vc2_conformance.level_constraints
: Level constraint definitions¶
The vc2_conformance.level_constraints
module contains definitions of
constraints imposed on VC-2 bitstreams by the various VC-2 level
specifications.
Sequence data unit ordering restrictions¶
Levels may restrict the ordering or choice of data unit types within a
bitstream. These restrictions are described using
symbol_re
regular expressions provided in
LEVEL_SEQUENCE_RESTRICTIONS
.
-
LEVEL_SEQUENCE_RESTRICTIONS
= {level: LevelSequenceRestrictions, ...}¶ A lookup from
Levels
toLevelSequenceRestrictions
(loaded fromvc2_conformance/level_sequence_restrictions.csv
) describing the restrictions on sequences imposed by each VC-2 level.
-
class
LevelSequenceRestrictions
(sequence_restriction_explanation, sequence_restriction_regex)¶ Restrictions on sequence orderings for a VC-2 level.
- Parameters
- sequence_restriction_explanationstr
A human readable explanation of the restriction imposed (informative).
- sequence_restriction_regexstr
A regular expression describing the sequence ordering allowed which can be matched using a
Matcher
. Each symbol is aParseCodes
name string.
Coding parameter restrictions¶
Levels impose various restrictions on bitstream parameters and values. These
restrictions are collected into a constraint table (see
constraint_table
) in LEVEL_CONSTRAINTS
.
-
LEVEL_CONSTRAINTS
= <constraint table>¶ A constraint table (see
vc2_conformance.constraint_table
) loaded fromvc2_conformance/level_constraints.csv
.Constraints which apply due to levels. Keys correspond to particular bitstream values or properties and are enumerated below:
- (11.2.1)
level
: int (from theLevels
enum)profile
: int (from theProfiles
enum)major_version
: intminor_version
: int
- (11.1)
base_video_format
: int (from theBaseVideoFormats
enum)
- (11.4.3)
custom_dimensions_flag
: boolframe_width
: intframe_height
: int
- (11.4.4)
custom_color_diff_format_flag
: boolcolor_diff_format_index
: int (from theColorDifferenceSamplingFormats
enum)
- (11.4.5)
custom_scan_format_flag
: boolsource_sampling
: int (from theSourceSamplingModes
enum)
- (11.4.6)
custom_frame_rate_flag
: boolframe_rate_index
: int (from thePresetFrameRates
enum, or 0)frame_rate_numer
: intframe_rate_denom
: int
- (11.4.7)
custom_pixel_aspect_ratio_flag
: boolpixel_aspect_ratio_index
: int (from thePresetPixelAspectRatios
enum, or 0)pixel_aspect_ratio_numer
: intpixel_aspect_ratio_denom
: int
- (11.4.8)
custom_clean_area_flag
: boolclean_width
: intclean_height
: intleft_offset
: inttop_offset
: int
- (11.4.9)
custom_signal_range_flag
: boolcustom_signal_range_index
: int (from thePresetSignalRanges
enum, or 0)luma_offset
: intluma_excursion
: intcolor_diff_offset
: intcolor_diff_excursion
: int
- (11.4.10)
custom_color_spec_flag
: boolcolor_spec_index
: int (from thePresetColorSpecs
enum)custom_color_primaries_flag
: boolcolor_primaries_index
: int (from thePresetColorPrimaries
enum)custom_color_matrix_flag
: boolcolor_matrix_index
: int (from thePresetColorMatrices
enum)custom_transfer_function_flag
: booltransfer_function_index
: int (from thePresetTransferFunctions
enum)
- (11.1)
picture_coding_mode
: int (from thePictureCodingModes
enum)
- (12.4.1)
wavelet_index
: int (from theWaveletFilters
enum)dwt_depth
: int
- (12.4.4.1)
asym_transform_index_flag
: boolwavelet_index_ho
: int (from theWaveletFilters
enum)asym_transform_flag
: booldwt_depth_ho
: int
- (12.4.5.2)
slices_x
: int (giving the allowed number of slices in the x dimension)slices_y
: int (giving the allowed number of slices in the y dimension)slices_have_same_dimensions
: bool. True iff all slices contain exactly the same number of transform components.slice_bytes_numerator
: intslice_bytes_denominator
: intslice_prefix_bytes
: intslice_size_scaler
: int
- (12.4.5.3)
custom_quant_matrix
: boolquant_matrix_values
: int (giving the allowed values within a custom quantisation matrix).
- (13.5.3)
qindex
: int (the allowed qindex values as defined by individual slices)
- (13.5.3.2)
total_slice_bytes
: int (total number of bytes allowed in a high quality picture slice, including all prefix bytes and slice size fields.
See also:
LEVEL_CONSTRAINT_ANY_VALUES
.
-
LEVEL_CONSTRAINT_ANY_VALUES
= {key: ValueSet, ...}¶ For keys in
LEVEL_CONSTRAINTS
which may holdAnyValue
, defines an explicitValueSet
defining all valid values, for example when the key refers to an enumerated value. Where the range of allowed values is truly open ended, no value is provided in this dictionary.