| | 112 | === Configuration === |
| | 113 | This controls how the test will be run, the parameters of each test and so on. There exist many commands, the basic commands are: |
| | 114 | |
| | 115 | ==== enc_dec_pcm ==== |
| | 116 | This command first encodes an input file and then decodes the encoded file. It’s useful to test a video encoder. An example of this command is fate-vorbis-encode test, which can be found in `tests/fate/vorbis.mak`. The code of this command is the following: |
| | 117 | |
| | 118 | {{{ |
| | 119 | FATE_VORBIS += fate-vorbis-encode |
| | 120 | fate-vorbis-encode: CMD = enc_dec_pcm ogg wav s16le $(TARGET_SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav -c:a vorbis -strict experimental |
| | 121 | fate-vorbis-encode: REF = $(SAMPLES)/audio-reference/luckynight_2ch_44kHz_s16.wav |
| | 122 | fate-vorbis-encode: CMP_SHIFT = 0 |
| | 123 | fate-vorbis-encode: CMP_TARGET = 2000 |
| | 124 | fate-vorbis-encode: SIZE_TOLERANCE = 12123 |
| | 125 | fate-vorbis-encode: FUZZ = 0 |
| | 126 | [...] |
| | 127 | fate-vorbis-encode: CMP = stddev |
| | 128 | }}} |
| | 129 | |
| | 130 | * CMD |
| | 131 | * enc_dec_pcm: indicates the command to be executed. |
| | 132 | * ogg: indicates the format in which to encode the input file |
| | 133 | * wav: indicates the format in which to decode the encoded file. |
| | 134 | * s16le: indicates the codec_name. |
| | 135 | * file: the input file |
| | 136 | * @: the other commands to be included |
| | 137 | |
| | 138 | * REF: indicates the reference file, the decoded file will be compared with this file. |
| | 139 | * CMP_SHIFT: to calculate the CMP_SHIFT value you can use the tests/tini_psnr command. A guide how to use it is [http://trac.ffmpeg.org/wiki/FATE/UseOftiny_psnr explained here]. |
| | 140 | * CMP_TARGET: it depends on what “CMP= “ is set. |
| | 141 | * FUZZ: is the difference that is considered ok between the CMP_TARGET and the actual value. |
| | 142 | * SIZE_TOLERANCE is the difference between the input and output sizes. The value of this parameter is calculated by subtracting the size of the two files. |
| | 143 | |
| | 144 | {{{ |
| | 145 | #!div style="border: 1pt dotted; margin: 1em; background-color: #fffff9;" |
| | 146 | |
| | 147 | '''Notes:''' |
| | 148 | |
| | 149 | The CMP_TARGET and FUZZ may differ to one architecture to another. You may need to adjust these values depending on the architecture. |
| | 150 | }}} |
| | 151 | |
| | 152 | To do a new test do the following: |
| | 153 | 1. Compute CMP_SHIFT value with tiny_psnr. The program needs the encoder input and decoder output (that is 2 pcm wav or raw files). |
| | 154 | 2. Copy the fate test to the .mak file and adjust the CMD options to match your needs. |
| | 155 | 3. Run the new test, it should show errors like: |
| | 156 | {{{ |
| | 157 | stddev: 296.37 PSNR: 46.89 MAXDIFF: 4810 bytes: 1675800/ 1679360 |
| | 158 | stddev: |296.37 - 2000| >= 0 |
| | 159 | }}} |
| | 160 | 4. The CMP_TARGET for your test is 296 and your FUZZ is 0. |
| | 161 | 5. The SIZE_TOLERANCE is 1679360 - 1675800 = 3560. |
| | 162 | |
| | 163 | |