Changeset 983 in 3DVCSoftware for branches/HTM-11.2-dev3-MediaTek
- Timestamp:
- 11 Jul 2014, 03:49:39 (10 years ago)
- Location:
- branches/HTM-11.2-dev3-MediaTek
- Files:
-
- 3 added
- 33 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/NonCTC/allintra/baseCfg_2view+depth_AllIntra.cfg
r872 r983 179 179 InterSDC : 1 # use of inter sdc 180 180 MPI : 1 181 181 SingleDepthMode : 1 # use of single depth mode 182 182 #========== view synthesis optimization (VSO) ========== 183 183 -
branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/NonCTC/allintra/baseCfg_3view+depth_AllIntra.cfg
r872 r983 194 194 InterSDC : 1 # use of inter sdc 195 195 MPI : 1 196 196 SingleDepthMode : 1 # use of single depth mode 197 197 #========== view synthesis optimization (VSO) ========== 198 198 VSOConfig : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string -
branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_2view+depth.cfg
r950 r983 215 215 InterSDC : 1 # use of inter sdc 216 216 MPI : 1 217 217 SingleDepthMode : 1 # use of single depth mode 218 218 #========== view synthesis optimization (VSO) ========== 219 219 -
branches/HTM-11.2-dev3-MediaTek/cfg/3D-HEVC/baseCfg_3view+depth.cfg
r950 r983 246 246 InterSDC : 1 # use of inter sdc 247 247 MPI : 1 248 248 SingleDepthMode : 1 # use of single depth mode 249 249 #========== view synthesis optimization (VSO) ========== 250 250 VSOConfig : [cx0 B(cc1) I(s0.25 s0.5 s0.75)][cx1 B(oo0) B(oo2) I(s0.25 s0.5 s0.75 s1.25 s1.5 s1.75)][cx2 B(cc1) I(s1.25 s1.5 s1.75)] # VSO configuration string -
branches/HTM-11.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.cpp
r976 r983 380 380 ("SDC", m_useSDC, true, "Simplified depth coding") 381 381 ("DLT", m_useDLT, true, "Depth lookup table") 382 #endif 383 #if MTK_SINGLE_DEPTH_MODE_I0095 384 ("SingleDepthMode", m_useSingleDepthMode, true, "Single depth mode") 382 385 #endif 383 386 #endif … … 2523 2526 printf("DLT:%d ", m_useDLT ); 2524 2527 #endif 2528 #if MTK_SINGLE_DEPTH_MODE_I0095 2529 printf("SingleDepthMode:%d ", m_useSingleDepthMode); 2530 #endif 2525 2531 #if H_3D_INTER_SDC 2526 2532 printf( "interSDC:%d ", m_bDepthInterSDCFlag ? 1 : 0 ); -
branches/HTM-11.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncCfg.h
r976 r983 473 473 Bool m_useDLT; ///< flag for using DLT 474 474 #endif 475 #if MTK_SINGLE_DEPTH_MODE_I0095 476 Bool m_useSingleDepthMode; ///< flag for using single depth mode 477 #endif 475 478 #if H_3D_QTLPC 476 479 Bool m_bUseQTL; ///< flag for using depth QuadTree Limitation -
branches/HTM-11.2-dev3-MediaTek/source/App/TAppEncoder/TAppEncTop.cpp
r976 r983 201 201 m_cTEncTop.setUseSDC ( isDepth ? m_useSDC : false ); 202 202 m_cTEncTop.setUseDLT ( isDepth ? m_useDLT : false ); 203 #endif 204 #if MTK_SINGLE_DEPTH_MODE_I0095 205 m_cTEncTop.setUseSingleDepthMode ( isDepth ? m_useSingleDepthMode : false ); 203 206 #endif 204 207 #if H_3D_QTLPC -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/ContextTables.h
r976 r983 51 51 #define NUM_SPLIT_FLAG_CTX 3 ///< number of context models for split flag 52 52 #define NUM_SKIP_FLAG_CTX 3 ///< number of context models for skip flag 53 53 #if MTK_SINGLE_DEPTH_MODE_I0095 54 #define NUM_SINGLEDEPTH_FLAG_CTX 1 55 #define NUM_SINGLE_DEPTH_VALUE_DATA_CTX 1 56 #endif 54 57 #define NUM_MERGE_FLAG_EXT_CTX 1 ///< number of context models for merge flag of merge extended 55 58 #define NUM_MERGE_IDX_EXT_CTX 1 ///< number of context models for merge index of merge extended … … 150 153 { CNU, CNU, CNU, }, 151 154 }; 152 155 #if MTK_SINGLE_DEPTH_MODE_I0095 156 static const UChar 157 INIT_SINGLEDEPTH_FLAG[3][NUM_SINGLEDEPTH_FLAG_CTX] = 158 { 159 { 185 }, 160 { 185 }, 161 { 185 }, 162 }; 163 static const UChar 164 INIT_SINGLE_DEPTH_VALUE_DATA[3][NUM_SINGLE_DEPTH_VALUE_DATA_CTX] = 165 { 166 { 137 }, 167 { 137 }, 168 { 137 }, 169 }; 170 #endif 153 171 static const UChar 154 172 INIT_MERGE_FLAG_EXT[3][NUM_MERGE_FLAG_EXT_CTX] = -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.cpp
r976 r983 60 60 61 61 m_skipFlag = NULL; 62 62 #if MTK_SINGLE_DEPTH_MODE_I0095 63 m_singleDepthFlag = NULL; 64 m_apSingleDepthValue = NULL; 65 #endif 63 66 m_pePartSize = NULL; 64 67 m_pePredMode = NULL; … … 182 185 183 186 m_skipFlag = new Bool[ uiNumPartition ]; 184 187 #if MTK_SINGLE_DEPTH_MODE_I0095 188 m_singleDepthFlag = new Bool[ uiNumPartition ]; 189 m_apSingleDepthValue = (Pel*)xMalloc(Pel, uiNumPartition); 190 #endif 185 191 m_pePartSize = new Char[ uiNumPartition ]; 186 192 memset( m_pePartSize, SIZE_NONE,uiNumPartition * sizeof( *m_pePartSize ) ); … … 329 335 330 336 if ( m_skipFlag ) { delete[] m_skipFlag; m_skipFlag = NULL; } 331 337 #if MTK_SINGLE_DEPTH_MODE_I0095 338 if ( m_singleDepthFlag ) { delete[] m_singleDepthFlag; m_singleDepthFlag = NULL; } 339 if ( m_apSingleDepthValue ) { xFree(m_apSingleDepthValue); m_apSingleDepthValue = NULL; } 340 #endif 332 341 if ( m_pePartSize ) { delete[] m_pePartSize; m_pePartSize = NULL; } 333 342 if ( m_pePredMode ) { delete[] m_pePredMode; m_pePredMode = NULL; } … … 494 503 TComDataCU * pcFrom = pcPic->getCU(getAddr()); 495 504 m_skipFlag[ui] = pcFrom->getSkipFlag(ui); 505 #if MTK_SINGLE_DEPTH_MODE_I0095 506 m_singleDepthFlag[ui] = pcFrom->getSingleDepthFlag(ui); 507 m_apSingleDepthValue[ui] = pcFrom->getSingleDepthValue(ui); 508 #endif 496 509 m_pePartSize[ui] = pcFrom->getPartitionSize(ui); 497 510 m_pePredMode[ui] = pcFrom->getPredictionMode(ui); … … 550 563 { 551 564 memset( m_skipFlag + firstElement, false, numElements * sizeof( *m_skipFlag ) ); 552 565 #if MTK_SINGLE_DEPTH_MODE_I0095 566 memset( m_singleDepthFlag + firstElement, false, numElements * sizeof( *m_singleDepthFlag ) ); 567 memset( m_apSingleDepthValue + firstElement, 0, numElements * sizeof( *m_apSingleDepthValue ) ); 568 #endif 553 569 memset( m_pePartSize + firstElement, SIZE_NONE, numElements * sizeof( *m_pePartSize ) ); 554 570 memset( m_pePredMode + firstElement, MODE_NONE, numElements * sizeof( *m_pePredMode ) ); … … 738 754 m_puhTransformSkip[2][ui] = 0; 739 755 m_skipFlag[ui] = false; 756 #if MTK_SINGLE_DEPTH_MODE_I0095 757 m_singleDepthFlag[ui] = false; 758 m_apSingleDepthValue[ui] = 0; 759 #endif 740 760 m_pePartSize[ui] = SIZE_NONE; 741 761 m_pePredMode[ui] = MODE_NONE; … … 913 933 { 914 934 m_skipFlag[ui] = false; 935 #if MTK_SINGLE_DEPTH_MODE_I0095 936 m_singleDepthFlag[ui] = false; 937 m_apSingleDepthValue[ui]= 0; 938 #endif 915 939 m_pePartSize[ui] = SIZE_NONE; 916 940 m_pePredMode[ui] = MODE_NONE; … … 934 958 m_puhTransformSkip[2][ui] = pcCU->getTransformSkip(uiPartOffset+ui,TEXT_CHROMA_V); 935 959 m_skipFlag[ui] = pcCU->getSkipFlag(uiPartOffset+ui); 960 #if MTK_SINGLE_DEPTH_MODE_I0095 961 m_singleDepthFlag[ui] = pcCU->getSingleDepthFlag(uiPartOffset+ui); 962 m_apSingleDepthValue[ui] = pcCU->getSingleDepthValue(uiPartOffset+ui); 963 #endif 936 964 m_pePartSize[ui] = pcCU->getPartitionSize(uiPartOffset+ui); 937 965 m_pePredMode[ui] = pcCU->getPredictionMode(uiPartOffset+ui); … … 1083 1111 1084 1112 m_skipFlag=pcCU->getSkipFlag() + uiPart; 1085 1113 #if MTK_SINGLE_DEPTH_MODE_I0095 1114 m_singleDepthFlag = pcCU->getSingleDepthFlag() + uiPart; 1115 m_apSingleDepthValue = pcCU->getSingleDepthValue() + uiPart; 1116 #endif 1086 1117 m_phQP=pcCU->getQP() + uiPart; 1087 1118 m_pePartSize = pcCU->getPartitionSize() + uiPart; … … 1221 1252 1222 1253 m_skipFlag = pcCU->getSkipFlag () + uiAbsPartIdx; 1223 1254 #if MTK_SINGLE_DEPTH_MODE_I0095 1255 m_singleDepthFlag = pcCU->getSingleDepthFlag () + uiAbsPartIdx; 1256 m_apSingleDepthValue = pcCU->getSingleDepthValue () + uiAbsPartIdx; 1257 #endif 1224 1258 m_pePartSize = pcCU->getPartitionSize () + uiAbsPartIdx; 1225 1259 #if H_3D_NBDV … … 1297 1331 Int sizeInChar = sizeof( Char ) * uiNumPartition; 1298 1332 memcpy( m_skipFlag + uiOffset, pcCU->getSkipFlag(), sizeof( *m_skipFlag ) * uiNumPartition ); 1333 #if MTK_SINGLE_DEPTH_MODE_I0095 1334 memcpy( m_singleDepthFlag + uiOffset, pcCU->getSingleDepthFlag(), sizeof( *m_singleDepthFlag ) * uiNumPartition ); 1335 memcpy( m_apSingleDepthValue + uiOffset, pcCU->getSingleDepthValue(), sizeof( *m_apSingleDepthValue ) * uiNumPartition); 1336 #endif 1299 1337 memcpy( m_phQP + uiOffset, pcCU->getQP(), sizeInChar ); 1300 1338 memcpy( m_pePartSize + uiOffset, pcCU->getPartitionSize(), sizeof( *m_pePartSize ) * uiNumPartition ); … … 1417 1455 1418 1456 memcpy( rpcCU->getSkipFlag() + m_uiAbsIdxInLCU, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition ); 1419 1457 #if MTK_SINGLE_DEPTH_MODE_I0095 1458 memcpy( rpcCU->getSingleDepthFlag() + m_uiAbsIdxInLCU, m_singleDepthFlag, sizeof( *m_singleDepthFlag ) * m_uiNumPartition ); 1459 memcpy( rpcCU->getSingleDepthValue() + m_uiAbsIdxInLCU, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * m_uiNumPartition); 1460 #endif 1420 1461 memcpy( rpcCU->getQP() + m_uiAbsIdxInLCU, m_phQP, sizeInChar ); 1421 1462 #if H_3D_NBDV … … 1533 1574 Int sizeInChar = sizeof( Char ) * uiQNumPart; 1534 1575 memcpy( rpcCU->getSkipFlag() + uiPartOffset, m_skipFlag, sizeof( *m_skipFlag ) * uiQNumPart ); 1535 1576 #if MTK_SINGLE_DEPTH_MODE_I0095 1577 memcpy( rpcCU->getSingleDepthFlag() + uiPartOffset, m_singleDepthFlag, sizeof( *m_singleDepthFlag ) * uiQNumPart ); 1578 memcpy( rpcCU->getSingleDepthValue() + uiPartOffset, m_apSingleDepthValue, sizeof( *m_apSingleDepthValue ) * uiQNumPart); 1579 #endif 1536 1580 memcpy( rpcCU->getQP() + uiPartOffset, m_phQP, sizeInChar ); 1537 1581 memcpy( rpcCU->getPartitionSize() + uiPartOffset, m_pePartSize, sizeof( *m_pePartSize ) * uiQNumPart ); … … 2453 2497 memset( m_skipFlag + absPartIdx, skip, m_pcPic->getNumPartInCU() >> ( 2 * depth ) ); 2454 2498 } 2455 2499 #if MTK_SINGLE_DEPTH_MODE_I0095 2500 Void TComDataCU::setSingleDepthFlagSubParts( Bool singleDepth, UInt absPartIdx, UInt depth ) 2501 { 2502 assert( sizeof( *m_singleDepthFlag) == 1 ); 2503 memset( m_singleDepthFlag + absPartIdx, singleDepth, m_pcPic->getNumPartInCU() >> ( 2 * depth ) ); 2504 } 2505 2506 Void TComDataCU::setSingleDepthValueSubParts(Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ) 2507 { 2508 setSubPartT<Pel>( singleDepthValue, m_apSingleDepthValue, uiAbsPartIdx, uiDepth, uiPUIdx ); 2509 } 2510 #endif 2456 2511 Void TComDataCU::setPredModeSubParts( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ) 2457 2512 { … … 6092 6147 } 6093 6148 #endif 6149 6150 #if MTK_SINGLE_DEPTH_MODE_I0095 6151 Bool TComDataCU::getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index) 6152 { 6153 6154 Bool bDepAvail = false; 6155 Pel *pDepth = this->getPic()->getPicYuvRec()->getLumaAddr(); 6156 Int iDepStride = this->getPic()->getPicYuvRec()->getStride(); 6157 6158 Int xP, yP, nPSW, nPSH; 6159 this->getPartPosition(uiPartIdx, xP, yP, nPSW, nPSH); 6160 UInt PicHeight=this->getPic()->getPicYuvRec()->getHeight(); 6161 UInt PicWidth=this->getPic()->getPicYuvRec()->getWidth(); 6162 switch(index) 6163 { 6164 case 0: // Mid Left 6165 if( ( xP != 0 ) && ( ( yP + ( nPSH >> 1 ) ) < PicHeight ) ) 6166 { 6167 *pNeighDepth = pDepth[ (yP+(nPSH>>1)) * iDepStride + (xP-1) ]; 6168 bDepAvail = true; 6169 } 6170 break; 6171 case 1: // Mid Above 6172 if( ( yP != 0 ) && ( ( xP + ( nPSW >> 1 ) ) < PicWidth ) ) 6173 { 6174 *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP + (nPSW>>1)) ]; 6175 bDepAvail = true; 6176 } 6177 break; 6178 case 2: // Above 6179 if(yP != 0) 6180 { 6181 *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP) ]; 6182 bDepAvail = true; 6183 } 6184 break; 6185 case 3: // Left 6186 if(xP != 0) 6187 { 6188 *pNeighDepth = pDepth[ (yP) * iDepStride + (xP-1) ]; 6189 bDepAvail = true; 6190 } 6191 break; 6192 case 4: // Above_Left 6193 if(xP != 0 && yP != 0) 6194 { 6195 *pNeighDepth = pDepth[ (yP-1) * iDepStride + (xP-1) ]; 6196 bDepAvail = true; 6197 } 6198 break; 6199 default: 6200 break; 6201 } 6202 return bDepAvail; 6203 } 6204 6205 #endif 6094 6206 #if H_3D_NBDV 6095 6207 //Notes from QC: -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComDataCU.h
r976 r983 110 110 // ------------------------------------------------------------------------------------------------------------------- 111 111 Bool* m_skipFlag; ///< array of skip flags 112 #if MTK_SINGLE_DEPTH_MODE_I0095 113 Bool* m_singleDepthFlag; ///< array of single depth flags 114 Pel* m_apSingleDepthValue; 115 #endif 112 116 Char* m_pePartSize; ///< array of partition sizes 113 117 Char* m_pePredMode; ///< array of prediction modes … … 347 351 Void setSkipFlag ( UInt idx, Bool skip) { m_skipFlag[idx] = skip; } 348 352 Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); 349 353 #if MTK_SINGLE_DEPTH_MODE_I0095 354 Bool* getSingleDepthFlag () { return m_singleDepthFlag; } 355 Bool getSingleDepthFlag (UInt idx) { return m_singleDepthFlag[idx]; } 356 Void setSingleDepthFlag ( UInt idx, Bool singleDepth) { m_singleDepthFlag[idx] = singleDepth; } 357 Void setSingleDepthFlagSubParts ( Bool singleDepth, UInt absPartIdx, UInt depth ); 358 359 Pel* getSingleDepthValue( ) { return m_apSingleDepthValue; } 360 Pel getSingleDepthValue (UInt idx) { return m_apSingleDepthValue[idx]; } 361 Void setSingleDepthValue ( UInt idx, Pel pDepthValue) { m_apSingleDepthValue[idx] = pDepthValue; } 362 Void setSingleDepthValueSubParts (Pel singleDepthValue, UInt uiAbsPartIdx, UInt uiPUIdx, UInt uiDepth ); 363 #endif 350 364 Char* getPredictionMode () { return m_pePredMode; } 351 365 PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } … … 489 503 Bool getDispMvPredCan(UInt uiPartIdx, RefPicList eRefPicList, Int iRefIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDis, Int* iPdm ); 490 504 #endif 491 505 #if MTK_SINGLE_DEPTH_MODE_I0095 506 Bool getNeighDepth (UInt uiPartIdx, UInt uiPartAddr, Pel* pNeighDepth, Int index); 507 #endif 492 508 #if H_3D_NBDV_REF 493 509 Pel getMcpFromDM(TComPicYuv* pcBaseViewDepthPicYuv, TComMv* mv, Int iBlkX, Int iBlkY, Int iWidth, Int iHeight, Int* aiShiftLUT ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.cpp
r976 r983 139 139 , m_depthToDisparityF ( NULL ) 140 140 #endif 141 #if MTK_SINGLE_DEPTH_MODE_I0095 142 , m_bApplySingleDepthMode (false) 143 #endif 141 144 #endif 142 145 { … … 1091 1094 m_interLayerPredLayerIdc[ layer ] = pSrc->m_interLayerPredLayerIdc[ layer ]; 1092 1095 } 1096 #endif 1097 #if MTK_SINGLE_DEPTH_MODE_I0095 1098 m_bApplySingleDepthMode = pSrc->m_bApplySingleDepthMode; 1093 1099 #endif 1094 1100 #if H_3D_IC -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TComSlice.h
r976 r983 2205 2205 UInt m_aiDDDShift [MAX_NUM_LAYERS]; 2206 2206 #endif 2207 2207 #if MTK_SINGLE_DEPTH_MODE_I0095 2208 Bool m_bApplySingleDepthMode; 2209 #endif 2208 2210 public: 2209 2211 TComSlice(); … … 2275 2277 #if H_3D 2276 2278 TComPic* getTexturePic () { return m_ivPicsCurrPoc[0][ m_viewIndex ]; } 2279 #endif 2280 #if MTK_SINGLE_DEPTH_MODE_I0095 2281 Void setApplySingleDepthMode( Bool b ) { m_bApplySingleDepthMode = b; } 2282 Bool getApplySingleDepthMode() { return m_bApplySingleDepthMode; } 2277 2283 #endif 2278 2284 #if H_3D_IC -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibCommon/TypeDef.h
r976 r983 215 215 // MTK_DLT_CODING_FIX_H0091 216 216 217 #define MTK_SINGLE_DEPTH_MODE_I0095 1 // Single depth mode proposed in JCT3V-I0095 218 #if MTK_SINGLE_DEPTH_MODE_I0095 219 #define MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE 2 // size of the sample candidate list 220 #endif 217 221 218 222 #define H_3D_INTER_SDC 1 // INTER SDC, Inter simplified depth coding … … 381 385 382 386 // OTHERS 383 //#define H_MV_HLS_8_HSB_Q0041_03 0 // #3 (HS /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows 384 :// #define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution 387 //#define H_MV_HLS_8_HSB_Q0041_03 0 // #3 (HS /Q0041/hybrid scalability) The proposed text was endorsed, with non-editorial open issues considered as follows ?// #define H_MV_HLS_7_OTHER_P0187_1 0 // (OTHER/P0187/NoOutputOfPriorPicsFlag) #1 Inference of NoOutputOfPriorPicsFlag and proposes to take into account colour format and bit depth for the inference in addition to spatial resolution 385 388 //#define H_MV_HLS_8_MIS_Q0078_24 0 // #24 (MISC /Q0078/scan and pic type) , Items 3 b,c and 4, clarifying which pictures in an output layer sets are applied the values of general_progressive_source_flag, general_interlaced_source_flag, general_non_packed_constraint_flag and general_frame_only_constraint_flag. 386 389 //#define H_MV_HLS_7_HRD_P0138_6 0 // (HRD/P0138/HRD parameters for bitstreams excluding) #6 Decision: Adopt (as revised in updated contribution, with the specification of a flag in the BP SEI (HRD/P0192/sub-DPB) #12 Establish sub-DPBs based on the representation format indicated at the VPS level. It was suggested that the expressed shared capacity limit would need to be less than or equal to the sum of the individual capacity limits. Decision: Adopt as modified. Further study is encouraged on profile/level constraint selections. -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.cpp
r976 r983 2473 2473 } 2474 2474 #endif 2475 #if MTK_SINGLE_DEPTH_MODE_I0095 2476 if(rpcSlice->getIsDepth()) 2477 { 2478 UInt uiCodeTmp = 0; 2479 READ_FLAG( uiCodeTmp, "slice_enable_single_depth_mode" ); 2480 rpcSlice->setApplySingleDepthMode(uiCodeTmp); 2481 } 2482 #endif 2475 2483 if (!rpcSlice->isIntra()) 2476 2484 { … … 2843 2851 assert(0); 2844 2852 } 2845 2853 #if MTK_SINGLE_DEPTH_MODE_I0095 2854 Void TDecCavlc::parseSingleDepthMode( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2855 { 2856 assert(0); 2857 } 2858 #endif 2846 2859 Void TDecCavlc::parseCUTransquantBypassFlag( TComDataCU* /*pcCU*/, UInt /*uiAbsPartIdx*/, UInt /*uiDepth*/ ) 2847 2860 { -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCAVLC.h
r976 r983 119 119 120 120 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 121 #if MTK_SINGLE_DEPTH_MODE_I0095 122 Void parseSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 123 #endif 121 124 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 122 125 Void parseMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.cpp
r976 r983 542 542 return; 543 543 } 544 544 #if MTK_SINGLE_DEPTH_MODE_I0095 545 m_pcEntropyDecoder->decodeSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth ); 546 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 547 { 548 #endif 545 549 m_pcEntropyDecoder->decodePredMode( pcCU, uiAbsPartIdx, uiDepth ); 546 550 m_pcEntropyDecoder->decodePartSize( pcCU, uiAbsPartIdx, uiDepth ); … … 572 576 m_pcEntropyDecoder->decodeCoeff( pcCU, uiAbsPartIdx, uiDepth, uiCurrWidth, uiCurrHeight, bCodeDQP ); 573 577 setdQPFlag( bCodeDQP ); 578 #if MTK_SINGLE_DEPTH_MODE_I0095 579 } 580 #endif 574 581 xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast ); 575 582 #if H_3D_IV_MERGE … … 671 678 break; 672 679 case MODE_INTRA: 680 #if MTK_SINGLE_DEPTH_MODE_I0095 681 if( m_ppcCU[uiDepth]->getSingleDepthFlag(0) ) 682 xReconIntraSingleDepth( m_ppcCU[uiDepth], 0, uiDepth ); 683 #if H_3D_DIM_SDC 684 else if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 685 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 686 #endif 687 else 688 #else 673 689 #if H_3D_DIM_SDC 674 690 if( m_ppcCU[uiDepth]->getSDCFlag(0) ) 675 691 xReconIntraSDC( m_ppcCU[uiDepth], 0, uiDepth ); 676 692 else 693 #endif 677 694 #endif 678 695 xReconIntraQT( m_ppcCU[uiDepth], uiDepth ); … … 709 726 } 710 727 } 711 728 #if MTK_SINGLE_DEPTH_MODE_I0095 729 Void TDecCu::xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 730 { 731 UInt uiWidth = pcCU->getWidth ( 0 ); 732 UInt uiHeight = pcCU->getHeight ( 0 ); 733 734 TComYuv* pcRecoYuv = m_ppcYuvReco[uiDepth]; 735 736 UInt uiStride = pcRecoYuv->getStride (); 737 Pel* piReco = pcRecoYuv->getLumaAddr( uiAbsPartIdx ); 738 739 740 AOF( uiWidth == uiHeight ); 741 AOF( uiAbsPartIdx == 0 ); 742 743 //construction of depth candidates 744 Pel testDepth; 745 Pel DepthNeighbours[5]; 746 Int index =0; 747 for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ ) 748 { 749 if(!pcCU->getNeighDepth (0, uiAbsPartIdx, &testDepth, i)) 750 { 751 continue; 752 } 753 DepthNeighbours[index]=testDepth; 754 index++; 755 for(Int j=0;j<index-1;j++) 756 { 757 if( (DepthNeighbours[index-1]==DepthNeighbours[j]) ) 758 { 759 index--; 760 break; 761 } 762 } 763 } 764 765 if(index==0) 766 { 767 DepthNeighbours[index]=1<<(g_bitDepthY-1); 768 index++; 769 } 770 771 if(index==1) 772 { 773 DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 ); 774 index++; 775 } 776 777 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 778 { 779 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 780 { 781 piReco[ uiX ] =DepthNeighbours[(Int)pcCU->getSingleDepthValue(uiAbsPartIdx)]; 782 } 783 piReco += uiStride; 784 } 785 786 // clear UV 787 UInt uiStrideC = pcRecoYuv->getCStride(); 788 Pel *pRecCb = pcRecoYuv->getCbAddr(); 789 Pel *pRecCr = pcRecoYuv->getCrAddr(); 790 791 for (Int y=0; y<uiHeight/2; y++) 792 { 793 for (Int x=0; x<uiWidth/2; x++) 794 { 795 pRecCb[x] = 1<<(g_bitDepthC-1); 796 pRecCr[x] = 1<<(g_bitDepthC-1); 797 } 798 799 pRecCb += uiStrideC; 800 pRecCr += uiStrideC; 801 } 802 } 803 #endif 712 804 #if H_3D_INTER_SDC 713 805 Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecCu.h
r872 r983 123 123 Void setdQPFlag ( Bool b ) { m_bDecodeDQP = b; } 124 124 Void xFillPCMBuffer (TComDataCU* pCU, UInt depth); 125 #if MTK_SINGLE_DEPTH_MODE_I0095 126 Void xReconIntraSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 127 #endif 125 128 #if H_3D_DIM_SDC 126 129 Void xReconIntraSDC ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecEntropy.cpp
r976 r983 52 52 m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth ); 53 53 } 54 54 #if MTK_SINGLE_DEPTH_MODE_I0095 55 Void TDecEntropy::decodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 56 { 57 if ( !pcCU->getSlice()->getIsDepth() ) 58 { 59 return; 60 } 61 if(!pcCU->getSlice()->getApplySingleDepthMode()) 62 { 63 return; 64 } 65 m_pcEntropyDecoderIf->parseSingleDepthMode( pcCU, uiAbsPartIdx, uiDepth ); 66 } 67 #endif 55 68 Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 56 69 { -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecEntropy.h
r976 r983 89 89 public: 90 90 virtual Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 91 #if MTK_SINGLE_DEPTH_MODE_I0095 92 virtual Void parseSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 93 #endif 91 94 virtual Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 95 virtual Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; … … 176 179 Void decodeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 177 180 Void decodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 181 #if MTK_SINGLE_DEPTH_MODE_I0095 182 Void decodeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) ; 183 #endif 178 184 Void decodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 179 185 Void decodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPUIdx ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecSbac.cpp
r976 r983 52 52 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 53 53 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 54 #if MTK_SINGLE_DEPTH_MODE_I0095 55 , m_cCUSingleDepthFlagSCModel ( 1, 1, NUM_SINGLEDEPTH_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 56 , m_cSingleDepthValueSCModel ( 1, 1, NUM_SINGLE_DEPTH_VALUE_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 57 #endif 54 58 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 55 59 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 132 136 m_cCUSplitFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 133 137 m_cCUSkipFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SKIP_FLAG ); 138 #if MTK_SINGLE_DEPTH_MODE_I0095 139 m_cCUSingleDepthFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 140 m_cSingleDepthValueSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 141 #endif 134 142 m_cCUMergeFlagExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT ); 135 143 m_cCUMergeIdxExtSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_MERGE_IDX_EXT ); … … 199 207 m_cCUSplitFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SPLIT_FLAG ); 200 208 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 209 #if MTK_SINGLE_DEPTH_MODE_I0095 210 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 211 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 212 #endif 201 213 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT ); 202 214 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT ); … … 636 648 #endif 637 649 } 638 650 #if MTK_SINGLE_DEPTH_MODE_I0095 651 Void TDecSbac::parseSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 652 { 653 pcCU->setSingleDepthFlagSubParts( false, uiAbsPartIdx, uiDepth ); 654 UInt uiSymbol = 0; 655 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) ); 656 if( uiSymbol ) 657 { 658 pcCU->setSingleDepthFlagSubParts( true, uiAbsPartIdx, uiDepth ); 659 pcCU->setSkipFlagSubParts( false, uiAbsPartIdx, uiDepth ); 660 pcCU->setSDCFlagSubParts( false, uiAbsPartIdx, uiDepth ); 661 pcCU->setPredModeSubParts( MODE_INTRA, uiAbsPartIdx, uiDepth ); 662 pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 663 pcCU->setLumaIntraDirSubParts (DC_IDX, uiAbsPartIdx, uiDepth ); 664 pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth ); 665 pcCU->setMergeFlagSubParts( false , uiAbsPartIdx, 0, uiDepth ); 666 pcCU->setTrIdxSubParts(0, uiAbsPartIdx, uiDepth); 667 pcCU->setCbfSubParts(0, 1, 1, uiAbsPartIdx, uiDepth); 668 669 UInt absValDeltaDC = 0; 670 671 UInt uiUnaryIdx = 0; 672 UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE; 673 if ( uiNumCand > 1 ) 674 { 675 for( ; uiUnaryIdx < uiNumCand - 1; ++uiUnaryIdx ) 676 { 677 UInt uiSymbol2 = 0; 678 if ( uiUnaryIdx==0 ) 679 { 680 m_pcTDecBinIf->decodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) ); 681 } 682 else 683 { 684 m_pcTDecBinIf->decodeBinEP( uiSymbol2); 685 } 686 if( uiSymbol2 == 0 ) 687 { 688 break; 689 } 690 } 691 } 692 absValDeltaDC = uiUnaryIdx; 693 pcCU->setSingleDepthValueSubParts((Pel)absValDeltaDC,uiAbsPartIdx, 0, uiDepth); 694 } 695 } 696 697 #endif 639 698 /** parse merge flag 640 699 * \param pcCU -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibDecoder/TDecSbac.h
r976 r983 129 129 130 130 Void parseSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 131 #if MTK_SINGLE_DEPTH_MODE_I0095 132 Void parseSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 133 #endif 131 134 Void parseCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 132 135 Void parseSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 179 182 ContextModel3DBuffer m_cCUSplitFlagSCModel; 180 183 ContextModel3DBuffer m_cCUSkipFlagSCModel; 184 #if MTK_SINGLE_DEPTH_MODE_I0095 185 ContextModel3DBuffer m_cCUSingleDepthFlagSCModel; 186 ContextModel3DBuffer m_cSingleDepthValueSCModel; 187 #endif 181 188 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 182 189 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCavlc.cpp
r976 r983 2022 2022 } 2023 2023 #endif 2024 2024 #if MTK_SINGLE_DEPTH_MODE_I0095 2025 if(pcSlice->getIsDepth()) 2026 { 2027 WRITE_FLAG( pcSlice->getApplySingleDepthMode() ? 1 : 0, "slice_enable_single_depth_mode" ); 2028 } 2029 #endif 2025 2030 #if H_3D_IV_MERGE 2026 2031 assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_MEM); … … 2408 2413 assert(0); 2409 2414 } 2410 2415 #if MTK_SINGLE_DEPTH_MODE_I0095 2416 Void TEncCavlc::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 2417 { 2418 assert(0); 2419 } 2420 #endif 2411 2421 Void TEncCavlc::codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 2412 2422 { -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCavlc.h
r884 r983 123 123 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 124 124 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 125 #if MTK_SINGLE_DEPTH_MODE_I0095 126 Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ); 127 #endif 125 128 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 126 129 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCfg.h
r976 r983 416 416 Bool m_useSDC; 417 417 Bool m_useDLT; 418 #endif 419 #if MTK_SINGLE_DEPTH_MODE_I0095 420 Bool m_useSingleDepthMode; 418 421 #endif 419 422 #if H_3D_IV_MERGE … … 1008 1011 Void setUseDLT ( Bool b) { m_useDLT = b; } 1009 1012 #endif 1013 #if MTK_SINGLE_DEPTH_MODE_I0095 1014 Void setUseSingleDepthMode ( Bool bVal ) { m_useSingleDepthMode = bVal; } 1015 Bool getUseSingleDepthMode () { return m_useSingleDepthMode; } 1016 #endif 1010 1017 #if H_3D_QTLPC 1011 1018 Void setUseQTL ( Bool b ) { m_bUseQTL = b; } -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.cpp
r976 r983 709 709 } 710 710 #endif 711 711 #if MTK_SINGLE_DEPTH_MODE_I0095 712 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 713 if(rpcBestCU->getSlice()->getApplySingleDepthMode()) 714 { 715 xCheckRDCostSingleDepth( rpcBestCU, rpcTempCU, SIZE_2Nx2N ); 716 rpcTempCU->initEstData( uiDepth, iMinQP, isAddLowestQP ); 717 } 718 #endif 712 719 if(!earlyDetectionSkipMode) 713 720 { … … 1536 1543 return; 1537 1544 } 1545 #if MTK_SINGLE_DEPTH_MODE_I0095 1546 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, uiAbsPartIdx ); 1547 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 1548 { 1549 #endif 1538 1550 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1539 1551 … … 1568 1580 m_pcEntropyCoder->encodeCoeff( pcCU, uiAbsPartIdx, uiDepth, pcCU->getWidth (uiAbsPartIdx), pcCU->getHeight(uiAbsPartIdx), bCodeDQP ); 1569 1581 setdQPFlag( bCodeDQP ); 1570 1582 #if MTK_SINGLE_DEPTH_MODE_I0095 1583 } 1584 #endif 1571 1585 // --- write terminating bit --- 1572 1586 finishCU(pcCU,uiAbsPartIdx,uiDepth); … … 1971 1985 1972 1986 rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth ); 1987 #if MTK_SINGLE_DEPTH_MODE_I0095 1988 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 1989 #endif 1973 1990 #if H_3D_VSP // possible bug fix 1974 1991 if( rpcTempCU->getSkipFlag(0) ) … … 1994 2011 } 1995 2012 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2013 #if MTK_SINGLE_DEPTH_MODE_I0095 2014 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2015 #endif 1996 2016 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 1997 2017 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); … … 2130 2150 2131 2151 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2132 2152 #if MTK_SINGLE_DEPTH_MODE_I0095 2153 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2154 #endif 2133 2155 rpcTempCU->setPartSizeSubParts ( ePartSize, 0, uhDepth ); 2134 2156 rpcTempCU->setPredModeSubParts ( MODE_INTER, 0, uhDepth ); … … 2226 2248 } 2227 2249 rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth ); 2250 #if MTK_SINGLE_DEPTH_MODE_I0095 2251 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uhDepth ); 2252 #endif 2228 2253 rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth ); 2229 2254 rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth ); … … 2320 2345 } 2321 2346 } 2322 2347 #if MTK_SINGLE_DEPTH_MODE_I0095 2348 Void TEncCu::xCheckRDCostSingleDepth( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize eSize ) 2349 { 2350 UInt uiDepth = rpcTempCU->getDepth( 0 ); 2351 if( !rpcBestCU->getSlice()->getIsDepth() || (eSize != SIZE_2Nx2N)) 2352 { 2353 return; 2354 } 2355 2356 #if H_3D_VSO // M5 2357 if( m_pcRdCost->getUseRenModel() ) 2358 { 2359 UInt uiWidth = m_ppcOrigYuv[uiDepth]->getWidth (); 2360 UInt uiHeight = m_ppcOrigYuv[uiDepth]->getHeight (); 2361 Pel* piSrc = m_ppcOrigYuv[uiDepth]->getLumaAddr(); 2362 UInt uiSrcStride = m_ppcOrigYuv[uiDepth]->getStride (); 2363 m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight ); 2364 } 2365 #endif 2366 2367 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2368 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth ); 2369 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); 2370 rpcTempCU->setCUTransquantBypassSubParts( rpcTempCU->getCUTransquantBypass(0), 0, uiDepth ); 2371 2372 rpcTempCU->setTrIdxSubParts(0, 0, uiDepth); 2373 rpcTempCU->setCbfSubParts(0, 1, 1, 0, uiDepth); 2374 rpcTempCU->setSingleDepthFlagSubParts(true, 0, uiDepth); 2375 rpcTempCU->setLumaIntraDirSubParts (DC_IDX, 0, uiDepth); 2376 #if H_3D_DIM_SDC 2377 rpcTempCU->setSDCFlagSubParts( false, 0, uiDepth); 2378 #endif 2379 2380 UInt uiPreCalcDistC; 2381 m_pcPredSearch ->estIntraPredSingleDepth ( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth], uiPreCalcDistC, false ); 2382 2383 2384 m_ppcRecoYuvTemp[uiDepth]->copyToPicLuma(rpcTempCU->getPic()->getPicYuvRec(), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU() ); 2385 2386 2387 m_pcEntropyCoder->resetBits(); 2388 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 2389 { 2390 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true ); 2391 } 2392 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2393 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2394 2395 2396 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2397 2398 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits(); 2399 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded(); 2400 2401 2402 #if H_3D_VSO // M6 2403 if( m_pcRdCost->getUseLambdaScaleVSO()) 2404 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCostVSO( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2405 else 2406 #endif 2407 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() ); 2408 2409 2410 xCheckDQP( rpcTempCU ); 2411 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth); 2412 } 2413 #endif 2323 2414 Void TEncCu::xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG ) 2324 2415 { … … 2463 2554 2464 2555 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2465 2556 #if MTK_SINGLE_DEPTH_MODE_I0095 2557 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2558 #endif 2466 2559 rpcTempCU->setPartSizeSubParts( eSize, 0, uiDepth ); 2467 2560 rpcTempCU->setPredModeSubParts( MODE_INTRA, 0, uiDepth ); … … 2488 2581 } 2489 2582 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2583 #if MTK_SINGLE_DEPTH_MODE_I0095 2584 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2585 if(!rpcTempCU->getSingleDepthFlag(0)) 2586 { 2587 #endif 2490 2588 m_pcEntropyCoder->encodePredMode( rpcTempCU, 0, true ); 2491 2589 m_pcEntropyCoder->encodePartSize( rpcTempCU, 0, uiDepth, true ); … … 2500 2598 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP ); 2501 2599 setdQPFlag( bCodeDQP ); 2502 2600 #if MTK_SINGLE_DEPTH_MODE_I0095 2601 } 2602 #endif 2503 2603 m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]); 2504 2604 … … 2528 2628 2529 2629 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth ); 2530 2630 #if MTK_SINGLE_DEPTH_MODE_I0095 2631 rpcTempCU->setSingleDepthFlagSubParts( false, 0, uiDepth ); 2632 #endif 2531 2633 rpcTempCU->setIPCMFlag(0, true); 2532 2634 rpcTempCU->setIPCMFlagSubParts (true, 0, rpcTempCU->getDepth(0)); … … 2545 2647 } 2546 2648 m_pcEntropyCoder->encodeSkipFlag ( rpcTempCU, 0, true ); 2649 #if MTK_SINGLE_DEPTH_MODE_I0095 2650 m_pcEntropyCoder->encodeSingleDepthMode( rpcTempCU, 0, true ); 2651 #endif 2547 2652 m_pcEntropyCoder->encodePredMode ( rpcTempCU, 0, true ); 2548 2653 m_pcEntropyCoder->encodePartSize ( rpcTempCU, 0, uiDepth, true ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncCu.h
r872 r983 159 159 Void xCheckRDCostInterDBBP( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, Bool bUseMRG = false ); 160 160 #endif 161 #if MTK_SINGLE_DEPTH_MODE_I0095 162 Void xCheckRDCostSingleDepth ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 163 #endif 161 164 Void xCheckRDCostIntra ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 162 165 Void xCheckDQP ( TComDataCU* pcCU ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.cpp
r976 r983 119 119 m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx ); 120 120 } 121 121 #if MTK_SINGLE_DEPTH_MODE_I0095 122 Void TEncEntropy::encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 123 { 124 if ( !pcCU->getSlice()->getIsDepth() ) 125 { 126 return; 127 } 128 if(!pcCU->getSlice()->getApplySingleDepthMode()) 129 { 130 return; 131 } 132 133 if( bRD ) 134 { 135 uiAbsPartIdx = 0; 136 } 137 m_pcEntropyCoderIf->codeSingleDepthMode( pcCU, uiAbsPartIdx ); 138 } 139 #endif 122 140 /** encode merge flag 123 141 * \param pcCU -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncEntropy.h
r884 r983 86 86 virtual Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 87 87 virtual Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 88 #if MTK_SINGLE_DEPTH_MODE_I0095 89 virtual Void codeSingleDepthMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 90 #endif 88 91 virtual Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 89 92 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 171 174 Void encodeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 172 175 Void encodeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 176 #if MTK_SINGLE_DEPTH_MODE_I0095 177 Void encodeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD=false ); 178 #endif 173 179 Void encodePUWise ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 174 180 Void encodeInterDirPU ( TComDataCU* pcSubCU, UInt uiAbsPartIdx ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncGOP.cpp
r976 r983 934 934 pcSlice->setRefPicList ( rcListPic ); 935 935 #endif 936 936 #if MTK_SINGLE_DEPTH_MODE_I0095 937 TEncTop* pcEncTop = (TEncTop*) m_pcCfg; 938 bool enableSingleDepthMode=false; 939 if(pcEncTop->getUseSingleDepthMode()) 940 { 941 if(pcSlice->getIsDepth()) 942 { 943 enableSingleDepthMode=true; 944 } 945 } 946 pcSlice->setApplySingleDepthMode(enableSingleDepthMode); 947 #endif 937 948 #if H_3D_ARP 938 949 //GT: This seems to be broken when layerId in vps is not equal to layerId in nuh -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSbac.cpp
r976 r983 58 58 , m_cCUSplitFlagSCModel ( 1, 1, NUM_SPLIT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels ) 59 59 , m_cCUSkipFlagSCModel ( 1, 1, NUM_SKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 60 #if MTK_SINGLE_DEPTH_MODE_I0095 61 , m_cCUSingleDepthFlagSCModel ( 1, 1, NUM_SINGLEDEPTH_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 62 , m_cSingleDepthValueSCModel ( 1, 1, NUM_SINGLE_DEPTH_VALUE_DATA_CTX , m_contextModels + m_numContextModels, m_numContextModels) 63 #endif 60 64 , m_cCUMergeFlagExtSCModel ( 1, 1, NUM_MERGE_FLAG_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) 61 65 , m_cCUMergeIdxExtSCModel ( 1, 1, NUM_MERGE_IDX_EXT_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 130 134 131 135 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 136 #if MTK_SINGLE_DEPTH_MODE_I0095 137 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 138 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 139 #endif 132 140 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 133 141 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); … … 206 214 curCost = m_cCUSplitFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 207 215 curCost += m_cCUSkipFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG ); 216 #if MTK_SINGLE_DEPTH_MODE_I0095 217 curCost += m_cCUSingleDepthFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 218 curCost += m_cSingleDepthValueSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 219 #endif 208 220 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); 209 221 curCost += m_cCUMergeIdxExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT); … … 275 287 276 288 m_cCUSkipFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SKIP_FLAG ); 289 #if MTK_SINGLE_DEPTH_MODE_I0095 290 m_cCUSingleDepthFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLEDEPTH_FLAG ); 291 m_cSingleDepthValueSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SINGLE_DEPTH_VALUE_DATA ); 292 #endif 277 293 m_cCUMergeFlagExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_FLAG_EXT); 278 294 m_cCUMergeIdxExtSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_MERGE_IDX_EXT); … … 434 450 m_pcBinIf->encodeBinsEP( bins, numBins ); 435 451 } 436 452 #if MTK_SINGLE_DEPTH_MODE_I0095 453 Void TEncSbac::codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ) 454 { 455 UInt uiSymbol = pcCU->getSingleDepthFlag(uiAbsPartIdx ) ? 1 : 0; 456 m_pcBinIf->encodeBin( uiSymbol, m_cCUSingleDepthFlagSCModel.get( 0, 0, 0 ) ); 457 if(uiSymbol) 458 { 459 UInt uiUnaryIdx = (UInt) pcCU->getSingleDepthValue(uiAbsPartIdx); 460 UInt uiNumCand = MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE; 461 if ( uiNumCand > 1 ) 462 { 463 for( UInt ui = 0; ui < uiNumCand - 1; ++ui ) 464 { 465 const UInt uiSymbol2 = ui == uiUnaryIdx ? 0 : 1; 466 if ( ui==0 ) 467 { 468 m_pcBinIf->encodeBin( uiSymbol2, m_cSingleDepthValueSCModel.get( 0, 0, 0 ) ); 469 } 470 else 471 { 472 m_pcBinIf->encodeBinEP( uiSymbol2 ); 473 } 474 if( uiSymbol2 == 0 ) 475 { 476 break; 477 } 478 } 479 } 480 } 481 } 482 #endif 437 483 /** Coding of coeff_abs_level_minus3 438 484 * \param uiSymbol value of coeff_abs_level_minus3 -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSbac.h
r976 r983 153 153 Void codeCUTransquantBypassFlag( TComDataCU* pcCU, UInt uiAbsPartIdx ); 154 154 Void codeSkipFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 155 #if MTK_SINGLE_DEPTH_MODE_I0095 156 Void codeSingleDepthMode( TComDataCU* pcCU, UInt uiAbsPartIdx ); 157 #endif 155 158 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 156 159 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 219 222 ContextModel3DBuffer m_cCUSplitFlagSCModel; 220 223 ContextModel3DBuffer m_cCUSkipFlagSCModel; 224 #if MTK_SINGLE_DEPTH_MODE_I0095 225 ContextModel3DBuffer m_cCUSingleDepthFlagSCModel; 226 ContextModel3DBuffer m_cSingleDepthValueSCModel; 227 #endif 221 228 ContextModel3DBuffer m_cCUMergeFlagExtSCModel; 222 229 ContextModel3DBuffer m_cCUMergeIdxExtSCModel; -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSearch.cpp
r976 r983 915 915 } 916 916 m_pcEntropyCoder->encodeSkipFlag( pcCU, 0, true ); 917 #if MTK_SINGLE_DEPTH_MODE_I0095 918 m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true ); 919 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 920 #endif 917 921 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 918 922 } 919 923 #if MTK_SINGLE_DEPTH_MODE_I0095 924 else 925 { 926 m_pcEntropyCoder->encodeSingleDepthMode(pcCU, 0, true ); 927 } 928 #endif 929 #if MTK_SINGLE_DEPTH_MODE_I0095 930 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 931 { 932 #endif 920 933 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 921 934 … … 932 945 } 933 946 } 934 } 947 #if MTK_SINGLE_DEPTH_MODE_I0095 948 } 949 #endif 950 } 951 #if MTK_SINGLE_DEPTH_MODE_I0095 952 if(!pcCU->getSingleDepthFlag(uiAbsPartIdx)) 953 { 954 #endif 935 955 // luma prediction mode 936 956 if( pcCU->getPartitionSize(0) == SIZE_2Nx2N ) … … 975 995 } 976 996 } 977 997 #if MTK_SINGLE_DEPTH_MODE_I0095 998 } 999 #endif 978 1000 } 979 1001 if( bChroma ) … … 1837 1859 dRDCost += dSingleCost; 1838 1860 } 1839 1861 #if MTK_SINGLE_DEPTH_MODE_I0095 1862 Void TEncSearch::xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel *DepthNeighbor ) 1863 { 1864 UInt uiWidth = pcCU ->getWidth ( 0 ); 1865 UInt uiHeight = pcCU ->getHeight ( 0 ); 1866 UInt uiStride = pcOrgYuv ->getStride (); 1867 Pel* piOrg = pcOrgYuv ->getLumaAddr( uiAbsPartIdx ); 1868 Pel* piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1869 1870 AOF( uiWidth == uiHeight ); 1871 AOF( uiAbsPartIdx == 0 ); 1872 pcCU->setSingleDepthValueSubParts((Pel)iTestDepthIdx,uiAbsPartIdx, 0, pcCU->getDepth(0)); 1873 //===== reconstruction ===== 1874 1875 for( UInt uiY = 0; uiY < uiHeight; uiY++ ) 1876 { 1877 for( UInt uiX = 0; uiX < uiWidth; uiX++ ) 1878 { 1879 piPred[ uiX ] = DepthNeighbor[iTestDepthIdx]; 1880 } 1881 piPred += uiStride; 1882 } 1883 1884 // clear UV 1885 UInt uiStrideC = pcPredYuv->getCStride(); 1886 Pel *pRecCb = pcPredYuv->getCbAddr(); 1887 Pel *pRecCr = pcPredYuv->getCrAddr(); 1888 1889 for (Int y=0; y<uiHeight/2; y++) 1890 { 1891 for (Int x=0; x<uiWidth/2; x++) 1892 { 1893 pRecCb[x] = 1<<(g_bitDepthC-1); 1894 pRecCr[x] = 1<<(g_bitDepthC-1); 1895 } 1896 1897 pRecCb += uiStrideC; 1898 pRecCr += uiStrideC; 1899 } 1900 1901 piPred = pcPredYuv->getLumaAddr( uiAbsPartIdx ); 1902 //===== determine distortion ===== 1903 #if H_3D_VSO 1904 if ( m_pcRdCost->getUseVSO() ) 1905 ruiDist = m_pcRdCost->getDistPartVSO ( pcCU, uiAbsPartIdx, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight, false ); 1906 else 1907 #endif 1908 ruiDist = m_pcRdCost->getDistPart(g_bitDepthY, piPred, uiStride, piOrg, uiStride, uiWidth, uiHeight ); 1909 1910 //===== determine rate and r-d cost ===== 1911 m_pcEntropyCoder->resetBits(); 1912 m_pcEntropyCoder->encodeSingleDepthMode( pcCU, 0, true ); 1913 UInt uiBits = m_pcEntropyCoder->getNumberOfWrittenBits(); 1914 1915 #if H_3D_VSO 1916 if ( m_pcRdCost->getUseLambdaScaleVSO()) 1917 dRDCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist ); 1918 else 1919 #endif 1920 dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist ); 1921 } 1922 #endif 1840 1923 #if H_3D_DIM_SDC 1841 1924 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi ) … … 2777 2860 pcCU->setChromIntraDirSubParts( uiBestMode, 0, pcCU->getDepth( 0 ) ); 2778 2861 } 2779 2862 #if MTK_SINGLE_DEPTH_MODE_I0095 2863 Void 2864 TEncSearch::estIntraPredSingleDepth( TComDataCU* pcCU, 2865 TComYuv* pcOrgYuv, 2866 TComYuv* pcPredYuv, 2867 TComYuv* pcResiYuv, 2868 TComYuv* pcRecoYuv, 2869 UInt& ruiDistC, 2870 Bool bLumaOnly ) 2871 { 2872 UInt uiDepth = pcCU->getDepth(0); 2873 UInt uiWidth = pcCU->getWidth (0); 2874 UInt uiHeight = pcCU->getHeight(0); 2875 2876 2877 Pel* piOrg = pcOrgYuv ->getLumaAddr( 0, uiWidth ); 2878 UInt uiStride = pcPredYuv->getStride(); 2879 2880 Int index=0; 2881 Pel testDepth; 2882 Pel DepthNeighbours[5]; 2883 //construction of depth candidates 2884 for( Int i = 0; (i < 5) && (index<MTK_SINGLE_DEPTH_MODE_CANDIDATE_LIST_SIZE) ; i++ ) 2885 { 2886 if(!pcCU->getNeighDepth (0, 0, &testDepth, i)) 2887 { 2888 continue; 2889 } 2890 DepthNeighbours[index]=testDepth; 2891 index++; 2892 for(Int j=0;j<index-1;j++) 2893 { 2894 if( (DepthNeighbours[index-1]==DepthNeighbours[j])) 2895 { 2896 index--; 2897 break; 2898 } 2899 } 2900 } 2901 2902 if(index==0) 2903 { 2904 DepthNeighbours[index]=1<<(g_bitDepthY-1); 2905 index++; 2906 } 2907 2908 if(index==1) 2909 { 2910 DepthNeighbours[index]=ClipY(DepthNeighbours[0] + 1 ); 2911 index++; 2912 } 2913 2914 2915 Dist uiDist = 0; 2916 Double dCost = 0.0; 2917 Dist uiBestDist = 0; 2918 Double dBestCost = MAX_DOUBLE; 2919 Pel pBestSingleDepthValue = 0; 2920 2921 for( Int testdepthidx = 0; testdepthidx < index ; testdepthidx++ ) 2922 { 2923 // set context models 2924 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] ); 2925 2926 // determine residual for partition 2927 uiDist = 0; 2928 dCost = 0.0; 2929 #if H_3D_VSO // M36 2930 if( m_pcRdCost->getUseRenModel() ) 2931 { 2932 m_pcRdCost->setRenModelData( pcCU, 0, piOrg, uiStride, uiWidth, uiHeight ); 2933 } 2934 #endif 2935 xIntraCodingSingleDepth(pcCU, 0, pcOrgYuv, pcPredYuv, uiDist, dCost, testdepthidx, DepthNeighbours); 2936 // check r-d cost 2937 if( dCost < dBestCost ) 2938 { 2939 uiBestDist = uiDist; 2940 dBestCost = dCost; 2941 pBestSingleDepthValue = pcCU->getSingleDepthValue(0); 2942 // copy reconstruction 2943 pcPredYuv->copyPartToPartYuv(pcRecoYuv, 0, uiWidth, uiHeight); 2944 } 2945 } // depth index loop 2946 2947 2948 pcCU->setSingleDepthValueSubParts((Pel)pBestSingleDepthValue,0, 0, uiDepth); 2949 assert(pBestSingleDepthValue>=0); 2950 2951 //===== reset context models ===== 2952 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]); 2953 2954 //===== set distortion (rate and r-d costs are determined later) ===== 2955 pcCU->getTotalDistortion() = uiBestDist; 2956 } 2957 2958 #endif 2780 2959 Void 2781 2960 TEncSearch::estIntraPredQT( TComDataCU* pcCU, … … 6981 7160 } 6982 7161 m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true ); 7162 #if MTK_SINGLE_DEPTH_MODE_I0095 7163 m_pcEntropyCoder->encodeSingleDepthMode ( pcCU, 0, true ); 7164 #endif 6983 7165 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 6984 7166 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); -
branches/HTM-11.2-dev3-MediaTek/source/Lib/TLibEncoder/TEncSearch.h
r884 r983 187 187 TComYuv* pcRecoYuv, 188 188 UInt uiPreCalcDistC ); 189 189 #if MTK_SINGLE_DEPTH_MODE_I0095 190 Void estIntraPredSingleDepth ( TComDataCU* pcCU, 191 TComYuv* pcOrgYuv, 192 TComYuv* pcPredYuv, 193 TComYuv* pcResiYuv, 194 TComYuv* pcRecoYuv, 195 UInt& ruiDistC, 196 Bool bLumaOnly ); 197 #endif 190 198 191 199 /// encoder estimation - inter prediction (non-skip) … … 342 350 UInt uiAbsPartIdx, 343 351 UInt stateU0V1Both2 ); 344 352 #if MTK_SINGLE_DEPTH_MODE_I0095 353 Void xIntraCodingSingleDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Int iTestDepthIdx, Pel * DepthNeighbor ); 354 #endif 345 355 #if H_3D_DIM 346 356 // -------------------------------------------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.