FFmpeg
Macros | Functions | Variables
vp8.c File Reference
#include "config_components.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "hwconfig.h"
#include "internal.h"
#include "mathops.h"
#include "rectangle.h"
#include "thread.h"
#include "threadframe.h"
#include "vp8.h"
#include "vp8data.h"

Go to the source code of this file.

Macros

#define VPX(vp7, f)   vp8_ ## f
 
#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 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 void vp8_decode_flush_impl (AVCodecContext *avctx, int free_mem)
 
static void vp8_decode_flush (AVCodecContext *avctx)
 
static VP8Framevp8_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 VP56Frame ref_to_update (VP8Context *s, int update, VP56Frame 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, 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 (VP8mvbounds *s, VP56mv *dst, const VP56mv *src)
 
static av_always_inline int read_mv_component (VP56RangeCoder *c, const uint8_t *p, int vp7)
 Motion vector coding, 17.1. More...
 
static int vp7_read_mv_component (VP56RangeCoder *c, const uint8_t *p)
 
static int vp8_read_mv_component (VP56RangeCoder *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 (VP8Context *s, VP56RangeCoder *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 VP56mvget_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, VP8mvbounds *mv_bounds, 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, VP8mvbounds *mv_bounds, VP8Macroblock *mb, int mb_x, int mb_y, uint8_t *segment, uint8_t *ref, int layout, int is_vp7)
 
static av_always_inline 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], 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 (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], const uint8_t scan[16])
 
static int vp8_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], const uint8_t scan[16], int vp7)
 
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], int is_vp7)
 
static av_always_inline void backup_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 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 *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, 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 More...
 
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 More...
 
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. More...
 
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, int is_vp7)
 
static av_always_inline void filter_mb (VP8Context *s, uint8_t *dst[3], VP8FilterStrength *f, int mb_x, int mb_y, int is_vp7)
 
static av_always_inline void filter_mb_simple (VP8Context *s, uint8_t *dst, VP8FilterStrength *f, int mb_x, int mb_y)
 
static av_always_inline int vp78_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *curframe, VP8Frame *prev_frame, int is_vp7)
 
static int vp7_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *cur_frame, VP8Frame *prev_frame)
 
static int vp8_decode_mv_mb_modes (AVCodecContext *avctx, VP8Frame *cur_frame, 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]
 

Macro Definition Documentation

◆ VPX

#define VPX (   vp7,
  f 
)    vp8_ ## f

Definition at line 52 of file vp8.c.

◆ VP7_MVC_SIZE

#define VP7_MVC_SIZE   17

Definition at line 451 of file vp8.c.

◆ VP8_MVC_SIZE

#define VP8_MVC_SIZE   19

Definition at line 452 of file vp8.c.

◆ MV_EDGE_CHECK

#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); \
} \
}

◆ XCHG

#define XCHG (   a,
  b,
  xchg 
)
Value:
do { \
if (xchg) \
AV_SWAP64(b, a); \
} while (0)

◆ H_LOOP_FILTER_16Y_INNER

#define H_LOOP_FILTER_16Y_INNER (   cond)
Value:
if (cond && inner_filter) { \
s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 4, linesize, \
bedge_lim_y, inner_limit, \
hev_thresh); \
s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 8, linesize, \
bedge_lim_y, inner_limit, \
hev_thresh); \
s->vp8dsp.vp8_h_loop_filter16y_inner(dst[0] + 12, linesize, \
bedge_lim_y, inner_limit, \
hev_thresh); \
s->vp8dsp.vp8_h_loop_filter8uv_inner(dst[1] + 4, dst[2] + 4, \
uvlinesize, bedge_lim_uv, \
inner_limit, hev_thresh); \
}

◆ MARGIN

#define MARGIN   (16 << 2)

Definition at line 2280 of file vp8.c.

◆ check_thread_pos

#define check_thread_pos (   td,
  otd,
  mb_x_check,
  mb_y_check 
)    while(0)

Definition at line 2365 of file vp8.c.

◆ update_pos

#define update_pos (   td,
  mb_y,
  mb_x 
)    while(0)

Definition at line 2366 of file vp8.c.

Function Documentation

◆ free_buffers()

static void free_buffers ( VP8Context s)
static

Definition at line 55 of file vp8.c.

Referenced by update_dimensions(), and vp8_decode_flush_impl().

