forked from len0rd/rockbox
Fix FS#10174 by correcting an oversimplification of the AAC window switching code I introduced with the unified IMDCT library. Should significantly improve accuracy for all AAC files.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20821 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
14731bc3e2
commit
0a1baa36b1
3 changed files with 24 additions and 9 deletions
|
|
@ -198,8 +198,8 @@ static INLINE void mdct(fb_info *fb, real_t *in_data, real_t *out_data, uint16_t
|
||||||
|
|
||||||
ALIGN real_t transf_buf[2*1024] IBSS_ATTR;
|
ALIGN real_t transf_buf[2*1024] IBSS_ATTR;
|
||||||
|
|
||||||
void ifilter_bank(uint8_t window_sequence,
|
void ifilter_bank(uint8_t window_sequence, uint8_t window_shape,
|
||||||
real_t *freq_in,
|
uint8_t window_shape_prev, real_t *freq_in,
|
||||||
real_t *time_out, real_t *overlap,
|
real_t *time_out, real_t *overlap,
|
||||||
uint8_t object_type, uint16_t frame_len)
|
uint8_t object_type, uint16_t frame_len)
|
||||||
{
|
{
|
||||||
|
|
@ -232,10 +232,22 @@ void ifilter_bank(uint8_t window_sequence,
|
||||||
(void) object_type;
|
(void) object_type;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
window_long = sine_long_1024;
|
/*AAC uses two different window shapes depending on spectal features*/
|
||||||
|
if(window_shape == 0){
|
||||||
|
window_long = sine_long_1024;
|
||||||
|
window_short = sine_short_128;
|
||||||
|
} else {
|
||||||
|
window_long = kbd_long_1024;
|
||||||
|
window_short = kbd_short_128;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(window_shape_prev == 0){
|
||||||
|
window_long_prev = sine_long_1024;
|
||||||
|
window_short_prev = sine_short_128;
|
||||||
|
} else {
|
||||||
window_long_prev = kbd_long_1024;
|
window_long_prev = kbd_long_1024;
|
||||||
window_short = sine_short_128;
|
|
||||||
window_short_prev = kbd_short_128;
|
window_short_prev = kbd_short_128;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef LD_DEC
|
#ifdef LD_DEC
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ void filter_bank_ltp(fb_info *fb,
|
||||||
uint16_t frame_len);
|
uint16_t frame_len);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void ifilter_bank(uint8_t window_sequence,
|
void ifilter_bank(uint8_t window_sequence, uint8_t window_shape,
|
||||||
real_t *freq_in,
|
uint8_t window_shape_prev, real_t *freq_in,
|
||||||
real_t *time_out, real_t *overlap,
|
real_t *time_out, real_t *overlap,
|
||||||
uint8_t object_type, uint16_t frame_len);
|
uint8_t object_type, uint16_t frame_len);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -960,7 +960,8 @@ uint8_t reconstruct_single_channel(NeAACDecHandle hDecoder, ic_stream *ics,
|
||||||
if (hDecoder->object_type != SSR)
|
if (hDecoder->object_type != SSR)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
ifilter_bank(ics->window_sequence,spec_coef,
|
ifilter_bank(ics->window_sequence,ics->window_shape,
|
||||||
|
hDecoder->window_shape_prev[sce->channel],spec_coef,
|
||||||
hDecoder->time_out[sce->channel], hDecoder->fb_intermed[sce->channel],
|
hDecoder->time_out[sce->channel], hDecoder->fb_intermed[sce->channel],
|
||||||
hDecoder->object_type, hDecoder->frameLength);
|
hDecoder->object_type, hDecoder->frameLength);
|
||||||
#ifdef SSR_DEC
|
#ifdef SSR_DEC
|
||||||
|
|
@ -1198,10 +1199,12 @@ uint8_t reconstruct_channel_pair(NeAACDecHandle hDecoder, ic_stream *ics1, ic_st
|
||||||
if (hDecoder->object_type != SSR)
|
if (hDecoder->object_type != SSR)
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
ifilter_bank(ics1->window_sequence, spec_coef1,
|
ifilter_bank(ics1->window_sequence,ics1->window_shape,
|
||||||
|
hDecoder->window_shape_prev[cpe->channel],spec_coef1,
|
||||||
hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
|
hDecoder->time_out[cpe->channel], hDecoder->fb_intermed[cpe->channel],
|
||||||
hDecoder->object_type, hDecoder->frameLength);
|
hDecoder->object_type, hDecoder->frameLength);
|
||||||
ifilter_bank(ics2->window_sequence,spec_coef2,
|
ifilter_bank(ics2->window_sequence,ics2->window_shape,
|
||||||
|
hDecoder->window_shape_prev[cpe->paired_channel], spec_coef2,
|
||||||
hDecoder->time_out[cpe->paired_channel], hDecoder->fb_intermed[cpe->paired_channel],
|
hDecoder->time_out[cpe->paired_channel], hDecoder->fb_intermed[cpe->paired_channel],
|
||||||
hDecoder->object_type, hDecoder->frameLength);
|
hDecoder->object_type, hDecoder->frameLength);
|
||||||
#ifdef SSR_DEC
|
#ifdef SSR_DEC
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue