Ticket #402: FixSaoClip.patch

File FixSaoClip.patch, 894 bytes (added by chihming.fu, 12 years ago)

patch file to fix the bug

  • Lib/TLibEncoder/TEncSampleAdaptiveOffset.cpp

     
    19371937        if(m_iCount [yCbCr][typeIdx][classIdx])
    19381938        {
    19391939          m_iOffset[yCbCr][typeIdx][classIdx] = (Int64) xRoundIbdi((Double)(m_iOffsetOrg[yCbCr][typeIdx][classIdx]<<g_uiBitIncrement) / (Double)(m_iCount [yCbCr][typeIdx][classIdx]<<m_uiSaoBitIncrease));
    1940           m_iOffset[yCbCr][typeIdx][classIdx] = Clip3(-offsetTh, offsetTh, (Int)m_iOffset[yCbCr][typeIdx][classIdx]);
     1940          m_iOffset[yCbCr][typeIdx][classIdx] = Clip3(-offsetTh, offsetTh-1, (Int)m_iOffset[yCbCr][typeIdx][classIdx]);
    19411941          if (typeIdx < 4)
    19421942          {
    19431943            if ( m_iOffset[yCbCr][typeIdx][classIdx]<0 && classIdx<3 )