From: Benjamin Gaignard Date: Mon, 29 Aug 2022 16:21:55 +0000 (+0200) Subject: media: hantro: HEVC: Fix chroma offset computation X-Git-Tag: v6.1-rc5~124^2~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f64853ad7f964b3bf7c1d63b27ca7ef972797a1c;p=platform%2Fkernel%2Flinux-starfive.git media: hantro: HEVC: Fix chroma offset computation The chroma offset depends of the bitstream depth. Make sure that ctx->bit_depth is used to compute it. Signed-off-by: Benjamin Gaignard Reviewed-by: Ezequiel Garcia Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c b/drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c index 233ecd8..a917079 100644 --- a/drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c +++ b/drivers/media/platform/verisilicon/hantro_g2_hevc_dec.c @@ -12,7 +12,7 @@ static size_t hantro_hevc_chroma_offset(struct hantro_ctx *ctx) { - return ctx->dst_fmt.width * ctx->dst_fmt.height; + return ctx->dst_fmt.width * ctx->dst_fmt.height * ctx->bit_depth / 8; } static size_t hantro_hevc_motion_vectors_offset(struct hantro_ctx *ctx)