From 158c7f059c3906b0116ae73a7669a3bb7bc570bb Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 7 Oct 2003 11:32:40 +0000 Subject: 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 --- libavcodec/avcodec.h | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) (limited to 'libavcodec/avcodec.h') 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<