media: uapi: mpeg2: rework quantisation matrices semantics
As stated in the MPEG-2 specification, section 6.3.7 "Quant matrix extension": Each quantisation matrix has a default set of values. When a sequence_header_code is decoded all matrices shall be reset to their default values. User defined matrices may be downloaded and this can occur in a sequence_header() or in a quant_matrix_extension(). The load_intra_quantiser_matrix syntax elements are transmitted in the bitstream headers, signalling that a quantisation matrix needs to be loaded and used for pictures transmitted afterwards (until the matrices are reset). This "load" semantics are implemented in the V4L2 interface without the need of any "load" flags: passing the control is effectively a load. Therefore, rework the V4L2_CID_MPEG_VIDEO_MPEG2_QUANTISATION semantics to match the MPEG-2 semantics. Quantisation matrices values are now initialized by the V4L2 control core to their reset default value, and applications are expected to reset their values as specified. The quantisation control is therefore optional, and used to load bitstream-defined values in the quantisation matrices. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Co-developed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Tested-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Tested-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
118f3e1562
commit
81bbb65f19
@@ -1779,23 +1779,6 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type -
|
||||
:stub-columns: 0
|
||||
:widths: 1 1 2
|
||||
|
||||
* - __u8
|
||||
- ``load_intra_quantiser_matrix``
|
||||
- One bit to indicate whether to load the ``intra_quantiser_matrix`` data.
|
||||
* - __u8
|
||||
- ``load_non_intra_quantiser_matrix``
|
||||
- One bit to indicate whether to load the ``non_intra_quantiser_matrix``
|
||||
data.
|
||||
* - __u8
|
||||
- ``load_chroma_intra_quantiser_matrix``
|
||||
- One bit to indicate whether to load the
|
||||
``chroma_intra_quantiser_matrix`` data, only relevant for non-4:2:0 YUV
|
||||
formats.
|
||||
* - __u8
|
||||
- ``load_chroma_non_intra_quantiser_matrix``
|
||||
- One bit to indicate whether to load the
|
||||
``chroma_non_intra_quantiser_matrix`` data, only relevant for non-4:2:0
|
||||
YUV formats.
|
||||
* - __u8
|
||||
- ``intra_quantiser_matrix[64]``
|
||||
- The quantisation matrix coefficients for intra-coded frames, in zigzag
|
||||
|
||||
Reference in New Issue
Block a user