@ -237,6 +237,34 @@ static void AAC_RENAME(apply_tns)(void *_coef_param, TemporalNoiseShaping *tns,
}
}
}
}
/**
* Apply windowing and MDCT to obtain the spectral
* coefficient from the predicted sample by LTP .
*/
static inline void AAC_RENAME ( windowing_and_mdct_ltp ) ( AACDecContext * ac ,
INTFLOAT * out , INTFLOAT * in ,
IndividualChannelStream * ics )
{
const INTFLOAT * lwindow = ics - > use_kb_window [ 0 ] ? AAC_RENAME2 ( aac_kbd_long_1024 ) : AAC_RENAME2 ( sine_1024 ) ;
const INTFLOAT * swindow = ics - > use_kb_window [ 0 ] ? AAC_RENAME2 ( aac_kbd_short_128 ) : AAC_RENAME2 ( sine_128 ) ;
const INTFLOAT * lwindow_prev = ics - > use_kb_window [ 1 ] ? AAC_RENAME2 ( aac_kbd_long_1024 ) : AAC_RENAME2 ( sine_1024 ) ;
const INTFLOAT * swindow_prev = ics - > use_kb_window [ 1 ] ? AAC_RENAME2 ( aac_kbd_short_128 ) : AAC_RENAME2 ( sine_128 ) ;
if ( ics - > window_sequence [ 0 ] ! = LONG_STOP_SEQUENCE ) {
ac - > fdsp - > vector_fmul ( in , in , lwindow_prev , 1024 ) ;
} else {
memset ( in , 0 , 448 * sizeof ( * in ) ) ;
ac - > fdsp - > vector_fmul ( in + 448 , in + 448 , swindow_prev , 128 ) ;
}
if ( ics - > window_sequence [ 0 ] ! = LONG_START_SEQUENCE ) {
ac - > fdsp - > vector_fmul_reverse ( in + 1024 , in + 1024 , lwindow , 1024 ) ;
} else {
ac - > fdsp - > vector_fmul_reverse ( in + 1024 + 448 , in + 1024 + 448 , swindow , 128 ) ;
memset ( in + 1024 + 576 , 0 , 448 * sizeof ( * in ) ) ;
}
ac - > mdct_ltp_fn ( ac - > mdct_ltp , out , in , sizeof ( INTFLOAT ) ) ;
}
/**
/**
* Apply the long term prediction
* Apply the long term prediction
*/
*/
@ -257,7 +285,7 @@ static void AAC_RENAME(apply_ltp)(AACDecContext *ac, SingleChannelElement *sce)
predTime [ i ] = AAC_MUL30 ( sce - > AAC_RENAME ( ltp_state ) [ i + 2048 - ltp - > lag ] , ltp - > AAC_RENAME ( coef ) ) ;
predTime [ i ] = AAC_MUL30 ( sce - > AAC_RENAME ( ltp_state ) [ i + 2048 - ltp - > lag ] , ltp - > AAC_RENAME ( coef ) ) ;
memset ( & predTime [ i ] , 0 , ( 2048 - i ) * sizeof ( * predTime ) ) ;
memset ( & predTime [ i ] , 0 , ( 2048 - i ) * sizeof ( * predTime ) ) ;
ac - > AAC_RENAME ( windowing_and_mdct_ltp ) ( ac , predFreq , predTime , & sce - > ics ) ;
AAC_RENAME ( windowing_and_mdct_ltp ) ( ac , predFreq , predTime , & sce - > ics ) ;
if ( sce - > tns . present )
if ( sce - > tns . present )
AAC_RENAME ( apply_tns ) ( predFreq , & sce - > tns , & sce - > ics , 0 ) ;
AAC_RENAME ( apply_tns ) ( predFreq , & sce - > tns , & sce - > ics , 0 ) ;