1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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
This commit is contained in:
Diego Biurrun 2010-01-08 10:00:56 +00:00
parent d3c01751a3
commit 49d2d1c35c

View File

@ -242,6 +242,7 @@ void ff_clean_mpeg4_qscales(MpegEncContext *s){
static inline void mpeg4_encode_dc(PutBitContext * s, int level, int n) static inline void mpeg4_encode_dc(PutBitContext * s, int level, int n)
{ {
#if 1 #if 1
/* DC will overflow if level is outside the [-255,255] range. */
level+=256; level+=256;
if (n < 4) { if (n < 4) {
/* luminance */ /* luminance */