From 609c526d563a499ae5aec9c1ed6ce8642cb99772 Mon Sep 17 00:00:00 2001 From: Andree Buschmann Date: Fri, 20 May 2011 23:28:09 +0000 Subject: Use more IRAM on S5L870x to speed up wmapro by ~2%. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29906 a1c6a512-1295-4272-9138-f99709370657 --- apps/codecs/lib/ffmpeg_get_bits.h | 4 ++-- apps/codecs/libwmapro/wmaprodec.c | 14 +++++++------- apps/codecs/libwmapro/wmaprodec.h | 14 +++++++++++++- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/apps/codecs/lib/ffmpeg_get_bits.h b/apps/codecs/lib/ffmpeg_get_bits.h index 139d7ae556..04eda021a7 100644 --- a/apps/codecs/lib/ffmpeg_get_bits.h +++ b/apps/codecs/lib/ffmpeg_get_bits.h @@ -571,9 +571,9 @@ int init_vlc_sparse(VLC *vlc, int nb_bits, int nb_codes, #define INIT_VLC_USE_NEW_STATIC 4 void free_vlc(VLC *vlc); -#define INIT_VLC_STATIC(vlc, bits, a,b,c,d,e,f,g, static_size)\ +#define INIT_VLC_STATIC(vlc, bits, a,b,c,d,e,f,g, static_size, attr)\ {\ - static VLC_TYPE table[static_size][2];\ + static VLC_TYPE table[static_size][2] attr;\ (vlc)->table= table;\ (vlc)->table_allocated= static_size;\ init_vlc(vlc, bits, a,b,c,d,e,f,g, INIT_VLC_USE_NEW_STATIC);\ diff --git a/apps/codecs/libwmapro/wmaprodec.c b/apps/codecs/libwmapro/wmaprodec.c index c72bd0f10f..9d42c6de0f 100644 --- a/apps/codecs/libwmapro/wmaprodec.c +++ b/apps/codecs/libwmapro/wmaprodec.c @@ -400,31 +400,31 @@ int decode_init(asf_waveformatex_t *wfx) INIT_VLC_STATIC(&sf_vlc, SCALEVLCBITS, HUFF_SCALE_SIZE, scale_huffbits, 1, 1, - scale_huffcodes, 2, 2, 616); + scale_huffcodes, 2, 2, 616, IBSS_ATTR_WMAPRO_VLC_TABLES); INIT_VLC_STATIC(&sf_rl_vlc, VLCBITS, HUFF_SCALE_RL_SIZE, scale_rl_huffbits, 1, 1, - scale_rl_huffcodes, 4, 4, 1406); + scale_rl_huffcodes, 4, 4, 1406, IBSS_ATTR_WMAPRO_VLC_TABLES); INIT_VLC_STATIC(&coef_vlc[0], VLCBITS, HUFF_COEF0_SIZE, coef0_huffbits, 1, 1, - coef0_huffcodes, 4, 4, 2108); + coef0_huffcodes, 4, 4, 2108, IBSS_ATTR_WMAPRO_VLC_TABLES); INIT_VLC_STATIC(&coef_vlc[1], VLCBITS, HUFF_COEF1_SIZE, coef1_huffbits, 1, 1, - coef1_huffcodes, 4, 4, 3912); + coef1_huffcodes, 4, 4, 3912, IBSS_ATTR_WMAPRO_VLC_TABLES); INIT_VLC_STATIC(&vec4_vlc, VLCBITS, HUFF_VEC4_SIZE, vec4_huffbits, 1, 1, - vec4_huffcodes, 2, 2, 604); + vec4_huffcodes, 2, 2, 604, IBSS_ATTR_WMAPRO_VLC_TABLES); INIT_VLC_STATIC(&vec2_vlc, VLCBITS, HUFF_VEC2_SIZE, vec2_huffbits, 1, 1, - vec2_huffcodes, 2, 2, 562); + vec2_huffcodes, 2, 2, 562, IBSS_ATTR_WMAPRO_VLC_TABLES); INIT_VLC_STATIC(&vec1_vlc, VLCBITS, HUFF_VEC1_SIZE, vec1_huffbits, 1, 1, - vec1_huffcodes, 2, 2, 562); + vec1_huffcodes, 2, 2, 562, IBSS_ATTR_WMAPRO_VLC_TABLES); /** calculate number of scale factor bands and their offsets for every possible block size */ diff --git a/apps/codecs/libwmapro/wmaprodec.h b/apps/codecs/libwmapro/wmaprodec.h index e30205cd35..d8398fc9f1 100644 --- a/apps/codecs/libwmapro/wmaprodec.h +++ b/apps/codecs/libwmapro/wmaprodec.h @@ -7,24 +7,36 @@ #define IBSS_ATTR_WMAPRO_LARGE_IRAM IBSS_ATTR #define ICODE_ATTR_WMAPRO_LARGE_IRAM #define ICONST_ATTR_WMAPRO_LARGE_IRAM ICONST_ATTR +#define IBSS_ATTR_WMAPRO_VLC_TABLES #define ICONST_ATTR_WMAPRO_WIN_VS_TMP -#elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) || defined(CPU_S5L870X) +#elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) /* Enough IRAM to move additional data and code to it. */ #define IBSS_ATTR_WMAPRO_LARGE_IRAM IBSS_ATTR #define ICODE_ATTR_WMAPRO_LARGE_IRAM ICODE_ATTR #define ICONST_ATTR_WMAPRO_LARGE_IRAM ICONST_ATTR +#define IBSS_ATTR_WMAPRO_VLC_TABLES #define ICONST_ATTR_WMAPRO_WIN_VS_TMP +#elif defined(CPU_S5L870X) +/* Enough IRAM to move additional data and code to it. */ +#define IBSS_ATTR_WMAPRO_LARGE_IRAM IBSS_ATTR +#define ICODE_ATTR_WMAPRO_LARGE_IRAM ICODE_ATTR +#define ICONST_ATTR_WMAPRO_LARGE_IRAM ICONST_ATTR +#define IBSS_ATTR_WMAPRO_VLC_TABLES IBSS_ATTR +#define ICONST_ATTR_WMAPRO_WIN_VS_TMP ICONST_ATTR + #else /* Not enough IRAM available. */ #define IBSS_ATTR_WMAPRO_LARGE_IRAM #define ICODE_ATTR_WMAPRO_LARGE_IRAM #define ICONST_ATTR_WMAPRO_LARGE_IRAM +#define IBSS_ATTR_WMAPRO_VLC_TABLES /* Models with large IRAM put tmp to IRAM rather than window coefficients as * this is the fastest option. On models with smaller IRAM the 2nd-best option * is to move the window coefficients to IRAM. */ #define ICONST_ATTR_WMAPRO_WIN_VS_TMP ICONST_ATTR + #endif int decode_init(asf_waveformatex_t *wfx); -- cgit v1.2.3