vf_fspp.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <math.h>
#include "config.h"
#include "mp_msg.h"
#include "cpudetect.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
#include "av_helpers.h"
#include "libvo/fastmemcpy.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/x86/asm.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
Include dependency graph for vf_fspp.c:

Go to the source code of this file.

Data Structures

struct  vf_priv_s
 

Macros

#define BLOCKSZ   12
 
#define STORE(pos)
 
#define STORE2(pos)
 
#define store_slice_s   store_slice_c
 
#define store_slice2_s   store_slice2_c
 
#define mul_thrmat_s   mul_thrmat_c
 
#define column_fidct_s   column_fidct_c
 
#define row_idct_s   row_idct_c
 
#define row_fdct_s   row_fdct_c
 
#define DCTSIZE   8
 
#define DCTSIZE_S   "8"
 
#define FIX(x, s)   ((int) ((x) * (1<<s) + 0.5)&0xffff)
 
#define C64(x)   ((uint64_t)((x)|(x)<<16))<<32 | (uint64_t)(x) | (uint64_t)(x)<<16
 
#define FIX64(x, s)   C64(FIX(x,s))
 
#define MULTIPLY16H(x, k)   (((x)*(k))>>16)
 
#define THRESHOLD(r, x, t)   if(((unsigned)((x)+t))>t*2) r=(x);else r=0;
 
#define DESCALE(x, n)   (((x) + (1 << ((n)-1))) >> n)
 

Typedefs

typedef int32_t int_simd16_t
 

Functions

static const uint8_t __attribute__ ((aligned(32)))
 
static void store_slice_c (uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
 
static void store_slice2_c (uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)
 
static void mul_thrmat_c (struct vf_priv_s *p, int q)
 
static void column_fidct_c (int16_t *thr_adr, int16_t *data, int16_t *output, int cnt)
 
static void row_idct_c (int16_t *workspace, int16_t *output_adr, int output_stride, int cnt)
 
static void row_fdct_c (int16_t *data, const uint8_t *pixels, int line_size, int cnt)
 
static void filter (struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma)
 
static int config (struct vf_instance *vf, int width, int height, int d_width, int d_height, unsigned int flags, unsigned int outfmt)
 
static void get_image (struct vf_instance *vf, mp_image_t *mpi)
 
static int put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
 
static void uninit (struct vf_instance *vf)
 
static int query_format (struct vf_instance *vf, unsigned int fmt)
 
static int control (struct vf_instance *vf, int request, void *data)
 
static int vf_open (vf_instance_t *vf, char *args)
 

Variables

static const short custom_threshold [64]
 
const vf_info_t ff_vf_info_fspp
 
static const int16_t FIX_0_382683433 =FIX(0.382683433, 14)
 
static const int16_t FIX_0_541196100 =FIX(0.541196100, 14)
 
static const int16_t FIX_0_707106781 =FIX(0.707106781, 14)
 
static const int16_t FIX_1_306562965 =FIX(1.306562965, 14)
 
static const int16_t FIX_1_414213562_A =FIX(1.414213562, 14)
 
static const int16_t FIX_1_847759065 =FIX(1.847759065, 13)
 
static const int16_t FIX_2_613125930 =FIX(-2.613125930, 13)
 
static const int16_t FIX_1_414213562 =FIX(1.414213562, 13)
 
static const int16_t FIX_1_082392200 =FIX(1.082392200, 13)
 

Macro Definition Documentation

#define BLOCKSZ   12

Definition at line 62 of file vf_fspp.c.

Referenced by filter().

#define C64 (   x)    ((uint64_t)((x)|(x)<<16))<<32 | (uint64_t)(x) | (uint64_t)(x)<<16

Definition at line 704 of file vf_fspp.c.

#define column_fidct_s   column_fidct_c

Definition at line 177 of file vf_fspp.c.

Referenced by filter().

#define DCTSIZE   8

Definition at line 700 of file vf_fspp.c.

Referenced by column_fidct_c(), row_fdct_c(), and row_idct_c().

#define DCTSIZE_S   "8"

Definition at line 701 of file vf_fspp.c.

Referenced by column_fidct_c(), row_fdct_c(), and row_idct_c().

#define DESCALE (   x,
  n 
)    (((x) + (1 << ((n)-1))) >> n)

