better default parameter,added counterpart option, better names for few options, 3-pass support and improved documentation.

patch by Loren Merritt


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13497 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
iive 2004-09-27 21:04:42 +00:00
parent 189a46b6a5
commit ab6b2a7c5d
2 changed files with 54 additions and 46 deletions

View File

@ -6770,20 +6770,13 @@ Sets the bitrate to be used in kbits/\:second (default: off).
This is required if you want a CBR (constant bitrate) encode.
.
.TP
.B iframe=<value>
.B keyint=<value>
Sets maximum interval between I frames.
Larger values save bits, thus improve quality, at the cost of seeking
precision (default: 60).
precision (default: 250).
.
.TP
.B frameref=<1\-15>
Number of previous frames used as predictors in a P frame (default: 1).
This is effective in Anime, but seems to make little difference in
live-action source material.
Some decoders are unable to deal with large frameref values.
.
.TP
.B idrframe=<value>
.B idrint=<value>
Each <value> I-Frames are IDR-Frames (default: 2).
In H.264, I-Frames do not necessarily bound a closed GOP because it is
allowable for a P-frame to be predicted from more frames than just the one
@ -6793,11 +6786,18 @@ IDR-Frames restrict subsequent P-frames from referring to any frame
prior to the IDR-Frame.
.
.TP
.B bframe=<value>
number of B-Frames between I- and P-Frames (default: 0)
.B frameref=<1\-15>
Number of previous frames used as predictors in a P frame (default: 1).
This is effective in Anime, but seems to make little difference in
live-action source material.
Some decoders are unable to deal with large frameref values.
.
.TP
.B deblock=<0|1>
.B bframes=<0\-16>
number of consecutive B-Frames between I- and P-Frames (default: 0)
.
.TP
.B deblock | nodeblock
Use deblocking filter (default: on).
As it takes very little time compared to its quality gain, it's not
recommend to disable it.
@ -6824,10 +6824,10 @@ Beta parameter of deblocking filter (default: 0).
Affects the maximum allowed gradient within two adjacent blocks.
.
.TP
.B cabac\ \ \
Use CABAC (Context-Adaptive Binary Arithmetic Coding).
Slows down encoding but should save 10-15% of the bits.
Unless you are looking for speed, you should activate it.
.B cabac | nocabac
Use CABAC (Context-Adaptive Binary Arithmetic Coding) (default: on).
Slightly slows down encoding and decoding, but should save 10-15% bitrate.
Unless you are looking for speed, you should not disable it.
.
.TP
.B cabacidc=<value>
@ -6847,7 +6847,7 @@ directly affect distortion.
.REss
.
.TP
.B qp_constant=<2\-51>
.B qp_constant=<1\-51>
This selects the quantizer to use.
20\-40 is a useful range (default: 26).
Lower values result in better fidelity, but higher bitrates.
@ -6858,11 +6858,11 @@ is about a factor of 10.
Useful quantizers in H.264 tend to be very large compared to MPEG[124].
.
.TP
.B qp_min=<2\-51> (CBR only)
.B qp_min=<1\-51> (CBR or 2 pass)
Minimum quantizer, 15\-35 seems to be a useful range (default: 10).
.
.TP
.B qp_max=<2\-51> (CBR only)
.B qp_max=<1\-51> (CBR or 2 pass)
maximum quantizer (default: 51)
.
.TP
@ -6912,7 +6912,7 @@ Lower values allow the quantizer value to jump around more,
higher values force it to vary more smoothly.
.
.TP
.B fullinter
.B fullinter | nofullinter
Use all available interframe macroblock types (i16x16, i4x4, p16x16-4x4)
The idea is to find the type and size that best describe a certain area
of the picture, i.e.\& very effective for Anime, which usually contains
@ -6921,22 +6921,6 @@ Depending on the source material, it can improve or degrade quality, use
it with care.
.
.TP
.B log=<-1\-3>
Adjust the amount of logging info printed to the screen.
.RSs
-1: none
.br
0: Print errors only.
.br
1: warnings
.br
2: PSNR, encoding times, and other analysis stats when the encode finishes
(default)
.br
3: PSNR, QP, frametype, size, and other stats for every frame
.REss
.
.TP
.B subq=<0\-5>
Adjust subpel refinement quality.
This parameter controls quality versus speed tradeoffs involved in the motion
@ -6957,8 +6941,24 @@ It can improve quality significantly.
.REss
.
.TP
.B psnr\ \ \
Print signal-to-noise ratio statistics.
.B log=<-1\-3>
Adjust the amount of logging info printed to the screen.
.RSs
-1: none
.br
0: Print errors only.
.br
1: warnings
.br
2: PSNR, encoding times, and other analysis stats when the encode finishes
(default)
.br
3: PSNR, QP, frametype, size, and other stats for every frame
.REss
.
.TP
.B psnr | nopsnr
Print signal-to-noise ratio statistics (default: off).
.
.
.\" --------------------------------------------------------------------------

