mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 14:34:33 +02:00
Only recompute level_cost_[] when needed
Add a dirty_ flag to keep track of updated probabilities and the need to recompute the level costs. This only makes a difference for "-m 2" method which was sub-optimal. But it's overall cleaner to have this flag. Change-Id: I21c71201e1d07a923d97a3adf2fbbd7d67d35433
This commit is contained in:
@ -421,8 +421,8 @@ static int TrellisQuantizeBlock(const VP8EncIterator* const it,
|
||||
int ctx0, int coeff_type,
|
||||
const VP8Matrix* const mtx,
|
||||
int lambda) {
|
||||
ProbaArray* const last_costs = it->enc_->proba_.coeffs_[coeff_type];
|
||||
CostArray* const costs = it->enc_->proba_.level_cost_[coeff_type];
|
||||
const ProbaArray* const last_costs = it->enc_->proba_.coeffs_[coeff_type];
|
||||
const CostArray* const costs = it->enc_->proba_.level_cost_[coeff_type];
|
||||
const int first = (coeff_type == 0) ? 1 : 0;
|
||||
Node nodes[17][NUM_NODES];
|
||||
int best_path[3] = {-1, -1, -1}; // store best-last/best-level/best-previous
|
||||
|
Reference in New Issue
Block a user