1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

avcodec/mpegvideo_enc: Combine some checks

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2021-12-13 13:57:14 +01:00
parent 090cd1394f
commit 9f906f3114

View File

@@ -3520,7 +3520,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
/* we need to initialize some time vars before we can encode B-frames */ /* we need to initialize some time vars before we can encode B-frames */
// RAL: Condition added for MPEG1VIDEO // RAL: Condition added for MPEG1VIDEO
if (s->codec_id == AV_CODEC_ID_MPEG1VIDEO || s->codec_id == AV_CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->msmpeg4_version)) if (s->out_format == FMT_MPEG1 || (s->h263_pred && !s->msmpeg4_version))
set_frame_distances(s); set_frame_distances(s);
if(CONFIG_MPEG4_ENCODER && s->codec_id == AV_CODEC_ID_MPEG4) if(CONFIG_MPEG4_ENCODER && s->codec_id == AV_CODEC_ID_MPEG4)
ff_set_mpeg4_time(s); ff_set_mpeg4_time(s);
@@ -3549,7 +3549,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
update_qscale(s); update_qscale(s);
} }
if(s->codec_id != AV_CODEC_ID_AMV && s->codec_id != AV_CODEC_ID_MJPEG){ if (s->out_format != FMT_MJPEG) {
if(s->q_chroma_intra_matrix != s->q_intra_matrix ) av_freep(&s->q_chroma_intra_matrix); if(s->q_chroma_intra_matrix != s->q_intra_matrix ) av_freep(&s->q_chroma_intra_matrix);
if(s->q_chroma_intra_matrix16 != s->q_intra_matrix16) av_freep(&s->q_chroma_intra_matrix16); if(s->q_chroma_intra_matrix16 != s->q_intra_matrix16) av_freep(&s->q_chroma_intra_matrix16);
s->q_chroma_intra_matrix = s->q_intra_matrix; s->q_chroma_intra_matrix = s->q_intra_matrix;