mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
histogram: add log2 wrapper
Change-Id: I5e68efaf5f763a42ace1af83f4b7887e0ddfd099
This commit is contained in:
parent
8c34378ff3
commit
9b71502669
@ -7,6 +7,9 @@
|
|||||||
//
|
//
|
||||||
// Author: Jyrki Alakuijala (jyrki@google.com)
|
// Author: Jyrki Alakuijala (jyrki@google.com)
|
||||||
//
|
//
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef USE_LOSSLESS_ENCODER
|
#ifdef USE_LOSSLESS_ENCODER
|
||||||
|
|
||||||
@ -17,6 +20,17 @@
|
|||||||
#include "./histogram.h"
|
#include "./histogram.h"
|
||||||
#include "../dsp/lossless.h"
|
#include "../dsp/lossless.h"
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && !defined(NOT_HAVE_LOG2)
|
||||||
|
# define NOT_HAVE_LOG2 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NOT_HAVE_LOG2
|
||||||
|
static WEBP_INLINE double log2(double d) {
|
||||||
|
const double kLog2Reciprocal = 1.442695040888963;
|
||||||
|
return log(d) * kLog2Reciprocal;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void HistogramClear(VP8LHistogram* const p) {
|
static void HistogramClear(VP8LHistogram* const p) {
|
||||||
memset(p->literal_, 0, sizeof(p->literal_));
|
memset(p->literal_, 0, sizeof(p->literal_));
|
||||||
memset(p->red_, 0, sizeof(p->red_));
|
memset(p->red_, 0, sizeof(p->red_));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user