Changeset 872 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncGOP.cpp


Ignore:
Timestamp:
27 Mar 2014, 10:11:29 (11 years ago)
Author:
tech
Message:

Merged HTM-10.0-dev0@871. (MV-HEVC 7 HLS)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibEncoder/TEncGOP.cpp

    r773 r872  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2013, ITU/ISO/IEC
     6* Copyright (c) 2010-2014, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    105105#endif
    106106#endif
     107#if FIX1172
     108  m_associatedIRAPType = NAL_UNIT_CODED_SLICE_IDR_N_LP;
     109  m_associatedIRAPPOC  = 0;
     110#endif
    107111  return;
    108112}
     
    292296}
    293297
     298#if H_MV_HLS_7_SEI_P0204_26
     299SEISubBitstreamProperty *TEncGOP::xCreateSEISubBitstreamProperty( TComSPS *sps)
     300{
     301  SEISubBitstreamProperty *seiSubBitstreamProperty = new SEISubBitstreamProperty();
     302
     303  seiSubBitstreamProperty->m_activeVpsId = sps->getVPSId();
     304  /* These values can be determined by the encoder; for now we will use the input parameter */
     305  TEncTop *encTop = this->m_pcEncTop;
     306  seiSubBitstreamProperty->m_numAdditionalSubStreams = encTop->getNumAdditionalSubStreams();
     307  seiSubBitstreamProperty->m_subBitstreamMode        = encTop->getSubBitstreamMode();
     308  seiSubBitstreamProperty->m_outputLayerSetIdxToVps  = encTop->getOutputLayerSetIdxToVps();
     309  seiSubBitstreamProperty->m_highestSublayerId       = encTop->getHighestSublayerId();
     310  seiSubBitstreamProperty->m_avgBitRate              = encTop->getAvgBitRate();
     311  seiSubBitstreamProperty->m_maxBitRate              = encTop->getMaxBitRate();
     312
     313  return seiSubBitstreamProperty;
     314}
     315#endif
     316
    294317Void TEncGOP::xCreateLeadingSEIMessages (/*SEIMessages seiMessages,*/ AccessUnit &accessUnit, TComSPS *sps)
    295318{
     
    342365    delete sei;
    343366  }
     367#if H_MV_HLS_7_SEI_P0204_26
     368  if( m_pcCfg->getSubBitstreamPropSEIEnabled() )
     369  {
     370    SEISubBitstreamProperty *sei = xCreateSEISubBitstreamProperty ( sps );
     371
     372    nalu = NALUnit(NAL_UNIT_PREFIX_SEI);
     373    m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
     374    m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps);
     375    writeRBSPTrailingBits(nalu.m_Bitstream);
     376    accessUnit.push_back(new NALUnitEBSP(nalu));
     377    delete sei;
     378  }
     379#endif
    344380}
    345381
     
    472508    }
    473509
    474     if( getNalUnitType(pocCurr, m_iLastIDR) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr, m_iLastIDR) == NAL_UNIT_CODED_SLICE_IDR_N_LP )
     510    if( getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_W_RADL || getNalUnitType(pocCurr, m_iLastIDR, isField) == NAL_UNIT_CODED_SLICE_IDR_N_LP )
    475511    {
    476512      m_iLastIDR = pocCurr;
     
    551587#if H_MV
    552588    // Set the nal unit type
    553     pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
     589    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
    554590    if( pcSlice->getSliceType() == B_SLICE )
    555591    {
     
    559595      }
    560596    }
     597
     598// To be checked!
     599    if( pcSlice->getSliceType() == B_SLICE )
     600    {
     601      if( m_pcCfg->getGOPEntry( ( pcSlice->getRapPicFlag() && getLayerId() > 0 ) ? MAX_GOP : iGOPid ).m_sliceType == 'I' )
     602      {
     603        pcSlice->setSliceType( I_SLICE );
     604      }
     605    }
    561606#else
    562607    if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='P')
     
    564609      pcSlice->setSliceType(P_SLICE);
    565610    }
     611    if(pcSlice->getSliceType()==B_SLICE&&m_pcCfg->getGOPEntry(iGOPid).m_sliceType=='I')
     612    {
     613      pcSlice->setSliceType(I_SLICE);
     614    }
     615   
    566616    // Set the nal unit type
    567     pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR));
     617    pcSlice->setNalUnitType(getNalUnitType(pocCurr, m_iLastIDR, isField));
    568618#endif
    569619    if(pcSlice->getTemporalLayerNonReferenceFlag())
     
    589639    m_pcEncTop->selectReferencePictureSet(pcSlice, pocCurr, iGOPid);
    590640    pcSlice->getRPS()->setNumberOfLongtermPictures(0);
    591 
    592 #if FIX1071
     641#if FIX1172
     642    if ( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_LP
     643      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_W_RADL
     644      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_BLA_N_LP
     645      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_W_RADL
     646      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR_N_LP
     647      || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_CRA )  // IRAP picture
     648    {
     649      m_associatedIRAPType = pcSlice->getNalUnitType();
     650      m_associatedIRAPPOC = pocCurr;
     651    }
     652    pcSlice->setAssociatedIRAPType(m_associatedIRAPType);
     653    pcSlice->setAssociatedIRAPPOC(m_associatedIRAPPOC);
     654#endif
     655
    593656    if ((pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0) || (pcSlice->isIRAP()))
    594657    {
    595658      pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS(), pcSlice->isIRAP());
    596659    }
    597 #else
    598     if(pcSlice->checkThatAllRefPicsAreAvailable(rcListPic, pcSlice->getRPS(), false) != 0)
    599     {
    600       pcSlice->createExplicitReferencePictureSetFromReference(rcListPic, pcSlice->getRPS());
    601     }
    602 #endif
    603660    pcSlice->applyReferencePictureSet(rcListPic, pcSlice->getRPS());
    604661
    605     if(pcSlice->getTLayer() > 0)
     662    if(pcSlice->getTLayer() > 0
     663      &&  !( pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_N     // Check if not a leading picture
     664          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RADL_R
     665          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_N
     666          || pcSlice->getNalUnitType() == NAL_UNIT_CODED_SLICE_RASL_R )
     667        )
    606668    {
    607669      if(pcSlice->isTemporalLayerSwitchingPoint(rcListPic) || pcSlice->getSPS()->getTemporalIdNestingFlag())
     
    613675        else
    614676        {
    615           pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TLA_R);
     677          pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_TSA_R);
    616678        }
    617679      }
     
    907969    pcPic->getSlice(pcSlice->getSliceIdx())->setMvdL1ZeroFlag(pcSlice->getMvdL1ZeroFlag());
    908970
    909 #if RATE_CONTROL_LAMBDA_DOMAIN
    910971    Double lambda            = 0.0;
    911972    Int actualHeadBits       = 0;
     
    9441005      else if ( frameLevel == 0 )   // intra case, but use the model
    9451006      {
    946 #if RATE_CONTROL_INTRA
    9471007        m_pcSliceEncoder->calCostSliceI(pcPic);
    948 #endif
    9491008        if ( m_pcCfg->getIntraPeriod() != 1 )   // do not refine allocated bits for all intra case
    9501009        {
    9511010          Int bits = m_pcRateCtrl->getRCSeq()->getLeftAverageBits();
    952 #if RATE_CONTROL_INTRA
    9531011          bits = m_pcRateCtrl->getRCPic()->getRefineBitsForIntra( bits );
    954 #else
    955           bits = m_pcRateCtrl->getRCSeq()->getRefineBitsForIntra( bits );
    956 #endif
    9571012          if ( bits < 200 )
    9581013          {
     
    9631018
    9641019        list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList();
    965 #if RATE_CONTROL_INTRA
    9661020        m_pcRateCtrl->getRCPic()->getLCUInitTargetBits();
    9671021        lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType());
    968 #else
    969         lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture );
    970 #endif
    9711022        sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture );
    9721023      }
     
    9841035#endif
    9851036        list<TEncRCPic*> listPreviousPicture = m_pcRateCtrl->getPicList();
    986 #if RATE_CONTROL_INTRA
    9871037        lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture, pcSlice->getSliceType());
    988 #else
    989         lambda  = m_pcRateCtrl->getRCPic()->estimatePicLambda( listPreviousPicture );
    990 #endif
    9911038        sliceQP = m_pcRateCtrl->getRCPic()->estimatePicQP( lambda, listPreviousPicture );
    9921039#if KWU_RC_MADPRED_E0227
     
    10001047      m_pcSliceEncoder->resetQP( pcPic, sliceQP, lambda );
    10011048    }
    1002 #endif
    10031049
    10041050    UInt uiNumSlices = 1;
     
    12031249
    12041250    // SAO parameter estimation using non-deblocked pixels for LCU bottom and right boundary areas
    1205     if( m_pcCfg->getSaoLcuBasedOptimization() && m_pcCfg->getSaoLcuBoundary() )
    1206     {
    1207       m_pcSAO->resetStats();
    1208       m_pcSAO->calcSaoStatsCu_BeforeDblk( pcPic );
     1251    if( pcSlice->getSPS()->getUseSAO() && m_pcCfg->getSaoLcuBoundary() )
     1252    {
     1253      m_pcSAO->getPreDBFStatistics(pcPic);
    12091254    }
    12101255
     
    12181263    m_pcLoopFilter->loopFilterPic( pcPic );
    12191264
    1220     pcSlice = pcPic->getSlice(0);
    1221     if(pcSlice->getSPS()->getUseSAO())
    1222     {
    1223       std::vector<Bool> LFCrossSliceBoundaryFlag;
    1224       for(Int s=0; s< uiNumSlices; s++)
    1225       {
    1226         LFCrossSliceBoundaryFlag.push_back(  ((uiNumSlices==1)?true:pcPic->getSlice(s)->getLFCrossSliceBoundaryFlag()) );
    1227       }
    1228       m_storedStartCUAddrForEncodingSlice.resize(uiNumSlices+1);
    1229       pcPic->createNonDBFilterInfo(m_storedStartCUAddrForEncodingSlice, 0, &LFCrossSliceBoundaryFlag ,pcPic->getPicSym()->getNumTiles() ,bLFCrossTileBoundary);
    1230     }
    1231 
    1232 
    1233     pcSlice = pcPic->getSlice(0);
    1234 
    1235     if(pcSlice->getSPS()->getUseSAO())
    1236     {
    1237       m_pcSAO->createPicSaoInfo(pcPic);
    1238     }
    1239 
    12401265    /////////////////////////////////////////////////////////////////////////////////////////////////// File writing
    12411266    // Set entropy coder
     
    12541279      writeRBSPTrailingBits(nalu.m_Bitstream);
    12551280      accessUnit.push_back(new NALUnitEBSP(nalu));
    1256 #if RATE_CONTROL_LAMBDA_DOMAIN
    12571281      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    1258 #endif
    12591282
    12601283#if H_MV
     
    12961319      writeRBSPTrailingBits(nalu.m_Bitstream);
    12971320      accessUnit.push_back(new NALUnitEBSP(nalu));
    1298 #if RATE_CONTROL_LAMBDA_DOMAIN
    12991321      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    1300 #endif
    13011322
    13021323#if H_MV
     
    13131334      writeRBSPTrailingBits(nalu.m_Bitstream);
    13141335      accessUnit.push_back(new NALUnitEBSP(nalu));
    1315 #if RATE_CONTROL_LAMBDA_DOMAIN
    13161336      actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    1317 #endif
     1337     
    13181338#if PPS_FIX_DEPTH
    13191339      }
     
    13431363        {
    13441364          SOPcurrPOC += deltaPOC;
    1345           SOPDescriptionSEI.m_sopDescVclNaluType[i] = getNalUnitType(SOPcurrPOC, m_iLastIDR);
     1365          SOPDescriptionSEI.m_sopDescVclNaluType[i] = getNalUnitType(SOPcurrPOC, m_iLastIDR, isField);
    13461366          SOPDescriptionSEI.m_sopDescTemporalId[i] = m_pcCfg->getGOPEntry(j).m_temporalId;
    13471367          SOPDescriptionSEI.m_sopDescStRpsIdx[i] = m_pcEncTop->getReferencePictureSetIdxForSOP(pcSlice, SOPcurrPOC, j);
     
    16211641          }
    16221642          m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream);
    1623 #if RATE_CONTROL_LAMBDA_DOMAIN
    16241643          tmpBitsBeforeWriting = m_pcEntropyCoder->getNumberOfWrittenBits();
    1625 #endif
    16261644          m_pcEntropyCoder->encodeSliceHeader(pcSlice);
    1627 #if RATE_CONTROL_LAMBDA_DOMAIN
    16281645          actualHeadBits += ( m_pcEntropyCoder->getNumberOfWrittenBits() - tmpBitsBeforeWriting );
    1629 #endif
    16301646
    16311647          // is it needed?
     
    17481764          xAttachSliceDataToNalUnit(nalu, pcBitstreamRedirect);
    17491765          accessUnit.push_back(new NALUnitEBSP(nalu));
    1750 #if RATE_CONTROL_LAMBDA_DOMAIN
    17511766          actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8;
    1752 #endif
    17531767          bNALUAlignedWrittenToList = true;
    17541768          uiOneBitstreamPerSliceLength += nalu.m_Bitstream.getNumberOfWrittenBits(); // length of bitstream after byte-alignment
     
    17941808              m_pcEntropyCoder->resetEntropy();
    17951809              m_pcEntropyCoder->setBitstream( m_pcBitCounter );
    1796               m_pcSAO->startSaoEnc(pcPic, m_pcEntropyCoder, m_pcEncTop->getRDSbacCoder(), m_pcEncTop->getRDGoOnSbacCoder());
    1797               SAOParam& cSaoParam = *pcSlice->getPic()->getPicSym()->getSaoParam();
    1798 
    1799 #if SAO_CHROMA_LAMBDA
    1800 #if SAO_ENCODING_CHOICE
    1801               m_pcSAO->SAOProcess(&cSaoParam, pcPic->getSlice(0)->getLambdaLuma(), pcPic->getSlice(0)->getLambdaChroma(), pcPic->getSlice(0)->getDepth());
    1802 #else
    1803               m_pcSAO->SAOProcess(&cSaoParam, pcPic->getSlice(0)->getLambdaLuma(), pcPic->getSlice(0)->getLambdaChroma());
    1804 #endif
    1805 #else
    1806               m_pcSAO->SAOProcess(&cSaoParam, pcPic->getSlice(0)->getLambda());
    1807 #endif
    1808               m_pcSAO->endSaoEnc();
     1810            Bool sliceEnabled[NUM_SAO_COMPONENTS];
     1811            m_pcSAO->initRDOCabacCoder(m_pcEncTop->getRDGoOnSbacCoder(), pcSlice);
     1812            m_pcSAO->SAOProcess(pcPic
     1813              , sliceEnabled
     1814              , pcPic->getSlice(0)->getLambdas()
     1815#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
     1816              , m_pcCfg->getSaoLcuBoundary()
     1817#endif
     1818              );
    18091819              m_pcSAO->PCMLFDisableProcess(pcPic);
    1810             }
    1811 #if SAO_RDO
    1812             m_pcEntropyCoder->setEntropyCoder ( m_pcCavlcCoder, pcSlice );
    1813 #endif
    1814             processingState = ENCODE_SLICE;
    1815 
     1820
     1821            //assign SAO slice header
    18161822            for(Int s=0; s< uiNumSlices; s++)
    18171823            {
    1818               if (pcSlice->getSPS()->getUseSAO())
    1819               {
    1820                 pcPic->getSlice(s)->setSaoEnabledFlag((pcSlice->getPic()->getPicSym()->getSaoParam()->bSaoFlag[0]==1)?true:false);
     1824              pcPic->getSlice(s)->setSaoEnabledFlag(sliceEnabled[SAO_Y]);
     1825              assert(sliceEnabled[SAO_Cb] == sliceEnabled[SAO_Cr]);
     1826              pcPic->getSlice(s)->setSaoEnabledFlagChroma(sliceEnabled[SAO_Cb]);
    18211827              }
    18221828            }
     1829          processingState = ENCODE_SLICE;
    18231830          }
    18241831          break;
     
    18311838        }
    18321839      } // end iteration over slices
    1833 
    1834       if(pcSlice->getSPS()->getUseSAO())
    1835       {
    1836         if(pcSlice->getSPS()->getUseSAO())
    1837         {
    1838           m_pcSAO->destroyPicSaoInfo();
    1839         }
    1840         pcPic->destroyNonDBFilterInfo();
    1841       }
    18421840#if H_3D
    18431841      pcPic->compressMotion(2);
     
    19191917
    19201918    //In case of field coding, compute the interlaced PSNR for both fields
    1921     if (isField && ((!pcPic->isTopField() && isTff) || (pcPic->isTopField() && !isTff)))
     1919    if (isField && ((!pcPic->isTopField() && isTff) || (pcPic->isTopField() && !isTff)) && (pcPic->getPOC()%m_iGopSize != 1))
    19221920    {
    19231921      //get complementary top field
     
    19311929      xCalculateInterlacedAddPSNR(pcPicTop, pcPic, pcPicTop->getPicYuvRec(), pcPic->getPicYuvRec(), accessUnit, dEncTime );
    19321930    }
     1931    else if (isField && pcPic->getPOC()!= 0 && (pcPic->getPOC()%m_iGopSize == 0))
     1932    {
     1933      //get complementary bottom field
     1934      TComPic* pcPicBottom;
     1935      TComList<TComPic*>::iterator   iterPic = rcListPic.begin();
     1936      while ((*iterPic)->getPOC() != pcPic->getPOC()+1)
     1937      {
     1938        iterPic ++;
     1939      }
     1940      pcPicBottom = *(iterPic);
     1941      xCalculateInterlacedAddPSNR(pcPic, pcPicBottom, pcPic->getPicYuvRec(), pcPicBottom->getPicYuvRec(), accessUnit, dEncTime );
     1942    }
    19331943   
    19341944      if (digestStr)
     
    19471957        }
    19481958      }
    1949 #if RATE_CONTROL_LAMBDA_DOMAIN
    19501959      if ( m_pcCfg->getUseRateCtrl() )
    19511960      {
    1952 #if !M0036_RC_IMPROVEMENT
    1953         Double effectivePercentage = m_pcRateCtrl->getRCPic()->getEffectivePercentage();
    1954 #endif
    19551961        Double avgQP     = m_pcRateCtrl->getRCPic()->calAverageQP();
    19561962        Double avgLambda = m_pcRateCtrl->getRCPic()->calAverageLambda();
     
    19591965          avgLambda = lambda;
    19601966        }
    1961 #if M0036_RC_IMPROVEMENT
    1962 #if RATE_CONTROL_INTRA
    19631967        m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda, pcSlice->getSliceType());
    1964 #else
    1965         m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda );
    1966 #endif
    1967 #else
    1968         m_pcRateCtrl->getRCPic()->updateAfterPicture( actualHeadBits, actualTotalBits, avgQP, avgLambda, effectivePercentage );
    1969 #endif
    19701968        m_pcRateCtrl->getRCPic()->addToPictureLsit( m_pcRateCtrl->getPicList() );
    19711969
     
    19801978        }
    19811979      }
    1982 #else
    1983       if(m_pcCfg->getUseRateCtrl())
    1984       {
    1985         UInt  frameBits = m_vRVM_RP[m_vRVM_RP.size()-1];
    1986         m_pcRateCtrl->updataRCFrameStatus((Int)frameBits, pcSlice->getSliceType());
    1987       }
    1988 #endif
    19891980
    19901981      if( ( m_pcCfg->getPictureTimingSEIEnabled() || m_pcCfg->getDecodingUnitInfoSEIEnabled() ) &&
     
    21732164      delete[] pcSubstreamsOut;
    21742165  }
    2175 #if !KWU_FIX_URQ && !RATE_CONTROL_LAMBDA_DOMAIN
    2176   if(m_pcCfg->getUseRateCtrl())
    2177   {
    2178     m_pcRateCtrl->updateRCGOPStatus();
    2179   }
    2180 #endif
    21812166  delete pcBitstreamRedirect;
    21822167
     
    22622247  m_pcEntropyCoder->resetEntropy    ();
    22632248  m_pcEntropyCoder->setBitstream    ( m_pcBitCounter );
    2264   pcSlice = pcPic->getSlice(0);
    2265   if(pcSlice->getSPS()->getUseSAO())
    2266   {
    2267     std::vector<Bool> LFCrossSliceBoundaryFlag(1, true);
    2268     std::vector<Int>  sliceStartAddress;
    2269     sliceStartAddress.push_back(0);
    2270     sliceStartAddress.push_back(pcPic->getNumCUsInFrame()* pcPic->getNumPartInCU());
    2271     pcPic->createNonDBFilterInfo(sliceStartAddress, 0, &LFCrossSliceBoundaryFlag);
    2272   }
    2273  
    2274   if( pcSlice->getSPS()->getUseSAO())
    2275   {
    2276     pcPic->destroyNonDBFilterInfo();
    2277   }
    2278  
    22792249  m_pcEntropyCoder->resetEntropy    ();
    22802250  ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
     
    24542424    case NAL_UNIT_CODED_SLICE_TRAIL_R: return "TRAIL_R";
    24552425    case NAL_UNIT_CODED_SLICE_TRAIL_N: return "TRAIL_N";
    2456     case NAL_UNIT_CODED_SLICE_TLA_R:      return "TLA_R";
     2426    case NAL_UNIT_CODED_SLICE_TSA_R:      return "TSA_R";
    24572427    case NAL_UNIT_CODED_SLICE_TSA_N: return "TSA_N";
    24582428    case NAL_UNIT_CODED_SLICE_STSA_R: return "STSA_R";
     
    27022672    for (Int x = 0; x < width; x++)
    27032673    {
    2704       dst[x] = isTff ? (UChar) top[x] : (UChar) bottom[x];
    2705       dst[stride+x] = isTff ? (UChar) bottom[x] : (UChar) top[x];
     2674      dst[x] = isTff ? top[x] : bottom[x];
     2675      dst[stride+x] = isTff ? bottom[x] : top[x];
    27062676    }
    27072677    top += stride;
     
    28622832 * This function checks the configuration and returns the appropriate nal_unit_type for the picture.
    28632833 */
    2864 NalUnitType TEncGOP::getNalUnitType(Int pocCurr, Int lastIDR)
     2834NalUnitType TEncGOP::getNalUnitType(Int pocCurr, Int lastIDR, Bool isField)
    28652835{
    28662836  if (pocCurr == 0)
     
    28682838    return NAL_UNIT_CODED_SLICE_IDR_W_RADL;
    28692839  }
    2870   if (pocCurr % m_pcCfg->getIntraPeriod() == 0)
     2840  if ((pocCurr - isField) % m_pcCfg->getIntraPeriod() == 0)
    28712841  {
    28722842    if (m_pcCfg->getDecodingRefreshType() == 1)
Note: See TracChangeset for help on using the changeset viewer.