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
46b06bd8
Commit
46b06bd8
authored
Dec 20, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpegvideo_enc: implement frame skip score normalization
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
21a2fb7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
codecs.texi
doc/codecs.texi
+3
-0
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+5
-2
No files found.
doc/codecs.texi
View file @
46b06bd8
...
...
@@ -877,6 +877,9 @@ Set frame skip factor.
@item skip_exp @var{integer} (@emph{encoding,video})
Set frame skip exponent.
Negative values behave identical to the corresponding positive ones, except
that the score is normalized.
Positive values exist primarly for compatibility reasons and are not so useful.
@item skipcmp @var{integer} (@emph{encoding,video})
Set frame skip compare function.
...
...
libavcodec/mpegvideo_enc.c
View file @
46b06bd8
...
...
@@ -1145,7 +1145,7 @@ static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)
uint8_t
*
rptr
=
ref
->
f
.
data
[
plane
]
+
8
*
(
x
+
y
*
stride
);
int
v
=
s
->
dsp
.
frame_skip_cmp
[
1
](
s
,
dptr
,
rptr
,
stride
,
8
);
switch
(
s
->
avctx
->
frame_skip_exp
)
{
switch
(
FFABS
(
s
->
avctx
->
frame_skip_exp
)
)
{
case
0
:
score
=
FFMAX
(
score
,
v
);
break
;
case
1
:
score
+=
FFABS
(
v
);
break
;
case
2
:
score64
+=
v
*
(
int64_t
)
v
;
break
;
...
...
@@ -1155,9 +1155,13 @@ static int skip_check(MpegEncContext *s, Picture *p, Picture *ref)
}
}
}
emms_c
();
if
(
score
)
score64
=
score
;
if
(
s
->
avctx
->
frame_skip_exp
<
0
)
score64
=
pow
(
score64
/
(
double
)(
s
->
mb_width
*
s
->
mb_height
),
-
1
.
0
/
s
->
avctx
->
frame_skip_exp
);
if
(
score64
<
s
->
avctx
->
frame_skip_threshold
)
return
1
;
...
...
@@ -1307,7 +1311,6 @@ static int select_input_picture(MpegEncContext *s)
// FIXME check that te gop check above is +-1 correct
av_frame_unref
(
&
s
->
input_picture
[
0
]
->
f
);
emms_c
();
ff_vbv_update
(
s
,
0
);
goto
no_output_pic
;
...
...
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