[PATCH 1/5] doc/encoders: Add libxvid doc
--- doc/encoders.texi | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index fdf054c..c703000 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1212,6 +1212,135 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT Encoding ffpresets for common usages are provided so they can be used with the general presets system (e.g. passing the @option{pre} option). +@section libxvid + +Xvid MPEG-4 Part 2 encoder wrapper. + +Requires the presence of the libxvidcore headers and library during +configuration. You need to explicitly configure the build with +@code{--enable-libxvid}. + +An native MPEG-4 Part 2 encoder exists, so users can encode to this +format without this library. + +@subsection Options + +The following options are supported by the libxvid wrapper: + +@table @option +@item b +Set bit rate in bits/second. + +@item g +Set group of picture (GOP) size. Default value is 12. + +@item qmin +Set minimum quantizer scale. Must be included between -1 and 69, default +value is 2. + +@item qmax +Set maximum quantizer scale. Must be included between -1 and 1024, +default value is 31. + +@item mpeg_quant +Enable MPEG quantizer instead of H.263 when set to 1. + +@item threads +Set multi-threading thread count. Possible values are integers greater or +equal to 0, or @samp{auto}. 0 or @samp{auto} means that it automatically +detects a good number of threads. 1 means to disable multi-threading. + +@item bf +Set maximum number of B-frames. + +@item b_qfactor +Set quantization parameter (QP) factor between P- and B-frames. Value +is a float number. + +@item b_qoffset +Set QP offset between P- and B-frames. Value is a float number. + +@item flags +Set specific encoding flags. Possible values: + +@table @samp + +@item mv4 +Use four motion vector by macroblock. + +@item aic +Enable high quality AC prediction. + +@item gray +Only encode grayscale. + +@item gmc +Enable the use of global motion compensation (GMC). + +@item qpel +Enable quarter-pixel motion compensation. + +@item cgop +Enable closed GOP. + +@item global_header +Place global headers in extradata instead of every keyframe. + +@end table + +@item trellis +Enable trellis-based rate-distortion optimal quantization when set to +1. Default is 0 (disabled). + +@item me_method +Set motion estimation method. Possible values in the decreasing order +of speed and increasing order of quality: + +@table @samp + +@item zero +Use no motion estimation (default). + +@item phods +@item x1 +@item log +Enable advanced diamond zonal search for 16x16 blocks and half-pixel +refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for +@samp{phods}. + +@item epzs +Enable all of the things described above, plus advanced diamond zonal +search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion +estimation on chroma planes. + +@item full +Enable all of the things described above, plus extended 16x16 and 8x8 +blocks search. + +@end table + +@item mbd +Set macroblock decision algorithm. Possible values in the increasing +order of quality: + +@table @samp + +@item simple +Use macroblock comparing function algorithm (default). + +@item bits +Enable rate distortion-based half pixel and quarter pixel refinement for +16x16 blocks. + +@item rd +Enable all of the things described above, plus rate distortion-based +half pixel and quarter pixel refinement for 8x8 blocks, and rate +distortion-based search using square pattern. + +@end table + +@end table + @section png PNG image encoder. -- 1.8.1.2
The old implementation does not specify the param and is not usable. --- doc/encoders.texi | 17 +++++++++++++++++ libavcodec/libxvid.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index c703000..a42e7ba 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1339,6 +1339,23 @@ distortion-based search using square pattern. @end table +@item lumi_masking_mode +Set human visual system masking mode. Possible values: + +@c FIXME: I'm not able to explain the difference between the modes. +@c Need someone who is more familiar with this. +@table @samp +@item off +Disable masking. + +@item lumi +Luminance masking. + +@item variance +Variance masking. + +@end table + @end table @section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 05a12db..15b3734 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -63,6 +63,7 @@ struct xvid_context { int twopassfd; unsigned char *intra_matrix; /**< P-Frame Quant Matrix */ unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ + int lumi_masking_mode; /**< Luminance masking mode */ }; /** @@ -355,6 +356,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_single_t single = { 0 }; struct xvid_ff_pass1 rc2pass1 = { 0 }; xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -526,9 +528,13 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { } /* Luminance Masking */ - if( 0.0 != avctx->lumi_masking ) { + if( avctx->lumi_masking != 0.0 || x->lumi_masking_mode ) { + masking.method = ( x->lumi_masking_mode == 2 ); plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking; - plugins[xvid_enc_create.num_plugins].param = NULL; + + /* The old behavior is that when avctx->lumi_masking is specified, + * plugins[...].param = NULL. Trying to keep the old behavior here. */ + plugins[xvid_enc_create.num_plugins].param = x->lumi_masking_mode ? &masking : NULL ; xvid_enc_create.num_plugins++; } @@ -762,6 +768,23 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) { return 0; } +#define OFFSET(x) offsetof(struct xvid_context, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "lumi_masking_mode", "HVS masking mode", OFFSET(lumi_masking_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "lumi_masking_mode" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { NULL }, +}; + +static const AVClass xvid_class = { + .class_name = "libxvid", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_libxvid_encoder = { .name = "libxvid", .type = AVMEDIA_TYPE_VIDEO, @@ -772,4 +795,5 @@ AVCodec ff_libxvid_encoder = { .close = xvid_encode_close, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"), + .priv_class = &xvid_class, }; -- 1.8.1.2
On Sat, Jul 27, 2013 at 04:32:31PM -0700, Timothy Gu wrote:
The old implementation does not specify the param and is not usable. --- doc/encoders.texi | 17 +++++++++++++++++ libavcodec/libxvid.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/doc/encoders.texi b/doc/encoders.texi index c703000..a42e7ba 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1339,6 +1339,23 @@ distortion-based search using square pattern.
@end table
+@item lumi_masking_mode +Set human visual system masking mode. Possible values: + +@c FIXME: I'm not able to explain the difference between the modes. +@c Need someone who is more familiar with this. +@table @samp +@item off +Disable masking. + +@item lumi +Luminance masking. + +@item variance +Variance masking. + +@end table + @end table
@section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 05a12db..15b3734 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -63,6 +63,7 @@ struct xvid_context { int twopassfd; unsigned char *intra_matrix; /**< P-Frame Quant Matrix */ unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ + int lumi_masking_mode; /**< Luminance masking mode */ };
/** @@ -355,6 +356,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_single_t single = { 0 }; struct xvid_ff_pass1 rc2pass1 = { 0 }; xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -526,9 +528,13 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { }
/* Luminance Masking */ - if( 0.0 != avctx->lumi_masking ) { + if( avctx->lumi_masking != 0.0 || x->lumi_masking_mode ) { + masking.method = ( x->lumi_masking_mode == 2 ); plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking; - plugins[xvid_enc_create.num_plugins].param = NULL; + + /* The old behavior is that when avctx->lumi_masking is specified, + * plugins[...].param = NULL. Trying to keep the old behavior here. */ + plugins[xvid_enc_create.num_plugins].param = x->lumi_masking_mode ? &masking : NULL ; xvid_enc_create.num_plugins++; }
@@ -762,6 +768,23 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) { return 0; }
+#define OFFSET(x) offsetof(struct xvid_context, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "lumi_masking_mode", "HVS masking mode", OFFSET(lumi_masking_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "lumi_masking_mode" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { NULL }, +};
this doesnt allow both to be specified also it uses the AVCodecContext lumi_masking parameter for variance masking [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin
On Sunday, July 28, 2013, Michael Niedermayer wrote:
On Sat, Jul 27, 2013 at 04:32:31PM -0700, Timothy Gu wrote:
The old implementation does not specify the param and is not usable. --- doc/encoders.texi | 17 +++++++++++++++++ libavcodec/libxvid.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/doc/encoders.texi b/doc/encoders.texi index c703000..a42e7ba 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1339,6 +1339,23 @@ distortion-based search using square pattern.
@end table
+@item lumi_masking_mode +Set human visual system masking mode. Possible values: + +@c FIXME: I'm not able to explain the difference between the modes. +@c Need someone who is more familiar with this. +@table @samp +@item off +Disable masking. + +@item lumi +Luminance masking. + +@item variance +Variance masking. + +@end table + @end table
@section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 05a12db..15b3734 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -63,6 +63,7 @@ struct xvid_context { int twopassfd; unsigned char *intra_matrix; /**< P-Frame Quant Matrix */ unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ + int lumi_masking_mode; /**< Luminance masking mode */ };
/** @@ -355,6 +356,7 @@ static av_cold int xvid_encode_init(AVCodecContext
*avctx) {
xvid_plugin_single_t single = { 0 }; struct xvid_ff_pass1 rc2pass1 = { 0 }; xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -526,9 +528,13 @@ static av_cold int xvid_encode_init(AVCodecContext
*avctx) {
}
/* Luminance Masking */ - if( 0.0 != avctx->lumi_masking ) { + if( avctx->lumi_masking != 0.0 || x->lumi_masking_mode ) { + masking.method = ( x->lumi_masking_mode == 2 ); plugins[xvid_enc_create.num_plugins].func =
xvid_plugin_lumimasking;
- plugins[xvid_enc_create.num_plugins].param = NULL; + + /* The old behavior is that when avctx->lumi_masking is specified, + * plugins[...].param = NULL. Trying to keep the old behavior here. */ + plugins[xvid_enc_create.num_plugins].param = x->lumi_masking_mode ? &masking : NULL ; xvid_enc_create.num_plugins++; }
@@ -762,6 +768,23 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) { return 0; }
+#define OFFSET(x) offsetof(struct xvid_context, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "lumi_masking_mode", "HVS masking mode", OFFSET(lumi_masking_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "lumi_masking_mode" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { NULL }, +};
this doesnt allow both to be specified
Xvid does not allow both to be specified
also it uses the AVCodecContext lumi_masking parameter for variance masking
(Do you want me to use avctx->lumi_masking or ...) lumi_masking is a float number which I interpret as a "threshold"-like thing, instead of the masking mode switch. The original code is that if lumi_masking is not 0 then it opens the plugin, but it does not specify the required param. My patch intends to keep the original behavior if only lumi_masking is specified, and add an additional option to control the masking mode. So ... BTW, this patch depends on the first patch in the set, and can someone explain to me the difference between variance and luminance? Timothy [...]
On Sun, Jul 28, 2013 at 03:54:52PM -0700, Timothy Gu wrote:
On Sunday, July 28, 2013, Michael Niedermayer wrote:
On Sat, Jul 27, 2013 at 04:32:31PM -0700, Timothy Gu wrote:
The old implementation does not specify the param and is not usable. --- doc/encoders.texi | 17 +++++++++++++++++ libavcodec/libxvid.c | 28 ++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-)
diff --git a/doc/encoders.texi b/doc/encoders.texi index c703000..a42e7ba 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1339,6 +1339,23 @@ distortion-based search using square pattern.
@end table
+@item lumi_masking_mode +Set human visual system masking mode. Possible values: + +@c FIXME: I'm not able to explain the difference between the modes. +@c Need someone who is more familiar with this. +@table @samp +@item off +Disable masking. + +@item lumi +Luminance masking. + +@item variance +Variance masking. + +@end table + @end table
@section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 05a12db..15b3734 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -63,6 +63,7 @@ struct xvid_context { int twopassfd; unsigned char *intra_matrix; /**< P-Frame Quant Matrix */ unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ + int lumi_masking_mode; /**< Luminance masking mode */ };
/** @@ -355,6 +356,7 @@ static av_cold int xvid_encode_init(AVCodecContext
*avctx) {
xvid_plugin_single_t single = { 0 }; struct xvid_ff_pass1 rc2pass1 = { 0 }; xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -526,9 +528,13 @@ static av_cold int xvid_encode_init(AVCodecContext
*avctx) {
}
/* Luminance Masking */ - if( 0.0 != avctx->lumi_masking ) { + if( avctx->lumi_masking != 0.0 || x->lumi_masking_mode ) { + masking.method = ( x->lumi_masking_mode == 2 ); plugins[xvid_enc_create.num_plugins].func =
xvid_plugin_lumimasking;
- plugins[xvid_enc_create.num_plugins].param = NULL; + + /* The old behavior is that when avctx->lumi_masking is specified, + * plugins[...].param = NULL. Trying to keep the old behavior here. */ + plugins[xvid_enc_create.num_plugins].param = x->lumi_masking_mode ? &masking : NULL ; xvid_enc_create.num_plugins++; }
@@ -762,6 +768,23 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) { return 0; }
+#define OFFSET(x) offsetof(struct xvid_context, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "lumi_masking_mode", "HVS masking mode", OFFSET(lumi_masking_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "lumi_masking_mode" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { NULL }, +};
this doesnt allow both to be specified
Xvid does not allow both to be specified
i thought one could add 2 plugins one for lumi and one for variance masking
also it uses the AVCodecContext lumi_masking parameter for variance masking
(Do you want me to use avctx->lumi_masking or ...)
lumi_masking is a float number which I interpret as a "threshold"-like thing, instead of the masking mode switch.
The original code is that if lumi_masking is not 0 then it opens the plugin, but it does not specify the required param.
My patch intends to keep the original behavior if only lumi_masking is specified, and add an additional option to control the masking mode. So ...
BTW, this patch depends on the first patch in the set, and can someone explain to me the difference between variance and luminance?
Timothy
[...] _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
-- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB While the State exists there can be no freedom; when there is freedom there will be no State. -- Vladimir Lenin
On Jul 28, 2013 4:07 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Sun, Jul 28, 2013 at 03:54:52PM -0700, Timothy Gu wrote:
On Sunday, July 28, 2013, Michael Niedermayer wrote:
On Sat, Jul 27, 2013 at 04:32:31PM -0700, Timothy Gu wrote:
[...]
+static const AVOption options[] = { + { "lumi_masking_mode", "HVS masking mode", OFFSET(lumi_masking_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "lumi_masking_mode" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { NULL }, +};
this doesnt allow both to be specified
Xvid does not allow both to be specified
i thought one could add 2 plugins one for lumi and one for variance masking
No, it is just one big plugin with a switch to use either method. Timothy
On Sun, Jul 28, 2013 at 04:12:56PM -0700, Timothy Gu wrote:
On Jul 28, 2013 4:07 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Sun, Jul 28, 2013 at 03:54:52PM -0700, Timothy Gu wrote:
On Sunday, July 28, 2013, Michael Niedermayer wrote:
On Sat, Jul 27, 2013 at 04:32:31PM -0700, Timothy Gu wrote:
[...]
+static const AVOption options[] = { + { "lumi_masking_mode", "HVS masking mode", OFFSET(lumi_masking_mode), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "lumi_masking_mode" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { NULL }, +};
this doesnt allow both to be specified
Xvid does not allow both to be specified
i thought one could add 2 plugins one for lumi and one for variance masking
No, it is just one big plugin with a switch to use either method.
i dont see how this would be a problem on its own one could load the plugin twice with the switch being different for each [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange
On Jul 28, 2013 7:44 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Sun, Jul 28, 2013 at 04:12:56PM -0700, Timothy Gu wrote:
On Jul 28, 2013 4:07 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
this doesnt allow both to be specified
Xvid does not allow both to be specified
i thought one could add 2 plugins one for lumi and one for variance masking
No, it is just one big plugin with a switch to use either method.
i dont see how this would be a problem on its own one could load the plugin twice with the switch being different for each
Well this might be possible, but I don't know how to do it. The xvid doc and example program don't say how to use a same plugin twice. Maybe someone can implement it in a separate patch in the future. Timothy
On Sun, Jul 28, 2013 at 08:01:03PM -0700, Timothy Gu wrote:
On Jul 28, 2013 7:44 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Sun, Jul 28, 2013 at 04:12:56PM -0700, Timothy Gu wrote:
On Jul 28, 2013 4:07 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
this doesnt allow both to be specified
Xvid does not allow both to be specified
i thought one could add 2 plugins one for lumi and one for variance masking
No, it is just one big plugin with a switch to use either method.
i dont see how this would be a problem on its own one could load the plugin twice with the switch being different for each
Well this might be possible, but I don't know how to do it. The xvid doc and example program don't say how to use a same plugin twice. Maybe someone can implement it in a separate patch in the future.
can you elaborate on what problem there is with using the same plugin twice ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The real ebay dictionary, page 1 "Used only once" - "Some unspecified defect prevented a second use" "In good condition" - "Can be repaird by experienced expert" "As is" - "You wouldnt want it even if you were payed for it, if you knew ..."
On Mon, Jul 29, 2013 at 5:56 AM, Michael Niedermayer <michaelni@gmx.at> wrote:
can you elaborate on what problem there is with using the same plugin twice ?
Now I get what you mean. I tried to implement both, but the result is that using both masking modes has the same effect as just using lumi masking. So I guess it is better not to have a "both" mode. Timothy
On Mon, Jul 29, 2013 at 07:02:17PM -0700, Timothy Gu wrote:
On Mon, Jul 29, 2013 at 5:56 AM, Michael Niedermayer <michaelni@gmx.at> wrote:
can you elaborate on what problem there is with using the same plugin twice ?
Now I get what you mean.
I tried to implement both, but the result is that using both masking modes has the same effect as just using lumi masking. So I guess it is better not to have a "both" mode.
I still think they should get 2 seperate parameters and if both arent possible to be used at the same time then an error could be printed if both are set [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates
The old implementation is unusable due to change in the Xvid API. --- doc/encoders.texi | 13 +++++++++++++ libavcodec/libxvid.c | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 2 deletions(-) diff --git a/doc/encoders.texi b/doc/encoders.texi index 16be948..a647836 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1323,6 +1323,19 @@ half pixel and quarter pixel refinement for 8x8 blocks, and rate distortion-based search using square pattern. @end table +@item lumi_aq +Enable lumi masking adaptive quantization when set to 1. Default is 0 +(disabled). + +@item variance_aq +Enable variance adaptive quantization when set to 1. Default is 0 +(disabled). + +When combined with @option{lumi_aq}, the resulting quality will not +be better than any of the two specified individually. In other +words, the resulting quality will be the worse one of the two +effects. + @end table @section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 05a12db..0c94c8c 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -63,6 +63,8 @@ struct xvid_context { int twopassfd; unsigned char *intra_matrix; /**< P-Frame Quant Matrix */ unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ + int lumi_aq; /**< Lumi masking as an aq method */ + int variance_aq; /**< Variance adaptive quantization */ }; /** @@ -355,6 +357,8 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_single_t single = { 0 }; struct xvid_ff_pass1 rc2pass1 = { 0 }; xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking_l = { 0 }; /* For lumi masking */ + xvid_plugin_lumimasking_t masking_v = { 0 }; /* For variance AQ */ xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -526,12 +530,29 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { } /* Luminance Masking */ - if( 0.0 != avctx->lumi_masking ) { + if( avctx->lumi_masking != 0.0 || x->lumi_aq ) { + masking_l.method = 0; plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking; - plugins[xvid_enc_create.num_plugins].param = NULL; + + /* The old behavior is that when avctx->lumi_masking is specified, + * plugins[...].param = NULL. Trying to keep the old behavior here. */ + plugins[xvid_enc_create.num_plugins].param = x->lumi_aq ? &masking_l : NULL ; xvid_enc_create.num_plugins++; } + /* Variance AQ */ + if( x->variance_aq ) { + masking_v.method = 1; + plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking; + plugins[xvid_enc_create.num_plugins].param = &masking_v ; + xvid_enc_create.num_plugins++; + } + + if( x->lumi_aq && x->variance_aq ) + av_log(avctx, AV_LOG_INFO, + "Both lumi_aq and variance_aq are enabled. The resulting quality" + "will be the worse one of the two effects made by the AQ.\n"); + /* Frame Rate and Key Frames */ xvid_correct_framerate(avctx); xvid_enc_create.fincr = avctx->time_base.num; @@ -762,6 +783,21 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) { return 0; } +#define OFFSET(x) offsetof(struct xvid_context, x) +#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "lumi_aq", "Luminance masking AQ", OFFSET(lumi_aq), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, + { "variance_aq", "Variance AQ", OFFSET(variance_aq), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, + { NULL }, +}; + +static const AVClass xvid_class = { + .class_name = "libxvid", + .item_name = av_default_item_name, + .option = options, + .version = LIBAVUTIL_VERSION_INT, +}; + AVCodec ff_libxvid_encoder = { .name = "libxvid", .type = AVMEDIA_TYPE_VIDEO, @@ -772,4 +808,5 @@ AVCodec ff_libxvid_encoder = { .close = xvid_encode_close, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"), + .priv_class = &xvid_class, }; -- 1.8.1.2
On Tue, Jul 30, 2013 at 07:39:06PM -0700, Timothy Gu wrote:
The old implementation is unusable due to change in the Xvid API. --- doc/encoders.texi | 13 +++++++++++++ libavcodec/libxvid.c | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 2 deletions(-)
applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong.
Timothy Gu <timothygu99 <at> gmail.com> writes:
+ xvid_plugin_lumimasking_t masking_l = { 0 }; /* For lumi masking */ + xvid_plugin_lumimasking_t masking_v = { 0 }; /* For variance AQ */
This apparently needs a configure update: http://thread.gmane.org/gmane.comp.video.ffmpeg.user/48045 Carl Eugen
--- doc/encoders.texi | 37 +++++++++++++++++++++++++++++++++++++ libavcodec/libxvid.c | 19 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index a42e7ba..6286b9c 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1356,6 +1356,43 @@ Variance masking. @end table +@item ssim +Set structural similarity (SSIM) displaying method. Possible values: + +@table @samp +@item off +Disable displaying of SSIM information. + +@item avg +Output average SSIM at the end of encoding to stdout. The format of +showing the average SSIM is: + +@example +Average SSIM: %f +@end example + +For users who are not familiar with C, %f means a float number, or +a decimal (e.g. 0.939232). + +@item frame +Output both per-frame SSIM data during encoding and average SSIM at +the end of encoding to stdout. The format of per-frame information +is: + +@example + SSIM: avg: %1.3f min: %1.3f max: %1.3f +@end example + +For users who are not familiar with C, %1.3f means a float number +rounded to 3 digits after the dot (e.g. 0.932). + +@end table + +@item ssim_acc +Set SSIM accuracy. Valid options are integers within the range of +0-4, while 0 gives the most accurate result and 4 computes the +fastest. + @end table @section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 15b3734..f3b3db5 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -64,6 +64,8 @@ struct xvid_context { unsigned char *intra_matrix; /**< P-Frame Quant Matrix */ unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ int lumi_masking_mode; /**< Luminance masking mode */ + int ssim; /**< SSIM information display mode */ + int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */ }; /** @@ -357,6 +359,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { struct xvid_ff_pass1 rc2pass1 = { 0 }; xvid_plugin_2pass2_t rc2pass2 = { 0 }; xvid_plugin_lumimasking_t masking = { 0 }; + xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -538,6 +541,17 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_enc_create.num_plugins++; } + /* SSIM */ + if( x->ssim ) { + plugins[xvid_enc_create.num_plugins].func = xvid_plugin_ssim; + ssim.b_printstat = ( x->ssim == 2 ); + ssim.acc = x->ssim_acc; + ssim.cpu_flags = xvid_gbl_init.cpu_flags; + ssim.b_visualize = 0; + plugins[xvid_enc_create.num_plugins].param = &ssim; + xvid_enc_create.num_plugins++; + } + /* Frame Rate and Key Frames */ xvid_correct_framerate(avctx); xvid_enc_create.fincr = avctx->time_base.num; @@ -775,6 +789,11 @@ static const AVOption options[] = { { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, { "lumi", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, { "variance", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "lumi_masking_mode" }, + { "ssim", "Show SSIM information to stdout", OFFSET(ssim), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "ssim" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "ssim" }, + { "avg", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "ssim" }, + { "frame", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "ssim" }, + { "ssim_acc", "SSIM accuracy", OFFSET(ssim_acc), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, VE }, { NULL }, }; -- 1.8.1.2
On Sat, Jul 27, 2013 at 04:32:32PM -0700, Timothy Gu wrote:
--- doc/encoders.texi | 37 +++++++++++++++++++++++++++++++++++++ libavcodec/libxvid.c | 19 +++++++++++++++++++ 2 files changed, 56 insertions(+)
this one wont apply without the previous [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Republics decline into democracies and democracies degenerate into despotisms. -- Aristotle
--- Rebased doc/encoders.texi | 37 +++++++++++++++++++++++++++++++++++++ libavcodec/libxvid.c | 19 +++++++++++++++++++ 2 files changed, 56 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index a647836..727549f 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1336,6 +1336,43 @@ be better than any of the two specified individually. In other words, the resulting quality will be the worse one of the two effects. +@item ssim +Set structural similarity (SSIM) displaying method. Possible values: + +@table @samp +@item off +Disable displaying of SSIM information. + +@item avg +Output average SSIM at the end of encoding to stdout. The format of +showing the average SSIM is: + +@example +Average SSIM: %f +@end example + +For users who are not familiar with C, %f means a float number, or +a decimal (e.g. 0.939232). + +@item frame +Output both per-frame SSIM data during encoding and average SSIM at +the end of encoding to stdout. The format of per-frame information +is: + +@example + SSIM: avg: %1.3f min: %1.3f max: %1.3f +@end example + +For users who are not familiar with C, %1.3f means a float number +rounded to 3 digits after the dot (e.g. 0.932). + +@end table + +@item ssim_acc +Set SSIM accuracy. Valid options are integers within the range of +0-4, while 0 gives the most accurate result and 4 computes the +fastest. + @end table @section png diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 0c94c8c..7bece4a 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -65,6 +65,8 @@ struct xvid_context { unsigned char *inter_matrix; /**< I-Frame Quant Matrix */ int lumi_aq; /**< Lumi masking as an aq method */ int variance_aq; /**< Variance adaptive quantization */ + int ssim; /**< SSIM information display mode */ + int ssim_acc; /**< SSIM accuracy. 0: accurate. 4: fast. */ }; /** @@ -359,6 +361,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_2pass2_t rc2pass2 = { 0 }; xvid_plugin_lumimasking_t masking_l = { 0 }; /* For lumi masking */ xvid_plugin_lumimasking_t masking_v = { 0 }; /* For variance AQ */ + xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; xvid_enc_plugin_t plugins[7]; @@ -553,6 +556,17 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { "Both lumi_aq and variance_aq are enabled. The resulting quality" "will be the worse one of the two effects made by the AQ.\n"); + /* SSIM */ + if( x->ssim ) { + plugins[xvid_enc_create.num_plugins].func = xvid_plugin_ssim; + ssim.b_printstat = ( x->ssim == 2 ); + ssim.acc = x->ssim_acc; + ssim.cpu_flags = xvid_gbl_init.cpu_flags; + ssim.b_visualize = 0; + plugins[xvid_enc_create.num_plugins].param = &ssim; + xvid_enc_create.num_plugins++; + } + /* Frame Rate and Key Frames */ xvid_correct_framerate(avctx); xvid_enc_create.fincr = avctx->time_base.num; @@ -788,6 +802,11 @@ static av_cold int xvid_encode_close(AVCodecContext *avctx) { static const AVOption options[] = { { "lumi_aq", "Luminance masking AQ", OFFSET(lumi_aq), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, { "variance_aq", "Variance AQ", OFFSET(variance_aq), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE }, + { "ssim", "Show SSIM information to stdout", OFFSET(ssim), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 2, VE, "ssim" }, + { "off", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "ssim" }, + { "avg", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "ssim" }, + { "frame", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, INT_MIN, INT_MAX, VE, "ssim" }, + { "ssim_acc", "SSIM accuracy", OFFSET(ssim_acc), AV_OPT_TYPE_INT, { .i64 = 2 }, 0, 4, VE }, { NULL }, }; -- 1.8.1.2
On Tue, Jul 30, 2013 at 07:40:45PM -0700, Timothy Gu wrote:
---
Rebased
doc/encoders.texi | 37 +++++++++++++++++++++++++++++++++++++ libavcodec/libxvid.c | 19 +++++++++++++++++++ 2 files changed, 56 insertions(+)
applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato
--- libavcodec/libxvid.c | 65 ++++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index f3b3db5..25896a0 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -355,47 +355,46 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { uint16_t *intra, *inter; int fd; - xvid_plugin_single_t single = { 0 }; - struct xvid_ff_pass1 rc2pass1 = { 0 }; - xvid_plugin_2pass2_t rc2pass2 = { 0 }; - xvid_plugin_lumimasking_t masking = { 0 }; - xvid_plugin_ssim_t ssim = { 0 }; - xvid_gbl_init_t xvid_gbl_init = { 0 }; - xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_plugin_single_t single = { 0 }; + struct xvid_ff_pass1 rc2pass1 = { 0 }; + xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking = { 0 }; + xvid_plugin_ssim_t ssim = { 0 }; + xvid_gbl_init_t xvid_gbl_init = { 0 }; + xvid_enc_create_t xvid_enc_create = { 0 }; + xvid_enc_plugin_t plugins[7]; x->twopassfd = -1; /* Bring in VOP flags from ffmpeg command-line */ - x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */ + x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */ if( xvid_flags & CODEC_FLAG_4MV ) - x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */ - if( avctx->trellis - ) - x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */ + x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */ + if( avctx->trellis) + x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */ if( xvid_flags & CODEC_FLAG_AC_PRED ) - x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */ + x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */ if( xvid_flags & CODEC_FLAG_GRAY ) - x->vop_flags |= XVID_VOP_GREYSCALE; + x->vop_flags |= XVID_VOP_GREYSCALE; /* Decide which ME quality setting to use */ x->me_flags = 0; switch( avctx->me_method ) { case ME_FULL: /* Quality 6 */ - x->me_flags |= XVID_ME_EXTSEARCH16 - | XVID_ME_EXTSEARCH8; + x->me_flags |= XVID_ME_EXTSEARCH16 + | XVID_ME_EXTSEARCH8; case ME_EPZS: /* Quality 4 */ - x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 - | XVID_ME_HALFPELREFINE8 - | XVID_ME_CHROMA_PVOP - | XVID_ME_CHROMA_BVOP; + x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 + | XVID_ME_HALFPELREFINE8 + | XVID_ME_CHROMA_PVOP + | XVID_ME_CHROMA_BVOP; case ME_LOG: /* Quality 2 */ case ME_PHODS: case ME_X1: - x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 - | XVID_ME_HALFPELREFINE16; + x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 + | XVID_ME_HALFPELREFINE16; case ME_ZERO: /* Quality 0 */ default: @@ -406,15 +405,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { switch( avctx->mb_decision ) { case 2: x->vop_flags |= XVID_VOP_MODEDECISION_RD; - x->me_flags |= XVID_ME_HALFPELREFINE8_RD - | XVID_ME_QUARTERPELREFINE8_RD - | XVID_ME_EXTSEARCH_RD - | XVID_ME_CHECKPREDICTION_RD; + x->me_flags |= XVID_ME_HALFPELREFINE8_RD + | XVID_ME_QUARTERPELREFINE8_RD + | XVID_ME_EXTSEARCH_RD + | XVID_ME_CHECKPREDICTION_RD; case 1: if( !(x->vop_flags & XVID_VOP_MODEDECISION_RD) ) x->vop_flags |= XVID_VOP_FAST_MODEDECISION_RD; - x->me_flags |= XVID_ME_HALFPELREFINE16_RD - | XVID_ME_QUARTERPELREFINE16_RD; + x->me_flags |= XVID_ME_HALFPELREFINE16_RD + | XVID_ME_QUARTERPELREFINE16_RD; default: break; @@ -423,12 +422,12 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { /* Bring in VOL flags from ffmpeg command-line */ x->vol_flags = 0; if( xvid_flags & CODEC_FLAG_GMC ) { - x->vol_flags |= XVID_VOL_GMC; - x->me_flags |= XVID_ME_GME_REFINE; + x->vol_flags |= XVID_VOL_GMC; + x->me_flags |= XVID_ME_GME_REFINE; } if( xvid_flags & CODEC_FLAG_QPEL ) { - x->vol_flags |= XVID_VOL_QUARTERPEL; - x->me_flags |= XVID_ME_QUARTERPELREFINE16; + x->vol_flags |= XVID_VOL_QUARTERPEL; + x->me_flags |= XVID_ME_QUARTERPELREFINE16; if( x->vop_flags & XVID_VOP_INTER4V ) x->me_flags |= XVID_ME_QUARTERPELREFINE8; } -- 1.8.1.2
--- Rebased libavcodec/libxvid.c | 67 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 7bece4a..edf5f43 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -356,48 +356,47 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { uint16_t *intra, *inter; int fd; - xvid_plugin_single_t single = { 0 }; - struct xvid_ff_pass1 rc2pass1 = { 0 }; - xvid_plugin_2pass2_t rc2pass2 = { 0 }; - xvid_plugin_lumimasking_t masking_l = { 0 }; /* For lumi masking */ - xvid_plugin_lumimasking_t masking_v = { 0 }; /* For variance AQ */ - xvid_plugin_ssim_t ssim = { 0 }; - xvid_gbl_init_t xvid_gbl_init = { 0 }; - xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_plugin_single_t single = { 0 }; + struct xvid_ff_pass1 rc2pass1 = { 0 }; + xvid_plugin_2pass2_t rc2pass2 = { 0 }; + xvid_plugin_lumimasking_t masking_l = { 0 }; /* For lumi masking */ + xvid_plugin_lumimasking_t masking_v = { 0 }; /* For variance AQ */ + xvid_plugin_ssim_t ssim = { 0 }; + xvid_gbl_init_t xvid_gbl_init = { 0 }; + xvid_enc_create_t xvid_enc_create = { 0 }; + xvid_enc_plugin_t plugins[7]; x->twopassfd = -1; /* Bring in VOP flags from ffmpeg command-line */ - x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */ + x->vop_flags = XVID_VOP_HALFPEL; /* Bare minimum quality */ if( xvid_flags & CODEC_FLAG_4MV ) - x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */ - if( avctx->trellis - ) - x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */ + x->vop_flags |= XVID_VOP_INTER4V; /* Level 3 */ + if( avctx->trellis) + x->vop_flags |= XVID_VOP_TRELLISQUANT; /* Level 5 */ if( xvid_flags & CODEC_FLAG_AC_PRED ) - x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */ + x->vop_flags |= XVID_VOP_HQACPRED; /* Level 6 */ if( xvid_flags & CODEC_FLAG_GRAY ) - x->vop_flags |= XVID_VOP_GREYSCALE; + x->vop_flags |= XVID_VOP_GREYSCALE; /* Decide which ME quality setting to use */ x->me_flags = 0; switch( avctx->me_method ) { case ME_FULL: /* Quality 6 */ - x->me_flags |= XVID_ME_EXTSEARCH16 - | XVID_ME_EXTSEARCH8; + x->me_flags |= XVID_ME_EXTSEARCH16 + | XVID_ME_EXTSEARCH8; case ME_EPZS: /* Quality 4 */ - x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 - | XVID_ME_HALFPELREFINE8 - | XVID_ME_CHROMA_PVOP - | XVID_ME_CHROMA_BVOP; + x->me_flags |= XVID_ME_ADVANCEDDIAMOND8 + | XVID_ME_HALFPELREFINE8 + | XVID_ME_CHROMA_PVOP + | XVID_ME_CHROMA_BVOP; case ME_LOG: /* Quality 2 */ case ME_PHODS: case ME_X1: - x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 - | XVID_ME_HALFPELREFINE16; + x->me_flags |= XVID_ME_ADVANCEDDIAMOND16 + | XVID_ME_HALFPELREFINE16; case ME_ZERO: /* Quality 0 */ default: @@ -408,15 +407,15 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { switch( avctx->mb_decision ) { case 2: x->vop_flags |= XVID_VOP_MODEDECISION_RD; - x->me_flags |= XVID_ME_HALFPELREFINE8_RD - | XVID_ME_QUARTERPELREFINE8_RD - | XVID_ME_EXTSEARCH_RD - | XVID_ME_CHECKPREDICTION_RD; + x->me_flags |= XVID_ME_HALFPELREFINE8_RD + | XVID_ME_QUARTERPELREFINE8_RD + | XVID_ME_EXTSEARCH_RD + | XVID_ME_CHECKPREDICTION_RD; case 1: if( !(x->vop_flags & XVID_VOP_MODEDECISION_RD) ) x->vop_flags |= XVID_VOP_FAST_MODEDECISION_RD; - x->me_flags |= XVID_ME_HALFPELREFINE16_RD - | XVID_ME_QUARTERPELREFINE16_RD; + x->me_flags |= XVID_ME_HALFPELREFINE16_RD + | XVID_ME_QUARTERPELREFINE16_RD; default: break; @@ -425,12 +424,12 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { /* Bring in VOL flags from ffmpeg command-line */ x->vol_flags = 0; if( xvid_flags & CODEC_FLAG_GMC ) { - x->vol_flags |= XVID_VOL_GMC; - x->me_flags |= XVID_ME_GME_REFINE; + x->vol_flags |= XVID_VOL_GMC; + x->me_flags |= XVID_ME_GME_REFINE; } if( xvid_flags & CODEC_FLAG_QPEL ) { - x->vol_flags |= XVID_VOL_QUARTERPEL; - x->me_flags |= XVID_ME_QUARTERPELREFINE16; + x->vol_flags |= XVID_VOL_QUARTERPEL; + x->me_flags |= XVID_ME_QUARTERPELREFINE16; if( x->vop_flags & XVID_VOP_INTER4V ) x->me_flags |= XVID_ME_QUARTERPELREFINE8; } -- 1.8.1.2
On Jul 30, 2013 7:42 PM, "Timothy Gu" <timothygu99@gmail.com> wrote:
---
Rebased
libavcodec/libxvid.c | 67
++++++++++++++++++++++++++--------------------------
1 file changed, 33 insertions(+), 34 deletions(-)
Ping
On Tue, Jul 30, 2013 at 07:41:32PM -0700, Timothy Gu wrote:
---
Rebased
libavcodec/libxvid.c | 67 ++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 34 deletions(-)
applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange
It is not possible to have a plugin[] array with 4 or more elements. --- libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index 25896a0..b5ebef5 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -362,7 +362,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_enc_plugin_t plugins[3]; x->twopassfd = -1; -- 1.8.1.2
It is not possible to have a plugin[] array with 5 or more elements. --- Changed according to newer versions of other patches libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index edf5f43..8945c28 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -364,7 +364,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_enc_plugin_t plugins[4]; x->twopassfd = -1; -- 1.8.1.2
On Tue, Jul 30, 2013 at 07:42:32PM -0700, Timothy Gu wrote:
It is not possible to have a plugin[] array with 5 or more elements. ---
Changed according to newer versions of other patches
libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index edf5f43..8945c28 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -364,7 +364,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_enc_plugin_t plugins[4];
the patch is correct but why should the array be tightened up ? also it might make sense (independant of this patch) to check that the array is large enough for the used plugins [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB In fact, the RIAA has been known to suggest that students drop out of college or go to community college in order to be able to afford settlements. -- The RIAA
On Jul 31, 2013 12:15 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Tue, Jul 30, 2013 at 07:42:32PM -0700, Timothy Gu wrote:
It is not possible to have a plugin[] array with 5 or more elements. ---
Changed according to newer versions of other patches
libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index edf5f43..8945c28 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -364,7 +364,7 @@ static av_cold int xvid_encode_init(AVCodecContext
*avctx) {
xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_enc_plugin_t plugins[4];
the patch is correct but why should the array be tightened up ?
For the sake of saving a few bytes in memory.
also it might make sense (independant of this patch) to check that the array is large enough for the used plugins
I don't think there is a need for that. A developer can just count the value of the counter by hand to make sure the array doesn't overload. [...] Timothy
On Thu, Aug 1, 2013 at 5:27 PM, Timothy Gu <timothygu99@gmail.com> wrote:
On Jul 31, 2013 12:15 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Tue, Jul 30, 2013 at 07:42:32PM -0700, Timothy Gu wrote:
It is not possible to have a plugin[] array with 5 or more elements. ---
Changed according to newer versions of other patches
libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index edf5f43..8945c28 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -364,7 +364,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_enc_plugin_t plugins[4];
the patch is correct but why should the array be tightened up ?
For the sake of saving a few bytes in memory.
also it might make sense (independant of this patch) to check that the array is large enough for the used plugins
I don't think there is a need for that. A developer can just count the value of the counter by hand to make sure the array doesn't overload.
Will this be applied? (Read: ping) Timothy
On Sat, Aug 03, 2013 at 05:00:12PM -0700, Timothy Gu wrote:
On Thu, Aug 1, 2013 at 5:27 PM, Timothy Gu <timothygu99@gmail.com> wrote:
On Jul 31, 2013 12:15 PM, "Michael Niedermayer" <michaelni@gmx.at> wrote:
On Tue, Jul 30, 2013 at 07:42:32PM -0700, Timothy Gu wrote:
It is not possible to have a plugin[] array with 5 or more elements. ---
Changed according to newer versions of other patches
libavcodec/libxvid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index edf5f43..8945c28 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -364,7 +364,7 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx) { xvid_plugin_ssim_t ssim = { 0 }; xvid_gbl_init_t xvid_gbl_init = { 0 }; xvid_enc_create_t xvid_enc_create = { 0 }; - xvid_enc_plugin_t plugins[7]; + xvid_enc_plugin_t plugins[4];
the patch is correct but why should the array be tightened up ?
For the sake of saving a few bytes in memory.
also it might make sense (independant of this patch) to check that the array is large enough for the used plugins
I don't think there is a need for that. A developer can just count the value of the counter by hand to make sure the array doesn't overload.
Will this be applied? (Read: ping)
without a check that ensures the array is large enough in the future, i wont reduce the arrays size. Doing otherwise would create fragile code that could easily become a security issue [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates
On Sat, Aug 3, 2013 at 7:24 PM, Michael Niedermayer <michaelni@gmx.at> wrote:
On Sat, Aug 03, 2013 at 05:00:12PM -0700, Timothy Gu wrote:
Will this be applied? (Read: ping)
without a check that ensures the array is large enough in the future, i wont reduce the arrays size. Doing otherwise would create fragile code that could easily become a security issue
You are right, but I am not capable of doing it (I am not that good a programmer, maybe you don't understand. What should I use? A macro, a static function, or something else? Where should I put the check?) I think I will just leave the big plugins[] there, until someone else (maybe you) does it. Timothy
On Sat, Aug 03, 2013 at 08:55:11PM -0700, Timothy Gu wrote:
On Sat, Aug 3, 2013 at 7:24 PM, Michael Niedermayer <michaelni@gmx.at> wrote:
On Sat, Aug 03, 2013 at 05:00:12PM -0700, Timothy Gu wrote:
Will this be applied? (Read: ping)
without a check that ensures the array is large enough in the future, i wont reduce the arrays size. Doing otherwise would create fragile code that could easily become a security issue
You are right, but I am not capable of doing it (I am not that good a programmer, maybe you don't understand. What should I use? A macro, a static function, or something else? Where should I put the check?)
I think I will just leave the big plugins[] there, until someone else (maybe you) does it.
fixed applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus
On date Saturday 2013-07-27 16:32:30 -0700, Timothy Gu encoded:
--- doc/encoders.texi | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+)
diff --git a/doc/encoders.texi b/doc/encoders.texi index fdf054c..c703000 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1212,6 +1212,135 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT Encoding ffpresets for common usages are provided so they can be used with the general presets system (e.g. passing the @option{pre} option).
+@section libxvid + +Xvid MPEG-4 Part 2 encoder wrapper. +
+Requires the presence of the libxvidcore headers and library during
This encoder requires so that the subject is explicit.
+configuration. You need to explicitly configure the build with +@code{--enable-libxvid}. +
+An native MPEG-4 Part 2 encoder exists, so users can encode to this +format without this library.
A native Also slightly more informative: The native @code{mpeg4} encoder supports MPEG-4 Part 2, so users ...
+ +@subsection Options + +The following options are supported by the libxvid wrapper: + +@table @option +@item b +Set bit rate in bits/second. + +@item g +Set group of picture (GOP) size. Default value is 12. + +@item qmin +Set minimum quantizer scale. Must be included between -1 and 69, default +value is 2. + +@item qmax +Set maximum quantizer scale. Must be included between -1 and 1024, +default value is 31. +
+@item mpeg_quant +Enable MPEG quantizer instead of H.263 when set to 1.
Default value is 0?
+ +@item threads +Set multi-threading thread count. Possible values are integers greater or +equal to 0, or @samp{auto}. 0 or @samp{auto} means that it automatically +detects a good number of threads. 1 means to disable multi-threading. + +@item bf +Set maximum number of B-frames. + +@item b_qfactor +Set quantization parameter (QP) factor between P- and B-frames. Value +is a float number. + +@item b_qoffset +Set QP offset between P- and B-frames. Value is a float number. + +@item flags +Set specific encoding flags. Possible values: + +@table @samp + +@item mv4 +Use four motion vector by macroblock. + +@item aic +Enable high quality AC prediction. + +@item gray +Only encode grayscale. + +@item gmc +Enable the use of global motion compensation (GMC). + +@item qpel +Enable quarter-pixel motion compensation. + +@item cgop +Enable closed GOP. + +@item global_header +Place global headers in extradata instead of every keyframe. + +@end table + +@item trellis +Enable trellis-based rate-distortion optimal quantization when set to +1. Default is 0 (disabled). + +@item me_method +Set motion estimation method. Possible values in the decreasing order +of speed and increasing order of quality: + +@table @samp + +@item zero +Use no motion estimation (default). + +@item phods +@item x1 +@item log +Enable advanced diamond zonal search for 16x16 blocks and half-pixel +refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for +@samp{phods}. + +@item epzs +Enable all of the things described above, plus advanced diamond zonal +search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion +estimation on chroma planes. + +@item full +Enable all of the things described above, plus extended 16x16 and 8x8 +blocks search. + +@end table + +@item mbd +Set macroblock decision algorithm. Possible values in the increasing +order of quality: + +@table @samp + +@item simple +Use macroblock comparing function algorithm (default). + +@item bits +Enable rate distortion-based half pixel and quarter pixel refinement for +16x16 blocks. + +@item rd +Enable all of the things described above, plus rate distortion-based +half pixel and quarter pixel refinement for 8x8 blocks, and rate +distortion-based search using square pattern. + +@end table + +@end table
I'm not really happy about duplicating common option documentation. LGTM otherwise. -- FFmpeg = Fierce and Fascinating Miracolous Political Erudite Game
On Mon, Jul 29, 2013 at 3:22 AM, Stefano Sabatini <stefasab@gmail.com> wrote:
On date Saturday 2013-07-27 16:32:30 -0700, Timothy Gu encoded:
--- doc/encoders.texi | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+)
diff --git a/doc/encoders.texi b/doc/encoders.texi index fdf054c..c703000 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1212,6 +1212,135 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT Encoding ffpresets for common usages are provided so they can be used with the general presets system (e.g. passing the @option{pre} option).
+@section libxvid + +Xvid MPEG-4 Part 2 encoder wrapper. +
+Requires the presence of the libxvidcore headers and library during
This encoder requires
so that the subject is explicit.
+configuration. You need to explicitly configure the build with +@code{--enable-libxvid}. +
+An native MPEG-4 Part 2 encoder exists, so users can encode to this +format without this library.
A native
Also slightly more informative:
The native @code{mpeg4} encoder supports MPEG-4 Part 2, so users ...
+ +@subsection Options + +The following options are supported by the libxvid wrapper: + +@table @option +@item b +Set bit rate in bits/second. + +@item g +Set group of picture (GOP) size. Default value is 12. + +@item qmin +Set minimum quantizer scale. Must be included between -1 and 69, default +value is 2. + +@item qmax +Set maximum quantizer scale. Must be included between -1 and 1024, +default value is 31. +
+@item mpeg_quant +Enable MPEG quantizer instead of H.263 when set to 1.
Default value is 0?
See below
+ +@item threads +Set multi-threading thread count. Possible values are integers greater or +equal to 0, or @samp{auto}. 0 or @samp{auto} means that it automatically +detects a good number of threads. 1 means to disable multi-threading. + +@item bf +Set maximum number of B-frames. + +@item b_qfactor +Set quantization parameter (QP) factor between P- and B-frames. Value +is a float number. + +@item b_qoffset +Set QP offset between P- and B-frames. Value is a float number. + +@item flags +Set specific encoding flags. Possible values: + +@table @samp + +@item mv4 +Use four motion vector by macroblock. + +@item aic +Enable high quality AC prediction. + +@item gray +Only encode grayscale. + +@item gmc +Enable the use of global motion compensation (GMC). + +@item qpel +Enable quarter-pixel motion compensation. + +@item cgop +Enable closed GOP. + +@item global_header +Place global headers in extradata instead of every keyframe. + +@end table + +@item trellis +Enable trellis-based rate-distortion optimal quantization when set to +1. Default is 0 (disabled). + +@item me_method +Set motion estimation method. Possible values in the decreasing order +of speed and increasing order of quality: + +@table @samp + +@item zero +Use no motion estimation (default). + +@item phods +@item x1 +@item log +Enable advanced diamond zonal search for 16x16 blocks and half-pixel +refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for +@samp{phods}. + +@item epzs +Enable all of the things described above, plus advanced diamond zonal +search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion +estimation on chroma planes. + +@item full +Enable all of the things described above, plus extended 16x16 and 8x8 +blocks search. + +@end table + +@item mbd +Set macroblock decision algorithm. Possible values in the increasing +order of quality: + +@table @samp + +@item simple +Use macroblock comparing function algorithm (default). + +@item bits +Enable rate distortion-based half pixel and quarter pixel refinement for +16x16 blocks. + +@item rd +Enable all of the things described above, plus rate distortion-based +half pixel and quarter pixel refinement for 8x8 blocks, and rate +distortion-based search using square pattern. + +@end table + +@end table
I'm not really happy about duplicating common option documentation. LGTM otherwise.
I deleted the common options in the newer patch. I think that it is better to amend the existing common codec options chapter (add the default value) than to add it in the separate paragraphs. If I have the time in the future, I might do it. Timothy
--- doc/encoders.texi | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/doc/encoders.texi b/doc/encoders.texi index fdf054c..c4226c2 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -1212,6 +1212,121 @@ no-fast-pskip=1:subq=6:8x8dct=0:trellis=0 OUTPUT Encoding ffpresets for common usages are provided so they can be used with the general presets system (e.g. passing the @option{pre} option). +@section libxvid + +Xvid MPEG-4 Part 2 encoder wrapper. + +This encoder requires the presence of the libxvidcore headers and library +during configuration. You need to explicitly configure the build with +@code{--enable-libxvid --enable-gpl}. + +The native @code{mpeg4} encoder supports MPEG-4 Part 2, so users can +encode to this format without this library. + +@subsection Options + +The options follows are supported by the libxvid wrapper. For the +documentation for the undocumented but listed options, please see +@ref{codec-options,,the Codec Options chapter}. + +@table @option +@item b + +@item g + +@item qmin + +@item qmax + +@item mpeg_quant + +@item threads + +@item bf + +@item b_qfactor + +@item b_qoffset + +@item flags +Set specific encoding flags. Possible values: + +@table @samp + +@item mv4 +Use four motion vector by macroblock. + +@item aic +Enable high quality AC prediction. + +@item gray +Only encode grayscale. + +@item gmc +Enable the use of global motion compensation (GMC). + +@item qpel +Enable quarter-pixel motion compensation. + +@item cgop +Enable closed GOP. + +@item global_header +Place global headers in extradata instead of every keyframe. + +@end table + +@item trellis + +@item me_method +Set motion estimation method. Possible values in the decreasing order +of speed and increasing order of quality: + +@table @samp + +@item zero +Use no motion estimation (default). + +@item phods +@item x1 +@item log +Enable advanced diamond zonal search for 16x16 blocks and half-pixel +refinement for 16x16 blocks. @samp{x1} and @samp{log} are aliases for +@samp{phods}. + +@item epzs +Enable all of the things described above, plus advanced diamond zonal +search for 8x8 blocks, half-pixel refinement for 8x8 blocks, and motion +estimation on chroma planes. + +@item full +Enable all of the things described above, plus extended 16x16 and 8x8 +blocks search. + +@end table + +@item mbd +Set macroblock decision algorithm. Possible values in the increasing +order of quality: + +@table @samp + +@item simple +Use macroblock comparing function algorithm (default). + +@item bits +Enable rate distortion-based half pixel and quarter pixel refinement for +16x16 blocks. + +@item rd +Enable all of the things described above, plus rate distortion-based +half pixel and quarter pixel refinement for 8x8 blocks, and rate +distortion-based search using square pattern. + +@end table + +@end table + @section png PNG image encoder. -- 1.8.1.2
On date Monday 2013-07-29 19:12:10 -0700, Timothy Gu encoded:
--- doc/encoders.texi | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) [...]
Applied with some fixes, thanks. -- FFmpeg = Fiendish and Faithful Multimedia Philosophical Encoding/decoding Geek
participants (4)
-
Carl Eugen Hoyos -
Michael Niedermayer -
Stefano Sabatini -
Timothy Gu