[XviD-devel] [Fwd: Data partitioning for encoder]

sigdrak sigdrak at free.fr
Tue Apr 19 23:13:09 CEST 2005


Seeing the general activity on this list, I took the liberty to forward 
the moderated mail, minus the offending patch (mail too big), for fear 
it may end up with the actual spam in /dev/null

The corresponding patch is available here:
http://sigdrak.free.fr/datapart.patch

-------- Message original --------
Sujet: Data partitioning for encoder
Date: Mon, 18 Apr 2005 20:44:32 +0200
De: sigdrak <sigdrak at free.fr>
Pour: xvid-devel at xvid.org

Hello,

the attached patch should provide data partitioning abilities to the
encoder. This is an adaptation from a patch of an intermediate state of 
development, and for reasons stated later, I can't extract easily the 
equivalent from my current code.

I tested IP...P sequences using mplayer. B frames should not be affected
by data partitioning, per the standard, but I haven't tested. I could 
have tested with MoMuSys but I prefered saving myself the trouble and 
submit this patch right away.

For this I introduced:
- 2 additional bitstream in the encoder creator and frame structure
- 2 additional flags for signaling data partitioning (at the encoder
level and the frame level)
- a function to concatenate bitstreams.
- a modification of functions in mbcoding.c to write to the proper
bitstreams

For info, the bitstream should look (from my recollection of my code)
like this with data partitioning:
- I MB: (mcbpc,dquant,interlace,dc) DC_MARKER (ac_pred_flag,ac)
- P intra MB: (mcbpc) DC_MARKER (dquant,interlace,dc) (ac_pred_flag, ac)
- P inter MB: (mcbpc,mc_sel,MV) MOTION_MARKER (cbpy,dquant,interlace)
(coeffs)

I also wrote functions which are not used yet (or ever) and which I hope
have self-explaining names:
- BitStreamWriteStartOfVideoPacket
- BitstreamWriteGroupOfVopHeader
- BitstreamWriteEndOfSequence
About the two last: I suspect that AVI or proper frame cutting is
responsible for them not being used, and a new VOL is used instead of a GOV.

Globally, I had trouble with indentation: code uses tabs and not spaces
(this is left for trolling on other occasions). So, I hope it won't
break up too many things. I'd be interested if someone has
set up a XVID coding style profile/mode for vi or emacs famillies (see
indentation remark).

I have decoder-side pending code, but unfortunately, it is merged with 
my current work on video packetization. I'd prefer not to go through the 
trouble of making a proper patch for the decoder, as data partitioning 
and video packetiztion get deeply tied at some point. Therefore, I'd 
prefer to see the present patch merged first.

By the way, my packetization seems to work on both encoder and decoder
sides, but I haven't tested it yet on B-frames. I'm opting for a packet
size parameter, as the profiles rather state this limit over any other.
Packetization or data partitioning or normal coding all work separately,
but packetization+data partitioning still fails.

A proper design however is needed before this becomes of any use:
- bumping API, bitstream and any other version (not for 1.1 obviously)
- plugin interfaces for controlling the packetization process
- proper encoder/decoder interfaces based on video packets instead of
full-frame en/decoding
- a plugin specialized in enforcing the video packet sizes whenever
video packetization is used and a profile is selected

Regards,
sigdrak.



More information about the XviD-devel mailing list