[FFmpeg-devel] [PATCH] lavc/hevc: set correct chroma location

Hendrik Leppkes h.leppkes at gmail.com
Tue Jun 23 01:07:55 EEST 2020


On Tue, Jun 23, 2020 at 12:02 AM Steinar H. Gunderson
<steinar+ffmpeg at gunderson.no> wrote:
>
> HEVC is left chroma like H.264, so add the proper location on init.
>
> Signed-off-by: Steinar H. Gunderson <steinar+ffmpeg at gunderson.no>
> ---
>  libavcodec/hevcdec.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index c9e28f5826..3306cf3702 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -3534,6 +3534,8 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
>          else
>              s->threads_type = FF_THREAD_SLICE;
>
> +    avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
> +

This is not correct. The chroma location can vary and is signaled in
the bitstream.

I actually send a patch to the ML a while back to do this properly,
but apparently it slipped through the cracks. I'll revive it.

- Hendrik


More information about the ffmpeg-devel mailing list