Ticket #521: ticket-pltqp.patch

File ticket-pltqp.patch, 1.0 KB (added by gordon, 2 months ago)
  • source/Lib/EncoderLib/IntraSearch.cpp

    diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp
    index b9047f9..f526589 100644
    a b void IntraSearch::preCalcPLTIndex(CodingStructure& cs, Partitioner& partitioner, 
    20302030  }
    20312031
    20322032  PelBuf   curPLTIdx = tu.getcurPLTIdx(compBegin);
    2033   int      errorLimit = numComp * g_paletteQuant[cu.qp];
     2033  int      errorLimit = numComp * g_paletteQuant[cu.qp < 0 ? 0 : cu.qp];
    20342034  uint32_t bestIdx = 0;
    20352035  uint32_t scaleX = getComponentScaleX(COMPONENT_Cb, cs.sps->getChromaFormatIdc());
    20362036  uint32_t scaleY = getComponentScaleY(COMPONENT_Cb, cs.sps->getChromaFormatIdc());
    void IntraSearch::derivePLTLossy(CodingStructure& cs, Partitioner& partitioner, 
    21672167    }
    21682168  }
    21692169
    2170   int errorLimit = g_paletteQuant[cu.qp];
     2170  int errorLimit = g_paletteQuant[cu.qp < 0 ? 0 : cu.qp];
    21712171  uint32_t totalSize = height*width;
    21722172  SortingElement *pelList = new SortingElement[totalSize];
    21732173  SortingElement  element;