FFmpeg
leaddec.c
Go to the documentation of this file.
1 /*
2  * LEAD MCMP decoder
3  *
4  * Copyright (c) 2023 Peter Ross
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 "avcodec.h"
24 #include "blockdsp.h"
25 #include "codec_internal.h"
26 #include "copy_block.h"
27 #include "decode.h"
28 #include "get_bits.h"
29 #include "idctdsp.h"
30 #include "jpegquanttables.h"
31 #include "jpegtables.h"
32 #include "leaddata.h"
33 #include "libavutil/attributes.h"
34 #include "libavutil/mem.h"
35 #include "libavutil/mem_internal.h"
36 #include "libavutil/thread.h"
37 
38 #define LUMA_DC_BITS 9
39 #define CHROMA_DC_BITS 11
40 #define LUMA_AC_BITS 10
41 #define CHROMA_AC_BITS 10
42 
45 static VLCElem luma_ac_vlc[1160];
46 static VLCElem chroma_ac_vlc[1160];
47 
48 static av_cold void lead_init_static_data(void)
49 {
51  luma_dc_len, 1,
52  NULL, 0, 0,
53  0, 0);
55  chroma_dc_len, 1,
56  NULL, 0, 0,
57  0, 0);
59  luma_ac_len, 1,
61  0, 0);
63  chroma_ac_len, 1,
65  0, 0);
66 }
67 
68 typedef struct LeadContext {
69  uint8_t *bitstream_buf;
70  unsigned int bitstream_buf_size;
73  uint8_t permutated_scantable[64];
74 } LeadContext;
75 
77 {
78  static AVOnce init_static_once = AV_ONCE_INIT;
79  LeadContext *s = avctx->priv_data;
80 
81  if (avctx->extradata_size < 20)
82  return AVERROR_INVALIDDATA;
83 
84  ff_blockdsp_init(&s->bdsp);
85  ff_idctdsp_init(&s->idsp, avctx);
86  ff_permute_scantable(s->permutated_scantable, ff_zigzag_direct, s->idsp.idct_permutation);
87 
88  ff_thread_once(&init_static_once, lead_init_static_data);
89 
90  return 0;
91 }
92 
93 static void calc_dequant(uint16_t * dequant, const uint8_t * quant_tbl, int q)
94 {
95  for (int i = 0; i < 64; i++)
96  dequant[i] = av_clip(q * quant_tbl[ff_zigzag_direct[i]] / 50, 2, 32767);
97 }
98 
100  const VLCElem * dc_table, int dc_bits, const VLCElem * ac_table, int ac_bits,
101  int16_t * dc_pred, const uint16_t * dequant,
102  uint8_t * dst, int stride)
103 {
104  DECLARE_ALIGNED(32, int16_t, block)[64];
105  int size;
106 
107  s->bdsp.clear_block(block);
108 
109  if (get_bits_left(gb) <= 0)
110  return AVERROR_INVALIDDATA;
111 
112  size = get_vlc2(gb, dc_table, dc_bits, 1);
113  if (size < 0)
114  return AVERROR_INVALIDDATA;
115 
116  if (size)
117  *dc_pred += get_xbits(gb, size);
118 
119  block[0] = (1 << 10) + *dc_pred * dequant[0];
120 
121  for (int i = 1; i < 64; i++) {
122  int symbol = get_vlc2(gb, ac_table, ac_bits, 2);
123  if (symbol < 0)
124  return AVERROR_INVALIDDATA;
125 
126  if (!symbol)
127  break;
128 
129  i += symbol >> 4;
130  if (i >= 64)
131  return AVERROR_INVALIDDATA;
132 
133  size = symbol & 0xF;
134  if (size)
135  block[s->permutated_scantable[i]] = get_xbits(gb, size) * dequant[i];
136  }
137 
138  s->idsp.idct_put(dst, stride, block);
139  return 0;
140 }
141 
143  int * got_frame, AVPacket * avpkt)
144 {
145  LeadContext *s = avctx->priv_data;
146  const uint8_t * buf = avpkt->data;
147  int ret, format, zero = 0, yuv20p_half = 0, fields = 1, q, size;
148  GetBitContext gb;
149  int16_t dc_pred[3] = {0, 0, 0};
150  uint16_t dequant[2][64];
151 
152  if (avpkt->size < 8)
153  return AVERROR_INVALIDDATA;
154 
155  format = AV_RL16(buf + 4);
156  switch(format) {
157  case 0x0:
158  zero = 1;
159  avctx->pix_fmt = AV_PIX_FMT_YUV420P;
160  break;
161  case 0x6:
162  case 0x8000:
163  yuv20p_half = 1;
165  case 0x1000:
166  avctx->pix_fmt = AV_PIX_FMT_YUV420P;
167  break;
168  case 0x1006:
169  fields = 2;
170  avctx->pix_fmt = AV_PIX_FMT_YUV420P;
171  break;
172  case 0x2000:
173  avctx->pix_fmt = AV_PIX_FMT_YUV444P;
174  break;
175  case 0x2006:
176  avctx->pix_fmt = AV_PIX_FMT_YUV444P;
177  fields = 2;
178  break;
179  default:
180  avpriv_request_sample(avctx, "unsupported format 0x%x", format);
181  return AVERROR_PATCHWELCOME;
182  }
183 
184  q = AV_RL16(buf + 6);
187 
188  int mb_size_log2 = 4 - (avctx->pix_fmt == AV_PIX_FMT_YUV444P);
189  int blocks_per_mb = 2 + (1<<mb_size_log2)*(1<<mb_size_log2) / 64 - 2*yuv20p_half;
190  // Check against a lower bound of the input bitstream size
191  // Each block has at least a dc and ac code
192  // The smallest DC and AC code are each 2 bit
193  // There are cases where a column at the right or row at the bottom cannot be encoded, these are disregarded in this check as they do not fulfill the contract of encoding width x height pixels. They are either unsupported by the format or our implementation is incorrect
194  if ((avpkt->size - 8LL) * 8 < AV_CEIL_RSHIFT(avctx->width, mb_size_log2) * AV_CEIL_RSHIFT(avctx->height, mb_size_log2) * blocks_per_mb * (2 + 2))
195  return AVERROR_INVALIDDATA;
196 
197  if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
198  return ret;
199 
200  av_fast_padded_malloc(&s->bitstream_buf, &s->bitstream_buf_size, avpkt->size - 8);
201  if (!s->bitstream_buf)
202  return AVERROR(ENOMEM);
203 
204  size = 0;
205  for (int i = 8; i < avpkt->size; i++) {
206  int src = buf[i] ^ 0x80;
207  s->bitstream_buf[size++] = src;
208  if (src == 0xFF && i + 1 < avpkt->size && (buf[i + 1] ^ 0x80) == 0x00)
209  i++;
210  }
211 
212  ret = init_get_bits8(&gb, s->bitstream_buf, size);
213  if (ret < 0)
214  return ret;
215 
216  if (avctx->pix_fmt == AV_PIX_FMT_YUV420P && zero) {
217  for (int mb_y = 0; mb_y < avctx->height / 8; mb_y++)
218  for (int mb_x = 0; mb_x < avctx->width / 16; mb_x++)
219  for (int b = 0; b < 4; b++) {
220  int luma_block = 2;
221  const VLCElem * dc_vlc = b < luma_block ? luma_dc_vlc : chroma_dc_vlc;
222  int dc_bits = b < luma_block ? LUMA_DC_BITS : CHROMA_DC_BITS;
223  const VLCElem * ac_vlc = b < luma_block ? luma_ac_vlc : chroma_ac_vlc;
224  int ac_bits = b < luma_block ? LUMA_AC_BITS : CHROMA_AC_BITS;
225  int plane = b < luma_block ? 0 : b - 1;
226  int x, y, yclip;
227 
228  if (b < luma_block) {
229  y = 8*mb_y + 8*(b >> 1);
230  x = 16*mb_x + 8*(b & 1);
231  yclip = 0;
232  } else {
233  y = 4*mb_y;
234  x = 8*mb_x;
235  yclip = y + 8 >= avctx->height / 2;
236  }
237 
238  if (yclip) {
239  uint8_t tmp[64];
240  ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits,
241  dc_pred + plane, dequant[!(b < 4)], tmp, 8);
242  for (int yy = 0; yy < 8 && y + yy < avctx->height / 2; yy++)
243  memcpy(frame->data[plane] + (y+yy)*frame->linesize[plane] + x, tmp + yy, 8);
244  } else {
245  ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits,
246  dc_pred + plane, dequant[!(b < 4)],
247  frame->data[plane] + y*frame->linesize[plane] + x,
248  frame->linesize[plane]);
249  }
250  if (ret < 0)
251  return ret;
252  }
253  } else if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
254  for (int f = 0; f < fields; f++)
255  for (int mb_y = 0; mb_y < (avctx->height + 15) / 16 / fields; mb_y++)
256  for (int mb_x = 0; mb_x < (avctx->width + 15) / 16; mb_x++)
257  for (int b = 0; b < (yuv20p_half ? 4 : 6); b++) {
258  int luma_block = yuv20p_half ? 2 : 4;
259  const VLCElem * dc_vlc = b < luma_block ? luma_dc_vlc : chroma_dc_vlc;
260  int dc_bits = b < luma_block ? LUMA_DC_BITS : CHROMA_DC_BITS;
261  const VLCElem * ac_vlc = b < luma_block ? luma_ac_vlc : chroma_ac_vlc;
262  int ac_bits = b < luma_block ? LUMA_AC_BITS : CHROMA_AC_BITS;
263  int plane = b < luma_block ? 0 : b - (yuv20p_half ? 1 : 3);
264  int x, y;
265 
266  if (b < luma_block) {
267  y = 16*mb_y + 8*(b >> 1);
268  x = 16*mb_x + 8*(b & 1);
269  } else {
270  y = 8*mb_y;
271  x = 8*mb_x;
272  }
273 
274  ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits,
275  dc_pred + plane, dequant[!(b < 4)],
276  frame->data[plane] + (f + y*fields)*frame->linesize[plane] + x,
277  (yuv20p_half && b < 2 ? 2 : 1) * fields * frame->linesize[plane]);
278  if (ret < 0)
279  return ret;
280 
281  if (yuv20p_half && b < 2)
282  copy_block8(frame->data[plane] + (y + 1)*frame->linesize[plane] + x,
283  frame->data[plane] + y*frame->linesize[plane] + x,
284  2*frame->linesize[plane], 2*frame->linesize[plane], 8);
285  }
286  } else {
287  for (int f = 0; f < fields; f++)
288  for (int j = 0; j < (avctx->height + 7) / fields / 8; j++)
289  for (int i = 0; i < (avctx->width + 7) / 8; i++)
290  for (int plane = 0; plane < 3; plane++) {
291  const VLCElem * dc_vlc = !plane ? luma_dc_vlc : chroma_dc_vlc;
292  int dc_bits = !plane ? LUMA_DC_BITS : CHROMA_DC_BITS;
293  const VLCElem * ac_vlc = !plane ? luma_ac_vlc : chroma_ac_vlc;
294  int ac_bits = !plane ? LUMA_AC_BITS : CHROMA_AC_BITS;
295 
296  ret = decode_block(s, &gb, dc_vlc, dc_bits, ac_vlc, ac_bits,
297  dc_pred + plane, dequant[!!plane],
298  frame->data[plane] + (f + 8*j*fields)*frame->linesize[plane] + 8*i,
299  fields * frame->linesize[plane]);
300  if (ret < 0)
301  return ret;
302  }
303  }
304 
305  *got_frame = 1;
306 
307  return avpkt->size;
308 }
309 
311 {
312  LeadContext *s = avctx->priv_data;
313 
314  av_freep(&s->bitstream_buf);
315 
316  return 0;
317 }
318 
320  .p.name = "lead",
321  CODEC_LONG_NAME("LEAD MCMP"),
322  .p.type = AVMEDIA_TYPE_VIDEO,
323  .p.id = AV_CODEC_ID_LEAD,
324  .priv_data_size = sizeof(LeadContext),
328  .p.capabilities = AV_CODEC_CAP_DR1,
329  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
330 };
LeadContext::bdsp
BlockDSPContext bdsp
Definition: leaddec.c:71
jpegtables.h
av_clip
#define av_clip
Definition: common.h:100
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: codec_internal.h:43
blockdsp.h
get_bits_left
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:688
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
mem_internal.h
chroma_dc_vlc
static VLCElem chroma_dc_vlc[1<< CHROMA_DC_BITS]
Definition: leaddec.c:44
thread.h
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:435
CHROMA_AC_BITS
#define CHROMA_AC_BITS
Definition: leaddec.c:41
AVPacket::data
uint8_t * data
Definition: packet.h:595
b
#define b
Definition: input.c:43
FFCodec
Definition: codec_internal.h:127
copy_block8
static void copy_block8(uint8_t *dst, const uint8_t *src, ptrdiff_t dstStride, ptrdiff_t srcStride, int h)
Definition: copy_block.h:47
LeadContext::idsp
IDCTDSPContext idsp
Definition: leaddec.c:72
BlockDSPContext
Definition: blockdsp.h:32
ff_idctdsp_init
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
Definition: idctdsp.c:228
ff_permute_scantable
av_cold void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64], const uint8_t permutation[64])
Definition: idctdsp.c:30
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:197
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
GetBitContext
Definition: get_bits.h:109
dequant
static int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf, int16_t *dst, int mul, int shift, int coeff_num)
Definition: cavsdec.c:522
lead_decode_end
static av_cold int lead_decode_end(AVCodecContext *avctx)
Definition: leaddec.c:310
ff_thread_once
static int ff_thread_once(char *control, void(*routine)(void))
Definition: thread.h:205
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:119
chroma_dc_len
static const uint8_t chroma_dc_len[]
Definition: leaddata.h:30
init_get_bits8
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition: get_bits.h:544
AVCodecContext::extradata_size
int extradata_size
Definition: avcodec.h:523
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:347
ff_blockdsp_init
av_cold void ff_blockdsp_init(BlockDSPContext *c)
Definition: blockdsp.c:58
s
#define s(width, name)
Definition: cbs_vp9.c:198
AV_CEIL_RSHIFT
#define AV_CEIL_RSHIFT(a, b)
Definition: common.h:60
luma_ac_len
static const uint8_t luma_ac_len[]
Definition: leaddata.h:34
LeadContext::bitstream_buf_size
unsigned int bitstream_buf_size
Definition: leaddec.c:70
decode.h
get_bits.h
AV_RL16
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_RL16
Definition: bytestream.h:94
LeadContext::bitstream_buf
uint8_t * bitstream_buf
Definition: leaddec.c:69
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
av_fallthrough
#define av_fallthrough
Definition: attributes.h:67
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:332
tmp
static uint8_t tmp[40]
Definition: aes_ctr.c:52
fields
the definition of that something depends on the semantic of the filter The callback must examine the status of the filter s links and proceed accordingly The status of output links is stored in the status_in and status_out fields and tested by the then the processing requires a frame on this link and the filter is expected to make efforts in that direction The status of input links is stored by the fifo and status_out fields
Definition: filter_design.txt:155
dc_vlc
static VLCElem dc_vlc[1104]
Definition: clearvideo.c:79
AV_CODEC_ID_LEAD
@ AV_CODEC_ID_LEAD
Definition: codec_id.h:328
AV_ONCE_INIT
#define AV_ONCE_INIT
Definition: thread.h:203
NULL
#define NULL
Definition: coverity.c:32
AVERROR_PATCHWELCOME
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
Definition: error.h:64
format
New swscale design to change SwsGraph is what coordinates multiple passes These can include cascaded scaling error diffusion and so on Or we could have separate passes for the vertical and horizontal scaling In between each SwsPass lies a fully allocated image buffer Graph passes may have different levels of e g we can have a single threaded error diffusion pass following a multi threaded scaling pass SwsGraph is internally recreated whenever the image format
Definition: swscale-v2.txt:14
ff_mjpeg_val_ac_chrominance
const uint8_t ff_mjpeg_val_ac_chrominance[]
Definition: jpegtabs.h:69
leaddata.h
get_vlc2
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
Definition: get_bits.h:645
jpegquanttables.h
lead_decode_init
static av_cold int lead_decode_init(AVCodecContext *avctx)
Definition: leaddec.c:76
AVOnce
#define AVOnce
Definition: thread.h:202
CHROMA_DC_BITS
#define CHROMA_DC_BITS
Definition: leaddec.c:39
LUMA_DC_BITS
#define LUMA_DC_BITS
Definition: leaddec.c:38
f
f
Definition: af_crystalizer.c:122
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1765
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:551
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
ff_mjpeg_val_ac_luminance
const uint8_t ff_mjpeg_val_ac_luminance[]
Definition: jpegtabs.h:42
AVPacket::size
int size
Definition: packet.h:596
codec_internal.h
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:104
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:87
i
#define i(width, name, range_min, range_max)
Definition: cbs_h264.c:63
luma_dc_len
static const uint8_t luma_dc_len[]
Definition: leaddata.h:26
LeadContext::permutated_scantable
uint8_t permutated_scantable[64]
Definition: leaddec.c:73
size
int size
Definition: twinvq_data.h:10344
VLCElem
Definition: vlc.h:32
decode_block
static int decode_block(LeadContext *s, GetBitContext *gb, const VLCElem *dc_table, int dc_bits, const VLCElem *ac_table, int ac_bits, int16_t *dc_pred, const uint16_t *dequant, uint8_t *dst, int stride)
Definition: leaddec.c:99
attributes.h
get_xbits
static int get_xbits(GetBitContext *s, int n)
Read MPEG-1 dc-style VLC (sign bit + mantissa with no MSB).
Definition: get_bits.h:294
zero
static int zero(InterplayACMContext *s, unsigned ind, unsigned col)
Definition: interplayacm.c:121
ff_lead_decoder
const FFCodec ff_lead_decoder
Definition: leaddec.c:319
copy_block.h
luma_ac_vlc
static VLCElem luma_ac_vlc[1160]
Definition: leaddec.c:45
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:53
ff_mjpeg_std_chrominance_quant_tbl
const uint8_t ff_mjpeg_std_chrominance_quant_tbl[64]
Definition: jpegquanttables.c:45
lead_decode_frame
static int lead_decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
Definition: leaddec.c:142
lead_init_static_data
static av_cold void lead_init_static_data(void)
Definition: leaddec.c:48
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:179
AVCodecContext::height
int height
Definition: avcodec.h:600
luma_dc_vlc
static VLCElem luma_dc_vlc[1<< LUMA_DC_BITS]
Definition: leaddec.c:43
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:639
calc_dequant
static void calc_dequant(uint16_t *dequant, const uint8_t *quant_tbl, int q)
Definition: leaddec.c:93
idctdsp.h
avcodec.h
ff_zigzag_direct
const uint8_t ff_zigzag_direct[64]
Definition: mathtables.c:137
ret
ret
Definition: filter_design.txt:187
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:265
IDCTDSPContext
Definition: idctdsp.h:43
ff_mjpeg_std_luminance_quant_tbl
const uint8_t ff_mjpeg_std_luminance_quant_tbl[64]
Definition: jpegquanttables.c:35
AVCodecContext
main external API structure.
Definition: avcodec.h:439
chroma_ac_vlc
static VLCElem chroma_ac_vlc[1160]
Definition: leaddec.c:46
ac_vlc
static VLCElem ac_vlc[554]
Definition: clearvideo.c:79
chroma_ac_len
static const uint8_t chroma_ac_len[]
Definition: leaddata.h:48
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
mem.h
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:37
VLC_INIT_STATIC_TABLE_FROM_LENGTHS
#define VLC_INIT_STATIC_TABLE_FROM_LENGTHS(vlc_table, nb_bits, nb_codes, lens, lens_wrap, syms, syms_wrap, syms_size, offset, flags)
Definition: vlc.h:288
AVPacket
This structure stores compressed data.
Definition: packet.h:572
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:466
av_freep
#define av_freep(p)
Definition: tableprint_vlc.h:35
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:600
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
LUMA_AC_BITS
#define LUMA_AC_BITS
Definition: leaddec.c:40
stride
#define stride
Definition: h264pred_template.c:536
LeadContext
Definition: leaddec.c:68
src
#define src
Definition: vp8dsp.c:248