[FFmpeg-cvslog] aic: add frame threading support

Paul B Mahol git at videolan.org
Wed Jun 29 11:07:36 CEST 2016


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Jun  1 15:46:49 2016 -0400| [6e2ad28cf76461b02d85ad178087ba0c628b8d9d] | committer: Vittorio Giovara

aic: add frame threading support

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/aic.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aic.c b/libavcodec/aic.c
index 9ea27a7..7c6dddd 100644
--- a/libavcodec/aic.c
+++ b/libavcodec/aic.c
@@ -28,6 +28,7 @@
 #include "get_bits.h"
 #include "golomb.h"
 #include "idctdsp.h"
+#include "thread.h"
 #include "unary.h"
 
 #define AIC_HDR_SIZE    24
@@ -373,6 +374,7 @@ static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
     uint32_t off;
     int x, y, ret;
     int slice_size;
+    ThreadFrame frame = { .f = data };
 
     ctx->frame            = data;
     ctx->frame->pict_type = AV_PICTURE_TYPE_I;
@@ -391,7 +393,7 @@ static int aic_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
         return ret;
     }
 
-    if ((ret = ff_get_buffer(avctx, ctx->frame, 0)) < 0)
+    if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
         return ret;
 
     bytestream2_init(&gb, buf + AIC_HDR_SIZE,
@@ -484,5 +486,6 @@ AVCodec ff_aic_decoder = {
     .init           = aic_decode_init,
     .close          = aic_decode_close,
     .decode         = aic_decode_frame,
-    .capabilities   = AV_CODEC_CAP_DR1,
+    .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
+    .init_thread_copy = ONLY_IF_THREADS_ENABLED(aic_decode_init),
 };



More information about the ffmpeg-cvslog mailing list