Message ID | 20210817210032.17597-1-jeebjp@gmail.com |
---|---|
State | Accepted |
Commit | 7ca71b79f2b3256a0eef1a099b857ac9e4017e36 |
Headers | show |
Series | [FFmpeg-devel,1/2] avcodec/libx264: leave full range flag unchanged if unknown | expand |
Context | Check | Description |
---|---|---|
andriy/x86_make | success | Make finished |
andriy/x86_make_fate | success | Make fate finished |
andriy/PPC64_make | success | Make finished |
andriy/PPC64_make_fate | success | Make fate finished |
lgtm
On Wed, Aug 18, 2021 at 10:00 AM Paul B Mahol <onemda@gmail.com> wrote: > > lgtm Thanks, applied as 7ca71b79f2b3256a0eef1a099b857ac9e4017e36 . Jan
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 9afaf19547..d48e142e41 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -857,10 +857,12 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.i_slice_count = avctx->slices; - x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P || - avctx->pix_fmt == AV_PIX_FMT_YUVJ422P || - avctx->pix_fmt == AV_PIX_FMT_YUVJ444P || - avctx->color_range == AVCOL_RANGE_JPEG; + if (avctx->color_range != AVCOL_RANGE_UNSPECIFIED) + x4->params.vui.b_fullrange = avctx->color_range == AVCOL_RANGE_JPEG; + else if (avctx->pix_fmt == AV_PIX_FMT_YUVJ420P || + avctx->pix_fmt == AV_PIX_FMT_YUVJ422P || + avctx->pix_fmt == AV_PIX_FMT_YUVJ444P) + x4->params.vui.b_fullrange = 1; if (avctx->colorspace != AVCOL_SPC_UNSPECIFIED) x4->params.vui.i_colmatrix = avctx->colorspace;