MythTV  master
Classes | Macros | Typedefs | Functions | Variables
filter_denoise3d.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include "mythconfig.h"
#include <string.h>
#include <math.h>
#include "filter.h"
#include "mythframe.h"
#include "../mm_arch.h"
#include "ffmpeg-mmx.h"
Include dependency graph for filter_denoise3d.c:

Go to the source code of this file.

Classes

struct  ThisFilter
 

Macros

#define PARAM1_DEFAULT   4.0
 
#define PARAM2_DEFAULT   3.0
 
#define PARAM3_DEFAULT   6.0
 
#define LowPass(Prev, Curr, Coef)   ((Curr) + (Coef)[(Prev) - (Curr)])
 
#define ABS(A)   ( (A) > 0 ? (A) : -(A) )
 

Typedefs

typedef struct ThisFilter ThisFilter
 

Functions

static void calc_coefs (uint8_t *Ct, double Dist25)
 
static void denoise (uint8_t *Frame, uint8_t *FramePrev, uint8_t *Line, int W, int H, const uint8_t *Spatial, const uint8_t *Temporal)
 
static void denoiseMMX (uint8_t *Frame, uint8_t *FramePrev, uint8_t *Line, int W, int H, const uint8_t *Spatial, const uint8_t *Temporal)
 
static int alloc_line (ThisFilter *filter, int size)
 
static int alloc_prev (ThisFilter *filter, int size)
 
static int imax (int a, int b)
 
static int init_buf (ThisFilter *filter, VideoFrame *frame)
 
static int denoise3DFilter (VideoFilter *f, VideoFrame *frame, int field)
 
static void Denoise3DFilterCleanup (VideoFilter *filter)
 
static VideoFilterNewDenoise3DFilter (VideoFrameType inpixfmt, VideoFrameType outpixfmt, const int *width, const int *height, const char *options, int threads)
 

Variables

static const mmx_t mz = { 0x0LL }
 
static FmtConv FmtList []
 
const FilterInfo filter_table []
 

Macro Definition Documentation

◆ PARAM1_DEFAULT

#define PARAM1_DEFAULT   4.0

Definition at line 22 of file filter_denoise3d.c.

◆ PARAM2_DEFAULT

#define PARAM2_DEFAULT   3.0

Definition at line 23 of file filter_denoise3d.c.

◆ PARAM3_DEFAULT

#define PARAM3_DEFAULT   6.0

Definition at line 24 of file filter_denoise3d.c.

◆ LowPass

#define LowPass (   Prev,
  Curr,
  Coef 
)    ((Curr) + (Coef)[(Prev) - (Curr)])

Definition at line 26 of file filter_denoise3d.c.

◆ ABS

#define ABS (   A)    ( (A) > 0 ? (A) : -(A) )

Definition at line 29 of file filter_denoise3d.c.

Typedef Documentation

◆ ThisFilter

typedef struct ThisFilter ThisFilter

Function Documentation

◆ calc_coefs()

static void calc_coefs ( uint8_t *  Ct,
double  Dist25 
)
static

Definition at line 55 of file filter_denoise3d.c.

Referenced by NewDenoise3DFilter().

◆ denoise()

static void denoise ( uint8_t *  Frame,
uint8_t *  FramePrev,
uint8_t *  Line,
int  W,
int  H,
const uint8_t *  Spatial,
const uint8_t *  Temporal 
)
static

Definition at line 67 of file filter_denoise3d.c.

Referenced by NewDenoise3DFilter().

◆ denoiseMMX()

static void denoiseMMX ( uint8_t *  Frame,
uint8_t *  FramePrev,
uint8_t *  Line,
int  W,
int  H,
const uint8_t *  Spatial,
const uint8_t *  Temporal 
)
static

Definition at line 103 of file filter_denoise3d.c.

Referenced by NewDenoise3DFilter().

◆ alloc_line()

static int alloc_line ( ThisFilter filter,
int  size 
)
static

Definition at line 267 of file filter_denoise3d.c.

Referenced by init_buf().

◆ alloc_prev()

static int alloc_prev ( ThisFilter filter,
int  size 
)
static

Definition at line 285 of file filter_denoise3d.c.

Referenced by init_buf().

◆ imax()

static int imax ( int  a,
int  b 
)
static

Definition at line 303 of file filter_denoise3d.c.

Referenced by init_buf().

◆ init_buf()

static int init_buf ( ThisFilter filter,
VideoFrame frame 
)
static

Definition at line 305 of file filter_denoise3d.c.

Referenced by denoise3DFilter().

◆ denoise3DFilter()

static int denoise3DFilter ( VideoFilter f,
VideoFrame frame,
int  field 
)
static

Definition at line 330 of file filter_denoise3d.c.

Referenced by NewDenoise3DFilter().

◆ Denoise3DFilterCleanup()

static void Denoise3DFilterCleanup ( VideoFilter filter)
static

Definition at line 372 of file filter_denoise3d.c.

Referenced by NewDenoise3DFilter().

◆ NewDenoise3DFilter()

static VideoFilter* NewDenoise3DFilter ( VideoFrameType  inpixfmt,
VideoFrameType  outpixfmt,
const int *  width,
const int *  height,
const char *  options,
int  threads 
)
static

Definition at line 381 of file filter_denoise3d.c.

Variable Documentation

◆ mz

const mmx_t mz = { 0x0LL }
static

Definition at line 33 of file filter_denoise3d.c.

Referenced by denoiseMMX().

◆ FmtList

FmtConv FmtList[]
static
Initial value:
=
{
}
#define FMT_NULL
Definition: filter.h:20

Definition at line 462 of file filter_denoise3d.c.

◆ filter_table

const FilterInfo filter_table[]
Initial value:
=
{
{
.filter_init= &NewDenoise3DFilter,
.name= (char*)"denoise3d",
.descript= (char*)
"removes noise with a spatial and temporal low-pass filter",
.formats= FmtList,
.libname= NULL
},
}
#define NULL
Definition: H264Parser.h:62
static VideoFilter * NewDenoise3DFilter(VideoFrameType inpixfmt, VideoFrameType outpixfmt, const int *width, const int *height, const char *options, int threads)
static FmtConv FmtList[]
#define FILT_NULL
Definition: filter.h:47

Definition at line 468 of file filter_denoise3d.c.