Changeset 753 in 3DVCSoftware for branches/HTM-9.1-dev0-RWTH/source/Lib
- Timestamp:
- 22 Dec 2013, 20:21:39 (11 years ago)
- Location:
- branches/HTM-9.1-dev0-RWTH/source/Lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.cpp
r751 r753 2581 2581 } 2582 2582 2583 #if RWTH_DELTA_DLT2584 Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTOut, Int *piDeltaDLTOutNum )2583 #if H_3D_DELTA_DLT 2584 Void TComDLT::getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum ) 2585 2585 { 2586 2586 Bool abBM0[ 256 ]; … … 2591 2591 2592 2592 // convert reference DLT to bit string 2593 for( Int i = 0; i < iDLTInRefNum; i++ )2593 for( Int i = 0; i < uiDLTInRefNum; i++ ) 2594 2594 { 2595 2595 abBM0[ piDLTInRef[ i ] ] = true; … … 2601 2601 } 2602 2602 2603 *p iDeltaDLTOutNum = 0;2603 *puiDeltaDLTOutNum = 0; 2604 2604 for( Int i = 0; i < 256; i++ ) 2605 2605 { 2606 2606 if( abBM0[ i ] ^ abBM1[ i ] ) 2607 2607 { 2608 piDeltaDLTOut[ *p iDeltaDLTOutNum ] = i;2609 *p iDeltaDLTOutNum = *piDeltaDLTOutNum + 1;2610 } 2611 } 2612 } 2613 2614 Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTIn, Int piDeltaDLTInNum )2608 piDeltaDLTOut[ *puiDeltaDLTOutNum ] = i; 2609 *puiDeltaDLTOutNum = *puiDeltaDLTOutNum + 1; 2610 } 2611 } 2612 } 2613 2614 Void TComDLT::setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum ) 2615 2615 { 2616 2616 Bool abBM0[ 256 ]; … … 2621 2621 2622 2622 // convert reference DLT to bit string 2623 for( Int i = 0; i < iDLTInRefNum; i++ )2623 for( Int i = 0; i < uiDLTInRefNum; i++ ) 2624 2624 { 2625 2625 abBM0[ piDLTInRef[ i ] ] = true; 2626 2626 } 2627 2627 // convert delta DLT to bit string 2628 for( Int i = 0; i < piDeltaDLTInNum; i++ )2628 for( Int i = 0; i < uiDeltaDLTInNum; i++ ) 2629 2629 { 2630 2630 abBM1[ piDeltaDLTIn[ i ] ] = true; -
branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TComSlice.h
r751 r753 1204 1204 Int m_iNumDepthViews; 1205 1205 UInt m_uiDepthViewBitDepth; 1206 1207 #if RWTH_DELTA_DLT1208 Bool m_bUseDeltaDLTFlag [ MAX_NUM_LAYERS ];1209 #endif1210 1206 1211 1207 public: … … 1218 1214 Bool getUseDLTFlag ( Int layerIdInVps ) { return m_bUseDLTFlag[ layerIdInVps ]; } 1219 1215 Void setUseDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDLTFlag[ layerIdInVps ] = b; } 1220 1221 #if RWTH_DELTA_DLT1222 Bool getUseDeltaDLTFlag ( Int layerIdInVps ) { return m_bUseDeltaDLTFlag[ layerIdInVps ]; }1223 Void setUseDeltaDLTFlag ( Int layerIdInVps, Bool b ) { m_bUseDeltaDLTFlag[ layerIdInVps ] = b; }1224 #endif1225 1216 1226 1217 Bool getInterViewDltPredEnableFlag( Int layerIdInVps ) { return m_bInterViewDltPredEnableFlag[ layerIdInVps ]; } 1227 1218 Void setInterViewDltPredEnableFlag( Int layerIdInVps, Bool b ) { m_bInterViewDltPredEnableFlag[ layerIdInVps ] = b; } 1228 1229 1219 1230 1220 Void setNumDepthViews ( Int n ) { m_iNumDepthViews = n; } … … 1239 1229 Pel idx2DepthValue( Int layerIdInVps, UInt uiIdx ) { return getUseDLTFlag(layerIdInVps)?m_iIdx2DepthValue[layerIdInVps][uiIdx]:uiIdx; } 1240 1230 Void setDepthLUTs( Int layerIdInVps, Int* idx2DepthValue = NULL, Int iNumDepthValues = 0 ); 1241 #if RWTH_DELTA_DLT 1242 Void getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTOut, Int *piDeltaDLTOutNum ); 1243 Void setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, Int iDLTInRefNum, Int* piDeltaDLTIn, Int piDeltaDLTInNum ); 1231 #if H_3D_DELTA_DLT 1232 Int* idx2DepthValue( Int layerIdInVps ) { return m_iIdx2DepthValue[layerIdInVps]; } 1233 Void getDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTOut, UInt *puiDeltaDLTOutNum ); 1234 Void setDeltaDLT( Int layerIdInVps, Int* piDLTInRef, UInt uiDLTInRefNum, Int* piDeltaDLTIn, UInt uiDeltaDLTInNum ); 1244 1235 #endif 1245 1236 }; -
branches/HTM-9.1-dev0-RWTH/source/Lib/TLibCommon/TypeDef.h
r751 r753 222 222 #define Log2( n ) ( log((double)n) / log(2.0) ) 223 223 #endif 224 #define RWTH_DELTA_DLT 1224 #define H_3D_DELTA_DLT 1 225 225 #endif 226 226 -
branches/HTM-9.1-dev0-RWTH/source/Lib/TLibDecoder/TDecCAVLC.cpp
r749 r753 412 412 if ( pcDLT->getUseDLTFlag( i ) ) 413 413 { 414 UInt uiNumDepthValues = 0;415 414 Bool bDltBitMapRepFlag = false; 416 415 UInt uiMaxDiff = 0xffffffff; … … 430 429 bDltBitMapRepFlag = false; 431 430 } 431 432 UInt uiNumDepthValues = 0; 433 Int aiIdx2DepthValue[256]; 432 434 433 435 // Bit map 434 436 if ( bDltBitMapRepFlag ) 435 437 { 436 UInt uiNumDepthValues = 0;437 Int aiIdx2DepthValue[256];438 439 438 for (UInt d=0; d<256; d++) 440 439 { … … 446 445 } 447 446 } 448 449 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues);450 447 } 451 448 // Diff Coding … … 454 451 READ_CODE(8, uiNumDepthValues, "num_depth_values_in_dlt[i]"); // num_entry 455 452 453 #if !H_3D_DELTA_DLT 456 454 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) // Single-view DLT Diff Coding 455 #endif 457 456 { 458 457 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 459 460 Int* aiIdx2DepthValue = (Int*) calloc(uiNumDepthValues, sizeof(Int));461 458 462 459 if (uiNumDepthValues > 1) … … 501 498 } 502 499 503 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues); 504 505 free(aiIdx2DepthValue); 506 } 500 } 507 501 } 502 503 #if H_3D_DELTA_DLT 504 if( pcDLT->getInterViewDltPredEnableFlag( i ) ) 505 { 506 // interpret decoded values as delta DLT 507 AOF( pcVPS->getDepthId( 1 ) == 1 ); 508 AOF( i > 1 ); 509 // assumes ref layer id to be 1 510 Int* piRefDLT = pcDLT->idx2DepthValue( 1 ); 511 UInt uiRefNum = pcDLT->getNumDepthValues( 1 ); 512 pcDLT->setDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue, uiNumDepthValues); 513 } 514 else 515 { 516 // store final DLT 517 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues); 518 } 519 #else 520 // store final DLT 521 pcDLT->setDepthLUTs(i, aiIdx2DepthValue, uiNumDepthValues); 522 #endif 508 523 } 509 524 } -
branches/HTM-9.1-dev0-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp
r748 r753 299 299 WRITE_FLAG( pcDLT->getInterViewDltPredEnableFlag( i ) ? 1 : 0, "inter_view_dlt_pred_enable_flag[ i ]"); 300 300 301 // determine whether to use bit-map301 // ----------------------------- determine whether to use bit-map ----------------------------- 302 302 Bool bDltBitMapRepFlag = false; 303 303 UInt uiNumBitsNonBitMap = 0; … … 310 310 311 311 UInt* puiDltDiffValues = NULL; 312 313 if ( NULL == (puiDltDiffValues = (UInt *)calloc(pcDLT->getNumDepthValues(i), sizeof(UInt))) ) 312 313 Int aiIdx2DepthValue_coded[256]; 314 UInt uiNumDepthValues_coded = 0; 315 316 uiNumDepthValues_coded = pcDLT->getNumDepthValues(i); 317 for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++ ) 318 { 319 aiIdx2DepthValue_coded[ui] = pcDLT->idx2DepthValue(i, ui); 320 } 321 322 #if H_3D_DELTA_DLT 323 if( pcDLT->getInterViewDltPredEnableFlag( i ) ) 324 { 325 AOF( pcVPS->getDepthId( 1 ) == 1 ); 326 AOF( i > 1 ); 327 // assumes ref layer id to be 1 328 Int* piRefDLT = pcDLT->idx2DepthValue( 1 ); 329 UInt uiRefNum = pcDLT->getNumDepthValues( 1 ); 330 pcDLT->getDeltaDLT(i, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, &uiNumDepthValues_coded); 331 } 332 #endif 333 334 if ( NULL == (puiDltDiffValues = (UInt *)calloc(uiNumDepthValues_coded, sizeof(UInt))) ) 314 335 { 315 336 exit(-1); 316 337 } 317 338 318 for (UInt d = 1; d < pcDLT->getNumDepthValues(i); d++)339 for (UInt d = 1; d < uiNumDepthValues_coded; d++) 319 340 { 320 puiDltDiffValues[d] = pcDLT->idx2DepthValue(i, d) - pcDLT->idx2DepthValue(i, (d-1));341 puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1]; 321 342 322 343 if ( uiMaxDiff < puiDltDiffValues[d] ) … … 335 356 uiNumBitsNonBitMap += 8; // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ]) 336 357 337 if ( pcDLT->getNumDepthValues(i)> 1 )358 if ( uiNumDepthValues_coded > 1 ) 338 359 { 339 360 uiNumBitsNonBitMap += 8; // u(v) bits for max_diff[ layerId ] 340 361 } 341 362 342 if ( pcDLT->getNumDepthValues(i)> 2 )363 if ( uiNumDepthValues_coded > 2 ) 343 364 { 344 365 uiLengthMinDiff = (UInt) ceil(Log2(uiMaxDiff + 1)); … … 351 372 { 352 373 uiLengthDltDiffMinusMin = (UInt) ceil(Log2(uiMaxDiff - uiMinDiff + 1)); 353 uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * ( pcDLT->getNumDepthValues(i)- 1); // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]374 uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (uiNumDepthValues_coded - 1); // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ] 354 375 } 355 376 … … 360 381 bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true; 361 382 362 // Actual coding383 // ----------------------------- Actual coding ----------------------------- 363 384 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) 364 385 { … … 376 397 for (UInt d=0; d < 256; d++) 377 398 { 378 if ( d == pcDLT->idx2DepthValue(i, uiDltArrayIndex))399 if ( d == aiIdx2DepthValue_coded[uiDltArrayIndex] ) 379 400 { 380 401 WRITE_FLAG(1, "dlt_bit_map_flag[ layerId ][ j ]"); … … 390 411 else 391 412 { 392 WRITE_CODE(pcDLT->getNumDepthValues(i), 8, "num_depth_values_in_dlt[layerId]"); // num_entry 393 413 WRITE_CODE(uiNumDepthValues_coded, 8, "num_depth_values_in_dlt[layerId]"); // num_entry 414 415 #if !H_3D_DELTA_DLT 394 416 if ( pcDLT->getInterViewDltPredEnableFlag( i ) == false ) // Single-view DLT Diff Coding 417 #endif 395 418 { 396 // The condition if( pcVPS->getNumDepthValues(i) > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component.397 if ( pcDLT->getNumDepthValues(i)> 1 )419 // The condition if( uiNumDepthValues_coded > 0 ) is always true since for Single-view Diff Coding, there is at least one depth value in depth component. 420 if ( uiNumDepthValues_coded > 1 ) 398 421 { 399 422 WRITE_CODE(uiMaxDiff, 8, "max_diff[ layerId ]"); // max_diff 400 423 } 401 424 402 if ( pcDLT->getNumDepthValues(i)> 2 )425 if ( uiNumDepthValues_coded > 2 ) 403 426 { 404 427 WRITE_CODE((uiMinDiff - 1), uiLengthMinDiff, "min_diff_minus1[ layerId ]"); // min_diff_minus1 405 428 } 406 429 407 WRITE_CODE( pcDLT->idx2DepthValue(i, 0), 8, "dlt_depth_value0[layerId]"); // entry0430 WRITE_CODE(aiIdx2DepthValue_coded[0], 8, "dlt_depth_value0[layerId]"); // entry0 408 431 409 432 if (uiMaxDiff > uiMinDiff) 410 433 { 411 for (UInt d=1; d < pcDLT->getNumDepthValues(i); d++)434 for (UInt d=1; d < uiNumDepthValues_coded; d++) 412 435 { 413 436 WRITE_CODE( (puiDltDiffValues[d] - uiMinDiff), uiLengthDltDiffMinusMin, "dlt_depth_value_diff_minus_min[ layerId ][ j ]"); // entry_value_diff_minus_min[ k ]
Note: See TracChangeset for help on using the changeset viewer.