From: Diego Biurrun Date: Fri, 8 Jan 2010 10:00:56 +0000 (+0000) Subject: Explain why the level variable is magically inceased in mpeg4_encode_dc(). X-Git-Tag: v0.6~2075 X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=49d2d1c35cc0438747dd8ef111163cb341f8f9fe Explain why the level variable is magically inceased in mpeg4_encode_dc(). It must be in a certain range to avoid DC overflows. Originally committed as revision 21087 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 64cbecba9a..36dd3c90a2 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -242,6 +242,7 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s){ static inline void mpeg4_encode_dc(PutBitContext * s, int level, int n) { #if 1 + /* DC will overflow if level is outside the [-255,255] range. */ level+=256; if (n < 4) { /* luminance */