epf.h (980B)
1 // Copyright (c) the JPEG XL Project Authors. All rights reserved. 2 // 3 // Use of this source code is governed by a BSD-style 4 // license that can be found in the LICENSE file. 5 6 #ifndef LIB_JXL_EPF_H_ 7 #define LIB_JXL_EPF_H_ 8 9 // Fast SIMD "in-loop" edge preserving filter (adaptive, nonlinear). 10 11 #include "lib/jxl/dec_cache.h" 12 #include "lib/jxl/image.h" 13 #include "lib/jxl/loop_filter.h" 14 15 namespace jxl { 16 17 // 4 * (sqrt(0.5)-1), so that Weight(sigma) = 0.5. 18 static constexpr float kInvSigmaNum = -1.1715728752538099024f; 19 20 // kInvSigmaNum / 0.3 21 constexpr float kMinSigma = -3.90524291751269967465540850526868f; 22 23 // Fills the `state->filter_weights.sigma` image with the precomputed sigma 24 // values in the area inside `block_rect`. Accesses the AC strategy, quant field 25 // and epf_sharpness fields in the corresponding positions. 26 void ComputeSigma(const LoopFilter& lf, const Rect& block_rect, 27 PassesDecoderState* state); 28 29 } // namespace jxl 30 31 #endif // LIB_JXL_EPF_H_