[Ffmpeg-cvslog] CVS: ffmpeg/libavcodec bmp.c, NONE, 1.1 allcodecs.c, 1.115, 1.116 Makefile, 1.212, 1.213 avcodec.h, 1.428, 1.429

Måns Rullgård mru
Wed Nov 30 10:49:39 CET 2005


Michael Niedermayer said:
> Hi
>
> On Wed, Nov 30, 2005 at 02:40:52AM +0100, M?ns Rullg?rd CVS wrote:
> [...]
>>     switch(depth){
>>     case 16:
>>         for(i = 0; i < avctx->height; i++){
>>             uint16_t *src = (uint16_t *) buf;
>>             uint16_t *dst = (uint16_t *) ptr;
>>
>>             for(j = 0; j < avctx->width; j++)
>>                 *dst++ = le2me_16(*src++);
>>
>>             buf += n;
>>             ptr += linesize;
>>         }
>>         break;
>>     case 32:
>>         for(i = 0; i < avctx->height; i++){
>>             uint8_t *src = buf;
>>             uint8_t *dst = ptr;
>>
>>             for(j = 0; j < avctx->width; j++){
>>                 dst[0] = src[rgb[2]];
>>                 dst[1] = src[rgb[1]];
>>                 dst[2] = src[rgb[0]];
>
> hmm, i love pixel format conversation code in codecs ...
> please at least add a note to the source explaining that this is not the
> way its supposed to be done but that instead a new PIX_FMT should be added
> for each new pixel format,

That way we'll end up with a PIX_FMT for every permutation of component
orders.  I agree that converting between "standard" formats in a codec
shouldn't be done.  Dealing with arbitrary pixel layouts in every app is
a nuisance.  Even though it's not compressed, it can still be considered
an encoded format that needs to be decoded into a normal format.

> also please avoid the memcpy() stuff, see raw.c on how this is possible

OK, I'll have a look.  I was looking at pnm.c, and it uses memcpy().  I
guess it should be fixed too...

-- 
M?ns Rullg?rd
mru at mru.ath.cx





More information about the ffmpeg-cvslog mailing list