aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h263dec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-02 07:22:48 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2024-06-20 18:58:38 +0200
commit18f1aca3e8ac550a83a293cb0a210f9df1a8a5d1 (patch)
tree650654dc44e8c4722a7e12e783239d47303290b0 /libavcodec/h263dec.c
parent091d00663721d28d926a835d554c2f7dfdd064b6 (diff)
downloadffmpeg-18f1aca3e8ac550a83a293cb0a210f9df1a8a5d1.tar.gz
avcodec/mpegvideo_dec: Set dct_unquantize ptrs only once when possible
Everything except dct_unquantize_intra for MPEG-4 need only be set once. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r--libavcodec/h263dec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index eee7978452..666675fcf1 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -110,6 +110,9 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
avctx->chroma_sample_location = AVCHROMA_LOC_CENTER;
break;
case AV_CODEC_ID_MPEG4:
+ // dct_unquantize_inter is only used with MPEG-2 quantizers,
+ // so we can already set dct_unquantize_inter here once and for all.
+ s->dct_unquantize_inter = s->dct_unquantize_mpeg2_inter;
break;
case AV_CODEC_ID_MSMPEG4V1:
s->h263_pred = 1;
@@ -523,6 +526,11 @@ retry:
goto retry;
if (s->studio_profile != (s->idsp.idct == NULL))
ff_mpv_idct_init(s);
+ if (s->mpeg_quant) {
+ s->dct_unquantize_intra = s->dct_unquantize_mpeg2_intra;
+ } else {
+ s->dct_unquantize_intra = s->dct_unquantize_h263_intra;
+ }
}
/* After H.263 & MPEG-4 header decode we have the height, width,