Skip to content

Commit

Permalink
update: silk sdk to kn007/silk-v3-decoder@07bfa0f
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Sep 10, 2023
1 parent 75da484 commit f4f1f93
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion native/src/interface/SKP_Silk_SDK_API.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void SKP_Silk_SDK_get_TOC(
/* Get the version number */
/**************************/
/* Return a pointer to string specifying the version */
const char *SKP_Silk_SDK_get_version();
const char *SKP_Silk_SDK_get_version(void);

#ifdef __cplusplus
}
Expand Down
2 changes: 2 additions & 0 deletions native/src/silk/SKP_Silk_AsmPreproc.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#elif defined (__ARM_ARCH_7A__)
#define EMBEDDED_ARM 6
#define EMBEDDED_ARMv6
#else
#define EMBEDDED_ARM 0
#endif
#endif

Expand Down
2 changes: 1 addition & 1 deletion native/src/silk/SKP_Silk_Inlines.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ SKP_INLINE SKP_int32 SKP_Silk_SIN_APPROX_Q24( /* O returns approximate
}
if( x < 1100 ) {
/* Special case: high accuracy */
return SKP_SMLAWB( -1 << 24, SKP_MUL( x, x ), 5053 );
return SKP_SMLAWB( -(1 << 24), SKP_MUL( x, x ), 5053 );
}
x = SKP_SMULWB( SKP_LSHIFT( x, 8 ), x ); /* contains x^2 in Q20 */
y_Q30 = SKP_SMLAWB( -SKP_SIN_APPROX_CONST2, x, -SKP_SIN_APPROX_CONST3 );
Expand Down
2 changes: 1 addition & 1 deletion native/src/silk/SKP_Silk_NSQ.c
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer(
/* Flip sign depending on dither */
r_Q10 = ( r_Q10 ^ dither ) - dither;
r_Q10 = SKP_SUB32( r_Q10, offset_Q10 );
r_Q10 = SKP_LIMIT_32( r_Q10, -64 << 10, 64 << 10 );
r_Q10 = SKP_LIMIT_32( r_Q10, -(64 << 10), 64 << 10 );

/* Quantize */
q_Q0 = 0;
Expand Down
2 changes: 1 addition & 1 deletion native/src/silk/SKP_Silk_NSQ_del_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ SKP_INLINE void SKP_Silk_noise_shape_quantizer_del_dec(
/* Flip sign depending on dither */
r_Q10 = ( r_Q10 ^ dither ) - dither;
r_Q10 = SKP_SUB32( r_Q10, offset_Q10 );
r_Q10 = SKP_LIMIT_32( r_Q10, -64 << 10, 64 << 10 );
r_Q10 = SKP_LIMIT_32( r_Q10, -(64 << 10), 64 << 10 );

/* Find two quantization level candidates and measure their rate-distortion */
if( r_Q10 < -1536 ) {
Expand Down
1 change: 1 addition & 0 deletions native/src/silk/SKP_Silk_SigProc_FIX.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ extern "C"
# include "SKP_Silk_macros.h"
# endif
#else
# define EMBEDDED_ARM 0
# include "SKP_Silk_macros.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion native/src/silk/SKP_Silk_ana_filt_bank_1.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* Coefficients for 2-band filter bank based on first-order allpass filters */
// old
static SKP_int16 A_fb1_20[ 1 ] = { 5394 << 1 };
static SKP_int16 A_fb1_21[ 1 ] = { 20623 << 1 }; /* wrap-around to negative number is intentional */
static SKP_int16 A_fb1_21[ 1 ] = { (SKP_int16) (20623 << 1) }; /* wrap-around to negative number is intentional */

/* Split signal into two decimated bands using first-order allpass filters */
void SKP_Silk_ana_filt_bank_1(
Expand Down
1 change: 0 additions & 1 deletion native/src/silk/SKP_Silk_enc_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ SKP_int SKP_Silk_SDK_Encode(
if( ( ( encControl->API_sampleRate != 8000 ) &&
( encControl->API_sampleRate != 12000 ) &&
( encControl->API_sampleRate != 16000 ) &&
( encControl->API_sampleRate != 22050 ) &&
( encControl->API_sampleRate != 24000 ) &&
( encControl->API_sampleRate != 32000 ) &&
( encControl->API_sampleRate != 44100 ) &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ public void connect(Process process, InputStream stdin, OutputStream output) thr
if (hz == 0) {
throw new IOException("Cannot find Hz");
}
if (hz == 22050) {
if (!Boolean.getBoolean("silk-codec.rate-check-ignore")) {
throw new IllegalArgumentException("22050 Hz is not supported. If you need to ignore this check, please set `silk-codec.rate-check-ignore=true`");
}
}
threadPool.execute(() -> {
try {
// drop error input
Expand Down

0 comments on commit f4f1f93

Please sign in to comment.