Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed Mac OSX problem of unresolved abs() #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions appgitlhevcdecoder/HM-10.0/source/Lib/TLibCommon/TComMv.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
* granted under this license.
*
* Copyright (c) 2010-2013, ITU/ISO/IEC
* All rights reserved.
Expand Down Expand Up @@ -54,95 +54,95 @@ class TComMv
private:
Short m_iHor; ///< horizontal component of motion vector
Short m_iVer; ///< vertical component of motion vector

Int abs(Int x) const { return x>0 ? x : -x; }
public:

// ------------------------------------------------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------------------------------------------------

TComMv() :
m_iHor(0),
m_iVer(0)
{
}

TComMv( Short iHor, Short iVer ) :
m_iHor(iHor),
m_iVer(iVer)
{
}

// ------------------------------------------------------------------------------------------------------------------
// set
// ------------------------------------------------------------------------------------------------------------------

Void set ( Short iHor, Short iVer) { m_iHor = iHor; m_iVer = iVer; }
Void setHor ( Short i ) { m_iHor = i; }
Void setVer ( Short i ) { m_iVer = i; }
Void setZero () { m_iHor = m_iVer = 0; }

// ------------------------------------------------------------------------------------------------------------------
// get
// ------------------------------------------------------------------------------------------------------------------

Int getHor () const { return m_iHor; }
Int getVer () const { return m_iVer; }
Int getAbsHor () const { return abs( m_iHor ); }
Int getAbsVer () const { return abs( m_iVer ); }

// ------------------------------------------------------------------------------------------------------------------
// operations
// ------------------------------------------------------------------------------------------------------------------

const TComMv& operator += (const TComMv& rcMv)
{
m_iHor += rcMv.m_iHor;
m_iVer += rcMv.m_iVer;
return *this;
}

const TComMv& operator-= (const TComMv& rcMv)
{
m_iHor -= rcMv.m_iHor;
m_iVer -= rcMv.m_iVer;
return *this;
}

const TComMv& operator>>= (const Int i)
{
m_iHor >>= i;
m_iVer >>= i;
return *this;
}

const TComMv& operator<<= (const Int i)
{
m_iHor <<= i;
m_iVer <<= i;
return *this;
}

const TComMv operator - ( const TComMv& rcMv ) const
{
return TComMv( m_iHor - rcMv.m_iHor, m_iVer - rcMv.m_iVer );
}

const TComMv operator + ( const TComMv& rcMv ) const
{
return TComMv( m_iHor + rcMv.m_iHor, m_iVer + rcMv.m_iVer );
}

Bool operator== ( const TComMv& rcMv ) const
{
return (m_iHor==rcMv.m_iHor && m_iVer==rcMv.m_iVer);
}

Bool operator!= ( const TComMv& rcMv ) const
{
return (m_iHor!=rcMv.m_iHor || m_iVer!=rcMv.m_iVer);
}

const TComMv scaleMv( Int iScale ) const
{
Int mvx = Clip3( -32768, 32767, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8 );
Expand Down
38 changes: 19 additions & 19 deletions appgitlhevcdecoder/HM-12.0/source/Lib/TLibCommon/TComMv.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
* granted under this license.
*
* Copyright (c) 2010-2013, ITU/ISO/IEC
* All rights reserved.
Expand Down Expand Up @@ -54,95 +54,95 @@ class TComMv
private:
Short m_iHor; ///< horizontal component of motion vector
Short m_iVer; ///< vertical component of motion vector

Int abs(Int x) const { return x>0 ? x : -x; }
public:

// ------------------------------------------------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------------------------------------------------

TComMv() :
m_iHor(0),
m_iVer(0)
{
}

TComMv( Short iHor, Short iVer ) :
m_iHor(iHor),
m_iVer(iVer)
{
}

// ------------------------------------------------------------------------------------------------------------------
// set
// ------------------------------------------------------------------------------------------------------------------

Void set ( Short iHor, Short iVer) { m_iHor = iHor; m_iVer = iVer; }
Void setHor ( Short i ) { m_iHor = i; }
Void setVer ( Short i ) { m_iVer = i; }
Void setZero () { m_iHor = m_iVer = 0; }

// ------------------------------------------------------------------------------------------------------------------
// get
// ------------------------------------------------------------------------------------------------------------------

Int getHor () const { return m_iHor; }
Int getVer () const { return m_iVer; }
Int getAbsHor () const { return abs( m_iHor ); }
Int getAbsVer () const { return abs( m_iVer ); }

// ------------------------------------------------------------------------------------------------------------------
// operations
// ------------------------------------------------------------------------------------------------------------------

const TComMv& operator += (const TComMv& rcMv)
{
m_iHor += rcMv.m_iHor;
m_iVer += rcMv.m_iVer;
return *this;
}

const TComMv& operator-= (const TComMv& rcMv)
{
m_iHor -= rcMv.m_iHor;
m_iVer -= rcMv.m_iVer;
return *this;
}

const TComMv& operator>>= (const Int i)
{
m_iHor >>= i;
m_iVer >>= i;
return *this;
}

const TComMv& operator<<= (const Int i)
{
m_iHor <<= i;
m_iVer <<= i;
return *this;
}

const TComMv operator - ( const TComMv& rcMv ) const
{
return TComMv( m_iHor - rcMv.m_iHor, m_iVer - rcMv.m_iVer );
}

const TComMv operator + ( const TComMv& rcMv ) const
{
return TComMv( m_iHor + rcMv.m_iHor, m_iVer + rcMv.m_iVer );
}

Bool operator== ( const TComMv& rcMv ) const
{
return (m_iHor==rcMv.m_iHor && m_iVer==rcMv.m_iVer);
}

Bool operator!= ( const TComMv& rcMv ) const
{
return (m_iHor!=rcMv.m_iHor || m_iVer!=rcMv.m_iVer);
}

const TComMv scaleMv( Int iScale ) const
{
Int mvx = Clip3( -32768, 32767, (iScale * getHor() + 127 + (iScale * getHor() < 0)) >> 8 );
Expand Down
38 changes: 19 additions & 19 deletions appgitlhevcdecoder/HM-4.0/source/Lib/TLibCommon/TComMv.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
* granted under this license.
*
* Copyright (c) 2010-2011, ITU/ISO/IEC
* All rights reserved.
Expand Down Expand Up @@ -53,95 +53,95 @@ class TComMv
private:
Short m_iHor; ///< horizontal component of motion vector
Short m_iVer; ///< vertical component of motion vector

Int abs(Int x) const { return x>0 ? x : -x; }
public:

// ------------------------------------------------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------------------------------------------------

TComMv() :
m_iHor(0),
m_iVer(0)
{
}

TComMv( Short iHor, Short iVer ) :
m_iHor(iHor),
m_iVer(iVer)
{
}

// ------------------------------------------------------------------------------------------------------------------
// set
// ------------------------------------------------------------------------------------------------------------------

Void set ( Short iHor, Short iVer) { m_iHor = iHor; m_iVer = iVer; }
Void setHor ( Short i ) { m_iHor = i; }
Void setVer ( Short i ) { m_iVer = i; }
Void setZero () { m_iHor = m_iVer = 0; }

// ------------------------------------------------------------------------------------------------------------------
// get
// ------------------------------------------------------------------------------------------------------------------

Int getHor () const { return m_iHor; }
Int getVer () const { return m_iVer; }
Int getAbsHor () const { return abs( m_iHor ); }
Int getAbsVer () const { return abs( m_iVer ); }

// ------------------------------------------------------------------------------------------------------------------
// operations
// ------------------------------------------------------------------------------------------------------------------

const TComMv& operator += (const TComMv& rcMv)
{
m_iHor += rcMv.m_iHor;
m_iVer += rcMv.m_iVer;
return *this;
}

const TComMv& operator-= (const TComMv& rcMv)
{
m_iHor -= rcMv.m_iHor;
m_iVer -= rcMv.m_iVer;
return *this;
}

const TComMv& operator>>= (const Int i)
{
m_iHor >>= i;
m_iVer >>= i;
return *this;
}

const TComMv& operator<<= (const Int i)
{
m_iHor <<= i;
m_iVer <<= i;
return *this;
}

const TComMv operator - ( const TComMv& rcMv ) const
{
return TComMv( m_iHor - rcMv.m_iHor, m_iVer - rcMv.m_iVer );
}

const TComMv operator + ( const TComMv& rcMv ) const
{
return TComMv( m_iHor + rcMv.m_iHor, m_iVer + rcMv.m_iVer );
}

Bool operator== ( const TComMv& rcMv ) const
{
return (m_iHor==rcMv.m_iHor && m_iVer==rcMv.m_iVer);
}

Bool operator!= ( const TComMv& rcMv ) const
{
return (m_iHor!=rcMv.m_iHor || m_iVer!=rcMv.m_iVer);
}

const TComMv scaleMv( Int iScale ) const
{
#if MV_SCALE_ROUNDING_F142
Expand Down
Loading