// Copyright 2011 Google Inc. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the COPYING file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // ----------------------------------------------------------------------------- // // Selecting filter level // // Author: [email protected] (Somnath Banerjee) #include <assert.h> #include "src/enc/vp8i_enc.h" #include "src/dsp/dsp.h" // This table gives, for a given sharpness, the filtering strength to be // used (at least) in order to filter a given edge step delta. // This is constructed by brute force inspection: for all delta, we iterate // over all possible filtering strength / thresh until needs_filter() returns // true. #define MAX_DELTA_SIZE … static const uint8_t kLevelsFromDelta[8][MAX_DELTA_SIZE] = …; int VP8FilterStrengthFromDelta(int sharpness, int delta) { … } //------------------------------------------------------------------------------ // Paragraph 15.4: compute the inner-edge filtering strength #if !defined(WEBP_REDUCE_SIZE) static int GetILevel(int sharpness, int level) { … } static void DoFilter(const VP8EncIterator* const it, int level) { … } //------------------------------------------------------------------------------ // SSIM metric for one macroblock static double GetMBSSIM(const uint8_t* yuv1, const uint8_t* yuv2) { … } #endif // !defined(WEBP_REDUCE_SIZE) //------------------------------------------------------------------------------ // Exposed APIs: Encoder should call the following 3 functions to adjust // loop filter strength void VP8InitFilter(VP8EncIterator* const it) { … } void VP8StoreFilterStats(VP8EncIterator* const it) { … } void VP8AdjustFilterStrength(VP8EncIterator* const it) { … } // -----------------------------------------------------------------------------