[FFmpeg-cvslog] Merge commit '370ddc7b38d6b27b54fc2f5ee5f3dd9506f8c7c8'

Clément Bœsch git at videolan.org
Mon Jun 20 12:52:25 CEST 2016


ffmpeg | branch: master | Clément Bœsch <clement at stupeflix.com> | Mon Jun 20 12:35:32 2016 +0200| [c8f7a23319e54059c6a355746845c4e4e0215509] | committer: Clément Bœsch

Merge commit '370ddc7b38d6b27b54fc2f5ee5f3dd9506f8c7c8'

* commit '370ddc7b38d6b27b54fc2f5ee5f3dd9506f8c7c8':
  h264: remove H264Context.pict_type

Merged-by: Clément Bœsch <clement at stupeflix.com>

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

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

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 812e7c0..f2dc473 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -491,8 +491,6 @@ static void decode_postinit(H264Context *h, int setup_finished)
     H264Picture *cur = h->cur_pic_ptr;
     int i, pics, out_of_order, out_idx;
 
-    h->cur_pic_ptr->f->pict_type = h->pict_type;
-
     if (h->next_output_pic)
         return;
 
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 60355bf..5e9827d 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -627,8 +627,6 @@ typedef struct H264Context {
      */
     int single_decode_warning;
 
-    enum AVPictureType pict_type;
-
     /** @} */
 
     /**
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 0365e9b..0e13fd9 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -499,6 +499,8 @@ static int h264_frame_start(H264Context *h)
     pic->invalid_gap = 0;
     pic->sei_recovery_frame_cnt = h->sei.recovery_point.recovery_frame_cnt;
 
+    pic->f->pict_type = h->slice_ctx[0].slice_type;
+
     if ((ret = alloc_picture(h, pic)) < 0)
         return ret;
     if(!h->frame_recovered && !h->avctx->hwaccel
@@ -1140,10 +1142,6 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
         }
     }
 
-    // to make a few old functions happy, it's wrong though
-    if (!h->setup_finished)
-        h->pict_type = sl->slice_type;
-
     pps_id = get_ue_golomb(&sl->gb);
     if (pps_id >= MAX_PPS_COUNT) {
         av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id);


======================================================================

diff --cc libavcodec/h264.c
index 812e7c0,c024d7e..f2dc473
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@@ -490,9 -436,8 +490,7 @@@ static void decode_postinit(H264Contex
      H264Picture *out = h->cur_pic_ptr;
      H264Picture *cur = h->cur_pic_ptr;
      int i, pics, out_of_order, out_idx;
 -    int invalid = 0, cnt = 0;
  
-     h->cur_pic_ptr->f->pict_type = h->pict_type;
- 
      if (h->next_output_pic)
          return;
  
diff --cc libavcodec/h264_slice.c
index 0365e9b,9e08c0b..0e13fd9
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@@ -496,37 -466,11 +496,39 @@@ static int h264_frame_start(H264Contex
      pic->f->key_frame = 0;
      pic->mmco_reset  = 0;
      pic->recovered   = 0;
 +    pic->invalid_gap = 0;
 +    pic->sei_recovery_frame_cnt = h->sei.recovery_point.recovery_frame_cnt;
  
+     pic->f->pict_type = h->slice_ctx[0].slice_type;
+ 
 -    if (CONFIG_ERROR_RESILIENCE && h->enable_er)
 +    if ((ret = alloc_picture(h, pic)) < 0)
 +        return ret;
 +    if(!h->frame_recovered && !h->avctx->hwaccel
 +#if FF_API_CAP_VDPAU
 +       && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
 +#endif
 +       )
 +        ff_color_frame(pic->f, c);
 +
 +    h->cur_pic_ptr = pic;
 +    ff_h264_unref_picture(h, &h->cur_pic);
 +    if (CONFIG_ERROR_RESILIENCE) {
 +        ff_h264_set_erpic(&h->slice_ctx[0].er.cur_pic, NULL);
 +    }
 +
 +    if ((ret = ff_h264_ref_picture(h, &h->cur_pic, h->cur_pic_ptr)) < 0)
 +        return ret;
 +
 +    for (i = 0; i < h->nb_slice_ctx; i++) {
 +        h->slice_ctx[i].linesize   = h->cur_pic_ptr->f->linesize[0];
 +        h->slice_ctx[i].uvlinesize = h->cur_pic_ptr->f->linesize[1];
 +    }
 +
 +    if (CONFIG_ERROR_RESILIENCE && h->enable_er) {
          ff_er_frame_start(&h->slice_ctx[0].er);
 +        ff_h264_set_erpic(&h->slice_ctx[0].er.last_pic, NULL);
 +        ff_h264_set_erpic(&h->slice_ctx[0].er.next_pic, NULL);
 +    }
  
      for (i = 0; i < 16; i++) {
          h->block_offset[i]           = (4 * ((scan8[i] - scan8[0]) & 7) << pixel_shift) + 4 * pic->f->linesize[0] * ((scan8[i] - scan8[0]) >> 3);
@@@ -1129,21 -976,6 +1131,17 @@@ int ff_h264_decode_slice_header(H264Con
          return AVERROR_INVALIDDATA;
      }
  
 +    if (h->current_slice == 0 && !h->first_field) {
 +        if (
 +            (h->avctx->skip_frame >= AVDISCARD_NONREF && !h->nal_ref_idc) ||
 +            (h->avctx->skip_frame >= AVDISCARD_BIDIR  && sl->slice_type_nos == AV_PICTURE_TYPE_B) ||
 +            (h->avctx->skip_frame >= AVDISCARD_NONINTRA && sl->slice_type_nos != AV_PICTURE_TYPE_I) ||
 +            (h->avctx->skip_frame >= AVDISCARD_NONKEY && h->nal_unit_type != NAL_IDR_SLICE && h->sei.recovery_point.recovery_frame_cnt < 0) ||
 +            h->avctx->skip_frame >= AVDISCARD_ALL) {
 +            return SLICE_SKIPED;
 +        }
 +    }
 +
-     // to make a few old functions happy, it's wrong though
-     if (!h->setup_finished)
-         h->pict_type = sl->slice_type;
- 
      pps_id = get_ue_golomb(&sl->gb);
      if (pps_id >= MAX_PPS_COUNT) {
          av_log(h->avctx, AV_LOG_ERROR, "pps_id %u out of range\n", pps_id);



More information about the ffmpeg-cvslog mailing list