Skip to content
GitLab
Explore
Sign in
Show whitespace changes
Inline
Side-by-side
lib_lc3plus/dec_lc3_fl.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,12 +7,10 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"functions.h"
static
int
Dec_LC3PLUS_Channel_fl
(
LC3PLUS_Dec
*
decoder
,
int
channel
,
uint8_t
*
bs_in
,
void
*
s_out
,
int
bps
,
int
bfi_ext
)
{
DecSetup
*
h_DecSetup
;
...
...
@@ -65,11 +63,9 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs
case
50
:
max_bw_stopband
=
max_bw_stopband
>>
1
;
break
;
#ifdef CR8_G_ADD_75MS
case
75
:
max_bw_stopband
=
3
*
(
max_bw_stopband
>>
2
);
break
;
#endif
case
100
:
break
;
}
...
...
@@ -149,9 +145,7 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs
h_DecSetup
->
PlcSetup
.
q_d_prev
,
h_DecSetup
->
sqQdec_fl
,
h_DecSetup
->
spec_inv_idx
,
decoder
->
yLen
,
bfi
,
decoder
->
frame_dms
,
h_DecSetup
->
concealMethod
,
h_DecSetup
->
ltpf_mem_pitch
,
h_DecSetup
->
ltpf_param
[
0
],
&
h_DecSetup
->
PlcAdvSetup
->
cum_fflcAtten
#ifdef CR8_A_PLC_FADEOUT_TUNING
,
h_DecSetup
->
PlcAdvSetup
->
plc_fadeout_type
#endif
);
/* IMDCT */
...
...
@@ -172,9 +166,7 @@ static int Dec_LC3PLUS_Channel_fl(LC3PLUS_Dec* decoder, int channel, uint8_t* bs
bfi
,
h_DecSetup
->
ltpf_param
,
h_DecSetup
->
ltpf_param_mem
,
h_DecSetup
->
ltpf_conf_beta_idx
,
h_DecSetup
->
ltpf_conf_beta
,
h_DecSetup
->
concealMethod
,
h_DecSetup
->
alpha
,
&
h_DecSetup
->
ltpf_mem_active
#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH
,
&
h_DecSetup
->
rel_pitch_change
,
decoder
->
hrmode
,
decoder
->
frame_dms
#endif
);
{
...
...
@@ -244,9 +236,12 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num
}
bfi
=
Dec_LC3PLUS_Channel_fl
(
decoder
,
ch
,
input
,
output
[
ch
],
bps
,
bfi
);
if
(
input
!=
NULL
)
{
input
+=
decoder
->
channel_setup
[
ch
]
->
targetBytes
;
}
}
}
else
{
decoder
->
epmr
=
LC3PLUS_EPMR_HIGH_NC
;
...
...
@@ -275,7 +270,11 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num
channel_bfi
=
1
;
}
if
(
input
!=
NULL
)
{
input
=
input
+
np_zero
;
}
decoder
->
n_pc
=
MAX
(
decoder
->
n_pc
-
(
2
*
np_zero
),
0
);
if
(
channel_bfi
==
2
)
...
...
@@ -313,8 +312,11 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num
channel_bfi
=
Dec_LC3PLUS_Channel_fl
(
decoder
,
ch
,
input
,
output
[
ch
],
bps
,
channel_bfi
);
out_bfi
|=
channel_bfi
;
if
(
input
!=
NULL
)
{
input
+=
fec_num_bytes
;
}
}
bfi
=
out_bfi
&
1
;
}
...
...
@@ -360,14 +362,16 @@ LC3PLUS_Error Dec_LC3PLUS_fl(LC3PLUS_Dec* decoder, uint8_t* input, LC3_INT32 num
}
bfi
=
Dec_LC3PLUS_Channel_fl
(
decoder
,
ch
,
input
,
output
[
ch
],
bps
,
bfi
);
if
(
input
!=
NULL
)
{
input
+=
decoder
->
channel_setup
[
ch
]
->
targetBytes
;
}
}
}
if
((
decoder
->
last_error
==
LC3PLUS_OK
)
&&
bfi
)
{
decoder
->
last_error
=
LC3PLUS_DECODE_ERROR
;
}
return
bfi
==
1
?
LC3PLUS_DECODE_ERROR
:
LC3PLUS_OK
;
}
lib_lc3plus/defines.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#ifndef DEFINES_H
#define DEFINES_H
...
...
@@ -26,10 +25,6 @@ typedef int8_t LC3_INT8;
typedef
uint32_t
LC3_UINT32
;
/* Release defines */
#define ENABLE_2_5MS_MODE
#define ENABLE_5MS_MODE
#define ENABLE_075_DMS_MODE
#define ENABLE_10_MS_MODE
#define ENABLE_ADVANCED_PLC_FL
#define ENABLE_ADVANCED_PLC_FL_DEFAULT
#define ENABLE_BW_CONTROLLER
...
...
@@ -44,41 +39,12 @@ typedef uint32_t LC3_UINT32;
#define ENABLE_FRAME_MS_FLAG
#define ENABLE_HR_MODE_FL_FLAG
#define CR8_G_ADD_75MS
#ifndef NO_POST_REL_CHANGES
/* Post-release non-bitexact changes */
#define CR8_A_PLC_FADEOUT_TUNING
/* Adapt PLC fadeout to avoid gaps in signal */
#define CR9_D_FLOATING_POINT_CODE_SIMPLIFICATIONS
#define CR9_F_PITCH_WIN_LEN_FIX
/* Increase window length for pitch calculation */
#define CR9_G_IMPROVE_TDC
/* summarize G,H,J,L,N */
#ifdef CR9_G_IMPROVE_TDC
#define CR9_G_PLC_NS_TDC_FIX
/* Always use TDC if pitch > 0 */
#define CR9_H_REMOVE_SWITCH_TO_PLC_NS
#define CR9_J_SLOW_TDC_FADEOUT
#define CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER
#ifdef ENABLE_HR_MODE_FL
#ifdef PLC_TUNING_SHORT_FADEOUT
#define CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH
#endif
#endif
#endif
/* CR9_G_IMPROVE_TDC */
#define CR9_I_INC_TDC_FADEOUT_LEN
#define CR9_K_REDUCE_NORM_CORR_TH
#endif
/* NO_POST_REL_CHANGES */
#ifdef CR9_D_FLOATING_POINT_CODE_SIMPLIFICATIONS
#define CR9_SIMPLIFY_LOOP
#define CR9_LTPF_REWRITE
#define CR9_QUANT_SPEC_REWRITE
#define CR9_SIMPLIFY_ARI_DECODER
#endif
#ifdef CR8_A_PLC_FADEOUT_TUNING
#define MAX_UINT8 255
#ifdef CR9_L_RETRAIN_FADEOUT_TYPE_CLASSIFIER
#ifdef CR9_K_REDUCE_NORM_CORR_TH
#define THRESH_100_DMS_TDC_CNT 9
#define THRESH_100_DMS_NS_CNT 7
#define THRESH_100_DMS_TDC_NS_CNT 73
...
...
@@ -91,33 +57,11 @@ typedef uint32_t LC3_UINT32;
#define THRESH_025_DMS_TDC_CNT 20
#define THRESH_025_DMS_NS_CNT 21
#define THRESH_025_DMS_TDC_NS_CNT 278
#else
#define THRESH_100_DMS_TDC_CNT 3
#define THRESH_100_DMS_NS_CNT 35
#define THRESH_100_DMS_TDC_NS_CNT 114
#define THRESH_075_DMS_TDC_CNT 6
#define THRESH_075_DMS_NS_CNT 37
#define THRESH_075_DMS_TDC_NS_CNT 130
#define THRESH_050_DMS_TDC_CNT 12
#define THRESH_050_DMS_NS_CNT 55
#define THRESH_050_DMS_TDC_NS_CNT 227
#define THRESH_025_DMS_TDC_CNT 10
#define THRESH_025_DMS_NS_CNT 138
#define THRESH_025_DMS_TDC_NS_CNT 431
#endif
#else
#define FAC1_FADEOUT 0.2
#define FAC2_FADEOUT 1.5
#define FAC3_FADEOUT 1.75
#endif
#define REL_PITCH_THRESH 0.36
#define PLC_LONGTERM_ANALYSIS_MS 200
/* Analysis window 2000 ms / 10 ms */
#define PLC_LONGTERM_ANALYSIS_STARTUP_FILL 0.5f
/* required buffer fill amount, set to 0.0 to not require any fill at all */
#endif
/* Precision Defines */
#define LC3_FABS(x) (fabsf(x))
#define LC3_POW(x, y) (powf(x, y))
...
...
@@ -137,7 +81,6 @@ typedef uint32_t LC3_UINT32;
#define MAX_BR_100DMS_WB 221600
/* for 100ms at 16kHz */
#define MAX_BR_100DMS_SSWB 314400
/* for 100ms at 24kHz */
#ifdef CR8_G_ADD_75MS
#define MIN_BR_075DMS_48KHZ_HR ((int)124800/ 800/2)* 800
#define MIN_BR_075DMS_96KHZ_HR ((int)149600/ 800/2)* 800
#define MIN_BR_075DMS 21334
/* ceil( 20 * 800 * 100/ 75) */
...
...
@@ -145,9 +88,6 @@ typedef uint32_t LC3_UINT32;
#define MAX_BR_075DMS_NB 152534
/* ceil(143 * 800 * 100/ 75) */
#define MAX_BR_075DMS_WB 295467
/* ceil(277 * 800 * 100/ 75) */
#define MAX_BR_075DMS_SSWB 419200
/* ceil(393 * 800 * 100/ 75) */
#endif
#define CR8_E_TONE_DETECTOR
/* Tone detector for hrmode to deactivate TNS - improves SNR and THD+N */
typedef
int32_t
LC3_INT32
;
#if defined(__xtensa__)
...
...
@@ -158,11 +98,6 @@ typedef int32_t LC3_INT32;
#define ALIGNMENT_BALLOC_RED 7
#endif
#ifndef CR8_A_PLC_FADEOUT_TUNING
#define PLC2_FADEOUT_IN_MS 30
#endif
#ifdef CR8_A_PLC_FADEOUT_TUNING
/* PLC2/PhEcu fading settings */
/* PLC2/PHEcu muting Table setup settings */
#define PLC2_FADEOUT_IN_MS_MIN 30
/* Table min */
...
...
@@ -173,8 +108,6 @@ typedef int32_t LC3_INT32;
#define PLC2_FADEOUT_IN_MS 30
/* 30 P800 fadeout optimized */
#define PLC2_FADEOUT_LONG_IN_MS 120
/* 120 MUSHRA, && stable tonal fadeout optimized */
#endif
#define PHECU_FRES 62.5
#define PHECU_C_JACOB 1.1429
#define MAX_LGW 9
/* LGW48K + 1 !! */
...
...
@@ -206,16 +139,12 @@ typedef int32_t LC3_INT32;
#define TDC_L_FIR_HP 11
#define PLC3_HPBLENDTHROTTLE 30
/* higher numbers increase throttled blending from hp filtered to unfiltered uv excitation (0 is no throttle) */
#ifdef CR9_I_INC_TDC_FADEOUT_LEN
#define PLC_FADEOUT_TYPE_1_IN_MS 200
#endif
#define PLC_FADEOUT_IN_MS 60
/* fade-out to zero in ms for TD-PLC and NS, minimum value is 20 */
#define PLC4_TRANSIT_START_IN_MS 20
/* begin of transition time for noise substitution for voiced signals */
#define PLC4_TRANSIT_END_IN_MS PLC_FADEOUT_IN_MS
/* end of transition time for noise substitution */
#define PLC34_ATTEN_FAC_100 0.5000
/* attenuation factor for NS and TDC @ 10 ms*/
#ifdef CR8_G_ADD_75MS
#define PLC34_ATTEN_FAC_075 0.5946
/* attenuation factor for NS and TDC @ 7.5 ms */
#endif
#define PLC34_ATTEN_FAC_050 0.7071
/* attenuation factor for NS and TDC @ 5.0 ms*/
#define PLC34_ATTEN_FAC_025 0.8409
/* attenuation factor for NS and TDC @ 2.5 ms*/
...
...
@@ -246,21 +175,13 @@ typedef int32_t LC3_INT32;
#define LC3_EPS (1.1e-7f)
#define M_PI 3.14159265358979323846
#define M_PI
_LC3PLUS
3.14159265358979323846
/* FUNCTION MACROS */
#define CEILING(x, y) (((x) + (y)-1) / (y))
#ifdef CR8_A_PLC_FADEOUT_TUNING
#define FRAME2FS_IDX_10MS(x) (x<500 ? (x/100) : 5)
/* 80 -> 0, 160 -> 1, 240 -> 2, 320 -> 3, 480 -> 4 , 960 -> 5*/
#define FS2FS_IDX(x) ((x) == 96000 ? 5 : (x) / 10000)
/* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4, 96000 -> 5 */
#else
#define FRAME2FS_IDX(x) (x / 100)
/* 80 -> 0, 160 -> 1, 240 -> 2, 320 -> 3, 480 -> 4*/
#define FS2FS_IDX(x) \
(x / 10000)
/* 8000 -> 0, 16000 -> 1, 24000 -> 2, 32000 -> 3, 48000 -> 4 \
*/
#endif
#define UNUSED(x) (void)(x)
/* silence unused parameter warning */
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
...
...
lib_lc3plus/detect_cutoff_warped.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"functions.h"
...
...
@@ -34,13 +33,11 @@ void processDetectCutoffWarped_fl(LC3_FLOAT* d2, LC3_INT fs_idx, LC3_INT frame_d
warp_idx_stop
=
BW_warp_idx_stop_all_5ms
[
fs_idx
-
1
];
bw_dist
=
brickwall_dist
;
break
;
#ifdef CR8_G_ADD_75MS
case
75
:
warp_idx_start
=
BW_warp_idx_start_all_7_5ms
[
fs_idx
-
1
];
warp_idx_stop
=
BW_warp_idx_stop_all_7_5ms
[
fs_idx
-
1
];
bw_dist
=
brickwall_dist_7_5ms
;
break
;
#endif
case
100
:
warp_idx_start
=
BW_warp_idx_start_all
[
fs_idx
-
1
];
warp_idx_stop
=
BW_warp_idx_stop_all
[
fs_idx
-
1
];
...
...
lib_lc3plus/enc_entropy.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"functions.h"
...
...
lib_lc3plus/enc_lc3_fl.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"functions.h"
...
...
@@ -64,9 +63,7 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s
/* Pitch estimation */
processOlpa_fl
(
h_EncSetup
->
s_12k8
,
h_EncSetup
->
olpa_mem_s12k8
,
h_EncSetup
->
olpa_mem_s6k4
,
&
h_EncSetup
->
olpa_mem_pitch
,
#ifdef CR9_F_PITCH_WIN_LEN_FIX
&
h_EncSetup
->
pitch_flag
,
#endif
&
T0_out
,
&
normcorr
,
s_12k8_len
,
encoder
->
frame_dms
);
/* LTPF encoder */
...
...
@@ -75,9 +72,7 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s
&
h_EncSetup
->
ltpf_mem_normcorr
,
&
h_EncSetup
->
ltpf_mem_ltpf_on
,
&
h_EncSetup
->
ltpf_mem_pitch
,
h_EncSetup
->
ltpf_param
,
&
h_EncSetup
->
ltpf_mem_mem_normcorr
,
&
ltpfBits
#ifdef CR9_K_REDUCE_NORM_CORR_TH
,
encoder
->
hrmode
#endif
);
/* Attack detector */
...
...
@@ -89,11 +84,7 @@ static void Enc_LC3PLUS_Channel_fl(LC3PLUS_Enc* encoder, int channel, int32_t* s
processPerBandEnergy_fl
(
encoder
->
bands_number
,
encoder
->
bands_offset
,
encoder
->
hrmode
,
encoder
->
frame_dms
,
h_EncSetup
->
ener
,
d_fl
);
/* Near Nyquist detector */
processNearNyquistdetector_fl
(
&
encoder
->
near_nyquist_flag
,
encoder
->
fs_idx
,
encoder
->
near_nyquist_index
,
encoder
->
bands_number
,
h_EncSetup
->
ener
#ifdef CR8_E_TONE_DETECTOR
,
encoder
->
frame_dms
,
encoder
->
hrmode
);
#else
);
#endif
/* Disable LTPF if nyquist detector triggers or -lfe mode is active*/
if
(
encoder
->
near_nyquist_flag
!=
0
||
h_EncSetup
->
lfe
==
1
)
{
...
...
lib_lc3plus/estimate_global_gain.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"functions.h"
...
...
lib_lc3plus/fft/cfft.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,8 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"cfft.h"
...
...
lib_lc3plus/fft/cfft.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,8 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
"../functions.h"
...
...
lib_lc3plus/fft/fft_15_16.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/fft_240_480.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/fft_2_9.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/fft_32.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/fft_384_768.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/fft_60_128.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/fft_generic.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
/* guard against unindended includes */
#ifndef INCLUDED_FROM_IISFFT_C
#error "this file must not be included"
...
...
lib_lc3plus/fft/iis_fft.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
<assert.h>
...
...
@@ -43,11 +42,11 @@ static IIS_FFT_ERROR create(HANDLE_IIS_FFT* handle, LC3_INT type, LC3_INT len, I
return
IIS_FFT_INTERNAL_ERROR
;
}
if
(
!
(
*
handle
))
{
(
*
handle
)
=
(
HANDLE_IIS_FFT
)
calloc
(
1
,
sizeof
(
IIS_FFT
));
}
if
(
!
(
*
handle
))
{
return
IIS_FFT_MEMORY_ERROR
;
...
...
lib_lc3plus/fft/iis_fft.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#ifndef IIS_FFT_H
#define IIS_FFT_H
...
...
lib_lc3plus/fft/iisfft.c
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,8 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#include
"options.h"
#include
"wmc_auto.h"
#include
<assert.h>
...
...
lib_lc3plus/fft/iisfft.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#ifndef IISFFT_H
#define IISFFT_H
...
...
lib_lc3plus/functions.h
View file @
96c5acd5
/******************************************************************************
* ETSI TS 103 634 V1.
4.3
*
* ETSI TS 103 634 V1.
5.1
*
* Low Complexity Communication Codec Plus (LC3plus) *
* *
* Copyright licence is solely granted through ETSI Intellectual Property *
...
...
@@ -7,7 +7,6 @@
* estoppel or otherwise. *
******************************************************************************/
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
...
...
@@ -109,9 +108,7 @@ void processNoiseFactor_fl(LC3_INT* fac_ns_idx, LC3_FLOAT x[], LC3_INT xq[], LC3
void
processNoiseFilling_fl
(
LC3_FLOAT
xq
[],
LC3_INT
nfseed
,
LC3_INT
fac_ns_idx
,
LC3_INT
bw_stopband
,
LC3_INT
frame_dms
,
LC3_FLOAT
fac_ns_pc
,
LC3_INT
spec_inv_idx
);
void
processOlpa_fl
(
LC3_FLOAT
*
s_12k8
,
LC3_FLOAT
*
mem_s12k8
,
LC3_FLOAT
*
mem_s6k4
,
LC3_INT
*
mem_old_T0
,
#ifdef CR9_F_PITCH_WIN_LEN_FIX
LC3_INT
*
pitch_flag
,
#endif
LC3_INT
*
T0_out
,
LC3_FLOAT
*
normcorr_out
,
LC3_INT
len
,
LC3_INT
frame_dms
);
void
processTnsCoder_fl
(
LC3_FLOAT
*
x
,
LC3_INT
bw_cutoff_idx
,
LC3_INT
bw_fcbin
,
LC3_INT
fs
,
LC3_INT
N
,
LC3_INT
frame_dms
,
LC3_INT
nBits
,
...
...
@@ -129,11 +126,7 @@ void processSnsInterpolateScf_fl(LC3_FLOAT* gains, LC3_INT encoder_side, LC3_INT
void
processDetectCutoffWarped_fl
(
LC3_FLOAT
*
d2
,
LC3_INT
fs_idx
,
LC3_INT
frame_dms
,
LC3_INT
*
bw_idx
);
void
processNearNyquistdetector_fl
(
LC3_INT16
*
near_nyquist_flag
,
const
LC3_INT
fs_idx
,
const
LC3_INT
near_nyquist_index
,
const
LC3_INT
bands_number
,
const
LC3_FLOAT
*
ener
#ifdef CR8_E_TONE_DETECTOR
,
const
LC3_INT16
frame_dms
,
const
LC3_INT16
hrmode
);
#else
);
#endif
void
processPerBandEnergy_fl
(
LC3_INT
bands_number
,
const
LC3_INT
*
acc_coeff_per_band
,
LC3_INT16
hrmode
,
LC3_INT16
frame_dms
,
LC3_FLOAT
*
d2
,
LC3_FLOAT
*
d
);
void
ProcessingIMDCT_fl
(
LC3_FLOAT
*
y
,
LC3_INT
yLen
,
const
LC3_FLOAT
*
win
,
LC3_INT
winLen
,
LC3_INT
last_zeros
,
LC3_FLOAT
*
mem
,
LC3_FLOAT
*
x
,
...
...
@@ -144,18 +137,14 @@ void ProcessingITDA_WIN_OLA_fl(LC3_FLOAT* x_tda, LC3_INT32 yLen, const LC3_FLOAT
void
process_ltpf_coder_fl
(
LC3_FLOAT
*
xin
,
LC3_INT
xLen
,
LC3_INT
ltpf_enable
,
LC3_INT
pitch_ol
,
LC3_FLOAT
pitch_ol_norm_corr
,
LC3_INT
frame_dms
,
LC3_FLOAT
*
mem_old_x
,
LC3_INT
memLen
,
LC3_FLOAT
*
mem_norm_corr_past
,
LC3_INT
*
mem_on
,
LC3_FLOAT
*
mem_pitch
,
LC3_INT
*
param
,
LC3_FLOAT
*
mem_norm_corr_past_past
,
LC3_INT
*
bits
#ifdef CR9_K_REDUCE_NORM_CORR_TH
,
LC3_INT16
hrmode
#endif
);
void
process_ltpf_decoder_fl
(
LC3_FLOAT
*
x
,
LC3_INT
xLen
,
LC3_FLOAT
*
y
,
LC3_INT
fs
,
LC3_FLOAT
*
mem_old_x
,
LC3_FLOAT
*
mem_old_y
,
LC3_INT
*
mem_pitch_LC3_INT
,
LC3_INT
*
mem_pitch_fr
,
LC3_FLOAT
*
mem_gain
,
LC3_INT
*
mem_beta_idx
,
LC3_INT
bfi
,
LC3_INT
*
param
,
LC3_INT
*
mem_param
,
LC3_INT
conf_beta_idx
,
LC3_FLOAT
conf_beta
,
LC3_INT
concealMethod
,
LC3_FLOAT
damping
,
LC3_INT
*
mem_ltpf_active
#ifdef CR9_N_SHORT_FADE_FOR_UNSTABLE_PITCH
,
LC3_FLOAT
*
rel_pitch_change
,
LC3_INT
hrmode
,
LC3_INT
frame_dms
#endif
);
void
process_resamp12k8_fl
(
LC3_FLOAT
x
[],
LC3_INT
x_len
,
LC3_FLOAT
mem_in
[],
LC3_INT
mem_in_len
,
LC3_FLOAT
mem_50
[],
LC3_FLOAT
mem_out
[],
...
...
@@ -242,17 +231,13 @@ void processPlcDampingScramblingMain_fl(LC3_INT32 *ns_seed,
LC3_FLOAT
*
spec_prev
,
LC3_FLOAT
*
spec
,
LC3_INT32
spec_inv_idx
,
LC3_INT32
yLen
,
LC3_INT32
bfi
,
LC3_INT32
frame_dms
,
LC3_INT32
concealMethod
,
LC3_INT32
pitch_present_bfi1
,
LC3_INT32
pitch_present_bfi2
,
LC3_FLOAT
*
cum_fflcAtten
#ifdef CR8_A_PLC_FADEOUT_TUNING
,
LC3_UINT8
plc_fadeout_type
#endif
);
void
processPlcDampingScrambling_fl
(
LC3_FLOAT
*
spec
,
LC3_INT32
yLen
,
LC3_INT32
nbLostCmpt
,
LC3_FLOAT
*
stabFac
,
LC3_INT32
processDampScramb
,
LC3_FLOAT
*
cum_fflcAtten
,
LC3_INT32
pitch_present
,
LC3_INT32
frame_dms
,
LC3_FLOAT
*
cum_fading_slow
,
LC3_FLOAT
*
cum_fading_fast
,
LC3_INT32
*
seed
,
LC3_INT32
spec_inv_idx
#ifdef CR8_A_PLC_FADEOUT_TUNING
,
LC3_UINT8
plc_fadeout_type
#endif
);
void
plc_phEcu_F0_refine_first
(
LC3_INT32
*
plocs
,
LC3_INT32
n_plocs
,
LC3_FLOAT
*
f0est
,
const
LC3_INT32
Xabs_len
,
...
...
@@ -279,10 +264,8 @@ void plc_phEcu_spec_ana(LC3_FLOAT* xfp, LC3_INT32 xfp_len, const LC3_FLOAT*
void
plc_phEcu_subst_spec
(
LC3_INT32
*
plocs
,
LC3_INT32
n_plocs
,
LC3_FLOAT
*
f0est
,
LC3_INT32
time_offs
,
Complex
*
X
,
LC3_INT32
X_len
,
LC3_FLOAT
*
mag_chg_gr
,
LC3_INT32
*
seed
,
LC3_FLOAT
*
alpha
,
LC3_FLOAT
*
beta
,
LC3_FLOAT
*
Xavg
,
LC3_INT32
t_adv_in
,
LC3_INT32
Lprot
,
LC3_INT32
delta_corr
,
#ifdef CR8_A_PLC_FADEOUT_TUNING
LC3_INT16
fadeout
,
/* needed for DC muting */
LC3_INT16
*
nonpure_tone_flag_ptr
,
/* i/o: flag */
#endif
LC3_FLOAT
*
corr_phase_dbg
,
LC3_FLOAT
*
X_i_new_re_dbg
,
LC3_FLOAT
*
X_i_new_im_dbg
);
void
plc_phEcu_rec_frame
(
Complex
*
X_in
,
LC3_INT32
xfp_len
,
LC3_INT32
Lecu
,
const
LC3_FLOAT
*
whr
,
const
LC3_FLOAT
*
winMDCT
,
LC3_INT32
Lprot
,
...
...
@@ -300,18 +283,14 @@ void plc_phEcu_tba_trans_dect_gains(LC3_INT32 burst_len, LC3_INT32 n_grp, LC3_FL
LC3_FLOAT
*
alpha
,
LC3_FLOAT
*
beta
,
LC3_FLOAT
*
mag_chg
,
LC3_FLOAT
*
ph_dith
,
LC3_INT32
*
tr_dec
,
LC3_FLOAT
*
att_val
,
LC3_INT32
*
attDegreeFrames
,
LC3_FLOAT
*
thresh_dbg
#ifdef CR8_A_PLC_FADEOUT_TUNING
,
LC3_UINT8
plc_fadeout_type
#endif
);
void
plc_phEcu_trans_burst_ana_sub
(
LC3_INT32
fs_idx
,
LC3_INT32
burst_len
,
LC3_INT32
n_grp
,
LC3_FLOAT
*
oold_spect_shape
,
LC3_FLOAT
*
oold_EwPtr
,
LC3_FLOAT
*
old_spect_shape
,
LC3_FLOAT
*
old_EwPtr
,
LC3_FLOAT
*
stPhECU_beta_mute
,
LC3_FLOAT
*
stPhECU_mag_chg_1st
,
LC3_FLOAT
*
stPhECU_Xavg
,
LC3_FLOAT
*
alpha
,
LC3_FLOAT
*
beta
,
LC3_FLOAT
*
mag_chg
,
LC3_INT32
*
tr_dec_dbg
,
LC3_FLOAT
*
gpc_dbg
#ifdef CR8_A_PLC_FADEOUT_TUNING
,
LC3_UINT8
plc_fadeout_type
#endif
);
void
plc_phEcu_hq_ecu
(
LC3_FLOAT
*
f0binPtr
,
LC3_FLOAT
*
f0ltpGainPtr
,
...
...
@@ -326,10 +305,8 @@ void plc_phEcu_hq_ecu(
LC3_FLOAT
*
st_beta_mute
,
LC3_FLOAT
*
st_mag_chg_1st
,
LC3_FLOAT
*
st_Xavg
,
LC3_INT32
LA_ZEROS
,
LC3_FLOAT
*
x_tda
,
LC3_FLOAT
*
xsubst_dbg
,
Complex
*
X_out_m_dbg
,
LC3_INT32
*
seed_dbg
,
LC3_FLOAT
*
mag_chg_dbg
,
LC3_INT32
*
tr_dec_dbg
,
LC3_FLOAT
*
gpc_dbg
,
LC3_FLOAT
*
X_i_new_re_dbg
,
LC3_FLOAT
*
X_i_new_im_dbg
,
LC3_FLOAT
*
corr_phase_dbg
,
Fft
*
PhEcu_Fft
,
Fft
*
PhEcu_Ifft
#ifdef CR8_A_PLC_FADEOUT_TUNING
,
LC3_UINT8
plc_fadeout_type
,
LC3_INT16
*
nonpure_tone_flag_ptr
#endif
);
void
processTdcPreemphasis_fl
(
LC3_FLOAT
*
in
,
LC3_FLOAT
*
pre_emph_factor
,
LC3_INT32
n_bands
);
...
...
@@ -340,12 +317,11 @@ void processTdcInverseOdft_fl(LC3_FLOAT *in, LC3_INT32 n_bands, LC3_FLOAT *out,
void
processTdcApply_fl
(
const
LC3_INT32
pitch_LC3_INT
,
const
LC3_FLOAT
*
preemphFac
,
const
LC3_FLOAT
*
A
,
const
LC3_INT32
lpc_order
,
const
LC3_FLOAT
*
pcmbufHist
,
const
LC3_INT32
max_len_pcm_plc
,
const
LC3_INT32
N
,
const
LC3_INT32
frame_dms
,
const
LC3_INT32
SampRate
,
const
LC3_INT32
nbLostCmpt
,
const
LC3_INT32
overlap
,
const
LC3_FLOAT
*
stabFac
,
LC3_FLOAT
harmonicBuf
[
MAX_PITCH
],
LC3_FLOAT
synthHist
[
M
],
LC3_INT32
*
fract
,
LC3_INT16
*
seed
,
LC3_FLOAT
*
gain_c
,
LC3_FLOAT
*
alpha
,
LC3_FLOAT
*
synth
#ifdef CR9_I_INC_TDC_FADEOUT_LEN
,
LC3_UINT8
plc_fadeout_type
#endif
,
LC3_FLOAT
*
alpha_type_2_table
);
void
*
balloc
(
void
*
base
,
size_t
*
base_size
,
size_t
size
);
LC3_FLOAT
type_2_fadeout
(
LC3_INT32
nbLostFramesInRow
,
LC3_INT32
frame_dms
);
#endif
Prev
1
2
3
4
5
6
7
Next