Merge commit 'bc7f4268514624e1286ea76d27a89a56b4ee18e1'
authorJames Almer <jamrial@gmail.com>
Mon, 1 Aug 2016 21:15:07 +0000 (18:15 -0300)
committerJames Almer <jamrial@gmail.com>
Mon, 1 Aug 2016 21:15:07 +0000 (18:15 -0300)
* commit 'bc7f4268514624e1286ea76d27a89a56b4ee18e1':
  h264: drop tests whether the codec id is AV_CODEC_ID_H264

Conflicts:
libavcodec/h264dec.c

Merged-by: James Almer <jamrial@gmail.com>
1  2 
libavcodec/h264_slice.c
libavcodec/h264dec.c

@@@ -2349,19 -2111,8 +2349,18 @@@ static int decode_slice(struct AVCodecC
          sl->deblocking_filter = 0;
  
      sl->is_complex = FRAME_MBAFF(h) || h->picture_structure != PICT_FRAME ||
-                      avctx->codec_id != AV_CODEC_ID_H264 ||
                       (CONFIG_GRAY && (h->flags & AV_CODEC_FLAG_GRAY));
  
 +    if (!(h->avctx->active_thread_type & FF_THREAD_SLICE) && h->picture_structure == PICT_FRAME && h->slice_ctx[0].er.error_status_table) {
 +        const int start_i  = av_clip(sl->resync_mb_x + sl->resync_mb_y * h->mb_width, 0, h->mb_num - 1);
 +        if (start_i) {
 +            int prev_status = h->slice_ctx[0].er.error_status_table[h->slice_ctx[0].er.mb_index2xy[start_i - 1]];
 +            prev_status &= ~ VP_START;
 +            if (prev_status != (ER_MV_END | ER_DC_END | ER_AC_END))
 +                h->slice_ctx[0].er.error_occurred = 1;
 +        }
 +    }
 +
      if (h->ps.pps->cabac) {
          /* realign */
          align_get_bits(&sl->gb);
@@@ -406,24 -371,18 +406,22 @@@ av_cold int ff_h264_decode_init(AVCodec
          return AVERROR_UNKNOWN;
      }
  
-     if (avctx->codec_id == AV_CODEC_ID_H264) {
-         if (avctx->ticks_per_frame == 1) {
-             if(h->avctx->time_base.den < INT_MAX/2) {
-                 h->avctx->time_base.den *= 2;
-             } else
-                 h->avctx->time_base.num /= 2;
-         }
-         avctx->ticks_per_frame = 2;
 -    if (avctx->ticks_per_frame == 1)
 -        h->avctx->framerate.num *= 2;
++    if (avctx->ticks_per_frame == 1) {
++        if(h->avctx->time_base.den < INT_MAX/2) {
++            h->avctx->time_base.den *= 2;
++        } else
++            h->avctx->time_base.num /= 2;
 +    }
+     avctx->ticks_per_frame = 2;
  
      if (avctx->extradata_size > 0 && avctx->extradata) {
 -       ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
 -                                      &h->ps, &h->is_avc, &h->nal_length_size,
 -                                      avctx->err_recognition, avctx);
 -       if (ret < 0) {
 -           h264_decode_end(avctx);
 -           return ret;
 -       }
 +        ret = ff_h264_decode_extradata(avctx->extradata, avctx->extradata_size,
 +                                       &h->ps, &h->is_avc, &h->nal_length_size,
 +                                       avctx->err_recognition, avctx);
 +        if (ret < 0) {
 +            h264_decode_end(avctx);
 +            return ret;
 +        }
      }
  
      if (h->ps.sps && h->ps.sps->bitstream_restriction_flag &&