FFmpeg
|
#include "config_components.h"
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "decode.h"
#include "hwaccel_internal.h"
#include "hwconfig.h"
#include "mathops.h"
#include "refstruct.h"
#include "thread.h"
#include "threadframe.h"
#include "vp8.h"
#include "vp89_rac.h"
#include "vp8data.h"
#include "vpx_rac.h"
Go to the source code of this file.
Macros | |
#define | VP7_MVC_SIZE 17 |
#define | VP8_MVC_SIZE 19 |
#define | MV_EDGE_CHECK(n) |
#define | XCHG(a, b, xchg) |
#define | H_LOOP_FILTER_16Y_INNER(cond) |
#define | MARGIN (16 << 2) |
#define | check_thread_pos(td, otd, mb_x_check, mb_y_check) while(0) |
#define | update_pos(td, mb_y, mb_x) while(0) |
Functions | |
static int | vp8_rac_get_sint (VPXRangeCoder *c, int bits) |
static int | vp8_rac_get_nn (VPXRangeCoder *c) |
static int | vp8_rac_get_coeff (VPXRangeCoder *c, const uint8_t *prob) |
static void | free_buffers (VP8Context *s) |
static int | vp8_alloc_frame (VP8Context *s, VP8Frame *f, int ref) |
static void | vp8_release_frame (VP8Frame *f) |
static void | vp8_decode_flush_impl (AVCodecContext *avctx, int free_mem) |
static void | vp8_decode_flush (AVCodecContext *avctx) |
static VP8Frame * | vp8_find_free_buffer (VP8Context *s) |
static enum AVPixelFormat | get_pixel_format (VP8Context *s) |
static av_always_inline int | update_dimensions (VP8Context *s, int width, int height, int is_vp7) |
static int | vp7_update_dimensions (VP8Context *s, int width, int height) |
static int | vp8_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 | vp7_get_quants (VP8Context *s) |
static void | vp8_get_quants (VP8Context *s) |
static VP8FrameType | ref_to_update (VP8Context *s, int update, VP8FrameType ref) |
Determine which buffers golden and altref should be updated with after this frame. More... | |
static void | vp78_reset_probability_tables (VP8Context *s) |
static void | vp78_update_probability_tables (VP8Context *s) |
static void | vp78_update_pred16x16_pred8x8_mvc_probabilities (VP8Context *s, int mvc_size) |
static void | update_refs (VP8Context *s) |
static void | copy_chroma (AVFrame *dst, const AVFrame *src, int width, int height) |
static void | fade (uint8_t *dst, ptrdiff_t dst_linesize, const uint8_t *src, ptrdiff_t src_linesize, int width, int height, int alpha, int beta) |
static int | vp7_fade_frame (VP8Context *s, int alpha, int beta) |
static int | vp7_decode_frame_header (VP8Context *s, const uint8_t *buf, int buf_size) |
static int | vp8_decode_frame_header (VP8Context *s, const uint8_t *buf, int buf_size) |
static av_always_inline void | clamp_mv (const VP8mvbounds *s, VP8mv *dst, const VP8mv *src) |
static av_always_inline int | read_mv_component (VPXRangeCoder *c, const uint8_t *p, int vp7) |
Motion vector coding, 17.1. More... | |
static int | vp7_read_mv_component (VPXRangeCoder *c, const uint8_t *p) |
static int | vp8_read_mv_component (VPXRangeCoder *c, const uint8_t *p) |
static const av_always_inline uint8_t * | get_submv_prob (uint32_t left, uint32_t top, int is_vp7) |
static av_always_inline int | decode_splitmvs (const VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb, int layout, int is_vp7) |
Split motion vector prediction, 16.4. More... | |
static int | vp7_calculate_mb_offset (int mb_x, int mb_y, int mb_width, int xoffset, int yoffset, int boundary, int *edge_x, int *edge_y) |
The vp7 reference decoder uses a padding macroblock column (added to right edge of the frame) to guard against illegal macroblock offsets. More... | |
static const VP8mv * | get_bmv_ptr (const VP8Macroblock *mb, int subblock) |
static av_always_inline void | vp7_decode_mvs (VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, int layout) |
static av_always_inline void | vp8_decode_mvs (VP8Context *s, const VP8mvbounds *mv_bounds, VP8Macroblock *mb, int mb_x, int mb_y, int layout) |
static av_always_inline void | decode_intra4x4_modes (VP8Context *s, VPXRangeCoder *c, VP8Macroblock *mb, int mb_x, int keyframe, int layout) |
static av_always_inline void | decode_mb_mode (VP8Context *s, const VP8mvbounds *mv_bounds, VP8Macroblock *mb, int mb_x, int mb_y, uint8_t *segment, const uint8_t *ref, int layout, int is_vp7) |
static av_always_inline int | decode_block_coeffs_internal (VPXRangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], int i, const uint8_t *token_prob, const int16_t qmul[2], const uint8_t scan[16], int vp7) |
static av_always_inline int | inter_predict_dc (int16_t block[16], int16_t pred[2]) |
static int | vp7_decode_block_coeffs_internal (VPXRangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], int i, const uint8_t *token_prob, const int16_t qmul[2], const uint8_t scan[16]) |
static int | vp8_decode_block_coeffs_internal (VPXRangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], int i, const uint8_t *token_prob, const int16_t qmul[2]) |
static av_always_inline int | decode_block_coeffs (VPXRangeCoder *c, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS - 1], int i, int zero_nhood, const int16_t qmul[2], const uint8_t scan[16], int vp7) |
static av_always_inline void | decode_mb_coeffs (VP8Context *s, VP8ThreadData *td, VPXRangeCoder *c, VP8Macroblock *mb, uint8_t t_nnz[9], uint8_t l_nnz[9], int is_vp7) |
static av_always_inline void | backup_mb_border (uint8_t *top_border, const uint8_t *src_y, const uint8_t *src_cb, const uint8_t *src_cr, ptrdiff_t linesize, ptrdiff_t 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, ptrdiff_t linesize, ptrdiff_t 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, int vp7) |
static av_always_inline int | check_intra_pred8x8_mode_emuedge (int mode, int mb_x, int mb_y, int vp7) |
static av_always_inline int | check_tm_pred4x4_mode (int mode, int mb_x, int mb_y, int vp7) |
static av_always_inline int | check_intra_pred4x4_mode_emuedge (int mode, int mb_x, int mb_y, int *copy_buf, int vp7) |
static av_always_inline void | intra_predict (VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], VP8Macroblock *mb, int mb_x, int mb_y, int is_vp7) |
static av_always_inline void | vp8_mc_luma (VP8Context *s, VP8ThreadData *td, uint8_t *dst, const ThreadFrame *ref, const VP8mv *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 More... | |
static av_always_inline void | vp8_mc_chroma (VP8Context *s, VP8ThreadData *td, uint8_t *dst1, uint8_t *dst2, const ThreadFrame *ref, const VP8mv *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 More... | |
static av_always_inline void | vp8_mc_part (VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], const 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, const VP8mv *mv) |
static av_always_inline void | prefetch_motion (const VP8Context *s, const 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 *const dst[3], VP8Macroblock *mb, int mb_x, int mb_y) |
Apply motion vectors to prediction buffer, chapter 18. More... | |
static av_always_inline void | idct_mb (VP8Context *s, VP8ThreadData *td, uint8_t *const dst[3], const VP8Macroblock *mb) |
static av_always_inline void | filter_level_for_mb (const VP8Context *s, const VP8Macroblock *mb, VP8FilterStrength *f, int is_vp7) |
static av_always_inline void | filter_mb (const VP8Context *s, uint8_t *const dst[3], const VP8FilterStrength *f, int mb_x, int mb_y, int is_vp7) |
static av_always_inline void | filter_mb_simple (const VP8Context *s, uint8_t *dst, const VP8FilterStrength *f, int mb_x, int mb_y) |
static av_always_inline int | vp78_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *curframe, const VP8Frame *prev_frame, int is_vp7) |
static int | vp7_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *cur_frame, const VP8Frame *prev_frame) |
static int | vp8_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *cur_frame, const VP8Frame *prev_frame) |
static av_always_inline int | decode_mb_row_no_filter (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) |
static int | vp7_decode_mb_row_no_filter (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static int | vp8_decode_mb_row_no_filter (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static av_always_inline void | filter_mb_row (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) |
static void | vp7_filter_mb_row (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static void | vp8_filter_mb_row (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static av_always_inline int | vp78_decode_mb_row_sliced (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr, int is_vp7) |
static int | vp7_decode_mb_row_sliced (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static int | vp8_decode_mb_row_sliced (AVCodecContext *avctx, void *tdata, int jobnr, int threadnr) |
static av_always_inline int | vp78_decode_frame (AVCodecContext *avctx, AVFrame *rframe, int *got_frame, const AVPacket *avpkt, int is_vp7) |
int | ff_vp8_decode_frame (AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt) |
av_cold int | ff_vp8_decode_free (AVCodecContext *avctx) |
static av_cold int | vp8_init_frames (VP8Context *s) |
static av_always_inline int | vp78_decode_init (AVCodecContext *avctx, int is_vp7) |
av_cold int | ff_vp8_decode_init (AVCodecContext *avctx) |
Variables | |
static const uint8_t | subpel_idx [3][8] |
#define MV_EDGE_CHECK | ( | n | ) |
#define H_LOOP_FILTER_16Y_INNER | ( | cond | ) |
#define check_thread_pos | ( | td, | |
otd, | |||
mb_x_check, | |||
mb_y_check | |||
) | while(0) |
|
static |
Definition at line 50 of file vp8.c.
Referenced by parse_segment_info(), and vp8_get_quants().
|
static |
Definition at line 65 of file vp8.c.
Referenced by vp78_update_pred16x16_pred8x8_mvc_probabilities().
|
static |
Definition at line 72 of file vp8.c.
Referenced by decode_block_coeffs_internal().
|
static |
Definition at line 83 of file vp8.c.
Referenced by update_dimensions(), and vp8_decode_flush_impl().
|
static |
Definition at line 103 of file vp8.c.
Referenced by vp78_decode_frame(), and vp7_fade_frame().
|
static |
Definition at line 123 of file vp8.c.
Referenced by vp78_decode_frame(), vp8_decode_flush_impl(), and vp8_find_free_buffer().
|
static |
Definition at line 147 of file vp8.c.
Referenced by ff_vp8_decode_free(), update_dimensions(), and vp8_decode_flush().
|
static |
|
static |
Definition at line 168 of file vp8.c.
Referenced by vp78_decode_frame(), and vp7_fade_frame().
|
static |
Definition at line 192 of file vp8.c.
Referenced by update_dimensions(), and vp78_decode_frame().
|
static |
Definition at line 209 of file vp8.c.
Referenced by vp7_update_dimensions(), and vp8_update_dimensions().
|
static |
Definition at line 273 of file vp8.c.
Referenced by vp7_decode_frame_header().
|
static |
Definition at line 278 of file vp8.c.
Referenced by vp8_decode_frame_header().
|
static |
Definition at line 284 of file vp8.c.
Referenced by vp8_decode_frame_header().
|
static |
Definition at line 306 of file vp8.c.
Referenced by vp8_decode_frame_header().
|
static |
Definition at line 330 of file vp8.c.
Referenced by vp8_decode_frame_header().
|
static |
Definition at line 362 of file vp8.c.
Referenced by vp7_decode_frame_header().
|
static |
Definition at line 381 of file vp8.c.
Referenced by vp8_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 VP8_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 VP8_FRAME_PREVIOUS otherwise. If the flag is not set, the number read means: 0: no update 1: VP8_FRAME_PREVIOUS 2: update golden with altref, or update altref with golden
Definition at line 427 of file vp8.c.
Referenced by update_refs().
|
static |
Definition at line 443 of file vp8.c.
Referenced by vp7_decode_frame_header(), and vp8_decode_frame_header().
|
static |
Definition at line 452 of file vp8.c.
Referenced by vp7_decode_frame_header(), and vp8_decode_frame_header().
|
static |
Definition at line 471 of file vp8.c.
Referenced by vp7_decode_frame_header(), and vp8_decode_frame_header().
|
static |
Definition at line 491 of file vp8.c.
Referenced by uncompressed_header(), and vp8_decode_frame_header().
Definition at line 502 of file vp8.c.
Referenced by vp7_fade_frame().
|
static |
Definition at line 513 of file vp8.c.
Referenced by parse_time_sequence(), and vp7_fade_frame().
|
static |
Definition at line 529 of file vp8.c.
Referenced by vp7_decode_frame_header().
|
static |
Definition at line 567 of file vp8.c.
Referenced by vp78_decode_frame().
|
static |
Definition at line 731 of file vp8.c.
Referenced by vp78_decode_frame().
|
static |
Definition at line 872 of file vp8.c.
Referenced by vp8_decode_mvs().
|
static |
Motion vector coding, 17.1.
Definition at line 883 of file vp8.c.
Referenced by decode_splitmvs(), vp7_read_mv_component(), and vp8_read_mv_component().
|
static |
Definition at line 911 of file vp8.c.
Referenced by vp7_decode_mvs().
|
static |
Definition at line 916 of file vp8.c.
Referenced by vp8_decode_mvs().
|
static |
Definition at line 922 of file vp8.c.
Referenced by decode_splitmvs().
|
static |
Split motion vector prediction, 16.4.
Definition at line 939 of file vp8.c.
Referenced by vp7_decode_mvs(), and vp8_decode_mvs().
|
static |
The vp7 reference decoder uses a padding macroblock column (added to right edge of the frame) to guard against illegal macroblock offsets.
The algorithm has bugs that permit offsets to straddle the padding column. This function replicates those bugs.
[out] | edge_x | macroblock x address |
[out] | edge_y | macroblock y address |
Definition at line 1021 of file vp8.c.
Referenced by vp7_decode_mvs().
|
static |
Definition at line 1034 of file vp8.c.
Referenced by vp7_decode_mvs().
|
static |
Definition at line 1040 of file vp8.c.
Referenced by decode_mb_mode().
|
static |
Definition at line 1130 of file vp8.c.
Referenced by decode_mb_mode().
|
static |
Definition at line 1230 of file vp8.c.
Referenced by decode_mb_mode().
|
static |
Definition at line 1265 of file vp8.c.
Referenced by decode_mb_row_no_filter(), and vp78_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 1358 of file vp8.c.
Referenced by vp7_decode_block_coeffs_internal(), and vp8_decode_block_coeffs_internal().
|
static |
Definition at line 1418 of file vp8.c.
Referenced by decode_mb_coeffs().
|
static |
Definition at line 1440 of file vp8.c.
Referenced by decode_block_coeffs().
|
static |
Definition at line 1452 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 |
scan | scan pattern (VP7 only) |
Definition at line 1477 of file vp8.c.
Referenced by decode_mb_coeffs().
|
static |
Definition at line 1492 of file vp8.c.
Referenced by decode_mb_row_no_filter().
|
static |
Definition at line 1567 of file vp8.c.
Referenced by decode_mb_row_no_filter(), and filter_mb_row().
|
static |
Definition at line 1579 of file vp8.c.
Referenced by intra_predict().
|
static |
Definition at line 1613 of file vp8.c.
Referenced by check_intra_pred8x8_mode_emuedge().
Definition at line 1622 of file vp8.c.
Referenced by check_intra_pred8x8_mode_emuedge().
|
static |
Definition at line 1631 of file vp8.c.
Referenced by intra_predict().
Definition at line 1647 of file vp8.c.
Referenced by check_intra_pred4x4_mode_emuedge().
|
static |
Definition at line 1657 of file vp8.c.
Referenced by intra_predict().
|
static |
Definition at line 1693 of file vp8.c.
Referenced by 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 1831 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 1889 of file vp8.c.
Referenced by inter_predict(), and vp8_mc_part().
|
static |
Definition at line 1939 of file vp8.c.
Referenced by inter_predict().
|
static |
Definition at line 1977 of file vp8.c.
Referenced by decode_mb_row_no_filter().
|
static |
Apply motion vectors to prediction buffer, chapter 18.
Definition at line 2000 of file vp8.c.
Referenced by decode_mb_row_no_filter().
|
static |
Definition at line 2084 of file vp8.c.
Referenced by decode_mb_row_no_filter().
|
static |
Definition at line 2147 of file vp8.c.
Referenced by decode_mb_row_no_filter().
|
static |
Definition at line 2180 of file vp8.c.
Referenced by filter_mb_row().
|
static |
Definition at line 2267 of file vp8.c.
Referenced by filter_mb_row().
|
static |
Definition at line 2301 of file vp8.c.
Referenced by vp7_decode_mv_mb_modes(), and vp8_decode_mv_mb_modes().
|
static |
Definition at line 2338 of file vp8.c.
Referenced by vp78_decode_frame().
|
static |
Definition at line 2344 of file vp8.c.
Referenced by vp78_decode_frame().
|
static |
Definition at line 2388 of file vp8.c.
Referenced by vp7_decode_mb_row_no_filter(), and vp8_decode_mb_row_no_filter().
|
static |
Definition at line 2521 of file vp8.c.
Referenced by vp78_decode_init().
|
static |
Definition at line 2527 of file vp8.c.
Referenced by vp78_decode_init().
|
static |
Definition at line 2533 of file vp8.c.
Referenced by vp7_filter_mb_row(), and vp8_filter_mb_row().
|
static |
Definition at line 2592 of file vp8.c.
Referenced by vp78_decode_init().
|
static |
Definition at line 2598 of file vp8.c.
Referenced by vp78_decode_init().
|
static |
Definition at line 2605 of file vp8.c.
Referenced by vp7_decode_mb_row_sliced(), and vp8_decode_mb_row_sliced().
|
static |
Definition at line 2639 of file vp8.c.
Referenced by vp78_decode_frame().
|
static |
Definition at line 2645 of file vp8.c.
Referenced by vp78_decode_frame().
|
static |
Definition at line 2652 of file vp8.c.
Referenced by ff_vp8_decode_frame().
int ff_vp8_decode_frame | ( | AVCodecContext * | avctx, |
AVFrame * | frame, | ||
int * | got_frame, | ||
AVPacket * | avpkt | ||
) |
Definition at line 2842 of file vp8.c.
Referenced by vp8_lossy_decode_frame().
av_cold int ff_vp8_decode_free | ( | AVCodecContext * | avctx | ) |
Definition at line 2856 of file vp8.c.
Referenced by vp78_decode_init(), and webp_decode_close().
|
static |
Definition at line 2868 of file vp8.c.
Referenced by vp78_decode_init().
|
static |
Definition at line 2880 of file vp8.c.
Referenced by ff_vp8_decode_init().
av_cold int ff_vp8_decode_init | ( | AVCodecContext * | avctx | ) |
Definition at line 2923 of file vp8.c.
Referenced by vp8_lossy_decode_frame().
|
static |
Definition at line 1807 of file vp8.c.
Referenced by vp8_mc_chroma(), and vp8_mc_luma().