View Full Version : Question about HCenc's Fox Matrices
cubdukat
31st May 2007, 20:03
Right now I've been using HCEnc to encode my HD captures down to DVD, and I've been using the Fox1 matrix.
I also notice that there are two other Fox matrices. Most of the material I transfer is from shows like "24" or "Lost," which have a lot of fast motion or highly detailed scenes. Which one of the three matrices would be best suited, or would another one of the matrices it uses be better?
Amnon82
31st May 2007, 23:32
I only see one fox matrix. Maybe you try one of my AutoQ matrices.
Fishman0919
1st June 2007, 00:26
With the built in Matrices you get Fox 1,2,3
Amnon82
1st June 2007, 00:31
Upps I only looked into the matrices folder of the zip. Sorry.
manono
1st June 2007, 06:48
Hi-
In descending order 1 to 3, each is progressively lower bitrate than the one before. Only the number one is the real Fox Home Entertainment matrix. It looks to me like the numbers 2 and 3 were grabbed from the matrices I supplied for the Rockas Matrix Editor for DVD-RB. The number 2 is a good one I got from commercial DVDs, and the number 3 is a mix of Intra from Fox and Inter from CCE's MPEG Standard matrix.
There's no rule about which will be best for your material. It's a function of how well your material compresses and how much you're trying to stuff onto a DVD5 (?). About all I can suggest is to check the final average quants and, if they get much above 8 or so, to use a lower bitrate matrix. If you're doing TV show DVDs which commonly stuff 3 hours or so onto a DVD9, and if you're trying to compress to a DVD5, a real low bitrate matrix - something like AVAMAT7 (=AutoQ2) - is probably the way to go.
Hi Manono,
About all I can suggest is to check the final average quants and, if they get much above 8 or so, to use a lower bitrate matrix.Is this a general suggestion for all occasions, or just for the OP's specific case? I guess what I'm asking is: is there any kind of correlation between avg quant and final visual quality? :stupid:
manono
1st June 2007, 12:47
Hi-
is there any kind of correlation between avg quant and final visual quality?
I like to think there is, although maybe I'm just deluding myself. :) Actually, the guidelines I follow myself are more conservative than those I suggested. I use DVDBitrate Viewer to get the average quants, and the figures it gives out are higher than those that show in CCE, so I don't think they're all that accurate. I use 10 different matrices and usually try and choose the one that will give me a final average quant of around 7, and a bit less for the lower bitrate matrices.
If you're asking if it's a bad thing to use the Fox Home Entertainment matrix when the final average quant is 12, for example, then the answer's no. I've even seen retail DVDs using that matrix with average quants in that range. But a low bitrate matrix such as AVAMAT7 (AutoQ2) will have begun to artifact before then.
This is just what I do, and what works for me. cubdukat (and you) will develop his own guidelines. I do think, though, that average quant (perhaps combined with the quantisation matrix used), much more so than bitrate, is the most important factor in determing the final quality of your encode. I would even go so far as to say that bitrate is an almost useless figure in determining final quality. I've encoded movies where a bitrate of 2500 was enough, and others where 5000 wasn't enough. Just one person's opinion.
Thanks, that was informative. I think I'll start recording the avg quant on my rebuilds, and see if I can find a q range that fits with my idea of "good" quality. I can't use custom matrices with ProCoder 2 (my usual encoder), but maybe it can help me decide optimal bitrates :)
ronnylov
4th June 2007, 15:51
Some MPEG-2 encoders use non-linear quantization and other use linear quantization (I don't remember what type HCEnc does). q=7 with linear quant is probably not the same as q=7 with non-linear quant.
The maximum quantizer may be interesting too. If you have a movie with a part of heavy action and a longer part with low motion then the average may be fine but the maximum is rather high (the action scenes may not look good despite of a good average quant).
Just some things to think about.
Bitrate Viewer lists all of my ProCoder 2 encodings as nonlinear quant, and the average quant values I'm seeing aren't even approaching manono's ideal value of 7, so I'm guessing CCE is linear, and not directly comparable...
I've been paying attention to quant in my recent ProCoder 2 jobs:
Title Bitrate Comp. avg q
--------------------------------------------
Samurai Spy 5264 69.2% 1.86
Black Test Car 6010 66.8% 1.74
Samurai Rebellion 4533 66.2% 2.26
Goyokin 4603 57.3% 3.67
What I gather from this mini-list is that:
Black Test Car is the most compressible of the 5 movies listed. Visual artifacts will probably be most noticeable in Goyokin, which has the highest average quant.
Is that right? Any other information that can be gleaned? :)
manono
4th June 2007, 20:36
Any other information that can be gleaned?
Yes, that you have good taste in films, and are going through a Japanese samurai and exploitation film period. :) I've done all of those except for Black Test Car, although I have other Masumura films.
In CCE you can choose linear or nonlinear quantization and I, of course, make all mine for nonlinear. As near as I can tell, you can't choose in HCEnc, and all his are also nonlinear.
One major drawback to Procoder, and one (of a couple) of the reasons why I refuse to use it, is that you can't choose your quantization matrix, and are stuck with the lousy Standard Matrix (as it's called by CCE). That, combined with the fact that it softens all encodings with a filter that can't be turned off (the other reason), means that your average quants are quite low. If you could use a higher bitrate matrix (by using HCEnc or CCE, for example), they would be higher, but your encodings would be (in my opinion) sharper and more detailed. Check out those Criterions for the matrix they use. I'm not saying you should use it, but that any decent DVD production company or major studio gave up using the Standard Matrix years ago.
Oops, I made a mistake on the list: I used HC on Ecstasy of the Angels, not ProCoder 2...
Manono: I understand what you're saying about ProCoder's drawbacks. But personally, I've never been able to see that much of a difference between matrices. The differences are usually oh-so-slight. On the other hand, when I compare ProCoder 2 versus HC (on certain sources), the reduced amount of macroblocking really stands out. I guess that's what my eyes are most sensitive to. I've been meaning to revisit HC and play around with the LUMGAIN parameter, since I tend to notice macroblocking mostly in darker scenes.
OT: What's your favorite Masumura film? Mine would have to be Giants and Toys, although I haven't seen even a fraction of his HUGE filmography.
manono
5th June 2007, 05:23
What's your favorite Masumura film?
I've only seen 3 myself, Giants And Toys, Blind Beast, and Red Angel:
http://former.imdb.com/title/tt0051834/
http://former.imdb.com/title/tt0140384/
http://former.imdb.com/title/tt0139820/
Blind Beast is way too weird for my tastes, Giants And Toys is very good, and I thought Red Angel truly excellent. Just my opinion.
After ronnylov's post I did some experimenting using linear and nonlinear quantization and was surprised by what I found. I did a trailer for a movie using a 1-pass CQ encode and all other settings the same except for the linear/nonlinear. Here are the file sizes and average quants as given by Bitrate Viewer:
1-Pass CQ FileSize Ave. Quant
Nonlinear 56,604 KB 6.22
Linear 65,288 KB 2.69
I thought that so strange that I went back and ran some multi-pass tests so I could have a look at the Ave Quants in CCE's VBR Bitrate Allocation window. It shows them to be nearly identical. Here are the same results with Bitrate Viewer:
2-Pass VBR FileSize Ave. Quant
Nonlinear 57,286 KB 6.18
Linear 57,209 KB 3.22
My conclusion is that Bitrate Viewer chokes on Linear Quantization. I don't use Linear Quantization anyway, so it was just an academic exercise.
dragongodz
5th June 2007, 06:39
is there any kind of correlation between avg quant and final visual quality?
I like to think there is, although maybe I'm just deluding myself. :)
yes you are deluding yourself. ;)
the simple fact is when talking about getting lower quants at the same final file size there is always a cost. that means you must make the material more compressable.
to do that means losing information/detail. now if it is very fine detail that a person may not see or notice is gone then indeed you may gain a bit of extra quality. however you can also lower quants noticably and end up with smudged/blurred/smoothed out result that someone may not find as pleasing.
so the connection between quant and quality at the same end size is very tenuous and in no way should be trusted alone.
EDIT:
yes it could be argued that the higher quant may also lose some detail. while true a good encoder will still try to retain as much detail as possible and try to get the bitrate down in flatter areas.
manono
5th June 2007, 11:02
yes you are deluding yourself.
I'm not sure we disagree. When kumi asked the question, he didn't qualify the question by saying for 2 files the same size. Maybe it was understood that he was talking about files of the same size. I don't know. When I answered the question, I didn't qualify it either. It's apparent that 2 encodes of the same material with identical settings except for the bitrate/filesize differences will produce results of different quality. The greater the difference in the bitrates, the greater and more obvious the quality differences. What I was really talking about, though, was choosing the right matrix to produce a pretty consistent final average quant among my various encodes.the simple fact is when talking about getting lower quants at the same final file size there is always a cost. that means you must make the material more compressable.
to do that means losing information/detail.
My basic contention is that if you do an encode using the Standard Matrix with an average quant of 3 and then compare it, in terms of similarity to a high quality source, with an encode using the Fox Home Entertainment Matrix of the same bitrate/filesize with an average quant of , say, 7, that the Fox encode is of higher quality. The reason is that the Standard Matrix starts out by filtering so much important low frequency detail that even though the ave. quant is much lower, because the Fox encode is filtering more of the less noticeable high frequency detail, it produces a better result. Based on what I quoted of yours just above this paragraph, I think you would agree with me.
so the connection between quant and quality at the same end size is very tenuous and in no way should be trusted alone.
I can find nothing in that statement with which to disagree. Some idiot can put on a strong spatial filter in his script, or enable heavy vertical and low-pass filtering in CCE, get lower average quants than he would without the additional filtering, and then claim his is the better encode. And, of course, that's nonsense, especially when discussing encoding from a high-quality DVD source. Such things might come in handy if encoding some crummy hand-held camera home movie footage, or making a VHS->DVD conversion. Me, if I want to get the size down while maintaining decent quality, when encoding an extra, or when encoding a very long movie, I'll let the chosen matrix do the filtering for me.
dragongodz
5th June 2007, 11:57
When kumi asked the question, he didn't qualify the question by saying for 2 files the same size.
well he did say "down to dvd" so i would assume there was the limitation on final file size.
The reason is that the Standard Matrix starts out by filtering so much important low frequency detail that even though the ave. quant is much lower, because the Fox encode is filtering more of the less noticeable high frequency detail, it produces a better result. Based on what I quoted of yours just above this paragraph, I think you would agree with me.
yes i agree. that is why i mentioned it depended on what and how much detail was being filtered.
Some idiot can put on a strong spatial filter in his script, or enable heavy vertical and low-pass filtering in CCE, get lower average quants than he would without the additional filtering, and then claim his is the better encode. And, of course, that's nonsense, especially when discussing encoding from a high-quality DVD source.
which sums up my contention rather well, only adding that a bad choice of matrix could have a similar result. :)
Me, if I want to get the size down while maintaining decent quality, when encoding an extra, or when encoding a very long movie, I'll let the chosen matrix do the filtering for me.
and thats certainly a handy weapon to have but like any type of filtering is best used with caution unless a person understand exactly what they are doing. i have no doubt you do but have concerns about newbies just throwing a super duper low bitrate matrix at things thinking its all going to look better.
things like Rockas's matrix previewing program, for DVD-RB, is a great tool to check out the effects of different matrices on different material. its a pity there isnt something to automate doing that for other sources.
Fishman0919
5th June 2007, 13:20
I started a test along time ago but never completed.
It was comparing encoders and I did a quick test with CCE SP between Linear and Non-Linear to see what people liked better.
The test was several samples encoder at 2750k... I asked about 50 or so people and about 2/3 like the linear samples better.
I also did some SSIM and PSNR, linear always scored better (not that that really mean anything on how good it looks)
EDIT: maybe I should try and finish that test and post it.... time, time, time.
hank315
5th June 2007, 16:44
2-Pass VBR FileSize Ave. Quant
Nonlinear 57,286 KB 6.18
Linear 57,209 KB 3.22
My conclusion is that Bitrate Viewer chokes on Linear Quantization.
The difference isn't that large, BitRate Viewer outputs the quantizer_scale_code, not the real quantizers.
To get the real quantizers using linear scaling the values in BRV must be multiplied by 2.
I've seen at least a bit of correlation between quants and quality, when comparing between frames in a single video, and comparing between different matrices operated on a single video.
Here's a question for you guys: let's say I have a video source, and I know everything about it. Quants, bitrate, matrix, filesize etc.
Is it possible to calculate (or even 'guesstimate') the average quantization of a re-encoded resultfile, if I encode it with the same matrix as used in the source and I know the final output size? I'm guessing "no" in the case of ProCoder and it's wacky filtering, but what about the more "predictable" HC?
manono
6th June 2007, 15:34
Is it possible to calculate (or even 'guesstimate') the average quantization of a re-encoded resultfile
I've wondered about that myself, as knowing the answer would help greatly in choosing the matrix to use. Although it doesn't seem at all intuitive to me, as near as I can tell you're working with some kind of an inverse logarithmic scale. If, for example, I'm encoding to 2/3 (67%) of the original size, and using the same matrix, the resulting average quant about doubles when compared to the original. I've done this enough times, though, that when I know how much I'm compressing from the source, and the matrix used by the source, I usually know the matrix to use for the ave quant I want. And if I guess wrong, as sometimes happens, I can always run a few more passes in CCE, or do it over again in HCEnc.
when I know how much I'm compressing from the source, and the matrix used by the source, I usually know the matrix to use for the ave quant I want.
I'm really curious about this... what might you fill in for the four target matrices below?
Source matrix Compression Target matrix
-----------------------------------------
MPEG Standard 80% ?
MPEG Standard 60% ?
FOX Home Ent. 80% ?
FOX Home Ent. 60% ?
My current method for choosing a matrix is an unsatisfactory roll-the-dice sort of affair: where I look only at the final bitrate and the compression ratio. But your method of taking into consideration the source matrix appeals to me... do you ever choose a higher bitrate matrix than what is present in the source? Or do you always go with a lower bitrate matrix, no matter the compression ratio?
manono
7th June 2007, 02:04
Sorry, but I forgot to mention one of the important variables, the ave quant of the source. Also, Fox is one of the good matrices and MPEG Standard isn't. It's better than the CCE default Standard Matrix (called MPEG in HCEnc), but not anything a Hollywood studio would use on a DVD. You do see the Standard and MPEG Standard matrices all too often on DVDs from other places, though. Sometimes you're forced to use matrices that compress like those 2, but for the MPEG Standard matrix, I have 2 that compress similarly, but are, in my opinion, better.
If I have a less than good source, I might run it through LimitedSharpenFaster to try and bring out any remaining detail. And I'm not going to start posting all kinds of matrices in this thread, although I'll be happy to discuss it privately with you.
...do you ever choose a higher bitrate matrix than what is present in the source?
There's not much point in it usually, because you're usually compressing the movie by quite a bit. I have done it on occasion, though, when recompressing a DVD5 for one reason or another (hard telecined, PAL2NTSC with field blending), and I'm making the reencode larger than the source retail DVD in order to fill the DVD5 more completely.
My suggestion is to start collecting matrices from retail DVDs and do some tests with them (and some of the ones included in HCEnc, but many of them are junky XviD low-bitrate matrices, no offense intended) to find how they compress relative to each other. Then after you get a nice spread of matrices that compress differently, limit yourself to those half a dozen or so. Either that or, if using CCE, just use the Standard matrix with AQ turned on and forget about the whole thing. :)
[...]after you get a nice spread of matrices that compress differently, limit yourself to those half a dozen or so.
That's a great idea, the selection of RME/HC matrices can be overwhelming.
I'm not going to start posting all kinds of matrices in this thread, although I'll be happy to discuss it privately with you.
I might PM you in the future, thanks :)
45tripp
7th June 2007, 18:52
Regarding linear vs non-linear quantization.
when trying to squeeze the mainconcept standalone for all it has, I found selecting linear
quant produced better results. Both on metrics and visual quality. I'd say it happens always,
regardless of source type and target bitrate level. I tested a bit again with
short samples of xvid, ,dvd and dv to mpeg2.
Here are some pics of a particular frame of xvid->mpeg2.
1. at a very low bitrate under 2000kbits/s where the difference is pronounced and
2. at a high bitrate 5000 kbits/s where the difference is still visually evident:
original (http://img299.imageshack.us/my.php?image=orfn8.png)
nonlinear2000 (http://img299.imageshack.us/my.php?image=nonlinearmz2.png)
linear2000 (http://img75.imageshack.us/my.php?image=linearix9.png)
nonlinear5000 (http://img75.imageshack.us/my.php?image=hnonlinearny7.png)
linear5000 (http://img123.imageshack.us/my.php?image=hlineartd4.png)
In fact I found that by setting non-linear quant to I frames and linear to P and B frames,
I got the best results. Considerably better than non-linear quant.
Interesting I thought. And I'd like to perhaps see a feature enabling the ability to change quant mapping
based on frame type in HC.
Could just be a mainconcept phenomena though.
Can't really check with anything else.
Did a few quick tests with CCE, putting linear vs non-linear.
Rather inconclusive.
With the same xvid clip, and very low bitrate, non-linear got the better in metrics.
Ever so slightly, in each frame. Nothing visible.
I also tried a normal bitarate of 4500 to re-encode a section of the Skeleton Key DVD.
Here linear got the better. Again closely closely matched but there were a few frames where linear
trumped non-l. i don't know. Skeleton key is very dark...
The diff came at frames with strong contrast between very dark and light, with each taking
approx 50% of the frame.
gl
hank315
7th June 2007, 21:34
Using non linear scaling can produce higher quants than linear scaling.
Some MB's in your low bitrate pics look if they have been done with a very high quant_scale_code, non linear might use a quant of 112 in these, linear only goes up to 62.
In general non linear scaling gives a better control over the quantizers and bitrate control so I'm not very keen implementing linear scaling.
The next pic gives the releation between the quant_scale_code (1-31) and the real quantizers for linear and non linear scaling.
http://img111.imageshack.us/img111/884/qscaletw1.png
45tripp
10th June 2007, 03:23
thanks for the graph.
yeah you're right.
I had sections where the quant_scale_code spiked high.
The reason mainconcept.
VBR mode is very poor. I even downloaded a vegas trial to check, perhaps I'd messed something up in the standalone settings.
I had temporarily retracted a comment to double check stuff, but
mainconcept's vbr mode is third rate, mainconcept at default settings is absolute shit.
Anyway
I re-tried linear vs bilinear utilising mainconcept's cq mode:
size av.Q peak.Q vqm ssim
nonlin cq2 78.7 1.28 3.14 .516 .9919
linear cq1 78.9 0.15 1.5 .516 .9918
nonlin cq4 39.9 3.37 5.68 .591 .9873
linear cq2 41.6 1.04 2.74 .584 .9878
nonlin cq8 22.4 7.44 9.75 .733 .9777
linear cq4 23.2 3.39 5.03 .694 .9790
nonlin cq10 19.3 8.52 11.78 .796 .9733
linear cq6 18.8 5.48 7.25 .764 .9736
nonlin cq12 17.4 9.88 12.88 .856 .9694
linear cq8 17.2 6.46 8.52 .812 .9698
I think I see what you mean about bitrate control,
but it seems to me the heavier compression is, the more favoured linear quant mapping is. I'd think having the ability to change quant mapping, by frame type, or having it automatically switch in some cases could prove beneficial.
I don't know how each encoder works, but for mainconcept I still find setting b frames to linear quant mapping a good thing.
ty
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.