FFmpeg
Macros | Functions
vc1dsp.c File Reference

VC-1 and WMV3 decoder. More...

#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/intreadwrite.h"
#include "h264chroma.h"
#include "qpeldsp.h"
#include "rnd_avg.h"
#include "vc1dsp.h"
#include "startcode.h"

Go to the source code of this file.

Macros

#define VC1_MSPEL_FILTER_16B(DIR, TYPE)
 
#define VC1_MSPEL_MC(OP, OP4, OPNAME)
 
#define op_put(a, b)   (a) = av_clip_uint8(b)
 
#define op_avg(a, b)   (a) = ((a) + av_clip_uint8(b) + 1) >> 1
 
#define op4_avg(a, b)   (a) = rnd_avg32(a, b)
 
#define op4_put(a, b)   (a) = (b)
 
#define PUT_VC1_MSPEL(a, b)
 
#define chroma_mc(a)
 
#define avg2(a, b)   (((a) + (b) + 1) >> 1)
 
#define FN_ASSIGN(X, Y)
 

Functions

static void vc1_v_overlap_c (uint8_t *src, int stride)
 
static void vc1_h_overlap_c (uint8_t *src, int stride)
 
static void vc1_v_s_overlap_c (int16_t *top, int16_t *bottom)
 
static void vc1_h_s_overlap_c (int16_t *left, int16_t *right, int left_stride, int right_stride, int flags)
 
static av_always_inline int vc1_filter_line (uint8_t *src, int stride, int pq)
 VC-1 in-loop deblocking filter for one line. More...
 
static void vc1_loop_filter (uint8_t *src, int step, int stride, int len, int pq)
 VC-1 in-loop deblocking filter. More...
 
static void vc1_v_loop_filter4_c (uint8_t *src, int stride, int pq)
 
static void vc1_h_loop_filter4_c (uint8_t *src, int stride, int pq)
 
static void vc1_v_loop_filter8_c (uint8_t *src, int stride, int pq)
 
static void vc1_h_loop_filter8_c (uint8_t *src, int stride, int pq)
 
static void vc1_v_loop_filter16_c (uint8_t *src, int stride, int pq)
 
static void vc1_h_loop_filter16_c (uint8_t *src, int stride, int pq)
 
static void vc1_inv_trans_8x8_dc_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static void vc1_inv_trans_8x8_c (int16_t block[64])
 
static void vc1_inv_trans_8x4_dc_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static void vc1_inv_trans_8x4_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static void vc1_inv_trans_4x8_dc_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static void vc1_inv_trans_4x8_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static void vc1_inv_trans_4x4_dc_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static void vc1_inv_trans_4x4_c (uint8_t *dest, ptrdiff_t stride, int16_t *block)
 
static av_always_inline int vc1_mspel_filter (const uint8_t *src, int stride, int mode, int r)
 
static void put_no_rnd_vc1_chroma_mc8_c (uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
static void put_no_rnd_vc1_chroma_mc4_c (uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
static void avg_no_rnd_vc1_chroma_mc8_c (uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
static void avg_no_rnd_vc1_chroma_mc4_c (uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
av_cold void ff_vc1dsp_init (VC1DSPContext *dsp)
 

Detailed Description

VC-1 and WMV3 decoder.

Definition in file vc1dsp.c.

Macro Definition Documentation

#define VC1_MSPEL_FILTER_16B (   DIR,
  TYPE 
)
Value:
static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, \
int stride, \
int mode) \
{ \
switch(mode) { \
case 0: /* no shift - should not occur */ \
return 0; \
case 1: /* 1/4 shift */ \
return -4 * src[-stride] + 53 * src[0] + \
18 * src[stride] - 3 * src[stride * 2]; \
case 2: /* 1/2 shift */ \
return -1 * src[-stride] + 9 * src[0] + \
9 * src[stride] - 1 * src[stride * 2]; \
case 3: /* 3/4 shift */ \
return -3 * src[-stride] + 18 * src[0] + \
53 * src[stride] - 4 * src[stride * 2]; \
} \
return 0; /* should not occur */ \
}
#define src
Definition: vp8dsp.c:254
#define TYPE
Definition: ffv1.h:196
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
#define stride
mode
Use these values in ebur128_init (or'ed).
Definition: ebur128.h:83

Definition at line 545 of file vc1dsp.c.

#define VC1_MSPEL_MC (   OP,
  OP4,
  OPNAME 
)

Definition at line 590 of file vc1dsp.c.

#define op_put (   a,
  b 
)    (a) = av_clip_uint8(b)

Definition at line 728 of file vc1dsp.c.

#define op_avg (   a,
  b 
)    (a) = ((a) + av_clip_uint8(b) + 1) >> 1

