112 |
if(out==NULL) printf("Cannot open %s in plugin_ssim\n",path); |
if(out==NULL) printf("Cannot open %s in plugin_ssim\n",path); |
113 |
|
|
114 |
fprintf(out,"SSIM Error Metric\n"); |
fprintf(out,"SSIM Error Metric\n"); |
115 |
fprintf(out,"quant avg min max"); |
fprintf(out,"quant avg min max\n"); |
116 |
while(tmp->next->next != NULL){ |
while(tmp->next->next != NULL){ |
117 |
fprintf(out,"%3d %1.4f %1.4f %1.4f\n",tmp->quant,tmp->ssim_avg,tmp->ssim_min,tmp->ssim_max); |
fprintf(out,"%3d %1.4f %1.4f %1.4f\n",tmp->quant,tmp->ssim_avg,tmp->ssim_min,tmp->ssim_max); |
118 |
tmp = tmp->next; |
tmp = tmp->next; |
263 |
fdevo = (float) devo; |
fdevo = (float) devo; |
264 |
fdevc = (float) devc; |
fdevc = (float) devc; |
265 |
fcorr = (float) corr; |
fcorr = (float) corr; |
266 |
// printf("meano: %f meanc: %f devo: %f devc: %f corr: %f\n",fmeano,fmeanc,fdevo,fdevc,fcorr); |
/* printf("meano: %f meanc: %f devo: %f devc: %f corr: %f\n",fmeano,fmeanc,fdevo,fdevc,fcorr); */ |
267 |
return ((2.0*fmeano*fmeanc + c1)*(fcorr/32.0 + c2))/((fmeano*fmeano + fmeanc*fmeanc + c1)*(fdevc/64.0 + fdevo/64.0 + c2)); |
return ((2.0*fmeano*fmeanc + c1)*(fcorr/32.0 + c2))/((fmeano*fmeano + fmeanc*fmeanc + c1)*(fdevc/64.0 + fdevo/64.0 + c2)); |
268 |
} |
} |
269 |
|
|
310 |
ptr1+=GRID; |
ptr1+=GRID; |
311 |
ptr2+=GRID; |
ptr2+=GRID; |
312 |
/*rest of each row*/ |
/*rest of each row*/ |
313 |
for(j=1;j<width;j+=GRID){ |
for(j=GRID;j<width;j+=GRID){ |
314 |
/* for grid = 1 use |
/* for grid = 1 use |
315 |
meano += ssim->func2x8(ptr1,str); |
meano += ssim->func2x8(ptr1,str); |
316 |
meanc += ssim->func2x8(ptr2,str); |
meanc += ssim->func2x8(ptr2,str); |
424 |
if(ssim->param->stat_path != NULL) |
if(ssim->param->stat_path != NULL) |
425 |
framestat_write(ssim,ssim->param->stat_path); |
framestat_write(ssim,ssim->param->stat_path); |
426 |
framestat_free(ssim->head); |
framestat_free(ssim->head); |
427 |
//free(ssim->errmap); |
/*free(ssim->errmap);*/ |
428 |
free(ssim->param); |
free(ssim->param); |
429 |
free(ssim); |
free(ssim); |
430 |
break; |
break; |