mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 13:59:51 +02:00
fast auto-determined filtering strength
kLevelsFromDelta[sharpness][delta] is an inverse look-up table that tells the minimum filtering strength needed to trigger the filtering of a step with amplitude 'delta'. We use this table in various situations: a) when computing the initial (/global) filtering strength for each segment. We look at the quantization step and deduce the proper filtering strength needed to result this quantization noise (talking the -f option into account). b) during intra16 calculation, when a block ends up very empty (only DC coeffs are non-zero, all ACs have vanished). We'll rely on the in-loop filtering to restore the smoothness (if the source was gradient-like smooth. That's why we look at the distortion too before triggering the filtering). Step b) goes _in addition_ to a), potentially raising the filtering strength if blockiness is likely. Change-Id: Icaeca93ef21da195b079e6587a44d9edfc8e9efa
This commit is contained in:
@ -248,6 +248,8 @@ typedef struct {
|
||||
int beta_; // filter-susceptibility, range [0,255].
|
||||
int quant_; // final segment quantizer.
|
||||
int fstrength_; // final in-loop filtering strength
|
||||
int max_edge_; // max edge delta (for filtering strength)
|
||||
int min_disto_; // minimum distortion required to trigger filtering record
|
||||
// reactivities
|
||||
int lambda_i16_, lambda_i4_, lambda_uv_;
|
||||
int lambda_mode_, lambda_trellis_, tlambda_;
|
||||
@ -555,6 +557,10 @@ void VP8InitFilter(VP8EncIterator* const it);
|
||||
void VP8StoreFilterStats(VP8EncIterator* const it);
|
||||
void VP8AdjustFilterStrength(VP8EncIterator* const it);
|
||||
|
||||
// returns the approximate filtering strength needed to smooth a edge
|
||||
// step of 'delta', given a sharpness parameter 'sharpness'.
|
||||
int VP8FilterStrengthFromDelta(int sharpness, int delta);
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
|
Reference in New Issue
Block a user