Definition at line 729 of file vc1dsp.c.

#define op4_avg (   a,
  b 
)    (a) = rnd_avg32(a, b)

Definition at line 730 of file vc1dsp.c.

#define op4_put (   a,
  b 
)    (a) = (b)

Definition at line 731 of file vc1dsp.c.

#define PUT_VC1_MSPEL (   a,
  b 
)
Value:
static void put_vc1_mspel_mc ## a ## b ## _c(uint8_t *dst, \
const uint8_t *src, \
ptrdiff_t stride, int rnd) \
{ \
put_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
} \
static void avg_vc1_mspel_mc ## a ## b ## _c(uint8_t *dst, \
const uint8_t *src, \
ptrdiff_t stride, int rnd) \
{ \
avg_vc1_mspel_mc(dst, src, stride, a, b, rnd); \
} \
static void put_vc1_mspel_mc ## a ## b ## _16_c(uint8_t *dst, \
const uint8_t *src, \
ptrdiff_t stride, int rnd) \
{ \
put_vc1_mspel_mc_16(dst, src, stride, a, b, rnd); \
} \
static void avg_vc1_mspel_mc ## a ## b ## _16_c(uint8_t *dst, \
const uint8_t *src, \
ptrdiff_t stride, int rnd) \
{ \
avg_vc1_mspel_mc_16(dst, src, stride, a, b, rnd); \
}
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:36
#define src
Definition: vp8dsp.c:254
uint8_t
#define b
Definition: input.c:41
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
#define rnd()
Definition: checkasm.h:106

Definition at line 738 of file vc1dsp.c.

#define chroma_mc (   a)
Value:
((A * src[a] + B * src[a + 1] + \
C * src[stride + a] + D * src[stride + a + 1] + 32 - 4) >> 6)
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:36
#define src
Definition: vp8dsp.c:254
#define A(x)
Definition: vp56_arith.h:28
#define B
Definition: huffyuvdsp.h:32
s EdgeDetect Foobar g libavfilter vf_edgedetect c libavfilter vf_foobar c edit libavfilter and add an entry for foobar following the pattern of the other filters edit libavfilter allfilters and add an entry for foobar following the pattern of the other filters configure make j< whatever > ffmpeg ffmpeg i you should get a foobar png with Lena edge detected That s your new playground is ready Some little details about what s going which in turn will define variables for the build system and the C
GLint GLenum GLboolean GLsizei stride
Definition: opengl_enc.c:104
D(D(float, sse)
Definition: rematrix_init.c:28

Definition at line 783 of file vc1dsp.c.

Referenced by avg_no_rnd_vc1_chroma_mc4_c(), avg_no_rnd_vc1_chroma_mc8_c(), put_no_rnd_vc1_chroma_mc4_c(), put_no_rnd_vc1_chroma_mc8_c(), and rv34_mc().

#define avg2 (   a,
  b 
)    (((a) + (b) + 1) >> 1)

Definition at line 833 of file vc1dsp.c.

Referenced by avg_no_rnd_vc1_chroma_mc4_c(), and avg_no_rnd_vc1_chroma_mc8_c().

#define FN_ASSIGN (   X,
  Y 
)
Value:
dsp->put_vc1_mspel_pixels_tab[1][X+4*Y] = put_vc1_mspel_mc##X##Y##_c; \
dsp->put_vc1_mspel_pixels_tab[0][X+4*Y] = put_vc1_mspel_mc##X##Y##_16_c; \
dsp->avg_vc1_mspel_pixels_tab[1][X+4*Y] = avg_vc1_mspel_mc##X##Y##_c; \
dsp->avg_vc1_mspel_pixels_tab[0][X+4*Y] = avg_vc1_mspel_mc##X##Y##_16_c
Definition: vf_addroi.c:26
#define Y
Definition: boxblur.h:38

