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

Nicholas T ntung
Wed Mar 28 03:25:40 CEST 2007

okay, great, that fixed it. I thought it was some small mistake. Thanks.

I got the audio to work!!! :) It's not reading the sample rate yet, or
setting audio pts, sorry. Is it my decoder, or is the voice acting in
ANIM0000 not as good as DAG2?


On 3/27/07, Michael Niedermayer <michaelni at gmx.at> wrote:
> theres still trailing whitespace in the patch
sorry, I turned it off in my editor

> return -1
done, and with the invalid starting block, the av_log is with ERROR
instead of VERBOSE.

> its not the job of the demuxer to decode the video frames
> the demuxer doesnt has access to AVCodecContext.get/release_buffer() which
> means it cant use direct rendering
> decoding in the demuxer breaks stream copy
> if the video is stored in another container which does store the packet
> size then a decoder seperate from a demuxer is needed
is there a misunderstanding here? There is no decoding, but the whole
frame does need to be read, and I was storing it as I read it, instead
of storing the length and then reading it again. As you can see, for
the case of RLE sequences, the demuxer does "vidbuf++[0] =
get_byte(pb);", whereas the decoder does a memset.

> both these functions fail if a single run is over 3 lines
> also x + length occurs 5 times in the 2 functions, it likely would be faster
> not to redo this and hope the compiler would remove it
> thats also one reason why i dont like to hide such trivial code in functions
> it hides such trivial optimization opertunities
which it shouldn't be, because the width is 256 or 320. Do you suggest
skipping the memset and just copying characters? This is what another
codec did.

> bytestream_get_le16(&buf)
okay, thanks

> it should be more efficient to do the memsets directly into the destination
> buffer
but I can't use the same function twice...

> the function does nothing and is thus unneeded
it should have been doing something. the demuxer wasn't, so I deleted
that. Mike Melanson: perhaps you could remove yours in idcin.c as

> comment is not doxygen compatible

> duplicate comment
oops, fixed.

> the cast is unneeded

> the demuxer should not modify the packet beyond the absolute neccesary
I can't set a 0 so I don't have to do the check over again?

> calling av_new_packet(pkt) after setting pkt->pts of course cannot work
Thank you so much! It works :)

> non constant static variables break thread safety
I put this in BVID_DemuxContext; is that okay?

> calling exit() in a demuxer is not ok
fixed, all exits gone

> this function does nothing so its unneeded
fixed (as noted above)

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

More information about the ffmpeg-devel mailing list