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; |
552 |
} else if (strcmp("-vhqmode", argv[i]) == 0 && i < argc - 1) { |
} else if (strcmp("-vhqmode", argv[i]) == 0 && i < argc - 1) { |
553 |
i++; |
i++; |
554 |
ARG_VHQMODE = atoi(argv[i]); |
ARG_VHQMODE = atoi(argv[i]); |
555 |
|
} else if (strcmp("-metric", argv[i]) == 0 && i < argc - 1) { |
556 |
|
i++; |
557 |
|
ARG_QMETRIC = atoi(argv[i]); |
558 |
} else if (strcmp("-framerate", argv[i]) == 0 && i < argc - 1) { |
} else if (strcmp("-framerate", argv[i]) == 0 && i < argc - 1) { |
559 |
int exponent; |
int exponent; |
560 |
i++; |
i++; |
704 |
ARG_VBVMAXRATE = atoi(argv[i]); |
ARG_VBVMAXRATE = atoi(argv[i]); |
705 |
} else if (strcmp("-vbvpeak", argv[i]) == 0 && i < argc -1) { |
} else if (strcmp("-vbvpeak", argv[i]) == 0 && i < argc -1) { |
706 |
i++; |
i++; |
707 |
ARG_VBVPEAKRATE = atoi(argv[i])*3; |
ARG_VBVPEAKRATE = atoi(argv[i]); |
708 |
} else if (strcmp("-reaction", argv[i]) == 0 && i < argc -1) { |
} else if (strcmp("-reaction", argv[i]) == 0 && i < argc -1) { |
709 |
i++; |
i++; |
710 |
ARG_REACTION = atoi(argv[i]); |
ARG_REACTION = atoi(argv[i]); |
1872 |
fprintf(stderr, " -quality integer : quality ([0..%d]) (6)\n", ME_ELEMENTS - 1); |
fprintf(stderr, " -quality integer : quality ([0..%d]) (6)\n", ME_ELEMENTS - 1); |
1873 |
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"); |
1874 |
fprintf(stderr, " -bvhq : use R-D optimizations for B-frames\n"); |
fprintf(stderr, " -bvhq : use R-D optimizations for B-frames\n"); |
1875 |
|
fprintf(stderr, " -metric integer : distortion metric for R-D opt (PSNR:0, PSNRHVSM: 1)\n"); |
1876 |
fprintf(stderr, " -qpel : use quarter pixel ME\n"); |
fprintf(stderr, " -qpel : use quarter pixel ME\n"); |
1877 |
fprintf(stderr, " -gmc : use global motion compensation\n"); |
fprintf(stderr, " -gmc : use global motion compensation\n"); |
1878 |
fprintf(stderr, " -qtype integer : quantization type (H263:0, MPEG4:1) (0)\n"); |
fprintf(stderr, " -qtype integer : quantization type (H263:0, MPEG4:1) (0)\n"); |
1884 |
fprintf(stderr, " -stats : print stats about encoded frames\n"); |
fprintf(stderr, " -stats : print stats about encoded frames\n"); |
1885 |
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"); |
1886 |
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"); |
1887 |
fprintf(stderr, " -psnrhvsm : prints psnr-hvs-m metric for every frame\n"); |
fprintf(stderr, " -psnrhvsm : prints PSNRHVSM metric for every frame\n"); |
1888 |
fprintf(stderr, " -debug : activates xvidcore internal debugging output\n"); |
fprintf(stderr, " -debug : activates xvidcore internal debugging output\n"); |
1889 |
fprintf(stderr, " -vop_debug : print some info directly into encoded frames\n"); |
fprintf(stderr, " -vop_debug : print some info directly into encoded frames\n"); |
1890 |
fprintf(stderr, " -nochromame : Disable chroma motion estimation\n"); |
fprintf(stderr, " -nochromame : Disable chroma motion estimation\n"); |
2183 |
rc2pass2.vbv_size = ARG_VBVSIZE; |
rc2pass2.vbv_size = ARG_VBVSIZE; |
2184 |
rc2pass2.vbv_initial = (ARG_VBVSIZE*3)/4; |
rc2pass2.vbv_initial = (ARG_VBVSIZE*3)/4; |
2185 |
rc2pass2.vbv_maxrate = ARG_VBVMAXRATE; |
rc2pass2.vbv_maxrate = ARG_VBVMAXRATE; |
2186 |
rc2pass2.vbv_peakrate = ARG_VBVPEAKRATE*3; |
rc2pass2.vbv_peakrate = ARG_VBVPEAKRATE; |
2187 |
|
|
2188 |
|
|
2189 |
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2; |
plugins[xvid_enc_create.num_plugins].func = xvid_plugin_2pass2; |
2487 |
if (ARG_BVHQ) |
if (ARG_BVHQ) |
2488 |
xvid_enc_frame.vop_flags |= XVID_VOP_RD_BVOP; |
xvid_enc_frame.vop_flags |= XVID_VOP_RD_BVOP; |
2489 |
|
|
2490 |
|
if (ARG_QMETRIC == 1) |
2491 |
|
xvid_enc_frame.vop_flags |= XVID_VOP_RD_PSNRHVSM; |
2492 |
|
|
2493 |
switch (ARG_VHQMODE) /* this is the same code as for vfw */ |
switch (ARG_VHQMODE) /* this is the same code as for vfw */ |
2494 |
{ |
{ |
2495 |
case 1: /* VHQ_MODE_DECISION */ |
case 1: /* VHQ_MODE_DECISION */ |