Changeset 1265 in SHVCSoftware
- Timestamp:
- 14 Jul 2015, 03:43:14 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1262 r1265 101 101 Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags 102 102 Char* m_phQP; ///< array of QP values 103 UChar* m_ChromaQpAdj; ///< array of chroma QP adjustments (indexed) 103 UChar* m_ChromaQpAdj; ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 104 104 UInt m_codedChromaQpAdj; 105 105 UChar* m_puhTrIdx; ///< array of transform indices … … 267 267 Char getCodedQP () { return m_codedQP; } 268 268 269 UChar* getChromaQpAdj () { return m_ChromaQpAdj; } 270 UChar getChromaQpAdj (Int idx) const { return m_ChromaQpAdj[idx]; } 271 Void setChromaQpAdj (Int idx, UChar val) { m_ChromaQpAdj[idx] = val; } 269 UChar* getChromaQpAdj () { return m_ChromaQpAdj; } ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 270 UChar getChromaQpAdj (Int idx) const { return m_ChromaQpAdj[idx]; } ///< When value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 271 Void setChromaQpAdj (Int idx, UChar val) { m_ChromaQpAdj[idx] = val; } ///< When val = 0, cu_chroma_qp_offset_flag=0; when val>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=val-1 272 272 Void setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth ); 273 273 Void setCodedChromaQpAdj ( Char qp ) { m_codedChromaQpAdj = qp; } -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1260 r1265 2295 2295 m_saoOffsetBitShift[ch] = 0; 2296 2296 } 2297 m_ChromaQpAdjTable [0].u.comp.CbOffset = 0;2298 m_ChromaQpAdjTable [0].u.comp.CrOffset = 0;2297 m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.CbOffset = 0; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0. This is initialised here and never subsequently changed. 2298 m_ChromaQpAdjTableIncludingNullEntry[0].u.comp.CrOffset = 0; 2299 2299 2300 2300 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1259 r1265 1615 1615 // Chroma QP Adjustments 1616 1616 Int m_MaxCuChromaQpAdjDepth; 1617 Int m_ChromaQpAdjTableSize; 1618 ChromaQpAdj m_ChromaQpAdjTable [7];1617 Int m_ChromaQpAdjTableSize; // size (excludes the null entry used in the following array). 1618 ChromaQpAdj m_ChromaQpAdjTableIncludingNullEntry[1+MAX_QP_OFFSET_LIST_SIZE]; //!< Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise 1619 1619 1620 1620 Int m_chromaCbQpOffset; … … 1725 1725 Void clearChromaQpAdjTable() { m_ChromaQpAdjTableSize = 0; } 1726 1726 Int getChromaQpAdjTableSize() const { return m_ChromaQpAdjTableSize; } 1727 const ChromaQpAdj& getChromaQpAdjTableAt( Int idx ) const { return m_ChromaQpAdjTable[idx]; } 1728 Void setChromaQpAdjTableAt( Int idx, Int cbOffset, Int crOffset )1727 1728 const ChromaQpAdj& getChromaQpAdjTableAt( Int cuChromaQpOffsetIdxPlus1 ) const 1729 1729 { 1730 m_ChromaQpAdjTable[idx].u.comp.CbOffset = cbOffset; 1731 m_ChromaQpAdjTable[idx].u.comp.CrOffset = crOffset; 1732 m_ChromaQpAdjTableSize = max(m_ChromaQpAdjTableSize, idx); 1730 assert(cuChromaQpOffsetIdxPlus1 < m_ChromaQpAdjTableSize+1); 1731 return m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1]; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise 1732 } 1733 1734 Void setChromaQpAdjTableAt( Int cuChromaQpOffsetIdxPlus1, Int cbOffset, Int crOffset ) 1735 { 1736 assert (cuChromaQpOffsetIdxPlus1 != 0 && cuChromaQpOffsetIdxPlus1 <= MAX_QP_OFFSET_LIST_SIZE); 1737 m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CbOffset = cbOffset; // Array includes entry [0] for the null offset used when cu_chroma_qp_offset_flag=0, and entries [cu_chroma_qp_offset_idx+1...] otherwise 1738 m_ChromaQpAdjTableIncludingNullEntry[cuChromaQpOffsetIdxPlus1].u.comp.CrOffset = crOffset; 1739 m_ChromaQpAdjTableSize = max(m_ChromaQpAdjTableSize, cuChromaQpOffsetIdxPlus1); 1733 1740 } 1734 1741 -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1259 r1265 314 314 #define O0043_BEST_EFFORT_DECODING 0 ///< 0 (default) = disable code related to best effort decoding, 1 = enable code relating to best effort decoding [ decode-side only ]. 315 315 316 #define MAX_QP_OFFSET_LIST_SIZE 6 ///< Maximum size of QP offset list is 6 entries 316 317 // Cost mode support 317 318 -
branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp
r1264 r1265 385 385 UInt tableSizeMinus1 = 0; 386 386 READ_UVLC(tableSizeMinus1, "chroma_qp_offset_list_len_minus1"); 387 /* skip zero index */ 388 for (Int chromaQpAdjustmentIndex = 1; chromaQpAdjustmentIndex <= (tableSizeMinus1 + 1); chromaQpAdjustmentIndex++) 387 assert(tableSizeMinus1 < MAX_QP_OFFSET_LIST_SIZE); 388 389 for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx <= (tableSizeMinus1); cuChromaQpOffsetIdx++) 389 390 { 390 391 Int cbOffset; … … 394 395 READ_SVLC(crOffset, "cr_qp_offset_list[i]"); 395 396 assert(crOffset >= -12 && crOffset <= 12); 396 pcPPS->setChromaQpAdjTableAt(chromaQpAdjustmentIndex, cbOffset, crOffset); 397 // table uses +1 for index (see comment inside the function) 398 pcPPS->setChromaQpAdjTableAt(cuChromaQpOffsetIdx+1, cbOffset, crOffset); 397 399 } 398 400 assert(pcPPS->getChromaQpAdjTableSize() == tableSizeMinus1 + 1); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp
r1261 r1265 300 300 WRITE_UVLC(pcPPS->getChromaQpAdjTableSize() - 1, "chroma_qp_offset_list_len_minus1"); 301 301 /* skip zero index */ 302 for (Int c hromaQpAdjustmentIndex = 1; chromaQpAdjustmentIndex <= pcPPS->getChromaQpAdjTableSize(); chromaQpAdjustmentIndex++)302 for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx < pcPPS->getChromaQpAdjTableSize(); cuChromaQpOffsetIdx++) 303 303 { 304 WRITE_SVLC(pcPPS->getChromaQpAdjTableAt(c hromaQpAdjustmentIndex).u.comp.CbOffset, "cb_qp_offset_list[i]");305 WRITE_SVLC(pcPPS->getChromaQpAdjTableAt(c hromaQpAdjustmentIndex).u.comp.CrOffset, "cr_qp_offset_list[i]");304 WRITE_SVLC(pcPPS->getChromaQpAdjTableAt(cuChromaQpOffsetIdx+1).u.comp.CbOffset, "cb_qp_offset_list[i]"); 305 WRITE_SVLC(pcPPS->getChromaQpAdjTableAt(cuChromaQpOffsetIdx+1).u.comp.CrOffset, "cr_qp_offset_list[i]"); 306 306 } 307 307 }
Note: See TracChangeset for help on using the changeset viewer.