--- plugin_ssim.c 2006/10/13 06:32:02 1.2 +++ plugin_ssim.c 2006/10/13 15:16:25 1.4 @@ -26,7 +26,7 @@ #include #include #include -#include +#include "../portab.h" #include "../xvid.h" #include "plugin_ssim.h" #include "../utils/emms.h" @@ -107,12 +107,12 @@ /*writeout the collected stats*/ void framestat_write(ssim_data_t* ssim, char* path){ + framestat_t* tmp = ssim->head; FILE* out = fopen(path,"w"); if(out==NULL) printf("Cannot open %s in plugin_ssim\n",path); - framestat_t* tmp = ssim->head; fprintf(out,"SSIM Error Metric\n"); - fprintf(out,"quant avg min max"); + fprintf(out,"quant avg min max\n"); while(tmp->next->next != NULL){ fprintf(out,"%3d %1.4f %1.4f %1.4f\n",tmp->quant,tmp->ssim_avg,tmp->ssim_min,tmp->ssim_max); tmp = tmp->next; @@ -122,10 +122,9 @@ /*writeout the collected stats in octave readable format*/ void framestat_write_oct(ssim_data_t* ssim, char* path){ - + framestat_t* tmp; FILE* out = fopen(path,"w"); if(out==NULL) printf("Cannot open %s in plugin_ssim\n",path); - framestat_t* tmp; fprintf(out,"quant = ["); tmp = ssim->head; @@ -264,7 +263,7 @@ fdevo = (float) devo; fdevc = (float) devc; fcorr = (float) corr; -// 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); */ return ((2.0*fmeano*fmeanc + c1)*(fcorr/32.0 + c2))/((fmeano*fmeano + fmeanc*fmeanc + c1)*(fdevc/64.0 + fdevo/64.0 + c2)); } @@ -311,7 +310,7 @@ ptr1+=GRID; ptr2+=GRID; /*rest of each row*/ - for(j=1;jfunc2x8(ptr1,str); meanc += ssim->func2x8(ptr2,str); @@ -352,7 +351,7 @@ } */ if(ssim->param->b_printstat){ - printf("SSIM: avg: %f min: %f max: %f\n",isum,min,max); + printf(" SSIM: avg: %f min: %f max: %f\n",isum,min,max); } } @@ -425,7 +424,7 @@ if(ssim->param->stat_path != NULL) framestat_write(ssim,ssim->param->stat_path); framestat_free(ssim->head); - //free(ssim->errmap); + /*free(ssim->errmap);*/ free(ssim->param); free(ssim); break;