◆ vp8_alloc_frame()

static int vp8_alloc_frame ( VP8Context s,
VP8Frame f,
int  ref 
)
static

Definition at line 75 of file vp8.c.

Referenced by vp78_decode_frame(), and vp7_fade_frame().

◆ vp8_release_frame()

static void vp8_release_frame ( VP8Context s,
VP8Frame f 
)
static

Definition at line 100 of file vp8.c.

Referenced by vp78_decode_frame(), vp8_decode_flush_impl(), and vp8_find_free_buffer().

◆ vp8_decode_flush_impl()

static void vp8_decode_flush_impl ( AVCodecContext avctx,
int  free_mem 
)
static

Definition at line 133 of file vp8.c.

Referenced by ff_vp8_decode_free(), update_dimensions(), and vp8_decode_flush().

◆ vp8_decode_flush()

static void vp8_decode_flush ( AVCodecContext avctx)
static

Definition at line 146 of file vp8.c.

◆ vp8_find_free_buffer()

static VP8Frame* vp8_find_free_buffer ( VP8Context s)
static

Definition at line 151 of file vp8.c.

Referenced by vp78_decode_frame(), and vp7_fade_frame().

◆ get_pixel_format()

static enum AVPixelFormat get_pixel_format ( VP8Context s)
static

Definition at line 175 of file vp8.c.

Referenced by update_dimensions(), and vp78_decode_frame().

◆ update_dimensions()

static av_always_inline int update_dimensions ( VP8Context s,
int  width,
int  height,
int  is_vp7 
)
static

Definition at line 192 of file vp8.c.

Referenced by vp7_update_dimensions(), and vp8_update_dimensions().

◆ vp7_update_dimensions()

static int vp7_update_dimensions ( VP8Context s,
int  width,
int  height 
)
static

Definition at line 256 of file vp8.c.

Referenced by vp7_decode_frame_header().

◆ vp8_update_dimensions()

static int vp8_update_dimensions ( VP8Context s,
int  width,
int  height 
)
static

Definition at line 261 of file vp8.c.

Referenced by vp8_decode_frame_header().

◆ parse_segment_info()

static void parse_segment_info ( VP8Context s)
static

Definition at line 267 of file vp8.c.

Referenced by vp8_decode_frame_header().

◆ update_lf_deltas()

static void update_lf_deltas ( VP8Context s)
static

Definition at line 289 of file vp8.c.

Referenced by vp8_decode_frame_header().

◆ setup_partitions()

