"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/tmo/mantiuk06/contrast_domain.cpp" between
pfstools-2.1.0.tgz and pfstools-2.2.0.tgz

About: pfstools are a set of command line programs (and one GUI program) for reading, writing, manipulating, and viewing high-dynamic range (HDR) images and video frames (similar as the netpbm package does for low-dynamic range images).

contrast_domain.cpp  (pfstools-2.1.0.tgz):contrast_domain.cpp  (pfstools-2.2.0.tgz)
skipping to change at line 343 skipping to change at line 343
#pragma omp parallel for reduction(+:val) schedule(static) #pragma omp parallel for reduction(+:val) schedule(static)
for(int j=0;j<n;j++) for(int j=0;j<n;j++)
val += a[j] * b[j]; val += a[j] * b[j];
return val; return val;
} }
// set zeros for matrix elements // set zeros for matrix elements
static inline void matrix_zero(int n, float* m) static inline void matrix_zero(int n, float* m)
{ {
bzero(m, n*sizeof(float)); //bzero(m, n*sizeof(float));
memset(m, n, sizeof(float));
} }
// calculate divergence of two gradient maps (Gx and Gy) // calculate divergence of two gradient maps (Gx and Gy)
// divG(x,y) = Gx(x,y) - Gx(x-1,y) + Gy(x,y) - Gy(x,y-1) // divG(x,y) = Gx(x,y) - Gx(x-1,y) + Gy(x,y) - Gy(x,y-1)
static inline void calculate_and_add_divergence(const int cols, const int rows, const float* const Gx, const float* const Gy, float* const divG) static inline void calculate_and_add_divergence(const int cols, const int rows, const float* const Gx, const float* const Gy, float* const divG)
{ {
#pragma omp parallel for schedule(static) #pragma omp parallel for schedule(static)
for(int ky=0; ky<rows; ky++) for(int ky=0; ky<rows; ky++)
for(int kx=0; kx<cols; kx++) for(int kx=0; kx<cols; kx++)
{ {
skipping to change at line 676 skipping to change at line 677
const float ierr2 = err2; const float ierr2 = err2;
const float percent_sf = 100.0f/logf(tol2*bnrm2/ierr2); const float percent_sf = 100.0f/logf(tol2*bnrm2/ierr2);
int iter = 0; int iter = 0;
bool reset = true; bool reset = true;
int num_backwards = 0; int num_backwards = 0;
const int num_backwards_ceiling = 3; const int num_backwards_ceiling = 3;
for (; iter < itmax; iter++) for (; iter < itmax; iter++)
{ {
fprintf( stderr, "Iter %d\n", iter );
if( progress_cb != NULL ) if( progress_cb != NULL )
progress_cb( (int) (logf(err2/ierr2)*percent_sf)); progress_cb( (int) (logf(err2/ierr2)*percent_sf));
solveX(n, r, z); // z = ~A(-1) * r = -0.25 * r solveX(n, r, z); // z = ~A(-1) * r = -0.25 * r
solveX(n, rr, zz); // zz = ~A(-1) * rr = -0.25 * rr solveX(n, rr, zz); // zz = ~A(-1) * rr = -0.25 * rr
const float bknum = matrix_DotProduct(n, z, rr); const float bknum = matrix_DotProduct(n, z, rr);
if(reset) if(reset)
{ {
 End of changes. 2 change blocks. 
1 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)