[XviD-devel] A SSIM Plugin for XviD

Johannes Reinhardt Johannes.Reinhardt at uni-konstanz.de
Tue Oct 10 17:44:54 CEST 2006


Hi,

I hacked together a plugin that calculates the ssim quality metric
(http://www.cns.nyu.edu/~lcv/ssim/) for every encoded frame and outputs
a summary for every frame and at the end. The ssim stats can be written
into a file.

There are 3 patches put here:

http://xvid.ist-dein-freund.de/stuff/ssim01.zip

I tried to attach them to the mail, but the list complains about mails > 
10 kB.

example_make.diff: Fixes a problem with the examples makefile and Linux
by replacing the explicit name of the static lib with the one from
platform.inc

ssim_core.diff: Includes plugin_ssim into xvidcore like the other plugins

rawenc.diff: Integrates plugin_ssim into xvid_rawenc and adds two new
commandlineswitches

Then there is

plugin_ssim.c: The source file of the plugin. Belongs to
xvidcore/src/plugins

plugin_ssim-a.asm: Some asm routines to speed things up a bit. Belongs
to xvidcore/src/plugins


Some notes:

There is code in plugin_ssim.c to visualize the ssim error between
original and compressed frame. It uses display.h and display-x11.c from
x264 and only works with X. I am not sure how to do tell
automake/configure to include these only in *NIX. Is it ok to #ifdef the
specific code?

The computation of ssim is slow. I tried to speed it up with a bit asm,
but I have not coded in asm before. It would be great if some of the asm
wizards could comment. It can be sped up more by reducing accuracy, by
changing GRID to 2 or 4. But there seems to lurks a bug, as this 
sometimes gives strange results. I will look into this.

The calculated ssim values can differ from the ones avisynth or x264
calculates, so only use them to compare different xvid settings.
I call check_cpu_features() in order to turn the sse/mmx code on. What
about adding things cpu features and number of threads to
xvid_plg_create_t. There are some deprecated fields in xvid_plg_create_t
that should have been removed before 1.0.

I think about threading the ssim calculation. What would be the best way
doing this? Using the macros from motion_smp?


Regards,

Johannes




More information about the XviD-devel mailing list