--- trunk/xvidcore/examples/xvid_encraw.c 2004/04/02 21:29:21 1398 +++ trunk/xvidcore/examples/xvid_encraw.c 2005/07/05 20:39:52 1623 @@ -21,7 +21,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: xvid_encraw.c,v 1.14 2004-04-02 21:29:21 edgomez Exp $ + * $Id: xvid_encraw.c,v 1.18 2005-07-05 20:39:52 chl Exp $ * ****************************************************************************/ @@ -151,7 +151,9 @@ static int ARG_PACKED = 0; static int ARG_DEBUG = 0; static int ARG_VOPDEBUG = 0; +static int ARG_GREYSCALE = 0; static int ARG_GMC = 0; +static int ARG_INTERLACING = 0; static int ARG_QPEL = 0; static int ARG_CLOSED_GOP = 0; @@ -237,7 +239,7 @@ int stats_type; int stats_quant; int stats_length; - int use_assembler = 0; + int use_assembler = 1; // this default changed! int input_num; int output_num; @@ -264,6 +266,8 @@ if (strcmp("-asm", argv[i]) == 0) { use_assembler = 1; + } else if (strcmp("-noasm", argv[i]) == 0) { + use_assembler = 0; } else if (strcmp("-w", argv[i]) == 0 && i < argc - 1) { i++; XDIM = atoi(argv[i]); @@ -343,10 +347,16 @@ ARG_OUTPUTFILE = argv[i]; } else if (strcmp("-vop_debug", argv[i]) == 0) { ARG_VOPDEBUG = 1; - } else if (strcmp("-qpel", argv[i]) == 0) { + } + else if (strcmp("-grey", argv[i]) == 0) { + ARG_GREYSCALE = 1; + } + else if (strcmp("-qpel", argv[i]) == 0) { ARG_QPEL = 1; } else if (strcmp("-gmc", argv[i]) == 0) { ARG_GMC = 1; + } else if (strcmp("-interlaced", argv[i]) == 0) { + ARG_INTERLACING = 1; } else if (strcmp("-closed_gop", argv[i]) == 0) { ARG_CLOSED_GOP = 1; } else if (strcmp("-help", argv[i])) { @@ -693,11 +703,14 @@ fprintf(stderr, "\n"); fprintf(stderr, "Other options\n"); fprintf(stderr, " -asm : use assembly optmized code\n"); + fprintf(stderr, " -noasm : do not use assembly optmized code\n"); fprintf(stderr, " -quality integer: quality ([0..%d])\n", ME_ELEMENTS - 1); fprintf(stderr, " -qpel : use quarter pixel ME\n"); fprintf(stderr, " -gmc : use global motion compensation\n"); + fprintf(stderr, " -interlaced : use interlaced encoding (this is NOT a deinterlacer!)\n"); fprintf(stderr, " -packed : packed mode\n"); fprintf(stderr, " -closed_gop : closed GOP mode\n"); + fprintf(stderr, " -grey : grey scale coding (chroma is discarded)\n"); fprintf(stderr, " -lumimasking : use lumimasking algorithm\n"); fprintf(stderr, " -stats : print stats about encoded frames\n"); fprintf(stderr, " -debug : activates xvidcore internal debugging output\n"); @@ -950,6 +963,13 @@ rc2pass2.filename = ARG_PASS2; rc2pass2.bitrate = ARG_BITRATE; +/* An example of activating VBV could look like this + rc2pass2.vbv_size = 3145728; + rc2pass2.vbv_initial = 2359296; + rc2pass2.vbv_maxrate = 4000000; + rc2pass2.vbv_peakrate = 10000000; +*/ + plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2; plugins[xvid_enc_create.num_plugins].param = &rc2pass2; xvid_enc_create.num_plugins++; @@ -1091,6 +1111,8 @@ xvid_enc_frame.vol_flags |= XVID_VOL_QUARTERPEL; if (ARG_GMC) xvid_enc_frame.vol_flags |= XVID_VOL_GMC; + if (ARG_INTERLACING) + xvid_enc_frame.vol_flags |= XVID_VOL_INTERLACING; /* Set up core's general features */ xvid_enc_frame.vop_flags = vop_presets[ARG_QUALITY]; @@ -1099,6 +1121,10 @@ xvid_enc_frame.vop_flags |= XVID_VOP_DEBUG; } + if (ARG_GREYSCALE) { + xvid_enc_frame.vop_flags |= XVID_VOP_GREYSCALE; + } + /* Frame type -- let core decide for us */ xvid_enc_frame.type = XVID_TYPE_AUTO;