static int setup_partitions ( VP8Context s,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 313 of file vp8.c.

Referenced by vp8_decode_frame_header().

◆ vp7_get_quants()

static void vp7_get_quants ( VP8Context s)
static

Definition at line 345 of file vp8.c.

Referenced by vp7_decode_frame_header().

◆ vp8_get_quants()

static void vp8_get_quants ( VP8Context s)
static

Definition at line 364 of file vp8.c.

Referenced by vp8_decode_frame_header().

◆ ref_to_update()

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 410 of file vp8.c.

Referenced by update_refs().

◆ vp78_reset_probability_tables()

static void vp78_reset_probability_tables ( VP8Context s)
static

Definition at line 426 of file vp8.c.

Referenced by vp7_decode_frame_header(), and vp8_decode_frame_header().

◆ vp78_update_probability_tables()

static void vp78_update_probability_tables ( VP8Context s)
static

Definition at line 435 of file vp8.c.

Referenced by vp7_decode_frame_header(), and vp8_decode_frame_header().

◆ vp78_update_pred16x16_pred8x8_mvc_probabilities()

static void vp78_update_pred16x16_pred8x8_mvc_probabilities ( VP8Context s,
int  mvc_size 
)
static

Definition at line 454 of file vp8.c.

Referenced by vp7_decode_frame_header(), and vp8_decode_frame_header().

◆ update_refs()

static void update_refs ( VP8Context s)
static

Definition at line 474 of file vp8.c.

Referenced by uncompressed_header(), and vp8_decode_frame_header().

◆ copy_chroma()

static void copy_chroma ( AVFrame dst,
AVFrame src,
int  width,
int  height 
)
static

Definition at line 485 of file vp8.c.

Referenced by vp7_fade_frame().

◆ fade()

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

Definition at line 496 of file vp8.c.

Referenced by parse_time_sequence(), and vp7_fade_frame().

◆ vp7_fade_frame()

static int vp7_fade_frame ( VP8Context s,
int  alpha,
int  beta 
)
static

Definition at line 512 of file vp8.c.

Referenced by vp7_decode_frame_header().

◆ vp7_decode_frame_header()

static int vp7_decode_frame_header ( VP8Context s,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 549 of file vp8.c.

Referenced by vp78_decode_frame().

◆ vp8_decode_frame_header()

static int vp8_decode_frame_header ( VP8Context s,
const uint8_t *  buf,
int  buf_size 
)
static

Definition at line 713 of file vp8.c.

Referenced by vp78_decode_frame().

◆ clamp_mv()

static av_always_inline void clamp_mv ( VP8mvbounds s,
VP56mv dst,
const VP56mv src 
)
static

Definition at line 854 of file vp8.c.

Referenced by vp8_decode_mvs().

◆ read_mv_component()

static av_always_inline int read_mv_component ( VP56RangeCoder c,
const uint8_t *  p,
int  vp7 
)
static

Motion vector coding, 17.1.

Definition at line 865 of file vp8.c.

Referenced by decode_splitmvs(), vp7_read_mv_component(), and vp8_read_mv_component().

◆ vp7_read_mv_component()

static int vp7_read_mv_component ( VP56RangeCoder c,
const uint8_t *  p 
)
static

Definition at line 893 of file vp8.c.

Referenced by vp7_decode_mvs().

◆ vp8_read_mv_component()

static int vp8_read_mv_component ( VP56RangeCoder c,
const uint8_t *  p 
)
static

Definition at line 898 of file vp8.c.

Referenced by vp8_decode_mvs().

◆ get_submv_prob()

static const av_always_inline uint8_t* get_submv_prob ( uint32_t  left,
uint32_t  top,
int  is_vp7 
)
static

Definition at line 904 of file vp8.c.

Referenced by decode_splitmvs().

◆ decode_splitmvs()

static av_always_inline int decode_splitmvs ( VP8Context s,
VP56RangeCoder c,
VP8Macroblock mb,
int  layout,
int  is_vp7 
)
static

Split motion vector prediction, 16.4.

Returns
the number of motion vectors parsed (2, 4 or 16)

Definition at line 921 of file vp8.c.

Referenced by vp7_decode_mvs(), and vp8_decode_mvs().

◆ vp7_calculate_mb_offset()

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 
)
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.

Parameters
[out]edge_xmacroblock x address
[out]edge_ymacroblock y address
Returns
macroblock offset legal (boolean)

Definition at line 1003 of file vp8.c.

Referenced by vp7_decode_mvs().

◆ get_bmv_ptr()

static const VP56mv* get_bmv_ptr ( const VP8Macroblock mb,
int  subblock 
)
static

Definition at line 1016 of file vp8.c.

Referenced by vp7_decode_mvs().

◆ vp7_decode_mvs()

static av_always_inline void vp7_decode_mvs ( VP8Context s,
VP8Macroblock mb,
int  mb_x,
int  mb_y,
int  layout 
)
static

Definition at line 1022 of file vp8.c.

Referenced by decode_mb_mode().

◆ vp8_decode_mvs()

static av_always_inline void vp8_decode_mvs ( VP8Context s,
VP8mvbounds mv_bounds,
VP8Macroblock mb,
int  mb_x,
int  mb_y,
int  layout 
)
static

Definition at line 1113 of file vp8.c.

Referenced by decode_mb_mode().

◆ decode_intra4x4_modes()

static av_always_inline void decode_intra4x4_modes ( VP8Context s,
VP56RangeCoder c,
VP8Macroblock mb,
int  mb_x,
int  keyframe,
int  layout 
)
static

Definition at line 1213 of file vp8.c.

Referenced by decode_mb_mode().

◆ decode_mb_mode()

static av_always_inline void decode_mb_mode ( VP8Context s,
VP8mvbounds mv_bounds,
VP8Macroblock mb,
int  mb_x,
int  mb_y,
uint8_t *  segment,
uint8_t *  ref,
int  layout,
int  is_vp7 
)
static

Definition at line 1248 of file vp8.c.

Referenced by decode_mb_row_no_filter(), and vp78_decode_mv_mb_modes().

◆ decode_block_coeffs_internal()

static av_always_inline 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],
const uint8_t  scan[16],
int  vp7 
)
static
Parameters
rarithmetic bitstream reader context
blockdestination for block coefficients
probsprobabilities to use when reading trees from the bitstream
iinitial coeff index, 0 unless a separate DC block is coded
qmularray holding the dc/ac dequant factor at position 0/1
Returns
0 if no coeffs were decoded otherwise, the index of the last coeff decoded plus one

