[svn] / trunk / xvidcore / src / plugins / plugin_ssim.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/plugins/plugin_ssim.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1730, Wed Oct 11 13:55:32 2006 UTC revision 1734, Fri Oct 13 08:39:31 2006 UTC
# Line 26  Line 26 
26  #include <malloc.h>  #include <malloc.h>
27  #include <stdio.h>  #include <stdio.h>
28  #include <math.h>  #include <math.h>
29  #include <stdint.h>  #include "../portab.h"
30  #include "../xvid.h"  #include "../xvid.h"
31  #include "plugin_ssim.h"  #include "plugin_ssim.h"
32  #include "../utils/emms.h"  #include "../utils/emms.h"
# Line 107  Line 107 
107    
108  /*writeout the collected stats*/  /*writeout the collected stats*/
109  void framestat_write(ssim_data_t* ssim, char* path){  void framestat_write(ssim_data_t* ssim, char* path){
110            framestat_t* tmp = ssim->head;
111          FILE* out = fopen(path,"w");          FILE* out = fopen(path,"w");
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);
         framestat_t* tmp = ssim->head;  
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");
# Line 122  Line 122 
122    
123  /*writeout the collected stats in octave readable format*/  /*writeout the collected stats in octave readable format*/
124  void framestat_write_oct(ssim_data_t* ssim, char* path){  void framestat_write_oct(ssim_data_t* ssim, char* path){
125            framestat_t* tmp;
126          FILE* out = fopen(path,"w");          FILE* out = fopen(path,"w");
127          if(out==NULL) printf("Cannot open %s in plugin_ssim\n",path);          if(out==NULL) printf("Cannot open %s in plugin_ssim\n",path);
         framestat_t* tmp;  
128    
129          fprintf(out,"quant = [");          fprintf(out,"quant = [");
130          tmp = ssim->head;          tmp = ssim->head;
# Line 296  Line 295 
295                  meano = ssim->func8x8(ptr1,str);                  meano = ssim->func8x8(ptr1,str);
296                  meanc = ssim->func8x8(ptr2,str);                  meanc = ssim->func8x8(ptr2,str);
297                  ssim->consim(ptr1,ptr2,str,meano>>6,meanc>>6,&devo,&devc,&corr);                  ssim->consim(ptr1,ptr2,str,meano>>6,meanc>>6,&devo,&devc,&corr);
298                    emms();
299    
300                  val = calc_ssim(meano,meanc,devo,devc,corr);                  val = calc_ssim(meano,meanc,devo,devc,corr);
301                  isum += val;                  isum += val;
# Line 318  Line 318 
318                          meano = ssim->func8x8(ptr1,str);                          meano = ssim->func8x8(ptr1,str);
319                          meanc = ssim->func8x8(ptr2,str);                          meanc = ssim->func8x8(ptr2,str);
320                          ssim->consim(ptr1,ptr2,str,meano>>6,meanc>>6,&devo,&devc,&corr);                          ssim->consim(ptr1,ptr2,str,meano>>6,meanc>>6,&devo,&devc,&corr);
321                            emms();
322    
323                          val = calc_ssim(meano,meanc,devo,devc,corr);                          val = calc_ssim(meano,meanc,devo,devc,corr);
324                          isum += val;                          isum += val;
325                          c++;                          c++;
# Line 370  Line 372 
372    
373          ssim->param = param;          ssim->param = param;
374    
375    #if defined(ARCH_IS_IA32)
376          if(cpu_flags & XVID_CPU_MMX){          if(cpu_flags & XVID_CPU_MMX){
377                  ssim->func8x8 = lum_8x8_mmx;                  ssim->func8x8 = lum_8x8_mmx;
378                  ssim->consim = consim_mmx;                  ssim->consim = consim_mmx;
# Line 377  Line 380 
380          if(cpu_flags & XVID_CPU_SSE2){          if(cpu_flags & XVID_CPU_SSE2){
381                  ssim->consim = consim_sse2;                  ssim->consim = consim_sse2;
382          }          }
383    #endif
384    
385          ssim->ssim_sum = 0.0;          ssim->ssim_sum = 0.0;
386          ssim->frame_cnt = 0;          ssim->frame_cnt = 0;

Legend:
Removed from v.1730  
changed lines
  Added in v.1734

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4