Thread (36 messages) 36 messages, 4 authors, 2023-09-12

Re: [PATCH v6 14/18] media: verisilicon: vp9: Use destination buffer height to compute chroma offset

From: Jernej Škrabec <jernej.skrabec@gmail.com>
Date: 2023-09-10 13:21:52
Also in: linux-arm-msm, linux-media, linux-mediatek, linux-rockchip, linux-staging, lkml

Hi Benjamin!

Dne petek, 01. september 2023 ob 14:44:10 CEST je Benjamin Gaignard 
napisal(a):
quoted hunk ↗ jump to hunk
Source and destination buffer height may not be the same because
alignment constraint are different.
Use destination height to compute chroma offset because we target
this buffer as hardware output.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Fixes: e2da465455ce ("media: hantro: Support VP9 on the G2 core")
---
 drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c
b/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c index
6db1c32fce4d..1f3f5e7ce978 100644
--- a/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c
+++ b/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c
@@ -93,9 +93,7 @@ static int start_prepare_run(struct hantro_ctx *ctx, const
struct v4l2_ctrl_vp9_ static size_t chroma_offset(const struct hantro_ctx
*ctx,
 			    const struct v4l2_ctrl_vp9_frame 
*dec_params)
 {
-	int bytes_per_pixel = dec_params->bit_depth == 8 ? 1 : 2;
-
-	return ctx->src_fmt.width * ctx->src_fmt.height * bytes_per_pixel;
+	return ctx->dst_fmt.width * ctx->dst_fmt.height * ctx->bit_depth / 
8;

Commit message doesn't mention bit_depth change at all. While I think there is 
no difference between dec_params->bit_depth and ctx->bit_depth, you shouldn't 
just use ordinary division. If bit_depth is 10, it will be rounded down. And 
if you decide to use bit_depth from context, please remove dec_params 
argument.

Best regards,
Jernej
 }

 static size_t mv_offset(const struct hantro_ctx *ctx,




_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help