Log in

View Full Version : Jawor's 2CD Quantization Matrix


Jawor
17th December 2004, 14:10
Ooops! I did it again...

Originally posted by Alxemi
What about a Jawor´s 2CD quantization matrix? :)
(http://forum.doom9.org/showthread.php?threadid=74463&perpage=20&pagenumber=4)

Here it is! ;)

This time I want to preserve as much image detail, as I can when encoding at high bitrates. I used the zigzag scan order to

define matrix coefficents. This time the INTER matrix has lower coefficents than the INTRA matrix. Results of

preliminary tests are quite good.

Jawor's 2CD Matrix (http://www.mat.uni.torun.pl/~jawor/matrix/index.html)

(direct link (http://www.mat.uni.torun.pl/~jawor/matrix/Jawor_2CD_Matrix.xcm)).

I used chapters 1, 8, 20, 22 and 29 of The Matrix (DVD, R2, PAL) as my test clip.

Software used: VDM 1.5.4.1, AviSynth 2.5.5 (DGDecode), DGIndex, Windows 2000 Professional, DirectX 9.

Screenshots were done with VDM (through Avisynth - DirectShowSource()). ffdshow 18.07.2004 did the decoding

(without postprocessing).

The script:
MPEG2Source("matrix.d2v")
Crop(0,78,-0,-78,align=true)
UnDot()
Lanczos4Resize(640,256) # according to ITU-R BT.601

XviD settings:
MSP=6, VHQ=1, chroma motion
Qpel & GMC ON
B-VOPs 2/1.50/1.00, sensitivity=-5
Closed GOV ON, packed bitstream OFF
AQ & interlace OFF
quantizers 2-31
Turbo & cartoon OFF
Trellis & chroma optimizer ON
"fast" 1st pass at constant quant = 3
2nd pass target bitrate = 1000 kbps

The test clip is 17 minutes 25 secons long and contains both low and high motion stuff. Chapter 1 has a lot of darkness,

there's the green Matrix code and policemen with flashlights that easily causze ringing. In chapter 8 Morpheus talks to Neo

in the abandoned hotel (highly textured wallpapers). In chapter 20 we see the crew of the Nebuchadnezzar in the ship's

mess (grey and blue). In chapter 22 Neo meets the Oracle in her warm-colored kitchen. Chapter 29 is the famous lobby shootout

with lots of debris flying around.

ATM I can show you screenshots from Six of Nine HVS and Jawor's 2CD Matrix encodes. Stay tuned... ;)

<EDIT>
I put the screenshots in separate posts.
</EDIT>

P.S. I'm sorry if the screenshots load up very slow. I tried to upload them at http://www.imageshack.us several times, but some of them just won't show up in the browser (there was just an outline). Right now, they're in Poland at http://www.divx.howto.pl.

Sharktooth
17th December 2004, 15:39
Ok, i've seen the screenshots but i fail to estabilish what's better without the source images.
It seems to me that sometimes 6of9 is somewhat more sharper than your matrix, but sometimes it's the opposite way (maybe it's due to the zigzag distribuition).
Also there are differencies in the image backgrounds between the 2. But those are less noticeable (i think) during playback.
Plz attach the source images:)

Didée
17th December 2004, 16:31
I'm tempted to analyze this matrix - but better spare it for now, and only follow the discussion ;)

(Tip: in medium/low-motion scenes, compare frames far away from an I-frame, not those very closely after an I-frame.)

Sharktooth
17th December 2004, 16:32
I'm doing an encode. I will tell you what are my impressions later.

Jawor
20th December 2004, 11:13
source frame
http://img132.exs.cx/img132/2363/sourcei1ar.png
Six of Nine max=20
http://www.divx.howto.pl/images/nowosci/Jawor/6of920_I.png
Six of Nine HVS
http://www.divx.howto.pl/images/nowosci/Jawor/6of9hvs_I.png
HVS Best Picture
http://www.divx.howto.pl/images/nowosci/Jawor/HVSBest_I.png
MPEG
http://www.divx.howto.pl/images/nowosci/Jawor/MPEG_I.png
EQM v1
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv1_I.png
EQM v2
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv2_I.png
EQM v3 HR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3HR_I.png
EQM v3 EHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3EHR_I.png
EQM v3 UHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3UHR_I.png
EQM v3 UHR revision 2
http://img143.exs.cx/img143/5534/eqmv3uhrrev2i7tj.png
Jawor's 2CD Matrix
http://www.divx.howto.pl/images/nowosci/Jawor/jawor2cd_I.png

