[x264-devel] [PATCH]adaptive lowpass

Eric Viscito eric at ev-consulting.com
Thu Jun 28 05:38:57 CEST 2007


Hi Loren,

Thank you for your reply.

I should have read through the patch.  Now I see it is scaling the DCT
coefficients, obviously after prediction, and that the adaptivity is
purely to QP.  My comments are more applicable to adaptive low pass
filtering in the spatial domain prior to even the prediction.

A general principle is that each compression system has a sweetspot in
terms of what bandwidth signal it can efficiently compress.  If content is
outside that range, the end result looks better if it is prefiltered and
possibly even resolution-reduced.  That is why we had things like HHR in
MPEG-2, and still have "HD" that is not 1920 pixels wide.  That is still a
prefilter on the original data.  I know that technique is outside the
scope of this discussion, but it is definitely related.

A few comments directed to your issues are in-line.

Eric

On Wed, June 27, 2007 4:51 pm, Loren Merritt wrote:
> Is it better to multiply the coeffs by some fraction, rather than
> subtracting a constant (in the case of deadzone) or increasing lambda (in
> the case of trellis)? That wouldn't be strictly a lowpass, but it would
> also reduce the bits in high frequencies by changing coefficient magnitude
> rather than step size, and would be closer to RD optimal.

A deadzone does not subtract a constant from every coefficient, but rather
sends a larger bucket of coefficients to zero and leaves the quantizer
characteristic alone for coefficients outside that big bucket and the two
that surround it.  So it reduces the magnitude of small coefficients,
independent of their location in the spectrum.  However, using a weighting
matrix, together with the naturally lowpass nature of images makes the
deadzone preferentially zero out higher frequencies.  It will act like a
lowpass filter or even an "all-reject" filter, but spatially variant, and
only in places and at frequencies where the prediction is good.

A deadzone can be in an RD-cost loop, or it can be static.

Raising lambda in the trellis quant algorithm will reduce the juiciest
coefficients from an R/D perspective, considering all non-zeros in one
block at a time.  That seems pretty powerful.  This is still spatially
variant but not as obviously dependent on prediction quality since it
operates on all magnitudes of coefficients.

The adaptive lowpass filter is not in an RD-cost feedback loopand its
adaptivity is unrelatd to scene content.  Therefore, it might be blurring
areas where the blurring is quite visible but not delivering a
commensurate bit reduction cost.  The filter attenuation is dependent on
prediction quality, making it spatially variant even though it is applied
equally everywhere that QP is the same.  It seems like a less
discriminating way of reducing bit rate at the expense of distortion than
the trellis RD quantizer.

My only hesitation is that I'm just not sure where that "rasining lambda"
logic takes you.  Eventually, the cost of bits is so high that the trellis
algorithm starts introducing egregious distortions.  They won't be quite
so easy on the eye as a little blurring.  This is nothing more than the
old "what lambda should we use" problem, isn't it?

In summary, I think you have asked a very tough question and I have not
answered it.

;-)

My gut says the answer is more likely to be to tweak the trellis, but that
there will be cases where a content- and QP-adaptive pre-filter is a good
idea.


>
> On Wed, 27 Jun 2007, Eric Viscito wrote:
>
>> The CQM quantizer reduces bits by injects more quantization noise into
>> the
>> high frequencies without changing the magnitude of those frequencies.
>
> The quantizer almost always rounds down, so increasing the quantization
> step size also reduces the average coefficient magnitude.
>
>> The reduction in bits in the two schemes comes with different types of
>> distortions.
>>
>> So the *adaptive* LPF provides a means to trade off the two types of
>> distortions.  If the adaptive filter control is sound, this can be a
>> benefit.
>
> It can adapt the amount of bits spent in high vs low freqs. But the CQM is
> still constant, so the LPF vs quantization noise is still not adaptive.

Again, my comments were regarding a pre-filter.
>
> --Loren Merritt
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel
>




_______________________________________________
x264-devel mailing list
x264-devel at videolan.org
http://mailman.videolan.org/listinfo/x264-devel



More information about the x264-devel mailing list