Commit 49d7abc0 authored by James Zern's avatar James Zern
Browse files

vp9_picklpf: search_filter_level: remove filt_err

inspect ss_err[] directly, removes an unnecessary assignment

Change-Id: I14db5e8e567e7e541a57fce73389ffe7651d5614
parent 0cf599b5
......@@ -77,7 +77,6 @@ static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
while (filter_step > 0) {
const int filt_high = MIN(filt_mid + filter_step, max_filter_level);
const int filt_low = MAX(filt_mid - filter_step, min_filter_level);
int filt_err;
// Bias against raising loop filter in favor of lowering it.
int bias = (best_err >> (15 - (filt_mid / 8))) * filter_step;
......@@ -92,17 +91,14 @@ static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
if (filt_direction <= 0 && filt_low != filt_mid) {
// Get Low filter error score
if (ss_err[filt_low] < 0) {
filt_err = try_filter_frame(sd, cpi, filt_low, partial_frame);
ss_err[filt_low] = filt_err;
} else {
filt_err = ss_err[filt_low];
ss_err[filt_low] = try_filter_frame(sd, cpi, filt_low, partial_frame);
}
// If value is close to the best so far then bias towards a lower loop
// filter value.
if ((filt_err - bias) < best_err) {
if ((ss_err[filt_low] - bias) < best_err) {
// Was it actually better than the previous best?
if (filt_err < best_err)
best_err = filt_err;
if (ss_err[filt_low] < best_err)
best_err = ss_err[filt_low];
filt_best = filt_low;
}
......@@ -111,14 +107,11 @@ static int search_filter_level(const YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi,
// Now look at filt_high
if (filt_direction >= 0 && filt_high != filt_mid) {
if (ss_err[filt_high] < 0) {
filt_err = try_filter_frame(sd, cpi, filt_high, partial_frame);
ss_err[filt_high] = filt_err;
} else {
filt_err = ss_err[filt_high];
ss_err[filt_high] = try_filter_frame(sd, cpi, filt_high, partial_frame);
}
// Was it better than the previous best?
if (filt_err < (best_err - bias)) {
best_err = filt_err;
if (ss_err[filt_high] < (best_err - bias)) {
best_err = ss_err[filt_high];
filt_best = filt_high;
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment