From patchwork Sun Feb 18 11:59:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Irui Wang X-Patchwork-Id: 13561837 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A0E35C4829E for ; Sun, 18 Feb 2024 12:00:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=TzhRI4cypCmqunSRf1qOngM5HMg8RqcBPftI0z984+k=; b=dqP94zEQL0tIm9tg+QV+ZINmoe 7rxsIbBbfko3Zf/Y2NE9aYAYyFnh5KtMzj1Lab4b+57kz7eT8L7rzLTg0cHhoRiU6qtDo1Scw3McL B7X1dYdATF65PdKUVFbEcQ5wKJY0NPEyf7ZmlZO8zs7sQ7ks2rc6iulXdQY9AO5Qasl43I3G+YGVE +y6RH8Nsbh0LkUj7t5emmbSgmywAfLxD7Tk6WubA6ehWKVx6uxKS6jPQNvNo0Ti1ytXa6rSTVmEv0 RR9QZoB3YcHxqAj9gY1icI+PUX2LmXD4clMFzOMhFyxD2413Mw8UV9/TVu2Zq8oi/7PnTupxgQjgy +TKJ9uZg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbfq9-00000007f9D-2Hso; Sun, 18 Feb 2024 12:00:13 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbfq6-00000007f8Q-2OSQ; Sun, 18 Feb 2024 12:00:11 +0000 X-UUID: 3e286a20ce5511ee9a263b4415211400-20240218 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:Message-ID:Date:Subject:CC:To:From; bh=TzhRI4cypCmqunSRf1qOngM5HMg8RqcBPftI0z984+k=; b=KLpdFM5j/y1cbr8/sYiFZx3Xt+l1UD17FTPCEAUmkSI44URW1a5pxJ0ZqFrHx17mXy6EFQ733h8d42nf7AYCR0cLfvBcY2otAiN6FOLQ3eg8CsH9c8uw/FEJQMODsEZtM7Oj3B3q6E6g2DHvL9dbKX4aTn42jdK8nNCSt+PCzV0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:39e3a19c-c3b6-4f1a-83be-6a229f78593b,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:e08a0484-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,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,TF_CID_SPAM_ULN X-UUID: 3e286a20ce5511ee9a263b4415211400-20240218 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1306743444; Sun, 18 Feb 2024 05:00:00 -0700 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Sun, 18 Feb 2024 19:59:57 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Sun, 18 Feb 2024 19:59:56 +0800 From: Irui Wang To: Hans Verkuil , Mauro Carvalho Chehab , Matthias Brugger , , Tiffany Lin , Yunfei Dong , "Maoguang Meng" , Longfei Wang CC: Irui Wang , , , , Subject: [PATCH] media: mediatek: vcodec: Handle VP9 superframe bitstream with 8 sub-frames Date: Sun, 18 Feb 2024 19:59:54 +0800 Message-ID: <20240218115954.4038-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 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--5.750200-8.000000 X-TMASE-MatchedRID: IJfQKf6xjE6Ue16iAyR+HGwjJ4TFeU1ujiWciALpTNN85Y+z3ulenvlY oV6p/cSxNZAOTDwYVno1wOHlbbYzTen2wHlv5vGungIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIHm9 ggFVoCcDdytBPL+XPG4A3JHtlS20dOtydYzqtvffie0XCVPLtzLJc3JXqjnqNftwZ3X11IV0= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--5.750200-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: F2090AF9C4AD7B26B2E5A28458883101736AB5C245AFA98C059F16668B64FC452000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240218_040010_640930_D9838481 X-CRM114-Status: GOOD ( 12.28 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The VP9 bitstream has 8 sub-frames into one superframe, the superframe index validate failed when reach 8, modify the index checking so that the last sub-frame can be decoded normally. Signed-off-by: Irui Wang --- .../media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c index 55355fa70090..4a9ced7348ee 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_if.c @@ -526,7 +526,7 @@ static void vp9_swap_frm_bufs(struct vdec_vp9_inst *inst) /* if this super frame and it is not last sub-frame, get next fb for * sub-frame decode */ - if (vsi->sf_frm_cnt > 0 && vsi->sf_frm_idx != vsi->sf_frm_cnt - 1) + if (vsi->sf_frm_cnt > 0 && vsi->sf_frm_idx != vsi->sf_frm_cnt) vsi->sf_next_ref_fb_idx = vp9_get_sf_ref_fb(inst); } @@ -735,7 +735,7 @@ static void get_free_fb(struct vdec_vp9_inst *inst, struct vdec_fb **out_fb) static int validate_vsi_array_indexes(struct vdec_vp9_inst *inst, struct vdec_vp9_vsi *vsi) { - if (vsi->sf_frm_idx >= VP9_MAX_FRM_BUF_NUM - 1) { + if (vsi->sf_frm_idx >= VP9_MAX_FRM_BUF_NUM) { mtk_vdec_err(inst->ctx, "Invalid vsi->sf_frm_idx=%u.", vsi->sf_frm_idx); return -EIO; }