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
LevelstoLevelSequenceRestrictions(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 aParseCodesname 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 theLevelsenum)profile: int (from theProfilesenum)major_version: intminor_version: int
- (11.1)
base_video_format: int (from theBaseVideoFormatsenum)
- (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 theColorDifferenceSamplingFormatsenum)
- (11.4.5)
custom_scan_format_flag: boolsource_sampling: int (from theSourceSamplingModesenum)
- (11.4.6)
custom_frame_rate_flag: boolframe_rate_index: int (from thePresetFrameRatesenum, or 0)frame_rate_numer: intframe_rate_denom: int
- (11.4.7)
custom_pixel_aspect_ratio_flag: boolpixel_aspect_ratio_index: int (from thePresetPixelAspectRatiosenum, 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 thePresetSignalRangesenum, 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 thePresetColorSpecsenum)custom_color_primaries_flag: boolcolor_primaries_index: int (from thePresetColorPrimariesenum)custom_color_matrix_flag: boolcolor_matrix_index: int (from thePresetColorMatricesenum)custom_transfer_function_flag: booltransfer_function_index: int (from thePresetTransferFunctionsenum)
- (11.1)
picture_coding_mode: int (from thePictureCodingModesenum)
- (12.4.1)
wavelet_index: int (from theWaveletFiltersenum)dwt_depth: int
- (12.4.4.1)
asym_transform_index_flag: boolwavelet_index_ho: int (from theWaveletFiltersenum)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_CONSTRAINTSwhich may holdAnyValue, defines an explicitValueSetdefining 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.