Skip to content
Snippets Groups Projects
UnitTools.cpp 121 KiB
Newer Older
  • Learn to ignore specific revisions
  • #if JVET_P0199_P0289_P0303_MIP_FULLMATRIX
      else if( block.width == 4 || block.height == 4 || (block.width == 8 && block.height == 8) )
    #else
    
      else if (block.width <= 8 && block.height <= 8)
    
    #if JVET_P0803_COMBINED_MIP_CLEANUP || JVET_P0199_P0289_P0303_MIP_FULLMATRIX
    
    int getMipSizeId(const Size& block)
    {
      if( block.width == 4 && block.height == 4 )
      {
        return 0;
      }
    
    #if JVET_P0199_P0289_P0303_MIP_FULLMATRIX
      else if( block.width == 4 || block.height == 4 || (block.width == 8 && block.height == 8) )
    #else
    
      else if( block.width <= 8 && block.height <= 8 )
    
      {
        return 1;
      }
      else
      {
        return 2;
      }
    
    }
    #endif
    #if !JVET_P0803_COMBINED_MIP_CLEANUP
    
    bool mipModesAvailable(const Size& block)
    {
      return (getNumModesMip(block));
    }
    
    bool allowLfnstWithMip(const Size& block)
    {
      if (block.width >= 16 && block.height >= 16)
      {
        return true;
      }
      return false;
    }
    
    bool PU::isRefPicSameSize( const PredictionUnit& pu )
    {
      bool samePicSize = true;
      int curPicWidth = pu.cs->pps->getPicWidthInLumaSamples();
      int curPicHeight = pu.cs->pps->getPicHeightInLumaSamples();
    
      if( pu.refIdx[0] >= 0 )
      {
    
    Brian Heng's avatar
    Brian Heng committed
        int refPicWidth = pu.cu->slice->getRefPic( REF_PIC_LIST_0, pu.refIdx[0] )->getPicWidthInLumaSamples();
        int refPicHeight = pu.cu->slice->getRefPic( REF_PIC_LIST_0, pu.refIdx[0] )->getPicHeightInLumaSamples();
    
    
        samePicSize = refPicWidth == curPicWidth && refPicHeight == curPicHeight;
      }
    
      if( pu.refIdx[1] >= 0 )
      {
    
    Brian Heng's avatar
    Brian Heng committed
        int refPicWidth = pu.cu->slice->getRefPic( REF_PIC_LIST_1, pu.refIdx[1] )->getPicWidthInLumaSamples();
        int refPicHeight = pu.cu->slice->getRefPic( REF_PIC_LIST_1, pu.refIdx[1] )->getPicHeightInLumaSamples();
    
    
        samePicSize = samePicSize && ( refPicWidth == curPicWidth && refPicHeight == curPicHeight );
      }
    
      return samePicSize;
    }