29#define BITSTREAM_READER_LE
39#define BINK_FLAG_ALPHA 0x00100000
40#define BINK_FLAG_GRAY 0x00020000
63 4, 8, 8, 5, 5, 11, 11, 4, 4, 7
67 0, 0, 0, 1, 1, 0, 1, 0, 0, 0
98#define GET_HUFF(gb, tree) (tree).syms[get_vlc2(gb, bink_trees[(tree).vlc_num].table,\
99 bink_trees[(tree).vlc_num].bits, 1)]
186 bw = (
c->avctx->width + 7) >> 3;
187 bh = (
c->avctx->height + 7) >> 3;
194 c->bundle[
i].data =
tmp;
196 c->bundle[
i].data_end =
tmp;
233 }
while (
size && size2);
249 uint8_t tmp1[16] = { 0 }, tmp2[16], *in = tmp1, *
out = tmp2;
256 if (!
tree->vlc_num) {
257 for (
i = 0;
i < 16;
i++)
263 for (
i = 0;
i <=
len;
i++) {
265 tmp1[
tree->syms[
i]] = 1;
267 for (
i = 0;
i < 16 &&
len < 16 - 1;
i++)
272 for (
i = 0;
i < 16;
i++)
274 for (
i = 0;
i <=
len;
i++) {
276 for (t = 0; t < 16; t +=
size << 1)
280 memcpy(
tree->syms, in, 16);
297 for (
i = 0;
i < 16;
i++) {
305 int ret =
read_tree(gb, &
c->bundle[bundle_num].tree);
309 c->bundle[bundle_num].cur_dec =
310 c->bundle[bundle_num].cur_ptr =
c->bundle[bundle_num].data;
322#define CHECK_READ_VAL(gb, b, t) \
323 if (!b->cur_dec || (b->cur_dec > b->cur_ptr)) \
325 t = get_bits(gb, b->len); \
334 const uint8_t *dec_end;
337 dec_end =
b->cur_dec + t;
338 if (dec_end >
b->data_end) {
346 memset(
b->cur_dec, v, t);
349 while (
b->cur_dec < dec_end)
358 const uint8_t *dec_end;
361 dec_end =
b->cur_dec + t;
362 if (dec_end >
b->data_end) {
372 v = (v ^ sign) - sign;
374 memset(
b->cur_dec, v, t);
377 while (
b->cur_dec < dec_end) {
381 v = (v ^ sign) - sign;
396 const uint8_t *dec_end;
399 if (
c->version ==
'k') {
406 dec_end =
b->cur_dec + t;
407 if (dec_end >
b->data_end) {
415 memset(
b->cur_dec, v, t);
418 while (
b->cur_dec < dec_end) {
426 if (dec_end -
b->cur_dec <
run)
428 memset(
b->cur_dec, last,
run);
439 const uint8_t *dec_end;
442 dec_end =
b->cur_dec + t;
443 if (dec_end >
b->data_end) {
447 while (
b->cur_dec < dec_end) {
461 const uint8_t *dec_end;
464 dec_end =
b->cur_dec + t;
465 if (dec_end >
b->data_end) {
472 c->col_lastval =
GET_HUFF(gb,
c->col_high[
c->col_lastval]);
474 v = (
c->col_lastval << 4) | v;
475 if (
c->version <
'i') {
476 sign = ((int8_t) v) >> 7;
477 v = ((v & 0x7F) ^ sign) - sign;
480 memset(
b->cur_dec, v, t);
483 while (
b->cur_dec < dec_end) {
486 c->col_lastval =
GET_HUFF(gb,
c->col_high[
c->col_lastval]);
488 v = (
c->col_lastval << 4) | v;
489 if (
c->version <
'i') {
490 sign = ((int8_t) v) >> 7;
491 v = ((v & 0x7F) ^ sign) - sign;
501#define DC_START_BITS 11
504 int start_bits,
int has_sign)
506 int i, j,
len, len2, bsize, sign, v, v2;
507 int16_t *
dst = (int16_t*)
b->cur_dec;
508 int16_t *dst_end = (int16_t*)
b->data_end;
513 v =
get_bits(gb, start_bits - has_sign);
516 v = (v ^ sign) - sign;
518 if (dst_end -
dst < 1)
522 for (
i = 0;
i <
len;
i += 8) {
524 if (dst_end -
dst < len2)
528 for (j = 0; j < len2; j++) {
532 v2 = (v2 ^ sign) - sign;
536 if (v < -32768 || v > 32767) {
542 for (j = 0; j < len2; j++)
547 b->cur_dec = (uint8_t*)
dst;
562 return *
c->bundle[bundle].cur_ptr++;
564 return (int8_t)*
c->bundle[bundle].cur_ptr++;
565 ret = *(int16_t*)
c->bundle[bundle].cur_ptr;
566 c->bundle[bundle].cur_ptr += 2;
572 c->bundle[bundle_num].cur_dec =
573 c->bundle[bundle_num].cur_ptr =
c->bundle[bundle_num].data;
574 c->bundle[bundle_num].len = 13;
593 if (
b->data_end -
b->cur_dec <
len * (1 + (
bits > 8)))
604 int16_t *
dst = (int16_t*)
b->cur_dec;
613 b->cur_dec = (uint8_t*)
dst;
624 int val = *
c->bundle[bundle_num].cur_ptr++;
627 ret = *(int16_t*)
c->bundle[bundle_num].cur_ptr;
628 c->bundle[bundle_num].cur_ptr += 2;
642 const uint8_t *scan,
int *coef_count_,
643 int coef_idx[64],
int q)
648 int list_start = 64, list_end = 64, list_pos;
655 coef_list[list_end] = 4; mode_list[list_end++] = 0;
656 coef_list[list_end] = 24; mode_list[list_end++] = 0;
657 coef_list[list_end] = 44; mode_list[list_end++] = 0;
658 coef_list[list_end] = 1; mode_list[list_end++] = 3;
659 coef_list[list_end] = 2; mode_list[list_end++] = 3;
660 coef_list[list_end] = 3; mode_list[list_end++] = 3;
663 list_pos = list_start;
664 while (list_pos < list_end) {
665 if (!(mode_list[list_pos] | coef_list[list_pos]) || !
get_bits1(gb)) {
669 ccoef = coef_list[list_pos];
670 mode = mode_list[list_pos];
673 coef_list[list_pos] = ccoef + 4;
674 mode_list[list_pos] = 1;
678 coef_list[list_pos] = 0;
679 mode_list[list_pos++] = 0;
681 for (
i = 0;
i < 4;
i++, ccoef++) {
683 coef_list[--list_start] = ccoef;
684 mode_list[ list_start] = 3;
691 t = (t ^ sign) - sign;
693 block[scan[ccoef]] = t;
694 coef_idx[coef_count++] = ccoef;
699 mode_list[list_pos] = 2;
700 for (
i = 0;
i < 3;
i++) {
702 coef_list[list_end] = ccoef;
703 mode_list[list_end++] = 2;
712 t = (t ^ sign) - sign;
714 block[scan[ccoef]] = t;
715 coef_idx[coef_count++] = ccoef;
716 coef_list[list_pos] = 0;
717 mode_list[list_pos++] = 0;
727 if (quant_idx > 15U) {
733 *coef_count_ = coef_count;
739 int coef_count,
int coef_idx[64],
744 for (
i = 0;
i < coef_count;
i++) {
745 int idx = coef_idx[
i];
763 int list_start = 64, list_end = 64, list_pos;
765 int nz_coeff_count = 0;
767 coef_list[list_end] = 4; mode_list[list_end++] = 0;
768 coef_list[list_end] = 24; mode_list[list_end++] = 0;
769 coef_list[list_end] = 44; mode_list[list_end++] = 0;
770 coef_list[list_end] = 0; mode_list[list_end++] = 2;
773 for (
i = 0;
i < nz_coeff_count;
i++) {
776 if (
block[nz_coeff[
i]] < 0)
784 list_pos = list_start;
785 while (list_pos < list_end) {
786 if (!(coef_list[list_pos] | mode_list[list_pos]) || !
get_bits1(gb)) {
790 ccoef = coef_list[list_pos];
791 mode = mode_list[list_pos];
794 coef_list[list_pos] = ccoef + 4;
795 mode_list[list_pos] = 1;
799 coef_list[list_pos] = 0;
800 mode_list[list_pos++] = 0;
802 for (
i = 0;
i < 4;
i++, ccoef++) {
804 coef_list[--list_start] = ccoef;
805 mode_list[ list_start] = 3;
807 nz_coeff[nz_coeff_count++] =
bink_scan[ccoef];
817 mode_list[list_pos] = 2;
818 for (
i = 0;
i < 3;
i++) {
820 coef_list[list_end] = ccoef;
821 mode_list[list_end++] = 2;
825 nz_coeff[nz_coeff_count++] =
bink_scan[ccoef];
828 coef_list[list_pos] = 0;
829 mode_list[list_pos++] = 0;
848 for (
i = 0;
i < 8;
i++)
850 for (
i = 0;
i < 8;
i++)
855 int plane_idx,
int is_key,
int is_chroma)
859 uint8_t *
dst, *
ref, *ref_start, *ref_end;
866 int ybias = is_key ? -15 : 0;
867 int qp, quant_idx, coef_count, coef_idx[64];
870 int bw = is_chroma ? (
c->avctx->width + 15) >> 4 : (
c->avctx->width + 7) >> 3;
871 int bh = is_chroma ? (
c->avctx->height + 15) >> 4 : (
c->avctx->height + 7) >> 3;
874 ref_start =
frame->data[plane_idx];
875 ref_end =
frame->data[plane_idx] + ((bh - 1) *
frame->linesize[plane_idx] + bw - 1) * 8;
877 for (
i = 0;
i < 64;
i++)
878 coordmap[
i] = (
i & 7) + (
i >> 3) *
stride;
880 for (by = 0; by < bh; by++) {
887 for (bx = 0; bx < bw; bx++,
dst += 8) {
908 for (j = 0; j <
run; j++)
909 dst[coordmap[*scan++]] = v;
911 for (j = 0; j <
run; j++)
919 memset(dctblock, 0,
sizeof(*dctblock) * 64);
938 c->bdsp.clear_block(
block);
954 memset(dctblock, 0,
sizeof(*dctblock) * 64);
967 for (
i = 0;
i < 2;
i++)
969 for (
i = 0;
i < 8;
i++) {
971 for (j = 0; j < 8; j++, v >>= 1)
988 for (
i = 0;
i < 8;
i++)
1005 uint8_t *
dst, uint8_t *prev,
int stride,
1011 uint8_t *
ref = prev + xoff + yoff *
stride;
1023 int plane_idx,
int is_chroma)
1027 uint8_t *
dst, *prev, *ref_start, *ref_end;
1029 const uint8_t *scan;
1033 int coordmap[64], quant_idx, coef_count, coef_idx[64];
1036 int bw = is_chroma ? (
c->avctx->width + 15) >> 4 : (
c->avctx->width + 7) >> 3;
1037 int bh = is_chroma ? (
c->avctx->height + 15) >> 4 : (
c->avctx->height + 7) >> 3;
1038 int width =
c->avctx->width >> is_chroma;
1039 int height =
c->avctx->height >> is_chroma;
1058 ref_start =
c->last->data[plane_idx] ?
c->last->data[plane_idx]
1059 :
frame->data[plane_idx];
1061 + (bw - 1 +
c->last->linesize[plane_idx] * (bh - 1)) * 8;
1063 for (
i = 0;
i < 64;
i++)
1064 coordmap[
i] = (
i & 7) + (
i >> 3) *
stride;
1066 for (by = 0; by < bh; by++) {
1087 prev = (
c->last->data[plane_idx] ?
c->last->data[plane_idx]
1089 for (bx = 0; bx < bw; bx++,
dst += 8, prev += 8) {
1120 for (j = 0; j <
run; j++)
1121 ublock[*scan++] = v;
1123 for (j = 0; j <
run; j++)
1131 memset(dctblock, 0,
sizeof(*dctblock) * 64);
1136 c->binkdsp.idct_put(ublock, 8, dctblock);
1140 c->bdsp.fill_block_tab[0](
dst, v,
stride, 16);
1143 for (
i = 0;
i < 2;
i++)
1145 for (j = 0; j < 8; j++) {
1148 ublock[
i + j*8] = col[v & 1];
1152 for (j = 0; j < 8; j++)
1153 for (
i = 0;
i < 8;
i++)
1168 ref_start, ref_end);
1185 for (j = 0; j <
run; j++)
1186 dst[coordmap[*scan++]] = v;
1188 for (j = 0; j <
run; j++)
1197 ref_start, ref_end);
1200 c->bdsp.clear_block(
block);
1206 memset(dctblock, 0,
sizeof(*dctblock) * 64);
1215 c->bdsp.fill_block_tab[1](
dst, v,
stride, 8);
1219 ref_start, ref_end);
1222 memset(dctblock, 0,
sizeof(*dctblock) * 64);
1230 for (
i = 0;
i < 2;
i++)
1232 for (
i = 0;
i < 8;
i++) {
1234 for (j = 0; j < 8; j++, v >>= 1)
1239 for (
i = 0;
i < 8;
i++)
1262 int plane, plane_idx, ret;
1263 int bits_count =
pkt->size << 3;
1265 if (
c->version >
'b') {
1277 if (
c->version >=
'i')
1282 if (
c->version >=
'i')
1287 for (plane = 0; plane < 3; plane++) {
1288 plane_idx = (!plane || !
c->swap_planes) ? plane : (plane ^ 3);
1290 if (
c->version >
'b') {
1295 c->frame_num == 1, !!plane)) < 0)
1302 if (
c->version >
'b') {
1315 for (
int i = 0,
offset = 0;
i < 16;
i++) {
1332 uint8_t inv_bink_scan[64];
1333 static const int s[64]={
1334 1073741824,1489322693,1402911301,1262586814,1073741824, 843633538, 581104888, 296244703,
1335 1489322693,2065749918,1945893874,1751258219,1489322693,1170153332, 806015634, 410903207,
1336 1402911301,1945893874,1832991949,1649649171,1402911301,1102260336, 759250125, 387062357,
1337 1262586814,1751258219,1649649171,1484645031,1262586814, 992008094, 683307060, 348346918,
1338 1073741824,1489322693,1402911301,1262586814,1073741824, 843633538, 581104888, 296244703,
1339 843633538,1170153332,1102260336, 992008094, 843633538, 662838617, 456571181, 232757969,
1340 581104888, 806015634, 759250125, 683307060, 581104888, 456571181, 314491699, 160326478,
1341 296244703, 410903207, 387062357, 348346918, 296244703, 232757969, 160326478, 81733730,
1345 for (
i = 0;
i < 64;
i++)
1348 for (j = 0; j < 16; j++) {
1349 for (
i = 0;
i < 64;
i++) {
1350 int k = inv_bink_scan[
i];
1374 c->swap_planes =
c->version >=
'h';
1395 if (
c->version ==
'b') {
1422 .p.name =
"binkvideo",
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
static double val(void *priv, double ch)
const FFCodec ff_bink_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
static const uint8_t binkb_inter_seed[64]
static const uint8_t bink_tree_bits[16][16]
static const uint8_t binkb_runbits[64]
static const uint8_t bink_scan[64]
Bink DCT and residue 8x8 block scan order.
static const int32_t bink_intra_quant[16][64]
static const uint8_t binkb_intra_seed[64]
static const uint8_t bink_patterns[16][64]
static const int32_t bink_inter_quant[16][64]
static const uint8_t bink_tree_lens[16][16]
static const uint8_t binkb_num[16]
static const uint8_t binkb_den[16]
av_cold void ff_binkdsp_init(BinkDSPContext *c)
#define flags(name, subs,...)
#define i(width, name, range_min, range_max)
#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...
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
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.
void(* flush)(AVBSFContext *ctx)
int(* init)(AVBSFContext *ctx)
static const uint8_t bits[8]
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static unsigned int get_bits1(GetBitContext *s)
static int get_bits_count(const GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int av_frame_replace(AVFrame *dst, const AVFrame *src)
Ensure the destination frame refers to the same data described by the source frame,...
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx)
Check if the given dimension of an image is valid, meaning that all bytes of the image can be address...
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
Average and put pixel Widths can be 16, 8, 4 or 2.
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
static const uint8_t bink_rlelens[4]
static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, int plane_idx, int is_key, int is_chroma)
static av_cold void bink_init_vlcs(void)
static int read_block_types(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *pkt)
static int read_tree(GetBitContext *gb, Tree *tree)
Read information about Huffman tree used to decode data.
static int binkb_read_bundle(BinkContext *c, GetBitContext *gb, int bundle_num)
static void unquantize_dct_coeffs(int32_t block[64], const uint32_t quant[64], int coef_count, int coef_idx[64], const uint8_t *scan)
#define DC_START_BITS
number of bits used to store first DC value in bundle
static av_cold void free_bundles(BinkContext *c)
Free memory used by bundles.
static int read_bundle(GetBitContext *gb, BinkContext *c, int bundle_num)
Prepare bundle for decoding data.
Sources
IDs for different data types used in Bink video codec.
@ BINK_SRC_INTER_DC
DC values for interblocks with DCT.
@ BINK_SRC_SUB_BLOCK_TYPES
16x16 block types (a subset of 8x8 block types)
@ BINK_SRC_INTRA_DC
DC values for intrablocks with DCT.
@ BINK_SRC_PATTERN
8-bit values for 2-colour pattern fill
@ BINK_SRC_BLOCK_TYPES
8x8 block types
@ BINK_SRC_Y_OFF
Y components of motion value.
@ BINK_SRC_RUN
run lengths for special fill block
@ BINK_SRC_COLORS
pixel values used for different block types
@ BINK_SRC_X_OFF
X components of motion value.
OldSources
IDs for different data types used in old version of Bink video codec.
@ BINKB_SRC_INTRA_Q
quantizer values for intrablocks with DCT
@ BINKB_SRC_INTRA_DC
DC values for intrablocks with DCT.
@ BINKB_SRC_PATTERN
8-bit values for 2-colour pattern fill
@ BINKB_SRC_COLORS
pixel values used for different block types
@ BINKB_SRC_INTER_DC
DC values for interblocks with DCT.
@ BINKB_SRC_Y_OFF
Y components of motion value.
@ BINKB_SRC_INTER_COEFS
number of coefficients for residue blocks
@ BINKB_SRC_X_OFF
X components of motion value.
@ BINKB_SRC_BLOCK_TYPES
8x8 block types
@ BINKB_SRC_INTER_Q
quantizer values for interblocks with DCT
static int read_patterns(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
static int read_dct_coeffs(BinkContext *c, GetBitContext *gb, int32_t block[64], const uint8_t *scan, int *coef_count_, int coef_idx[64], int q)
Read 8x8 block of DCT coefficients.
static int get_value(BinkContext *c, int bundle)
Retrieve next value from bundle.
static av_cold int decode_init(AVCodecContext *avctx)
static void init_lengths(BinkContext *c, int width, int bw)
Initialize length in all bundles.
static int32_t binkb_intra_quant[16][64]
static int read_dcs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b, int start_bits, int has_sign)
static av_cold void binkb_calc_quant(void)
Calculate quantization tables for version b.
static av_cold int decode_end(AVCodecContext *avctx)
static int read_motion_values(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
static const uint8_t binkb_bundle_signed[BINKB_NB_SRC]
static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, int plane_idx, int is_chroma)
static int32_t binkb_inter_quant[16][64]
static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size)
Merge two consequent lists of equal size depending on bits read.
static int read_residue(GetBitContext *gb, int16_t block[64], int masks_count)
Read 8x8 block with residue after motion compensation.
static int binkb_get_value(BinkContext *c, int bundle_num)
#define GET_HUFF(gb, tree)
static int bink_put_pixels(BinkContext *c, uint8_t *dst, uint8_t *prev, int stride, uint8_t *ref_start, uint8_t *ref_end)
static void put_pixels8x8_overlapped(uint8_t *dst, uint8_t *src, int stride)
Copy 8x8 block from source to destination, where src and dst may be overlapped.
static av_cold int init_bundles(BinkContext *c)
Allocate memory for bundles.
static av_cold void binkb_init_bundles(BinkContext *c)
static int read_runs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
static const uint8_t binkb_bundle_sizes[BINKB_NB_SRC]
static int read_colors(GetBitContext *gb, Bundle *b, BinkContext *c)
static av_cold void binkb_init_bundle(BinkContext *c, int bundle_num)
BlockTypes
Bink video block types.
@ INTRA_BLOCK
intra DCT block
@ SKIP_BLOCK
skipped block
@ RAW_BLOCK
uncoded 8x8 block
@ RESIDUE_BLOCK
motion block with some difference added
@ MOTION_BLOCK
block is copied from previous frame with some offset
@ INTER_BLOCK
motion block with DCT applied to the difference
@ FILL_BLOCK
block is filled with single colour
@ PATTERN_BLOCK
block is filled with two colours following custom pattern
@ RUN_BLOCK
block is composed from runs of colours with custom scan order
@ SCALED_BLOCK
block has size 16x16
#define CHECK_READ_VAL(gb, b, t)
common check before starting decoding bundle data
static VLC bink_trees[16]
av_cold void ff_blockdsp_init(BlockDSPContext *c)
av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
Macro definitions for various function/variable attributes.
static int ff_thread_once(char *control, void(*routine)(void))
static const uint16_t mask[17]
#define FFSWAP(type, a, b)
void * av_calloc(size_t nmemb, size_t size)
Memory handling functions.
#define LOCAL_ALIGNED_32(t, v,...)
#define LOCAL_ALIGNED_16(t, v,...)
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
@ AVCOL_RANGE_JPEG
Full range content.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
@ AV_PIX_FMT_YUVA420P
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
static const uint16_t table[]
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
enum AVColorRange color_range
MPEG vs JPEG YUV range.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int flags
AV_CODEC_FLAG_*.
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
int col_lastval
value of last decoded high nibble in "colours" data type
Tree col_high[16]
trees for decoding high nibble in "colours" data type
int version
internal Bink file version
Bundle bundle[BINKB_NB_SRC]
bundles for decoding all data types
op_pixels_func put_pixels_tab
data structure used for decoding single Bink data type
uint8_t * cur_dec
pointer to the not yet decoded part of the buffer
Tree tree
Huffman tree-related data.
uint8_t * cur_ptr
pointer to the data that is not read from buffer yet
int len
length of number of entries to decode (in bits)
uint8_t * data_end
buffer end
uint8_t * data
buffer for decoded symbols
op_pixels_func put_pixels_tab[4][4]
Halfpel motion compensation with rounding (a+b+1)>>1.
data needed to decode 4-bit Huffman-coded value
uint8_t syms[16]
leaf value to symbol mapping
int vlc_num
tree number (in bink_trees[])
static int ref[MAX_W *MAX_W]
#define VLC_INIT_USE_STATIC
#define vlc_init(vlc, nb_bits, nb_codes, bits, bits_wrap, bits_size, codes, codes_wrap, codes_size, flags)
static const uint8_t quant[64]