FFmpeg
Macros | Functions | Variables
vp8dsp.c File Reference
#include "config_components.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "mathops.h"
#include "vp8dsp.h"

Go to the source code of this file.

Macros

#define MK_IDCT_DC_ADD4_C(name)
 
#define LOAD_PIXELS
 
#define clip_int8(n)   (cm[(n) + 0x80] - 0x80)
 
#define NORMAL_LIMIT(vpn)
 E - limit at the macroblock edge I - limit for interior difference. More...
 
#define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline)
 
#define UV_LOOP_FILTER(vpn, dir, stridea, strideb)
 
#define LOOP_FILTER_SIMPLE(vpn)
 
#define LOOP_FILTERS(vpn)
 
#define PUT_PIXELS(WIDTH)
 
#define FILTER_6TAP(src, F, stride)
 
#define FILTER_4TAP(src, F, stride)
 
#define VP8_EPEL_H(SIZE, TAPS)
 
#define VP8_EPEL_V(SIZE, TAPS)
 
#define VP8_EPEL_HV(SIZE, HTAPS, VTAPS)
 
#define VP8_BILINEAR(SIZE)
 
#define VP78_MC_FUNC(IDX, SIZE)
 
#define VP78_BILINEAR_MC_FUNC(IDX, SIZE)
 

Functions

static av_always_inline void filter_common (uint8_t *p, ptrdiff_t stride, int is4tap, int is_vp7)
 
static av_always_inline void vp7_filter_common (uint8_t *p, ptrdiff_t stride, int is4tap)
 
static av_always_inline void vp8_filter_common (uint8_t *p, ptrdiff_t stride, int is4tap)
 
static av_always_inline int vp7_simple_limit (uint8_t *p, ptrdiff_t stride, int flim)
 
static av_always_inline int vp8_simple_limit (uint8_t *p, ptrdiff_t stride, int flim)
 
static av_always_inline int hev (uint8_t *p, ptrdiff_t stride, int thresh)
 
static av_always_inline void filter_mbedge (uint8_t *p, ptrdiff_t stride)
 
av_cold void ff_vp78dsp_init (VP8DSPContext *dsp)
 

Variables

static const uint8_t subpel_filters [7][6]
 

Detailed Description

VP8 compatible video decoder

Definition in file vp8dsp.c.

Macro Definition Documentation

◆ MK_IDCT_DC_ADD4_C

#define MK_IDCT_DC_ADD4_C (   name)
Value:
static void name ## _idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], \
ptrdiff_t stride) \
{ \
name ## _idct_dc_add_c(dst + stride * 0 + 0, block[0], stride); \
name ## _idct_dc_add_c(dst + stride * 0 + 4, block[1], stride); \
name ## _idct_dc_add_c(dst + stride * 4 + 0, block[2], stride); \
name ## _idct_dc_add_c(dst + stride * 4 + 4, block[3], stride); \
} \
\
static void name ## _idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], \
ptrdiff_t stride) \
{ \
name ## _idct_dc_add_c(dst + 0, block[0], stride); \
name ## _idct_dc_add_c(dst + 4, block[1], stride); \
name ## _idct_dc_add_c(dst + 8, block[2], stride); \
name ## _idct_dc_add_c(dst + 12, block[3], stride); \
}

Definition at line 36 of file vp8dsp.c.

◆ LOAD_PIXELS

#define LOAD_PIXELS
Value:
int av_unused p3 = p[-4 * stride]; \
int av_unused p2 = p[-3 * stride]; \
int av_unused p1 = p[-2 * stride]; \
int av_unused p0 = p[-1 * stride]; \
int av_unused q0 = p[ 0 * stride]; \
int av_unused q1 = p[ 1 * stride]; \
int av_unused q2 = p[ 2 * stride]; \
int av_unused q3 = p[ 3 * stride];

Definition at line 251 of file vp8dsp.c.

◆ clip_int8

#define clip_int8 (   n)    (cm[(n) + 0x80] - 0x80)

Definition at line 261 of file vp8dsp.c.

◆ NORMAL_LIMIT

#define NORMAL_LIMIT (   vpn)
Value:
static av_always_inline int vp ## vpn ## _normal_limit(uint8_t *p, \
ptrdiff_t stride, \
int E, int I) \
{ \
LOAD_PIXELS \
return vp ## vpn ## _simple_limit(p, stride, E) && \
FFABS(p3 - p2) <= I && FFABS(p2 - p1) <= I && \
FFABS(p1 - p0) <= I && FFABS(q3 - q2) <= I && \
FFABS(q2 - q1) <= I && FFABS(q1 - q0) <= I; \
}

E - limit at the macroblock edge I - limit for interior difference.

Definition at line 329 of file vp8dsp.c.

◆ LOOP_FILTER

#define LOOP_FILTER (   vpn,
  dir,
  size,
  stridea,
  strideb,
  maybe_inline 
)

Definition at line 373 of file vp8dsp.c.

◆ UV_LOOP_FILTER

