mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
add a -partition_limit option to limit the number of bits used by intra4x4
Although it degrades quality, this option is useful to avoid the 512k limit for partition #0. If not enough to reach the lower bound of 4bits per macroblock header, one should also limit the number of segments used (down to -segments 1) See the man file for extra details. Change-Id: Ia59ffac13176c85b809ddd6340d37b54ee9487ea
This commit is contained in:
@ -112,11 +112,15 @@ static void ResetBoundaryPredictions(VP8Encoder* const enc) {
|
||||
|
||||
static void MapConfigToTools(VP8Encoder* const enc) {
|
||||
const int method = enc->config_->method;
|
||||
const int limit = 100 - enc->config_->partition_limit;
|
||||
enc->method_ = method;
|
||||
enc->rd_opt_level_ = (method >= 6) ? 3
|
||||
: (method >= 5) ? 2
|
||||
: (method >= 3) ? 1
|
||||
: 0;
|
||||
enc->max_i4_header_bits_ =
|
||||
256 * 16 * 16 * // upper bound: up to 16bit per 4x4 block
|
||||
(limit * limit) / (100 * 100); // ... modulated with a quadratic curve.
|
||||
}
|
||||
|
||||
// Memory scaling with dimensions:
|
||||
|
Reference in New Issue
Block a user