[svn] / trunk / xvidcore / examples / xvid_encraw.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/examples/xvid_encraw.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1622, Wed Jun 22 06:18:14 2005 UTC revision 1624, Tue Jul 5 20:55:12 2005 UTC
# Line 21  Line 21 
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.17 2005-06-22 06:18:14 Skal Exp $   * $Id: xvid_encraw.c,v 1.19 2005-07-05 20:55:12 chl Exp $
25   *   *
26   ****************************************************************************/   ****************************************************************************/
27    
# Line 155  Line 155 
155  static int ARG_GMC = 0;  static int ARG_GMC = 0;
156  static int ARG_INTERLACING = 0;  static int ARG_INTERLACING = 0;
157  static int ARG_QPEL = 0;  static int ARG_QPEL = 0;
158    static int ARG_VHQMODE = 0;
159  static int ARG_CLOSED_GOP = 0;  static int ARG_CLOSED_GOP = 0;
160    
161  #ifndef READ_PNM  #ifndef READ_PNM
# Line 239  Line 240 
240          int stats_type;          int stats_type;
241          int stats_quant;          int stats_quant;
242          int stats_length;          int stats_length;
243          int use_assembler = 0;          int use_assembler = 1;  // this default changed!
244    
245          int input_num;          int input_num;
246          int output_num;          int output_num;
# Line 266  Line 267 
267    
268                  if (strcmp("-asm", argv[i]) == 0) {                  if (strcmp("-asm", argv[i]) == 0) {
269                          use_assembler = 1;                          use_assembler = 1;
270                    } else if (strcmp("-noasm", argv[i]) == 0) {
271                            use_assembler = 0;
272                  } else if (strcmp("-w", argv[i]) == 0 && i < argc - 1) {                  } else if (strcmp("-w", argv[i]) == 0 && i < argc - 1) {
273                          i++;                          i++;
274                          XDIM = atoi(argv[i]);                          XDIM = atoi(argv[i]);
# Line 312  Line 315 
315                  } else if (strcmp("-quality", argv[i]) == 0 && i < argc - 1) {                  } else if (strcmp("-quality", argv[i]) == 0 && i < argc - 1) {
316                          i++;                          i++;
317                          ARG_QUALITY = atoi(argv[i]);                          ARG_QUALITY = atoi(argv[i]);
318                    } else if (strcmp("-vhqmode", argv[i]) == 0 && i < argc - 1) {
319                            i++;
320                            ARG_VHQMODE = atoi(argv[i]);
321                  } else if (strcmp("-framerate", argv[i]) == 0 && i < argc - 1) {                  } else if (strcmp("-framerate", argv[i]) == 0 && i < argc - 1) {
322                          i++;                          i++;
323                          ARG_FRAMERATE = (float) atof(argv[i]);                          ARG_FRAMERATE = (float) atof(argv[i]);
# Line 701  Line 707 
707      fprintf(stderr, "\n");      fprintf(stderr, "\n");
708          fprintf(stderr, "Other options\n");          fprintf(stderr, "Other options\n");
709          fprintf(stderr, " -asm            : use assembly optmized code\n");          fprintf(stderr, " -asm            : use assembly optmized code\n");
710            fprintf(stderr, " -noasm            : do not use assembly optmized code\n");
711          fprintf(stderr, " -quality integer: quality ([0..%d])\n", ME_ELEMENTS - 1);          fprintf(stderr, " -quality integer: quality ([0..%d])\n", ME_ELEMENTS - 1);
712            fprintf(stderr, " -vhqmode integer: level of Rate-Distorsion optimizations ([0..4]) (default=0)\n");
713          fprintf(stderr, " -qpel           : use quarter pixel ME\n");          fprintf(stderr, " -qpel           : use quarter pixel ME\n");
714          fprintf(stderr, " -gmc            : use global motion compensation\n");          fprintf(stderr, " -gmc            : use global motion compensation\n");
715          fprintf(stderr, " -interlaced     : use interlaced encoding (this is NOT a deinterlacer!)\n");          fprintf(stderr, " -interlaced     : use interlaced encoding (this is NOT a deinterlacer!)\n");
# Line 1139  Line 1147 
1147          if (ARG_QPEL && (xvid_enc_frame.vop_flags & XVID_VOP_INTER4V))          if (ARG_QPEL && (xvid_enc_frame.vop_flags & XVID_VOP_INTER4V))
1148                  xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE8;                  xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE8;
1149    
1150            switch (ARG_VHQMODE) /* this is the same code as for vfw */
1151            {
1152            case 1: /* VHQ_MODE_DECISION */
1153                    xvid_enc_frame.vop_flags |= XVID_VOP_MODEDECISION_RD;
1154                    break;
1155    
1156            case 2: /* VHQ_LIMITED_SEARCH */
1157                    xvid_enc_frame.vop_flags |= XVID_VOP_MODEDECISION_RD;
1158                    xvid_enc_frame.motion |= XVID_ME_HALFPELREFINE16_RD;
1159                    xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE16_RD;
1160                    break;
1161    
1162            case 3: /* VHQ_MEDIUM_SEARCH */
1163                    xvid_enc_frame.vop_flags |= XVID_VOP_MODEDECISION_RD;
1164                    xvid_enc_frame.motion |= XVID_ME_HALFPELREFINE16_RD;
1165                    xvid_enc_frame.motion |= XVID_ME_HALFPELREFINE8_RD;
1166                    xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE16_RD;
1167                    xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE8_RD;
1168                    xvid_enc_frame.motion |= XVID_ME_CHECKPREDICTION_RD;
1169                    break;
1170    
1171            case 4: /* VHQ_WIDE_SEARCH */
1172                    xvid_enc_frame.vop_flags |= XVID_VOP_MODEDECISION_RD;
1173                    xvid_enc_frame.motion |= XVID_ME_HALFPELREFINE16_RD;
1174                    xvid_enc_frame.motion |= XVID_ME_HALFPELREFINE8_RD;
1175                    xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE16_RD;
1176                    xvid_enc_frame.motion |= XVID_ME_QUARTERPELREFINE8_RD;
1177                    xvid_enc_frame.motion |= XVID_ME_CHECKPREDICTION_RD;
1178                    xvid_enc_frame.motion |= XVID_ME_EXTSEARCH_RD;
1179                    break;
1180    
1181            default :
1182                    break;
1183            }
1184    
1185          /* We don't use special matrices */          /* We don't use special matrices */
1186          xvid_enc_frame.quant_intra_matrix = NULL;          xvid_enc_frame.quant_intra_matrix = NULL;
1187          xvid_enc_frame.quant_inter_matrix = NULL;          xvid_enc_frame.quant_inter_matrix = NULL;

Legend:
Removed from v.1622  
changed lines
  Added in v.1624

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4