[Ffmpeg-devel] tiff encoder (qualification task for GSoC)

Bobby Bingham uhmmmm
Fri Mar 23 03:27:46 CET 2007


Michael Niedermayer wrote:
>>  
>> +static void tput_short(uint8_t **p, int x, int le){
>> +    if(le){
>> +        **p = x & 0xff;
>> +        *(*p + 1) = x >> 8;
>> +    }else{
>> +        *(*p + 1) = x & 0xff;
>> +        *(*p) = x >> 8;
>> +    }
>> +    *p += 2;
>> +}
>> +
>> +static void tput_long(uint8_t **p, long x, int le){
>> +    if(le){
>> +        **p = x & 0xff;
>> +        *(*p + 1) = (x >> 8) & 0xff;
>> +        *(*p + 2) = (x >> 16) & 0xff;
>> +        *(*p + 3) = (x >> 24);
>> +    }else{
>> +        *(*p + 3) = x & 0xff;
>> +        *(*p + 2) = (x >> 8) & 0xff;
>> +        *(*p + 1) = (x >> 16) & 0xff;
>> +        *(*p) = (x >> 24);
>> +    }
>> +    *p += 4;
>> +}
> 
> please use bytestream_put_le or be*() also is there any reason why be and le
> is supported in the encoder, this seems unneeded complexity
> 
> 

The first two bytes of a TIFF file specify whether the file is in little 
or big endian, so it's certainly possible to encode to either.  But 
since all decoders are required to read either, I think it'd just be 
fastest and simplest to encode in the host's native endianness and leave 
it at that.

-- 
Bobby Bingham
??????????????????????




More information about the ffmpeg-devel mailing list