[MPlayer-dev-eng] [PATCH] tga loader for libmpcodecs

Alex Beregszaszi alex at galaktik.hu
Fri Sep 13 18:30:53 CEST 2002


Hi,

> > anyway, you've added BGR24 to codecs.conf too, but your code doesn't seem to
> > support 24bpp output:
> >
> >                     *final++ = chans.a = (info.bpp == 32) ? *data++ : 255;
> > 
> > the 4th write to final[] should not be done if mpi->bpp==24
> > for now i've removed BGR24 from codecs.conf.
> > 
> > anyway the code could be optimized a lot, by doing memcpy() for the cases
> > when input and output bpp matches.
> 
> Alright, I speeded up the code. I switched back to BGR, so I can directly copy input to output. However, I still don't know how to really set the format of the output data. I implemented the VDCTRL_QUERY_FORMAT stuff in control().
> 
> If I understand that correctly, VDCTRL_QUERY_FORMAT gives information about the supported formats... So I return CONTROL_TRUE when the tga decoder is queried for IMGFMT_BGR24 or IMGFMT_BGR32. Basically, I just want to use BGR24 for 24bpp TGA files and BGR32 for 32bpp TGA files at the moment (that way I can decode quite fast). Is it possible to do so?
That's what for VDCTRL_QUERY_FORMAT is.
Return TRUE for bgr24 if your file is a 24bpp one, and bgr32 if it's a 32bpp one.
Else return FALSE.

-- 
Alex Beregszaszi  <alex at naxine.org>



More information about the MPlayer-dev-eng mailing list