Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th October 2006, 11:16   #1  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Custom Matrices

[edit] I was going to leave this post as it was, but it has been recently bumped to the front page. Currently the cases that these cqms were meant to fix are handled very well by psychovisual optimizations within X264, such as Dark Shikari's aq, psy rd, and psy trellis, which usually work better then cqms, in my (and everyone elses) opinion. Cqms can still be usefull, but not most of the time, and certainly not for the majority of people.

This thread is to provide a place for me to keep up to date versions of my Mpeg4-avc cqms, and somewhere to refer people who want copies of them. If you have any questions about these matrices in particular feel free to ask them here; however I would apriciate it if more general questions (stuff about matrices in general, etc.) were kept out of this thread, to keep it succinct. Some matrices used in commercial HD-DVD/Blu-Ray encodes can be found in another thread.

With the addition of the deadzone parameter there is yet another value that needs to be tweaked to get the best results, I will specify any deadzone settings that i think are neccesary to get the most out of a matrix by posting the command line, IE "--deadzone-inter 6 --deadzone-intra 6". Megui now has gui options for changing the deadzone settings, reffered to as luma intra deadzone, and luma inter deadzone.

M4G LRM V4: LRM is for low to very low bitrates, 1cd or less, and MRM may even be better for some 1cd encodes at this point. It is designed to avoid artefacts more then to preserve detail. 0:0 for smooth encodes, -3;0 for moderate encodes.
Code:
INTRA4X4_LUMA =
8,22,32,47,
22,48,55,57,
32,55,63,69,
47,57,69,84	

INTRA4X4_CHROMAU =
16,20,34,64,
20,40,62,78,
34,62,98,138,
64,78,138,168

INTRA4X4_CHROMAV =
16,20,34,64,
20,40,62,78,
34,62,98,138,
64,78,138,168

INTER4X4_LUMA =
12,28,28,32,
28,32,35,38,
28,35,42,46,
32,38,46,55	

INTER4X4_CHROMAU =
18,24,34,41,
24,40,48,56,
34,48,64,92,
41,56,92,110		

INTER4X4_CHROMAV =
18,24,34,41,
24,40,48,56,
34,48,64,92,
41,56,92,110	

INTRA8X8_LUMA =
8,11,10,16,24,28,29,32,
12,13,14,19,26,27,29,33,
14,13,16,24,28,29,32,35,
14,17,22,30,32,34,38,39,
18,22,28,32,37,42,45,47,
24,27,29,34,42,49,55,57,
29,29,32,38,45,55,63,69,
32,33,35,39,47,57,69,84

INTER8X8_LUMA =
13,14,16,18,20,21,22,24,
14,15,18,19,20,21,22,25,
16,18,20,21,22,23,25,27,
18,19,21,23,25,26,29,31,
20,20,22,25,28,31,35,38,
21,21,23,26,31,37,42,48,
22,22,25,29,35,42,51,61,
24,25,27,31,38,48,61,76
M4G MRM V2: MRM is supposed to work well at moderate bitrates (and sometimes does well even at low and high bitrates, though it isn't suited for transparency). It should give a good balance of details and artefacts, it looks similar to HVS best. 0:-1 for smooth results (not recommended) -1:-2 for moderate sharpness, -2:-4 for high sharpness. should be used with "--deadzone-inter 6 --deadzone-intra 6" to get a more detailed picture, at the cost of a small amount of ringing.
Code:
INTRA4X4_LUMA =
10,10,20,30,
10,10,34,33,
20,34,52,76,
30,33,76,112

INTRA4X4_CHROMAU =
8,8,24,72,
8,8,41,144,
24,41,96,200,
72,144,200,255

INTRA4X4_CHROMAV =
8,8,24,72,
8,8,41,144,
24,41,96,200,
72,144,200,255

INTER4X4_LUMA =
10,18,20,20,
18,18,34,44,
20,34,52,76,
20,44,76,112

INTER4X4_CHROMAU =
16,22,22,22,
22,22,22,56,
22,22,72,96,
22,56,96,128

INTER4X4_CHROMAV =
16,22,22,22,
22,22,22,56,
22,22,72,96,
22,56,96,128

INTRA8X8_LUMA =
12,12,14,20,24,26,30,32,
12,12,15,22,24,27,30,36,
14,15,20,26,27,31,34,40,
20,22,26,30,35,38,40,46,
24,24,27,35,42,48,50,52,
26,27,31,38,48,56,60,64,
30,30,34,40,50,60,72,80,
32,36,40,46,52,64,80,96

INTER8X8_LUMA =
12,16,16,18,20,22,25,28,
16,16,17,20,20,23,26,28,
16,17,20,22,24,26,29,31,
18,20,22,25,28,31,33,38,
20,20,24,28,33,37,43,49,
22,23,26,31,37,46,56,65,
25,26,29,33,42,56,70,88,
28,28,31,38,49,65,88,115
M4G HRM V2: HRM is for high to very high bitrates depending upon your source, however the new version scales quite well so if you really wanted to you could use it at any bitrate without problems. For transparency it should be used with the "--deadzone-inter 4 --deadzone-intra 6" switches added to the commandline, without the quotes. since it is designed for transparency, there shouldn't be any noticible properties it introduces to the picture. B predict mode should be set to none if your source is very grainy(and you wan't it to stay that way), or has many low contrast areas, otherwise b-rdo should be disabled and b prediction should be set to auto. I would apriciate feedback on any sources that cannot reach transparency with this matrix, as I have run into a few, but cannot currently find a solution.
Code:
INTRA4X4_LUMA =
15,6,15,22,
6,7,25,30,
15,25,38,48,
22,30,48,96

