Ignore:
Timestamp:
5 Jul 2014, 05:16:45 (10 years ago)
Author:
tech
Message:
  • Merged 11.0-dev0@963. (Update to HM 14.0 + MV-HEVC Draft 8 HLS)
  • Added coding results.
  • Changed version number.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp

    r872 r964  
    110110    m_offsetClipTable[compIdx] = NULL;
    111111  }
     112#if !SAO_SGN_FUNC
    112113  m_signTable = NULL;
    113 
     114#endif
    114115 
    115116  m_lineBufWidth = 0;
     
    155156  }
    156157
     158#if !SAO_SGN_FUNC
    157159  //look-up table for clipping
     160  Int overallMaxSampleValue=0;
     161#endif
    158162  for(Int compIdx =0; compIdx < NUM_SAO_COMPONENTS; compIdx++)
    159163  {
     
    161165    Int maxSampleValue = (1<< bitDepthSample); //exclusive
    162166    Int maxOffsetValue = (g_saoMaxOffsetQVal[compIdx] << m_offsetStepLog2[compIdx]);
     167#if !SAO_SGN_FUNC
     168    if (maxSampleValue>overallMaxSampleValue) overallMaxSampleValue=maxSampleValue;
     169#endif
    163170
    164171    m_offsetClipTable[compIdx] = new Int[(maxSampleValue + maxOffsetValue -1)+ (maxOffsetValue)+1 ]; //positive & negative range plus 0
     
    176183      *(offsetClipPtr -k -1 )              = 0;
    177184    }
    178     if(compIdx == SAO_Y) //g_bitDepthY is always larger than or equal to g_bitDepthC
    179     {
    180       m_signTable = new Short[ 2*(maxSampleValue-1) + 1 ];
    181       m_sign = &(m_signTable[maxSampleValue-1]);
     185  }
     186
     187#if !SAO_SGN_FUNC
     188  m_signTable = new Short[ 2*(overallMaxSampleValue-1) + 1 ];
     189  m_sign = &(m_signTable[overallMaxSampleValue-1]);
    182190
    183191      m_sign[0] = 0;
    184       for(Int k=1; k< maxSampleValue; k++)
     192  for(Int k=1; k< overallMaxSampleValue; k++)
    185193      {
    186194        m_sign[k] = 1;
    187195        m_sign[-k]= -1;
    188196      }
    189     }
    190   } 
    191 
     197#endif
    192198}
    193199
     
    208214    }
    209215  }
     216#if !SAO_SGN_FUNC
    210217  if( m_signTable )
    211218  {
    212219    delete[] m_signTable; m_signTable = NULL;
    213220  }
     221#endif
    214222}
    215223
     
    388396      for (y=0; y< height; y++)
    389397      {
     398#if SAO_SGN_FUNC
     399        signLeft = (Char)sgn(srcLine[startX] - srcLine[startX-1]);
     400#else
    390401        signLeft = (Char)m_sign[srcLine[startX] - srcLine[startX-1]];
     402#endif
    391403        for (x=startX; x< endX; x++)
    392404        {
     405#if SAO_SGN_FUNC
     406          signRight = (Char)sgn(srcLine[x] - srcLine[x+1]);
     407#else
    393408          signRight = (Char)m_sign[srcLine[x] - srcLine[x+1]];
     409#endif
    394410          edgeType =  signRight + signLeft;
    395411          signLeft  = -signRight;
     
    419435      for (x=0; x< width; x++)
    420436      {
     437#if SAO_SGN_FUNC
     438        signUpLine[x] = (Char)sgn(srcLine[x] - srcLineAbove[x]);
     439#else
    421440        signUpLine[x] = (Char)m_sign[srcLine[x] - srcLineAbove[x]];
     441#endif
    422442      }
    423443
     
    429449        for (x=0; x< width; x++)
    430450        {
     451#if SAO_SGN_FUNC
     452          signDown  = (Char)sgn(srcLine[x] - srcLineBelow[x]);
     453#else
    431454          signDown  = (Char)m_sign[srcLine[x] - srcLineBelow[x]];
     455#endif
    432456          edgeType = signDown + signUpLine[x];
    433457          signUpLine[x]= -signDown;
     
    456480      for (x=startX; x< endX+1; x++)
    457481      {
     482#if SAO_SGN_FUNC
     483        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x- 1]);
     484#else
    458485        signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x- 1]];
     486#endif
    459487      }
    460488
     
    465493      for(x= firstLineStartX; x< firstLineEndX; x++)
    466494      {
     495#if SAO_SGN_FUNC
     496        edgeType  =  sgn(srcLine[x] - srcLineAbove[x- 1]) - signUpLine[x+1];
     497#else
    467498        edgeType  =  m_sign[srcLine[x] - srcLineAbove[x- 1]] - signUpLine[x+1];
     499#endif
    468500        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    469501      }
     
    479511        for (x=startX; x<endX; x++)
    480512        {
     513#if SAO_SGN_FUNC
     514          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x+ 1]);
     515#else
    481516          signDown =  (Char)m_sign[srcLine[x] - srcLineBelow[x+ 1]] ;
     517#endif
    482518          edgeType =  signDown + signUpLine[x];
    483519          resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
     
    485521          signDownLine[x+1] = -signDown;
    486522        }
     523#if SAO_SGN_FUNC
     524        signDownLine[startX] = (Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);
     525#else
    487526        signDownLine[startX] = (Char)m_sign[srcLineBelow[startX] - srcLine[startX-1]];
     527#endif
    488528
    489529        signTmpLine  = signUpLine;
     
    501541      for(x= lastLineStartX; x< lastLineEndX; x++)
    502542      {
     543#if SAO_SGN_FUNC
     544        edgeType =  sgn(srcLine[x] - srcLineBelow[x+ 1]) + signUpLine[x];
     545#else
    503546        edgeType =  m_sign[srcLine[x] - srcLineBelow[x+ 1]] + signUpLine[x];
     547#endif
    504548        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    505549
     
    519563      for (x=startX-1; x< endX; x++)
    520564      {
     565#if SAO_SGN_FUNC
     566        signUpLine[x] = (Char)sgn(srcLineBelow[x] - srcLine[x+1]);
     567#else
    521568        signUpLine[x] = (Char)m_sign[srcLineBelow[x] - srcLine[x+1]];
     569#endif
    522570      }
    523571
     
    529577      for(x= firstLineStartX; x< firstLineEndX; x++)
    530578      {
     579#if SAO_SGN_FUNC
     580        edgeType = sgn(srcLine[x] - srcLineAbove[x+1]) -signUpLine[x-1];
     581#else
    531582        edgeType = m_sign[srcLine[x] - srcLineAbove[x+1]] -signUpLine[x-1];
     583#endif
    532584        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    533585      }
     
    542594        for(x= startX; x< endX; x++)
    543595        {
     596#if SAO_SGN_FUNC
     597          signDown =  (Char)sgn(srcLine[x] - srcLineBelow[x-1]);
     598#else
    544599          signDown =  (Char)m_sign[srcLine[x] - srcLineBelow[x-1]] ;
     600#endif
    545601          edgeType =  signDown + signUpLine[x];
    546602          resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    547603          signUpLine[x-1] = -signDown;
    548604        }
     605#if SAO_SGN_FUNC
     606        signUpLine[endX-1] = (Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);
     607#else
    549608        signUpLine[endX-1] = (Char)m_sign[srcLineBelow[endX-1] - srcLine[endX]];
     609#endif
    550610        srcLine  += srcStride;
    551611        resLine += resStride;
     
    558618      for(x= lastLineStartX; x< lastLineEndX; x++)
    559619      {
     620#if SAO_SGN_FUNC
     621        edgeType = sgn(srcLine[x] - srcLineBelow[x-1]) + signUpLine[x];
     622#else
    560623        edgeType = m_sign[srcLine[x] - srcLineBelow[x-1]] + signUpLine[x];
     624#endif
    561625        resLine[x] = offsetClip[srcLine[x] + offset[edgeType]];
    562626
Note: See TracChangeset for help on using the changeset viewer.