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
37#include "mlp_parser.h"37#include "mlp_parser.h"
38#include "mlpdsp.h"38#include "mlpdsp.h"
39#include "mlp.h"39#include "mlp.h"
40#include "config.h"
40 41
41/** number of bits used for VLC lookup - longest Huffman code is 9 */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#define VLC_BITS 947#define VLC_BITS 9
48#define VLC_STATIC_SIZE 512
49#endif
43 50
44typedef struct SubStream {51typedef struct SubStream {
45 /// Set if a valid restart header has been read. Otherwise the substream cannot be decoded.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 if (!huff_vlc[0].bits) {197 if (!huff_vlc[0].bits) {
191 INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,198 INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
192 &ff_mlp_huffman_tables[0][0][1], 2, 1,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 INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,201 INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
195 &ff_mlp_huffman_tables[1][0][1], 2, 1,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 INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,204 INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
198 &ff_mlp_huffman_tables[2][0][1], 2, 1,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 ff_mlp_init_crc();209 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