Commit f634e8b5 authored by Remy Foray's avatar Remy Foray Committed by Karsten Suehring

Fix #356: fix value of SPS::m_numRPL0/1

Set SPS::m_numRPL0/1 equal to num_ref_pic_lists_in_sps instead of num_ref_pic_lists_in_sps + 1.
This allow to align the parsing of slice_header with specification when
getNumRPL0() or getNumRPL1() are called (correspond to the condition on
num_ref_pic_lists_in_sps in the specfication).
parent 5b3c1127
......@@ -1458,14 +1458,14 @@ SPS::~SPS()
void SPS::createRPLList0(int numRPL)
{
m_RPLList0.destroy();
m_RPLList0.create(numRPL);
m_RPLList0.create(numRPL + 1);
m_numRPL0 = numRPL;
m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false;
}
void SPS::createRPLList1(int numRPL)
{
m_RPLList1.destroy();
m_RPLList1.create(numRPL);
m_RPLList1.create(numRPL + 1);
m_numRPL1 = numRPL;
m_rpl1IdxPresentFlag = (m_numRPL0 != m_numRPL1) ? true : false;
......
......@@ -1087,7 +1087,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
//Read candidate for List0
READ_UVLC(uiCode, "num_ref_pic_lists_in_sps[0]");
uint32_t numberOfRPL = uiCode;
pcSPS->createRPLList0(numberOfRPL + 1);
pcSPS->createRPLList0(numberOfRPL);
RPLList* rplList = pcSPS->getRPLList0();
ReferencePictureList* rpl;
for (uint32_t ii = 0; ii < numberOfRPL; ii++)
......@@ -1101,7 +1101,7 @@ void HLSyntaxReader::parseSPS(SPS* pcSPS)
{
READ_UVLC(uiCode, "num_ref_pic_lists_in_sps[1]");
numberOfRPL = uiCode;
pcSPS->createRPLList1(numberOfRPL + 1);
pcSPS->createRPLList1(numberOfRPL);
rplList = pcSPS->getRPLList1();
for (uint32_t ii = 0; ii < numberOfRPL; ii++)
{
......
......@@ -1291,8 +1291,8 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
ReferencePictureList* rpl;
int numRPLCandidates = getRPLCandidateSize(0);
sps.createRPLList0(numRPLCandidates + 1);
sps.createRPLList1(numRPLCandidates + 1);
sps.createRPLList0(numRPLCandidates);
sps.createRPLList1(numRPLCandidates);
RPLList* rplList = 0;
for (int i = 0; i < 2; i++)
......@@ -1317,7 +1317,7 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
//Check RPLL0 first
const RPLList* rplList0 = sps.getRPLList0();
const RPLList* rplList1 = sps.getRPLList1();
uint32_t numberOfRPL = sps.getNumRPL0() - 1;
uint32_t numberOfRPL = sps.getNumRPL0();
bool isAllEntriesinRPLHasSameSignFlag = true;
bool isFirstEntry = true;
......@@ -1339,7 +1339,7 @@ void EncLib::xInitRPL(SPS &sps, bool isFieldCoding)
}
}
//Check RPLL1. Skip it if it is already found out that this flag is not true for RPL0 or if RPL1 is the same as RPL0
numberOfRPL = sps.getNumRPL1() - 1;
numberOfRPL = sps.getNumRPL1();
isFirstEntry = true;
lastSign = true;
for (uint32_t ii = 0; isAllEntriesinRPLHasSameSignFlag && !sps.getRPL1CopyFromRPL0Flag() && ii < numberOfRPL; ii++)
......
......@@ -722,10 +722,9 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
const RPLList* rplList0 = pcSPS->getRPLList0();
const RPLList* rplList1 = pcSPS->getRPLList1();
uint32_t numberOfRPL = pcSPS->getNumRPL0() - 1;
//Write candidate for List0
numberOfRPL = pcSPS->getNumRPL0() - 1;
uint32_t numberOfRPL = pcSPS->getNumRPL0();
WRITE_UVLC(numberOfRPL, "num_ref_pic_lists_in_sps[0]");
for (int ii = 0; ii < numberOfRPL; ii++)
{
......@@ -736,7 +735,7 @@ void HLSWriter::codeSPS( const SPS* pcSPS )
//Write candidate for List1
if (!pcSPS->getRPL1CopyFromRPL0Flag())
{
numberOfRPL = pcSPS->getNumRPL1() - 1;
numberOfRPL = pcSPS->getNumRPL1();
WRITE_UVLC(numberOfRPL, "num_ref_pic_lists_in_sps[1]");
for (int ii = 0; ii < numberOfRPL; ii++)
{
......
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