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=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, FROM_EXCESS_BASE64,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH, URIBL_BLOCKED autolearn=unavailable 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 082ACC28CC6 for ; Mon, 3 Jun 2019 15:37:28 +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 CDE8A24769 for ; Mon, 3 Jun 2019 15:37:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pMaf6o2e" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CDE8A24769 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=siol.net 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:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KFizVF43UFpipwHcKHvu5ygGhvRn+P3Eyn6jYkBzR+w=; b=pMaf6o2eMnOrXj 2/QacQInvrfu0IpxbxpcTRGnSmirD5Tz+lI9NqkfAWYfXXVDY2z+HDMr5i6f6CM2MbrSIbgmCALJ0 2WUH2UlWgNT7Yflk5LbkP3ncMtVKZ0Lu/w8R9agW3ML4KPrXfZuibn6YquuumZhPSa8ucQnv59BLH NmruyW1SYw3hxr26MnKluAJnwh+OlCvrAWkX7SBq0e8BVWvqsX6oZ1aVEYFKca95jQKgA+x5+KhlT LvrSdHgCeRY+QvwOO+AdNvG8ZireC/O9YwzK6x7Lp6sohPhtxKibS5F7Nx4PLIXD6QI/59CBc3Ibl BCAF3fSIZWZ2AmNIMvgQ==; 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 1hXp1Z-0001iy-EW; Mon, 03 Jun 2019 15:37:25 +0000 Received: from mailoutvs28.siol.net ([185.57.226.219] helo=mail.siol.net) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hXp1V-0001hu-43 for linux-arm-kernel@lists.infradead.org; Mon, 03 Jun 2019 15:37:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 41407520580; Mon, 3 Jun 2019 17:37:18 +0200 (CEST) X-Virus-Scanned: amavisd-new at psrvmta10.zcs-production.pri Received: from mail.siol.net ([127.0.0.1]) by localhost (psrvmta10.zcs-production.pri [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id y2fQPCRP4Vjv; Mon, 3 Jun 2019 17:37:17 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id DA31B520F55; Mon, 3 Jun 2019 17:37:17 +0200 (CEST) Received: from jernej-laptop.localnet (cpe-86-58-52-202.static.triera.net [86.58.52.202]) (Authenticated sender: jernej.skrabec@siol.net) by mail.siol.net (Postfix) with ESMTPA id 89BE3520580; Mon, 3 Jun 2019 17:37:17 +0200 (CEST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Maxime Ripard Subject: Re: [PATCH 3/7] media: cedrus: Fix decoding for some H264 videos Date: Mon, 03 Jun 2019 17:37:17 +0200 Message-ID: <2536664.ljALn0aKaT@jernej-laptop> In-Reply-To: <20190603115536.j5lan6wtmbxpoe2k@flea> References: <20190530211516.1891-1-jernej.skrabec@siol.net> <20190530211516.1891-4-jernej.skrabec@siol.net> <20190603115536.j5lan6wtmbxpoe2k@flea> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190603_083721_716710_FDE14B3A X-CRM114-Status: GOOD ( 19.19 ) 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: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, mchehab@kernel.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 Dne ponedeljek, 03. junij 2019 ob 13:55:36 CEST je Maxime Ripard napisal(a): > Hi, > > On Thu, May 30, 2019 at 11:15:12PM +0200, Jernej Skrabec wrote: > > It seems that for some H264 videos at least one bitstream parsing > > trigger must be called in order to be decoded correctly. There is no > > explanation why this helps, but it was observed that two sample videos > > with this fix are now decoded correctly and there is no regression with > > others. > > > > Signed-off-by: Jernej Skrabec > > --- > > I have two samples which are fixed by this: > > http://jernej.libreelec.tv/videos/h264/test.mkv > > http://jernej.libreelec.tv/videos/h264/Dredd%20%E2%80%93%20DTS%20Sound%20C > > heck%20DTS-HD%20MA%207.1.m2ts > > > > Although second one also needs support for multi-slice frames, which is > > not yet implemented here.> > > .../staging/media/sunxi/cedrus/cedrus_h264.c | 22 ++++++++++++++++--- > > 1 file changed, 19 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c index > > cc8d17f211a1..d0ee3f90ff46 100644 > > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > > @@ -6,6 +6,7 @@ > > > > * Copyright (c) 2018 Bootlin > > */ > > > > +#include > > > > #include > > > > #include > > > > @@ -289,6 +290,20 @@ static void cedrus_write_pred_weight_table(struct > > cedrus_ctx *ctx,> > > } > > > > } > > We should have a comment here explaining why that is needed ok. > > > +static void cedrus_skip_bits(struct cedrus_dev *dev, int num) > > +{ > > + for (; num > 32; num -= 32) { > > + cedrus_write(dev, VE_H264_TRIGGER_TYPE, 0x3 | (32 << 8)); > > Using defines here would be great Yes, sorry about that. > > > + while (cedrus_read(dev, VE_H264_STATUS) & (1 << 8)) > > + udelay(1); > > + } > > A new line here would be great > > > + if (num > 0) { > > + cedrus_write(dev, VE_H264_TRIGGER_TYPE, 0x3 | (num << 8)); > > + while (cedrus_read(dev, VE_H264_STATUS) & (1 << 8)) > > + udelay(1); > > + } > > Can't we make that a bit simpler by not duplicating the loop? > > Something like: > > int current = 0; > > while (current < num) { > int tmp = min(num - current, 32); > > cedrus_write(dev, VE_H264_TRIGGER_TYPE, 0x3 | (current << 8)) > while (...) > ... > > current += tmp; > } Yes, that looks better, I'll change it in next version. Best regards, Jernej _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel