media: uapi: h264: Split prediction weight parameters

The prediction weight parameters are only required under
certain conditions, which depend on slice header parameters.

As specified in section 7.3.3 Slice header syntax, the prediction
weight table is present if:

((weighted_pred_flag && (slice_type == P || slice_type == SP)) || \
(weighted_bipred_idc == 1 && slice_type == B))

Given its size, it makes sense to move this table to its control,
so applications can avoid passing it if the slice doesn't specify it.

Before this change struct v4l2_ctrl_h264_slice_params was 960 bytes.
With this change, it's 188 bytes and struct v4l2_ctrl_h264_pred_weight
is 772 bytes.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Jonas Karlman <jonas@kwiboo.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Ezequiel Garcia
2020-08-25 05:52:29 +02:00
committed by Mauro Carvalho Chehab
parent cefdf80584
commit eb44c6c9c2
8 changed files with 45 additions and 18 deletions

View File

@@ -1879,18 +1879,23 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
- 0x00000008
-
``Prediction Weight Table``
``V4L2_CID_MPEG_VIDEO_H264_PRED_WEIGHTS (struct)``
Prediction weight table defined according to :ref:`h264`,
section 7.4.3.2 "Prediction Weight Table Semantics".
The prediction weight table must be passed by applications
under the conditions explained in section 7.3.3 "Slice header
syntax".
The bitstream parameters are defined according to :ref:`h264`,
section 7.4.3.2 "Prediction Weight Table Semantics". For further
documentation, refer to the above specification, unless there is
an explicit comment stating otherwise.
.. note::
.. c:type:: v4l2_h264_pred_weight_table
This compound control is not yet part of the public kernel API and
it is expected to change.
.. c:type:: v4l2_ctrl_h264_pred_weights
.. cssclass:: longtable
.. flat-table:: struct v4l2_h264_pred_weight_table
.. flat-table:: struct v4l2_ctrl_h264_pred_weights
:header-rows: 0
:stub-columns: 0
:widths: 1 1 2