---
 doc/multithreading.txt  |    2 +-
 libavcodec/avcodec.h    |   10 +++++-----
 libavcodec/beosthread.c |    4 ++--
 libavcodec/os2thread.c  |    4 ++--
 libavcodec/pthread.c    |    8 ++++----
 libavcodec/thread.h     |    6 +++---
 libavcodec/utils.c      |    8 ++++----
 libavcodec/w32thread.c  |    4 ++--
 8 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/doc/multithreading.txt b/doc/multithreading.txt
index 9b9ea2d..e9433d9 100644
--- a/doc/multithreading.txt
+++ b/doc/multithreading.txt
@@ -2,7 +2,7 @@ FFmpeg multithreading methods
 ==============================================
 
 FFmpeg provides two methods for multithreading codecs, controlled by
-AVCodecContext thread_algorithm:
+AVCodecContext thread_type:
 
 Slice threading decodes multiple parts of a frame at the same time, using
 execute().
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index f5102f0..c4c772f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2263,17 +2263,17 @@ typedef struct AVCodecContext {
      * - encoding: Set by user, otherwise the default is used.
      * - decoding: Set by user, otherwise the default is used.
      */
-    int thread_algorithm;
-#define FF_THREAD_MULTIFRAME 1 //< Decode more than one frame at once
-#define FF_THREAD_MULTISLICE 2 //< Decode more than one part of a single frame at once
-#define FF_THREAD_DEFAULT    3 //< Use both if possible.
+    int thread_type;
+#define FF_THREAD_FRAME   1 //< Decode more than one frame at once
+#define FF_THREAD_SLICE   2 //< Decode more than one part of a single frame at once
+#define FF_THREAD_DEFAULT 3 //< Use both if possible.
 
     /**
      * Which multithreading methods are actually active at the moment.
      * - encoding: Set by libavcodec.
      * - decoding: Set by libavcodec.
      */
-    int active_thread_algorithm;
+    int active_thread_type;
 } AVCodecContext;
 
 /**
diff --git a/libavcodec/beosthread.c b/libavcodec/beosthread.c
index a403278..b0d1daa 100644
--- a/libavcodec/beosthread.c
+++ b/libavcodec/beosthread.c
@@ -121,13 +121,13 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){
     int i;
     ThreadContext *c;
 
-    if(!(s->thread_algorithm & FF_THREAD_MULTISLICE)){
+    if(!(s->thread_type & FF_THREAD_SLICE)){
         av_log(s, AV_LOG_WARNING, "The requested thread algorithm is not supported with this thread library.\n");
         return 0;
     }
 
     s->thread_count= thread_count;
-    s->active_thread_algorithm= FF_THREAD_MULTISLICE;
+    s->active_thread_type= FF_THREAD_SLICE;
 
     assert(!s->thread_opaque);
     c= av_mallocz(sizeof(ThreadContext)*thread_count);
diff --git a/libavcodec/os2thread.c b/libavcodec/os2thread.c
index e06d7f6..8e93a78 100644
--- a/libavcodec/os2thread.c
+++ b/libavcodec/os2thread.c
@@ -114,13 +114,13 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){
     ThreadContext *c;
     uint32_t threadid;
 
-    if(!(s->thread_algorithm & FF_THREAD_MULTISLICE)){
+    if(!(s->thread_type & FF_THREAD_SLICE)){
         av_log(s, AV_LOG_WARNING, "The requested thread algorithm is not supported with this thread library.\n");
         return 0;
     }
 
     s->thread_count= thread_count;
-    s->active_thread_algorithm= FF_THREAD_MULTISLICE;
+    s->active_thread_type= FF_THREAD_SLICE;
 
     assert(!s->thread_opaque);
     c= av_mallocz(sizeof(ThreadContext)*thread_count);
diff --git a/libavcodec/pthread.c b/libavcodec/pthread.c
index 99a029c..5c947b9 100644
--- a/libavcodec/pthread.c
+++ b/libavcodec/pthread.c
@@ -678,11 +678,11 @@ static void validate_thread_parameters(AVCodecContext *avctx)
                                 && !(avctx->flags & CODEC_FLAG_LOW_DELAY)
                                 && !(avctx->flags2 & CODEC_FLAG2_CHUNKS);
     if (avctx->thread_count <= 1)
-        avctx->active_thread_algorithm = 0;
-    else if (frame_threading_supported && (avctx->thread_algorithm & FF_THREAD_MULTIFRAME))
-        avctx->active_thread_algorithm = FF_THREAD_MULTIFRAME;
+        avctx->active_thread_type = 0;
+    else if (frame_threading_supported && (avctx->thread_type & FF_THREAD_FRAME))
+        avctx->active_thread_type = FF_THREAD_FRAME;
     else
-        avctx->active_thread_algorithm = FF_THREAD_MULTISLICE;
+        avctx->active_thread_type = FF_THREAD_SLICE;
 }
 
 int avcodec_thread_init(AVCodecContext *avctx, int thread_count)
diff --git a/libavcodec/thread.h b/libavcodec/thread.h
index a611df7..cd05cd3 100644
--- a/libavcodec/thread.h
+++ b/libavcodec/thread.h
@@ -104,9 +104,9 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *f);
 void ff_release_buffer(AVCodecContext *avctx, AVFrame *f);
 
 ///True if frame threading is active.
-#define USE_FRAME_THREADING(avctx) (avctx->active_thread_algorithm == FF_THREAD_MULTIFRAME)
+#define USE_FRAME_THREADING(avctx) (avctx->active_thread_type == FF_THREAD_FRAME)
 ///True if calling AVCodecContext execute() will run in parallel.
-#define USE_AVCODEC_EXECUTE(avctx) (avctx->active_thread_algorithm == FF_THREAD_MULTISLICE)
+#define USE_AVCODEC_EXECUTE(avctx) (avctx->active_thread_type == FF_THREAD_SLICE)
 
 #else
 
@@ -129,7 +129,7 @@ static inline void ff_release_buffer(AVCodecContext *avctx, AVFrame *f)
 }
 
 #define USE_FRAME_THREADING(avctx) 0
-#define USE_AVCODEC_EXECUTE(avctx) (ENABLE_THREADS && avctx->active_thread_algorithm)
+#define USE_AVCODEC_EXECUTE(avctx) (ENABLE_THREADS && avctx->active_thread_type)
 
 #endif
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 0a56c6f..9a283a5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -734,9 +734,9 @@ static const AVOption options[]={
 {"request_channels", "set desired number of audio channels", OFFSET(request_channels), FF_OPT_TYPE_INT, DEFAULT, 0, INT_MAX, A|D},
 {"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), FF_OPT_TYPE_FLOAT, 1.0, 0.0, 1.0, A|D},
 {"reservoir", "use bit reservoir", 0, FF_OPT_TYPE_CONST, CODEC_FLAG2_BIT_RESERVOIR, INT_MIN, INT_MAX, A|E, "flags2"},
-{"thread_algorithm", "select multithreading type", OFFSET(thread_algorithm), FF_OPT_TYPE_INT, FF_THREAD_DEFAULT, 0, INT_MAX, V|E|D, "thread_algorithm"},
-{"slice", NULL, 0, FF_OPT_TYPE_CONST, FF_THREAD_MULTISLICE, INT_MIN, INT_MAX, V|E|D, "thread_algorithm"},
-{"frame", NULL, 0, FF_OPT_TYPE_CONST, FF_THREAD_MULTIFRAME, INT_MIN, INT_MAX, V|E|D, "thread_algorithm"},
+{"thread_type", "select multithreading type", OFFSET(thread_type), FF_OPT_TYPE_INT, FF_THREAD_DEFAULT, 0, INT_MAX, V|E|D, "thread_type"},
+{"slice", NULL, 0, FF_OPT_TYPE_CONST, FF_THREAD_SLICE, INT_MIN, INT_MAX, V|E|D, "thread_type"},
+{"frame", NULL, 0, FF_OPT_TYPE_CONST, FF_THREAD_FRAME, INT_MIN, INT_MAX, V|E|D, "thread_type"},
 {NULL},
 };
 
@@ -1011,7 +1011,7 @@ int avcodec_close(AVCodecContext *avctx)
     av_freep(&avctx->priv_data);
     av_freep(&avctx->rc_eq);
     avctx->codec = NULL;
-    avctx->active_thread_algorithm = 0;
+    avctx->active_thread_type = 0;
     entangled_thread_counter--;
     return 0;
 }
diff --git a/libavcodec/w32thread.c b/libavcodec/w32thread.c
index 31c0b8d..ff4156f 100644
--- a/libavcodec/w32thread.c
+++ b/libavcodec/w32thread.c
@@ -104,13 +104,13 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count){
     ThreadContext *c;
     uint32_t threadid;
 
-    if(!(s->thread_algorithm & FF_THREAD_MULTISLICE)){
+    if(!(s->thread_type & FF_THREAD_SLICE)){
         av_log(s, AV_LOG_WARNING, "The requested thread algorithm is not supported with this thread library.\n");
         return 0;
     }
 
     s->thread_count= thread_count;
-    s->active_thread_algorithm= FF_THREAD_MULTISLICE;
+    s->active_thread_type= FF_THREAD_SLICE;
 
     assert(!s->thread_opaque);
     c= av_mallocz(sizeof(ThreadContext)*thread_count);
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to