[Ffmpeg-devel] help on forcing rgb555 with 16bpp

Michael Niedermayer michaelni
Tue Oct 24 13:57:59 CEST 2006


Hi

On Tue, Oct 24, 2006 at 04:25:29AM -0300, Reynaldo H. Verdejo Pinochet wrote:
> Hi folks
> 
> Im a little confused by the way raw.c chooses PIX_FMT using the
> bits_per_sample value. Looking at the raw_init_decoder function, how
> am I supossed to get my data interpreted as rgb555 by the raw
> decoder if:
> 
> 1.- bits per sample is 16bpp.
> 2.- I have no mapping for the packed PIX_FMT_RGB555 on pixelFormatTags[].

find a sechole in lavc and exploit it and change the pix_fmt ;)


> 
> I'm thinking there is need to add RGB mappings to pixelFormatTags. If

yes or set bits per sample to 15


> that's true how do i choose a tag? Should I just invent some?  And last 
> but not least, why does the raw decoder choose PIX_FMT using bpp if there 
> are packed formats that share that bitcount (ie RGB565 RGB555) ?

because AVI uses the same codec_tag for all rgb variants
the problem is the silly design of avi ...

setting the pix_fmt in avi alone doesnt help at all, as muxers generally dont
use the pix_fmt and making all demuxers and muxers set/get the pix_fmt would
likely be far too messy (and then the same would have to be done with audio)

setting a fake codec_tag in avidec.c would be an easy and simple solution ...

having a codec_id per pix_fmt would be another one but that too would
likely become messy

also look at the mailinglist archives this was disscussed already a few
times but noone posted any acceptable patches to fix it

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

In the past you could go to a library and read, borrow or copy any book
Today you'd get arrested for mere telling someone where the library is




More information about the ffmpeg-devel mailing list