28 #include "libavutil/channel_layout.h"
39 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
40 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
41 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
42 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
43 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
44 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
54 -1, -1, 2, 6, -1, -1, 2, 6
59 -1, -1, -1, -1, 1, 2, 4, 6,
60 -1, -1, -1, -1, 1, 2, 4, 6
65 -1, -1, -1, -1, -1, -1, -1, -1,
66 1, 1, 1, 2, 2, 4, 5, 6,
67 -1, -1, -1, -1, -1, -1, -1, -1,
68 1, 1, 1, 2, 2, 4, 5, 6
73 -1, -1, -1, -1, -1, -1, -1, -1,
74 -1, -1, -1, -1, -1, -1, -1, -1,
75 1, 1, 1, 1, 1, 2, 2, 2,
76 2, 4, 4, 4, 5, 5, 6, 6,
77 -1, -1, -1, -1, -1, -1, -1, -1,
78 -1, -1, -1, -1, -1, -1, -1, -1,
79 1, 1, 1, 1, 1, 2, 2, 2,
80 2, 4, 4, 4, 5, 5, 6, 6
85 -1, -1, -1, -1, -1, -1, -1, -1,
86 -1, -1, -1, -1, -1, -1, -1, -1,
87 -1, -1, -1, -1, -1, -1, -1, -1,
88 -1, -1, -1, -1, -1, -1, -1, -1,
89 1, 1, 1, 1, 1, 1, 1, 1,
90 1, 1, 2, 2, 2, 2, 2, 2,
91 2, 2, 4, 4, 4, 4, 4, 4,
92 5, 5, 5, 5, 6, 6, 6, 6,
93 -1, -1, -1, -1, -1, -1, -1, -1,
94 -1, -1, -1, -1, -1, -1, -1, -1,
95 -1, -1, -1, -1, -1, -1, -1, -1,
96 -1, -1, -1, -1, -1, -1, -1, -1,
97 1, 1, 1, 1, 1, 1, 1, 1,
98 1, 1, 2, 2, 2, 2, 2, 2,
99 2, 2, 4, 4, 4, 4, 4, 4,
100 5, 5, 5, 5, 6, 6, 6, 6
118 for (start_pos = 0; start_pos < 64; start_pos++) {
119 unsigned int dest_pos, table_pos;
121 for (table_pos = 0, dest_pos = start_pos;
123 table_pos++, dest_pos += 64) {
124 int put = 0,
count, table_value;
128 if (start_pos &
count)
147 int8_t channel_hint[2];
148 int ret, chan, channels = 1;
157 if (samples == 0xffffffff) {
162 if (samples > pkt->
size * 2)
166 if (channel_hint[0] & 0x80) {
167 channel_hint[0] = ~channel_hint[0];
183 for (chan = 0; chan < channels; chan++) {
184 uint16_t *dest = (uint16_t*)frame->
data[0] + chan;
185 int step_index = channel_hint[chan];
186 int output = pcm_data[chan];
190 int lookup_size,
lookup, highbit, lowbits;
192 step_index = av_clip(step_index, 0, 88);
194 lookup =
get_bits(&gb, lookup_size);
195 highbit = 1 << (lookup_size - 1);
196 lowbits = highbit - 1;
198 if (lookup & highbit)
203 if (lookup == lowbits) {
206 int predict_index, diff;
208 predict_index = (lookup << (7 - lookup_size)) | (step_index << 6);
209 predict_index = av_clip(predict_index, 0, 5785);
216 output = av_clip_int16(output + diff);
This structure describes decoded (raw) audio or video data.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static void skip_bits_long(GetBitContext *s, int n)
static const int8_t *const step_index_tables[]
static const int8_t index_table3[]
#define AV_CH_LAYOUT_STEREO
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
static int predict_table_init
static int get_sbits(GetBitContext *s, int n)
enum AVSampleFormat sample_fmt
audio sample format
const char * name
Name of the codec implementation.
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
bitstream reader API header.
static const int8_t index_table2[]
static const uint8_t size_table[]
static const int8_t index_table6[]
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
const int16_t ff_adpcm_step_table[89]
This is the step table.
Libavcodec external API header.
uint64_t channel_layout
Audio channel layout.
#define FF_ARRAY_ELEMS(a)
static const int8_t index_table4[]
static const int8_t index_table5[]
static av_cold int decode_init(AVCodecContext *avctx)
static const int8_t index_table1[]
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
common internal api header.
#define AVERROR_INVALIDDATA
int channels
number of audio channels
static uint16_t predict_table[5786 *2]
#define AV_CH_LAYOUT_MONO
This structure stores compressed data.
int nb_samples
number of audio samples (per channel) described by this frame
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.