Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
34fe125f
Commit
34fe125f
authored
Dec 20, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mpegvideo_enc: fix frame skipping with intra only codecs
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
241eccd6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
14 deletions
+17
-14
mpegvideo.c
libavcodec/mpegvideo.c
+3
-1
mpegvideo_enc.c
libavcodec/mpegvideo_enc.c
+14
-13
No files found.
libavcodec/mpegvideo.c
View file @
34fe125f
...
...
@@ -2655,7 +2655,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
else
if
(
!
is_mpeg12
&&
(
s
->
h263_pred
||
s
->
h263_aic
))
s
->
mbintra_table
[
mb_xy
]
=
1
;
if
((
s
->
flags
&
CODEC_FLAG_PSNR
)
||
!
(
s
->
encoding
&&
(
s
->
intra_only
||
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
&&
s
->
avctx
->
mb_decision
!=
FF_MB_DECISION_RD
))
{
//FIXME precalc
if
(
(
s
->
flags
&
CODEC_FLAG_PSNR
)
||
s
->
avctx
->
frame_skip_threshold
||
s
->
avctx
->
frame_skip_factor
||
!
(
s
->
encoding
&&
(
s
->
intra_only
||
s
->
pict_type
==
AV_PICTURE_TYPE_B
)
&&
s
->
avctx
->
mb_decision
!=
FF_MB_DECISION_RD
))
{
//FIXME precalc
uint8_t
*
dest_y
,
*
dest_cb
,
*
dest_cr
;
int
dct_linesize
,
dct_offset
;
op_pixels_func
(
*
op_pix
)[
4
];
...
...
libavcodec/mpegvideo_enc.c
View file @
34fe125f
...
...
@@ -1300,6 +1300,20 @@ static int select_input_picture(MpegEncContext *s)
/* set next picture type & ordering */
if
(
s
->
reordered_input_picture
[
0
]
==
NULL
&&
s
->
input_picture
[
0
])
{
if
(
s
->
avctx
->
frame_skip_threshold
||
s
->
avctx
->
frame_skip_factor
)
{
if
(
s
->
picture_in_gop_number
<
s
->
gop_size
&&
s
->
next_picture_ptr
&&
skip_check
(
s
,
s
->
input_picture
[
0
],
s
->
next_picture_ptr
))
{
// 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
;
}
}
if
(
/*s->picture_in_gop_number >= s->gop_size ||*/
s
->
next_picture_ptr
==
NULL
||
s
->
intra_only
)
{
s
->
reordered_input_picture
[
0
]
=
s
->
input_picture
[
0
];
...
...
@@ -1309,19 +1323,6 @@ static int select_input_picture(MpegEncContext *s)
}
else
{
int
b_frames
;
if
(
s
->
avctx
->
frame_skip_threshold
||
s
->
avctx
->
frame_skip_factor
)
{
if
(
s
->
picture_in_gop_number
<
s
->
gop_size
&&
skip_check
(
s
,
s
->
input_picture
[
0
],
s
->
next_picture_ptr
))
{
// 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
;
}
}
if
(
s
->
flags
&
CODEC_FLAG_PASS2
)
{
for
(
i
=
0
;
i
<
s
->
max_b_frames
+
1
;
i
++
)
{
int
pict_num
=
s
->
input_picture
[
0
]
->
f
.
display_picture_number
+
i
;
...
...
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