89 s1 = av_clip_int16(s0);
101 int buf_size = avpkt->
size;
106 int num_blocks, ch, ret;
122 if (buf_size < header_size)
125 buf_size -= header_size;
136 if (buf_size >= 4 && (
AV_RB16(buf) & 0x8000)) {
153 while (num_blocks--) {
154 for (ch = 0; ch < c->
channels; ch++) {
155 if (
adx_decode(c, samples[ch], samples_offset, buf, ch)) {
169 return buf - avpkt->
data;
175 memset(c->
prev, 0,
sizeof(c->
prev));
This structure describes decoded (raw) audio or video data.
static av_cold int adx_decode_init(AVCodecContext *avctx)
AVFrame * coded_frame
the picture in the bitstream
static int get_sbits(GetBitContext *s, int n)
struct ADXContext ADXContext
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
enum AVSampleFormat sample_fmt
audio sample format
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
bitstream reader API header.
static int init(AVCodecParserContext *s)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
void av_log(void *avcl, int level, const char *fmt,...)
const char * name
Name of the codec implementation.
static void adx_decode_flush(AVCodecContext *avctx)
static int adx_decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *avpkt)
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame)
Get a buffer for a frame.
static int adx_decode(ADXContext *c, int16_t *out, int offset, const uint8_t *in, int ch)
Decode 32 samples from 18 bytes.
main external API structure.
void avcodec_get_frame_defaults(AVFrame *frame)
Set the fields of the given AVFrame to default values.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static const uint16_t scale[4]
int avpriv_adx_decode_header(AVCodecContext *avctx, const uint8_t *buf, int bufsize, int *header_size, int *coeff)
Decode ADX stream header.
common internal api header.
static av_cold void flush(AVCodecContext *avctx)
Flush (reset) the frame ID after seeking.
#define AVERROR_INVALIDDATA
AVCodec ff_adpcm_adx_decoder
AVSampleFormat
Audio Sample Formats.
int channels
number of audio channels
uint8_t ** extended_data
pointers to the data planes/channels.
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame