1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/mpeg4videodec,h263dec: Only set skipped_last_frame for !vop_coded

This is more in line with the spec and avoids a branch.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-05-01 22:31:36 +02:00
parent c37fb99abb
commit 2865ebd1fb
2 changed files with 3 additions and 1 deletions

View File

@ -463,7 +463,6 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict,
#endif #endif
} else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) { } else if (CONFIG_MPEG4_DECODER && avctx->codec_id == AV_CODEC_ID_MPEG4) {
ret = ff_mpeg4_decode_picture_header(s); ret = ff_mpeg4_decode_picture_header(s);
s->skipped_last_frame = (ret == FRAME_SKIPPED);
} else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) { } else if (CONFIG_H263I_DECODER && s->codec_id == AV_CODEC_ID_H263I) {
ret = ff_intel_h263_decode_picture_header(s); ret = ff_intel_h263_decode_picture_header(s);
} else if (CONFIG_FLV_DECODER && s->h263_flv) { } else if (CONFIG_FLV_DECODER && s->h263_flv) {

View File

@ -3265,6 +3265,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb,
if (get_bits1(gb) != 1) { if (get_bits1(gb) != 1) {
if (s->avctx->debug & FF_DEBUG_PICT_INFO) if (s->avctx->debug & FF_DEBUG_PICT_INFO)
av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n"); av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
s->skipped_last_frame = 1;
return FRAME_SKIPPED; return FRAME_SKIPPED;
} }
if (ctx->new_pred) if (ctx->new_pred)
@ -3691,6 +3692,8 @@ int ff_mpeg4_decode_picture_header(MpegEncContext *s)
{ {
Mpeg4DecContext *const ctx = (Mpeg4DecContext*)s; Mpeg4DecContext *const ctx = (Mpeg4DecContext*)s;
s->skipped_last_frame = 0;
if (ctx->bitstream_buffer) { if (ctx->bitstream_buffer) {
int buf_size = get_bits_left(&s->gb) / 8U; int buf_size = get_bits_left(&s->gb) / 8U;
int bitstream_buffer_size = ctx->bitstream_buffer->size; int bitstream_buffer_size = ctx->bitstream_buffer->size;