Log in

View Full Version : x264, 1 pass quality mode, trellis, b-frames and sharktooth profiles


anaqim
24th January 2007, 13:35
Hi, I'm reading these forums alot more than i post. Usually searching will produce some answers given some time.

There are a few issues i'd like to get help with which I still wonder about:

1) I am doing single pass quality encodes and I found a guide for mencoder and another from a DVD forum that say never use trellis with 1 pass as it can give unexpected results. These posts are a few years old as far as I can see and at the same time i notice that for example Sharktooth has activated trellis 1 in his single pass quality profile. The tests i've done show that using both trellis 1 and 2 can give considerable file size changes. What is the updated truth about this subject?

2) B-frames. I see that alot of recommendations for using 3-5 B-frames when encoding typical movies. At the same time there is a parameter that activates adaptive use of B-frames. My tests show that even if i set 16 B-frames, the adaptive thing seems to work fine as speed is usually not affect much which I guess indicate its working as intended. So if this adaptive thing is working, why limit B-frames to 3 or at all? Is there a potential downside to allowing the adaptive algorithm unrestricted access to all B-frames?

3) Im using Sharktooths custom CQM but one thing i cannot seem to figure out is which loop filter settings to use with it. I presume the CQM has been designed with a particular loop filter setting in mind. If not, which one would Sharktooth recommend with his filter for encoded targetting --crf 20-22?

4) About CQM. I read somewhere that Sharktooths CQM is tuned for bitrates around 1200-1400. Is this a good CQM for --crf 20-22? what about for --crf 18? If not, should I use the default one or can you recommend a different one?

My current non-trellis syntax which gives me decent fps is:

" --crf 22 --ref 16 --bframes 16 --b-pyramid --weightb --b-rdo --bime --filter -1:-1 --analyse all --8x8dct --no-fast-pskip --subme 7 --me umh --mixed-refs --progress --threads auto --no-psnr --cqmfile "e:\data\settings\eqm_avc_hr.cfg"

Thanks for helping out and an excellent forum!!


Anaqim


Note! I am aware that using 16 reference frames will slow down encodes and might not be very efficient nor useful for average movies and that its generally more worth with extra reference frames for animated content. Still I like to max things out and the encoding time difference doesnt bother me much.

Manao
24th January 2007, 23:13
1) size always matter ( if not, why encode ? ).

Trellis improves the relationship quality / size, but it does so sometimes by lowering both size and quality ( but size more than quality ), sometimes by increasing both ( quality more than size ), sometimes even by increasing quality and decreasing size. When you target a bitrate/size, trellis will give better results. So trellis is good.

2)So if this adaptive thing is working, why limit B-frames to 3 or at all?That's a good reasoningIs there a potential downside to allowing the adaptive algorithm unrestricted access to all B-frames?If it did, somebody would have made a report. Anyway, practically, the encoder will hardly never use 16 bframes in a row.
3)Deblocking is a subjective matter. Some people prefer 0, other -4, so it's really up to you to test.
4)CQM are never tuned for a specific bitrate. A bitrate by itself is meaningless. It may be "tuned" for a quantizer, but I also doubt it. Anyway, there again, CQM's quality perception is subjective.

Commenting your settings : as you noticed, --ref 16 is an overkill ( anything over 4-5 refs is ). Actually, when testing, it often happens that over 7-8 reference, the quality at a given size doesn't increase anymore, and often may fluctuate ( 9 ref better than 8, but 10 and 11 worse than 9, then 12 better than 9... ), so you really should consider not using that much references.