Profiling on a Raspberry Pi revealed the best performance to correspond with VLC_BITS = 5. Results for overall audio decode and the get_vlc2 function in particular are as follows: Before After Mean StdDev Mean StdDev Confidence Change 6:2 total 348.8 20.1 339.6 15.1 88.8% +2.7% (insignificant) 6:2 function 38.1 8.1 26.4 4.1 100.0% +44.5% 8:2 total 339.1 15.4 324.5 15.5 99.4% +4.5% 8:2 function 33.8 7.0 27.3 5.6 99.7% +23.6% 6:6 total 604.6 20.8 572.8 20.6 100.0% +5.6% 6:6 function 95.8 8.4 68.9 8.2 100.0% +39.1% 8:8 total 766.4 17.6 741.5 21.2 100.0% +3.4% 8:8 function 106.0 11.4 86.1 9.9 100.0% +23.1%
Unified · Split
| @@ -37,9 +37,16 @@ · 36 unmodified lines | ||
| 37 | 37 | #include "mlp_parser.h" |
| 38 | 38 | #include "mlpdsp.h" |
| 39 | 39 | #include "mlp.h" |
| 40 | +#include "config.h" | |
| 40 | 41 | |
| 41 | 42 | /** number of bits used for VLC lookup - longest Huffman code is 9 */ |
| 43 | +#if ARCH_ARM | |
| 44 | +#define VLC_BITS 5 | |
| 45 | +#define VLC_STATIC_SIZE 64 | |
| 46 | +#else | |
| 42 | 47 | #define VLC_BITS 9 |
| 48 | +#define VLC_STATIC_SIZE 512 | |
| 49 | +#endif | |
| 43 | 50 | |
| 44 | 51 | typedef struct SubStream { |
| 45 | 52 | /// Set if a valid restart header has been read. Otherwise the substream cannot be decoded. |
| @@ -190,13 +197,13 @@ static av_cold void init_static(void) · 144 unmodified lines | ||
| 190 | 197 | if (!huff_vlc[0].bits) { |
| 191 | 198 | INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18, |
| 192 | 199 | &ff_mlp_huffman_tables[0][0][1], 2, 1, |
| 193 | − &ff_mlp_huffman_tables[0][0][0], 2, 1, 512); | |
| 200 | + &ff_mlp_huffman_tables[0][0][0], 2, 1, VLC_STATIC_SIZE); | |
| 194 | 201 | INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16, |
| 195 | 202 | &ff_mlp_huffman_tables[1][0][1], 2, 1, |
| 196 | − &ff_mlp_huffman_tables[1][0][0], 2, 1, 512); | |
| 203 | + &ff_mlp_huffman_tables[1][0][0], 2, 1, VLC_STATIC_SIZE); | |
| 197 | 204 | INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15, |
| 198 | 205 | &ff_mlp_huffman_tables[2][0][1], 2, 1, |
| 199 | − &ff_mlp_huffman_tables[2][0][0], 2, 1, 512); | |
| 206 | + &ff_mlp_huffman_tables[2][0][0], 2, 1, VLC_STATIC_SIZE); | |
| 200 | 207 | } |
| 201 | 208 | |
| 202 | 209 | ff_mlp_init_crc(); |