38#define TRELLIS_WIDTH 16
39#define SCORE_LIMIT INT_MAX / 2
57 ptrdiff_t linesize,
int x,
int y,
int w,
int h,
58 int16_t *blocks, uint16_t *emu_buf,
59 int mbs_per_slice,
int blocks_per_mb,
int is_chroma)
62 const int mb_width = 4 * blocks_per_mb;
66 for (
i = 0;
i < mbs_per_slice;
i++,
src += mb_width) {
68 memset(blocks, 0, 64 * (mbs_per_slice -
i) * blocks_per_mb
72 if (x + mb_width <=
w && y + 16 <=
h) {
79 elinesize = 16 *
sizeof(*emu_buf);
81 bw =
FFMIN(
w - x, mb_width);
84 for (j = 0; j < bh; j++) {
85 memcpy(emu_buf + j * 16,
86 (
const uint8_t*)
src + j * linesize,
88 pix = emu_buf[j * 16 + bw - 1];
89 for (k = bw; k < mb_width; k++)
90 emu_buf[j * 16 + k] =
pix;
93 memcpy(emu_buf + j * 16,
94 emu_buf + (bh - 1) * 16,
95 mb_width *
sizeof(*emu_buf));
98 ctx->fdct(&
ctx->fdsp, esrc, elinesize, blocks);
100 if (blocks_per_mb > 2) {
101 ctx->fdct(&
ctx->fdsp, esrc + 8, elinesize, blocks);
104 ctx->fdct(&
ctx->fdsp, esrc + elinesize * 4, elinesize, blocks);
106 if (blocks_per_mb > 2) {
107 ctx->fdct(&
ctx->fdsp, esrc + elinesize * 4 + 8, elinesize, blocks);
111 ctx->fdct(&
ctx->fdsp, esrc, elinesize, blocks);
113 ctx->fdct(&
ctx->fdsp, esrc + elinesize * 4, elinesize, blocks);
115 if (blocks_per_mb > 2) {
116 ctx->fdct(&
ctx->fdsp, esrc + 8, elinesize, blocks);
118 ctx->fdct(&
ctx->fdsp, esrc + elinesize * 4 + 8, elinesize, blocks);
128 ptrdiff_t linesize,
int x,
int y,
int w,
int h,
129 uint16_t *blocks,
int mbs_per_slice,
int abits)
131 const int slice_width = 16 * mbs_per_slice;
132 int i, j, copy_w, copy_h;
134 copy_w =
FFMIN(
w - x, slice_width);
135 copy_h =
FFMIN(
h - y, 16);
136 for (
i = 0;
i < copy_h;
i++) {
137 memcpy(blocks,
src, copy_w *
sizeof(*
src));
139 for (j = 0; j < copy_w; j++)
142 for (j = 0; j < copy_w; j++)
143 blocks[j] = (blocks[j] << 6) | (blocks[j] >> 4);
144 for (j = copy_w; j < slice_width; j++)
145 blocks[j] = blocks[copy_w - 1];
146 blocks += slice_width;
147 src += linesize >> 1;
149 for (;
i < 16;
i++) {
150 memcpy(blocks, blocks - slice_width, slice_width *
sizeof(*blocks));
151 blocks += slice_width;
160 unsigned int rice_order, exp_order, switch_bits, switch_val;
168 switch_val = switch_bits << rice_order;
170 if (
val >= switch_val) {
171 val -= switch_val - (1 << exp_order);
174 put_bits(pb, exponent - exp_order + switch_bits, 0);
177 exponent =
val >> rice_order;
187#define GET_SIGN(x) ((x) >> 31)
188#define MAKE_CODE(x) (((x) * 2) ^ GET_SIGN(x))
191 int blocks_per_slice,
int scale)
196 prev_dc = (blocks[0] - 0x4000) /
scale;
201 for (
i = 1;
i < blocks_per_slice;
i++, blocks += 64) {
202 dc = (blocks[0] - 0x4000) /
scale;
203 delta = dc - prev_dc;
215 int blocks_per_slice,
216 const uint8_t *scan,
const int16_t *qmat)
222 int max_coeffs, abs_level;
223 max_coeffs = blocks_per_slice << 6;
225 for (
i = 1;
i < 64;
i++) {
226 for (idx = scan[
i]; idx < max_coeffs; idx += 64) {
227 level = blocks[idx] / qmat[scan[
i]];
235 prev_level =
FFMIN(abs_level, 9);
245 const uint16_t *
src, ptrdiff_t linesize,
246 int mbs_per_slice, int16_t *blocks,
250 int blocks_per_slice = mbs_per_slice * blocks_per_mb;
252 encode_dcs(pb, blocks, blocks_per_slice, qmat[0]);
253 encode_acs(pb, blocks, blocks_per_slice,
ctx->scantable, qmat);
258 const int dbits = (abits == 8) ? 4 : 7;
259 const int dsize = 1 << dbits - 1;
260 int diff = cur - prev;
263 if (
diff >= (1 << abits) - dsize)
290 int mbs_per_slice, uint16_t *blocks,
293 const int abits =
ctx->alpha_bits;
294 const int mask = (1 << abits) - 1;
295 const int num_coeffs = mbs_per_slice * 256;
296 int prev =
mask, cur;
313 }
while (idx < num_coeffs);
326 int num_cblocks, pwidth, line_add;
330 uint16_t *qmat_chroma;
332 if (
ctx->pictures_per_frame == 1)
337 if (
ctx->force_quant) {
338 qmat =
ctx->quants[0];
339 qmat_chroma =
ctx->quants_chroma[0];
342 qmat_chroma =
ctx->quants_chroma[
quant];
344 qmat =
ctx->custom_q;
345 qmat_chroma =
ctx->custom_chroma_q;
346 for (
i = 0;
i < 64;
i++) {
348 qmat_chroma[
i] =
ctx->quant_chroma_mat[
i] *
quant;
352 for (
i = 0;
i <
ctx->num_planes;
i++) {
353 is_chroma = (
i == 1 ||
i == 2);
358 pwidth = avctx->
width;
363 pwidth = avctx->
width >> 1;
367 src = (
const uint16_t*)(pic->
data[
i] + yp * linesize +
372 pwidth, avctx->
height /
ctx->pictures_per_frame,
373 ctx->blocks[0],
ctx->emu_buf,
374 mbs_per_slice, num_cblocks, is_chroma);
377 mbs_per_slice,
ctx->blocks[0],
381 mbs_per_slice,
ctx->blocks[0],
382 num_cblocks, qmat_chroma);
386 pwidth, avctx->
height /
ctx->pictures_per_frame,
387 ctx->blocks[0], mbs_per_slice,
ctx->alpha_bits);
399 unsigned int rice_order, exp_order, switch_bits, switch_val;
407 switch_val = switch_bits << rice_order;
409 if (
val >= switch_val) {
410 val -= switch_val - (1 << exp_order);
413 return exponent * 2 - exp_order + switch_bits + 1;
415 return (
val >> rice_order) + rice_order + 1;
426 prev_dc = (blocks[0] - 0x4000) /
scale;
432 for (
i = 1;
i < blocks_per_slice;
i++, blocks += 64) {
433 dc = (blocks[0] - 0x4000) /
scale;
435 delta = dc - prev_dc;
449 const uint8_t *scan,
const int16_t *qmat)
455 int max_coeffs, abs_level;
458 max_coeffs = blocks_per_slice << 6;
461 for (
i = 1;
i < 64;
i++) {
462 for (idx = scan[
i]; idx < max_coeffs; idx += 64) {
463 level = blocks[idx] / qmat[scan[
i]];
471 prev_level =
FFMIN(abs_level, 9);
483 const uint16_t *
src, ptrdiff_t linesize,
488 int blocks_per_slice;
491 blocks_per_slice = mbs_per_slice * blocks_per_mb;
501 const int dbits = (abits == 8) ? 4 : 7;
502 const int dsize = 1 << dbits - 1;
503 int diff = cur - prev;
506 if (
diff >= (1 << abits) - dsize)
515 const uint16_t *
src, ptrdiff_t linesize,
516 int mbs_per_slice, int16_t *blocks)
518 const int abits =
ctx->alpha_bits;
519 const int mask = (1 << abits) - 1;
520 const int num_coeffs = mbs_per_slice * 256;
521 int prev =
mask, cur;
544 }
while (idx < num_coeffs);
557 int trellis_node,
int x,
int y,
int mbs_per_slice,
561 int i, q, pq, xp, yp;
565 const int min_quant =
ctx->profile_info->min_quant;
566 const int max_quant =
ctx->profile_info->max_quant;
568 int mbs, prev, cur, new_score;
572 uint16_t *qmat_chroma;
573 int linesize[4], line_add;
576 if (
ctx->pictures_per_frame == 1)
580 mbs = x + mbs_per_slice;
582 for (
i = 0;
i <
ctx->num_planes;
i++) {
583 is_chroma[
i] = (
i == 1 ||
i == 2);
588 pwidth = avctx->
width;
593 pwidth = avctx->
width >> 1;
596 linesize[
i] =
ctx->pic->linesize[
i] *
ctx->pictures_per_frame;
597 src = (
const uint16_t *)(
ctx->pic->data[
i] + yp * linesize[
i] +
598 line_add *
ctx->pic->linesize[
i]) + xp;
602 pwidth, avctx->
height /
ctx->pictures_per_frame,
604 mbs_per_slice, num_cblocks[
i], is_chroma[
i]);
607 pwidth, avctx->
height /
ctx->pictures_per_frame,
608 td->
blocks[
i], mbs_per_slice,
ctx->alpha_bits);
612 for (q = min_quant; q < max_quant + 2; q++) {
619 mbs_per_slice, td->
blocks[3]);
621 for (q = min_quant; q <= max_quant; q++) {
629 for (
i = 1;
i <
ctx->num_planes - !!
ctx->alpha_bits;
i++) {
634 ctx->quants_chroma[q], td);
636 if (
bits > 65000 * 8)
639 slice_bits[q] =
bits;
640 slice_score[q] =
error;
642 if (slice_bits[max_quant] <=
ctx->bits_per_mb * mbs_per_slice) {
643 slice_bits[max_quant + 1] = slice_bits[max_quant];
644 slice_score[max_quant + 1] = slice_score[max_quant] + 1;
645 overquant = max_quant;
647 for (q = max_quant + 1; q < 128; q++) {
651 qmat =
ctx->quants[q];
652 qmat_chroma =
ctx->quants_chroma[q];
656 for (
i = 0;
i < 64;
i++) {
657 qmat[
i] =
ctx->quant_mat[
i] * q;
658 qmat_chroma[
i] =
ctx->quant_chroma_mat[
i] * q;
666 for (
i = 1;
i <
ctx->num_planes - !!
ctx->alpha_bits;
i++) {
677 slice_bits[max_quant + 1] =
bits;
678 slice_score[max_quant + 1] =
error;
681 td->
nodes[trellis_node + max_quant + 1].
quant = overquant;
683 bits_limit = mbs *
ctx->bits_per_mb;
684 for (pq = min_quant; pq < max_quant + 2; pq++) {
687 for (q = min_quant; q < max_quant + 2; q++) {
688 cur = trellis_node + q;
690 error = slice_score[q];
691 if (
bits > bits_limit)
709 pq = trellis_node + min_quant;
710 for (q = min_quant + 1; q < max_quant + 2; q++) {
713 pq = trellis_node + q;
721 int jobnr,
int threadnr)
725 int mbs_per_slice =
ctx->mbs_per_slice;
726 int x, y = jobnr,
mb, q = 0;
728 for (x =
mb = 0; x <
ctx->mb_width; x += mbs_per_slice,
mb++) {
729 while (
ctx->mb_width - x < mbs_per_slice)
736 for (x =
ctx->slices_width - 1; x >= 0; x--) {
745 const AVFrame *pic,
int *got_packet)
748 uint8_t *orig_buf, *buf, *slice_hdr, *slice_sizes, *
tmp;
749 uint8_t *picture_size_pos;
751 int x, y,
i,
mb, q = 0;
752 int sizes[4] = { 0 };
753 int slice_hdr_size = 2 *
ctx->num_planes;
756 int max_slice_size = (
ctx->frame_size_upper_bound - 200) / (
ctx->pictures_per_frame *
ctx->slices_per_picture + 1);
760 pkt_size =
ctx->frame_size_upper_bound;
765 orig_buf =
pkt->data;
769 bytestream_put_be32 (&orig_buf,
FRAME_ID);
775 bytestream_put_be16 (&buf,
ctx->chroma_factor !=
CFACTOR_Y422 ||
ctx->alpha_bits ? 1 : 0);
777 bytestream_put_be16 (&buf, avctx->
width);
778 bytestream_put_be16 (&buf, avctx->
height);
780 frame_flags =
ctx->chroma_factor << 6;
783 bytestream_put_byte (&buf, frame_flags);
785 bytestream_put_byte (&buf, 0);
787 bytestream_put_byte (&buf, pic->
color_trc);
789 bytestream_put_byte (&buf,
ctx->alpha_bits >> 3);
790 bytestream_put_byte (&buf, 0);
792 bytestream_put_byte (&buf, 0x03);
796 bytestream_put_byte (&buf, 0x00);
798 bytestream_put_be16 (&
tmp, buf - orig_buf);
800 for (
ctx->cur_picture_idx = 0;
801 ctx->cur_picture_idx <
ctx->pictures_per_frame;
802 ctx->cur_picture_idx++) {
804 picture_size_pos = buf + 1;
805 bytestream_put_byte (&buf, 0x40);
807 bytestream_put_be16 (&buf,
ctx->slices_per_picture);
808 bytestream_put_byte (&buf,
av_log2(
ctx->mbs_per_slice) << 4);
812 buf +=
ctx->slices_per_picture * 2;
815 if (!
ctx->force_quant) {
822 for (y = 0; y <
ctx->mb_height; y++) {
823 int mbs_per_slice =
ctx->mbs_per_slice;
824 for (x =
mb = 0; x <
ctx->mb_width; x += mbs_per_slice,
mb++) {
825 q =
ctx->force_quant ?
ctx->force_quant
826 :
ctx->slice_q[
mb + y *
ctx->slices_width];
828 while (
ctx->mb_width - x < mbs_per_slice)
831 bytestream_put_byte(&buf, slice_hdr_size << 3);
833 buf += slice_hdr_size - 1;
834 if (pkt_size <= buf - orig_buf + 2 * max_slice_size) {
835 uint8_t *start =
pkt->data;
838 int delta = 200 + (
ctx->pictures_per_frame *
839 ctx->slices_per_picture + 1) *
840 max_slice_size - pkt_size;
843 ctx->frame_size_upper_bound +=
delta;
847 "Packet too small: is %i,"
848 " needs %i (slice: %i). "
849 "Correct allocation",
850 pkt_size,
delta, max_slice_size);
859 orig_buf =
pkt->data + (orig_buf - start);
860 buf =
pkt->data + (buf - start);
861 picture_size_pos =
pkt->data + (picture_size_pos - start);
862 slice_sizes =
pkt->data + (slice_sizes - start);
863 slice_hdr =
pkt->data + (slice_hdr - start);
872 bytestream_put_byte(&slice_hdr, q);
873 slice_size = slice_hdr_size +
sizes[
ctx->num_planes - 1];
874 for (
i = 0;
i <
ctx->num_planes - 1;
i++) {
875 bytestream_put_be16(&slice_hdr,
sizes[
i]);
878 bytestream_put_be16(&slice_sizes, slice_size);
879 buf += slice_size - slice_hdr_size;
880 if (max_slice_size < slice_size)
881 max_slice_size = slice_size;
885 picture_size = buf - (picture_size_pos - 1);
886 bytestream_put_be32(&picture_size_pos, picture_size);
915 ptrdiff_t linesize, int16_t *
block)
918 const uint16_t *tsrc =
src;
920 for (y = 0; y < 8; y++) {
921 for (x = 0; x < 8; x++)
922 block[y * 8 + x] = tsrc[x];
923 tsrc += linesize >> 1;
931 int err = 0,
i, j, min_quant, max_quant;
940 if (!
ctx->force_quant) {
941 min_quant =
ctx->profile_info->min_quant;
942 max_quant =
ctx->profile_info->max_quant;
955 *
sizeof(*
ctx->tdata->nodes));
956 if (!
ctx->tdata[j].nodes)
958 for (
i = min_quant;
i < max_quant + 2;
i++) {
959 ctx->tdata[j].nodes[
i].prev_node = -1;
960 ctx->tdata[j].nodes[
i].bits = 0;
961 ctx->tdata[j].nodes[
i].score = 0;
969#define OFFSET(x) offsetof(ProresContext, x)
970#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
973 {
"mbs_per_slice",
"macroblocks per slice",
OFFSET(mbs_per_slice),
979 0, 0,
VE, .unit =
"profile" },
981 0, 0,
VE, .unit =
"profile" },
983 0, 0,
VE, .unit =
"profile" },
985 0, 0,
VE, .unit =
"profile" },
987 0, 0,
VE, .unit =
"profile" },
989 0, 0,
VE, .unit =
"profile" },
991 0, 0,
VE, .unit =
"profile" },
992 {
"vendor",
"vendor ID",
OFFSET(vendor),
994 {
"bits_per_mb",
"desired bits per macroblock",
OFFSET(bits_per_mb),
999 0, 0,
VE, .unit =
"quant_mat" },
1001 0, 0,
VE, .unit =
"quant_mat" },
1003 0, 0,
VE, .unit =
"quant_mat" },
1005 0, 0,
VE, .unit =
"quant_mat" },
1007 0, 0,
VE, .unit =
"quant_mat" },
1009 0, 0,
VE, .unit =
"quant_mat" },
1011 { .i64 = 16 }, 0, 16,
VE },
1016 .class_name =
"ProRes encoder",
1023 .p.name =
"prores_ks",
static double val(void *priv, double ch)
const FFCodec ff_prores_ks_encoder
static av_cold void close(AVCodecParserContext *s)
static av_cold int encode_init(AVCodecContext *avctx)
Libavcodec external API header.
static av_always_inline void bytestream_put_buffer(uint8_t **b, const uint8_t *src, unsigned int size)
#define i(width, name, range_min, range_max)
static const unsigned codebook[256][2]
#define CODEC_PIXFMTS(...)
#define FF_CODEC_ENCODE_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...
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
static av_cold int encode_close(AVCodecContext *avctx)
int(* init)(AVBSFContext *ctx)
int ff_alloc_packet(AVCodecContext *avctx, AVPacket *avpkt, int64_t size)
Check AVPacket size and allocate data.
#define FF_INPUT_BUFFER_MIN_SIZE
Used by some encoders as upper bound for the length of headers.
static const uint8_t bits[8]
static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame, AVPacket *pkt)
static const uint8_t frame_size[4]
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
#define AV_CODEC_FLAG_INTERLACED_DCT
Use interlaced DCT.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
int av_grow_packet(AVPacket *pkt, int grow_by)
Increase packet size, correctly zeroing padding.
#define AV_FRAME_FLAG_TOP_FIELD_FIRST
A flag to mark frames where the top field is displayed first if the content is interlaced.
const char * av_default_item_name(void *ptr)
Return the context name.
#define LIBAVUTIL_VERSION_INT
static const int sizes[][2]
static void scale(int *out, const int *in, const int w, const int h, const int shift)
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static const uint16_t mask[17]
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
#define AV_PIX_FMT_YUVA444P10
#define AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV444P10
const AVProfile ff_prores_profiles[]
const uint8_t ff_prores_dc_codebook[7]
const uint8_t ff_prores_run_to_cb[16]
const uint8_t ff_prores_level_to_cb[10]
static int est_alpha_diff(int cur, int prev, int abits)
static int estimate_slice_plane(ProresContext *ctx, int *error, int plane, const uint16_t *src, ptrdiff_t linesize, int mbs_per_slice, int blocks_per_mb, const int16_t *qmat, ProresThreadData *td)
static const AVClass proresenc_class
static int estimate_alpha_plane(ProresContext *ctx, const uint16_t *src, ptrdiff_t linesize, int mbs_per_slice, int16_t *blocks)
static int estimate_acs(int *error, int16_t *blocks, int blocks_per_slice, const uint8_t *scan, const int16_t *qmat)
static void encode_alpha_plane(ProresContext *ctx, PutBitContext *pb, int mbs_per_slice, uint16_t *blocks, int quant)
static av_cold int encode_init(AVCodecContext *avctx)
static av_cold int encode_close(AVCodecContext *avctx)
static void encode_acs(PutBitContext *pb, int16_t *blocks, int blocks_per_slice, const uint8_t *scan, const int16_t *qmat)
static void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int val)
Write an unsigned rice/exp golomb codeword.
static void put_alpha_run(PutBitContext *pb, int run)
static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, PutBitContext *pb, int sizes[4], int x, int y, int quant, int mbs_per_slice)
static void get_alpha_data(ProresContext *ctx, const uint16_t *src, ptrdiff_t linesize, int x, int y, int w, int h, uint16_t *blocks, int mbs_per_slice, int abits)
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pic, int *got_packet)
static int estimate_vlc(unsigned codebook, int val)
static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice, int scale)
static int find_slice_quant(AVCodecContext *avctx, int trellis_node, int x, int y, int mbs_per_slice, ProresThreadData *td)
static void get_slice_data(ProresContext *ctx, const uint16_t *src, ptrdiff_t linesize, int x, int y, int w, int h, int16_t *blocks, uint16_t *emu_buf, int mbs_per_slice, int blocks_per_mb, int is_chroma)
static void put_alpha_diff(PutBitContext *pb, int cur, int prev, int abits)
static void prores_fdct(FDCTDSPContext *fdsp, const uint16_t *src, ptrdiff_t linesize, int16_t *block)
static void encode_slice_plane(ProresContext *ctx, PutBitContext *pb, const uint16_t *src, ptrdiff_t linesize, int mbs_per_slice, int16_t *blocks, int blocks_per_mb, const int16_t *qmat)
static void encode_dcs(PutBitContext *pb, int16_t *blocks, int blocks_per_slice, int scale)
static int find_quant_thread(AVCodecContext *avctx, void *arg, int jobnr, int threadnr)
av_cold int ff_prores_kostya_encode_init(AVCodecContext *avctx, ProresContext *ctx, enum AVPixelFormat pix_fmt)
@ PRORES_PROFILE_STANDARD
#define MAX_MBS_PER_SLICE
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static int put_bytes_output(const PutBitContext *s)
Describe the class of an AVClass context structure.
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
int flags
AV_CODEC_FLAG_*.
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.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
enum AVColorPrimaries color_primaries
enum AVColorSpace colorspace
YUV colorspace type.
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
enum AVColorTransferCharacteristic color_trc
This structure stores compressed data.
void(* fdct)(int16_t *block)
int16_t blocks[MAX_PLANES][64 *4 *MAX_MBS_PER_SLICE]
int16_t custom_chroma_q[64]
struct TrellisNode * nodes
#define av_malloc_array(a, b)
#define avpriv_request_sample(...)
static void error(const char *err)
static AVFormatContext * ctx
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
static const uint8_t quant[64]