FFmpeg
|
#include "libavutil/attributes.h"
#include "libavutil/imgutils.h"
#include "libavutil/internal.h"
#include "avcodec.h"
#include "binkdata.h"
#include "binkdsp.h"
#include "blockdsp.h"
#include "get_bits.h"
#include "hpeldsp.h"
#include "internal.h"
#include "mathops.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 |
Macros | |
#define | 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 More... | |
#define | DC_START_BITS 11 |
number of bits used to store first DC value in bundle More... | |
#define | C (1LL<<30) |
Enumerations | |
enum | OldSources { BINKB_SRC_BLOCK_TYPES = 0, BINKB_SRC_COLORS, BINKB_SRC_PATTERN, BINKB_SRC_X_OFF, BINKB_SRC_Y_OFF, BINKB_SRC_INTRA_DC, BINKB_SRC_INTER_DC, BINKB_SRC_INTRA_Q, BINKB_SRC_INTER_Q, BINKB_SRC_INTER_COEFS, BINKB_NB_SRC } |
IDs for different data types used in old version of Bink video codec. More... | |
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) |
Initialize length in all bundles. More... | |
static av_cold int | init_bundles (BinkContext *c) |
Allocate memory for bundles. More... | |
static av_cold void | free_bundles (BinkContext *c) |
Free memory used by bundles. More... | |
static void | merge (GetBitContext *gb, uint8_t *dst, uint8_t *src, int size) |
Merge two consequent lists of equal size depending on bits read. More... | |
static void | read_tree (GetBitContext *gb, Tree *tree) |
Read information about Huffman tree used to decode data. More... | |
static void | read_bundle (GetBitContext *gb, BinkContext *c, int bundle_num) |
Prepare bundle for decoding data. More... | |
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) |
Retrieve next value from bundle. More... | |
static av_cold void | binkb_init_bundle (BinkContext *c, int bundle_num) |
static av_cold void | binkb_init_bundles (BinkContext *c) |
static int | binkb_read_bundle (BinkContext *c, GetBitContext *gb, int bundle_num) |
static int | binkb_get_value (BinkContext *c, int bundle_num) |
static int | read_dct_coeffs (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. More... | |
static void | unquantize_dct_coeffs (int32_t block[64], const int32_t quant[64], int coef_count, int coef_idx[64], const uint8_t *scan) |
static int | read_residue (GetBitContext *gb, int16_t block[64], int masks_count) |
Read 8x8 block with residue after motion compensation. More... | |
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. More... | |
static int | binkb_decode_plane (BinkContext *c, AVFrame *frame, GetBitContext *gb, int plane_idx, int is_key, int is_chroma) |
static int | bink_put_pixels (BinkContext *c, uint8_t *dst, uint8_t *prev, int stride, uint8_t *ref_start, uint8_t *ref_end) |
static int | bink_decode_plane (BinkContext *c, AVFrame *frame, GetBitContext *gb, int plane_idx, int is_chroma) |
static int | decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *pkt) |
static av_cold void | binkb_calc_quant (void) |
Calculate quantization tables for version b. More... | |
static av_cold int | decode_init (AVCodecContext *avctx) |
static av_cold int | decode_end (AVCodecContext *avctx) |
static void | flush (AVCodecContext *avctx) |
Variables | |
static VLC | bink_trees [16] |
static const int | binkb_bundle_sizes [BINKB_NB_SRC] |
static const int | binkb_bundle_signed [BINKB_NB_SRC] |
static int32_t | binkb_intra_quant [16][64] |
static int32_t | binkb_inter_quant [16][64] |
static const uint8_t | bink_rlelens [4] = { 4, 8, 12, 32 } |
AVCodec | ff_bink_decoder |
#define BINK_FLAG_ALPHA 0x00100000 |
Definition at line 37 of file bink.c.
Referenced by decode_init().
#define GET_HUFF | ( | gb, | |
tree | |||
) |
Definition at line 96 of file bink.c.
Referenced by read_block_types(), read_colors(), read_motion_values(), read_patterns(), and read_runs().
#define CHECK_READ_VAL | ( | gb, | |
b, | |||
t | |||
) |
common check before starting decoding bundle data
gb | context for reading bits |
b | bundle |
t | variable where number of elements to decode will be stored |
Definition at line 307 of file bink.c.
Referenced by binkb_read_bundle(), 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 466 of file bink.c.
Referenced by bink_decode_plane().
#define C (1LL<<30) |
Referenced by add_gradient_pred_c(), aic_decode_slice(), avg_no_rnd_vc1_chroma_mc4_c(), avg_no_rnd_vc1_chroma_mc8_c(), binkb_calc_quant(), decode_haar_block(), decode_image_block(), ff_avg_h264_chroma_mc4_mmi(), ff_avg_h264_chroma_mc8_mmi(), ff_avg_no_rnd_vc1_chroma_mc4_mmi(), ff_avg_no_rnd_vc1_chroma_mc8_mmi(), ff_h263_pred_motion(), ff_put_h264_chroma_mc4_mmi(), ff_put_h264_chroma_mc8_mmi(), ff_put_no_rnd_vc1_chroma_mc4_mmi(), ff_put_no_rnd_vc1_chroma_mc8_mmi(), ff_vc1_pred_b_mv(), ff_vc1_pred_mv(), ff_vc1_pred_mv_intfr(), filter_color(), filter_color2(), filter_frame(), filter_mono(), gmc1_c(), horizX1Filter(), idct(), initFilter(), main(), mpc8_dec_enum(), mvi_predict(), precalc_coefs(), pred_8x16_motion(), pred_motion(), pred_pskip_motion(), pred_spatial_direct_motion(), put_no_rnd_vc1_chroma_mc4_c(), put_no_rnd_vc1_chroma_mc8_c(), restore_gradient_planar(), restore_gradient_planar_il(), restore_median_planar(), restore_median_planar_il(), rv30_loop_filter(), rv34_pred_mv(), rv34_pred_mv_b(), rv34_pred_mv_rv3(), rv40_decode_intra_types(), rv40_loop_filter(), svq3_pred_motion(), and wmv2_pred_motion().
enum OldSources |
IDs for different data types used in old version of Bink video codec.
enum Sources |
IDs for different data types used in Bink video codec.
enum BlockTypes |
Bink video block types.
|
static |
Initialize length in all bundles.
c | decoder context |
width | plane width |
bw | plane width in 8x8 blocks |
Definition at line 153 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Allocate memory for bundles.
c | decoder context |
Definition at line 178 of file bink.c.
Referenced by decode_init().
|
static |
Free memory used by bundles.
c | decoder context |
Definition at line 202 of file bink.c.
Referenced by decode_end(), and decode_init().
|
static |
Merge 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 217 of file bink.c.
Referenced by config_input_main(), draw_frame(), filter_frame(), read_tree(), realtext_read_header(), request_frame(), and uninit().
|
static |
Read information about Huffman tree used to decode data.
gb | context for reading bits |
tree | pointer for storing tree data |
Definition at line 244 of file bink.c.
Referenced by read_bundle().
|
static |
Prepare bundle for decoding data.
gb | context for reading bits |
c | decoder context |
bundle_num | number of the bundle to initialize |
Definition at line 285 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 316 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 338 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 372 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 407 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 427 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 468 of file bink.c.
Referenced by bink_decode_plane().
|
inlinestatic |
Retrieve next value from bundle.
c | decoder context |
bundle | bundle number |
Definition at line 520 of file bink.c.
Referenced by bink_decode_plane(), and bink_put_pixels().
|
static |
Definition at line 533 of file bink.c.
Referenced by binkb_init_bundles().
|
static |
Definition at line 540 of file bink.c.
Referenced by binkb_decode_plane().
|
static |
Definition at line 547 of file bink.c.
Referenced by binkb_decode_plane().
|
inlinestatic |
Definition at line 581 of file bink.c.
Referenced by binkb_decode_plane().
|
static |
Read 8x8 block of DCT coefficients.
gb | context for reading bits |
block | place for storing coefficients |
scan | scan order table |
quant_matrices | quantization matrices |
Definition at line 604 of file bink.c.
Referenced by bink_decode_plane(), and binkb_decode_plane().
|
static |
Definition at line 697 of file bink.c.
Referenced by bink_decode_plane(), and binkb_decode_plane().
|
static |
Read 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 717 of file bink.c.
Referenced by bink_decode_plane(), and binkb_decode_plane().
Copy 8x8 block from source to destination, where src and dst may be overlapped.
Definition at line 802 of file bink.c.
Referenced by binkb_decode_plane().
|
static |
Definition at line 812 of file bink.c.
Referenced by decode_frame().
|
static |
Definition at line 962 of file bink.c.
Referenced by bink_decode_plane().
|
static |
Definition at line 980 of file bink.c.
Referenced by decode_frame().
|
static |
Calculate quantization tables for version b.
Definition at line 1260 of file bink.c.
Referenced by decode_init().
|
static |
|
static |
|
static |
|
static |
Definition at line 60 of file bink.c.
Referenced by binkb_get_value(), and binkb_read_bundle().
|
static |
Definition at line 64 of file bink.c.
Referenced by binkb_get_value(), and binkb_read_bundle().
|
static |
Definition at line 68 of file bink.c.
Referenced by binkb_calc_quant(), and binkb_decode_plane().
|
static |
Definition at line 69 of file bink.c.
Referenced by binkb_calc_quant(), and binkb_decode_plane().
|
static |
Definition at line 370 of file bink.c.
Referenced by read_block_types().
AVCodec ff_bink_decoder |