Implement a cruncher for lossless at method 6.

Go over the whole compression step for each of the
transforms and pick the best one.

Change-Id: I3a1b1458348c468558be0fcf491038a5724c9364
This commit is contained in:
Vincent Rabaud
2017-04-20 16:56:36 +02:00
parent 1b92b237ac
commit adab8ce020
4 changed files with 195 additions and 113 deletions

View File

@ -27,16 +27,24 @@ extern "C" {
// maximum value of transform_bits_ in VP8LEncoder.
#define MAX_TRANSFORM_BITS 6
typedef enum {
kEncoderNone = 0,
kEncoderARGB,
kEncoderNearLossless,
kEncoderPalette
} VP8LEncoderARGBContent;
typedef struct {
const WebPConfig* config_; // user configuration and parameters
const WebPPicture* pic_; // input picture.
uint32_t* argb_; // Transformed argb image data.
uint32_t* argb_scratch_; // Scratch memory for argb rows
// (used for prediction).
uint32_t* transform_data_; // Scratch memory for transform data.
uint32_t* transform_mem_; // Currently allocated memory.
size_t transform_mem_size_; // Currently allocated memory size.
uint32_t* argb_; // Transformed argb image data.
VP8LEncoderARGBContent argb_content_; // Content type of the argb buffer.
uint32_t* argb_scratch_; // Scratch memory for argb rows
// (used for prediction).
uint32_t* transform_data_; // Scratch memory for transform data.
uint32_t* transform_mem_; // Currently allocated memory.
size_t transform_mem_size_; // Currently allocated memory size.
int current_width_; // Corresponds to packed image width.