new segmentation algorithm

fixes the 'blocky sky problem' (saturation problem: when luma was flat,
chroma noise was taking over, resulting in random segment id assigned.
When just using a common uniform segment was better).

+ side clean-up and readibility/experimentability MACRO'ization
+ added '-map 7' option

Change-Id: I35982a9e43c0fecbfdd7b05e4813e8ba8c121d71
This commit is contained in:
skal
2012-09-03 19:40:52 +02:00
parent 2cf1f81590
commit 5725cabac0
6 changed files with 135 additions and 95 deletions

View File

@ -29,9 +29,6 @@ extern "C" {
#define ENC_MIN_VERSION 2
#define ENC_REV_VERSION 0
// size of histogram used by CollectHistogram.
#define MAX_COEFF_THRESH 64
// intra prediction modes
enum { B_DC_PRED = 0, // 4x4 modes
B_TM_PRED = 1,
@ -162,6 +159,14 @@ static WEBP_INLINE int QUANTDIV(int n, int iQ, int B) {
}
extern const uint8_t VP8Zigzag[16];
// size of histogram used by CollectHistogram.
#define MAX_COEFF_THRESH 31
typedef struct VP8Histogram VP8Histogram;
struct VP8Histogram {
// TODO(skal): we only need to store the max_value and last_non_zero actually.
int distribution[MAX_COEFF_THRESH + 1];
};
//------------------------------------------------------------------------------
// Headers