Quantization works by breaking large input sets into smaller ones by removing information that might not be as relevant. A small example of this is, instead of storing data like: 28.56 we store it 28.56204234672.
So QP work by keeping the information it throws away consistent, thus resulting in a constant quality. In the H263 (xvid,divx, mpeg part 4, 3ivx) days a QP of 1 = 100% quality and every step was 5 less, so a QP 3 would be 90% and QP 5 = 85% and so on.
In H264 a QP 0 = 100% and there are 51 steps suggesting that every step is roughly 2% quality loss of course that is all mathematical and in the real world we deal with perceptual. And that is where CRF comes in.
Constant Rate Factor
CRF works similarly to QP in that it tries and mimics the perceptual quality output of QP, such that a QP 21 would look to the human eye near identical to a CRF 21, it does this by reducing information in areas the human eye can't perceive and redistributes them in other areas that might need more data.
QP: 2.6 GB
CRF: 2.1 GB(24% smaller)
So lets take a look at how CRF scales with different resolution sizes. The y-axis represents file size and the x-axis the vertical lines from 96x52p to 1920x1040p. The first step is 5% pixels of max and the second is 10%, the 3rd 15% and so on until 100% of/or 1920x1040.
So what is a good CRF value? It mainly depends on what you want, if you want a near identical copy then 18, High Quality 19-21.
But lets see how various CRF values impact the compression of a file. y-axis is file-size and x-axis is the CRF value