[theora-dev] VP3 In ffmpeg

Mike Melanson melanson at pcisys.net
Sun May 4 20:01:42 PDT 2003

        Sorry for taking so long with this, but I finally committed a
first pass of my own VP3 decoder to the ffmpeg codebase. You can browse
the source here:


vp3.c and vp3data.h are the files in question. Attached is a message I
sent to the ffmpeg-devel list about the new decoder and its present

        Have fun...

	-Mike Melanson

<p><p>---------- Forwarded message ----------
Date: Sun, 4 May 2003 20:55:54 -0600 (MDT)
From: Mike Melanson <melanson at pcisys.net>
To: ffmpeg-devel at lists.sourceforge.net
Subject: VP3 Is Here

	Sorry for the delay; I sort of went stagnant on multimedia hacking
for the past 2 months. But I have been working hard for the past few days
to finish up the new VP3 decoder and it is (almost) ready to go. Here are
some outstanding issues:

* I can not make it play nicely with ffmpeg (I do my development and
testing in xine). When I hook it up, ffmpeg always crashes after the first
frame decode. gdb points back to av_free() but I am willing to admit there
is probably something wrong with my decoder which causes it.

* If you do get it to run, you will immediately notice something missing,
like all of the motion-compensated macroblocks. There are 2 things at work
here: I can not even begin to understand how ffmpeg does half-pel motion
compensation (needed for Y MC), and I still have not completely examined
how VP3 does quarterpel MC (needed for U&V MC). This is the single comment
packaged in the VP3 source:

"For the U and V planes the MV specifies 1/4 pixel accuracy. This is
adjusted to 1/2 pixel as follows ( 0->0, 1/4->1/2, 1/2->1/2, 3/4->1/2 )."

Any clarifications on ffmpeg's MC facilities would be appreciated.

* Huffman tables: Yes, more huge data tables (vp3data.h). Ideally, I would
like to turn these into static histograms. It does not matter right now,
but Theora is supposed to transport histograms with the video data. So we
will need the histogram -> Huffman support eventually.

* I tried to get CODEC_CAP_DR1 to work, but I kept getting an avcodec
assertion about the frame being the wrong type.

* I have not even tried to get slice dispatching to work, but it should
not be too hard with a little code shuffling. All of the necessary data is
available by the final rendering phase, before all the IDCT and MC takes

* Documentation: Now that I have a (nearly) complete decoder, I should be
able to finish up my document in the next few days.

* Is there a recommended way to copy blocks from the last frame to the
current one? Right now I am just using 8 memcpy()'s.

	Enjoy (and good luck! :)
	-Mike Melanson

<p><p><p>--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'theora-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Theora-dev mailing list