Merge commit '5d1c2e53ab3ce27b48c138d22bb01ff8e8304f27'
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 17 Mar 2014 04:59:01 +0000 (05:59 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 17 Mar 2014 05:05:19 +0000 (06:05 +0100)
* commit '5d1c2e53ab3ce27b48c138d22bb01ff8e8304f27':
  h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define

Conflicts:
libavcodec/h264.c
libavcodec/h264_ps.c

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

@@@ -1862,9 -1767,9 +1862,9 @@@ static int decode_update_thread_context
      h->droppable            = h1->droppable;
      h->low_delay            = h1->low_delay;
  
-     for (i = 0; h->DPB && i < MAX_PICTURE_COUNT; i++) {
 -    for (i = 0; i < H264_MAX_PICTURE_COUNT; i++) {
++    for (i = 0; h->DPB && i < H264_MAX_PICTURE_COUNT; i++) {
          unref_picture(h, &h->DPB[i]);
 -        if (h1->DPB[i].f.buf[0] &&
 +        if (h1->DPB && h1->DPB[i].f.buf[0] &&
              (ret = ref_picture(h, &h->DPB[i], &h1->DPB[i])) < 0)
              return ret;
      }
@@@ -39,6 -39,8 +39,8 @@@
  #include "h264qpel.h"
  #include "rectangle.h"
  
 -#define H264_MAX_PICTURE_COUNT 32
++#define H264_MAX_PICTURE_COUNT 36
  #define MAX_SPS_COUNT          32
  #define MAX_PPS_COUNT         256
  
@@@ -443,10 -400,8 +443,10 @@@ int ff_h264_decode_seq_parameter_set(H2
      }
  
      sps->ref_frame_count = get_ue_golomb_31(&h->gb);
-     if (sps->ref_frame_count > MAX_PICTURE_COUNT - 2 ||
 +    if (h->avctx->codec_tag == MKTAG('S', 'M', 'V', '2'))
 +        sps->ref_frame_count = FFMAX(2, sps->ref_frame_count);
 -        sps->ref_frame_count >= 32U) {
+     if (sps->ref_frame_count > H264_MAX_PICTURE_COUNT - 2 ||
 +        sps->ref_frame_count > 16U) {
          av_log(h->avctx, AV_LOG_ERROR,
                 "too many reference frames %d\n", sps->ref_frame_count);
          goto fail;