mirror of
https://github.com/xiph/opus.git
synced 2025-05-27 13:49:13 +00:00
increase NSQ decision delay from 32 to 40
This commit is contained in:
parent
ae25203fa7
commit
2799c53ced
5 changed files with 20 additions and 14 deletions
|
@ -237,7 +237,8 @@ void silk_NSQ_del_dec_c(
|
|||
psDD = &psDelDec[ Winner_ind ];
|
||||
last_smple_idx = smpl_buf_idx + decisionDelay;
|
||||
for( i = 0; i < decisionDelay; i++ ) {
|
||||
last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK;
|
||||
last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY;
|
||||
if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY;
|
||||
pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND(
|
||||
silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gains_Q16[ 1 ] ), 14 ) );
|
||||
|
@ -288,7 +289,9 @@ void silk_NSQ_del_dec_c(
|
|||
last_smple_idx = smpl_buf_idx + decisionDelay;
|
||||
Gain_Q10 = silk_RSHIFT32( Gains_Q16[ psEncC->nb_subfr - 1 ], 6 );
|
||||
for( i = 0; i < decisionDelay; i++ ) {
|
||||
last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK;
|
||||
last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY;
|
||||
if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY;
|
||||
|
||||
pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND(
|
||||
silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gain_Q10 ), 8 ) );
|
||||
|
@ -562,8 +565,9 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
|
|||
psSS[ 1 ].xq_Q14 = xq_Q14;
|
||||
}
|
||||
|
||||
*smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */
|
||||
last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */
|
||||
*smpl_buf_idx = ( *smpl_buf_idx - 1 ) % DECISION_DELAY;
|
||||
if( *smpl_buf_idx < 0 ) *smpl_buf_idx += DECISION_DELAY;
|
||||
last_smple_idx = ( *smpl_buf_idx + decisionDelay ) % DECISION_DELAY;
|
||||
|
||||
/* Find winner */
|
||||
RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10;
|
||||
|
|
|
@ -64,8 +64,7 @@ opus_int silk_control_SNR(
|
|||
/* Find bitrate interval in table and interpolate */
|
||||
for( k = 1; k < TARGET_RATE_TAB_SZ; k++ ) {
|
||||
if( TargetRate_bps <= rateTable[ k ] ) {
|
||||
frac_Q6 = silk_DIV32( silk_LSHIFT( TargetRate_bps - rateTable[ k - 1 ], 6 ),
|
||||
rateTable[ k ] - rateTable[ k - 1 ] );
|
||||
frac_Q6 = silk_DIV32( silk_LSHIFT( TargetRate_bps - rateTable[ k - 1 ], 6 ), rateTable[ k ] - rateTable[ k - 1 ] );
|
||||
psEncC->SNR_dB_Q7 = silk_LSHIFT( silk_SNR_table_Q1[ k - 1 ], 6 ) + silk_MUL( frac_Q6, silk_SNR_table_Q1[ k ] - silk_SNR_table_Q1[ k - 1 ] );
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -158,8 +158,7 @@ extern "C"
|
|||
#define LTP_BUF_LENGTH 512
|
||||
#define LTP_MASK ( LTP_BUF_LENGTH - 1 )
|
||||
|
||||
#define DECISION_DELAY 32
|
||||
#define DECISION_DELAY_MASK ( DECISION_DELAY - 1 )
|
||||
#define DECISION_DELAY 40
|
||||
|
||||
/* Number of subframes for excitation entropy coding */
|
||||
#define SHELL_CODEC_FRAME_LENGTH 16
|
||||
|
|
|
@ -323,8 +323,9 @@ static inline void silk_noise_shape_quantizer_del_dec(
|
|||
psSS[ 1 ].xq_Q14 = xq_Q14;
|
||||
}
|
||||
|
||||
*smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */
|
||||
last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */
|
||||
*smpl_buf_idx = ( *smpl_buf_idx - 1 ) % DECISION_DELAY;
|
||||
if( *smpl_buf_idx < 0 ) *smpl_buf_idx += DECISION_DELAY;
|
||||
last_smple_idx = ( *smpl_buf_idx + decisionDelay ) % DECISION_DELAY;
|
||||
|
||||
/* Find winner */
|
||||
RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10;
|
||||
|
|
|
@ -234,7 +234,8 @@ void silk_NSQ_del_dec_sse4_1(
|
|||
psDD = &psDelDec[ Winner_ind ];
|
||||
last_smple_idx = smpl_buf_idx + decisionDelay;
|
||||
for( i = 0; i < decisionDelay; i++ ) {
|
||||
last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK;
|
||||
last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY;
|
||||
if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY;
|
||||
pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND(
|
||||
silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gains_Q16[ 1 ] ), 14 ) );
|
||||
|
@ -285,7 +286,8 @@ void silk_NSQ_del_dec_sse4_1(
|
|||
last_smple_idx = smpl_buf_idx + decisionDelay;
|
||||
Gain_Q10 = silk_RSHIFT32( Gains_Q16[ psEncC->nb_subfr - 1 ], 6 );
|
||||
for( i = 0; i < decisionDelay; i++ ) {
|
||||
last_smple_idx = ( last_smple_idx - 1 ) & DECISION_DELAY_MASK;
|
||||
last_smple_idx = ( last_smple_idx - 1 ) % DECISION_DELAY;
|
||||
if( last_smple_idx < 0 ) last_smple_idx += DECISION_DELAY;
|
||||
pulses[ i - decisionDelay ] = (opus_int8)silk_RSHIFT_ROUND( psDD->Q_Q10[ last_smple_idx ], 10 );
|
||||
pxq[ i - decisionDelay ] = (opus_int16)silk_SAT16( silk_RSHIFT_ROUND(
|
||||
silk_SMULWW( psDD->Xq_Q14[ last_smple_idx ], Gain_Q10 ), 8 ) );
|
||||
|
@ -638,8 +640,9 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec_sse4_1(
|
|||
psSS[ 1 ].xq_Q14 = xq_Q14;
|
||||
}
|
||||
}
|
||||
*smpl_buf_idx = ( *smpl_buf_idx - 1 ) & DECISION_DELAY_MASK; /* Index to newest samples */
|
||||
last_smple_idx = ( *smpl_buf_idx + decisionDelay ) & DECISION_DELAY_MASK; /* Index to decisionDelay old samples */
|
||||
*smpl_buf_idx = ( *smpl_buf_idx - 1 ) % DECISION_DELAY;
|
||||
if( *smpl_buf_idx < 0 ) *smpl_buf_idx += DECISION_DELAY;
|
||||
last_smple_idx = ( *smpl_buf_idx + decisionDelay ) % DECISION_DELAY;
|
||||
|
||||
/* Find winner */
|
||||
RDmin_Q10 = psSampleState[ 0 ][ 0 ].RD_Q10;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue