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.14 2003-03-26 14:56:09 edgomez Exp $ |
* $Id: xvid_encraw.c,v 1.11.2.15 2003-04-08 14:01:35 suxen_drol Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
94 |
static int ARG_BITRATE = 0; |
static int ARG_BITRATE = 0; |
95 |
static char *ARG_PASS1 = 0; |
static char *ARG_PASS1 = 0; |
96 |
static char *ARG_PASS2 = 0; |
static char *ARG_PASS2 = 0; |
97 |
|
static int ARG_PASS2_BITRATE = 0; |
98 |
static float ARG_QUANTI = 0.0f; |
static float ARG_QUANTI = 0.0f; |
99 |
static int ARG_QUALITY = 5; |
static int ARG_QUALITY = 5; |
100 |
static float ARG_FRAMERATE = 25.00f; |
static float ARG_FRAMERATE = 25.00f; |
217 |
ARG_PASS1 = argv[i]; |
ARG_PASS1 = argv[i]; |
218 |
} else if (strcmp("-pass2", argv[i]) == 0 && i < argc - 2) { |
} else if (strcmp("-pass2", argv[i]) == 0 && i < argc - 2) { |
219 |
i++; |
i++; |
|
ARG_PASS1 = argv[i]; |
|
|
i++; |
|
220 |
ARG_PASS2 = argv[i]; |
ARG_PASS2 = argv[i]; |
221 |
|
i++; |
222 |
|
ARG_PASS2_BITRATE = atoi(argv[i]); |
223 |
} else if (strcmp("-max_bframes", argv[i]) == 0 && i < argc - 1) { |
} else if (strcmp("-max_bframes", argv[i]) == 0 && i < argc - 1) { |
224 |
i++; |
i++; |
225 |
ARG_MAXBFRAMES = atoi(argv[i]); |
ARG_MAXBFRAMES = atoi(argv[i]); |
574 |
fprintf(stderr, " -framerate float : target framerate (>0 | default=25.0)\n"); |
fprintf(stderr, " -framerate float : target framerate (>0 | default=25.0)\n"); |
575 |
fprintf(stderr, " -bitrate integer : bitrate -- for CBR/VBR pass2\n"); |
fprintf(stderr, " -bitrate integer : bitrate -- for CBR/VBR pass2\n"); |
576 |
fprintf(stderr, " -quant float : quantizer -- for \"Fixed\" quantizer RC\n"); |
fprintf(stderr, " -quant float : quantizer -- for \"Fixed\" quantizer RC\n"); |
577 |
fprintf(stderr, " -pass1 filename : stats filename\n"); |
fprintf(stderr, " -pass1 filename : output stats filename\n"); |
578 |
fprintf(stderr, " -pass2 filename1 filename2 : first pass stats and scaled stats filename\n"); |
fprintf(stderr, " -pass2 filename bitrate : input stats filename, target bitrate\n"); |
579 |
fprintf(stderr, "\n"); |
fprintf(stderr, "\n"); |
580 |
fprintf(stderr, "Other options\n"); |
fprintf(stderr, "Other options\n"); |
581 |
fprintf(stderr, " -asm : use assembly optmized code\n"); |
fprintf(stderr, " -asm : use assembly optmized code\n"); |
788 |
xvid_enc_create.num_plugins++; |
xvid_enc_create.num_plugins++; |
789 |
} |
} |
790 |
|
|
791 |
if (ARG_PASS1 && ARG_PASS2) { |
if (ARG_PASS2) { |
792 |
rc2pass2.version = XVID_VERSION; |
rc2pass2.version = XVID_VERSION; |
793 |
memset(&rc2pass2, 0, sizeof(xvid_plugin_2pass2_t)); |
memset(&rc2pass2, 0, sizeof(xvid_plugin_2pass2_t)); |
794 |
rc2pass2.filename1 = ARG_PASS1; |
rc2pass2.filename = ARG_PASS2; |
795 |
rc2pass2.filename2 = ARG_PASS2; |
rc2pass2.bitrate = ARG_PASS2_BITRATE; |
796 |
|
|
797 |
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2; |
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2; |
798 |
plugins[xvid_enc_create.num_plugins].param = &rc2pass2; |
plugins[xvid_enc_create.num_plugins].param = &rc2pass2; |
799 |
xvid_enc_create.num_plugins++; |
xvid_enc_create.num_plugins++; |
800 |
} else if (ARG_PASS1) { |
} |
801 |
|
|
802 |
|
if (ARG_PASS1) { |
803 |
rc2pass1.version = XVID_VERSION; |
rc2pass1.version = XVID_VERSION; |
804 |
memset(&rc2pass1, 0, sizeof(xvid_plugin_2pass1_t)); |
memset(&rc2pass1, 0, sizeof(xvid_plugin_2pass1_t)); |
805 |
rc2pass1.filename = ARG_PASS1; |
rc2pass1.filename = ARG_PASS1; |