Ticket #1368: chroma_qp_offset_list_len_minus1.patch

File chroma_qp_offset_list_len_minus1.patch, 1.3 KB (added by kolya, 10 years ago)
Line 
1--- a/source/Lib/TLibCommon/TComSlice.h
2+++ b/source/Lib/TLibCommon/TComSlice.h
3@@ -1206,3 +1206,2 @@
4 
5   Void                   setChromaQpAdjTableAt( Int idx, Int cbOffset, Int crOffset )
6@@ -1211,5 +1210,5 @@
7     m_ChromaQpAdjTable[idx].u.comp.CrOffset = crOffset;
8-    m_ChromaQpAdjTableSize = max(m_ChromaQpAdjTableSize, idx);
9   }
10+
11+  Void                   setChromaQpAdjTableSize(UInt ChromaQpAdjTableSize)               { m_ChromaQpAdjTableSize = ChromaQpAdjTableSize};
12 
13diff --git a/source/Lib/TLibDecoder/TDecCAVLC.cpp b/source/Lib/TLibDecoder/TDecCAVLC.cpp
14index f094642..ce21066 100644
15--- a/source/Lib/TLibDecoder/TDecCAVLC.cpp
16+++ b/source/Lib/TLibDecoder/TDecCAVLC.cpp
17@@ -389,4 +389,7 @@
18               READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1");
19-              /* skip zero index */
20-              for (Int chromaQpAdjustmentIndex = 1; chromaQpAdjustmentIndex <= (tableSizeMinus1 + 1); chromaQpAdjustmentIndex++)
21+              pcPPS->setChromaQpAdjTableSize(tableSizeMinus1);
22+
23+              assert((tableSizeMinus1() >= 0) && (tableSizeMinus1 <=5) );
24+
25+              for (Int chromaQpAdjustmentIndex = 0; chromaQpAdjustmentIndex <= tableSizeMinus1; chromaQpAdjustmentIndex++)
26               {
27@@ -398,3 +401,2 @@
28               }
29-              assert(pcPPS->getChromaQpAdjTableSize() == tableSizeMinus1 + 1);
30             }