Home
last modified time | relevance | path

Searched refs:nbytes (Results 1 – 25 of 31) sorted by relevance

12

/liblc3-latest/tools/
Dlc3bin.c80 uint16_t nbytes; in lc3bin_read_data() local
82 if (fread(&nbytes, sizeof(nbytes), 1, fp) < 1 in lc3bin_read_data()
83 || nbytes > nchannels * LC3_HR_MAX_FRAME_BYTES in lc3bin_read_data()
84 || fread(buffer, nbytes, 1, fp) < 1) in lc3bin_read_data()
87 return nbytes; in lc3bin_read_data()
120 void lc3bin_write_data(FILE *fp, const void *data, int nbytes) in lc3bin_write_data() argument
122 uint16_t hdr_nbytes = nbytes; in lc3bin_write_data()
125 fwrite(data, 1, nbytes, fp); in lc3bin_write_data()
Dlc3bin.h70 void lc3bin_write_data(FILE *fp, const void *data, int nbytes);
/liblc3-latest/test/
Dlc3_py.c53 int nbytes; in encode_py() local
56 if (!PyArg_ParseTuple(args, "OOi", &encoder_obj, &pcm_obj, &nbytes)) in encode_py()
67 CTYPES_CHECK("nbytes", nbytes >= 20 && nbytes <= 400); in encode_py()
69 uint8_t out[nbytes]; in encode_py()
71 lc3_encode(encoder, LC3_PCM_FORMAT_S16, pcm, 1, nbytes, out); in encode_py()
76 PyBytes_FromStringAndSize((const char *)out, nbytes)); in encode_py()
110 int nbytes = in_obj == Py_None ? 0 : PyBytes_Size(in_obj); in decode_py() local
120 lc3_decode(decoder, in, nbytes, LC3_PCM_FORMAT_S16, pcm, 1); in decode_py()
Dattdet.py39 def is_enabled(self, nbytes): argument
42 self.sr == T.SRATE_32K and nbytes > 80
45 self.sr >= T.SRATE_48K and nbytes >= 100
48 self.sr == T.SRATE_32K and nbytes >= 61 and nbytes < 150
51 self.sr >= T.SRATE_48K and nbytes >= 75 and nbytes < 150
55 def run(self, nbytes, x): argument
96 return self.is_enabled(nbytes) and f_att
112 for nbytes in [ 61, 61-1, 75-1, 75, 80, 80+1, 100-1, 100, 150-1, 150 ]:
114 f_att = lc3.attdet_run(dt, sr, nbytes,
117 ok = ok and f_att == attdet.is_enabled(nbytes)
Dencoder.py51 def analyse(self, x, nbytes): argument
53 att = self.attdet.run(nbytes, x)
67 x = self.tns.run(x, bw, nn_flag, nbytes)
69 (xq, lastnz, x) = self.spec.run(bw, nbytes,
75 def encode(self, pitch_present, nbytes): argument
77 b = bitstream.BitstreamWriter(nbytes)
96 def run(self, x, nbytes): argument
98 pitch_present = self.analyse(x, nbytes)
100 data = self.encode(pitch_present, nbytes)
Dspec_py.c29 int nbytes, nbits_budget, g_off; in estimate_gain_py() local
35 &x_obj, &nbytes, &nbits_budget, &nbits_off, &g_off)) in estimate_gain_py()
49 x, nbytes, nbits_budget, nbits_off, g_off, &reset_off, &g_min); in estimate_gain_py()
99 int nbytes, nq, nbits_budget; in compute_nbits_py() local
104 &nbytes, &x_obj, &nq, &nbits_budget)) in compute_nbits_py()
117 dt, sr, nbytes, x, &nq, nbits_budget, &lsb_mode); in compute_nbits_py()
125 int nbytes, pitch; in analyze_py() local
134 &nbytes, &pitch, &tns_obj, &spec_obj, &x_obj)) in analyze_py()
146 lc3_spec_analyze(dt, sr, nbytes, pitch, &tns, &spec, x, &side); in analyze_py()
Dattdet_py.c27 unsigned dt, sr, nbytes; in attdet_run_py() local
33 &dt, &sr, &nbytes, &attdet_obj, &x_obj)) in attdet_run_py()
44 int att = lc3_attdet_run(dt, sr, nbytes, &attdet, x+6); in attdet_run_py()
Dspec.py36 def get_gain_offset(self, nbytes): argument
41 g_off = (nbytes * 8) // (10 * (1 + sr_ind))
76 def estimate_gain(self, x, nbytes, nbits_spec, nbits_off, g_off): argument
90 bitrate = (8 * nbytes / (dt_ms * 1e-3)).astype(int)
169 def compute_nbits(self, nbytes, x, lastnz, nbits_spec): argument
172 nbytes >= 20 * (3 + min(self.sr, T.SRATE_48K)))]
174 nbytes > 20 * (1 + min(self.sr, T.SRATE_48K)))]
285 def run(self, bw, nbytes, nbits_bw, nbits_ltpf, nbits_sns, nbits_tns, x): argument
297 nbits_ari += 3 + int(hr) + min((8*nbytes - 1) // 1280, 2)
299 nbits_spec = 8*nbytes - \
[all …]
Dltpf_py.c85 int nbytes; in synthesize_py() local
89 &dt, &sr, &nbytes, &ltpf_obj, &data_obj, &x_obj)) in synthesize_py()
94 CTYPES_CHECK("nbytes", nbytes >= 20 && nbytes <= 400); in synthesize_py()
104 lc3_ltpf_synthesize(dt, sr, nbytes, in synthesize_py()
Dsns_py.c29 int nbytes, att; in compute_scale_factors_py() local
33 if (!PyArg_ParseTuple(args, "IIiOp", &dt, &sr, &nbytes, &eb_obj, &att)) in compute_scale_factors_py()
44 compute_scale_factors(dt, sr, nbytes, eb, att, scf); in compute_scale_factors_py()
144 int nbytes, att; in analyze_py() local
148 &dt, &sr, &nbytes, &eb_obj, &att, &x_obj)) in analyze_py()
160 lc3_sns_analyze(dt, sr, nbytes, eb, att, &data, x, x); in analyze_py()
Dtns_py.c118 int nn_flag, nbytes; in analyze_py() local
122 &dt, &bw, &nn_flag, &nbytes, &x_obj)) in analyze_py()
132 lc3_tns_analyze(dt, bw, nn_flag, nbytes, &data, x); in analyze_py()
Dtns.py232 def run(self, x, bw, nn_flag, nbytes): argument
240 self.lpc_weighting = nbytes < 120 * (1 + self.dt) / 8
310 def load(self, b, bw, nbytes): argument
313 self.lpc_weighting = nbytes < 120 * (1 + self.dt) / 8
368 for nbytes in (nbytes_lim, nbytes_lim + 1):
370 y = analysis.run(x, bw, nn_flag, nbytes)
371 (y_c, data_c) = lc3.tns_analyze(dt, bw, nn_flag, nbytes, x)
Dltpf.py332 def run(self, x, nbytes): argument
356 nbits = round(nbytes*8 * 10 / T.DT_MS[dt])
566 nbytes = rng.integers(10*(2+sr), 10*(6+sr))
571 y = synthesis.run(x, nbytes)
572 x_c = lc3.ltpf_synthesize(dt, sr, nbytes, state_c, data_c, x_c)
641 nbytes = NBYTES[i]
646 lc3.ltpf_synthesize(dt, sr, nbytes, state, data, x)
653 y = lc3.ltpf_synthesize(dt, sr, nbytes, state, data, x)[nd:]
Dbitstream.py106 def __init__(self, nbytes): argument
108 super().__init__(bytearray(nbytes))
/liblc3-latest/src/
Dlc3.c145 bool hrmode, int dt_us, int sr_hz, int nbytes) in lc3_hr_resolve_bitrate() argument
150 if (dt >= LC3_NUM_DT || sr >= LC3_NUM_SRATE || nbytes < 0) in lc3_hr_resolve_bitrate()
153 return LC3_MIN(((int64_t)nbytes * 3200 + dt) / (1 + dt), INT_MAX); in lc3_hr_resolve_bitrate()
156 LC3_EXPORT int lc3_resolve_bitrate(int dt_us, int nbytes) in lc3_resolve_bitrate() argument
158 return lc3_hr_resolve_bitrate(false, dt_us, 8000, nbytes); in lc3_resolve_bitrate()
286 int nbytes, struct side_data *side) in analyze() argument
302 bool att = lc3_attdet_run(dt, sr_pcm, nbytes, &encoder->attdet, xt); in analyze()
321 lc3_sns_analyze(dt, sr, nbytes, e, att, &side->sns, xf, xf); in analyze()
323 lc3_tns_analyze(dt, side->bw, nn_flag, nbytes, &side->tns, xf); in analyze()
326 nbytes, side->pitch_present, &side->tns, in analyze()
[all …]
Dspec.c33 static int resolve_gain_offset(enum lc3_srate sr, int nbytes) in resolve_gain_offset() argument
37 int g_off = (nbytes * 8) / (10 * (1 + sr_ind)); in resolve_gain_offset()
84 int nbytes, int nbits_budget, float nbits_off, int g_off, in estimate_gain() argument
102 reg_bits = (8*nbytes * 4) / (125 * (1 + dt)); in estimate_gain()
304 static bool resolve_modes(enum lc3_srate sr, int nbytes, bool *p_lsb_mode) in resolve_modes() argument
309 *p_lsb_mode = (nbytes >= 20 * (3 + sr_ind)) && (sr < LC3_SRATE_96K_HR); in resolve_modes()
311 return (nbytes > 20 * (1 + sr_ind)) && (sr < LC3_SRATE_96K_HR); in resolve_modes()
324 enum lc3_dt dt, enum lc3_srate sr, int nbytes, in compute_nbits() argument
327 bool lsb_mode, high_rate = resolve_modes(sr, nbytes, &lsb_mode); in compute_nbits()
420 enum lc3_dt dt, enum lc3_srate sr, int nbytes, in put_quantized() argument
[all …]
Dspec.h52 enum lc3_dt dt, enum lc3_srate sr, int nbytes,
74 int nbytes, const lc3_spec_side_t *side, float *x);
102 int nbytes, const lc3_spec_side_t *side, float *x);
Dbits.c142 int nbytes = LC3_MIN(accu->n >> 3, in accu_flush() local
145 accu->n -= 8 * nbytes; in accu_flush()
147 for ( ; nbytes; accu->v >>= 8, nbytes--) in accu_flush()
319 int nbytes = LC3_MIN(accu->n >> 3, buffer->p_bw - buffer->start); in accu_load() local
321 accu->n -= 8 * nbytes; in accu_load()
323 for ( ; nbytes; nbytes--) { in accu_load()
Dtns.h51 bool nn_flag, int nbytes, lc3_tns_data_t *data, float *x);
81 enum lc3_dt dt, enum lc3_bandwidth bw, int nbytes, lc3_tns_data_t *data);
Dattdet.c26 int nbytes, struct lc3_attdet_analysis *attdet, const int16_t *x) in lc3_attdet_run() argument
36 nbytes < nbytes_ranges[dt - LC3_DT_7M5][sr - LC3_SRATE_32K][0] || in lc3_attdet_run()
37 nbytes > nbytes_ranges[dt - LC3_DT_7M5][sr - LC3_SRATE_32K][1] ) in lc3_attdet_run()
Dattdet.h34 int nbytes, lc3_attdet_analysis_t *attdet, const int16_t *x);
Dtns.c32 static bool resolve_lpc_weighting(enum lc3_dt dt, int nbytes) in resolve_lpc_weighting() argument
34 return nbytes * 8 < 120 * (int)(1 + dt); in resolve_lpc_weighting()
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()
488 enum lc3_dt dt, enum lc3_bandwidth bw, int nbytes, lc3_tns_data_t *data) in lc3_tns_get_data() argument
491 data->lpc_weighting = resolve_lpc_weighting(dt, nbytes); in lc3_tns_get_data()
Dsns.h55 enum lc3_dt dt, enum lc3_srate sr, int nbytes,
Dltpf.h99 void lc3_ltpf_synthesize(enum lc3_dt dt, enum lc3_srate sr, int nbytes,
/liblc3-latest/include/
Dlc3.h308 bool hrmode, int dt_us, int sr_hz, int nbytes);
310 LC3_EXPORT int lc3_resolve_bitrate(int dt_us, int nbytes);
369 const void *pcm, int stride, int nbytes, void *out);
415 lc3_decoder_t decoder, const void *in, int nbytes,

12