#ifndef __LC3_TABLES_H
#define __LC3_TABLES_H
#include "common.h"
#include "bits.h"
extern const int lc3_ns_2m5[LC3_NUM_SRATE];
extern const int lc3_ne_2m5[LC3_NUM_SRATE];
extern const int lc3_ns_4m [LC3_NUM_SRATE];
static inline int lc3_ns(enum lc3_dt dt, enum lc3_srate sr) {
return lc3_ns_2m5[sr] * (1 + dt);
}
static inline int lc3_ne(enum lc3_dt dt, enum lc3_srate sr) {
return lc3_ne_2m5[sr] * (1 + dt);
}
static inline int lc3_nd(enum lc3_dt dt, enum lc3_srate sr) {
return ( lc3_ns(dt, sr) +
(dt == LC3_DT_7M5 ? lc3_ns_4m[sr] : lc3_ns_2m5[sr]) ) >> 1;
}
static inline int lc3_nh(enum lc3_dt dt, enum lc3_srate sr) {
return sr > LC3_SRATE_48K_HR ? 0 :
(8 + (dt == LC3_DT_7M5)) * lc3_ns_2m5[sr];
}
static inline int lc3_nt(enum lc3_srate sr) {
return lc3_ns_2m5[sr] >> 1;
}
#define LC3_MAX_SRATE_HZ ( LC3_PLUS_HR ? 96000 : 48000 )
#define LC3_MAX_NS ( LC3_NS(10000, LC3_MAX_SRATE_HZ) )
#define LC3_MAX_NE ( LC3_PLUS_HR ? LC3_MAX_NS : LC3_NS(10000, 40000) )
extern const int lc3_frame_bytes_hr_lim
[LC3_NUM_DT][LC3_NUM_SRATE - LC3_SRATE_48K_HR][2];
static inline int lc3_min_frame_bytes(enum lc3_dt dt, enum lc3_srate sr) {
return !lc3_hr(sr) ? LC3_MIN_FRAME_BYTES :
lc3_frame_bytes_hr_lim[dt][sr - LC3_SRATE_48K_HR][0];
}
static inline int lc3_max_frame_bytes(enum lc3_dt dt, enum lc3_srate sr) {
return !lc3_hr(sr) ? LC3_MAX_FRAME_BYTES :
lc3_frame_bytes_hr_lim[dt][sr - LC3_SRATE_48K_HR][1];
}
struct lc3_fft_bf3_twiddles { int n3; const struct lc3_complex (*t)[2]; };
struct lc3_fft_bf2_twiddles { int n2; const struct lc3_complex *t; };
struct lc3_mdct_rot_def { int n4; const struct lc3_complex *w; };
extern const struct lc3_fft_bf3_twiddles *lc3_fft_twiddles_bf3[];
extern const struct lc3_fft_bf2_twiddles *lc3_fft_twiddles_bf2[][3];
extern const struct lc3_mdct_rot_def *lc3_mdct_rot[LC3_NUM_DT][LC3_NUM_SRATE];
extern const float *lc3_mdct_win[LC3_NUM_DT][LC3_NUM_SRATE];
#define LC3_MAX_BANDS 64
extern const int lc3_num_bands[LC3_NUM_DT][LC3_NUM_SRATE];
extern const int *lc3_band_lim[LC3_NUM_DT][LC3_NUM_SRATE];
extern const float lc3_sns_lfcb[32][8];
extern const float lc3_sns_hfcb[32][8];
struct lc3_sns_vq_gains {
int count; const float *v;
};
extern const struct lc3_sns_vq_gains lc3_sns_vq_gains[4];
extern const int32_t lc3_sns_mpvq_offsets[][11];
extern const struct lc3_ac_model lc3_tns_order_models[];
extern const uint16_t lc3_tns_order_bits[][8];
extern const struct lc3_ac_model lc3_tns_coeffs_models[];
extern const uint16_t lc3_tns_coeffs_bits[][17];
extern const float *lc3_ltpf_cnum[LC3_NUM_SRATE][4];
extern const float *lc3_ltpf_cden[LC3_NUM_SRATE][4];
extern const uint8_t lc3_spectrum_lookup[2][2][256][4];
extern const struct lc3_ac_model lc3_spectrum_models[];
extern const uint16_t lc3_spectrum_bits[][17];
#endif