Log in

View Full Version : What Harms and Helps with Low vs High bitrates?


Lyle_JP
8th February 2006, 21:58
I have abandoned all DivX encoding after doing numerous side-by-side comparisons with DivX and XviD 1.1. XviD is simply an amazing codec. However, I want to make sure I fully understand all the options and what is best to turn on for a low bitrate rip vs. a high bitrate rip. I have tried to break every option down into 4 categories: Always makes picture look better, never makes picture look better, makes picture better in low-bitrate rip but compromises pic at high bitrates, and makes picture better in high-bitrate rip but compromises pic at low bitrates.

I would like some input on my conclusions (some of which I have come to out of my own experiences, some from searching here). Also, the following assumptions are being made:
* Encoding time is not a factor
* All encodes are two-pass with definite target filesizes in mind
* low bitrate is defined as 40% - 60% of compressability test
* high bitrate is defined as greater than 80% of compressability test
* Items marked in red likely not compatible with stand-alone players

Always Helps
Ultra high motion search
VHQ Mode 4
VHQ for b-frames
Chroma Motion?
Quarter Pixel
GMC

Never Helps
Turbo

Helps Low but Hurts High
Adaptive Quantization?
Trellis Quantization?
H.263
CQMs formulated for low bitrates

Helps High but Hurts Low
MPEG quantization
CQMs formulated for high bitrates

The items marked with question marks seem to be issues of contention on previous builds. Is there a sense of consensus now that 1.1 final has been released? Should Trellis and AQ be in the "Always helps" list? What about Chroma motion?

-Lyle J.P.

Teegedeck
8th February 2006, 23:20
I don't think AQ should be in the 'always helps' list; at low quantizers you can have the strange effect that quite many macroblocks receive the same quant in b-frames as in p-frames (because there is no AQ in b-frames). That kind of contradicts the idea behind b-frames. So I have come a bit wary of AQ here, but I think that it helps with mid- to strong compression but only on files where it actually kicks in often. When AQ saves 4-5% bitrate in constant quant mode on a file I would consider it worthwhile; of course you get such and higher savings more often when you use high quantizers.

Trellis is always a good idea. The best thing since sliced bread (well, sliced bread an VHQ).

mod
9th February 2006, 00:04
Why "turbo" never helps? It's just because encoding time isn't a relevant factor, or there're other reasons?

Didée
9th February 2006, 00:55
Throwing some cents ...



VHQ Mode 4

It helps most times, but not always. VHQ4 will result the "most efficient" coding, but there are cases (sources with certain noise characteristics) where it will look worse than VHQ3..1. "Most efficient" to the encoder is not always "most pleasing" to the human eye. It's difficult to explain - best way is, if you're encoding something with visible noise, make some short tests if VHQ4 will produce "floating" artefacts. If yes, re-try with lower VHQ modes and see whether or not it gets better.


Chroma Motion

Always helps. However it's not so much about improving the "overall impression" ... it's more about avoiding artefacts in certain image parts where motion search without considering chroma information would lead to "wrong" motion vectors.


Quarter Pixel

A matter of the source (each is unique), and also a matter of taste. For me it's mostly "yes", but other opinions are same valid.


GMC

Hmmh, GMC ... well, it always helps. It always helps, by an amount so small that you need fine maths to reveal the difference it has made...


CQMs formulated for low/high bitrates

Oh, you just reminded me that it's indeed possible to use the builtin mpeg/h263 quantizations ... I knew I had forgotten something :D


Then, if you're going to do a "high bitrate" encoding, give a try on changing B-frame settings from max/ratio/offset 2/1.50/1.00 (default) to 1/1.62/0.00.
Explaining this is cumbersome again ... but if your comp.test is >80%, try it.


Everything above is i.m.h.o. :)

foxyshadis
9th February 2006, 01:32
GMC looks really bad on low-bitrate, but I mean sub-500... so if you mean 700-1200 then sure, it's great (if not always worth the extra encoding and decoding cost). Qpel always adds a few bits and doesn't always take enough off to balance... but AVC obviously decided it was a good idea to use qpel always.

mod, turbo shuts off vhq, iirc. vhq raises precision, whereas turbo lowers it. ;p

mod
9th February 2006, 02:04
turbo shuts off vhq, iirc. vhq raises precision, whereas turbo lowers it. ;p
Hey, THANKS!!!!

unskinnyboy
9th February 2006, 05:28
Agree with Teegedeck here about AQ & Trellis. There is no reason to use AQ if the compressibility is quite high. I generally shut AQ off for Anime, dark/moody movies and for any movie where the compressibility is quite high (>75%). AQ can boost the compressibility a bit more there, but then again you don't need that extra boost when you already have a high compressibility. Chances are the artifacts (nice dancing blocks in a black background) likely to be caused by AQ might ruin it for you (it does for me).

