diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2010-05-29 03:15:30 +0400 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2010-05-29 03:15:30 +0400 |
commit | 0435fb16d73da639ee257320be854508a5b5ad7d (patch) | |
tree | 0695e2f9953462a429a74ec6a9c1b28d460ff6cd /libavcodec/h264.c | |
parent | c91dce994d38d02431cba324775bce8b969428a5 (diff) |
In h264 decoder, use jpeg yuv pixel format when full range is set in vui
Originally committed as revision 23369 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 31050631c3..e4eb232ea1 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -51,6 +51,13 @@ static const uint8_t div6[52]={ 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, }; +static const enum PixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = { + PIX_FMT_DXVA2_VLD, + PIX_FMT_VAAPI_VLD, + PIX_FMT_YUVJ420P, + PIX_FMT_NONE +}; + void ff_h264_write_back_intra_pred_mode(H264Context *h){ int8_t *mode= h->intra4x4_pred_mode + h->mb2br_xy[h->mb_xy]; @@ -1842,7 +1849,10 @@ static int decode_slice_header(H264Context *h, H264Context *h0){ av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den, h->sps.num_units_in_tick, den, 1<<30); } - s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts); + s->avctx->pix_fmt = s->avctx->get_format(s->avctx, + s->avctx->color_range == AVCOL_RANGE_JPEG ? + hwaccel_pixfmt_list_h264_jpeg_420 : + ff_hwaccel_pixfmt_list_420); s->avctx->hwaccel = ff_find_hwaccel(s->avctx->codec->id, s->avctx->pix_fmt); if (MPV_common_init(s) < 0) @@ -3382,7 +3392,6 @@ AVCodec h264_decoder = { /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush= flush_dpb, .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), - .pix_fmts= ff_hwaccel_pixfmt_list_420, }; #if CONFIG_H264_VDPAU_DECODER |