[FFmpeg-cvslog] avcodec/mpv_reconstruct_mb_template: Optimize always-true branch away
Andreas Rheinhardt
git at videolan.org
Thu Jun 20 20:00:57 EEST 2024
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jun 11 13:36:40 2024 +0200| [2e5287e519dc0f99ade473096c9b6742f0d8114b] | committer: Andreas Rheinhardt
avcodec/mpv_reconstruct_mb_template: Optimize always-true branch away
There are only two mpegvideo decoders that use another
(software) pixel format than YUV420: MPEG-1/2 and
the MPEG-4 studio profile. Neither of these use this part
of the code, so one can optimize the 422 code away when
this code is compiled for the decoder.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e5287e519dc0f99ade473096c9b6742f0d8114b
---
libavcodec/mpv_reconstruct_mb_template.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/mpv_reconstruct_mb_template.c b/libavcodec/mpv_reconstruct_mb_template.c
index e39b3d0e73..257767e80b 100644
--- a/libavcodec/mpv_reconstruct_mb_template.c
+++ b/libavcodec/mpv_reconstruct_mb_template.c
@@ -172,7 +172,8 @@ void mpv_reconstruct_mb_internal(MpegEncContext *s, int16_t block[12][64],
add_dequant_dct(s, block[3], 3, dest_y + dct_offset + block_size, dct_linesize, s->qscale);
if (!CONFIG_GRAY || !(s->avctx->flags & AV_CODEC_FLAG_GRAY)) {
- if (s->chroma_y_shift) {
+ av_assert2(IS_ENCODER || s->chroma_y_shift);
+ if (!IS_ENCODER || s->chroma_y_shift) {
add_dequant_dct(s, block[4], 4, dest_cb, uvlinesize, s->chroma_qscale);
add_dequant_dct(s, block[5], 5, dest_cr, uvlinesize, s->chroma_qscale);
} else {
More information about the ffmpeg-cvslog
mailing list