Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jvet/VVCSoftware_VTM
  • chenhuanbang/VVCSoftware_VTM
  • ezhizng/VVCSoftware_VTM
  • XZheng/VVCSoftware_VTM
  • YanZhang/VVCSoftware_VTM
  • xiaozhongxu/VVCSoftware_VTM
  • bossen/VVCSoftware_VTM
  • XiangLi/VVCSoftware_VTM
  • s.iwamura/VVCSoftware_VTM
  • yuling.hsiao/VVCSoftware_VTM
  • ccc2384823/VVCSoftware_VTM
  • yuchisu/VVCSoftware_VTM
  • schwarz/VVCSoftware_VTM
  • philippe.hanhart/VVCSoftware_VTM
  • nanh/VVCSoftware_VTM
  • guillaume.laroche/VVCSoftware_VTM
  • Kenneth/VVCSoftware_VTM
  • jonatan/VVCSoftware_VTM
  • Alexey/VVCSoftware_VTM
  • saintspear/VVCSoftware_VTM
  • xinzhao/VVCSoftware_VTM
  • Seungsoo/VVCSoftware_VTM
  • jamesxxiu/VVCSoftware_VTM
  • leolzhao/VVCSoftware_VTM
  • ywchen/VVCSoftware_VTM
  • kevin625/VVCSoftware_VTM
  • Zhang/VVCSoftware_VTM
  • zhangkai/VVCSoftware_VTM
  • YCSun/VVCSoftware_VTM
  • ksuehring/VVCSoftware_VTM
  • AbeKiyo/VVCSoftware_VTM
  • naeri.park/VVCSoftware_VTM
  • ling/VVCSoftware_VTM
  • aikiho/VVCSoftware_VTM
  • JangwonChoi/VVCSoftware_VTM
  • Shelly/VVCSoftware_VTM
  • blaeser/VVCSoftware_VTM
  • crhelmrich/VVCSoftware_VTM
  • keydel/VVCSoftware_VTM
  • adam_wieckowski/VVCSoftware_VTM
  • hashimry/VVCSoftware_VTM
  • yimingli/VVCSoftware_VTM
  • zhipin/VVCSoftware_VTM
  • chernyak/VVCSoftware_VTM
  • jvet-l-ahg-14/VVCSoftware_VTM
  • sauer/VVCSoftware_VTM
  • fbarbier/VVCSoftware_VTM
  • misrak/VVCSoftware_VTM
  • ikai/VVCSoftware_VTM
  • tlu/VVCSoftware_VTM
  • Yasugi/VVCSoftware_VTM
  • peterchuang/VVCSoftware_VTM
  • wanght99/VVCSoftware_VTM
  • yuhan/VVCSoftware_VTM
  • hongbin/VVCSoftware_VTM
  • jiahaoli/VVCSoftware_VTM
  • cfd/VVCSoftware_VTM
  • ruoyangyu/VVCSoftware_VTM
  • chujoh/VVCSoftware_VTM
  • lijingya/VVCSoftware_VTM
  • hinz/VVCSoftware_VTM
  • tamse.anish/VVCSoftware_VTM
  • mcoban/VVCSoftware_VTM
  • george/VVCSoftware_VTM
  • jeeva.raj/VVCSoftware_VTM
  • antoine/VVCSoftware_VTM
  • moonmo.koo/VVCSoftware_VTM
  • deluxan/VVCSoftware_VTM
  • bheng/VVCSoftware_VTM
  • lzz8246/VVCSoftware_VTM
  • delagrangep/VVCSoftware_VTM
  • jiechen/VVCSoftware_VTM
  • hendry197/VVCSoftware_VTM
  • LGE_VCC/VVCSoftware_VTM
  • asegall/VVCSoftware_VTM
  • pbcowan/VVCSoftware_VTM
  • forayr/VVCSoftware_VTM
  • JT/VVCSoftware_VTM
  • Zhou/VVCSoftware_VTM
  • yjpiao/VVCSoftware_VTM
  • fabrice.leleannec/VVCSoftware_VTM
  • tpoirier/VVCSoftware_VTM
  • PoHan.Lin/VVCSoftware_VTM
  • jzxu/VVCSoftware_VTM
  • junghak.nam/VVCSoftware_VTM
  • guichunli/VVCSoftware_VTM
  • xianglinwang/VVCSoftware_VTM
  • chunchic/VVCSoftware_VTM
  • chrisr12/VVCSoftware_VTM
  • ks_kashyap/VVCSoftware_VTM
  • minhua/VVCSoftware_VTM
  • Sheng-Yen.Lin/VVCSoftware_VTM
  • hegilmez/VVCSoftware_VTM
  • swongah/VVCSoftware_VTM
  • merkle/VVCSoftware_VTM
  • sunyucheng/VVCSoftware_VTM
  • kirchhoffer/VVCSoftware_VTM
  • vdrugeon/VVCSoftware_VTM
  • jennylai/VVCSoftware_VTM
  • rickxu/VVCSoftware_VTM
  • seuhong/VVCSoftware_VTM
  • chollmann/VVCSoftware_VTM
  • jvet-n-ce8-public/VVCSoftware_VTM
  • martin.m.pettersson/VVCSoftware_VTM
  • siekmann/VVCSoftware_VTM
  • aramasub/VVCSoftware_VTM
  • zhiyilin/VVCSoftware_VTM
  • EricLin/VVCSoftware_VTM
  • mengwang/VVCSoftware_VTM
  • m.sarwer/VVCSoftware_VTM
  • agnesedong/VVCSoftware_VTM
  • geonjungko/VVCSoftware_VTM
  • bray/VVCSoftware_VTM
  • yhchao/VVCSoftware_VTM
  • Zhu/VVCSoftware_VTM
  • ykato/VVCSoftware_VTM
  • ZhipinDeng/VVCSoftware_VTM
  • jasonjung/VVCSoftware_VTM
  • hanhuang/VVCSoftware_VTM
  • seregin/VVCSoftware_VTM
  • wchen1014/VVCSoftware_VTM
  • Auyeung/VVCSoftware_VTM
  • Morris/VVCSoftware_VTM
  • lphamvan/VVCSoftware_VTM
  • dmehlem/VVCSoftware_VTM
  • shih-ta.hsiang/VVCSoftware_VTM
  • ysanchez/VVCSoftware_VTM
  • baegn74/VVCSoftware_VTM
  • kazui/VVCSoftware_VTM
  • yuwenhe_vvc/VVCSoftware_VTM
  • rickard/VVCSoftware_VTM
  • wangyang.cs/VVCSoftware_VTM
  • xwmeng/VVCSoftware_VTM
  • takeshi.tsukuba/VVCSoftware_VTM
  • yixindu/VVCSoftware_VTM
  • baixiu.wz/VVCSoftware_VTM
  • hm.jang/VVCSoftware_VTM
  • Ted/VVCSoftware_VTM
  • nguyen/VVCSoftware_VTM
  • chaohsiu/VVCSoftware_VTM
  • francoise/VVCSoftware_VTM
  • Yin/VVCSoftware_VTM
  • Morigami/VVCSoftware_VTM
  • sagar.kotecha/VVCSoftware_VTM
  • hwsun/VVCSoftware_VTM
  • pierrick.bouvier/VVCSoftware_VTM
  • XiangMa/VVCSoftware_VTM
  • LouiseLee/VVCSoftware_VTM
  • chenps/VVCSoftware_VTM
  • karls/VVCSoftware_VTM
  • biaowang/VVCSoftware_VTM
  • hangao/VVCSoftware_VTM
  • Jin/VVCSoftware_VTM
  • analci/VVCSoftware_VTM
  • KuiFan/VVCSoftware_VTM
  • hobingzhang/VVCSoftware_VTM
  • audrey.turquin/VVCSoftware_VTM
  • rlliao/VVCSoftware_VTM
  • winken/VVCSoftware_VTM
  • hallapur/VVCSoftware_VTM
  • T.Hashimoto/VVCSoftware_VTM
  • AnandMeher/VVCSoftware_VTM
  • semihese/VVCSoftware_VTM
  • ouedraogo/VVCSoftware_VTM
  • arthurcerveira/VVCSoftware_VTM
  • sunmi.yoo/VVCSoftware_VTM
  • Cynthia/VVCSoftware_VTM
  • yang/VVCSoftware_VTM
  • yuyoon/VVCSoftware_VTM
  • jslee/VVCSoftware_VTM
  • weimin.zeng/VVCSoftware_VTM
  • edrthomas/VVCSoftware_VTM
  • Mitsuru.Katsumata/VVCSoftware_VTM
  • adybrowne/VVCSoftware_VTM
  • jack.enhorn/VVCSoftware_VTM
  • Palanivel/VVCSoftware_VTM
  • olena.chubach/VVCSoftware_VTM
  • juvenalluo/VVCSoftware_VTM
  • yylee/VVCSoftware_VTM
  • bross/VVCSoftware_VTM
  • jvet-ahg-nnvc/VVCSoftware_VTM
  • jacob/VVCSoftware_VTM
  • dmytro.rusanovskyy/VVCSoftware_VTM
  • karamnaser/VVCSoftware_VTM
  • milos.radosavljevic/VVCSoftware_VTM
  • Keming/VVCSoftware_VTM
  • pj/VVCSoftware_VTM
  • cwkuo/VVCSoftware_VTM
  • BD/VVCSoftware_VTM
  • bartnik/VVCSoftware_VTM
  • Fangjun.Pu/VVCSoftware_VTM
  • nikolay.shostak/VVCSoftware_VTM
  • kirill.suverov/VVCSoftware_VTM
  • Xile_Zhou/VVCSoftware_VTM
  • ksuehring/vvc-software-vtm-nnvc
  • guether/VVCSoftware_VTM
  • salmonc/VVCSoftware_VTM
  • eeehey/VVCSoftware_VTM
  • marie-pierre.gallasso/VVCSoftware_VTM
  • jvet-ahg-fgt/VTM
  • liaojq/VVCSoftware_VTM
  • axel.ricard/VVCSoftware_VTM
  • XiangLi/nnvc
  • sw.xie/VVCSoftware_VTM
  • jeeva.raj/vvc-software-vtm-tu-c
  • XiangLi/tu-c
  • msantamaria/nnvc
  • cjj490168650/VVCSoftware_VTM
  • Yun_li/VVCSoftware_VTM
  • Zhengang/vvc-software-vtm
  • lvzhuoyi/vvc-software-vtm-nnvc
  • Kenneth/vvc-software-vtm-nn
  • biatekt/vvc-software-vtm
  • jvet-ahg-gcc/VVCSoftware_VTM
  • JINGYING/VVCSoftware_VTM
  • furban/VVCSoftware_VTM
  • yanning/VVCSoftware_VTM
  • zhuochen/VVCSoftware_VTM
  • Kaifa/VVCSoftware_VTM_AJ0048
  • yueli/VVCSoftware_VTM
  • tokumo/VVCSoftware_VTM