Definition at line 1340 of file vp8.c.

Referenced by vp7_decode_block_coeffs_internal(), and vp8_decode_block_coeffs_internal().

◆ inter_predict_dc()

static av_always_inline int inter_predict_dc ( int16_t  block[16],
int16_t  pred[2] 
)
static

Definition at line 1400 of file vp8.c.

Referenced by decode_mb_coeffs().

◆ vp7_decode_block_coeffs_internal()

static int vp7_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],
const uint8_t  scan[16] 
)
static

Definition at line 1422 of file vp8.c.

Referenced by decode_block_coeffs().

◆ vp8_decode_block_coeffs_internal()

static int vp8_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

Definition at line 1434 of file vp8.c.

Referenced by decode_block_coeffs().

◆ decode_block_coeffs()

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],
const uint8_t  scan[16],
int  vp7 
)
static
Parameters
carithmetic bitstream reader context
blockdestination for block coefficients
probsprobabilities to use when reading trees from the bitstream
iinitial coeff index, 0 unless a separate DC block is coded
zero_nhoodthe initial prediction context for number of surrounding all-zero blocks (only left/top, so 0-2)
qmularray holding the dc/ac dequant factor at position 0/1
scanscan pattern (VP7 only)
Returns
0 if no coeffs were decoded otherwise, the index of the last coeff decoded plus one

Definition at line 1459 of file vp8.c.

Referenced by decode_mb_coeffs().

◆ decode_mb_coeffs()

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],
int  is_vp7 
)
static

Definition at line 1474 of file vp8.c.

Referenced by decode_mb_row_no_filter().

◆ backup_mb_border()

static av_always_inline void backup_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  simple 
)
static

Definition at line 1549 of file vp8.c.

Referenced by decode_mb_row_no_filter(), and filter_mb_row().

◆ xchg_mb_border()

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

Definition at line 1561 of file vp8.c.

Referenced by intra_predict().

◆ check_dc_pred8x8_mode()

static av_always_inline int check_dc_pred8x8_mode ( int  mode,
int  mb_x,
int  mb_y 
)
static

Definition at line 1595 of file vp8.c.

Referenced by check_intra_pred8x8_mode_emuedge().

◆ check_tm_pred8x8_mode()

static av_always_inline int check_tm_pred8x8_mode ( int  mode,
int  mb_x,
int  mb_y,
int  vp7 
)
static

Definition at line 1604 of file vp8.c.

Referenced by check_intra_pred8x8_mode_emuedge().

◆ check_intra_pred8x8_mode_emuedge()

static av_always_inline int check_intra_pred8x8_mode_emuedge ( int  mode,
int  mb_x,
int  mb_y,
int  vp7 
)
static

Definition at line 1613 of file vp8.c.

Referenced by intra_predict().

◆ check_tm_pred4x4_mode()

static av_always_inline int check_tm_pred4x4_mode ( int  mode,
int  mb_x,
int  mb_y,
int  vp7 
)
static

Definition at line 1629 of file vp8.c.

Referenced by check_intra_pred4x4_mode_emuedge().

◆ check_intra_pred4x4_mode_emuedge()

static av_always_inline int check_intra_pred4x4_mode_emuedge ( int  mode,
int  mb_x,
int  mb_y,
int copy_buf,
int  vp7 
)
static

Definition at line 1639 of file vp8.c.

Referenced by intra_predict().

◆ intra_predict()

static av_always_inline void intra_predict ( VP8Context s,
VP8ThreadData td,
uint8_t *  dst[3],
VP8Macroblock mb,
int  mb_x,
int  mb_y,
int  is_vp7 
)
static

Definition at line 1675 of file vp8.c.

Referenced by decode_mb_row_no_filter().

◆ vp8_mc_luma()

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] 
)
static

luma MC function

