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=-3.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_NEOMUTT autolearn=ham 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 30C9AC43381 for ; Wed, 6 Mar 2019 10:57:25 +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 EB2B520675 for ; Wed, 6 Mar 2019 10:57:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="DwBtlKOd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EB2B520675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com 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-Type:Cc: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4QIzadiWqm1xGw620c+KBDVgVzNC3ZVfTZq5qeDUJ7w=; b=DwBtlKOdw5vWmOQMO8YAP4NTK YfFC6m3D+PVJrQKmke9TBjIumpz2KMWR7MnqYoBV7p7Wk/9Ke4Yn5D0MC1ZQQQN3cTMwQTXUux1cb sWHrQ5KPm/pbU1nB1AzYTVBGHnEgv+13sAQtxIssboighdsMZMchA0o7KUSqRhteuKyNf2A6EpGkR yw+6EhBze2tXZQImRnvP2HKLk86KlLVNwHUK3I6bRWoB+b/208TahvNdQr8ocROTHNI5AG2ZfIa8v zI4EmfvQ1sWfK/eDrVO6oIgx8pwOzBKU0NbTamkXI9noUgGjELzyBoIWuZeqafiiocaOvBpH6OFU6 8idfCZ40Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1UEk-0001NQ-7H; Wed, 06 Mar 2019 10:57:22 +0000 Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1UEg-0001MI-PY for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2019 10:57:20 +0000 X-Originating-IP: 90.88.150.179 Received: from localhost (aaubervilliers-681-1-31-179.w90-88.abo.wanadoo.fr [90.88.150.179]) (Authenticated sender: maxime.ripard@bootlin.com) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id D185F20003; Wed, 6 Mar 2019 10:57:08 +0000 (UTC) Date: Wed, 6 Mar 2019 11:57:08 +0100 From: Maxime Ripard To: Jernej =?utf-8?Q?=C5=A0krabec?= Subject: Re: [PATCH v4 2/2] media: cedrus: Add H264 decoding support Message-ID: <20190306105708.kjp7xjom42azhl6y@flea> References: <1717029.ugS2kBEt89@jernej-laptop> <20190305101732.3eylxubiiboygjc5@flea> <7218484.YqF67YIo71@jernej-laptop> MIME-Version: 1.0 In-Reply-To: <7218484.YqF67YIo71@jernej-laptop> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190306_025719_135974_E01DE2FA X-CRM114-Status: GOOD ( 28.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , acourbot@chromium.org, jonas@kwiboo.se, jenskuske@gmail.com, linux-sunxi@googlegroups.com, linux-kernel@vger.kernel.org, tfiga@chromium.org, Paul Kocialkowski , Chen-Yu Tsai , hans.verkuil@cisco.com, Laurent Pinchart , sakari.ailus@linux.intel.com, nicolas.dufresne@collabora.com, ezequiel@collabora.com, posciak@chromium.org, linux-media@vger.kernel.org Content-Type: multipart/mixed; boundary="===============5134176306224944980==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============5134176306224944980== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5oodpt76mqik6m2b" Content-Disposition: inline --5oodpt76mqik6m2b Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Tue, Mar 05, 2019 at 06:05:08PM +0100, Jernej =C5=A0krabec wrote: > Dne torek, 05. marec 2019 ob 11:17:32 CET je Maxime Ripard napisal(a): > > Hi Jernej, > >=20 > > On Wed, Feb 20, 2019 at 06:50:54PM +0100, Jernej =C5=A0krabec wrote: > > > I really wanted to do another review on previous series but got distr= acted > > > by analyzing one particulary troublesome H264 sample. It still doesn't > > > work correctly, so I would ask you if you can test it with your stack= (it > > > might be userspace issue): > > >=20 > > > http://jernej.libreelec.tv/videos/problematic/test.mkv > > >=20 > > > Please take a look at my comments below. > >=20 > > I'd really prefer to focus on getting this merged at this point, and > > then fixing odd videos and / or setups we can find later > > on. Especially when new stacks are going to be developped on top of > > this, I'm sure we're going to have plenty of bugs to address :) >=20 > I forgot to mention, you can add: > Reviewed-by: Jernej Skrabec >=20 > once you fix issues. Great, thanks :) > > > > + for (i =3D 0; i < ARRAY_SIZE(pred_weight->weight_factors); i++) { > > > > + const struct v4l2_h264_weight_factors *factors =3D > > > > + &pred_weight->weight_factors[i]; > > > > + > > > > + for (j =3D 0; j < ARRAY_SIZE(factors->luma_weight); j++)=20 > { > > > > + u32 val; > > > > + > > > > + val =3D ((factors->luma_offset[j] & 0x1ff) <<=20 > 16) > > > >=20 > > > > + (factors->luma_weight[j] & 0x1ff); > > > > + cedrus_write(dev, VE_AVC_SRAM_PORT_DATA, > > >=20 > > > val); > > >=20 > > > You should cast offset varible to wider type. Currently some videos w= hich > > > use prediction weight table don't work for me, unless offset is caste= d to > > > u32 first. Shifting 8 bit variable for 16 places gives you 0 every ti= me. > >=20 > > I'll do it. > >=20 > > > Luma offset and weight are defined as s8, so having wider mask doesn't > > > really make sense. However, I think weight should be s16 anyway, beca= use > > > standard says that it's value could be 2^denominator for default valu= e or > > > in range -128..127. Worst case would be 2^7 =3D 128 and -128. To cove= r both > > > values you need at least 9 bits. > >=20 > > But if I understood the spec right, in that case you would just have > > the denominator set, and not the offset, while the offset is used if > > you don't use the default formula (and therefore remains in the -128 > > 127 range which is covered by the s8), right? >=20 > Yeah, default offset is 0 and s8 is sufficient for that. I'm talking abou= t=20 > weight. Default weight is "1 << denominator", which might be 1 << 7 or 12= 8. >=20 > We could also add a flag, which would signal default table. In that case = we=20 > could just set a bit to tell VPU to use default values. Even if some VPUs= need=20 > default table to be set explicitly, it's very easy to calculate values as= =20 > mentioned in previous paragraph. Yeah, sorry, I meant weight. Would that make any difference? Can we have situations where both the denominator and the weight would be set, with the weight set to 128? I've checked in the libva and ffmpeg, and libva uses a short, while ffmpeg uses an int, both for the weight and offset. For consistency I guess we could change both to shorts just like libva? What do you think? Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --5oodpt76mqik6m2b Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXH+nhAAKCRDj7w1vZxhR xY4fAP9lDiwgT+3oYdujG6kE1Qyw1W4wyCTqTi0jgm7oujeTagD/U74819AYc2pA 7h2l8gSdhU9KRQ2Xg8ChzPaFgR1v1ww= =/2so -----END PGP SIGNATURE----- --5oodpt76mqik6m2b-- --===============5134176306224944980== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============5134176306224944980==--