Go to the documentation of this file.
67 const uint8_t *in,
int ch)
99 int buf_size = avpkt->
size;
103 const uint8_t *buf = avpkt->
data;
104 const uint8_t *buf_end = buf + avpkt->
size;
105 int num_blocks, ch,
ret;
106 size_t new_extradata_size;
107 uint8_t *new_extradata;
110 &new_extradata_size);
111 if (new_extradata && new_extradata_size > 0) {
114 new_extradata_size, &header_size,
128 if (!
c->header_parsed && buf_size >= 2 &&
AV_RB16(buf) == 0x8000) {
136 c->header_parsed = 1;
137 if (buf_size < header_size)
140 buf_size -= header_size;
142 if (!
c->header_parsed)
146 num_blocks = buf_size / (
BLOCK_SIZE *
c->channels);
150 if (!num_blocks || buf_size % (
BLOCK_SIZE *
c->channels)) {
151 if (buf_size >= 4 && (
AV_RB16(buf) & 0x8000)) {
166 while (num_blocks--) {
167 for (ch = 0; ch <
c->channels; ch++) {
180 frame->nb_samples = samples_offset;
183 return buf - avpkt->
data;
189 memset(
c->prev, 0,
sizeof(
c->prev));
194 .
p.
name =
"adpcm_adx",
static void adx_decode_flush(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static int adx_decode(ADXContext *c, int16_t *out, int offset, const uint8_t *in, int ch)
Decode 32 samples from 18 bytes.
int nb_channels
Number of channels in this layout.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
AVCodec p
The public AVCodec.
AVChannelLayout ch_layout
Audio channel layout.
static av_always_inline float scale(float x, float s)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const FFCodec ff_adpcm_adx_decoder
#define FF_CODEC_DECODE_CB(func)
static int get_sbits(GetBitContext *s, int n)
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
static av_cold int adx_decode_init(AVCodecContext *avctx)
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
enum AVSampleFormat sample_fmt
audio sample format
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
@ AV_SAMPLE_FMT_S16P
signed 16 bits, planar
#define i(width, name, range_min, range_max)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
uint8_t * av_packet_get_side_data(const AVPacket *pkt, enum AVPacketSideDataType type, size_t *size)
Get side information from packet.
AVSampleFormat
Audio sample formats.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const char * name
Name of the codec implementation.
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
main external API structure.
@ AV_PKT_DATA_NEW_EXTRADATA
The AV_PKT_DATA_NEW_EXTRADATA is used to notify the codec or the format that the extradata buffer was...
Filter the word “frame” indicates either a video frame or a group of audio samples
This structure stores compressed data.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int ff_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, int bufsize, int *header_size, int *coeff)
Decode ADX stream header.
static int adx_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
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