From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99F2EC282DD for ; Wed, 8 Jan 2020 14:12:17 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 6106A20643 for ; Wed, 8 Jan 2020 14:12:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DaHPKobd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6106A20643 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZWj5thQmXGM86CuRBjVhF0W98E6xPL2l/ppmwqvKv4o=; b=DaHPKobdH7W860 8dfgqnsFpHyZ9RRvlzEaA99GdSfzApUa33EluPW8JfxuHowh6rQMYXjCmgErlGR320WYRJBE5Ftf5 VX5ycGGk6W8N+3q2Y1Mb0JQjNB4jN8Amu241xswe5JhKINY7Gs2czn3wUSQ84hLHdbb7yPcNFXTgg VyudncQgecMLJxZIxe9Tvb5rTqBHV1UgztRkRBbqkWn5Ua/UwFDvfGR2eYZFg20b4a4maihAAsLo5 jzlKrZ8Tv03uqgP1/WPlEbl9GYqle6yzQ79pFTzbJuslOk1OqpGuCJlpTg1sYPQO8dVU+yQdUjHKS Ew7nRWpFo3lzglrpzDWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipC4G-0002UK-Fb; Wed, 08 Jan 2020 14:12:16 +0000 Received: from 177.206.132.169.dynamic.adsl.gvt.net.br ([177.206.132.169] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipC4B-0002T4-CD; Wed, 08 Jan 2020 14:12:12 +0000 Date: Wed, 8 Jan 2020 15:11:57 +0100 From: Mauro Carvalho Chehab To: Jernej Skrabec Subject: Re: [PATCH v2 1/4] media: uapi: hevc: Add scaling matrix control Message-ID: <20200108151157.17cf9774@kernel.org> In-Reply-To: <20191213160428.54303-2-jernej.skrabec@siol.net> References: <20191213160428.54303-1-jernej.skrabec@siol.net> <20191213160428.54303-2-jernej.skrabec@siol.net> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, hverkuil@xs4all.nl, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Em Fri, 13 Dec 2019 17:04:25 +0100 Jernej Skrabec escreveu: > HEVC has a scaling matrix concept. Add support for it. > +struct v4l2_ctrl_hevc_scaling_matrix { > + __u8 scaling_list_4x4[6][16]; > + __u8 scaling_list_8x8[6][64]; > + __u8 scaling_list_16x16[6][64]; > + __u8 scaling_list_32x32[2][64]; > + __u8 scaling_list_dc_coef_16x16[6]; > + __u8 scaling_list_dc_coef_32x32[2]; > +}; I never looked at HEVC spec, but the above seems really weird. Please correct me if I am wrong, but each of the above matrixes is independent, and the driver will use just one of the above on any specific time (for a given video output node), right? If so, why would userspace be forced to update lots of matrixes, if would likely use just one at a given time? IMO, the proper way would be, instead, to use an uAPI like: /* * Actually, as this is uAPI, we will use a fixed size integer type, like * unsigned int */ enum hevc_scaling_matrix_type { HEVC_SCALING_MATRIX_4x4, HEVC_SCALING_MATRIX_8x8, ... HEVC_SCALING_MATRIX_DC_COEF_32x32, }; struct v4l2_ctrl_hevc_scaling_matrix { __u32 scaling_type /* as defined by enum hevc_scaling_matrix_type */ union { __u8 scaling_list_4x4[6][16]; __u8 scaling_list_8x8[6][64]; __u8 scaling_list_16x16[6][64]; __u8 scaling_list_32x32[2][64]; __u8 scaling_list_dc_coef_16x16[6]; __u8 scaling_list_dc_coef_32x32[2]; }; }; And let the core use a default for each scaling matrix, if userspace doesn't set it. Cheers, Mauro _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2C136C282DD for ; Wed, 8 Jan 2020 14:12:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0072920720 for ; Wed, 8 Jan 2020 14:12:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578492742; bh=nXRbCIvWFni5/kkEcOEpwe39xSL34pDogwAjsOuipRg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=BRp1sP6r5ESBy/lrBR3yXum6SmjQz3KKjmkGhFXvNZjnHZi6S6EMyYBlDWwGTry+P 6qi/p9owRx0NMd6jT2Nl5RqyF1fGK9eqyp+fDeT/l6MvFCGKu3RcXx9ChKREyq6OPM zQbFo3novaj6mB/h2fXvynElQ/u3z3T4wbed5jkg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728782AbgAHOMV (ORCPT ); Wed, 8 Jan 2020 09:12:21 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:57434 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727600AbgAHOMV (ORCPT ); Wed, 8 Jan 2020 09:12:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=fr9fRlz5jxrgjkeY4j9Bve4Yqtw4Ip+E2iegvsEk9jk=; b=PBzy4YDRvknqyOdLQyAz3OMtm VKkkh+lcwJHiQz+AfDbo+JFL3kwsaJHo0GP4eQ8xuTmZMbnDEP1UIVlsYdY9sYN3rs+1rf0xxZbiZ uX3ZrF1B8p/4OBrNzTU8JIOyEnxcyNQP+IfxRWacyHfRad6gde1Zo/Gpf56CeHm/wldNEzh8Hmso0 XfCRsmv1Lov+rld2P3P20MUTPD68Xk90QyZS3/2/tyX9XLhmtQHR77JFpnkYnsibTNaOFMihoeAqR zQ51DvLE3lb5zfsz3bVNcIcFgF2uu/bE/q82ktdyTec8YZnpCyVysC1o0iBO3Wtj9V4iO+U8ERZq8 3wHU2WqDw==; Received: from 177.206.132.169.dynamic.adsl.gvt.net.br ([177.206.132.169] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1ipC4B-0002T4-CD; Wed, 08 Jan 2020 14:12:12 +0000 Date: Wed, 8 Jan 2020 15:11:57 +0100 From: Mauro Carvalho Chehab To: Jernej Skrabec Cc: mripard@kernel.org, paul.kocialkowski@bootlin.com, hverkuil@xs4all.nl, gregkh@linuxfoundation.org, wens@csie.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 1/4] media: uapi: hevc: Add scaling matrix control Message-ID: <20200108151157.17cf9774@kernel.org> In-Reply-To: <20191213160428.54303-2-jernej.skrabec@siol.net> References: <20191213160428.54303-1-jernej.skrabec@siol.net> <20191213160428.54303-2-jernej.skrabec@siol.net> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Em Fri, 13 Dec 2019 17:04:25 +0100 Jernej Skrabec escreveu: > HEVC has a scaling matrix concept. Add support for it. > +struct v4l2_ctrl_hevc_scaling_matrix { > + __u8 scaling_list_4x4[6][16]; > + __u8 scaling_list_8x8[6][64]; > + __u8 scaling_list_16x16[6][64]; > + __u8 scaling_list_32x32[2][64]; > + __u8 scaling_list_dc_coef_16x16[6]; > + __u8 scaling_list_dc_coef_32x32[2]; > +}; I never looked at HEVC spec, but the above seems really weird. Please correct me if I am wrong, but each of the above matrixes is independent, and the driver will use just one of the above on any specific time (for a given video output node), right? If so, why would userspace be forced to update lots of matrixes, if would likely use just one at a given time? IMO, the proper way would be, instead, to use an uAPI like: /* * Actually, as this is uAPI, we will use a fixed size integer type, like * unsigned int */ enum hevc_scaling_matrix_type { HEVC_SCALING_MATRIX_4x4, HEVC_SCALING_MATRIX_8x8, ... HEVC_SCALING_MATRIX_DC_COEF_32x32, }; struct v4l2_ctrl_hevc_scaling_matrix { __u32 scaling_type /* as defined by enum hevc_scaling_matrix_type */ union { __u8 scaling_list_4x4[6][16]; __u8 scaling_list_8x8[6][64]; __u8 scaling_list_16x16[6][64]; __u8 scaling_list_32x32[2][64]; __u8 scaling_list_dc_coef_16x16[6]; __u8 scaling_list_dc_coef_32x32[2]; }; }; And let the core use a default for each scaling matrix, if userspace doesn't set it. Cheers, Mauro