Remove CONFIG_INTEGERIZE_SGR build flag
The integerised SGR subspace projection filter has been in master for 3
weeks, enabled by default, without any reported problems. This commit
removes the old floating point code as well as the build flag
Change-Id: I645a617e9afb953b738d6c877948eb52ad0046f0
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c
index 3885ad5..a7fab16 100644
--- a/av1/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -406,14 +406,12 @@
return err;
}
-#if CONFIG_INTEGERIZE_SGR
static int64_t signed_rounded_divide(int64_t dividend, int64_t divisor) {
if (dividend < 0)
return (dividend - divisor / 2) / divisor;
else
return (dividend + divisor / 2) / divisor;
}
-#endif // CONFIG_INTEGERIZE_SGR
static void get_proj_subspace(const uint8_t *src8, int width, int height,
int src_stride, const uint8_t *dat8,
@@ -421,7 +419,6 @@
int32_t *flt0, int flt0_stride, int32_t *flt1,
int flt1_stride, int *xq,
const sgr_params_type *params) {
-#if CONFIG_INTEGERIZE_SGR
int i, j;
int64_t H[2][2] = { { 0, 0 }, { 0, 0 } };
int64_t C[2] = { 0, 0 };
@@ -511,94 +508,6 @@
else
xq[1] = (int)signed_rounded_divide(div2 * (1 << SGRPROJ_PRJ_BITS), Det);
}
-#else // CONFIG_INTEGERIZE_SGR
- int i, j;
- double H[2][2] = { { 0, 0 }, { 0, 0 } };
- double C[2] = { 0, 0 };
- double Det;
- double x[2];
- const int size = width * height;
-
- aom_clear_system_state();
-
- // Default
- xq[0] = 0;
- xq[1] = 0;
- if (!use_highbitdepth) {
- const uint8_t *src = src8;
- const uint8_t *dat = dat8;
- for (i = 0; i < height; ++i) {
- for (j = 0; j < width; ++j) {
- const double u = (double)(dat[i * dat_stride + j] << SGRPROJ_RST_BITS);
- const double s =
- (double)(src[i * src_stride + j] << SGRPROJ_RST_BITS) - u;
- const double f1 =
- (params->r[0] > 0) ? (double)flt0[i * flt0_stride + j] - u : 0;
- const double f2 =
- (params->r[1] > 0) ? (double)flt1[i * flt1_stride + j] - u : 0;
- H[0][0] += f1 * f1;
- H[1][1] += f2 * f2;
- H[0][1] += f1 * f2;
- C[0] += f1 * s;
- C[1] += f2 * s;
- }
- }
- } else {
- const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
- const uint16_t *dat = CONVERT_TO_SHORTPTR(dat8);
- for (i = 0; i < height; ++i) {
- for (j = 0; j < width; ++j) {
- const double u = (double)(dat[i * dat_stride + j] << SGRPROJ_RST_BITS);
- const double s =
- (double)(src[i * src_stride + j] << SGRPROJ_RST_BITS) - u;
- const double f1 =
- (params->r[0] > 0) ? (double)flt0[i * flt0_stride + j] - u : 0;
- const double f2 =
- (params->r[1] > 0) ? (double)flt1[i * flt1_stride + j] - u : 0;
- H[0][0] += f1 * f1;
- H[1][1] += f2 * f2;
- H[0][1] += f1 * f2;
- C[0] += f1 * s;
- C[1] += f2 * s;
- }
- }
- }
- H[0][0] /= size;
- H[0][1] /= size;
- H[1][1] /= size;
- H[1][0] = H[0][1];
- C[0] /= size;
- C[1] /= size;
- if (params->r[0] == 0) {
- // H matrix is now only the scalar H[1][1]
- // C vector is now only the scalar C[1]
- Det = H[1][1];
- if (Det < 1e-8) return; // ill-posed, return default values
- x[0] = 0;
- x[1] = C[1] / Det;
-
- xq[0] = 0;
- xq[1] = (int)rint(x[1] * (1 << SGRPROJ_PRJ_BITS));
- } else if (params->r[1] == 0) {
- // H matrix is now only the scalar H[0][0]
- // C vector is now only the scalar C[0]
- Det = H[0][0];
- if (Det < 1e-8) return; // ill-posed, return default values
- x[0] = C[0] / Det;
- x[1] = 0;
-
- xq[0] = (int)rint(x[0] * (1 << SGRPROJ_PRJ_BITS));
- xq[1] = 0;
- } else {
- Det = (H[0][0] * H[1][1] - H[0][1] * H[1][0]);
- if (Det < 1e-8) return; // ill-posed, return default values
- x[0] = (H[1][1] * C[0] - H[0][1] * C[1]) / Det;
- x[1] = (H[0][0] * C[1] - H[1][0] * C[0]) / Det;
-
- xq[0] = (int)rint(x[0] * (1 << SGRPROJ_PRJ_BITS));
- xq[1] = (int)rint(x[1] * (1 << SGRPROJ_PRJ_BITS));
- }
-#endif // CONFIG_INTEGERIZE_SGR
}
static void encode_xq(int *xq, int *xqd, const sgr_params_type *params) {
diff --git a/build/cmake/aom_config_defaults.cmake b/build/cmake/aom_config_defaults.cmake
index 7318d9c..37e3c1b 100644
--- a/build/cmake/aom_config_defaults.cmake
+++ b/build/cmake/aom_config_defaults.cmake
@@ -136,7 +136,6 @@
set_aom_config_var(CONFIG_2PASS_PARTITION_SEARCH_LVL 1 NUMBER
"AV1 experiment flag.")
set_aom_config_var(CONFIG_SHARP_SETTINGS 0 NUMBER "AV1 experiment flag.")
-set_aom_config_var(CONFIG_INTEGERIZE_SGR 1 NUMBER "AV1 experiment flag.")
set_aom_config_var(CONFIG_ONE_PASS_SVM 0 NUMBER "AV1 experiment flag.")
#