FFmpeg
Loading...
Searching...
No Matches
vc1dsp.c File Reference

VC-1 and WMV3 decoder. More...

#include "config_components.h"
#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"
#include "vc1_common.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)
 
#define op_avg(a, b)
 
#define op4_avg(a, b)
 
#define op4_put(a, b)
 
#define PUT_VC1_MSPEL(a, b)
 
#define chroma_mc(a)
 
#define avg2(a, b)
 
#define FN_ASSIGN(X, Y)
 

Functions

static void vc1_v_overlap_c (uint8_t *src, ptrdiff_t stride)
 
static void vc1_h_overlap_c (uint8_t *src, ptrdiff_t 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, ptrdiff_t left_stride, ptrdiff_t right_stride, int flags)
 
static av_always_inline int vc1_filter_line (uint8_t *src, ptrdiff_t stride, int pq)
 VC-1 in-loop deblocking filter for one line.
 
static av_always_inline void vc1_loop_filter (uint8_t *src, ptrdiff_t step, ptrdiff_t stride, int len, int pq)
 VC-1 in-loop deblocking filter.
 
static void vc1_v_loop_filter4_c (uint8_t *src, ptrdiff_t stride, int pq)
 
static void vc1_h_loop_filter4_c (uint8_t *src, ptrdiff_t stride, int pq)
 
static void vc1_v_loop_filter8_c (uint8_t *src, ptrdiff_t stride, int pq)
 
static void vc1_h_loop_filter8_c (uint8_t *src, ptrdiff_t stride, int pq)
 
static void vc1_v_loop_filter16_c (uint8_t *src, ptrdiff_t stride, int pq)
 
static void vc1_h_loop_filter16_c (uint8_t *src, ptrdiff_t 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, ptrdiff_t stride, int mode, int r)
 
static void put_no_rnd_vc1_chroma_mc8_c (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
static void put_no_rnd_vc1_chroma_mc4_c (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
static void avg_no_rnd_vc1_chroma_mc8_c (uint8_t *dst, const uint8_t *src, ptrdiff_t stride, int h, int x, int y)
 
static void avg_no_rnd_vc1_chroma_mc4_c (uint8_t *dst, const 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

◆ VC1_MSPEL_FILTER_16B

#define VC1_MSPEL_FILTER_16B ( DIR,
TYPE )
Value:
static av_always_inline int vc1_mspel_ ## DIR ## _filter_16bits(const TYPE *src, \
ptrdiff_t 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 TYPE
Definition ffv1dec.c:90
#define av_always_inline
Definition attributes.h:72
Definition swscale.c:71
#define stride
#define src
Definition vp8dsp.c:248

Definition at line 542 of file vc1dsp.c.

◆ VC1_MSPEL_MC

#define VC1_MSPEL_MC ( OP,
OP4,
OPNAME )

Definition at line 587 of file vc1dsp.c.

◆ op_put

#define op_put ( a,
b )
Value:
#define av_clip_uint8
Definition common.h:106
int a
#define b
Definition input.c:43

Definition at line 725 of file vc1dsp.c.

◆ op_avg

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

Definition at line 726 of file vc1dsp.c.

◆ op4_avg

#define op4_avg ( a,
b )
Value:
(a) = rnd_avg32(a, b)
static uint32_t rnd_avg32(uint32_t a, uint32_t b)
Definition rnd_avg.h:31

Definition at line 727 of file vc1dsp.c.

◆ op4_put

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

Definition at line 728 of file vc1dsp.c.

◆ PUT_VC1_MSPEL

#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); \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
#define rnd
Definition checkasm.h:136

Definition at line 735 of file vc1dsp.c.

◆ chroma_mc

#define chroma_mc ( a)
Value:
((A * src[a] + B * src[a + 1] + \
C * src[stride + a] + D * src[stride + a + 1] + 32 - 4) >> 6)
#define A(x)
Definition vpx_arith.h:28
#define D
Definition avdct.c:35
#define B
Definition huffyuv.h:42
#define C

Definition at line 780 of file vc1dsp.c.

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

◆ avg2

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

Definition at line 830 of file vc1dsp.c.

Referenced by avg_no_rnd_vc1_chroma_mc4_c(), and avg_no_rnd_vc1_chroma_mc8_c().

◆ FN_ASSIGN

#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
#define Y
Definition boxblur.h:37
#define X
Definition f_ebur128.c:157

Definition at line 962 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

Function Documentation

◆ vc1_v_overlap_c()

static void vc1_v_overlap_c ( uint8_t * src,
ptrdiff_t stride )
static

Definition at line 40 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_h_overlap_c()

static void vc1_h_overlap_c ( uint8_t * src,
ptrdiff_t stride )
static

Definition at line 64 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_v_s_overlap_c()

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

Definition at line 87 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_h_s_overlap_c()

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

Definition at line 113 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_filter_line()

static av_always_inline int vc1_filter_line ( uint8_t * src,
ptrdiff_t 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 150 of file vc1dsp.c.

Referenced by vc1_loop_filter().

◆ vc1_loop_filter()

static av_always_inline void vc1_loop_filter ( uint8_t * src,
ptrdiff_t step,
ptrdiff_t stride,
int len,
int pq )
static

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

◆ vc1_v_loop_filter4_c()

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

Definition at line 210 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_h_loop_filter4_c()

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

Definition at line 215 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_v_loop_filter8_c()

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

Definition at line 220 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_h_loop_filter8_c()

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

Definition at line 225 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_v_loop_filter16_c()

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

Definition at line 230 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_h_loop_filter16_c()

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

Definition at line 235 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_8x8_dc_c()

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

Definition at line 241 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_8x8_c()

static void vc1_inv_trans_8x8_c ( int16_t block[64])
static

Definition at line 262 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_8x4_dc_c()

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

Definition at line 332 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_8x4_c()

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

Definition at line 353 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_4x8_dc_c()

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

Definition at line 409 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_4x8_c()

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

Definition at line 426 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_4x4_dc_c()

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

Definition at line 482 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_inv_trans_4x4_c()

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

Definition at line 499 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ vc1_mspel_filter()

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

Definition at line 567 of file vc1dsp.c.

Referenced by vc1_mspel_filter().

◆ put_no_rnd_vc1_chroma_mc8_c()

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

Definition at line 783 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ put_no_rnd_vc1_chroma_mc4_c()

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

Definition at line 809 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ avg_no_rnd_vc1_chroma_mc8_c()

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

Definition at line 831 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ avg_no_rnd_vc1_chroma_mc4_c()

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

Definition at line 857 of file vc1dsp.c.

Referenced by ff_vc1dsp_init().

◆ ff_vc1dsp_init()