Loading lib_lc3plus/dec_lc3_fl.c +1 −1 Original line number Diff line number Diff line Loading @@ -364,6 +364,6 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num } } if (decoder->last_error == LC3PLUS_OK && bfi) decoder->last_error = LC3PLUS_DECODE_ERROR; if ((decoder->last_error == LC3PLUS_OK) && bfi) decoder->last_error = LC3PLUS_DECODE_ERROR; return bfi == 1 ? LC3PLUS_DECODE_ERROR : LC3PLUS_OK; } lib_lc3plus/fft/cfft.c +5 −1 Original line number Diff line number Diff line Loading @@ -387,8 +387,10 @@ void LC3_cfft(LC3_FLOAT* re, LC3_FLOAT* im, LC3_INT length, LC3_INT stride, LC3_ LC3_INT LC3_cfft_plan(Cfft* handle, LC3_INT length, LC3_INT sign) { /* check if length is power of two */ if (!CFFT_PLAN_SUPPORT(length) || abs(sign) != 1) if (!CFFT_PLAN_SUPPORT(length) || (abs(sign) != 1)) { return 0; } handle->len = length; handle->sign = sign; Loading Loading @@ -419,5 +421,7 @@ void LC3_cfft_apply(Cfft* handle, LC3_FLOAT* re, LC3_FLOAT* im, LC3_INT stride) void LC3_cfft_free(Cfft* handle) { if (handle->table) { free(handle->table); } } lib_lc3plus/fft/iis_fft.c +9 −2 Original line number Diff line number Diff line Loading @@ -38,14 +38,19 @@ static IIS_FFT_ERROR create(HANDLE_IIS_FFT* handle, LC3_INT type, LC3_INT len, I LC3_INT trlen = (type == FFT_COMPLEX) ? len : len / 2; /* check argument sanity */ if (sign != IIS_FFT_FWD && sign != IIS_FFT_BWD) if ((sign != IIS_FFT_FWD) && (sign != IIS_FFT_BWD)) return IIS_FFT_INTERNAL_ERROR; if (!(*handle)) { (*handle) = (HANDLE_IIS_FFT)calloc(1, sizeof(IIS_FFT)); } if (!(*handle)) { return IIS_FFT_MEMORY_ERROR; } (*handle)->len = len; (*handle)->sign = sign; Loading Loading @@ -122,7 +127,9 @@ IIS_FFT_ERROR LC3_IIS_FFT_Apply_CFFT(HANDLE_IIS_FFT handle, const Complex* input { LC3_FLOAT* dummy; if (!handle) { return IIS_FFT_INTERNAL_ERROR; } /* check for inplace operation */ memmove(output, input, sizeof(*input) * handle->len); Loading lib_lc3plus/fft/iisfft.c +8 −0 Original line number Diff line number Diff line Loading @@ -61,7 +61,9 @@ IIS_FFT_ERROR LC3_iisfft_plan(Iisfft* handle, LC3_INT length, LC3_INT sign) { memset(handle, 0, sizeof(Iisfft)); if (length < 2) { return IIS_FFT_LENGTH_ERROR; } handle->length = length; handle->sign = sign; if (need_scratch(length)) { Loading @@ -69,7 +71,9 @@ IIS_FFT_ERROR LC3_iisfft_plan(Iisfft* handle, LC3_INT length, LC3_INT sign) LC3_INT i = 0; LC3_INT lengthOfPrimeScratch = BORDER_FOR_SECOND_SCRATCH; if (!factorize(length, &handle->num_factors, handle->factors, handle->isPrime)) { return IIS_FFT_LENGTH_ERROR; } /* create additional scratch for primeFFT() */ for (i = 0; i < handle->num_factors; i++) { if (handle->isPrime[i] == 1 && handle->factors[i] > lengthOfPrimeScratch) { Loading @@ -79,9 +83,11 @@ IIS_FFT_ERROR LC3_iisfft_plan(Iisfft* handle, LC3_INT length, LC3_INT sign) if (lengthOfPrimeScratch > BORDER_FOR_SECOND_SCRATCH) { handle->scratch2 = (LC3_INT*)malloc(sizeof(LC3_INT) * lengthOfPrimeScratch); if (!handle->scratch2) { return IIS_FFT_MEMORY_ERROR; } } } return IIS_FFT_NO_ERROR; } Loading @@ -90,8 +96,10 @@ void LC3_iisfft_free(Iisfft* handle) { handle->length = 0; if (handle->scratch2) { free(handle->scratch2); } } Loading Loading
lib_lc3plus/dec_lc3_fl.c +1 −1 Original line number Diff line number Diff line Loading @@ -364,6 +364,6 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num } } if (decoder->last_error == LC3PLUS_OK && bfi) decoder->last_error = LC3PLUS_DECODE_ERROR; if ((decoder->last_error == LC3PLUS_OK) && bfi) decoder->last_error = LC3PLUS_DECODE_ERROR; return bfi == 1 ? LC3PLUS_DECODE_ERROR : LC3PLUS_OK; }
lib_lc3plus/fft/cfft.c +5 −1 Original line number Diff line number Diff line Loading @@ -387,8 +387,10 @@ void LC3_cfft(LC3_FLOAT* re, LC3_FLOAT* im, LC3_INT length, LC3_INT stride, LC3_ LC3_INT LC3_cfft_plan(Cfft* handle, LC3_INT length, LC3_INT sign) { /* check if length is power of two */ if (!CFFT_PLAN_SUPPORT(length) || abs(sign) != 1) if (!CFFT_PLAN_SUPPORT(length) || (abs(sign) != 1)) { return 0; } handle->len = length; handle->sign = sign; Loading Loading @@ -419,5 +421,7 @@ void LC3_cfft_apply(Cfft* handle, LC3_FLOAT* re, LC3_FLOAT* im, LC3_INT stride) void LC3_cfft_free(Cfft* handle) { if (handle->table) { free(handle->table); } }
lib_lc3plus/fft/iis_fft.c +9 −2 Original line number Diff line number Diff line Loading @@ -38,14 +38,19 @@ static IIS_FFT_ERROR create(HANDLE_IIS_FFT* handle, LC3_INT type, LC3_INT len, I LC3_INT trlen = (type == FFT_COMPLEX) ? len : len / 2; /* check argument sanity */ if (sign != IIS_FFT_FWD && sign != IIS_FFT_BWD) if ((sign != IIS_FFT_FWD) && (sign != IIS_FFT_BWD)) return IIS_FFT_INTERNAL_ERROR; if (!(*handle)) { (*handle) = (HANDLE_IIS_FFT)calloc(1, sizeof(IIS_FFT)); } if (!(*handle)) { return IIS_FFT_MEMORY_ERROR; } (*handle)->len = len; (*handle)->sign = sign; Loading Loading @@ -122,7 +127,9 @@ IIS_FFT_ERROR LC3_IIS_FFT_Apply_CFFT(HANDLE_IIS_FFT handle, const Complex* input { LC3_FLOAT* dummy; if (!handle) { return IIS_FFT_INTERNAL_ERROR; } /* check for inplace operation */ memmove(output, input, sizeof(*input) * handle->len); Loading
lib_lc3plus/fft/iisfft.c +8 −0 Original line number Diff line number Diff line Loading @@ -61,7 +61,9 @@ IIS_FFT_ERROR LC3_iisfft_plan(Iisfft* handle, LC3_INT length, LC3_INT sign) { memset(handle, 0, sizeof(Iisfft)); if (length < 2) { return IIS_FFT_LENGTH_ERROR; } handle->length = length; handle->sign = sign; if (need_scratch(length)) { Loading @@ -69,7 +71,9 @@ IIS_FFT_ERROR LC3_iisfft_plan(Iisfft* handle, LC3_INT length, LC3_INT sign) LC3_INT i = 0; LC3_INT lengthOfPrimeScratch = BORDER_FOR_SECOND_SCRATCH; if (!factorize(length, &handle->num_factors, handle->factors, handle->isPrime)) { return IIS_FFT_LENGTH_ERROR; } /* create additional scratch for primeFFT() */ for (i = 0; i < handle->num_factors; i++) { if (handle->isPrime[i] == 1 && handle->factors[i] > lengthOfPrimeScratch) { Loading @@ -79,9 +83,11 @@ IIS_FFT_ERROR LC3_iisfft_plan(Iisfft* handle, LC3_INT length, LC3_INT sign) if (lengthOfPrimeScratch > BORDER_FOR_SECOND_SCRATCH) { handle->scratch2 = (LC3_INT*)malloc(sizeof(LC3_INT) * lengthOfPrimeScratch); if (!handle->scratch2) { return IIS_FFT_MEMORY_ERROR; } } } return IIS_FFT_NO_ERROR; } Loading @@ -90,8 +96,10 @@ void LC3_iisfft_free(Iisfft* handle) { handle->length = 0; if (handle->scratch2) { free(handle->scratch2); } } Loading