Commit 819ed817 authored by Xiaozhong Xu's avatar Xiaozhong Xu Committed by Xiang Li

add back accidentally changed Cmake files

parent 06f53581
......@@ -26,11 +26,6 @@ add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} ${CMAKE_CU
# include the output directory, where the svnrevision.h file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
target_compile_definitions( ${EXE_NAME} PUBLIC RExt__DECODER_DEBUG_BIT_STATISTICS=1 )
target_compile_definitions( ${EXE_NAME} PUBLIC RExt__DECODER_DEBUG_TOOL_STATISTICS=1 )
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
......@@ -65,7 +60,7 @@ if( CMAKE_COMPILER_IS_GNUCC AND BUILD_STATIC )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_WPP_STATIC_LINK=1 )
endif()
target_link_libraries( ${EXE_NAME} CommonAnalyserLib DecoderAnalyserLib Utilities Threads::Threads ${ADDITIONAL_LIBS} )
target_link_libraries( ${EXE_NAME} CommonLib DecoderAnalyserLib Utilities Threads::Threads ${ADDITIONAL_LIBS} )
# Add a SVN revision generator
# a custom target that is always built
......
......@@ -26,10 +26,6 @@ add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} ${CMAKE_CU
# include the output directory, where the svnrevision.h file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
......
......@@ -28,10 +28,6 @@ add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} ${CMAKE_CU
# include the output directory, where the svnrevision.h file is generated
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_TRACING=1 )
......
......@@ -44,10 +44,6 @@ set( INC_FILES ${BASE_INC_FILES} ${X86_INC_FILES} ${MD5_INC_FILES} )
# library
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......
......@@ -107,10 +107,6 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
if( isIntra && intraModeC == DM_CHROMA_IDX ) intraModeC = 36;
else if( isIntra ) intraModeC = g_intraMode65to33AngMapping[intraModeC];
#endif
#endif
int imvVal = 0;
#if JVET_K0357_AMVR
imvVal = cs.cus[0]->imv;
#endif
#if JEM_TOOLS
DTRACE( g_trace_ctx, D_MODE_COST, "ModeCost: %6lld %3d @(%4d,%4d) [%2dx%2d] %d (qp%d,pm%d,ptSize%d,skip%d,mrg%d,fruc%d,obmc%d,ic%d,imv%d,affn%d,%d,%d) tempCS = %lld (%d,%d)\n",
......@@ -127,7 +123,11 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
cs.pus[0]->frucMrgMode,
cs.cus[0]->obmcFlag,
cs.cus[0]->LICFlag,
imvVal,
#if JVET_K0357_AMVR
cs.cus[0]->imv,
#else
0,
#endif
cs.cus[0]->affine,
intraModeL, intraModeC,
tempCost, tempBits, tempDist );
......@@ -144,7 +144,11 @@ inline void dtraceModeCost(CodingStructure &cs, double lambda)
cs.cus[0]->skip,
cs.pus[0]->mergeFlag,
0, 0,
imvVal,
#if JVET_K0357_AMVR
cs.cus[0]->imv,
#else
0,
#endif
0, 0,
intraModeL, intraModeC,
tempCost, tempBits, tempDist );
......
......@@ -15,11 +15,6 @@ endif()
# library
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC RExt__DECODER_DEBUG_BIT_STATISTICS=1 )
target_compile_definitions( ${LIB_NAME} PUBLIC RExt__DECODER_DEBUG_TOOL_STATISTICS=1 )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
......@@ -54,7 +49,7 @@ else()
endif()
target_include_directories( ${LIB_NAME} PUBLIC ../DecoderLib )
target_link_libraries( ${LIB_NAME} CommonAnalyserLib Threads::Threads )
target_link_libraries( ${LIB_NAME} CommonLib Threads::Threads )
# example: place header files in different folders
source_group( "Natvis Files" FILES ${NATVIS_FILES} )
......
......@@ -16,10 +16,6 @@ endif()
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......
......@@ -443,7 +443,7 @@ public:
}
void printSummary(const ChromaFormat chFmt, const bool printSequenceMSE, const BitDepths &bitDepths, const std::string &sFilename)
void printSummary(const ChromaFormat chFmt, const bool printSequenceMSE, const bool printHexPsnr, const BitDepths &bitDepths, const std::string &sFilename)
{
FILE* pFile = fopen (sFilename.c_str(), "at");
......
......@@ -7,6 +7,8 @@ file( GLOB SRC_FILES "*.cpp" )
# get include files
file( GLOB INC_FILES "*.h" )
file( GLOB SSE41_SRC_FILES "IbcHashMap.cpp" )
# NATVIS files for Visual Studio
if( MSVC )
file( GLOB NATVIS_FILES "../../VisualStudio/*.natvis" )
......@@ -16,10 +18,6 @@ endif()
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......@@ -55,6 +53,10 @@ endif()
target_include_directories( ${LIB_NAME} PUBLIC . )
target_link_libraries( ${LIB_NAME} CommonLib Threads::Threads )
if( UNIX )
set_property( SOURCE ${SSE41_SRC_FILES} APPEND PROPERTY COMPILE_FLAGS "-msse4" )
endif()
if( CMAKE_COMPILER_IS_GNUCC )
# this is quite certainly a compiler problem
set_property( SOURCE "EncCu.cpp" APPEND PROPERTY COMPILE_FLAGS "-Wno-array-bounds" )
......
......@@ -58,6 +58,9 @@
#include "InterSearch.h"
#include "RateCtrl.h"
#include "EncModeCtrl.h"
#if JVET_K0076_CPR
#include "IbcHashMap.h"
#endif
//! \ingroup EncoderLib
//! \{
......
......@@ -2801,7 +2801,7 @@ void EncGOP::compressGOP( int iPOCLast, int iNumPicRcvd, PicList& rcListPic,
}
void EncGOP::printOutSummary(uint32_t uiNumAllPicCoded, bool isField, const bool printMSEBasedSNR, const bool printSequenceMSE, const BitDepths &bitDepths)
void EncGOP::printOutSummary(uint32_t uiNumAllPicCoded, bool isField, const bool printMSEBasedSNR, const bool printSequenceMSE, const bool printHexPsnr, const BitDepths &bitDepths)
{
#if ENABLE_QPA
const bool useWPSNR = m_pcEncLib->getUseWPSNR();
......@@ -2836,16 +2836,16 @@ void EncGOP::printOutSummary(uint32_t uiNumAllPicCoded, bool isField, const bool
#if ENABLE_QPA
m_gcAnalyzeAll.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths, useWPSNR);
#else
m_gcAnalyzeAll.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
m_gcAnalyzeAll.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, printHexPsnr, bitDepths);
#endif
msg( DETAILS,"\n\nI Slices--------------------------------------------------------\n" );
m_gcAnalyzeI.printOut('i', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
m_gcAnalyzeI.printOut('i', chFmt, printMSEBasedSNR, printSequenceMSE, printHexPsnr, bitDepths);
msg( DETAILS,"\n\nP Slices--------------------------------------------------------\n" );
m_gcAnalyzeP.printOut('p', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
m_gcAnalyzeP.printOut('p', chFmt, printMSEBasedSNR, printSequenceMSE, printHexPsnr, bitDepths);
msg( DETAILS,"\n\nB Slices--------------------------------------------------------\n" );
m_gcAnalyzeB.printOut('b', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
m_gcAnalyzeB.printOut('b', chFmt, printMSEBasedSNR, printSequenceMSE, printHexPsnr, bitDepths);
#if WCG_WPSNR
if (useLumaWPSNR)
......@@ -2856,14 +2856,14 @@ void EncGOP::printOutSummary(uint32_t uiNumAllPicCoded, bool isField, const bool
#endif
if (!m_pcCfg->getSummaryOutFilename().empty())
{
m_gcAnalyzeAll.printSummary(chFmt, printSequenceMSE, bitDepths, m_pcCfg->getSummaryOutFilename());
m_gcAnalyzeAll.printSummary(chFmt, printSequenceMSE, printHexPsnr, bitDepths, m_pcCfg->getSummaryOutFilename());
}
if (!m_pcCfg->getSummaryPicFilenameBase().empty())
{
m_gcAnalyzeI.printSummary(chFmt, printSequenceMSE, bitDepths, m_pcCfg->getSummaryPicFilenameBase()+"I.txt");
m_gcAnalyzeP.printSummary(chFmt, printSequenceMSE, bitDepths, m_pcCfg->getSummaryPicFilenameBase()+"P.txt");
m_gcAnalyzeB.printSummary(chFmt, printSequenceMSE, bitDepths, m_pcCfg->getSummaryPicFilenameBase()+"B.txt");
m_gcAnalyzeI.printSummary(chFmt, printSequenceMSE, printHexPsnr, bitDepths, m_pcCfg->getSummaryPicFilenameBase()+"I.txt");
m_gcAnalyzeP.printSummary(chFmt, printSequenceMSE, printHexPsnr, bitDepths, m_pcCfg->getSummaryPicFilenameBase()+"P.txt");
m_gcAnalyzeB.printSummary(chFmt, printSequenceMSE, printHexPsnr, bitDepths, m_pcCfg->getSummaryPicFilenameBase()+"B.txt");
}
#if WCG_WPSNR
......@@ -2883,11 +2883,11 @@ void EncGOP::printOutSummary(uint32_t uiNumAllPicCoded, bool isField, const bool
#if ENABLE_QPA
m_gcAnalyzeAll_in.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths, useWPSNR);
#else
m_gcAnalyzeAll_in.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, bitDepths);
m_gcAnalyzeAll_in.printOut('a', chFmt, printMSEBasedSNR, printSequenceMSE, printHexPsnr, bitDepths);
#endif
if (!m_pcCfg->getSummaryOutFilename().empty())
{
m_gcAnalyzeAll_in.printSummary(chFmt, printSequenceMSE, bitDepths, m_pcCfg->getSummaryOutFilename());
m_gcAnalyzeAll_in.printSummary(chFmt, printSequenceMSE, printHexPsnr, bitDepths, m_pcCfg->getSummaryOutFilename());
#if WCG_WPSNR
if (useLumaWPSNR)
{
......
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2017, ITU/ISO/IEC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file IbcHashMap.cpp
\brief IBC hash map encoder class
*/
#include "CommonLib/dtrace_codingstruct.h"
#include "CommonLib/Picture.h"
#include "CommonLib/UnitTools.h"
#include "IbcHashMap.h"
#include <nmmintrin.h>
using namespace std;
//! \ingroup IbcHashMap
//! \{
// ====================================================================================================================
// Constructor / destructor / create / destroy
// ====================================================================================================================
IbcHashMap::IbcHashMap()
{
m_picWidth = 0;
m_picHeight = 0;
m_pos2Hash = NULL;
}
IbcHashMap::~IbcHashMap()
{
destroy();
}
void IbcHashMap::init(const int picWidth, const int picHeight)
{
if (picWidth != m_picWidth || picHeight != m_picHeight)
{
destroy();
}
m_picWidth = picWidth;
m_picHeight = picHeight;
m_pos2Hash = new unsigned int*[m_picHeight];
m_pos2Hash[0] = new unsigned int[m_picWidth * m_picHeight];
for (int n = 1; n < m_picHeight; n++)
{
m_pos2Hash[n] = m_pos2Hash[n - 1] + m_picWidth;
}
}
void IbcHashMap::destroy()
{
if (m_pos2Hash != NULL)
{
if (m_pos2Hash[0] != NULL)
{
delete[] m_pos2Hash[0];
}
delete[] m_pos2Hash;
}
m_pos2Hash = NULL;
}
template<int maskBit>
unsigned int IbcHashMap::xxCalcBlockHash(const Pel* pel, const int stride, const int width, const int height, unsigned int crc)
{
for (int y = 0; y < height; y++)
{
for (int x = 0; x < width; x++)
{
crc = _mm_crc32_u16(crc, pel[x] >> maskBit);
}
pel += stride;
}
return crc;
}
template<ChromaFormat chromaFormat, int maskBit>
void IbcHashMap::xxBuildPicHashMap(const PelUnitBuf& pic)
{
const int chromaScalingX = getChannelTypeScaleX(CHANNEL_TYPE_CHROMA, chromaFormat);
const int chromaScalingY = getChannelTypeScaleY(CHANNEL_TYPE_CHROMA, chromaFormat);
const int chromaMinBlkWidth = MIN_PU_SIZE >> chromaScalingX;
const int chromaMinBlkHeight = MIN_PU_SIZE >> chromaScalingY;
const Pel* pelY = NULL;
const Pel* pelCb = NULL;
const Pel* pelCr = NULL;
Position pos;
for (pos.y = 0; pos.y + MIN_PU_SIZE <= pic.Y().height; pos.y++)
{
// row pointer
pelY = pic.Y().bufAt(0, pos.y);
if (chromaFormat != CHROMA_400)
{
int chromaY = pos.y >> chromaScalingY;
pelCb = pic.Cb().bufAt(0, chromaY);
pelCr = pic.Cr().bufAt(0, chromaY);
}
for (pos.x = 0; pos.x + MIN_PU_SIZE <= pic.Y().width; pos.x++)
{
// 0x1FF is just an initial value
unsigned int hashValue = 0x1FF;
// luma part
hashValue = xxCalcBlockHash<maskBit>(&pelY[pos.x], pic.Y().stride, MIN_PU_SIZE, MIN_PU_SIZE, hashValue);
// chroma part
if (chromaFormat != CHROMA_400)
{
int chromaX = pos.x >> chromaScalingX;
hashValue = xxCalcBlockHash<maskBit>(&pelCb[chromaX], pic.Cb().stride, chromaMinBlkWidth, chromaMinBlkHeight, hashValue);
hashValue = xxCalcBlockHash<maskBit>(&pelCr[chromaX], pic.Cr().stride, chromaMinBlkWidth, chromaMinBlkHeight, hashValue);
}
// hash table
m_hash2Pos[hashValue].push_back(pos);
m_pos2Hash[pos.y][pos.x] = hashValue;
}
}
}
void IbcHashMap::rebuildPicHashMap(const PelUnitBuf& pic)
{
m_hash2Pos.clear();
switch (pic.chromaFormat)
{
case CHROMA_400:
xxBuildPicHashMap<CHROMA_400, 0>(pic);
break;
case CHROMA_420:
xxBuildPicHashMap<CHROMA_420, 0>(pic);
break;
case CHROMA_422:
xxBuildPicHashMap<CHROMA_422, 0>(pic);
break;
case CHROMA_444:
xxBuildPicHashMap<CHROMA_444, 0>(pic);
break;
default:
THROW("invalid chroma fomat");
break;
}
}
bool IbcHashMap::ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk)
{
cand.clear();
// find the block with least candidates
size_t minSize = MAX_UINT;
unsigned int targetHashOneBlock = 0;
for (SizeType y = 0; y < lumaArea.height && minSize > 1; y += MIN_PU_SIZE)
{
for (SizeType x = 0; x < lumaArea.width && minSize > 1; x += MIN_PU_SIZE)
{
unsigned int hash = m_pos2Hash[lumaArea.pos().y + y][lumaArea.pos().x + x];
if (m_hash2Pos[hash].size() < minSize)
{
minSize = m_hash2Pos[hash].size();
targetHashOneBlock = hash;
}
}
}
if (m_hash2Pos[targetHashOneBlock].size() > 1)
{
std::vector<Position>& candOneBlock = m_hash2Pos[targetHashOneBlock];
// check whether whole block match
for (std::vector<Position>::iterator refBlockPos = candOneBlock.begin(); refBlockPos != candOneBlock.end(); refBlockPos++)
{
Position bottomRight = refBlockPos->offset(lumaArea.width - 1, lumaArea.height - 1);
bool wholeBlockMatch = true;
if (lumaArea.width > MIN_PU_SIZE || lumaArea.height > MIN_PU_SIZE)
{
#if JVET_K0076_CPR
if (!cs.isDecomp(bottomRight, cs.chType) || bottomRight.x >= m_picWidth || bottomRight.y >= m_picHeight)
#else
if (!cs.isDecomp(bottomRight, CHANNEL_TYPE_LUMA) || bottomRight.x >= m_picWidth || bottomRight.y >= m_picHeight)
#endif
{
continue;
}
for (SizeType y = 0; y < lumaArea.height && wholeBlockMatch; y += MIN_PU_SIZE)
{
for (SizeType x = 0; x < lumaArea.width && wholeBlockMatch; x += MIN_PU_SIZE)
{
// whether the reference block and current block has the same hash
wholeBlockMatch &= (m_pos2Hash[lumaArea.pos().y + y][lumaArea.pos().x + x] == m_pos2Hash[refBlockPos->y + y][refBlockPos->x + x]);
}
}
}
else
{
#if JVET_K0076_CPR
if (abs(refBlockPos->x - lumaArea.x) > searchRange4SmallBlk || abs(refBlockPos->y - lumaArea.y) > searchRange4SmallBlk || !cs.isDecomp(bottomRight, cs.chType))
#else
if (abs(refBlockPos->x - lumaArea.x) > searchRange4SmallBlk || abs(refBlockPos->y - lumaArea.y) > searchRange4SmallBlk || !cs.isDecomp(bottomRight, CHANNEL_TYPE_LUMA))
#endif
{
continue;
}
}
if (wholeBlockMatch)
{
cand.push_back(*refBlockPos);
if (cand.size() > maxCand)
{
break;
}
}
}
}
return cand.size() > 0;
}
int IbcHashMap::getHashHitRatio(const Area& lumaArea)
{
int maxX = std::min((int)(lumaArea.x + lumaArea.width), m_picWidth);
int maxY = std::min((int)(lumaArea.y + lumaArea.height), m_picHeight);
int hit = 0, total = 0;
for (int y = lumaArea.y; y < maxY; y += MIN_PU_SIZE)
{
for (int x = lumaArea.x; x < maxX; x += MIN_PU_SIZE)
{
const unsigned int hash = m_pos2Hash[y][x];
hit += (m_hash2Pos[hash].size() > 1);
total++;
}
}
return 100 * hit / total;
}
//! \}
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2017, ITU/ISO/IEC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * Neither the name of the ITU/ISO/IEC nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
/** \file IbcHashMap.h
\brief IBC hash map encoder class (header)
*/
#ifndef __IBCHASHMAP__
#define __IBCHASHMAP__
// Include files
#include "CommonLib/CommonDef.h"
#include "CommonLib/IntraPrediction.h"
#include "CommonLib/InterPrediction.h"
#include "CommonLib/TrQuant.h"
#include "CommonLib/Unit.h"
#include "CommonLib/UnitPartitioner.h"
#include <unordered_map>
#include <vector>
//! \ingroup EncoderLib
//! \{
// ====================================================================================================================
// Class definition
// ====================================================================================================================
class IbcHashMap
{
private:
int m_picWidth;
int m_picHeight;
unsigned int** m_pos2Hash;
std::unordered_map<unsigned int, std::vector<Position>> m_hash2Pos;
template<int maskBit>
unsigned int xxCalcBlockHash(const Pel* pel, const int stride, const int width, const int height, unsigned int crc);
template<ChromaFormat chromaFormat, int maskBit>
void xxBuildPicHashMap(const PelUnitBuf& pic);
public:
IbcHashMap();
virtual ~IbcHashMap();
void init(const int picWidth, const int picHeight);
void destroy();
void rebuildPicHashMap(const PelUnitBuf& pic);
bool ibcHashMatch(const Area& lumaArea, std::vector<Position>& cand, const CodingStructure& cs, const int maxCand, const int searchRange4SmallBlk);
int getHashHitRatio(const Area& lumaArea);
};
//! \}
#endif // __IBCHASHMAP__
......@@ -1599,7 +1599,7 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp
m_pcTrQuant->selectLambda(compID);
#endif
#if JEM_TOOLS&&!JVET_K0190
#if JEM_TOOLS||JVET_K0190
if( ! PU::isLMCMode(uiChFinalMode) && sps.getSpsNext().getUseLMChroma() )
{
if( compID == COMPONENT_Cb )
......
......@@ -1300,7 +1300,11 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
if( pcSlice->getSliceType() != I_SLICE &&
#if JVET_K0076_CPR
( ( pcSlice->getColFromL0Flag() == 1 && pcSlice->getNumRefIdx(REF_PIC_LIST_0) > 1 + (int)pcSlice->getSPS()->getSpsNext().getIBCMode()) ||
#else
( ( pcSlice->getColFromL0Flag() == 1 && pcSlice->getNumRefIdx( REF_PIC_LIST_0 ) > 1 ) ||
#endif
( pcSlice->getColFromL0Flag() == 0 && pcSlice->getNumRefIdx( REF_PIC_LIST_1 ) > 1 ) ) )
{
WRITE_UVLC( pcSlice->getColRefIdx(), "collocated_ref_idx" );
......
......@@ -16,10 +16,6 @@ endif()
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC JEM_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment