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" |
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"); |
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; |
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; |
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++; |
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; |
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; |