FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
vf_filmdint.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include "config.h"
#include "mp_msg.h"
#include "cpudetect.h"
#include "img_format.h"
#include "mp_image.h"
#include "vd.h"
#include "vf.h"
#include "cmmx.h"
#include "libavutil/x86/asm.h"
#include "libvo/fastmemcpy.h"

Go to the source code of this file.

Data Structures

struct  metrics
 
struct  frame_stats
 
struct  vf_priv_s
 

Macros

#define NUM_STORED   4
 
#define PPZ   { 2000, 2000, 0, 2000 }
 
#define PPR   { 2000, 2000, 0, 2000 }
 
#define MIN(a, b)   (((a)<(b))?(a):(b))
 
#define MAX(a, b)   (((a)>(b))?(a):(b))
 
#define PDIFFUB(X, Y, T)
 
#define PDIFFUBT(X, Y, T)
 
#define PSUMBW(X, T, Z)
 
#define PSADBW(X, Y, T, Z)   PDIFFUBT(X,Y,T) PSUMBW(Y,T,Z)
 
#define PMAXUB(X, Y)   "psubusb " #X "," #Y "\n\tpaddusb " #X "," #Y "\n\t"
 
#define PMAXUW(X, Y)   "psubusw " #X "," #Y "\n\tpaddusw " #X "," #Y "\n\t"
 
#define PMINUBT(X, Y, T)
 
#define PAVGB(X, Y)   "pavgusb " #X "," #Y "\n\t"
 
#define MEQ(X, Y)   ((X).even == (Y).even && (X).odd == (Y).odd && (X).temp == (Y).temp && (X).noise == (Y).noise)
 
#define BLOCK_METRICS_TEMPLATE()
 
#define PSUMBW(X, T, Z)   "psadbw " #Z "," #X "\n\t"
 
#define PSADBW(X, Y, T, Z)   "psadbw " #X "," #Y "\n\t"
 
#define PMAXUB(X, Y)   "pmaxub " #X "," #Y "\n\t"
 
#define PMINUBT(X, Y, T)   "pminub " #X "," #Y "\n\t"
 
#define PAVGB(X, Y)   "pavgb " #X "," #Y "\n\t"
 
#define METRICS(X)   (X).even, (X).odd, (X).noise, (X).temp
 
#define ITOC(X)   (!(X) ? ' ' : (X) + ((X)>9 ? 'a'-10 : '0'))
 

Enumerations

enum  pu_field_type_t {
  PU_1ST_OF_3, PU_2ND_OF_3, PU_3RD_OF_3, PU_1ST_OF_2,
  PU_2ND_OF_2, PU_INTERLACED
}
 

Functions

static void get_metrics_c (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct metrics *m)
 
static void get_metrics_fast_c (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct metrics *m)
 
static void get_metrics_faster_c (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct metrics *m)
 
static void get_block_stats (struct metrics *m, struct vf_priv_s *p, struct frame_stats *s)
 
static struct metrics block_metrics_c (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s)
 
static struct metrics block_metrics_fast_c (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s)
 
static struct metrics block_metrics_faster_c (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s)
 
static struct metrics block_metrics_3dnow (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s)
 
static struct metrics block_metrics_mmx2 (unsigned char *a, unsigned char *b, int as, int bs, int lines, struct vf_priv_s *p, struct frame_stats *s)
 
static int dint_copy_line_mmx2 (unsigned char *dst, unsigned char *a, long bos, long cos, int ds, int ss, int w, int t)
 
static int dint_copy_line (unsigned char *dst, unsigned char *a, long bos, long cos, int ds, int ss, int w, int t)
 
static int dint_copy_plane (unsigned char *d, unsigned char *a, unsigned char *b, unsigned char *c, unsigned long w, unsigned long h, unsigned long ds, unsigned long ss, unsigned long threshold, long field, long mmx2)
 
static void copy_merge_fields (struct vf_priv_s *p, mp_image_t *dmpi, unsigned char **old, unsigned char **new, unsigned long show)
 
