FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
interplayacm.c
Go to the documentation of this file.
1 /*
2  * Interplay ACM decoder
3  *
4  * Copyright (c) 2004-2008 Marko Kreen
5  * Copyright (c) 2008 Adam Gashlin
6  * Copyright (c) 2015 Paul B Mahol
7  *
8  * Permission to use, copy, modify, and distribute this software for any
9  * purpose with or without fee is hereby granted, provided that the above
10  * copyright notice and this permission notice appear in all copies.
11  *
12  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19  */
20 
21 #include "libavutil/intreadwrite.h"
22 
23 #define BITSTREAM_READER_LE
24 #include "avcodec.h"
25 #include "get_bits.h"
26 #include "internal.h"
27 
28 static const int8_t map_1bit[] = { -1, +1 };
29 static const int8_t map_2bit_near[] = { -2, -1, +1, +2 };
30 static const int8_t map_2bit_far[] = { -3, -2, +2, +3 };
31 static const int8_t map_3bit[] = { -4, -3, -2, -1, +1, +2, +3, +4 };
32 
33 static int mul_3x3 [3 * 3 * 3];
34 static int mul_3x5 [5 * 5 * 5];
35 static int mul_2x11[11 * 11];
36 
37 typedef struct InterplayACMContext {
43 
44  int level;
45  int rows;
46  int cols;
48  int block_len;
49  int skip;
50 
51  int *block;
52  int *wrapbuf;
53  int *ampbuf;
54  int *midbuf;
56 
58 {
60  int x1, x2, x3;
61 
62  if (avctx->extradata_size < 14)
63  return AVERROR_INVALIDDATA;
64 
65  s->level = AV_RL16(avctx->extradata + 12) & 0xf;
66  s->rows = AV_RL16(avctx->extradata + 12) >> 4;
67  s->cols = 1 << s->level;
68  s->wrapbuf_len = 2 * s->cols - 2;
69  s->block_len = s->rows * s->cols;
70  s->max_framesize = s->block_len;
71 
72  s->block = av_calloc(s->block_len, sizeof(int));
73  s->wrapbuf = av_calloc(s->wrapbuf_len, sizeof(int));
74  s->ampbuf = av_calloc(0x10000, sizeof(int));
75  s->bitstream = av_calloc(s->max_framesize, sizeof(*s->bitstream));
76  if (!s->block || !s->wrapbuf || !s->ampbuf || !s->bitstream)
77  return AVERROR(ENOMEM);
78 
79  s->midbuf = s->ampbuf + 0x8000;
81 
82  for (x3 = 0; x3 < 3; x3++)
83  for (x2 = 0; x2 < 3; x2++)
84  for (x1 = 0; x1 < 3; x1++)
85  mul_3x3[x1 + x2 * 3 + x3* 3 * 3] = x1 + (x2 << 4) + (x3 << 8);
86  for (x3 = 0; x3 < 5; x3++)
87  for (x2 = 0; x2 < 5; x2++)
88  for (x1 = 0; x1 < 5; x1++)
89  mul_3x5[x1 + x2 * 5 + x3 * 5 * 5] = x1 + (x2 << 4) + (x3 << 8);
90  for (x2 = 0; x2 < 11; x2++)
91  for (x1 = 0; x1 < 11; x1++)
92  mul_2x11[x1 + x2 * 11] = x1 + (x2 << 4);
93 
94  return 0;
95 }
96 
97 #define set_pos(s, r, c, idx) do { \
98  unsigned pos = ((r) << s->level) + (c); \
99  s->block[pos] = s->midbuf[(idx)]; \
100  } while (0)
101 
102 static int zero(InterplayACMContext *s, unsigned ind, unsigned col)
103 {
104  unsigned i;
105 
106  for (i = 0; i < s->rows; i++)
107  set_pos(s, i, col, 0);
108  return 0;
109 }
110 
111 static int bad(InterplayACMContext *s, unsigned ind, unsigned col)
112 {
113  return AVERROR_INVALIDDATA;
114 }
115 
116 static int linear(InterplayACMContext *s, unsigned ind, unsigned col)
117 {
118  GetBitContext *gb = &s->gb;
119  unsigned int i;
120  int b, middle = 1 << (ind - 1);
121 
122  for (i = 0; i < s->rows; i++) {
123  b = get_bits(gb, ind);
124  set_pos(s, i, col, b - middle);
125  }
126  return 0;
127 }
128 
129 static int k13(InterplayACMContext *s, unsigned ind, unsigned col)
130 {
131  GetBitContext *gb = &s->gb;
132  unsigned i, b;
133 
134  for (i = 0; i < s->rows; i++) {
135  b = get_bits1(gb);
136  if (b == 0) {
137  set_pos(s, i++, col, 0);
138  if (i >= s->rows)
139  break;
140  set_pos(s, i, col, 0);
141  continue;
142  }
143  b = get_bits1(gb);
144  if (b == 0) {
145  set_pos(s, i, col, 0);
146  continue;
147  }
148  b = get_bits1(gb);
149  set_pos(s, i, col, map_1bit[b]);
150  }
151  return 0;
152 }
153 
154 static int k12(InterplayACMContext *s, unsigned ind, unsigned col)
155 {
156  GetBitContext *gb = &s->gb;
157  unsigned i, b;
158 
159  for (i = 0; i < s->rows; i++) {
160  b = get_bits1(gb);
161  if (b == 0) {
162  set_pos(s, i, col, 0);
163  continue;
164  }
165 
166  b = get_bits1(gb);
167  set_pos(s, i, col, map_1bit[b]);
168  }
169  return 0;
170 }
171 
172 static int k24(InterplayACMContext *s, unsigned ind, unsigned col)
173 {
174  GetBitContext *gb = &s->gb;
175  unsigned i, b;
176 
177  for (i = 0; i < s->rows; i++) {
178  b = get_bits1(gb);
179  if (b == 0) {
180  set_pos(s, i++, col, 0);
181  if (i >= s->rows) break;
182  set_pos(s, i, col, 0);
183  continue;
184  }
185 
186  b = get_bits1(gb);
187  if (b == 0) {
188  set_pos(s, i, col, 0);
189  continue;
190  }
191 
192  b = get_bits(gb, 2);
193  set_pos(s, i, col, map_2bit_near[b]);
194  }
195  return 0;
196 }
197 
198 static int k23(InterplayACMContext *s, unsigned ind, unsigned col)
199 {
200  GetBitContext *gb = &s->gb;
201  unsigned i, b;
202 
203  for (i = 0; i < s->rows; i++) {
204  b = get_bits1(gb);
205  if (b == 0) {
206  set_pos(s, i, col, 0);
207  continue;
208  }
209 
210  b = get_bits(gb, 2);
211  set_pos(s, i, col, map_2bit_near[b]);
212  }
213  return 0;
214 }
215 
216 static int k35(InterplayACMContext *s, unsigned ind, unsigned col)
217 {
218  GetBitContext *gb = &s->gb;
219  unsigned i, b;
220 
221  for (i = 0; i < s->rows; i++) {
222  b = get_bits1(gb);
223  if (b == 0) {
224  set_pos(s, i++, col, 0);
225  if (i >= s->rows)
226  break;
227  set_pos(s, i, col, 0);
228  continue;
229  }
230 
231  b = get_bits1(gb);
232  if (b == 0) {
233  set_pos(s, i, col, 0);
234  continue;
235  }
236 
237  b = get_bits1(gb);
238  if (b == 0) {
239  b = get_bits1(gb);
240  set_pos(s, i, col, map_1bit[b]);
241  continue;
242  }
243 
244  b = get_bits(gb, 2);
245  set_pos(s, i, col, map_2bit_far[b]);
246  }
247  return 0;
248 }
249 
250 static int k34(InterplayACMContext *s, unsigned ind, unsigned col)
251 {
252  GetBitContext *gb = &s->gb;
253  unsigned i, b;
254 
255  for (i = 0; i < s->rows; i++) {
256  b = get_bits1(gb);
257  if (b == 0) {
258  set_pos(s, i, col, 0);
259  continue;
260  }
261 
262  b = get_bits1(gb);
263  if (b == 0) {
264  b = get_bits1(gb);
265  set_pos(s, i, col, map_1bit[b]);
266  continue;
267  }
268 
269  b = get_bits(gb, 2);
270  set_pos(s, i, col, map_2bit_far[b]);
271  }
272  return 0;
273 }
274 
275 static int k45(InterplayACMContext *s, unsigned ind, unsigned col)
276 {
277  GetBitContext *gb = &s->gb;
278  unsigned i, b;
279 
280  for (i = 0; i < s->rows; i++) {
281  b = get_bits1(gb);
282  if (b == 0) {
283  set_pos(s, i, col, 0); i++;
284  if (i >= s->rows)
285  break;
286  set_pos(s, i, col, 0);
287  continue;
288  }
289 
290  b = get_bits1(gb);
291  if (b == 0) {
292  set_pos(s, i, col, 0);
293  continue;
294  }
295 
296  b = get_bits(gb, 3);
297  set_pos(s, i, col, map_3bit[b]);
298  }
299  return 0;
300 }
301 
302 static int k44(InterplayACMContext *s, unsigned ind, unsigned col)
303 {
304  GetBitContext *gb = &s->gb;
305  unsigned i, b;
306 
307  for (i = 0; i < s->rows; i++) {
308  b = get_bits1(gb);
309  if (b == 0) {
310  set_pos(s, i, col, 0);
311  continue;
312  }
313 
314  b = get_bits(gb, 3);
315  set_pos(s, i, col, map_3bit[b]);
316  }
317  return 0;
318 }
319 
320 static int t15(InterplayACMContext *s, unsigned ind, unsigned col)
321 {
322  GetBitContext *gb = &s->gb;
323  unsigned i, b;
324  int n1, n2, n3;
325 
326  for (i = 0; i < s->rows; i++) {
327  /* b = (x1) + (x2 * 3) + (x3 * 9) */
328  b = get_bits(gb, 5);
329 
330  n1 = (mul_3x3[b] & 0x0F) - 1;
331  n2 = ((mul_3x3[b] >> 4) & 0x0F) - 1;
332  n3 = ((mul_3x3[b] >> 8) & 0x0F) - 1;
333 
334  set_pos(s, i++, col, n1);
335  if (i >= s->rows)
336  break;
337  set_pos(s, i++, col, n2);
338  if (i >= s->rows)
339  break;
340  set_pos(s, i, col, n3);
341  }
342  return 0;
343 }
344 
345 static int t27(InterplayACMContext *s, unsigned ind, unsigned col)
346 {
347  GetBitContext *gb = &s->gb;
348  unsigned i, b;
349  int n1, n2, n3;
350 
351  for (i = 0; i < s->rows; i++) {
352  /* b = (x1) + (x2 * 5) + (x3 * 25) */
353  b = get_bits(gb, 7);
354 
355  n1 = (mul_3x5[b] & 0x0F) - 2;
356  n2 = ((mul_3x5[b] >> 4) & 0x0F) - 2;
357  n3 = ((mul_3x5[b] >> 8) & 0x0F) - 2;
358 
359  set_pos(s, i++, col, n1);
360  if (i >= s->rows)
361  break;
362  set_pos(s, i++, col, n2);
363  if (i >= s->rows)
364  break;
365  set_pos(s, i, col, n3);
366  }
367  return 0;
368 }
369 
370 static int t37(InterplayACMContext *s, unsigned ind, unsigned col)
371 {
372  GetBitContext *gb = &s->gb;
373  unsigned i, b;
374  int n1, n2;
375  for (i = 0; i < s->rows; i++) {
376  /* b = (x1) + (x2 * 11) */
377  b = get_bits(gb, 7);
378 
379  n1 = (mul_2x11[b] & 0x0F) - 5;
380  n2 = ((mul_2x11[b] >> 4) & 0x0F) - 5;
381 
382  set_pos(s, i++, col, n1);
383  if (i >= s->rows)
384  break;
385  set_pos(s, i, col, n2);
386  }
387  return 0;
388 }
389 
390 typedef int (*filler)(InterplayACMContext *s, unsigned ind, unsigned col);
391 
392 static const filler filler_list[] = {
393  zero, bad, bad, linear,
397  linear, k13, k12, t15,
398  k24, k23, t27, k35,
399  k34, bad, k45, k44,
400  bad, t37, bad, bad,
401 };
402 
404 {
405  GetBitContext *gb = &s->gb;
406  unsigned i, ind;
407  int ret;
408 
409  for (i = 0; i < s->cols; i++) {
410  ind = get_bits(gb, 5);
411  ret = filler_list[ind](s, ind, i);
412  if (ret < 0)
413  return ret;
414  }
415  return 0;
416 }
417 
418 static void juggle(int *wrap_p, int *block_p, unsigned sub_len, unsigned sub_count)
419 {
420  unsigned i, j;
421  int *p, r0, r1, r2, r3;
422 
423  for (i = 0; i < sub_len; i++) {
424  p = block_p;
425  r0 = wrap_p[0];
426  r1 = wrap_p[1];
427  for (j = 0; j < sub_count/2; j++) {
428  r2 = *p;
429  *p = r1 * 2 + (r0 + r2);
430  p += sub_len;
431  r3 = *p;
432  *p = r2 * 2 - (r1 + r3);
433  p += sub_len;
434  r0 = r2;
435  r1 = r3;
436  }
437 
438  *wrap_p++ = r0;
439  *wrap_p++ = r1;
440  block_p++;
441  }
442 }
443 
445 {
446  unsigned sub_count, sub_len, todo_count, step_subcount, i;
447  int *wrap_p, *block_p, *p;
448 
449  /* juggle only if subblock_len > 1 */
450  if (s->level == 0)
451  return;
452 
453  /* 2048 / subblock_len */
454  if (s->level > 9)
455  step_subcount = 1;
456  else
457  step_subcount = (2048 >> s->level) - 2;
458 
459  /* Apply juggle() (rows)x(cols)
460  * from (step_subcount * 2) x (subblock_len/2)
461  * to (step_subcount * subblock_len) x (1)
462  */
463  todo_count = s->rows;
464  block_p = s->block;
465  while (1) {
466  wrap_p = s->wrapbuf;
467  sub_count = step_subcount;
468  if (sub_count > todo_count)
469  sub_count = todo_count;
470 
471  sub_len = s->cols / 2;
472  sub_count *= 2;
473 
474  juggle(wrap_p, block_p, sub_len, sub_count);
475  wrap_p += sub_len * 2;
476 
477  for (i = 0, p = block_p; i < sub_count; i++) {
478  p[0]++;
479  p += sub_len;
480  }
481 
482  while (sub_len > 1) {
483  sub_len /= 2;
484  sub_count *= 2;
485  juggle(wrap_p, block_p, sub_len, sub_count);
486  wrap_p += sub_len * 2;
487  }
488 
489  if (todo_count <= step_subcount)
490  break;
491 
492  todo_count -= step_subcount;
493  block_p += step_subcount << s->level;
494  }
495 }
496 
498 {
499  GetBitContext *gb = &s->gb;
500  int pwr, count, val, i, x, ret;
501 
502  pwr = get_bits(gb, 4);
503  val = get_bits(gb, 16);
504 
505  count = 1 << pwr;
506 
507  for (i = 0, x = 0; i < count; i++) {
508  s->midbuf[i] = x;
509  x += val;
510  }
511 
512  for (i = 1, x = -val; i <= count; i++) {
513  s->midbuf[-i] = x;
514  x -= val;
515  }
516 
517  ret = fill_block(s);
518  if (ret < 0)
519  return ret;
520 
521  juggle_block(s);
522 
523  return 0;
524 }
525 
526 static int decode_frame(AVCodecContext *avctx, void *data,
527  int *got_frame_ptr, AVPacket *pkt)
528 {
529  InterplayACMContext *s = avctx->priv_data;
530  GetBitContext *gb = &s->gb;
531  AVFrame *frame = data;
532  const uint8_t *buf;
533  int16_t *samples;
534  int ret, n, buf_size, input_buf_size;
535 
536  if (!pkt->size && !s->bitstream_size) {
537  *got_frame_ptr = 0;
538  return 0;
539  }
540 
541  buf_size = FFMIN(pkt->size, s->max_framesize - s->bitstream_size);
542  input_buf_size = buf_size;
543  if (s->bitstream_index + s->bitstream_size + buf_size > s->max_framesize) {
544  memmove(s->bitstream, &s->bitstream[s->bitstream_index], s->bitstream_size);
545  s->bitstream_index = 0;
546  }
547  if (pkt->data)
548  memcpy(&s->bitstream[s->bitstream_index + s->bitstream_size], pkt->data, buf_size);
549  buf = &s->bitstream[s->bitstream_index];
550  buf_size += s->bitstream_size;
551  s->bitstream_size = buf_size;
552  if (buf_size < s->max_framesize && pkt->data) {
553  *got_frame_ptr = 0;
554  return input_buf_size;
555  }
556 
557  if ((ret = init_get_bits8(gb, buf, buf_size)) < 0)
558  return ret;
559 
560  frame->nb_samples = s->block_len / avctx->channels;
561  if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
562  return ret;
563 
564  skip_bits(gb, s->skip);
565  ret = decode_block(s);
566  if (ret < 0)
567  return ret;
568 
569  samples = (int16_t *)frame->data[0];
570  for (n = 0; n < frame->nb_samples * avctx->channels; n++) {
571  int val = s->block[n] >> s->level;
572  *samples++ = val;
573  }
574 
575  *got_frame_ptr = 1;
576  s->skip = get_bits_count(gb) - 8 * (get_bits_count(gb) / 8);
577  n = get_bits_count(gb) / 8;
578 
579  if (n > buf_size && pkt->data) {
580  s->bitstream_size = 0;
581  s->bitstream_index = 0;
582  return AVERROR_INVALIDDATA;
583  }
584 
585  if (s->bitstream_size) {
586  s->bitstream_index += n;
587  s->bitstream_size -= n;
588  return input_buf_size;
589  }
590  return n;
591 }
592 
594 {
595  InterplayACMContext *s = avctx->priv_data;
596 
597  av_freep(&s->block);
598  av_freep(&s->wrapbuf);
599  av_freep(&s->ampbuf);
600  av_freep(&s->bitstream);
601  s->bitstream_size = 0;
602 
603  return 0;
604 }
605 
607  .name = "interplayacm",
608  .long_name = NULL_IF_CONFIG_SMALL("Interplay ACM"),
609  .type = AVMEDIA_TYPE_AUDIO,
611  .init = decode_init,
612  .close = decode_close,
613  .decode = decode_frame,
614  .capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_DR1,
615  .priv_data_size = sizeof(InterplayACMContext),
616 };
const char const char void * val
Definition: avisynth_c.h:771
const char * s
Definition: avisynth_c.h:768
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
This structure describes decoded (raw) audio or video data.
Definition: frame.h:184
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
static const int8_t map_2bit_far[]
Definition: interplayacm.c:30
static int linear(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:116
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:247
static int k24(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:172
int size
Definition: avcodec.h:1602
const char * b
Definition: vf_curves.c:113
static int mul_3x5[5 *5 *5]
Definition: interplayacm.c:34
static AVPacket pkt
AVCodec.
Definition: avcodec.h:3600
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:87
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame_ptr, AVPacket *pkt)
Definition: interplayacm.c:526
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
Definition: mem.c:260
static int decode_block(InterplayACMContext *s)
Definition: interplayacm.c:497
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:984
enum AVSampleFormat sample_fmt
audio sample format
Definition: avcodec.h:2446
uint8_t
#define av_cold
Definition: attributes.h:82
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
Definition: avcodec.h:1791
static AVFrame * frame
static int k35(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:216
uint8_t * data
Definition: avcodec.h:1601
static int get_bits_count(const GetBitContext *s)
Definition: get_bits.h:199
static const int8_t map_2bit_near[]
Definition: interplayacm.c:29
bitstream reader API header.
static int mul_2x11[11 *11]
Definition: interplayacm.c:35
AVCodec ff_interplay_acm_decoder
Definition: interplayacm.c:606
static int t15(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:320
static int k44(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:302
#define AVERROR(e)
Definition: error.h:43
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
static av_cold int decode_close(AVCodecContext *avctx)
Definition: interplayacm.c:593
static int t27(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:345
const char * name
Name of the codec implementation.
Definition: avcodec.h:3607
GLsizei count
Definition: opengl_enc.c:109
#define set_pos(s, r, c, idx)
Definition: interplayacm.c:97
static int k34(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:250
#define FFMIN(a, b)
Definition: common.h:96
int(* filler)(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:390
int n
Definition: avisynth_c.h:684
static int zero(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:102
GetBitContext gb
Definition: interplayacm.c:38
static int fill_block(InterplayACMContext *s)
Definition: interplayacm.c:403
static void juggle_block(InterplayACMContext *s)
Definition: interplayacm.c:444
static av_cold int decode_init(AVCodecContext *avctx)
Definition: interplayacm.c:57
static int k12(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:154
Libavcodec external API header.
static int k13(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:129
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:437
main external API structure.
Definition: avcodec.h:1676
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: utils.c:947
static const filler filler_list[]
Definition: interplayacm.c:392
void * buf
Definition: avisynth_c.h:690
int extradata_size
Definition: avcodec.h:1792
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:299
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:292
static int t37(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:370
static void juggle(int *wrap_p, int *block_p, unsigned sub_len, unsigned sub_count)
Definition: interplayacm.c:418
static const int8_t map_3bit[]
Definition: interplayacm.c:31
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:198
static int mul_3x3[3 *3 *3]
Definition: interplayacm.c:33
common internal api header.
signed 16 bits
Definition: samplefmt.h:61
static int k23(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:198
void * priv_data
Definition: avcodec.h:1718
static const int8_t map_1bit[]
Definition: interplayacm.c:28
int channels
number of audio channels
Definition: avcodec.h:2439
#define av_freep(p)
static int bad(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:111
This structure stores compressed data.
Definition: avcodec.h:1578
int nb_samples
number of audio samples (per channel) described by this frame
Definition: frame.h:241
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:959
static int k45(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:275
for(j=16;j >0;--j)