From patchwork Fri Dec 2 07:47:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 28735 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp702626wrr; Thu, 1 Dec 2022 23:52:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf7sCceA25ETUAQ8D1rzAHCftLmlBUHaxyhYqj1pADFnr813sZfahc2FOMl9cFM7jqYZhYJ1 X-Received: by 2002:a05:6a00:1388:b0:574:d12e:f3d6 with SMTP id t8-20020a056a00138800b00574d12ef3d6mr33101165pfg.78.1669967534356; Thu, 01 Dec 2022 23:52:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669967534; cv=pass; d=google.com; s=arc-20160816; b=tKlsWYtiphjNHvYgO8DPmiAegpXLLE96stW6UV2+aIfNeVzjGsGuCyDprd+lHJs+6P L8F0O5DHczhqbGHV5yMRR7IUYI+BDEX8iFaUgpTHuNwAbqEnhzYpPbynL3lF+2/zQFdP gRkfKncvG63gc6kVcEpOV3vsWMpuWpcEGyx4UzXAOso6lY5DuFkakIMg2Smm8vYwKPXO d0ECL5yBL7TqE2EPS1FXgcbxoajJmaSnnjJfnivzVdzCQC7lW9BuR7oO7KISyxKN4W5m cO5oI+HlqQy83itrF8z7EbUhHlqsK1vCt5dw6urXylY5SE989EPB7ZR7xzxwyNVMaFfT 3NHw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cu3P7ryNMLoHtw08Bw8zwZYVi+5b7Hwih9KWC1ja8+o=; b=sCRgtJQsphsauodvk9pc5XBw8t7IX4CRjU6Wo0HbEMflwyUguL63uB3LNVbHTVNs3b v1RAl8YOK4Kp6I0yhqjfKvj5dJ4v5AH1+srmIdwkbkeVlTsvxOoYIluIIqe+1C4nX1jy FtJpg/IYhKhHos81Su/lIpqSXol3SwZzhK3eHr+PlRLXzalnKJPclJ+DDZKC2ciaXrXD J0RbFKb0OwVqsD6VGmjEaIxX4vq/p1GA8b3EjJerHYf9UiPmmiP+7Jf3MPYXUUhwZ+sQ CpUvvGAnkSTDshVHdzuaEeKs1iINv0HgSVrP0SOmolLXmcQlemhhmq5TcE8gKOVcdomG lRUQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Ur+1ayGQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i11-20020a17090acf8b00b002196e1485efsi5490157pju.55.2022.12.01.23.52.00; Thu, 01 Dec 2022 23:52:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Ur+1ayGQ; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232458AbiLBHr4 (ORCPT + 99 others); Fri, 2 Dec 2022 02:47:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbiLBHrx (ORCPT ); Fri, 2 Dec 2022 02:47:53 -0500 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2081.outbound.protection.outlook.com [40.107.21.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 029C3FCD3; Thu, 1 Dec 2022 23:47:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AXmhhOk2bdfa8h7gm2MeFLxoCeMBAaAIGHnIgxkpxhG7ijk49jfP/R7+9EcuT4VIhKZJVom2lX2D36W0iPkMvAgzNvIGGOWLLfWfMEdT6lOop1/lSUzsbhkRZ9lItIix344AlxFGCxUUABvFaPAwhGun9gZnxX4niPpHeI1/vJQG6fVEKAOENTHSlG0tgToMyDxcdNQ7vNuhWe1hyo3v5qw18yCyNWXh++zCF0cb+rsbOq8xfdqWtbJ7IlCYaZKM3rreMSA3VKWJ7TyfxUqzE+bUPWmNzLt+u+tWplTzxb56M7P80S4j6cTwzz6RsyWY0wanrGjzm8OpoPS3jBsEAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=cu3P7ryNMLoHtw08Bw8zwZYVi+5b7Hwih9KWC1ja8+o=; b=HQJuKbZQw8BdQTCN4K282Sh6kRcg7ef0uL6jHRQjm8OJSjvHEjb8Lc1145Wr3dwQNF3pTs+Rmf5Wh52LcLOXoa6q85Se9Sk2Bp7QBlakV+RTUlFSiONxFqNodt94owwiyL1yPL5kNitnx9ncpNdkxu2b+abl6anZ0lhNjR9A23UbZbxJhjT4ta6o1olpwtjtSknE5M4f+tMhlaps4Oa1a7d/dEDfEaQVIAeSGZevv+9xndkqaKWCxFx2ChqQb1CIvWxdktuxRGNPJIbVhP7yqfyjiuj0ks/omsk5htV7qcdPFnh17IhWxRnDa9abiNjaE7m3uQZv9mz6ZTLQmH0yTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cu3P7ryNMLoHtw08Bw8zwZYVi+5b7Hwih9KWC1ja8+o=; b=Ur+1ayGQ2r0joy9s3AxdWF+z4lAeYmStbEK0mP01yipMY5KNDBTVVGI7obYKqYgZZV1G7V1RNPKaQ8EWuKCQ9PNvgmFqlgmyMIQGn1bAA2IpVcXuDCZdeobcr7HIhrL2JSRdMQNBzhIahRxiZsnEi6f8HvCbMSsRPUMPT1wWyMM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AS1PR04MB9384.eurprd04.prod.outlook.com (2603:10a6:20b:4d8::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.8; Fri, 2 Dec 2022 07:47:49 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::4e64:fadc:30cf:4b86]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::4e64:fadc:30cf:4b86%5]) with mapi id 15.20.5857.023; Fri, 2 Dec 2022 07:47:49 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/2] media: add Sorenson Spark video format Date: Fri, 2 Dec 2022 15:47:16 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI1PR02CA0015.apcprd02.prod.outlook.com (2603:1096:4:1f7::18) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AS1PR04MB9384:EE_ X-MS-Office365-Filtering-Correlation-Id: 10411770-fece-4316-7632-08dad4398279 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/PyysXWkQbdorpsyULn5k9MUSaWsRQVmt5y0Aa/fBEHgj5ELc3YNHsOtKp3VAWTowzdtdHJRjTAwbpo3GtjILsDEJeTICKSmNzRh7+7uZlldv/NCToh312YothKm4L8N2jnY924WscEo2t5Dhfp163KIAPfjeyQqZ0oB7op1AzaeNCqyVf+tgvuUySRdw+kWNRDFLgh7McLQpq59/ycDCnU7a1v5VfeRpQHdnTdEwFy9oeouY4sC99JFYU5lq1zUZo0C33nxpZ10+IMeNiqHQQPn6i+bva6E7QKrpHhDlHPyjVgsW5FXveTUAsVtT4H4EKODBtmyXdwbnwFd/jisQxMJ9G5ZvNjelK7gsvb5taoYkDVmmluZHNhnV+ZURqYPJE5p2brDw6eBo5h16PVrBXgJ/IC1jPXlPfMGQxwsae/yJD6UQd8l0P7j2WjFDq0rvFEko/NTwJ/1gO/cn6SlVnfaAZMmV5YUE75lHyOyhR+2mfa/TZIyjkXoE+sEkrkq47pk2uOKNIwM+h80L/MrmIJoAo3znT0D7SEuCKrvmH2BvUFKpF/9AFGyJXJisqq1QZ+vYyyN6+xVEUQ1mfb4p1HMc/I3dhsYj4adPbq8BAsSJ+elaJTR79YY4gJWHyZcn2IkGyD3eyOtk8gDJL/xnz5x0OXPEQXGM725hvhkLjn0EeQp/Zizv/RI+l+1Pc6 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(376002)(136003)(366004)(39860400002)(346002)(396003)(451199015)(36756003)(86362001)(6486002)(316002)(44832011)(5660300002)(8936002)(4326008)(66946007)(8676002)(7416002)(41300700001)(66476007)(478600001)(66556008)(38350700002)(38100700002)(6506007)(6666004)(2906002)(52116002)(26005)(6512007)(186003)(2616005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lSWIVt/P8J1IYT+2szbhEQ9Aw0gqkhqIRerm2w2JLeSinSG41WE1CYpfXzvDLaqbQo6uR8bzp4R2ttBbDndpjzHsExGlbTUyRZtUMwEtEXTPv9gqTvf18L6sXHwkE2MBb+FyDGpmGAPyQwL0B3PYCtHPax1tB7cDE/1hggE7iaAkb9gxRJU8vXBTsW7bFxKUdNSzH5PYl45PtKkBiijkMU6tXEj8gC0adwHHzkGZUOcSNnGYyqH5LOcBa2NoG4xMOSGssby1I3tIvN/BBQ+tP1TU2KYVFPcShuhVLTKwRhESNeuTXDRHl5veqoEgmlYvMkeBD/CFq3IV0mywZrvbQRtSWfJ8M+vV56lwO+H8hGlwCu81ZUMlbEGSHwoOgP1UlcQj5GzxbCKomcC49QZOYLr0U55pTD8gTiq4d7CTx/2nMVpqLmj2uil8wA1vgMSoeoTNTOlpfDXF71ntDrWA8vsVM5GmKSZh5VAs9cFXydaY2BW/xgm8QUHEH64WBLO/hwKj77R6u3/jBCgoBy+kBdFlLY1bSMcsUMQRQJIpbXnORVkPWdnXpSj840wPNqHycUNHivGIKHS9FWPdiNnDKiAcdSuP2KxBKFc7Vi/ni0WzQ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ource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2022 07:47:49.4506 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Vno4Dmb1Y+A8LwbJW4bUgEmzVuPZmwMR33ZtL3xetYT5GX8XH/J/1LzDWcpyo9XC8srhowjDtSRd/xu/uevI+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9384 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751087877367701691?= X-GMAIL-MSGID: =?utf-8?q?1751087877367701691?= Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files. Sorenson Spark is an incomplete implementation of H.263. It differs mostly in header structure and ranges of the coefficients. Signed-off-by: Ming Qian --- Documentation/userspace-api/media/v4l/pixfmt-compressed.rst | 5 +++++ drivers/media/v4l2-core/v4l2-ioctl.c | 1 + include/uapi/linux/videodev2.h | 1 + 3 files changed, 7 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst index 506dd3c98884..8794b92fde36 100644 --- a/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst +++ b/Documentation/userspace-api/media/v4l/pixfmt-compressed.rst @@ -88,6 +88,11 @@ Compressed Formats - ``V4L2_PIX_FMT_H263`` - 'H263' - H263 video elementary stream. + * .. _V4L2-PIX-FMT-SPK: + + - ``V4L2_PIX_FMT_SPK`` + - 'Sorenson Spark' + - Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files * .. _V4L2-PIX-FMT-MPEG1: - ``V4L2_PIX_FMT_MPEG1`` diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index d5a259db55b0..ee4196b9d71f 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1478,6 +1478,7 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) case V4L2_PIX_FMT_HEVC_SLICE: descr = "HEVC Parsed Slice Data"; break; case V4L2_PIX_FMT_FWHT: descr = "FWHT"; break; /* used in vicodec */ case V4L2_PIX_FMT_FWHT_STATELESS: descr = "FWHT Stateless"; break; /* used in vicodec */ + case V4L2_PIX_FMT_SPK: descr = "Sorenson Spark"; break; case V4L2_PIX_FMT_CPIA1: descr = "GSPCA CPiA YUV"; break; case V4L2_PIX_FMT_WNVA: descr = "WNVA"; break; case V4L2_PIX_FMT_SN9C10X: descr = "GSPCA SN9C10X"; break; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 0e2ccd7dc877..0f905abbd15a 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -739,6 +739,7 @@ struct v4l2_pix_format { #define V4L2_PIX_FMT_FWHT_STATELESS v4l2_fourcc('S', 'F', 'W', 'H') /* Stateless FWHT (vicodec) */ #define V4L2_PIX_FMT_H264_SLICE v4l2_fourcc('S', '2', '6', '4') /* H264 parsed slices */ #define V4L2_PIX_FMT_HEVC_SLICE v4l2_fourcc('S', '2', '6', '5') /* HEVC parsed slices */ +#define V4L2_PIX_FMT_SPK v4l2_fourcc('S', 'P', 'K', '0') /* Sorenson Spark */ /* Vendor-specific formats */ #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ From patchwork Fri Dec 2 07:47:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 28736 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp702704wrr; Thu, 1 Dec 2022 23:52:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf4iP0+Ayfd07smI6UEFyx8NqHY9JU97oVG8C3Sp9dQmzu5SXYyA87UP3RJfvA/H9eh45nSo X-Received: by 2002:a17:902:7006:b0:181:b55a:f987 with SMTP id y6-20020a170902700600b00181b55af987mr52254620plk.67.1669967549238; Thu, 01 Dec 2022 23:52:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669967549; cv=pass; d=google.com; s=arc-20160816; b=ffkwG/jZUIqnSeNBH1sYw6uBCH5lWf+Hq17v2AfLeMdkZ8driIeSWNVp1jatmIg1rh 8mruXh7piXzQysj1j8hNVETTWIZEFznqf6PlPjUFqZvslKSva5zcnj+wqaVKIkVa+Ugb fPyXUw2rmwk/j9xD8Z9/c22HWdrS0VGof2qbwhiS6O0DNbGtNV8X5P2vEaID2j6/+JaR OoidN82qV4ZITcEQPRK4UDD96DTDEct9zpnxnxyDwP9smSye/KVhjI7jchb/yKgN8kr2 aoxhATYVA9v7dr2YU+wwQvpdCrOzPUiM+gCFs3/lQo1lUUIZbq6zshVjKl/nwv+h2wTS RveQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fmo9r4dCtCA/pxiFPT/rVXfK/Ozo6bHQOtSI5P6fCwA=; b=Z2dRAH+c1PpaLgvxsL+7PBMe8eJcwDMeDao252uvcQM2k4vlRDGqSdeNFFuPbZqQ3M Sf1b2iKvMeFHyob39rUsxE2QY57vYkmUK9V/SUQZTdEQubOXpbiv6F6HDU98oteficPD +/cjcY4DynNVyzN3GCE/OufGhm3j3OMO1naBIwLILP7PDz/2sUm4d5sGrqjO+abpc9p0 xt+yBT1+6acMiHXVPXZNJ+WOBdS6OeNOwOU53WyjTOj/LXY0YDL5//JlKDA4LjvQXlO/ 2cNqfbnK7tXA0THMztPPJL56gMCmaSZGPeKWQTod/ujB2L7KfVAyfBD3DvodMmfQLVQS uVrg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=obO+xIBT; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24-20020a633758000000b00478704a1c21si4550861pgn.663.2022.12.01.23.52.16; Thu, 01 Dec 2022 23:52:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=obO+xIBT; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232185AbiLBHsG (ORCPT + 99 others); Fri, 2 Dec 2022 02:48:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232464AbiLBHr5 (ORCPT ); Fri, 2 Dec 2022 02:47:57 -0500 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2057.outbound.protection.outlook.com [40.107.22.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8DD5205FA; Thu, 1 Dec 2022 23:47:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gfRuyB2NYrc6XganfoFTY94yNuupTwcg3HDyV0n31t3cb+v4yb9YLUymLMTWyopDgF8u+Uco4HoIvYgdMvt76J2IepcbPoaSGj+rjQh+kF2c6dZA744TLVSYNILJRdUqS4by2/gO9ZVNNACFuLZ5ppu81peu4X/es4tNg6QliL5vyyrfTFFrd93VqfVSyj3hRooE93OJIlBIKEasCtLEOANuL2BQvYbeRhU0QtVaKnb8LWlDzTRT/Cennu0eqkJQq329EJIDiN7uLgTZ0gwAC2hD2bVFsRCDXB0Hd6y6IeXfQIKYFJetelTB1/OqROWJT2ZWXyYD3TFbSpd2dJJXgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=fmo9r4dCtCA/pxiFPT/rVXfK/Ozo6bHQOtSI5P6fCwA=; b=HkhDMjZR+k1dz42cuFt+S3hGlmK70Wdi7C87blOJmx2PWHJhrDasWne2lKKpgujKi0U30ZNn7aZLF0PhbsVeG6QZHJjI0aiQxgsrp/S/CpIjmCAkfNXt6fIZqxxRxxNQ/pc26bTmSufOH0LQSCJiiWT3kW1A/eo+V4BcAle82+Hitk7274U4qXrDZoNfmL0gDtKAojxFGgqtkuah0Z0vQN9qaqBoef3Uq8sXYBzixrgKCtyW4HWxOnoTkEIWLTdrFnvPpV8eFoSYplUV0XwfVkmTDtb97gYsUeLd+2PWMKMa+Pmh5ksUTmbR5yoMvrceH7UbK2nuoWFykjkJv3ZfXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fmo9r4dCtCA/pxiFPT/rVXfK/Ozo6bHQOtSI5P6fCwA=; b=obO+xIBT3DqIbYqnnp/5MVsZX62EBkjPRRgsVtVvw3Fb/M402r0lBCIypJKjERKsertI/Mz06AqslgS5fursoCDCj8SYJR+aIglsQ1ozPCTWXvijl/rTCAsBffuZEGqVAZYVyylkcBkgOqoAL5vpj1sJm8lbz71j7fuoS+gMbdk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by AS8PR04MB8232.eurprd04.prod.outlook.com (2603:10a6:20b:3b2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5857.20; Fri, 2 Dec 2022 07:47:53 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::4e64:fadc:30cf:4b86]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::4e64:fadc:30cf:4b86%5]) with mapi id 15.20.5857.023; Fri, 2 Dec 2022 07:47:53 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, ming.zhou@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/2] media: amphion: support to decode sorenson spark video Date: Fri, 2 Dec 2022 15:47:17 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI1PR02CA0015.apcprd02.prod.outlook.com (2603:1096:4:1f7::18) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|AS8PR04MB8232:EE_ X-MS-Office365-Filtering-Correlation-Id: ed6df154-6fb5-4eb6-b463-08dad43984c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ODT1d5ramsCRZQPlZ17Mq76K2A+2Q+RAp8IwMqcHoaoo5tCaI6hbyUdC3DV4SXIzHqtPfPr4ASXmSURzlmImdqAhOiaKwbHOl2pmzfHJqY+SPJ3se2jj4GjJNeRz8GdQOZSAi/EoJaEuhfwl28eMHc0Tn8MPRAxnHZjA5euQXsKhGbjTuiM95j0D/GnYQPGQCkqkRhLjfdjUkA8LHeS1EE7FWjeaiLcLTcuSO9iX/8ZxdaDFURE0iFB/dt88C09C4CibC9ONRru9nkkUO1lvmAtkfo807oUG+kyvyV38wbmxgyl2gnC17EL4f6eaBQwzljhi5RvF7MkuteuSYmNx/U7w4KB3VK1UcI3YIE18lWKQPuN6zkznlcYndk0mMLf9NpbcoAvqyyORhWKRx7rM7TO6W4uX5j/dsSKufb+MhLcBA3UAQeGrCJpOBe6oXxRLZG5YHHfhC0/UjTO9bdMgpyOMlPfd0BohbnjvXEPrKIrqxglInns3ZylUyj9nZuBB+m92wboRJAKtrztGvB8C19txBwodqaUbjlq5zS1eXXOOIZGDitz3ZlrM29RxlxoKiYpbJQcc66EtmYPRXfUAQnJOkHv21fMYdLKk0E0Fp1f2OHAtTj1nZAb23zAuXIbV8FdeAdIQI6TpeFqJFOeM6cpIz30gKt4c0pcP2Ga2ESwrl38ojOUNqq5NQgQeTT1ljDmCojbixk3y6FCtdcVI6w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(366004)(396003)(346002)(39860400002)(451199015)(41300700001)(4326008)(186003)(86362001)(44832011)(2616005)(8936002)(7416002)(36756003)(5660300002)(478600001)(6486002)(38100700002)(38350700002)(26005)(66476007)(66946007)(8676002)(66556008)(316002)(6506007)(6512007)(6666004)(52116002)(2906002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: +LfIKAr98kG7yUCglB2DODt6dMt1pEScYFn2eJ3FhlZd8uw38cUnjCbu1Hnz8WUBph/t+B5Ro/n8hn0rYcgXDRoLTO0VRFa788hTvrOT+0YZjh8QW2ykJSibdm0UaNeBzQGKap0Mgu5bGfH6b++kLvJck2/erWBDcPylcrox22BM6Heso3rG1FE2sqSA6QzHwZhZsK8qV1RWW2rCbmipPlC1Q3lpRrrulLTIom0GEhVPYdXKMWbhOraRM/5lSr1ZHko/MIm7EBWIy8hAXKVJdytA7MyQU4n+QuOjPGcajlJ4puySPfhziib/+5kQfenst1FkdjzJDafYG1+ROwllqiJxQvn8kPtwdqhZw4y63+E4TKGECT3kURQBMppFP1bB7iokmdYQISHVphf/MPYG7c+ymF5JmZsF12ExgRWR0HVutLrlnQDAyIqNge4TbD0PfciMlEKoslOZ3crzsOgwCqX4fivhawFTCsD5g0av5Nx4T7W2RibCuxB6j73RUECm5w8PtDcd0j1QJhfBMKx6NB3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X-MS-Exchange-CrossTenant-Network-Message-Id: ed6df154-6fb5-4eb6-b463-08dad43984c8 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2022 07:47:53.4035 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: nISHXp3osycJ0csxe54b//m9DLkK3KLtdcukTwR0oV7kz7OtSelBwn/ohIPnH6xPU8Y2pb2znd8sljZabJ3UOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8232 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751087893050882839?= X-GMAIL-MSGID: =?utf-8?q?1751087893050882839?= Sorenson Spark is an implementation of H.263 for use in Flash Video and Adobe Flash files. amphion decoder can support it by insert some startcode before sequence and picture. Signed-off-by: Ming Qian --- drivers/media/platform/amphion/vdec.c | 7 +++++++ drivers/media/platform/amphion/vpu_malone.c | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/drivers/media/platform/amphion/vdec.c b/drivers/media/platform/amphion/vdec.c index 87f9f8e90ab1..09304b96f40d 100644 --- a/drivers/media/platform/amphion/vdec.c +++ b/drivers/media/platform/amphion/vdec.c @@ -165,6 +165,13 @@ static const struct vpu_format vdec_formats[] = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED }, + { + .pixfmt = V4L2_PIX_FMT_SPK, + .mem_planes = 1, + .comp_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE, + .flags = V4L2_FMT_FLAG_DYN_RESOLUTION | V4L2_FMT_FLAG_COMPRESSED + }, {0, 0, 0, 0}, }; diff --git a/drivers/media/platform/amphion/vpu_malone.c b/drivers/media/platform/amphion/vpu_malone.c index 2c9bfc6a5a72..67ba637c4c7f 100644 --- a/drivers/media/platform/amphion/vpu_malone.c +++ b/drivers/media/platform/amphion/vpu_malone.c @@ -562,6 +562,7 @@ static struct malone_fmt_mapping fmt_mappings[] = { {V4L2_PIX_FMT_H263, MALONE_FMT_ASP}, {V4L2_PIX_FMT_JPEG, MALONE_FMT_JPG}, {V4L2_PIX_FMT_VP8, MALONE_FMT_VP8}, + {V4L2_PIX_FMT_SPK, MALONE_FMT_SPK}, }; static enum vpu_malone_format vpu_malone_format_remap(u32 pixelformat) @@ -987,6 +988,7 @@ static const struct malone_padding_scode padding_scodes[] = { {SCODE_PADDING_EOS, V4L2_PIX_FMT_XVID, {0xb1010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_H263, {0xb1010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_VP8, {0x34010000, 0x0}}, + {SCODE_PADDING_EOS, V4L2_PIX_FMT_SPK, {0x34010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_JPEG, {0xefff0000, 0x0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H264, {0x0B010000, 0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H264_MVC, {0x0B010000, 0}}, @@ -998,6 +1000,7 @@ static const struct malone_padding_scode padding_scodes[] = { {SCODE_PADDING_ABORT, V4L2_PIX_FMT_XVID, {0xb1010000, 0x0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_H263, {0xb1010000, 0x0}}, {SCODE_PADDING_ABORT, V4L2_PIX_FMT_VP8, {0x34010000, 0x0}}, + {SCODE_PADDING_ABORT, V4L2_PIX_FMT_SPK, {0x34010000, 0x0}}, {SCODE_PADDING_EOS, V4L2_PIX_FMT_JPEG, {0x0, 0x0}}, {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264, {0x15010000, 0x0}}, {SCODE_PADDING_BUFFLUSH, V4L2_PIX_FMT_H264_MVC, {0x15010000, 0x0}}, @@ -1411,6 +1414,16 @@ static int vpu_malone_insert_scode_vp8_pic(struct malone_scode_t *scode) return size; } +static int vpu_malone_insert_scode_spk_seq(struct malone_scode_t *scode) +{ + return vpu_malone_insert_scode_seq(scode, MALONE_CODEC_ID_SPK, 0); +} + +static int vpu_malone_insert_scode_spk_pic(struct malone_scode_t *scode) +{ + return vpu_malone_insert_scode_pic(scode, MALONE_CODEC_ID_SPK, 0); +} + static const struct malone_scode_handler scode_handlers[] = { { /* fix me, need to swap return operation after gstreamer swap */ @@ -1427,6 +1440,11 @@ static const struct malone_scode_handler scode_handlers[] = { .insert_scode_seq = vpu_malone_insert_scode_vp8_seq, .insert_scode_pic = vpu_malone_insert_scode_vp8_pic, }, + { + .pixelformat = V4L2_PIX_FMT_SPK, + .insert_scode_seq = vpu_malone_insert_scode_spk_seq, + .insert_scode_pic = vpu_malone_insert_scode_spk_pic, + }, }; static const struct malone_scode_handler *get_scode_handler(u32 pixelformat)