[FFmpeg-devel] [PATCH] avcodec/proresdec_lgpl: make use of BlockDSP

Paul B Mahol onemda at gmail.com
Mon Jun 26 20:34:32 EEST 2017


Signed-off-by: Paul B Mahol <onemda at gmail.com>
---
 libavcodec/proresdec_lgpl.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c
index bc5bdb5..e91abaf 100644
--- a/libavcodec/proresdec_lgpl.c
+++ b/libavcodec/proresdec_lgpl.c
@@ -34,6 +34,7 @@
 
 #include "libavutil/intmath.h"
 #include "avcodec.h"
+#include "blockdsp.h"
 #include "idctdsp.h"
 #include "internal.h"
 #include "proresdata.h"
@@ -52,6 +53,7 @@ typedef struct ProresThreadData {
 } ProresThreadData;
 
 typedef struct ProresContext {
+    BlockDSPContext bdsp;
     ProresDSPContext dsp;
     AVFrame    *frame;
     ScanTable  scantable;
@@ -86,6 +88,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
     ctx->slice_data       = NULL;
 
     avctx->bits_per_raw_sample = PRORES_BITS_PER_SAMPLE;
+    ff_blockdsp_init(&ctx->bdsp, avctx);
     ff_proresdsp_init(&ctx->dsp, avctx);
 
     ctx->scantable_type = -1;   // set scantable type to uninitialized
@@ -431,11 +434,12 @@ static int decode_slice_plane(ProresContext *ctx, ProresThreadData *td,
 {
     GetBitContext gb;
     int16_t *block_ptr;
-    int mb_num, blocks_per_slice, ret;
+    int i, mb_num, blocks_per_slice, ret;
 
     blocks_per_slice = mbs_per_slice * blocks_per_mb;
 
-    memset(td->blocks, 0, 8 * 4 * 64 * sizeof(*td->blocks));
+    for (i = 0; i < blocks_per_slice; i++)
+        ctx->bdsp.clear_block(td->blocks + (i << 6));
 
     init_get_bits(&gb, buf, data_size << 3);
 
-- 
2.9.3



More information about the ffmpeg-devel mailing list