FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Typedefs | Functions
tiny_ssim.c File Reference
#include "config.h"
#include <inttypes.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define FFSWAP(type, a, b)   do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
 
#define FFMIN(a, b)   ((a) > (b) ? (b) : (a))
 
#define BIT_DEPTH   8
 
#define PIXEL_MAX   ((1 << BIT_DEPTH)-1)
 

Typedefs

typedef uint8_t pixel
 

Functions

static void ssim_4x4x2_core (const pixel *pix1, intptr_t stride1, const pixel *pix2, intptr_t stride2, int sums[2][4])
 
static float ssim_end1 (int s1, int s2, int ss, int s12)
 
static float ssim_end4 (int sum0[5][4], int sum1[5][4], int width)
 
float ssim_plane (pixel *pix1, intptr_t stride1, pixel *pix2, intptr_t stride2, int width, int height, void *buf, int *cnt)
 
uint64_t ssd_plane (const uint8_t *pix1, const uint8_t *pix2, int size)
 
static double ssd_to_psnr (uint64_t ssd, uint64_t denom)
 
static double ssim_db (double ssim, double weight)
 
static void print_results (uint64_t ssd[3], double ssim[3], int frames, int w, int h)
 
int main (int argc, char *argv[])
 

Macro Definition Documentation

#define FFSWAP (   type,
  a,
  b 
)    do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)

Definition at line 37 of file tiny_ssim.c.

Referenced by ssim_plane().

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

Definition at line 38 of file tiny_ssim.c.

Referenced by ssim_plane().

#define BIT_DEPTH   8

Definition at line 40 of file tiny_ssim.c.

#define PIXEL_MAX   ((1 << BIT_DEPTH)-1)

Definition at line 41 of file tiny_ssim.c.

Referenced by ssim_end1().

Typedef Documentation

typedef uint8_t pixel

Definition at line 42 of file tiny_ssim.c.

Function Documentation

static void ssim_4x4x2_core ( const pixel pix1,
intptr_t  stride1,
const pixel pix2,
intptr_t  stride2,
int  sums[2][4] 
)
static

Definition at line 47 of file tiny_ssim.c.

Referenced by ssim_plane().

static float ssim_end1 ( int  s1,
int  s2,
int  ss,
int  s12 
)
static

Definition at line 76 of file tiny_ssim.c.

Referenced by ssim_end4().

static float ssim_end4 ( int  sum0[5][4],
int  sum1[5][4],
int  width 
)
static

Definition at line 100 of file tiny_ssim.c.

Referenced by ssim_plane().

float ssim_plane ( pixel pix1,
intptr_t  stride1,
pixel pix2,
intptr_t  stride2,
int  width,
int  height,
void buf,
int cnt 
)

Definition at line 113 of file tiny_ssim.c.

Referenced by main().

uint64_t ssd_plane ( const uint8_t pix1,
const uint8_t pix2,
int  size 
)

Definition at line 141 of file tiny_ssim.c.

Referenced by main().

static double ssd_to_psnr ( uint64_t  ssd,
uint64_t  denom 
)
static

Definition at line 153 of file tiny_ssim.c.

Referenced by print_results().

static double ssim_db ( double  ssim,
double  weight 
)
static

Definition at line 158 of file tiny_ssim.c.

Referenced by print_results().

static void print_results ( uint64_t  ssd[3],
double  ssim[3],
int  frames,
int  w,
int  h 
)
static

Definition at line 163 of file tiny_ssim.c.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)

Definition at line 178 of file tiny_ssim.c.