FFmpeg
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 FFmpeg.
6  *
7  * FFmpeg 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  * FFmpeg 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 FFmpeg; 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 
30 static const uint8_t block_sequences[16][8] = {
31  { 0, 0, 0, 0, 0, 0, 0, 0 },
32  { 2, 0, 0, 0, 0, 0, 0, 0 },
33  { 5, 7, 0, 0, 0, 0, 0, 0 },
34  { 5, 0, 0, 0, 0, 0, 0, 0 },
35  { 6, 0, 0, 0, 0, 0, 0, 0 },
36  { 5, 7, 5, 7, 0, 0, 0, 0 },
37  { 5, 7, 5, 0, 0, 0, 0, 0 },
38  { 5, 7, 6, 0, 0, 0, 0, 0 },
39  { 5, 5, 0, 0, 0, 0, 0, 0 },
40  { 3, 0, 0, 0, 0, 0, 0, 0 },
41  { 6, 6, 0, 0, 0, 0, 0, 0 },
42  { 2, 4, 0, 0, 0, 0, 0, 0 },
43  { 2, 4, 5, 7, 0, 0, 0, 0 },
44  { 2, 4, 5, 0, 0, 0, 0, 0 },
45  { 2, 4, 6, 0, 0, 0, 0, 0 },
46  { 2, 4, 5, 7, 5, 7, 0, 0 },
47 };
48 
49 typedef struct PAFVideoDecContext {
52 
53  int width;
54  int height;
55 
60 
63 
65 {
66  PAFVideoDecContext *c = avctx->priv_data;
67  int i;
68 
69  av_frame_free(&c->pic);
70 
71  for (i = 0; i < 4; i++)
72  av_freep(&c->frame[i]);
73 
74  return 0;
75 }
76 
78 {
79  PAFVideoDecContext *c = avctx->priv_data;
80  int i;
81  int ret;
82 
83  c->width = avctx->width;
84  c->height = avctx->height;
85 
86  if (avctx->height & 3 || avctx->width & 3) {
87  av_log(avctx, AV_LOG_ERROR,
88  "width %d and height %d must be multiplie of 4.\n",
89  avctx->width, avctx->height);
90  return AVERROR_INVALIDDATA;
91  }
92 
93  avctx->pix_fmt = AV_PIX_FMT_PAL8;
94  ret = av_image_check_size2(avctx->width, FFALIGN(avctx->height, 256), avctx->max_pixels, avctx->pix_fmt, 0, avctx);
95  if (ret < 0)
96  return ret;
97 
98  c->pic = av_frame_alloc();
99  if (!c->pic)
100  return AVERROR(ENOMEM);
101 
102  c->frame_size = avctx->width * FFALIGN(avctx->height, 256);
103  c->video_size = avctx->width * avctx->height;
104  for (i = 0; i < 4; i++) {
105  c->frame[i] = av_mallocz(c->frame_size);
106  if (!c->frame[i]) {
107  paf_video_close(avctx);
108  return AVERROR(ENOMEM);
109  }
110  }
111 
112  return 0;
113 }
114 
116 {
117  int i;
118 
119  for (i = 0; i < 4; i++) {
120  bytestream2_get_buffer(&c->gb, dst, 4);
121  dst += width;
122  }
123 }
124 
126 {
127  int i;
128 
129  for (i = 0; i < 4; i++) {
130  if (mask & (1 << 7 - i))
131  dst[i] = color;
132  if (mask & (1 << 3 - i))
133  dst[width + i] = color;
134  }
135 }
136 
137 static void copy_src_mask(uint8_t *dst, int width, uint8_t mask, const uint8_t *src)
138 {
139  int i;
140 
141  for (i = 0; i < 4; i++) {
142  if (mask & (1 << 7 - i))
143  dst[i] = src[i];
144  if (mask & (1 << 3 - i))
145  dst[width + i] = src[width + i];
146  }
147 }
148 
150  const uint8_t **p,
151  const uint8_t **pend)
152 {
153  int val = bytestream2_get_be16(&c->gb);
154  int page = val >> 14;
155  int x = (val & 0x7F);
156  int y = ((val >> 7) & 0x7F);
157 
158  *p = c->frame[page] + x * 2 + y * 2 * c->width;
159  *pend = c->frame[page] + c->frame_size;
160 }
161 
163 {
164  uint32_t opcode_size, offset;
165  uint8_t *dst, *dend, mask = 0, color = 0;
166  const uint8_t *src, *send, *opcodes;
167  int i, j, op = 0;
168 
169  i = bytestream2_get_byte(&c->gb);
170  if (i) {
171  if (code & 0x10) {
172  int align;
173 
174  align = bytestream2_tell(&c->gb) & 3;
175  if (align)
176  bytestream2_skip(&c->gb, 4 - align);
177  }
178  do {
179  int page, val, x, y;
180  val = bytestream2_get_be16(&c->gb);
181  page = val >> 14;
182  x = (val & 0x7F) * 2;
183  y = ((val >> 7) & 0x7F) * 2;
184  dst = c->frame[page] + x + y * c->width;
185  dend = c->frame[page] + c->frame_size;
186  offset = (x & 0x7F) * 2;
187  j = bytestream2_get_le16(&c->gb) + offset;
188  if (bytestream2_get_bytes_left(&c->gb) < (j - offset) * 16)
189  return AVERROR_INVALIDDATA;
190  do {
191  offset++;
192  if (dst + 3 * c->width + 4 > dend)
193  return AVERROR_INVALIDDATA;
194  read4x4block(c, dst, c->width);
195  if ((offset & 0x3F) == 0)
196  dst += c->width * 3;
197  dst += 4;
198  } while (offset < j);
199  } while (--i);
200  }
201 
202  dst = c->frame[c->current_frame];
203  dend = c->frame[c->current_frame] + c->frame_size;
204  do {
205  set_src_position(c, &src, &send);
206  if ((src + 3 * c->width + 4 > send) ||
207  (dst + 3 * c->width + 4 > dend) ||
208  bytestream2_get_bytes_left(&c->gb) < 4)
209  return AVERROR_INVALIDDATA;
210  copy_block4(dst, src, c->width, c->width, 4);
211  i++;
212  if ((i & 0x3F) == 0)
213  dst += c->width * 3;
214  dst += 4;
215  } while (i < c->video_size / 16);
216 
217  opcode_size = bytestream2_get_le16(&c->gb);
218  bytestream2_skip(&c->gb, 2);
219 
220  if (bytestream2_get_bytes_left(&c->gb) < opcode_size)
221  return AVERROR_INVALIDDATA;
222 
223  opcodes = pkt + bytestream2_tell(&c->gb);
224  bytestream2_skipu(&c->gb, opcode_size);
225 
226  dst = c->frame[c->current_frame];
227 
228  for (i = 0; i < c->height; i += 4, dst += c->width * 3)
229  for (j = 0; j < c->width; j += 4, dst += 4) {
230  int opcode, k = 0;
231  if (op > opcode_size)
232  return AVERROR_INVALIDDATA;
233  if (j & 4) {
234  opcode = opcodes[op] & 15;
235  op++;
236  } else {
237  opcode = opcodes[op] >> 4;
238  }
239 
240  while (block_sequences[opcode][k]) {
241  offset = c->width * 2;
242  code = block_sequences[opcode][k++];
243 
244  switch (code) {
245  case 2:
246  offset = 0;
247  case 3:
248  color = bytestream2_get_byte(&c->gb);
249  case 4:
250  mask = bytestream2_get_byte(&c->gb);
251  copy_color_mask(dst + offset, c->width, mask, color);
252  break;
253  case 5:
254  offset = 0;
255  case 6:
256  set_src_position(c, &src, &send);
257  case 7:
258  if (src + offset + c->width + 4 > send)
259  return AVERROR_INVALIDDATA;
260  mask = bytestream2_get_byte(&c->gb);
261  copy_src_mask(dst + offset, c->width, mask, src + offset);
262  break;
263  }
264  }
265  }
266 
267  return 0;
268 }
269 
270 static int paf_video_decode(AVCodecContext *avctx, void *data,
271  int *got_frame, AVPacket *pkt)
272 {
273  PAFVideoDecContext *c = avctx->priv_data;
274  uint8_t code, *dst, *end;
275  int i, frame, ret;
276 
277  if (pkt->size < 2)
278  return AVERROR_INVALIDDATA;
279 
280  bytestream2_init(&c->gb, pkt->data, pkt->size);
281 
282  code = bytestream2_get_byte(&c->gb);
283  if ((code & 0xF) > 4 || (code & 0xF) == 3) {
284  avpriv_request_sample(avctx, "unknown/invalid code");
285  return AVERROR_INVALIDDATA;
286  }
287 
288  if ((code & 0xF) == 0 &&
289  c->video_size / 32 - (int64_t)bytestream2_get_bytes_left(&c->gb) > c->video_size / 32 * (int64_t)avctx->discard_damaged_percentage / 100)
290  return AVERROR_INVALIDDATA;
291 
292  if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
293  return ret;
294 
295  if (code & 0x20) { // frame is keyframe
296  memset(c->pic->data[1], 0, AVPALETTE_SIZE);
297  c->current_frame = 0;
298  c->pic->key_frame = 1;
299  c->pic->pict_type = AV_PICTURE_TYPE_I;
300  } else {
301  c->pic->key_frame = 0;
302  c->pic->pict_type = AV_PICTURE_TYPE_P;
303  }
304 
305  if (code & 0x40) { // palette update
306  uint32_t *out = (uint32_t *)c->pic->data[1];
307  int index, count;
308 
309  index = bytestream2_get_byte(&c->gb);
310  count = bytestream2_get_byte(&c->gb) + 1;
311 
312  if (index + count > 256)
313  return AVERROR_INVALIDDATA;
314  if (bytestream2_get_bytes_left(&c->gb) < 3 * count)
315  return AVERROR_INVALIDDATA;
316 
317  out += index;
318  for (i = 0; i < count; i++) {
319  unsigned r, g, b;
320 
321  r = bytestream2_get_byteu(&c->gb);
322  r = r << 2 | r >> 4;
323  g = bytestream2_get_byteu(&c->gb);
324  g = g << 2 | g >> 4;
325  b = bytestream2_get_byteu(&c->gb);
326  b = b << 2 | b >> 4;
327  *out++ = (0xFFU << 24) | (r << 16) | (g << 8) | b;
328  }
329  c->pic->palette_has_changed = 1;
330  }
331 
332  if (code & 0x20)
333  for (i = 0; i < 4; i++)
334  memset(c->frame[i], 0, c->frame_size);
335 
336  switch (code & 0x0F) {
337  case 0:
338  /* Block-based motion compensation using 4x4 blocks with either
339  * horizontal or vertical vectors; might incorporate VQ as well. */
340  if ((ret = decode_0(c, pkt->data, code)) < 0)
341  return ret;
342  break;
343  case 1:
344  /* Uncompressed data. This mode specifies that (width * height) bytes
345  * should be copied directly from the encoded buffer into the output. */
346  dst = c->frame[c->current_frame];
347  // possibly chunk length data
348  bytestream2_skip(&c->gb, 2);
349  if (bytestream2_get_bytes_left(&c->gb) < c->video_size)
350  return AVERROR_INVALIDDATA;
351  bytestream2_get_bufferu(&c->gb, dst, c->video_size);
352  break;
353  case 2:
354  /* Copy reference frame: Consume the next byte in the stream as the
355  * reference frame (which should be 0, 1, 2, or 3, and should not be
356  * the same as the current frame number). */
357  frame = bytestream2_get_byte(&c->gb);
358  if (frame > 3)
359  return AVERROR_INVALIDDATA;
360  if (frame != c->current_frame)
361  memcpy(c->frame[c->current_frame], c->frame[frame], c->frame_size);
362  break;
363  case 4:
364  /* Run length encoding.*/
365  dst = c->frame[c->current_frame];
366  end = dst + c->video_size;
367 
368  bytestream2_skip(&c->gb, 2);
369 
370  while (dst < end) {
371  int8_t code;
372  int count;
373 
374  if (bytestream2_get_bytes_left(&c->gb) < 2)
375  return AVERROR_INVALIDDATA;
376 
377  code = bytestream2_get_byteu(&c->gb);
378  count = FFABS(code) + 1;
379 
380  if (dst + count > end)
381  return AVERROR_INVALIDDATA;
382  if (code < 0)
383  memset(dst, bytestream2_get_byteu(&c->gb), count);
384  else
385  bytestream2_get_buffer(&c->gb, dst, count);
386  dst += count;
387  }
388  break;
389  default:
390  av_assert0(0);
391  }
392 
393  av_image_copy_plane(c->pic->data[0], c->pic->linesize[0],
394  c->frame[c->current_frame], c->width,
395  c->width, c->height);
396 
397  c->current_frame = (c->current_frame + 1) & 3;
398  if ((ret = av_frame_ref(data, c->pic)) < 0)
399  return ret;
400 
401  *got_frame = 1;
402 
403  return pkt->size;
404 }
405 
407  .name = "paf_video",
408  .long_name = NULL_IF_CONFIG_SMALL("Amazing Studio Packed Animation File Video"),
409  .type = AVMEDIA_TYPE_VIDEO,
410  .id = AV_CODEC_ID_PAF_VIDEO,
411  .priv_data_size = sizeof(PAFVideoDecContext),
412  .init = paf_video_init,
413  .close = paf_video_close,
415  .capabilities = AV_CODEC_CAP_DR1,
416 };
AVCodec
AVCodec.
Definition: avcodec.h:3481
decode_0
static int decode_0(PAFVideoDecContext *c, uint8_t *pkt, uint8_t code)
Definition: pafvideo.c:162
init
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
PAFVideoDecContext::opcodes
uint8_t * opcodes
Definition: pafvideo.c:61
r
const char * r
Definition: vf_curves.c:114
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
out
FILE * out
Definition: movenc.c:54
color
Definition: vf_paletteuse.c:588
GetByteContext
Definition: bytestream.h:33
bytestream2_skipu
static av_always_inline void bytestream2_skipu(GetByteContext *g, unsigned int size)
Definition: bytestream.h:170
PAFVideoDecContext::gb
GetByteContext gb
Definition: pafvideo.c:51
count
void INT64 INT64 count
Definition: avisynth_c.h:767
av_frame_free
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition: frame.c:202
end
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:295
PAFVideoDecContext::frame_size
int frame_size
Definition: pafvideo.c:58
internal.h
AVPacket::data
uint8_t * data
Definition: avcodec.h:1477
b
#define b
Definition: input.c:41
data
const char data[16]
Definition: mxf.c:91
PAFVideoDecContext::frame
uint8_t * frame[4]
Definition: pafvideo.c:57
PAFVideoDecContext::width
int width
Definition: pafvideo.c:53
ff_reget_buffer
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: decode.c:2012
bytestream2_get_bytes_left
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:154
av_image_copy_plane
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:338
bytestream2_skip
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:164
U
#define U(x)
Definition: vp56_arith.h:37
copy_src_mask
static void copy_src_mask(uint8_t *dst, int width, uint8_t mask, const uint8_t *src)
Definition: pafvideo.c:137
src
#define src
Definition: vp8dsp.c:254
av_image_check_size2
int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enum AVPixelFormat pix_fmt, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of a plane of an image with...
Definition: imgutils.c:253
av_frame_alloc
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition: frame.c:189
PAFVideoDecContext::current_frame
int current_frame
Definition: pafvideo.c:56
PAFVideoDecContext
Definition: pafvideo.c:49
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
av_cold
#define av_cold
Definition: attributes.h:84
mask
static const uint16_t mask[17]
Definition: lzw.c:38
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:42
width
#define width
g
const char * g
Definition: vf_curves.c:115
op
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:78
av_assert0
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Definition: avassert.h:37
paf_video_init
static av_cold int paf_video_init(AVCodecContext *avctx)
Definition: pafvideo.c:77
AVCodecContext::max_pixels
int64_t max_pixels
The number of pixels per image to maximally accept.
Definition: avcodec.h:3292
copy_color_mask
static void copy_color_mask(uint8_t *dst, int width, uint8_t mask, uint8_t color)
Definition: pafvideo.c:125
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
block_sequences
static const uint8_t block_sequences[16][8]
Definition: pafvideo.c:30
AVPALETTE_SIZE
#define AVPALETTE_SIZE
Definition: pixfmt.h:32
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:274
bytestream2_get_buffer
static av_always_inline unsigned int bytestream2_get_buffer(GetByteContext *g, uint8_t *dst, unsigned int size)
Definition: bytestream.h:263
read4x4block
static void read4x4block(PAFVideoDecContext *c, uint8_t *dst, int width)
Definition: pafvideo.c:115
index
int index
Definition: gxfenc.c:89
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
bytestream2_tell
static av_always_inline int bytestream2_tell(GetByteContext *g)
Definition: bytestream.h:188
PAFVideoDecContext::video_size
int video_size
Definition: pafvideo.c:59
PAFVideoDecContext::pic
AVFrame * pic
Definition: pafvideo.c:50
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:981
AVPacket::size
int size
Definition: avcodec.h:1478
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:188
av_frame_ref
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:443
color
static const uint32_t color[16+AV_CLASS_CATEGORY_NB]
Definition: log.c:92
val
const char const char void * val
Definition: avisynth_c.h:863
offset
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Definition: writing_filters.txt:86
copy_block4
static void copy_block4(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h)
Definition: copy_block.h:37
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
code
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
Definition: filter_design.txt:178
copy_block.h
AV_CODEC_ID_PAF_VIDEO
@ AV_CODEC_ID_PAF_VIDEO
Definition: avcodec.h:397
uint8_t
uint8_t
Definition: audio_convert.c:194
av_mallocz
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
Definition: mem.c:236
AVCodec::name
const char * name
Name of the codec implementation.
Definition: avcodec.h:3488
paf_video_decode
static int paf_video_decode(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
Definition: pafvideo.c:270
AVCodecContext::height
int height
Definition: avcodec.h:1738
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1775
avcodec.h
AV_PIX_FMT_PAL8
@ AV_PIX_FMT_PAL8
8 bits with AV_PIX_FMT_RGB32 palette
Definition: pixfmt.h:77
ret
ret
Definition: filter_design.txt:187
set_src_position
static void set_src_position(PAFVideoDecContext *c, const uint8_t **p, const uint8_t **pend)
Definition: pafvideo.c:149
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:264
align
const AVS_VideoInfo int align
Definition: avisynth_c.h:887
AVCodecContext
main external API structure.
Definition: avcodec.h:1565
pkt
static AVPacket pkt
Definition: demuxing_decoding.c:54
AVCodecContext::discard_damaged_percentage
int discard_damaged_percentage
The percentage of damaged samples to discard a frame.
Definition: avcodec.h:3372
AV_PICTURE_TYPE_P
@ AV_PICTURE_TYPE_P
Predicted.
Definition: avutil.h:275
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
PAFVideoDecContext::height
int height
Definition: pafvideo.c:54
bytestream2_get_bufferu
static av_always_inline unsigned int bytestream2_get_bufferu(GetByteContext *g, uint8_t *dst, unsigned int size)
Definition: bytestream.h:273
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:39
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:48
AVPacket
This structure stores compressed data.
Definition: avcodec.h:1454
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:1592
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:1738
bytestream.h
imgutils.h
bytestream2_init
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:133
paf_video_close
static av_cold int paf_video_close(AVCodecContext *avctx)
Definition: pafvideo.c:64
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:28
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
ff_paf_video_decoder
AVCodec ff_paf_video_decoder
Definition: pafvideo.c:406