Move mathutils.h to aom_dsp
The intent is to remove aom_dsp's dependency on av1 specific code.
BUG=aomedia:2734
Change-Id: I770bf90f5ecf160177fefd69aa5b89902fab80d1
diff --git a/aom_dsp/aom_dsp_common.h b/aom_dsp/aom_dsp_common.h
index 150d35d..efb634a 100644
--- a/aom_dsp/aom_dsp_common.h
+++ b/aom_dsp/aom_dsp_common.h
@@ -21,6 +21,8 @@
extern "C" {
#endif
+#define PI 3.141592653589793238462643383279502884
+
#ifndef MAX_SB_SIZE
#define MAX_SB_SIZE 128
#endif // ndef MAX_SB_SIZE
diff --git a/av1/encoder/mathutils.h b/aom_dsp/mathutils.h
similarity index 97%
rename from av1/encoder/mathutils.h
rename to aom_dsp/mathutils.h
index 576de07..86853c0 100644
--- a/av1/encoder/mathutils.h
+++ b/aom_dsp/mathutils.h
@@ -9,8 +9,8 @@
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
-#ifndef AOM_AV1_ENCODER_MATHUTILS_H_
-#define AOM_AV1_ENCODER_MATHUTILS_H_
+#ifndef AOM_DSP_MATHUTILS_H_
+#define AOM_DSP_MATHUTILS_H_
#include <memory.h>
#include <math.h>
@@ -18,6 +18,9 @@
#include <stdlib.h>
#include <assert.h>
+#include "aom_dsp/aom_dsp_common.h"
+#include "aom_mem/aom_mem.h"
+
static const double TINY_NEAR_ZERO = 1.0E-16;
// Solves Ax = b, where x and b are column vectors of size nx1 and A is nxn
@@ -356,4 +359,4 @@
return 0;
}
-#endif // AOM_AV1_ENCODER_MATHUTILS_H_
+#endif // AOM_DSP_MATHUTILS_H_
diff --git a/aom_dsp/noise_model.c b/aom_dsp/noise_model.c
index 19c660e..5930199 100644
--- a/aom_dsp/noise_model.c
+++ b/aom_dsp/noise_model.c
@@ -15,11 +15,10 @@
#include <string.h>
#include "aom_dsp/aom_dsp_common.h"
+#include "aom_dsp/mathutils.h"
#include "aom_dsp/noise_model.h"
#include "aom_dsp/noise_util.h"
#include "aom_mem/aom_mem.h"
-#include "av1/common/common.h"
-#include "av1/encoder/mathutils.h"
#define kLowPolyNumParams 3
diff --git a/av1/common/common.h b/av1/common/common.h
index cc2da98..bb74924 100644
--- a/av1/common/common.h
+++ b/av1/common/common.h
@@ -26,8 +26,6 @@
extern "C" {
#endif
-#define PI 3.141592653589793238462643383279502884
-
// Only need this for fixed-size arrays, for structs just assign.
#define av1_copy(dest, src) \
{ \
diff --git a/av1/encoder/optical_flow.c b/av1/encoder/optical_flow.c
index 56c78ec..3139a29 100644
--- a/av1/encoder/optical_flow.c
+++ b/av1/encoder/optical_flow.c
@@ -12,13 +12,15 @@
#include <limits.h>
#include "config/aom_config.h"
+
+#include "aom_dsp/mathutils.h"
+#include "aom_mem/aom_mem.h"
+
#include "av1/common/av1_common_int.h"
#include "av1/encoder/encoder.h"
-#include "av1/encoder/mathutils.h"
#include "av1/encoder/optical_flow.h"
#include "av1/encoder/sparse_linear_solver.h"
#include "av1/encoder/reconinter_enc.h"
-#include "aom_mem/aom_mem.h"
#if CONFIG_OPTICAL_FLOW_API
diff --git a/av1/encoder/pickrst.c b/av1/encoder/pickrst.c
index e965910..fc530b4 100644
--- a/av1/encoder/pickrst.c
+++ b/av1/encoder/pickrst.c
@@ -19,6 +19,7 @@
#include "aom_dsp/aom_dsp_common.h"
#include "aom_dsp/binary_codes_writer.h"
+#include "aom_dsp/mathutils.h"
#include "aom_dsp/psnr.h"
#include "aom_mem/aom_mem.h"
#include "aom_ports/mem.h"
@@ -28,7 +29,6 @@
#include "av1/encoder/av1_quantize.h"
#include "av1/encoder/encoder.h"
-#include "av1/encoder/mathutils.h"
#include "av1/encoder/picklpf.h"
#include "av1/encoder/pickrst.h"
diff --git a/av1/encoder/ransac.c b/av1/encoder/ransac.c
index 07e1a5f..ff00a46 100644
--- a/av1/encoder/ransac.c
+++ b/av1/encoder/ransac.c
@@ -15,8 +15,8 @@
#include <stdlib.h>
#include <assert.h>
+#include "aom_dsp/mathutils.h"
#include "av1/encoder/ransac.h"
-#include "av1/encoder/mathutils.h"
#include "av1/encoder/random.h"
#define MAX_MINPTS 4