Message ID | 20190905101533.525-1-p.zabel@pengutronix.de (mailing list archive) |
---|---|
State | Rejected, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1i5ono-0001as-HI; Thu, 05 Sep 2019 10:15:44 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732779AbfIEKPn (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 5 Sep 2019 06:15:43 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:58015 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732504AbfIEKPm (ORCPT <rfc822; linux-media@vger.kernel.org>); Thu, 5 Sep 2019 06:15:42 -0400 Received: from dude02.hi.pengutronix.de ([2001:67c:670:100:1d::28] helo=dude02.pengutronix.de.) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from <p.zabel@pengutronix.de>) id 1i5onl-0001qT-Ag; Thu, 05 Sep 2019 12:15:41 +0200 From: Philipp Zabel <p.zabel@pengutronix.de> To: linux-media@vger.kernel.org Cc: Hans Verkuil <hverkuil@xs4all.nl>, Ezequiel Garcia <ezequiel@collabora.com>, Nicolas Dufresne <nicolas.dufresne@collabora.com>, Tomasz Figa <tfiga@chromium.org>, Jonas Karlman <jonas@kwiboo.se>, Paul Kocialkowski <paul.kocialkowski@bootlin.com>, Boris Brezillon <boris.brezillon@collabora.com>, kernel@pengutronix.de Subject: [PATCH 1/2] media: uapi: h264: Add num_ref_idx_active_override_flag Date: Thu, 5 Sep 2019 12:15:32 +0200 Message-Id: <20190905101533.525-1-p.zabel@pengutronix.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::28 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org |
Series |
[1/2] media: uapi: h264: Add num_ref_idx_active_override_flag
|
|
Commit Message
Philipp Zabel
Sept. 5, 2019, 10:15 a.m. UTC
This flag tells the kernel whether the slice header contained the
num_ref_idx_l[01]_active_minus1 syntax elements, or whether the
num_ref_idx_l[01]_default_active_minus1 from PPS should be used
instead.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++
include/media/h264-ctrls.h | 1 +
2 files changed, 4 insertions(+)
Comments
On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > This flag tells the kernel whether the slice header contained the > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > instead. > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > --- > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > include/media/h264-ctrls.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > index bc5dd8e76567..451a5b0f2a35 100644 > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > - 0x00000008 > - > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > + - 0x00000010 > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > As far as I remember, the idea was for the userspace to always put the right num_ref_idx in the slice_params and the drivers always use that. Was there any problem with that? Best regards, Tomasz > ``Prediction Weight Table`` > > diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h > index e877bf1d537c..dab519aea9bf 100644 > --- a/include/media/h264-ctrls.h > +++ b/include/media/h264-ctrls.h > @@ -133,6 +133,7 @@ struct v4l2_h264_pred_weight_table { > #define V4L2_H264_SLICE_FLAG_BOTTOM_FIELD 0x02 > #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x04 > #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x08 > +#define V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE 0x10 > > struct v4l2_ctrl_h264_slice_params { > /* Size in bytes, including header */ > -- > 2.20.1 >
On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > > This flag tells the kernel whether the slice header contained the > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > > instead. > > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > > --- > > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > > include/media/h264-ctrls.h | 1 + > > 2 files changed, 4 insertions(+) > > > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > index bc5dd8e76567..451a5b0f2a35 100644 > > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > > - 0x00000008 > > - > > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > > + - 0x00000010 > > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > > > As far as I remember, the idea was for the userspace to always put the > right num_ref_idx in the slice_params and the drivers always use that. > Was there any problem with that? I don't think so, at least for currently known hardware. In that case we should drop the unused num_ref_idx_l[01]_default_active_minus1 fields from struct v4l2_ctrl_h264_pps and document that userspace should fill the defaults into v4l2_ctrl_h264_slice_params themselves if num_ref_idx_active_override_flag wasn't set. regards Philipp
Le jeudi 05 septembre 2019 à 12:39 +0200, Philipp Zabel a écrit : > On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > This flag tells the kernel whether the slice header contained the > > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > > > instead. > > > > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > > > --- > > > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > > > include/media/h264-ctrls.h | 1 + > > > 2 files changed, 4 insertions(+) > > > > > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > index bc5dd8e76567..451a5b0f2a35 100644 > > > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > > > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > > > - 0x00000008 > > > - > > > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > > > + - 0x00000010 > > > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > > > > > > As far as I remember, the idea was for the userspace to always put the > > right num_ref_idx in the slice_params and the drivers always use that. > > Was there any problem with that? > > I don't think so, at least for currently known hardware. > > In that case we should drop the unused > num_ref_idx_l[01]_default_active_minus1 fields from struct > v4l2_ctrl_h264_pps and document that userspace should fill > the defaults into v4l2_ctrl_h264_slice_params themselves if > num_ref_idx_active_override_flag wasn't set. It might have been added in a previous effort to allow reconstructing the bitstream from the structures. > > regards > Philipp
On Thu, Sep 5, 2019 at 11:17 PM Nicolas Dufresne <nicolas.dufresne@collabora.com> wrote: > > Le jeudi 05 septembre 2019 à 12:39 +0200, Philipp Zabel a écrit : > > On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > > > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > > This flag tells the kernel whether the slice header contained the > > > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > > > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > > > > instead. > > > > > > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > > > > --- > > > > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > > > > include/media/h264-ctrls.h | 1 + > > > > 2 files changed, 4 insertions(+) > > > > > > > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > index bc5dd8e76567..451a5b0f2a35 100644 > > > > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > > > > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > > > > - 0x00000008 > > > > - > > > > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > > > > + - 0x00000010 > > > > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > > > > > > > > > As far as I remember, the idea was for the userspace to always put the > > > right num_ref_idx in the slice_params and the drivers always use that. > > > Was there any problem with that? > > > > I don't think so, at least for currently known hardware. > > > > In that case we should drop the unused > > num_ref_idx_l[01]_default_active_minus1 fields from struct > > v4l2_ctrl_h264_pps and document that userspace should fill > > the defaults into v4l2_ctrl_h264_slice_params themselves if > > num_ref_idx_active_override_flag wasn't set. > > It might have been added in a previous effort to allow reconstructing > the bitstream from the structures. Wouldn't one still be able to reconstruct a valid (but not exact) stream without that flag, given the assumption above? Best regards, Tomasz
On Mon, 2019-09-09 at 16:09 +0900, Tomasz Figa wrote: > On Thu, Sep 5, 2019 at 11:17 PM Nicolas Dufresne > <nicolas.dufresne@collabora.com> wrote: > > > > Le jeudi 05 septembre 2019 à 12:39 +0200, Philipp Zabel a écrit : > > > On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > > > > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > > > This flag tells the kernel whether the slice header contained the > > > > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > > > > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > > > > > instead. > > > > > > > > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > > > > > --- > > > > > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > > > > > include/media/h264-ctrls.h | 1 + > > > > > 2 files changed, 4 insertions(+) > > > > > > > > > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > index bc5dd8e76567..451a5b0f2a35 100644 > > > > > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > > > > > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > > > > > - 0x00000008 > > > > > - > > > > > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > > > > > + - 0x00000010 > > > > > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > > > > > > > > > > > > As far as I remember, the idea was for the userspace to always put the > > > > right num_ref_idx in the slice_params and the drivers always use that. > > > > Was there any problem with that? > > > > > > I don't think so, at least for currently known hardware. > > > > > > In that case we should drop the unused > > > num_ref_idx_l[01]_default_active_minus1 fields from struct > > > v4l2_ctrl_h264_pps and document that userspace should fill > > > the defaults into v4l2_ctrl_h264_slice_params themselves if > > > num_ref_idx_active_override_flag wasn't set. > > > > It might have been added in a previous effort to allow reconstructing > > the bitstream from the structures. > > Wouldn't one still be able to reconstruct a valid (but not exact) > stream without that flag, given the assumption above? If the Hantro G1, as appears to be the case, parses the slice header and decides itself whether to use the override from the slice or the default that was written to a register, it needs the num_ref_idx_l[01]_default_active_minus1 field to fill the register, but doesn't need either the num_ref_idx_l[01]_active_minus1 override nor the flag. A decoder that doesn't parse the slice header can always be told to use the override (thus no need to have the flag in the uapi), if userspace fills the default into the override fields as a fallback. Such a decoder does need the num_ref_idx_l[01]_active_minus1 override, but doesn't need the num_ref_idx_l[01]_default_active_minus1 field nor the flag. That is my current understanding of the intention behind this interface, I hope this is accurate. I've tried to make the docs reflect this in ("media: uapi: h264: clarify num_ref_idx_l[01]_(default_)active fields") [1]. [1] https://lore.kernel.org/linux-media/20190905114210.9232-1-p.zabel@pengutronix.de/T/#u regards Philipp
On Mon, Sep 9, 2019 at 4:30 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > On Mon, 2019-09-09 at 16:09 +0900, Tomasz Figa wrote: > > On Thu, Sep 5, 2019 at 11:17 PM Nicolas Dufresne > > <nicolas.dufresne@collabora.com> wrote: > > > > > > Le jeudi 05 septembre 2019 à 12:39 +0200, Philipp Zabel a écrit : > > > > On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > > > > > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > > > > This flag tells the kernel whether the slice header contained the > > > > > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > > > > > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > > > > > > instead. > > > > > > > > > > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > > > > > > --- > > > > > > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > > > > > > include/media/h264-ctrls.h | 1 + > > > > > > 2 files changed, 4 insertions(+) > > > > > > > > > > > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > > index bc5dd8e76567..451a5b0f2a35 100644 > > > > > > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > > > > > > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > > > > > > - 0x00000008 > > > > > > - > > > > > > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > > > > > > + - 0x00000010 > > > > > > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > > > > > > > > > > > > > > > As far as I remember, the idea was for the userspace to always put the > > > > > right num_ref_idx in the slice_params and the drivers always use that. > > > > > Was there any problem with that? > > > > > > > > I don't think so, at least for currently known hardware. > > > > > > > > In that case we should drop the unused > > > > num_ref_idx_l[01]_default_active_minus1 fields from struct > > > > v4l2_ctrl_h264_pps and document that userspace should fill > > > > the defaults into v4l2_ctrl_h264_slice_params themselves if > > > > num_ref_idx_active_override_flag wasn't set. > > > > > > It might have been added in a previous effort to allow reconstructing > > > the bitstream from the structures. > > > > Wouldn't one still be able to reconstruct a valid (but not exact) > > stream without that flag, given the assumption above? > > If the Hantro G1, as appears to be the case, parses the slice header and > decides itself whether to use the override from the slice or the default > that was written to a register, it needs the > num_ref_idx_l[01]_default_active_minus1 field to fill the register, but > doesn't need either the num_ref_idx_l[01]_active_minus1 override nor the > flag. > > A decoder that doesn't parse the slice header can always be told to use > the override (thus no need to have the flag in the uapi), if userspace > fills the default into the override fields as a fallback. Such a decoder > does need the num_ref_idx_l[01]_active_minus1 override, but doesn't need > the num_ref_idx_l[01]_default_active_minus1 field nor the flag. > > That is my current understanding of the intention behind this interface, > I hope this is accurate. > I've tried to make the docs reflect this in ("media: uapi: h264: clarify > num_ref_idx_l[01]_(default_)active fields") [1]. > > [1] https://lore.kernel.org/linux-media/20190905114210.9232-1-p.zabel@pengutronix.de/T/#u Yes, makes sense for me. Best regards, Tomasz
Hi, On Mon 09 Sep 19, 18:40, Tomasz Figa wrote: > On Mon, Sep 9, 2019 at 4:30 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > > On Mon, 2019-09-09 at 16:09 +0900, Tomasz Figa wrote: > > > On Thu, Sep 5, 2019 at 11:17 PM Nicolas Dufresne > > > <nicolas.dufresne@collabora.com> wrote: > > > > > > > > Le jeudi 05 septembre 2019 à 12:39 +0200, Philipp Zabel a écrit : > > > > > On Thu, 2019-09-05 at 19:31 +0900, Tomasz Figa wrote: > > > > > > On Thu, Sep 5, 2019 at 7:15 PM Philipp Zabel <p.zabel@pengutronix.de> wrote: > > > > > > > This flag tells the kernel whether the slice header contained the > > > > > > > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > > > > > > > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > > > > > > > instead. > > > > > > > > > > > > > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > > > > > > > --- > > > > > > > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > > > > > > > include/media/h264-ctrls.h | 1 + > > > > > > > 2 files changed, 4 insertions(+) > > > > > > > > > > > > > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > > > index bc5dd8e76567..451a5b0f2a35 100644 > > > > > > > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > > > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > > > > > > > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > > > > > > > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > > > > > > > - 0x00000008 > > > > > > > - > > > > > > > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > > > > > > > + - 0x00000010 > > > > > > > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > > > > > > > > > > > > > > > > > > As far as I remember, the idea was for the userspace to always put the > > > > > > right num_ref_idx in the slice_params and the drivers always use that. > > > > > > Was there any problem with that? > > > > > > > > > > I don't think so, at least for currently known hardware. > > > > > > > > > > In that case we should drop the unused > > > > > num_ref_idx_l[01]_default_active_minus1 fields from struct > > > > > v4l2_ctrl_h264_pps and document that userspace should fill > > > > > the defaults into v4l2_ctrl_h264_slice_params themselves if > > > > > num_ref_idx_active_override_flag wasn't set. > > > > > > > > It might have been added in a previous effort to allow reconstructing > > > > the bitstream from the structures. > > > > > > Wouldn't one still be able to reconstruct a valid (but not exact) > > > stream without that flag, given the assumption above? > > > > If the Hantro G1, as appears to be the case, parses the slice header and > > decides itself whether to use the override from the slice or the default > > that was written to a register, it needs the > > num_ref_idx_l[01]_default_active_minus1 field to fill the register, but > > doesn't need either the num_ref_idx_l[01]_active_minus1 override nor the > > flag. > > > > A decoder that doesn't parse the slice header can always be told to use > > the override (thus no need to have the flag in the uapi), if userspace > > fills the default into the override fields as a fallback. Such a decoder > > does need the num_ref_idx_l[01]_active_minus1 override, but doesn't need > > the num_ref_idx_l[01]_default_active_minus1 field nor the flag. > > > > That is my current understanding of the intention behind this interface, > > I hope this is accurate. > > I've tried to make the docs reflect this in ("media: uapi: h264: clarify > > num_ref_idx_l[01]_(default_)active fields") [1]. > > > > [1] https://lore.kernel.org/linux-media/20190905114210.9232-1-p.zabel@pengutronix.de/T/#u > > Yes, makes sense for me. Sorry for being late to the party and catching up with this just now. It looks like the conclusion is that we need to keep both the PPS default and slice-specific set of fields to cover both hardware that parses the slice header and hardware that doesn't. In H265, I had evicted the PPS default value and the flag in favor of only providing a slice-specific value, but I should certainly revise this to have the two sets of values and the flag. This should allow covering hardware that does slice header parsing itself. Cheers, Paul
Hi, On Thu 05 Sep 19, 12:15, Philipp Zabel wrote: > This flag tells the kernel whether the slice header contained the > num_ref_idx_l[01]_active_minus1 syntax elements, or whether the > num_ref_idx_l[01]_default_active_minus1 from PPS should be used > instead. Looks good to me: Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Cheers, Paul > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> > --- > Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 3 +++ > include/media/h264-ctrls.h | 1 + > 2 files changed, 4 insertions(+) > > diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > index bc5dd8e76567..451a5b0f2a35 100644 > --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst > @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - > * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` > - 0x00000008 > - > + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE > + - 0x00000010 > + - Corresponds to the num_ref_idx_active_override_flag syntax element. > > ``Prediction Weight Table`` > > diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h > index e877bf1d537c..dab519aea9bf 100644 > --- a/include/media/h264-ctrls.h > +++ b/include/media/h264-ctrls.h > @@ -133,6 +133,7 @@ struct v4l2_h264_pred_weight_table { > #define V4L2_H264_SLICE_FLAG_BOTTOM_FIELD 0x02 > #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x04 > #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x08 > +#define V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE 0x10 > > struct v4l2_ctrl_h264_slice_params { > /* Size in bytes, including header */ > -- > 2.20.1 >
diff --git a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst index bc5dd8e76567..451a5b0f2a35 100644 --- a/Documentation/media/uapi/v4l/ext-ctrls-codec.rst +++ b/Documentation/media/uapi/v4l/ext-ctrls-codec.rst @@ -1860,6 +1860,9 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - * - ``V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH`` - 0x00000008 - + * - ``V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE + - 0x00000010 + - Corresponds to the num_ref_idx_active_override_flag syntax element. ``Prediction Weight Table`` diff --git a/include/media/h264-ctrls.h b/include/media/h264-ctrls.h index e877bf1d537c..dab519aea9bf 100644 --- a/include/media/h264-ctrls.h +++ b/include/media/h264-ctrls.h @@ -133,6 +133,7 @@ struct v4l2_h264_pred_weight_table { #define V4L2_H264_SLICE_FLAG_BOTTOM_FIELD 0x02 #define V4L2_H264_SLICE_FLAG_DIRECT_SPATIAL_MV_PRED 0x04 #define V4L2_H264_SLICE_FLAG_SP_FOR_SWITCH 0x08 +#define V4L2_H264_SLICE_FLAG_NUM_REF_IDX_ACTIVE_OVERRIDE 0x10 struct v4l2_ctrl_h264_slice_params { /* Size in bytes, including header */