]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/idctdsp.c
avcodec/prosumer: Only scan as many elements as matter in fill_elements()
[ffmpeg] / libavcodec / idctdsp.c
index 1de372d2b9e267de519ef04cdfca79061b4c402f..846ed0b0f8322315d9f20b70bee18f6bb61b1af7 100644 (file)
@@ -256,9 +256,17 @@ av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
         c->perm_type = FF_IDCT_PERM_NONE;
     } else {
         if (avctx->bits_per_raw_sample == 10 || avctx->bits_per_raw_sample == 9) {
-            c->idct_put              = ff_simple_idct_put_int16_10bit;
-            c->idct_add              = ff_simple_idct_add_int16_10bit;
-            c->idct                  = ff_simple_idct_int16_10bit;
+            /* 10-bit MPEG-4 Simple Studio Profile requires a higher precision IDCT
+               However, it only uses idct_put */
+            if (c->mpeg4_studio_profile) {
+                c->idct_put              = ff_simple_idct_put_int32_10bit;
+                c->idct_add              = NULL;
+                c->idct                  = NULL;
+            } else {
+                c->idct_put              = ff_simple_idct_put_int16_10bit;
+                c->idct_add              = ff_simple_idct_add_int16_10bit;
+                c->idct                  = ff_simple_idct_int16_10bit;
+            }
             c->perm_type             = FF_IDCT_PERM_NONE;
         } else if (avctx->bits_per_raw_sample == 12) {
             c->idct_put              = ff_simple_idct_put_int16_12bit;