static void diff_planes (struct vf_priv_s *p, struct frame_stats *s, unsigned char *of, unsigned char *nf, int w, int h, int os, int ns, int swapped)
 
static void diff_fields (struct vf_priv_s *p, struct frame_stats *s, unsigned char **old, unsigned char **new)
 
static const char * parse_args (struct vf_priv_s *p, const char *args)
 
static unsigned long gcd (unsigned long x, unsigned long y)
 
static void init (struct vf_priv_s *p, mp_image_t *mpi)
 
static double get_time (void)
 
static void get_image (struct vf_instance *vf, mp_image_t *mpi)
 
static long cmpe (unsigned long x, unsigned long y, unsigned long err, unsigned long e)
 
static unsigned long find_breaks (struct vf_priv_s *p, struct frame_stats *s)
 
static int put_image (struct vf_instance *vf, mp_image_t *mpi, double pts)
 
static int query_format (struct vf_instance *vf, unsigned int fmt)
 
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 uninit (struct vf_instance *vf)
 
static int vf_open (vf_instance_t *vf, char *args)
 

Variables

static struct frame_stats ppzs = {PPZ,PPZ,PPZ,PPZ,PPZ,PPZ,PPZ,0,0,9999}
 
static struct frame_stats pprs = {PPR,PPR,PPR,PPR,PPR,PPR,PPR,0,0,9999}
 
const vf_info_t ff_vf_info_filmdint
 

Macro Definition Documentation

#define NUM_STORED   4

Definition at line 36 of file vf_filmdint.c.

Referenced by get_image(), and init().

#define PPZ   { 2000, 2000, 0, 2000 }

Definition at line 96 of file vf_filmdint.c.

#define PPR   { 2000, 2000, 0, 2000 }

Definition at line 97 of file vf_filmdint.c.

#define MIN (   a,
  b 
)    (((a)<(b))?(a):(b))

Definition at line 102 of file vf_filmdint.c.

Referenced by find_breaks().

#define MAX (   a,
  b 
)    (((a)>(b))?(a):(b))

Definition at line 105 of file vf_filmdint.c.

Referenced by find_breaks(), and get_block_stats().

#define PDIFFUB (   X,
  Y,
  T 
)
Value:
"movq " #X "," #T "\n\t" \
"psubusb " #Y "," #T "\n\t" \
"psubusb " #X "," #Y "\n\t" \
"paddusb " #Y "," #T "\n\t"

Definition at line 108 of file vf_filmdint.c.

#define PDIFFUBT (   X,
  Y,
  T 
)
Value:
"movq " #X "," #T "\n\t" \
"psubusb " #Y "," #T "\n\t" \
"psubusb " #X "," #Y "\n\t" \
"paddusb " #T "," #Y "\n\t"

Definition at line 113 of file vf_filmdint.c.

Referenced by dint_copy_line_mmx2().

#define PSUMBW (   X,
  T,
 
)
Value:
"movq " #X "," #T "\n\t" \
"punpcklbw " #Z "," #X "\n\t" \
"punpckhbw " #Z "," #T "\n\t" \
"paddw " #T "," #X "\n\t" \
"movq " #X "," #T "\n\t" \
"psllq $32, " #T "\n\t" \
"paddw " #T "," #X "\n\t" \
"movq " #X "," #T "\n\t" \
"psllq $16, " #T "\n\t" \
"paddw " #T "," #X "\n\t" \
"psrlq $48, " #X "\n\t"

Definition at line 470 of file vf_filmdint.c.

#define PSADBW (   X,
  Y,
  T,
 
)    PDIFFUBT(X,Y,T) PSUMBW(Y,T,Z)

Definition at line 471 of file vf_filmdint.c.

#define PMAXUB (   X,
  Y 
)    "psubusb " #X "," #Y "\n\tpaddusb " #X "," #Y "\n\t"

Definition at line 472 of file vf_filmdint.c.

Referenced by doVertDefFilter_TMPL().

#define PMAXUW (   X,
  Y 
)    "psubusw " #X "," #Y "\n\tpaddusw " #X "," #Y "\n\t"

