[svn] / trunk / xvidcore / examples / xvid_encraw.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/examples/xvid_encraw.c

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

revision 1729, Wed Oct 11 13:52:06 2006 UTC revision 1739, Mon Oct 16 04:46:01 2006 UTC
# Line 21  Line 21 
21   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
22   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
23   *   *
24   * $Id: xvid_encraw.c,v 1.28 2006-10-11 13:52:06 Skal Exp $   * $Id: xvid_encraw.c,v 1.31 2006-10-16 04:46:01 Skal Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 1197  Line 1197 
1197                                  framestats[5].size += stats_length;                                  framestats[5].size += stats_length;
1198                          }                          }
1199    
1200    #define SSE2PSNR(sse, width, height) ((!(sse))?0.0f : 48.131f - 10*(float)log10((float)(sse)/((float)((width)*(height)))))
1201    
1202                          if (ARG_PROGRESS == 0) {                          if (ARG_PROGRESS == 0) {
1203                                  printf("%5d: key=%i, time= %6.0f, len= %7d", !result ? input_num : -1,                                  printf("%5d: key=%i, time= %6.0f, len= %7d", !result ? input_num : -1,
# Line 1204  Line 1205 
1205                                  printf(" | type=%s, quant= %2d, len= %7d", type, stats_quant,                                  printf(" | type=%s, quant= %2d, len= %7d", type, stats_quant,
1206                                     stats_length);                                     stats_length);
1207    
 #define SSE2PSNR(sse, width, height) ((!(sse))?0.0f : 48.131f - 10*(float)log10((float)(sse)/((float)((width)*(height)))))  
1208    
1209                                  if (ARG_STATS) {                                  if (ARG_STATS) {
1210                                          printf(", psnr y = %2.2f, psnr u = %2.2f, psnr v = %2.2f",                                          printf(", psnr y = %2.2f, psnr u = %2.2f, psnr v = %2.2f",
1211                                                  SSE2PSNR(sse[0], XDIM, YDIM), SSE2PSNR(sse[1], XDIM / 2,                                                  SSE2PSNR(sse[0], XDIM, YDIM), SSE2PSNR(sse[1], XDIM / 2, YDIM / 2),
                                                                                                                                 YDIM / 2),  
1212                                                  SSE2PSNR(sse[2], XDIM / 2, YDIM / 2));                                                  SSE2PSNR(sse[2], XDIM / 2, YDIM / 2));
   
                                         totalPSNR[0] += SSE2PSNR(sse[0], XDIM, YDIM);  
                                         totalPSNR[1] += SSE2PSNR(sse[1], XDIM/2, YDIM/2);  
                                         totalPSNR[2] += SSE2PSNR(sse[2], XDIM/2, YDIM/2);  
1213                                  }                                  }
1214                                  printf("\n");                                  printf("\n");
1215                          } else {                          } else {
# Line 1231  Line 1226 
1226                                  }                                  }
1227                          }                          }
1228    
1229                            if (ARG_STATS) {
1230                                    totalPSNR[0] += SSE2PSNR(sse[0], XDIM, YDIM);
1231                                    totalPSNR[1] += SSE2PSNR(sse[1], XDIM/2, YDIM/2);
1232                                    totalPSNR[2] += SSE2PSNR(sse[2], XDIM/2, YDIM/2);
1233                  }                  }
1234  #undef SSE2PSNR  #undef SSE2PSNR
1235                    }
1236    
1237                  if (m4v_size < 0)                  if (m4v_size < 0)
1238                          break;                          break;
# Line 1903  Line 1903 
1903                  xvid_enc_create.num_plugins++;                  xvid_enc_create.num_plugins++;
1904          }          }
1905    
1906  #ifndef WIN32          if (ARG_SSIM || ARG_SSIM_PATH != NULL) {
         if (ARG_SSIM) {  
1907                  plugins[xvid_enc_create.num_plugins].func = xvid_plugin_ssim;                  plugins[xvid_enc_create.num_plugins].func = xvid_plugin_ssim;
1908                  ssim.b_printstat = 1;                  ssim.b_printstat = ARG_SSIM;
1909                  ssim.stat_path = ARG_SSIM_PATH;                  ssim.stat_path = ARG_SSIM_PATH;
1910                  ssim.b_visualize = 0;                  ssim.b_visualize = 0;
1911                  plugins[xvid_enc_create.num_plugins].param = &ssim;                  plugins[xvid_enc_create.num_plugins].param = &ssim;
1912                  xvid_enc_create.num_plugins++;                  xvid_enc_create.num_plugins++;
1913          }          }
 #endif  
1914    
1915  #if 0  #if 0
1916          if (ARG_DEBUG) {          if (ARG_DEBUG) {

Legend:
Removed from v.1729  
changed lines
  Added in v.1739

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