Fix the input to Hadamard functions in unit test

The input to Hadamard transform is the residual block, whose pixels
can range from -((1 << BitDepth) - 1) to (1 << BitDepth) - 1. Earlier
values from -(1 << BitDepth) to (1 << BitDepth) - 1 were  being tested.
As -(1 << BitDepth) is not a valid value, changed the input to take
values in the range [-((1 << BitDepth) - 1), ((1 << BitDepth) - 1)].

The functions Rand9Signed() and Rand13Signed are deleted since they
are not used by any other caller.

Change-Id: I10b358a2ff7168ac595849d3c78a91cfa6b3b24d
(cherry picked from commit 57dd20ae5c6df7c4244ade1bd7af1991935e77d2)
diff --git a/test/acm_random.h b/test/acm_random.h
index 2e9fe56..15e8c9c 100644
--- a/test/acm_random.h
+++ b/test/acm_random.h
@@ -52,12 +52,6 @@
     return static_cast<int16_t>(Rand15()) - (1 << 14);
   }
 
-  int16_t Rand13Signed() {
-    // Use 13 bits: values between 4095 and -4096.
-    const uint32_t value = random_.Generate(8192);
-    return static_cast<int16_t>(value) - 4096;
-  }
-
   uint16_t Rand12() {
     const uint32_t value =
         random_.Generate(testing::internal::Random::kMaxRange);
@@ -65,12 +59,6 @@
     return (value >> 19) & 0xfff;
   }
 
-  int16_t Rand9Signed() {
-    // Use 9 bits: values between 255 (0x0FF) and -256 (0x100).
-    const uint32_t value = random_.Generate(512);
-    return static_cast<int16_t>(value) - 256;
-  }
-
   uint8_t Rand8() {
     const uint32_t value =
         random_.Generate(testing::internal::Random::kMaxRange);
diff --git a/test/hadamard_test.cc b/test/hadamard_test.cc
index 628005b..fc306e6 100644
--- a/test/hadamard_test.cc
+++ b/test/hadamard_test.cc
@@ -242,6 +242,12 @@
 
   virtual void SetUp() { rnd_.Reset(ACMRandom::DeterministicSeed()); }
 
+  // The Rand() function generates values in the range [-((1 << BitDepth) - 1),
+  // (1 << BitDepth) - 1]. This is because the input to the Hadamard transform
+  // is the residual pixel, which is defined as 'source pixel - predicted
+  // pixel'. Source pixel and predicted pixel take values in the range
+  // [0, (1 << BitDepth) - 1] and thus the residual pixel ranges from
+  // -((1 << BitDepth) - 1) to ((1 << BitDepth) - 1).
   virtual int16_t Rand() = 0;
 
   void CompareReferenceRandom() {
@@ -344,7 +350,12 @@
 class HadamardLowbdTest : public HadamardTestBase<tran_low_t, HadamardFunc> {
  public:
   HadamardLowbdTest() : HadamardTestBase(GetParam(), /*do_shift=*/true) {}
-  virtual int16_t Rand() { return rnd_.Rand9Signed(); }
+  // Use values between -255 (0xFF01) and 255 (0x00FF)
+  virtual int16_t Rand() {
+    int16_t src = rnd_.Rand8();
+    int16_t pred = rnd_.Rand8();
+    return src - pred;
+  }
 };
 
 TEST_P(HadamardLowbdTest, CompareReferenceRandom) { CompareReferenceRandom(); }
@@ -395,7 +406,12 @@
 class HadamardHighbdTest : public HadamardTestBase<tran_low_t, HadamardFunc> {
  protected:
   HadamardHighbdTest() : HadamardTestBase(GetParam(), /*do_shift=*/true) {}
-  virtual int16_t Rand() { return rnd_.Rand13Signed(); }
+  // Use values between -4095 (0xF001) and 4095 (0x0FFF)
+  virtual int16_t Rand() {
+    int16_t src = rnd_.Rand12();
+    int16_t pred = rnd_.Rand12();
+    return src - pred;
+  }
 };
 
 TEST_P(HadamardHighbdTest, CompareReferenceRandom) { CompareReferenceRandom(); }
@@ -430,7 +446,12 @@
 class HadamardLowbdLPTest : public HadamardTestBase<int16_t, HadamardLPFunc> {
  public:
   HadamardLowbdLPTest() : HadamardTestBase(GetParam(), /*do_shift=*/false) {}
-  virtual int16_t Rand() { return rnd_.Rand9Signed(); }
+  // Use values between -255 (0xFF01) and 255 (0x00FF)
+  virtual int16_t Rand() {
+    int16_t src = rnd_.Rand8();
+    int16_t pred = rnd_.Rand8();
+    return src - pred;
+  }
 };
 
 TEST_P(HadamardLowbdLPTest, CompareReferenceRandom) {
@@ -475,7 +496,12 @@
  public:
   HadamardLowbdLP8x8DualTest()
       : HadamardTestBase(GetParam(), /*do_shift=*/false) {}
-  virtual int16_t Rand() { return rnd_.Rand9Signed(); }
+  // Use values between -255 (0xFF01) and 255 (0x00FF)
+  virtual int16_t Rand() {
+    int16_t src = rnd_.Rand8();
+    int16_t pred = rnd_.Rand8();
+    return src - pred;
+  }
 };
 
 TEST_P(HadamardLowbdLP8x8DualTest, CompareReferenceRandom) {