/liblc3-latest/src/ |
D | sns.c | 775 const float *eb, bool att, struct lc3_sns_data *data, in lc3_sns_analyze() argument 790 resolve_codebooks(scf, &data->lfcb, &data->hfcb); in lc3_sns_analyze() 792 quantize(scf, data->lfcb, data->hfcb, in lc3_sns_analyze() 793 c, cn, &data->shape, &data->gain); in lc3_sns_analyze() 795 unquantize(data->lfcb, data->hfcb, in lc3_sns_analyze() 796 cn[data->shape], data->shape, data->gain, scf); in lc3_sns_analyze() 798 enumerate(data->shape, c[data->shape], in lc3_sns_analyze() 799 &data->idx_a, &data->ls_a, &data->idx_b, &data->ls_b); in lc3_sns_analyze() 809 const lc3_sns_data_t *data, const float *x, float *y) in lc3_sns_synthesize() argument 814 deenumerate(data->shape, in lc3_sns_synthesize() [all …]
|
D | tns.c | 388 bool nn_flag, int nbytes, struct lc3_tns_data *data, float *x) in lc3_tns_analyze() argument 400 data->lpc_weighting = resolve_lpc_weighting(dt, nbytes); in lc3_tns_analyze() 401 data->nfilters = 1 + (dt >= LC3_DT_5M && bw >= LC3_BANDWIDTH_SWB); in lc3_tns_analyze() 406 for (int f = 0; f < data->nfilters; f++) { in lc3_tns_analyze() 408 data->rc_order[f] = 0; in lc3_tns_analyze() 412 if (data->lpc_weighting && pred_gain[f] < 2.f) in lc3_tns_analyze() 417 quantize_rc(rc[f], maxorder, &data->rc_order[f], data->rc[f]); in lc3_tns_analyze() 418 unquantize_rc(data->rc[f], data->rc_order[f], rc[f]); in lc3_tns_analyze() 421 forward_filtering(dt, bw, data->rc_order, rc, x); in lc3_tns_analyze() 428 const struct lc3_tns_data *data, float *x) in lc3_tns_synthesize() argument [all …]
|
D | tns.h | 51 bool nn_flag, int nbytes, lc3_tns_data_t *data, float *x); 58 int lc3_tns_get_nbits(const lc3_tns_data_t *data); 65 void lc3_tns_put_data(lc3_bits_t *bits, const lc3_tns_data_t *data); 81 enum lc3_dt dt, enum lc3_bandwidth bw, int nbytes, lc3_tns_data_t *data); 90 const lc3_tns_data_t *data, float *x);
|
D | ltpf.h | 54 lc3_ltpf_analysis_t *ltpf, const int16_t *x, lc3_ltpf_data_t *data); 60 void lc3_ltpf_disable(lc3_ltpf_data_t *data); 74 void lc3_ltpf_put_data(lc3_bits_t *bits, const lc3_ltpf_data_t *data); 85 void lc3_ltpf_get_data(lc3_bits_t *bits, lc3_ltpf_data_t *data); 100 lc3_ltpf_synthesis_t *ltpf, const lc3_ltpf_data_t *data,
|
D | sns.h | 56 const float *eb, bool att, lc3_sns_data_t *data, 70 void lc3_sns_put_data(lc3_bits_t *bits, const lc3_sns_data_t *data); 83 int lc3_sns_get_data(lc3_bits_t *bits, lc3_sns_data_t *data); 95 const lc3_sns_data_t *data, const float *x, float *y);
|
D | ltpf.c | 662 const int16_t *x, struct lc3_ltpf_data *data) in lc3_ltpf_analyse() argument 707 data->pitch_index = refine_pitch(x_12k8, n_12k8, tc, &pitch); in lc3_ltpf_analyse() 722 data->active = !lc3_hr(sr) && pitch_present && in lc3_ltpf_analyse() 726 data->active = !lc3_hr(sr) && pitch_present && in lc3_ltpf_analyse() 731 ltpf->active = data->active; in lc3_ltpf_analyse() 856 lc3_ltpf_synthesis_t *ltpf, const lc3_ltpf_data_t *data, in lc3_ltpf_synthesize() argument 863 int p_idx = data ? data->pitch_index : 0; in lc3_ltpf_synthesize() 878 bool active = data && data->active && g_idx < 4; in lc3_ltpf_synthesize() 933 void lc3_ltpf_disable(struct lc3_ltpf_data *data) in lc3_ltpf_disable() argument 935 data->active = false; in lc3_ltpf_disable() [all …]
|
D | lc3.c | 566 const void *data, int nbytes, struct side_data *side) in decode() argument 578 lc3_setup_bits(&bits, LC3_BITS_MODE_READ, (void *)data, nbytes); in decode()
|
/liblc3-latest/tools/ |
D | wave.c | 98 struct wave_data data; in wave_read_header() local 117 for ( ; fread(&data, sizeof(data), 1, fp) == 1 && data.id != WAVE_DATA_ID in wave_read_header() 118 ; fseek(fp, data.size, SEEK_CUR) ); in wave_read_header() 127 *nframes = data.size / format.framesize; in wave_read_header() 150 struct wave_data data; in wave_write_header() member 171 header.data = (struct wave_data){ in wave_write_header()
|
D | lc3bin.c | 120 void lc3bin_write_data(FILE *fp, const void *data, int nbytes) in lc3bin_write_data() argument 125 fwrite(data, 1, nbytes, fp); in lc3bin_write_data()
|
D | lc3bin.h | 70 void lc3bin_write_data(FILE *fp, const void *data, int nbytes);
|
/liblc3-latest/test/ |
D | tns_py.c | 116 struct lc3_tns_data data = { 0 }; in analyze_py() local 132 lc3_tns_analyze(dt, bw, nn_flag, nbytes, &data, x); in analyze_py() 134 return Py_BuildValue("ON", x_obj, new_tns_data(&data)); in analyze_py() 141 struct lc3_tns_data data; in synthesize_py() local 149 CTYPES_CHECK(NULL, data_obj = to_tns_data(data_obj, &data)); in synthesize_py() 155 lc3_tns_synthesize(dt, bw, &data, x); in synthesize_py() 163 struct lc3_tns_data data = { 0 }; in get_nbits_py() local 168 CTYPES_CHECK("data", to_tns_data(data_obj, &data)); in get_nbits_py() 170 int nbits = lc3_tns_get_nbits(&data); in get_nbits_py()
|
D | decoder.py | 50 def decode(self, data): argument 52 b = bitstream.BitstreamReader(data) 60 self.tns.load(b, bw, len(data)) 71 x = self.spec.decode(b, bw, len(data)) 88 def run(self, data): argument 90 (x, bw, pitch) = self.decode(data) 92 x = self.synthesize(x, bw, pitch, len(data))
|
D | ltpf_py.c | 57 struct lc3_ltpf_data data = { 0 }; in analyse_py() local 72 lc3_ltpf_analyse(dt, sr, <pf, x + nt, &data); in analyse_py() 75 return Py_BuildValue("iN", pitch_present, new_ltpf_data(&data)); in analyse_py() 82 struct lc3_ltpf_data data; in synthesize_py() local 98 CTYPES_CHECK(NULL, data_obj = to_ltpf_data(data_obj, &data)); in synthesize_py() 105 <pf, pitch_present ? &data : NULL, x, x + nd); in synthesize_py()
|
D | ctypes.h | 382 static PyObject *new_ltpf_data(const struct lc3_ltpf_data *data) in new_ltpf_data() argument 387 new_scalar(NPY_BOOL, &data->active)); in new_ltpf_data() 390 new_scalar(NPY_INT, &data->pitch_index)); in new_ltpf_data() 397 PyObject *obj, const struct lc3_ltpf_data *data) in to_ltpf_data() argument 405 to_scalar(item, NPY_BOOL, &data->active)); in to_ltpf_data() 409 to_scalar(item, NPY_INT, &data->pitch_index)); in to_ltpf_data() 419 static PyObject *new_sns_data(const struct lc3_sns_data *data) in new_sns_data() argument 424 new_scalar(NPY_INT, &data->lfcb)); in new_sns_data() 427 new_scalar(NPY_INT, &data->hfcb)); in new_sns_data() 430 new_scalar(NPY_INT, &data->shape)); in new_sns_data() [all …]
|
D | sns_py.c | 142 struct lc3_sns_data data = { 0 }; in analyze_py() local 160 lc3_sns_analyze(dt, sr, nbytes, eb, att, &data, x, x); in analyze_py() 162 return Py_BuildValue("ON", x_obj, new_sns_data(&data)); in analyze_py() 168 struct lc3_sns_data data; in synthesize_py() local 177 CTYPES_CHECK(NULL, data_obj = to_sns_data(data_obj, &data)); in synthesize_py() 183 lc3_sns_synthesize(dt, sr, &data, x, x); in synthesize_py()
|
D | sns.py | 41 data = { 'lfcb' : self.ind_lf, 'hfcb' : self.ind_hf, 46 data.update({ 'idx_b' : self.idx_b, 'ls_b' : self.ls_b }) 48 return data 509 data = analysis.get_data() 514 for k in data.keys(): 515 ok = ok and data_c[k] == data[k] 523 data = analysis.get_data() 527 for k in data.keys(): 528 ok = ok and data_c[k] == data[k] 594 (x, data) = lc3.sns_analyze(dt, sr, 0, C.E_B[i0][i], False, C.X[i0][i]) [all …]
|
D | encoder.py | 100 data = self.encode(pitch_present, nbytes) 102 return data 113 data = lc3.encode(enc_c, C.X_PCM[i0][i], C.NBYTES[i0]) 114 ok = ok and data == C.BYTES_AC[i0][i]
|
D | bitstream.py | 21 def __init__(self, data): argument 23 self.bytes = data 25 self.bp_bw = len(data) - 1 42 def __init__(self, data): argument 44 super().__init__(data)
|
D | ltpf.py | 526 data = ltpf.get_data() 534 ok = ok and data_c['active'] == data['active'] 535 ok = ok and data_c['pitch_index'] == data['pitch_index'] 590 (pitch_present, data) = lc3.ltpf_analyse(dt, sr, state, x) 595 ok = ok and data['pitch_index'] == C.PITCH_INDEX[i0][0] 596 ok = ok and data['active'] == C.LTPF_ACTIVE[i0][0] 599 (pitch_present, data) = lc3.ltpf_analyse(dt, sr, state, x) 604 ok = ok and data['pitch_index'] == C.PITCH_INDEX[i0][1] 605 ok = ok and data['active'] == C.LTPF_ACTIVE[i0][1] 643 data = { 'active' : ACTIVE[i][0], 'pitch_index' : PITCH_INDEX[i][0] } [all …]
|
/liblc3-latest/fuzz/ |
D | dfuzz.cc | 24 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) in LLVMFuzzerTestOneInput() argument 29 FuzzedDataProvider fdp(data, size); in LLVMFuzzerTestOneInput() 63 fdp.ConsumeBytes<uint8_t>(nchannels * frame_size).data(), frame_size, in LLVMFuzzerTestOneInput() 64 fmt, std::vector<uint8_t>(nchannels * frame_samples * sample_bytes).data()); in LLVMFuzzerTestOneInput()
|
D | efuzz.cc | 46 e.Encode(pcm.data(), in encode() 47 frame_size, std::vector<uint8_t>(nchannels * frame_size).data()); in encode() 65 e.Encode(fmt, fdp.ConsumeBytes<uint8_t>(pcm_bytes).data(), in encode() 66 frame_size, std::vector<uint8_t>(nchannels * frame_size).data()); in encode() 71 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) in LLVMFuzzerTestOneInput() argument 76 FuzzedDataProvider fdp(data, size); in LLVMFuzzerTestOneInput()
|
/liblc3-latest/python/ |
D | lc3.py | 364 data = (c_byte * data_size).from_buffer(data_buffer, data_offset) 367 ret = self.lib.lc3_encode(encoder, pcm_fmt, pcm, nchannels, len(data), data) 475 self, data: bytes | bytearray | memoryview, bit_depth: None = None 479 def decode(self, data: bytes | bytearray | memoryview, bit_depth: int) -> bytes: ... 482 self, data: bytes | bytearray | memoryview, bit_depth: int | None = None 503 data_buffer = bytearray(data)
|