#define UV_LOOP_FILTER (   vpn,
  dir,
  stridea,
  strideb 
)
Value:
LOOP_FILTER(vpn, dir, 8, stridea, strideb, av_always_inline) \
static void vpn ## _ ## dir ## _loop_filter8uv_c(uint8_t *dstU, \
uint8_t *dstV, \
ptrdiff_t stride, int fE, \
int fI, int hev_thresh) \
{ \
vpn ## _ ## dir ## _loop_filter8_c(dstU, stride, fE, fI, hev_thresh); \
vpn ## _ ## dir ## _loop_filter8_c(dstV, stride, fE, fI, hev_thresh); \
} \
\
static void vpn ## _ ## dir ## _loop_filter8uv_inner_c(uint8_t *dstU, \
uint8_t *dstV, \
ptrdiff_t stride, \
int fE, int fI, \
int hev_thresh) \
{ \
vpn ## _ ## dir ## _loop_filter8_inner_c(dstU, stride, fE, fI, \
hev_thresh); \
vpn ## _ ## dir ## _loop_filter8_inner_c(dstV, stride, fE, fI, \
hev_thresh); \
}

Definition at line 410 of file vp8dsp.c.

◆ LOOP_FILTER_SIMPLE

#define LOOP_FILTER_SIMPLE (   vpn)
Value:
static void vpn ## _v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
int flim) \
{ \
int i; \
for (i = 0; i < 16; i++) \
if (vpn ## _simple_limit(dst + i, stride, flim)) \
vpn ## _filter_common(dst + i, stride, 1); \
} \
\
static void vpn ## _h_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
int flim) \
{ \
int i; \
for (i = 0; i < 16; i++) \
if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \
vpn ## _filter_common(dst + i * stride, 1, 1); \
}

Definition at line 433 of file vp8dsp.c.

◆ LOOP_FILTERS

#define LOOP_FILTERS (   vpn)
Value:
LOOP_FILTER(vpn, v, 16, 1, stride, ) \
LOOP_FILTER(vpn, h, 16, stride, 1, ) \
UV_LOOP_FILTER(vpn, v, 1, stride) \
UV_LOOP_FILTER(vpn, h, stride, 1) \
LOOP_FILTER_SIMPLE(vpn) \

Definition at line 452 of file vp8dsp.c.

◆ PUT_PIXELS

#define PUT_PIXELS (   WIDTH)
Value:
static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \
const uint8_t *src, ptrdiff_t srcstride, \
int h, int x, int y) \
{ \
int i; \
for (i = 0; i < h; i++, dst += dststride, src += srcstride) \
memcpy(dst, src, WIDTH); \
}

Definition at line 469 of file vp8dsp.c.

◆ FILTER_6TAP

#define FILTER_6TAP (   src,
  F,
  stride 
)
Value:
cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \
F[0] * src[x - 2 * stride] + F[3] * src[x + 1 * stride] - \
F[4] * src[x + 2 * stride] + F[5] * src[x + 3 * stride] + 64) >> 7]

Definition at line 483 of file vp8dsp.c.

◆ FILTER_4TAP

#define FILTER_4TAP (   src,
  F,
  stride 
)
Value:
cm[(F[2] * src[x + 0 * stride] - F[1] * src[x - 1 * stride] + \
F[3] * src[x + 1 * stride] - F[4] * src[x + 2 * stride] + 64) >> 7]

Definition at line 488 of file vp8dsp.c.

◆ VP8_EPEL_H

#define VP8_EPEL_H (   SIZE,
  TAPS 
)
Value:
static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my) \
{ \
const uint8_t *filter = subpel_filters[mx - 1]; \
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
int x, y; \
for (y = 0; y < h; y++) { \
for (x = 0; x < SIZE; x++) \
dst[x] = FILTER_ ## TAPS ## TAP(src, filter, 1); \
dst += dststride; \
src += srcstride; \
} \
}

Definition at line 492 of file vp8dsp.c.

◆ VP8_EPEL_V

#define VP8_EPEL_V (   SIZE,
  TAPS 
)
Value:
static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
const uint8_t *src, \
ptrdiff_t srcstride, \
int h, int mx, int my) \
{ \
const uint8_t *filter = subpel_filters[my - 1]; \
const uint8_t *cm = ff_crop_tab + MAX_NEG_CROP; \
int x, y; \
for (y = 0; y < h; y++) { \
for (x = 0; x < SIZE; x++) \
dst[x] = FILTER_ ## TAPS ## TAP(src, filter, srcstride); \
dst += dststride; \
src += srcstride; \
} \
}

Definition at line 510 of file vp8dsp.c.

◆ VP8_EPEL_HV

#define VP8_EPEL_HV (   SIZE,
  HTAPS,
  VTAPS 
)

Definition at line 528 of file vp8dsp.c.

◆ VP8_BILINEAR

#define VP8_BILINEAR (   SIZE)

Definition at line 587 of file vp8dsp.c.

◆ VP78_MC_FUNC

