vc2_bit_widths.pattern_evaluation
: Measure the outputs achieved by test patterns¶
This module provides routines for passing test patterns through a VC encoder and decoder and determining the values produced.
Evaluation functions¶
-
evaluate_analysis_test_pattern_output
(h_filter_params, v_filter_params, dwt_depth, dwt_depth_ho, level, array_name, test_pattern_specification, input_min, input_max)¶ Given an analysis test pattern (e.g. created using
make_analysis_maximising_pattern()
), return the actual intermediate encoder value when the signal is processed.- Parameters
- h_filter_params
vc2_data_tables.LiftingFilterParameters
- v_filter_params
vc2_data_tables.LiftingFilterParameters
Horizontal and vertical filter synthesis (not analysis!) filter parameters (e.g. from
vc2_data_tables.LIFTING_FILTERS
) defining the wavelet transform used.- dwt_depthint
- dwt_depth_hoint
The transform depth used by the filters.
- levelint
- array_namestr
The intermediate value in the encoder the test pattern targets.
- test_pattern_specification
TestPatternSpecification
The test pattern to evaluate.
- input_minint
- input_maxint
The minimum and maximum value which may be used in the test pattern.
- h_filter_params
- Returns
- encoded_minimumint
- encoded_maximumint
The target encoder value when the test pattern encoded with minimising and maximising signal levels respectively.
-
evaluate_synthesis_test_pattern_output
(h_filter_params, v_filter_params, dwt_depth, dwt_depth_ho, quantisation_matrix, synthesis_pyexp, test_pattern_specification, input_min, input_max, max_quantisation_index)¶ Given a synthesis test pattern (e.g. created using
make_synthesis_maximising_pattern()
oroptimise_synthesis_maximising_test_pattern()
), return the actual decoder value, and worst-case quantisation index when the signal is processed.- Parameters
- h_filter_params
vc2_data_tables.LiftingFilterParameters
- v_filter_params
vc2_data_tables.LiftingFilterParameters
Horizontal and vertical filter synthesis (not analysis!) filter parameters (e.g. from
vc2_data_tables.LIFTING_FILTERS
) defining the wavelet transform used.- dwt_depthint
- dwt_depth_hoint
The transform depth used by the filters.
- quantisation_matrix{level: {orient: int, …}, …}
The VC-2 quantisation matrix to use.
- synthesis_pyexp
PyExp
A
PyExp
expression which defines the synthesis process for the decoder value the test pattern is maximising/minimising. Such an expression is usually obtained from the use ofsynthesis_transform()
andmake_variable_coeff_arrays()
.- test_pattern_specification
TestPatternSpecification
The test pattern to evaluate.
- input_minint
- input_maxint
The minimum and maximum value which may be used in the test pattern.
- max_quantisation_indexint
The maximum quantisation index to use. This should be set high enough that at the highest quantisation level all transform coefficients are quantised to zero.
- h_filter_params
- Returns
- decoded_minimum(value, quantisation_index)
- decoded_maximum(value, quantisation_index)
The target decoded value (and worst-case quantisation index) when the test pattern is encoded using minimising and maximising values respectively.
Utility functions¶
-
convert_test_pattern_to_padded_picture_and_slice
(test_pattern, input_min, input_max, dwt_depth, dwt_depth_ho)¶ Convert a description of a test pattern (in terms of polarities) into a
numpy.array
, padded ready for processing with a filter with the specified transform depths.- Parameters
- test_pattern
TestPattern
- input_minint
- input_maxint
The full signal range to expand the test pattern to.
- dwt_depthint
- dwt_depth_hoint
The transform depth used by the filters.
- test_pattern
- Returns