INTRA4X4_CHROMAU =
16,6,24,72,
6,8,41,144,
24,41,96,200,
72,144,200,255

INTRA4X4_CHROMAV =
16,6,24,72,
6,8,41,144,
24,41,96,200,
72,144,200,255

INTER4X4_LUMA =
4,11,15,22,
11,11,25,30,
15,25,38,48,
22,30,48,96

INTER4X4_CHROMAU =
5,16,16,16,
16,16,16,56,
16,16,72,96,
16,56,96,128

INTER4X4_CHROMAV =
5,16,16,16,
16,16,16,56,
16,16,72,96,
16,56,96,128

INTRA8X8_LUMA =
24,7,7,12,15,20,21,23,
8,9,14,15,18,21,23,21,
10,12,15,17,17,21,26,20,
14,15,17,17,18,33,30,23,
15,17,17,21,26,39,39,29,
18,18,20,24,33,39,41,35,
21,24,29,34,39,45,45,38,
27,35,36,39,38,38,38,38

INTER8X8_LUMA =
6,10,13,13,15,16,18,22,
10,10,12,15,15,16,21,24,
13,12,15,16,19,21,25,27,
13,15,16,21,24,28,30,34,
15,15,19,24,30,36,37,40,
16,16,21,28,36,42,45,52,
18,21,25,30,37,45,55,72,
22,24,27,34,40,52,72,96
M4G Smooth V1: An all purpose smooth matrix that blocks very little, gives a similar look to smooth mpeg2 video. -3:0 works well for inloop. Some sources may need to have b-frame mode set to none to work properly with this matrix
Code:
INTRA4X4_LUMA =
4,9,18,45,
9,16,35,180,
18,35,225,255,
45,180,255,255

INTRA4X4_CHROMAU =
14,22,32,72,
22,24,41,144,
32,41,96,200,
72,144,200,255

INTRA4X4_CHROMAV =
14,22,32,72,
22,24,41,144,
32,41,96,200,
72,144,200,255

INTER4X4_LUMA =
4,9,18,45,
9,16,35,180,
18,35,225,255,
45,180,255,255

INTER4X4_CHROMAU =
16,22,22,22,
22,22,22,56,
22,22,72,96,
22,56,96,128

INTER4X4_CHROMAV =
16,22,22,22,
22,22,22,56,
22,22,72,96,
22,56,96,128

INTRA8X8_LUMA =
5,11,10,16,28,68,80,80,
12,12,14,18,32,73,90,110,
14,13,16,30,51,87,138,112,
14,17,28,36,80,174,160,124,
18,28,47,88,136,255,206,154,
30,42,86,128,162,208,226,184,
60,128,156,174,206,241,240,202,
144,184,190,196,224,200,206,198