View File

@ -61,13 +61,13 @@ extern char* passtmpfile;
static int bitrate = -1;
static int qp_constant = 26;
static int frame_ref = 1;
static int iframe = 60;
static int iframe = 250;
static int idrframe = 2;
static int bframe = 0;
static int deblock = 1;
static int deblockalpha = 0;
static int deblockbeta = 0;
static int cabac = 0;
static int cabac = 1;
static int cabacidc = -1;
static int fullinter = 0;
static float ip_factor = 2.0;
@ -89,16 +89,19 @@ static int log_level = 2;
m_option_t x264encopts_conf[] = {
{"bitrate", &bitrate, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
{"qp_constant", &qp_constant, CONF_TYPE_INT, CONF_RANGE, 1, 51, NULL},
{"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 100, NULL},
{"iframe", &iframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
{"idrframe", &idrframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
{"bframe", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 10, NULL},
{"deblock", &deblock, CONF_TYPE_INT, CONF_RANGE, 0, 1, NULL},
{"frameref", &frame_ref, CONF_TYPE_INT, CONF_RANGE, 1, 15, NULL},
{"keyint", &iframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
{"idrint", &idrframe, CONF_TYPE_INT, CONF_RANGE, 1, 24000000, NULL},
{"bframes", &bframe, CONF_TYPE_INT, CONF_RANGE, 0, 16, NULL},
{"deblock", &deblock, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nodeblock", &deblock, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"deblockalpha", &deblockalpha, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL},
{"deblockbeta", &deblockbeta, CONF_TYPE_INT, CONF_RANGE, -6, 6, NULL},
{"cabac", &cabac, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nocabac", &cabac, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"cabacidc", &cabacidc, CONF_TYPE_INT, CONF_RANGE, -1, 2, NULL},
{"fullinter", &fullinter, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nofullinter", &fullinter, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"ip_factor", &ip_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
{"pb_factor", &pb_factor, CONF_TYPE_FLOAT, CONF_RANGE, -10.0, 10.0, NULL},
{"rc_buffer_size", &rc_buffer_size, CONF_TYPE_INT, CONF_RANGE, 0, 24000000, NULL},
@ -113,6 +116,7 @@ m_option_t x264encopts_conf[] = {
{"qblur", &qblur, CONF_TYPE_FLOAT, CONF_RANGE, 0, 99, NULL},
{"subq", &subq, CONF_TYPE_INT, CONF_RANGE, 0, 5, NULL},
{"psnr", &psnr, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"nopsnr", &psnr, CONF_TYPE_FLAG, 0, 1, 0, NULL},
{"log", &log_level, CONF_TYPE_INT, CONF_RANGE, -1, 3, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
};
@ -168,6 +172,10 @@ static int config(struct vf_instance_s* vf, int width, int height, int d_width,
mod->param.rc.b_stat_write = 0;
mod->param.rc.b_stat_read = 1;
break;
case 3:
mod->param.rc.b_stat_write = 1;
mod->param.rc.b_stat_read = 1;
break;
}
if(bitrate > 0) {
if(rc_buffer_size <= 0)