Definition at line 133 of file vf_filmdint.c.

Referenced by block_metrics_mmx2().

#define PMINUBT (   X,
  Y,
  T 
)
Value:
"movq " #Y "," #T "\n\t" \
"psubusb " #X "," #T "\n\t" \
"psubusb " #T "," #Y "\n\t"

Definition at line 473 of file vf_filmdint.c.

#define PAVGB (   X,
  Y 
)    "pavgusb " #X "," #Y "\n\t"
#define MEQ (   X,
  Y 
)    ((X).even == (Y).even && (X).odd == (Y).odd && (X).temp == (Y).temp && (X).noise == (Y).noise)

Definition at line 384 of file vf_filmdint.c.

Referenced by block_metrics_mmx2().

#define BLOCK_METRICS_TEMPLATE ( )

Definition at line 386 of file vf_filmdint.c.

Referenced by block_metrics_3dnow(), and block_metrics_mmx2().

#define PSUMBW (   X,
  T,
 
)    "psadbw " #Z "," #X "\n\t"

Definition at line 470 of file vf_filmdint.c.

#define PSADBW (   X,
  Y,
  T,
 
)    "psadbw " #X "," #Y "\n\t"

Definition at line 471 of file vf_filmdint.c.

#define PMAXUB (   X,
  Y 
)    "pmaxub " #X "," #Y "\n\t"

Definition at line 472 of file vf_filmdint.c.

#define PMINUBT (   X,
  Y,
  T 
)    "pminub " #X "," #Y "\n\t"

Definition at line 473 of file vf_filmdint.c.

#define PAVGB (   X,
  Y 
)    "pavgb " #X "," #Y "\n\t"

Definition at line 474 of file vf_filmdint.c.

#define METRICS (   X)    (X).even, (X).odd, (X).noise, (X).temp

Definition at line 817 of file vf_filmdint.c.

Referenced by diff_fields().

#define ITOC (   X)    (!(X) ? ' ' : (X) + ((X)>9 ? 'a'-10 : '0'))

Definition at line 1137 of file vf_filmdint.c.

Referenced by put_image().

Enumeration Type Documentation

Enumerator:
PU_1ST_OF_3 
PU_2ND_OF_3 
PU_3RD_OF_3 
PU_1ST_OF_2 
PU_2ND_OF_2 
PU_INTERLACED 

Definition at line 38 of file vf_filmdint.c.

Function Documentation

static void get_metrics_c ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct metrics m 
)
inlinestatic

Definition at line 140 of file vf_filmdint.c.

Referenced by block_metrics_c().

static void get_metrics_fast_c ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct metrics m 
)
inlinestatic

Definition at line 185 of file vf_filmdint.c.

Referenced by block_metrics_fast_c().

static void get_metrics_faster_c ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct metrics m 
)
inlinestatic

Definition at line 231 of file vf_filmdint.c.

Referenced by block_metrics_faster_c().

static void get_block_stats ( struct metrics m,
struct vf_priv_s p,
struct frame_stats s 
)
inlinestatic
static struct metrics block_metrics_c ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct vf_priv_s p,
struct frame_stats s 
)
staticread

Definition at line 346 of file vf_filmdint.c.

Referenced by block_metrics_mmx2(), and diff_planes().

static struct metrics block_metrics_fast_c ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct vf_priv_s p,
struct frame_stats s 
)
staticread

Definition at line 359 of file vf_filmdint.c.

Referenced by diff_planes().

static struct metrics block_metrics_faster_c ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct vf_priv_s p,
struct frame_stats s 
)
staticread

Definition at line 372 of file vf_filmdint.c.

Referenced by diff_planes().

static struct metrics block_metrics_3dnow ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct vf_priv_s p,
struct frame_stats s 
)
staticread

Definition at line 448 of file vf_filmdint.c.

Referenced by diff_planes().

static struct metrics block_metrics_mmx2 ( unsigned char *  a,
unsigned char *  b,
int  as,
int  bs,
int  lines,
struct vf_priv_s p,
struct frame_stats s 
)
staticread