INTER8X8_LUMA =
5,11,10,16,22,28,38,46,
12,12,14,18,26,38,45,70,
14,13,16,24,34,41,51,125,
14,17,22,24,37,50,100,155,
18,22,28,42,70,135,160,180,
24,26,39,50,135,175,200,205,
30,45,51,100,160,200,225,230,
48,70,125,155,180,205,230,255
M4G High Detail V3.1: A very sharp matrix, works best at mid bitrates. -3:0 is the recommended deblocking setting. This matrix is NOT designed to keep grain well, its supposed to look sharp and crisp, not keep everything in the source, it should look detailed, but not transparent, so little pieces of grain and noise are usually some of the first things to get removed.
Code:
INTRA4X4_LUMA =
6,16,22,28,
16,24,32,40,
22,32,48,72,
28,40,72,112

INTRA4X4_CHROMAU =
12,22,32,72,
22,24,41,144,
32,41,96,200,
72,144,200,255

INTRA4X4_CHROMAV =
12,22,32,72,
22,24,41,144,
32,41,96,200,
72,144,200,255

INTER4X4_LUMA =
9,20,21,24,
20,21,24,44,
21,24,56,80,
24,44,80,112

INTER4X4_CHROMAU =
16,22,22,22,
22,22,22,56,
22,22,72,96,
22,56,96,128

INTER4X4_CHROMAV =
16,22,22,22,
22,22,22,56,
22,22,72,96,
22,56,96,128

INTRA8X8_LUMA =
8,9,11,13,16,21,24,27,
9,9,12,15,18,22,24,29,
11,12,15,19,22,25,28,32,
13,15,19,24,27,30,34,37,
16,18,22,27,34,39,41,46,
21,22,25,30,39,48,59,74,
24,24,28,34,41,59,81,109,
27,29,32,37,46,74,109,160

INTER8X8_LUMA =
12,12,12,12,13,16,19,25,
12,12,12,12,13,16,21,27,
12,12,13,15,18,21,26,33,
12,12,15,21,25,30,37,45,
13,13,18,25,34,43,54,64,
16,16,21,30,43,60,76,94,
19,21,26,37,54,76,102,132,
25,27,33,45,64,94,132,177
matrices in a 7zip

Last edited by *.mp4 guy; 22nd August 2008 at 05:01.
*.mp4 guy is offline   Reply With Quote
Old 13th October 2006, 11:25   #2  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
it would be nice if you could add a description to each mask, what it is supposed to do and under which circumstances to use (low/mid/high bitrates etc.)
Thunderbolt8 is offline   Reply With Quote
Old 13th October 2006, 11:43   #3  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Not sure what you mean by the "source". I'll get around to adding descriptions later.
*.mp4 guy is offline   Reply With Quote
Old 13th October 2006, 13:44   #4  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
Can you put all matrices in one zip together. And can you reccomend me some for 1 CD rip, where bitrate usualy 500-1000kbps. Thanks
shon3i is offline   Reply With Quote
Old 13th October 2006, 17:38   #5  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
a description for what each matrix purpose is is definitely needed, or did you just set them up by using dices?
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 15th October 2006, 05:11   #6  |  Link
fields_g
x264... Brilliant!
 
Join Date: Mar 2005
Location: Rockville, MD
Posts: 167
Quote:
Originally Posted by shon3i View Post
Can you put all matrices in one zip together.
Another thought.... I know MeGUI supports profile distrobution through the update server. I don't recall it being used for CQMs. Anyone know if the current MeGUI support this if fed the right files? Once the explanations are developed, and M4G (and the server admins) belive your matrix tweaking is mature enough, I wouldn't mind seeing them delivered in such a way. It should work pretty slick once the server is working again.
fields_g is offline   Reply With Quote
Old 15th October 2006, 05:37   #7  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Nice. But while copying them, I noticed that you're missing INTRA4X4_LUMA and INTRA4X4_CHROMAU from MRM. Which so happens to be the one I most want to test. =p
foxyshadis is offline   Reply With Quote
Old 15th October 2006, 14:08   #8  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Quote:
Originally Posted by fields_g View Post
and M4G (and the server admins) belive your matrix tweaking is mature enough, I wouldn't mind seeing them delivered in such a way. It should work pretty slick once the server is working again.
M4G is a less unwieldy contraction of my D9 nickname, sorry for the confusion.

Quote:
Originally Posted by foxyshadis View Post
Nice. But while copying them, I noticed that you're missing INTRA4X4_LUMA and INTRA4X4_CHROMAU from MRM. Which so happens to be the one I most want to test. =p
thanks for noticing that, fixed.
*.mp4 guy is offline   Reply With Quote
Old 15th October 2006, 18:19   #9  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
Aswome, thank you so much, now testing.
shon3i is offline   Reply With Quote
Old 15th October 2006, 19:40   #10  |  Link
DDogg
Retired, but still around
 
