Changeset 1265 in SHVCSoftware


Ignore:
Timestamp:
14 Jul 2015, 03:43:14 (9 years ago)
Author:
seregin
Message:

port rev 4262

Location:
branches/SHM-dev/source/Lib
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h

    r1262 r1265  
    101101  Bool*          m_CUTransquantBypass;   ///< array of cu_transquant_bypass flags
    102102  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
    104104  UInt           m_codedChromaQpAdj;
    105105  UChar*         m_puhTrIdx;           ///< array of transform indices
     
    267267  Char          getCodedQP            ()                        { return m_codedQP;           }
    268268
    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
    272272  Void          setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth );
    273273  Void          setCodedChromaQpAdj   ( Char qp )               { m_codedChromaQpAdj = qp;    }
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp

    r1260 r1265  
    22952295    m_saoOffsetBitShift[ch] = 0;
    22962296  }
    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;
    22992299
    23002300#if SVC_EXTENSION
  • branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h

    r1259 r1265  
    16151615  // Chroma QP Adjustments
    16161616  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
    16191619
    16201620  Int              m_chromaCbQpOffset;
     
    17251725  Void                   clearChromaQpAdjTable()                                          { m_ChromaQpAdjTableSize = 0;                   }
    17261726  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
    17291729  {
    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);
    17331740  }
    17341741
  • branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h

    r1259 r1265  
    314314#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 ].
    315315
     316#define MAX_QP_OFFSET_LIST_SIZE                           6 ///< Maximum size of QP offset list is 6 entries
    316317// Cost mode support
    317318
  • branches/SHM-dev/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r1264 r1265  
    385385              UInt tableSizeMinus1 = 0;
    386386              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++)
    389390              {
    390391                Int cbOffset;
     
    394395                READ_SVLC(crOffset, "cr_qp_offset_list[i]");
    395396                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);
    397399              }
    398400              assert(pcPPS->getChromaQpAdjTableSize() == tableSizeMinus1 + 1);
  • branches/SHM-dev/source/Lib/TLibEncoder/TEncCavlc.cpp

    r1261 r1265  
    300300              WRITE_UVLC(pcPPS->getChromaQpAdjTableSize() - 1,                    "chroma_qp_offset_list_len_minus1");
    301301              /* skip zero index */
    302               for (Int chromaQpAdjustmentIndex = 1; chromaQpAdjustmentIndex <= pcPPS->getChromaQpAdjTableSize(); chromaQpAdjustmentIndex++)
     302              for (Int cuChromaQpOffsetIdx = 0; cuChromaQpOffsetIdx < pcPPS->getChromaQpAdjTableSize(); cuChromaQpOffsetIdx++)
    303303              {
    304                 WRITE_SVLC(pcPPS->getChromaQpAdjTableAt(chromaQpAdjustmentIndex).u.comp.CbOffset,     "cb_qp_offset_list[i]");
    305                 WRITE_SVLC(pcPPS->getChromaQpAdjTableAt(chromaQpAdjustmentIndex).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]");
    306306              }
    307307            }
Note: See TracChangeset for help on using the changeset viewer.