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.29 2006-10-13 09:28:46 Skal Exp $ |
* $Id: xvid_encraw.c,v 1.31 2006-10-16 04:46:01 Skal Exp $ |
25 |
* |
* |
26 |
****************************************************************************/ |
****************************************************************************/ |
27 |
|
|
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, |
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 { |
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; |
1903 |
xvid_enc_create.num_plugins++; |
xvid_enc_create.num_plugins++; |
1904 |
} |
} |
1905 |
|
|
1906 |
if (ARG_SSIM) { |
if (ARG_SSIM || ARG_SSIM_PATH != NULL) { |
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; |