Definition at line 709 of file vf_fspp.c.

Referenced by row_idct_c().

#define FIX (   x,
  s 
)    ((int) ((x) * (1<<s) + 0.5)&0xffff)

Definition at line 703 of file vf_fspp.c.

#define FIX64 (   x,
  s 
)    C64(FIX(x,s))

Definition at line 705 of file vf_fspp.c.

#define mul_thrmat_s   mul_thrmat_c

Definition at line 176 of file vf_fspp.c.

Referenced by filter(), and vf_open().

#define MULTIPLY16H (   x,
  k 
)    (((x)*(k))>>16)

Definition at line 707 of file vf_fspp.c.

Referenced by column_fidct_c(), row_fdct_c(), and row_idct_c().

#define row_fdct_s   row_fdct_c

Definition at line 179 of file vf_fspp.c.

Referenced by filter().

#define row_idct_s   row_idct_c

Definition at line 178 of file vf_fspp.c.

Referenced by filter().

#define STORE (   pos)
Value:
temp= (src[x + pos] + (d[pos]>>log2_scale))>>(6-log2_scale); \
src[x + pos]=src[x + pos - 8*src_stride]=0; \
if(temp & 0x100) temp= ~(temp>>31); \
dst[x + pos]= temp;
else temp
Definition: vf_mcdeint.c:148
set threshold d
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
Discrete Time axis x
AVS_Value src
Definition: avisynth_c.h:523
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Referenced by store_slice_c().

#define STORE2 (   pos)
Value:
temp= (src[x + pos] + src[x + pos + 16*src_stride] + (d[pos]>>log2_scale))>>(6-log2_scale); \
src[x + pos + 16*src_stride]=0; \
if(temp & 0x100) temp= ~(temp>>31); \
dst[x + pos]= temp;
else temp
Definition: vf_mcdeint.c:148
set threshold d
initialize output if(nPeaks >3)%at least 3 peaks in spectrum for trying to find f0 nf0peaks
Discrete Time axis x
AVS_Value src
Definition: avisynth_c.h:523
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160

Referenced by store_slice2_c().

#define store_slice2_s   store_slice2_c

Definition at line 175 of file vf_fspp.c.

Referenced by filter().

#define store_slice_s   store_slice_c

Definition at line 174 of file vf_fspp.c.

Referenced by filter().

#define THRESHOLD (   r,
  x,
  t 
)    if(((unsigned)((x)+t))>t*2) r=(x);else r=0;

Definition at line 708 of file vf_fspp.c.

Referenced by column_fidct_c().

Typedef Documentation

Definition at line 734 of file vf_fspp.c.

Function Documentation

static const uint8_t __attribute__ ( (aligned(32))  )
static

Definition at line 78 of file vf_fspp.c.

Referenced by column_fidct_c(), filter(), row_fdct_c(), and row_idct_c().

static void column_fidct_c ( int16_t *  thr_adr,
int16_t *  data,
int16_t *  output,
int  cnt 
)
static

Definition at line 749 of file vf_fspp.c.

Referenced by mul_thrmat_c().

static int config ( struct vf_instance vf,
int  width,
int  height,
int  d_width,
int  d_height,
unsigned int  flags,
unsigned int  outfmt 
)
static

Definition at line 490 of file vf_fspp.c.

Referenced by vf_open().

static int control ( struct vf_instance vf,
int  request,
void data 
)
static

Definition at line 614 of file vf_fspp.c.

Referenced by vf_open().

static void filter ( struct vf_priv_s p,
uint8_t dst,
uint8_t src,
int  dst_stride,
int  src_stride,
int  width,
int  height,
uint8_t qp_store,
int  qp_stride,
int  is_luma 
)
static

Definition at line 410 of file vf_fspp.c.

