FFmpeg
hq_hqa.c
Go to the documentation of this file.
1 /*
2  * Canopus HQ/HQA decoder
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include <stdint.h>
22 
23 #include "libavutil/attributes.h"
24 #include "libavutil/mem_internal.h"
25 #include "libavutil/thread.h"
26 
27 #include "avcodec.h"
28 #include "bytestream.h"
29 #include "canopus.h"
30 #include "codec_internal.h"
31 #include "decode.h"
32 #include "get_bits.h"
33 #include "hq_hqadata.h"
34 #include "hq_hqadsp.h"
35 #include "vlc.h"
36 
37 /* HQ/HQA slices are a set of macroblocks belonging to a frame, and
38  * they usually form a pseudorandom pattern (probably because it is
39  * nicer to display on partial decode).
40  *
41  * For HQA it just happens that each slice is on every 8th macroblock,
42  * but they can be on any frame width like
43  * X.......X.
44  * ......X...
45  * ....X.....
46  * ..X.......
47  * etc.
48  *
49  * The original decoder has special handling for edge macroblocks,
50  * while lavc simply aligns coded_width and coded_height.
51  */
52 
53 typedef struct HQContext {
56 
57  DECLARE_ALIGNED(16, int16_t, block)[12][64];
58 } HQContext;
59 
60 static VLCElem hq_ac_vlc[1184];
61 static VLCElem hqa_cbp_vlc[32];
62 
63 static inline void put_blocks(HQContext *c, AVFrame *pic,
64  int plane, int x, int y, int ilace,
65  int16_t *block0, int16_t *block1)
66 {
67  uint8_t *p = pic->data[plane] + x;
68 
69  c->hqhqadsp.idct_put(p + y * pic->linesize[plane],
70  pic->linesize[plane] << ilace, block0);
71  c->hqhqadsp.idct_put(p + (y + (ilace ? 1 : 8)) * pic->linesize[plane],
72  pic->linesize[plane] << ilace, block1);
73 }
74 
75 static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
76  int qsel, int is_chroma, int is_hqa)
77 {
78  const int32_t *q;
79  int val, pos = 1;
80 
81  memset(block, 0, 64 * sizeof(*block));
82 
83  if (!is_hqa) {
84  block[0] = get_sbits(gb, 9) * 64;
85  q = hq_quants[qsel][is_chroma][get_bits(gb, 2)];
86  } else {
87  q = hq_quants[qsel][is_chroma][get_bits(gb, 2)];
88  block[0] = get_sbits(gb, 9) * 64;
89  }
90 
91  for (;;) {
92  val = get_vlc2(gb, hq_ac_vlc, 9, 2);
93  if (val < 0)
94  return AVERROR_INVALIDDATA;
95 
96  pos += hq_ac_skips[val];
97  if (pos >= 64)
98  break;
99  block[ff_zigzag_direct[pos]] = (int)(hq_ac_syms[val] * (unsigned)q[pos]) >> 12;
100  pos++;
101  }
102 
103  return 0;
104 }
105 
106 static int hq_decode_mb(HQContext *c, AVFrame *pic,
107  GetBitContext *gb, int x, int y)
108 {
109  int qgroup, flag;
110  int i, ret;
111 
112  qgroup = get_bits(gb, 4);
113  flag = get_bits1(gb);
114 
115  for (i = 0; i < 8; i++) {
116  ret = hq_decode_block(c, gb, c->block[i], qgroup, i >= 4, 0);
117  if (ret < 0)
118  return ret;
119  }
120 
121  put_blocks(c, pic, 0, x, y, flag, c->block[0], c->block[2]);
122  put_blocks(c, pic, 0, x + 8, y, flag, c->block[1], c->block[3]);
123  put_blocks(c, pic, 2, x >> 1, y, flag, c->block[4], c->block[5]);
124  put_blocks(c, pic, 1, x >> 1, y, flag, c->block[6], c->block[7]);
125 
126  return 0;
127 }
128 
130  int prof_num, size_t data_size)
131 {
132  const HQProfile *profile;
133  GetBitContext gb;
134  const uint8_t *perm, *src = gbc->buffer;
135  uint32_t slice_off[21];
136  int slice, start_off, next_off, i, ret;
137 
138  if ((unsigned)prof_num >= NUM_HQ_PROFILES) {
139  profile = &hq_profile[0];
140  avpriv_request_sample(ctx->avctx, "HQ Profile %d", prof_num);
141  } else {
142  profile = &hq_profile[prof_num];
143  av_log(ctx->avctx, AV_LOG_VERBOSE, "HQ Profile %d\n", prof_num);
144  }
145 
146  ctx->avctx->coded_width = FFALIGN(profile->width, 16);
147  ctx->avctx->coded_height = FFALIGN(profile->height, 16);
148  ctx->avctx->width = profile->width;
149  ctx->avctx->height = profile->height;
150  ctx->avctx->bits_per_raw_sample = 8;
151  ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
152 
153  ret = ff_get_buffer(ctx->avctx, pic, 0);
154  if (ret < 0)
155  return ret;
156 
157  /* Offsets are stored from CUV position, so adjust them accordingly. */
158  for (i = 0; i < profile->num_slices + 1; i++)
159  slice_off[i] = bytestream2_get_be24(gbc) - 4;
160 
161  next_off = 0;
162  for (slice = 0; slice < profile->num_slices; slice++) {
163  start_off = next_off;
164  next_off = profile->tab_h * (slice + 1) / profile->num_slices;
165  perm = profile->perm_tab + start_off * profile->tab_w * 2;
166 
167  if (slice_off[slice] < (profile->num_slices + 1) * 3 ||
168  slice_off[slice] >= slice_off[slice + 1] ||
169  slice_off[slice + 1] > data_size) {
170  av_log(ctx->avctx, AV_LOG_ERROR,
171  "Invalid slice size %"SIZE_SPECIFIER".\n", data_size);
172  break;
173  }
174  init_get_bits(&gb, src + slice_off[slice],
175  (slice_off[slice + 1] - slice_off[slice]) * 8);
176 
177  for (i = 0; i < (next_off - start_off) * profile->tab_w; i++) {
178  ret = hq_decode_mb(ctx, pic, &gb, perm[0] * 16, perm[1] * 16);
179  if (ret < 0) {
180  av_log(ctx->avctx, AV_LOG_ERROR,
181  "Error decoding macroblock %d at slice %d.\n", i, slice);
182  return ret;
183  }
184  perm += 2;
185  }
186  }
187 
188  return 0;
189 }
190 
191 static int hqa_decode_mb(HQContext *c, AVFrame *pic, int qgroup,
192  GetBitContext *gb, int x, int y)
193 {
194  int flag = 0;
195  int i, ret, cbp;
196 
197  if (get_bits_left(gb) < 1)
198  return AVERROR_INVALIDDATA;
199 
200  cbp = get_vlc2(gb, hqa_cbp_vlc, 5, 1);
201 
202  for (i = 0; i < 12; i++)
203  memset(c->block[i], 0, sizeof(*c->block));
204  for (i = 0; i < 12; i++)
205  c->block[i][0] = -128 * (1 << 6);
206 
207  if (cbp) {
208  flag = get_bits1(gb);
209 
210  cbp |= cbp << 4;
211  if (cbp & 0x3)
212  cbp |= 0x500;
213  if (cbp & 0xC)
214  cbp |= 0xA00;
215  for (i = 0; i < 12; i++) {
216  if (!(cbp & (1 << i)))
217  continue;
218  ret = hq_decode_block(c, gb, c->block[i], qgroup, i >= 8, 1);
219  if (ret < 0)
220  return ret;
221  }
222  }
223 
224  put_blocks(c, pic, 3, x, y, flag, c->block[ 0], c->block[ 2]);
225  put_blocks(c, pic, 3, x + 8, y, flag, c->block[ 1], c->block[ 3]);
226  put_blocks(c, pic, 0, x, y, flag, c->block[ 4], c->block[ 6]);
227  put_blocks(c, pic, 0, x + 8, y, flag, c->block[ 5], c->block[ 7]);
228  put_blocks(c, pic, 2, x >> 1, y, flag, c->block[ 8], c->block[ 9]);
229  put_blocks(c, pic, 1, x >> 1, y, flag, c->block[10], c->block[11]);
230 
231  return 0;
232 }
233 
235  int quant, int slice_no, int w, int h)
236 {
237  int i, j, off;
238  int ret;
239 
240  for (i = 0; i < h; i += 16) {
241  off = (slice_no * 16 + i * 3) & 0x70;
242  for (j = off; j < w; j += 128) {
243  ret = hqa_decode_mb(ctx, pic, quant, gb, j, i);
244  if (ret < 0) {
245  av_log(ctx->avctx, AV_LOG_ERROR,
246  "Error decoding macroblock at %dx%d.\n", i, j);
247  return ret;
248  }
249  }
250  }
251 
252  return 0;
253 }
254 
255 static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, size_t data_size)
256 {
257  GetBitContext gb;
258  const int num_slices = 8;
259  uint32_t slice_off[9];
260  int i, slice, ret;
261  int width, height, quant;
262  const uint8_t *src = gbc->buffer;
263 
264  if (bytestream2_get_bytes_left(gbc) < 8 + 4*(num_slices + 1))
265  return AVERROR_INVALIDDATA;
266 
267  width = bytestream2_get_be16(gbc);
268  height = bytestream2_get_be16(gbc);
269 
270  ret = ff_set_dimensions(ctx->avctx, width, height);
271  if (ret < 0)
272  return ret;
273 
274  ctx->avctx->coded_width = FFALIGN(width, 16);
275  ctx->avctx->coded_height = FFALIGN(height, 16);
276  ctx->avctx->bits_per_raw_sample = 8;
277  ctx->avctx->pix_fmt = AV_PIX_FMT_YUVA422P;
278 
279  av_log(ctx->avctx, AV_LOG_VERBOSE, "HQA Profile\n");
280 
281  quant = bytestream2_get_byte(gbc);
282  bytestream2_skip(gbc, 3);
283  if (quant >= NUM_HQ_QUANTS) {
284  av_log(ctx->avctx, AV_LOG_ERROR,
285  "Invalid quantization matrix %d.\n", quant);
286  return AVERROR_INVALIDDATA;
287  }
288 
289  ret = ff_get_buffer(ctx->avctx, pic, 0);
290  if (ret < 0)
291  return ret;
292 
293  /* Offsets are stored from HQA1 position, so adjust them accordingly. */
294  for (i = 0; i < num_slices + 1; i++)
295  slice_off[i] = bytestream2_get_be32(gbc) - 4;
296 
297  for (slice = 0; slice < num_slices; slice++) {
298  if (slice_off[slice] < (num_slices + 1) * 3 ||
299  slice_off[slice] >= slice_off[slice + 1] ||
300  slice_off[slice + 1] > data_size) {
301  av_log(ctx->avctx, AV_LOG_ERROR,
302  "Invalid slice size %"SIZE_SPECIFIER".\n", data_size);
303  break;
304  }
305  init_get_bits(&gb, src + slice_off[slice],
306  (slice_off[slice + 1] - slice_off[slice]) * 8);
307 
308  ret = hqa_decode_slice(ctx, pic, &gb, quant, slice, width, height);
309  if (ret < 0)
310  return ret;
311  }
312 
313  return 0;
314 }
315 
317  int *got_frame, AVPacket *avpkt)
318 {
319  HQContext *ctx = avctx->priv_data;
320  GetByteContext gbc0, *const gbc = &gbc0;
321  uint32_t info_tag;
322  unsigned int data_size;
323  int ret;
324  unsigned tag;
325 
326  bytestream2_init(gbc, avpkt->data, avpkt->size);
327  if (bytestream2_get_bytes_left(gbc) < 4 + 4) {
328  av_log(avctx, AV_LOG_ERROR, "Frame is too small (%d).\n", avpkt->size);
329  return AVERROR_INVALIDDATA;
330  }
331 
332  info_tag = bytestream2_peek_le32(gbc);
333  if (info_tag == MKTAG('I', 'N', 'F', 'O')) {
334  int info_size;
335  bytestream2_skip(gbc, 4);
336  info_size = bytestream2_get_le32(gbc);
337  if (info_size < 0 || bytestream2_get_bytes_left(gbc) < info_size) {
338  av_log(avctx, AV_LOG_ERROR, "Invalid INFO size (%d).\n", info_size);
339  return AVERROR_INVALIDDATA;
340  }
341  ff_canopus_parse_info_tag(avctx, gbc->buffer, info_size);
342 
343  bytestream2_skip(gbc, info_size);
344  }
345 
346  data_size = bytestream2_get_bytes_left(gbc);
347  if (data_size < 4) {
348  av_log(avctx, AV_LOG_ERROR, "Frame is too small (%d).\n", data_size);
349  return AVERROR_INVALIDDATA;
350  }
351 
352  /* HQ defines dimensions and number of slices, and thus slice traversal
353  * order. HQA has no size constraint and a fixed number of slices, so it
354  * needs a separate scheme for it. */
355  tag = bytestream2_get_le32(gbc);
356  if ((tag & 0x00FFFFFF) == (MKTAG('U', 'V', 'C', ' ') & 0x00FFFFFF)) {
357  ret = hq_decode_frame(ctx, pic, gbc, tag >> 24, data_size);
358  } else if (tag == MKTAG('H', 'Q', 'A', '1')) {
359  ret = hqa_decode_frame(ctx, pic, gbc, data_size);
360  } else {
361  av_log(avctx, AV_LOG_ERROR, "Not a HQ/HQA frame.\n");
362  return AVERROR_INVALIDDATA;
363  }
364  if (ret < 0) {
365  av_log(avctx, AV_LOG_ERROR, "Error decoding frame.\n");
366  return ret;
367  }
368 
369  pic->flags |= AV_FRAME_FLAG_KEY;
371 
372  *got_frame = 1;
373 
374  return avpkt->size;
375 }
376 
377 static av_cold void hq_init_vlcs(void)
378 {
380  cbp_vlc_lens, 1, 1, cbp_vlc_bits, 1, 1, 0);
381 
383  hq_ac_bits, 1, 1, hq_ac_codes, 2, 2, 0);
384 }
385 
387 {
388  static AVOnce init_static_once = AV_ONCE_INIT;
389  HQContext *ctx = avctx->priv_data;
390  ctx->avctx = avctx;
391 
392  ff_hqdsp_init(&ctx->hqhqadsp);
393 
394  ff_thread_once(&init_static_once, hq_init_vlcs);
395 
396  return 0;
397 }
398 
400  .p.name = "hq_hqa",
401  CODEC_LONG_NAME("Canopus HQ/HQA"),
402  .p.type = AVMEDIA_TYPE_VIDEO,
403  .p.id = AV_CODEC_ID_HQ_HQA,
404  .priv_data_size = sizeof(HQContext),
407  .p.capabilities = AV_CODEC_CAP_DR1,
408 };
hq_decode_block
static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64], int qsel, int is_chroma, int is_hqa)
Definition: hq_hqa.c:75
NUM_HQ_QUANTS
#define NUM_HQ_QUANTS
Definition: hq_hqadata.h:28
get_bits_left
static int get_bits_left(GetBitContext *gb)
Definition: get_bits.h:694
mem_internal.h
GetByteContext
Definition: bytestream.h:33
thread.h
hq_ac_bits
static const uint8_t hq_ac_bits[NUM_HQ_AC_ENTRIES]
Definition: hq_hqadata.h:1159
hq_decode_mb
static int hq_decode_mb(HQContext *c, AVFrame *pic, GetBitContext *gb, int x, int y)
Definition: hq_hqa.c:106
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:340
w
uint8_t w
Definition: llviddspenc.c:38
AVPacket::data
uint8_t * data
Definition: packet.h:522
FFCodec
Definition: codec_internal.h:127
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:196
AVFrame::flags
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
Definition: frame.h:612
hq_ac_syms
static const int16_t hq_ac_syms[NUM_HQ_AC_ENTRIES]
Definition: hq_hqadata.h:1356
ff_set_dimensions
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:94
init_get_bits
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
Definition: get_bits.h:514
hq_hqa_decode_frame
static int hq_hqa_decode_frame(AVCodecContext *avctx, AVFrame *pic, int *got_frame, AVPacket *avpkt)
Definition: hq_hqa.c:316
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:361
bytestream2_skip
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
Definition: bytestream.h:168
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
NUM_HQ_PROFILES
#define NUM_HQ_PROFILES
Definition: hq_hqadata.h:27
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
perm
perm
Definition: f_perms.c:75
val
static double val(void *priv, double ch)
Definition: aeval.c:78
hq_decode_frame
static int hq_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, int prof_num, size_t data_size)
Definition: hq_hqa.c:129
hq_ac_skips
static const uint8_t hq_ac_skips[NUM_HQ_AC_ENTRIES]
Definition: hq_hqadata.h:1306
quant
static const uint8_t quant[64]
Definition: vmixdec.c:71
ff_thread_once
static int ff_thread_once(char *control, void(*routine)(void))
Definition: thread.h:205
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:180
FF_ARRAY_ELEMS
#define FF_ARRAY_ELEMS(a)
Definition: sinewin_tablegen.c:29
av_cold
#define av_cold
Definition: attributes.h:90
AV_FRAME_FLAG_KEY
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition: frame.h:591
HQContext::avctx
AVCodecContext * avctx
Definition: hq_hqa.c:54
width
#define width
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:287
HQProfile
Definition: hq_hqadata.h:30
HQContext::hqhqadsp
HQDSPContext hqhqadsp
Definition: hq_hqa.c:55
hqa_decode_slice
static int hqa_decode_slice(HQContext *ctx, AVFrame *pic, GetBitContext *gb, int quant, int slice_no, int w, int h)
Definition: hq_hqa.c:234
GetByteContext::buffer
const uint8_t * buffer
Definition: bytestream.h:34
hq_ac_vlc
static VLCElem hq_ac_vlc[1184]
Definition: hq_hqa.c:60
get_sbits
static int get_sbits(GetBitContext *s, int n)
Definition: get_bits.h:320
ctx
AVFormatContext * ctx
Definition: movenc.c:48
hq_quants
static const int32_t *const hq_quants[NUM_HQ_QUANTS][2][4]
Definition: hq_hqadata.h:1140
decode.h
get_bits.h
hq_init_vlcs
static av_cold void hq_init_vlcs(void)
Definition: hq_hqa.c:377
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:272
cbp_vlc_lens
static const uint8_t cbp_vlc_lens[16]
Definition: hq_hqadata.h:44
if
if(ret)
Definition: filter_design.txt:179
hqa_decode_mb
static int hqa_decode_mb(HQContext *c, AVFrame *pic, int qgroup, GetBitContext *gb, int x, int y)
Definition: hq_hqa.c:191
AV_ONCE_INIT
#define AV_ONCE_INIT
Definition: thread.h:203
hqa_cbp_vlc
static VLCElem hqa_cbp_vlc[32]
Definition: hq_hqa.c:61
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:279
get_bits1
static unsigned int get_bits1(GetBitContext *s)
Definition: get_bits.h:388
cbp_vlc_bits
static const uint8_t cbp_vlc_bits[16]
Definition: hq_hqadata.h:39
hqa_decode_frame
static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, GetByteContext *gbc, size_t data_size)
Definition: hq_hqa.c:255
hq_ac_codes
static const uint16_t hq_ac_codes[NUM_HQ_AC_ENTRIES]
Definition: hq_hqadata.h:1209
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:652
canopus.h
AVOnce
#define AVOnce
Definition: thread.h:202
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_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(GetByteContext *g)
Definition: bytestream.h:158
hq_hqadata.h
AVFrame::pict_type
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:442
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1568
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:365
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
AVPacket::size
int size
Definition: packet.h:523
codec_internal.h
DECLARE_ALIGNED
#define DECLARE_ALIGNED(n, t, v)
Definition: mem_internal.h:109
VLCElem
Definition: vlc.h:32
HQContext
Definition: hq_hqa.c:53
height
#define height
block1
static int16_t block1[64]
Definition: dct.c:120
HQContext::block
int16_t block[12][64]
Definition: hq_hqa.c:57
NUM_HQ_AC_ENTRIES
#define NUM_HQ_AC_ENTRIES
Definition: hq_hqadata.h:26
attributes.h
hq_hqadsp.h
ff_hqdsp_init
av_cold void ff_hqdsp_init(HQDSPContext *c)
Definition: hq_hqadsp.c:127
AV_CODEC_ID_HQ_HQA
@ AV_CODEC_ID_HQ_HQA
Definition: codec_id.h:240
flag
#define flag(name)
Definition: cbs_av1.c:466
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:255
hq_profile
static const HQProfile hq_profile[NUM_HQ_PROFILES]
Definition: hq_hqadata.h:8357
put_blocks
static void put_blocks(HQContext *c, AVFrame *pic, int plane, int x, int y, int ilace, int16_t *block0, int16_t *block1)
Definition: hq_hqa.c:63
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:194
profile
int profile
Definition: mxfenc.c:2226
avcodec.h
ff_zigzag_direct
const uint8_t ff_zigzag_direct[64]
Definition: mathtables.c:98
tag
uint32_t tag
Definition: movenc.c:1786
ret
ret
Definition: filter_design.txt:187
pos
unsigned int pos
Definition: spdifenc.c:413
SIZE_SPECIFIER
#define SIZE_SPECIFIER
Definition: internal.h:141
AVCodecContext
main external API structure.
Definition: avcodec.h:445
VLC_INIT_STATIC_TABLE
#define VLC_INIT_STATIC_TABLE(vlc_table, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
Definition: vlc.h:267
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
avpriv_request_sample
#define avpriv_request_sample(...)
Definition: tableprint_vlc.h:36
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:78
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:472
AVPacket
This structure stores compressed data.
Definition: packet.h:499
src
INIT_CLIP pixel * src
Definition: h264pred_template.c:418
vlc.h
int32_t
int32_t
Definition: audioconvert.c:56
bytestream.h
bytestream2_init
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:137
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:385
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
h
h
Definition: vp9dsp_template.c:2038
HQDSPContext
Definition: hq_hqadsp.h:32
int
int
Definition: ffmpeg_filter.c:425
ff_hq_hqa_decoder
const FFCodec ff_hq_hqa_decoder
Definition: hq_hqa.c:399
AV_PIX_FMT_YUVA422P
@ AV_PIX_FMT_YUVA422P
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
Definition: pixfmt.h:173
hq_hqa_decode_init
static av_cold int hq_hqa_decode_init(AVCodecContext *avctx)
Definition: hq_hqa.c:386