#include "libavcore/imgutils.h"#include "avcodec.h"#include "vp56.h"#include "vp8data.h"#include "vp8dsp.h"#include "h264pred.h"#include "rectangle.h"Go to the source code of this file.
Data Structures | |
| struct | VP8FilterStrength |
| VP8 compatible video decoder. More... | |
| struct | VP8Macroblock |
| struct | VP8Context |
Defines | |
| #define | MARGIN (16 << 2) |
| #define | MV_EDGE_CHECK(n) |
| #define | XCHG(a, b, xchg) |
Functions | |
| static void | vp8_decode_flush (AVCodecContext *avctx) |
| static int | update_dimensions (VP8Context *s, int width, int height) |
| static void | parse_segment_info (VP8Context *s) |
| static void | update_lf_deltas (VP8Context *s) |
| static int | setup_partitions (VP8Context *s, const uint8_t *buf, int buf_size) |
| static void | get_quants (VP8Context *s) |
| static VP56Frame | ref_to_update (VP8Context *s, int update, VP56Frame ref) |
| Determine which buffers golden and altref should be updated with after this frame. | |
| static void | update_refs (VP8Context *s) |
| static int | decode_frame_header (VP8Context *s, const uint8_t *buf, int buf_size) |
| static av_always_inline void | clamp_mv (VP8Context *s, VP56mv *dst, const VP56mv *src, int mb_x, int mb_y) |
| static av_always_inline void | find_near_mvs (VP8Context *s, VP8Macroblock *mb, VP56mv near[2], VP56mv *best, uint8_t cnt[4]) |
| static int | read_mv_component (VP56RangeCoder *c, const uint8_t *p) |
| Motion vector coding, 17.1. | |
| static av_always_inline const uint8_t * | get_submv_prob (uint32_t left, uint32_t top) |
| static av_always_inline int | decode_splitmvs (VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb) |
| Split motion vector prediction, 16.4. | |
| static av_always_inline void | decode_intra4x4_modes (VP8Context *s, VP56RangeCoder *c, int mb_x, int keyframe) |
| static av_always_inline void | decode_mb_mode (VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_t *segment) |
| static int | decode_block_coeffs_internal (VP56RangeCoder *c, DCTELEM block[16], uint8_t probs[8][3][NUM_DCT_TOKENS-1], int i, uint8_t *token_prob, int16_t qmul[2]) |
| static av_always_inline int | decode_block_coeffs (VP56RangeCoder *c, DCTELEM block[16], uint8_t probs[8][3][NUM_DCT_TOKENS-1], int i, int zero_nhood, int16_t qmul[2]) |
| static av_always_inline void | decode_mb_coeffs (VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, uint8_t t_nnz[9], uint8_t l_nnz[9]) |
| static av_always_inline void | backup_mb_border (uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int simple) |
| static av_always_inline void | xchg_mb_border (uint8_t *top_border, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int mb_x, int mb_y, int mb_width, int simple, int xchg) |
| static av_always_inline int | check_dc_pred8x8_mode (int mode, int mb_x, int mb_y) |
| static av_always_inline int | check_tm_pred8x8_mode (int mode, int mb_x, int mb_y) |
| static av_always_inline int | check_intra_pred8x8_mode (int mode, int mb_x, int mb_y) |
| static av_always_inline int | check_intra_pred8x8_mode_emuedge (int mode, int mb_x, int mb_y) |
| static av_always_inline int | check_tm_pred4x4_mode (int mode, int mb_x, int mb_y) |
| static av_always_inline int | check_intra_pred4x4_mode_emuedge (int mode, int mb_x, int mb_y, int *copy_buf) |
| static av_always_inline void | intra_predict (VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, int mb_x, int mb_y) |
| static av_always_inline void | vp8_mc (VP8Context *s, int luma, uint8_t *dst, uint8_t *src, const VP56mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, int linesize, vp8_mc_func mc_func[3][3]) |
| Generic MC function. | |
| static av_always_inline void | vp8_mc_part (VP8Context *s, uint8_t *dst[3], AVFrame *ref_frame, int x_off, int y_off, int bx_off, int by_off, int block_w, int block_h, int width, int height, VP56mv *mv) |
| static av_always_inline void | prefetch_motion (VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int mb_xy, int ref) |
| static av_always_inline void | inter_predict (VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb, int mb_x, int mb_y) |
| Apply motion vectors to prediction buffer, chapter 18. | |
| static av_always_inline void | idct_mb (VP8Context *s, uint8_t *dst[3], VP8Macroblock *mb) |
| static av_always_inline void | filter_level_for_mb (VP8Context *s, VP8Macroblock *mb, VP8FilterStrength *f) |
| static av_always_inline void | filter_mb (VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f, int mb_x, int mb_y) |
| static av_always_inline void | filter_mb_simple (VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y) |
| static void | filter_mb_row (VP8Context *s, int mb_y) |
| static void | filter_mb_row_simple (VP8Context *s, int mb_y) |
| static int | vp8_decode_frame (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
| static av_cold int | vp8_decode_init (AVCodecContext *avctx) |
| static av_cold int | vp8_decode_free (AVCodecContext *avctx) |
Variables | |
| AVCodec | vp8_decoder |
| #define MARGIN (16 << 2) |
Referenced by clamp_mv().
| #define MV_EDGE_CHECK | ( | n | ) |
Value:
{\
VP8Macroblock *edge = mb_edge[n];\
int edge_ref = edge->ref_frame;\
if (edge_ref != VP56_FRAME_CURRENT) {\
uint32_t mv = AV_RN32A(&edge->mv);\
if (mv) {\
if (cur_sign_bias != sign_bias[edge_ref]) {\
/* SWAR negate of the values in mv. */\
mv = ~mv;\
mv = ((mv&0x7fff7fff) + 0x00010001) ^ (mv&0x80008000);\
}\
if (!n || mv != AV_RN32A(&near_mv[idx]))\
AV_WN32A(&near_mv[++idx], mv);\
cnt[idx] += 1 + (n != 2);\
} else\
cnt[CNT_ZERO] += 1 + (n != 2);\
}\
}
Referenced by find_near_mvs().
| #define XCHG | ( | a, | |||
| b, | |||||
| xchg | ) |
| static av_always_inline void backup_mb_border | ( | uint8_t * | top_border, | |
| uint8_t * | src_y, | |||
| uint8_t * | src_cb, | |||
| uint8_t * | src_cr, | |||
| int | linesize, | |||
| int | uvlinesize, | |||
| int | simple | |||
| ) | [static] |
| static av_always_inline int check_dc_pred8x8_mode | ( | int | mode, | |
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
Definition at line 986 of file vp8.c.
Referenced by check_intra_pred8x8_mode(), and check_intra_pred8x8_mode_emuedge().
| static av_always_inline int check_intra_pred4x4_mode_emuedge | ( | int | mode, | |
| int | mb_x, | |||
| int | mb_y, | |||
| int * | copy_buf | |||
| ) | [static] |
| static av_always_inline int check_intra_pred8x8_mode | ( | int | mode, | |
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static av_always_inline int check_intra_pred8x8_mode_emuedge | ( | int | mode, | |
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static av_always_inline int check_tm_pred4x4_mode | ( | int | mode, | |
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static av_always_inline int check_tm_pred8x8_mode | ( | int | mode, | |
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static av_always_inline void clamp_mv | ( | VP8Context * | s, | |
| VP56mv * | dst, | |||
| const VP56mv * | src, | |||
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static av_always_inline int decode_block_coeffs | ( | VP56RangeCoder * | c, | |
| DCTELEM | block[16], | |||
| uint8_t | probs[8][3][NUM_DCT_TOKENS-1], | |||
| int | i, | |||
| int | zero_nhood, | |||
| int16_t | qmul[2] | |||
| ) | [static] |
| static int decode_block_coeffs_internal | ( | VP56RangeCoder * | c, | |
| DCTELEM | block[16], | |||
| uint8_t | probs[8][3][NUM_DCT_TOKENS-1], | |||
| int | i, | |||
| uint8_t * | token_prob, | |||
| int16_t | qmul[2] | |||
| ) | [static] |
| c | arithmetic bitstream reader context | |
| block | destination for block coefficients | |
| probs | probabilities to use when reading trees from the bitstream | |
| i | initial coeff index, 0 unless a separate DC block is coded | |
| zero_nhood | the initial prediction context for number of surrounding all-zero blocks (only left/top, so 0-2) | |
| qmul | array holding the dc/ac dequant factor at position 0/1 |
Definition at line 818 of file vp8.c.
Referenced by decode_block_coeffs().
| static int decode_frame_header | ( | VP8Context * | s, | |
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static av_always_inline void decode_intra4x4_modes | ( | VP8Context * | s, | |
| VP56RangeCoder * | c, | |||
| int | mb_x, | |||
| int | keyframe | |||
| ) | [static] |
| static av_always_inline void decode_mb_coeffs | ( | VP8Context * | s, | |
| VP56RangeCoder * | c, | |||
| VP8Macroblock * | mb, | |||
| uint8_t | t_nnz[9], | |||
| uint8_t | l_nnz[9] | |||
| ) | [static] |
| static av_always_inline void decode_mb_mode | ( | VP8Context * | s, | |
| VP8Macroblock * | mb, | |||
| int | mb_x, | |||
| int | mb_y, | |||
| uint8_t * | segment | |||
| ) | [static] |
| static av_always_inline int decode_splitmvs | ( | VP8Context * | s, | |
| VP56RangeCoder * | c, | |||
| VP8Macroblock * | mb | |||
| ) | [static] |
Split motion vector prediction, 16.4.
Definition at line 638 of file vp8.c.
Referenced by decode_mb_mode().
| static av_always_inline void filter_level_for_mb | ( | VP8Context * | s, | |
| VP8Macroblock * | mb, | |||
| VP8FilterStrength * | f | |||
| ) | [static] |
| static av_always_inline void filter_mb | ( | VP8Context * | s, | |
| uint8_t * | dst[3], | |||
| VP8FilterStrength * | f, | |||
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static void filter_mb_row | ( | VP8Context * | s, | |
| int | mb_y | |||
| ) | [static] |
| static void filter_mb_row_simple | ( | VP8Context * | s, | |
| int | mb_y | |||
| ) | [static] |
| static av_always_inline void filter_mb_simple | ( | VP8Context * | s, | |
| uint8_t * | dst, | |||
| VP8FilterStrength * | f, | |||
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static av_always_inline void find_near_mvs | ( | VP8Context * | s, | |
| VP8Macroblock * | mb, | |||
| VP56mv | near[2], | |||
| VP56mv * | best, | |||
| uint8_t | cnt[4] | |||
| ) | [static] |
| static void get_quants | ( | VP8Context * | s | ) | [static] |
| static av_always_inline const uint8_t* get_submv_prob | ( | uint32_t | left, | |
| uint32_t | top | |||
| ) | [static] |
| static av_always_inline void idct_mb | ( | VP8Context * | s, | |
| uint8_t * | dst[3], | |||
| VP8Macroblock * | mb | |||
| ) | [static] |
| static av_always_inline void inter_predict | ( | VP8Context * | s, | |
| uint8_t * | dst[3], | |||
| VP8Macroblock * | mb, | |||
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
Apply motion vectors to prediction buffer, chapter 18.
Definition at line 1297 of file vp8.c.
Referenced by vp8_decode_frame().
| static av_always_inline void intra_predict | ( | VP8Context * | s, | |
| uint8_t * | dst[3], | |||
| VP8Macroblock * | mb, | |||
| int | mb_x, | |||
| int | mb_y | |||
| ) | [static] |
| static void parse_segment_info | ( | VP8Context * | s | ) | [static] |
| static av_always_inline void prefetch_motion | ( | VP8Context * | s, | |
| VP8Macroblock * | mb, | |||
| int | mb_x, | |||
| int | mb_y, | |||
| int | mb_xy, | |||
| int | ref | |||
| ) | [static] |
| static int read_mv_component | ( | VP56RangeCoder * | c, | |
| const uint8_t * | p | |||
| ) | [static] |
Motion vector coding, 17.1.
Definition at line 595 of file vp8.c.
Referenced by decode_mb_mode(), and decode_splitmvs().
| static VP56Frame ref_to_update | ( | VP8Context * | s, | |
| int | update, | |||
| VP56Frame | ref | |||
| ) | [static] |
Determine which buffers golden and altref should be updated with after this frame.
The spec isn't clear here, so I'm going by my understanding of what libvpx does
Intra frames update all 3 references Inter frames update VP56_FRAME_PREVIOUS if the update_last flag is set If the update (golden|altref) flag is set, it's updated with the current frame if update_last is set, and VP56_FRAME_PREVIOUS otherwise. If the flag is not set, the number read means: 0: no update 1: VP56_FRAME_PREVIOUS 2: update golden with altref, or update altref with golden
Definition at line 356 of file vp8.c.
Referenced by update_refs().
| static int setup_partitions | ( | VP8Context * | s, | |
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static int update_dimensions | ( | VP8Context * | s, | |
| int | width, | |||
| int | height | |||
| ) | [static] |
| static void update_lf_deltas | ( | VP8Context * | s | ) | [static] |
| static void update_refs | ( | VP8Context * | s | ) | [static] |
| static void vp8_decode_flush | ( | AVCodecContext * | avctx | ) | [static] |
| static int vp8_decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| AVPacket * | avpkt | |||
| ) | [static] |
| static av_cold int vp8_decode_free | ( | AVCodecContext * | avctx | ) | [static] |
| static av_cold int vp8_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static av_always_inline void vp8_mc | ( | VP8Context * | s, | |
| int | luma, | |||
| uint8_t * | dst, | |||
| uint8_t * | src, | |||
| const VP56mv * | mv, | |||
| int | x_off, | |||
| int | y_off, | |||
| int | block_w, | |||
| int | block_h, | |||
| int | width, | |||
| int | height, | |||
| int | linesize, | |||
| vp8_mc_func | mc_func[3][3] | |||
| ) | [static] |
Generic MC function.
| s | VP8 decoding context | |
| luma | 1 for luma (Y) planes, 0 for chroma (Cb/Cr) planes | |
| dst | target buffer for block data at block position | |
| src | reference picture buffer at origin (0, 0) | |
| mv | motion vector (relative to block position) to get pixel data from | |
| x_off | horizontal position of block from origin (0, 0) | |
| y_off | vertical position of block from origin (0, 0) | |
| block_w | width of block (16, 8 or 4) | |
| block_h | height of block (always same as block_w) | |
| width | width of src/dst plane data | |
| height | height of src/dst plane data | |
| linesize | size of a single line of plane data, including padding | |
| mc_func | motion compensation function pointers (bilinear or sixtap MC) |
Definition at line 1214 of file vp8.c.
Referenced by inter_predict(), and vp8_mc_part().
| static av_always_inline void vp8_mc_part | ( | VP8Context * | s, | |
| uint8_t * | dst[3], | |||
| AVFrame * | ref_frame, | |||
| int | x_off, | |||
| int | y_off, | |||
| int | bx_off, | |||
| int | by_off, | |||
| int | block_w, | |||
| int | block_h, | |||
| int | width, | |||
| int | height, | |||
| VP56mv * | mv | |||
| ) | [static] |
| static av_always_inline void xchg_mb_border | ( | uint8_t * | top_border, | |
| uint8_t * | src_y, | |||
| uint8_t * | src_cb, | |||
| uint8_t * | src_cr, | |||
| int | linesize, | |||
| int | uvlinesize, | |||
| int | mb_x, | |||
| int | mb_y, | |||
| int | mb_width, | |||
| int | simple, | |||
| int | xchg | |||
| ) | [static] |
Initial value:
{
"vp8",
AVMEDIA_TYPE_VIDEO,
CODEC_ID_VP8,
sizeof(VP8Context),
vp8_decode_init,
NULL,
vp8_decode_free,
vp8_decode_frame,
CODEC_CAP_DR1,
.flush = vp8_decode_flush,
.long_name = NULL_IF_CONFIG_SMALL("On2 VP8"),
}
1.5.6