"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libavcodec/aacsbr.c" between
libav-12.tar.gz and libav-12.1.tar.gz

About: libav provides cross-platform tools ("avconv") and libraries to convert, manipulate and stream a wide range of multimedia (audio and video) formats and protocols.

aacsbr.c  (libav-12):aacsbr.c  (libav-12.1)
skipping to change at line 330 skipping to change at line 330
/// Master Frequency Band Table (14496-3 sp04 p194) /// Master Frequency Band Table (14496-3 sp04 p194)
static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr, static int sbr_make_f_master(AACContext *ac, SpectralBandReplication *sbr,
SpectrumParameters *spectrum) SpectrumParameters *spectrum)
{ {
unsigned int temp, max_qmf_subbands = 0; unsigned int temp, max_qmf_subbands = 0;
unsigned int start_min, stop_min; unsigned int start_min, stop_min;
int k; int k;
const int8_t *sbr_offset_ptr; const int8_t *sbr_offset_ptr;
int16_t stop_dk[13]; int16_t stop_dk[13];
if (sbr->sample_rate < 32000) {
temp = 3000;
} else if (sbr->sample_rate < 64000) {
temp = 4000;
} else
temp = 5000;
start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
switch (sbr->sample_rate) { switch (sbr->sample_rate) {
case 16000: case 16000:
sbr_offset_ptr = sbr_offset[0]; sbr_offset_ptr = sbr_offset[0];
break; break;
case 22050: case 22050:
sbr_offset_ptr = sbr_offset[1]; sbr_offset_ptr = sbr_offset[1];
break; break;
case 24000: case 24000:
sbr_offset_ptr = sbr_offset[2]; sbr_offset_ptr = sbr_offset[2];
break; break;
skipping to change at line 365 skipping to change at line 355
break; break;
case 88200: case 96000: case 128000: case 176400: case 192000: case 88200: case 96000: case 128000: case 176400: case 192000:
sbr_offset_ptr = sbr_offset[5]; sbr_offset_ptr = sbr_offset[5];
break; break;
default: default:
av_log(ac->avctx, AV_LOG_ERROR, av_log(ac->avctx, AV_LOG_ERROR,
"Unsupported sample rate for SBR: %d\n", sbr->sample_rate); "Unsupported sample rate for SBR: %d\n", sbr->sample_rate);
return -1; return -1;
} }
if (sbr->sample_rate < 32000) {
temp = 3000;
} else if (sbr->sample_rate < 64000) {
temp = 4000;
} else
temp = 5000;
start_min = ((temp << 7) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
stop_min = ((temp << 8) + (sbr->sample_rate >> 1)) / sbr->sample_rate;
sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq]; sbr->k[0] = start_min + sbr_offset_ptr[spectrum->bs_start_freq];
if (spectrum->bs_stop_freq < 14) { if (spectrum->bs_stop_freq < 14) {
sbr->k[2] = stop_min; sbr->k[2] = stop_min;
make_bands(stop_dk, stop_min, 64, 13); make_bands(stop_dk, stop_min, 64, 13);
qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16); qsort(stop_dk, 13, sizeof(stop_dk[0]), qsort_comparison_function_int16);
for (k = 0; k < spectrum->bs_stop_freq; k++) for (k = 0; k < spectrum->bs_stop_freq; k++)
sbr->k[2] += stop_dk[k]; sbr->k[2] += stop_dk[k];
} else if (spectrum->bs_stop_freq == 14) { } else if (spectrum->bs_stop_freq == 14) {
sbr->k[2] = 2*sbr->k[0]; sbr->k[2] = 2*sbr->k[0];
skipping to change at line 1100 skipping to change at line 1100
if (sbr->start) if (sbr->start)
num_sbr_bits += read_sbr_data(ac, sbr, gb, id_aac); num_sbr_bits += read_sbr_data(ac, sbr, gb, id_aac);
num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7; num_align_bits = ((cnt << 3) - 4 - num_sbr_bits) & 7;
bytes_read = ((num_sbr_bits + num_align_bits + 4) >> 3); bytes_read = ((num_sbr_bits + num_align_bits + 4) >> 3);
if (bytes_read > cnt) { if (bytes_read > cnt) {
av_log(ac->avctx, AV_LOG_ERROR, av_log(ac->avctx, AV_LOG_ERROR,
"Expected to read %d SBR bytes actually read %d.\n", cnt, bytes_r ead); "Expected to read %d SBR bytes actually read %d.\n", cnt, bytes_r ead);
sbr_turnoff(sbr);
} }
return cnt; return cnt;
} }
/// Dequantization and stereo decoding (14496-3 sp04 p203) /// Dequantization and stereo decoding (14496-3 sp04 p203)
static void sbr_dequant(SpectralBandReplication *sbr, int id_aac) static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
{ {
int k, e; int k, e;
int ch; int ch;
 End of changes. 3 change blocks. 
10 lines changed or deleted 11 lines changed or added

Home  |  About  |  All  |  Newest  |  Fossies Dox  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTPS