History

truehd: tune VLC decoding for ARM.

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%

Ben Avison committed 12 years ago

Commit fcf5fc41 parent 483321f1 file · +10 −3Browse files

Unified · Split

libavcodec/mlpdec.c+10−3
@@ -37,9 +37,16 @@ · 36 unmodified lines
3737 #include "mlp_parser.h"
3838 #include "mlpdsp.h"
3939 #include "mlp.h"
40+#include "config.h"
4041
4142 /** 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
4247 #define VLC_BITS 9
48+#define VLC_STATIC_SIZE 512
49+#endif
4350
4451 typedef struct SubStream {
4552 /// 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
190197 if (!huff_vlc[0].bits) {
191198 INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
192199 &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);
194201 INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
195202 &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);
197204 INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
198205 &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);
200207 }
201208
202209 ff_mlp_init_crc();

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t