Guard the lossless encoder (in flux) under a flag

Change-Id: I6dd8fd17089c199001c06b1afde14233dc3e3234
This commit is contained in:
Urvang Joshi
2012-04-11 09:52:13 +00:00
committed by James Zern
parent 09f7532cce
commit 6b38378acb
16 changed files with 82 additions and 4 deletions

View File

@ -19,8 +19,10 @@ extern "C" {
#include <stdlib.h>
#include "./lossless.h"
#include "../dec/vp8li.h"
#include "../enc/histogram.h"
#ifdef USE_LOSSLESS_ENCODER
#include "../enc/histogram.h"
// A lookup table for small values of log(int) to be used in entropy
// computation.
@ -122,6 +124,8 @@ double VP8LFastLog(int v) {
return log(v);
}
#endif
//------------------------------------------------------------------------------
// Image transforms.
@ -288,6 +292,7 @@ static const PredictorFunc kPredictors[16] = {
Predictor0, Predictor0 // <- padding security sentinels
};
#ifdef USE_LOSSLESS_ENCODER
// TODO(vikasa): Replace 256 etc with defines.
static double PredictionCostSpatial(const int* counts,
int weight_0, double exp_val) {
@ -472,6 +477,8 @@ void VP8LResidualImage(int width, int height, int bits,
}
}
#endif
// Inverse prediction.
static void PredictorInverseTransform(const VP8LTransform* const transform,
int y_start, int y_end, uint32_t* data) {
@ -524,6 +531,7 @@ static void PredictorInverseTransform(const VP8LTransform* const transform,
}
}
#ifdef USE_LOSSLESS_ENCODER
void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs) {
int i;
for (i = 0; i < num_pixs; ++i) {
@ -534,6 +542,7 @@ void VP8LSubtractGreenFromBlueAndRed(uint32_t* argb_data, int num_pixs) {
argb_data[i] = (argb & 0xff00ff00) | (new_r << 16) | new_b;
}
}
#endif
// Add green to blue and red channels (i.e. perform the inverse transform of
// 'subtract green').
@ -606,6 +615,7 @@ static WEBP_INLINE uint32_t TransformColor(const Multipliers* const m,
return (argb & 0xff00ff00u) | (new_red << 16) | (new_blue);
}
#ifdef USE_LOSSLESS_ENCODER
static WEBP_INLINE int SkipRepeatedPixels(const uint32_t* const argb,
int ix, int xsize) {
const uint32_t v = argb[ix];
@ -844,6 +854,7 @@ void VP8LColorSpaceTransform(int width, int height, int bits, int step,
}
}
}
#endif
// Color space inverse transform.
static void ColorSpaceInverseTransform(const VP8LTransform* const transform,