[Ffmpeg-devel] [PATCH] qcelp codec supporrt
Thu Dec 14 10:28:33 CET 2006
Rich Felker wrote:
> On Wed, Dec 13, 2006 at 11:18:02PM +0000, M?ns Rullg?rd wrote:
>>>>> + *p++ = (pkt.data[i] >> 8) & 0xff;
>>>>> + *p++ = pkt.data[i] & 0xff;
>>>> the & 0xff isnt needed
>>> I appended it because I thought signed to unsigned conversion
>>> between two values of the different storage size is not
>>> defined in the C spefication.
>> Conversion to unsigned is well-defined. Conversion to signed is only
>> defined when the value is within the range of the target type. This
>> is mostly because the C standard doesn't specify how negative numbers
>> are represented. Apparently there were some machines in the distant
>> past that used one's complement to represent negative numbers.
> Because their creators failed MATH 101... For all practical purposes,
> all arithmetic is twos complement and signed truncation is well-defined.
Seymour Cray failing math101?
T +32  2 790 29 41
F +32  2 790 29 02
E mailto:mbardiaux at mediaxim.be
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
More information about the ffmpeg-devel