From afd2eeb402043f8f79c657aec970f31ca8a51d07 Mon Sep 17 00:00:00 2001 From: Harish Mahendrakar Date: Thu, 29 Jul 2021 14:57:38 -0700 Subject: [PATCH] encoder: Update dimension check for semi-planar input For YUV 420 semi-planar input, second plane's width was wrongly being checked to be equal to half of first plane's width. Corrected this condition now to check that both these widths are same. Bug: 242103647 Test: avcenc -c enc.cfg Change-Id: I3c06f6e40823ddbf00df0435bfbd1cd314c982e3 --- encoder/ih264e_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encoder/ih264e_api.c b/encoder/ih264e_api.c index 502c957..1f4c532 100644 --- a/encoder/ih264e_api.c +++ b/encoder/ih264e_api.c @@ -194,7 +194,7 @@ static IV_STATUS_T api_check_input_dimensions(codec_t *ps_codec, break; case IV_YUV_420SP_UV: case IV_YUV_420SP_VU: - if ((ps_inp_buf->au4_wd[0] / 2) != ps_inp_buf->au4_wd[1]) + if (ps_inp_buf->au4_wd[0] != ps_inp_buf->au4_wd[1]) { ps_op->s_ive_op.u4_error_code |= 1 << IVE_UNSUPPORTEDPARAM; ps_op->s_ive_op.u4_error_code |= IH264E_WIDTH_NOT_SUPPORTED;