convolve: support larger blocks, fix asm saturation bug
Updates the common convoloution code to support blocks larger than
16x16, and rectangular blocks. This uncovered a bug in the SSSE3
filtering routines due to the order of application of saturation.
This commit fixes that bug, adjusts the unit test to bias its
random values towards the extremes, and adds a test to ensure that
all filters conform to the expected pairwise addition structure.
Change-Id: I81f69668b1de0de5a8ed43f0643845641525c8f0
diff --git a/test/acm_random.h b/test/acm_random.h
index 514894e..84c6c75 100644
--- a/test/acm_random.h
+++ b/test/acm_random.h
@@ -35,6 +35,13 @@
return (rand() >> 8) & 0xff;
}
+ uint8_t Rand8Extremes(void) {
+ // Returns a random value near 0 or near 255, to better exercise
+ // saturation behavior.
+ const uint8_t r = Rand8();
+ return r < 128 ? r << 4 : r >> 4;
+ }
+
int PseudoUniform(int range) {
return (rand() >> 8) % range;
}