Log in

View Full Version : Custom Matrices


Pages : 1 2 [3] 4

elguaxo
10th April 2007, 23:18
But if you give them different ids, then the muxer knows to keep both.

I see all pieces have the same IDs:
SPS id: 0
PPS id: 0

How do I give them different ids? Is --sps-id an x264 option? Thanks.

Edit: found it in x264's --longhelp!
--no-asm Disable all CPU optimizations
--visualize Show MB types overlayed on the encoded video
--sps-id <integer> Set SPS and PPS id numbers [0]

S”nTė£
11th April 2007, 16:14
Hey
Wondering if there are any recommended settings for deblocking with the HRM mtx.

Also, when you say "B predict mode should be set to none ..., otherwise b-rdo should be disabled", do you mean that for grainy sources you better disable b predict or b-rdo, OR do you mean that for grainy sources you better disable b predict and for other sources you better disable b-rdo?

*.mp4 guy
12th April 2007, 07:52
-2:-4 works well for HRM, "you mean that for grainy sources you better disable b predict and for other sources you better disable b-rdo" that is right.

fields_g
8th July 2007, 15:01
Many people are using AQ instead of deadzones. Do these matrixes work better with deadzones? Are there some AQ setting recommendations for the various CQMs, especially HRM?

elguaxo
8th July 2007, 15:21
*.mp4 guy has already recommended deadzones for some of his matrices, but I think he has not tried the AQ patch a lot: http://forum.doom9.org/showthread.php?p=998178#post998178

For the filesizes/rate factors/resolutions I am using, I am very happy with the M4G High Detail V3.1 matrix with --aq-strength 0.6 to 0.9 and a --aq-sensitivity 10 http://forum.doom9.org/showthread.php?p=1001174#post1001174

fight2win
17th July 2007, 12:37
if i use custom commandline in megui and enter deadzone options for hrm matrx, i get it at last as follows, is it ok? also, what is this aq and how can i set it for high bitrate detail retaining encodes, sir mp4guy?

--bitrate 1866 --analyse p8x8,b8x8,i4x4 --vbv-maxrate 25000 --threads auto --thread-input --progress --no-psnr --no-ssim --output "" "" --deadzone-inter 4 --deadzone-intra 6

*.mp4 guy
17th July 2007, 18:14
You don't need to use the custom commandline options now, luma inter and luma intra deadzones are accesable in megui. elguaxo is right, I haven't tested aq much, so I can't offer any advice on it.

You haven't given my enough information for me to judge your entire commandline.

fight2win
17th July 2007, 18:28
You don't need to use the custom commandline options now, luma inter and luma intra deadzones are accesable in megui. elguaxo is right, I haven't tested aq much, so I can't offer any advice on it.

You haven't given my enough information for me to judge your entire commandline.

thanks sir, can u pls tell me if deadzone 4 is inter or intra luma and is 6 inter or intra luma, also sir, i'm trying to encode my casino royale disc to x264 anamorphic mp4 with dual audio lc-aac 5.1 audio streams, and aiming for a filesize of 2235 mb (1/2 dvd) , so i was thinking of using ur hrm matrix as u say it's pretty sharp. sir, can u please advice me about matrix and what other options to keep sharpness and quality , i want to keep sharpness and quality, filesizes or encoding time don't matter much, thanks in advance

*.mp4 guy
18th July 2007, 02:28
I apreciate you're being polite, but could you stop calling me sir, thanks. 4 is intra deadzone, 6 is inter deadzone. HRM isn't aimed at being "sharp" its aimed at being low on artifacts, so there will be a bit of blurring in some cases, but very little loss of detail or blocking/banding. High detail v3.1 and MRM v2 are both sharper then HRM, but have more artifacts, MRM having more blocking, and high detail having more ringing, both causing more banding; however at the bitrate your using no matrix should cause noticible detail loss, so what is imprtant is avoiding artifacts.

I would recommend using these options:
-no fast p-skip
-no dct decimation
-no b-rdo
-aq (with whatever settings you like)
-5 reference frames
-mixed reference frames
-max 3 b frames
-multi hex motion estimation with search range 24 (default is 16)
-rdo6
-keyeframe interval 240 (250 for pal)
-min gop size 48 (50 for pal)
-chroma me
-all macroblock options enabled
-all b-frame options enaabled (except b-rdo)
- deblock -1:-2, or -2:-4 (second is sharper, but maybe more ringing)

