Commit 1899a3f0 authored by Remy Foray's avatar Remy Foray
Browse files

Fix #345: slice_address coding

Align with specification slice_adress coding (num bits might be equal to 0)
parent 11ab7f3b
Pipeline #2003 passed with stage
......@@ -1473,7 +1473,7 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
const uint32_t numValidComp=getNumberValidComponents(chFmt);
const bool bChroma=(chFmt!=CHROMA_400);
int bitsSliceAddress = 1;
int bitsSliceAddress = 0;
if (!pps->getRectSliceFlag())
{
while (pps->getNumTilesInPic() > (1 << bitsSliceAddress)) //TODO: use the correct one
......@@ -1499,7 +1499,10 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
{
if (pps->getRectSliceFlag())
{
READ_CODE(bitsSliceAddress, uiCode, "slice_address");
if(bitsSliceAddress > 0)
READ_CODE(bitsSliceAddress, uiCode, "slice_address");
else
uiCode = 0;
int sliceIdx = 0;
while (pps->getSliceId(sliceIdx) != uiCode && sliceIdx <= pps->getNumSlicesInPicMinus1())
{
......@@ -1510,7 +1513,10 @@ void HLSyntaxReader::parseSliceHeader (Slice* pcSlice, ParameterSetManager *para
}
else
{
READ_CODE(bitsSliceAddress, uiCode, "slice_address");
if(bitsSliceAddress > 0)
READ_CODE(bitsSliceAddress, uiCode, "slice_address");
else
uiCode = 0;
pcSlice->setSliceCurStartBrickIdx(uiCode);
}
}
......
......@@ -1029,7 +1029,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
WRITE_FLAG( pcSlice->getNoOutputPriorPicsFlag() ? 1 : 0, "no_output_of_prior_pics_flag" );
}
WRITE_UVLC( pcSlice->getPPS()->getPPSId(), "slice_pic_parameter_set_id" );
int bitsSliceAddress = 1;
int bitsSliceAddress = 0;
if (!pcSlice->getPPS()->getRectSliceFlag())
{
while (pcSlice->getPPS()->getNumBricksInPic() > (1 << bitsSliceAddress))
......@@ -1051,7 +1051,7 @@ void HLSWriter::codeSliceHeader ( Slice* pcSlice )
}
}
}
if (pcSlice->getPPS()->getRectSliceFlag() || pcSlice->getPPS()->getNumBricksInPic() > 1)
if ((pcSlice->getPPS()->getRectSliceFlag() || pcSlice->getPPS()->getNumBricksInPic() > 1) && bitsSliceAddress > 0)
{
if (pcSlice->getPPS()->getRectSliceFlag())
{
......
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