[FFmpeg-devel] [PATCH] avcodec/hevcdec: fix per-frame signaling of color_trc

James Almer jamrial at gmail.com
Thu Sep 17 03:28:36 EEST 2020


On 9/16/2020 9:14 PM, Pavel Koshevoy wrote:
> This is a partial revert of f2ad6238e4c0e99e2fc131ee14c586e87b045680
> It fixes per-frame color_trc signaling of arib-std-b67 frames.
> 
> Reproducible with:
> ffprobe -show_frames lg_4k_hlg.ts | grep color_transfer=
> ---
>  libavcodec/hevcdec.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index c1de75abe1..e3d1e3f693 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -2810,6 +2810,12 @@ static int set_side_data(HEVCContext *s)
>          s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
>      }
>  
> +    if (s->sei.alternative_transfer.present &&
> +        av_color_transfer_name(s->sei.alternative_transfer.preferred_transfer_characteristics) &&
> +        s->sei.alternative_transfer.preferred_transfer_characteristics != AVCOL_TRC_UNSPECIFIED) {
> +        s->avctx->color_trc = out->color_trc = s->sei.alternative_transfer.preferred_transfer_characteristics;
> +    }
> +
>      for (int i = 0; i < s->sei.unregistered.nb_buf_ref; i++) {
>          HEVCSEIUnregistered *unreg = &s->sei.unregistered;

I have an alternative approach. Will send it soon.


More information about the ffmpeg-devel mailing list