[XviD-devel] padding bytes in stream?
Stephan Assmus
superstippi at gmx.de
Tue Jul 3 09:22:53 CEST 2007
Hello all,
First of all, thank you for a great software package! It is clean and well
documented, it was easy to dive into it and be productive quickly. Thanks!
I was wondering about the decode example with regards to MIN_USEFUL_BYTES
(defined to 1). In the example, new data is fetched when there is less or
equal to MIN_USEFUL_BYTES left in the source buffer. I used this code to
write a BeOS decoder plugin. There is a function that the decoder can use,
which will give it the "next chunk" of data from the extractor (ie AVI). I
keep fetching chunk buffers and feeding them into xvid until I successfully
decoded a frame. On the next request to decode a frame, I feed the left
over bytes of the last chunk buffer into xvid and start fetching the next
chunks and so on. My question is about MIN_USEFUL_BYTES. When xvid left
just 1 byte in the buffer, should I prepend that byte to the next buffer or
can it be safely discarded (like it is just some kind of padding). Right
now, I just discard this byte and the codec seems to work fine, but someone
looked over my code and spotted this and said I should probably not drop
that byte... any insights?
Thanks and best regards,
-Stephan
More information about the XviD-devel
mailing list