[x265] [PATCH] _upBuff1: scale down from int32_t to int8_t
praveen at multicorewareinc.com
praveen at multicorewareinc.com
Tue Dec 30 14:49:09 CET 2014
# HG changeset patch
# User Praveen Tiwari
# Date 1419320229 -19800
# Node ID 10a16175a843d46df9c84523edce2d61d20761fa
# Parent ed7405ed73e062a32c1413f8868d5f73edde79ac
_upBuff1: scale down from int32_t to int8_t
diff -r ed7405ed73e0 -r 10a16175a843 source/encoder/sao.cpp
--- a/source/encoder/sao.cpp Mon Dec 22 16:42:51 2014 +0530
+++ b/source/encoder/sao.cpp Tue Dec 23 13:07:09 2014 +0530
@@ -36,7 +36,7 @@
}
/* get the sign of input variable (TODO: this is a dup, make common) */
-inline int signOf(int x)
+inline int8_t signOf(int x)
{
return (x >> 31) | ((int)((((uint32_t)-x)) >> 31));
}
@@ -257,8 +257,8 @@
pixel* tmpL;
pixel* tmpU;
- int32_t _upBuff1[MAX_CU_SIZE + 2], *upBuff1 = _upBuff1 + 1;
- int32_t _upBufft[MAX_CU_SIZE + 2], *upBufft = _upBufft + 1;
+ int8_t _upBuff1[MAX_CU_SIZE + 2], *upBuff1 = _upBuff1 + 1;
+ int8_t _upBufft[MAX_CU_SIZE + 2], *upBufft = _upBufft + 1;
{
const pixel* recR = &rec[ctuWidth - 1];
@@ -335,7 +335,7 @@
{
for (x = 0; x < ctuWidth; x++)
{
- int signDown = signOf(rec[x] - rec[x + stride]);
+ int8_t signDown = signOf(rec[x] - rec[x + stride]);
int edgeType = signDown + upBuff1[x] + 2;
upBuff1[x] = -signDown;
@@ -366,7 +366,7 @@
upBufft[startX] = signOf(rec[stride + startX] - tmpL[y]);
for (x = startX; x < endX; x++)
{
- int signDown = signOf(rec[x] - rec[x + stride + 1]);
+ int8_t signDown = signOf(rec[x] - rec[x + stride + 1]);
int edgeType = signDown + upBuff1[x] + 2;
upBufft[x + 1] = -signDown;
rec[x] = m_clipTable[rec[x] + m_offsetEo[edgeType]];
@@ -396,7 +396,7 @@
for (y = startY; y < endY; y++)
{
x = startX;
- int signDown = signOf(rec[x] - tmpL[y + 1]);
+ int8_t signDown = signOf(rec[x] - tmpL[y + 1]);
int edgeType = signDown + upBuff1[x] + 2;
upBuff1[x - 1] = -signDown;
rec[x] = m_clipTable[rec[x] + m_offsetEo[edgeType]];
More information about the x265-devel
mailing list