Home
last modified time | relevance | path

Searched refs:C (Results 1 – 11 of 11) sorted by relevance

/liblc3-latest/test/
Dspec.py20 import tables as T, appendix_c as C namespace
92 C = [ [ -6, 0, None, 2 ], [ -6, 0, None, 5 ] ]
95 bitrate // 12500 + C[sr - T.SRATE_48K_HR][dt], 6, 23)
791 for i in range(len(C.X_F[i0])):
795 g_int = lc3.spec_estimate_gain(dt, sr, C.X_F[i0][i],
796 0, C.NBITS_SPEC[i0][i], C.NBITS_OFFSET[i0][i], -C.GG_OFF[i0][i])[0]
797 ok = ok and g_int == C.GG_IND[i0][i] + C.GG_OFF[i0][i]
800 C.GG_IND[i0][i] + C.GG_OFF[i0][i], C.X_F[i0][i])
802 ok = ok and np.any((np.trunc(x) - C.X_Q[i0][i]) == 0)
803 ok = ok and nq == C.LASTNZ[i0][i]
[all …]
Dsns.py21 import tables as T, appendix_c as C namespace
572 for i in range(len(C.E_B[i0])):
574 scf = lc3.sns_compute_scale_factors(dt, sr, 0, C.E_B[i0][i], False)
575 ok = ok and np.amax(np.abs(scf - C.SCF[i0][i])) < 1e-4
578 ok = ok and lf == C.IND_LF[i0][i] and hf == C.IND_HF[i0][i]
581 ok = ok and np.any(y[0][:16] - C.SNS_Y0[i0][i] == 0)
582 ok = ok and np.any(y[1][:10] - C.SNS_Y1[i0][i] == 0)
583 ok = ok and np.any(y[2][:16] - C.SNS_Y2[i0][i] == 0)
584 ok = ok and np.any(y[3][:16] - C.SNS_Y3[i0][i] == 0)
585 ok = ok and shape == 2*C.SUBMODE_MSB[i0][i] + C.SUBMODE_LSB[i0][i]
[all …]
Dtns.py20 import tables as T, appendix_c as C namespace
420 for i in range(len(C.X_S[i0])):
422 (_, a) = lc3.tns_compute_lpc_coeffs(dt, sr, C.X_S[i0][i])
423 ok = ok and np.amax(np.abs(a[0] - C.TNS_LEV_A[i0][i])) < 1e-5
426 ok = ok and np.amax(np.abs(rc - C.TNS_LEV_RC[i0][i])) < 1e-5
428 (rc_order, rc_i) = lc3.tns_quantize_rc(dt, C.TNS_LEV_RC[i0][i])
429 ok = ok and rc_order == C.RC_ORDER[i0][i][0]
430 ok = ok and np.any((rc_i + 8) - C.RC_I_1[i0][i] == 0)
433 ok = ok and np.amax(np.abs(rc_q - C.RC_Q_1[i0][i])) < 1e-6
435 (x, side) = lc3.tns_analyze(dt, sr, False, C.NBYTES[i0], C.X_S[i0][i])
[all …]
Dltpf.py21 import tables as T, appendix_c as C namespace
491 x = np.append(np.zeros(nt), C.X_PCM[i0][0])
494 u = y[-k:len(C.X_TILDE_12K8D[i0][0])-k]
496 ok = ok and np.amax(np.abs(u - C.X_TILDE_12K8D[i0][0]/2)) < 2
498 x = np.append(x[-nt:], C.X_PCM[i0][1])
501 u = y[-k:len(C.X_TILDE_12K8D[i0][1])-k]
503 ok = ok and np.amax(np.abs(u - C.X_TILDE_12K8D[i0][1]/2)) < 2
589 x = np.append(np.zeros(nt), C.X_PCM[i0][0])
592 ok = ok and C.T_CURR[i0][0] - state['tc'] == 17
593 ok = ok and np.amax(np.abs(state['nc'][0] - C.NC_LTPF[i0][0])) < 1e-5
[all …]
Dmdct.py21 import tables as T, appendix_c as C namespace
137 (y, d) = lc3.mdct_forward(dt, sr, C.X_PCM[i0][0], np.zeros(nd))
138 ok = ok and np.amax(np.abs(y - C.X[i0][0])) < 1e-1
140 (y, d) = lc3.mdct_forward(dt, sr, C.X_PCM[i0][1], d)
141 ok = ok and np.amax(np.abs(y - C.X[i0][1])) < 1e-1
180 (y, d0) = lc3.mdct_inverse(dt, sr, C.X_HAT_SNS[i0][0], np.zeros(nd))
181 yr = C.T_HAT_MDCT[i0][0][ns-nd:2*ns-nd]
182 dr = C.T_HAT_MDCT[i0][0][2*ns-nd:]
187 (y, d1) = lc3.mdct_inverse(dt, sr, C.X_HAT_SNS[i0][1], d0)
188 yr[ :nd] = C.T_HAT_MDCT[i0][1][ns-nd:ns] + d0
[all …]
Denergy.py20 import tables as T, appendix_c as C namespace
71 e = lc3.energy_compute(dt, sr, C.X[i0][0])[0]
72 ok = ok and np.amax(np.abs(1 - e/C.E_B[i0][0])) < 1e-6
74 e = lc3.energy_compute(dt, sr, C.X[i0][1])[0]
75 ok = ok and np.amax(np.abs(1 - e/C.E_B[i0][1])) < 1e-6
Dattdet.py20 import tables as T, appendix_c as C namespace
160 x = np.append(np.zeros(6), C.X_PCM_ATT[i0][0])
161 f_att = lc3.attdet_run(dt, sr, C.NBYTES_ATT[i0], state, x)
162 ok = ok and f_att == C.F_ATT[i0][0]
164 x = np.append(x[-6:], C.X_PCM_ATT[i0][1])
165 f_att = lc3.attdet_run(dt, sr, C.NBYTES_ATT[i0], state, x)
166 ok = ok and f_att == C.F_ATT[i0][1]
Dencoder.py24 import tables as T, appendix_c as C namespace
111 for i in range(len(C.X_PCM[i0])):
113 data = lc3.encode(enc_c, C.X_PCM[i0][i], C.NBYTES[i0])
114 ok = ok and data == C.BYTES_AC[i0][i]
Ddecoder.py24 import tables as T, appendix_c as C namespace
103 for i in range(len(C.BYTES_AC[i0])):
105 pcm = lc3.decode(dec_c, bytes(C.BYTES_AC[i0][i]))
106 ok = ok and np.max(np.abs(pcm - C.X_HAT_CLIP[i0][i])) < 1
Dbwdet.py20 import tables as T, appendix_c as C namespace
143 E_B = C.E_B[i0]
144 P_BW = C.P_BW[i0]
/liblc3-latest/
DREADME.md115 The C implementation is unitary validated against this implementation and
116 intermediate values given in Appendix C of the LC3 specification.
175 Decoding and encoding tools are provided in `python/tools`, like C tools,