--- trunk/xvidcore/examples/xvid_encraw.c 2004/06/10 18:13:42 1470 +++ trunk/xvidcore/examples/xvid_encraw.c 2005/06/22 06:18:14 1622 @@ -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.15 2004-06-10 18:13:42 chl Exp $ + * $Id: xvid_encraw.c,v 1.17 2005-06-22 06:18:14 Skal 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; @@ -343,10 +345,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])) { @@ -696,8 +704,10 @@ 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"); @@ -1098,6 +1108,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]; @@ -1106,6 +1118,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;