Libav
|
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "internal.h"
#include "vp8.h"
#include "vp8data.h"
#include "rectangle.h"
#include "thread.h"
Go to the source code of this file.
Macros | |
#define | MV_EDGE_CHECK(n) |
#define | XCHG(a, b, xchg) |
#define | MARGIN (16 << 2) |
#define | check_thread_pos(td, otd, mb_x_check, mb_y_check) |
#define | update_pos(td, mb_y, mb_x) |
#define | REBASE(pic) pic ? pic - &s_src->frames[0] + &s->frames[0] : NULL |
Functions | |
static void | free_buffers (VP8Context *s) |
static int | vp8_alloc_frame (VP8Context *s, VP8Frame *f, int ref) |
static void | vp8_release_frame (VP8Context *s, VP8Frame *f) |
static int | vp8_ref_frame (VP8Context *s, VP8Frame *dst, VP8Frame *src) |
static void | vp8_decode_flush_impl (AVCodecContext *avctx, int free_mem) |
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) |
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, int layout) |
Split motion vector prediction, 16.4. | |
static av_always_inline void | decode_mvs (VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout) |
static av_always_inline void | decode_intra4x4_modes (VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, int mb_x, int keyframe, int layout) |
static av_always_inline void | decode_mb_mode (VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_t *segment, uint8_t *ref, int layout) |
static int | decode_block_coeffs_internal (VP56RangeCoder *r, int16_t block[16], uint8_t probs[16][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, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS-1], int i, int zero_nhood, int16_t qmul[2]) |
static av_always_inline void | decode_mb_coeffs (VP8Context *s, VP8ThreadData *td, 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_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, VP8ThreadData *td, uint8_t *dst[3], VP8Macroblock *mb, int mb_x, int mb_y) |
static av_always_inline void | vp8_mc_luma (VP8Context *s, VP8ThreadData *td, uint8_t *dst, ThreadFrame *ref, const VP56mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, ptrdiff_t linesize, vp8_mc_func mc_func[3][3]) |
luma MC function | |
static av_always_inline void | vp8_mc_chroma (VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst2, ThreadFrame *ref, const VP56mv *mv, int x_off, int y_off, int block_w, int block_h, int width, int height, ptrdiff_t linesize, vp8_mc_func mc_func[3][3]) |
chroma MC function | |
static av_always_inline void | vp8_mc_part (VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], ThreadFrame *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, VP8ThreadData *td, 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, VP8ThreadData *td, 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 | vp8_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *curframe, VP8Frame *prev_frame) |
static void | vp8_decode_mb_row_no_filter (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static void | vp8_filter_mb_row (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static int | vp8_decode_mb_row_sliced (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
int | ff_vp8_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt) |
av_cold int | ff_vp8_decode_free (AVCodecContext *avctx) |
static av_cold int | vp8_init_frames (VP8Context *s) |
av_cold int | ff_vp8_decode_init (AVCodecContext *avctx) |
static av_cold int | vp8_decode_init_thread_copy (AVCodecContext *avctx) |
static int | vp8_decode_update_thread_context (AVCodecContext *dst, const AVCodecContext *src) |
Variables | |
static const uint8_t | subpel_idx [3][8] |
AVCodec | ff_vp8_decoder |
#define MV_EDGE_CHECK | ( | n | ) |
Referenced by decode_mvs().
#define XCHG | ( | a, | |
b, | |||
xchg | |||
) |
#define MARGIN (16 << 2) |
Definition at line 1574 of file vp8.c.
Referenced by ff_vp8_decode_frame(), vp8_decode_mb_row_no_filter(), and vp8_decode_mv_mb_modes().
#define check_thread_pos | ( | td, | |
otd, | |||
mb_x_check, | |||
mb_y_check | |||
) |
Definition at line 1638 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter(), and vp8_filter_mb_row().
#define update_pos | ( | td, | |
mb_y, | |||
mb_x | |||
) |
Definition at line 1639 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter(), vp8_decode_mb_row_sliced(), and vp8_filter_mb_row().
#define REBASE | ( | pic | ) | pic ? pic - &s_src->frames[0] + &s->frames[0] : NULL |
Definition at line 2036 of file vp8.c.
Referenced by vp8_decode_update_thread_context().
|
static |
Definition at line 38 of file vp8.c.
Referenced by vp8_decode_flush_impl(), and vp8_decode_update_thread_context().
|
static |
Definition at line 58 of file vp8.c.
Referenced by ff_vp8_decode_frame().
|
static |
Definition at line 71 of file vp8.c.
Referenced by ff_vp8_decode_frame(), vp8_decode_flush_impl(), and vp8_ref_frame().
|
static |
Definition at line 77 of file vp8.c.
Referenced by vp8_decode_update_thread_context().
|
static |
Definition at line 95 of file vp8.c.
Referenced by ff_vp8_decode_free(), update_dimensions(), and vp8_decode_flush().
|
static |
|
static |
Definition at line 113 of file vp8.c.
Referenced by decode_frame_header().
|
static |
Definition at line 158 of file vp8.c.
Referenced by decode_frame_header().
|
static |
Definition at line 179 of file vp8.c.
Referenced by decode_frame_header().
|
static |
Definition at line 203 of file vp8.c.
Referenced by decode_frame_header().
|
static |
Definition at line 229 of file vp8.c.
Referenced by decode_frame_header().
|
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 275 of file vp8.c.
Referenced by update_refs().
|
static |
Definition at line 291 of file vp8.c.
Referenced by decode_frame_header().
|
static |
Definition at line 302 of file vp8.c.
Referenced by ff_vp8_decode_frame().
|
static |
Definition at line 440 of file vp8.c.
Referenced by decode_mvs().
|
static |
Motion vector coding, 17.1.
Definition at line 449 of file vp8.c.
Referenced by decode_mvs(), and decode_splitmvs().
|
static |
Definition at line 478 of file vp8.c.
Referenced by decode_splitmvs().
|
static |
Split motion vector prediction, 16.4.
Definition at line 492 of file vp8.c.
Referenced by decode_mvs().
|
static |
Definition at line 563 of file vp8.c.
Referenced by decode_mb_mode().
|
static |
Definition at line 662 of file vp8.c.
Referenced by decode_mb_mode().
|
static |
Definition at line 696 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter(), and vp8_decode_mv_mb_modes().
|
static |
r | 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 |
qmul | array holding the dc/ac dequant factor at position 0/1 |
Definition at line 760 of file vp8.c.
Referenced by decode_block_coeffs().
|
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 828 of file vp8.c.
Referenced by decode_mb_coeffs().
|
static |
Definition at line 839 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter().
|
static |
Definition at line 900 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter(), and vp8_filter_mb_row().
|
static |
Definition at line 911 of file vp8.c.
Referenced by intra_predict().
|
static |
Definition at line 942 of file vp8.c.
Referenced by check_intra_pred8x8_mode_emuedge().
|
static |
Definition at line 952 of file vp8.c.
Referenced by check_intra_pred8x8_mode_emuedge().
|
static |
Definition at line 962 of file vp8.c.
Referenced by intra_predict().
|
static |
Definition at line 978 of file vp8.c.
Referenced by check_intra_pred4x4_mode_emuedge().
|
static |
Definition at line 988 of file vp8.c.
Referenced by intra_predict().
|
static |
Definition at line 1022 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter().
|
static |
luma MC function
s | VP8 decoding context |
dst | target buffer for block data at block position |
ref | 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 1154 of file vp8.c.
Referenced by inter_predict(), and vp8_mc_part().
|
static |
chroma MC function
s | VP8 decoding context |
dst1 | target buffer for block data at block position (U plane) |
dst2 | target buffer for block data at block position (V plane) |
ref | 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 1209 of file vp8.c.
Referenced by inter_predict(), and vp8_mc_part().
|
static |
Definition at line 1256 of file vp8.c.
Referenced by inter_predict().
|
static |
Definition at line 1288 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter().
|
static |
Apply motion vectors to prediction buffer, chapter 18.
Definition at line 1310 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter().
|
static |
Definition at line 1390 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter().
|
static |
Definition at line 1443 of file vp8.c.
Referenced by vp8_decode_mb_row_no_filter().
|
static |
Definition at line 1473 of file vp8.c.
Referenced by vp8_filter_mb_row().
|
static |
Definition at line 1543 of file vp8.c.
Referenced by vp8_filter_mb_row().
|
static |
Definition at line 1575 of file vp8.c.
Referenced by ff_vp8_decode_frame().
|
static |
Definition at line 1642 of file vp8.c.
Referenced by vp8_decode_mb_row_sliced().
|
static |
Definition at line 1749 of file vp8.c.
Referenced by vp8_decode_mb_row_sliced().
|
static |
Definition at line 1803 of file vp8.c.
Referenced by ff_vp8_decode_frame().
int ff_vp8_decode_frame | ( | AVCodecContext * | avctx, |
void * | data, | ||
int * | got_frame, | ||
AVPacket * | avpkt | ||
) |
Definition at line 1830 of file vp8.c.
Referenced by vp8_lossy_decode_frame().
av_cold int ff_vp8_decode_free | ( | AVCodecContext * | avctx | ) |
Definition at line 1977 of file vp8.c.
Referenced by ff_vp8_decode_init(), vp8_decode_init_thread_copy(), and webp_decode_close().
|
static |
Definition at line 1989 of file vp8.c.
Referenced by ff_vp8_decode_init(), and vp8_decode_init_thread_copy().
av_cold int ff_vp8_decode_init | ( | AVCodecContext * | avctx | ) |
Definition at line 2000 of file vp8.c.
Referenced by vp8_lossy_decode_frame().
|
static |
|
static |
|
static |
Definition at line 1130 of file vp8.c.
Referenced by vp8_mc_chroma(), and vp8_mc_luma().
AVCodec ff_vp8_decoder |