From fa9b665eea1742c2df343211429ba8b31878654a Mon Sep 17 00:00:00 2001 From: Remy Foray <remy.foray@allegrodvt.com> Date: Fri, 6 Sep 2019 20:43:33 +0200 Subject: [PATCH] Fix #499: parsing of rpls_poc_lsb_lt and slice_pos_lsb_lt - rpls_poc_lsb_lt shall be parsed when !ltrp_in_slice_header_flag - When ltrp_in_slice_header_flag = 0, the value of st_ref_pic_flag are needed to parse slice_poc_lsb_lt. Add the update RefPicIdentifier in this case. - Using two separate index ii and j might cause the overwriting of short term information by long term one as the RefPicIdentifier array are common. Remove j. --- source/Lib/DecoderLib/VLCReader.cpp | 12 ++++-------- source/Lib/EncoderLib/VLCWriter.cpp | 12 ++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index 3b1ab66c2..223537e4c 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -304,11 +304,7 @@ void HLSyntaxReader::parseRefPicList(SPS* sps, ReferencePictureList* rpl) int deltaValue = 0; bool firstSTRP = true; -#if JVET_N0100_PROPOSAL1 - for (int ii = 0, j = 0; ii < numRefPic; ii++) -#else for (int ii = 0; ii < numRefPic; ii++) -#endif { isLongTerm = false; if (sps->getLongTermRefsPresent()) @@ -348,12 +344,12 @@ void HLSyntaxReader::parseRefPicList(SPS* sps, ReferencePictureList* rpl) numStrp++; } #if JVET_N0100_PROPOSAL1 - else if (rpl->getLtrpInSliceHeaderFlag()) + else { - READ_CODE(sps->getBitsForPOC(), code, "poc_lsb_lt[listIdx][rplsIdx][j]"); - rpl->setRefPicIdentifier(j, code, isLongTerm); + if (!rpl->getLtrpInSliceHeaderFlag()) + READ_CODE(sps->getBitsForPOC(), code, "poc_lsb_lt[listIdx][rplsIdx][j]"); + rpl->setRefPicIdentifier(ii, code, isLongTerm); numLtrp++; - j++; } #else else // else if( !ltrp_in_slice_header_flag[ listIdx ][ rplsIdx ] ) diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index 557dfeac0..5c4d560dd 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -174,11 +174,7 @@ void HLSWriter::xCodeRefPicList(const ReferencePictureList* rpl, bool isLongTerm int prevDelta = MAX_INT; int deltaValue = 0; bool firstSTRP = true; -#if JVET_N0100_PROPOSAL1 - for (int ii = 0, j = 0; ii < numRefPic; ii++) -#else for (int ii = 0; ii < numRefPic; ii++) -#endif { if (rpl->getNumberOfLongtermPictures() > 0) WRITE_FLAG(!rpl->isRefPicLongterm(ii), "st_ref_pic_flag[ listIdx ][ rplsIdx ][ i ]"); @@ -208,17 +204,13 @@ void HLSWriter::xCodeRefPicList(const ReferencePictureList* rpl, bool isLongTerm WRITE_FLAG((deltaValue < 0) ? 0 : 1, "strp_entry_sign_flag[ listIdx ][ rplsIdx ][ i ]"); //0 means negative delta POC : 1 means positive } #if JVET_N0100_PROPOSAL1 - else if (rpl->getLtrpInSliceHeaderFlag()) - { - WRITE_CODE(rpl->getRefPicIdentifier(j), ltLsbBitsCount, "poc_lsb_lt[listIdx][rplsIdx][j]"); - j++; - } + else if (!rpl->getLtrpInSliceHeaderFlag()) #else else +#endif { WRITE_CODE(rpl->getRefPicIdentifier(ii), ltLsbBitsCount, "poc_lsb_lt[listIdx][rplsIdx][i]"); } -#endif } } -- GitLab