FFmpeg
cllc.c
Go to the documentation of this file.
1 /*
2  * Canopus Lossless Codec decoder
3  *
4  * Copyright (c) 2012-2013 Derek Buitenhuis
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #include <inttypes.h>
24 
25 #include "libavutil/intreadwrite.h"
26 #include "libavutil/mem.h"
27 #include "bswapdsp.h"
28 #include "canopus.h"
29 #include "get_bits.h"
30 #include "avcodec.h"
31 #include "codec_internal.h"
32 #include "thread.h"
33 
34 #define VLC_BITS 7
35 #define VLC_DEPTH 2
36 
37 
38 typedef struct CLLCContext {
41 
42  uint8_t *swapped_buf;
44 } CLLCContext;
45 
47 {
48  uint8_t symbols[256];
49  uint8_t bits[256];
50  int num_lens, num_codes, num_codes_sum;
51  int i, j, count;
52 
53  count = 0;
54  num_codes_sum = 0;
55 
56  num_lens = get_bits(gb, 5);
57 
58  if (num_lens > VLC_BITS * VLC_DEPTH) {
59  av_log(ctx->avctx, AV_LOG_ERROR, "To long VLCs %d\n", num_lens);
60  return AVERROR_INVALIDDATA;
61  }
62 
63  for (i = 0; i < num_lens; i++) {
64  num_codes = get_bits(gb, 9);
65  num_codes_sum += num_codes;
66 
67  if (num_codes_sum > 256) {
68  av_log(ctx->avctx, AV_LOG_ERROR,
69  "Too many VLCs (%d) to be read.\n", num_codes_sum);
70  return AVERROR_INVALIDDATA;
71  }
72 
73  for (j = 0; j < num_codes; j++) {
74  symbols[count] = get_bits(gb, 8);
75  bits[count] = i + 1;
76 
77  count++;
78  }
79  }
80 
81  return ff_vlc_init_from_lengths(vlc, VLC_BITS, count, bits, 1,
82  symbols, 1, 1, 0, 0, ctx->avctx);
83 }
84 
85 /*
86  * Unlike the RGB24 read/restore, which reads in a component at a time,
87  * ARGB read/restore reads in ARGB quads.
88  */
89 static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left,
90  VLC *vlc, uint8_t *outbuf)
91 {
92  uint8_t *dst;
93  int pred[4];
94  int code;
95  int i;
96 
97  OPEN_READER(bits, gb);
98 
99  dst = outbuf;
100  pred[0] = top_left[0];
101  pred[1] = top_left[1];
102  pred[2] = top_left[2];
103  pred[3] = top_left[3];
104 
105  for (i = 0; i < ctx->avctx->width; i++) {
106  /* Always get the alpha component */
107  UPDATE_CACHE(bits, gb);
108  GET_VLC(code, bits, gb, vlc[0].table, VLC_BITS, VLC_DEPTH);
109 
110  pred[0] += code;
111  dst[0] = pred[0];
112 
113  /* Skip the components if they are entirely transparent */
114  if (dst[0]) {
115  /* Red */
116  UPDATE_CACHE(bits, gb);
117  GET_VLC(code, bits, gb, vlc[1].table, VLC_BITS, VLC_DEPTH);
118 
119  pred[1] += code;
120  dst[1] = pred[1];
121 
122  /* Green */
123  UPDATE_CACHE(bits, gb);
124  GET_VLC(code, bits, gb, vlc[2].table, VLC_BITS, VLC_DEPTH);
125 
126  pred[2] += code;
127  dst[2] = pred[2];
128 
129  /* Blue */
130  UPDATE_CACHE(bits, gb);
131  GET_VLC(code, bits, gb, vlc[3].table, VLC_BITS, VLC_DEPTH);
132 
133  pred[3] += code;
134  dst[3] = pred[3];
135  } else {
136  dst[1] = 0;
137  dst[2] = 0;
138  dst[3] = 0;
139  }
140 
141  dst += 4;
142  }
143 
144  CLOSE_READER(bits, gb);
145 
146  top_left[0] = outbuf[0];
147 
148  /* Only stash components if they are not transparent */
149  if (top_left[0]) {
150  top_left[1] = outbuf[1];
151  top_left[2] = outbuf[2];
152  top_left[3] = outbuf[3];
153  }
154 
155  return 0;
156 }
157 
159  int *top_left, VLC *vlc, uint8_t *outbuf)
160 {
161  uint8_t *dst;
162  int pred, code;
163  int i;
164 
165  OPEN_READER(bits, gb);
166 
167  dst = outbuf;
168  pred = *top_left;
169 
170  /* Simultaneously read and restore the line */
171  for (i = 0; i < ctx->avctx->width; i++) {
172  UPDATE_CACHE(bits, gb);
173  GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH);
174 
175  pred += code;
176  dst[0] = pred;
177  dst += 3;
178  }
179 
180  CLOSE_READER(bits, gb);
181 
182  /* Stash the first pixel */
183  *top_left = outbuf[0];
184 
185  return 0;
186 }
187 
189  int *top_left, VLC *vlc, uint8_t *outbuf,
190  int is_chroma)
191 {
192  int pred, code;
193  int i;
194 
195  OPEN_READER(bits, gb);
196 
197  pred = *top_left;
198 
199  /* Simultaneously read and restore the line */
200  for (i = 0; i < ctx->avctx->width >> is_chroma; i++) {
201  UPDATE_CACHE(bits, gb);
202  GET_VLC(code, bits, gb, vlc->table, VLC_BITS, VLC_DEPTH);
203 
204  pred += code;
205  outbuf[i] = pred;
206  }
207 
208  CLOSE_READER(bits, gb);
209 
210  /* Stash the first pixel */
211  *top_left = outbuf[0];
212 
213  return 0;
214 }
215 
217 {
218  AVCodecContext *avctx = ctx->avctx;
219  uint8_t *dst;
220  int pred[4];
221  int ret;
222  int i, j;
223  VLC vlc[4];
224 
225  pred[0] = 0;
226  pred[1] = 0x80;
227  pred[2] = 0x80;
228  pred[3] = 0x80;
229 
230  dst = pic->data[0];
231 
232  skip_bits(gb, 16);
233 
234  /* Read in code table for each plane */
235  for (i = 0; i < 4; i++) {
236  ret = read_code_table(ctx, gb, &vlc[i]);
237  if (ret < 0) {
238  for (j = 0; j < i; j++)
239  ff_vlc_free(&vlc[j]);
240 
241  av_log(ctx->avctx, AV_LOG_ERROR,
242  "Could not read code table %d.\n", i);
243  return ret;
244  }
245  }
246 
247  /* Read in and restore every line */
248  for (i = 0; i < avctx->height; i++) {
249  read_argb_line(ctx, gb, pred, vlc, dst);
250 
251  dst += pic->linesize[0];
252  }
253 
254  for (i = 0; i < 4; i++)
255  ff_vlc_free(&vlc[i]);
256 
257  return 0;
258 }
259 
261 {
262  AVCodecContext *avctx = ctx->avctx;
263  uint8_t *dst;
264  int pred[3];
265  int ret;
266  int i, j;
267  VLC vlc[3];
268 
269  pred[0] = 0x80;
270  pred[1] = 0x80;
271  pred[2] = 0x80;
272 
273  dst = pic->data[0];
274 
275  skip_bits(gb, 16);
276 
277  /* Read in code table for each plane */
278  for (i = 0; i < 3; i++) {
279  ret = read_code_table(ctx, gb, &vlc[i]);
280  if (ret < 0) {
281  for (j = 0; j < i; j++)
282  ff_vlc_free(&vlc[j]);
283 
284  av_log(ctx->avctx, AV_LOG_ERROR,
285  "Could not read code table %d.\n", i);
286  return ret;
287  }
288  }
289 
290  /* Read in and restore every line */
291  for (i = 0; i < avctx->height; i++) {
292  for (j = 0; j < 3; j++)
293  read_rgb24_component_line(ctx, gb, &pred[j], &vlc[j], &dst[j]);
294 
295  dst += pic->linesize[0];
296  }
297 
298  for (i = 0; i < 3; i++)
299  ff_vlc_free(&vlc[i]);
300 
301  return 0;
302 }
303 
305 {
306  AVCodecContext *avctx = ctx->avctx;
307  uint8_t block;
308  uint8_t *dst[3];
309  int pred[3];
310  int ret;
311  int i, j;
312  VLC vlc[2];
313 
314  pred[0] = 0x80;
315  pred[1] = 0x80;
316  pred[2] = 0x80;
317 
318  dst[0] = pic->data[0];
319  dst[1] = pic->data[1];
320  dst[2] = pic->data[2];
321 
322  skip_bits(gb, 8);
323 
324  block = get_bits(gb, 8);
325  if (block) {
326  avpriv_request_sample(ctx->avctx, "Blocked YUV");
327  return AVERROR_PATCHWELCOME;
328  }
329 
330  /* Read in code table for luma and chroma */
331  for (i = 0; i < 2; i++) {
332  ret = read_code_table(ctx, gb, &vlc[i]);
333  if (ret < 0) {
334  for (j = 0; j < i; j++)
335  ff_vlc_free(&vlc[j]);
336 
337  av_log(ctx->avctx, AV_LOG_ERROR,
338  "Could not read code table %d.\n", i);
339  return ret;
340  }
341  }
342 
343  /* Read in and restore every line */
344  for (i = 0; i < avctx->height; i++) {
345  read_yuv_component_line(ctx, gb, &pred[0], &vlc[0], dst[0], 0); /* Y */
346  read_yuv_component_line(ctx, gb, &pred[1], &vlc[1], dst[1], 1); /* U */
347  read_yuv_component_line(ctx, gb, &pred[2], &vlc[1], dst[2], 1); /* V */
348 
349  for (j = 0; j < 3; j++)
350  dst[j] += pic->linesize[j];
351  }
352 
353  for (i = 0; i < 2; i++)
354  ff_vlc_free(&vlc[i]);
355 
356  return 0;
357 }
358 
359 static int cllc_decode_frame(AVCodecContext *avctx, AVFrame *pic,
360  int *got_picture_ptr, AVPacket *avpkt)
361 {
362  CLLCContext *ctx = avctx->priv_data;
363  const uint8_t *src = avpkt->data;
364  uint32_t info_tag, info_offset;
365  int data_size;
366  GetBitContext gb;
367  int coding_type, ret;
368 
369  if (avpkt->size < 4 + 4) {
370  av_log(avctx, AV_LOG_ERROR, "Frame is too small %d.\n", avpkt->size);
371  return AVERROR_INVALIDDATA;
372  }
373 
374  info_offset = 0;
375  info_tag = AV_RL32(src);
376  if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
377  info_offset = AV_RL32(src + 4);
378  if (info_offset > UINT32_MAX - 8 || info_offset + 8 > avpkt->size) {
379  av_log(avctx, AV_LOG_ERROR,
380  "Invalid INFO header offset: 0x%08"PRIX32" is too large.\n",
381  info_offset);
382  return AVERROR_INVALIDDATA;
383  }
384  ff_canopus_parse_info_tag(avctx, src + 8, info_offset);
385 
386  info_offset += 8;
387  src += info_offset;
388  }
389 
390  data_size = (avpkt->size - info_offset) & ~1;
391 
392  /* Make sure our bswap16'd buffer is big enough */
393  av_fast_padded_malloc(&ctx->swapped_buf,
394  &ctx->swapped_buf_size, data_size);
395  if (!ctx->swapped_buf) {
396  av_log(avctx, AV_LOG_ERROR, "Could not allocate swapped buffer.\n");
397  return AVERROR(ENOMEM);
398  }
399 
400  /* bswap16 the buffer since CLLC's bitreader works in 16-bit words */
401  ctx->bdsp.bswap16_buf((uint16_t *) ctx->swapped_buf, (uint16_t *) src,
402  data_size / 2);
403 
404  if ((ret = init_get_bits8(&gb, ctx->swapped_buf, data_size)) < 0)
405  return ret;
406 
407  /*
408  * Read in coding type. The types are as follows:
409  *
410  * 0 - YUY2
411  * 1 - BGR24 (Triples)
412  * 2 - BGR24 (Quads)
413  * 3 - BGRA
414  */
415  coding_type = (AV_RL32(src) >> 8) & 0xFF;
416  av_log(avctx, AV_LOG_DEBUG, "Frame coding type: %d\n", coding_type);
417 
418  if(get_bits_left(&gb) < avctx->height * avctx->width)
419  return AVERROR_INVALIDDATA;
420 
421  switch (coding_type) {
422  case 0:
423  avctx->pix_fmt = AV_PIX_FMT_YUV422P;
424  avctx->bits_per_raw_sample = 8;
425 
426  if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
427  return ret;
428 
429  ret = decode_yuv_frame(ctx, &gb, pic);
430  if (ret < 0)
431  return ret;
432 
433  break;
434  case 1:
435  case 2:
436  avctx->pix_fmt = AV_PIX_FMT_RGB24;
437  avctx->bits_per_raw_sample = 8;
438 
439  if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
440  return ret;
441 
442  ret = decode_rgb24_frame(ctx, &gb, pic);
443  if (ret < 0)
444  return ret;
445 
446  break;
447  case 3:
448  avctx->pix_fmt = AV_PIX_FMT_ARGB;
449  avctx->bits_per_raw_sample = 8;
450 
451  if ((ret = ff_thread_get_buffer(avctx, pic, 0)) < 0)
452  return ret;
453 
454  ret = decode_argb_frame(ctx, &gb, pic);
455  if (ret < 0)
456  return ret;
457 
458  break;
459  default:
460  av_log(avctx, AV_LOG_ERROR, "Unknown coding type: %d.\n", coding_type);
461  return AVERROR_INVALIDDATA;
462  }
463 
464  pic->flags |= AV_FRAME_FLAG_KEY;
466 
467  *got_picture_ptr = 1;
468 
469  return avpkt->size;
470 }
471 
473 {
474  CLLCContext *ctx = avctx->priv_data;
475 
476  av_freep(&ctx->swapped_buf);
477 
478  return 0;
479 }
480 
482 {
483  CLLCContext *ctx = avctx->priv_data;
484 
485  /* Initialize various context values */
486  ctx->avctx = avctx;
487  ctx->swapped_buf = NULL;
488  ctx->swapped_buf_size = 0;
489 
490  ff_bswapdsp_init(&ctx->bdsp);
491 
492  return 0;
493 }
494 
496  .p.name = "cllc",
497  CODEC_LONG_NAME("Canopus Lossless Codec"),
498  .p.type = AVMEDIA_TYPE_VIDEO,
499  .p.id = AV_CODEC_ID_CLLC,
500  .priv_data_size = sizeof(CLLCContext),
503  .close = cllc_decode_close,
504  .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
505 };
ff_cllc_decoder
const FFCodec ff_cllc_decoder
Definition: cllc.c:495
bswapdsp.h
ff_vlc_init_from_lengths
int ff_vlc_init_from_lengths(VLC *vlc, int nb_bits, int nb_codes, const int8_t *lens, int lens_wrap, const void *symbols, int symbols_wrap, int symbols_size, int offset, int flags, void *logctx)
Build VLC decoding tables suitable for use with get_vlc2()
Definition: vlc.c:306
get_bits_left
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:695
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
read_yuv_component_line
static int read_yuv_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf, int is_chroma)
Definition: cllc.c:188
VLC_DEPTH
#define VLC_DEPTH
Definition: cllc.c:35
CLLCContext::avctx
AVCodecContext * avctx
Definition: cllc.c:39
GET_VLC
#define GET_VLC(code, name, gb, table, bits, max_depth)
If the vlc code is invalid and max_depth=1, then no bits will be removed.
Definition: get_bits.h:574
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:375
AVPacket::data
uint8_t * data
Definition: packet.h:524
decode_rgb24_frame
static int decode_rgb24_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
Definition: cllc.c:260
table
static const uint16_t table[]
Definition: prosumer.c:205
FFCodec
Definition: codec_internal.h:127
UPDATE_CACHE
#define UPDATE_CACHE(name, gb)
Definition: get_bits.h:225
AVFrame::flags
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
Definition: frame.h:647
thread.h
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:396
ff_thread_get_buffer
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have so the codec calls ff_thread_report set FF_CODEC_CAP_ALLOCATE_PROGRESS in FFCodec caps_internal and use ff_thread_get_buffer() to allocate frames. Otherwise decode directly into the user-supplied frames. Call ff_thread_report_progress() after some part of the current picture has decoded. A good place to put this is where draw_horiz_band() is called - add this if it isn 't called anywhere
skip_bits
static void skip_bits(GetBitContext *s, int n)
Definition: get_bits.h:381
read_rgb24_component_line
static int read_rgb24_component_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
Definition: cllc.c:158
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:335
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
cllc_decode_frame
static int cllc_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_picture_ptr, AVPacket *avpkt)
Definition: cllc.c:359
ff_canopus_parse_info_tag
int ff_canopus_parse_info_tag(AVCodecContext *avctx, const uint8_t *src, size_t size)
Definition: canopus.c:30
GetBitContext
Definition: get_bits.h:108
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
av_cold
#define av_cold
Definition: attributes.h:90
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:545
AV_FRAME_FLAG_KEY
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition: frame.h:626
CLOSE_READER
#define CLOSE_READER(name, gb)
Definition: get_bits.h:188
VLC_BITS
#define VLC_BITS
Definition: cllc.c:34
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
intreadwrite.h
bits
uint8_t bits
Definition: vp3data.h:128
cllc_decode_close
static av_cold int cllc_decode_close(AVCodecContext *avctx)
Definition: cllc.c:472
AVCodecContext::bits_per_raw_sample
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition: avcodec.h:1574
AV_LOG_DEBUG
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:201
ctx
AVFormatContext * ctx
Definition: movenc.c:49
get_bits.h
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:110
ff_bswapdsp_init
av_cold void ff_bswapdsp_init(BswapDSPContext *c)
Definition: bswapdsp.c:49
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:279
canopus.h
AVFrame::pict_type
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:477
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:366
AV_PIX_FMT_RGB24
@ AV_PIX_FMT_RGB24
packed RGB 8:8:8, 24bpp, RGBRGB...
Definition: pixfmt.h:75
read_argb_line
static int read_argb_line(CLLCContext *ctx, GetBitContext *gb, int *top_left, VLC *vlc, uint8_t *outbuf)
Definition: cllc.c:89
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
read_code_table
static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
Definition: cllc.c:46
AVPacket::size
int size
Definition: packet.h:525
codec_internal.h
decode_yuv_frame
static int decode_yuv_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
Definition: cllc.c:304
CLLCContext::swapped_buf
uint8_t * swapped_buf
Definition: cllc.c:42
OPEN_READER
#define OPEN_READER(name, gb)
Definition: get_bits.h:177
CLLCContext::bdsp
BswapDSPContext bdsp
Definition: cllc.c:40
cllc_decode_init
static av_cold int cllc_decode_init(AVCodecContext *avctx)
Definition: cllc.c:481
AV_PIX_FMT_ARGB
@ AV_PIX_FMT_ARGB
packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
Definition: pixfmt.h:99
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
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
av_fast_padded_malloc
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
Definition: utils.c:52
AV_CODEC_ID_CLLC
@ AV_CODEC_ID_CLLC
Definition: codec_id.h:218
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:194
AVCodecContext::height
int height
Definition: avcodec.h:618
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:657
avcodec.h
ff_vlc_free
void ff_vlc_free(VLC *vlc)
Definition: vlc.c:580
ret
ret
Definition: filter_design.txt:187
pred
static const float pred[4]
Definition: siprdata.h:259
AV_RL32
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
Definition: bytestream.h:92
AVCodecContext
main external API structure.
Definition: avcodec.h:445
CLLCContext
Definition: cllc.c:38
VLC
Definition: vlc.h:36
VLC::table
VLCElem * table
Definition: vlc.h:38
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
mem.h
decode_argb_frame
static int decode_argb_frame(CLLCContext *ctx, GetBitContext *gb, AVFrame *pic)
Definition: cllc.c:216
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:36
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:472
AVPacket
This structure stores compressed data.
Definition: packet.h:501
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:34
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
CLLCContext::swapped_buf_size
int swapped_buf_size
Definition: cllc.c:43
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:618
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:420
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
MKTAG
#define MKTAG(a, b, c, d)
Definition: macros.h:55
BswapDSPContext
Definition: bswapdsp.h:24