av1: support V4L2 HDR static setting [1/1]
authorgan.zhang <gan.zhang@amlogic.com>
Fri, 4 Dec 2020 07:22:36 +0000 (15:22 +0800)
committerGan Zhang <gan.zhang@amlogic.com>
Tue, 8 Dec 2020 09:24:31 +0000 (01:24 -0800)
PD#SWPL-38314

Problem:
Luminance doesn't match display
Application can not set static information to decoder.

Solution:
Luminance match display (*10000)
Interface layer set static information.

Verify:
AH212

Change-Id: Ifcd90a4c88a7fba7c007e54d47155e2edf370584
Signed-off-by: gan.zhang <gan.zhang@amlogic.com>
drivers/amvdec_ports/decoder/vdec_av1_if.c

index 0a79789169a1622c36430403437cec76130e2ee0..2b9b657fdfcc0bb9a54a77f934977936cca89b6e 100644 (file)
@@ -295,6 +295,7 @@ static void vdec_parser_parms(struct vdec_av1_inst *inst)
                inst->parms.hdr.color_parms.present_flag) {
                u8 *pbuf = ctx->config.buf + ctx->config.length;
 
+               pbuf += sprintf(pbuf, "HDRStaticInfo:%d;", 1);
                pbuf += sprintf(pbuf, "mG.x:%d;",
                        ctx->config.parm.dec.hdr.color_parms.primaries[0][0]);
                pbuf += sprintf(pbuf, "mG.y:%d;",
@@ -312,7 +313,7 @@ static void vdec_parser_parms(struct vdec_av1_inst *inst)
                pbuf += sprintf(pbuf, "mW.y:%d;",
                        ctx->config.parm.dec.hdr.color_parms.white_point[1]);
                pbuf += sprintf(pbuf, "mMaxDL:%d;",
-                       ctx->config.parm.dec.hdr.color_parms.luminance[0] / 1000);
+                       ctx->config.parm.dec.hdr.color_parms.luminance[0] * 1000);
                pbuf += sprintf(pbuf, "mMinDL:%d;",
                        ctx->config.parm.dec.hdr.color_parms.luminance[1]);
                pbuf += sprintf(pbuf, "mMaxCLL:%d;",