Jawor
20th December 2004, 11:14
source frame
http://img132.exs.cx/img132/6341/sourcep9wk.png
Six of Nine max=20
http://www.divx.howto.pl/images/nowosci/Jawor/6of920_P.png
Six of Nine HVS
http://www.divx.howto.pl/images/nowosci/Jawor/6of9hvs_P.png
HVS Best Picture
http://www.divx.howto.pl/images/nowosci/Jawor/HVSBest_P.png
MPEG
http://www.divx.howto.pl/images/nowosci/Jawor/MPEG_P.png
EQM v1
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv1_P.png
EQM v2
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv2_P.png
EQM v3 HR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3HR_P.png
EQM v3 EHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3EHR_P.png
EQM v3 UHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3UHR_P.png
EQM v3 UHR revision 2
http://img132.exs.cx/img132/1252/eqmv3uhrrev2p6vz.png
Jawor's 2CD Matrix
http://www.divx.howto.pl/images/nowosci/Jawor/jawor2cd_P.png

Jawor
20th December 2004, 11:15
source frame
http://img132.exs.cx/img132/4706/sources1xc.png
Six of Nine max=20
http://www.divx.howto.pl/images/nowosci/Jawor/6of920_S.png
Six of Nine HVS
http://www.divx.howto.pl/images/nowosci/Jawor/6of9hvs_S.png
HVS Best Picture
http://www.divx.howto.pl/images/nowosci/Jawor/HVSBest_S.png
MPEG
http://www.divx.howto.pl/images/nowosci/Jawor/MPEG_S.png
EQM v1
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv1_S.png
EQM v2
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv2_S.png
EQM v3 HR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3HR_S.png
EQM v3 EHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3EHR_S.png
EQM v3 UHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3UHR_S.png
EQM v3 UHR revision 2
http://img132.exs.cx/img132/9513/eqmv3uhrrev2s5fw.png
Jawor's 2CD Matrix
http://www.divx.howto.pl/images/nowosci/Jawor/jawor2cd_S.png

Jawor
20th December 2004, 11:16
source frame
http://img132.exs.cx/img132/512/sourceb8mc.png
Six of Nine max=20
http://www.divx.howto.pl/images/nowosci/Jawor/6of920_B.png
Six of Nine HVS
http://www.divx.howto.pl/images/nowosci/Jawor/6of9hvs_B.png
HVS Best Picture
http://www.divx.howto.pl/images/nowosci/Jawor/HVSBest_B.png
MPEG
http://www.divx.howto.pl/images/nowosci/Jawor/MPEG_B.png
EQM v1
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv1_B.png
EQM v2
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv2_B.png
EQM v3 HR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3HR_B.png
EQM v3 EHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3EHR_B.png
EQM v3 UHR
http://www.divx.howto.pl/images/nowosci/Jawor/EQMv3UHR_B.png
EQM v3 UHR revision 2
http://img132.exs.cx/img132/4323/eqmv3uhrrev2b9rc.png
Jawor's 2CD Matrix
http://www.divx.howto.pl/images/nowosci/Jawor/jawor2cd_B.png

Jawor
20th December 2004, 11:26
Originaly posted by Sharktooth
Plz attach the source images
I promise to do this, but it can take a few days, since I have no web access at home.
Originaly posted by Sharktooth
Also there are differencies in the image backgrounds between the 2. But those are less noticeable (i think) during playback.
Yup!

The EQM v3 UHR matrix is not the December revision. I'll test the 17/12/2004 revision soon ;)

Alxemi
22nd December 2004, 00:13
Since i use jawors 1cd as my reference 1cd matrix, i´m forced to give this one a serious try.

Not to say that with that quote, i feel myself like the uncle of the creature or something :D

thanks anyway for your work, jawor and all the other matrices-creators, you are making an awesome competition here for benefit of all.

regards.

Arcon
29th December 2004, 16:58
thanks, after comparing it with one of my favourites (hvs best) i really like the result. i'll test it with a complete encode the next time to see how it performes in action :)

Jawor
7th January 2005, 12:46
Originally posted by Arcon
thanks, after comparing it with one of my favourites (hvs best) i really like the result.
I'm happy to hear that :D