Definition at line 965 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

Function Documentation

static void vc1_v_overlap_c ( uint8_t src,
int  stride 
)
static

Definition at line 37 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_h_overlap_c ( uint8_t src,
int  stride 
)
static

Definition at line 61 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_v_s_overlap_c ( int16_t *  top,
int16_t *  bottom 
)
static

Definition at line 84 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_h_s_overlap_c ( int16_t *  left,
int16_t *  right,
int  left_stride,
int  right_stride,
int  flags 
)
static

Definition at line 110 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static av_always_inline int vc1_filter_line ( uint8_t src,
int  stride,
int  pq 
)
static

VC-1 in-loop deblocking filter for one line.

Parameters
srcsource block type
strideblock stride
pqblock quantizer
Returns
whether other 3 pairs should be filtered or not
See also
8.6

Definition at line 147 of file vc1dsp.c.

Referenced by vc1_loop_filter().

static void vc1_loop_filter ( uint8_t src,
int  step,
int  stride,
int  len,
int  pq 
)
inlinestatic

VC-1 in-loop deblocking filter.

Parameters
srcsource block type
stepdistance between horizontally adjacent elements
stridedistance between vertically adjacent elements
lenedge length to filter (4 or 8 pixels)
pqblock quantizer
See also
8.6

Definition at line 196 of file vc1dsp.c.

Referenced by vc1_h_loop_filter16_c(), vc1_h_loop_filter4_c(), vc1_h_loop_filter8_c(), vc1_v_loop_filter16_c(), vc1_v_loop_filter4_c(), and vc1_v_loop_filter8_c().

static void vc1_v_loop_filter4_c ( uint8_t src,
int  stride,
int  pq 
)
static

Definition at line 213 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_h_loop_filter4_c ( uint8_t src,
int  stride,
int  pq 
)
static

Definition at line 218 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_v_loop_filter8_c ( uint8_t src,
int  stride,
int  pq 
)
static

Definition at line 223 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_h_loop_filter8_c ( uint8_t src,
int  stride,
int  pq 
)
static

Definition at line 228 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_v_loop_filter16_c ( uint8_t src,
int  stride,
int  pq 
)
static

Definition at line 233 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_h_loop_filter16_c ( uint8_t src,
int  stride,
int  pq 
)
static

Definition at line 238 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_8x8_dc_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 244 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_8x8_c ( int16_t  block[64])
static

Definition at line 265 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_8x4_dc_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 335 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_8x4_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 356 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_4x8_dc_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 412 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_4x8_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 429 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_4x4_dc_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 485 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void vc1_inv_trans_4x4_c ( uint8_t dest,
ptrdiff_t  stride,
int16_t *  block 
)
static

Definition at line 502 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static av_always_inline int vc1_mspel_filter ( const uint8_t src,
int  stride,
int  mode,
int  r 
)
static

Definition at line 570 of file vc1dsp.c.

static void put_no_rnd_vc1_chroma_mc8_c ( uint8_t dst,
uint8_t src,
ptrdiff_t  stride,
int  h,
int  x,
int  y 
)
static

Definition at line 786 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void put_no_rnd_vc1_chroma_mc4_c ( uint8_t dst,
uint8_t src,
ptrdiff_t  stride,
int  h,
int  x,
int  y 
)
static

Definition at line 812 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void avg_no_rnd_vc1_chroma_mc8_c ( uint8_t dst,
uint8_t src,
ptrdiff_t  stride,
int  h,
int  x,
int  y 
)
static

Definition at line 834 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

static void avg_no_rnd_vc1_chroma_mc4_c ( uint8_t dst,
uint8_t src,
ptrdiff_t  stride,
int  h,
int  x,
int  y 
)
static

Definition at line 860 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

av_cold void ff_vc1dsp_init ( VC1DSPContext dsp)

Definition at line 971 of file vc1dsp.c.

Referenced by ff_vc1_init_common(), and wmv9_init().