[FFmpeg-cvslog] avcodec/proresenc_anatoliy: Use fdct from DSPContext instead of direct call.

Michael Niedermayer git at videolan.org
Fri May 30 18:56:37 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 30 18:03:22 2014 +0200| [63b4d6feb88309d3a47b666008fa00bc4dd32f10] | committer: Michael Niedermayer

avcodec/proresenc_anatoliy: Use fdct from DSPContext instead of direct call.

Based-on: a55546f48d55e3d1155840541b2be5f4f8cf18ab by Diego Biurrun
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=63b4d6feb88309d3a47b666008fa00bc4dd32f10
---

 libavcodec/proresenc_anatoliy.c |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c
index 6514862..391ffa9 100644
--- a/libavcodec/proresenc_anatoliy.c
+++ b/libavcodec/proresenc_anatoliy.c
@@ -145,6 +145,7 @@ static const uint8_t QMAT_CHROMA[4][64] = {
 
 
 typedef struct {
+    DSPContext dsp;
     uint8_t* fill_y;
     uint8_t* fill_u;
     uint8_t* fill_v;
@@ -276,27 +277,29 @@ static void get(uint8_t *pixels, int stride, int16_t* block)
     }
 }
 
-static void fdct_get(uint8_t *pixels, int stride, int16_t* block)
+static void fdct_get(DSPContext *dsp, uint8_t *pixels, int stride, int16_t* block)
 {
     get(pixels, stride, block);
-    ff_jpeg_fdct_islow_10(block);
+    dsp->fdct(block);
 }
 
 static int encode_slice_plane(AVCodecContext *avctx, int mb_count,
         uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size,
         int *qmat, int chroma)
 {
+    ProresContext* ctx = avctx->priv_data;
+    DSPContext *dsp = &ctx->dsp;
     DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block;
     int i, blocks_per_slice;
     PutBitContext pb;
 
     block = blocks;
     for (i = 0; i < mb_count; i++) {
-        fdct_get(src,                  src_stride, block + (0 << 6));
-        fdct_get(src + 8 * src_stride, src_stride, block + ((2 - chroma) << 6));
+        fdct_get(dsp, src,                  src_stride, block + (0 << 6));
+        fdct_get(dsp, src + 8 * src_stride, src_stride, block + ((2 - chroma) << 6));
         if (!chroma) {
-            fdct_get(src + 16,                  src_stride, block + (1 << 6));
-            fdct_get(src + 16 + 8 * src_stride, src_stride, block + (3 << 6));
+            fdct_get(dsp, src + 16,                  src_stride, block + (1 << 6));
+            fdct_get(dsp, src + 16 + 8 * src_stride, src_stride, block + (3 << 6));
         }
 
         block += (256 >> chroma);
@@ -576,6 +579,8 @@ static av_cold int prores_encode_init(AVCodecContext *avctx)
         return -1;
     }
 
+    ff_dsputil_init(&ctx->dsp, avctx);
+
     avctx->codec_tag = AV_RL32((const uint8_t*)profiles[avctx->profile].name);
 
     for (i = 1; i <= 16; i++) {



More information about the ffmpeg-cvslog mailing list