FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
magicyuv.c
Go to the documentation of this file.
1 /*
2  * MagicYUV decoder
3  * Copyright (c) 2016 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 <stdio.h>
23 #include <stdlib.h>
24 #include <string.h>
25 
26 #include "libavutil/qsort.h"
27 #include "avcodec.h"
28 #include "bytestream.h"
29 #include "get_bits.h"
30 #include "huffyuvdsp.h"
31 #include "internal.h"
32 #include "thread.h"
33 
34 typedef struct Slice {
35  uint32_t start;
36  uint32_t size;
37 } Slice;
38 
39 typedef enum Prediction {
40  LEFT = 1,
43 } Prediction;
44 
45 typedef struct MagicYUVContext {
48  int nb_slices;
49  int planes; // number of encoded planes in bitstream
50  int decorrelate; // postprocessing work
51  int interlaced; // video is interlaced
52  uint8_t *buf; // pointer to AVPacket->data
53  int hshift[4];
54  int vshift[4];
55  Slice *slices[4]; // slice positions and size in bitstream for each plane
56  int slices_size[4];
57  uint8_t len[4][256]; // table of code lengths for each plane
58  VLC vlc[4]; // VLC for each plane
61 
63 {
64  MagicYUVContext *s = avctx->priv_data;
66  return 0;
67 }
68 
69 typedef struct HuffEntry {
72  uint32_t code;
73 } HuffEntry;
74 
75 static int ff_magy_huff_cmp_len(const void *a, const void *b)
76 {
77  const HuffEntry *aa = a, *bb = b;
78  return (aa->len - bb->len) * 256 + aa->sym - bb->sym;
79 }
80 
81 static int build_huff(VLC *vlc, uint8_t *len)
82 {
83  HuffEntry he[256];
84  uint32_t codes[256];
85  uint8_t bits[256];
86  uint8_t syms[256];
87  uint32_t code;
88  int i;
89 
90  for (i = 0; i < 256; i++) {
91  he[i].sym = 255 - i;
92  he[i].len = len[i];
93  }
95 
96  code = 1;
97  for (i = 255; i >= 0; i--) {
98  codes[i] = code >> (32 - he[i].len);
99  bits[i] = he[i].len;
100  syms[i] = he[i].sym;
101  code += 0x80000000u >> (he[i].len - 1);
102  }
103 
104  ff_free_vlc(vlc);
105  return ff_init_vlc_sparse(vlc, FFMIN(he[255].len, 12), 256,
106  bits, sizeof(*bits), sizeof(*bits),
107  codes, sizeof(*codes), sizeof(*codes),
108  syms, sizeof(*syms), sizeof(*syms), 0);
109 }
110 
111 static int decode_slice(AVCodecContext *avctx, void *tdata,
112  int j, int threadnr)
113 {
114  MagicYUVContext *s = avctx->priv_data;
115  int interlaced = s->interlaced;
116  AVFrame *p = s->p;
117  int i, k, x, ret;
119  uint8_t *dst;
120 
121  for (i = 0; i < s->planes; i++) {
122  int height = AV_CEIL_RSHIFT(FFMIN(s->slice_height, avctx->coded_height - j * s->slice_height), s->vshift[i]);
123  int width = AV_CEIL_RSHIFT(avctx->coded_width, s->hshift[i]);
124  int sheight = AV_CEIL_RSHIFT(s->slice_height, s->vshift[i]);
125  int fake_stride = p->linesize[i] * (1 + interlaced);
126  int stride = p->linesize[i];
127  int flags, pred;
128 
129  if ((ret = init_get_bits8(&b, s->buf + s->slices[i][j].start, s->slices[i][j].size)) < 0)
130  return ret;
131 
132  flags = get_bits(&b, 8);
133  pred = get_bits(&b, 8);
134 
135  dst = p->data[i] + j * sheight * stride;
136  if (flags & 1) {
137  for (k = 0; k < height; k++) {
138  for (x = 0; x < width; x++) {
139  dst[x] = get_bits(&b, 8);
140  }
141  dst += stride;
142  }
143  } else {
144  for (k = 0; k < height; k++) {
145  for (x = 0; x < width; x++) {
146  int pix;
147  if (get_bits_left(&b) <= 0) {
148  return AVERROR_INVALIDDATA;
149  }
150  pix = get_vlc2(&b, s->vlc[i].table, s->vlc[i].bits, 3);
151  if (pix < 0) {
152  return AVERROR_INVALIDDATA;
153  }
154  dst[x] = 255 - pix;
155  }
156  dst += stride;
157  }
158  }
159 
160  if (pred == LEFT) {
161  dst = p->data[i] + j * sheight * stride;
162  s->hdsp.add_hfyu_left_pred(dst, dst, width, 0);
163  dst += stride;
164  if (interlaced) {
165  s->hdsp.add_hfyu_left_pred(dst, dst, width, 0);
166  dst += stride;
167  }
168  for (k = 1 + interlaced; k < height; k++) {
169  s->hdsp.add_hfyu_left_pred(dst, dst, width, dst[-fake_stride]);
170  dst += stride;
171  }
172  } else if (pred == GRADIENT) {
173  int left, lefttop, top;
174 
175  dst = p->data[i] + j * sheight * stride;
176  s->hdsp.add_hfyu_left_pred(dst, dst, width, 0);
177  left = lefttop = 0;
178  dst += stride;
179  if (interlaced) {
180  s->hdsp.add_hfyu_left_pred(dst, dst, width, 0);
181  left = lefttop = 0;
182  dst += stride;
183  }
184  for (k = 1 + interlaced; k < height; k++) {
185  top = dst[-fake_stride];
186  left = top + dst[0];
187  dst[0] = left;
188  for (x = 1; x < width; x++) {
189  top = dst[x - fake_stride];
190  lefttop = dst[x - (fake_stride + 1)];
191  left += top - lefttop + dst[x];
192  dst[x] = left;
193  }
194  dst += stride;
195  }
196  } else if (pred == MEDIAN) {
197  int left, lefttop;
198 
199  dst = p->data[i] + j * sheight * stride;
200  lefttop = left = dst[0];
201  s->hdsp.add_hfyu_left_pred(dst, dst, width, 0);
202  dst += stride;
203  if (interlaced) {
204  lefttop = left = dst[0];
205  s->hdsp.add_hfyu_left_pred(dst, dst, width, 0);
206  dst += stride;
207  }
208  for (k = 1 + interlaced; k < height; k++) {
209  s->hdsp.add_hfyu_median_pred(dst, dst - fake_stride, dst, width, &left, &lefttop);
210  lefttop = left = dst[0];
211  dst += stride;
212  }
213  } else {
214  avpriv_request_sample(avctx, "unknown prediction: %d", pred);
215  }
216  }
217 
218  if (s->decorrelate) {
219  int height = FFMIN(s->slice_height, avctx->coded_height - j * s->slice_height);
220  int width = avctx->coded_width;
221  uint8_t *b = p->data[0] + j * s->slice_height * p->linesize[0];
222  uint8_t *g = p->data[1] + j * s->slice_height * p->linesize[1];
223  uint8_t *r = p->data[2] + j * s->slice_height * p->linesize[2];
224 
225  for (i = 0; i < height; i++) {
226  s->hdsp.add_bytes(b, g, width);
227  s->hdsp.add_bytes(r, g, width);
228  b += p->linesize[0];
229  g += p->linesize[1];
230  r += p->linesize[2];
231  }
232  }
233 
234  return 0;
235 }
236 
237 static int decode_frame(AVCodecContext *avctx,
238  void *data, int *got_frame,
239  AVPacket *avpkt)
240 {
241  uint32_t first_offset, offset, next_offset, header_size, slice_width;
242  int ret, format, version, table_size;
243  MagicYUVContext *s = avctx->priv_data;
244  ThreadFrame frame = { .f = data };
245  AVFrame *p = data;
246  GetByteContext gb;
248  int i, j, k, width, height;
249 
250  bytestream2_init(&gb, avpkt->data, avpkt->size);
251  if (bytestream2_get_le32(&gb) != MKTAG('M','A','G','Y'))
252  return AVERROR_INVALIDDATA;
253 
254  header_size = bytestream2_get_le32(&gb);
255  if (header_size < 32 || header_size >= avpkt->size)
256  return AVERROR_INVALIDDATA;
257 
258  version = bytestream2_get_byte(&gb);
259  if (version != 7) {
260  avpriv_request_sample(avctx, "unsupported version: %d", version);
261  return AVERROR_PATCHWELCOME;
262  }
263 
264  s->hshift[1] = s->vshift[1] = 0;
265  s->hshift[2] = s->vshift[2] = 0;
266  s->decorrelate = 0;
267 
268  format = bytestream2_get_byte(&gb);
269  switch (format) {
270  case 0x65:
271  avctx->pix_fmt = AV_PIX_FMT_GBRP;
272  s->decorrelate = 1;
273  s->planes = 3;
274  break;
275  case 0x66:
276  avctx->pix_fmt = AV_PIX_FMT_GBRAP;
277  s->decorrelate = 1;
278  s->planes = 4;
279  break;
280  case 0x67:
281  avctx->pix_fmt = AV_PIX_FMT_YUV444P;
282  s->planes = 3;
283  break;
284  case 0x68:
285  avctx->pix_fmt = AV_PIX_FMT_YUV422P;
286  s->planes = 3;
287  s->hshift[1] = s->hshift[2] = 1;
288  break;
289  case 0x69:
290  avctx->pix_fmt = AV_PIX_FMT_YUV420P;
291  s->planes = 3;
292  s->hshift[1] = s->vshift[1] = 1;
293  s->hshift[2] = s->vshift[2] = 1;
294  break;
295  case 0x6a:
296  avctx->pix_fmt = AV_PIX_FMT_YUVA444P;
297  s->planes = 4;
298  break;
299  case 0x6b:
300  avctx->pix_fmt = AV_PIX_FMT_GRAY8;
301  s->planes = 1;
302  break;
303  default:
304  avpriv_request_sample(avctx, "unsupported format: 0x%X", format);
305  return AVERROR_PATCHWELCOME;
306  }
307 
308  bytestream2_skip(&gb, 2);
309  s->interlaced = !!(bytestream2_get_byte(&gb) & 2);
310  bytestream2_skip(&gb, 3);
311 
312  width = bytestream2_get_le32(&gb);
313  height = bytestream2_get_le32(&gb);
314  if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
315  return ret;
316 
317  slice_width = bytestream2_get_le32(&gb);
318  if (slice_width != avctx->coded_width) {
319  avpriv_request_sample(avctx, "unsupported slice width: %d", slice_width);
320  return AVERROR_PATCHWELCOME;
321  }
322  s->slice_height = bytestream2_get_le32(&gb);
323  if ((s->slice_height <= 0) || (s->slice_height > INT_MAX - avctx->coded_height)) {
324  av_log(avctx, AV_LOG_ERROR, "invalid slice height: %d\n", s->slice_height);
325  return AVERROR_INVALIDDATA;
326  }
327 
328  bytestream2_skip(&gb, 4);
329 
330  s->nb_slices = (avctx->coded_height + s->slice_height - 1) / s->slice_height;
331  if (s->nb_slices > INT_MAX / sizeof(Slice)) {
332  av_log(avctx, AV_LOG_ERROR, "invalid number of slices: %d\n", s->nb_slices);
333  return AVERROR_INVALIDDATA;
334  }
335 
336  for (i = 0; i < s->planes; i++) {
337  av_fast_malloc(&s->slices[i], &s->slices_size[i], s->nb_slices * sizeof(Slice));
338  if (!s->slices[i])
339  return AVERROR(ENOMEM);
340 
341  offset = bytestream2_get_le32(&gb);
342  if (offset >= avpkt->size - header_size)
343  return AVERROR_INVALIDDATA;
344 
345  if (i == 0)
346  first_offset = offset;
347 
348  for (j = 0; j < s->nb_slices - 1; j++) {
349  s->slices[i][j].start = offset + header_size;
350  next_offset = bytestream2_get_le32(&gb);
351  s->slices[i][j].size = next_offset - offset;
352  offset = next_offset;
353 
354  if (offset >= avpkt->size - header_size)
355  return AVERROR_INVALIDDATA;
356  }
357 
358  s->slices[i][j].start = offset + header_size;
359  s->slices[i][j].size = avpkt->size - s->slices[i][j].start;
360  }
361 
362  if (bytestream2_get_byte(&gb) != s->planes)
363  return AVERROR_INVALIDDATA;
364 
365  bytestream2_skip(&gb, s->nb_slices * s->planes);
366 
367  table_size = header_size + first_offset - bytestream2_tell(&gb);
368  if (table_size < 2)
369  return AVERROR_INVALIDDATA;
370 
371  if ((ret = init_get_bits8(&b, avpkt->data + bytestream2_tell(&gb), table_size)) < 0)
372  return ret;
373 
374  memset(s->len, 0, sizeof(s->len));
375  j = i = 0;
376  while (get_bits_left(&b) >= 8) {
377  int l = get_bits(&b, 4);
378  int x = get_bits(&b, 4);
379  int L = get_bitsz(&b, l) + 1;
380 
381  for (k = 0; k < L; k++) {
382  if (j + k < 256)
383  s->len[i][j + k] = x;
384  }
385 
386  j += L;
387  if (j == 256) {
388  j = 0;
389  if (build_huff(&s->vlc[i], s->len[i])) {
390  av_log(avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n");
391  return AVERROR_INVALIDDATA;
392  }
393  i++;
394  if (i == s->planes) {
395  break;
396  }
397  } else if (j > 256) {
398  return AVERROR_INVALIDDATA;
399  }
400  }
401 
402  if (i != s->planes) {
403  av_log(avctx, AV_LOG_ERROR, "Huffman tables too short\n");
404  return AVERROR_INVALIDDATA;
405  }
406 
408  p->key_frame = 1;
409 
410  if ((ret = ff_thread_get_buffer(avctx, &frame, 0)) < 0)
411  return ret;
412 
413  s->buf = avpkt->data;
414  s->p = p;
415  avctx->execute2(avctx, decode_slice, NULL, NULL, s->nb_slices);
416 
417  if (avctx->pix_fmt == AV_PIX_FMT_GBRP ||
418  avctx->pix_fmt == AV_PIX_FMT_GBRAP) {
419  FFSWAP(uint8_t*, p->data[0], p->data[1]);
420  FFSWAP(int, p->linesize[0], p->linesize[1]);
421  }
422 
423  *got_frame = 1;
424 
425  if (ret < 0)
426  return ret;
427  return avpkt->size;
428 }
429 
430 #if HAVE_THREADS
431 static int decode_init_thread_copy(AVCodecContext *avctx)
432 {
433  MagicYUVContext *s = avctx->priv_data;
434 
435  s->slices[0] = 0;
436  s->slices[1] = 0;
437  s->slices[2] = 0;
438  s->slices[3] = 0;
439  s->slices_size[0] = 0;
440  s->slices_size[1] = 0;
441  s->slices_size[2] = 0;
442  s->slices_size[3] = 0;
443 
444  return 0;
445 }
446 #endif
447 
449 {
450  MagicYUVContext * const s = avctx->priv_data;
451 
452  av_freep(&s->slices[0]);
453  av_freep(&s->slices[1]);
454  av_freep(&s->slices[2]);
455  av_freep(&s->slices[3]);
456  s->slices_size[0] = 0;
457  s->slices_size[1] = 0;
458  s->slices_size[2] = 0;
459  s->slices_size[3] = 0;
460  ff_free_vlc(&s->vlc[0]);
461  ff_free_vlc(&s->vlc[1]);
462  ff_free_vlc(&s->vlc[2]);
463  ff_free_vlc(&s->vlc[3]);
464 
465  return 0;
466 }
467 
469  .name = "magicyuv",
470  .long_name = NULL_IF_CONFIG_SMALL("MagicYUV Lossless Video"),
471  .type = AVMEDIA_TYPE_VIDEO,
472  .id = AV_CODEC_ID_MAGICYUV,
473  .priv_data_size = sizeof(MagicYUVContext),
474  .init = decode_init,
475  .init_thread_copy = ONLY_IF_THREADS_ENABLED(decode_init_thread_copy),
476  .close = decode_end,
477  .decode = decode_frame,
479 };
#define NULL
Definition: coverity.c:32
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: magicyuv.c:237
const char * s
Definition: avisynth_c.h:631
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:59
int vshift[4]
Definition: magicyuv.c:54
This structure describes decoded (raw) audio or video data.
Definition: frame.h:184
int hshift[4]
Definition: magicyuv.c:53
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
static int ff_magy_huff_cmp_len(const void *a, const void *b)
Definition: magicyuv.c:75
int coded_width
Bitstream width / height, may be different from width/height e.g.
Definition: avcodec.h:1851
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:67
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:247
static int init_thread_copy(AVCodecContext *avctx)
Definition: tta.c:390
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
Definition: utils.c:210
const char * g
Definition: vf_curves.c:108
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
int ff_init_vlc_sparse(VLC *vlc_arg, int nb_bits, int nb_codes, const void *bits, int bits_wrap, int bits_size, const void *codes, int codes_wrap, int codes_size, const void *symbols, int symbols_wrap, int symbols_size, int flags)
Definition: bitstream.c:275
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:180
int size
Definition: avcodec.h:1581
const char * b
Definition: vf_curves.c:109
av_cold void ff_huffyuvdsp_init(HuffYUVDSPContext *c)
Definition: huffyuvdsp.c:108
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:1877
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:133
int version
Definition: avisynth_c.h:629
AVCodec.
Definition: avcodec.h:3542
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 bits
Definition: crc.c:296
uint8_t
#define av_cold
Definition: attributes.h:82
Multithreading support functions.
static AVFrame * frame
Prediction
Definition: magicyuv.c:39
#define height
uint8_t * data
Definition: avcodec.h:1580
bitstream reader API header.
void(* add_hfyu_median_pred)(uint8_t *dst, const uint8_t *top, const uint8_t *diff, intptr_t w, int *left, int *left_top)
Definition: huffyuvdsp.h:40
uint32_t code
Definition: magicyuv.c:72
#define av_log(a,...)
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:568
void(* add_bytes)(uint8_t *dst, uint8_t *src, intptr_t w)
Definition: huffyuvdsp.h:38
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
int slice_height
Definition: magicyuv.c:47
#define AVERROR(e)
Definition: error.h:43
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:164
uint8_t sym
Definition: magicyuv.c:70
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:176
const char * r
Definition: vf_curves.c:107
int slices_size[4]
Definition: magicyuv.c:56
const char * name
Name of the codec implementation.
Definition: avcodec.h:3549
static const uint8_t offset[127][2]
Definition: vf_spp.c:92
int(* add_hfyu_left_pred)(uint8_t *dst, const uint8_t *src, intptr_t w, int left)
Definition: huffyuvdsp.h:43
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: avcodec.h:1019
Definition: vlc.h:26
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:66
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
Definition: internal.h:215
Slice * slices[4]
Definition: magicyuv.c:55
static int decode_slice(AVCodecContext *avctx, void *tdata, int j, int threadnr)
Definition: magicyuv.c:111
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:258
#define FFMIN(a, b)
Definition: common.h:96
uint8_t interlaced
Definition: mxfenc.c:1823
#define width
HuffYUVDSPContext hdsp
Definition: magicyuv.c:59
Definition: magicyuv.c:34
AVFrame * p
Definition: magicyuv.c:46
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:535
#define L(x)
Definition: vp56_arith.h:36
int bits
Definition: vlc.h:27
static const float pred[4]
Definition: siprdata.h:259
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:62
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition: avcodec.h:1023
static av_always_inline int bytestream2_tell(GetByteContext *g)
Definition: bytestream.h:188
uint8_t len
Definition: magicyuv.c:71
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
Definition: frame.h:215
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:437
planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
Definition: pixfmt.h:188
int ff_thread_get_buffer(AVCodecContext *avctx, ThreadFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
main external API structure.
Definition: avcodec.h:1649
uint32_t size
Definition: magicyuv.c:36
uint32_t start
Definition: magicyuv.c:35
static int build_huff(VLC *vlc, uint8_t *len)
Definition: magicyuv.c:81
int coded_height
Definition: avcodec.h:1851
static const char * format
Definition: movenc.c:47
uint8_t len[4][256]
Definition: magicyuv.c:57
AVCodec ff_magicyuv_decoder
Definition: magicyuv.c:468
static av_cold int decode_init(AVCodecContext *avctx)
Definition: magicyuv.c:62
Definition: magicyuv.c:40
#define u(width,...)
VLC vlc[4]
Definition: magicyuv.c:58
uint8_t * buf
Definition: magicyuv.c:52
static int flags
Definition: cpu.c:47
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:198
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:105
void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size)
Allocate a buffer, reusing the given one if large enough.
Definition: mem.c:499
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:62
Y , 8bpp.
Definition: pixfmt.h:70
common internal api header.
if(ret< 0)
Definition: vf_mcdeint.c:282
planar GBRA 4:4:4:4 32bpp
Definition: pixfmt.h:228
static av_cold int decode_end(AVCodecContext *avctx)
Definition: magicyuv.c:448
void * priv_data
Definition: avcodec.h:1691
int len
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
Definition: avcodec.h:3139
VLC_TYPE(* table)[2]
code, bits
Definition: vlc.h:28
int key_frame
1 -> keyframe, 0-> not
Definition: frame.h:253
#define av_freep(p)
#define FFSWAP(type, a, b)
Definition: common.h:99
#define stride
#define MKTAG(a, b, c, d)
Definition: common.h:342
This structure stores compressed data.
Definition: avcodec.h:1557
void ff_free_vlc(VLC *vlc)
Definition: bitstream.c:360
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: avcodec.h:956
#define AV_QSORT(p, num, type, cmp)
Quicksort This sort is fast, and fully inplace but not stable and it is possible to construct input t...
Definition: qsort.h:33
static av_always_inline int get_bitsz(GetBitContext *s, int n)
Read 0-25 bits.
Definition: get_bits.h:262
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:58