From patchwork Tue Apr 9 06:44:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13621879 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 50FDC79CC; Tue, 9 Apr 2024 06:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645087; cv=none; b=S14CdeBE42AnGCIBpkorL6fTsqbDS4+qihJuZwWhYy/venGEILgAeIdb+o4D23wtGUCaNbuot5rlfmP7yJv6Nh9eu8IeBsWr7W1rIjSlcltk2jdZU538Q9AWun1BmUcZI/1ins0kcpOdXMZaCZYMmPHrJVKNFuK6fCWBuTHX4vA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645087; c=relaxed/simple; bh=c3rf2lftDQ48adYR6wNs4gJ4G6FOyKLWwDg6qawkDzQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=fEUbNF0AkYtzOYFZCW1t/UFTsPHxS47yQwDF/a47TEyZLOY7NjRbSIKAEK4W7uu08BzM4twCBkYhvxOwgBKQrXJ/JVAKPuF2Hu4ShTyPMP/crm1SbZNdvvOQ/X2ah2WeQ/eRkt1jk84Mc2xkSyoedFaqYEeh4e4AqYZH/jahONk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=kTALjyBL; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="kTALjyBL" X-UUID: a0ab2ebcf63c11eeb8927bc1f75efef4-20240409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=FlanlqfqVTCvu/sF5l5Vn/ngeI2/kVbcfoNHwjNRZw4=; b=kTALjyBLBfQj7YKSKLgHbrlBxdokFvyry2uhjhaNzY5+qMMqR13ZzqF+y5Y5PT1T2IfhacJBObrwtVaPFcTi1925GRfGzciwRlXBJVGyLMQ+P26e+Z6hbxvkAOUFSlLktLfgXxnQrbNJ6GphjOXPoWuXAvSSomzWMUiX9KlnMSk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:79ebc5f3-3cd5-4aac-a1f0-4ada53d9b2bd,IP:0,U RL:0,TC:0,Content:0,EDM:-30,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-30 X-CID-META: VersionHash:6f543d0,CLOUDID:6f02f585-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:2,IP:nil,UR L:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,S PR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: a0ab2ebcf63c11eeb8927bc1f75efef4-20240409 Received: from mtkmbs11n1.mediatek.inc [(172.21.101.185)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1704572196; Tue, 09 Apr 2024 14:44:34 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs11n2.mediatek.inc (172.21.101.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 9 Apr 2024 14:44:33 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 9 Apr 2024 14:44:32 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , Subject: [PATCH v2,1/5] media: mediatek: vcodec: fix incorrect MT2T format information Date: Tue, 9 Apr 2024 14:44:27 +0800 Message-ID: <20240409064431.16909-2-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240409064431.16909-1-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MTK: N Changing the bpp and hdiv values to make sure the bytesperline of plane[0] and plane[1] are the same. The width and height are 64 align. Fixes: 6afcc2b0aebf ("media: mediatek: vcodec: Add capture format to support 10bit tile mode") Signed-off-by: Yunfei Dong --- drivers/media/v4l2-core/v4l2-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index d34d210908d9..8587cd14741c 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -265,8 +265,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_VYUY, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 2, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 1 }, { .format = V4L2_PIX_FMT_Y212, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 4, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 1 }, { .format = V4L2_PIX_FMT_YUV48_12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 }, - { .format = V4L2_PIX_FMT_MT2110T, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2, - .block_w = { 16, 8, 0, 0 }, .block_h = { 32, 16, 0, 0 }}, + { .format = V4L2_PIX_FMT_MT2110T, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 5, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 1, .vdiv = 2, + .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, { .format = V4L2_PIX_FMT_MT2110R, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2, .block_w = { 16, 8, 0, 0 }, .block_h = { 32, 16, 0, 0 }}, From patchwork Tue Apr 9 06:44:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13621882 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60A3F763F1; Tue, 9 Apr 2024 06:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645091; cv=none; b=YDkcm791oXQvR1/HX7izF1HAtFk6/3tq4NcmIzYIK/5hUcs4OwuXy/6s8FJeGF/0xprznMXBXIwsxtnfTjJHiLbx0F7ABVoJUXU/e6gZRO5BKtscoy796ZHGWGt7m4TNgdSbCU2hFa38Mr25+3AkvsxQ2J6Dx+T1ZPAk3l7MNcE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645091; c=relaxed/simple; bh=cM9aQNPKr9G1RIwmRD1GqXwT7YVQbHWvN+ToiMWkmbg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ihuljhBnWPQG+/c1eJogGrf+wg7b5OOXa2vYRgRVoTD6vQHb+Zfu8vbgqNkclUH+CMGvxXJDJ5AYmsjhbSef2zgxpGmXf6rUQ3Sc2iFXdomtfF0P/MXxzIa5vQUHR6EbtX8V84c26dkAkG1HQdXkHfUUvHHDb6J0s+3mrfHFAfY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=Q+XYIX2f; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="Q+XYIX2f" X-UUID: a1f191f8f63c11eeb8927bc1f75efef4-20240409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=0qktbKEYPGtydjVRM7cyZ/EYPJ31azkhEL8i3TDFy3s=; b=Q+XYIX2fMe4mEV/CGSEceDtX48INUC6oDvlE+P8kRX1zUhdbCGW7AsB8SP2zl9ZveHZAERQykOEhM48HKy5dZU13ailBbotjVqpP9NuiG8BRtR5a1zi9ikUDF3fhGDai5fuhN+kC84+R4rQakDClatXvCr0xTh+NnxCeJiVPv/4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:f425eba1-25a0-4db0-80e0-4a2fcc5cb8ea,IP:0,U RL:0,TC:0,Content:0,EDM:-30,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-30 X-CID-META: VersionHash:6f543d0,CLOUDID:999b5b91-e2c0-40b0-a8fe-7c7e47299109,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:2,IP:nil,UR L:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,S PR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: a1f191f8f63c11eeb8927bc1f75efef4-20240409 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 998046553; Tue, 09 Apr 2024 14:44:37 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 9 Apr 2024 14:44:34 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 9 Apr 2024 14:44:33 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , "Yunfei Dong" , , , , , , Subject: [PATCH v2,2/5] media: mediatek: vcodec: fix incorrect MT2R format information Date: Tue, 9 Apr 2024 14:44:28 +0800 Message-ID: <20240409064431.16909-3-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240409064431.16909-1-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10-0.534700-8.000000 X-TMASE-MatchedRID: 6V/MDP75lNskAJTC0ghkVEOZWaJBszmqMZm0+sEE9mvjud2x7TPVt5kC erFMaabilTJXKqh1ne1uEZBMMoyNb/QkvsXHc/4WngIgpj8eDcBpkajQR5gb3qbj/c4OO+6RKra uXd3MZDWJDHD1rfJi5yF7K4DO6AFEByI5NST1E38DmPU85Y9e5vNFxnD1qTXUg+TrRUrIbbBdx2 UK2QfpuasNTb2hMWvDdOpdgj9khs5Br/EfNXvU1fNho9kAt8htLJl1Svx/Hh8xu7K+8aG0gEjdE 2R0SZiwQwymtxuJ6y0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10-0.534700-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: A58515800F8D61D2C85AC02EF66A19E85DC0B71DA7AC0702082136D86EB4CDE42000:8 X-MTK: N Changing the bpp and hdiv values to make sure the bytesperline of plane[0] and plane[1] are the same. The width and height are 64 align. Fixes: 1dff2beb60d3 ("media: mediatek: vcodec: Add capture format to support 10bit raster mode") Signed-off-by: Yunfei Dong --- drivers/media/v4l2-core/v4l2-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 8587cd14741c..cef1492dba22 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -267,8 +267,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) { .format = V4L2_PIX_FMT_YUV48_12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 1, .bpp = { 6, 0, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 1 }, { .format = V4L2_PIX_FMT_MT2110T, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 5, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 1, .vdiv = 2, .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, - { .format = V4L2_PIX_FMT_MT2110R, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 10, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 2, .vdiv = 2, - .block_w = { 16, 8, 0, 0 }, .block_h = { 32, 16, 0, 0 }}, + { .format = V4L2_PIX_FMT_MT2110R, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 5, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 1, .vdiv = 2, + .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, /* YUV planar formats */ { .format = V4L2_PIX_FMT_NV12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 }, From patchwork Tue Apr 9 06:44:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13621881 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BE14757F2; Tue, 9 Apr 2024 06:44:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645090; cv=none; b=PRhm7/ET4OQne/uJ17kOJjpOBKADqDZffQjMbe7AZbpNpLlzIccQHnIIJpyVr3MEu5rTtxhc3ooS+/1ptI/r7v6oQaNCSBUc40OMswPxFqilrgF5HeDsEf4+vxafd2sNc/Vdq6HW0vBehiXfTCe7qi+15LzjMfuu8SA8EVLHcfY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645090; c=relaxed/simple; bh=5GP1+BHoeHheZFdogUL8dW/blvK7u6Y7gZFK8nSf2nQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UNxlAq6Zj+eMpI1kX87V5pGWhB+EM2xe5zVmEhFAiZF9pfTvY+5/xnpuYyRzlaI3jMGllwIjNLlQDerJsuqI2KK7qwinHEfsIqKcSZP6f/VoLepXR1UqJmdS+XaV9MzeYxlHJ7wceVdI75Ux7vtWG0QFuUhg2cXkaQ8yzk+yOgQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=lLBttngE; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="lLBttngE" X-UUID: a1d9ce9cf63c11eeb8927bc1f75efef4-20240409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=1By4C96PsvcGaXtscQ2J2MMRcbf/nDmQwUtSXEsx0UU=; b=lLBttngEF8lq/8kSqW1Vrp8Fl8vDe//tE6YvFvnBHZKVAlhSkHF0VrIusL9W7OwX+xY2SiBO4vMS15sMD4jWA3exmnrRo0GINU3jPveJRXld/GkD4UjgvXWXecRtMMaB1maZxAwFVwwDBsyYbFV2K5/KsAf/6UN19bm1Q/e+sgE=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:decda469-c787-4dbc-ad66-6873950450d6,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6f543d0,CLOUDID:5f4a7482-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: a1d9ce9cf63c11eeb8927bc1f75efef4-20240409 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1277947394; Tue, 09 Apr 2024 14:44:36 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 9 Apr 2024 14:44:35 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 9 Apr 2024 14:44:34 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , Yunfei Dong , , , , , , Subject: [PATCH v2,3/5] media: mediatek: vcodec: add MM21 format definition Date: Tue, 9 Apr 2024 14:44:29 +0800 Message-ID: <20240409064431.16909-4-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240409064431.16909-1-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MTK: N Adding the definition of MM21 format to calculate bytesperline and sizeimage of plane[0] and plane[1]. Signed-off-by: Yunfei Dong --- drivers/media/v4l2-core/v4l2-common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index cef1492dba22..0d5de132e07f 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -269,6 +269,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, { .format = V4L2_PIX_FMT_MT2110R, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 5, 5, 0, 0 }, .bpp_div = { 4, 4, 1, 1 }, .hdiv = 1, .vdiv = 2, .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, + { .format = V4L2_PIX_FMT_MM21, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 1, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 2, + .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, /* YUV planar formats */ { .format = V4L2_PIX_FMT_NV12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 }, From patchwork Tue Apr 9 06:44:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13621883 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8100877620; Tue, 9 Apr 2024 06:44:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645091; cv=none; b=ThhGiDPVoVxlE6if6hloI4FBEukxLitcK+Yd7KQWtZiOcOzjrPPigbspBk5YucOMzYuvVN37/pp7aKrOdTG4LsNpxaosp6iZbiqXULcCrwijJYbE33EdJ23IAFYxOLHKdGOqtBghvE93h+GuKdFUqPPN8nMnjnv9ah5f3kPR2fQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645091; c=relaxed/simple; bh=/EfGLAuXNn7CJOSxT1lml+odygEvkvbadyeR0pxnBBM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CCZnY+By7vm7eeNW+mzN/FcFde6loGXF/BQ9/POZFZhhX8o2byLETUerL/hRls6K123O12rtSSFuT1HukEqHD4p90Fn3vV6w9p/ytdyGFVrs5Uh4kHtemM0bW70/uKwYASTuGo13mGZdAEY2Y7WNfMcN3FkpFMb1Usff/qscZ5k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=BoojvV8+; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="BoojvV8+" X-UUID: a403833ef63c11ee935d6952f98a51a9-20240409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=j+KhJ6EB+cj5pLe9kHuoAtVj6VnwdkbMa6xi4h0zCuA=; b=BoojvV8+DUW9VoMCbk89fTA67VTYCNcm52XxbOx0TriTEkzE1Pl9AIB4XfJ88e2sk/4hhpljuoT5BQUw9aBW9PWJySzBFLiIjFosYAqclsivxfneTTml4pUvpB1/6Tcuok7mwIGE1CQxQxD7I8izmQSlXaqPP2/wvT1qVsF6XhU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:83e5c2b7-8a56-4704-92c8-4d49f117abf3,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:6f543d0,CLOUDID:aa9b5b91-e2c0-40b0-a8fe-7c7e47299109,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: a403833ef63c11ee935d6952f98a51a9-20240409 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 2018417611; Tue, 09 Apr 2024 14:44:40 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 9 Apr 2024 14:44:36 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 9 Apr 2024 14:44:35 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , "Yunfei Dong" , , , , , , Subject: [PATCH v2,4/5] media: mediatek: vcodec: add MT21 format definition Date: Tue, 9 Apr 2024 14:44:30 +0800 Message-ID: <20240409064431.16909-5-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240409064431.16909-1-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--0.600600-8.000000 X-TMASE-MatchedRID: 3/Lgny1vFHgmcIFfEYO7XAPZZctd3P4BWDdWpJMntKjANHjiWWI+7TMS YlM6Tw/V4vM1YF6AJbbCCfuIMF6xLSdET58jp62SNp7AbDE1MbDAd5zs4vPBYwrnM+1Obl9yatZ PNGSV67f7iywLUKDZp2vSF656JZcx4Zwt/wu7ol2frG2VghuuRVSMwMhT0DhthJVRlkc0uv5GBX oeyrLHXVBo425nomviD2TeXwRpghwOIqZ2uUSDWA== X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--0.600600-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 1B045FBF83946BA5E3B4A30D4C91362BFE0DFD92C4D4CD15C374A30A36CF54C02000:8 X-MTK: N Adding the definition of MT21 format to calculate bytesperline and sizeimage of plane[0] and plane[1]. Signed-off-by: Yunfei Dong --- drivers/media/v4l2-core/v4l2-common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-common.c b/drivers/media/v4l2-core/v4l2-common.c index 0d5de132e07f..6dba989c2291 100644 --- a/drivers/media/v4l2-core/v4l2-common.c +++ b/drivers/media/v4l2-core/v4l2-common.c @@ -271,6 +271,8 @@ const struct v4l2_format_info *v4l2_format_info(u32 format) .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, { .format = V4L2_PIX_FMT_MM21, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 1, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 2, .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, + { .format = V4L2_PIX_FMT_MT21C, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 2, .comp_planes = 2, .bpp = { 1, 1, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 1, .vdiv = 2, + .block_w = { 64, 64, 0, 0 }, .block_h = { 64, 64, 0, 0 }}, /* YUV planar formats */ { .format = V4L2_PIX_FMT_NV12, .pixel_enc = V4L2_PIXEL_ENC_YUV, .mem_planes = 1, .comp_planes = 2, .bpp = { 1, 2, 0, 0 }, .bpp_div = { 1, 1, 1, 1 }, .hdiv = 2, .vdiv = 2 }, From patchwork Tue Apr 9 06:44:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunfei Dong X-Patchwork-Id: 13621884 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D3FDC7C090; Tue, 9 Apr 2024 06:44:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645093; cv=none; b=FdV7v9ciEEdMRsKy65WL1On2c4EbjF1j/0/TNgCleZ1IHe/SuNPQh/6aUbseinpGfk0XObkKARJD4s5n4i1N1zOnEkhRmKgJtcxUWGa7X3AVA8GWfyBdGOjtLOMSpFAL/M6IlkPhGOGFvQ+J/SK7qkSZQZXtj7tDJJSUfouC9CM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712645093; c=relaxed/simple; bh=sPbXPWvg5+mZ/6oQLlNfovqlH0U3jK5wpCleZwSaPXw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZBt79RHuJOoUJqTHxNNlDRR/QqNSKMdlWpD98yM0q4wUzySAPnqUVH7TgKBFFwCc0wLEAEk+8XXIzsXeVVq/ZnJRhKmNEFAMaK41Ig4ZWDz0gmfFS00j2cp0V7LOsNajtV5RoNO1FZ8rCxbYX3W8NkqyXRxYbkUy/b/miJerne4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=TvHxiaBb; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="TvHxiaBb" X-UUID: a406fb0ef63c11ee935d6952f98a51a9-20240409 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=MZosmWHxYSHcRW0nI04JC77u+V6QJPuWaadF+FdFu+s=; b=TvHxiaBbAj7mB/fuGZ8+7OKidmp29p5fII3uUIpoEOg2S8tG8pVigtiYJzfCxf+uvw+TR6aqOo+sMiUKre5NELBfEhins30Fb8u3mxEscnTb7mfF3OUfKNzZjHO59oHiyySM9ceKStOR0FzQVvRhPIlI44K6NDaLp4wnomQuTJk=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:2dc70a6e-aff6-47d8-ae24-97788bb88c13,IP:0,U RL:0,TC:0,Content:39,EDM:-30,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:9 X-CID-META: VersionHash:6f543d0,CLOUDID:754a7482-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:4,EDM:2,IP:nil,UR L:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,S PR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: a406fb0ef63c11ee935d6952f98a51a9-20240409 Received: from mtkmbs13n1.mediatek.inc [(172.21.101.193)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1778975413; Tue, 09 Apr 2024 14:44:40 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n1.mediatek.inc (172.21.101.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Tue, 9 Apr 2024 14:44:37 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Tue, 9 Apr 2024 14:44:36 +0800 From: Yunfei Dong To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= , Nicolas Dufresne , Hans Verkuil , AngeloGioacchino Del Regno , Benjamin Gaignard , Nathan Hebert , Sebastian Fricke CC: Hsin-Yi Wang , Fritz Koenig , Daniel Vetter , Steve Cho , "Yunfei Dong" , , , , , , Subject: [PATCH v2,5/5] media: mediatek: vcodec: fix incorrect sizeimage for 10bit bitstream Date: Tue, 9 Apr 2024 14:44:31 +0800 Message-ID: <20240409064431.16909-6-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240409064431.16909-1-yunfei.dong@mediatek.com> References: <20240409064431.16909-1-yunfei.dong@mediatek.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--3.412300-8.000000 X-TMASE-MatchedRID: uGd8VeYUEEWhmMaez4U1AFz+axQLnAVBTI0NfY99MMnfUZT83lbkEEtH ojrK13E4Xbw7dgf/8HlAA7ZKGvXdAC1Wsi+5O6Jcsyw+ZJnFumQcZd/OW4yvKkYx760ONDcW9Gb SSaq0f4Oh3i6rZZP9+lCkJPtKWaaNDPIzF4wRfrAURSScn+QSXt0H8LFZNFG7CKFCmhdu5cWqtb 6GDxXi6iofexNkV7fbMknYdva+C6W5yj/z7E7qhyhZ9FGlWWy3Z1gP/jdV4D1SjXz3n1GYt9lEd 4EsQOBGa8q+62VkyTppp55fZDlsr34cY/B7JqXaYZ1R7NXn0MdBmmCXcKyFFJ6oP1a0mRIj X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--3.412300-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 8939B90B9B248E41F954A5A918956B972837D3BCB544E7A6922A45827A39B2232000:8 X-MTK: N The sizeimage of each plane is calculated the same way for 8bit and 10bit bitstream. Using v4l2 common interface v4l2_fill_pixfmt_mp to separate. Fixes: 9d86be9bda6c ("media: mediatek: vcodec: Add driver to support 10bit") Signed-off-by: Yunfei Dong --- .../mediatek/vcodec/decoder/mtk_vcodec_dec.c | 28 ++++++------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c index 9107707de6c4..fbfba69682ea 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.c @@ -262,40 +262,28 @@ static int vidioc_try_fmt(struct mtk_vcodec_dec_ctx *ctx, struct v4l2_format *f, int tmp_w, tmp_h; /* - * Find next closer width align 64, height align 64, size align - * 64 rectangle + * Find next closer width align 64, heign align 64, size align 64 rectangle * Note: This only get default value, the real HW needed value * only available when ctx in MTK_STATE_HEADER state */ tmp_w = pix_fmt_mp->width; tmp_h = pix_fmt_mp->height; + v4l_bound_align_image(&pix_fmt_mp->width, MTK_VDEC_MIN_W, frmsize->max_width, 6, &pix_fmt_mp->height, MTK_VDEC_MIN_H, frmsize->max_height, 6, 9); - if (pix_fmt_mp->width < tmp_w && - (pix_fmt_mp->width + 64) <= frmsize->max_width) + if (pix_fmt_mp->width < tmp_w && (pix_fmt_mp->width + 64) <= frmsize->max_width) pix_fmt_mp->width += 64; - if (pix_fmt_mp->height < tmp_h && - (pix_fmt_mp->height + 64) <= frmsize->max_height) + if (pix_fmt_mp->height < tmp_h && (pix_fmt_mp->height + 64) <= frmsize->max_height) pix_fmt_mp->height += 64; + v4l2_fill_pixfmt_mp(pix_fmt_mp, fmt->fourcc, pix_fmt_mp->width, pix_fmt_mp->height); mtk_v4l2_vdec_dbg(0, ctx, - "before resize wxh=%dx%d, after resize wxh=%dx%d, sizeimage=%d", + "before resize:%dx%d, after resize:%dx%d, sizeimage=0x%x_0x%x", tmp_w, tmp_h, pix_fmt_mp->width, pix_fmt_mp->height, - pix_fmt_mp->width * pix_fmt_mp->height); - - pix_fmt_mp->num_planes = fmt->num_planes; - pix_fmt_mp->plane_fmt[0].sizeimage = - pix_fmt_mp->width * pix_fmt_mp->height; - pix_fmt_mp->plane_fmt[0].bytesperline = pix_fmt_mp->width; - - if (pix_fmt_mp->num_planes == 2) { - pix_fmt_mp->plane_fmt[1].sizeimage = - (pix_fmt_mp->width * pix_fmt_mp->height) / 2; - pix_fmt_mp->plane_fmt[1].bytesperline = - pix_fmt_mp->width; - } + pix_fmt_mp->plane_fmt[0].sizeimage, + pix_fmt_mp->plane_fmt[1].sizeimage); } pix_fmt_mp->flags = 0;