Libav
pafvideo.c
Go to the documentation of this file.
1 /*
2  * Packed Animation File video decoder
3  * Copyright (c) 2012 Paul B Mahol
4  *
5  * This file is part of Libav.
6  *
7  * Libav is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * Libav is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with Libav; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/imgutils.h"
23 
24 #include "avcodec.h"
25 #include "bytestream.h"
26 #include "copy_block.h"
27 #include "internal.h"
28 
29 static const uint8_t block_sequences[16][8] = {
30  { 0, 0, 0, 0, 0, 0, 0, 0 }, { 2, 0, 0, 0, 0, 0, 0, 0 },
31  { 5, 7, 0, 0, 0, 0, 0, 0 }, { 5, 0, 0, 0, 0, 0, 0, 0 },
32  { 6, 0, 0, 0, 0, 0, 0, 0 }, { 5, 7, 5, 7, 0, 0, 0, 0 },
33  { 5, 7, 5, 0, 0, 0, 0, 0 }, { 5, 7, 6, 0, 0, 0, 0, 0 },
34  { 5, 5, 0, 0, 0, 0, 0, 0 }, { 3, 0, 0, 0, 0, 0, 0, 0 },
35  { 6, 6, 0, 0, 0, 0, 0, 0 }, { 2, 4, 0, 0, 0, 0, 0, 0 },
36  { 2, 4, 5, 7, 0, 0, 0, 0 }, { 2, 4, 5, 0, 0, 0, 0, 0 },
37  { 2, 4, 6, 0, 0, 0, 0, 0 }, { 2, 4, 5, 7, 5, 7, 0, 0 },
38 };
39 
40 typedef struct PAFVideoDecContext {
43 
44  int width;
45  int height;
46 
51 
54 
56 {
57  PAFVideoDecContext *c = avctx->priv_data;
58  int i;
59 
60  av_frame_free(&c->pic);
61 
62  for (i = 0; i < 4; i++)
63  av_freep(&c->frame[i]);
64 
65  return 0;
66 }
67 
69 {
70  PAFVideoDecContext *c = avctx->priv_data;
71  int i;
72 
73  c->width = avctx->width;
74  c->height = avctx->height;
75 
76  if (avctx->height & 3 || avctx->width & 3) {
77  av_log(avctx, AV_LOG_ERROR,
78  "width %d and height %d must be multiplie of 4.\n",
79  avctx->width, avctx->height);
80  return AVERROR_INVALIDDATA;
81  }
82 
83  avctx->pix_fmt = AV_PIX_FMT_PAL8;
84 
85  c->pic = av_frame_alloc();
86  if (!c->pic)
87  return AVERROR(ENOMEM);
88 
89  c->frame_size = avctx->width * FFALIGN(avctx->height, 256);
90  c->video_size = avctx->width * avctx->height;
91  for (i = 0; i < 4; i++) {
92  c->frame[i] = av_mallocz(c->frame_size);
93  if (!c->frame[i]) {
94  paf_video_close(avctx);
95  return AVERROR(ENOMEM);
96  }
97  }
98 
99  return 0;
100 }
101 
102 static void read4x4block(PAFVideoDecContext *c, uint8_t *dst, int width)
103 {
104  int i;
105 
106  for (i = 0; i < 4; i++) {
107  bytestream2_get_buffer(&c->gb, dst, 4);
108  dst += width;
109  }
110 }
111 
113 {
114  int i;
115 
116  for (i = 0; i < 4; i++) {
117  if (mask & (1 << 7 - i))
118  dst[i] = color;
119  if (mask & (1 << 3 - i))
120  dst[width + i] = color;
121  }
122 }
123 
124 static void copy_src_mask(uint8_t *dst, int width, uint8_t mask, const uint8_t *src)
125 {
126  int i;
127 
128  for (i = 0; i < 4; i++) {
129  if (mask & (1 << 7 - i))
130  dst[i] = src[i];
131  if (mask & (1 << 3 - i))
132  dst[width + i] = src[width + i];
133  }
134 }
135 
137  const uint8_t **p,
138  const uint8_t **pend)
139 {
140  int val = bytestream2_get_be16(&c->gb);
141  int page = val >> 14;
142  int x = (val & 0x7F);
143  int y = ((val >> 7) & 0x7F);
144 
145  *p = c->frame[page] + x * 2 + y * 2 * c->width;
146  *pend = c->frame[page] + c->frame_size;
147 }
148 
149 static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
150 {
151  uint32_t opcode_size, offset;
152  uint8_t *dst, *dend, mask = 0, color = 0;
153  const uint8_t *src, *send, *opcodes;
154  int i, j, op = 0;
155 
156  i = bytestream2_get_byte(&c->gb);
157  if (i) {
158  if (code & 0x10) {
159  int pos = bytestream2_tell(&c->gb) & 3;
160  if (pos)
161  bytestream2_skip(&c->gb, 4 - pos);
162  }
163  do {
164  int page, val, x, y;
165  val = bytestream2_get_be16(&c->gb);
166  page = val >> 14;
167  x = (val & 0x7F) * 2;
168  y = ((val >> 7) & 0x7F) * 2;
169  dst = c->frame[page] + x + y * c->width;
170  dend = c->frame[page] + c->frame_size;
171  offset = (x & 0x7F) * 2;
172  j = bytestream2_get_le16(&c->gb) + offset;
173  do {
174  offset++;
175  if (dst + 3 * c->width + 4 > dend)
176  return AVERROR_INVALIDDATA;
177  read4x4block(c, dst, c->width);
178  if ((offset & 0x3F) == 0)
179  dst += c->width * 3;
180  dst += 4;
181  } while (offset < j);
182  } while (--i);
183  }
184 
185  dst = c->frame[c->current_frame];
186  dend = c->frame[c->current_frame] + c->frame_size;
187  do {
188  set_src_position(c, &src, &send);
189  if ((src + 3 * c->width + 4 > send) ||
190  (dst + 3 * c->width + 4 > dend))
191  return AVERROR_INVALIDDATA;
192  copy_block4(dst, src, c->width, c->width, 4);
193  i++;
194  if ((i & 0x3F) == 0)
195  dst += c->width * 3;
196  dst += 4;
197  } while (i < c->video_size / 16);
198 
199  opcode_size = bytestream2_get_le16(&c->gb);
200  bytestream2_skip(&c->gb, 2);
201 
202  if (bytestream2_get_bytes_left(&c->gb) < opcode_size)
203  return AVERROR_INVALIDDATA;
204 
205  opcodes = pkt + bytestream2_tell(&c->gb);
206  bytestream2_skipu(&c->gb, opcode_size);
207 
208  dst = c->frame[c->current_frame];
209 
210  for (i = 0; i < c->height; i += 4, dst += c->width * 3)
211  for (j = 0; j < c->width; j += 4, dst += 4) {
212  int opcode, k = 0;
213  if (op > opcode_size)
214  return AVERROR_INVALIDDATA;
215  if (j & 4) {
216  opcode = opcodes[op] & 15;
217  op++;
218  } else {
219  opcode = opcodes[op] >> 4;
220  }
221 
222  while (block_sequences[opcode][k]) {
223  offset = c->width * 2;
224  code = block_sequences[opcode][k++];
225 
226  switch (code) {
227  case 2:
228  offset = 0;
229  case 3:
230  color = bytestream2_get_byte(&c->gb);
231  case 4:
232  mask = bytestream2_get_byte(&c->gb);
233  copy_color_mask(dst + offset, c->width, mask, color);
234  break;
235  case 5:
236  offset = 0;
237  case 6:
238  set_src_position(c, &src, &send);
239  case 7:
240  if (src + offset + c->width + 4 > send)
241  return AVERROR_INVALIDDATA;
242  mask = bytestream2_get_byte(&c->gb);
243  copy_src_mask(dst + offset, c->width, mask, src + offset);
244  break;
245  }
246  }
247  }
248 
249  return 0;
250 }
251 
252 static int paf_video_decode(AVCodecContext *avctx, void *data,
253  int *got_frame, AVPacket *pkt)
254 {
255  PAFVideoDecContext *c = avctx->priv_data;
256  uint8_t code, *dst, *end;
257  int i, frame, ret;
258 
259  if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
260  return ret;
261 
262  bytestream2_init(&c->gb, pkt->data, pkt->size);
263 
264  code = bytestream2_get_byte(&c->gb);
265  if (code & 0x20) { // frame is keyframe
266  for (i = 0; i < 4; i++)
267  memset(c->frame[i], 0, c->frame_size);
268 
269  memset(c->pic->data[1], 0, AVPALETTE_SIZE);
270  c->current_frame = 0;
271  c->pic->key_frame = 1;
273  } else {
274  c->pic->key_frame = 0;
276  }
277 
278  if (code & 0x40) { // palette update
279  uint32_t *out = (uint32_t *)c->pic->data[1];
280  int index, count;
281 
282  index = bytestream2_get_byte(&c->gb);
283  count = bytestream2_get_byte(&c->gb) + 1;
284 
285  if (index + count > 256)
286  return AVERROR_INVALIDDATA;
287  if (bytestream2_get_bytes_left(&c->gb) < 3 * count)
288  return AVERROR_INVALIDDATA;
289 
290  out += index;
291  for (i = 0; i < count; i++) {
292  unsigned r, g, b;
293 
294  r = bytestream2_get_byteu(&c->gb);
295  r = r << 2 | r >> 4;
296  g = bytestream2_get_byteu(&c->gb);
297  g = g << 2 | g >> 4;
298  b = bytestream2_get_byteu(&c->gb);
299  b = b << 2 | b >> 4;
300  *out++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
301  }
302  c->pic->palette_has_changed = 1;
303  }
304 
305  switch (code & 0x0F) {
306  case 0:
307  /* Block-based motion compensation using 4x4 blocks with either
308  * horizontal or vertical vectors; might incorporate VQ as well. */
309  if ((ret = decode_0(c, pkt->data, code)) < 0)
310  return ret;
311  break;
312  case 1:
313  /* Uncompressed data. This mode specifies that (width * height) bytes
314  * should be copied directly from the encoded buffer into the output. */
315  dst = c->frame[c->current_frame];
316  // possibly chunk length data
317  bytestream2_skip(&c->gb, 2);
319  return AVERROR_INVALIDDATA;
320  bytestream2_get_bufferu(&c->gb, dst, c->video_size);
321  break;
322  case 2:
323  /* Copy reference frame: Consume the next byte in the stream as the
324  * reference frame (which should be 0, 1, 2, or 3, and should not be
325  * the same as the current frame number). */
326  frame = bytestream2_get_byte(&c->gb);
327  if (frame > 3)
328  return AVERROR_INVALIDDATA;
329  if (frame != c->current_frame)
330  memcpy(c->frame[c->current_frame], c->frame[frame], c->frame_size);
331  break;
332  case 4:
333  /* Run length encoding.*/
334  dst = c->frame[c->current_frame];
335  end = dst + c->video_size;
336 
337  bytestream2_skip(&c->gb, 2);
338 
339  while (dst < end) {
340  int8_t code;
341  int count;
342 
343  if (bytestream2_get_bytes_left(&c->gb) < 2)
344  return AVERROR_INVALIDDATA;
345 
346  code = bytestream2_get_byteu(&c->gb);
347  count = FFABS(code) + 1;
348 
349  if (dst + count > end)
350  return AVERROR_INVALIDDATA;
351  if (code < 0)
352  memset(dst, bytestream2_get_byteu(&c->gb), count);
353  else
354  bytestream2_get_buffer(&c->gb, dst, count);
355  dst += count;
356  }
357  break;
358  default:
359  avpriv_request_sample(avctx, "unknown/invalid code");
360  return AVERROR_INVALIDDATA;
361  }
362 
363  av_image_copy_plane(c->pic->data[0], c->pic->linesize[0],
364  c->frame[c->current_frame], c->width,
365  c->width, c->height);
366 
367  c->current_frame = (c->current_frame + 1) & 3;
368  if ((ret = av_frame_ref(data, c->pic)) < 0)
369  return ret;
370 
371  *got_frame = 1;
372 
373  return pkt->size;
374 }
375 
377  .name = "paf_video",
378  .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"),
379  .type = AVMEDIA_TYPE_VIDEO,
380  .id = AV_CODEC_ID_PAF_VIDEO,
381  .priv_data_size = sizeof(PAFVideoDecContext),
382  .init = paf_video_init,
385  .capabilities = CODEC_CAP_DR1,
386 };
#define AVPALETTE_SIZE
Definition: avcodec.h:3035
static av_cold int paf_video_close(AVCodecContext *avctx)
Definition: pafvideo.c:55
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:54
GetByteContext gb
Definition: pafvideo.c:42
This structure describes decoded (raw) audio or video data.
Definition: frame.h:135
uint8_t * frame[4]
Definition: pafvideo.c:48
int size
Definition: avcodec.h:974
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1254
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:130
AVCodec.
Definition: avcodec.h:2796
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
Definition: bytestream.h:268
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:57
void av_freep(void *ptr)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Definition: mem.c:198
static int decode(MimicContext *ctx, int quality, int num_coeffs, int is_iframe)
Definition: mimic.c:275
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
uint8_t
#define b
Definition: input.c:52
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
Definition: frame.c:188
const char * name
Name of the codec implementation.
Definition: avcodec.h:2803
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:684
const char data[16]
Definition: mxf.c:70
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
Definition: bytestream.h:165
uint8_t * opcodes
Definition: pafvideo.c:52
#define r
Definition: input.c:51
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:123
static const uint16_t mask[17]
Definition: lzw.c:38
#define AVERROR(e)
Definition: error.h:43
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:159
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:69
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:150
g
Definition: yuv2rgb.c:535
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
Definition: bytestream.h:258
static int paf_video_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
Definition: pafvideo.c:252
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:149
AVFrame * pic
Definition: pafvideo.c:41
Libavcodec external API header.
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame)
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buf...
Definition: utils.c:808
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:196
static const uint8_t block_sequences[16][8]
Definition: pafvideo.c:29
int width
picture width / height.
Definition: avcodec.h:1224
#define FFALIGN(x, a)
Definition: common.h:62
static void set_src_position(PAFVideoDecContext *c, const uint8_t **p, const uint8_t **pend)
Definition: pafvideo.c:136
8 bit with PIX_FMT_RGB32 palette
Definition: pixfmt.h:76
static av_always_inline int bytestream2_tell(GetByteContext *g)
Definition: bytestream.h:183
static int width
Definition: utils.c:156
#define av_cold
Definition: attributes.h:66
main external API structure.
Definition: avcodec.h:1050
static void close(AVCodecParserContext *s)
Definition: h264_parser.c:490
AVCodec ff_paf_video_decoder
Definition: pafvideo.c:376
int index
Definition: gxfenc.c:72
uint8_t * data
Definition: avcodec.h:973
int palette_has_changed
Tell user application that palette has changed from previous frame.
Definition: frame.h:330
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:153
static void copy_src_mask(uint8_t *dst, int width, uint8_t mask, const uint8_t *src)
Definition: pafvideo.c:124
void * priv_data
Definition: avcodec.h:1092
static av_cold int paf_video_init(AVCodecContext *avctx)
Definition: pafvideo.c:68
static void copy_color_mask(uint8_t *dst, int width, uint8_t mask, uint8_t color)
Definition: pafvideo.c:112
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_dlog(ac->avr,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> out
static int op(uint8_t **dst, const uint8_t *dst_end, GetByteContext *gb, int pixel, int count, int *x, int width, int linesize)
Perform decode operation.
Definition: anm.c:76
common internal api header.
static const uint8_t color[]
Definition: log.c:55
static av_cold int init(AVCodecParserContext *s)
Definition: h264_parser.c:499
Definition: vf_drawbox.c:37
static void copy_block4(uint8_t *dst, const uint8_t *src, int dstStride, int srcStride, int h)
Definition: copy_block.h:26
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:191
#define FFABS(a)
Definition: common.h:52
void av_image_copy_plane(uint8_t *dst, int dst_linesize, const uint8_t *src, int src_linesize, int bytewidth, int height)
Copy image plane from src to dst.
Definition: imgutils.c:254
static void read4x4block(PAFVideoDecContext *c, uint8_t *dst, int width)
Definition: pafvideo.c:102
static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
Definition: pafvideo.c:149
This structure stores compressed data.
Definition: avcodec.h:950
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:141
Predicted.
Definition: avutil.h:254
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:205