@mod: To know what Turbo does, check here (http://forum.doom9.org/showthread.php?p=707858#post707858). Turbo results in a theoretical drop in quality. You may or may not perceive it. If you don't, then by all means use it.

mod
9th February 2006, 10:47
@unskinnyboy: ah, I missed that post 'cause I don't use AGK..
After years of encoding, I discover this noob fault.. :(
BTW, I don't use QPel, so, according to the linked post, maybe the quality seems not different to my with or without turbo because it affects "only" b-frames..
But.. MY target isn't a quick encode, so I think I'll switch turbo off.. :D
Thanks again for the reply.

Lyle_JP
10th February 2006, 00:38
AQ can boost the compressibility a bit more there, but then again you don't need that extra boost when you already have a high compressibility. Chances are the artifacts (nice dancing blocks in a black background) likely to be caused by AQ might ruin it for you (it does for me).

Yes, I have seen this, but I have also been told that Trellis can cause this too, which is why I initially put it in the "Hurts on High" list. Is this not the case? Also, I had read somewhere that Trellis was only effective with H.263 quantization. Is that still true, or is it really old info?

-Lyle J.P.

Poutnik
10th February 2006, 06:22
I think Teegedeck wrote somewhere it was true trellies had caused
errors at some circumstanes ( e.g. with low quants at some CQM ),
but these errors was eliminated and at time on his writing
it was not known any troubles about Trellis.

Teegedeck
10th February 2006, 06:45
That is correct. Those were very outdated infos. It's amazing how bugs from 'alpha-versions' of features like Trellis and VHQ stick in public memory.

Lyle_JP
10th February 2006, 23:39
Okay, so based on the feedback in this thread, my new lists should look something like this:

Always Helps
Ultra high motion search
VHQ for b-frames
Chroma Motion
Trellis Quantization
Quarter Pixel

Never (or Rarely) Helps
Turbo
GMC

Helps Low but Hurts High
Adaptive Quantization
H.263

Helps High but Hurts Low
MPEG quantization

Source Dependent*
VHQ Mode (1 for noisy, 4 for clean)
Custom Quantization Matricis

*Yes, I know, technically everything is source dependent. I'm just looking for a formula that covers a good 90% of DVD rips with a two-pass strategy.

Thanks everyone for your input!

-Lyle J.P.

Elic
11th February 2006, 13:39
Hmm, IMHO there is one more quality-raising factor: bitrate curve compression, especially helpful in mid-to-low bitrates and on sources of wide range of movement and detalization (from nearly-static close-ups to sports/forest/rain). It allows to "borrow" some percent of (relatively high) bitrate from high-motion scenes (where worsening is not so visible) and lend it to low-motion scenes in order to significantly improve their quality. I use about 6-15% of "low bitrate improvement" and about 15-35% of "high bitrate degradation" (exact numbers are highly dependent on source).

Teegedeck
11th February 2006, 14:19
I agree. A mild setting like low 5, high 15 should help on most encodings with an average quant worse than, say, 2.5 (respectively something like quant 4 with SixOfNine).

And as we are getting now into the more obscure of settings, perhaps you'd be interested to research the subject 'first pass at a constant quantizer bigger than 2'...

BTW, I support Didée's alternative b-frame settings.

shon3i
11th February 2006, 15:50
@Teegedeck i agree with you. You can also doing first pass at q=3 this helps always but with Didee b-frame settings averge qunats from 3.50 can be 2.80, and curve compression 20/10 or 25/15 and overflow treatment 0/5/5 or 0/4/9 and what cqm you preffered

Didée
11th February 2006, 21:44
Ah, curve compression ...

There's no definite proof, but from some testing (around XviD v1.0 times) it was my impression that the "high" percentage of CC is relative to the given max. quantizers *if* quantizers are limited. With unlimited quantizers (1-31), a CC setting of of low/high 20/40 will lead to quantizers spreaded rather wide ... but when quants are limited i.e. 2-6 (aiming at avg. P-quant of 3.0~3.5), the spread is much more narrow.

Also, syskin once mentioned overflow treatment settings of 0/7/4 ... and 0/8/4 has become my quasi-default setting for this.

Elic
11th February 2006, 22:08
Teegedeck >> 'first pass at a constant quantizer bigger than 2'
Didée > With unlimited quantizers (1-31), a CC setting of of low/high 20/40 will lead to quantizers spreaded rather wide
Yes, I tried 1st pass @ q3 and got much more linear distribution of quants. And of course I got out of annoying effect that the less bitrate, the higher quant (i.e. quant 4-5 on low motion scenes and ~3 on high-motion. However, I want more "equitable" :) quant distribution - for example, quant 2...3 on near-stills (face close-up) and 4..5 on fast-motion high-detail scenes.

Didée > overflow treatment settings of 0/7/4 ... and 0/8/4 has become my quasi-default
Sorry, I didn't understand "overflow treatment" and so I don't touch defaults. Can you please direct me to intelligible manual about it, and/or advise about "what watch on" during experiments around this strange thing? :)

olymind1
12th February 2006, 00:56
hi, since i'm newbie here too, and i'm looking for this formula too, so i'd like to advise to make it sticky, 'couse there are a lot of topics about what is the best, better, good settings, and since most of the switches are here, there is no point for making any more this question releadet topics, so it would be easy to find for newbies, and maybe on newer release of xvid it would be good to keep it up-to-date

but it is just a suggestion, but hope a good one :)

and thanks for the info :)