1
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 06:03:45 +01:00

document the recent changes in Snow.

new lavcopts: 'refs', 'vqscale=0'



git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18570 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
lorenm 2006-06-05 05:34:26 +00:00
parent 5c8cb3d022
commit c7032926c9
3 changed files with 42 additions and 20 deletions

View File

@ -7925,6 +7925,11 @@ subpel refinement quality (for qpel) (default: 8 (high quality))
This has a significant effect on speed.
.
.TP
.B refs=<1\-8>
number of reference frames to consider for motion compensation
(Snow only) (default: 1)
.
.TP
.B psnr\ \ \
print the PSNR (peak signal to noise ratio) for the whole video after encoding
and store the per frame PSNR in a file with a name like 'psnr_hhmmss.log'.

View File

@ -12,22 +12,18 @@ command line.
OPTIONS RECOGNIZED BY SNOW
* vqscale=<0.01-255>
Encoding quality, sane range 1-10, default: 0 (lossless). May be
fractional.
* vqscale=<0.0-255.0>
Encoding quality, sane range 1-10. 0 is lossless.
May be fractional.
A given quality in snow needs a somewhat lower qscale than the same
quality in MPEG-4.
Note that 0 may not be specified; if you want lossless encoding, you
must leave out vqscale.
* vpass=<1-3>
Activates internal two (or more) pass mode.
* vbitrate=<value>
Specify bitrate of the 2nd pass.
Don't use it for 1st pass as CBR isn't implemented yet, use vqscale
instead, and set it to a quantizer near the target average quant
of the final encode.
Specify bitrate of 1pass CBR or 2pass ABR. default: 800 kbit/s.
This is not very accurate for short videos.
* lmin, lmax, vqcomp, vratetol, vrc_eq, vrc_override
Generic multipass ratecontrol options, subject to the same suggestions
@ -36,15 +32,24 @@ OPTIONS RECOGNIZED BY SNOW
* cmp, subcmp, mbcmp
Set the comparison function, default: 0 (SAD).
useful values = 0 (SAD), 1 (SSD), 11 (5/3 wavelet), 12 (9/7 wavelet).
Experience shows that SSD is the best most of the time, while SAD is
slightly better the remainder of the time.
useful values = 0 (SAD), 1 (SSD), 2 (SATD),
11 (5/3 wavelet), 12 (9/7 wavelet).
SAD is fastest and lowest quality.
SSD is the only function that makes correct decisions about intra vs
inter (mbcmp) when using fast motion estimation, but is not the best for
the actual search (cmp, subcmp).
The wavelet functions (use the one that matches pred) are best quality,
especially whith vme=8, but are very slow.
SATD is a good balance.
You can add 256 to any of the options to enable chroma motion
estimation for that comparison (e.g. mbcmp=257 for SSD with chroma),
but it doesn't seem to help much for the moment.
* pred=<0-2>
Wavelet type. 0 (9/7 wavelet), 1 (5/3 wavelet), 2 (13/7 wavelet).
Wavelet type.
0 = 9/7 wavelet, default.
1 = 5/3 wavelet.
2 = 13/7 wavelet.
9/7 is probably better for for lossy coding, and 5/3 for lossless.
NOTE: 9/7 wavelet doesn't work with lossless mode.
@ -55,6 +60,7 @@ OPTIONS RECOGNIZED BY SNOW
* v4mv
Allows smaller motion partitions, default: off.
v4mv is theoretically good, but in practice isn't really working yet.
The current MB decision algorithm doesn't make very good use of this:
It improves quality, but also increases bitrate. (You could get
more quality per bitrate by reducing quantizer instead.)
@ -67,10 +73,18 @@ OPTIONS RECOGNIZED BY SNOW
Iterative ME currently does not perform scenecut detection, so should
be used only in the second pass of a two pass encode.
v4mv and the wavelet cmp functions are theoretically good, but in practice
aren't really working yet.
* refs=<1-8>
Allows each block to choose which of several reference frames to
motion compensate from. Defult: 1. Larger values always improve
compression, but cost lots of CPU-time when encoding and extra
memory when decoding.
In short:
The best options in almost all cases are
vcodec=snow:vstrict=-2:vpass=1:vqscale=$N:pred=0:cmp=1:subcmp=1:mbcmp=1:qpel
vcodec=snow:vstrict=-2:vpass=2:vbitrate=$B:pred=0:cmp=1:subcmp=1:mbcmp=1:qpel:vme=8
vcodec=snow:vstrict=-2:vpass=1:vbitrate=$B:pred=0:cmp=2:subcmp=2:mbcmp=1:qpel
vcodec=snow:vstrict=-2:vpass=2:vbitrate=$B:pred=0:cmp=12:subcmp=12:mbcmp=1:qpel:vme=8:refs=8
Decent, fast options are
vcodec=snow:vstrict=-2:vpass=1:vbitrate=$B:pred=0:cmp=1:subcmp=1:mbcmp=1
vcodec=snow:vstrict=-2:vpass=2:vbitrate=$B:pred=0:cmp=2:subcmp=2:mbcmp=1:refs=2

