]> git.sesse.net Git - ffmpeg/commitdiff
h264: eliminate max_contexts
authorAnton Khirnov <anton@khirnov.net>
Wed, 13 Apr 2016 15:33:59 +0000 (17:33 +0200)
committerAnton Khirnov <anton@khirnov.net>
Sun, 24 Apr 2016 08:06:25 +0000 (10:06 +0200)
It is always equal to nb_slice_ctx.

libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_slice.c

index efecabf8b613139b63d14469d03ce2895deb8d1e..50dea33ef1ee029988fa9a35d08ef8b1e9cac536 100644 (file)
@@ -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;
index cb38664ba1592c07a86b30e941340018b60e16e7..d1cd37dee9a25b3d83ceeb1a53c53f4ae92a21cb 100644 (file)
@@ -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;
-
     /** @} */
 
     /**
index e0e3577223ef14452fdbfb1de988c8b4cb1a943e..9eb493ed69dcca6215fc305f03bdb8f06a0ec6a7 100644 (file)
@@ -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. */