diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-10-07 11:32:40 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-10-07 11:32:40 +0000 |
commit | 158c7f059c3906b0116ae73a7669a3bb7bc570bb (patch) | |
tree | 1dbb85c2164bec440148a818aeafd6c6197b80c6 /libavcodec/avcodec.h | |
parent | 72385798357e53f64ba5ac405fb1b227ddcffc6c (diff) | |
download | ffmpeg-158c7f059c3906b0116ae73a7669a3bb7bc570bb.tar.gz |
use lagrange multipler instead of qp for ratecontrol, this may break some things, tell me ASAP if u notice anything broken
quality which was 1..31 float is now a 1..FF_LAMBDA_MAX int, and FF_QP2LAMBDA * qp can be used to convert to the new range
Originally committed as revision 2348 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/avcodec.h')
-rw-r--r-- | libavcodec/avcodec.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a1e7e4e076..99cd1d1381 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -15,7 +15,7 @@ extern "C" { #define FFMPEG_VERSION_INT 0x000408 #define FFMPEG_VERSION "0.4.8" -#define LIBAVCODEC_BUILD 4683 +#define LIBAVCODEC_BUILD 4684 #define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT #define LIBAVCODEC_VERSION FFMPEG_VERSION @@ -316,15 +316,15 @@ static const int Motion_Est_QTab[] = { ME_ZERO, ME_PHODS, ME_LOG, int display_picture_number;\ \ /**\ - * quality (between 1 (good) and 31 (bad)) \ + * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \ * - encoding: set by lavc for coded_picture (and set by user for input)\ * - decoding: set by lavc\ */\ - float quality; \ + int quality; \ \ /**\ * buffer age (1->was last buffer and dint change, 2->..., ...).\ - * set to something large if the buffer has not been used yet \ + * set to INT_MAX if the buffer has not been used yet \ * - encoding: unused\ * - decoding: MUST be set by get_buffer()\ */\ @@ -1181,8 +1181,13 @@ typedef struct AVCodecContext { * Dont touch, used by lavc default_get_buffer() */ void *internal_buffer; - -#define FF_QUALITY_SCALE 256 + +#define FF_LAMBDA_SHIFT 7 +#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT) +#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda +#define FF_LAMBDA_MAX (256*128-1) + +#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove /** * global quality for codecs which cannot change it per frame. * this should be proportional to MPEG1/2/4 qscale. @@ -1263,6 +1268,20 @@ typedef struct AVCodecContext { * - decoding: unused */ int scenechange_threshold; + + /** + * minimum lagrange multipler + * - encoding: set by user. + * - decoding: unused + */ + int lmin; + + /** + * maximum lagrange multipler + * - encoding: set by user. + * - decoding: unused + */ + int lmax; } AVCodecContext; |