Referenced by put_image().

static void get_image ( struct vf_instance vf,
mp_image_t mpi 
)
static

Definition at line 504 of file vf_fspp.c.

Referenced by init_pullup(), and vf_open().

static void mul_thrmat_c ( struct vf_priv_s p,
int  q 
)
static

Definition at line 161 of file vf_fspp.c.

static int put_image ( struct vf_instance vf,
mp_image_t mpi,
double  pts 
)
static

Definition at line 522 of file vf_fspp.c.

Referenced by vf_open().

static int query_format ( struct vf_instance vf,
unsigned int  fmt 
)
static

Definition at line 595 of file vf_fspp.c.

Referenced by vf_open().

static void row_fdct_c ( int16_t *  data,
const uint8_t pixels,
int  line_size,
int  cnt 
)
static

Definition at line 1878 of file vf_fspp.c.

Referenced by mul_thrmat_c().

static void row_idct_c ( int16_t *  workspace,
int16_t *  output_adr,
int  output_stride,
int  cnt 
)
static

Definition at line 1609 of file vf_fspp.c.

Referenced by mul_thrmat_c().

static void store_slice2_c ( uint8_t dst,
int16_t *  src,
int  dst_stride,
int  src_stride,
int  width,
int  height,
int  log2_scale 
)
static

Definition at line 135 of file vf_fspp.c.

static void store_slice_c ( uint8_t dst,
int16_t *  src,
int  dst_stride,
int  src_stride,
int  width,
int  height,
int  log2_scale 
)
static

Definition at line 108 of file vf_fspp.c.

static void uninit ( struct vf_instance vf)
static

Definition at line 576 of file vf_fspp.c.

Referenced by vf_open().

static int vf_open ( vf_instance_t vf,
char *  args 
)
static

Definition at line 627 of file vf_fspp.c.

Variable Documentation

const short custom_threshold[64]
static
Initial value:
=
{ 71, 296, 295, 237, 71, 40, 38, 19,
245, 193, 185, 121, 102, 73, 53, 27,
158, 129, 141, 107, 97, 73, 50, 26,
102, 116, 109, 98, 82, 66, 45, 23,
71, 94, 95, 81, 70, 56, 38, 20,
56, 77, 74, 66, 56, 44, 30, 15,
38, 53, 50, 45, 38, 30, 21, 11,
20, 27, 26, 23, 20, 15, 11, 5
}

Definition at line 64 of file vf_fspp.c.

Referenced by vf_open().

const vf_info_t ff_vf_info_fspp
Initial value:
= {
"fast simple postprocess",
"fspp",
"Michael Niedermayer, Nikolaj Poroshin",
"",
}
NULL
Definition: eval.c:55
static int vf_open(vf_instance_t *vf, char *args)
Definition: vf_fspp.c:627

Definition at line 683 of file vf_fspp.c.

const int16_t FIX_0_382683433 =FIX(0.382683433, 14)
static

Definition at line 735 of file vf_fspp.c.

const int16_t FIX_0_541196100 =FIX(0.541196100, 14)
static

Definition at line 736 of file vf_fspp.c.

const int16_t FIX_0_707106781 =FIX(0.707106781, 14)
static

Definition at line 737 of file vf_fspp.c.

const int16_t FIX_1_082392200 =FIX(1.082392200, 13)
static

Definition at line 743 of file vf_fspp.c.

const int16_t FIX_1_306562965 =FIX(1.306562965, 14)
static

Definition at line 738 of file vf_fspp.c.

const int16_t FIX_1_414213562 =FIX(1.414213562, 13)
static

Definition at line 742 of file vf_fspp.c.

const int16_t FIX_1_414213562_A =FIX(1.414213562, 14)
static

Definition at line 739 of file vf_fspp.c.

const int16_t FIX_1_847759065 =FIX(1.847759065, 13)
static

Definition at line 740 of file vf_fspp.c.

const int16_t FIX_2_613125930 =FIX(-2.613125930, 13)
static

Definition at line 741 of file vf_fspp.c.