[FFmpeg-devel] [PATCH] hevcdec: Correctly signal AVCOL_RANGE_UNSPECIFIED if nothing was set in the bitstream

Hendrik Leppkes h.leppkes at gmail.com
Thu Feb 17 14:58:18 EET 2022


On Thu, Feb 17, 2022 at 1:54 PM Martin Storsjö <martin at martin.st> wrote:
>
> This matches what the H264 decoder signals for such a case.
>
> Signed-off-by: Martin Storsjö <martin at martin.st>
> ---
>  libavcodec/hevcdec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 8d7a4f7147..01d459984f 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -338,7 +338,7 @@ static void export_stream_params(HEVCContext *s, const HEVCSPS *sps)
>          avctx->color_range = sps->vui.video_full_range_flag ? AVCOL_RANGE_JPEG
>                                                              : AVCOL_RANGE_MPEG;
>      else
> -        avctx->color_range = AVCOL_RANGE_MPEG;
> +        avctx->color_range = AVCOL_RANGE_UNSPECIFIED;
>

The HEVC specification is pretty clear that when its not signalled, it
should be inferred as 0 (eg. mpeg)

> When the video_full_range_flag syntax element is not present, the value of video_full_range_flag is inferred to be equal to 0

- Hendrik


More information about the ffmpeg-devel mailing list