[XviD-devel] Colorspace question

suxen_drol suxen_drol at hotmail.com
Sat Dec 6 13:07:39 CET 2003

On Fri, 5 Dec 2003 13:26:48 +0100 Christoph Nägeli <chn at kbw.ch> wrote:
> Hi all,
> I've almost finished my XviD QuickTime Component for OS X, but I've got 
> yet some things to do before I may start by XviD itself.
> As far as I can remember, there was a colorspace constants (I think it 
> was dev-api-2 or something like that) that allowed you to specify a 
> function instead of a bitmap. This function was called as soon as XviD 
> needed to work on the image and that function was allowed to write 
> directly the image into the interal image buffer.
> In dev-api-4 I cannot find something like that, is there a way I may do 
> this? This would prevent one unnecessary copying of data.
> Correct me if this feature has never existed, but I think mplayer used 
> this in the decoder.

there is a "special" decoding colorspace type XVID_CSP_INTERNAL, which
instructs xvid to set the members of the "xframe.output" struct to point
to xvid's internal decoding buffer.

for example
	// set up xframe members
	xframe.output.csp = XVID_CSP_INTERNAL;
	xvid_decore( ... )	// decode frame
	//  xframe.output.plane[0] will point to xvid's internal Y buffer
	//  xframe.output.stride[0] will equal the Y buffer stride
	//  xframe.output.plane[1] will point to xvid's internal U buffer
	// and so on,

> I'm writing an encoder by the way.

the above only applies to the decoder.

-- pete

More information about the XviD-devel mailing list