112#define RSHIFT_SIZE(size) \
114static int##size##_t rshift##size(int##size##_t value, int shift) \
116 int##size##_t rounding = (int##size##_t)1 << (shift - 1); \
117 int##size##_t mask = ((int##size##_t)1 << (shift + 1)) - 1; \
118 return ((value + rounding) >> shift) - ((value & mask) == rounding); \
121static int##size##_t rshift##size##_clip24(int##size##_t value, int shift) \
123 return av_clip_intp2(rshift##size(value, shift), 23); \
134 730, -413, -9611, 43626, -121026, 269973, -585547, 2801966,
135 697128, -160481, 27611, 8478, -10043, 3511, 688, -897,
138 -897, 688, 3511, -10043, 8478, 27611, -160481, 697128,
139 2801966, -585547, 269973, -121026, 43626, -9611, -413, 730,
149 1033, -584, -13592, 61697, -171156, 381799, -828088, 3962579,
150 985888, -226954, 39048, 11990, -14203, 4966, 973, -1268,
153 -1268, 973, 4966, -14203, 11990, 39048, -226954, 985888,
154 3962579, -828088, 381799, -171156, 61697, -13592, -584, 1033,
185 return rshift64_clip24(e,
shift);
193 for (subband = 0; subband <
NB_SUBBANDS; subband++)
206 int eighth = *idx == 7;
207 *idx = (*idx + 1) & 7;
ConstTables ff_aptx_quant_tables[2][NB_SUBBANDS]
static av_always_inline void aptx_qmf_filter_signal_push(FilterSignal *signal, int32_t sample)
static const int32_t aptx_qmf_outer_coeffs[NB_FILTERS][FILTER_TAPS]
int ff_aptx_init(AVCodecContext *avctx)
static int aptx_check_parity(Channel channels[NB_CHANNELS], int32_t *idx)
static int32_t aptx_quantized_parity(Channel *channel)
static const int32_t aptx_qmf_inner_coeffs[NB_FILTERS][FILTER_TAPS]
#define RSHIFT_SIZE(size)
static av_always_inline int32_t aptx_qmf_convolution(FilterSignal *signal, const int32_t coeffs[FILTER_TAPS], int shift)
void ff_aptx_invert_quantize_and_prediction(Channel *channel, int hd)
void ff_aptx_generate_dither(Channel *channel)
Libavcodec external API header.
#define i(width, name, range_min, range_max)
channel
Use these values when setting the channel map with ebur128_set_channel().
static int shift(int a, int b)
static volatile sig_atomic_t sig
main external API structure.
Channel channels[NB_CHANNELS]
Quantize quantize[NB_SUBBANDS]
Prediction prediction[NB_SUBBANDS]
InvertQuantize invert_quantize[NB_SUBBANDS]
int32_t dither[NB_SUBBANDS]
const int32_t * invert_quantize_dither_factors
const int32_t * quantize_intervals
const int16_t * quantize_factor_select_offset
const int32_t * quantize_dither_factors
int32_t buffer[2 *FILTER_TAPS]
int32_t quantization_factor
int32_t reconstructed_difference
int32_t reconstructed_differences[48]
int32_t previous_reconstructed_sample
int32_t predicted_difference
FilterSignal inner_filter_signal[NB_FILTERS][NB_FILTERS]
FilterSignal outer_filter_signal[NB_FILTERS]
int32_t quantized_sample_parity_change