Merge commit 'ee62b364be0c30cba83b5ff10a3ca8c3e866ade6'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Apr 2015 11:01:15 +0000 (13:01 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 29 Apr 2015 11:23:45 +0000 (13:23 +0200)
* commit 'ee62b364be0c30cba83b5ff10a3ca8c3e866ade6':
  h264: eliminate ff_h264_set_parameter_from_sps()

Conflicts:
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_slice.c

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

Simple merge
Simple merge
@@@ -1100,9 -1002,26 +1098,40 @@@ static int h264_slice_header_init(H264C
      ret = ff_h264_alloc_tables(h);
      if (ret < 0) {
          av_log(h->avctx, AV_LOG_ERROR, "Could not allocate memory\n");
 -        return ret;
 +        goto fail;
 +    }
 +
++    if (h->avctx->codec &&
++        h->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU &&
++        (h->sps.bit_depth_luma != 8 || h->sps.chroma_format_idc > 1)) {
++        av_log(h->avctx, AV_LOG_ERROR,
++                "VDPAU decoding does not support video colorspace.\n");
++        ret = AVERROR_INVALIDDATA;
++        goto fail;
+     }
 -    if (h->sps.bit_depth_luma < 8 || h->sps.bit_depth_luma > 10) {
++    if (h->sps.bit_depth_luma < 8 || h->sps.bit_depth_luma > 14 ||
++        h->sps.bit_depth_luma == 11 || h->sps.bit_depth_luma == 13
++    ) {
+         av_log(h->avctx, AV_LOG_ERROR, "Unsupported bit depth %d\n",
+                h->sps.bit_depth_luma);
 -        return AVERROR_INVALIDDATA;
++        ret = AVERROR_INVALIDDATA;
++        goto fail;
+     }
++    h->cur_bit_depth_luma         =
+     h->avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
++    h->cur_chroma_format_idc      = h->sps.chroma_format_idc;
+     h->pixel_shift                = h->sps.bit_depth_luma > 8;
+     ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma,
+                     h->sps.chroma_format_idc);
+     ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma);
+     ff_h264qpel_init(&h->h264qpel, h->sps.bit_depth_luma);
+     ff_h264_pred_init(&h->hpc, h->avctx->codec_id, h->sps.bit_depth_luma,
+                       h->sps.chroma_format_idc);
+     ff_videodsp_init(&h->vdsp, h->sps.bit_depth_luma);
      if (nb_slices > H264_MAX_THREADS || (nb_slices > h->mb_height && h->mb_height)) {
          int max_slices;
          if (h->mb_height)