I attached the source frames and screenshots from the EQM v3 UHR rev 2 test.

Jawor
22nd July 2007, 16:51
Due to a nasty bug in LigH's Custom Quantization Matrix Editor, coefficients in Jawor's 2CD Matrix are not properly ordered. My intention was to order them in a zigzag-scan fashion. Unfortunately the bug in CQME caused improper presentation of scan order. I thought that the order of coefficients in my matrix is right while it wasn't.

There's no need to worry, your encodes done with Jawor's 2CD Matrix are NOT "b0rked" - the matrix is still a proper MPEG-1/2/4 quantization matrix, it's just the order of coefficients that's wrong. I decided to keep Jawor's 2CD Matrix the way it is so confusion can be avoided.

There's a fixed version called Jawor's ZSM (Zigzag Scan Matrix) available here (http://jawormat.republika.pl/matrices.html) (scroll the page down).

I know that bugs in software are sometimes inevitable, so I don't blame LigH. He did a great job with his Matrix Editor.

Gromozeka
23rd July 2007, 17:17
Thanks, I used your builds,
they have any advantages before standarts builds? Except for presets and optimization?

Jawor
23rd July 2007, 17:24
they have any advantages before standarts builds? Except for presets and optimization?
The only "addition" to my recent builds are DivX Certified profiles.

A long time ago I did some builds that could use up to 1024 zones and some builds with VBV enabled (now VBV is enabled by default also in Koepi's builds and all "Vanilla" builds).

Gromozeka
23rd July 2007, 18:23
Thank you very much! :)

Jawor
23rd July 2007, 21:05
There are new 1.1.3 builds available on my site. Now up to 8192 zones can be used and Frame Drop Ratio is ignored (no N-VOPs are used). I disabled N-VOPs for better SAP compatibility (only Packed Bitstream still uses N-VOPs in these builds).

LigH
24th July 2007, 07:01
Due to a nasty bug in LigH's Custom Quantization Matrix Editor, coefficients in Jawor's 2CD Matrix are not properly ordered.

Bug? What, how, where? Explain!

Did I misplace positions in the scan order? - And make sure you refer to CQME 1.0c, I once changed something about that (a transponation, IIRC)!

Jawor
24th July 2007, 20:18
And make sure you refer to CQME 1.0c, I once changed something about that (a transponation, IIRC)!
Version 1.0c is OK, but the previous one showed the scan order wrong. It looks like the bug was fixed in 1.0c.

The version I used in January 2005 (1.0a or 1.0b, I'm not sure which one) shown me something like this:
http://img409.imageshack.us/img409/9168/scanordersf9.png
Unfortunately the coefficients in the intra-frame matrix were NOT zigzag-scan ordered. CQME 1.0c shows the order right.

Gromozeka
24th August 2007, 17:35
Jawor
DivX Codec 6.7 Beta Released! We've got a few new high def goodies for you to play with in this version of DivX Codec. First and foremost is support for the DivX 1080HD profile!

In your bulds Xvid profile its shall do it?

Jawor
24th August 2007, 17:47
I can make a new build with the 1080HD profile. It may take a few days.

Gromozeka
24th August 2007, 18:38
Thanks :)
Update your build XviD:
http://ffdshow.faireal.net/mirror/XviD/

P.S.: High profile DivX allows to use mpeg matrix, but xviD does not allow to do it

Jawor
24th August 2007, 19:42
New 1.1.3 builds with the DivX 1080HD profile are here (http://jawormat.republika.pl/xvid.html).

Now you can use MPEG and MPEG-Custom quantization type in DivX HDTV and DivX 1080HD profiles (please use MPEG-Custom with caution, it's not supported by DivX Inc. at the moment). The 1080HD profile allows to set aspect ratio and to use interlacing with B-frames. Aspect ratio signaling is ignored by some AVI splitters and software decoders. AR should work after remuxing the video stream to MP4 or MKV.

Gromozeka
24th August 2007, 20:22
But it is realized in the codec. It can works in their container divX which now supports some sound streams, subtitles and the menu?

Jawor
24th August 2007, 20:26
I guess the next release of DivX Player will support AR signaling (right now it apparently does not).

Gromozeka
24th August 2007, 20:43
P.S: Your builds not support 1920x1080 and he have update from june 30, but is buld from jule 25 from
http://ffdshow.faireal.net/mirror/XviD/
Sorry, your asked about XviD 1.1.3