Parameters
sVP8 decoding context
dsttarget buffer for block data at block position
refreference picture buffer at origin (0, 0)
mvmotion vector (relative to block position) to get pixel data from
x_offhorizontal position of block from origin (0, 0)
y_offvertical position of block from origin (0, 0)
block_wwidth of block (16, 8 or 4)
block_hheight of block (always same as block_w)
widthwidth of src/dst plane data
heightheight of src/dst plane data
linesizesize of a single line of plane data, including padding
mc_funcmotion compensation function pointers (bilinear or sixtap MC)

Definition at line 1813 of file vp8.c.

Referenced by inter_predict(), and vp8_mc_part().

◆ vp8_mc_chroma()

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] 
)
static

chroma MC function

Parameters
sVP8 decoding context
dst1target buffer for block data at block position (U plane)
dst2target buffer for block data at block position (V plane)
refreference picture buffer at origin (0, 0)
mvmotion vector (relative to block position) to get pixel data from
x_offhorizontal position of block from origin (0, 0)
y_offvertical position of block from origin (0, 0)
block_wwidth of block (16, 8 or 4)
block_hheight of block (always same as block_w)
widthwidth of src/dst plane data
heightheight of src/dst plane data
linesizesize of a single line of plane data, including padding
mc_funcmotion compensation function pointers (bilinear or sixtap MC)

Definition at line 1871 of file vp8.c.

Referenced by inter_predict(), and vp8_mc_part().

◆ vp8_mc_part()

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

Definition at line 1921 of file vp8.c.

Referenced by inter_predict().

◆ prefetch_motion()

static av_always_inline void prefetch_motion ( VP8Context s,
VP8Macroblock mb,
int  mb_x,
int  mb_y,
int  mb_xy,
int  ref 
)
static

Definition at line 1959 of file vp8.c.

Referenced by decode_mb_row_no_filter().

◆ inter_predict()

static av_always_inline void inter_predict ( VP8Context s,
VP8ThreadData td,
uint8_t *  dst[3],
VP8Macroblock mb,
int  mb_x,
int  mb_y 
)
static

Apply motion vectors to prediction buffer, chapter 18.

Definition at line 1982 of file vp8.c.

Referenced by decode_mb_row_no_filter().

◆ idct_mb()

static av_always_inline void idct_mb ( VP8Context s,
VP8ThreadData td,
uint8_t *  dst[3],
VP8Macroblock mb 
)
static

Definition at line 2066 of file vp8.c.

Referenced by decode_mb_row_no_filter().

◆ filter_level_for_mb()

static av_always_inline void filter_level_for_mb ( VP8Context s,
VP8Macroblock mb,
VP8FilterStrength f,
int  is_vp7 
)
static

Definition at line 2128 of file vp8.c.

Referenced by decode_mb_row_no_filter().

◆ filter_mb()

static av_always_inline void filter_mb ( VP8Context s,
uint8_t *  dst[3],
VP8FilterStrength f,
int  mb_x,
int  mb_y,
int  is_vp7 
)
static

Definition at line 2161 of file vp8.c.

Referenced by filter_mb_row().

◆ filter_mb_simple()

static av_always_inline void filter_mb_simple ( VP8Context s,
uint8_t *  dst,
VP8FilterStrength f,
int  mb_x,
int  mb_y 
)
static

Definition at line 2248 of file vp8.c.

Referenced by filter_mb_row().

◆ vp78_decode_mv_mb_modes()

static av_always_inline int vp78_decode_mv_mb_modes ( AVCodecContext avctx,
VP8Frame curframe,
VP8Frame prev_frame,
int  is_vp7 
)
static

Definition at line 2282 of file vp8.c.

Referenced by vp7_decode_mv_mb_modes(), and vp8_decode_mv_mb_modes().

◆ vp7_decode_mv_mb_modes()

static int vp7_decode_mv_mb_modes ( AVCodecContext avctx,
VP8Frame cur_frame,
VP8Frame prev_frame 
)
static

Definition at line 2319 of file vp8.c.

Referenced by vp78_decode_frame().

◆ vp8_decode_mv_mb_modes()

static int vp8_decode_mv_mb_modes ( AVCodecContext avctx,
VP8Frame cur_frame,
VP8Frame prev_frame 
)
static

Definition at line 2325 of file vp8.c.

Referenced by vp78_decode_frame().

◆ decode_mb_row_no_filter()

