28 #define BITSTREAM_READER_LE 38 #define BINK_FLAG_ALPHA 0x00100000 39 #define BINK_FLAG_GRAY 0x00020000 62 4, 8, 8, 5, 5, 11, 11, 4, 4, 7
66 0, 0, 0, 1, 1, 0, 1, 0, 0, 0
97 #define GET_HUFF(gb, tree) (tree).syms[get_vlc2(gb, bink_trees[(tree).vlc_num].table,\ 98 bink_trees[(tree).vlc_num].bits, 1)] 232 }
while (size && size2);
248 uint8_t tmp1[16] = { 0 }, tmp2[16], *
in = tmp1, *
out = tmp2;
256 for (i = 0; i < 16; i++)
262 for (i = 0; i <=
len; i++) {
264 tmp1[tree->
syms[
i]] = 1;
266 for (i = 0; i < 16 && len < 16 - 1; i++)
271 for (i = 0; i < 16; i++)
273 for (i = 0; i <=
len; i++) {
275 for (t = 0; t < 16; t += size << 1)
276 merge(gb, out + t, in + t, size);
279 memcpy(tree->
syms, in, 16);
296 for (i = 0; i < 16; i++) {
321 #define CHECK_READ_VAL(gb, b, t) \ 322 if (!b->cur_dec || (b->cur_dec > b->cur_ptr)) \ 324 t = get_bits(gb, b->len); \ 371 v = (v ^ sign) - sign;
380 v = (v ^ sign) - sign;
425 if (dec_end - b->
cur_dec < run)
475 sign = ((int8_t) v) >> 7;
476 v = ((v & 0x7F) ^ sign) - sign;
489 sign = ((int8_t) v) >> 7;
490 v = ((v & 0x7F) ^ sign) - sign;
500 #define DC_START_BITS 11 503 int start_bits,
int has_sign)
505 int i, j,
len, len2, bsize, sign, v, v2;
506 int16_t *dst = (int16_t*)b->
cur_dec;
507 int16_t *dst_end = (int16_t*)b->
data_end;
512 v =
get_bits(gb, start_bits - has_sign);
515 v = (v ^ sign) - sign;
517 if (dst_end - dst < 1)
521 for (i = 0; i <
len; i += 8) {
522 len2 =
FFMIN(len - i, 8);
523 if (dst_end - dst < len2)
527 for (j = 0; j < len2; j++) {
531 v2 = (v2 ^ sign) - sign;
535 if (v < -32768 || v > 32767) {
541 for (j = 0; j < len2; j++)
586 const int mask = 1 << (bits - 1);
596 for (i = 0; i <
len; i++)
599 for (i = 0; i <
len; i++)
603 int16_t *dst = (int16_t*)b->
cur_dec;
606 for (i = 0; i <
len; i++)
609 for (i = 0; i <
len; i++)
641 const uint8_t *scan,
int *coef_count_,
642 int coef_idx[64],
int q)
647 int list_start = 64, list_end = 64, list_pos;
654 coef_list[list_end] = 4; mode_list[list_end++] = 0;
655 coef_list[list_end] = 24; mode_list[list_end++] = 0;
656 coef_list[list_end] = 44; mode_list[list_end++] = 0;
657 coef_list[list_end] = 1; mode_list[list_end++] = 3;
658 coef_list[list_end] = 2; mode_list[list_end++] = 3;
659 coef_list[list_end] = 3; mode_list[list_end++] = 3;
661 for (bits =
get_bits(gb, 4) - 1; bits >= 0; bits--) {
662 list_pos = list_start;
663 while (list_pos < list_end) {
664 if (!(mode_list[list_pos] | coef_list[list_pos]) || !
get_bits1(gb)) {
668 ccoef = coef_list[list_pos];
669 mode = mode_list[list_pos];
672 coef_list[list_pos] = ccoef + 4;
673 mode_list[list_pos] = 1;
676 coef_list[list_pos] = 0;
677 mode_list[list_pos++] = 0;
679 for (i = 0; i < 4; i++, ccoef++) {
681 coef_list[--list_start] = ccoef;
682 mode_list[ list_start] = 3;
689 t = (t ^ sign) - sign;
691 block[scan[ccoef]] = t;
692 coef_idx[coef_count++] = ccoef;
697 mode_list[list_pos] = 2;
698 for (i = 0; i < 3; i++) {
700 coef_list[list_end] = ccoef;
701 mode_list[list_end++] = 2;
710 t = (t ^ sign) - sign;
712 block[scan[ccoef]] = t;
713 coef_idx[coef_count++] = ccoef;
714 coef_list[list_pos] = 0;
715 mode_list[list_pos++] = 0;
725 if (quant_idx > 15
U) {
731 *coef_count_ = coef_count;
737 int coef_count,
int coef_idx[64],
741 block[0] = (
int)(block[0] * quant[0]) >> 11;
742 for (i = 0; i < coef_count; i++) {
743 int idx = coef_idx[
i];
744 block[scan[idx]] = (
int)(block[scan[idx]] * quant[idx]) >> 11;
761 int list_start = 64, list_end = 64, list_pos;
763 int nz_coeff_count = 0;
765 coef_list[list_end] = 4; mode_list[list_end++] = 0;
766 coef_list[list_end] = 24; mode_list[list_end++] = 0;
767 coef_list[list_end] = 44; mode_list[list_end++] = 0;
768 coef_list[list_end] = 0; mode_list[list_end++] = 2;
771 for (i = 0; i < nz_coeff_count; i++) {
774 if (block[nz_coeff[i]] < 0)
775 block[nz_coeff[
i]] -=
mask;
777 block[nz_coeff[
i]] +=
mask;
782 list_pos = list_start;
783 while (list_pos < list_end) {
784 if (!(coef_list[list_pos] | mode_list[list_pos]) || !
get_bits1(gb)) {
788 ccoef = coef_list[list_pos];
789 mode = mode_list[list_pos];
792 coef_list[list_pos] = ccoef + 4;
793 mode_list[list_pos] = 1;
796 coef_list[list_pos] = 0;
797 mode_list[list_pos++] = 0;
799 for (i = 0; i < 4; i++, ccoef++) {
801 coef_list[--list_start] = ccoef;
802 mode_list[ list_start] = 3;
804 nz_coeff[nz_coeff_count++] =
bink_scan[ccoef];
806 block[
bink_scan[ccoef]] = (mask ^ sign) - sign;
814 mode_list[list_pos] = 2;
815 for (i = 0; i < 3; i++) {
817 coef_list[list_end] = ccoef;
818 mode_list[list_end++] = 2;
822 nz_coeff[nz_coeff_count++] =
bink_scan[ccoef];
824 block[
bink_scan[ccoef]] = (mask ^ sign) - sign;
825 coef_list[list_pos] = 0;
826 mode_list[list_pos++] = 0;
845 for (i = 0; i < 8; i++)
846 memcpy(tmp + i*8, src + i*stride, 8);
847 for (i = 0; i < 8; i++)
848 memcpy(dst + i*stride, tmp + i*8, 8);
852 int plane_idx,
int is_key,
int is_chroma)
863 int ybias = is_key ? -15 : 0;
864 int qp, quant_idx, coef_count, coef_idx[64];
871 ref_start = frame->
data[plane_idx];
872 ref_end = frame->
data[plane_idx] + (bh * frame->
linesize[plane_idx] + bw) * 8;
874 for (i = 0; i < 64; i++)
875 coordmap[i] = (i & 7) + (i >> 3) * stride;
877 for (by = 0; by < bh; by++) {
884 for (bx = 0; bx < bw; bx++, dst += 8) {
905 for (j = 0; j <
run; j++)
906 dst[coordmap[*scan++]] = v;
908 for (j = 0; j <
run; j++)
916 memset(dctblock, 0,
sizeof(*dctblock) * 64);
927 ref = dst + xoff + yoff *
stride;
928 if (ref < ref_start || ref + 8*stride > ref_end) {
943 ref = dst + xoff + yoff *
stride;
944 if (ref < ref_start || ref + 8 * stride > ref_end) {
951 memset(dctblock, 0,
sizeof(*dctblock) * 64);
964 for (i = 0; i < 2; i++)
966 for (i = 0; i < 8; i++) {
968 for (j = 0; j < 8; j++, v >>= 1)
969 dst[i*stride + j] = col[v & 1];
975 ref = dst + xoff + yoff *
stride;
976 if (ref < ref_start || ref + 8 * stride > ref_end) {
985 for (i = 0; i < 8; i++)
1009 if (ref < ref_start || ref > ref_end) {
1020 int plane_idx,
int is_chroma)
1024 uint8_t *dst, *prev, *ref_start, *ref_end;
1030 int coordmap[64], quant_idx, coef_count, coef_idx[64];
1041 dst = frame->
data[plane_idx];
1043 for (i = 0; i <
height; i++)
1044 memset(dst + i * stride, fill, width);
1056 : frame->
data[plane_idx];
1058 + (bw - 1 + c->
last->
linesize[plane_idx] * (bh - 1)) * 8;
1060 for (i = 0; i < 64; i++)
1061 coordmap[i] = (i & 7) + (i >> 3) * stride;
1063 for (by = 0; by < bh; by++) {
1085 : frame->
data[plane_idx]) + 8*by*stride;
1086 for (bx = 0; bx < bw; bx++, dst += 8, prev += 8) {
1117 for (j = 0; j <
run; j++)
1118 ublock[*scan++] = v;
1120 for (j = 0; j <
run; j++)
1128 memset(dctblock, 0,
sizeof(*dctblock) * 64);
1140 for (i = 0; i < 2; i++)
1142 for (j = 0; j < 8; j++) {
1144 for (i = 0; i < 8; i++, v >>= 1)
1145 ublock[i + j*8] = col[v & 1];
1149 for (j = 0; j < 8; j++)
1150 for (i = 0; i < 8; i++)
1165 ref_start, ref_end);
1182 for (j = 0; j <
run; j++)
1183 dst[coordmap[*scan++]] = v;
1185 for (j = 0; j <
run; j++)
1194 ref_start, ref_end);
1203 memset(dctblock, 0,
sizeof(*dctblock) * 64);
1216 ref_start, ref_end);
1219 memset(dctblock, 0,
sizeof(*dctblock) * 64);
1227 for (i = 0; i < 2; i++)
1229 for (i = 0; i < 8; i++) {
1231 for (j = 0; j < 8; j++, v >>= 1)
1232 dst[i*stride + j] = col[v & 1];
1236 for (i = 0; i < 8; i++)
1259 int plane, plane_idx,
ret;
1260 int bits_count = pkt->
size << 3;
1284 for (plane = 0; plane < 3; plane++) {
1285 plane_idx = (!plane || !c->
swap_planes) ? plane : (plane ^ 3);
1318 static const int s[64]={
1319 1073741824,1489322693,1402911301,1262586814,1073741824, 843633538, 581104888, 296244703,
1320 1489322693,2065749918,1945893874,1751258219,1489322693,1170153332, 806015634, 410903207,
1321 1402911301,1945893874,1832991949,1649649171,1402911301,1102260336, 759250125, 387062357,
1322 1262586814,1751258219,1649649171,1484645031,1262586814, 992008094, 683307060, 348346918,
1323 1073741824,1489322693,1402911301,1262586814,1073741824, 843633538, 581104888, 296244703,
1324 843633538,1170153332,1102260336, 992008094, 843633538, 662838617, 456571181, 232757969,
1325 581104888, 806015634, 759250125, 683307060, 581104888, 456571181, 314491699, 160326478,
1326 296244703, 410903207, 387062357, 348346918, 296244703, 232757969, 160326478, 81733730,
1330 for (i = 0; i < 64; i++)
1333 for (j = 0; j < 16; j++) {
1334 for (i = 0; i < 64; i++) {
1335 int k = inv_bink_scan[
i];
1348 static int binkb_initialised = 0;
1361 if (!bink_trees[15].table) {
1362 for (i = 0; i < 16; i++) {
1364 bink_trees[
i].
table = table + i*128;
1366 init_vlc(&bink_trees[i], maxbits, 16,
1392 if (!binkb_initialised) {
1394 binkb_initialised = 1;
1419 .
name =
"binkvideo",
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static const uint8_t bink_tree_lens[16][16]
8-bit values for 2-colour pattern fill
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
av_cold void ff_binkdsp_init(BinkDSPContext *c)
static const uint8_t bink_tree_bits[16][16]
#define CHECK_READ_VAL(gb, b, t)
common check before starting decoding bundle data
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static av_cold int init(AVCodecContext *avctx)
void(* clear_block)(int16_t *block)
void(* scale_block)(const uint8_t src[64], uint8_t *dst, int linesize)
static const uint8_t binkb_den[16]
enum AVColorRange color_range
MPEG vs JPEG YUV range.
static int read_residue(GetBitContext *gb, int16_t block[64], int masks_count)
Read 8x8 block with residue after motion compensation.
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
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)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
8-bit values for 2-colour pattern fill
static const uint8_t bink_scan[64]
Bink DCT and residue 8x8 block scan order.
Tree col_high[16]
trees for decoding high nibble in "colours" data type
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
16x16 block types (a subset of 8x8 block types)
int len
length of number of entries to decode (in bits)
Macro definitions for various function/variable attributes.
void * av_calloc(size_t nmemb, size_t size)
Non-inlined equivalent of av_mallocz_array().
static int32_t binkb_inter_quant[16][64]
void(* idct_put)(uint8_t *dest, int line_size, int32_t *block)
#define LOCAL_ALIGNED_16(t, v,...)
quantizer values for interblocks with DCT
static av_cold void binkb_init_bundle(BinkContext *c, int bundle_num)
static int read_patterns(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
X components of motion value.
planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
motion block with DCT applied to the difference
The exact code depends on how similar the blocks are and how related they are to the block
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static int binkb_get_value(BinkContext *c, int bundle_num)
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.
Tree tree
Huffman tree-related data.
BlockTypes
Bink video block types.
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
#define LOCAL_ALIGNED_32(t, v,...)
int av_frame_ref(AVFrame *dst, const AVFrame *src)
Set up a new reference to the data described by the source frame.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
#define u(width, name, range_min, range_max)
static const int32_t bink_inter_quant[16][64]
static int get_bits_count(const GetBitContext *s)
int vlc_num
tree number (in bink_trees[])
bitstream reader API header.
static int read_runs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
data structure used for decoding single Bink data type
static const uint8_t bink_patterns[16][64]
static const uint16_t table[]
uint8_t * data
buffer for decoded symbols
block is copied from previous frame with some offset
static int get_bits_left(GetBitContext *gb)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
uint8_t * data_end
buffer end
static const uint16_t mask[17]
#define init_vlc(vlc, nb_bits, nb_codes,bits, bits_wrap, bits_size,codes, codes_wrap, codes_size,flags)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
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...
static av_cold void free_bundles(BinkContext *c)
Free memory used by bundles.
int flags
AV_CODEC_FLAG_*.
const char * name
Name of the codec implementation.
int col_lastval
value of last decoded high nibble in "colours" data type
DC values for interblocks with DCT.
av_cold void ff_hpeldsp_init(HpelDSPContext *c, int flags)
block is composed from runs of colours with custom scan order
common internal API header
block is filled with single colour
static av_cold void binkb_calc_quant(void)
Calculate quantization tables for version b.
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...
int width
picture width / height.
static int binkb_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, int plane_idx, int is_key, int is_chroma)
Y components of motion value.
void(* idct_add)(uint8_t *dest, int line_size, int32_t *block)
number of coefficients for residue blocks
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
static const uint8_t binkb_inter_seed[64]
static const uint8_t binkb_runbits[64]
static int bink_decode_plane(BinkContext *c, AVFrame *frame, GetBitContext *gb, int plane_idx, int is_chroma)
data needed to decode 4-bit Huffman-coded value
uint8_t * cur_dec
pointer to the not yet decoded part of the buffer
Libavcodec external API header.
quantizer values for intrablocks with DCT
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
void(* add_pixels8)(uint8_t *av_restrict pixels, int16_t *block, int line_size)
#define DC_START_BITS
number of bits used to store first DC value in bundle
main external API structure.
void(* op_pixels_func)(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
op_pixels_func put_pixels_tab[4][4]
Halfpel motion compensation with rounding (a+b+1)>>1.
static av_cold int decode_init(AVCodecContext *avctx)
static unsigned int get_bits1(GetBitContext *s)
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(const uint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(const int16_t *) pi >> 8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(const int16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(const int32_t *) pi >> 24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(const int32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(const float *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(const float *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(const float *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(const double *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(const double *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(const double *) pi *(1U<< 31))))#define SET_CONV_FUNC_GROUP(ofmt, ifmt) static void set_generic_function(AudioConvert *ac){}void ff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map){AudioConvert *ac;int in_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) return NULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt) > 2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);return NULL;}return ac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}else if(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;else ac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);return ac;}int ff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){int use_generic=1;int len=in->nb_samples;int p;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%d samples - audio_convert: %s to %s (dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));return ff_convert_dither(ac-> in
static const int32_t bink_intra_quant[16][64]
DC values for interblocks with DCT.
Sources
IDs for different data types used in Bink video codec.
block is filled with two colours following custom pattern
static av_cold void binkb_init_bundles(BinkContext *c)
static int32_t binkb_intra_quant[16][64]
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 init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
static const uint8_t binkb_num[16]
#define GET_HUFF(gb, tree)
run lengths for special fill block
Y components of motion value.
static VLC bink_trees[16]
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_bundle(GetBitContext *gb, BinkContext *c, int bundle_num)
Prepare bundle for decoding data.
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
Bundle bundle[BINKB_NB_SRC]
bundles for decoding all data types
#define flags(name, subs,...)
static void flush(AVCodecContext *avctx)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
pixel values used for different block types
Narrow or limited range content.
X components of motion value.
uint8_t * cur_ptr
pointer to the data that is not read from buffer yet
GLint GLenum GLboolean GLsizei stride
static const uint8_t binkb_intra_seed[64]
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static int binkb_read_bundle(BinkContext *c, GetBitContext *gb, int bundle_num)
common internal api header.
static int ref[MAX_W *MAX_W]
static void init_lengths(BinkContext *c, int width, int bw)
Initialize length in all bundles.
static av_cold int init_bundles(BinkContext *c)
Allocate memory for bundles.
#define INIT_VLC_USE_NEW_STATIC
static int read_colors(GetBitContext *gb, Bundle *b, BinkContext *c)
static int read_block_types(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
uint8_t syms[16]
leaf value to symbol mapping
static int read_dcs(AVCodecContext *avctx, GetBitContext *gb, Bundle *b, int start_bits, int has_sign)
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt)
DC values for intrablocks with DCT.
static int read_tree(GetBitContext *gb, Tree *tree)
Read information about Huffman tree used to decode data.
static int read_motion_values(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
motion block with some difference added
VLC_TYPE(* table)[2]
code, bits
static int bink_put_pixels(BinkContext *c, uint8_t *dst, uint8_t *prev, int stride, uint8_t *ref_start, uint8_t *ref_end)
static const int binkb_bundle_sizes[BINKB_NB_SRC]
int version
internal Bink file version
static const int binkb_bundle_signed[BINKB_NB_SRC]
static av_cold int decode_end(AVCodecContext *avctx)
op_pixels_func put_pixels_tab
#define FFSWAP(type, a, b)
static const uint8_t bink_rlelens[4]
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
pixel values used for different block types
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
static int get_value(BinkContext *c, int bundle)
Retrieve next value from bundle.
static double val(void *priv, double ch)
This structure stores compressed data.
#define AV_GET_BUFFER_FLAG_REF
The decoder will keep a reference to the frame and may reuse it later.
mode
Use these values in ebur128_init (or'ed).
DC values for intrablocks with DCT.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
OldSources
IDs for different data types used in old version of Bink video codec.
op_fill_func fill_block_tab[2]