FFmpeg
Loading...
Searching...
No Matches
bwdifdsp.c File Reference
#include <stdint.h>
#include <string.h>
#include "config.h"
#include "bwdifdsp.h"
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/macros.h"

Go to the source code of this file.

Macros

#define FILTER_INTRA()
 
#define FILTER1()
 
#define SPAT_CHECK()
 
#define FILTER_LINE()
 
#define FILTER_EDGE()
 
#define FILTER2()
 

Functions

void ff_bwdif_filter_intra_c (void *dst1, const void *cur1, int w, int prefs, int mrefs, int prefs3, int mrefs3, int parity, int clip_max)
 
void ff_bwdif_filter_line_c (void *dst1, const void *prev1, const void *cur1, const void *next1, int w, int prefs, int mrefs, int prefs2, int mrefs2, int prefs3, int mrefs3, int prefs4, int mrefs4, int parity, int clip_max)
 
void ff_bwdif_filter_edge_c (void *dst1, const void *prev1, const void *cur1, const void *next1, int w, int prefs, int mrefs, int prefs2, int mrefs2, int parity, int clip_max, int spat)
 
static void filter_intra_16bit (void *dst1, const void *cur1, int w, int prefs, int mrefs, int prefs3, int mrefs3, int parity, int clip_max)
 
static void filter_line_c_16bit (void *dst1, const void *prev1, const void *cur1, const void *next1, int w, int prefs, int mrefs, int prefs2, int mrefs2, int prefs3, int mrefs3, int prefs4, int mrefs4, int parity, int clip_max)
 
static void filter_edge_16bit (void *dst1, const void *prev1, const void *cur1, const void *next1, int w, int prefs, int mrefs, int prefs2, int mrefs2, int parity, int clip_max, int spat)
 
av_cold void ff_bwdif_init_filter_line (BWDIFDSPContext *s, int bit_depth)
 

Variables

static const uint16_t coef_lf [2] = { 4309, 213 }
 
static const uint16_t coef_hf [3] = { 5570, 3801, 1016 }
 
static const uint16_t coef_sp [2] = { 5077, 981 }
 

Macro Definition Documentation

◆ FILTER_INTRA

#define FILTER_INTRA ( )
Value:
for (x = 0; x < w; x++) { \
interpol = (coef_sp[0] * (cur[mrefs] + cur[prefs]) - coef_sp[1] * (cur[mrefs3] + cur[prefs3])) >> 13; \
dst[0] = av_clip(interpol, 0, clip_max); \
\
dst++; \
cur++; \
}
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
Definition dsp.h:87
static const uint16_t coef_sp[2]
Definition bwdifdsp.c:49
#define av_clip
Definition common.h:100
uint8_t w
Definition llvidencdsp.c:39
static int interpol(MBContext *s, uint32_t *color, int x, int y, int linesize)

Definition at line 52 of file bwdifdsp.c.

Referenced by ff_bwdif_filter_intra_c(), and filter_intra_16bit().

◆ FILTER1

#define FILTER1 ( )
Value:
for (x = 0; x < w; x++) { \
int c = cur[mrefs]; \
int d = (prev2[0] + next2[0]) >> 1; \
int e = cur[prefs]; \
int temporal_diff0 = FFABS(prev2[0] - next2[0]); \
int temporal_diff1 =(FFABS(prev[mrefs] - c) + FFABS(prev[prefs] - e)) >> 1; \
int temporal_diff2 =(FFABS(next[mrefs] - c) + FFABS(next[prefs] - e)) >> 1; \
int diff = FFMAX3(temporal_diff0 >> 1, temporal_diff1, temporal_diff2); \
\
if (!diff) { \
dst[0] = d; \
} else {
#define FFABS(a)
Absolute value, Note, INT_MIN / INT64_MIN result in undefined behavior as they are not representable ...
Definition common.h:74
#define FFMAX3(a, b, c)
Definition macros.h:48
static av_always_inline int diff(const struct color_info *a, const struct color_info *b, const int trans_thresh)
static double c[64]

Definition at line 61 of file bwdifdsp.c.

Referenced by ff_bwdif_filter_edge_c(), ff_bwdif_filter_line_c(), filter_edge_16bit(), and filter_line_c_16bit().

◆ SPAT_CHECK

#define SPAT_CHECK ( )
Value:
int b = ((prev2[mrefs2] + next2[mrefs2]) >> 1) - c; \
int f = ((prev2[prefs2] + next2[prefs2]) >> 1) - e; \
int dc = d - c; \
int de = d - e; \
int max = FFMAX3(de, dc, FFMIN(b, f)); \
int min = FFMIN3(de, dc, FFMAX(b, f)); \
#define f(width, name)
Definition cbs_vp8.c:236
#define min(a, b)
#define max(a, b)
#define b
Definition input.c:43
#define FFMIN(a, b)
Definition macros.h:49
#define FFMAX(a, b)
Definition macros.h:47
#define FFMIN3(a, b, c)
Definition macros.h:50

Definition at line 75 of file bwdifdsp.c.

◆ FILTER_LINE

#define FILTER_LINE ( )
Value:
if (FFABS(c - e) > temporal_diff0) { \
interpol = (((coef_hf[0] * (prev2[0] + next2[0]) \
- coef_hf[1] * (prev2[mrefs2] + next2[mrefs2] + prev2[prefs2] + next2[prefs2]) \
+ coef_hf[2] * (prev2[mrefs4] + next2[mrefs4] + prev2[prefs4] + next2[prefs4])) >> 2) \
+ coef_lf[0] * (c + e) - coef_lf[1] * (cur[mrefs3] + cur[prefs3])) >> 13; \
} else { \
interpol = (coef_sp[0] * (c + e) - coef_sp[1] * (cur[mrefs3] + cur[prefs3])) >> 13; \
}
static const uint16_t coef_hf[3]
Definition bwdifdsp.c:48
#define SPAT_CHECK()
Definition bwdifdsp.c:75
static const uint16_t coef_lf[2]
Definition bwdifdsp.c:47

Definition at line 84 of file bwdifdsp.c.

Referenced by ff_bwdif_filter_line_c(), and filter_line_c_16bit().

◆ FILTER_EDGE

#define FILTER_EDGE ( )
Value:
if (spat) { \
SPAT_CHECK() \
} \
interpol = (c + e) >> 1;

Definition at line 95 of file bwdifdsp.c.

Referenced by ff_bwdif_filter_edge_c(), and filter_edge_16bit().

◆ FILTER2

#define FILTER2 ( )
Value:
if (interpol > d + diff) \
interpol = d + diff; \
else if (interpol < d - diff) \
interpol = d - diff; \
\
dst[0] = av_clip(interpol, 0, clip_max); \
} \
\
dst++; \
cur++; \
prev++; \
next++; \
prev2++; \
next2++; \
}

