[FFmpeg-devel] [RFC v2 3/3] daaladec: Implement a native Daala decoder

Ganesh Ajjanagadde gajjanag at mit.edu
Tue Dec 29 19:54:10 CET 2015

On Tue, Dec 29, 2015 at 10:42 AM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
> Hi,
> On Tue, Dec 29, 2015 at 12:25 PM, Michael Niedermayer <
> michael at niedermayer.cc> wrote:
>> On Tue, Dec 29, 2015 at 02:12:44AM +0000, Rostislav Pehlivanov wrote:
>> > +#define DAALAENT_PVQ_NOVAL    (-2147483647-1)
>> why is the 1 not already subtracted in the written value ?

Because there are no negative integer literals in C:
http://en.cppreference.com/w/cpp/language/integer_literal, i.e a -
sign applies unary minus, but 2147483648 is not representable in 32
bits, Thus, this literal will then have the type long int, or long
long int depending on where it can fit. And because of the beauty of
MSVC, it might not actually be able to use long long int, making the
whole thing undefined behavior. Even without that, the type of this
should really be int32_t or int.

See /usr/include/stdint.h for this approach (to define INT32_MIN),
thus Ronald's idea is better.

> I think it's MIN_INT32, maybe just write that.

You mean INT32_MIN :).

> Ronald
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

More information about the ffmpeg-devel mailing list