Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
eaw.c File Reference
#include "common/eaw.h"
#include "common/darktable.h"
#include "common/math.h"
#include "control/control.h"
#include "common/dwt.h"
+ Include dependency graph for eaw.c:

Data Structures

struct  _aligned_pixel
 

Macros

#define SUM_PIXEL_CONTRIBUTION(ii, jj)
 
#define SUM_PIXEL_PROLOGUE
 
#define SUM_PIXEL_EPILOGUE
 
#define SUM_PIXEL_CONTRIBUTION(ii, jj)
 
#define SUM_PIXEL_EPILOGUE
 

Typedefs

typedef struct _aligned_pixel _aligned_pixel
 

Functions

static void weight (const float *c1, const float *c2, const float sharpen, dt_aligned_pixel_t weight)
 
void eaw_decompose (float *const restrict out, const float *const restrict in, float *const restrict detail, const int scale, const float sharpen, const int32_t width, const int32_t height)
 
void eaw_synthesize (float *const out, const float *const in, const float *const restrict detail, const float *const restrict threshold, const float *const restrict boost, const int32_t width, const int32_t height)
 
static float dn_weight (const float *c1, const float *c2, const float inv_sigma2)
 
void eaw_dn_decompose (float *const restrict out, const float *const restrict in, float *const restrict detail, dt_aligned_pixel_t sum_squared, const int scale, const float inv_sigma2, const int32_t width, const int32_t height)
 

Macro Definition Documentation

◆ SUM_PIXEL_CONTRIBUTION [1/2]

#define SUM_PIXEL_CONTRIBUTION (   ii,
  jj 
)
Value:
do \
{ \
const float f = filter[(ii)] * filter[(jj)]; \
dt_aligned_pixel_t wp; \
weight(px, px2, sharpen, wp); \
dt_aligned_pixel_t w; \
dt_aligned_pixel_t pd; \
for_four_channels(c,aligned(px2)) \
{ \
w[c] = f * wp[c]; \
wgt[c] += w[c]; \
pd[c] = w[c] * px2[c]; \
sum[c] += pd[c]; \
} \
} while(0)
static float f(const float t, const float c, const float x)
Definition graduatednd.c:173

◆ SUM_PIXEL_CONTRIBUTION [2/2]

#define SUM_PIXEL_CONTRIBUTION (   ii,
  jj 
)
Value:
do \
{ \
const float f = filter[(ii)] * filter[(jj)]; \
const float wp = dn_weight(px, px2, inv_sigma2); \
const float w = f * wp; \
dt_aligned_pixel_t pd; \
for_each_channel(c,aligned(px2)) \
{ \
pd[c] = w * px2[c]; \
wgt[c] += w; \
sum[c] += pd[c]; \
} \
} while(0)
static float dn_weight(const float *c1, const float *c2, const float inv_sigma2)
Definition eaw.c:358

◆ SUM_PIXEL_EPILOGUE [1/2]

#define SUM_PIXEL_EPILOGUE
Value:
{ \
sum[c] /= wgt[c]; \
pcoarse[c] = sum[c]; \
const float det = (px[c] - sum[c]); \
pdetail[c] = det; \
} \
px += 4; \
pdetail += 4; \
pcoarse += 4;
#define for_each_channel(_var,...)
Definition darktable.h:411

◆ SUM_PIXEL_EPILOGUE [2/2]

#define SUM_PIXEL_EPILOGUE
Value:
{ \
sum[c] /= wgt[c]; \
pcoarse[c] = sum[c]; \
const float det = (px[c] - sum[c]); \
pdetail[c] = det; \
sum_sq.v[c] += (det*det); \
} \
px += 4; \
pdetail += 4; \
pcoarse += 4;

◆ SUM_PIXEL_PROLOGUE

#define SUM_PIXEL_PROLOGUE
Value:
dt_aligned_pixel_t sum = { 0.0f, 0.0f, 0.0f, 0.0f }; \
dt_aligned_pixel_t wgt = { 0.0f, 0.0f, 0.0f, 0.0f };

Typedef Documentation

◆ _aligned_pixel

Function Documentation

◆ dn_weight()

static float dn_weight ( const float *  c1,
const float *  c2,
const float  inv_sigma2 
)
inlinestatic
Todo:
: this should ideally depend on the image before noise stabilizing transforms!

References c1, c2, dot(), fast_mexp2f(), for_each_channel, and MAX.

◆ eaw_decompose()

void eaw_decompose ( float *const restrict  out,
const float *const restrict  in,
float *const restrict  detail,
const int  scale,
const float  sharpen,
const int32_t  width,
const int32_t  height 
)

◆ eaw_dn_decompose()

void eaw_dn_decompose ( float *const restrict  out,
const float *const restrict  in,
float *const restrict  detail,
dt_aligned_pixel_t  sum_squared,
const int  scale,
const float  inv_sigma2,
const int32_t  width,
const int32_t  height 
)

◆ eaw_synthesize()

void eaw_synthesize ( float *const  out,
const float *const  in,
const float *const restrict  detail,
const float *const restrict  threshold,
const float *const restrict  boost,
const int32_t  width,
const int32_t  height 
)

References height, MAX, MIN, and width.

Referenced by process(), and process().

◆ weight()