[FFmpeg-cvslog] r24223 - in trunk/libavcodec: libvpxenc.c options.c

cehoyos subversion
Mon Jul 12 23:23:04 CEST 2010


Author: cehoyos
Date: Mon Jul 12 23:23:03 2010
New Revision: 24223

Log:
Do not map video quantizer scale (from 1-51 to 0-63) for libvpx anymore.

Patch by James Zern, jzern google

Modified:
   trunk/libavcodec/libvpxenc.c
   trunk/libavcodec/options.c

Modified: trunk/libavcodec/libvpxenc.c
==============================================================================
--- trunk/libavcodec/libvpxenc.c	Mon Jul 12 23:17:10 2010	(r24222)
+++ trunk/libavcodec/libvpxenc.c	Mon Jul 12 23:23:03 2010	(r24223)
@@ -237,9 +237,8 @@ static av_cold int vp8_init(AVCodecConte
     enccfg.rc_target_bitrate = av_rescale_rnd(avctx->bit_rate, 1, 1000,
                                               AV_ROUND_NEAR_INF);
 
-    //convert [1,51] -> [0,63]
-    enccfg.rc_min_quantizer = ((avctx->qmin * 5 + 1) >> 2) - 1;
-    enccfg.rc_max_quantizer = ((avctx->qmax * 5 + 1) >> 2) - 1;
+    enccfg.rc_min_quantizer = avctx->qmin;
+    enccfg.rc_max_quantizer = avctx->qmax;
     enccfg.rc_dropframe_thresh = avctx->frame_skip_threshold;
 
     //_enc_init() will balk if kf_min_dist differs from max w/VPX_KF_AUTO

Modified: trunk/libavcodec/options.c
==============================================================================
--- trunk/libavcodec/options.c	Mon Jul 12 23:17:10 2010	(r24222)
+++ trunk/libavcodec/options.c	Mon Jul 12 23:23:03 2010	(r24223)
@@ -117,8 +117,8 @@ static const AVOption options[]={
 {"delay", NULL, OFFSET(delay), FF_OPT_TYPE_INT, DEFAULT, INT_MIN, INT_MAX},
 {"qcomp", "video quantizer scale compression (VBR)", OFFSET(qcompress), FF_OPT_TYPE_FLOAT, 0.5, -FLT_MAX, FLT_MAX, V|E},
 {"qblur", "video quantizer scale blur (VBR)", OFFSET(qblur), FF_OPT_TYPE_FLOAT, 0.5, 0, FLT_MAX, V|E},
-{"qmin", "min video quantizer scale (VBR)", OFFSET(qmin), FF_OPT_TYPE_INT, 2, 1, 63, V|E},
-{"qmax", "max video quantizer scale (VBR)", OFFSET(qmax), FF_OPT_TYPE_INT, 31, 1, 63, V|E},
+{"qmin", "min video quantizer scale (VBR)", OFFSET(qmin), FF_OPT_TYPE_INT, 2, 0, 63, V|E},
+{"qmax", "max video quantizer scale (VBR)", OFFSET(qmax), FF_OPT_TYPE_INT, 31, 0, 63, V|E},
 {"qdiff", "max difference between the quantizer scale (VBR)", OFFSET(max_qdiff), FF_OPT_TYPE_INT, 3, INT_MIN, INT_MAX, V|E},
 {"bf", "use 'frames' B frames", OFFSET(max_b_frames), FF_OPT_TYPE_INT, DEFAULT, 0, FF_MAX_B_FRAMES, V|E},
 {"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), FF_OPT_TYPE_FLOAT, 1.25, -FLT_MAX, FLT_MAX, V|E},



More information about the ffmpeg-cvslog mailing list