[FFmpeg-soc] [soc]: r1335 - dirac/libavcodec/dirac.c

Marco Gerards mgerards at xs4all.nl
Mon Sep 10 20:14:19 CEST 2007


marco <subversion at mplayerhq.hu> writes:

> Author: marco
> Date: Mon Sep 10 18:14:17 2007
> New Revision: 1335
>
> Log:
> fix the code to check for a zero codeblock
>
> Modified:
>    dirac/libavcodec/dirac.c

With this commit packing of the motion vectors work.  For now I just
use semi-random motion vectors and calculate a residue based on that.
Of course this is not useful for other reasons than testing if motion
vector packing works and it does.  Now the encoder does support
writing the bitstream for intra and inter frames.

So the next logical step is searching for optimal/good motion vectors.
As you know, I have no prior experience in multimedia and FFmpeg.  So
my questions can be quite silly or trivial.

First of all, am I right that the goal of a good ME is decreasing the
information in the residue?  In that case the residue gets smaller
when compressed.  So a better match results in a smaller residue thus
better compression.

Next, I wonder how to proceed.  Can I use a ME algorithm from FFmpeg?
Michael mentioned iterative_me, from Snow.  I assume this is the only
OBMC ME algorithm in FFmpeg?  It's quite hard for me to understand
this code and to understand if it is possible to use this at all.

So I will just explain what I need.  Dirac uses OBMC.  The blocks are
obviously overlapped.  The blocks are described using these variables,
for which I included some sample values:

xbsep = 8
xblen = 12
ybsep = 8
yblen = 12

xbsep/ybsep is the space between the blocks

For every block the following information is stored:

- Flag for reference to use: First reference frame, second reference
                             frame, both or none (DC value)
- 2 vectors (one for each reference frame)
- DC value (3 components)

Besides that, Dirac has a weight for the reference frames.  So when
you use two reference frames, you can give one a stronger weight.
According to the specification you can use this for fading, etc.

Dirac supports pixel, halfpel, qpel and eighthpel motion compensation.

I am quite overwhelmed by the FFmpeg code.  Especially because most ME
code seems to depend on a MpegContext and it doesn't look like it is
easy to use.  Any pointers that can help me to actually use this are
appreciated! :-)

Thanks,
Marco




More information about the FFmpeg-soc mailing list