[svn] / branches / release-1_3-branch / xvidcore / examples / xvid_encraw.c Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/examples/xvid_encraw.c

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

revision 1894, Sun Oct 10 19:24:24 2010 UTC revision 1913, Sat Dec 18 16:02:08 2010 UTC
# Line 22  Line 22 
22   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
23   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
24   *   *
25   * $Id: xvid_encraw.c,v 1.43 2010-10-10 19:20:03 Isibaar Exp $   * $Id: xvid_encraw.c,v 1.46 2010-12-18 16:02:08 Isibaar Exp $
26   *   *
27   ****************************************************************************/   ****************************************************************************/
28    
# Line 231  Line 231 
231  static  int ARG_TURBO = 0;  static  int ARG_TURBO = 0;
232  static  int ARG_VHQMODE = 1;  static  int ARG_VHQMODE = 1;
233  static  int ARG_BVHQ = 0;  static  int ARG_BVHQ = 0;
234    static  int ARG_QMETRIC = 0;
235  static  int ARG_CLOSED_GOP = 1;  static  int ARG_CLOSED_GOP = 1;
236  static  int ARG_CHROMAME = 1;  static  int ARG_CHROMAME = 1;
237  static  int ARG_PAR = 1;  static  int ARG_PAR = 1;
# Line 256  Line 257 
257  static  int ARG_VBVMAXRATE = 0;  static  int ARG_VBVMAXRATE = 0;
258  static  int ARG_VBVPEAKRATE = 0;  static  int ARG_VBVPEAKRATE = 0;
259  static  int ARG_THREADS = 0;  static  int ARG_THREADS = 0;
260    static  int ARG_SLICES = 1;
261  static  int ARG_VFR = 0;  static  int ARG_VFR = 0;
262  static  int ARG_PROGRESS = 0;  static  int ARG_PROGRESS = 0;
263  static  int ARG_COLORSPACE = XVID_CSP_YV12;  static  int ARG_COLORSPACE = XVID_CSP_YV12;
# Line 446  Line 448 
448                  } else if (strcmp("-threads", argv[i]) == 0 && i < argc -1) {                  } else if (strcmp("-threads", argv[i]) == 0 && i < argc -1) {
449                          i++;                          i++;
450                          ARG_THREADS = atoi(argv[i]);                          ARG_THREADS = atoi(argv[i]);
451                    } else if (strcmp("-slices", argv[i]) == 0 && i < argc -1) {
452                            i++;
453                            ARG_SLICES = atoi(argv[i]);
454                  } else if (strcmp("-bquant_ratio", argv[i]) == 0 && i < argc - 1) {                  } else if (strcmp("-bquant_ratio", argv[i]) == 0 && i < argc - 1) {
455                          i++;                          i++;
456                          ARG_BQRATIO = atoi(argv[i]);                          ARG_BQRATIO = atoi(argv[i]);
# Line 551  Line 556 
556                  } else if (strcmp("-vhqmode", argv[i]) == 0 && i < argc - 1) {                  } else if (strcmp("-vhqmode", argv[i]) == 0 && i < argc - 1) {
557                          i++;                          i++;
558                          ARG_VHQMODE = atoi(argv[i]);                          ARG_VHQMODE = atoi(argv[i]);
559                    } else if (strcmp("-metric", argv[i]) == 0 && i < argc - 1) {
560                            i++;
561                            ARG_QMETRIC = atoi(argv[i]);
562                  } else if (strcmp("-framerate", argv[i]) == 0 && i < argc - 1) {                  } else if (strcmp("-framerate", argv[i]) == 0 && i < argc - 1) {
563                          int exponent;                          int exponent;
564                          i++;                          i++;
# Line 700  Line 708 
708                          ARG_VBVMAXRATE = atoi(argv[i]);                          ARG_VBVMAXRATE = atoi(argv[i]);
709                  } else if (strcmp("-vbvpeak", argv[i]) == 0 && i < argc -1) {                  } else if (strcmp("-vbvpeak", argv[i]) == 0 && i < argc -1) {
710                          i++;                          i++;
711                          ARG_VBVPEAKRATE = atoi(argv[i])*3;                          ARG_VBVPEAKRATE = atoi(argv[i]);
712                  } else if (strcmp("-reaction", argv[i]) == 0 && i < argc -1) {                  } else if (strcmp("-reaction", argv[i]) == 0 && i < argc -1) {
713                          i++;                          i++;
714                          ARG_REACTION = atoi(argv[i]);                          ARG_REACTION = atoi(argv[i]);
# Line 1868  Line 1876 
1876          fprintf(stderr, " -quality integer               : quality ([0..%d]) (6)\n", ME_ELEMENTS - 1);          fprintf(stderr, " -quality integer               : quality ([0..%d]) (6)\n", ME_ELEMENTS - 1);
1877          fprintf(stderr, " -vhqmode integer               : level of R-D optimizations ([0..4]) (1)\n");          fprintf(stderr, " -vhqmode integer               : level of R-D optimizations ([0..4]) (1)\n");
1878          fprintf(stderr, " -bvhq                          : use R-D optimizations for B-frames\n");          fprintf(stderr, " -bvhq                          : use R-D optimizations for B-frames\n");
1879            fprintf(stderr, " -metric integer                : distortion metric for R-D opt (PSNR:0, PSNRHVSM: 1)\n");
1880          fprintf(stderr, " -qpel                          : use quarter pixel ME\n");          fprintf(stderr, " -qpel                          : use quarter pixel ME\n");
1881          fprintf(stderr, " -gmc                           : use global motion compensation\n");          fprintf(stderr, " -gmc                           : use global motion compensation\n");
1882          fprintf(stderr, " -qtype   integer               : quantization type (H263:0, MPEG4:1) (0)\n");          fprintf(stderr, " -qtype   integer               : quantization type (H263:0, MPEG4:1) (0)\n");
# Line 1879  Line 1888 
1888          fprintf(stderr, " -stats                         : print stats about encoded frames\n");          fprintf(stderr, " -stats                         : print stats about encoded frames\n");
1889          fprintf(stderr, " -ssim [integer]                : prints ssim for every frame (accurate: 0 fast: 4) (2)\n");          fprintf(stderr, " -ssim [integer]                : prints ssim for every frame (accurate: 0 fast: 4) (2)\n");
1890          fprintf(stderr, " -ssim_file filename            : outputs the ssim stats into a file\n");          fprintf(stderr, " -ssim_file filename            : outputs the ssim stats into a file\n");
1891          fprintf(stderr, " -psnrhvsm                      : prints psnr-hvs-m metric for every frame\n");          fprintf(stderr, " -psnrhvsm                      : prints PSNRHVSM metric for every frame\n");
1892          fprintf(stderr, " -debug                         : activates xvidcore internal debugging output\n");          fprintf(stderr, " -debug                         : activates xvidcore internal debugging output\n");
1893          fprintf(stderr, " -vop_debug                     : print some info directly into encoded frames\n");          fprintf(stderr, " -vop_debug                     : print some info directly into encoded frames\n");
1894          fprintf(stderr, " -nochromame                    : Disable chroma motion estimation\n");          fprintf(stderr, " -nochromame                    : Disable chroma motion estimation\n");
# Line 1893  Line 1902 
1902          fprintf(stderr, " -drop    integer               : Frame Drop Ratio (0..100) (0)\n");          fprintf(stderr, " -drop    integer               : Frame Drop Ratio (0..100) (0)\n");
1903          fprintf(stderr, " -start   integer               : Starting frame number\n");          fprintf(stderr, " -start   integer               : Starting frame number\n");
1904          fprintf(stderr, " -threads integer               : Number of threads\n");          fprintf(stderr, " -threads integer               : Number of threads\n");
1905            fprintf(stderr, " -slices  integer               : Number of slices\n");
1906          fprintf(stderr, " -progress [integer]            : Show progress updates every n frames (10)\n");          fprintf(stderr, " -progress [integer]            : Show progress updates every n frames (10)\n");
1907          fprintf(stderr, " -par     integer[:integer]     : Set Pixel Aspect Ratio.\n");          fprintf(stderr, " -par     integer[:integer]     : Set Pixel Aspect Ratio.\n");
1908          fprintf(stderr, "                                  1 = 1:1\n");          fprintf(stderr, "                                  1 = 1:1\n");
# Line 2178  Line 2188 
2188                  rc2pass2.vbv_size     =  ARG_VBVSIZE;                  rc2pass2.vbv_size     =  ARG_VBVSIZE;
2189                  rc2pass2.vbv_initial  =  (ARG_VBVSIZE*3)/4;                  rc2pass2.vbv_initial  =  (ARG_VBVSIZE*3)/4;
2190                  rc2pass2.vbv_maxrate  =  ARG_VBVMAXRATE;                  rc2pass2.vbv_maxrate  =  ARG_VBVMAXRATE;
2191                  rc2pass2.vbv_peakrate =  ARG_VBVPEAKRATE*3;                  rc2pass2.vbv_peakrate =  ARG_VBVPEAKRATE;
2192    
2193    
2194                  plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2;                  plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2;
# Line 2260  Line 2270 
2270  #endif  #endif
2271    
2272          xvid_enc_create.num_threads = ARG_THREADS;          xvid_enc_create.num_threads = ARG_THREADS;
2273            xvid_enc_create.num_slices  = ARG_SLICES;
2274    
2275          /* Frame rate  */          /* Frame rate  */
2276          xvid_enc_create.fincr = ARG_DWSCALE;          xvid_enc_create.fincr = ARG_DWSCALE;
# Line 2482  Line 2493 
2493          if (ARG_BVHQ)          if (ARG_BVHQ)
2494                  xvid_enc_frame.vop_flags |= XVID_VOP_RD_BVOP;                  xvid_enc_frame.vop_flags |= XVID_VOP_RD_BVOP;
2495    
2496            if (ARG_QMETRIC == 1)
2497                    xvid_enc_frame.vop_flags |= XVID_VOP_RD_PSNRHVSM;
2498    
2499          switch (ARG_VHQMODE) /* this is the same code as for vfw */          switch (ARG_VHQMODE) /* this is the same code as for vfw */
2500          {          {
2501          case 1: /* VHQ_MODE_DECISION */          case 1: /* VHQ_MODE_DECISION */

Legend:
Removed from v.1894  
changed lines
  Added in v.1913

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