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
52 -1, -1, 2, 6, -1, -1, 2, 6
56 -1, -1, -1, -1, 1, 2, 4, 6, -1, -1, -1, -1, 1, 2, 4, 6
60 -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 2, 2, 4, 5, 6,
61 -1, -1, -1, -1, -1, -1, -1, -1, 1, 1, 1, 2, 2, 4, 5, 6
65 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
66 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 5, 5, 6, 6,
67 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
68 1, 1, 1, 1, 1, 2, 2, 2, 2, 4, 4, 4, 5, 5, 6, 6
72 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
73 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
74 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
75 2, 2, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6,
76 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
77 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
78 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
79 2, 2, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6
96 for (start_pos = 0; start_pos < 64; start_pos++) {
97 unsigned int dest_pos, table_pos;
99 for (table_pos = 0, dest_pos = start_pos;
101 table_pos++, dest_pos += 64) {
102 int put = 0, count, table_value;
105 for (count = 32; count != 0; count >>= 1) {
106 if (start_pos & count)
125 int8_t channel_hint[2];
136 if (samples == 0xffffffff) {
145 if (channel_hint[0] & 0x80) {
146 channel_hint[0] = ~channel_hint[0];
162 for (chan = 0; chan <
channels; chan++) {
163 uint16_t *dest = (uint16_t *)
frame->
data[0] + chan;
164 int step_index = channel_hint[chan];
165 int output = pcm_data[chan];
169 int lookup_size,
lookup, highbit, lowbits;
171 step_index =
av_clip(step_index, 0, 88);
174 highbit = 1 << (lookup_size - 1);
175 lowbits = highbit - 1;
185 int predict_index,
diff;
187 predict_index = (
lookup << (7 - lookup_size)) | (step_index << 6);
188 predict_index =
av_clip(predict_index, 0, 5785);
211 .
name =
"adpcm_vima",
const int16_t ff_adpcm_step_table[89]
This is the step table.
Libavcodec external API header.
audio channel layout utility functions
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
bitstream reader API header.
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
static int get_sbits(GetBitContext *s, int n)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_CH_LAYOUT_MONO
#define AV_CH_LAYOUT_STEREO
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_CHANNEL_CONF
Codec should fill in channel configuration and samplerate instead of container.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
@ AV_SAMPLE_FMT_S16
signed 16 bits
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define FF_ARRAY_ELEMS(a)
main external API structure.
enum AVSampleFormat sample_fmt
audio sample format
int channels
number of audio channels
uint64_t channel_layout
Audio channel layout.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video 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.
This structure stores compressed data.
static av_always_inline int diff(const uint32_t a, const uint32_t b)
static uint16_t predict_table[5786 *2]
static const int8_t index_table5[]
static const uint8_t size_table[]
static const int8_t index_table1[]
static const int8_t index_table4[]
AVCodec ff_adpcm_vima_decoder
static const int8_t index_table6[]
static const int8_t index_table3[]
static av_cold int decode_init(AVCodecContext *avctx)
static const int8_t index_table2[]
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
static const int8_t *const step_index_tables[]
static int predict_table_init