-all other options at default

fight2win
18th July 2007, 06:02
I apreciate you're being polite, but could you stop calling me sir, thanks. 4 is intra deadzone, 6 is inter deadzone. HRM isn't aimed at being "sharp" its aimed at being low on artifacts, so there will be a bit of blurring in some cases, but very little loss of detail or blocking/banding. High detail v3.1 and MRM v2 are both sharper then HRM, but have more artifacts, MRM having more blocking, and high detail having more ringing, both causing more banding; however at the bitrate your using no matrix should cause noticible detail loss, so what is imprtant is avoiding artifacts.

I would recommend using these options:
-no fast p-skip
-no dct decimation
-no b-rdo
-aq (with whatever settings you like)
-5 reference frames
-mixed reference frames
-max 3 b frames
-multi hex motion estimation with search range 24 (default is 16)
-rdo6
-keyeframe interval 240 (250 for pal)
-min gop size 48 (50 for pal)
-chroma me
-all macroblock options enabled
-all b-frame options enaabled (except b-rdo)
- deblock -1:-2, or -2:-4 (second is sharper, but maybe more ringing)

-all other options at default

thanks sir (pls let me call u sir, talented needs to be respected), sir, one more small question, what is aq and what settings to use for it, is it adaptive quantization? how to set value for it?also, -2 is deblocking strength or threshold in -2,-4 deblocking?

Tack
18th July 2007, 14:55
thanks sir (pls let me call u sir, talented needs to be respected)
One might argue that it is disrespectful to not honour his request not to refer to him as "sir." But I understand that this is probably a culture thing. I don't like being called sir either.

what is aq and what settings to use for it, is it adaptive quantization? how to set value for it?
AQ is adaptive quantization, yes. It is not officially part of x264 but is available as an add-on patch. Do x264 --help and if you see options aq-strength and aq-sensitivity, your x264 build has AQ support.

You'll want to experiment with the values to see what meets your needs best. I use aq_strength=0.8 aq_sensitivity=17.

also, -2 is deblocking strength or threshold in -2,-4 deblocking?
Here's the documentation from mplayer's man page for deblock:

deblock=<-6-6>,<-6-6>
The first parameter is AlphaC0 (default: 0). This adjusts thresholds for
the H.264 in-loop deblocking filter. First, this parameter adjusts the
maximum amount of change that the filter is allowed to cause on any one
pixel. Secondly, this parameter affects the threshold for difference
across the edge being filtered. A positive value reduces blocking arti-
facts more, but will also smear details.
The second parameter is Beta (default: 0). This affects the detail
threshold. Very detailed blocks are not filtered, since the smoothing
caused by the filter would be more noticeable than the original blocking.
The default behavior of the filter almost always achieves optimal quality,
so it is best to either leave it alone, or make only small adjustments.
However, if your source material already has some blocking or noise which
you would like to remove, it may be a good idea to turn it up a little
bit.

fight2win
18th July 2007, 17:03
One might argue that it is disrespectful to not honour his request not to refer to him as "sir." But I understand that this is probably a culture thing. I don't like being called sir either.


AQ is adaptive quantization, yes. It is not officially part of x264 but is available as an add-on patch. Do x264 --help and if you see options aq-strength and aq-sensitivity, your x264 build has AQ support.

You'll want to experiment with the values to see what meets your needs best. I use aq_strength=0.8 aq_sensitivity=17.


Here's the documentation from mplayer's man page for deblock:

deblock=<-6-6>,<-6-6>
The first parameter is AlphaC0 (default: 0). This adjusts thresholds for
the H.264 in-loop deblocking filter. First, this parameter adjusts the
maximum amount of change that the filter is allowed to cause on any one
pixel. Secondly, this parameter affects the threshold for difference
across the edge being filtered. A positive value reduces blocking arti-
facts more, but will also smear details.
The second parameter is Beta (default: 0). This affects the detail
threshold. Very detailed blocks are not filtered, since the smoothing
caused by the filter would be more noticeable than the original blocking.
The default behavior of the filter almost always achieves optimal quality,
so it is best to either leave it alone, or make only small adjustments.
However, if your source material already has some blocking or noise which
you would like to remove, it may be a good idea to turn it up a little
bit.


