Remove Border at the top for levels array
Change-Id: I627aca949bc20660ace0246db862a49c3e2ef928
diff --git a/av1/common/enums.h b/av1/common/enums.h
index 34e3719..9af7b0f 100644
--- a/av1/common/enums.h
+++ b/av1/common/enums.h
@@ -207,7 +207,7 @@
#define TX_PAD_HOR 4
// Pad 6 extra rows (2 on top and 4 on bottom) to remove vertical availability
// check.
-#define TX_PAD_TOP 2
+#define TX_PAD_TOP 0
#define TX_PAD_BOTTOM 4
#define TX_PAD_VER (TX_PAD_TOP + TX_PAD_BOTTOM)
// Pad 16 extra bytes to avoid reading overflow in SIMD optimization.
diff --git a/av1/encoder/encodetxb.c b/av1/encoder/encodetxb.c
index fc2bc90..8bf1c96 100644
--- a/av1/encoder/encodetxb.c
+++ b/av1/encoder/encodetxb.c
@@ -464,8 +464,6 @@
const int stride = width + TX_PAD_HOR;
uint8_t *ls = levels;
- memset(levels - TX_PAD_TOP * stride, 0,
- sizeof(*levels) * TX_PAD_TOP * stride);
memset(levels + stride * height, 0,
sizeof(*levels) * (TX_PAD_BOTTOM * stride + TX_PAD_END));
diff --git a/av1/encoder/x86/encodetxb_avx2.c b/av1/encoder/x86/encodetxb_avx2.c
index 7642f57..2621301 100644
--- a/av1/encoder/x86/encodetxb_avx2.c
+++ b/av1/encoder/x86/encodetxb_avx2.c
@@ -26,14 +26,6 @@
const int stride = width + TX_PAD_HOR;
const __m256i y_zeros = _mm256_setzero_si256();
- const int32_t pre_len = sizeof(*levels) * TX_PAD_TOP * stride;
- uint8_t *pre_buf = levels - TX_PAD_TOP * stride;
- uint8_t *pre_buf_end = pre_buf + pre_len;
- do {
- yy_storeu_256(pre_buf, y_zeros);
- pre_buf += 32;
- } while (pre_buf < pre_buf_end);
-
const int32_t bottom_len = sizeof(*levels) * (TX_PAD_BOTTOM * stride);
uint8_t *bottom_buf_end = levels + (height + TX_PAD_BOTTOM) * stride;
uint8_t *bottom_buf = bottom_buf_end - ((bottom_len + 31) & (~31));
diff --git a/av1/encoder/x86/encodetxb_sse4.c b/av1/encoder/x86/encodetxb_sse4.c
index 5e0687c..34c9e4f 100644
--- a/av1/encoder/x86/encodetxb_sse4.c
+++ b/av1/encoder/x86/encodetxb_sse4.c
@@ -23,14 +23,6 @@
const int stride = width + TX_PAD_HOR;
const __m128i zeros = _mm_setzero_si128();
- const int32_t pre_len = sizeof(*levels) * TX_PAD_TOP * stride;
- uint8_t *pre_buf = levels - TX_PAD_TOP * stride;
- uint8_t *pre_buf_end = pre_buf + pre_len;
- do {
- _mm_storeu_si128((__m128i *)(pre_buf), zeros);
- pre_buf += 16;
- } while (pre_buf < pre_buf_end);
-
const int32_t bottom_len = sizeof(*levels) * (TX_PAD_BOTTOM * stride);
uint8_t *bottom_buf = levels + stride * height;
uint8_t *bottom_buf_end = bottom_buf + bottom_len;