19 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
20 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 |
* |
* |
22 |
* $Id: xvid_encraw.c,v 1.11.2.6 2003-03-15 14:32:56 suxen_drol Exp $ |
* $Id: xvid_encraw.c,v 1.11.2.7 2003-03-15 16:41:32 suxen_drol Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
423 |
} |
} |
424 |
|
|
425 |
printf(" | type=%s quant=%2d, length=%7d", type, stats_quant, stats_length); |
printf(" | type=%s quant=%2d, length=%7d", type, stats_quant, stats_length); |
426 |
|
|
427 |
|
if(ARG_STATS) { |
428 |
|
printf(", psnr y = %2.2f, psnr u = %2.2f, psnr v = %2.2f", |
429 |
|
(stats[0] == 0)? 0.0f: 48.131f - 10*(float)log10((float)stats[0]/((float)(XDIM)*(YDIM))), |
430 |
|
(stats[1] == 0)? 0.0f: 48.131f - 10*(float)log10((float)stats[1]/((float)(XDIM)*(YDIM)/4)), |
431 |
|
(stats[2] == 0)? 0.0f: 48.131f - 10*(float)log10((float)stats[2]/((float)(XDIM)*(YDIM)/4))); |
432 |
|
} |
433 |
|
|
434 |
} |
} |
435 |
|
|
436 |
printf("\n"); |
printf("\n"); |
564 |
fprintf(stderr, " -t integer : input data type (yuv=0, pgm=1)\n"); |
fprintf(stderr, " -t integer : input data type (yuv=0, pgm=1)\n"); |
565 |
fprintf(stderr, " -n integer : number of frames to encode\n"); |
fprintf(stderr, " -n integer : number of frames to encode\n"); |
566 |
fprintf(stderr, " -q integer : quality ([0..5])\n"); |
fprintf(stderr, " -q integer : quality ([0..5])\n"); |
567 |
fprintf(stderr, " -d boolean : save decoder output (0 False*, !=0 True)\n"); |
fprintf(stderr, " -dump : save decoder output\n"); |
568 |
fprintf(stderr, " -m : save mpeg4 raw stream\n"); |
fprintf(stderr, " -m : save mpeg4 raw stream\n"); |
569 |
fprintf(stderr, " -o string : output container filename (only usefull when -m 1 is used) :\n"); |
fprintf(stderr, " -o string : output container filename (only usefull when -m 1 is used) :\n"); |
570 |
fprintf(stderr, " When this option is not used : one file per encoded frame\n"); |
fprintf(stderr, " When this option is not used : one file per encoded frame\n"); |
683 |
{ |
{ |
684 |
int xerr; |
int xerr; |
685 |
|
|
686 |
xvid_enc_plugin_t plugins[2]; |
xvid_enc_plugin_t plugins[1]; |
687 |
|
|
688 |
xvid_gbl_init_t xvid_gbl_init; |
xvid_gbl_init_t xvid_gbl_init; |
689 |
xvid_enc_create_t xvid_enc_create; |
xvid_enc_create_t xvid_enc_create; |
729 |
|
|
730 |
xvid_enc_create.plugins = plugins; |
xvid_enc_create.plugins = plugins; |
731 |
xvid_enc_create.num_plugins = 0; |
xvid_enc_create.num_plugins = 0; |
|
if (ARG_STATS) { |
|
|
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_psnr; |
|
|
plugins[xvid_enc_create.num_plugins].param = NULL; |
|
|
xvid_enc_create.num_plugins++; |
|
|
} |
|
732 |
if (ARG_DUMP) { |
if (ARG_DUMP) { |
733 |
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_dump; |
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_dump; |
734 |
plugins[xvid_enc_create.num_plugins].param = NULL; |
plugins[xvid_enc_create.num_plugins].param = NULL; |
761 |
/* Global encoder options */ |
/* Global encoder options */ |
762 |
xvid_enc_create.global = 0; |
xvid_enc_create.global = 0; |
763 |
if (ARG_PACKED) xvid_enc_create.global |= XVID_PACKED; |
if (ARG_PACKED) xvid_enc_create.global |= XVID_PACKED; |
764 |
|
if (ARG_STATS) xvid_enc_create.global |= XVID_EXTRASTATS_ENABLE; |
765 |
|
|
766 |
/* I use a small value here, since will not encode whole movies, but short clips */ |
/* I use a small value here, since will not encode whole movies, but short clips */ |
767 |
xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL); |
xerr = xvid_encore(NULL, XVID_ENC_CREATE, &xvid_enc_create, NULL); |
817 |
|
|
818 |
/* Set up core's general features */ |
/* Set up core's general features */ |
819 |
xvid_enc_frame.vol_flags = vol_presets[ARG_QUALITY]; |
xvid_enc_frame.vol_flags = vol_presets[ARG_QUALITY]; |
820 |
|
if (ARG_STATS) xvid_enc_frame.vol_flags |= XVID_EXTRASTATS; |
821 |
|
|
822 |
/* Set up core's general features */ |
/* Set up core's general features */ |
823 |
xvid_enc_frame.vop_flags = vop_presets[ARG_QUALITY]; |
xvid_enc_frame.vop_flags = vop_presets[ARG_QUALITY]; |