Ticket #1278: fix_1278.patch

File fix_1278.patch, 1.6 KB (added by barrouxg, 10 years ago)

This patch fixes the padding problem for field size computation when computing the PSNR values.

  • source/Lib/TLibEncoder/TEncGOP.cpp

     
    23972439    const Pel*  pOrg    = (conversion!=IPCOLOURSPACE_UNCHANGED) ? pcPic ->getPicYuvTrueOrg()->getAddr(ch) : pcPic ->getPicYuvOrg()->getAddr(ch);
    23982440    Pel*  pRec    = picd.getAddr(ch);
    23992441    const Int   iStride = pcPicD->getStride(ch);
    24002442
    24012443    const Int   iWidth  = pcPicD->getWidth (ch) - (m_pcEncTop->getPad(0) >> pcPic->getComponentScaleX(ch));
    2402     const Int   iHeight = pcPicD->getHeight(ch) - (m_pcEncTop->getPad(1) >> pcPic->getComponentScaleY(ch));
     2444    const Int   iHeight = pcPicD->getHeight(ch) - ((m_pcEncTop->getPad(1) >> (pcPic->isField()?1:0)) >> pcPic->getComponentScaleY(ch));
    24032445
    24042446    Int   iSize   = iWidth*iHeight;
    24052447
    24062448    UInt64 uiSSDtemp=0;
    24072449    for(Int y = 0; y < iHeight; y++ )
     
    25342576    assert(apcPicRecFields[0]->getWidth(ch)==apcPicRecFields[1]->getWidth(ch));
    25352577    assert(apcPicRecFields[0]->getHeight(ch)==apcPicRecFields[1]->getHeight(ch));
    25362578
    25372579    UInt64 uiSSDtemp=0;
    25382580    const Int   iWidth  = apcPicRecFields[0]->getWidth (ch) - (m_pcEncTop->getPad(0) >> apcPicRecFields[0]->getComponentScaleX(ch));
    2539     const Int   iHeight = apcPicRecFields[0]->getHeight(ch) - (m_pcEncTop->getPad(1) >> apcPicRecFields[0]->getComponentScaleY(ch));
     2581    const Int   iHeight = apcPicRecFields[0]->getHeight(ch) - ((m_pcEncTop->getPad(1) >> 1) >> apcPicRecFields[0]->getComponentScaleY(ch));
    25402582
    25412583    Int   iSize   = iWidth*iHeight;
    25422584
    25432585    for(UInt fieldNum=0; fieldNum<2; fieldNum++)
    25442586    {