Index: apps/codecs/libwmapro/wmaprodec.c =================================================================== --- apps/codecs/libwmapro/wmaprodec.c (revision 27632) +++ apps/codecs/libwmapro/wmaprodec.c (working copy) @@ -877,7 +877,7 @@ for (i = 0; i < 4; i++) { if (vals[i]) { int sign = get_bits1(&s->gb) - 1; - ci->coeffs[cur_coeff] = (sign == -1)? -vals[i]<coeffs[cur_coeff] = (sign == -1)? vals[i]<coeffs[cur_coeff] = 0; @@ -1261,6 +1261,7 @@ get_bits_count(&s->gb) - s->subframe_offset); if (transmit_coeffs) { + int nbits = av_log2(subframe_len)+1; /** reconstruct the per channel data */ inverse_channel_transform(s); for (i = 0; i < s->channels_for_cur_subframe; i++) { @@ -1271,7 +1272,7 @@ if (c == s->lfe_channel) memset(&s->tmp[cur_subwoofer_cutoff], 0, sizeof(*s->tmp) * (subframe_len - cur_subwoofer_cutoff)); - + /** inverse quantization and rescaling */ for (b = 0; b < s->num_bands; b++) { const int end = FFMIN(s->cur_sfb_offsets[b+1], s->subframe_len); @@ -1288,14 +1289,13 @@ vector_fixmul_scalar(s->tmp+start, s->channel[c].coeffs + start, - quant, end-start); + quant>>(nbits-3), end-start); } /** apply imdct (ff_imdct_half == DCTIV with reverse) */ - imdct_half(av_log2(subframe_len)+1, - s->channel[c].coeffs, s->tmp); + ff_imdct_half(nbits,s->channel[c].coeffs, s->tmp); } } Index: apps/codecs/libwmapro/wma.c =================================================================== --- apps/codecs/libwmapro/wma.c (revision 27632) +++ apps/codecs/libwmapro/wma.c (working copy) @@ -115,7 +115,7 @@ /** normal code */ offset += run_table[code]; sign = !get_bits1(gb); - ptr[offset & coef_mask] = sign ? -level_table[code] : level_table[code]; + ptr[offset & coef_mask] = sign ? level_table[code] : -level_table[code]; ptr[offset & coef_mask] <<= WMAPRO_FRACT; } else if (code == 1) { /** EOB */ @@ -143,7 +143,7 @@ } } sign = !get_bits1(gb); - ptr[offset & coef_mask] = sign ? -level : level; + ptr[offset & coef_mask] = sign ? level : -level; ptr[offset & coef_mask] <<= WMAPRO_FRACT; } }