[FFmpeg-soc] [soc]: r5470 - in aac-sbr: aacsbr.c aacsbr.h
alexc
subversion at mplayerhq.hu
Sat Nov 28 03:31:20 CET 2009
Author: alexc
Date: Sat Nov 28 03:31:20 2009
New Revision: 5470
Log:
Move bs_amp_res from the SBR context to the SBRData context since it is set per
channel in sbr_grid.
Modified:
aac-sbr/aacsbr.c
aac-sbr/aacsbr.h
Modified: aac-sbr/aacsbr.c
==============================================================================
--- aac-sbr/aacsbr.c Sat Nov 28 03:31:18 2009 (r5469)
+++ aac-sbr/aacsbr.c Sat Nov 28 03:31:20 2009 (r5470)
@@ -504,13 +504,13 @@ static int sbr_grid(AACContext *ac, Spec
int i;
ch_data->bs_num_env[0] = ch_data->bs_num_env[1];
- sbr->bs_amp_res = sbr->bs_amp_res_header;
+ ch_data->bs_amp_res = sbr->bs_amp_res_header;
switch (ch_data->bs_frame_class = get_bits(gb, 2)) {
case FIXFIX:
ch_data->bs_num_env[1] = 1 << get_bits(gb, 2);
if (ch_data->bs_num_env[1] == 1)
- sbr->bs_amp_res = 0;
+ ch_data->bs_amp_res = 0;
ch_data->bs_freq_res[0] = get_bits1(gb);
for (i = 1; i < ch_data->bs_num_env[1]; i++)
@@ -609,7 +609,7 @@ static void sbr_envelope(SpectralBandRep
if (sbr->bs_coupling && ch) {
max_depth = 2;
- if (sbr->bs_amp_res) {
+ if (ch_data->bs_amp_res) {
bits = 5;
t_huff = vlc_sbr[T_HUFFMAN_ENV_BAL_3_0DB].table;
f_huff = vlc_sbr[F_HUFFMAN_ENV_BAL_3_0DB].table;
@@ -620,7 +620,7 @@ static void sbr_envelope(SpectralBandRep
}
} else {
max_depth = 3;
- if (sbr->bs_amp_res) {
+ if (ch_data->bs_amp_res) {
bits = 6;
t_huff = vlc_sbr[T_HUFFMAN_ENV_3_0DB].table;
f_huff = vlc_sbr[F_HUFFMAN_ENV_3_0DB].table;
@@ -966,10 +966,10 @@ static void sbr_env_noise_floors(Spectra
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac, int ch)
{
int k, l;
- float alpha = sbr->bs_amp_res ? 1.0f : 0.5f;
+ float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
if (id_aac == TYPE_CCE && sbr->bs_coupling) {
- float pan_offset = sbr->bs_amp_res ? 12.0f : 24.0f;
+ float pan_offset = sbr->data[ch].bs_amp_res ? 12.0f : 24.0f;
for (l = 1; l <= sbr->data[ch].bs_num_env[1]; l++) {
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[l + 1]]; k++) {
float temp1 = powf(2.0f, sbr->env_facs[0][l][k] * alpha + 7.0f);
Modified: aac-sbr/aacsbr.h
==============================================================================
--- aac-sbr/aacsbr.h Sat Nov 28 03:31:18 2009 (r5469)
+++ aac-sbr/aacsbr.h Sat Nov 28 03:31:20 2009 (r5470)
@@ -100,6 +100,7 @@ typedef struct {
uint32_t bs_data_env[7][32];
uint32_t bs_data_noise[2][5];
uint8_t bs_add_harmonic[32];
+ uint8_t bs_amp_res;
} SBRData;
/**
@@ -109,7 +110,6 @@ typedef struct {
uint8_t start;
int32_t sample_rate;
// SBR header bitstream variables
- uint8_t bs_amp_res;
uint8_t bs_amp_res_header;
SpectrumParameters spectrum_params[2];
// if (bs_header_extra_2)
More information about the FFmpeg-soc
mailing list