[codec,avc] chroma reverse filter cutoff threshold
This commit is contained in:
parent
860d002794
commit
d768796163
@ -116,8 +116,10 @@ static pstatus_t general_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3],
|
||||
{
|
||||
const UINT32 val2x = (x * 2);
|
||||
const UINT32 val2x1 = val2x + 1;
|
||||
const INT32 up = pU[val2x] * 4;
|
||||
const INT32 vp = pV[val2x] * 4;
|
||||
const BYTE inU = pU[val2x];
|
||||
const BYTE inV = pV[val2x];
|
||||
const INT32 up = inU * 4;
|
||||
const INT32 vp = inV * 4;
|
||||
INT32 u2020;
|
||||
INT32 v2020;
|
||||
|
||||
@ -126,8 +128,9 @@ static pstatus_t general_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3],
|
||||
|
||||
u2020 = up - pU[val2x1] - pU1[val2x] - pU1[val2x1];
|
||||
v2020 = vp - pV[val2x1] - pV1[val2x] - pV1[val2x1];
|
||||
pU[val2x] = CLIP(u2020);
|
||||
pV[val2x] = CLIP(v2020);
|
||||
|
||||
pU[val2x] = CONDITIONAL_CLIP(u2020, inU);
|
||||
pV[val2x] = CONDITIONAL_CLIP(v2020, inV);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -515,8 +515,10 @@ static pstatus_t neon_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], const
|
||||
{
|
||||
const UINT32 val2x = (x * 2);
|
||||
const UINT32 val2x1 = val2x + 1;
|
||||
const INT32 up = pU[val2x] * 4;
|
||||
const INT32 vp = pV[val2x] * 4;
|
||||
const BYTE inU = pU[val2x];
|
||||
const BYTE inV = pV[val2x];
|
||||
const INT32 up = inU * 4;
|
||||
const INT32 vp = inV * 4;
|
||||
INT32 u2020;
|
||||
INT32 v2020;
|
||||
|
||||
@ -525,8 +527,8 @@ static pstatus_t neon_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], const
|
||||
|
||||
u2020 = up - pU[val2x1] - pU1[val2x] - pU1[val2x1];
|
||||
v2020 = vp - pV[val2x1] - pV1[val2x] - pV1[val2x1];
|
||||
pU[val2x] = CLIP(u2020);
|
||||
pV[val2x] = CLIP(v2020);
|
||||
pU[val2x] = CONDITIONAL_CLIP(u2020, inU);
|
||||
pV[val2x] = CONDITIONAL_CLIP(v2020, inV);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1192,8 +1192,10 @@ static pstatus_t ssse3_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], cons
|
||||
{
|
||||
const UINT32 val2x = (x * 2);
|
||||
const UINT32 val2x1 = val2x + 1;
|
||||
const INT32 up = pU[val2x] * 4;
|
||||
const INT32 vp = pV[val2x] * 4;
|
||||
const BYTE inU = pU[val2x];
|
||||
const BYTE inV = pV[val2x];
|
||||
const INT32 up = inU * 4;
|
||||
const INT32 vp = inV * 4;
|
||||
INT32 u2020;
|
||||
INT32 v2020;
|
||||
|
||||
@ -1202,8 +1204,8 @@ static pstatus_t ssse3_ChromaFilter(BYTE* pDst[3], const UINT32 dstStep[3], cons
|
||||
|
||||
u2020 = up - pU[val2x1] - pU1[val2x] - pU1[val2x1];
|
||||
v2020 = vp - pV[val2x1] - pV1[val2x] - pV1[val2x1];
|
||||
pU[val2x] = CLIP(u2020);
|
||||
pV[val2x] = CLIP(v2020);
|
||||
pU[val2x] = CONDITIONAL_CLIP(u2020, inU);
|
||||
pV[val2x] = CONDITIONAL_CLIP(v2020, inV);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,6 +209,19 @@ static INLINE BYTE CLIP(INT64 X)
|
||||
return (BYTE)X;
|
||||
}
|
||||
|
||||
static INLINE BYTE CONDITIONAL_CLIP(INT32 in, BYTE original)
|
||||
{
|
||||
BYTE out = CLIP(in);
|
||||
BYTE diff;
|
||||
if (out > original)
|
||||
diff = out - original;
|
||||
else
|
||||
diff = original - out;
|
||||
if (diff < 30)
|
||||
return original;
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* | R | ( | 256 0 403 | | Y | )
|
||||
* | G | = ( | 256 -48 -120 | | U - 128 | ) >> 8
|
||||
|
Loading…
Reference in New Issue
Block a user