|
|
@ -1285,23 +1285,34 @@ int ff_dca_xbr_parse_frame(DCAContext *s) |
|
|
|
for(i = 0; i < n_xbr_ch[chset]; i++) { |
|
|
|
for(i = 0; i < n_xbr_ch[chset]; i++) { |
|
|
|
const uint32_t *scale_table; |
|
|
|
const uint32_t *scale_table; |
|
|
|
int nbits; |
|
|
|
int nbits; |
|
|
|
|
|
|
|
int scale_table_size; |
|
|
|
|
|
|
|
|
|
|
|
if (s->scalefactor_huffman[chan_base+i] == 6) { |
|
|
|
if (s->scalefactor_huffman[chan_base+i] == 6) { |
|
|
|
scale_table = ff_dca_scale_factor_quant7; |
|
|
|
scale_table = ff_dca_scale_factor_quant7; |
|
|
|
|
|
|
|
scale_table_size = FF_ARRAY_ELEMS(ff_dca_scale_factor_quant7); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
scale_table = ff_dca_scale_factor_quant6; |
|
|
|
scale_table = ff_dca_scale_factor_quant6; |
|
|
|
|
|
|
|
scale_table_size = FF_ARRAY_ELEMS(ff_dca_scale_factor_quant6); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
nbits = anctemp[i]; |
|
|
|
nbits = anctemp[i]; |
|
|
|
|
|
|
|
|
|
|
|
for(j = 0; j < active_bands[chset][i]; j++) { |
|
|
|
for(j = 0; j < active_bands[chset][i]; j++) { |
|
|
|
if(abits_high[i][j] > 0) { |
|
|
|
if(abits_high[i][j] > 0) { |
|
|
|
scale_table_high[i][j][0] = |
|
|
|
int index = get_bits(&s->gb, nbits); |
|
|
|
scale_table[get_bits(&s->gb, nbits)]; |
|
|
|
if (index >= scale_table_size) { |
|
|
|
|
|
|
|
av_log(s->avctx, AV_LOG_ERROR, "scale table index %d invalid\n", index); |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
scale_table_high[i][j][0] = scale_table[index]; |
|
|
|
|
|
|
|
|
|
|
|
if(xbr_tmode && s->transition_mode[i][j]) { |
|
|
|
if(xbr_tmode && s->transition_mode[i][j]) { |
|
|
|
scale_table_high[i][j][1] = |
|
|
|
int index = get_bits(&s->gb, nbits); |
|
|
|
scale_table[get_bits(&s->gb, nbits)]; |
|
|
|
if (index >= scale_table_size) { |
|
|
|
|
|
|
|
av_log(s->avctx, AV_LOG_ERROR, "scale table index %d invalid\n", index); |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
scale_table_high[i][j][1] = scale_table[index]; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|