[FFmpeg-devel] [PATCH] Add DPX decoder rev-9

Michael Niedermayer michaelni
Mon May 25 23:58:38 CEST 2009


On Mon, May 25, 2009 at 08:54:12AM +0200, Jimmy Christensen wrote:
> On 2009-05-15 03:51, Michael Niedermayer wrote:
>> On Mon, May 11, 2009 at 11:31:25AM +0200, Jimmy Christensen wrote:
[...]
>>
>>
>> [...]
>>> +    for (x = 0; x<  s->height; x++) {
>>> +        uint8_t *dst = ptr;
>>> +        for (y = 0; y<  s->width; y++) {
>>
>>> +            rgbBuffer = AV_RB32(buf);
>>> +            memcpy(&rgb10Field,&rgbBuffer, 4);
>>> +            rgb16Field.R = rgb10Field.R * 64; // 10-bit>  16-bit
>>> +            rgb16Field.G = rgb10Field.G * 64; // 10-bit>  16-bit
>>> +            rgb16Field.B = rgb10Field.B * 64; // 10-bit>  16-bit
>>> +            memcpy(dst,&rgb16Field, dstBpp);
>>
>> not portable
>>
>
> I rewrote a little, but still uses memcpy from rgb16Field to dst, since 
> that should actually be portable. 

you will have to quote page and pararaph of the C standard that gurantees
bitfields to work the way you seem to belive they do


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090525/10db17c9/attachment.pgp>



More information about the ffmpeg-devel mailing list