[svn] / branches / dev-api-4 / xvidcore / src / plugins / plugin_psnr.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/src/plugins/plugin_psnr.c

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

revision 921, Sat Mar 15 14:38:34 2003 UTC revision 922, Sat Mar 15 16:04:38 2003 UTC
# Line 9  Line 9 
9      case XVID_PLG_INFO :      case XVID_PLG_INFO :
10          {          {
11          xvid_plg_info_t * info = (xvid_plg_info_t*)param1;          xvid_plg_info_t * info = (xvid_plg_info_t*)param1;
12          info->flags = XVID_REQORIGINAL;          info->flags = XVID_REQPSNR;
13          return 0;          return 0;
14          }          }
15    
# Line 22  Line 22 
22         {         {
23         xvid_plg_data_t * data = (xvid_plg_data_t*)param1;         xvid_plg_data_t * data = (xvid_plg_data_t*)param1;
24    
        long sse_y = plane_sse(data->original.plane[0], data->current.plane[0],  
                 data->current.stride[0], data->width, data->height);  
   
        long sse_u = plane_sse(data->original.plane[1], data->current.plane[1],  
                 data->current.stride[1], data->width/2, data->height/2);  
   
        long sse_v = plane_sse(data->original.plane[2], data->current.plane[2],  
                 data->current.stride[2], data->width/2, data->height/2);  
   
25         printf("y_psnr=%2.2f u_psnr=%2.2f v_psnr=%2.2f\n",         printf("y_psnr=%2.2f u_psnr=%2.2f v_psnr=%2.2f\n",
26             sse_to_PSNR(sse_y, data->width*data->height),             sse_to_PSNR(data->sse_y, data->width*data->height),
27             sse_to_PSNR(sse_u, data->width*data->height/4),             sse_to_PSNR(data->sse_u, data->width*data->height/4),
28             sse_to_PSNR(sse_v, data->width*data->height/4));             sse_to_PSNR(data->sse_v, data->width*data->height/4));
   
        {  
            IMAGE img;  
            char tmp[100];  
            img.y = data->original.plane[0];  
            img.u = data->original.plane[1];  
            img.v = data->original.plane[2];  
            sprintf(tmp, "ori-%03i.pgm", data->frame_num);  
            image_dump_yuvpgm(&img, data->original.stride[0], data->width, data->height, tmp);  
   
            img.y = data->current.plane[0];  
            img.u = data->current.plane[1];  
            img.v = data->current.plane[2];  
            sprintf(tmp, "enc-%03i.pgm", data->frame_num);  
            image_dump_yuvpgm(&img, data->reference.stride[0], data->width, data->height, tmp);  
        }  
29    
30         return 0;         return 0;
31         }         }

Legend:
Removed from v.921  
changed lines
  Added in v.922

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