• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

README.mdH A D02-Jun-202110.2 KiB280170

SVT-HEVC_FunctionalTests.pyH A D02-Jun-202169.6 KiB1,4671,282

README.md

1# SVT-HEVC Test Script Overview
2
3### Python
4
5The test script is written in Python.  Supported Python versions include 2.7 and 3.7
6
7
8### Operating Systems
9
10Test cases can be run on both Linux and Windows platforms.
11
12
13
14### Paths
15
16The following relative paths are defined in the script:\
17ENC_PATH   = folder where the SvtHevcEncApp executable can be found - default: "encoders"\
18BIN_PATH   = folder where the created bitstreams are stored - default: "bitstreams"\
19YUV_PATH   = folder where the input yuv media file are stored - default: "yuvs"\
20TOOLS_PATH = folder where the tools are located (e.g. reference decoder, MCTS decoder) - default: "tools"\
21These folders should be created prior to running the script.\
22The bitstream folder should be empty and cleared for each run.\
23Note: You should build the SVT encoder and place the executable in the folder specified under "ENC_PATH"\
24Note: Download the reference decoder from https://hevc.hhi.fraunhofer.de/ and place in the folder specified under "TOOLS_PATH"\
25Note: The MCTS check decoder can be found at: https://github.com/kelvinhu325/HM/tree/mcts_check .  The binary should be build and place in the folder specified under "TOOLS_PATH"
26
27
28
29### Validation Test Modes
30
31VALIDATION_TEST_MODE defines which of the 3 validation test modes that the script runs in:\
320 = Fast - Used to quickly verify code check-ins.  Should take around 2 hours\
331 = Nightly - Used as a daily stability check-ins_support. Should take around 18 hours\
342 = Full - Used to verify releases of the products.  Should take around 2 days.\
35Note: Estimated time is based on tests ran on Intel Xeon Gold 6140 CPU w/ 94.7 GB memory.\
36The script modes differ by the total number of tests that are run.
37
38
39
40### COLOR_MODE
41
42COLOR_MODE defines which subset of media files are used in the test
43
440 = P420, P422, and P444\
451 = P420 Only\
462 = P422 Only\
473 = P444 Only
48
49
50
51### QP/VBR
52
53QP_VBR_MODE defines how the quantization parameter, variable bitrate, and constant rate factor parameters are specified in the tests:
54
550 =QP, VBR, and CRF parameters are used\
561 = QP Only\
572 = VBR Only\
583 = CRF Only\
594 = QP and VBR Only
60
61
62### Encoder Modes
63
64SPEED_ENC_MODES is a list variable that defines which encoding modes (0-11) are used in the speed tests. It defaults to [0,6,9]
65
66ENC_MODES is a list variable that defines which encoding modes (0-11) are used in each of the validation test modes.
67
68### Number of Frames
69
70NUM_FRAMES is a variable that defines the number of frames encoded in each test. It default to 20
71
72
73### Quantization Iterations
74
75MIN_QP and MAX_QP define the range of quantization that the tests can be run with.\
76QP_ITERATIONS defines the number of random quantization values used in that range.\
77MIN_QP defaults to 30\
78MAX_QP defaults to  50\
79QP_ITERATIONS defaults to 1\
80QP iteration is only used when the QP parameter is being used
81
82
83
84### Variable Bitrate Iterations
85
86MIN_BR and MAX_BR define the range of bitrates (bytes/second) that the tests can be run with.\
87VBR_ITERATIONS defines the number of variable bitrate values used in that range.\
88MIN_BR defaults to 1000\
89MAX_BR defaults to 10000000\
90VBR_ITERATIONS defaults to 1 for fast and nightly test modes, and 2 for full test modes\
91VBR iteration is only used when VBR parameter is being used
92
93
94
95### CRF Iterations
96
97MIN_CRF and MAX_CRF define the range of rate factors that the tests can be run with.\
98CRF_ITERATIONS defines the number of iterations to set when Constant Rate Factor testing is specified.
99
100
101
102### Search Area Iterations
103
104SA_ITER defines the size of the search area used in the tests
105
106
107### Look Ahead Distance Iterations
108
109LAD_ITER defines the number of look ahead iterations that are used in the tests
110
111
112
113### Intra Period Iterations
114
115INTRA_PERIOD_ITER defines the number of intra period iterations that are used in the tests
116
117
118
119### MCTS Iterations
120
121MCTS_ITER defines the number of motion constrained tileset iterations that are used in the tests
122
123
124
125### Width Height Iterations
126
127WH_ITER defines the number of width/height pairs are used in the tests\
128MIN_WIDTH and MAX_WIDTH define the range of widths (default: 832-4096)\
129MIN_HEIGHT and MAX_HEIGHT define the range of heights (default: 480-2304)
130
131
132
133### Debugging
134
135Setting DEBUG_MODE to a non-zero value will allow the script to run and configure each test to be run, but not actually run the test.
136
137
138
139### Configuration
140
141TEST_CONFIGURATION can be set to 0 or 1\
142        0 = Validation Test - Verify that encoder parameters are functioning properly\
143        1 = Speed Test - Check the speed of encoding
144
145Both set of tests use different set of media files (VALIDATION_TEST_SEQUENCES
146and SPEED_TEST_SEQUENCES).
147
148Validation tests tabulate sums of the number of test that are run and the
149number of tests that pass.  The total time taken to run the full set of tests is
150calculated.
151
152Speed tests are written into a batch file (speed_script.bat/speed_script.sh)
153which can executed outside of this batch file.
154
155### Adding a validation test
156
157Here are the basic steps to follow when adding a test to validate the correct processing of an encoder parameter.  You can refer to existing tests functions (e.g. sao_test) for reference on creating a new test function.
158
159
1601. Add a function that runs a test at the bottom of the section labeled FUNCTIONAL TESTS.
161
162   - The name of the function should reflect the test(s) scope (e.g. myparameter_test)
163
164   - The two parameters to the function should be:
165
166     - self - standard Python instance variable
167
168     - seq_list - list of sequences (videos) that are to be run
169       These parameters are not used in the body of the function, but are passed in the \
170       return when the function ends.
171
172       Example Function signature:
173
174       ```python
175       def myparameter_test(self,seq_list)
176       ```
177
178   - Add a body to function
179
180     - create a variable that defines the name of the test (e.g. test_name = 'myparameter_test')
181
182     - create a dictionary that defines parameters and a list of values.  More than one parameter can be included in the dictionary (e.g.)
183
184       ```python
185       combination_test_params = { 'MyParameterName'     : [0, 1],
186                                   'MyOtherParameterName'     : [0, 1],
187       }
188       ```
189
190     - make sure that all parameters used in the dictionary are also included in the default_tokens dictionary created in the get_param_tokens	function (e.g.)
191
192       ```python
193        default_tokens = {
194        ...
195        'MyParameterName' : '-mp',
196        'MyOtherParameterName' : '-mop',
197        ...
198       ```
199
200     - Add a return statement to the function which calls run_functional_tests passing  the sequence list, test name, and test parameters (e.g.)
201
202       ```python
203        return self.run_functional_tests(seq_list, test_name, combination_test_params)
204       ```
205
206   - Here's the resulting function:
207
208     ```python
209     def myparameter_test(self,seq_list){
210         # Test specific parameters:
211         test_name = 'myparameter_test'
212         combination_test_params = { 'MyParameterName'     : [0, 1],
213                                     'MyOtherParameterName'     : [0, 1],
214                                   }
215         # Run tests
216         return self.run_functional_tests(seq_list, test_name, combination_test_params)
217     ```
218
2192. Add a call to the new function at the end of the set of validation tests that are run.  In the function run_validation_test, add these lines that call your function and tabulate the num_tests and num_passed counters (e.g.)
220
221   ```python
222    num_tests, num_passed = self.myparameter_test(seq_list)
223    total_tests = total_tests + num_tests
224    total_passed = total_passed + num_passed
225   ```
226
2273. Try running the script in debug mode.  There should be a txt file with a name based on your test name (e.g. myparameter_test.txt).  Open the text file and verify that  the individual tests run match with the parameters you've specified in your function.
228
229
230
231### How to use the test script:
232
2331. Make sure ENC_PATH, BIN_PATH,YUV_PATH, and TOOLS_PATH folders are created relative to the location of  where the script is located.  The bitstream folder should be empty and cleared for each run.
234
2352. Build SVT encoder and place the executable in the folder specified under "ENC_PATH"
236
2373. Download the reference decoder from https://hevc.hhi.fraunhofer.de/
238
2394. Build the reference decoder and place it in the folder specified under "TOOLS_PATH"(Windows:TAppDecoder.exe , Linux: TAppDecoder)
240
2415. Download the MCTS decoder from https://github.com/kelvinhu325/HM/tree/mcts_check
242
2436. Build the MTCS decoder and place it in the folder specified under "TOOLS_PATH"(Windows:MCTS_TAppDecoder.exe , Linux: MCTS_TAppDecoder)
244
2457. Obtain the YUV media files and copy to YUV_PATH
246
2478. Run script as follows:
248
249Run all test suites:
250
251```
252python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type all
253```
254
255​Run test suites separately:
256
257```
258python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type vbv_test
259python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type mcts_test
260python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type hdr_test
261python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type intra_period_test
262python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type width_height_test
263python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type buffered_test
264python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type run_to_run_test
265python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type qp_file_test
266python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type enc_struct_test
267python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type unpacked_test
268python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type dlf_test
269python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type sao_test
270python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type constrained_intra_test
271python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type scene_change_test
272python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type me_hme_test
273python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type asm_test
274python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type decode_test
275python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type defield_test
276python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type tile_test
277python SVT-HEVC_FunctionalTests.py [Fast|Nightly|Full ] -type multi_channel_test
278```
279
280