diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-02-02 19:33:48 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-02-02 19:33:48 +0000 |
commit | 6e0d8c06c7af61859e8d7bc2351a607d8abeab75 (patch) | |
tree | a2046b84143a0191ff3b998ab985c7c54be437aa /libavcodec | |
parent | 957c743a23881636dcc1da307ad9c4ac6b65f7ac (diff) | |
download | ffmpeg-6e0d8c06c7af61859e8d7bc2351a607d8abeab75.tar.gz |
mb_lmin/max to limit the per mb quality for the ratecontrol independant from the frame limits
Originally committed as revision 3928 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 20 | ||||
-rw-r--r-- | libavcodec/ratecontrol.c | 4 | ||||
-rw-r--r-- | libavcodec/utils.c | 4 |
3 files changed, 21 insertions, 7 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index ebb27e536c..826b227df5 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -17,7 +17,7 @@ extern "C" { #define FFMPEG_VERSION_INT 0x000409 #define FFMPEG_VERSION "0.4.9-pre1" -#define LIBAVCODEC_BUILD 4741 +#define LIBAVCODEC_BUILD 4742 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT #define LIBAVCODEC_VERSION FFMPEG_VERSION @@ -1276,14 +1276,14 @@ typedef struct AVCodecContext { /** * minimum MB quantizer. - * - encoding: set by user. + * - encoding: unused * - decoding: unused */ int mb_qmin; /** * maximum MB quantizer. - * - encoding: set by user. + * - encoding: unused * - decoding: unused */ int mb_qmax; @@ -1758,6 +1758,20 @@ typedef struct AVCodecContext { * - decoding: unused */ float border_masking; + + /** + * minimum MB lagrange multipler. + * - encoding: set by user. + * - decoding: unused + */ + int mb_lmin; + + /** + * maximum MB lagrange multipler. + * - encoding: set by user. + * - decoding: unused + */ + int mb_lmax; } AVCodecContext; diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c index 04f1e5bc80..19641d453d 100644 --- a/libavcodec/ratecontrol.c +++ b/libavcodec/ratecontrol.c @@ -506,8 +506,8 @@ static void adaptive_quantization(MpegEncContext *s, double q){ float cplx_sum= 0.0; float cplx_tab[s->mb_num]; float bits_tab[s->mb_num]; - const int qmin= s->avctx->lmin; - const int qmax= s->avctx->lmax; + const int qmin= s->avctx->mb_lmin; + const int qmax= s->avctx->mb_lmax; Picture * const pic= &s->current_picture; const int mb_width = s->mb_width; const int mb_height = s->mb_height; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d7a7ed464b..99de9d38c6 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -430,8 +430,8 @@ void avcodec_get_context_defaults(AVCodecContext *s){ s->bit_rate_tolerance= s->bit_rate*10; s->qmin= 2; s->qmax= 31; - s->mb_qmin= 2; - s->mb_qmax= 31; + s->mb_lmin= FF_QP2LAMBDA * 2; + s->mb_lmax= FF_QP2LAMBDA * 31; s->rc_eq= "tex^qComp"; s->qcompress= 0.5; s->max_qdiff= 3; |