return -E_WMA_BAD_PARAMS;
/* compute MDCT block size */
- if (ahi->sample_rate <= 16000) {
+ if (ahi->sample_rate <= 16000)
pwd->frame_len_bits = 9;
- } else if (ahi->sample_rate <= 22050) {
+ else if (ahi->sample_rate <= 22050)
pwd->frame_len_bits = 10;
- } else {
+ else
pwd->frame_len_bits = 11;
- }
pwd->frame_len = 1 << pwd->frame_len_bits;
if (pwd->use_variable_block_len) {
int nb_max, nb;
high_freq = high_freq * 0.5;
else
high_freq = high_freq * 0.3;
- } else if (sample_rate1 == 11025) {
+ } else if (sample_rate1 == 11025)
high_freq = high_freq * 0.7;
- } else if (sample_rate1 == 8000) {
- if (bps <= 0.625) {
+ else if (sample_rate1 == 8000) {
+ if (bps <= 0.625)
high_freq = high_freq * 0.5;
- } else if (bps > 0.75) {
+ else if (bps > 0.75)
pwd->use_noise_coding = 0;
- } else {
+ else
high_freq = high_freq * 0.65;
- }
} else {
- if (bps >= 0.8) {
+ if (bps >= 0.8)
high_freq = high_freq * 0.75;
- } else if (bps >= 0.6) {
+ else if (bps >= 0.6)
high_freq = high_freq * 0.6;
- } else {
+ else
high_freq = high_freq * 0.5;
- }
}
PARA_INFO_LOG("channels=%d sample_rate=%d "
"bitrate=%d block_align=%d\n",
{
int ret;
int16_t *samples;
- static int frame_count;
if (buf_size == 0) {
pwd->last_superframe_len = 0;
ret = wma_decode_frame(pwd, samples);
if (ret < 0)
goto fail;
- frame_count++;
samples += pwd->ahi.channels * pwd->frame_len;
}
ret = wma_decode_frame(pwd, samples);
if (ret < 0)
goto fail;
- frame_count++;
samples += pwd->ahi.channels * pwd->frame_len;
}
ret = wma_decode_frame(pwd, samples);
if (ret < 0)
goto fail;
- frame_count++;
samples += pwd->ahi.channels * pwd->frame_len;
}
- PARA_DEBUG_LOG("frame_count: %d frame_len: %d, block_len: %d, "
- "outbytes: %zd, eaten: %d\n",
- frame_count, pwd->frame_len, pwd->block_len,
+ PARA_DEBUG_LOG("frame_len: %d, block_len: %d, outbytes: %zd, eaten: %d\n",
+ pwd->frame_len, pwd->block_len,
(int8_t *) samples - (int8_t *) data, pwd->ahi.block_align);
*data_size = (int8_t *)samples - (int8_t *)data;
return pwd->ahi.block_align;