oh-kay, well, i'm using cerf's x264 builds, dunno if they support aq or not, and dos window not staying in my vista...

fight2win
18th July 2007, 17:41
i'm using latest megui, and cerf's latest x264, but deadzone options are phased out/unselectable:

http://img381.imageshack.us/img381/1407/untitledhw1.th.png (http://img381.imageshack.us/my.php?image=untitledhw1.png)

elguaxo
18th July 2007, 17:45
You must disable trellis in order to use the deadzones features.

fight2win
18th July 2007, 17:49
You must disable trellis in order to use the deadzones features.

ok, thanks

SpAwN_gUy
20th July 2007, 09:02
I would recommend using these options:
-no fast p-skip
-no dct decimation
-no b-rdo
-aq (with whatever settings you like)
-5 reference frames
-mixed reference frames
-max 3 b frames
-multi hex motion estimation with search range 24 (default is 16)
-rdo6
-keyeframe interval 240 (250 for pal)
-min gop size 48 (50 for pal)
-chroma me
-all macroblock options enabled
-all b-frame options enaabled (except b-rdo)
- deblock -1:-2, or -2:-4 (second is sharper, but maybe more ringing)

-all other options at default 'kay .. i suppose theese options are for "film" content... and back to our sheeps (i'm (belo)russian)...
will there be any "cartoon/anime" matrix? ;) ... and what will you (or someone else) recommend settings for anime? ...

'cause i'm still using deadzones=6(as you recommended somwhere in this thread) and now i've added aq settings to command-line, but i dunno is this still "correct" or will i get any profit of using them both at the same time.

*.mp4 guy
20th July 2007, 17:53
'kay .. i suppose theese options are for "film" content... and back to our sheeps (i'm (belo)russian)...
(1)will there be any "cartoon/anime" matrix? ;) ... and what will you (or someone else) recommend settings for anime? ...

(2)'cause i'm still using deadzones=6(as you recommended somwhere in this thread) and now i've added aq settings to command-line, but i dunno is this still "correct" or will i get any profit of using them both at the same time.

(1) - I don't encode anime, but there are plenty of other people here who could make an anime matrix; as for settings, high bitrate anime can be treated about the same as high bitrate film (you need to use the same tricks to get rid of those last few artifacts), low bitrate anime however is a completely different matter, that I have even less experience with.

(2) - What is correct is what looks the best to you. There is no inherent problem with using custom deadzones and aq at the same time, though I would recommend using trellis on anime instead of deadzones (unless you are using very high bitrates).

HeadBangeR77
3rd August 2007, 01:07
I've recently dug out an old grrrainy & noisy sample o'mine, and I'm torturing it atm using your HRM v2 custom matrix. I've had some very good results so far, using both dead zones and AQ. I'm struggling hard to reduce the bitrate, that bumped up form about 3400 kbps (1024x432) with the default flat matrix to 6400 kbps using yours. The target is about 4000 kbps, as I would like to keep the film within 1 DVD-5 limit, including the original AC3 sound.

When I've gone through my 1-pass CFR samples and achieved the results, that I will be pleased with, I will post a sample or two ;)

In the meanwhile:
:thanks: for your custom CQMs and all the effort you've put into creating and improving them :)

cheers /HDBR77

*.mp4 guy
5th August 2007, 13:29
HRM is not always ideal for bitrate limited encoding, if you are having trouble reaching your needed filesize with it, it might be a good idea to switch to a more aggressive matrix; as with all advice, this is a generalization and may not apply to your specific situation.

HeadBangeR77
5th August 2007, 13:55
AQ has a great influence on the subjective quality of the film (how I would like to watch it), but also a huge impact on the bitrate in my particular case. I haven't done any samples with HRM v2 (dead zones as recommended, no trellis, no fast p-skip, no dct-decimate) without AQ. Should have a closer look, when I've finally found more time for samples. I'm at CRF one pass encoding atm, before I decide to encode the whole film in two pass bitrate mode.

