[FFmpeg-soc] Dirac encoder design

Marco Gerards mgerards at xs4all.nl
Fri Aug 17 12:21:03 CEST 2007


Hi,

At the moment I am working on the Dirac encoder.  This is the first
time I write a video encoder and I am not yet familiar with which
other encoders have similar issues.  I hope some of you can give me a
push in the right direction, a good approach from the beginning can
save a lot of time.

The main issue I encountered is writing out subbands encoded using
arithmetic coding.  They have to be prefixed with their length,
encoded using exp. Golomb (so variable length).

At the moment I have a PutBitContext, but of course I can not write
this data in sequence.  What would be the right approach?  Creating a
new PutBitContext, use it to do the arithmetic coding, write the
golomb code to the first PutBitContext.

After that I have to skip_put_bytes for the first PutBitContext,
memcpy the data and continue from there.

As for the buffer to use for arithmetic coding, how much memory do I
have to reserve for this?  For my feeling it has to be about the size
of the frame to fit within any safety margin (for both band coding and
MC data coding).  I assume I just have to do this at encoder
initialization time.

So hopefully I am on the right track.  I rather hear "your ideas are
silly" than "your code sucks" after finishing this code :-).  Are
there any other issues regarding encoding I could encounter and have
to take care of?  Any help on this can save me lots of time :-).

Thanks,
Marco




More information about the FFmpeg-soc mailing list