221 results
Show changes
Commits on Source (10)
...@@ -457,7 +457,7 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId ) ...@@ -457,7 +457,7 @@ void DecApp::xWriteOutput( PicList* pcListPic, uint32_t tId )
if (!m_reconFileName.empty()) if (!m_reconFileName.empty())
{ {
const Window &conf = pcPic->cs->pps->getConformanceWindow(); const Window &conf = pcPic->getConformanceWindow();
const SPS* sps = pcPic->cs->sps; const SPS* sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc(); ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
if( m_upscaledOutput ) if( m_upscaledOutput )
...@@ -581,7 +581,7 @@ void DecApp::xFlushOutput( PicList* pcListPic ) ...@@ -581,7 +581,7 @@ void DecApp::xFlushOutput( PicList* pcListPic )
if (!m_reconFileName.empty()) if (!m_reconFileName.empty())
{ {
const Window &conf = pcPic->cs->pps->getConformanceWindow(); const Window &conf = pcPic->getConformanceWindow();
const SPS* sps = pcPic->cs->sps; const SPS* sps = pcPic->cs->sps;
ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc(); ChromaFormat chromaFormatIDC = sps->getChromaFormatIdc();
if( m_upscaledOutput ) if( m_upscaledOutput )
......
...@@ -860,7 +860,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio ...@@ -860,7 +860,7 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID, const Predictio
enablePROF &= !subblkMVSpreadOverLimit; enablePROF &= !subblkMVSpreadOverLimit;
const int profThres = 1 << (iBit + (m_isBi ? 1 : 0)); const int profThres = 1 << (iBit + (m_isBi ? 1 : 0));
enablePROF &= !m_encOnly || pu.cu->slice->getCheckLDC() || iDMvHorX > profThres || iDMvHorY > profThres || iDMvVerX > profThres || iDMvVerY > profThres || iDMvHorX < -profThres || iDMvHorY < -profThres || iDMvVerX < -profThres || iDMvVerY < -profThres; enablePROF &= !m_encOnly || pu.cu->slice->getCheckLDC() || iDMvHorX > profThres || iDMvHorY > profThres || iDMvVerX > profThres || iDMvVerY > profThres || iDMvHorX < -profThres || iDMvHorY < -profThres || iDMvVerX < -profThres || iDMvVerY < -profThres;
enablePROF &= pu.cs->pps->getPicWidthInLumaSamples() == refPic->cs->pps->getPicWidthInLumaSamples() && pu.cs->pps->getPicHeightInLumaSamples() == refPic->cs->pps->getPicHeightInLumaSamples(); enablePROF &= pu.cs->pps->getPicWidthInLumaSamples() == refPic->getPicWidthInLumaSamples() && pu.cs->pps->getPicHeightInLumaSamples() == refPic->getPicHeightInLumaSamples();
if (compID == COMPONENT_Y) if (compID == COMPONENT_Y)
{ {
...@@ -1643,6 +1643,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu ...@@ -1643,6 +1643,7 @@ void InterPrediction::motionCompensation( PredictionUnit &pu, PelUnitBuf &predBu
bioApplied = false; bioApplied = false;
} }
} }
bioApplied = PU::isRefPicSameSize( pu ) ? bioApplied : false;
bool dmvrApplied = false; bool dmvrApplied = false;
dmvrApplied = (pu.mvRefine) && PU::checkDMVRCondition(pu); dmvrApplied = (pu.mvRefine) && PU::checkDMVRCondition(pu);
if ((pu.lumaSize().width > MAX_BDOF_APPLICATION_REGION || pu.lumaSize().height > MAX_BDOF_APPLICATION_REGION) && pu.mergeType != MRG_TYPE_SUBPU_ATMVP && (bioApplied && !dmvrApplied)) if ((pu.lumaSize().width > MAX_BDOF_APPLICATION_REGION || pu.lumaSize().height > MAX_BDOF_APPLICATION_REGION) && pu.mergeType != MRG_TYPE_SUBPU_ATMVP && (bioApplied && !dmvrApplied))
...@@ -2358,8 +2359,8 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio, ...@@ -2358,8 +2359,8 @@ bool InterPrediction::xPredInterBlkRPR( const std::pair<int, int>& scalingRatio,
if( scaled ) if( scaled )
{ {
int row, col; int row, col;
int refPicWidth = refPic->cs->pps->getPicWidthInLumaSamples(); int refPicWidth = refPic->getPicWidthInLumaSamples();
int refPicHeight = refPic->cs->pps->getPicHeightInLumaSamples(); int refPicHeight = refPic->getPicHeightInLumaSamples();
#if JVET_P0088_P0353_RPR_FILTERS #if JVET_P0088_P0353_RPR_FILTERS
int xFilter = filterIndex; int xFilter = filterIndex;
......
...@@ -296,6 +296,19 @@ public: ...@@ -296,6 +296,19 @@ public:
std::deque<Slice*> slices; std::deque<Slice*> slices;
SEIMessages SEIs; SEIMessages SEIs;
uint32_t m_picWidthInLumaSamples;
uint32_t m_picHeightInLumaSamples;
Window m_conformanceWindow;
void setPicWidthInLumaSamples( uint32_t u ) { m_picWidthInLumaSamples = u; }
uint32_t getPicWidthInLumaSamples() const { return m_picWidthInLumaSamples; }
void setPicHeightInLumaSamples( uint32_t u ) { m_picHeightInLumaSamples = u; }
uint32_t getPicHeightInLumaSamples() const { return m_picHeightInLumaSamples; }
Window& getConformanceWindow() { return m_conformanceWindow; }
const Window& getConformanceWindow() const { return m_conformanceWindow; }
void setConformanceWindow( Window& conformanceWindow ) { m_conformanceWindow = conformanceWindow; }
void allocateNewSlice(); void allocateNewSlice();
Slice *swapSliceObject(Slice * p, uint32_t i); Slice *swapSliceObject(Slice * p, uint32_t i);
void clearSliceBuffer(); void clearSliceBuffer();
......
...@@ -2527,7 +2527,7 @@ void Slice::scaleRefPicList( Picture *scaledRefPic[ ], APS** apss, APS* lmcsAps, ...@@ -2527,7 +2527,7 @@ void Slice::scaleRefPicList( Picture *scaledRefPic[ ], APS** apss, APS* lmcsAps,
// reference resampling for the whole picture is not applied at decoder // reference resampling for the whole picture is not applied at decoder
int xScale, yScale; int xScale, yScale;
CU::getRprScaling( sps, pps, m_apcRefPicList[refList][rIdx]->slices[0]->getPPS(), xScale, yScale ); CU::getRprScaling( sps, pps, m_apcRefPicList[refList][rIdx], xScale, yScale );
m_scalingRatio[refList][rIdx] = std::pair<int, int>( xScale, yScale ); m_scalingRatio[refList][rIdx] = std::pair<int, int>( xScale, yScale );
if( m_scalingRatio[refList][rIdx] == SCALE_1X || isDecoder ) if( m_scalingRatio[refList][rIdx] == SCALE_1X || isDecoder )
......
...@@ -1180,6 +1180,9 @@ private: ...@@ -1180,6 +1180,9 @@ private:
int m_chromaCbQpOffset; int m_chromaCbQpOffset;
int m_chromaCrQpOffset; int m_chromaCrQpOffset;
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
bool m_chromaJointCbCrQpOffsetPresentFlag;
#endif
int m_chromaCbCrQpOffset; int m_chromaCbCrQpOffset;
// Chroma QP Adjustments // Chroma QP Adjustments
...@@ -1293,6 +1296,11 @@ public: ...@@ -1293,6 +1296,11 @@ public:
void setCuQpDeltaSubdiv( uint32_t u ) { m_cuQpDeltaSubdiv = u; } void setCuQpDeltaSubdiv( uint32_t u ) { m_cuQpDeltaSubdiv = u; }
uint32_t getCuQpDeltaSubdiv() const { return m_cuQpDeltaSubdiv; } uint32_t getCuQpDeltaSubdiv() const { return m_cuQpDeltaSubdiv; }
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
bool getJointCbCrQpOffsetPresentFlag() const { return m_chromaJointCbCrQpOffsetPresentFlag; }
void setJointCbCrQpOffsetPresentFlag(bool b) { m_chromaJointCbCrQpOffsetPresentFlag = b; }
#endif
void setQpOffset(ComponentID compID, int i ) void setQpOffset(ComponentID compID, int i )
{ {
if (compID==COMPONENT_Cb) if (compID==COMPONENT_Cb)
......
...@@ -50,8 +50,12 @@ ...@@ -50,8 +50,12 @@
#include <assert.h> #include <assert.h>
#include <cassert> #include <cassert>
#define JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR 1 // JVET-P0667: removing signaling of qp offset table for JCCR, at SPS and PPS, when JCCR is disabled.
#define JVET_P0298_DISABLE_LEVELMAPPING_IN_BYPASS 1 // JVET-P0298: Disable level mapping in bypass mode #define JVET_P0298_DISABLE_LEVELMAPPING_IN_BYPASS 1 // JVET-P0298: Disable level mapping in bypass mode
#define JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT 1 // JVET-P0347: Max MTT Depth constraint
#define JVET_P0325_CHANGE_MERGE_CANDIDATE_ORDER 1 // JVET-P0325: reorder the spatial merge candidates #define JVET_P0325_CHANGE_MERGE_CANDIDATE_ORDER 1 // JVET-P0325: reorder the spatial merge candidates
#define JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT 1 // JVET-P0578: minimum CU size constraint #define JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT 1 // JVET-P0578: minimum CU size constraint
......
...@@ -100,14 +100,14 @@ void CS::setRefinedMotionField(CodingStructure &cs) ...@@ -100,14 +100,14 @@ void CS::setRefinedMotionField(CodingStructure &cs)
} }
// CU tools // CU tools
bool CU::getRprScaling( const SPS* sps, const PPS* curPPS, const PPS* refPPS, int& xScale, int& yScale ) bool CU::getRprScaling( const SPS* sps, const PPS* curPPS, Picture* refPic, int& xScale, int& yScale )
{ {
const Window& curConfWindow = curPPS->getConformanceWindow(); const Window& curConfWindow = curPPS->getConformanceWindow();
int curPicWidth = curPPS->getPicWidthInLumaSamples() - (curConfWindow.getWindowLeftOffset() + curConfWindow.getWindowRightOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc()); int curPicWidth = curPPS->getPicWidthInLumaSamples() - (curConfWindow.getWindowLeftOffset() + curConfWindow.getWindowRightOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc());
int curPicHeight = curPPS->getPicHeightInLumaSamples() - (curConfWindow.getWindowTopOffset() + curConfWindow.getWindowBottomOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc()); int curPicHeight = curPPS->getPicHeightInLumaSamples() - (curConfWindow.getWindowTopOffset() + curConfWindow.getWindowBottomOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc());
const Window& refConfWindow = refPPS->getConformanceWindow(); const Window& refConfWindow = refPic->getConformanceWindow();
int refPicWidth = refPPS->getPicWidthInLumaSamples() - (refConfWindow.getWindowLeftOffset() + refConfWindow.getWindowRightOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc()); int refPicWidth = refPic->getPicWidthInLumaSamples() - (refConfWindow.getWindowLeftOffset() + refConfWindow.getWindowRightOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc());
int refPicHeight = refPPS->getPicHeightInLumaSamples() - (refConfWindow.getWindowTopOffset() + refConfWindow.getWindowBottomOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc()); int refPicHeight = refPic->getPicHeightInLumaSamples() - (refConfWindow.getWindowTopOffset() + refConfWindow.getWindowBottomOffset()) * SPS::getWinUnitY(sps->getChromaFormatIdc());
xScale = ( ( refPicWidth << SCALE_RATIO_BITS ) + ( curPicWidth >> 1 ) ) / curPicWidth; xScale = ( ( refPicWidth << SCALE_RATIO_BITS ) + ( curPicWidth >> 1 ) ) / curPicWidth;
yScale = ( ( refPicHeight << SCALE_RATIO_BITS ) + ( curPicHeight >> 1 ) ) / curPicHeight; yScale = ( ( refPicHeight << SCALE_RATIO_BITS ) + ( curPicHeight >> 1 ) ) / curPicHeight;
...@@ -3920,16 +3920,16 @@ bool PU::isRefPicSameSize( const PredictionUnit& pu ) ...@@ -3920,16 +3920,16 @@ bool PU::isRefPicSameSize( const PredictionUnit& pu )
if( pu.refIdx[0] >= 0 ) if( pu.refIdx[0] >= 0 )
{ {
int refPicWidth = pu.cu->slice->getRefPic( REF_PIC_LIST_0, pu.refIdx[0] )->unscaledPic->cs->pps->getPicWidthInLumaSamples(); 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] )->unscaledPic->cs->pps->getPicHeightInLumaSamples(); int refPicHeight = pu.cu->slice->getRefPic( REF_PIC_LIST_0, pu.refIdx[0] )->getPicHeightInLumaSamples();
samePicSize = refPicWidth == curPicWidth && refPicHeight == curPicHeight; samePicSize = refPicWidth == curPicWidth && refPicHeight == curPicHeight;
} }
if( pu.refIdx[1] >= 0 ) if( pu.refIdx[1] >= 0 )
{ {
int refPicWidth = pu.cu->slice->getRefPic( REF_PIC_LIST_1, pu.refIdx[1] )->unscaledPic->cs->pps->getPicWidthInLumaSamples(); 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] )->unscaledPic->cs->pps->getPicHeightInLumaSamples(); int refPicHeight = pu.cu->slice->getRefPic( REF_PIC_LIST_1, pu.refIdx[1] )->getPicHeightInLumaSamples();
samePicSize = samePicSize && ( refPicWidth == curPicWidth && refPicHeight == curPicHeight ); samePicSize = samePicSize && ( refPicWidth == curPicWidth && refPicHeight == curPicHeight );
} }
......
...@@ -119,7 +119,7 @@ namespace CU ...@@ -119,7 +119,7 @@ namespace CU
uint8_t numSbtModeRdo (uint8_t sbtAllowed); uint8_t numSbtModeRdo (uint8_t sbtAllowed);
bool isSbtMode (const uint8_t sbtInfo); bool isSbtMode (const uint8_t sbtInfo);
bool isSameSbtSize (const uint8_t sbtInfo1, const uint8_t sbtInfo2); bool isSameSbtSize (const uint8_t sbtInfo1, const uint8_t sbtInfo2);
bool getRprScaling ( const SPS* sps, const PPS* curPPS, const PPS* refPPS, int& xScale, int& yScale ); bool getRprScaling ( const SPS* sps, const PPS* curPPS, Picture* refPic, int& xScale, int& yScale );
} }
// PU tools // PU tools
namespace PU namespace PU
......
...@@ -922,6 +922,12 @@ void DecLib::xActivateParameterSets() ...@@ -922,6 +922,12 @@ void DecLib::xActivateParameterSets()
m_pcPic->cs->slice = pSlice; m_pcPic->cs->slice = pSlice;
m_pcPic->cs->sps = sps; m_pcPic->cs->sps = sps;
m_pcPic->cs->pps = pps; m_pcPic->cs->pps = pps;
Window confWin = pps->getConformanceWindow( );
m_pcPic->setPicWidthInLumaSamples( pps->getPicWidthInLumaSamples() );
m_pcPic->setPicHeightInLumaSamples( pps->getPicHeightInLumaSamples() );
m_pcPic->setConformanceWindow( confWin );
memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss)); memcpy(m_pcPic->cs->alfApss, apss, sizeof(m_pcPic->cs->alfApss));
m_pcPic->cs->lmcsAps = lmcsAPS; m_pcPic->cs->lmcsAps = lmcsAPS;
m_pcPic->cs->scalinglistAps = scalinglistAPS; m_pcPic->cs->scalinglistAps = scalinglistAPS;
......
...@@ -453,8 +453,23 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana ...@@ -453,8 +453,23 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
CHECK( pcPPS->getQpOffset(COMPONENT_Cr) < -12, "Invalid Cr QP offset" ); CHECK( pcPPS->getQpOffset(COMPONENT_Cr) < -12, "Invalid Cr QP offset" );
CHECK( pcPPS->getQpOffset(COMPONENT_Cr) > 12, "Invalid Cr QP offset" ); CHECK( pcPPS->getQpOffset(COMPONENT_Cr) > 12, "Invalid Cr QP offset" );
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
READ_FLAG(uiCode, "pps_joint_cbcr_qp_offset_present_flag");
pcPPS->setJointCbCrQpOffsetPresentFlag(uiCode ? true : false);
if (pcPPS->getJointCbCrQpOffsetPresentFlag())
{
READ_SVLC(iCode, "pps_joint_cbcr_qp_offset");
}
else
{
iCode = 0;
}
#else
READ_SVLC( iCode, "pps_joint_cbcr_qp_offset"); READ_SVLC( iCode, "pps_joint_cbcr_qp_offset");
#endif
pcPPS->setQpOffset(JOINT_CbCr, iCode); pcPPS->setQpOffset(JOINT_CbCr, iCode);
CHECK( pcPPS->getQpOffset(JOINT_CbCr) < -12, "Invalid CbCr QP offset" ); CHECK( pcPPS->getQpOffset(JOINT_CbCr) < -12, "Invalid CbCr QP offset" );
CHECK( pcPPS->getQpOffset(JOINT_CbCr) > 12, "Invalid CbCr QP offset" ); CHECK( pcPPS->getQpOffset(JOINT_CbCr) > 12, "Invalid CbCr QP offset" );
...@@ -485,7 +500,18 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana ...@@ -485,7 +500,18 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana
CHECK(cbOffset < -12 || cbOffset > 12, "Invalid chroma QP offset"); CHECK(cbOffset < -12 || cbOffset > 12, "Invalid chroma QP offset");
READ_SVLC(crOffset, "cr_qp_offset_list[i]"); READ_SVLC(crOffset, "cr_qp_offset_list[i]");
CHECK(crOffset < -12 || crOffset > 12, "Invalid chroma QP offset"); CHECK(crOffset < -12 || crOffset > 12, "Invalid chroma QP offset");
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
if (pcPPS->getJointCbCrQpOffsetPresentFlag())
{
READ_SVLC(jointCbCrOffset, "joint_cbcr_qp_offset_list[i]");
}
else
{
jointCbCrOffset = 0;
}
#else
READ_SVLC(jointCbCrOffset, "joint_cbcr_qp_offset_list[i]"); READ_SVLC(jointCbCrOffset, "joint_cbcr_qp_offset_list[i]");
#endif
CHECK(jointCbCrOffset < -12 || jointCbCrOffset > 12, "Invalid chroma QP offset"); CHECK(jointCbCrOffset < -12 || jointCbCrOffset > 12, "Invalid chroma QP offset");
// table uses +1 for index (see comment inside the function) // table uses +1 for index (see comment inside the function)
pcPPS->setChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1, cbOffset, crOffset, jointCbCrOffset); pcPPS->setChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1, cbOffset, crOffset, jointCbCrOffset);
...@@ -1282,7 +1308,13 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1282,7 +1308,13 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
unsigned minQtLog2SizeInterY = uiCode + pcSPS->getLog2MinCodingBlockSize(); unsigned minQtLog2SizeInterY = uiCode + pcSPS->getLog2MinCodingBlockSize();
minQT[1] = 1 << minQtLog2SizeInterY; minQT[1] = 1 << minQtLog2SizeInterY;
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_inter_slice"); maxBTD[1] = uiCode; READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_inter_slice"); maxBTD[1] = uiCode;
#if JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT
CHECK(uiCode > 2*(ctbLog2SizeY - log2MinCUSize), "sps_max_mtt_hierarchy_depth_inter_slice shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
#endif
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slice_luma"); maxBTD[0] = uiCode; READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slice_luma"); maxBTD[0] = uiCode;
#if JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT
CHECK(uiCode > 2 * (ctbLog2SizeY - log2MinCUSize), "sps_max_mtt_hierarchy_depth_intra_slice_luma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
#endif
maxTTSize[0] = maxBTSize[0] = minQT[0]; maxTTSize[0] = maxBTSize[0] = minQT[0];
if (maxBTD[0] != 0) if (maxBTD[0] != 0)
...@@ -1304,6 +1336,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1304,6 +1336,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{ {
READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma"); minQT[2] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize()); READ_UVLC(uiCode, "sps_log2_diff_min_qt_min_cb_intra_slice_chroma"); minQT[2] = 1 << (uiCode + pcSPS->getLog2MinCodingBlockSize());
READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slice_chroma"); maxBTD[2] = uiCode; READ_UVLC(uiCode, "sps_max_mtt_hierarchy_depth_intra_slice_chroma"); maxBTD[2] = uiCode;
#if JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT
CHECK(uiCode > 2 * (ctbLog2SizeY - log2MinCUSize), "sps_max_mtt_hierarchy_depth_intra_slice_chroma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
#endif
maxTTSize[2] = maxBTSize[2] = minQT[2]; maxTTSize[2] = maxBTSize[2] = minQT[2];
if (maxBTD[2] != 0) if (maxBTD[2] != 0)
{ {
...@@ -1320,11 +1355,19 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1320,11 +1355,19 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
READ_FLAG( uiCode, "sps_max_luma_transform_size_64_flag"); pcSPS->setLog2MaxTbSize( (uiCode ? 1 : 0) + 5 ); READ_FLAG( uiCode, "sps_max_luma_transform_size_64_flag"); pcSPS->setLog2MaxTbSize( (uiCode ? 1 : 0) + 5 );
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
READ_FLAG(uiCode, "sps_joint_cbcr_enabled_flag"); pcSPS->setJointCbCrEnabledFlag(uiCode ? true : false);
#endif
if (pcSPS->getChromaFormatIdc() != CHROMA_400) if (pcSPS->getChromaFormatIdc() != CHROMA_400)
{ {
ChromaQpMappingTableParams chromaQpMappingTableParams; ChromaQpMappingTableParams chromaQpMappingTableParams;
READ_FLAG(uiCode, "same_qp_table_for_chroma"); chromaQpMappingTableParams.setSameCQPTableForAllChromaFlag(uiCode); READ_FLAG(uiCode, "same_qp_table_for_chroma"); chromaQpMappingTableParams.setSameCQPTableForAllChromaFlag(uiCode);
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
int numQPTables = chromaQpMappingTableParams.getSameCQPTableForAllChromaFlag() ? 1 : (pcSPS->getJointCbCrEnabledFlag() ? 3 : 2);
for (int i = 0; i < numQPTables; i++)
#else
for (int i = 0; i < (chromaQpMappingTableParams.getSameCQPTableForAllChromaFlag() ? 1 : 3); i++) for (int i = 0; i < (chromaQpMappingTableParams.getSameCQPTableForAllChromaFlag() ? 1 : 3); i++)
#endif
{ {
READ_UVLC(uiCode, "num_points_in_qp_table_minus1"); chromaQpMappingTableParams.setNumPtsInCQPTableMinus1(i,uiCode); READ_UVLC(uiCode, "num_points_in_qp_table_minus1"); chromaQpMappingTableParams.setNumPtsInCQPTableMinus1(i,uiCode);
std::vector<int> deltaQpInValMinus1(chromaQpMappingTableParams.getNumPtsInCQPTableMinus1(i) + 1); std::vector<int> deltaQpInValMinus1(chromaQpMappingTableParams.getNumPtsInCQPTableMinus1(i) + 1);
...@@ -1341,6 +1384,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1341,6 +1384,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
pcSPS->derivedChromaQPMappingTables(); pcSPS->derivedChromaQPMappingTables();
} }
READ_FLAG( uiCode, "sps_sao_enabled_flag" ); pcSPS->setSAOEnabledFlag ( uiCode ? true : false ); READ_FLAG( uiCode, "sps_sao_enabled_flag" ); pcSPS->setSAOEnabledFlag ( uiCode ? true : false );
READ_FLAG( uiCode, "sps_alf_enabled_flag" ); pcSPS->setALFEnabledFlag ( uiCode ? true : false ); READ_FLAG( uiCode, "sps_alf_enabled_flag" ); pcSPS->setALFEnabledFlag ( uiCode ? true : false );
...@@ -1349,7 +1393,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS) ...@@ -1349,7 +1393,9 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{ {
READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false); READ_FLAG(uiCode, "sps_bdpcm_enabled_flag"); pcSPS->setBDPCMEnabledFlag(uiCode ? true : false);
} }
#if !JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
READ_FLAG( uiCode, "sps_joint_cbcr_enabled_flag"); pcSPS->setJointCbCrEnabledFlag (uiCode ? true : false); READ_FLAG( uiCode, "sps_joint_cbcr_enabled_flag"); pcSPS->setJointCbCrEnabledFlag (uiCode ? true : false);
#endif
READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false ); READ_FLAG(uiCode, "sps_ref_wraparound_enabled_flag"); pcSPS->setWrapAroundEnabledFlag( uiCode ? true : false );
...@@ -1994,6 +2040,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para ...@@ -1994,6 +2040,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
{ {
READ_UVLC(uiCode, "slice_log2_diff_min_qt_min_cb"); pcSlice->setMinQTSize(1 << (uiCode + sps->getLog2MinCodingBlockSize())); READ_UVLC(uiCode, "slice_log2_diff_min_qt_min_cb"); pcSlice->setMinQTSize(1 << (uiCode + sps->getLog2MinCodingBlockSize()));
READ_UVLC(uiCode, "slice_max_mtt_hierarchy_depth_luma"); pcSlice->setMaxMTTHierarchyDepth(uiCode); READ_UVLC(uiCode, "slice_max_mtt_hierarchy_depth_luma"); pcSlice->setMaxMTTHierarchyDepth(uiCode);
#if JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT
CHECK(uiCode > 2 * (floorLog2(sps->getCTUSize()) - sps->getLog2MinCodingBlockSize()), "slice_max_mtt_hierarchy_depth_luma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
#endif
if (pcSlice->getMaxMTTHierarchyDepth() != 0) if (pcSlice->getMaxMTTHierarchyDepth() != 0)
{ {
READ_UVLC(uiCode, "slice_log2_diff_max_bt_min_qt"); pcSlice->setMaxBTSize(pcSlice->getMinQTSize() << uiCode); READ_UVLC(uiCode, "slice_log2_diff_max_bt_min_qt"); pcSlice->setMaxBTSize(pcSlice->getMinQTSize() << uiCode);
...@@ -2010,6 +2059,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para ...@@ -2010,6 +2059,9 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
{ {
READ_UVLC(uiCode, "slice_log2_diff_min_qt_min_cb_chroma"); pcSlice->setMinQTSizeIChroma(1 << (uiCode + sps->getLog2MinCodingBlockSize())); READ_UVLC(uiCode, "slice_log2_diff_min_qt_min_cb_chroma"); pcSlice->setMinQTSizeIChroma(1 << (uiCode + sps->getLog2MinCodingBlockSize()));
READ_UVLC(uiCode, "slice_max_mtt_hierarchy_depth_chroma"); pcSlice->setMaxMTTHierarchyDepthIChroma(uiCode); READ_UVLC(uiCode, "slice_max_mtt_hierarchy_depth_chroma"); pcSlice->setMaxMTTHierarchyDepthIChroma(uiCode);
#if JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT
CHECK(uiCode > 2 * (floorLog2(sps->getCTUSize()) - sps->getLog2MinCodingBlockSize()), "slice_max_mtt_hierarchy_depth_chroma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
#endif
if (pcSlice->getMaxMTTHierarchyDepthIChroma() != 0) if (pcSlice->getMaxMTTHierarchyDepthIChroma() != 0)
{ {
READ_UVLC(uiCode, "slice_log2_diff_max_bt_min_qt_chroma"); pcSlice->setMaxBTSizeIChroma(pcSlice->getMinQTSizeIChroma() << uiCode); READ_UVLC(uiCode, "slice_log2_diff_max_bt_min_qt_chroma"); pcSlice->setMaxBTSizeIChroma(pcSlice->getMinQTSizeIChroma() << uiCode);
......
...@@ -558,6 +558,11 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru ...@@ -558,6 +558,11 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru
const PPS *pps = m_ppsMap.getPS(2); const PPS *pps = m_ppsMap.getPS(2);
const SPS *sps = m_spsMap.getPS(pps->getSPSId()); const SPS *sps = m_spsMap.getPS(pps->getSPSId());
Window confWin = pps->getConformanceWindow( );
picCurr->setPicWidthInLumaSamples( pps->getPicWidthInLumaSamples() );
picCurr->setPicHeightInLumaSamples( pps->getPicHeightInLumaSamples() );
picCurr->setConformanceWindow( confWin );
picCurr->M_BUFS(0, PIC_ORIGINAL).copyFrom(m_cGOPEncoder.getPicBg()->getRecoBuf()); picCurr->M_BUFS(0, PIC_ORIGINAL).copyFrom(m_cGOPEncoder.getPicBg()->getRecoBuf());
picCurr->finalInit( *sps, *pps, m_apss, m_lmcsAPS, m_scalinglistAPS ); picCurr->finalInit( *sps, *pps, m_apss, m_lmcsAPS, m_scalinglistAPS );
picCurr->poc = m_iPOCLast - 1; picCurr->poc = m_iPOCLast - 1;
...@@ -619,6 +624,11 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru ...@@ -619,6 +624,11 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* cPicYuvTru
const PPS *pPPS=(ppsID<0) ? m_ppsMap.getFirstPS() : m_ppsMap.getPS(ppsID); const PPS *pPPS=(ppsID<0) ? m_ppsMap.getFirstPS() : m_ppsMap.getPS(ppsID);
const SPS *pSPS=m_spsMap.getPS(pPPS->getSPSId()); const SPS *pSPS=m_spsMap.getPS(pPPS->getSPSId());
Window confWin = pPPS->getConformanceWindow( );
pcPicCurr->setPicWidthInLumaSamples( pPPS->getPicWidthInLumaSamples() );
pcPicCurr->setPicHeightInLumaSamples( pPPS->getPicHeightInLumaSamples() );
pcPicCurr->setConformanceWindow( confWin );
if( m_rprEnabled ) if( m_rprEnabled )
{ {
pcPicCurr->M_BUFS( 0, PIC_ORIGINAL_INPUT ).getBuf( COMPONENT_Y ).copyFrom( pcPicYuvOrg->getBuf( COMPONENT_Y ) ); pcPicCurr->M_BUFS( 0, PIC_ORIGINAL_INPUT ).getBuf( COMPONENT_Y ).copyFrom( pcPicYuvOrg->getBuf( COMPONENT_Y ) );
...@@ -740,6 +750,11 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* pcPicYuvTr ...@@ -740,6 +750,11 @@ void EncLib::encode( bool flush, PelStorage* pcPicYuvOrg, PelStorage* pcPicYuvTr
int ppsID=-1; // Use default PPS ID int ppsID=-1; // Use default PPS ID
const PPS *pPPS=(ppsID<0) ? m_ppsMap.getFirstPS() : m_ppsMap.getPS(ppsID); const PPS *pPPS=(ppsID<0) ? m_ppsMap.getFirstPS() : m_ppsMap.getPS(ppsID);
const SPS *pSPS=m_spsMap.getPS(pPPS->getSPSId()); const SPS *pSPS=m_spsMap.getPS(pPPS->getSPSId());
Window confWin = pPPS->getConformanceWindow( );
pcField->setPicWidthInLumaSamples( pPPS->getPicWidthInLumaSamples() );
pcField->setPicHeightInLumaSamples( pPPS->getPicHeightInLumaSamples() );
pcField->setConformanceWindow( confWin );
pcField->finalInit( *pSPS, *pPPS, m_apss, m_lmcsAPS, m_scalinglistAPS ); pcField->finalInit( *pSPS, *pPPS, m_apss, m_lmcsAPS, m_scalinglistAPS );
} }
...@@ -1028,6 +1043,11 @@ void EncLib::xInitSPS(SPS &sps) ...@@ -1028,6 +1043,11 @@ void EncLib::xInitSPS(SPS &sps)
#if JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT #if JVET_P0578_MINIMUM_CU_SIZE_CONSTRAINT
CHECK(log2MinCUSize > std::min(6, floorLog2(sps.getMaxCUWidth())), "log2_min_luma_coding_block_size_minus2 shall be in the range of 0 to min (4, log2_ctu_size - 2)"); CHECK(log2MinCUSize > std::min(6, floorLog2(sps.getMaxCUWidth())), "log2_min_luma_coding_block_size_minus2 shall be in the range of 0 to min (4, log2_ctu_size - 2)");
#endif #endif
#if JVET_P0347_MAX_MTT_DEPTH_CONSTRAINT
CHECK(m_uiMaxMTTHierarchyDepth > 2 * (floorLog2(sps.getCTUSize()) - sps.getLog2MinCodingBlockSize()), "sps_max_mtt_hierarchy_depth_inter_slice shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
CHECK(m_uiMaxMTTHierarchyDepthI > 2 * (floorLog2(sps.getCTUSize()) - sps.getLog2MinCodingBlockSize()), "sps_max_mtt_hierarchy_depth_intra_slice_luma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
CHECK(m_uiMaxMTTHierarchyDepthIChroma > 2 * (floorLog2(sps.getCTUSize()) - sps.getLog2MinCodingBlockSize()), "sps_max_mtt_hierarchy_depth_intra_slice_chroma shall be in the range 0 to 2*(ctbLog2SizeY - log2MinCUSize)");
#endif
sps.setTransformSkipEnabledFlag(m_useTransformSkip); sps.setTransformSkipEnabledFlag(m_useTransformSkip);
sps.setBDPCMEnabledFlag(m_useBDPCM); sps.setBDPCMEnabledFlag(m_useBDPCM);
...@@ -1226,6 +1246,17 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) ...@@ -1226,6 +1246,17 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
pps.setPicInitQPMinus26( std::min( maxDQP, std::max( minDQP, baseQp ) )); pps.setPicInitQPMinus26( std::min( maxDQP, std::max( minDQP, baseQp ) ));
} }
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
if (sps.getJointCbCrEnabledFlag() == false || getChromaFormatIdc() == CHROMA_400)
{
pps.setJointCbCrQpOffsetPresentFlag(false);
}
else
{
pps.setJointCbCrQpOffsetPresentFlag(true);
}
#endif
#if ER_CHROMA_QP_WCG_PPS #if ER_CHROMA_QP_WCG_PPS
if (getWCGChromaQPControl().isEnabled()) if (getWCGChromaQPControl().isEnabled())
{ {
...@@ -1237,14 +1268,28 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps) ...@@ -1237,14 +1268,28 @@ void EncLib::xInitPPS(PPS &pps, const SPS &sps)
const int crQP =(int)(dcrQP + ( dcrQP < 0 ? -0.5 : 0.5) ); const int crQP =(int)(dcrQP + ( dcrQP < 0 ? -0.5 : 0.5) );
pps.setQpOffset(COMPONENT_Cb, Clip3( -12, 12, min(0, cbQP) + m_chromaCbQpOffset )); pps.setQpOffset(COMPONENT_Cb, Clip3( -12, 12, min(0, cbQP) + m_chromaCbQpOffset ));
pps.setQpOffset(COMPONENT_Cr, Clip3( -12, 12, min(0, crQP) + m_chromaCrQpOffset)); pps.setQpOffset(COMPONENT_Cr, Clip3( -12, 12, min(0, crQP) + m_chromaCrQpOffset));
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
if(pps.getJointCbCrQpOffsetPresentFlag())
pps.setQpOffset(JOINT_CbCr, Clip3(-12, 12, (min(0, cbQP) + min(0, crQP)) / 2 + m_chromaCbCrQpOffset));
else
pps.setQpOffset(JOINT_CbCr, 0);
#else
pps.setQpOffset(JOINT_CbCr, Clip3( -12, 12, ( min(0, cbQP) + min(0, crQP) ) / 2 + m_chromaCbCrQpOffset)); pps.setQpOffset(JOINT_CbCr, Clip3( -12, 12, ( min(0, cbQP) + min(0, crQP) ) / 2 + m_chromaCbCrQpOffset));
#endif
} }
else else
{ {
#endif #endif
pps.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset ); pps.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset );
pps.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset ); pps.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset );
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
if (pps.getJointCbCrQpOffsetPresentFlag())
pps.setQpOffset(JOINT_CbCr, m_chromaCbCrQpOffset);
else
pps.setQpOffset(JOINT_CbCr, 0);
#else
pps.setQpOffset(JOINT_CbCr, m_chromaCbCrQpOffset ); pps.setQpOffset(JOINT_CbCr, m_chromaCbCrQpOffset );
#endif
#if ER_CHROMA_QP_WCG_PPS #if ER_CHROMA_QP_WCG_PPS
} }
#endif #endif
......
...@@ -258,7 +258,19 @@ void HLSWriter::codePPS( const PPS* pcPPS, const SPS* pcSPS ) ...@@ -258,7 +258,19 @@ void HLSWriter::codePPS( const PPS* pcPPS, const SPS* pcSPS )
WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" ); WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" );
WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" ); WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" );
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
if (pcSPS->getJointCbCrEnabledFlag() == false || pcSPS->getChromaFormatIdc() == CHROMA_400)
{
CHECK(pcPPS->getJointCbCrQpOffsetPresentFlag(), "pps_jcbcr_qp_offset_present_flag should be false");
}
WRITE_FLAG(pcPPS->getJointCbCrQpOffsetPresentFlag() ? 1 : 0, "pps_joint_cbcr_qp_offset_present_flag");
if (pcPPS->getJointCbCrQpOffsetPresentFlag())
{
WRITE_SVLC(pcPPS->getQpOffset(JOINT_CbCr), "pps_joint_cbcr_qp_offset");
}
#else
WRITE_SVLC( pcPPS->getQpOffset(JOINT_CbCr), "pps_joint_cbcr_qp_offset" ); WRITE_SVLC( pcPPS->getQpOffset(JOINT_CbCr), "pps_joint_cbcr_qp_offset" );
#endif
WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0, "pps_slice_chroma_qp_offsets_present_flag" ); WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0, "pps_slice_chroma_qp_offsets_present_flag" );
...@@ -272,7 +284,14 @@ void HLSWriter::codePPS( const PPS* pcPPS, const SPS* pcSPS ) ...@@ -272,7 +284,14 @@ void HLSWriter::codePPS( const PPS* pcPPS, const SPS* pcSPS )
{ {
WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1).u.comp.CbOffset, "cb_qp_offset_list[i]"); WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1).u.comp.CbOffset, "cb_qp_offset_list[i]");
WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1).u.comp.CrOffset, "cr_qp_offset_list[i]"); WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx+1).u.comp.CrOffset, "cr_qp_offset_list[i]");
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
if (pcPPS->getJointCbCrQpOffsetPresentFlag())
{
WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.JointCbCrOffset, "joint_cbcr_qp_offset_list[i]");
}
#else
WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.JointCbCrOffset, "joint_cbcr_qp_offset_list[i]"); WRITE_SVLC(pcPPS->getChromaQpOffsetListEntry(cuChromaQpOffsetIdx + 1).u.comp.JointCbCrOffset, "joint_cbcr_qp_offset_list[i]");
#endif
} }
} }
...@@ -787,11 +806,19 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -787,11 +806,19 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
WRITE_FLAG( (pcSPS->getLog2MaxTbSize() - 5) ? 1 : 0, "sps_max_luma_transform_size_64_flag" ); WRITE_FLAG( (pcSPS->getLog2MaxTbSize() - 5) ? 1 : 0, "sps_max_luma_transform_size_64_flag" );
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
WRITE_FLAG(pcSPS->getJointCbCrEnabledFlag(), "sps_joint_cbcr_enabled_flag");
#endif
if (pcSPS->getChromaFormatIdc() != CHROMA_400) if (pcSPS->getChromaFormatIdc() != CHROMA_400)
{ {
const ChromaQpMappingTable& chromaQpMappingTable = pcSPS->getChromaQpMappingTable(); const ChromaQpMappingTable& chromaQpMappingTable = pcSPS->getChromaQpMappingTable();
WRITE_FLAG(chromaQpMappingTable.getSameCQPTableForAllChromaFlag(), "same_qp_table_for_chroma"); WRITE_FLAG(chromaQpMappingTable.getSameCQPTableForAllChromaFlag(), "same_qp_table_for_chroma");
#if JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
int numQPTables = chromaQpMappingTable.getSameCQPTableForAllChromaFlag() ? 1 : (pcSPS->getJointCbCrEnabledFlag() ? 3 : 2);
for (int i = 0; i < numQPTables; i++)
#else
for (int i = 0; i < (chromaQpMappingTable.getSameCQPTableForAllChromaFlag() ? 1 : 3); i++) for (int i = 0; i < (chromaQpMappingTable.getSameCQPTableForAllChromaFlag() ? 1 : 3); i++)
#endif
{ {
WRITE_UVLC(chromaQpMappingTable.getNumPtsInCQPTableMinus1(i), "num_points_in_qp_table_minus1"); WRITE_UVLC(chromaQpMappingTable.getNumPtsInCQPTableMinus1(i), "num_points_in_qp_table_minus1");
...@@ -815,7 +842,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS ) ...@@ -815,7 +842,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
{ {
CHECK(pcSPS->getBDPCMEnabledFlag(), "BDPCM cannot be used when transform skip is disabled"); CHECK(pcSPS->getBDPCMEnabledFlag(), "BDPCM cannot be used when transform skip is disabled");
} }
#if !JVET_P0667_QP_OFFSET_TABLE_SIGNALING_JCCR
WRITE_FLAG( pcSPS->getJointCbCrEnabledFlag(), "sps_joint_cbcr_enabled_flag"); WRITE_FLAG( pcSPS->getJointCbCrEnabledFlag(), "sps_joint_cbcr_enabled_flag");
#endif
WRITE_FLAG( pcSPS->getWrapAroundEnabledFlag() ? 1 : 0, "sps_ref_wraparound_enabled_flag" ); WRITE_FLAG( pcSPS->getWrapAroundEnabledFlag() ? 1 : 0, "sps_ref_wraparound_enabled_flag" );
if( pcSPS->getWrapAroundEnabledFlag() ) if( pcSPS->getWrapAroundEnabledFlag() )
......