#include "avcodec.h"
#include "dsputil.h"
#include "binkdata.h"
#include "mathops.h"
#include "get_bits.h"
Go to the source code of this file.
Data Structures | |
struct | Tree |
data needed to decode 4-bit Huffman-coded value More... | |
struct | Bundle |
data structure used for decoding single Bink data type More... | |
struct | BinkContext |
Defines | |
#define | ALT_BITSTREAM_READER_LE |
#define | BINK_FLAG_ALPHA 0x00100000 |
#define | BINK_FLAG_GRAY 0x00020000 |
#define | GET_HUFF(gb, tree) |
#define | CHECK_READ_VAL(gb, b, t) |
common check before starting decoding bundle data | |
#define | DC_START_BITS 11 |
number of bits used to store first DC value in bundle | |
Enumerations | |
enum | Sources { BINK_SRC_BLOCK_TYPES = 0, BINK_SRC_SUB_BLOCK_TYPES, BINK_SRC_COLORS, BINK_SRC_PATTERN, BINK_SRC_X_OFF, BINK_SRC_Y_OFF, BINK_SRC_INTRA_DC, BINK_SRC_INTER_DC, BINK_SRC_RUN, BINK_NB_SRC } |
IDs for different data types used in Bink video codec. More... | |
enum | BlockTypes { SKIP_BLOCK = 0, SCALED_BLOCK, MOTION_BLOCK, RUN_BLOCK, RESIDUE_BLOCK, INTRA_BLOCK, FILL_BLOCK, INTER_BLOCK, PATTERN_BLOCK, RAW_BLOCK } |
Bink video block types. More... | |
Functions | |
static void | init_lengths (BinkContext *c, int width, int bw) |
Initializes length length in all bundles. | |
static av_cold void | init_bundles (BinkContext *c) |
Allocates memory for bundles. | |
static av_cold void | free_bundles (BinkContext *c) |
Frees memory used by bundles. | |
static void | merge (GetBitContext *gb, uint8_t *dst, uint8_t *src, int size) |
Merges two consequent lists of equal size depending on bits read. | |
static void | read_tree (GetBitContext *gb, Tree *tree) |
Reads information about Huffman tree used to decode data. | |
static void | read_bundle (GetBitContext *gb, BinkContext *c, int bundle_num) |
Prepares bundle for decoding data. | |
static int | read_runs (AVCodecContext *avctx, GetBitContext *gb, Bundle *b) |
static int | read_motion_values (AVCodecContext *avctx, GetBitContext *gb, Bundle *b) |
static int | read_block_types (AVCodecContext *avctx, GetBitContext *gb, Bundle *b) |
static int | read_patterns (AVCodecContext *avctx, GetBitContext *gb, Bundle *b) |
static int | read_colors (GetBitContext *gb, Bundle *b, BinkContext *c) |
static int | read_dcs (AVCodecContext *avctx, GetBitContext *gb, Bundle *b, int start_bits, int has_sign) |
static int | get_value (BinkContext *c, int bundle) |
Retrieves next value from bundle. | |
static int | read_dct_coeffs (GetBitContext *gb, DCTELEM block[64], const uint8_t *scan, int is_intra) |
Reads 8x8 block of DCT coefficients. | |
static int | read_residue (GetBitContext *gb, DCTELEM block[64], int masks_count) |
Reads 8x8 block with residue after motion compensation. | |
static int | bink_decode_plane (BinkContext *c, GetBitContext *gb, int plane_idx, int is_chroma) |
static int | decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *pkt) |
static av_cold int | decode_init (AVCodecContext *avctx) |
static av_cold int | decode_end (AVCodecContext *avctx) |
Variables | |
static VLC | bink_trees [16] |
const uint8_t | bink_rlelens [4] = { 4, 8, 12, 32 } |
AVCodec | bink_decoder |
#define BINK_FLAG_ALPHA 0x00100000 |
#define CHECK_READ_VAL | ( | gb, | |||
b, | |||||
t | ) |
Value:
if (!b->cur_dec || (b->cur_dec > b->cur_ptr)) \ return 0; \ t = get_bits(gb, b->len); \ if (!t) { \ b->cur_dec = NULL; \ return 0; \ } \
gb | context for reading bits | |
b | bundle | |
t | variable where number of elements to decode will be stored |
Definition at line 264 of file bink.c.
Referenced by read_block_types(), read_colors(), read_dcs(), read_motion_values(), read_patterns(), and read_runs().
#define DC_START_BITS 11 |
number of bits used to store first DC value in bundle
Definition at line 421 of file bink.c.
Referenced by bink_decode_plane().
#define GET_HUFF | ( | gb, | |||
tree | ) |
Value:
(tree).syms[get_vlc2(gb, bink_trees[(tree).vlc_num].table,\ bink_trees[(tree).vlc_num].bits, 1)]
Definition at line 60 of file bink.c.
Referenced by read_block_types(), read_colors(), read_motion_values(), read_patterns(), and read_runs().
enum BlockTypes |
Bink video block types.
enum Sources |
IDs for different data types used in Bink video codec.
static int bink_decode_plane | ( | BinkContext * | c, | |
GetBitContext * | gb, | |||
int | plane_idx, | |||
int | is_chroma | |||
) | [static] |
static av_cold int decode_end | ( | AVCodecContext * | avctx | ) | [static] |
static int decode_frame | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
AVPacket * | pkt | |||
) | [static] |
static av_cold int decode_init | ( | AVCodecContext * | avctx | ) | [static] |
static av_cold void free_bundles | ( | BinkContext * | c | ) | [static] |
Frees memory used by bundles.
c | decoder context |
Definition at line 158 of file bink.c.
Referenced by decode_end().
static int get_value | ( | BinkContext * | c, | |
int | bundle | |||
) | [inline, static] |
Retrieves next value from bundle.
c | decoder context | |
bundle | bundle number |
Definition at line 470 of file bink.c.
Referenced by bink_decode_plane(), and get_tag().
static av_cold void init_bundles | ( | BinkContext * | c | ) | [static] |
Allocates memory for bundles.
c | decoder context |
Definition at line 138 of file bink.c.
Referenced by decode_init().
static void init_lengths | ( | BinkContext * | c, | |
int | width, | |||
int | bw | |||
) | [static] |
Initializes length length in all bundles.
c | decoder context | |
width | plane width | |
bw | plane width in 8x8 blocks |
Definition at line 115 of file bink.c.
Referenced by bink_decode_plane().
static void merge | ( | GetBitContext * | gb, | |
uint8_t * | dst, | |||
uint8_t * | src, | |||
int | size | |||
) | [static] |
Merges two consequent lists of equal size depending on bits read.
gb | context for reading bits | |
dst | buffer where merged list will be written to | |
src | pointer to the head of the first list (the second lists starts at src+size) | |
size | input lists size |
Definition at line 173 of file bink.c.
Referenced by read_tree().
static int read_block_types | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb, | |||
Bundle * | b | |||
) | [static] |
static void read_bundle | ( | GetBitContext * | gb, | |
BinkContext * | c, | |||
int | bundle_num | |||
) | [static] |
Prepares bundle for decoding data.
gb | context for reading bits | |
c | decoder context | |
bundle_num | number of the bundle to initialize |
Definition at line 242 of file bink.c.
Referenced by bink_decode_plane().
static int read_colors | ( | GetBitContext * | gb, | |
Bundle * | b, | |||
BinkContext * | c | |||
) | [static] |
static int read_dcs | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb, | |||
Bundle * | b, | |||
int | start_bits, | |||
int | has_sign | |||
) | [static] |
static int read_dct_coeffs | ( | GetBitContext * | gb, | |
DCTELEM | block[64], | |||
const uint8_t * | scan, | |||
int | is_intra | |||
) | [static] |
Reads 8x8 block of DCT coefficients.
gb | context for reading bits | |
block | place for storing coefficients | |
scan | scan order table | |
is_intra | tells what set of quantizer matrices to use |
Definition at line 492 of file bink.c.
Referenced by bink_decode_plane().
static int read_motion_values | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb, | |||
Bundle * | b | |||
) | [static] |
static int read_patterns | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb, | |||
Bundle * | b | |||
) | [static] |
static int read_residue | ( | GetBitContext * | gb, | |
DCTELEM | block[64], | |||
int | masks_count | |||
) | [static] |
Reads 8x8 block with residue after motion compensation.
gb | context for reading bits | |
block | place to store read data | |
masks_count | number of masks to decode |
Definition at line 593 of file bink.c.
Referenced by bink_decode_plane().
static int read_runs | ( | AVCodecContext * | avctx, | |
GetBitContext * | gb, | |||
Bundle * | b | |||
) | [static] |
static void read_tree | ( | GetBitContext * | gb, | |
Tree * | tree | |||
) | [static] |
Reads information about Huffman tree used to decode data.
gb | context for reading bits | |
tree | pointer for storing tree data |
Definition at line 200 of file bink.c.
Referenced by read_bundle().
Initial value:
{ "binkvideo", AVMEDIA_TYPE_VIDEO, CODEC_ID_BINKVIDEO, sizeof(BinkContext), decode_init, NULL, decode_end, decode_frame, .long_name = NULL_IF_CONFIG_SMALL("Bink video"), }
const uint8_t bink_rlelens[4] = { 4, 8, 12, 32 } |
VLC bink_trees[16] [static] |