Changeset 753 in 3DVCSoftware for branches/HTM-9.1-dev0-RWTH/source/Lib/TLibEncoder/TEncCavlc.cpp
- Timestamp:
- 22 Dec 2013, 20:21:39 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.