Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4296055ybi; Mon, 3 Jun 2019 08:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwnNK1RQrb5axmxKJH4XxBAq/3yQG8lwWGP6qmfJ6vBPGYYsAhxqJ+yHhGO1hLMrd2ftxnV X-Received: by 2002:aa7:8108:: with SMTP id b8mr32349681pfi.205.1559576177559; Mon, 03 Jun 2019 08:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559576177; cv=none; d=google.com; s=arc-20160816; b=AlGHnxC3rtjWBFZ/0DnLaOd7ueZdcX8EKkBKwHX9RLPDPOvHqF/XmcsDv1EbUejaF0 Uco3sRxAiKZ+vcS/I2Fyl2i2FChvPOraWxGr+WAbjkPcQ2ZB1FUIrhOATZhnpHkVeR7N YZ0Ok0dnVu4BE44gZKBfJ0d63bnK/XsQeMHrU9UE3ibMIPli0agVlJUiFEkJ/YDCCrZg yQvTkgeYIahORwEzSqJDf8ahJ2GAEqmn4QiKDo7Eg8Tmow69AqcJNDp2nmzSHopacPrq K4KXNqudqA22cKjB9TAyXIo9CB9mTOundhAesCapnZNMMU+ppAQjru/77VylCk7rlRLk pKpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6c19zr9+lJGI75k3DJxgkyHZUfjWLCTwWMB49YPDqd4=; b=yDOROZl3OmVTegUhYBIZ4rJu/N8apQ5yhDipdZicVrr/7rSZVADvjQQ/oie9S1LdeA IvMpmlu1xupyP1I0Z7zQoPGKUOsR3dOeRf9ZcjOkCpGbL8dSxHXgMe+nxmiF3bmpwhCp zCh7v0FVon61d1aB8wBYYP5qJqmQOIgeRn7sn2ufomZyAlGRbbs6PubIJQcGla6DhbCU f+hBfoL3w1hki/cztUiE56d006ZKk0HmsNMywNyclswY4MGcSfWUn9v7P8LdWQuCNdNJ Q/QOTvo5KunztWjHIGrOk053c6skyP/Es0pE87Lh9V8S3yzI8wgYtK5lDg9NzrxhXZmW BOIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k15si18015759pgh.331.2019.06.03.08.35.59; Mon, 03 Jun 2019 08:36:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=siol.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727832AbfFCPeJ (ORCPT + 99 others); Mon, 3 Jun 2019 11:34:09 -0400 Received: from mailoutvs5.siol.net ([185.57.226.196]:50891 "EHLO mail.siol.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727647AbfFCPeJ (ORCPT ); Mon, 3 Jun 2019 11:34:09 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTP id 7973A521018; Mon, 3 Jun 2019 17:34:05 +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 I185maW5QRX1; Mon, 3 Jun 2019 17:34:05 +0200 (CEST) Received: from mail.siol.net (localhost [127.0.0.1]) by mail.siol.net (Postfix) with ESMTPS id 10534520F7B; Mon, 3 Jun 2019 17:34:05 +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 A9764520F69; Mon, 3 Jun 2019 17:34:03 +0200 (CEST) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Maxime Ripard Cc: paul.kocialkowski@bootlin.com, wens@csie.org, mchehab@kernel.org, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, nicolas@ndufresne.ca, boris.brezillon@collabora.com, jonas@kwiboo.se Subject: Re: [PATCH 2/7] media: cedrus: Fix H264 default reference index count Date: Mon, 03 Jun 2019 17:34:03 +0200 Message-ID: <8861995.Bqp6Xp4pol@jernej-laptop> In-Reply-To: <20190603114620.vsvbxz6gyhg3tn7b@flea> References: <20190530211516.1891-1-jernej.skrabec@siol.net> <20190530211516.1891-3-jernej.skrabec@siol.net> <20190603114620.vsvbxz6gyhg3tn7b@flea> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dne ponedeljek, 03. junij 2019 ob 13:46:20 CEST je Maxime Ripard napisal(a): > On Thu, May 30, 2019 at 11:15:11PM +0200, Jernej Skrabec wrote: > > Reference index count in VE_H264_PPS reg should come from PPS control. > > However, this is not really important because reference index count is > > in our case always overridden by that from slice header. > > > > Cc: nicolas@ndufresne.ca > > Cc: boris.brezillon@collabora.com > > Cc: jonas@kwiboo.se > > > > Signed-off-by: Jernej Skrabec > > Acked-by: Maxime Ripard > > > --- > > We have to decide if we drop pps->num_ref_idx_l0_default_active_minus1 > > and pps->num_ref_idx_l1_default_active_minus1 fields or add > > num_ref_idx_l0_active_override_flag and > > num_ref_idx_l0_active_override_flag > > to slice control. Actually only one flag is in bitstream valid for both l0 and l1 ref list. > > > > Current control doesn't have those two flags, so in Cedrus override flag > > is > > always set and we rely on userspace to set > > slice->num_ref_idx_l0_active_minus1 and > > slice->num_ref_idx_l1_active_minus1 to correct values. This means that > > values stored in PPS are not needed and always ignored by VPU. > > > > If I understand correctly, algorithm is very simple: > > > > ref_count = PPS->ref_count > > if (override_flag) > > > > ref_count = slice->ref_count > > > > It seems that VAAPI provides only final value. In my opinion we should do > > the same - get rid of PPS default ref index count fields. > > The rationale was to be as conservative as possible and just expose > everything that is in the bitstream in those controls to accomodate > for as many weird hardware as possible. Ok, so then we should add that override flag, which would align with h264 specs and you can still do same trick in VAAPI library which it's currently used in Cedrus driver - always set override flag and fill out only slice reflist count. At the end it shouldn't matter for proper decoding in any driver. Best regards, Jernej