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