Skip to content
Snippets Groups Projects
IntraPrediction.cpp 71.6 KiB
Newer Older
  • Learn to ignore specific revisions
  •   run = 0;
      while (idx < total)
    
    Yung-Hsuan Chao (Jessie)'s avatar
    Yung-Hsuan Chao (Jessie) committed
        xPos = m_scanOrder[idx].x;
        yPos = m_scanOrder[idx].y;
    
        runType.at(xPos, yPos) = PLT_RUN_COPY;
    
        if (yPos == 0 && !cu.useRotation[compBegin])
    
        if (xPos == 0 && cu.useRotation[compBegin])
    
        if (!cu.useRotation[compBegin] && curPLTIdx.at(xPos, yPos) == curPLTIdx.at(xPos, yPos - 1))
    
        else if (cu.useRotation[compBegin] && curPLTIdx.at(xPos, yPos) == curPLTIdx.at(xPos - 1, yPos))
    
    bool IntraPrediction::calIndexRun(CodingStructure &cs, Partitioner& partitioner, uint32_t startPos, uint32_t total, uint32_t &run, ComponentID compBegin)
    
      TransformUnit &tu = *cs.getTU(partitioner.chType);
    
      PelBuf     curPLTIdx = tu.getcurPLTIdx(compBegin);
      PLTtypeBuf runType   = tu.getrunType(compBegin);
    
      run = 1;
      uint32_t idx = startPos;
      while (idx < total)
    
    Yung-Hsuan Chao (Jessie)'s avatar
    Yung-Hsuan Chao (Jessie) committed
        uint32_t xPos = m_scanOrder[idx].x;
        uint32_t yPos = m_scanOrder[idx].y;
    
        runType.at(xPos, yPos) = PLT_RUN_INDEX;
    
    Yung-Hsuan Chao (Jessie)'s avatar
    Yung-Hsuan Chao (Jessie) committed
        uint32_t xPrev = idx == 0 ? 0 : m_scanOrder[idx - 1].x;
        uint32_t yPrev = idx == 0 ? 0 : m_scanOrder[idx - 1].y;
    
        if (idx > startPos && curPLTIdx.at(xPos, yPos) == curPLTIdx.at(xPrev, yPrev))
    
        else if (idx > startPos)
    
    void IntraPrediction::reorderPLT(CodingStructure& cs, Partitioner& partitioner, ComponentID compBegin, uint32_t numComp)
    
      CodingUnit &cu = *cs.getCU(partitioner.chType);
    
    
      uint8_t        reusePLTSizetmp = 0;
      uint8_t        pltSizetmp = 0;
    
      Pel            curPLTtmp[MAX_NUM_COMPONENT][MAXPLTSIZE];
      bool           curPLTpred[MAXPLTPREDSIZE];
    
      for (int idx = 0; idx < MAXPLTPREDSIZE; idx++)
      {
        curPLTpred[idx] = false;
        cu.reuseflag[compBegin][idx] = false;
      }
      for (int idx = 0; idx < MAXPLTSIZE; idx++)
      {
        curPLTpred[idx] = false;
      }
    
      for (int predidx = 0; predidx < cs.prevPLT.curPLTSize[compBegin]; predidx++)
      {
        bool match = false;
        int curidx = 0;
    
        for (curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++)
        {
          bool matchTmp = true;
          for (int comp = compBegin; comp < (compBegin + numComp); comp++)
          {
            matchTmp = matchTmp && (cu.curPLT[comp][curidx] == cs.prevPLT.curPLT[comp][predidx]);
          }
          if (matchTmp)
          {
            match = true;
            break;
          }
        }
    
        if (match)
        {
          cu.reuseflag[compBegin][predidx] = true;
          curPLTpred[curidx] = true;
          for (int comp = compBegin; comp < (compBegin + numComp); comp++)
          {
            curPLTtmp[comp][reusePLTSizetmp] = cs.prevPLT.curPLT[comp][predidx];
          }
          reusePLTSizetmp++;
    
        }
      }
      cu.reusePLTSize[compBegin] = reusePLTSizetmp;
      for (int curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++)
      {
        if (!curPLTpred[curidx])
        {
          for (int comp = compBegin; comp < (compBegin + numComp); comp++)
          {
    
            curPLTtmp[comp][pltSizetmp] = cu.curPLT[comp][curidx];
    
      assert(pltSizetmp == cu.curPLTSize[compBegin]);
    
      for (int curidx = 0; curidx < cu.curPLTSize[compBegin]; curidx++)
      {
        for (int comp = compBegin; comp < (compBegin + numComp); comp++)
        {
          cu.curPLT[comp][curidx] = curPLTtmp[comp][curidx];
        }
      }