changeset 4408:291832d8d984

added constant-qscale encoding support with lavc, fixed slightly incorrect definition for the vme lavc option
author rfelker
date Tue, 29 Jan 2002 16:27:21 +0000
parents 760481d8421c
children 61e53100353e
files cfg-mencoder.h mencoder.c
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mencoder.h	Tue Jan 29 12:11:52 2002 +0000
+++ b/cfg-mencoder.h	Tue Jan 29 16:27:21 2002 +0000
@@ -53,7 +53,8 @@
 	{"vcodec", &lavc_param_vcodec, CONF_TYPE_STRING, 0, 0, 0, NULL},
 	{"vbitrate", &lavc_param_vbitrate, CONF_TYPE_INT, CONF_RANGE, 4, 24000000, NULL},
 	{"vhq", &lavc_param_vhq, CONF_TYPE_FLAG, 0, 0, 1, NULL},
-	{"vme", &lavc_param_vme, CONF_TYPE_FLAG, CONF_RANGE, 0, 3, NULL},
+	{"vme", &lavc_param_vme, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL},
+	{"vqscale", &lavc_param_vqscale, CONF_TYPE_INT, CONF_RANGE, 1, 31, NULL},
 	{"keyint", &lavc_param_keyint, CONF_TYPE_INT, 0, 0, 0, NULL},
 	{NULL, NULL, 0, 0, 0, 0, NULL}
 };
--- a/mencoder.c	Tue Jan 29 12:11:52 2002 +0000
+++ b/mencoder.c	Tue Jan 29 16:27:21 2002 +0000
@@ -72,6 +72,7 @@
 int lavc_param_vbitrate = -1;
 int lavc_param_vhq = 0; /* default is realtime encoding */
 int lavc_param_vme = 3;
+int lavc_param_vqscale = 0;
 int lavc_param_keyint = -1;
 #endif
 
@@ -988,11 +989,13 @@
        encoder context - FIXME */
     motion_estimation_method = lavc_param_vme;
 
-#if 0
     /* fixed qscale :p */
-    lavc_venc_context.flags |= CODEC_FLAG_QSCALE;
-    lavc_venc_context.quality = 1;
-#endif
+    if (lavc_param_vqscale)
+    {
+	printf("Using constant qscale = %d (VBR)\n", lavc_param_vqscale);
+	lavc_venc_context.flags |= CODEC_FLAG_QSCALE;
+	lavc_venc_context.quality = lavc_param_vqscale;
+    }
 
     if (avcodec_open(&lavc_venc_context, lavc_venc_codec) != 0)
     {