[SCM] libav/experimental: proresenc: Reuse proper dsputil infrastructure for FDCT

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:01:44 UTC 2014


The following commit has been merged in the experimental branch:
commit a55546f48d55e3d1155840541b2be5f4f8cf18ab
Author: Diego Biurrun <diego at biurrun.de>
Date:   Thu Feb 27 14:49:55 2014 -0800

    proresenc: Reuse proper dsputil infrastructure for FDCT

diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c
index d7d4af0..51e3783 100644
--- a/libavcodec/proresenc.c
+++ b/libavcodec/proresenc.c
@@ -192,7 +192,9 @@ typedef struct ProresContext {
     const uint8_t *quant_mat;
     const uint8_t *scantable;
 
-    void (* fdct) (const uint16_t *src, int linesize, int16_t *block);
+    void (* fdct)(DSPContext *dsp, const uint16_t *src,
+                  int linesize, int16_t *block);
+    DSPContext dsp;
 
     int mb_width, mb_height;
     int mbs_per_slice;
@@ -261,27 +263,27 @@ static void get_slice_data(ProresContext *ctx, const uint16_t *src,
                        mb_width * sizeof(*emu_buf));
         }
         if (!is_chroma) {
-            ctx->fdct(esrc, elinesize, blocks);
+            ctx->fdct(&ctx->dsp, esrc, elinesize, blocks);
             blocks += 64;
             if (blocks_per_mb > 2) {
-                ctx->fdct(esrc + 8, elinesize, blocks);
+                ctx->fdct(&ctx->dsp, esrc + 8, elinesize, blocks);
                 blocks += 64;
             }
-            ctx->fdct(esrc + elinesize * 4, elinesize, blocks);
+            ctx->fdct(&ctx->dsp, esrc + elinesize * 4, elinesize, blocks);
             blocks += 64;
             if (blocks_per_mb > 2) {
-                ctx->fdct(esrc + elinesize * 4 + 8, elinesize, blocks);
+                ctx->fdct(&ctx->dsp, esrc + elinesize * 4 + 8, elinesize, blocks);
                 blocks += 64;
             }
         } else {
-            ctx->fdct(esrc, elinesize, blocks);
+            ctx->fdct(&ctx->dsp, esrc, elinesize, blocks);
             blocks += 64;
-            ctx->fdct(esrc + elinesize * 4, elinesize, blocks);
+            ctx->fdct(&ctx->dsp, esrc + elinesize * 4, elinesize, blocks);
             blocks += 64;
             if (blocks_per_mb > 2) {
-                ctx->fdct(esrc + 8, elinesize, blocks);
+                ctx->fdct(&ctx->dsp, esrc + 8, elinesize, blocks);
                 blocks += 64;
-                ctx->fdct(esrc + elinesize * 4 + 8, elinesize, blocks);
+                ctx->fdct(&ctx->dsp, esrc + elinesize * 4 + 8, elinesize, blocks);
                 blocks += 64;
             }
         }
@@ -1066,7 +1068,8 @@ static av_cold int encode_close(AVCodecContext *avctx)
     return 0;
 }
 
-static void prores_fdct(const uint16_t *src, int linesize, int16_t *block)
+static void prores_fdct(DSPContext *dsp, const uint16_t *src,
+                        int linesize, int16_t *block)
 {
     int x, y;
     const uint16_t *tsrc = src;
@@ -1076,7 +1079,7 @@ static void prores_fdct(const uint16_t *src, int linesize, int16_t *block)
             block[y * 8 + x] = tsrc[x];
         tsrc += linesize >> 1;
     }
-    ff_jpeg_fdct_islow_10(block);
+    dsp->fdct(block);
 }
 
 static av_cold int encode_init(AVCodecContext *avctx)
@@ -1095,6 +1098,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
     ctx->fdct      = prores_fdct;
     ctx->scantable = interlaced ? ff_prores_interlaced_scan
                                 : ff_prores_progressive_scan;
+    ff_dsputil_init(&ctx->dsp, avctx);
 
     mps = ctx->mbs_per_slice;
     if (mps & (mps - 1)) {

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list