View File

@ -58,7 +58,7 @@ static int lavc_param_vrate_tolerance = 1000*8;
static int lavc_param_mb_decision = 0; /* default is realtime encoding */
static int lavc_param_v4mv = 0;
static int lavc_param_vme = 4;
static float lavc_param_vqscale = 0.0;
static float lavc_param_vqscale = -1;
static int lavc_param_vqmin = 2;
static int lavc_param_vqmax = 31;
static int lavc_param_mb_qmin = 2;
@ -161,6 +161,7 @@ static int lavc_param_bidir_refine = 0;
static int lavc_param_sc_factor = 1;
static int lavc_param_video_global_header= 0;
static int lavc_param_mv0_threshold = 256;
static int lavc_param_refs = 1;
char *lavc_param_acodec = "mp2";
int lavc_param_atag = 0;
@ -181,7 +182,7 @@ m_option_t lavcopts_conf[]={
{"mbd", &lavc_param_mb_decision, CONF_TYPE_INT, CONF_RANGE, 0, 9, NULL},
{"v4mv", &lavc_param_v4mv, CONF_TYPE_FLAG, 0, 0, 1, NULL},
{"vme", &lavc_param_vme, CONF_TYPE_INT, CONF_RANGE, 0, 8, NULL},
{"vqscale", &lavc_param_vqscale, CONF_TYPE_FLOAT, CONF_RANGE, 0.01, 255.0, NULL},
{"vqscale", &lavc_param_vqscale, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 255.0, NULL},
{"vqmin", &lavc_param_vqmin, CONF_TYPE_INT, CONF_RANGE, 1, 31, NULL},
{"vqmax", &lavc_param_vqmax, CONF_TYPE_INT, CONF_RANGE, 1, 31, NULL},
{"mbqmin", &lavc_param_mb_qmin, CONF_TYPE_INT, CONF_RANGE, 1, 31, NULL},
@ -321,6 +322,7 @@ m_option_t lavcopts_conf[]={
{"vglobal", &lavc_param_video_global_header, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL},
{"aglobal", &lavc_param_audio_global_header, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL},
{"mv0_threshold", &lavc_param_mv0_threshold, CONF_TYPE_INT, CONF_RANGE, 0, INT_MAX, NULL},
{"refs", &lavc_param_refs, CONF_TYPE_INT, CONF_RANGE, 1, 16, NULL},
{NULL, NULL, 0, 0, 0, 0, NULL}
};
#endif
@ -652,6 +654,7 @@ static int config(struct vf_instance_s* vf,
lavc_venc_context->flags2 |= CODEC_FLAG2_LOCAL_HEADER;
}
lavc_venc_context->mv0_threshold = lavc_param_mv0_threshold;
lavc_venc_context->refs = lavc_param_refs;
switch(lavc_param_format)
{
@ -741,7 +744,7 @@ static int config(struct vf_instance_s* vf,
lavc_venc_context->me_method = ME_ZERO+lavc_param_vme;
/* fixed qscale :p */
if (lavc_param_vqscale)
if (lavc_param_vqscale >= 0.0)
{
mp_msg(MSGT_MENCODER, MSGL_INFO, MSGTR_MPCODECS_UsingConstantQscale, lavc_param_vqscale);
lavc_venc_context->flags |= CODEC_FLAG_QSCALE;