[XviD-devel] Fw: libxvidcore compiling

Stephan Assmus superstippi at gmx.de
Sat Apr 12 12:16:32 CEST 2008


reno reballos wrote:
> Hi Master Stephan Assmus,
> 
> i have already encoded the raw stream into file and i was able to play it 
> back smoothly with VLC, and the next task is to decompress it through 
> xvid decoding, but along the process of decoding the compressed stream i 
> always got 1 as the return value of the decoding process in effect i got 
> less amount of data compare with the compressed data i.e. my compressed 
> data is 1Mb but when i decompressed it i got less than that sometimes i 
> got 67Kb, now my question is whats wrong with the decoding process?
> 
> another thing, please consider this scenario, i have built already the 
> encoding part and i can save the stream into file and even played it back 
> smoothly using VLC, and i try this file as an input to the xvid_decraw 
> and the result is, it decompresses the stream into single frames with the 
> 1Mb of compressed data i got around 250+ decoded single frames and this 
> is also same thing happens with the example provided by the 
> xvidcore-1.1.3 which is cactus.pgm(raw video format) and 
> my_xvid_example(compressed video format)... i have tried all these file 
> and they work perfectly even with my own xvid compressed file from my 
> application itself...
> 
> please help me why this strange thing happens....? looking forward to 
> hear from you...

My only recommendation is that you start from the xvid_decraw example and 
transform it for use in your application. Here is what I eventually came up 
with for the Haiku decoder plug-in:

<http://dev.haiku-os.org/browser/haiku/trunk/src/add-ons/media/plugins/xvid_decoder>

Interesting to you should only be the XvidDecoder class and specifically 
it's _XvidInit(), Decode() and _XvidDecode() methods. From a 10000 ft view, 
it boils down to feeding xvid a raw stream of bytes. It returns to you the 
number of bytes it consumed and this is what you use to keep track of where 
you are in the buffer. You keep feeding it more bytes and whenever the 
flags you get returned from xvid tell you so, you have successsfully 
decoded a frame (in Decode()):

		if (xvidDecoderStats.type > XVID_TYPE_NOTHING) {
			// got a full frame
			...

Best regards,
-Stephan


More information about the XviD-devel mailing list