Merge commit '5bf3c0fa49afd5bbf43aa841ff78007d72c80736'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 20:41:17 +0000 (21:41 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 20:41:17 +0000 (21:41 +0100)
* commit '5bf3c0fa49afd5bbf43aa841ff78007d72c80736':
  h264: drop the now unused per-slice H264Contexts

Conflicts:
libavcodec/h264_slice.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_parser.c
libavcodec/h264_slice.c

Simple merge
@@@ -651,10 -608,8 +651,8 @@@ typedef struct H264Context 
       * @name Members for slice based multithreading
       * @{
       */
-     struct H264Context *thread_context[H264_MAX_THREADS];
      /**
 -     * current slice number, used to initalize slice_num of each thread/context
 +     * current slice number, used to initialize slice_num of each thread/context
       */
      int current_slice;
  
Simple merge
@@@ -589,10 -509,8 +564,9 @@@ int ff_h264_update_thread_context(AVCod
              av_log(dst, AV_LOG_ERROR, "context_init() failed.\n");
              return ret;
          }
 +        }
  
-         h->thread_context[0] = h;
 -        h->context_initialized = 1;
 +        h->context_initialized = h1->context_initialized;
      }
  
      h->avctx->coded_height  = h1->avctx->coded_height;
@@@ -1173,53 -1043,22 +1147,22 @@@ static int h264_slice_header_init(H264C
          ret = ff_h264_slice_context_init(h, &h->slice_ctx[0]);
          if (ret < 0) {
              av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
 -            return ret;
 +            goto fail;
          }
      } else {
-         for (i = 1; i < h->slice_context_count; i++) {
-             H264Context *c;
-             c                    = h->thread_context[i] = av_mallocz(sizeof(H264Context));
-             if (!c) {
-                 ret = AVERROR(ENOMEM);
-                 goto fail;
-             }
-             c->avctx             = h->avctx;
-             c->vdsp              = h->vdsp;
-             c->h264dsp           = h->h264dsp;
-             c->h264qpel          = h->h264qpel;
-             c->h264chroma        = h->h264chroma;
-             c->sps               = h->sps;
-             c->pps               = h->pps;
-             c->pixel_shift       = h->pixel_shift;
-             c->cur_chroma_format_idc = h->cur_chroma_format_idc;
-             c->width             = h->width;
-             c->height            = h->height;
-             c->linesize          = h->linesize;
-             c->uvlinesize        = h->uvlinesize;
-             c->chroma_x_shift    = h->chroma_x_shift;
-             c->chroma_y_shift    = h->chroma_y_shift;
-             c->droppable         = h->droppable;
-             c->low_delay         = h->low_delay;
-             c->mb_width          = h->mb_width;
-             c->mb_height         = h->mb_height;
-             c->mb_stride         = h->mb_stride;
-             c->mb_num            = h->mb_num;
-             c->flags             = h->flags;
-             c->workaround_bugs   = h->workaround_bugs;
-             c->pict_type         = h->pict_type;
-             h->slice_ctx[i].h264 = c;
-             init_scan_tables(c);
-             clone_tables(c, &h->slice_ctx[i], h, i);
-             c->context_initialized = 1;
-         }
+         for (i = 0; i < h->slice_context_count; i++) {
+             H264SliceContext *sl = &h->slice_ctx[i];
+             sl->h264               = h;
+             sl->intra4x4_pred_mode = h->intra4x4_pred_mode + i * 8 * 2 * h->mb_stride;
+             sl->mvd_table[0]       = h->mvd_table[0]       + i * 8 * 2 * h->mb_stride;
+             sl->mvd_table[1]       = h->mvd_table[1]       + i * 8 * 2 * h->mb_stride;
  
-         for (i = 0; i < h->slice_context_count; i++)
-             if ((ret = ff_h264_slice_context_init(h, &h->slice_ctx[i])) < 0) {
+             if ((ret = ff_h264_slice_context_init(h, sl)) < 0) {
                  av_log(h->avctx, AV_LOG_ERROR, "context_init() failed.\n");
 -                return ret;
 +                goto fail;
              }
+         }
      }
  
      h->context_initialized = 1;