diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-19 12:03:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-19 13:12:20 +0100 |
commit | bfd0e02dd64e912a6b67c25d9f86b3b0b849ad10 (patch) | |
tree | 842fbb097a5fd1bdb1833fd52e7ea148220f6c1f /libavcodec/aacsbr_template.c | |
parent | 50ce510ac4e3ed093c051738242a9a75aeeb36ce (diff) | |
download | ffmpeg-bfd0e02dd64e912a6b67c25d9f86b3b0b849ad10.tar.gz |
avcodec/aacsbr: Split pre dequantization noise factors table
This allows removing a special case for the fixed point decoder and will
make error checks simpler
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/aacsbr_template.c')
-rw-r--r-- | libavcodec/aacsbr_template.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/libavcodec/aacsbr_template.c b/libavcodec/aacsbr_template.c index 66f415912c..906823ab72 100644 --- a/libavcodec/aacsbr_template.c +++ b/libavcodec/aacsbr_template.c @@ -906,33 +906,20 @@ static void read_sbr_noise(SpectralBandReplication *sbr, GetBitContext *gb, f_lav = vlc_sbr_lav[F_HUFFMAN_ENV_3_0DB]; } -#if USE_FIXED - for (i = 0; i < ch_data->bs_num_noise; i++) { - if (ch_data->bs_df_noise[i]) { - for (j = 0; j < sbr->n_q; j++) - ch_data->noise_facs[i + 1][j].mant = ch_data->noise_facs[i][j].mant + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav); - } else { - ch_data->noise_facs[i + 1][0].mant = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level - for (j = 1; j < sbr->n_q; j++) - ch_data->noise_facs[i + 1][j].mant = ch_data->noise_facs[i + 1][j - 1].mant + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav); - } - } -#else for (i = 0; i < ch_data->bs_num_noise; i++) { if (ch_data->bs_df_noise[i]) { for (j = 0; j < sbr->n_q; j++) - ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i][j] + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav); + ch_data->noise_facs_q[i + 1][j] = ch_data->noise_facs_q[i][j] + delta * (get_vlc2(gb, t_huff, 9, 2) - t_lav); } else { - ch_data->noise_facs[i + 1][0] = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level + ch_data->noise_facs_q[i + 1][0] = delta * get_bits(gb, 5); // bs_noise_start_value_balance or bs_noise_start_value_level for (j = 1; j < sbr->n_q; j++) - ch_data->noise_facs[i + 1][j] = ch_data->noise_facs[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav); + ch_data->noise_facs_q[i + 1][j] = ch_data->noise_facs_q[i + 1][j - 1] + delta * (get_vlc2(gb, f_huff, 9, 3) - f_lav); } } -#endif /* USE_FIXED */ - //assign 0th elements of noise_facs from last elements - memcpy(ch_data->noise_facs[0], ch_data->noise_facs[ch_data->bs_num_noise], - sizeof(ch_data->noise_facs[0])); + //assign 0th elements of noise_facs_q from last elements + memcpy(ch_data->noise_facs_q[0], ch_data->noise_facs_q[ch_data->bs_num_noise], + sizeof(ch_data->noise_facs_q[0])); } static void read_sbr_extension(AACContext *ac, SpectralBandReplication *sbr, |