#define VP78_MC_FUNC (   IDX,
  SIZE 
)
Value:
dsp->put_vp8_epel_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
dsp->put_vp8_epel_pixels_tab[IDX][0][1] = put_vp8_epel ## SIZE ## _h4_c; \
dsp->put_vp8_epel_pixels_tab[IDX][0][2] = put_vp8_epel ## SIZE ## _h6_c; \
dsp->put_vp8_epel_pixels_tab[IDX][1][0] = put_vp8_epel ## SIZE ## _v4_c; \
dsp->put_vp8_epel_pixels_tab[IDX][1][1] = put_vp8_epel ## SIZE ## _h4v4_c; \
dsp->put_vp8_epel_pixels_tab[IDX][1][2] = put_vp8_epel ## SIZE ## _h6v4_c; \
dsp->put_vp8_epel_pixels_tab[IDX][2][0] = put_vp8_epel ## SIZE ## _v6_c; \
dsp->put_vp8_epel_pixels_tab[IDX][2][1] = put_vp8_epel ## SIZE ## _h4v6_c; \
dsp->put_vp8_epel_pixels_tab[IDX][2][2] = put_vp8_epel ## SIZE ## _h6v6_c

Definition at line 646 of file vp8dsp.c.

◆ VP78_BILINEAR_MC_FUNC

#define VP78_BILINEAR_MC_FUNC (   IDX,
  SIZE 
)
Value:
dsp->put_vp8_bilinear_pixels_tab[IDX][0][0] = put_vp8_pixels ## SIZE ## _c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][0][1] = put_vp8_bilinear ## SIZE ## _h_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][0][2] = put_vp8_bilinear ## SIZE ## _h_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][1][0] = put_vp8_bilinear ## SIZE ## _v_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][1][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][1][2] = put_vp8_bilinear ## SIZE ## _hv_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][2][0] = put_vp8_bilinear ## SIZE ## _v_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][2][1] = put_vp8_bilinear ## SIZE ## _hv_c; \
dsp->put_vp8_bilinear_pixels_tab[IDX][2][2] = put_vp8_bilinear ## SIZE ## _hv_c

Definition at line 657 of file vp8dsp.c.

Function Documentation

◆ filter_common()

static av_always_inline void filter_common ( uint8_t *  p,
ptrdiff_t  stride,
int  is4tap,
int  is_vp7 
)
static

Definition at line 263 of file vp8dsp.c.

Referenced by vp7_filter_common(), and vp8_filter_common().

◆ vp7_filter_common()

static av_always_inline void vp7_filter_common ( uint8_t *  p,
ptrdiff_t  stride,
int  is4tap 
)
static

Definition at line 299 of file vp8dsp.c.

◆ vp8_filter_common()

static av_always_inline void vp8_filter_common ( uint8_t *  p,
ptrdiff_t  stride,
int  is4tap 
)
static

Definition at line 305 of file vp8dsp.c.

◆ vp7_simple_limit()

static av_always_inline int vp7_simple_limit ( uint8_t *  p,
ptrdiff_t  stride,
int  flim 
)
static

Definition at line 311 of file vp8dsp.c.

◆ vp8_simple_limit()

static av_always_inline int vp8_simple_limit ( uint8_t *  p,
ptrdiff_t  stride,
int  flim 
)
static

Definition at line 318 of file vp8dsp.c.

◆ hev()

static av_always_inline int hev ( uint8_t *  p,
ptrdiff_t  stride,
int  thresh 
)
static

Definition at line 345 of file vp8dsp.c.

◆ filter_mbedge()

static av_always_inline void filter_mbedge ( uint8_t *  p,
ptrdiff_t  stride 
)
static

Definition at line 351 of file vp8dsp.c.

◆ ff_vp78dsp_init()

av_cold void ff_vp78dsp_init ( VP8DSPContext dsp)

Definition at line 668 of file vp8dsp.c.

Referenced by checkasm_check_vp8dsp(), and vp78_decode_init().

Variable Documentation

◆ subpel_filters

const uint8_t subpel_filters[7][6]
static
q1
static const uint8_t q1[256]
Definition: twofish.c:100
name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
av_unused
#define av_unused
Definition: attributes.h:131
F
#define F(x)
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
ff_crop_tab
#define ff_crop_tab
Definition: motionpixels_tablegen.c:26
mx
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t mx
Definition: dsp.h:53
q0
static const uint8_t q0[256]
Definition: twofish.c:81
E
#define E
Definition: avdct.c:33
my
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t my
Definition: dsp.h:53
FFABS
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:74
srcstride
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t const uint8_t ptrdiff_t srcstride
Definition: dsp.h:84
dst
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition: dsp.h:83
WIDTH
#define WIDTH
Definition: c93.c:44
SIZE
#define SIZE
Definition: bitstream_template.c:36
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
av_always_inline
#define av_always_inline
Definition: attributes.h:49
stride
#define stride
Definition: h264pred_template.c:537
cm
#define cm
Definition: dvbsubdec.c:40
LOOP_FILTER
#define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline)
Definition: vp8dsp.c:373
_
#define _
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
h
h
Definition: vp9dsp_template.c:2070
MAX_NEG_CROP
#define MAX_NEG_CROP
Definition: mathops.h:31
src
#define src
Definition: vp8dsp.c:248
subpel_filters
static const uint8_t subpel_filters[7][6]
Definition: vp8dsp.c:459