[5] | 1 | /* The copyright in this software is being made available under the BSD |
---|
| 2 | * License, included below. This software may be subject to other third party |
---|
| 3 | * and contributor rights, including patent rights, and no such rights are |
---|
| 4 | * granted under this license. |
---|
| 5 | * |
---|
| 6 | * Copyright (c) 2010-2011, ISO/IEC |
---|
| 7 | * All rights reserved. |
---|
| 8 | * |
---|
| 9 | * Redistribution and use in source and binary forms, with or without |
---|
| 10 | * modification, are permitted provided that the following conditions are met: |
---|
| 11 | * |
---|
| 12 | * * Redistributions of source code must retain the above copyright notice, |
---|
| 13 | * this list of conditions and the following disclaimer. |
---|
| 14 | * * Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | * this list of conditions and the following disclaimer in the documentation |
---|
| 16 | * and/or other materials provided with the distribution. |
---|
| 17 | * * Neither the name of the ISO/IEC nor the names of its contributors may |
---|
| 18 | * be used to endorse or promote products derived from this software without |
---|
| 19 | * specific prior written permission. |
---|
| 20 | * |
---|
| 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 23 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 24 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS |
---|
| 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
---|
| 31 | * THE POSSIBILITY OF SUCH DAMAGE. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | |
---|
| 35 | |
---|
[2] | 36 | /** \file TComSlice.cpp |
---|
| 37 | \brief slice header and SPS class |
---|
| 38 | */ |
---|
| 39 | |
---|
| 40 | #include "CommonDef.h" |
---|
| 41 | #include "TComSlice.h" |
---|
| 42 | #include "TComPic.h" |
---|
| 43 | |
---|
| 44 | TComSlice::TComSlice() |
---|
| 45 | { |
---|
| 46 | m_uiPPSId = 0; |
---|
| 47 | m_iPOC = 0; |
---|
| 48 | m_eSliceType = I_SLICE; |
---|
| 49 | m_iSliceQp = 0; |
---|
| 50 | m_iSymbolMode = 1; |
---|
| 51 | m_aiNumRefIdx[0] = 0; |
---|
| 52 | m_aiNumRefIdx[1] = 0; |
---|
| 53 | m_bLoopFilterDisable = false; |
---|
[5] | 54 | |
---|
[2] | 55 | m_iSliceQpDelta = 0; |
---|
[5] | 56 | |
---|
[2] | 57 | m_iDepth = 0; |
---|
[5] | 58 | |
---|
[2] | 59 | m_pcPic = NULL; |
---|
| 60 | m_bRefenced = false; |
---|
| 61 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
| 62 | m_bRounding = false; |
---|
| 63 | #endif |
---|
| 64 | m_uiColDir = 0; |
---|
[5] | 65 | |
---|
[2] | 66 | m_iViewIdx = 0 ; |
---|
| 67 | |
---|
| 68 | initEqualRef(); |
---|
| 69 | m_bNoBackPredFlag = false; |
---|
| 70 | #if MS_LCEC_LOOKUP_TABLE_EXCEPTION |
---|
| 71 | m_bRefIdxCombineCoding = false; |
---|
| 72 | #endif |
---|
[5] | 73 | #if DCM_COMB_LIST |
---|
[2] | 74 | m_bRefPicListCombinationFlag = false; |
---|
| 75 | m_bRefPicListModificationFlagLC = false; |
---|
| 76 | #endif |
---|
| 77 | m_uiSliceCurStartCUAddr = 0; |
---|
| 78 | m_uiEntropySliceCurStartCUAddr = 0; |
---|
| 79 | |
---|
| 80 | ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); |
---|
| 81 | ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); |
---|
| 82 | m_pcTexturePic = NULL; |
---|
| 83 | #ifdef WEIGHT_PRED |
---|
| 84 | resetWpScaling(m_weightPredTable); |
---|
| 85 | initWpAcDcParam(); |
---|
| 86 | #endif |
---|
[12] | 87 | |
---|
| 88 | #if POZNAN_MP |
---|
| 89 | m_pcMP = NULL; |
---|
| 90 | #endif |
---|
[2] | 91 | } |
---|
| 92 | |
---|
| 93 | TComSlice::~TComSlice() |
---|
| 94 | { |
---|
[12] | 95 | #if POZNAN_MP |
---|
| 96 | m_pcMP = NULL; |
---|
| 97 | #endif |
---|
[2] | 98 | } |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | Void TComSlice::initSlice() |
---|
| 102 | { |
---|
| 103 | m_aiNumRefIdx[0] = 0; |
---|
| 104 | m_aiNumRefIdx[1] = 0; |
---|
[5] | 105 | |
---|
[2] | 106 | m_uiColDir = 0; |
---|
| 107 | |
---|
| 108 | ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); |
---|
| 109 | ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); |
---|
| 110 | m_pcTexturePic = NULL; |
---|
[5] | 111 | |
---|
[2] | 112 | initEqualRef(); |
---|
| 113 | m_bNoBackPredFlag = false; |
---|
| 114 | #if MS_LCEC_LOOKUP_TABLE_EXCEPTION |
---|
| 115 | m_bRefIdxCombineCoding = false; |
---|
| 116 | #endif |
---|
[5] | 117 | #if DCM_COMB_LIST |
---|
[2] | 118 | m_bRefPicListCombinationFlag = false; |
---|
| 119 | m_bRefPicListModificationFlagLC = false; |
---|
| 120 | #endif |
---|
| 121 | } |
---|
| 122 | |
---|
| 123 | Void TComSlice::sortPicList (TComList<TComPic*>& rcListPic) |
---|
| 124 | { |
---|
| 125 | TComPic* pcPicExtract; |
---|
| 126 | TComPic* pcPicInsert; |
---|
[5] | 127 | |
---|
[2] | 128 | TComList<TComPic*>::iterator iterPicExtract; |
---|
| 129 | TComList<TComPic*>::iterator iterPicExtract_1; |
---|
| 130 | TComList<TComPic*>::iterator iterPicInsert; |
---|
[5] | 131 | |
---|
[2] | 132 | for (Int i = 1; i < (Int)(rcListPic.size()); i++) |
---|
| 133 | { |
---|
| 134 | iterPicExtract = rcListPic.begin(); |
---|
| 135 | for (Int j = 0; j < i; j++) iterPicExtract++; |
---|
| 136 | pcPicExtract = *(iterPicExtract); |
---|
| 137 | pcPicExtract->setCurrSliceIdx(0); |
---|
[5] | 138 | |
---|
[2] | 139 | iterPicInsert = rcListPic.begin(); |
---|
| 140 | while (iterPicInsert != iterPicExtract) |
---|
| 141 | { |
---|
| 142 | pcPicInsert = *(iterPicInsert); |
---|
| 143 | pcPicInsert->setCurrSliceIdx(0); |
---|
| 144 | if (pcPicInsert->getPOC() >= pcPicExtract->getPOC()) |
---|
| 145 | { |
---|
| 146 | break; |
---|
| 147 | } |
---|
[5] | 148 | |
---|
[2] | 149 | iterPicInsert++; |
---|
| 150 | } |
---|
[5] | 151 | |
---|
[2] | 152 | iterPicExtract_1 = iterPicExtract; iterPicExtract_1++; |
---|
[5] | 153 | |
---|
[2] | 154 | // swap iterPicExtract and iterPicInsert, iterPicExtract = curr. / iterPicInsert = insertion position |
---|
| 155 | rcListPic.insert (iterPicInsert, iterPicExtract, iterPicExtract_1); |
---|
| 156 | rcListPic.erase (iterPicExtract); |
---|
| 157 | } |
---|
| 158 | } |
---|
| 159 | |
---|
| 160 | Void TComSlice::setRefPOCList () |
---|
| 161 | { |
---|
| 162 | for (Int iDir = 0; iDir < 2; iDir++) |
---|
| 163 | { |
---|
| 164 | for (Int iNumRefIdx = 0; iNumRefIdx < m_aiNumRefIdx[iDir]; iNumRefIdx++) |
---|
| 165 | { |
---|
| 166 | m_aiRefPOCList[iDir][iNumRefIdx] = m_apcRefPicList[iDir][iNumRefIdx]->getPOC(); |
---|
| 167 | } |
---|
| 168 | } |
---|
| 169 | |
---|
| 170 | } |
---|
| 171 | |
---|
[5] | 172 | #if DCM_COMB_LIST |
---|
[2] | 173 | Void TComSlice::generateCombinedList() |
---|
| 174 | { |
---|
| 175 | if(m_aiNumRefIdx[REF_PIC_LIST_C] > 0) |
---|
| 176 | { |
---|
| 177 | m_aiNumRefIdx[REF_PIC_LIST_C]=0; |
---|
| 178 | for(Int iNumCount = 0; iNumCount < MAX_NUM_REF_LC; iNumCount++) |
---|
| 179 | { |
---|
| 180 | m_iRefIdxOfLC[REF_PIC_LIST_0][iNumCount]=-1; |
---|
| 181 | m_iRefIdxOfLC[REF_PIC_LIST_1][iNumCount]=-1; |
---|
| 182 | m_eListIdFromIdxOfLC[iNumCount]=0; |
---|
| 183 | m_iRefIdxFromIdxOfLC[iNumCount]=0; |
---|
| 184 | m_iRefIdxOfL0FromRefIdxOfL1[iNumCount] = -1; |
---|
| 185 | m_iRefIdxOfL1FromRefIdxOfL0[iNumCount] = -1; |
---|
| 186 | } |
---|
| 187 | |
---|
| 188 | for (Int iNumRefIdx = 0; iNumRefIdx < MAX_NUM_REF; iNumRefIdx++) |
---|
| 189 | { |
---|
| 190 | if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_0]){ |
---|
| 191 | Bool bTempRefIdxInL2 = true; |
---|
| 192 | for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ ) |
---|
| 193 | { |
---|
| 194 | if (( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() ) && |
---|
| 195 | ( m_apcRefPicList[REF_PIC_LIST_0][iNumRefIdx]->getViewIdx() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getViewIdx() )) |
---|
| 196 | { |
---|
| 197 | m_iRefIdxOfL1FromRefIdxOfL0[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC]; |
---|
| 198 | m_iRefIdxOfL0FromRefIdxOfL1[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx; |
---|
| 199 | bTempRefIdxInL2 = false; |
---|
| 200 | assert(m_eListIdFromIdxOfLC[iRefIdxLC]==REF_PIC_LIST_1); |
---|
| 201 | break; |
---|
| 202 | } |
---|
| 203 | } |
---|
| 204 | |
---|
| 205 | if(bTempRefIdxInL2 == true) |
---|
[5] | 206 | { |
---|
[2] | 207 | m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_0; |
---|
| 208 | m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx; |
---|
| 209 | m_iRefIdxOfLC[REF_PIC_LIST_0][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++; |
---|
| 210 | } |
---|
| 211 | } |
---|
| 212 | |
---|
| 213 | if(iNumRefIdx < m_aiNumRefIdx[REF_PIC_LIST_1]){ |
---|
| 214 | Bool bTempRefIdxInL2 = true; |
---|
| 215 | for ( Int iRefIdxLC = 0; iRefIdxLC < m_aiNumRefIdx[REF_PIC_LIST_C]; iRefIdxLC++ ) |
---|
| 216 | { |
---|
| 217 | if (( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getPOC() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getPOC() ) && |
---|
| 218 | ( m_apcRefPicList[REF_PIC_LIST_1][iNumRefIdx]->getViewIdx() == m_apcRefPicList[m_eListIdFromIdxOfLC[iRefIdxLC]][m_iRefIdxFromIdxOfLC[iRefIdxLC]]->getViewIdx() )) |
---|
| 219 | { |
---|
| 220 | m_iRefIdxOfL0FromRefIdxOfL1[iNumRefIdx] = m_iRefIdxFromIdxOfLC[iRefIdxLC]; |
---|
| 221 | m_iRefIdxOfL1FromRefIdxOfL0[m_iRefIdxFromIdxOfLC[iRefIdxLC]] = iNumRefIdx; |
---|
| 222 | bTempRefIdxInL2 = false; |
---|
| 223 | assert(m_eListIdFromIdxOfLC[iRefIdxLC]==REF_PIC_LIST_0); |
---|
| 224 | break; |
---|
| 225 | } |
---|
| 226 | } |
---|
| 227 | if(bTempRefIdxInL2 == true) |
---|
| 228 | { |
---|
| 229 | m_eListIdFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = REF_PIC_LIST_1; |
---|
| 230 | m_iRefIdxFromIdxOfLC[m_aiNumRefIdx[REF_PIC_LIST_C]] = iNumRefIdx; |
---|
| 231 | m_iRefIdxOfLC[REF_PIC_LIST_1][iNumRefIdx] = m_aiNumRefIdx[REF_PIC_LIST_C]++; |
---|
| 232 | } |
---|
| 233 | } |
---|
| 234 | } |
---|
| 235 | } |
---|
| 236 | } |
---|
| 237 | #endif |
---|
| 238 | |
---|
| 239 | Void TComSlice::setRefPicListFromGOPSTring( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics ) |
---|
| 240 | { |
---|
| 241 | |
---|
| 242 | if (m_eSliceType == I_SLICE) |
---|
| 243 | { |
---|
| 244 | ::memset( m_apcRefPicList, 0, sizeof (m_apcRefPicList)); |
---|
| 245 | ::memset( m_aiNumRefIdx, 0, sizeof ( m_aiNumRefIdx )); |
---|
| 246 | |
---|
| 247 | return; |
---|
| 248 | } |
---|
| 249 | |
---|
| 250 | sortPicList(rcListPic); |
---|
| 251 | assert( m_eSliceType != P_SLICE || m_pcPic->getNumRefs( REF_PIC_LIST_1 ) == 0 ); |
---|
| 252 | for(Int iRefList = 0; iRefList<2; iRefList++ ) |
---|
| 253 | { |
---|
| 254 | RefPicList eRefList = (RefPicList) iRefList; |
---|
| 255 | m_aiNumRefIdx[eRefList] = m_pcPic->getNumRefs( eRefList ); |
---|
| 256 | for( Int i =0; i<m_pcPic->getNumRefs(eRefList); i++ ) |
---|
| 257 | { |
---|
| 258 | const int iRefPoc = m_pcPic->getRefPOC( eRefList, i ); |
---|
| 259 | const int iRefViewIdx = m_pcPic->getRefViewIdx( eRefList, i ); |
---|
| 260 | m_aiRefPOCList[eRefList][i] = iRefPoc; |
---|
| 261 | m_aiRefViewList[eRefList][i] = iRefViewIdx; |
---|
| 262 | |
---|
| 263 | TComPic* pcRefPic = NULL; |
---|
| 264 | if( iRefViewIdx == m_iViewIdx ) |
---|
| 265 | { |
---|
| 266 | // temporal prediction from current view |
---|
| 267 | for( TComList<TComPic*>::iterator it = rcListPic.begin(); it!=rcListPic.end(); it++) |
---|
| 268 | { |
---|
| 269 | if((*it)->getPOC() == iRefPoc) |
---|
| 270 | { |
---|
| 271 | pcRefPic = *it; |
---|
| 272 | break; |
---|
| 273 | } |
---|
| 274 | } |
---|
| 275 | assert( pcRefPic ); |
---|
| 276 | if( pcRefPic == NULL && iRefPoc > m_iPOC ) |
---|
| 277 | { |
---|
| 278 | const int iAltRefPoc = m_iPOC-(iRefPoc-m_iPOC) ; |
---|
| 279 | m_aiRefPOCList[eRefList][i] = iAltRefPoc ; |
---|
| 280 | for( TComList<TComPic*>::iterator it = rcListPic.begin(); it!=rcListPic.end(); it++) |
---|
| 281 | { |
---|
| 282 | if((*it)->getPOC() == iAltRefPoc) |
---|
| 283 | { |
---|
| 284 | pcRefPic = *it ; |
---|
| 285 | break; |
---|
| 286 | } |
---|
| 287 | } |
---|
| 288 | } |
---|
| 289 | } |
---|
| 290 | else |
---|
| 291 | { |
---|
| 292 | // inter-view prediction |
---|
| 293 | assert( iRefPoc == m_iPOC ); |
---|
| 294 | assert( 0 <= iRefViewIdx && iRefViewIdx < rapcSpatRefPics.size() ); |
---|
| 295 | pcRefPic = rapcSpatRefPics[iRefViewIdx]; |
---|
| 296 | } |
---|
| 297 | if( pcRefPic ) |
---|
| 298 | { |
---|
| 299 | m_apcRefPicList[eRefList][i] = pcRefPic; |
---|
| 300 | pcRefPic->getPicYuvRec()->extendPicBorder(); |
---|
| 301 | } |
---|
| 302 | else |
---|
| 303 | { |
---|
| 304 | printf("\n inconsistence in gop string!") ; // gop string inconsistent |
---|
| 305 | assert(0) ; |
---|
| 306 | } |
---|
| 307 | } |
---|
| 308 | } |
---|
| 309 | } |
---|
| 310 | Void TComSlice::setRefPicListExplicitlyDecoderSided( TComList<TComPic*>& rcListPic, std::vector<TComPic*>& rapcSpatRefPics ) |
---|
| 311 | { |
---|
| 312 | sortPicList(rcListPic); |
---|
| 313 | TComPic* pcRefPic = NULL; |
---|
| 314 | |
---|
| 315 | for(Int iRefList = 0; iRefList<2; iRefList++) |
---|
| 316 | { |
---|
| 317 | RefPicList eRefList = (RefPicList) iRefList; |
---|
| 318 | for( Int i=0; i<m_aiNumRefIdx[eRefList]; i++ ) |
---|
| 319 | { |
---|
| 320 | const int iRefPoc = m_aiRefPOCList[ eRefList][i ]; |
---|
| 321 | const int iRefViewIdx = m_aiRefViewList[ eRefList][i ]; |
---|
| 322 | if( iRefViewIdx == m_iViewIdx ) |
---|
| 323 | { |
---|
| 324 | for( TComList<TComPic*>::iterator it = rcListPic.begin(); it!=rcListPic.end(); it++) |
---|
| 325 | { |
---|
| 326 | if((*it)->getPOC() == iRefPoc) |
---|
| 327 | { |
---|
| 328 | pcRefPic = *it; |
---|
| 329 | break; |
---|
| 330 | } |
---|
| 331 | } |
---|
| 332 | } |
---|
| 333 | else |
---|
| 334 | { |
---|
| 335 | // inter-view prediction |
---|
| 336 | assert( iRefPoc == m_iPOC ); |
---|
| 337 | assert( 0 <= iRefViewIdx && iRefViewIdx < rapcSpatRefPics.size() ); |
---|
| 338 | pcRefPic = rapcSpatRefPics[iRefViewIdx]; |
---|
| 339 | } |
---|
| 340 | if( pcRefPic ) |
---|
| 341 | { |
---|
| 342 | m_apcRefPicList[eRefList][i] = pcRefPic; |
---|
| 343 | pcRefPic->getPicYuvRec()->extendPicBorder(); |
---|
| 344 | } |
---|
| 345 | else |
---|
| 346 | { |
---|
| 347 | printf("\n inconsistence in gop string!") ; // gop string inconsistent |
---|
| 348 | assert(0) ; |
---|
| 349 | } |
---|
| 350 | } |
---|
| 351 | } |
---|
| 352 | } |
---|
| 353 | |
---|
| 354 | Void TComSlice::initEqualRef() |
---|
| 355 | { |
---|
| 356 | for (Int iDir = 0; iDir < 2; iDir++) |
---|
| 357 | { |
---|
| 358 | for (Int iRefIdx1 = 0; iRefIdx1 < MAX_NUM_REF; iRefIdx1++) |
---|
| 359 | { |
---|
| 360 | for (Int iRefIdx2 = iRefIdx1; iRefIdx2 < MAX_NUM_REF; iRefIdx2++) |
---|
| 361 | { |
---|
| 362 | m_abEqualRef[iDir][iRefIdx1][iRefIdx2] = m_abEqualRef[iDir][iRefIdx2][iRefIdx1] = (iRefIdx1 == iRefIdx2? true : false); |
---|
| 363 | } |
---|
| 364 | } |
---|
| 365 | } |
---|
| 366 | } |
---|
| 367 | |
---|
| 368 | Void TComSlice::initMultiviewSlice( Int** aaiScale, Int** aaiOffset ) |
---|
| 369 | { |
---|
| 370 | if( m_pcSPS->hasCamParInSliceHeader() ) |
---|
| 371 | { |
---|
| 372 | UInt uiViewId = m_pcSPS->getViewId(); |
---|
| 373 | for( UInt uiBaseViewId = 0; uiBaseViewId < uiViewId; uiBaseViewId++ ) |
---|
| 374 | { |
---|
| 375 | m_aaiCodedScale [ 0 ][ uiBaseViewId ] = aaiScale [ uiBaseViewId ][ uiViewId ]; |
---|
| 376 | m_aaiCodedScale [ 1 ][ uiBaseViewId ] = aaiScale [ uiViewId ][ uiBaseViewId ]; |
---|
| 377 | m_aaiCodedOffset[ 0 ][ uiBaseViewId ] = aaiOffset[ uiBaseViewId ][ uiViewId ]; |
---|
| 378 | m_aaiCodedOffset[ 1 ][ uiBaseViewId ] = aaiOffset[ uiViewId ][ uiBaseViewId ]; |
---|
| 379 | } |
---|
| 380 | } |
---|
| 381 | } |
---|
| 382 | |
---|
| 383 | |
---|
| 384 | #if DCM_DECODING_REFRESH |
---|
| 385 | /** Function for marking the reference pictures when an IDR and CDR is encountered. |
---|
| 386 | * \param uiPOCCDR POC of the CDR picture |
---|
| 387 | * \param bRefreshPending flag indicating if a deferred decoding refresh is pending |
---|
| 388 | * \param rcListPic reference to the reference picture list |
---|
| 389 | * This function marks the reference pictures as "unused for reference" in the following conditions. |
---|
[5] | 390 | * If the nal_unit_type is IDR all pictures in the reference picture list |
---|
| 391 | * is marked as "unused for reference" |
---|
[2] | 392 | * Otherwise do for the CDR case (non CDR case has no effect since both if conditions below will not be true) |
---|
[5] | 393 | * If the bRefreshPending flag is true (a deferred decoding refresh is pending) and the current |
---|
| 394 | * temporal reference is greater than the temporal reference of the latest CDR picture (uiPOCCDR), |
---|
| 395 | * mark all reference pictures except the latest CDR picture as "unused for reference" and set |
---|
[2] | 396 | * the bRefreshPending flag to false. |
---|
[5] | 397 | * If the nal_unit_type is CDR, set the bRefreshPending flag to true and iPOCCDR to the temporal |
---|
[2] | 398 | * reference of the current picture. |
---|
| 399 | * Note that the current picture is already placed in the reference list and its marking is not changed. |
---|
| 400 | * If the current picture has a nal_ref_idc that is not 0, it will remain marked as "used for reference". |
---|
| 401 | */ |
---|
| 402 | Void TComSlice::decodingRefreshMarking(UInt& uiPOCCDR, Bool& bRefreshPending, TComList<TComPic*>& rcListPic) |
---|
| 403 | { |
---|
| 404 | TComPic* rpcPic; |
---|
[5] | 405 | UInt uiPOCCurr = getPOC(); |
---|
[2] | 406 | |
---|
| 407 | if (getNalUnitType() == NAL_UNIT_CODED_SLICE_IDR) // IDR |
---|
| 408 | { |
---|
| 409 | // mark all pictures as not used for reference |
---|
| 410 | TComList<TComPic*>::iterator iterPic = rcListPic.begin(); |
---|
| 411 | while (iterPic != rcListPic.end()) |
---|
| 412 | { |
---|
| 413 | rpcPic = *(iterPic); |
---|
| 414 | rpcPic->setCurrSliceIdx(0); |
---|
| 415 | if (rpcPic->getPOC() != uiPOCCurr) rpcPic->getSlice(0)->setReferenced(false); |
---|
| 416 | iterPic++; |
---|
| 417 | } |
---|
| 418 | } |
---|
| 419 | else // CDR or No DR |
---|
| 420 | { |
---|
[5] | 421 | if (bRefreshPending==true && uiPOCCurr > uiPOCCDR) // CDR reference marking pending |
---|
[2] | 422 | { |
---|
| 423 | TComList<TComPic*>::iterator iterPic = rcListPic.begin(); |
---|
| 424 | while (iterPic != rcListPic.end()) |
---|
| 425 | { |
---|
| 426 | rpcPic = *(iterPic); |
---|
| 427 | if (rpcPic->getPOC() != uiPOCCurr && rpcPic->getPOC() != uiPOCCDR) rpcPic->getSlice(0)->setReferenced(false); |
---|
| 428 | iterPic++; |
---|
| 429 | } |
---|
[5] | 430 | bRefreshPending = false; |
---|
[2] | 431 | } |
---|
| 432 | if (getNalUnitType() == NAL_UNIT_CODED_SLICE_CDR) // CDR picture found |
---|
| 433 | { |
---|
[5] | 434 | bRefreshPending = true; |
---|
[2] | 435 | uiPOCCDR = uiPOCCurr; |
---|
| 436 | } |
---|
| 437 | } |
---|
| 438 | } |
---|
| 439 | #endif |
---|
| 440 | |
---|
| 441 | Void TComSlice::copySliceInfo(TComSlice *pSrc) |
---|
| 442 | { |
---|
| 443 | assert( pSrc != NULL ); |
---|
| 444 | |
---|
| 445 | Int i, j, k; |
---|
| 446 | |
---|
| 447 | m_iPOC = pSrc->m_iPOC; |
---|
| 448 | m_iViewIdx = pSrc->m_iViewIdx; |
---|
| 449 | #if DCM_DECODING_REFRESH |
---|
| 450 | m_eNalUnitType = pSrc->m_eNalUnitType; |
---|
[5] | 451 | #endif |
---|
[2] | 452 | m_eSliceType = pSrc->m_eSliceType; |
---|
| 453 | m_iSliceQp = pSrc->m_iSliceQp; |
---|
| 454 | m_iSymbolMode = pSrc->m_iSymbolMode; |
---|
| 455 | m_bLoopFilterDisable = pSrc->m_bLoopFilterDisable; |
---|
[5] | 456 | |
---|
| 457 | #if DCM_COMB_LIST |
---|
[2] | 458 | for (i = 0; i < 3; i++) |
---|
| 459 | { |
---|
| 460 | m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; |
---|
| 461 | } |
---|
| 462 | |
---|
| 463 | for (i = 0; i < 2; i++) |
---|
| 464 | { |
---|
| 465 | for (j = 0; j < MAX_NUM_REF_LC; j++) |
---|
| 466 | { |
---|
| 467 | m_iRefIdxOfLC[i][j] = pSrc->m_iRefIdxOfLC[i][j]; |
---|
| 468 | } |
---|
| 469 | } |
---|
| 470 | for (i = 0; i < MAX_NUM_REF_LC; i++) |
---|
| 471 | { |
---|
| 472 | m_eListIdFromIdxOfLC[i] = pSrc->m_eListIdFromIdxOfLC[i]; |
---|
| 473 | m_iRefIdxFromIdxOfLC[i] = pSrc->m_iRefIdxFromIdxOfLC[i]; |
---|
| 474 | m_iRefIdxOfL1FromRefIdxOfL0[i] = pSrc->m_iRefIdxOfL1FromRefIdxOfL0[i]; |
---|
| 475 | m_iRefIdxOfL0FromRefIdxOfL1[i] = pSrc->m_iRefIdxOfL0FromRefIdxOfL1[i]; |
---|
| 476 | } |
---|
| 477 | m_bRefPicListModificationFlagLC = pSrc->m_bRefPicListModificationFlagLC; |
---|
| 478 | m_bRefPicListCombinationFlag = pSrc->m_bRefPicListCombinationFlag; |
---|
| 479 | #else |
---|
| 480 | for (i = 0; i < 2; i++) |
---|
| 481 | { |
---|
| 482 | m_aiNumRefIdx[i] = pSrc->m_aiNumRefIdx[i]; |
---|
| 483 | } |
---|
[5] | 484 | #endif |
---|
[2] | 485 | |
---|
| 486 | m_iSliceQpDelta = pSrc->m_iSliceQpDelta; |
---|
| 487 | for (i = 0; i < 2; i++) |
---|
| 488 | { |
---|
| 489 | for (j = 0; j < MAX_NUM_REF; j++) |
---|
| 490 | { |
---|
| 491 | m_apcRefPicList[i][j] = pSrc->m_apcRefPicList[i][j]; |
---|
| 492 | m_aiRefPOCList[i][j] = pSrc->m_aiRefPOCList[i][j]; |
---|
| 493 | m_aiRefViewList[i][j] = pSrc->m_aiRefViewList[i][j]; |
---|
| 494 | } |
---|
[5] | 495 | } |
---|
[2] | 496 | m_iDepth = pSrc->m_iDepth; |
---|
| 497 | |
---|
| 498 | // referenced slice |
---|
| 499 | m_bRefenced = pSrc->m_bRefenced; |
---|
| 500 | #ifdef ROUNDING_CONTROL_BIPRED |
---|
| 501 | m_bRounding = pSrc->m_bRounding; |
---|
| 502 | #endif |
---|
| 503 | |
---|
| 504 | // access channel |
---|
| 505 | m_pcSPS = pSrc->m_pcSPS; |
---|
| 506 | m_pcPPS = pSrc->m_pcPPS; |
---|
| 507 | m_uiPPSId = pSrc->m_uiPPSId; |
---|
| 508 | m_pcPic = pSrc->m_pcPic; |
---|
| 509 | |
---|
| 510 | m_uiColDir = pSrc->m_uiColDir; |
---|
| 511 | m_dLambda = pSrc->m_dLambda; |
---|
| 512 | for (i = 0; i < 2; i++) |
---|
| 513 | { |
---|
| 514 | for (j = 0; j < MAX_NUM_REF; j++) |
---|
| 515 | { |
---|
| 516 | for (k =0; k < MAX_NUM_REF; k++) |
---|
| 517 | { |
---|
| 518 | m_abEqualRef[i][j][k] = pSrc->m_abEqualRef[i][j][k]; |
---|
| 519 | } |
---|
| 520 | } |
---|
| 521 | } |
---|
| 522 | |
---|
| 523 | m_bNoBackPredFlag = pSrc->m_bNoBackPredFlag; |
---|
| 524 | #if MS_LCEC_LOOKUP_TABLE_EXCEPTION |
---|
| 525 | m_bRefIdxCombineCoding = pSrc->m_bRefIdxCombineCoding; |
---|
| 526 | #endif |
---|
| 527 | m_uiSliceMode = pSrc->m_uiSliceMode; |
---|
| 528 | m_uiSliceArgument = pSrc->m_uiSliceArgument; |
---|
| 529 | m_uiSliceCurStartCUAddr = pSrc->m_uiSliceCurStartCUAddr; |
---|
| 530 | m_uiSliceCurEndCUAddr = pSrc->m_uiSliceCurEndCUAddr; |
---|
| 531 | m_uiSliceIdx = pSrc->m_uiSliceIdx; |
---|
| 532 | m_uiEntropySliceMode = pSrc->m_uiEntropySliceMode; |
---|
[5] | 533 | m_uiEntropySliceArgument = pSrc->m_uiEntropySliceArgument; |
---|
[2] | 534 | m_uiEntropySliceCurStartCUAddr = pSrc->m_uiEntropySliceCurStartCUAddr; |
---|
| 535 | m_uiEntropySliceCurEndCUAddr = pSrc->m_uiEntropySliceCurEndCUAddr; |
---|
| 536 | m_bNextSlice = pSrc->m_bNextSlice; |
---|
| 537 | m_bNextEntropySlice = pSrc->m_bNextEntropySlice; |
---|
| 538 | #ifdef WEIGHT_PRED |
---|
| 539 | for ( int e=0 ; e<2 ; e++ ) |
---|
| 540 | for ( int n=0 ; n<MAX_NUM_REF ; n++ ) |
---|
| 541 | memcpy(m_weightPredTable[e][n], pSrc->m_weightPredTable[e][n], sizeof(wpScalingParam)*3 ); |
---|
| 542 | #endif |
---|
| 543 | } |
---|
| 544 | |
---|
| 545 | #ifdef WEIGHT_PRED |
---|
| 546 | Void TComSlice::getWpScaling( RefPicList e, Int iRefIdx, wpScalingParam *&wp ) |
---|
| 547 | { |
---|
| 548 | wp = m_weightPredTable[e][iRefIdx]; |
---|
| 549 | } |
---|
| 550 | |
---|
| 551 | Void TComSlice::displayWpScaling() |
---|
| 552 | { |
---|
| 553 | Bool bFound = false; |
---|
| 554 | for ( int e=0 ; e<2 ; e++ ) { |
---|
| 555 | for ( int i=0 ; i<MAX_NUM_REF ; i++ ) |
---|
| 556 | for ( int yuv=0 ; yuv<3 ; yuv++ ) |
---|
| 557 | if ( m_weightPredTable[e][i][yuv].bPresentFlag ) { |
---|
| 558 | if ( !bFound ) { |
---|
| 559 | printf("\tluma_log2_weight_denom = %d\n", m_weightPredTable[0][0][0].uiLog2WeightDenom); |
---|
| 560 | printf("\tchroma_log2_weight_denom = %d\n", m_weightPredTable[0][0][1].uiLog2WeightDenom); |
---|
| 561 | bFound = true; |
---|
| 562 | } |
---|
| 563 | Double weight = (Double)m_weightPredTable[e][i][yuv].iWeight / (Double)(1<<m_weightPredTable[0][0][0].uiLog2WeightDenom); |
---|
| 564 | if ( yuv == 0 ) { |
---|
| 565 | printf("\tluma_weight_l%d_flag = 1\n", e); |
---|
| 566 | printf("\t luma_weight_l%d[%d] = %d => w = %g\n", e, i, m_weightPredTable[e][i][yuv].iWeight, weight); |
---|
| 567 | printf("\t luma_offset_l%d[%d] = %d\n", e, i, m_weightPredTable[e][i][yuv].iOffset); |
---|
| 568 | } |
---|
| 569 | else { |
---|
| 570 | if ( yuv == 1 ) printf("\tchroma_weight_l%d_flag = 1\n", e); |
---|
| 571 | printf("\t chroma_weight_l%d[%d][%d] = %d => w = %g\n", e, i, yuv-1, m_weightPredTable[e][i][yuv].iWeight, weight); |
---|
| 572 | printf("\t chroma_offset_l%d[%d][%d] = %d\n", e, i, yuv-1, m_weightPredTable[e][i][yuv].iOffset); |
---|
| 573 | } |
---|
| 574 | } |
---|
| 575 | } |
---|
| 576 | } |
---|
| 577 | |
---|
[5] | 578 | // Default WP values settings : no weight. |
---|
[2] | 579 | Void TComSlice::resetWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]) |
---|
| 580 | { |
---|
| 581 | for ( int e=0 ; e<2 ; e++ ) { |
---|
| 582 | for ( int i=0 ; i<MAX_NUM_REF ; i++ ) |
---|
| 583 | for ( int yuv=0 ; yuv<3 ; yuv++ ) { |
---|
| 584 | wpScalingParam *pwp = &(wp[e][i][yuv]); |
---|
| 585 | pwp->bPresentFlag = false; |
---|
| 586 | pwp->uiLog2WeightDenom = 0; |
---|
| 587 | pwp->uiLog2WeightDenom = 0; |
---|
| 588 | pwp->iWeight = 1; |
---|
| 589 | pwp->iOffset = 0; |
---|
| 590 | } |
---|
| 591 | } |
---|
| 592 | } |
---|
| 593 | |
---|
| 594 | Void TComSlice::initWpScaling() |
---|
| 595 | { |
---|
| 596 | initWpScaling(m_weightPredTable); |
---|
| 597 | } |
---|
| 598 | |
---|
| 599 | Void TComSlice::initWpScaling(wpScalingParam wp[2][MAX_NUM_REF][3]) |
---|
| 600 | { |
---|
| 601 | for ( int e=0 ; e<2 ; e++ ) { |
---|
| 602 | for ( int i=0 ; i<MAX_NUM_REF ; i++ ) |
---|
| 603 | for ( int yuv=0 ; yuv<3 ; yuv++ ) { |
---|
| 604 | wpScalingParam *pwp = &(wp[e][i][yuv]); |
---|
| 605 | if ( !pwp->bPresentFlag ) { |
---|
| 606 | // Inferring values not present : |
---|
| 607 | pwp->iWeight = (1 << pwp->uiLog2WeightDenom); |
---|
| 608 | pwp->iOffset = 0; |
---|
| 609 | } |
---|
| 610 | |
---|
| 611 | pwp->w = pwp->iWeight; |
---|
| 612 | pwp->o = pwp->iOffset * (1 << (g_uiBitDepth-8)); |
---|
| 613 | pwp->shift = pwp->uiLog2WeightDenom; |
---|
| 614 | pwp->round = (pwp->uiLog2WeightDenom>=1) ? (1 << (pwp->uiLog2WeightDenom-1)) : (0); |
---|
| 615 | } |
---|
| 616 | } |
---|
| 617 | } |
---|
| 618 | #endif |
---|
| 619 | |
---|
| 620 | #ifdef WEIGHT_PRED |
---|
| 621 | Void TComSlice::getWpAcDcParam(wpACDCParam *&wp) |
---|
| 622 | { |
---|
| 623 | wp = m_weightACDCParam; |
---|
| 624 | } |
---|
| 625 | |
---|
| 626 | Void TComSlice::initWpAcDcParam() |
---|
| 627 | { |
---|
| 628 | for(Int iComp = 0; iComp < 3; iComp++ ) |
---|
| 629 | { |
---|
| 630 | m_weightACDCParam[iComp].iAC = 0; |
---|
| 631 | m_weightACDCParam[iComp].iDC = 0; |
---|
| 632 | } |
---|
| 633 | } |
---|
| 634 | #endif |
---|
| 635 | |
---|
| 636 | // ------------------------------------------------------------------------------------------------ |
---|
| 637 | // Sequence parameter set (SPS) |
---|
| 638 | // ------------------------------------------------------------------------------------------------ |
---|
| 639 | |
---|
| 640 | TComSPS::TComSPS() |
---|
| 641 | { |
---|
| 642 | // Structure |
---|
| 643 | m_uiSPSId = 0; |
---|
| 644 | m_uiWidth = 352; |
---|
| 645 | m_uiHeight = 288; |
---|
| 646 | m_uiMaxCUWidth = 32; |
---|
| 647 | m_uiMaxCUHeight = 32; |
---|
| 648 | m_uiMaxCUDepth = 3; |
---|
| 649 | m_uiMinTrDepth = 0; |
---|
| 650 | m_uiMaxTrDepth = 1; |
---|
| 651 | m_uiMaxTrSize = 32; |
---|
[5] | 652 | |
---|
[2] | 653 | // Tool list |
---|
| 654 | m_bUseALF = false; |
---|
| 655 | m_bUseDQP = false; |
---|
[5] | 656 | |
---|
[2] | 657 | m_bUseMRG = false; // SOPH: |
---|
[5] | 658 | #if HHI_MPI |
---|
[2] | 659 | m_bUseMVI = false; |
---|
[5] | 660 | #endif |
---|
| 661 | |
---|
[2] | 662 | m_uiViewId = 0; |
---|
| 663 | m_iViewOrderIdx = 0; |
---|
| 664 | m_bDepth = false; |
---|
| 665 | m_uiCamParPrecision = 0; |
---|
| 666 | m_bCamParInSliceHeader = false; |
---|
| 667 | ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); |
---|
| 668 | ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); |
---|
| 669 | |
---|
[5] | 670 | #if DEPTH_MAP_GENERATION |
---|
[2] | 671 | m_uiPredDepthMapGeneration = 0; |
---|
| 672 | m_uiPdmPrecision = 0; |
---|
| 673 | ::memset( m_aiPdmScaleNomDelta, 0x00, sizeof( m_aiPdmScaleNomDelta ) ); |
---|
| 674 | ::memset( m_aiPdmOffset, 0x00, sizeof( m_aiPdmOffset ) ); |
---|
[5] | 675 | #endif |
---|
| 676 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
| 677 | m_uiMultiviewMvPredMode = 0; |
---|
| 678 | #endif |
---|
| 679 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 680 | m_uiMultiviewResPredMode = 0; |
---|
[5] | 681 | #endif |
---|
[2] | 682 | |
---|
| 683 | // AMVP parameter |
---|
| 684 | ::memset( m_aeAMVPMode, 0, sizeof( m_aeAMVPMode ) ); |
---|
[11] | 685 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[5] | 686 | m_bUseDMM = false; |
---|
[11] | 687 | #endif |
---|
[2] | 688 | } |
---|
| 689 | |
---|
| 690 | TComSPS::~TComSPS() |
---|
| 691 | { |
---|
| 692 | } |
---|
| 693 | |
---|
| 694 | TComPPS::TComPPS() |
---|
| 695 | { |
---|
| 696 | #if CONSTRAINED_INTRA_PRED |
---|
| 697 | m_bConstrainedIntraPred = false; |
---|
| 698 | #endif |
---|
| 699 | m_uiSPSId = 0; |
---|
| 700 | m_uiPPSId = 0; |
---|
| 701 | } |
---|
| 702 | |
---|
| 703 | TComPPS::~TComPPS() |
---|
| 704 | { |
---|
| 705 | } |
---|
| 706 | |
---|
| 707 | Void |
---|
| 708 | TComSPS::initMultiviewSPS( UInt uiViewId, Int iViewOrderIdx, UInt uiCamParPrecision, Bool bCamParSlice, Int** aaiScale, Int** aaiOffset ) |
---|
| 709 | { |
---|
| 710 | AOT( uiViewId == 0 && iViewOrderIdx != 0 ); |
---|
| 711 | AOT( uiViewId != 0 && iViewOrderIdx == 0 ); |
---|
| 712 | AOT( uiViewId != 0 && !bCamParSlice && ( aaiScale == 0 || aaiOffset == 0 ) ); |
---|
| 713 | |
---|
| 714 | m_uiViewId = uiViewId; |
---|
| 715 | m_iViewOrderIdx = iViewOrderIdx; |
---|
| 716 | m_bDepth = false; |
---|
| 717 | m_uiCamParPrecision = ( m_uiViewId ? uiCamParPrecision : 0 ); |
---|
| 718 | m_bCamParInSliceHeader = ( m_uiViewId ? bCamParSlice : false ); |
---|
| 719 | ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); |
---|
| 720 | ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); |
---|
| 721 | if( !m_bCamParInSliceHeader ) |
---|
| 722 | { |
---|
| 723 | for( UInt uiBaseViewId = 0; uiBaseViewId < m_uiViewId; uiBaseViewId++ ) |
---|
| 724 | { |
---|
| 725 | m_aaiCodedScale [ 0 ][ uiBaseViewId ] = aaiScale [ uiBaseViewId ][ m_uiViewId ]; |
---|
| 726 | m_aaiCodedScale [ 1 ][ uiBaseViewId ] = aaiScale [ m_uiViewId ][ uiBaseViewId ]; |
---|
| 727 | m_aaiCodedOffset[ 0 ][ uiBaseViewId ] = aaiOffset[ uiBaseViewId ][ m_uiViewId ]; |
---|
| 728 | m_aaiCodedOffset[ 1 ][ uiBaseViewId ] = aaiOffset[ m_uiViewId ][ uiBaseViewId ]; |
---|
| 729 | } |
---|
| 730 | } |
---|
[12] | 731 | #if POZNAN_NONLINEAR_DEPTH |
---|
| 732 | m_fDepthPower = 1.0; |
---|
| 733 | #endif |
---|
[2] | 734 | } |
---|
| 735 | |
---|
| 736 | Void |
---|
| 737 | TComSPS::initMultiviewSPSDepth( UInt uiViewId, Int iViewOrderIdx ) |
---|
| 738 | { |
---|
| 739 | AOT( uiViewId == 0 && iViewOrderIdx != 0 ); |
---|
| 740 | AOT( uiViewId != 0 && iViewOrderIdx == 0 ); |
---|
| 741 | |
---|
| 742 | m_uiViewId = uiViewId; |
---|
| 743 | m_iViewOrderIdx = iViewOrderIdx; |
---|
| 744 | m_bDepth = true; |
---|
| 745 | m_uiCamParPrecision = 0; |
---|
| 746 | m_bCamParInSliceHeader = false; |
---|
| 747 | ::memset( m_aaiCodedScale, 0x00, sizeof( m_aaiCodedScale ) ); |
---|
| 748 | ::memset( m_aaiCodedOffset, 0x00, sizeof( m_aaiCodedOffset ) ); |
---|
[12] | 749 | #if POZNAN_NONLINEAR_DEPTH |
---|
| 750 | m_fDepthPower = 1.0; |
---|
| 751 | #endif |
---|
[2] | 752 | } |
---|
| 753 | |
---|
| 754 | |
---|
[5] | 755 | #if DEPTH_MAP_GENERATION |
---|
[2] | 756 | Void |
---|
| 757 | TComSPS::setPredDepthMapGeneration( UInt uiViewId, Bool bIsDepth, UInt uiPdmGenMode, UInt uiPdmMvPredMode, UInt uiPdmPrec, Int** aaiPdmScaleNomDelta, Int** aaiPdmOffset ) |
---|
[5] | 758 | { |
---|
[2] | 759 | AOF( m_uiViewId == uiViewId ); |
---|
| 760 | AOF( m_bDepth == bIsDepth ); |
---|
| 761 | AOT( ( uiViewId == 0 || bIsDepth ) && uiPdmGenMode ); |
---|
| 762 | AOT( uiPdmGenMode && ( aaiPdmScaleNomDelta == 0 || aaiPdmOffset == 0 ) ); |
---|
| 763 | AOT( uiPdmMvPredMode && uiPdmGenMode == 0 ); |
---|
[5] | 764 | |
---|
[2] | 765 | m_uiPredDepthMapGeneration = uiPdmGenMode; |
---|
[5] | 766 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 767 | m_uiMultiviewMvPredMode = uiPdmMvPredMode; |
---|
[5] | 768 | #endif |
---|
[2] | 769 | m_uiPdmPrecision = ( m_uiPredDepthMapGeneration ? uiPdmPrec : 0 ); |
---|
| 770 | ::memset( m_aiPdmScaleNomDelta, 0x00, sizeof( m_aiPdmScaleNomDelta ) ); |
---|
| 771 | ::memset( m_aiPdmOffset, 0x00, sizeof( m_aiPdmOffset ) ); |
---|
| 772 | if( m_uiPredDepthMapGeneration ) |
---|
| 773 | { |
---|
| 774 | for( UInt uiBaseId = 0; uiBaseId < m_uiViewId; uiBaseId++ ) |
---|
| 775 | { |
---|
| 776 | m_aiPdmScaleNomDelta[ uiBaseId ] = aaiPdmScaleNomDelta[ m_uiViewId ][ uiBaseId ]; |
---|
| 777 | m_aiPdmOffset [ uiBaseId ] = aaiPdmOffset [ m_uiViewId ][ uiBaseId ]; |
---|
| 778 | } |
---|
| 779 | } |
---|
| 780 | } |
---|
[5] | 781 | #endif |
---|