[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 |
---|
[56] | 4 | * granted under this license. |
---|
[5] | 5 | * |
---|
[56] | 6 | * Copyright (c) 2010-2012, ITU/ISO/IEC |
---|
[5] | 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. |
---|
[56] | 17 | * * Neither the name of the ITU/ISO/IEC nor the names of its contributors may |
---|
[5] | 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 | */ |
---|
[2] | 33 | |
---|
| 34 | /** \file TEncTop.cpp |
---|
| 35 | \brief encoder class |
---|
| 36 | */ |
---|
| 37 | |
---|
[56] | 38 | #include "TLibCommon/CommonDef.h" |
---|
[2] | 39 | #include "TEncTop.h" |
---|
[56] | 40 | #include "TEncPic.h" |
---|
[2] | 41 | #include "../../App/TAppEncoder/TAppEncTop.h" |
---|
[56] | 42 | #if FAST_BIT_EST |
---|
| 43 | #include "TLibCommon/ContextModel.h" |
---|
| 44 | #endif |
---|
[2] | 45 | |
---|
[56] | 46 | //! \ingroup TLibEncoder |
---|
| 47 | //! \{ |
---|
| 48 | |
---|
[2] | 49 | // ==================================================================================================================== |
---|
| 50 | // Constructor / destructor / create / destroy |
---|
| 51 | // ==================================================================================================================== |
---|
| 52 | |
---|
| 53 | TEncTop::TEncTop() |
---|
| 54 | { |
---|
| 55 | m_iPOCLast = -1; |
---|
| 56 | m_iNumPicRcvd = 0; |
---|
| 57 | m_uiNumAllPicCoded = 0; |
---|
| 58 | m_pppcRDSbacCoder = NULL; |
---|
| 59 | m_pppcBinCoderCABAC = NULL; |
---|
| 60 | m_cRDGoOnSbacCoder.init( &m_cRDGoOnBinCoderCABAC ); |
---|
| 61 | #if ENC_DEC_TRACE |
---|
| 62 | g_hTrace = fopen( "TraceEnc.txt", "wb" ); |
---|
| 63 | g_bJustDoIt = g_bEncDecTraceDisable; |
---|
| 64 | g_nSymbolCounter = 0; |
---|
| 65 | #endif |
---|
[56] | 66 | |
---|
| 67 | m_iMaxRefPicNum = 0; |
---|
| 68 | |
---|
| 69 | #if FAST_BIT_EST |
---|
| 70 | ContextModel::buildNextStateTable(); |
---|
| 71 | #endif |
---|
| 72 | |
---|
| 73 | m_pcSbacCoders = NULL; |
---|
| 74 | m_pcBinCoderCABACs = NULL; |
---|
| 75 | m_ppppcRDSbacCoders = NULL; |
---|
| 76 | m_ppppcBinCodersCABAC = NULL; |
---|
| 77 | m_pcRDGoOnSbacCoders = NULL; |
---|
| 78 | m_pcRDGoOnBinCodersCABAC = NULL; |
---|
| 79 | m_pcBitCounters = NULL; |
---|
| 80 | m_pcRdCosts = NULL; |
---|
[2] | 81 | } |
---|
| 82 | |
---|
| 83 | TEncTop::~TEncTop() |
---|
| 84 | { |
---|
| 85 | #if ENC_DEC_TRACE |
---|
| 86 | fclose( g_hTrace ); |
---|
| 87 | #endif |
---|
| 88 | } |
---|
| 89 | |
---|
| 90 | Void TEncTop::create () |
---|
| 91 | { |
---|
| 92 | // initialize global variables |
---|
[56] | 93 | initROM(); |
---|
| 94 | |
---|
[2] | 95 | // create processing unit classes |
---|
[56] | 96 | m_cGOPEncoder. create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight ); |
---|
[2] | 97 | m_cSliceEncoder. create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); |
---|
| 98 | m_cCuEncoder. create( g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight ); |
---|
| 99 | if (m_bUseSAO) |
---|
| 100 | { |
---|
[56] | 101 | #if SAO_UNIT_INTERLEAVING |
---|
| 102 | m_cEncSAO.setSaoInterleavingFlag(getSaoInterleavingFlag()); |
---|
| 103 | m_cEncSAO.setMaxNumOffsetsPerPic(getMaxNumOffsetsPerPic()); |
---|
| 104 | #endif |
---|
[2] | 105 | m_cEncSAO.create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); |
---|
| 106 | m_cEncSAO.createEncBuffer(); |
---|
| 107 | } |
---|
[56] | 108 | #if ADAPTIVE_QP_SELECTION |
---|
| 109 | if (m_bUseAdaptQpSelect) |
---|
| 110 | { |
---|
| 111 | m_cTrQuant.initSliceQpDelta(); |
---|
| 112 | } |
---|
[2] | 113 | #endif |
---|
| 114 | m_cAdaptiveLoopFilter.create( getSourceWidth(), getSourceHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); |
---|
| 115 | m_cLoopFilter. create( g_uiMaxCUDepth ); |
---|
[56] | 116 | |
---|
[5] | 117 | #if DEPTH_MAP_GENERATION |
---|
[21] | 118 | m_cDepthMapGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement, PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); |
---|
[5] | 119 | #endif |
---|
| 120 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 121 | m_cResidualGenerator. create( false, getSourceWidth(), getSourceHeight(), g_uiMaxCUDepth, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiBitDepth + g_uiBitIncrement ); |
---|
[5] | 122 | #endif |
---|
[2] | 123 | |
---|
| 124 | if(m_bUseALF) |
---|
| 125 | { |
---|
[56] | 126 | #if LCU_SYNTAX_ALF |
---|
| 127 | m_cAdaptiveLoopFilter.setAlfCoefInSlice(m_bALFParamInSlice); |
---|
| 128 | m_cAdaptiveLoopFilter.createAlfGlobalBuffers(); |
---|
| 129 | #else |
---|
| 130 | m_cAdaptiveLoopFilter.setGOPSize( getGOPSize() ); |
---|
[2] | 131 | m_cAdaptiveLoopFilter.createAlfGlobalBuffers(m_iALFEncodePassReduction); |
---|
[56] | 132 | #endif |
---|
[2] | 133 | } |
---|
| 134 | |
---|
[56] | 135 | if(m_bUseSAO || m_bUseALF) |
---|
| 136 | { |
---|
| 137 | m_vAPS.reserve(MAX_NUM_SUPPORTED_APS); |
---|
| 138 | } |
---|
| 139 | |
---|
[2] | 140 | // if SBAC-based RD optimization is used |
---|
| 141 | if( m_bUseSBACRD ) |
---|
| 142 | { |
---|
[56] | 143 | m_pppcRDSbacCoder = new TEncSbac** [g_uiMaxCUDepth+1]; |
---|
| 144 | #if FAST_BIT_EST |
---|
| 145 | m_pppcBinCoderCABAC = new TEncBinCABACCounter** [g_uiMaxCUDepth+1]; |
---|
| 146 | #else |
---|
| 147 | m_pppcBinCoderCABAC = new TEncBinCABAC** [g_uiMaxCUDepth+1]; |
---|
| 148 | #endif |
---|
| 149 | |
---|
| 150 | for ( Int iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) |
---|
[2] | 151 | { |
---|
| 152 | m_pppcRDSbacCoder[iDepth] = new TEncSbac* [CI_NUM]; |
---|
[56] | 153 | #if FAST_BIT_EST |
---|
| 154 | m_pppcBinCoderCABAC[iDepth] = new TEncBinCABACCounter* [CI_NUM]; |
---|
| 155 | #else |
---|
[2] | 156 | m_pppcBinCoderCABAC[iDepth] = new TEncBinCABAC* [CI_NUM]; |
---|
[56] | 157 | #endif |
---|
| 158 | |
---|
[2] | 159 | for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ ) |
---|
| 160 | { |
---|
| 161 | m_pppcRDSbacCoder[iDepth][iCIIdx] = new TEncSbac; |
---|
[56] | 162 | #if FAST_BIT_EST |
---|
| 163 | m_pppcBinCoderCABAC [iDepth][iCIIdx] = new TEncBinCABACCounter; |
---|
| 164 | #else |
---|
[2] | 165 | m_pppcBinCoderCABAC [iDepth][iCIIdx] = new TEncBinCABAC; |
---|
[56] | 166 | #endif |
---|
[2] | 167 | m_pppcRDSbacCoder [iDepth][iCIIdx]->init( m_pppcBinCoderCABAC [iDepth][iCIIdx] ); |
---|
| 168 | } |
---|
| 169 | } |
---|
| 170 | } |
---|
[56] | 171 | m_pcTAppEncTop = NULL; |
---|
[5] | 172 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
[56] | 173 | if( g_aacWedgeLists.empty() && m_bUseDMM ) |
---|
[2] | 174 | { |
---|
| 175 | initWedgeLists(); |
---|
| 176 | } |
---|
| 177 | #endif |
---|
| 178 | } |
---|
| 179 | |
---|
[56] | 180 | /** |
---|
| 181 | - Allocate coders required for wavefront for the nominated number of substreams. |
---|
| 182 | . |
---|
| 183 | \param iNumSubstreams Determines how much information to allocate. |
---|
| 184 | */ |
---|
| 185 | Void TEncTop::createWPPCoders(Int iNumSubstreams) |
---|
| 186 | { |
---|
| 187 | if (m_pcSbacCoders != NULL) |
---|
| 188 | return; // already generated. |
---|
| 189 | |
---|
| 190 | m_iNumSubstreams = iNumSubstreams; |
---|
| 191 | m_pcSbacCoders = new TEncSbac [iNumSubstreams]; |
---|
| 192 | m_pcBinCoderCABACs = new TEncBinCABAC [iNumSubstreams]; |
---|
| 193 | m_pcRDGoOnSbacCoders = new TEncSbac [iNumSubstreams]; |
---|
| 194 | m_pcRDGoOnBinCodersCABAC = new TEncBinCABAC [iNumSubstreams]; |
---|
| 195 | m_pcBitCounters = new TComBitCounter [iNumSubstreams]; |
---|
| 196 | m_pcRdCosts = new TComRdCost [iNumSubstreams]; |
---|
| 197 | |
---|
| 198 | for ( UInt ui = 0 ; ui < iNumSubstreams; ui++ ) |
---|
| 199 | { |
---|
| 200 | m_pcRDGoOnSbacCoders[ui].init( &m_pcRDGoOnBinCodersCABAC[ui] ); |
---|
| 201 | m_pcSbacCoders[ui].init( &m_pcBinCoderCABACs[ui] ); |
---|
| 202 | } |
---|
| 203 | if( m_bUseSBACRD ) |
---|
| 204 | { |
---|
| 205 | m_ppppcRDSbacCoders = new TEncSbac*** [iNumSubstreams]; |
---|
| 206 | m_ppppcBinCodersCABAC = new TEncBinCABAC***[iNumSubstreams]; |
---|
| 207 | for ( UInt ui = 0 ; ui < iNumSubstreams ; ui++ ) |
---|
| 208 | { |
---|
| 209 | m_ppppcRDSbacCoders[ui] = new TEncSbac** [g_uiMaxCUDepth+1]; |
---|
| 210 | m_ppppcBinCodersCABAC[ui]= new TEncBinCABAC** [g_uiMaxCUDepth+1]; |
---|
| 211 | |
---|
| 212 | for ( Int iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) |
---|
| 213 | { |
---|
| 214 | m_ppppcRDSbacCoders[ui][iDepth] = new TEncSbac* [CI_NUM]; |
---|
| 215 | m_ppppcBinCodersCABAC[ui][iDepth]= new TEncBinCABAC* [CI_NUM]; |
---|
| 216 | |
---|
| 217 | for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ ) |
---|
| 218 | { |
---|
| 219 | m_ppppcRDSbacCoders [ui][iDepth][iCIIdx] = new TEncSbac; |
---|
| 220 | m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx] = new TEncBinCABAC; |
---|
| 221 | m_ppppcRDSbacCoders [ui][iDepth][iCIIdx]->init( m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx] ); |
---|
| 222 | } |
---|
| 223 | } |
---|
| 224 | } |
---|
| 225 | } |
---|
| 226 | } |
---|
| 227 | |
---|
[2] | 228 | Void TEncTop::destroy () |
---|
| 229 | { |
---|
| 230 | if(m_bUseALF) |
---|
| 231 | { |
---|
| 232 | m_cAdaptiveLoopFilter.destroyAlfGlobalBuffers(); |
---|
| 233 | } |
---|
| 234 | |
---|
[56] | 235 | for(Int i=0; i< m_vAPS.size(); i++) |
---|
| 236 | { |
---|
| 237 | TComAPS& cAPS = m_vAPS[i]; |
---|
| 238 | m_cGOPEncoder.freeAPS(&cAPS, &m_cSPS); |
---|
| 239 | } |
---|
| 240 | |
---|
[2] | 241 | // destroy processing unit classes |
---|
[56] | 242 | m_cGOPEncoder. destroy(); |
---|
[2] | 243 | m_cSliceEncoder. destroy(); |
---|
| 244 | m_cCuEncoder. destroy(); |
---|
| 245 | if (m_cSPS.getUseSAO()) |
---|
| 246 | { |
---|
| 247 | m_cEncSAO.destroy(); |
---|
[56] | 248 | m_cEncSAO.destroyEncBuffer(); |
---|
[2] | 249 | } |
---|
| 250 | m_cAdaptiveLoopFilter.destroy(); |
---|
| 251 | m_cLoopFilter. destroy(); |
---|
[56] | 252 | |
---|
[5] | 253 | #if DEPTH_MAP_GENERATION |
---|
[2] | 254 | m_cDepthMapGenerator. destroy(); |
---|
[5] | 255 | #endif |
---|
| 256 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 257 | m_cResidualGenerator. destroy(); |
---|
[5] | 258 | #endif |
---|
[2] | 259 | |
---|
[56] | 260 | m_RPSList. destroy(); |
---|
| 261 | |
---|
[2] | 262 | // SBAC RD |
---|
| 263 | if( m_bUseSBACRD ) |
---|
| 264 | { |
---|
| 265 | Int iDepth; |
---|
| 266 | for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) |
---|
| 267 | { |
---|
| 268 | for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ ) |
---|
| 269 | { |
---|
| 270 | delete m_pppcRDSbacCoder[iDepth][iCIIdx]; |
---|
| 271 | delete m_pppcBinCoderCABAC[iDepth][iCIIdx]; |
---|
| 272 | } |
---|
| 273 | } |
---|
[56] | 274 | |
---|
[2] | 275 | for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) |
---|
| 276 | { |
---|
| 277 | delete [] m_pppcRDSbacCoder[iDepth]; |
---|
| 278 | delete [] m_pppcBinCoderCABAC[iDepth]; |
---|
| 279 | } |
---|
[56] | 280 | |
---|
[2] | 281 | delete [] m_pppcRDSbacCoder; |
---|
| 282 | delete [] m_pppcBinCoderCABAC; |
---|
[56] | 283 | |
---|
| 284 | for ( UInt ui = 0; ui < m_iNumSubstreams; ui++ ) |
---|
| 285 | { |
---|
| 286 | for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) |
---|
| 287 | { |
---|
| 288 | for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ ) |
---|
| 289 | { |
---|
| 290 | delete m_ppppcRDSbacCoders [ui][iDepth][iCIIdx]; |
---|
| 291 | delete m_ppppcBinCodersCABAC[ui][iDepth][iCIIdx]; |
---|
| 292 | } |
---|
| 293 | } |
---|
| 294 | |
---|
| 295 | for ( iDepth = 0; iDepth < g_uiMaxCUDepth+1; iDepth++ ) |
---|
| 296 | { |
---|
| 297 | delete [] m_ppppcRDSbacCoders [ui][iDepth]; |
---|
| 298 | delete [] m_ppppcBinCodersCABAC[ui][iDepth]; |
---|
| 299 | } |
---|
| 300 | delete[] m_ppppcRDSbacCoders [ui]; |
---|
| 301 | delete[] m_ppppcBinCodersCABAC[ui]; |
---|
| 302 | } |
---|
| 303 | delete[] m_ppppcRDSbacCoders; |
---|
| 304 | delete[] m_ppppcBinCodersCABAC; |
---|
[2] | 305 | } |
---|
[56] | 306 | delete[] m_pcSbacCoders; |
---|
| 307 | delete[] m_pcBinCoderCABACs; |
---|
| 308 | delete[] m_pcRDGoOnSbacCoders; |
---|
| 309 | delete[] m_pcRDGoOnBinCodersCABAC; |
---|
| 310 | delete[] m_pcBitCounters; |
---|
| 311 | delete[] m_pcRdCosts; |
---|
| 312 | |
---|
[2] | 313 | // destroy ROM |
---|
[56] | 314 | if(m_viewId == 0 && m_isDepth == false) |
---|
| 315 | { |
---|
| 316 | destroyROM(); |
---|
| 317 | } |
---|
| 318 | |
---|
[2] | 319 | return; |
---|
| 320 | } |
---|
| 321 | |
---|
| 322 | Void TEncTop::init( TAppEncTop* pcTAppEncTop ) |
---|
| 323 | { |
---|
| 324 | UInt *aTable4=NULL, *aTable8=NULL; |
---|
[56] | 325 | UInt* aTableLastPosVlcIndex=NULL; |
---|
[2] | 326 | // initialize SPS |
---|
| 327 | xInitSPS(); |
---|
[56] | 328 | |
---|
[2] | 329 | // initialize PPS |
---|
[56] | 330 | m_cPPS.setSPS(&m_cSPS); |
---|
| 331 | #if RPS_IN_SPS |
---|
| 332 | m_cSPS.setRPSList(&m_RPSList); |
---|
| 333 | #else |
---|
| 334 | m_cPPS.setRPSList(&m_RPSList); |
---|
| 335 | #endif |
---|
[2] | 336 | xInitPPS(); |
---|
[56] | 337 | xInitRPS(); |
---|
[2] | 338 | |
---|
[56] | 339 | xInitSPSforInterViewRefs(); |
---|
| 340 | xInitPPSforTiles(); |
---|
| 341 | |
---|
[2] | 342 | // initialize processing unit classes |
---|
[56] | 343 | m_cGOPEncoder. init( this ); |
---|
[2] | 344 | m_cSliceEncoder.init( this ); |
---|
| 345 | m_cCuEncoder. init( this ); |
---|
[56] | 346 | |
---|
| 347 | m_pcTAppEncTop = pcTAppEncTop; |
---|
[2] | 348 | |
---|
[5] | 349 | #if DEPTH_MAP_GENERATION |
---|
[71] | 350 | #if VIDYO_VPS_INTEGRATION |
---|
| 351 | m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getVPSAccess(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() ); |
---|
| 352 | #else |
---|
[80] | 353 | m_cDepthMapGenerator.init( (TComPrediction*)this->getPredSearch(), m_pcTAppEncTop->getSPSAccess(), m_pcTAppEncTop->getAUPicAccess() ); |
---|
[5] | 354 | #endif |
---|
[71] | 355 | #endif |
---|
[5] | 356 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 357 | m_cResidualGenerator.init( &m_cTrQuant, &m_cDepthMapGenerator ); |
---|
[5] | 358 | #endif |
---|
[2] | 359 | |
---|
| 360 | // initialize transform & quantization class |
---|
| 361 | m_pcCavlcCoder = getCavlcCoder(); |
---|
[56] | 362 | |
---|
| 363 | m_cTrQuant.init( g_uiMaxCUWidth, g_uiMaxCUHeight, 1 << m_uiQuadtreeTULog2MaxSize, |
---|
| 364 | 0, |
---|
| 365 | aTable4, aTable8, |
---|
| 366 | aTableLastPosVlcIndex, m_bUseRDOQ, true |
---|
| 367 | #if ADAPTIVE_QP_SELECTION |
---|
| 368 | , m_bUseAdaptQpSelect |
---|
[2] | 369 | #endif |
---|
[56] | 370 | ); |
---|
| 371 | |
---|
[2] | 372 | // initialize encoder search class |
---|
| 373 | m_cSearch.init( this, &m_cTrQuant, m_iSearchRange, m_bipredSearchRange, m_iFastSearch, 0, &m_cEntropyCoder, &m_cRdCost, getRDSbacCoder(), getRDGoOnSbacCoder() ); |
---|
| 374 | |
---|
| 375 | if(m_bUseALF) |
---|
| 376 | { |
---|
| 377 | m_cAdaptiveLoopFilter.setALFEncodePassReduction( m_iALFEncodePassReduction ); |
---|
[56] | 378 | m_cAdaptiveLoopFilter.setALFMaxNumberFilters( m_iALFMaxNumberFilters ); |
---|
| 379 | #if LCU_SYNTAX_ALF |
---|
| 380 | m_cAdaptiveLoopFilter.initPicQuadTreePartition(m_bALFPicBasedEncode ); |
---|
| 381 | #endif |
---|
[2] | 382 | } |
---|
[56] | 383 | |
---|
| 384 | m_iMaxRefPicNum = 0; |
---|
[2] | 385 | } |
---|
| 386 | |
---|
| 387 | // ==================================================================================================================== |
---|
| 388 | // Public member functions |
---|
| 389 | // ==================================================================================================================== |
---|
| 390 | |
---|
[56] | 391 | Void TEncTop::initNewPic( TComPicYuv* pcPicYuvOrg, TComPicYuv* pcOrgPdmDepth ) |
---|
| 392 | { |
---|
| 393 | TComPic* pcPicCurr = NULL; |
---|
| 394 | |
---|
| 395 | // get original YUV |
---|
| 396 | xGetNewPicBuffer( pcPicCurr ); |
---|
| 397 | pcPicYuvOrg->copyToPic( pcPicCurr->getPicYuvOrg() ); |
---|
| 398 | |
---|
| 399 | #if SONY_COLPIC_AVAILABILITY |
---|
| 400 | pcPicCurr->setViewOrderIdx(m_iViewOrderIdx); |
---|
| 401 | #endif |
---|
| 402 | pcPicCurr->setScaleOffset( m_aaiCodedScale, m_aaiCodedOffset ); |
---|
| 403 | |
---|
| 404 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
| 405 | if( m_uiMultiviewMvRegMode ) |
---|
| 406 | { |
---|
| 407 | AOF( pcOrgPdmDepth ); |
---|
| 408 | AOF( pcPicCurr->getOrgDepthMap() ); |
---|
| 409 | pcOrgPdmDepth->copyToPic( pcPicCurr->getOrgDepthMap() ); |
---|
| 410 | } |
---|
| 411 | else |
---|
| 412 | { |
---|
| 413 | AOT( pcOrgPdmDepth ); |
---|
| 414 | AOT( pcPicCurr->getOrgDepthMap() ); |
---|
| 415 | } |
---|
| 416 | #endif |
---|
| 417 | |
---|
| 418 | #if DEPTH_MAP_GENERATION |
---|
| 419 | // add extra pic buffers |
---|
| 420 | Bool bNeedPrdDepthMapBuf = ( m_uiPredDepthMapGeneration > 0 ); |
---|
| 421 | if( bNeedPrdDepthMapBuf && !pcPicCurr->getPredDepthMap() ) |
---|
| 422 | { |
---|
| 423 | pcPicCurr->addPrdDepthMapBuffer( PDM_SUB_SAMP_EXP_X(m_uiPredDepthMapGeneration), PDM_SUB_SAMP_EXP_Y(m_uiPredDepthMapGeneration) ); |
---|
| 424 | } |
---|
| 425 | #endif |
---|
| 426 | |
---|
| 427 | // compute image characteristics |
---|
| 428 | if ( getUseAdaptiveQP() ) |
---|
| 429 | { |
---|
| 430 | m_cPreanalyzer.xPreanalyze( dynamic_cast<TEncPic*>( pcPicCurr ) ); |
---|
| 431 | } |
---|
| 432 | } |
---|
| 433 | |
---|
[2] | 434 | Void TEncTop::deletePicBuffer() |
---|
| 435 | { |
---|
| 436 | TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); |
---|
| 437 | Int iSize = Int( m_cListPic.size() ); |
---|
[56] | 438 | |
---|
[2] | 439 | for ( Int i = 0; i < iSize; i++ ) |
---|
| 440 | { |
---|
| 441 | TComPic* pcPic = *(iterPic++); |
---|
[56] | 442 | |
---|
[2] | 443 | pcPic->destroy(); |
---|
| 444 | delete pcPic; |
---|
| 445 | pcPic = NULL; |
---|
| 446 | } |
---|
| 447 | } |
---|
| 448 | |
---|
| 449 | /** |
---|
| 450 | - Application has picture buffer list with size of GOP + 1 |
---|
| 451 | - Picture buffer list acts like as ring buffer |
---|
| 452 | - End of the list has the latest picture |
---|
| 453 | . |
---|
| 454 | \param bEos true if end-of-sequence is reached |
---|
| 455 | \param pcPicYuvOrg original YUV picture |
---|
| 456 | \retval rcListPicYuvRecOut list of reconstruction YUV pictures |
---|
| 457 | \retval rcListBitstreamOut list of output bitstreams |
---|
| 458 | \retval iNumEncoded number of encoded pictures |
---|
| 459 | */ |
---|
[56] | 460 | Void TEncTop::encode( bool bEos, TComPicYuv* pcPicYuvOrg, TComList<TComPicYuv*>& rcListPicYuvRecOut, std::list<AccessUnit>& accessUnitsOut, Int& iNumEncoded, Int gopId ) |
---|
| 461 | { |
---|
[2] | 462 | |
---|
[56] | 463 | if( gopId == 0) |
---|
[2] | 464 | { |
---|
[56] | 465 | m_cGOPEncoder.initGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut); |
---|
[2] | 466 | } |
---|
| 467 | |
---|
| 468 | { |
---|
[56] | 469 | m_cGOPEncoder.compressPicInGOP(m_iPOCLast, m_iNumPicRcvd, m_cListPic, rcListPicYuvRecOut, accessUnitsOut, gopId ); |
---|
[2] | 470 | } |
---|
[56] | 471 | |
---|
| 472 | if( gopId + 1 == m_cGOPEncoder.getGOPSize() ) |
---|
[2] | 473 | { |
---|
[56] | 474 | iNumEncoded = m_iNumPicRcvd; |
---|
| 475 | m_iNumPicRcvd = 0; |
---|
| 476 | m_uiNumAllPicCoded += iNumEncoded; |
---|
[2] | 477 | } |
---|
| 478 | } |
---|
| 479 | |
---|
| 480 | |
---|
[56] | 481 | #if HHI_INTERVIEW_SKIP || HHI_INTER_VIEW_MOTION_PRED || HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 482 | Void |
---|
| 483 | TEncTop::deleteExtraPicBuffers( Int iPoc ) |
---|
| 484 | { |
---|
| 485 | TComPic* pcPic = 0; |
---|
| 486 | TComList<TComPic*>::iterator cIter = m_cListPic.begin(); |
---|
| 487 | TComList<TComPic*>::iterator cEnd = m_cListPic.end (); |
---|
| 488 | for( ; cIter != cEnd; cIter++ ) |
---|
| 489 | { |
---|
| 490 | if( (*cIter)->getPOC() == iPoc ) |
---|
| 491 | { |
---|
| 492 | pcPic = *cIter; |
---|
| 493 | break; |
---|
| 494 | } |
---|
| 495 | } |
---|
| 496 | AOF( pcPic ); |
---|
| 497 | if ( pcPic ) |
---|
| 498 | { |
---|
[5] | 499 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 500 | pcPic->removeOrgDepthMapBuffer(); |
---|
[5] | 501 | #endif |
---|
| 502 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 503 | pcPic->removeResidualBuffer (); |
---|
[5] | 504 | #endif |
---|
| 505 | #if HHI_INTERVIEW_SKIP |
---|
[2] | 506 | pcPic->removeUsedPelsMapBuffer(); |
---|
[5] | 507 | #endif |
---|
[2] | 508 | } |
---|
| 509 | } |
---|
[56] | 510 | #endif |
---|
[2] | 511 | |
---|
| 512 | Void |
---|
| 513 | TEncTop::compressMotion( Int iPoc ) |
---|
| 514 | { |
---|
| 515 | TComPic* pcPic = 0; |
---|
| 516 | TComList<TComPic*>::iterator cIter = m_cListPic.begin(); |
---|
| 517 | TComList<TComPic*>::iterator cEnd = m_cListPic.end (); |
---|
| 518 | for( ; cIter != cEnd; cIter++ ) |
---|
| 519 | { |
---|
| 520 | if( (*cIter)->getPOC() == iPoc ) |
---|
| 521 | { |
---|
| 522 | pcPic = *cIter; |
---|
| 523 | break; |
---|
| 524 | } |
---|
| 525 | } |
---|
| 526 | AOF( pcPic ); |
---|
| 527 | if ( pcPic ) |
---|
| 528 | { |
---|
| 529 | pcPic->compressMotion(); |
---|
| 530 | } |
---|
| 531 | } |
---|
| 532 | |
---|
| 533 | // ==================================================================================================================== |
---|
| 534 | // Protected member functions |
---|
| 535 | // ==================================================================================================================== |
---|
| 536 | |
---|
| 537 | /** |
---|
| 538 | - Application has picture buffer list with size of GOP + 1 |
---|
| 539 | - Picture buffer list acts like as ring buffer |
---|
| 540 | - End of the list has the latest picture |
---|
| 541 | . |
---|
| 542 | \retval rpcPic obtained picture buffer |
---|
| 543 | */ |
---|
| 544 | Void TEncTop::xGetNewPicBuffer ( TComPic*& rpcPic ) |
---|
| 545 | { |
---|
| 546 | TComSlice::sortPicList(m_cListPic); |
---|
[56] | 547 | |
---|
| 548 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
| 549 | if (m_cListPic.size() >= (UInt)(m_iGOPSize + getMaxDecPicBuffering(MAX_TLAYER-1) + 2) ) |
---|
| 550 | #else |
---|
| 551 | if (m_cListPic.size() >= (UInt)(m_iGOPSize + getMaxNumberOfReferencePictures() + 2) ) |
---|
| 552 | #endif |
---|
[2] | 553 | { |
---|
[56] | 554 | TComList<TComPic*>::iterator iterPic = m_cListPic.begin(); |
---|
| 555 | Int iSize = Int( m_cListPic.size() ); |
---|
| 556 | for ( Int i = 0; i < iSize; i++ ) |
---|
| 557 | { |
---|
| 558 | rpcPic = *(++iterPic); |
---|
| 559 | if(rpcPic->getSlice(0)->isReferenced() == false) |
---|
| 560 | break; |
---|
| 561 | } |
---|
[2] | 562 | } |
---|
| 563 | else |
---|
| 564 | { |
---|
[56] | 565 | if ( getUseAdaptiveQP() ) |
---|
| 566 | { |
---|
| 567 | TEncPic* pcEPic = new TEncPic; |
---|
| 568 | pcEPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth, m_cPPS.getMaxCuDQPDepth()+1 ); |
---|
| 569 | rpcPic = pcEPic; |
---|
| 570 | } |
---|
| 571 | else |
---|
| 572 | { |
---|
| 573 | rpcPic = new TComPic; |
---|
| 574 | rpcPic->create( m_iSourceWidth, m_iSourceHeight, g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); |
---|
| 575 | } |
---|
| 576 | m_cListPic.pushBack( rpcPic ); |
---|
[2] | 577 | } |
---|
[56] | 578 | #if HHI_INTERVIEW_SKIP |
---|
| 579 | if( m_bInterViewSkip ) |
---|
| 580 | { |
---|
| 581 | rpcPic->addUsedPelsMapBuffer(); |
---|
| 582 | } |
---|
| 583 | #endif |
---|
[2] | 584 | rpcPic->setReconMark (false); |
---|
[56] | 585 | |
---|
[2] | 586 | m_iPOCLast++; |
---|
| 587 | m_iNumPicRcvd++; |
---|
[56] | 588 | |
---|
[5] | 589 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[2] | 590 | if( m_uiMultiviewMvRegMode ) |
---|
| 591 | { |
---|
| 592 | rpcPic->addOrgDepthMapBuffer(); |
---|
| 593 | } |
---|
[5] | 594 | #endif |
---|
[56] | 595 | |
---|
[2] | 596 | rpcPic->getSlice(0)->setPOC( m_iPOCLast ); |
---|
| 597 | // mark it should be extended |
---|
| 598 | rpcPic->getPicYuvRec()->setBorderExtension(false); |
---|
| 599 | } |
---|
| 600 | |
---|
| 601 | Void TEncTop::xInitSPS() |
---|
| 602 | { |
---|
[56] | 603 | m_cSPS.setPicWidthInLumaSamples ( m_iSourceWidth ); |
---|
| 604 | m_cSPS.setPicHeightInLumaSamples ( m_iSourceHeight ); |
---|
| 605 | #if PIC_CROPPING |
---|
| 606 | m_cSPS.setPicCroppingFlag( m_croppingMode!= 0 ); |
---|
| 607 | if (m_croppingMode != 0) |
---|
| 608 | { |
---|
| 609 | m_cSPS.setPicCropLeftOffset( m_cropLeft ); |
---|
| 610 | m_cSPS.setPicCropRightOffset( m_cropRight ); |
---|
| 611 | m_cSPS.setPicCropTopOffset( m_cropTop ); |
---|
| 612 | m_cSPS.setPicCropBottomOffset( m_cropBottom ); |
---|
| 613 | } |
---|
| 614 | #else |
---|
[2] | 615 | m_cSPS.setPad ( m_aiPad ); |
---|
[56] | 616 | #endif |
---|
[2] | 617 | m_cSPS.setMaxCUWidth ( g_uiMaxCUWidth ); |
---|
| 618 | m_cSPS.setMaxCUHeight ( g_uiMaxCUHeight ); |
---|
| 619 | m_cSPS.setMaxCUDepth ( g_uiMaxCUDepth ); |
---|
| 620 | m_cSPS.setMinTrDepth ( 0 ); |
---|
| 621 | m_cSPS.setMaxTrDepth ( 1 ); |
---|
[56] | 622 | |
---|
| 623 | #if !H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
| 624 | m_cSPS.setMaxNumberOfReferencePictures(m_maxNumberOfReferencePictures); |
---|
| 625 | m_cSPS.setNumReorderFrames(m_numReorderFrames); |
---|
| 626 | #endif |
---|
| 627 | m_cSPS.setPCMLog2MinSize (m_uiPCMLog2MinSize); |
---|
| 628 | m_cSPS.setUsePCM ( m_usePCM ); |
---|
| 629 | m_cSPS.setPCMLog2MaxSize( m_pcmLog2MaxSize ); |
---|
[2] | 630 | |
---|
| 631 | m_cSPS.setUseALF ( m_bUseALF ); |
---|
[56] | 632 | #if LCU_SYNTAX_ALF |
---|
| 633 | if(m_bUseALF) |
---|
| 634 | { |
---|
| 635 | m_cSPS.setUseALFCoefInSlice(m_bALFParamInSlice); |
---|
| 636 | } |
---|
| 637 | #endif |
---|
| 638 | |
---|
[2] | 639 | m_cSPS.setQuadtreeTULog2MaxSize( m_uiQuadtreeTULog2MaxSize ); |
---|
| 640 | m_cSPS.setQuadtreeTULog2MinSize( m_uiQuadtreeTULog2MinSize ); |
---|
| 641 | m_cSPS.setQuadtreeTUMaxDepthInter( m_uiQuadtreeTUMaxDepthInter ); |
---|
| 642 | m_cSPS.setQuadtreeTUMaxDepthIntra( m_uiQuadtreeTUMaxDepthIntra ); |
---|
[56] | 643 | |
---|
| 644 | #if LOSSLESS_CODING |
---|
| 645 | m_cSPS.setUseLossless ( m_useLossless ); |
---|
[2] | 646 | #endif |
---|
[56] | 647 | #if !PIC_CROPPING |
---|
[2] | 648 | m_cSPS.setUsePAD ( m_bUsePAD ); |
---|
[56] | 649 | #endif |
---|
| 650 | m_cSPS.setUseLMChroma ( m_bUseLMChroma ); |
---|
| 651 | |
---|
| 652 | m_cSPS.setMaxTrSize ( 1 << m_uiQuadtreeTULog2MaxSize ); |
---|
| 653 | |
---|
| 654 | m_cSPS.setUseLComb ( m_bUseLComb ); |
---|
| 655 | m_cSPS.setLCMod ( m_bLCMod ); |
---|
| 656 | m_cSPS.setUseNSQT( m_useNSQT ); |
---|
| 657 | |
---|
| 658 | Int i; |
---|
| 659 | #if HHI_AMVP_OFF |
---|
| 660 | for ( i = 0; i < g_uiMaxCUDepth; i++ ) |
---|
| 661 | { |
---|
| 662 | m_cSPS.setAMVPMode( i, AM_NONE ); |
---|
| 663 | } |
---|
| 664 | #else |
---|
| 665 | for ( i = 0; i < g_uiMaxCUDepth; i++ ) |
---|
| 666 | { |
---|
| 667 | m_cSPS.setAMVPMode( i, AM_EXPL ); |
---|
| 668 | } |
---|
| 669 | #endif |
---|
| 670 | |
---|
| 671 | for (i = 0; i < g_uiMaxCUDepth-1; i++ ) |
---|
| 672 | { |
---|
| 673 | m_cSPS.setAMPAcc( i, m_useAMP ); |
---|
| 674 | //m_cSPS.setAMPAcc( i, 1 ); |
---|
| 675 | } |
---|
[2] | 676 | |
---|
[56] | 677 | m_cSPS.setUseAMP ( m_useAMP ); |
---|
[2] | 678 | |
---|
[56] | 679 | for (i = g_uiMaxCUDepth-1; i < g_uiMaxCUDepth; i++ ) |
---|
| 680 | { |
---|
| 681 | m_cSPS.setAMPAcc(i, 0); |
---|
| 682 | } |
---|
| 683 | |
---|
| 684 | m_cSPS.setBitDepth ( g_uiBitDepth ); |
---|
| 685 | m_cSPS.setBitIncrement( g_uiBitIncrement ); |
---|
| 686 | #if H0736_AVC_STYLE_QP_RANGE |
---|
| 687 | m_cSPS.setQpBDOffsetY ( (Int)(6*(g_uiBitDepth + g_uiBitIncrement - 8)) ); |
---|
| 688 | m_cSPS.setQpBDOffsetC ( (Int)(6*(g_uiBitDepth + g_uiBitIncrement - 8)) ); |
---|
[2] | 689 | #endif |
---|
| 690 | |
---|
[56] | 691 | m_cSPS.setLFCrossSliceBoundaryFlag( m_bLFCrossSliceBoundaryFlag ); |
---|
| 692 | m_cSPS.setUseSAO( m_bUseSAO ); |
---|
[2] | 693 | |
---|
[56] | 694 | #if !H0566_TLA |
---|
| 695 | if ( m_bTLayering ) |
---|
| 696 | { |
---|
| 697 | Int iMaxTLayers = 1; |
---|
| 698 | for ( i = 1; ; i++) |
---|
| 699 | { |
---|
| 700 | iMaxTLayers = i; |
---|
| 701 | if ( (m_iGOPSize >> i) == 0 ) |
---|
| 702 | { |
---|
| 703 | break; |
---|
| 704 | } |
---|
| 705 | } |
---|
| 706 | |
---|
| 707 | m_cSPS.setMaxTLayers( (UInt)iMaxTLayers ); |
---|
| 708 | |
---|
| 709 | Bool bTemporalIdNestingFlag = true; |
---|
| 710 | for ( i = 0; i < m_cSPS.getMaxTLayers()-1; i++ ) |
---|
| 711 | { |
---|
| 712 | if ( !m_abTLayerSwitchingFlag[i] ) |
---|
| 713 | { |
---|
| 714 | bTemporalIdNestingFlag = false; |
---|
| 715 | break; |
---|
| 716 | } |
---|
| 717 | } |
---|
| 718 | |
---|
| 719 | m_cSPS.setTemporalIdNestingFlag( bTemporalIdNestingFlag ); |
---|
| 720 | } |
---|
| 721 | else |
---|
| 722 | { |
---|
| 723 | m_cSPS.setMaxTLayers( 1 ); |
---|
| 724 | m_cSPS.setTemporalIdNestingFlag( false ); |
---|
| 725 | } |
---|
| 726 | #else |
---|
| 727 | m_cSPS.setMaxTLayers( m_maxTempLayer ); |
---|
| 728 | m_cSPS.setTemporalIdNestingFlag( false ); |
---|
[42] | 729 | #endif |
---|
[56] | 730 | #if H0567_DPB_PARAMETERS_PER_TEMPORAL_LAYER |
---|
| 731 | for ( i = 0; i < m_cSPS.getMaxTLayers(); i++ ) |
---|
| 732 | { |
---|
| 733 | m_cSPS.setMaxDecPicBuffering(m_maxDecPicBuffering[i], i); |
---|
| 734 | m_cSPS.setNumReorderPics(m_numReorderPics[i], i); |
---|
| 735 | } |
---|
| 736 | #endif |
---|
| 737 | m_cSPS.setPCMBitDepthLuma (g_uiPCMBitDepthLuma); |
---|
| 738 | m_cSPS.setPCMBitDepthChroma (g_uiPCMBitDepthChroma); |
---|
| 739 | m_cSPS.setPCMFilterDisableFlag ( m_bPCMFilterDisableFlag ); |
---|
[42] | 740 | |
---|
[56] | 741 | m_cSPS.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); |
---|
| 742 | m_cSPS.setUniformSpacingIdr( m_iUniformSpacingIdr ); |
---|
| 743 | #if !REMOVE_TILE_DEPENDENCE |
---|
| 744 | m_cSPS.setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr ); |
---|
| 745 | #endif |
---|
| 746 | m_cSPS.setNumColumnsMinus1( m_iNumColumnsMinus1 ); |
---|
| 747 | m_cSPS.setNumRowsMinus1( m_iNumRowsMinus1 ); |
---|
| 748 | if( m_iUniformSpacingIdr == 0 ) |
---|
[2] | 749 | { |
---|
[56] | 750 | m_cSPS.setColumnWidth( m_puiColumnWidth ); |
---|
| 751 | m_cSPS.setRowHeight( m_puiRowHeight ); |
---|
| 752 | } |
---|
| 753 | m_cSPS.setScalingListFlag ( (m_useScalingListId == 0) ? 0 : 1 ); |
---|
| 754 | m_cSPS.setUseDF( m_loopFilterOffsetInAPS ); |
---|
| 755 | |
---|
| 756 | #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX |
---|
| 757 | m_cSPS.setUseDMM( m_bUseDMM ); |
---|
| 758 | #endif |
---|
| 759 | #if HHI_MPI |
---|
| 760 | m_cSPS.setUseMVI( m_bUseMVI ); |
---|
| 761 | #endif |
---|
| 762 | |
---|
| 763 | if( m_isDepth ) |
---|
| 764 | { |
---|
| 765 | m_cSPS.initMultiviewSPSDepth ( m_viewId, m_iViewOrderIdx ); |
---|
[5] | 766 | #if DEPTH_MAP_GENERATION |
---|
[56] | 767 | m_cSPS.setPredDepthMapGeneration( m_viewId, true ); |
---|
[5] | 768 | #endif |
---|
| 769 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 770 | m_cSPS.setMultiviewResPredMode ( 0 ); |
---|
[5] | 771 | #endif |
---|
[2] | 772 | } |
---|
| 773 | else |
---|
| 774 | { |
---|
[56] | 775 | m_cSPS.initMultiviewSPS ( m_viewId, m_iViewOrderIdx, m_uiCamParPrecision, m_bCamParInSliceHeader, m_aaiCodedScale, m_aaiCodedOffset ); |
---|
| 776 | if( m_viewId ) |
---|
[2] | 777 | { |
---|
[5] | 778 | #if DEPTH_MAP_GENERATION |
---|
| 779 | #if HHI_INTER_VIEW_MOTION_PRED |
---|
[56] | 780 | m_cSPS.setPredDepthMapGeneration( m_viewId, false, m_uiPredDepthMapGeneration, m_uiMultiviewMvPredMode, m_uiPdmPrecision, m_aaiPdmScaleNomDelta, m_aaiPdmOffset ); |
---|
[5] | 781 | #else |
---|
[56] | 782 | m_cSPS.setPredDepthMapGeneration( m_viewId, false, m_uiPredDepthMapGeneration, 0, m_uiPdmPrecision, m_aaiPdmScaleNomDelta, m_aaiPdmOffset ); |
---|
[5] | 783 | #endif |
---|
| 784 | #endif |
---|
| 785 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 786 | m_cSPS.setMultiviewResPredMode ( m_uiMultiviewResPredMode ); |
---|
[5] | 787 | #endif |
---|
[2] | 788 | } |
---|
| 789 | else |
---|
| 790 | { |
---|
[5] | 791 | #if DEPTH_MAP_GENERATION |
---|
[56] | 792 | m_cSPS.setPredDepthMapGeneration( m_viewId, false ); |
---|
[5] | 793 | #endif |
---|
| 794 | #if HHI_INTER_VIEW_RESIDUAL_PRED |
---|
[2] | 795 | m_cSPS.setMultiviewResPredMode ( 0 ); |
---|
[5] | 796 | #endif |
---|
[2] | 797 | } |
---|
| 798 | } |
---|
[56] | 799 | } |
---|
[2] | 800 | |
---|
[56] | 801 | Void TEncTop::xInitPPS() |
---|
| 802 | { |
---|
| 803 | m_cPPS.setConstrainedIntraPred( m_bUseConstrainedIntraPred ); |
---|
| 804 | m_cPPS.setSliceGranularity(m_iSliceGranularity); |
---|
| 805 | #if !H0566_TLA |
---|
| 806 | if ( m_cSPS.getTemporalIdNestingFlag() ) |
---|
| 807 | { |
---|
| 808 | m_cPPS.setNumTLayerSwitchingFlags( 0 ); |
---|
| 809 | for ( UInt i = 0; i < m_cSPS.getMaxTLayers() - 1; i++ ) |
---|
| 810 | { |
---|
| 811 | m_cPPS.setTLayerSwitchingFlag( i, true ); |
---|
| 812 | } |
---|
| 813 | } |
---|
| 814 | else |
---|
| 815 | { |
---|
| 816 | m_cPPS.setNumTLayerSwitchingFlags( m_cSPS.getMaxTLayers() - 1 ); |
---|
| 817 | for ( UInt i = 0; i < m_cPPS.getNumTLayerSwitchingFlags(); i++ ) |
---|
| 818 | { |
---|
| 819 | m_cPPS.setTLayerSwitchingFlag( i, m_abTLayerSwitchingFlag[i] ); |
---|
| 820 | } |
---|
| 821 | } |
---|
[2] | 822 | #endif |
---|
[56] | 823 | Bool bUseDQP = (getMaxCuDQPDepth() > 0)? true : false; |
---|
[2] | 824 | |
---|
[56] | 825 | #if LOSSLESS_CODING |
---|
| 826 | #if H0736_AVC_STYLE_QP_RANGE |
---|
| 827 | Int lowestQP = - m_cSPS.getQpBDOffsetY(); |
---|
| 828 | #else |
---|
| 829 | Int lowestQP = 0; |
---|
| 830 | #endif |
---|
| 831 | |
---|
| 832 | if(getUseLossless()) |
---|
[2] | 833 | { |
---|
[56] | 834 | if ((getMaxCuDQPDepth() == 0) && (getMaxDeltaQP() == 0 ) && (getQP() == lowestQP) ) |
---|
| 835 | { |
---|
| 836 | bUseDQP = false; |
---|
| 837 | } |
---|
| 838 | else |
---|
| 839 | { |
---|
| 840 | bUseDQP = true; |
---|
| 841 | } |
---|
[2] | 842 | } |
---|
[56] | 843 | else |
---|
| 844 | { |
---|
| 845 | if(bUseDQP == false) |
---|
| 846 | { |
---|
| 847 | if((getMaxDeltaQP() != 0 )|| getUseAdaptiveQP()) |
---|
| 848 | { |
---|
| 849 | bUseDQP = true; |
---|
| 850 | } |
---|
| 851 | } |
---|
| 852 | } |
---|
| 853 | |
---|
[2] | 854 | #else |
---|
[56] | 855 | if(bUseDQP == false) |
---|
[2] | 856 | { |
---|
[56] | 857 | if((getMaxDeltaQP() != 0 )|| getUseAdaptiveQP()) |
---|
| 858 | { |
---|
| 859 | bUseDQP = true; |
---|
| 860 | } |
---|
[2] | 861 | } |
---|
| 862 | #endif |
---|
| 863 | |
---|
[56] | 864 | if(bUseDQP) |
---|
| 865 | { |
---|
| 866 | m_cPPS.setUseDQP(true); |
---|
| 867 | m_cPPS.setMaxCuDQPDepth( m_iMaxCuDQPDepth ); |
---|
| 868 | m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) ); |
---|
| 869 | } |
---|
| 870 | else |
---|
| 871 | { |
---|
| 872 | m_cPPS.setUseDQP(false); |
---|
| 873 | m_cPPS.setMaxCuDQPDepth( 0 ); |
---|
| 874 | m_cPPS.setMinCuDQPSize( m_cPPS.getSPS()->getMaxCUWidth() >> ( m_cPPS.getMaxCuDQPDepth()) ); |
---|
| 875 | } |
---|
[2] | 876 | |
---|
[56] | 877 | m_cPPS.setChromaQpOffset ( m_iChromaQpOffset ); |
---|
| 878 | m_cPPS.setChromaQpOffset2nd( m_iChromaQpOffset2nd ); |
---|
[2] | 879 | |
---|
[56] | 880 | m_cPPS.setEntropyCodingMode( 1 ); // In the PPS now, but also remains in slice header! |
---|
| 881 | #if !WPP_SIMPLIFICATION |
---|
| 882 | m_cPPS.setEntropyCodingSynchro(m_iWaveFrontSynchro); |
---|
| 883 | m_cPPS.setCabacIstateReset(m_iWaveFrontFlush != 0); |
---|
[2] | 884 | #endif |
---|
[56] | 885 | m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams); |
---|
| 886 | m_cPPS.setUseWP( m_bUseWeightPred ); |
---|
| 887 | m_cPPS.setWPBiPredIdc( m_uiBiPredIdc ); |
---|
| 888 | m_cPPS.setEnableTMVPFlag( m_bEnableTMVP ); |
---|
| 889 | #if H0388 |
---|
| 890 | m_cPPS.setOutputFlagPresentFlag( false ); |
---|
[2] | 891 | #endif |
---|
[56] | 892 | #if MULTIBITS_DATA_HIDING |
---|
| 893 | m_cPPS.setSignHideFlag(getSignHideFlag()); |
---|
| 894 | m_cPPS.setTSIG(getTSIG()); |
---|
[2] | 895 | #endif |
---|
[56] | 896 | #if DBL_CONTROL |
---|
| 897 | m_cPPS.setDeblockingFilterControlPresent (m_DeblockingFilterControlPresent ); |
---|
[42] | 898 | #endif |
---|
[56] | 899 | #if PARALLEL_MERGE |
---|
| 900 | m_cPPS.setLog2ParallelMergeLevelMinus2 (LOG2_PARALLEL_MERGE_LEVEL_MINUS2); |
---|
[5] | 901 | #endif |
---|
[56] | 902 | #if CABAC_INIT_FLAG |
---|
| 903 | m_cPPS.setCabacInitPresentFlag(CABAC_INIT_PRESENT_FLAG); |
---|
[42] | 904 | #endif |
---|
[2] | 905 | } |
---|
| 906 | |
---|
[56] | 907 | //Function for initializing m_RPSList, a list of TComReferencePictureSet, based on the GOPEntry objects read from the config file. |
---|
| 908 | Void TEncTop::xInitRPS() |
---|
[2] | 909 | { |
---|
[56] | 910 | TComReferencePictureSet* rps; |
---|
| 911 | |
---|
| 912 | m_RPSList.create(getGOPSize()+m_extraRPSs); |
---|
| 913 | for( Int i = 0; i < getGOPSize()+m_extraRPSs; i++) |
---|
| 914 | { |
---|
| 915 | GOPEntryMvc ge = getGOPEntry(i); |
---|
| 916 | rps = m_RPSList.getReferencePictureSet(i); |
---|
| 917 | rps->setNumberOfPictures(ge.m_numRefPics); |
---|
| 918 | rps->setNumRefIdc(ge.m_numRefIdc); |
---|
| 919 | Int numNeg = 0; |
---|
| 920 | Int numPos = 0; |
---|
| 921 | for( Int j = 0; j < ge.m_numRefPics; j++) |
---|
[2] | 922 | { |
---|
[56] | 923 | rps->setDeltaPOC(j,ge.m_referencePics[j]); |
---|
| 924 | rps->setUsed(j,ge.m_usedByCurrPic[j]); |
---|
| 925 | if(ge.m_referencePics[j]>0) |
---|
| 926 | { |
---|
| 927 | numPos++; |
---|
| 928 | } |
---|
| 929 | else |
---|
| 930 | { |
---|
| 931 | numNeg++; |
---|
| 932 | } |
---|
[2] | 933 | } |
---|
[56] | 934 | rps->setNumberOfNegativePictures(numNeg); |
---|
| 935 | rps->setNumberOfPositivePictures(numPos); |
---|
| 936 | rps->setInterRPSPrediction(ge.m_interRPSPrediction); |
---|
| 937 | if (ge.m_interRPSPrediction) |
---|
[2] | 938 | { |
---|
[56] | 939 | rps->setDeltaRIdxMinus1(ge.m_deltaRIdxMinus1); |
---|
| 940 | rps->setDeltaRPS(ge.m_deltaRPS); |
---|
| 941 | rps->setNumRefIdc(ge.m_numRefIdc); |
---|
| 942 | for (Int j = 0; j < ge.m_numRefIdc; j++ ) |
---|
| 943 | { |
---|
| 944 | rps->setRefIdc(j, ge.m_refIdc[j]); |
---|
| 945 | } |
---|
| 946 | #if WRITE_BACK |
---|
| 947 | // the folowing code overwrite the deltaPOC and Used by current values read from the config file with the ones |
---|
| 948 | // computed from the RefIdc. This is not necessary if both are identical. Currently there is no check to see if they are identical. |
---|
| 949 | numNeg = 0; |
---|
| 950 | numPos = 0; |
---|
| 951 | TComReferencePictureSet* RPSRef = m_RPSList.getReferencePictureSet(i-(ge.m_deltaRIdxMinus1+1)); |
---|
| 952 | for (Int j = 0; j < ge.m_numRefIdc; j++ ) |
---|
| 953 | { |
---|
| 954 | if (ge.m_refIdc[j]) |
---|
| 955 | { |
---|
| 956 | Int deltaPOC = ge.m_deltaRPS + ((j < RPSRef->getNumberOfPictures())? RPSRef->getDeltaPOC(j) : 0); |
---|
| 957 | rps->setDeltaPOC((numNeg+numPos),deltaPOC); |
---|
| 958 | rps->setUsed((numNeg+numPos),ge.m_refIdc[j]==1?1:0); |
---|
| 959 | if (deltaPOC<0) |
---|
| 960 | { |
---|
| 961 | numNeg++; |
---|
| 962 | } |
---|
| 963 | else |
---|
| 964 | { |
---|
| 965 | numPos++; |
---|
| 966 | } |
---|
| 967 | } |
---|
| 968 | } |
---|
| 969 | rps->setNumberOfNegativePictures(numNeg); |
---|
| 970 | rps->setNumberOfPositivePictures(numPos); |
---|
| 971 | rps->sortDeltaPOC(); |
---|
| 972 | #endif |
---|
[2] | 973 | } |
---|
[56] | 974 | } |
---|
| 975 | |
---|
| 976 | } |
---|
[2] | 977 | |
---|
[56] | 978 | // This is a function that |
---|
| 979 | // determines what Reference Picture Set to use |
---|
| 980 | // for a specific slice (with POC = POCCurr) |
---|
| 981 | Void TEncTop::selectReferencePictureSet(TComSlice* slice, Int POCCurr, Int GOPid,TComList<TComPic*>& listPic ) |
---|
| 982 | { |
---|
| 983 | if( slice->getNalUnitType() == NAL_UNIT_CODED_SLICE_IDV ) |
---|
| 984 | { |
---|
| 985 | TComReferencePictureSet* rps = slice->getLocalRPS(); |
---|
| 986 | rps->setNumberOfNegativePictures(0); |
---|
| 987 | rps->setNumberOfPositivePictures(0); |
---|
| 988 | rps->setNumberOfLongtermPictures(0); |
---|
| 989 | rps->setNumberOfPictures(0); |
---|
| 990 | slice->setRPS(rps); |
---|
| 991 | } |
---|
| 992 | else |
---|
| 993 | { |
---|
| 994 | slice->setRPSidx(GOPid); |
---|
[2] | 995 | |
---|
[56] | 996 | for(Int extraNum=m_iGOPSize; extraNum<m_extraRPSs+m_iGOPSize; extraNum++) |
---|
| 997 | { |
---|
| 998 | if(m_uiIntraPeriod > 0) |
---|
| 999 | { |
---|
| 1000 | if(POCCurr%m_uiIntraPeriod==m_GOPList[extraNum].m_POC) |
---|
| 1001 | { |
---|
| 1002 | slice->setRPSidx(extraNum); |
---|
| 1003 | } |
---|
| 1004 | } |
---|
| 1005 | else |
---|
| 1006 | { |
---|
| 1007 | if(POCCurr==m_GOPList[extraNum].m_POC) |
---|
| 1008 | { |
---|
| 1009 | slice->setRPSidx(extraNum); |
---|
| 1010 | } |
---|
| 1011 | } |
---|
| 1012 | } |
---|
[2] | 1013 | |
---|
[56] | 1014 | slice->setRPS(getRPSList()->getReferencePictureSet(slice->getRPSidx())); |
---|
| 1015 | slice->getRPS()->setNumberOfPictures(slice->getRPS()->getNumberOfNegativePictures()+slice->getRPS()->getNumberOfPositivePictures()); |
---|
| 1016 | } |
---|
[2] | 1017 | } |
---|
| 1018 | |
---|
[56] | 1019 | Void TEncTop::xInitSPSforInterViewRefs() |
---|
[2] | 1020 | { |
---|
[56] | 1021 | // base view |
---|
| 1022 | if( getGOPEntry( MAX_GOP ).m_POC == -1 ) |
---|
| 1023 | { |
---|
| 1024 | m_cSPS.setNumberOfUsableInterViewRefs( 0 ); |
---|
| 1025 | m_cSPS.setListsModificationPresentFlag( false ); |
---|
| 1026 | return; |
---|
| 1027 | } |
---|
[2] | 1028 | |
---|
[56] | 1029 | Int numberUsableInterViewRefs = 0; |
---|
| 1030 | for( Int i = 0; i < getGOPSize()+1 && numberUsableInterViewRefs < MAX_VIEW_NUM; i++ ) |
---|
[2] | 1031 | { |
---|
[56] | 1032 | GOPEntryMvc ge = ( i < getGOPSize() ) ? getGOPEntry( i ) : getGOPEntry( MAX_GOP ); |
---|
| 1033 | for( Int j = 0; j < ge.m_numInterViewRefPics; j++ ) |
---|
[2] | 1034 | { |
---|
[56] | 1035 | // add ref view to list |
---|
| 1036 | Bool onList = false; |
---|
| 1037 | for( Int k = 0; k < numberUsableInterViewRefs; k++ ) |
---|
[2] | 1038 | { |
---|
[56] | 1039 | if( ge.m_interViewRefs[j] == m_cSPS.getUsableInterViewRef( k ) ) |
---|
[2] | 1040 | { |
---|
[56] | 1041 | onList = true; |
---|
[2] | 1042 | break; |
---|
| 1043 | } |
---|
| 1044 | } |
---|
[56] | 1045 | if( !onList ) |
---|
[2] | 1046 | { |
---|
[56] | 1047 | m_cSPS.setUsableInterViewRef( (UInt)numberUsableInterViewRefs, ge.m_interViewRefs[j] ); |
---|
| 1048 | numberUsableInterViewRefs++; |
---|
[2] | 1049 | } |
---|
| 1050 | } |
---|
| 1051 | } |
---|
[56] | 1052 | m_cSPS.setNumberOfUsableInterViewRefs( numberUsableInterViewRefs ); |
---|
| 1053 | |
---|
| 1054 | // sort inter view refs |
---|
| 1055 | for( Int j = 1; j < m_cSPS.getNumberOfUsableInterViewRefs(); j++ ) |
---|
| 1056 | { |
---|
| 1057 | Int deltaViewId = m_cSPS.getUsableInterViewRef( j ); |
---|
| 1058 | for( Int k = j-1; k >= 0; k-- ) |
---|
| 1059 | { |
---|
| 1060 | Int temp = m_cSPS.getUsableInterViewRef( k ); |
---|
| 1061 | if( deltaViewId > temp ) |
---|
| 1062 | { |
---|
| 1063 | m_cSPS.setUsableInterViewRef( k+1, temp ); |
---|
| 1064 | m_cSPS.setUsableInterViewRef( k, deltaViewId ); |
---|
| 1065 | } |
---|
| 1066 | } |
---|
[2] | 1067 | } |
---|
[56] | 1068 | |
---|
| 1069 | m_cSPS.setListsModificationPresentFlag( true ); |
---|
| 1070 | } |
---|
| 1071 | |
---|
| 1072 | Void TEncTop::xInitPPSforTiles() |
---|
| 1073 | { |
---|
| 1074 | m_cPPS.setColumnRowInfoPresent( m_iColumnRowInfoPresent ); |
---|
| 1075 | m_cPPS.setUniformSpacingIdr( m_iUniformSpacingIdr ); |
---|
| 1076 | #if !REMOVE_TILE_DEPENDENCE |
---|
| 1077 | m_cPPS.setTileBoundaryIndependenceIdr( m_iTileBoundaryIndependenceIdr ); |
---|
| 1078 | #endif |
---|
| 1079 | m_cPPS.setNumColumnsMinus1( m_iNumColumnsMinus1 ); |
---|
| 1080 | m_cPPS.setNumRowsMinus1( m_iNumRowsMinus1 ); |
---|
| 1081 | if( m_iUniformSpacingIdr == 0 ) |
---|
[2] | 1082 | { |
---|
[56] | 1083 | m_cPPS.setColumnWidth( m_puiColumnWidth ); |
---|
| 1084 | m_cPPS.setRowHeight( m_puiRowHeight ); |
---|
[2] | 1085 | } |
---|
[56] | 1086 | m_cPPS.setTileBehaviorControlPresentFlag( m_iTileBehaviorControlPresentFlag ); |
---|
| 1087 | m_cPPS.setLFCrossTileBoundaryFlag( m_bLFCrossTileBoundaryFlag ); |
---|
| 1088 | |
---|
| 1089 | // # substreams is "per tile" when tiles are independent. |
---|
| 1090 | if (m_iTileBoundaryIndependenceIdr && m_iWaveFrontSynchro) |
---|
[2] | 1091 | { |
---|
[56] | 1092 | m_cPPS.setNumSubstreams(m_iWaveFrontSubstreams * (m_iNumColumnsMinus1+1)*(m_iNumRowsMinus1+1)); |
---|
[2] | 1093 | } |
---|
| 1094 | } |
---|
| 1095 | |
---|
[56] | 1096 | Void TEncCfg::xCheckGSParameters() |
---|
[2] | 1097 | { |
---|
[56] | 1098 | Int iWidthInCU = ( m_iSourceWidth%g_uiMaxCUWidth ) ? m_iSourceWidth/g_uiMaxCUWidth + 1 : m_iSourceWidth/g_uiMaxCUWidth; |
---|
| 1099 | Int iHeightInCU = ( m_iSourceHeight%g_uiMaxCUHeight ) ? m_iSourceHeight/g_uiMaxCUHeight + 1 : m_iSourceHeight/g_uiMaxCUHeight; |
---|
| 1100 | UInt uiCummulativeColumnWidth = 0; |
---|
| 1101 | UInt uiCummulativeRowHeight = 0; |
---|
| 1102 | |
---|
| 1103 | //check the column relative parameters |
---|
| 1104 | if( m_iNumColumnsMinus1 >= (1<<(LOG2_MAX_NUM_COLUMNS_MINUS1+1)) ) |
---|
[2] | 1105 | { |
---|
[56] | 1106 | printf( "The number of columns is larger than the maximum allowed number of columns.\n" ); |
---|
| 1107 | exit( EXIT_FAILURE ); |
---|
[2] | 1108 | } |
---|
[56] | 1109 | |
---|
| 1110 | if( m_iNumColumnsMinus1 >= iWidthInCU ) |
---|
[2] | 1111 | { |
---|
[56] | 1112 | printf( "The current picture can not have so many columns.\n" ); |
---|
| 1113 | exit( EXIT_FAILURE ); |
---|
[2] | 1114 | } |
---|
[56] | 1115 | |
---|
| 1116 | if( m_iNumColumnsMinus1 && m_iUniformSpacingIdr==0 ) |
---|
[2] | 1117 | { |
---|
[56] | 1118 | for(Int i=0; i<m_iNumColumnsMinus1; i++) |
---|
| 1119 | uiCummulativeColumnWidth += m_puiColumnWidth[i]; |
---|
| 1120 | |
---|
| 1121 | if( uiCummulativeColumnWidth >= iWidthInCU ) |
---|
| 1122 | { |
---|
| 1123 | printf( "The width of the column is too large.\n" ); |
---|
| 1124 | exit( EXIT_FAILURE ); |
---|
| 1125 | } |
---|
[2] | 1126 | } |
---|
[56] | 1127 | |
---|
| 1128 | //check the row relative parameters |
---|
| 1129 | if( m_iNumRowsMinus1 >= (1<<(LOG2_MAX_NUM_ROWS_MINUS1+1)) ) |
---|
[2] | 1130 | { |
---|
[56] | 1131 | printf( "The number of rows is larger than the maximum allowed number of rows.\n" ); |
---|
| 1132 | exit( EXIT_FAILURE ); |
---|
[2] | 1133 | } |
---|
[56] | 1134 | |
---|
| 1135 | if( m_iNumRowsMinus1 >= iHeightInCU ) |
---|
[2] | 1136 | { |
---|
[56] | 1137 | printf( "The current picture can not have so many rows.\n" ); |
---|
| 1138 | exit( EXIT_FAILURE ); |
---|
[2] | 1139 | } |
---|
| 1140 | |
---|
[56] | 1141 | if( m_iNumRowsMinus1 && m_iUniformSpacingIdr==0 ) |
---|
| 1142 | { |
---|
| 1143 | for(Int i=0; i<m_iNumRowsMinus1; i++) |
---|
| 1144 | uiCummulativeRowHeight += m_puiRowHeight[i]; |
---|
| 1145 | |
---|
| 1146 | if( uiCummulativeRowHeight >= iHeightInCU ) |
---|
| 1147 | { |
---|
| 1148 | printf( "The height of the row is too large.\n" ); |
---|
| 1149 | exit( EXIT_FAILURE ); |
---|
| 1150 | } |
---|
| 1151 | } |
---|
[2] | 1152 | } |
---|
| 1153 | |
---|
[56] | 1154 | Void TEncTop::setTEncTopList(std::vector<TEncTop*>* pacTEncTopList ) |
---|
| 1155 | { |
---|
| 1156 | assert(m_viewId!=-1); // not to be set for single view coding |
---|
[2] | 1157 | |
---|
[56] | 1158 | m_pacTEncTopList=pacTEncTopList; |
---|
| 1159 | |
---|
| 1160 | } |
---|
| 1161 | |
---|
| 1162 | Void TEncTop::printOutSummary(UInt uiNumAllPicCoded) |
---|
[2] | 1163 | { |
---|
[56] | 1164 | assert (uiNumAllPicCoded == m_cAnalyzeAll.getNumPic()); |
---|
[2] | 1165 | |
---|
[56] | 1166 | //--CFG_KDY |
---|
| 1167 | m_cAnalyzeAll.setFrmRate( getFrameRate() ); |
---|
| 1168 | m_cAnalyzeI.setFrmRate( getFrameRate() ); |
---|
| 1169 | m_cAnalyzeP.setFrmRate( getFrameRate() ); |
---|
| 1170 | m_cAnalyzeB.setFrmRate( getFrameRate() ); |
---|
[2] | 1171 | |
---|
[56] | 1172 | //-- all |
---|
| 1173 | if(m_viewId==-1) |
---|
| 1174 | printf( "\n\nSUMMARY --------------------------------------------------------\n" ); |
---|
| 1175 | else { |
---|
| 1176 | if ( m_isDepth ) |
---|
| 1177 | { |
---|
| 1178 | printf( "\n\nSUMMARY ---------------------------------------------- DEPTH %2d\n", m_viewId ); |
---|
| 1179 | } |
---|
| 1180 | else |
---|
| 1181 | { |
---|
| 1182 | printf( "\n\nSUMMARY ---------------------------------------------- VIDEO %2d\n", m_viewId ); |
---|
| 1183 | } |
---|
| 1184 | }; |
---|
| 1185 | m_cAnalyzeAll.printOut('a'); |
---|
[2] | 1186 | |
---|
[56] | 1187 | printf( "\n\nI Slices--------------------------------------------------------\n" ); |
---|
| 1188 | m_cAnalyzeI.printOut('i'); |
---|
| 1189 | |
---|
| 1190 | printf( "\n\nP Slices--------------------------------------------------------\n" ); |
---|
| 1191 | m_cAnalyzeP.printOut('p'); |
---|
| 1192 | |
---|
| 1193 | printf( "\n\nB Slices--------------------------------------------------------\n" ); |
---|
| 1194 | m_cAnalyzeB.printOut('b'); |
---|
| 1195 | |
---|
| 1196 | // m_cAnalyzeAll.printSummaryOut(); |
---|
| 1197 | // m_cAnalyzeI.printSummary('I'); |
---|
| 1198 | // m_cAnalyzeP.printSummary('P'); |
---|
| 1199 | // m_cAnalyzeB.printSummary('B'); |
---|
[2] | 1200 | } |
---|
[56] | 1201 | |
---|
| 1202 | //! \} |
---|