Definition at line 477 of file vf_filmdint.c.

Referenced by diff_planes().

static int dint_copy_line_mmx2 ( unsigned char *  dst,
unsigned char *  a,
long  bos,
long  cos,
int  ds,
int  ss,
int  w,
int  t 
)
inlinestatic

Definition at line 607 of file vf_filmdint.c.

Referenced by dint_copy_plane().

static int dint_copy_line ( unsigned char *  dst,
unsigned char *  a,
long  bos,
long  cos,
int  ds,
int  ss,
int  w,
int  t 
)
inlinestatic

Definition at line 669 of file vf_filmdint.c.

Referenced by dint_copy_plane().

static int dint_copy_plane ( unsigned char *  d,
unsigned char *  a,
unsigned char *  b,
unsigned char *  c,
unsigned long  w,
unsigned long  h,
unsigned long  ds,
unsigned long  ss,
unsigned long  threshold,
long  field,
long  mmx2 
)
static

Definition at line 704 of file vf_filmdint.c.

Referenced by copy_merge_fields().

static void copy_merge_fields ( struct vf_priv_s p,
mp_image_t dmpi,
unsigned char **  old,
unsigned char **  new,
unsigned long  show 
)
static

Definition at line 739 of file vf_filmdint.c.

Referenced by put_image().

static void diff_planes ( struct vf_priv_s p,
struct frame_stats s,
unsigned char *  of,
unsigned char *  nf,
int  w,
int  h,
int  os,
int  ns,
int  swapped 
)
static

Definition at line 776 of file vf_filmdint.c.

Referenced by diff_fields().

static void diff_fields ( struct vf_priv_s p,
struct frame_stats s,
unsigned char **  old,
unsigned char **  new 
)
static

Definition at line 819 of file vf_filmdint.c.

Referenced by put_image().

static const char* parse_args ( struct vf_priv_s p,
const char *  args 
)
static

Definition at line 839 of file vf_filmdint.c.

Referenced by vf_open().

static unsigned long gcd ( unsigned long  x,
unsigned long  y 
)
static
static void init ( struct vf_priv_s p,
mp_image_t mpi 
)
static

Definition at line 872 of file vf_filmdint.c.

Referenced by get_image(), and put_image().

static double get_time ( void  )
inlinestatic

Definition at line 928 of file vf_filmdint.c.

Referenced by put_image().

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

Definition at line 935 of file vf_filmdint.c.

Referenced by vf_open().

static long cmpe ( unsigned long  x,
unsigned long  y,
unsigned long  err,
unsigned long  e 
)
inlinestatic

Definition at line 979 of file vf_filmdint.c.

Referenced by find_breaks().

static unsigned long find_breaks ( struct vf_priv_s p,
struct frame_stats s 
)
static

Definition at line 989 of file vf_filmdint.c.

Referenced by put_image().

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

Definition at line 1139 of file vf_filmdint.c.

Referenced by vf_open().

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

Definition at line 1337 of file vf_filmdint.c.

Referenced by vf_open().

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 1352 of file vf_filmdint.c.

Referenced by vf_open().

static void uninit ( struct vf_instance *  vf)
static

Definition at line 1397 of file vf_filmdint.c.

Referenced by vf_open().

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

Definition at line 1407 of file vf_filmdint.c.

Variable Documentation

struct frame_stats ppzs = {PPZ,PPZ,PPZ,PPZ,PPZ,PPZ,PPZ,0,0,9999}
static

Definition at line 98 of file vf_filmdint.c.

Referenced by put_image().

struct frame_stats pprs = {PPR,PPR,PPR,PPR,PPR,PPR,PPR,0,0,9999}
static

Definition at line 99 of file vf_filmdint.c.

Referenced by put_image().

const vf_info_t ff_vf_info_filmdint
Initial value:
= {
"Advanced inverse telecine filer",
"filmdint",
"Zoltan Hidvegi",
"",
}

Definition at line 1454 of file vf_filmdint.c.