FFmpeg
Macros | Functions | Variables
vp8dsp.c File Reference

VP8 compatible video decoder. More...

#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

#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); \
}
The exact code depends on how similar the blocks are and how related they are to the block
uint8_t
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
const char * name
Definition: opengl_enc.c:102

Definition at line 34 of file vp8dsp.c.

#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];
static const uint8_t q1[256]
Definition: twofish.c:96
static const uint8_t q0[256]
Definition: twofish.c:77
int
#define stride
#define av_unused
Definition: attributes.h:125

Definition at line 249 of file vp8dsp.c.

Referenced by filter_common(), filter_mbedge(), hev(), vp7_simple_limit(), and vp8_simple_limit().

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

Definition at line 259 of file vp8dsp.c.

Referenced by filter_common(), and filter_mbedge().

#define NORMAL_LIMIT (   vpn)
Value:
static av_always_inline int vp ## vpn ## _normal_limit(uint8_t *p, \
ptrdiff_t stride, \
int E, int I) \
{ \
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; \
}
static const uint8_t q1[256]
Definition: twofish.c:96
uint8_t
static const uint8_t q0[256]
Definition: twofish.c:77
#define E
Definition: avdct.c:32
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition: common.h:72
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a it should return
#define av_always_inline
Definition: attributes.h:39

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

Definition at line 327 of file vp8dsp.c.

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

Definition at line 371 of file vp8dsp.c.

#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); \
}
uint8_t
#define _
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
#define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline)
Definition: vp8dsp.c:371
#define av_always_inline
Definition: attributes.h:39

Definition at line 408 of file vp8dsp.c.

#define LOOP_FILTER_SIMPLE (   vpn)
Value:
static void vpn ## _v_loop_filter_simple_c(uint8_t *dst, ptrdiff_t stride, \
int flim) \
{ \
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) \
{ \
for (i = 0; i < 16; i++) \
if (vpn ## _simple_limit(dst + i * stride, 1, flim)) \
vpn ## _filter_common(dst + i * stride, 1, 1); \
}
uint8_t
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
int
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
for(j=16;j >0;--j)

Definition at line 431 of file vp8dsp.c.

#define LOOP_FILTERS (   vpn)
Value:
LOOP_FILTER(vpn, v, 16, 1, stride, ) \
LOOP_FILTER(vpn, h, 16, stride, 1, ) \
#define LOOP_FILTER_SIMPLE(vpn)
Definition: vp8dsp.c:431
#define UV_LOOP_FILTER(vpn, dir, stridea, strideb)
Definition: vp8dsp.c:408
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
#define LOOP_FILTER(vpn, dir, size, stridea, strideb, maybe_inline)
Definition: vp8dsp.c:371

Definition at line 450 of file vp8dsp.c.

Referenced by ff_vp78dsp_init().

#define PUT_PIXELS (   WIDTH)
Value:
static void put_vp8_pixels ## WIDTH ## _c(uint8_t *dst, ptrdiff_t dststride, \
uint8_t *src, ptrdiff_t srcstride, \
int h, int x, int y) \
{ \
for (i = 0; i < h; i++, dst += dststride, src += srcstride) \
memcpy(dst, src, WIDTH); \
}
#define WIDTH
Definition: c93.c:43
#define src
Definition: vp8dsp.c:254
uint8_t
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:259
int
for(j=16;j >0;--j)

Definition at line 467 of file vp8dsp.c.

#define FILTER_6TAP (   src,
  F,
  stride 
)
#define FILTER_4TAP (   src,
  F,
  stride 
)
#define VP8_EPEL_H (   SIZE,
  TAPS 
)
Value:
static void put_vp8_epel ## SIZE ## _h ## TAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
ptrdiff_t srcstride, \
int h, int mx, int my) \
{ \
const uint8_t *filter = subpel_filters[mx - 1]; \
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; \
} \
}
static const uint8_t subpel_filters[7][6]
Definition: vp8dsp.c:457
#define MAX_NEG_CROP
Definition: mathops.h:31
#define src
Definition: vp8dsp.c:254
uint8_t
#define SIZE
Definition: cabac.c:23
#define cm
Definition: dvbsubdec.c:37
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
int
#define ff_crop_tab
for(j=16;j >0;--j)

Definition at line 490 of file vp8dsp.c.

#define VP8_EPEL_V (   SIZE,
  TAPS 
)
Value:
static void put_vp8_epel ## SIZE ## _v ## TAPS ## _c(uint8_t *dst, \
ptrdiff_t dststride, \
ptrdiff_t srcstride, \
int h, int mx, int my) \
{ \
const uint8_t *filter = subpel_filters[my - 1]; \
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; \
} \
}
static const uint8_t subpel_filters[7][6]
Definition: vp8dsp.c:457
#define MAX_NEG_CROP
Definition: mathops.h:31
#define src
Definition: vp8dsp.c:254
uint8_t
#define SIZE
Definition: cabac.c:23
#define cm
Definition: dvbsubdec.c:37
filter_frame For filters that do not use the this method is called when a frame is pushed to the filter s input It can be called at any time except in a reentrant way If the input frame is enough to produce then the filter should push the output frames on the output link immediately As an exception to the previous rule if the input frame is enough to produce several output frames then the filter needs output only at least one per link The additional frames can be left buffered in the filter
int
#define ff_crop_tab
for(j=16;j >0;--j)

Definition at line 508 of file vp8dsp.c.

#define VP8_EPEL_HV (   SIZE,
  HTAPS,
  VTAPS 
)

Definition at line 526 of file vp8dsp.c.

#define VP8_BILINEAR (   SIZE)

Definition at line 585 of file vp8dsp.c.

#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
#define SIZE
Definition: cabac.c:23

Definition at line 644 of file vp8dsp.c.

Referenced by ff_vp78dsp_init().

#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
#define SIZE
Definition: cabac.c:23

Definition at line 655 of file vp8dsp.c.

Referenced by ff_vp78dsp_init().

Function Documentation

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

Definition at line 261 of file vp8dsp.c.

Referenced by vp7_filter_common(), and vp8_filter_common().

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

Definition at line 297 of file vp8dsp.c.

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

Definition at line 303 of file vp8dsp.c.

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

Definition at line 309 of file vp8dsp.c.

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

Definition at line 316 of file vp8dsp.c.

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

Definition at line 343 of file vp8dsp.c.

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

Definition at line 349 of file vp8dsp.c.

av_cold void ff_vp78dsp_init ( VP8DSPContext dsp)

Definition at line 666 of file vp8dsp.c.

Referenced by check_mc(), and vp78_decode_init().

Variable Documentation

const uint8_t subpel_filters[7][6]
static