[SCM] libav/experimental: truehd: tune VLC decoding for ARM.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Aug 10 16:02:26 UTC 2014


The following commit has been merged in the experimental branch:
commit fcf5fc444522d24caa9907225802817ae788f511
Author: Ben Avison <bavison at riscosopen.org>
Date:   Thu Mar 20 18:58:38 2014 +0000

    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%
    
    Signed-off-by: Martin Storsjö <martin at martin.st>

diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index c0f2d6a..e0415f5 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -37,9 +37,16 @@
 #include "mlp_parser.h"
 #include "mlpdsp.h"
 #include "mlp.h"
+#include "config.h"
 
 /** number of bits used for VLC lookup - longest Huffman code is 9 */
+#if ARCH_ARM
+#define VLC_BITS            5
+#define VLC_STATIC_SIZE     64
+#else
 #define VLC_BITS            9
+#define VLC_STATIC_SIZE     512
+#endif
 
 typedef struct SubStream {
     /// 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)
     if (!huff_vlc[0].bits) {
         INIT_VLC_STATIC(&huff_vlc[0], VLC_BITS, 18,
                     &ff_mlp_huffman_tables[0][0][1], 2, 1,
-                    &ff_mlp_huffman_tables[0][0][0], 2, 1, 512);
+                    &ff_mlp_huffman_tables[0][0][0], 2, 1, VLC_STATIC_SIZE);
         INIT_VLC_STATIC(&huff_vlc[1], VLC_BITS, 16,
                     &ff_mlp_huffman_tables[1][0][1], 2, 1,
-                    &ff_mlp_huffman_tables[1][0][0], 2, 1, 512);
+                    &ff_mlp_huffman_tables[1][0][0], 2, 1, VLC_STATIC_SIZE);
         INIT_VLC_STATIC(&huff_vlc[2], VLC_BITS, 15,
                     &ff_mlp_huffman_tables[2][0][1], 2, 1,
-                    &ff_mlp_huffman_tables[2][0][0], 2, 1, 512);
+                    &ff_mlp_huffman_tables[2][0][0], 2, 1, VLC_STATIC_SIZE);
     }
 
     ff_mlp_init_crc();

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list