Change experimental flag name
CONFIG_UV_LVL --> CONFIG_LOOPFILTER_LEVEL
Change name because the experiment combines filter level search
in U, V plane, and horizontal, vertical search in Y plane.
Change-Id: Ia05b8f80cd93b60a0305eb94e5783559ef904c13
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 4663e82..1ab2512 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3419,7 +3419,7 @@
struct loopfilter *lf = &cm->lf;
// Encode the loop filter level and type
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
aom_wb_write_literal(wb, lf->filter_level[0], 6);
aom_wb_write_literal(wb, lf->filter_level[1], 6);
if (lf->filter_level[0] || lf->filter_level[1]) {
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index d37b3ff..1a0716e 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -4134,7 +4134,7 @@
#endif // CONFIG_EXT_TILE
if (no_loopfilter) {
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
lf->filter_level[0] = 0;
lf->filter_level[1] = 0;
#else
@@ -4153,14 +4153,14 @@
cpi->time_pick_lpf += aom_usec_timer_elapsed(&timer);
}
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
if (lf->filter_level[0] || lf->filter_level[1])
#else
if (lf->filter_level > 0)
#endif
{
#if CONFIG_VAR_TX || CONFIG_EXT_PARTITION || CONFIG_CB4X4
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
av1_loop_filter_frame(cm->frame_to_show, cm, xd, lf->filter_level[0],
lf->filter_level[1], 0, 0);
av1_loop_filter_frame(cm->frame_to_show, cm, xd, lf->filter_level_u,
@@ -4170,7 +4170,7 @@
#else
av1_loop_filter_frame(cm->frame_to_show, cm, xd, lf->filter_level, 0, 0);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
#else
if (cpi->num_workers > 1)
av1_loop_filter_frame_mt(cm->frame_to_show, cm, xd->plane,
diff --git a/av1/encoder/picklpf.c b/av1/encoder/picklpf.c
index 73cf256..48f6d08 100644
--- a/av1/encoder/picklpf.c
+++ b/av1/encoder/picklpf.c
@@ -49,7 +49,7 @@
static int64_t try_filter_frame(const YV12_BUFFER_CONFIG *sd,
AV1_COMP *const cpi, int filt_level,
int partial_frame
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
,
int plane, int dir
#endif
@@ -58,7 +58,7 @@
int64_t filt_err;
#if CONFIG_VAR_TX || CONFIG_EXT_PARTITION || CONFIG_CB4X4
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
assert(plane >= 0 && plane <= 2);
int filter_level[2] = { filt_level, filt_level };
if (plane == 0 && dir == 0) filter_level[1] = cm->lf.filter_level[1];
@@ -69,7 +69,7 @@
#else
av1_loop_filter_frame(cm->frame_to_show, cm, &cpi->td.mb.e_mbd, filt_level, 1,
partial_frame);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
#else
if (cpi->num_workers > 1)
av1_loop_filter_frame_mt(cm->frame_to_show, cm, cpi->td.mb.e_mbd.plane,
@@ -85,7 +85,7 @@
highbd = cm->use_highbitdepth;
#endif // CONFIG_HIGHBITDEPTH
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
filt_err = aom_get_sse_plane(sd, cm->frame_to_show, plane, highbd);
// Re-instate the unfiltered frame
@@ -95,14 +95,14 @@
// Re-instate the unfiltered frame
yv12_copy_plane(&cpi->last_frame_uf, cm->frame_to_show, 0);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
return filt_err;
}
int av1_search_filter_level(const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi,
int partial_frame, double *best_cost_ret
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
,
int plane, int dir
#endif
@@ -118,7 +118,7 @@
// Start the search at the previous frame filter level unless it is now out of
// range.
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
int lvl;
switch (plane) {
case 0: lvl = (dir == 1) ? lf->filter_level[1] : lf->filter_level[0]; break;
@@ -129,7 +129,7 @@
int filt_mid = clamp(lvl, min_filter_level, max_filter_level);
#else
int filt_mid = clamp(lf->filter_level, min_filter_level, max_filter_level);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
int filter_step = filt_mid < 16 ? 4 : filt_mid / 4;
// Sum squared error at each filter level
int64_t ss_err[MAX_LOOP_FILTER + 1];
@@ -137,18 +137,18 @@
// Set each entry to -1
memset(ss_err, 0xFF, sizeof(ss_err));
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
yv12_copy_plane(cm->frame_to_show, &cpi->last_frame_uf, plane);
#else
// Make a copy of the unfiltered / processed recon buffer
aom_yv12_copy_y(cm->frame_to_show, &cpi->last_frame_uf);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
best_err = try_filter_frame(sd, cpi, filt_mid, partial_frame, plane, dir);
#else
best_err = try_filter_frame(sd, cpi, filt_mid, partial_frame);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
filt_best = filt_mid;
ss_err[filt_mid] = best_err;
@@ -168,12 +168,12 @@
if (filt_direction <= 0 && filt_low != filt_mid) {
// Get Low filter error score
if (ss_err[filt_low] < 0) {
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
ss_err[filt_low] =
try_filter_frame(sd, cpi, filt_low, partial_frame, plane, dir);
#else
ss_err[filt_low] = try_filter_frame(sd, cpi, filt_low, partial_frame);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
}
// If value is close to the best so far then bias towards a lower loop
// filter value.
@@ -189,12 +189,12 @@
// Now look at filt_high
if (filt_direction >= 0 && filt_high != filt_mid) {
if (ss_err[filt_high] < 0) {
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
ss_err[filt_high] =
try_filter_frame(sd, cpi, filt_high, partial_frame, plane, dir);
#else
ss_err[filt_high] = try_filter_frame(sd, cpi, filt_high, partial_frame);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
}
// If value is significantly better than previous best, bias added against
// raising filter value
@@ -229,7 +229,7 @@
lf->sharpness_level = cm->frame_type == KEY_FRAME ? 0 : cpi->oxcf.sharpness;
if (method == LPF_PICK_MINIMAL_LPF) {
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
lf->filter_level[0] = 0;
lf->filter_level[1] = 0;
#else
@@ -263,14 +263,14 @@
int filt_guess = ROUND_POWER_OF_TWO(q * 20723 + 1015158, 18);
#endif // CONFIG_HIGHBITDEPTH
if (cm->frame_type == KEY_FRAME) filt_guess -= 4;
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
lf->filter_level[0] = clamp(filt_guess, min_filter_level, max_filter_level);
lf->filter_level[1] = clamp(filt_guess, min_filter_level, max_filter_level);
#else
lf->filter_level = clamp(filt_guess, min_filter_level, max_filter_level);
#endif
} else {
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
lf->filter_level[0] = lf->filter_level[1] = av1_search_filter_level(
sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, NULL, 0, 2);
lf->filter_level[0] = av1_search_filter_level(
@@ -285,6 +285,6 @@
#else
lf->filter_level = av1_search_filter_level(
sd, cpi, method == LPF_PICK_FROM_SUBIMAGE, NULL);
-#endif // CONFIG_UV_LVL
+#endif // CONFIG_LOOPFILTER_LEVEL
}
}
diff --git a/av1/encoder/picklpf.h b/av1/encoder/picklpf.h
index 4950996..a61addf 100644
--- a/av1/encoder/picklpf.h
+++ b/av1/encoder/picklpf.h
@@ -21,7 +21,7 @@
struct yv12_buffer_config;
struct AV1_COMP;
int av1_get_max_filter_level(const AV1_COMP *cpi);
-#if CONFIG_UV_LVL
+#if CONFIG_LOOPFILTER_LEVEL
int av1_search_filter_level(const YV12_BUFFER_CONFIG *sd, AV1_COMP *cpi,
int partial_frame, double *err, int plane, int dir);
#else