static av_always_inline int decode_mb_row_no_filter ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr,
int  is_vp7 
)
static

Definition at line 2369 of file vp8.c.

Referenced by vp7_decode_mb_row_no_filter(), and vp8_decode_mb_row_no_filter().

◆ vp7_decode_mb_row_no_filter()

static int vp7_decode_mb_row_no_filter ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 2497 of file vp8.c.

Referenced by vp78_decode_init().

◆ vp8_decode_mb_row_no_filter()

static int vp8_decode_mb_row_no_filter ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 2503 of file vp8.c.

Referenced by vp78_decode_init().

◆ filter_mb_row()

static av_always_inline void filter_mb_row ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr,
int  is_vp7 
)
static

Definition at line 2509 of file vp8.c.

Referenced by vp7_filter_mb_row(), and vp8_filter_mb_row().

◆ vp7_filter_mb_row()

static void vp7_filter_mb_row ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 2568 of file vp8.c.

Referenced by vp78_decode_init().

◆ vp8_filter_mb_row()

static void vp8_filter_mb_row ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 2574 of file vp8.c.

Referenced by vp78_decode_init().

◆ vp78_decode_mb_row_sliced()

static av_always_inline int vp78_decode_mb_row_sliced ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr,
int  is_vp7 
)
static

Definition at line 2581 of file vp8.c.

Referenced by vp7_decode_mb_row_sliced(), and vp8_decode_mb_row_sliced().

◆ vp7_decode_mb_row_sliced()

static int vp7_decode_mb_row_sliced ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 2615 of file vp8.c.

Referenced by vp78_decode_frame().

◆ vp8_decode_mb_row_sliced()

static int vp8_decode_mb_row_sliced ( AVCodecContext avctx,
void *  tdata,
int  jobnr,
int  threadnr 
)
static

Definition at line 2621 of file vp8.c.

Referenced by vp78_decode_frame().

◆ vp78_decode_frame()

static av_always_inline int vp78_decode_frame ( AVCodecContext avctx,
AVFrame rframe,
int got_frame,
const AVPacket avpkt,
int  is_vp7 
)
static

Definition at line 2628 of file vp8.c.

Referenced by ff_vp8_decode_frame().

◆ ff_vp8_decode_frame()

int ff_vp8_decode_frame ( AVCodecContext avctx,
AVFrame frame,
int got_frame,
AVPacket avpkt 
)

Definition at line 2814 of file vp8.c.

Referenced by vp8_lossy_decode_frame().

◆ ff_vp8_decode_free()

av_cold int ff_vp8_decode_free ( AVCodecContext avctx)

Definition at line 2828 of file vp8.c.

Referenced by vp78_decode_init(), and webp_decode_close().

◆ vp8_init_frames()

static av_cold int vp8_init_frames ( VP8Context s)
static

Definition at line 2840 of file vp8.c.

Referenced by vp78_decode_init().

◆ vp78_decode_init()

static av_always_inline int vp78_decode_init ( AVCodecContext avctx,
int  is_vp7 
)
static

Definition at line 2852 of file vp8.c.

Referenced by ff_vp8_decode_init().

◆ ff_vp8_decode_init()

av_cold int ff_vp8_decode_init ( AVCodecContext avctx)

Definition at line 2895 of file vp8.c.

Referenced by vp8_lossy_decode_frame().

Variable Documentation

◆ subpel_idx

const uint8_t subpel_idx[3][8]
static
Initial value:
= {
{ 0, 1, 2, 1, 2, 1, 2, 1 },
{ 0, 3, 5, 3, 5, 3, 5, 3 },
{ 0, 2, 3, 2, 3, 2, 3, 2 },
}

Definition at line 1789 of file vp8.c.

Referenced by vp8_mc_chroma(), and vp8_mc_luma().

mv
static const int8_t mv[256][2]
Definition: 4xm.c:80
b
#define b
Definition: input.c:34
AV_COPY64
#define AV_COPY64(d, s)
Definition: intreadwrite.h:605
a
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
Definition: undefined.txt:41
AV_RN32A
#define AV_RN32A(p)
Definition: intreadwrite.h:526
VP56_FRAME_CURRENT
@ VP56_FRAME_CURRENT
Definition: vp56.h:44
cond
int(* cond)(enum AVPixelFormat pix_fmt)
Definition: pixdesc_query.c:28