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;
106 if (start_pos &
count)
125 int8_t channel_hint[2];
136 if (samples == 0xffffffff) {
141 if (samples > pkt->
size * 2)
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);
173 lookup =
get_bits(&gb, lookup_size);
174 highbit = 1 << (lookup_size - 1);
175 lowbits = highbit - 1;
177 if (lookup & highbit)
182 if (lookup == lowbits) {
185 int predict_index, diff;
187 predict_index = (lookup << (7 - lookup_size)) | (step_index << 6);
188 predict_index = av_clip(predict_index, 0, 5785);
195 output = av_clip_int16(output + diff);
211 .
name =
"adpcm_vima",