41 subbands[0] = low_subband_input + high_subband_input;
42 subbands[1] = low_subband_input - high_subband_input;
59 int32_t intermediate_samples[4];
63 for (i = 0; i < 2; i++)
66 subband_samples[2*i+0],
67 subband_samples[2*i+1],
68 &intermediate_samples[2*i]);
71 for (i = 0; i < 2; i++)
74 intermediate_samples[0+i],
75 intermediate_samples[2+i],
115 for (channel = 0; channel <
NB_CHANNELS; channel++) {
129 for (channel = 0; channel <
NB_CHANNELS; channel++)
136 int *got_frame_ptr,
AVPacket *avpkt)
162 for (channel = 0; channel <
NB_CHANNELS; channel++)
163 for (sample = 0; sample < 4; sample++)
165 samples[channel][sample] * 256);
172 #if CONFIG_APTX_DECODER 189 #if CONFIG_APTX_HD_DECODER Prediction prediction[NB_SUBBANDS]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int shift(int a, int b)
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
static av_cold int init(AVCodecContext *avctx)
static av_always_inline int32_t aptx_qmf_convolution(FilterSignal *signal, const int32_t coeffs[FILTER_TAPS], int shift)
#define AV_CH_LAYOUT_STEREO
void ff_aptx_invert_quantize_and_prediction(Channel *channel, int hd)
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_WB24 unsigned int_TMPL AV_RB16
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static void aptx_decode_channel(Channel *channel, int32_t samples[4])
static av_always_inline void aptx_qmf_filter_signal_push(FilterSignal *signal, int32_t sample)
static int32_t aptx_quantized_parity(Channel *channel)
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static void aptx_qmf_tree_synthesis(QMFAnalysis *qmf, int32_t subband_samples[4], int32_t samples[4])
Quantize quantize[NB_SUBBANDS]
static const int32_t aptx_qmf_inner_coeffs[NB_FILTERS][FILTER_TAPS]
static const int32_t aptx_qmf_outer_coeffs[NB_FILTERS][FILTER_TAPS]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
AVCodec ff_aptx_hd_decoder
void ff_aptx_generate_dither(Channel *channel)
FilterSignal inner_filter_signal[NB_FILTERS][NB_FILTERS]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const char * name
Name of the codec implementation.
int channels
number of audio channels, only used for audio.
av_cold int ff_aptx_init(AVCodecContext *avctx)
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
int32_t previous_reconstructed_sample
Channel channels[NB_CHANNELS]
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames...
static void aptx_unpack_codeword(Channel *channel, uint16_t codeword)
AVSampleFormat
Audio sample formats.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static void aptxhd_unpack_codeword(Channel *channel, uint32_t codeword)
static const uint16_t channel_layouts[7]
static int aptx_check_parity(Channel channels[NB_CHANNELS], int32_t *idx)
static int aptx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some input
static av_const int sign_extend(int val, unsigned bits)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
FilterSignal outer_filter_signal[NB_FILTERS]
channel
Use these values when setting the channel map with ebur128_set_channel().
static av_always_inline void aptx_qmf_polyphase_synthesis(FilterSignal signal[NB_FILTERS], const int32_t coeffs[NB_FILTERS][FILTER_TAPS], int shift, int32_t low_subband_input, int32_t high_subband_input, int32_t samples[NB_FILTERS])
static int aptx_decode_samples(AptXContext *ctx, const uint8_t *input, int32_t samples[NB_CHANNELS][4])
Filter the word “frame” indicates either a video frame or a group of audio samples
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.