[FFmpeg-cvslog] avcodec/huffyuvenc: frame multi-threading support

Michael Niedermayer git at videolan.org
Tue Jan 28 15:13:11 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jan 28 04:02:35 2014 +0100| [bb7a7111562b3c488be2ee1c41a39a913eed6497] | committer: Michael Niedermayer

avcodec/huffyuvenc: frame multi-threading support

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/frame_thread_encoder.c |    7 +++++++
 libavcodec/huffyuvenc.c           |    2 ++
 libavcodec/version.h              |    2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libavcodec/frame_thread_encoder.c b/libavcodec/frame_thread_encoder.c
index b9acefc..687f23a 100644
--- a/libavcodec/frame_thread_encoder.c
+++ b/libavcodec/frame_thread_encoder.c
@@ -133,6 +133,13 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
     if(avctx->thread_count <= 1)
         return 0;
 
+    if (avctx->codec_id == AV_CODEC_ID_HUFFYUV ||
+        avctx->codec_id == AV_CODEC_ID_FFVHUFF) {
+        // huffyuv doesnt support these with multiple frame threads currently
+        if (avctx->context_model > 0 || (avctx->flags & CODEC_FLAG_PASS1))
+            return 0;
+    }
+
     if(avctx->thread_count > MAX_THREADS)
         return AVERROR(EINVAL);
 
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index 3cb7293..2a69cc0 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -996,6 +996,7 @@ AVCodec ff_huffyuv_encoder = {
     .init           = encode_init,
     .encode2        = encode_frame,
     .close          = encode_end,
+    .capabilities   = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
     .pix_fmts       = (const enum AVPixelFormat[]){
         AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24,
         AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
@@ -1013,6 +1014,7 @@ AVCodec ff_ffvhuff_encoder = {
     .init           = encode_init,
     .encode2        = encode_frame,
     .close          = encode_end,
+    .capabilities   = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY,
     .pix_fmts       = (const enum AVPixelFormat[]){
         AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P,
         AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 27fd39e..c56a957 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -30,7 +30,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR 55
 #define LIBAVCODEC_VERSION_MINOR  49
-#define LIBAVCODEC_VERSION_MICRO 100
+#define LIBAVCODEC_VERSION_MICRO 101
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \



More information about the ffmpeg-cvslog mailing list