[FFmpeg-cvslog] h264: eliminate max_contexts

Anton Khirnov git at videolan.org
Tue Jun 21 11:29:45 CEST 2016


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Apr 13 17:33:59 2016 +0200| [2e5bde956519ae19cedfa482e199518e495bcaf5] | committer: Anton Khirnov

h264: eliminate max_contexts

It is always equal to nb_slice_ctx.

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

 libavcodec/h264.c       |    3 +--
 libavcodec/h264.h       |    8 --------
 libavcodec/h264_slice.c |    2 +-
 3 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index efecabf..50dea33 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -808,7 +808,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
     int nals_needed = 0; ///< number of NALs that need decoding before the next frame thread starts
     int i, ret = 0;
 
-    h->max_contexts = h->nb_slice_ctx;
     if (!(avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
         h->current_slice = 0;
         if (!h->first_field)
@@ -935,7 +934,7 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
                    nal->type, nal->size_bits);
         }
 
-        if (context_count == h->max_contexts) {
+        if (context_count == h->nb_slice_ctx) {
             ret = ff_h264_execute_decode_slices(h, context_count);
             if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
                 goto end;
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index cb38664..d1cd37d 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -584,14 +584,6 @@ typedef struct H264Context {
      */
     int current_slice;
 
-    /**
-     * Max number of threads / contexts.
-     * This is equal to AVCodecContext.thread_count unless
-     * multithreaded decoding is impossible, in which case it is
-     * reduced to 1.
-     */
-    int max_contexts;
-
     /** @} */
 
     /**
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index e0e3577..9eb493e 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -1462,7 +1462,7 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
          h->nal_ref_idc == 0))
         sl->deblocking_filter = 0;
 
-    if (sl->deblocking_filter == 1 && h->max_contexts > 1) {
+    if (sl->deblocking_filter == 1 && h->nb_slice_ctx > 1) {
         if (h->avctx->flags2 & AV_CODEC_FLAG2_FAST) {
             /* Cheat slightly for speed:
              * Do not bother to deblock across slices. */



More information about the ffmpeg-cvslog mailing list