/liblc3-3.5.0-3.4.0/test/ |
D | energy.py | 26 def __init__(self, dt, sr): argument 28 self.dt = dt 29 self.I = T.I[dt][sr] 36 e_lo = np.sum(e[:len(e) - [4, 2][self.dt]]) 37 e_hi = np.sum(e[len(e) - [4, 2][self.dt]:]) 43 def check_unit(rng, dt, sr): argument 45 ns = T.NS[dt][sr] 48 nrg = EnergyBand(dt, sr) 50 x = (2 * rng.random(T.NS[dt][sr])) - 1 53 (e_c, nn_c) = lc3.energy_compute(dt, sr, x) [all …]
|
D | mdct.py | 30 def __init__(self, dt, sr): argument 32 self.ns = T.NS[dt][sr] 33 self.nd = T.ND[dt][sr] 36 self.w = Mdct.W[dt][sr] 41 def __init__(self, dt, sr): argument 43 super().__init__(dt, sr) 66 def __init__(self, dt, sr): argument 68 super().__init__(dt, sr) 94 def check_forward_unit(rng, dt, sr): argument 96 ns = T.NS[dt][sr] [all …]
|
D | bwdet.py | 43 def __init__(self, dt, sr): argument 45 self.dt = dt 50 dt = self.dt 58 i0 = BW_START[dt][sr][bw] 59 i1 = BW_STOP[dt][sr][bw] 68 l = L[dt][bw0] 69 i0 = BW_START[dt][sr][bw0] - l 70 i1 = BW_START[dt][sr][bw0] 94 def check_unit(rng, dt, sr): argument 98 bwdet = BandwidthDetector(dt, sr) [all …]
|
D | attdet.py | 27 def __init__(self, dt, sr): argument 29 self.dt = dt 31 self.ms = T.DT_MS[dt] 41 c1 = self.dt == T.DT_10M and \ 44 c2 = self.dt == T.DT_10M and \ 47 c3 = self.dt == T.DT_7M5 and \ 50 c4 = self.dt == T.DT_7M5 and \ 104 def check_enabling(rng, dt): argument 110 attdet = AttackDetector(dt, sr) 114 f_att = lc3.attdet_run(dt, sr, nbytes, [all …]
|
D | spec.py | 31 def __init__(self, dt, sr): argument 33 self.dt = dt 45 nf_start = [ 18, 24 ][self.dt] 46 nf_width = [ 2, 3 ][self.dt] 48 bw_stop = int([ 80, 160, 240, 320, 400 ][bw] * (T.DT_MS[self.dt] / 10)) 60 def __init__(self, dt, sr): argument 62 super().__init__(dt, sr) 309 ne = T.NE[self.dt][self.sr] 404 def __init__(self, dt, sr): argument 406 super().__init__(dt, sr) [all …]
|
D | tns.py | 66 def __init__(self, dt): argument 68 self.dt = dt 99 def __init__(self, dt): argument 101 super().__init__(dt) 107 S = Tns.SUB_LIM[self.dt][bw][f] 188 self.nfilters = len(Tns.SUB_LIM[self.dt][bw]) 189 self.lpc_weighting = nbytes * 8 < 48 * T.DT_MS[self.dt] 213 i0 = Tns.FREQ_LIM[self.dt][bw][f] 214 i1 = Tns.FREQ_LIM[self.dt][bw][f+1] 260 self.nfilters = len(Tns.SUB_LIM[self.dt][bw]) [all …]
|
D | sns.py | 27 def __init__(self, dt, sr): argument 29 self.dt = dt 78 I = T.I[self.dt][self.sr] 88 def __init__(self, dt, sr): argument 90 super().__init__(dt, sr) 94 dt = self.dt 145 scf_a = (0.5 if self.dt == T.DT_10M else 0.3) * \ 342 def __init__(self, dt, sr): argument 344 super().__init__(dt, sr) 460 def check_analysis(rng, dt, sr): argument [all …]
|
D | spec_py.c | 29 unsigned dt, sr; in estimate_gain_py() local 36 if (!PyArg_ParseTuple(args, "IIOifi", &dt, &sr, in estimate_gain_py() 40 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in estimate_gain_py() 43 int ne = LC3_NE(dt, sr); in estimate_gain_py() 47 int g_int = estimate_gain(dt, sr, in estimate_gain_py() 72 unsigned dt, sr; in quantize_py() local 77 if (!PyArg_ParseTuple(args, "IIiO", &dt, &sr, &g_int, &x_obj)) in quantize_py() 80 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in quantize_py() 84 int ne = LC3_NE(dt, sr); in quantize_py() 91 quantize(dt, sr, g_int, x, __xq, &nq); in quantize_py() [all …]
|
D | encoder.py | 37 dt = { 7.5: T.DT_7M5, 10: T.DT_10M }[dt_ms] 42 self.ne = T.NE[dt][sr] 44 self.attdet = attdet.AttackDetector(dt, sr) 45 self.ltpf = ltpf.LtpfAnalysis(dt, sr) 47 self.mdct = mdct.MdctForward(dt, sr) 48 self.energy = energy.EnergyBand(dt, sr) 49 self.bwdet = bwdet.BandwidthDetector(dt, sr) 50 self.sns = sns.SnsAnalysis(dt, sr) 51 self.tns = tns.TnsAnalysis(dt) 52 self.spec = spec.SpectrumAnalysis(dt, sr) [all …]
|
D | mdct_py.c | 29 enum lc3_dt dt; in mdct_forward_py() local 33 if (!PyArg_ParseTuple(args, "iiOO", &dt, &sr, &x_obj, &xd_obj)) in mdct_forward_py() 36 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in mdct_forward_py() 39 int ns = LC3_NS(dt, sr), nd = LC3_ND(dt, sr); in mdct_forward_py() 48 lc3_mdct_forward(dt, sr, sr, x, d, y); in mdct_forward_py() 56 enum lc3_dt dt; in mdct_inverse_py() local 60 if (!PyArg_ParseTuple(args, "iiOO", &dt, &sr, &x_obj, &xd_obj)) in mdct_inverse_py() 63 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in mdct_inverse_py() 66 int ns = LC3_NS(dt, sr), nd = LC3_ND(dt, sr); in mdct_inverse_py() 75 lc3_mdct_inverse(dt, sr, sr, x, d, y); in mdct_inverse_py()
|
D | ltpf_py.c | 27 unsigned dt, sr; in resample_py() local 32 if (!PyArg_ParseTuple(args, "IIOOO", &dt, &sr, &hp50_obj, &x_obj, &y_obj)) in resample_py() 35 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in resample_py() 39 int ns = LC3_NS(dt, sr), nt = LC3_NT(dt); in resample_py() 41 int n = dt == LC3_DT_7M5 ? 96 : 128; in resample_py() 55 unsigned dt, sr; in analyse_py() local 60 if (!PyArg_ParseTuple(args, "IIOO", &dt, &sr, <pf_obj, &x_obj)) in analyse_py() 63 CTYPES_CHECK("dt", dt < LC3_NUM_DT); in analyse_py() 67 int ns = LC3_NS(dt, sr), nt = LC3_NT(sr); in analyse_py() 72 lc3_ltpf_analyse(dt, sr, <pf, x + nt, &data); in analyse_py() [all …]
|
D | sns_py.c | 28 unsigned dt, sr; in compute_scale_factors_py() local 33 if (!PyArg_ParseTuple(args, "IIOp", &dt, &sr, &eb_obj, &att)) in compute_scale_factors_py() 36 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in compute_scale_factors_py() 39 int nb = LC3_MIN(lc3_band_lim[dt][sr][LC3_NUM_BANDS], LC3_NUM_BANDS); in compute_scale_factors_py() 44 compute_scale_factors(dt, sr, eb, att, scf); in compute_scale_factors_py() 118 unsigned dt, sr; in spectral_shaping_py() local 122 if (!PyArg_ParseTuple(args, "IIOpO", &dt, &sr, &scf_q_obj, &inv, &x_obj)) in spectral_shaping_py() 125 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in spectral_shaping_py() 128 int ne = LC3_NE(dt, sr); in spectral_shaping_py() 133 spectral_shaping(dt, sr, scf_q, inv, x, x); in spectral_shaping_py() [all …]
|
D | tns_py.c | 29 unsigned dt, bw; in compute_lpc_coeffs_py() local 32 if (!PyArg_ParseTuple(args, "IIO", &dt, &bw, &x_obj)) in compute_lpc_coeffs_py() 35 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in compute_lpc_coeffs_py() 38 int ne = LC3_NE(dt, bw); in compute_lpc_coeffs_py() 45 compute_lpc_coeffs(dt, bw, x, g, a); in compute_lpc_coeffs_py() 107 unsigned dt, bw; in analyze_py() local 112 if (!PyArg_ParseTuple(args, "IIpIO", &dt, &bw, &nn_flag, &nbytes, &x_obj)) in analyze_py() 115 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in analyze_py() 118 int ne = LC3_NE(dt, bw); in analyze_py() 122 lc3_tns_analyze(dt, bw, nn_flag, nbytes, &data, x); in analyze_py() [all …]
|
D | ltpf.py | 27 def __init__(self, dt, sr, history = 0): argument 33 self.n = ((T.DT_MS[dt] * 128) / 10).astype(int) 34 self.d = [ 44, 24 ][dt] 36 self.x = np.zeros(self.w + T.NS[dt][sr]) 129 def __init__(self, dt, sr): argument 131 self.dt = dt 139 def __init__(self, dt, sr): argument 141 super().__init__(dt, sr) 144 dt, sr, history = 232) 253 active = (self.dt == T.DT_10M or self.nc[1] > 0.94) \ [all …]
|
D | decoder.py | 36 dt = { 7.5: T.DT_7M5, 10: T.DT_10M }[dt_ms] 42 self.ne = T.NE[dt][sr] 43 self.ns = T.NS[dt][sr] 45 self.mdct = mdct.MdctInverse(dt, sr) 47 self.bwdet = bwdet.BandwidthDetector(dt, sr) 48 self.spec = spec.SpectrumSynthesis(dt, sr) 49 self.tns = tns.TnsSynthesis(dt) 50 self.sns = sns.SnsSynthesis(dt, sr) 51 self.ltpf = ltpf.LtpfSynthesis(dt, sr) 101 def check_appendix_c(dt): argument [all …]
|
D | energy_py.c | 30 unsigned dt, sr; in energy_compute_py() local 34 if (!PyArg_ParseTuple(args, "IIO", &dt, &sr, &x_obj)) in energy_compute_py() 37 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in energy_compute_py() 40 int ns = LC3_NS(dt, sr); in energy_compute_py() 45 int nn_flag = lc3_energy_compute(dt, sr, x, e); in energy_compute_py()
|
D | attdet_py.c | 27 unsigned dt, sr, nbytes; in attdet_run_py() local 33 &dt, &sr, &nbytes, &attdet_obj, &x_obj)) in attdet_run_py() 36 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in attdet_run_py() 40 int ns = LC3_NS(dt, sr); in attdet_run_py() 44 int att = lc3_attdet_run(dt, sr, nbytes, &attdet, x+6); in attdet_run_py()
|
D | bwdet_py.c | 27 unsigned dt, sr; in bwdet_run_py() local 31 if (!PyArg_ParseTuple(args, "IIO", &dt, &sr, &e_obj)) in bwdet_run_py() 34 CTYPES_CHECK("dt", (unsigned)dt < LC3_NUM_DT); in bwdet_run_py() 38 int bw = lc3_bwdet_run(dt, sr, e); in bwdet_run_py()
|
/liblc3-3.5.0-3.4.0/src/ |
D | lc3.c | 81 enum lc3_dt dt = resolve_dt(dt_us); in lc3_frame_samples() local 84 if (dt >= LC3_NUM_DT || sr >= LC3_NUM_SRATE) in lc3_frame_samples() 87 return LC3_NS(dt, sr); in lc3_frame_samples() 133 enum lc3_dt dt = resolve_dt(dt_us); in lc3_delay_samples() local 136 if (dt >= LC3_NUM_DT || sr >= LC3_NUM_SRATE) in lc3_delay_samples() 139 return (dt == LC3_DT_7M5 ? 8 : 5) * (LC3_SRATE_KHZ(sr) / 2); in lc3_delay_samples() 157 enum lc3_dt dt = encoder->dt; in load_s16() local 162 int ns = LC3_NS(dt, sr); in load_s16() 178 enum lc3_dt dt = encoder->dt; in load_s24() local 183 int ns = LC3_NS(dt, sr); in load_s24() [all …]
|
D | common.h | 89 #define LC3_DT_US(dt) \ argument 90 ( (3 + (dt)) * 2500 ) 103 #define LC3_NS(dt, sr) \ argument 104 ( 20 * (3 + (dt)) * (1 + (sr) + ((sr) == LC3_SRATE_48K)) ) 106 #define LC3_ND(dt, sr) \ argument 107 ( (dt) == LC3_DT_7M5 ? 23 * LC3_NS(dt, sr) / 30 \ 108 : 5 * LC3_NS(dt, sr) / 8 ) 110 #define LC3_NE(dt, sr) \ argument 111 ( 20 * (3 + (dt)) * (1 + (sr)) ) 119 #define LC3_NH(dt, sr) \ argument [all …]
|
D | spec.c | 50 enum lc3_dt dt, enum lc3_srate sr, const float *x, in estimate_gain() argument 53 int ne = LC3_NE(dt, sr) >> 2; in estimate_gain() 208 LC3_HOT static void quantize(enum lc3_dt dt, enum lc3_srate sr, in quantize() argument 212 int ne = LC3_NE(dt, sr); in quantize() 239 LC3_HOT static float unquantize(enum lc3_dt dt, enum lc3_srate sr, in unquantize() argument 243 int i, ne = LC3_NE(dt, sr); in unquantize() 283 enum lc3_dt dt, enum lc3_srate sr, int nbytes, in compute_nbits() argument 286 int ne = LC3_NE(dt, sr); in compute_nbits() 384 enum lc3_dt dt, enum lc3_srate sr, int nbytes, in put_quantized() argument 387 int ne = LC3_NE(dt, sr); in put_quantized() [all …]
|
D | spec.h | 62 void lc3_spec_analyze(enum lc3_dt dt, enum lc3_srate sr, 73 enum lc3_dt dt, enum lc3_srate sr, const lc3_spec_side_t *side); 88 enum lc3_dt dt, enum lc3_srate sr, enum lc3_bandwidth bw, int nbytes, 104 enum lc3_dt dt, enum lc3_srate sr, lc3_spec_side_t *side); 115 int lc3_spec_decode(lc3_bits_t *bits, enum lc3_dt dt, enum lc3_srate sr,
|
D | energy.c | 27 enum lc3_dt dt, enum lc3_srate sr, const float *x, float *e) in lc3_energy_compute() argument 36 int n1 = n1_table[dt][sr]; in lc3_energy_compute() 48 int nb = LC3_MIN(LC3_NUM_BANDS, LC3_NS(dt, sr)); in lc3_energy_compute() 49 int iband_h = nb - 2*(2 - dt); in lc3_energy_compute() 50 const int *lim = lc3_band_lim[dt][sr]; in lc3_energy_compute()
|
D | tns.c | 32 static bool resolve_lpc_weighting(enum lc3_dt dt, int nbytes) in resolve_lpc_weighting() argument 34 return nbytes < (dt == LC3_DT_7M5 ? 360/8 : 480/8); in resolve_lpc_weighting() 59 enum lc3_dt dt, enum lc3_bandwidth bw, in compute_lpc_coeffs() argument 85 }[dt][bw]; in compute_lpc_coeffs() 256 enum lc3_dt dt, enum lc3_bandwidth bw, in forward_filtering() argument 260 int nf = LC3_NE(dt, bw) >> (nfilters - 1); in forward_filtering() 261 int i0, ie = 3*(3 + dt); in forward_filtering() 297 enum lc3_dt dt, enum lc3_bandwidth bw, in inverse_filtering() argument 301 int nf = LC3_NE(dt, bw) >> (nfilters - 1); in inverse_filtering() 302 int i0, ie = 3*(3 + dt); in inverse_filtering() [all …]
|
D | tns.h | 57 void lc3_tns_analyze(enum lc3_dt dt, enum lc3_bandwidth bw, 87 enum lc3_dt dt, enum lc3_bandwidth bw, int nbytes, lc3_tns_data_t *data); 95 void lc3_tns_synthesize(enum lc3_dt dt, enum lc3_bandwidth bw,
|