Log in

View Full Version : an idea for further enhancing xvid encoding


Blue_MiSfit
11th July 2004, 02:55
This is an offshoot of my earlier posting about another "pass" to further enhance quality.

Basically this idea involves making a more informed decision as to which custom quantization matrix (cqm) to use when encoding your film. The basic algorithm is as follows:

1) break the stream into "scenes", with a "scene" being defined as the span of time between sharp changes in the video image - thus a sort of "rough I-frame estimate"

2) encode each "scene" with each cqm you want to compare at your target bitrate

3) compare each version of each scene to one another with an SSIM test (manual visual comparison is far too time consuming for this process)

4) whichever cqm has the highest number of "wins" is the cqm you should use for the movie

theoretically anyway...

I know SSIM is not as good at analyzing quality as is a manual visual study. However, visually scanning each clip is far too time consuming for the user (you). SSIM is accurate enough for making decisions IMHO, I mean XviD uses PSNR internally for its encoding process - and SSIM is supposed to be better at analyzing video than PSNR anyway isn't it?

Lol... I'm kind of talking out of my ass here but whatever...

just some food for thought
~MiSfit

sysKin
11th July 2004, 04:07
Two comments:
- it would take ages or more. And it's the user who would have to start all gazzilion passes (1st and 2nd for each matrix, and then probably 2nd again).
- xvid doesn't use psnr during encoding (it is able to calculate it, if the user is interested, that's all).

In the end it's just easier to write a tool that takes several encodings (manually done using 1st, 2nd pass and different quantizations) and chooses the one with best SSIM. Same effect.

Blue_MiSfit
11th July 2004, 05:00
thats sort of what i was implying - using perhaps an avisynth script or something along those lines... maybe even an internal routine done by the codec...

manually this would be a hell of an undertaking

Soulhunter
11th July 2004, 19:06
Think 3 different matrices are enough to calculate a average matrix to match the source characteristics !!!

But this requires a "good guess" @ the pre-decision which 3 matrices to use... ;)


Bye