If I use motion estimation at 5, or eventually at 6(RDO), yet without RDO on B-frames, is it safe to use weightened biprediction then? (grain retention is important in this case, but not sth I couldn't live without ;) )

cheers /HDBR77

*.mp4 guy
5th August 2007, 23:33
You can safely go to rdo7, b-rdo enabled, 2 (4 if you don't mind a little flicker sometimes) consecutive b-frmes, bi-prediction enabled, as long as you set b-predict mode to none (rdo7 is fine no matter what), there will be a small impact on grain retention, but it shouldn't be significant.

Sagittaire
7th August 2007, 16:08
Problem is not really bframe but ratio for bframe. If you want higher quality for bframe use smaller ratio like 1.10 for example. Default ratio at 1.30 is certainely optimal for best overall quality but perhaps not for constant "local quality". With high ratio quality for bframe will be always lower than reference pframe simply because bframe in this case will use "very" higher quant than reference pframe. If you want really see if problem is bframe in this case use ratio at 1.00.

HeadBangeR77
7th August 2007, 23:26
Problem is not really bframe but ratio for bframe. If you want higher quality for bframe use smaller ratio like 1.10 for example. Default ratio at 1.30 is certainely optimal for best overall quality but perhaps not for constant "local quality". With high ratio quality for bframe will be always lower than reference pframe simply because bframe in this case will use "very" higher quant than reference pframe. If you want really see if problem is bframe in this case use ratio at 1.00.
I've already marked that B-frames are of higher quality than with XviD, even if I use low compression matrices and settings like 1.00 ratio + 1.00 offset in the latter case. Think you're pointing in the right direction.
Atm I'm using PB ratio like 1.25 or 1.20 depending on the encode. Usually it's enough for me to achieve the quality I want, especially with MRMv2 and HRMv2. Since I always use AQ, and the latest 667b (or is it 667c already, as avinaptic indicates?) pumps more bits in low-quality areas than the original rev. 667, I even get higher quality B-frames than P-frames. Not in terms of quantizers of course, but in terms of grain retention and the effect I would like to achieve (very subjective, though).

@ M4G:
I've had some incredibly good results with your CQM MRMv2 and direct mode set to auto. I'm under impression those samples might be even better than HMRv2 with no direct mode. Must compare still frames to decide. Tomorrow I should have a faster connection, so I will upload some samples, if I manage.
I assume the way to success are: your matrices with recommended dead zones, the rest of the settings I use, and the AQ (it really does the trick, yet not with the default flat one ;)).

cheers /HDBR77

Razorholt
8th August 2007, 02:21
Hi HeadBangeR77,

I'm currently encoding at 450kbps a bunch of mpeg2 videos and I think I tried pretty much all the matrices... Just like you (I presume) I'm sticking to the ones developed by mp4guy.

What sort of content are you encoding? Anime or film? And at what birates?


Thanks,
- Dan

HeadBangeR77
8th August 2007, 22:52
Hi HeadBangeR77,

I'm currently encoding at 450kbps a bunch of mpeg2 videos and I think I tried pretty much all the matrices... Just like you (I presume) I'm sticking to the ones developed by mp4guy.

What sort of content are you encoding? Anime or film? And at what birates?
I think mp4guy could help you much more than me:
- I'm rather new to x264,
- my target bitrates are high above yours,
- I'm a quality freak, who likes the old grainy style of XviD encodes :cool:

Atm I'm concentrating more on testing individual matrices: MRM v2, HRM v2, and High Detail v3.1 from mp4guy, and I would like to compare them (for my high bitrate grainy purposes ;)) with EQM AVC HR and the Prestige one. I'm pretty busy atm, and sometimes I have to compare dozens of still frames to tell the difference, so I will share my experience no sooner than in a week.

cheers /HDBR77

SealTooGreat
4th September 2007, 18:44
@*.mp4 guy

pls, check 3rd_raw/7th_column (29) and 7th_raw/3rd_column (28) in MRM V2 under INTER8X8_LUMA. Is this OK?

Chainmax
5th September 2007, 00:58
Are all these matrices (plus the detail-preserving ones extracted from some HDDVDs or BDs, can't remember their names) included in MeGUI's autoupdater?

elguaxo
5th September 2007, 01:13
Nope.

Chainmax
6th September 2007, 18:40
Do you think one of the MeGUI devs would be interested in doing so if asked?

Sharktooth
6th September 2007, 18:44
for what purpouse?

*.mp4 guy
6th September 2007, 18:58
@*.mp4 guy

pls, check 3rd_raw/7th_column (29) and 7th_raw/3rd_column (28) in MRM V2 under INTER8X8_LUMA. Is this OK?
It is ok, Just a typo, the 28 should be a 29. I'll fix it in the first post, but since it won't make a difference visually I'm not going to consider it an update.

Chainmax
7th September 2007, 03:03
for what purpouse?

For the same purpose it has profiles and avisynth filters: having a variety of options available.

Sharktooth
7th September 2007, 03:38
if we start to include matrices, ppl will think EVERY matrix is good for every source and will always be better than standard quantization. That's not true and i want to avoid it or ppl will start complaining for the output quality blaming x264.
matrices in AVC are for advanced users and i dont think that kind of ppl will have problems getting them from the forum and use them in the appropriate situations.

rkalwaitis
14th August 2008, 20:57
Mp4 is there a matrix for a wavelet codec?

rkalwaitis
14th August 2008, 22:11
How do you extract the data required to create your matrices. Is there a way to see each films data so that you can decide how you would like to change it if at all?

This is interesting stuff.

thanks

Adub
14th August 2008, 22:28
Just so you know, cqm's are pretty much outdated. What with the use of AQ, Psy-rdo, and psy-trellis, they are pretty much obsolete.

JarrettH
15th August 2008, 00:13
Andddd...Flat is the best looking overall anyway:p

rkalwaitis
15th August 2008, 07:36
I like flat too.

Sharktooth
15th August 2008, 12:14
How do you extract the data required to create your matrices. Is there a way to see each films data so that you can decide how you would like to change it if at all?

This is interesting stuff.

thanks
video stream analyzers.
IIRC avinaptic can do that... otherwise there should be other free softwares.

*.mp4 guy
15th August 2008, 17:13
Mp4 is there a matrix for a wavelet codec?
Kind of, It depends upon the implementation, and in any case, there probably will be far fewer coefficients.

rkalwaitis
17th August 2008, 18:45
I can not see any matrix like your custom ones when I use avinaptic to look at an avi file. Can you send me a link?

*.mp4 guy
17th August 2008, 20:29
I can not see any matrix like your custom ones when I use avinaptic to look at an avi file. Can you send me a link?

I'm afraid I don't understand the question. Avinaptic doesn't use cqm's.

Yoshiyuki Blade
17th August 2008, 21:19
I'm afraid I don't understand the question. Avinaptic doesn't use cqm's.

Avinaptic usually allows you to see the cqm used in a given clip. He says he can't see your cqms them via Avinaptic when he checks for it.

rkalwaitis
18th August 2008, 15:54
That is what I was going to ask, I thought I was doing something wrong :)

Okay so I have a vob file for instance. I want to analyze the video stream, which technically could help me determine if or what matrix I could apply to it? Isnt that how custom matrices come to be? I mean dont you have to have some numbers to change around to come up with the custom matrix? I guess I really want to know how to get those numbers.

Am I being stupid? MP4?

avinaptic doesnt necessarily show if a custom matrix is applied for example, it would not for a mkv file.

why is that? container specific?

thanks for answering my sill questions.

Sharktooth
18th August 2008, 16:03
MPEG-2 matrices are different than AVC matrices and the custom matrix info is in the video stream. if no info is shown then no custom matrix was used but just standard quantization.
i dont know what you want to do, but i can perceive a lot of confusion. search the forum for "custom matrices", "CQM", "custom quantization", etc... and document yourself a bit.
at present day CQMs are quite useless since the new adaptive quantization algos do great jobs.

rkalwaitis
19th August 2008, 07:03
Thanks Sharktooth, I was just trying to figure out where the got the starting numbers they used to make custom matrices. I am enjoying using Megui. Which has the x264. I tried one of MP4s custom matrices and it made a noticeable difference on an older film, I have and was just wondering how they made them.

rkalwaitis
19th August 2008, 10:00
Sharktooth doesnt 264 have its own custom matrix "JVT or Flat" with it? Everyone says they custom matrix is obsolete because of x264, but it has two matrices, correct???

Ranguvar
19th August 2008, 14:20
There's threads on making custom matrices, search. And the Flat matrix is what is now recommended. It's not really a custom matrix, it's different... I can't explain it as well as Sharktooth or *.mp4 guy can though.

Sharktooth
19th August 2008, 14:28
flat is not a custom matrix it's the DEFAULT quantization. JVT matrix is included too though and it's quite useless. like the default mpeg quantization matrix in xvid.

Ranguvar
19th August 2008, 14:30
like the default mpeg quantization matrix in xvid.
Do you mean H.263, not MPEG?