Commit 354490e1 authored by mru's avatar mru

AAC: Reduce depth of vlc_spectral tables to 2

Up to 6% faster overall on i7, no change on A8.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@21191 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 23df8c0d
...@@ -508,17 +508,17 @@ static av_cold int aac_decode_init(AVCodecContext *avccontext) ...@@ -508,17 +508,17 @@ static av_cold int aac_decode_init(AVCodecContext *avccontext)
avccontext->sample_fmt = SAMPLE_FMT_S16; avccontext->sample_fmt = SAMPLE_FMT_S16;
avccontext->frame_size = 1024; avccontext->frame_size = 1024;
AAC_INIT_VLC_STATIC( 0, 144); AAC_INIT_VLC_STATIC( 0, 304);
AAC_INIT_VLC_STATIC( 1, 114); AAC_INIT_VLC_STATIC( 1, 270);
AAC_INIT_VLC_STATIC( 2, 188); AAC_INIT_VLC_STATIC( 2, 550);
AAC_INIT_VLC_STATIC( 3, 180); AAC_INIT_VLC_STATIC( 3, 300);
AAC_INIT_VLC_STATIC( 4, 172); AAC_INIT_VLC_STATIC( 4, 328);
AAC_INIT_VLC_STATIC( 5, 140); AAC_INIT_VLC_STATIC( 5, 294);
AAC_INIT_VLC_STATIC( 6, 168); AAC_INIT_VLC_STATIC( 6, 306);
AAC_INIT_VLC_STATIC( 7, 114); AAC_INIT_VLC_STATIC( 7, 268);
AAC_INIT_VLC_STATIC( 8, 262); AAC_INIT_VLC_STATIC( 8, 510);
AAC_INIT_VLC_STATIC( 9, 248); AAC_INIT_VLC_STATIC( 9, 366);
AAC_INIT_VLC_STATIC(10, 384); AAC_INIT_VLC_STATIC(10, 462);
dsputil_init(&ac->dsp, avccontext); dsputil_init(&ac->dsp, avccontext);
...@@ -989,7 +989,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], ...@@ -989,7 +989,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
int len = off_len; int len = off_len;
do { do {
const int index = get_vlc2(gb, vlc_tab, 6, 3); const int index = get_vlc2(gb, vlc_tab, 8, 2);
unsigned cb_idx; unsigned cb_idx;
if (index >= cb_size) { if (index >= cb_size) {
...@@ -1009,7 +1009,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], ...@@ -1009,7 +1009,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
int len = off_len; int len = off_len;
do { do {
const int index = get_vlc2(gb, vlc_tab, 6, 3); const int index = get_vlc2(gb, vlc_tab, 8, 2);
unsigned nnz; unsigned nnz;
unsigned cb_idx; unsigned cb_idx;
uint32_t bits; uint32_t bits;
...@@ -1033,7 +1033,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], ...@@ -1033,7 +1033,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
int len = off_len; int len = off_len;
do { do {
const int index = get_vlc2(gb, vlc_tab, 6, 3); const int index = get_vlc2(gb, vlc_tab, 8, 2);
unsigned cb_idx; unsigned cb_idx;
if (index >= cb_size) { if (index >= cb_size) {
...@@ -1054,7 +1054,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], ...@@ -1054,7 +1054,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
int len = off_len; int len = off_len;
do { do {
const int index = get_vlc2(gb, vlc_tab, 6, 3); const int index = get_vlc2(gb, vlc_tab, 8, 2);
unsigned nnz; unsigned nnz;
unsigned cb_idx; unsigned cb_idx;
unsigned sign; unsigned sign;
...@@ -1079,7 +1079,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024], ...@@ -1079,7 +1079,7 @@ static int decode_spectrum_and_dequant(AACContext *ac, float coef[1024],
int len = off_len; int len = off_len;
do { do {
const int index = get_vlc2(gb, vlc_tab, 6, 3); const int index = get_vlc2(gb, vlc_tab, 8, 2);
unsigned nzt, nnz; unsigned nzt, nnz;
unsigned cb_idx; unsigned cb_idx;
uint32_t bits; uint32_t bits;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <stdint.h> #include <stdint.h>
#define AAC_INIT_VLC_STATIC(num, size) \ #define AAC_INIT_VLC_STATIC(num, size) \
INIT_VLC_STATIC(&vlc_spectral[num], 6, ff_aac_spectral_sizes[num], \ INIT_VLC_STATIC(&vlc_spectral[num], 8, ff_aac_spectral_sizes[num], \
ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \ ff_aac_spectral_bits[num], sizeof( ff_aac_spectral_bits[num][0]), sizeof( ff_aac_spectral_bits[num][0]), \
ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \ ff_aac_spectral_codes[num], sizeof(ff_aac_spectral_codes[num][0]), sizeof(ff_aac_spectral_codes[num][0]), \
size); size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment