[theora] More information on GSoC project

saulgoode at flashingtwelve.brickfilms.com saulgoode at flashingtwelve.brickfilms.com
Sat Apr 5 06:17:47 PDT 2008

Sorry about the preceding post, I have a pretty crappy email service.

On 4/2/08, Nuwan Millawitiya <millawitiya at gmail.com> wrote:

> I am interesting to do this project. I am a student of computer
> science & engineering. Nowadays I am working with theora codec to optimize
> the theora codec for narrow bandwidth conferencing. According to Saul\'s
> and Ivo Emanuel Gonçalve\'s reply, this is an interesting project and it is
> very useful.
> According to the Saul\'s reply, this can be done. (But I never worked
> with the code of GIMP).
> On Tue, Apr 1, 2008 at 9:40 PM, Ivo Emanuel Gonçalves <justivo at gmail.com>
> wrote:
>> Saul is clearly the one who can tell if this is feasable, but my idea
>> was to build a wrapper around png2theora. So, I guess GIMP would
>> export all data to PNG first and then pass it through png2theora and
>> get a video file.

To be more precise about the task, it is not directly GIMP which is to  
be modified, but the GIMP Animation Package (GAP). The GAP is  
technically maintained as a separate project from GIMP -- it has its  
own Bugzilla bug-tracking module & release schedule, and is typically  
offered as a separate download (this sort of separation is also seen  
in the GIMP-HELP and the GIMP-PRINT projects).

I emphasize the nature of this because it simplifies the task of  
adding OGG Theora support to GIMP. There is no need to modify GIMP  
code (or even examine it); the GAP is implemented as a set of plug-ins  
that communicate with GIMP through a Procedural DataBase (PDB) and  
transfer image data to and from the GIMP core in a \"pixel region\" or  
tile-based manner (plug-ins do not directly access image data). There  
is more information about this on the second page Dave Neary\'s  
tutorial (see http://developer.gimp.org/writing-a-plug-in/1/index.html).

An encoder only needs to retrieve image data from the GIMP -- there is  
no need to send any image data back to the core -- and the data only  
needs to be accessed once. This means that \"pixel region\" based  
retrieval method (which is simpler to implement than the tile-based  
method) would be sufficient.

The image data is stored using the RGB colorspace, 8-bits per pixel  
per channel. There are functions available in libgimp to convert to  
Y\'CbCr space but it would probably be more efficient to code that  
yourself. It might even be simpler owing to the added problem of  
padding out the Theora pages to 16-pixel boundaries.

The idea of saving to a PNG and then calling png2theora would work,  
but is probably more complicated than performing the conversion  
directly (and adds a dependency). (In fact, the GAP\'s  
\"Video->Convert frames\" command can currently be used to save the  
images to PNG format which can then be converted to Theora using  
png2theora externally).

The task of adding OGG Theora encoding to GIMP is certainly feasible  
and I should be more than willing to assist a GSoC project from a  
technical level (I am not willing to join Google Groups or be an  
official mentor).

More information about the theora mailing list