Definition at line 101 of file bwdifdsp.c.

Referenced by ff_bwdif_filter_edge_c(), ff_bwdif_filter_line_c(), filter_edge_16bit(), and filter_line_c_16bit().

Function Documentation

◆ ff_bwdif_filter_intra_c()

void ff_bwdif_filter_intra_c ( void * dst1,
const void * cur1,
int w,
int prefs,
int mrefs,
int prefs3,
int mrefs3,
int parity,
int clip_max )

Definition at line 118 of file bwdifdsp.c.

Referenced by ff_bwdif_init_filter_line(), and filter_intra_helper().

◆ ff_bwdif_filter_line_c()

void ff_bwdif_filter_line_c ( void * dst1,
const void * prev1,
const void * cur1,
const void * next1,
int w,
int prefs,
int mrefs,
int prefs2,
int mrefs2,
int prefs3,
int mrefs3,
int prefs4,
int mrefs4,
int parity,
int clip_max )

◆ ff_bwdif_filter_edge_c()

void ff_bwdif_filter_edge_c ( void * dst1,
const void * prev1,
const void * cur1,
const void * next1,
int w,
int prefs,
int mrefs,
int prefs2,
int mrefs2,
int parity,
int clip_max,
int spat )

Definition at line 146 of file bwdifdsp.c.

Referenced by ff_bwdif_init_filter_line(), and filter_edge_helper().

◆ filter_intra_16bit()

static void filter_intra_16bit ( void * dst1,
const void * cur1,
int w,
int prefs,
int mrefs,
int prefs3,
int mrefs3,
int parity,
int clip_max )
static

Definition at line 163 of file bwdifdsp.c.

Referenced by ff_bwdif_init_filter_line().

◆ filter_line_c_16bit()

static void filter_line_c_16bit ( void * dst1,
const void * prev1,
const void * cur1,
const void * next1,
int w,
int prefs,
int mrefs,
int prefs2,
int mrefs2,
int prefs3,
int mrefs3,
int prefs4,
int mrefs4,
int parity,
int clip_max )
static

Definition at line 173 of file bwdifdsp.c.

Referenced by config_output(), and ff_bwdif_init_filter_line().

◆ filter_edge_16bit()

static void filter_edge_16bit ( void * dst1,
const void * prev1,
const void * cur1,
const void * next1,
int w,
int prefs,
int mrefs,
int prefs2,
int mrefs2,
int parity,
int clip_max,
int spat )
static

Definition at line 191 of file bwdifdsp.c.

Referenced by ff_bwdif_init_filter_line().

◆ ff_bwdif_init_filter_line()

av_cold void ff_bwdif_init_filter_line ( BWDIFDSPContext * s,
int bit_depth )

Definition at line 208 of file bwdifdsp.c.

Referenced by checkasm_check_vf_bwdif(), and config_props().

Variable Documentation

◆ coef_lf

const uint16_t coef_lf[2] = { 4309, 213 }
static

Definition at line 47 of file bwdifdsp.c.

Referenced by deinterlace_plane_slice().

◆ coef_hf

const uint16_t coef_hf[3] = { 5570, 3801, 1016 }
static

Definition at line 48 of file bwdifdsp.c.

Referenced by deinterlace_plane_slice().

◆ coef_sp

const uint16_t coef_sp[2] = { 5077, 981 }
static

Definition at line 49 of file bwdifdsp.c.