Merge "use NULL for lf_stats_ testing, not bool"

This commit is contained in:
Pascal Massimino 2013-09-04 07:18:42 -07:00 committed by Gerrit Code Review
commit 2fd091c9ae

View File

@ -340,9 +340,8 @@ static double GetMBSSIM(const uint8_t* yuv1, const uint8_t* yuv2) {
// loop filter strength // loop filter strength
void VP8InitFilter(VP8EncIterator* const it) { void VP8InitFilter(VP8EncIterator* const it) {
if (it->lf_stats_ != NULL) {
int s, i; int s, i;
if (!it->lf_stats_) return;
InitTables(); InitTables();
for (s = 0; s < NUM_MB_SEGMENTS; s++) { for (s = 0; s < NUM_MB_SEGMENTS; s++) {
for (i = 0; i < MAX_LF_LEVELS; i++) { for (i = 0; i < MAX_LF_LEVELS; i++) {
@ -350,6 +349,7 @@ void VP8InitFilter(VP8EncIterator* const it) {
} }
} }
} }
}
void VP8StoreFilterStats(VP8EncIterator* const it) { void VP8StoreFilterStats(VP8EncIterator* const it) {
int d; int d;
@ -361,7 +361,7 @@ void VP8StoreFilterStats(VP8EncIterator* const it) {
const int delta_max = it->enc_->dqm_[s].quant_; const int delta_max = it->enc_->dqm_[s].quant_;
const int step_size = (delta_max - delta_min >= 4) ? 4 : 1; const int step_size = (delta_max - delta_min >= 4) ? 4 : 1;
if (!it->lf_stats_) return; if (it->lf_stats_ == NULL) return;
// NOTE: Currently we are applying filter only across the sublock edges // NOTE: Currently we are applying filter only across the sublock edges
// There are two reasons for that. // There are two reasons for that.
@ -385,12 +385,9 @@ void VP8StoreFilterStats(VP8EncIterator* const it) {
} }
void VP8AdjustFilterStrength(VP8EncIterator* const it) { void VP8AdjustFilterStrength(VP8EncIterator* const it) {
if (it->lf_stats_ != NULL) {
int s; int s;
VP8Encoder* const enc = it->enc_; VP8Encoder* const enc = it->enc_;
if (!it->lf_stats_) {
return;
}
for (s = 0; s < NUM_MB_SEGMENTS; s++) { for (s = 0; s < NUM_MB_SEGMENTS; s++) {
int i, best_level = 0; int i, best_level = 0;
// Improvement over filter level 0 should be at least 1e-5 (relatively) // Improvement over filter level 0 should be at least 1e-5 (relatively)
@ -405,6 +402,7 @@ void VP8AdjustFilterStrength(VP8EncIterator* const it) {
enc->dqm_[s].fstrength_ = best_level; enc->dqm_[s].fstrength_ = best_level;
} }
} }
}
#if defined(__cplusplus) || defined(c_plusplus) #if defined(__cplusplus) || defined(c_plusplus)
} // extern "C" } // extern "C"