Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d4c5d2ad
Commit
d4c5d2ad
authored
Jun 07, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsse weight
Originally committed as revision 3205 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
e6a2ac34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
12 deletions
+21
-12
avcodec.h
libavcodec/avcodec.h
+9
-2
dsputil.c
libavcodec/dsputil.c
+8
-6
motion_est.c
libavcodec/motion_est.c
+1
-1
mpegvideo.c
libavcodec/mpegvideo.c
+3
-3
No files found.
libavcodec/avcodec.h
View file @
d4c5d2ad
...
...
@@ -17,7 +17,7 @@ extern "C" {
#define FFMPEG_VERSION_INT 0x000408
#define FFMPEG_VERSION "0.4.8"
#define LIBAVCODEC_BUILD 471
5
#define LIBAVCODEC_BUILD 471
6
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
#define LIBAVCODEC_VERSION FFMPEG_VERSION
...
...
@@ -1591,11 +1591,18 @@ typedef struct AVCodecContext {
int
mb_threshold
;
/**
*
*
precision of the intra dc coefficient - 8.
* - encoding: set by user
* - decoding: unused
*/
int
intra_dc_precision
;
/**
* noise vs. sse weight for the nsse comparsion function.
* - encoding: set by user
* - decoding: unused
*/
int
nsse_weight
;
}
AVCodecContext
;
...
...
libavcodec/dsputil.c
View file @
d4c5d2ad
...
...
@@ -2587,11 +2587,11 @@ static int pix_abs8_xy2_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size,
return
s
;
}
static
int
nsse16_c
(
/*MpegEncContext*/
void
*
c
,
uint8_t
*
s1
,
uint8_t
*
s2
,
int
stride
,
int
h
){
static
int
nsse16_c
(
MpegEncContext
*
c
,
uint8_t
*
s1
,
uint8_t
*
s2
,
int
stride
,
int
h
){
int
score1
=
0
;
int
score2
=
0
;
int
x
,
y
;
for
(
y
=
0
;
y
<
h
;
y
++
){
for
(
x
=
0
;
x
<
16
;
x
++
){
score1
+=
(
s1
[
x
]
-
s2
[
x
])
*
(
s1
[
x
]
-
s2
[
x
]);
...
...
@@ -2607,11 +2607,12 @@ static int nsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int st
s1
+=
stride
;
s2
+=
stride
;
}
return
score1
+
ABS
(
score2
)
*
8
;
if
(
c
)
return
score1
+
ABS
(
score2
)
*
c
->
avctx
->
nsse_weight
;
else
return
score1
+
ABS
(
score2
)
*
8
;
}
static
int
nsse8_c
(
/*MpegEncContext*/
void
*
c
,
uint8_t
*
s1
,
uint8_t
*
s2
,
int
stride
,
int
h
){
static
int
nsse8_c
(
MpegEncContext
*
c
,
uint8_t
*
s1
,
uint8_t
*
s2
,
int
stride
,
int
h
){
int
score1
=
0
;
int
score2
=
0
;
int
x
,
y
;
...
...
@@ -2632,7 +2633,8 @@ static int nsse8_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int str
s2
+=
stride
;
}
return
score1
+
ABS
(
score2
)
*
8
;
if
(
c
)
return
score1
+
ABS
(
score2
)
*
c
->
avctx
->
nsse_weight
;
else
return
score1
+
ABS
(
score2
)
*
8
;
}
static
int
try_8x8basis_c
(
int16_t
rem
[
64
],
int16_t
weight
[
64
],
int16_t
basis
[
64
],
int
scale
){
...
...
libavcodec/motion_est.c
View file @
d4c5d2ad
...
...
@@ -223,7 +223,6 @@ static inline int get_penalty_factor(MpegEncContext *s, int type){
switch
(
type
&
0xFF
){
default
:
case
FF_CMP_SAD
:
case
FF_CMP_NSSE
:
return
s
->
lambda
>>
FF_LAMBDA_SHIFT
;
case
FF_CMP_DCT
:
return
(
3
*
s
->
lambda
)
>>
(
FF_LAMBDA_SHIFT
+
1
);
...
...
@@ -232,6 +231,7 @@ static inline int get_penalty_factor(MpegEncContext *s, int type){
case
FF_CMP_RD
:
case
FF_CMP_PSNR
:
case
FF_CMP_SSE
:
case
FF_CMP_NSSE
:
return
s
->
lambda2
>>
FF_LAMBDA_SHIFT
;
case
FF_CMP_BIT
:
return
1
;
...
...
libavcodec/mpegvideo.c
View file @
d4c5d2ad
...
...
@@ -3917,9 +3917,9 @@ static int sse_mb(MpegEncContext *s){
if
(
w
==
16
&&
h
==
16
)
if
(
s
->
avctx
->
mb_cmp
==
FF_CMP_NSSE
){
return
s
->
dsp
.
nsse
[
0
](
NULL
,
s
->
new_picture
.
data
[
0
]
+
s
->
mb_x
*
16
+
s
->
mb_y
*
s
->
linesize
*
16
,
s
->
dest
[
0
],
s
->
linesize
,
16
)
+
s
->
dsp
.
nsse
[
1
](
NULL
,
s
->
new_picture
.
data
[
1
]
+
s
->
mb_x
*
8
+
s
->
mb_y
*
s
->
uvlinesize
*
8
,
s
->
dest
[
1
],
s
->
uvlinesize
,
8
)
+
s
->
dsp
.
nsse
[
1
](
NULL
,
s
->
new_picture
.
data
[
2
]
+
s
->
mb_x
*
8
+
s
->
mb_y
*
s
->
uvlinesize
*
8
,
s
->
dest
[
2
],
s
->
uvlinesize
,
8
);
return
s
->
dsp
.
nsse
[
0
](
s
,
s
->
new_picture
.
data
[
0
]
+
s
->
mb_x
*
16
+
s
->
mb_y
*
s
->
linesize
*
16
,
s
->
dest
[
0
],
s
->
linesize
,
16
)
+
s
->
dsp
.
nsse
[
1
](
s
,
s
->
new_picture
.
data
[
1
]
+
s
->
mb_x
*
8
+
s
->
mb_y
*
s
->
uvlinesize
*
8
,
s
->
dest
[
1
],
s
->
uvlinesize
,
8
)
+
s
->
dsp
.
nsse
[
1
](
s
,
s
->
new_picture
.
data
[
2
]
+
s
->
mb_x
*
8
+
s
->
mb_y
*
s
->
uvlinesize
*
8
,
s
->
dest
[
2
],
s
->
uvlinesize
,
8
);
}
else
{
return
s
->
dsp
.
sse
[
0
](
NULL
,
s
->
new_picture
.
data
[
0
]
+
s
->
mb_x
*
16
+
s
->
mb_y
*
s
->
linesize
*
16
,
s
->
dest
[
0
],
s
->
linesize
,
16
)
+
s
->
dsp
.
sse
[
1
](
NULL
,
s
->
new_picture
.
data
[
1
]
+
s
->
mb_x
*
8
+
s
->
mb_y
*
s
->
uvlinesize
*
8
,
s
->
dest
[
1
],
s
->
uvlinesize
,
8
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment