Commit 89d2c6a1 authored by Loren Merritt's avatar Loren Merritt

X264_ABS => abs



git-svn-id: svn://svn.videolan.org/x264/trunk@354 df754926-b1dd-0310-bc7b-ec298dee348c
parent d13a1868
......@@ -53,7 +53,6 @@
****************************************************************************/
#define X264_MIN(a,b) ( (a)<(b) ? (a) : (b) )
#define X264_MAX(a,b) ( (a)>(b) ? (a) : (b) )
#define X264_ABS(a) ( (a)< 0 ? -(a) : (a) )
#define X264_MIN3(a,b,c) X264_MIN((a),X264_MIN((b),(c)))
#define X264_MAX3(a,b,c) X264_MAX((a),X264_MAX((b),(c)))
#define X264_MIN4(a,b,c,d) X264_MIN((a),X264_MIN3((b),(c),(d)))
......
......@@ -309,18 +309,18 @@ static inline void deblock_luma_c( uint8_t *pix, int xstride, int ystride, int a
const int q1 = pix[ 1*xstride];
const int q2 = pix[ 2*xstride];
if( X264_ABS( p0 - q0 ) < alpha &&
X264_ABS( p1 - p0 ) < beta &&
X264_ABS( q1 - q0 ) < beta ) {
if( abs( p0 - q0 ) < alpha &&
abs( p1 - p0 ) < beta &&
abs( q1 - q0 ) < beta ) {
int tc = tc0[i];
int delta;
if( X264_ABS( p2 - p0 ) < beta ) {
if( abs( p2 - p0 ) < beta ) {
pix[-2*xstride] = p1 + x264_clip3( (( p2 + ((p0 + q0 + 1) >> 1)) >> 1) - p1, -tc0[i], tc0[i] );
tc++;
}
if( X264_ABS( q2 - q0 ) < beta ) {
if( abs( q2 - q0 ) < beta ) {
pix[ 1*xstride] = q1 + x264_clip3( (( q2 + ((p0 + q0 + 1) >> 1)) >> 1) - q1, -tc0[i], tc0[i] );
tc++;
}
......@@ -357,9 +357,9 @@ static inline void deblock_chroma_c( uint8_t *pix, int xstride, int ystride, int
const int q0 = pix[ 0*xstride];
const int q1 = pix[ 1*xstride];
if( X264_ABS( p0 - q0 ) < alpha &&
X264_ABS( p1 - p0 ) < beta &&
X264_ABS( q1 - q0 ) < beta ) {
if( abs( p0 - q0 ) < alpha &&
abs( p1 - p0 ) < beta &&
abs( q1 - q0 ) < beta ) {
int delta = x264_clip3( (((q0 - p0 ) << 2) + (p1 - q1) + 4) >> 3, -tc, tc );
pix[-1*xstride] = clip_uint8( p0 + delta ); /* p0' */
......@@ -389,12 +389,12 @@ static inline void deblock_luma_intra_c( uint8_t *pix, int xstride, int ystride,
const int q1 = pix[ 1*xstride];
const int q2 = pix[ 2*xstride];
if( X264_ABS( p0 - q0 ) < alpha &&
X264_ABS( p1 - p0 ) < beta &&
X264_ABS( q1 - q0 ) < beta ) {
if( abs( p0 - q0 ) < alpha &&
abs( p1 - p0 ) < beta &&
abs( q1 - q0 ) < beta ) {
if(X264_ABS( p0 - q0 ) < ((alpha >> 2) + 2) ){
if( X264_ABS( p2 - p0 ) < beta)
if(abs( p0 - q0 ) < ((alpha >> 2) + 2) ){
if( abs( p2 - p0 ) < beta)
{
const int p3 = pix[-4*xstride];
/* p0', p1', p2' */
......@@ -405,7 +405,7 @@ static inline void deblock_luma_intra_c( uint8_t *pix, int xstride, int ystride,
/* p0' */
pix[-1*xstride] = ( 2*p1 + p0 + q1 + 2 ) >> 2;
}
if( X264_ABS( q2 - q0 ) < beta)
if( abs( q2 - q0 ) < beta)
{
const int q3 = pix[3*xstride];
/* q0', q1', q2' */
......@@ -443,9 +443,9 @@ static inline void deblock_chroma_intra_c( uint8_t *pix, int xstride, int ystrid
const int q0 = pix[ 0*xstride];
const int q1 = pix[ 1*xstride];
if( X264_ABS( p0 - q0 ) < alpha &&
X264_ABS( p1 - p0 ) < beta &&
X264_ABS( q1 - q0 ) < beta ) {
if( abs( p0 - q0 ) < alpha &&
abs( p1 - p0 ) < beta &&
abs( q1 - q0 ) < beta ) {
pix[-1*xstride] = (2*p1 + p0 + q1 + 2) >> 2; /* p0' */
pix[ 0*xstride] = (2*q1 + q0 + p1 + 2) >> 2; /* q0' */
......
......@@ -330,8 +330,8 @@ static void refine_subpel( x264_t *h, x264_me_t *m, int hpel_iters, int qpel_ite
* the result of the fullpel search */
if( hpel_iters )
{
int mx = X264_ABS(bmx - m->mvp[0]) < 4 ? m->mvp[0] : bmx;
int my = X264_ABS(bmy - m->mvp[1]) < 4 ? m->mvp[1] : bmy;
int mx = abs(bmx - m->mvp[0]) < 4 ? m->mvp[0] : bmx;
int my = abs(bmy - m->mvp[1]) < 4 ? m->mvp[1] : bmy;
if( mx != bmx || my != bmy )
COST_MV_SAD( mx, my );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment