Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#237 closed defect (duplicate)

When GOPSize=1, Decode mistake after IDR

Reported by: chenm003 Owned by:
Priority: critical Milestone: HM-5.1
Component: HM Version: HM-5.0
Keywords: Cc: fbossen, ksuehring, davidf, jct-vc@…

Description (last modified by ksuehring)

I am try the code in branch HM-4.1-dev.
I found there some bug.
In the Encoder, when encode IDR, the POC is prev_POC+1, but Decoder assume thet zero.
So G1002_RPS will hit some bug.

my cfg:


DecodingRefreshType : 2
GOPSize : 1
Frame1: P 1 1 0.442 0 2 1 1 -1 0
ListCombination : 0

my temp patch:


diff --git a/source/App/TAppEncoder/TAppEncCfg.cpp b/source/App/TAppEncoder/TAppEncCfg.cpp
index 2f11333..ef1b709 100644
--- a/source/App/TAppEncoder/TAppEncCfg.cpp
+++ b/source/App/TAppEncoder/TAppEncCfg.cpp
@@ -94,6 +94,7 @@ Void TAppEncCfg::destroy()
 #if G1002_RPS
 std::istringstream &operator>>(std::istringstream &in, GOPEntry &entry)     //input
 {
+  memset(&entry, 0, sizeof(entry));
   in>>entry.m_iSliceType;
   in>>entry.m_iPOC;
   in>>entry.m_iQPOffset;
diff --git a/source/Lib/TLibEncoder/TEncCavlc.cpp b/source/Lib/TLibEncoder/TEncCavlc.cpp
index 77a4820..dd1ad97 100644
--- a/source/Lib/TLibEncoder/TEncCavlc.cpp
+++ b/source/Lib/TLibEncoder/TEncCavlc.cpp
@@ -549,6 +549,7 @@ Void TEncCavlc::codeSliceHeader         ( TComSlice* pcSlice )
     {
       WRITE_UVLC( 0, "idr_pic_id" );
       WRITE_FLAG( 0, "no_output_of_prior_pics_flag" );
+      pcSlice->setPOC(0);
     }
     else
     {
diff --git a/source/Lib/TLibEncoder/TEncGOP.cpp b/source/Lib/TLibEncoder/TEncGOP.cpp
index 1662fbd..5392d3b 100644
--- a/source/Lib/TLibEncoder/TEncGOP.cpp
+++ b/source/Lib/TLibEncoder/TEncGOP.cpp
@@ -141,7 +141,7 @@ Void TEncGOP::init ( TEncTop* pcTEncTop )
 // ====================================================================================================================
 // Public member functions
 // ====================================================================================================================
-Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP)
+Void TEncGOP::compressGOP( Int& iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsInGOP)
 {
   TComPic*        pcPic;
   TComPicYuv*     pcPicYuvRecOut;
@@ -286,6 +286,9 @@ Void TEncGOP::compressGOP( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rc
         pcSlice->setSliceType(P_SLICE);
       }
 #endif
+    if (getNalUnitType(uiPOCCurr) == NAL_UNIT_CODED_SLICE_IDR)
+        iPOCLast = 0;
+
       // Set the nal unit type
       pcSlice->setNalUnitType(getNalUnitType(uiPOCCurr));
       // Do decoding refresh marking if any 
diff --git a/source/Lib/TLibEncoder/TEncGOP.h b/source/Lib/TLibEncoder/TEncGOP.h
index 9ab1c3b..c3cfb45 100644
--- a/source/Lib/TLibEncoder/TEncGOP.h
+++ b/source/Lib/TLibEncoder/TEncGOP.h
@@ -129,7 +129,7 @@ public:
   Void  destroy     ();
   
   Void  init        ( TEncTop* pcTEncTop );
-  Void  compressGOP ( Int iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP );
+  Void  compressGOP ( Int& iPOCLast, Int iNumPicRcvd, TComList<TComPic*>& rcListPic, TComList<TComPicYuv*>& rcListPicYuvRec, std::list<AccessUnit>& accessUnitsInGOP );
 #if TILES_DECODER
   Void xWriteTileLocationToSliceHeader (OutputNALUnit& rNalu, TComOutputBitstream*& rpcBitstreamRedirect, TComSlice*& rpcSlice);
 #endif

Attachments (1)

patch0.patch (7.0 KB) - added by chenm003 13 years ago.
Patch for bug when GOPSize=1

Download all attachments as: .zip

Change History (10)

comment:1 Changed 13 years ago by DefaultCC Plugin

  • Cc fbossen ksuehring davidf added

comment:2 Changed 13 years ago by davidf

Updating component after adding WD (Text) tickets

Changed 13 years ago by chenm003

Patch for bug when GOPSize=1

comment:3 Changed 13 years ago by chenm003

  • Version changed from HM-4.1 to HM-5.0rc1

I update my patch for decoder's wrong when output YUV.

comment:4 Changed 13 years ago by chenm003

When I setting LoopFilterDisable=0, decoder will crash when 2nd IDR.
The patch solve this bug also.

comment:5 Changed 13 years ago by ksuehring

  • Milestone set to HM-5.1

comment:6 Changed 13 years ago by ksuehring

  • Description modified (diff)

comment:7 Changed 13 years ago by ksuehring

  • Resolution set to fixed
  • Status changed from new to closed
  • Version changed from HM-5.0rc1 to HM-5.0

A fix has been provided by Rickard in HM-5.0-dev-bugfix r1719

comment:8 Changed 13 years ago by ksuehring

  • Resolution changed from fixed to duplicate

Closed as duplicate of #271.

comment:9 Changed 13 years ago by davidf

  • Cc jct-vc@… added
Note: See TracTickets for help on using tickets.

This list contains all users that will be notified about changes made to this ticket.

These roles will be notified: Reporter, Owner, Subscriber, Participant

  • chenm003(Reporter, Participant)
  • David Flynn(Subscriber, Participant)
  • Frank Bossen(Subscriber)
  • jct-vc@…(Subscriber)
  • karl.sharman@…(Always)
  • Karsten Suehring(Subscriber, Participant, Always)