FFmpeg
Loading...
Searching...
No Matches
fic.c
Go to the documentation of this file.
1/*
2 * Mirillis FIC decoder
3 *
4 * Copyright (c) 2014 Konstantin Shishkov
5 * Copyright (c) 2014 Derek Buitenhuis
6 *
7 * This file is part of FFmpeg.
8 *
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24#include "libavutil/common.h"
25#include "libavutil/mem.h"
27#include "libavutil/opt.h"
28#include "avcodec.h"
29#include "codec_internal.h"
30#include "decode.h"
31#include "get_bits.h"
32#include "golomb.h"
33
34typedef struct FICThreadContext {
35 DECLARE_ALIGNED(16, int16_t, block)[64];
36 const uint8_t *src;
39 int y_off;
42
61
62static const uint8_t fic_qmat_hq[64] = {
63 1, 2, 2, 2, 3, 3, 3, 4,
64 2, 2, 2, 3, 3, 3, 4, 4,
65 2, 2, 3, 3, 3, 4, 4, 4,
66 2, 2, 3, 3, 3, 4, 4, 5,
67 2, 3, 3, 3, 4, 4, 5, 6,
68 3, 3, 3, 4, 4, 5, 6, 7,
69 3, 3, 3, 4, 4, 5, 7, 7,
70 3, 3, 4, 4, 5, 7, 7, 7,
71};
72
73static const uint8_t fic_qmat_lq[64] = {
74 1, 5, 6, 7, 8, 9, 9, 11,
75 5, 5, 7, 8, 9, 9, 11, 12,
76 6, 7, 8, 9, 9, 11, 11, 12,
77 7, 7, 8, 9, 9, 11, 12, 13,
78 7, 8, 9, 9, 10, 11, 13, 16,
79 8, 9, 9, 10, 11, 13, 16, 19,
80 8, 9, 9, 11, 12, 15, 18, 23,
81 9, 9, 11, 12, 15, 18, 23, 27
82};
83
84static const uint8_t fic_header[7] = { 0, 0, 1, 'F', 'I', 'C', 'V' };
85
86#define FIC_HEADER_SIZE 27
87#define CURSOR_OFFSET 59
88#define CURSOR_SIZE 4096
89
90static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
91{
92 const unsigned t0 = 27246 * blk[3 * step] + 18405 * blk[5 * step];
93 const unsigned t1 = 27246 * blk[5 * step] - 18405 * blk[3 * step];
94 const unsigned t2 = 6393 * blk[7 * step] + 32139 * blk[1 * step];
95 const unsigned t3 = 6393 * blk[1 * step] - 32139 * blk[7 * step];
96 const unsigned t4 = 5793U * ((int)(t2 + t0 + 0x800) >> 12);
97 const unsigned t5 = 5793U * ((int)(t3 + t1 + 0x800) >> 12);
98 const unsigned t6 = t2 - t0;
99 const unsigned t7 = t3 - t1;
100 const unsigned t8 = 17734 * blk[2 * step] - 42813 * blk[6 * step];
101 const unsigned t9 = 17734 * blk[6 * step] + 42814 * blk[2 * step];
102 const unsigned tA = (blk[0 * step] - blk[4 * step]) * 32768 + rnd;
103 const unsigned tB = (blk[0 * step] + blk[4 * step]) * 32768 + rnd;
104 blk[0 * step] = (int)( t4 + t9 + tB) >> shift;
105 blk[1 * step] = (int)( t6 + t7 + t8 + tA) >> shift;
106 blk[2 * step] = (int)( t6 - t7 - t8 + tA) >> shift;
107 blk[3 * step] = (int)( t5 - t9 + tB) >> shift;
108 blk[4 * step] = (int)( -t5 - t9 + tB) >> shift;
109 blk[5 * step] = (int)(-(t6 - t7) - t8 + tA) >> shift;
110 blk[6 * step] = (int)(-(t6 + t7) + t8 + tA) >> shift;
111 blk[7 * step] = (int)( -t4 + t9 + tB) >> shift;
112}
113
114static void fic_idct_put(uint8_t *dst, int stride, int16_t *block)
115{
116 int i, j;
117 int16_t *ptr;
118
119 ptr = block;
120 fic_idct(ptr++, 8, 13, (1 << 12) + (1 << 17));
121 for (i = 1; i < 8; i++) {
122 fic_idct(ptr, 8, 13, 1 << 12);
123 ptr++;
124 }
125
126 ptr = block;
127 for (i = 0; i < 8; i++) {
128 fic_idct(ptr, 1, 20, 0);
129 ptr += 8;
130 }
131
132 ptr = block;
133 for (j = 0; j < 8; j++) {
134 for (i = 0; i < 8; i++)
135 dst[i] = av_clip_uint8(ptr[i]);
136 dst += stride;
137 ptr += 8;
138 }
139}
141 uint8_t *dst, int stride, int16_t *block, int *is_p)
142{
143 int i, num_coeff;
144
145 if (get_bits_left(gb) < 8)
146 return AVERROR_INVALIDDATA;
147
148 /* Is it a skip block? */
149 if (get_bits1(gb)) {
150 *is_p = 1;
151 return 0;
152 }
153
154 memset(block, 0, sizeof(*block) * 64);
155
156 num_coeff = get_bits(gb, 7);
157 if (num_coeff > 64)
158 return AVERROR_INVALIDDATA;
159
160 for (i = 0; i < num_coeff; i++) {
161 int v = get_se_golomb(gb);
162 if (v < -2048 || v > 2048)
163 return AVERROR_INVALIDDATA;
164 block[ff_zigzag_direct[i]] = v *
165 ctx->qmat[ff_zigzag_direct[i]];
166 }
167
169
170 return 0;
171}
172
173static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
174{
175 FICContext *ctx = avctx->priv_data;
176 FICThreadContext *tctx = tdata;
177 GetBitContext gb;
178 const uint8_t *src = tctx->src;
179 int slice_h = tctx->slice_h;
180 int src_size = tctx->src_size;
181 int y_off = tctx->y_off;
182 int x, y, p, ret;
183
184 ret = init_get_bits8(&gb, src, src_size);
185 if (ret < 0)
186 return ret;
187
188 for (p = 0; p < 3; p++) {
189 int stride = ctx->frame->linesize[p];
190 uint8_t* dst = ctx->frame->data[p] + (y_off >> !!p) * stride;
191
192 for (y = 0; y < (slice_h >> !!p); y += 8) {
193 for (x = 0; x < (ctx->aligned_width >> !!p); x += 8) {
194 int ret;
195
196 if ((ret = fic_decode_block(ctx, &gb, dst + x, stride,
197 tctx->block, &tctx->p_frame)) != 0)
198 return ret;
199 }
200
201 dst += 8 * stride;
202 }
203 }
204
205 return 0;
206}
207
208static av_always_inline void fic_alpha_blend(uint8_t *dst, uint8_t *src,
209 int size, uint8_t *alpha)
210{
211 int i;
212
213 for (i = 0; i < size; i++)
214 dst[i] += ((src[i] - dst[i]) * alpha[i]) >> 8;
215}
216
217static void fic_draw_cursor(AVCodecContext *avctx, const uint8_t cursor_buf[CURSOR_SIZE],
218 int cur_x, int cur_y)
219{
220 FICContext *ctx = avctx->priv_data;
221 const uint8_t *ptr = cursor_buf;
222 uint8_t *dstptr[3];
223 uint8_t planes[4][1024];
224 uint8_t chroma[3][256];
225 int i, j, p;
226
227 /* Convert to YUVA444. */
228 for (i = 0; i < 1024; i++) {
229 planes[0][i] = (( 25 * ptr[0] + 129 * ptr[1] + 66 * ptr[2]) / 255) + 16;
230 planes[1][i] = ((-38 * ptr[0] + 112 * ptr[1] + -74 * ptr[2]) / 255) + 128;
231 planes[2][i] = ((-18 * ptr[0] + 112 * ptr[1] + -94 * ptr[2]) / 255) + 128;
232 planes[3][i] = ptr[3];
233
234 ptr += 4;
235 }
236
237 /* Subsample chroma. */
238 for (i = 0; i < 32; i += 2)
239 for (j = 0; j < 32; j += 2)
240 for (p = 0; p < 3; p++)
241 chroma[p][16 * (i / 2) + j / 2] = (planes[p + 1][32 * i + j ] +
242 planes[p + 1][32 * i + j + 1] +
243 planes[p + 1][32 * (i + 1) + j ] +
244 planes[p + 1][32 * (i + 1) + j + 1]) / 4;
245
246 /* Seek to x/y pos of cursor. */
247 for (i = 0; i < 3; i++)
248 dstptr[i] = ctx->final_frame->data[i] +
249 (ctx->final_frame->linesize[i] * (cur_y >> !!i)) +
250 (cur_x >> !!i) + !!i;
251
252 /* Copy. */
253 for (i = 0; i < FFMIN(32, avctx->height - cur_y) - 1; i += 2) {
254 int lsize = FFMIN(32, avctx->width - cur_x);
255 int csize = lsize / 2;
256
257 fic_alpha_blend(dstptr[0],
258 planes[0] + i * 32, lsize, planes[3] + i * 32);
259 fic_alpha_blend(dstptr[0] + ctx->final_frame->linesize[0],
260 planes[0] + (i + 1) * 32, lsize, planes[3] + (i + 1) * 32);
261 fic_alpha_blend(dstptr[1],
262 chroma[0] + (i / 2) * 16, csize, chroma[2] + (i / 2) * 16);
263 fic_alpha_blend(dstptr[2],
264 chroma[1] + (i / 2) * 16, csize, chroma[2] + (i / 2) * 16);
265
266 dstptr[0] += ctx->final_frame->linesize[0] * 2;
267 dstptr[1] += ctx->final_frame->linesize[1];
268 dstptr[2] += ctx->final_frame->linesize[2];
269 }
270}
271
272static int fic_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
273 int *got_frame, AVPacket *avpkt)
274{
275 FICContext *ctx = avctx->priv_data;
276 const uint8_t *src = avpkt->data;
277 int ret;
278 int slice, nslices;
279 int msize;
280 int tsize;
281 int cur_x, cur_y;
282 int skip_cursor = ctx->skip_cursor;
283 const uint8_t *sdata;
284
285 /* Header + at least one slice (4) */
286 if (avpkt->size < FIC_HEADER_SIZE + 4) {
287 av_log(avctx, AV_LOG_ERROR, "Frame data is too small.\n");
288 return AVERROR_INVALIDDATA;
289 }
290
291 /* Check for header. */
292 if (memcmp(src, fic_header, 7))
293 av_log(avctx, AV_LOG_WARNING, "Invalid FIC Header.\n");
294
295 /* Is it a skip frame? */
296 if (src[17]) {
297 if (!ctx->final_frame->data[0]) {
298 av_log(avctx, AV_LOG_WARNING, "Initial frame is skipped\n");
299 return AVERROR_INVALIDDATA;
300 }
301 ret = ff_reget_buffer(avctx, ctx->final_frame,
303 if (ret < 0)
304 return ret;
305 goto skip;
306 }
307
308 nslices = src[13];
309 if (!nslices) {
310 av_log(avctx, AV_LOG_ERROR, "Zero slices found.\n");
311 return AVERROR_INVALIDDATA;
312 }
313
314 /* High or Low Quality Matrix? */
315 ctx->qmat = src[23] ? fic_qmat_hq : fic_qmat_lq;
316
317 /* Skip cursor data. */
318 tsize = AV_RB24(src + 24);
319 if (tsize > avpkt->size - FIC_HEADER_SIZE) {
320 av_log(avctx, AV_LOG_ERROR,
321 "Packet is too small to contain cursor (%d vs %d bytes).\n",
322 tsize, avpkt->size - FIC_HEADER_SIZE);
323 return AVERROR_INVALIDDATA;
324 }
325
326 if (!tsize || !AV_RL16(src + 37) || !AV_RL16(src + 39))
327 skip_cursor = 1;
328
329 if (!skip_cursor && tsize < 32) {
330 av_log(avctx, AV_LOG_WARNING,
331 "Cursor data too small. Skipping cursor.\n");
332 skip_cursor = 1;
333 }
334
335 /* Cursor position. */
336 cur_x = AV_RL16(src + 33);
337 cur_y = AV_RL16(src + 35);
338 if (!skip_cursor && (cur_x > avctx->width || cur_y > avctx->height)) {
339 av_log(avctx, AV_LOG_DEBUG,
340 "Invalid cursor position: (%d,%d). Skipping cursor.\n",
341 cur_x, cur_y);
342 skip_cursor = 1;
343 }
344
345 if (!skip_cursor && (AV_RL16(src + 37) != 32 || AV_RL16(src + 39) != 32)) {
346 av_log(avctx, AV_LOG_WARNING,
347 "Invalid cursor size. Skipping cursor.\n");
348 skip_cursor = 1;
349 }
350
351 if (!skip_cursor && avpkt->size < CURSOR_OFFSET + CURSOR_SIZE)
352 skip_cursor = 1;
353
354 /* Slice height for all but the last slice. */
355 ctx->slice_h = 16 * (ctx->aligned_height >> 4) / nslices;
356 if (ctx->slice_h % 16)
357 ctx->slice_h = FFALIGN(ctx->slice_h - 16, 16);
358
359 /* First slice offset and remaining data. */
360 sdata = src + tsize + FIC_HEADER_SIZE + 4 * nslices;
361 msize = avpkt->size - nslices * 4 - tsize - FIC_HEADER_SIZE;
362
363 if (msize <= ctx->aligned_width/8 * (ctx->aligned_height/8) / 8) {
364 av_log(avctx, AV_LOG_ERROR, "Not enough frame data to decode.\n");
365 return AVERROR_INVALIDDATA;
366 }
367
368 /* Allocate slice data. */
369 av_fast_malloc(&ctx->slice_data, &ctx->slice_data_size,
370 nslices * sizeof(ctx->slice_data[0]));
371 if (!ctx->slice_data_size) {
372 av_log(avctx, AV_LOG_ERROR, "Could not allocate slice data.\n");
373 return AVERROR(ENOMEM);
374 }
375 memset(ctx->slice_data, 0, nslices * sizeof(ctx->slice_data[0]));
376
377 for (slice = 0; slice < nslices; slice++) {
378 unsigned slice_off = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4);
379 unsigned slice_size;
380 int y_off = ctx->slice_h * slice;
381 int slice_h = ctx->slice_h;
382
383 /*
384 * Either read the slice size, or consume all data left.
385 * Also, special case the last slight height.
386 */
387 if (slice == nslices - 1) {
388 slice_size = msize;
389 slice_h = FFALIGN(avctx->height - ctx->slice_h * (nslices - 1), 16);
390 } else {
391 slice_size = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4 + 4);
392 if (slice_size < slice_off)
393 return AVERROR_INVALIDDATA;
394 }
395
396 if (slice_size < slice_off || slice_size > msize)
397 continue;
398
399 slice_size -= slice_off;
400
401 ctx->slice_data[slice].src = sdata + slice_off;
402 ctx->slice_data[slice].src_size = slice_size;
403 ctx->slice_data[slice].slice_h = slice_h;
404 ctx->slice_data[slice].y_off = y_off;
405 }
406
407 if ((ret = ff_reget_buffer(avctx, ctx->frame, 0)) < 0)
408 return ret;
409
410 if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
411 NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
412 return ret;
413
414 ctx->frame->flags |= AV_FRAME_FLAG_KEY;
415 ctx->frame->pict_type = AV_PICTURE_TYPE_I;
416 for (slice = 0; slice < nslices; slice++) {
417 if (ctx->slice_data[slice].p_frame) {
418 ctx->frame->flags &= ~AV_FRAME_FLAG_KEY;
419 ctx->frame->pict_type = AV_PICTURE_TYPE_P;
420 break;
421 }
422 }
423 ret = av_frame_replace(ctx->final_frame, ctx->frame);
424 if (ret < 0)
425 return ret;
426
427 /* Draw cursor if needed. */
428 if (!skip_cursor) {
429 /* Make frame writable. */
430 ret = ff_reget_buffer(avctx, ctx->final_frame, 0);
431 if (ret < 0)
432 return ret;
433
434 fic_draw_cursor(avctx, src + CURSOR_OFFSET, cur_x, cur_y);
435 }
436
437skip:
438 if ((ret = av_frame_ref(rframe, ctx->final_frame)) < 0)
439 return ret;
440 *got_frame = 1;
441
442 return avpkt->size;
443}
444
446{
447 FICContext *ctx = avctx->priv_data;
448
449 av_freep(&ctx->slice_data);
450 av_frame_free(&ctx->final_frame);
451 av_frame_free(&ctx->frame);
452
453 return 0;
454}
455
457{
458 FICContext *ctx = avctx->priv_data;
459
460 /* Initialize various context values */
461 ctx->avctx = avctx;
462 ctx->aligned_width = FFALIGN(avctx->width, 16);
463 ctx->aligned_height = FFALIGN(avctx->height, 16);
464
466 avctx->bits_per_raw_sample = 8;
467
468 ctx->frame = av_frame_alloc();
469 if (!ctx->frame)
470 return AVERROR(ENOMEM);
471 ctx->final_frame = av_frame_alloc();
472 if (!ctx->final_frame)
473 return AVERROR(ENOMEM);
474
475 return 0;
476}
477
478static const AVOption options[] = {
479{ "skip_cursor", "skip the cursor", offsetof(FICContext, skip_cursor), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM },
480{ NULL },
481};
482
484 .class_name = "FIC decoder",
485 .item_name = av_default_item_name,
486 .option = options,
487 .version = LIBAVUTIL_VERSION_INT,
488};
489
491 .p.name = "fic",
492 CODEC_LONG_NAME("Mirillis FIC"),
493 .p.type = AVMEDIA_TYPE_VIDEO,
494 .p.id = AV_CODEC_ID_FIC,
495 .priv_data_size = sizeof(FICContext),
498 .close = fic_decode_close,
500 .p.priv_class = &fic_decoder_class,
501 .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
502};
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
const FFCodec ff_fic_decoder
Definition fic.c:490
Libavcodec external API header.
static void BS_FUNC skip(BSCTX *bc, unsigned int n)
Skip n bits in the buffer.
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define rnd
Definition checkasm.h:136
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
common internal and external API header
#define av_clip_uint8
Definition common.h:106
#define NULL
Definition coverity.c:32
static int16_t block[64]
Definition dct.c:125
int ff_reget_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Identical in function to ff_get_buffer(), except it reuses the existing buffer if available.
Definition decode.c:1906
#define FF_REGET_BUFFER_FLAG_READONLY
the returned buffer does not need to be writable
Definition decode.h:137
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define CURSOR_OFFSET
Definition fic.c:87
static const AVClass fic_decoder_class
Definition fic.c:483
static int fic_decode_slice(AVCodecContext *avctx, void *tdata)
Definition fic.c:173
static av_always_inline void fic_idct(int16_t *blk, int step, int shift, int rnd)
Definition fic.c:90
static void fic_idct_put(uint8_t *dst, int stride, int16_t *block)
Definition fic.c:114
static int fic_decode_frame(AVCodecContext *avctx, AVFrame *rframe, int *got_frame, AVPacket *avpkt)
Definition fic.c:272
static const uint8_t fic_qmat_hq[64]
Definition fic.c:62
static const uint8_t fic_qmat_lq[64]
Definition fic.c:73
static av_cold int fic_decode_close(AVCodecContext *avctx)
Definition fic.c:445
static void fic_draw_cursor(AVCodecContext *avctx, const uint8_t cursor_buf[CURSOR_SIZE], int cur_x, int cur_y)
Definition fic.c:217
static av_always_inline void fic_alpha_blend(uint8_t *dst, uint8_t *src, int size, uint8_t *alpha)
Definition fic.c:208
static av_cold int fic_decode_init(AVCodecContext *avctx)
Definition fic.c:456
static int fic_decode_block(FICContext *ctx, GetBitContext *gb, uint8_t *dst, int stride, int16_t *block, int *is_p)
Definition fic.c:140
#define FIC_HEADER_SIZE
Definition fic.c:86
static const uint8_t fic_header[7]
Definition fic.c:84
#define CURSOR_SIZE
Definition fic.c:88
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
Definition get_bits.h:688
static unsigned int get_bits1(GetBitContext *s)
Definition get_bits.h:391
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
Definition get_bits.h:544
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition get_bits.h:337
exp golomb vlc stuff
static int get_se_golomb(GetBitContext *gb)
read signed exp golomb code.
Definition golomb.h:239
#define AV_OPT_FLAG_DECODING_PARAM
A generic parameter which can be set by the user for demuxing or decoding.
Definition opt.h:355
#define AV_OPT_FLAG_VIDEO_PARAM
Definition opt.h:357
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition opt.h:326
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
Definition codec.h:102
@ AV_CODEC_ID_FIC
Definition codec_id.h:225
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AVERROR(e)
Definition error.h:45
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition frame.h:687
int av_frame_replace(AVFrame *dst, const AVFrame *src)
Ensure the destination frame refers to the same data described by the source frame,...
Definition frame.c:376
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:278
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
Definition frame.c:52
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
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:555
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
AVPictureType
Definition avutil.h:276
@ AV_PICTURE_TYPE_I
Intra.
Definition avutil.h:278
@ AV_PICTURE_TYPE_P
Predicted.
Definition avutil.h:279
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const int16_t alpha[]
Definition ilbcdata.h:55
#define AV_RB32(p)
#define AV_RL16(p)
#define AV_RB24(x)
static int shift(int a, int b)
Definition bonk.c:261
#define av_always_inline
Definition attributes.h:72
#define av_cold
Definition attributes.h:117
static const struct @257111027162314367033347246032313251342043035002 planes[]
#define FFMIN(a, b)
Definition macros.h:49
#define FFALIGN(x, a)
Definition macros.h:78
const uint8_t ff_zigzag_direct[64]
Definition mathtables.c:137
Memory handling functions.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
AVOptions.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
#define blk(i)
Definition sha.c:55
Describe the class of an AVClass context structure.
Definition log.h:76
main external API structure.
Definition avcodec.h:443
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition avcodec.h:643
int width
picture width / height.
Definition avcodec.h:604
int(* execute)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size)
The codec may call this to execute several independent things.
Definition avcodec.h:1609
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
Definition avcodec.h:1571
void * priv_data
Definition avcodec.h:470
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
AVOption.
Definition opt.h:428
This structure stores compressed data.
Definition packet.h:580
int size
Definition packet.h:604
uint8_t * data
Definition packet.h:603
FICThreadContext * slice_data
Definition fic.c:49
const uint8_t * qmat
Definition fic.c:52
int aligned_width
Definition fic.c:56
int skip_cursor
Definition fic.c:59
enum AVPictureType cur_frame_type
Definition fic.c:54
AVFrame * final_frame
Definition fic.c:47
int num_slices
Definition fic.c:57
int slice_data_size
Definition fic.c:50
AVFrame * frame
Definition fic.c:46
int aligned_height
Definition fic.c:56
AVCodecContext * avctx
Definition fic.c:45
int slice_h
Definition fic.c:57
int p_frame
Definition fic.c:40
const uint8_t * src
Definition fic.c:36
int16_t block[64]
Definition fic.c:35
int slice_h
Definition fic.c:37
int src_size
Definition fic.c:38
#define stride
#define av_freep(p)
#define av_log(a,...)
#define src
Definition vp8dsp.c:248
static AVFormatContext * ctx
Definition movenc.c:49
int size
static av_always_inline void chroma(WaveformContext *s, AVFrame *in, AVFrame *out, int component, int intensity, int offset_y, int offset_x, int column, int mirror, int jobnr, int nb_jobs)