Commit 66fd974b authored by alexc's avatar alexc

aacsbr: Cleanup read_sbr_grid and copy_sbr_grid after the recent overhaul of those functions.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22412 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 1c17565e
......@@ -618,7 +618,7 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
GetBitContext *gb, SBRData *ch_data)
{
int i;
unsigned bs_pointer;
unsigned bs_pointer = 0;
// frameLengthFlag ? 15 : 16; 960 sample length frames unsupported; this value is numTimeSlots
int abs_bord_trail = 16;
int num_rel_lead, num_rel_trail;
......@@ -650,8 +650,6 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
for (i = 0; i < num_rel_lead; i++)
ch_data->t_env[i + 1] = ch_data->t_env[i] + abs_bord_trail;
bs_pointer = 0;
ch_data->bs_freq_res[1] = get_bits1(gb);
for (i = 1; i < ch_data->bs_num_env; i++)
ch_data->bs_freq_res[i + 1] = ch_data->bs_freq_res[1];
......@@ -659,13 +657,13 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
case FIXVAR:
abs_bord_trail += get_bits(gb, 2);
num_rel_trail = get_bits(gb, 2);
num_rel_lead = 0;
ch_data->bs_num_env = num_rel_trail + 1;
ch_data->t_env[0] = 0;
ch_data->t_env[ch_data->bs_num_env] = abs_bord_trail;
for (i = 0; i < num_rel_trail; i++)
ch_data->t_env[ch_data->bs_num_env - 1 - i] = ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
ch_data->t_env[ch_data->bs_num_env - 1 - i] =
ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
......@@ -703,7 +701,8 @@ static int read_sbr_grid(AACContext *ac, SpectralBandReplication *sbr,
for (i = 0; i < num_rel_lead; i++)
ch_data->t_env[i + 1] = ch_data->t_env[i] + 2 * get_bits(gb, 2) + 2;
for (i = 0; i < num_rel_trail; i++)
ch_data->t_env[ch_data->bs_num_env - 1 - i] = ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
ch_data->t_env[ch_data->bs_num_env - 1 - i] =
ch_data->t_env[ch_data->bs_num_env - i] - 2 * get_bits(gb, 2) - 2;
bs_pointer = get_bits(gb, ceil_log2[ch_data->bs_num_env]);
......
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