DDogg's Avatar
 
Join Date: Oct 2001
Location: Lone Star
Posts: 3,058
*.mp4 guy, thanks for the work and the descriptions. Can you share your thoughts on matching one of these matrices, or others for that matter, with the CQ-ASP_Q2_eq() profile? Size is not an overriding issue. Transparency is my main goal, but speed as well - moving a 200+ DVD collection to x264 takes a while. The CQ-ASP_Q2_eq() settings seem to provide quality, reasonable speed, and reasonable compression. Realize there is no one size fits all answer- just would appreciate your subjective opinion on a good place to start, matrix wise.
DDogg is offline   Reply With Quote
Old 15th October 2006, 19:45   #11  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally Posted by *.mp4 guy View Post
M4G MRM V2: MRM is supposed to work well at moderate bitrates (and sometimes does well even at low and high bitrates, though it isn't suited for transparency). It should give a good balance of details and artefacts, it looks similar to HVS best.
yummie
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 15th October 2006, 20:37   #12  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
@bond it is very important to use the modified deadzone settings if you want it to look like hvs best.

@ddog I don't have the CQ-ASP_Q2_eq() profile, from the name it looks like its an asp profile for megui(?), if its not could you post a link to the xml file here so I can see what its like.
*.mp4 guy is offline   Reply With Quote
Old 15th October 2006, 21:06   #13  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
@DDogg MRM will work well, though the results won't always be transparent, HRM might work well too, but you would have to deal with larger files, and disable b-prediction, and sometimes there wouldn't be any benefit.
*.mp4 guy is offline   Reply With Quote
Old 17th October 2006, 21:11   #14  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
@*.mp4 guy i get very good result with M4G Smooth V1 with all parameters you gave, with 720x464 (War Of The Worlds very grainy movie) @ 773kbps, i have few questions, is this matrix desinged for mid-low bitrates, and it is better tha LRM or MRM for same bitrate, and you mean about b prediction, did you mean about --weightb switch or ?

Thanks

Last edited by shon3i; 17th October 2006 at 21:14.
shon3i is offline   Reply With Quote
Old 18th October 2006, 02:25   #15  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
it is made to work at any bitrate (where you aren't trying for transparency). It isn't "better" then any of the other matrices, its just different, it usually does well on blurry/grainy footage, or on material with lots of gradients. Sometimes X264 doesn't handle matrices well, when that happens setting b-frame mode to none will fix the problem, thats what I meant by "disabling b-prediction".
*.mp4 guy is offline   Reply With Quote
Old 18th October 2006, 03:33   #16  |  Link
desta
Registered User
 
Join Date: Jan 2006
Posts: 220
Thanks for these mp4guy.

Could i just ask, what sort of values do you have in mind (roughly) when you say "low to very low bitrates" .. "moderate/mid bitrates" .. "high/very high bitrates" ?

Is it something like:

low = < 800
mid = 800 to 1500
high = 1500 +

... sorry to generalise. Just asking for my own benefit.
desta is offline   Reply With Quote
Old 18th October 2006, 04:04   #17  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Low = 1cd or less (IE 900 - whatever).
Medium = Anything more then low and less then high.
high = Transparent or almost transparent (dvd quality), bitrate tends to vary.
*.mp4 guy is offline   Reply With Quote
Old 18th October 2006, 04:06   #18  |  Link
desta
Registered User
 
Join Date: Jan 2006
Posts: 220
ok, thanks for clarifying.
desta is offline   Reply With Quote
Old 18th October 2006, 17:30   #19  |  Link
shon3i
BluRay Maniac
 
shon3i's Avatar
 
Join Date: Dec 2005
Posts: 2,419
Quote:
Originally Posted by *.mp4 guy View Post
it is made to work at any bitrate (where you aren't trying for transparency). It isn't "better" then any of the other matrices, its just different, it usually does well on blurry/grainy footage, or on material with lots of gradients. Sometimes X264 doesn't handle matrices well, when that happens setting b-frame mode to none will fix the problem, thats what I meant by "disabling b-prediction".
Ok, thanks for info, indeed i get very good and smooth picture, with this matrix.
shon3i is offline   Reply With Quote
Old 18th October 2006, 20:27   #20  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
Smooth is the best I've used for CG video of any matrix. It's really awesome!
foxyshadis is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.