[Ffmpeg-devel] Re: Bethsoft VID demuxer and decoder

Nicholas T ntung
Tue Mar 27 20:07:26 CEST 2007


here's the output when I run it on the sample vid file. it's probably some
stupid mistake. Values were comparable to segafilm.c when I ran it on a
sample .cpk file. I am going to be busy, so forgive me if I don't get back
immediately.

Also, what mailing client should I use so it doesn't break threading? I am
using gmail...I just turned off digest...maybe that will work.

[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] init
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]palette block.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]video block, pts = 4.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 8.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 12.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 16.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 20.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 24.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 28.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]non-offset video block, pts =
32.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]offset video block, pts = 36.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]non-offset video block, pts =
40.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]non-offset video block, pts =
44.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]non-offset video block, pts =
48.
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer]terminating block.
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] decoding frame
[bethsoftvid @ 0x847b17c][bethsoftvid video decoder] closing
[bethsoftvid @ 0x83d0f74][bethsoftvid demuxer] closing

> [about header file]
done, cleaned up other things also

> trailing whitespace
already fixed, please see previous message.

> you missunderstand, no input valid or invalid may cause anything to be
writen
> to unallocated memory
>
> as one example why this is so bad lets assume the buffer is on the stack
> each time a function is called the return address is put on the stack then
> the code jumps to the code of the function and it reserves some space for
> its local variables like our example buffer on the stack, now if we write
> over the end of the buffer we may overwrite this return address.
> but its not overwritten with any random value but rather with exactly what

> is stored in the file, lets assume that the new address will point into
> some packet read from the file and that packet contains executable code
> simply watching a video would turn your poor computer into someone elses
> computer ;)
>
> also asserts are inappropriate to check input validity, an assert() simply
> aborts the whole application if its not true. just think of printf()
aborting
> your editor (without it being able to safe your work) due to a failed
assert()
> similarely a video decoder may not abort the parent application because
some
> video is full of random damaged or even intentionally set bytes
>
> also asserts() are only enabled if debuging is so they are not appropriate

> to check for overflows as they simply arent always enabled ...
I know why buffer overflows are bad...but what am I supposed to use instead
of asserts?

> Vid is not correct as there are also audio packets
The file format is called "VID", so I renamed this to "BVID", hopefully that
will clear some things up

> [about nframes]
now used, will print something out saying end of file shouldn't have been
reached.

> the convertion to native endian uint32_t palette entries belongs in the
> decoder. as the output from the demuxer could be feeded to the avi/mov/...
> muxer and the file then could be transfered from a little endian to a big
> endian system demuxed and decoded there which would lead to the decoder
> getting messed up palette packets
fixed, code is cleaner now.

> uneeded cast, also theres no sense in storing the rle decoded picture
> we only need its length in the demuxer
cast removed. what's the point of reading all of the file to get the length,
then calling create packet, which
will read it all over again?

Nicholas

-- 
http://ntung.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bethsoft.diff
Type: text/x-patch
Size: 19751 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070327/fbd99f33/attachment.bin>



More information about the ffmpeg-devel mailing list