mirror of
https://github.com/xiph/opus.git
synced 2025-05-31 15:47:43 +00:00
Fixes a minor issue on CELT->SILK switching
This commit is contained in:
parent
38c6a15092
commit
09a84c8e4b
3 changed files with 175 additions and 187 deletions
|
@ -45,7 +45,7 @@
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>HAVE_CONFIG_H;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<AdditionalIncludeDirectories>..\win32;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>../win32;../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
|
|
@ -119,47 +119,37 @@ opus_int silk_encode_frame_FIX(
|
||||||
/*******************************************/
|
/*******************************************/
|
||||||
silk_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length * sizeof( opus_int16 ) );
|
silk_memcpy( x_frame + LA_SHAPE_MS * psEnc->sCmn.fs_kHz, psEnc->sCmn.inputBuf + 1, psEnc->sCmn.frame_length * sizeof( opus_int16 ) );
|
||||||
|
|
||||||
/*****************************************/
|
if( !psEnc->sCmn.prefillFlag ) {
|
||||||
/* Find pitch lags, initial LPC analysis */
|
/*****************************************/
|
||||||
/*****************************************/
|
/* Find pitch lags, initial LPC analysis */
|
||||||
silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );
|
/*****************************************/
|
||||||
|
silk_find_pitch_lags_FIX( psEnc, &sEncCtrl, res_pitch, x_frame );
|
||||||
|
|
||||||
/************************/
|
/************************/
|
||||||
/* Noise shape analysis */
|
/* Noise shape analysis */
|
||||||
/************************/
|
/************************/
|
||||||
silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
|
silk_noise_shape_analysis_FIX( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
|
||||||
|
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
/* Find linear prediction coefficients (LPC + LTP) */
|
/* Find linear prediction coefficients (LPC + LTP) */
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
|
silk_find_pred_coefs_FIX( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
|
||||||
|
|
||||||
/****************************************/
|
/****************************************/
|
||||||
/* Process gains */
|
/* Process gains */
|
||||||
/****************************************/
|
/****************************************/
|
||||||
silk_process_gains_FIX( psEnc, &sEncCtrl, condCoding );
|
silk_process_gains_FIX( psEnc, &sEncCtrl, condCoding );
|
||||||
|
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
/* Prefiltering for noise shaper */
|
/* Prefiltering for noise shaper */
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );
|
silk_prefilter_FIX( psEnc, &sEncCtrl, xfw, x_frame );
|
||||||
|
|
||||||
/****************************************/
|
/****************************************/
|
||||||
/* Low Bitrate Redundant Encoding */
|
/* Low Bitrate Redundant Encoding */
|
||||||
/****************************************/
|
/****************************************/
|
||||||
silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw, condCoding );
|
silk_LBRR_encode_FIX( psEnc, &sEncCtrl, xfw, condCoding );
|
||||||
|
|
||||||
if( psEnc->sCmn.prefillFlag ) {
|
|
||||||
if( psEnc->sCmn.nStatesDelayedDecision > 1 || psEnc->sCmn.warping_Q16 > 0 ) {
|
|
||||||
silk_NSQ_del_dec( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses,
|
|
||||||
sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
|
|
||||||
sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14 );
|
|
||||||
} else {
|
|
||||||
silk_NSQ( &psEnc->sCmn, &psEnc->sCmn.sNSQ, &psEnc->sCmn.indices, xfw, psEnc->sCmn.pulses,
|
|
||||||
sEncCtrl.PredCoef_Q12[ 0 ], sEncCtrl.LTPCoef_Q14, sEncCtrl.AR2_Q13, sEncCtrl.HarmShapeGain_Q14,
|
|
||||||
sEncCtrl.Tilt_Q14, sEncCtrl.LF_shp_Q14, sEncCtrl.Gains_Q16, sEncCtrl.pitchL, sEncCtrl.Lambda_Q10, sEncCtrl.LTP_scale_Q14 );
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
/* Loop over quantizer and entropy coding to control bitrate */
|
/* Loop over quantizer and entropy coding to control bitrate */
|
||||||
maxIter = 5;
|
maxIter = 5;
|
||||||
gainMult_Q8 = SILK_FIX_CONST( 1, 8 );
|
gainMult_Q8 = SILK_FIX_CONST( 1, 8 );
|
||||||
|
|
|
@ -128,39 +128,37 @@ opus_int silk_encode_frame_FLP(
|
||||||
x_frame[ LA_SHAPE_MS * psEnc->sCmn.fs_kHz + i * ( psEnc->sCmn.frame_length >> 3 ) ] += ( 1 - ( i & 2 ) ) * 1e-6f;
|
x_frame[ LA_SHAPE_MS * psEnc->sCmn.fs_kHz + i * ( psEnc->sCmn.frame_length >> 3 ) ] += ( 1 - ( i & 2 ) ) * 1e-6f;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************/
|
if( !psEnc->sCmn.prefillFlag ) {
|
||||||
/* Find pitch lags, initial LPC analysis */
|
/*****************************************/
|
||||||
/*****************************************/
|
/* Find pitch lags, initial LPC analysis */
|
||||||
silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );
|
/*****************************************/
|
||||||
|
silk_find_pitch_lags_FLP( psEnc, &sEncCtrl, res_pitch, x_frame );
|
||||||
|
|
||||||
/************************/
|
/************************/
|
||||||
/* Noise shape analysis */
|
/* Noise shape analysis */
|
||||||
/************************/
|
/************************/
|
||||||
silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
|
silk_noise_shape_analysis_FLP( psEnc, &sEncCtrl, res_pitch_frame, x_frame );
|
||||||
|
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
/* Find linear prediction coefficients (LPC + LTP) */
|
/* Find linear prediction coefficients (LPC + LTP) */
|
||||||
/***************************************************/
|
/***************************************************/
|
||||||
silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
|
silk_find_pred_coefs_FLP( psEnc, &sEncCtrl, res_pitch, x_frame, condCoding );
|
||||||
|
|
||||||
/****************************************/
|
/****************************************/
|
||||||
/* Process gains */
|
/* Process gains */
|
||||||
/****************************************/
|
/****************************************/
|
||||||
silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding );
|
silk_process_gains_FLP( psEnc, &sEncCtrl, condCoding );
|
||||||
|
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
/* Prefiltering for noise shaper */
|
/* Prefiltering for noise shaper */
|
||||||
/*****************************************/
|
/*****************************************/
|
||||||
silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );
|
silk_prefilter_FLP( psEnc, &sEncCtrl, xfw, x_frame );
|
||||||
|
|
||||||
/****************************************/
|
/****************************************/
|
||||||
/* Low Bitrate Redundant Encoding */
|
/* Low Bitrate Redundant Encoding */
|
||||||
/****************************************/
|
/****************************************/
|
||||||
silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw, condCoding );
|
silk_LBRR_encode_FLP( psEnc, &sEncCtrl, xfw, condCoding );
|
||||||
|
|
||||||
if( psEnc->sCmn.prefillFlag ) {
|
|
||||||
silk_NSQ_wrapper_FLP( psEnc, &sEncCtrl, &psEnc->sCmn.indices, &psEnc->sCmn.sNSQ, psEnc->sCmn.pulses, xfw );
|
|
||||||
} else {
|
|
||||||
/* Loop over quantizer and entroy coding to control bitrate */
|
/* Loop over quantizer and entroy coding to control bitrate */
|
||||||
maxIter = 5;
|
maxIter = 5;
|
||||||
gainMult_Q8 = SILK_FIX_CONST( 1, 8 );
|
gainMult_Q8 = SILK_FIX_CONST( 1, 8 );
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue