Changeset 694 in SHVCSoftware for branches/SHM-6-dev/source/Lib/TLibDecoder
- Timestamp:
- 18 Apr 2014, 19:14:51 (11 years ago)
- Location:
- branches/SHM-6-dev/source/Lib/TLibDecoder
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.cpp
r652 r694 93 93 fprintf( g_hTrace, "===========Tone Mapping Info SEI message ===========\n"); 94 94 break; 95 #if Q0074_SEI_COLOR_MAPPING 96 case SEI::COLOR_MAPPING_INFO: 97 fprintf( g_hTrace, "===========Color Mapping Info SEI message ===========\n"); 98 break; 99 #endif 95 100 case SEI::SOP_DESCRIPTION: 96 101 fprintf( g_hTrace, "=========== SOP Description SEI message ===========\n"); … … 280 285 xParseSEIToneMappingInfo((SEIToneMappingInfo&) *sei, payloadSize); 281 286 break; 287 #if Q0074_SEI_COLOR_MAPPING 288 case SEI::COLOR_MAPPING_INFO: 289 sei = new SEIColorMappingInfo; 290 xParseSEIColorMappingInfo((SEIColorMappingInfo&) *sei, payloadSize); 291 break; 292 #endif 282 293 case SEI::SOP_DESCRIPTION: 283 294 sei = new SEISOPDescription; … … 838 849 } 839 850 851 #if Q0074_SEI_COLOR_MAPPING 852 Void SEIReader::xParseSEIColorMappingInfo(SEIColorMappingInfo& sei, UInt /*payloadSize*/) 853 { 854 UInt uiVal; 855 Int iVal; 856 857 READ_UVLC( uiVal, "colour_map_id" ); sei.m_colorMapId = uiVal; 858 READ_FLAG( uiVal, "colour_map_cancel_flag" ); sei.m_colorMapCancelFlag = uiVal; 859 if( !sei.m_colorMapCancelFlag ) 860 { 861 READ_FLAG( uiVal, "colour_map_persistence_flag" ); sei.m_colorMapPersistenceFlag = uiVal; 862 READ_FLAG( uiVal, "colour_map_video_signal_type_present_flag" ); sei.m_colorMap_video_signal_type_present_flag = uiVal; 863 if ( sei.m_colorMap_video_signal_type_present_flag ) { 864 READ_FLAG( uiVal, "colour_map_video_full_range_flag" ); sei.m_colorMap_video_full_range_flag = uiVal; 865 READ_CODE( 8, uiVal, "colour_map_primaries" ); sei.m_colorMap_primaries = uiVal; 866 READ_CODE( 8, uiVal, "colour_map_transfer_characteristics" ); sei.m_colorMap_transfer_characteristics = uiVal; 867 READ_CODE( 8, uiVal, "colour_map_matrix_coeffs" ); sei.m_colorMap_matrix_coeffs = uiVal; 868 } 869 } 870 871 READ_CODE( 5, uiVal, "colour_map_coded_data_bit_depth" ); sei.m_colour_map_coded_data_bit_depth = uiVal; 872 READ_CODE( 5, uiVal, "colour_map_target_bit_depth" ); sei.m_colour_map_target_bit_depth = uiVal; 873 READ_UVLC( uiVal, "colour_map_model_id" ); sei.m_colorMapModelId = uiVal; 874 875 assert( sei.m_colorMapModelId == 0 ); 876 877 for( Int i=0 ; i<3 ; i++ ) 878 { 879 READ_CODE( 8, uiVal, "num_input_pivots_minus1[i]" ); sei.m_num_input_pivots[i] = (uiVal==0) ? 2 : (uiVal + 1) ; 880 sei.m_coded_input_pivot_value[i] = new Int[ sei.m_num_input_pivots[i] ]; 881 sei.m_target_input_pivot_value[i] = new Int[ sei.m_num_input_pivots[i] ]; 882 if( uiVal > 0 ) 883 { 884 for ( Int j=0 ; j<sei.m_num_input_pivots[i] ; j++ ) 885 { 886 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "coded_input_pivot_value[i][j]" ); sei.m_coded_input_pivot_value[i][j] = uiVal; 887 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "target_input_pivot_value[i][j]" ); sei.m_target_input_pivot_value[i][j] = uiVal; 888 } 889 } 890 else 891 { 892 sei.m_coded_input_pivot_value[i][0] = 0; 893 sei.m_target_input_pivot_value[i][0] = 0; 894 sei.m_coded_input_pivot_value[i][1] = (1 << sei.m_colour_map_coded_data_bit_depth) - 1 ; 895 sei.m_target_input_pivot_value[i][1] = (1 << sei.m_colour_map_target_bit_depth) - 1 ; 896 } 897 } 898 899 READ_FLAG( uiVal, "matrix_flag" ); sei.m_matrix_flag = uiVal; 900 if( sei.m_matrix_flag ) 901 { 902 READ_CODE( 4, uiVal, "log2_matrix_denom" ); sei.m_log2_matrix_denom = uiVal; 903 for ( Int i=0 ; i<3 ; i++ ) 904 { 905 for ( Int j=0 ; j<3 ; j++ ) 906 { 907 READ_SVLC( iVal, "matrix_coef[i][j]" ); sei.m_matrix_coef[i][j] = iVal; 908 } 909 } 910 } 911 912 for ( Int i=0 ; i<3 ; i++ ) 913 { 914 READ_CODE( 8, uiVal, "num_output_pivots_minus1[i]" ); sei.m_num_output_pivots[i] = (uiVal==0) ? 2 : (uiVal + 1) ; 915 sei.m_coded_output_pivot_value[i] = new Int[ sei.m_num_output_pivots[i] ]; 916 sei.m_target_output_pivot_value[i] = new Int[ sei.m_num_output_pivots[i] ]; 917 if( uiVal > 0 ) 918 { 919 for ( Int j=0 ; j<sei.m_num_output_pivots[i] ; j++ ) 920 { 921 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "coded_output_pivot_value[i][j]" ); sei.m_coded_output_pivot_value[i][j] = uiVal; 922 READ_CODE( (( sei.m_colour_map_coded_data_bit_depth + 7 ) >> 3 ) << 3, uiVal, "target_output_pivot_value[i][j]" ); sei.m_target_output_pivot_value[i][j] = uiVal; 923 } 924 } 925 else 926 { 927 sei.m_coded_output_pivot_value[i][0] = 0; 928 sei.m_target_output_pivot_value[i][0] = 0; 929 sei.m_coded_output_pivot_value[i][1] = (1 << sei.m_colour_map_coded_data_bit_depth) - 1 ; 930 sei.m_target_output_pivot_value[i][1] = (1 << sei.m_colour_map_target_bit_depth) - 1 ; 931 } 932 } 933 934 xParseByteAlign(); 935 } 936 #endif 937 840 938 Void SEIReader::xParseSEISOPDescription(SEISOPDescription &sei, UInt payloadSize) 841 939 { -
branches/SHM-6-dev/source/Lib/TLibDecoder/SEIread.h
r644 r694 90 90 Void xParseSEIGradualDecodingRefreshInfo (SEIGradualDecodingRefreshInfo &sei, UInt payloadSize); 91 91 Void xParseSEIToneMappingInfo (SEIToneMappingInfo& sei, UInt payloadSize); 92 #if Q0074_SEI_COLOR_MAPPING 93 Void xParseSEIColorMappingInfo (SEIColorMappingInfo& sei, UInt payloadSize); 94 #endif 92 95 Void xParseSEISOPDescription (SEISOPDescription &sei, UInt payloadSize); 93 96 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.cpp
r693 r694 96 96 m_pColorMappedPic = NULL; 97 97 #endif 98 99 #if Q0074_SEI_COLOR_MAPPING 100 m_ColorMapping = new TDecColorMapping(); 101 #endif 98 102 } 99 103 … … 110 114 m_pColorMappedPic = NULL; 111 115 } 116 #endif 117 #if Q0074_SEI_COLOR_MAPPING 118 if ( m_ColorMapping ) delete m_ColorMapping; 112 119 #endif 113 120 } … … 846 853 g_uiMaxCUDepth = sps->getMaxCUDepth(); 847 854 g_uiAddCUDepth = max (0, sps->getLog2MinCodingBlockSize() - (Int)sps->getQuadtreeTULog2MinSize() ); 855 856 #if Q0074_SEI_COLOR_MAPPING 857 for(Int compID=0; compID<3; compID++) 858 { 859 m_ColorMapping->setColorMapping( compID ? g_bitDepthC : g_bitDepthY, compID ); 860 } 861 #endif 848 862 849 863 for (Int i = 0; i < sps->getLog2DiffMaxMinCodingBlockSize(); i++) … … 1876 1890 } 1877 1891 } 1892 #if Q0074_SEI_COLOR_MAPPING 1893 m_ColorMapping->setColorMapping( m_SEIs ); 1894 #endif 1878 1895 } 1879 1896 #else … … 2386 2403 } 2387 2404 #endif 2405 2388 2406 #endif //SVC_EXTENSION 2407 2408 #if Q0074_SEI_COLOR_MAPPING 2409 TDecColorMapping::TDecColorMapping() 2410 { 2411 m_pcColorMappingPic[0] = NULL; 2412 m_pcColorMappingPic[1] = NULL; 2413 2414 m_colorMapCancelFlag = true; 2415 2416 for( Int i=0 ; i<3 ; i++ ) 2417 { 2418 m_lut1d_computed[i] = false; 2419 m_lut1d_input[i] = NULL; 2420 m_coded_input_pivot_value[i] = NULL; 2421 m_target_input_pivot_value[i] = NULL; 2422 } 2423 for( Int i=0 ; i<3 ; i++ ) 2424 { 2425 m_lut1d_output[i] = NULL; 2426 m_coded_output_pivot_value[i] = NULL; 2427 m_target_output_pivot_value[i] = NULL; 2428 } 2429 } 2430 2431 TDecColorMapping::~TDecColorMapping() 2432 { 2433 if ( m_pcColorMappingPic[0] ) delete m_pcColorMappingPic[0]; 2434 if ( m_pcColorMappingPic[1] ) delete m_pcColorMappingPic[1]; 2435 2436 for( Int i=0 ; i<3 ; i++ ) 2437 { 2438 if ( m_lut1d_input[i] ) delete m_lut1d_input[i]; 2439 if ( m_coded_input_pivot_value[i] ) delete m_coded_input_pivot_value[i]; 2440 if ( m_target_input_pivot_value[i] ) delete m_target_input_pivot_value[i]; 2441 } 2442 for( Int i=0 ; i<3 ; i++ ) 2443 { 2444 if ( m_lut1d_output[i] ) delete m_lut1d_output[i]; 2445 if ( m_coded_output_pivot_value[i] ) delete m_coded_output_pivot_value[i]; 2446 if ( m_target_output_pivot_value[i] ) delete m_target_output_pivot_value[i]; 2447 } 2448 } 2449 2450 Void TDecColorMapping::setColorMapping( SEIMessages m_SEIs ) 2451 { 2452 SEIMessages colorMappingInfo = getSeisByType(m_SEIs, SEI::COLOR_MAPPING_INFO) ; 2453 SEIColorMappingInfo *seiColorMappingInfo = NULL; 2454 if (colorMappingInfo.size() !=0) 2455 { 2456 seiColorMappingInfo = (SEIColorMappingInfo*)(*colorMappingInfo.begin()); 2457 2458 m_colorMapId = seiColorMappingInfo->m_colorMapId; 2459 m_colorMapCancelFlag = seiColorMappingInfo->m_colorMapCancelFlag; 2460 if( !m_colorMapCancelFlag ) 2461 { 2462 m_colorMapPersistenceFlag = seiColorMappingInfo->m_colorMapPersistenceFlag; 2463 m_colorMap_video_signal_type_present_flag = seiColorMappingInfo->m_colorMap_video_signal_type_present_flag; 2464 m_colorMap_video_full_range_flag = seiColorMappingInfo->m_colorMap_video_full_range_flag; 2465 m_colorMap_primaries = seiColorMappingInfo->m_colorMap_primaries; 2466 m_colorMap_transfer_characteristics = seiColorMappingInfo->m_colorMap_transfer_characteristics; 2467 m_colorMap_matrix_coeffs = seiColorMappingInfo->m_colorMap_matrix_coeffs; 2468 m_colorMapModelId = seiColorMappingInfo->m_colorMapModelId; 2469 2470 m_colour_map_coded_data_bit_depth = seiColorMappingInfo->m_colour_map_coded_data_bit_depth; 2471 m_colour_map_target_bit_depth = seiColorMappingInfo->m_colour_map_target_bit_depth; 2472 2473 for( Int i=0 ; i<3 ; i++ ) 2474 { 2475 m_num_input_pivots[i] = seiColorMappingInfo->m_num_input_pivots[i]; 2476 if ( m_coded_input_pivot_value[i] ) delete m_coded_input_pivot_value[i]; 2477 if ( m_target_input_pivot_value[i] ) delete m_target_input_pivot_value[i]; 2478 m_coded_input_pivot_value[i] = new Int[ m_num_input_pivots[i] ]; 2479 m_target_input_pivot_value[i] = new Int[ m_num_input_pivots[i] ]; 2480 for( Int j=0 ; j<m_num_input_pivots[i] ; j++ ) 2481 { 2482 m_coded_input_pivot_value[i][j] = seiColorMappingInfo->m_coded_input_pivot_value[i][j]; 2483 m_target_input_pivot_value[i][j] = seiColorMappingInfo->m_target_input_pivot_value[i][j]; 2484 } 2485 } 2486 2487 m_matrix_flag = seiColorMappingInfo->m_matrix_flag; 2488 m_log2_matrix_denom = m_matrix_flag ? (seiColorMappingInfo->m_log2_matrix_denom) : (0) ; 2489 for( Int i=0 ; i<3 ; i++ ) 2490 { 2491 for( Int j=0 ; j<3 ; j++ ) 2492 { 2493 m_matrix_coef[i][j] = seiColorMappingInfo->m_matrix_coef[i][j]; 2494 } 2495 } 2496 2497 for( Int i=0 ; i<3 ; i++ ) 2498 { 2499 m_num_output_pivots[i] = seiColorMappingInfo->m_num_output_pivots[i]; 2500 if ( m_coded_output_pivot_value[i] ) delete m_coded_output_pivot_value[i]; 2501 if ( m_target_output_pivot_value[i] ) delete m_target_output_pivot_value[i]; 2502 m_coded_output_pivot_value[i] = new Int[ m_num_output_pivots[i] ]; 2503 m_target_output_pivot_value[i] = new Int[ m_num_output_pivots[i] ]; 2504 for( Int j=0 ; j<m_num_output_pivots[i] ; j++ ) 2505 { 2506 m_coded_output_pivot_value[i][j] = seiColorMappingInfo->m_coded_output_pivot_value[i][j]; 2507 m_target_output_pivot_value[i][j] = seiColorMappingInfo->m_target_output_pivot_value[i][j]; 2508 } 2509 } 2510 2511 memset( m_lut1d_computed, 0, sizeof( m_lut1d_computed ) ); 2512 } 2513 } 2514 2515 } 2516 2517 Void TDecColorMapping::setColorMapping( Int bitDepth, Int iComp ) 2518 { 2519 if( !m_colorMapCancelFlag && !m_lut1d_computed[iComp] ) 2520 { 2521 2522 if ( m_lut1d_input[iComp] ) delete m_lut1d_input[iComp]; 2523 if ( m_lut1d_output[iComp] ) delete m_lut1d_output[iComp]; 2524 2525 m_lut1d_input[iComp] = new Int[ 1 << bitDepth ]; 2526 m_lut1d_output[iComp] = new Int[ 1 << bitDepth ]; 2527 2528 Int iShift = (m_colour_map_coded_data_bit_depth >= bitDepth) ? (m_colour_map_coded_data_bit_depth - bitDepth) : (0); 2529 Int iShiftPivot = (m_colour_map_coded_data_bit_depth >= bitDepth) ? (0) : (bitDepth - m_colour_map_coded_data_bit_depth); 2530 2531 for( Int k=0 ; k<(1<<bitDepth) ; k++ ) 2532 { 2533 Int iSample = k << iShift ; 2534 if( m_num_input_pivots[iComp] > 1 ) 2535 { 2536 for( Int iPivot=0 ; iPivot<m_num_input_pivots[iComp] ; iPivot++ ) 2537 { 2538 Int iCodedPrev = m_coded_input_pivot_value[iComp][iPivot] << iShiftPivot; 2539 Int iCodedNext = m_coded_input_pivot_value[iComp][iPivot+1] << iShiftPivot; 2540 Int iTargetPrev = m_target_input_pivot_value[iComp][iPivot] << iShiftPivot; 2541 Int iTargetNext = m_target_input_pivot_value[iComp][iPivot+1] << iShiftPivot; 2542 if ( iCodedPrev <= iSample && iSample < iCodedNext ) 2543 { 2544 Float fInterpol = (Float)( (iCodedNext - iSample)*iTargetPrev + (iSample - iCodedPrev)*iTargetNext ) / (Float)(iCodedNext - iCodedPrev) ; 2545 m_lut1d_input[iComp][k] = (Int)( 0.5 + fInterpol ); 2546 iPivot = m_num_input_pivots[iComp]; // stop 2547 } 2548 } 2549 } 2550 else 2551 { 2552 m_lut1d_input[iComp][k] = k; 2553 } 2554 } 2555 2556 iShift = ( (m_colour_map_coded_data_bit_depth >= bitDepth) ? (m_colour_map_coded_data_bit_depth - bitDepth) : (0) ); 2557 Int iOffset = iShift ? (1 << (iShift - 1)) : (0) ; 2558 iShiftPivot = (m_colour_map_target_bit_depth >= bitDepth) ? (0) : (bitDepth - m_colour_map_target_bit_depth) ; 2559 for( Int k=0 ; k<(1<<bitDepth) ; k++ ) 2560 { 2561 Int iSample = k << iShift; 2562 if ( m_num_output_pivots[iComp]>1 ) 2563 { 2564 for( Int iPivot=0 ; iPivot<m_num_output_pivots[iComp] ; iPivot++ ) 2565 { 2566 Int iCodedPrev = m_coded_output_pivot_value[iComp][iPivot] << iShiftPivot; 2567 Int iCodedNext = m_coded_output_pivot_value[iComp][iPivot+1] << iShiftPivot; 2568 Int iTargetPrev = m_target_output_pivot_value[iComp][iPivot] << iShiftPivot; 2569 Int iTargetNext = m_target_output_pivot_value[iComp][iPivot+1] << iShiftPivot; 2570 if ( iCodedPrev <= iSample && iSample < iCodedNext ) 2571 { 2572 Float fInterpol = (Float)( (iCodedNext - iSample)*iTargetPrev + (iSample - iCodedPrev)*iTargetNext ) / (Float)(iCodedNext - iCodedPrev) ; 2573 m_lut1d_output[iComp][k] = ( (Int)(0.5 + fInterpol) + iOffset ) >> iShift ; 2574 iPivot = m_num_output_pivots[iComp]; // stop 2575 } 2576 } 2577 } 2578 else 2579 { 2580 m_lut1d_output[iComp][k] = k; 2581 } 2582 } 2583 2584 m_lut1d_computed[iComp] = true; 2585 } 2586 2587 } 2588 2589 TComPicYuv* TDecColorMapping::getColorMapping( TComPicYuv* pPicYuvRec, Int iTop, Int curlayerId ) 2590 { 2591 if( !m_colorMapCancelFlag ) 2592 { 2593 if( !m_pcColorMappingPic[iTop] ) 2594 { 2595 m_pcColorMappingPic[iTop] = new TComPicYuv; 2596 #if SVC_EXTENSION 2597 m_pcColorMappingPic[iTop]->create( pPicYuvRec->getWidth(), pPicYuvRec->getHeight(), pPicYuvRec->getChromaFormat(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2598 #else 2599 m_pcColorMappingPic[iTop]->create( pPicYuvRec->getWidth(), pPicYuvRec->getHeight(), g_uiMaxCUWidth, g_uiMaxCUHeight, g_uiMaxCUDepth ); 2600 #endif 2601 } 2602 2603 Int iHeight = pPicYuvRec->getHeight(); 2604 Int iWidth = pPicYuvRec->getWidth(); 2605 Int iStride = pPicYuvRec->getStride(); 2606 Int iCStride = pPicYuvRec->getCStride(); 2607 2608 Pel* Lum0 = pPicYuvRec->getLumaAddr(); 2609 Pel* Cb0 = pPicYuvRec->getCbAddr(); 2610 Pel* Cr0 = pPicYuvRec->getCrAddr(); 2611 Pel* Lum1 = m_pcColorMappingPic[iTop]->getLumaAddr(); 2612 Pel* Cb1 = m_pcColorMappingPic[iTop]->getCbAddr(); 2613 Pel* Cr1 = m_pcColorMappingPic[iTop]->getCrAddr(); 2614 2615 #if SVC_EXTENSION 2616 Int bitDepthY = g_bitDepthYLayer[curlayerId]; 2617 Int bitDepthC = g_bitDepthCLayer[curlayerId]; 2618 2619 assert( g_bitDepthY == bitDepthY ); 2620 assert( g_bitDepthC == bitDepthC ); 2621 #else 2622 Int bitDepthY = g_bitDepthY; 2623 Int bitDepthC = g_bitDepthC; 2624 #endif 2625 2626 Int iYShift = (m_colour_map_target_bit_depth >= bitDepthY) ? (m_colour_map_target_bit_depth - bitDepthY) : (0) ; 2627 Int iCShift = (m_colour_map_target_bit_depth >= bitDepthC) ? (m_colour_map_target_bit_depth - bitDepthC) : (0) ; 2628 Int offsetY = (1 << (m_log2_matrix_denom+iYShift - 1)); 2629 Int offsetC = (1 << (m_log2_matrix_denom+iCShift - 1)); 2630 2631 Bool bScaleX = false ; 2632 Bool bScaleY = false ; 2633 Int cShift = 1 ; 2634 2635 Pel* LumPrev0 = Lum0; 2636 for( Int y = 0; y < iHeight ; y++ ) 2637 { 2638 Bool bDoChroma = (y % 2); 2639 for( Int x = 0; x < iWidth ; x++ ) 2640 { 2641 Int s1Y = m_lut1d_input[0][ Lum0[x] ]; 2642 Int s1U = m_lut1d_input[1][ Cb0[x>>1] ]; 2643 Int s1V = m_lut1d_input[2][ Cr0[x>>1] ]; 2644 2645 Int s2Y, s2U, s2V; 2646 if( m_matrix_flag ) 2647 { 2648 s2Y = ( m_matrix_coef[0][0]*s1Y + m_matrix_coef[0][1]*s1U + m_matrix_coef[0][2]*s1V + offsetY ) >> ( m_log2_matrix_denom + iYShift ); 2649 //s2Y = ClipBD( s2Y , bitDepthY ); 2650 s2Y = ClipY( s2Y ); 2651 Lum1[x] = m_lut1d_output[0][ s2Y ]; 2652 } 2653 else 2654 { 2655 s1Y = ( s1Y + offsetY ) >> iYShift ; 2656 //s1Y = ClipBD( s1Y , bitDepthY ); 2657 s1Y = ClipY( s1Y ); 2658 Lum1[x] = m_lut1d_output[0][ s1Y ]; 2659 } 2660 2661 if( bDoChroma && (x%2) ) 2662 { 2663 if( m_matrix_flag ) 2664 { 2665 //s1Y = ( m_lut1d_input[0][ Lum0[x] ] + m_lut1d_input[0][ Lum0[x+1] ] + m_lut1d_input[0][ LumPrev0[x] ] + m_lut1d_input[0][ LumPrev0[x+1] ] + 2 ) >> 2 ; 2666 //s1Y = m_lut1d_input[0][ (Lum0[x] + Lum0[x+1] + LumPrev0[x] + LumPrev0[x+1] + 2)>>2 ] ; 2667 s1Y = m_lut1d_input[0][ Lum0[x] ]; 2668 2669 s2U = ( m_matrix_coef[1][0]*s1Y + m_matrix_coef[1][1]*s1U + m_matrix_coef[1][2]*s1V + offsetC ) >> ( m_log2_matrix_denom + iCShift ) ; 2670 s2V = ( m_matrix_coef[2][0]*s1Y + m_matrix_coef[2][1]*s1U + m_matrix_coef[2][2]*s1V + offsetC ) >> ( m_log2_matrix_denom + iCShift ) ; 2671 //s2U = ClipBD( s2U , bitDepthC ); 2672 //s2V = ClipBD( s2V , bitDepthC ); 2673 s2U = ClipC( s2U ); 2674 s2V = ClipC( s2V ); 2675 Cb1[x>>cShift] = m_lut1d_output[1][ s2U ]; 2676 Cr1[x>>cShift] = m_lut1d_output[2][ s2V ]; 2677 } 2678 else 2679 { 2680 s1U = ( s1U + offsetC ) >> iCShift ; 2681 s1V = ( s1V + offsetC ) >> iCShift ; 2682 //s1U = ClipBD( s1U , bitDepthC ); 2683 //s1V = ClipBD( s1V , bitDepthC ); 2684 s1U = ClipC( s1U ); 2685 s1V = ClipC( s1V ); 2686 Cb1[x>>cShift] = m_lut1d_output[1][ s1U ]; 2687 Cr1[x>>cShift] = m_lut1d_output[2][ s1V ]; 2688 } 2689 } 2690 2691 } 2692 2693 LumPrev0 = Lum0; 2694 Lum0 += iStride; 2695 Lum1 += iStride; 2696 if( bDoChroma ) 2697 { 2698 Cb0 += iCStride; 2699 Cr0 += iCStride; 2700 Cb1 += iCStride; 2701 Cr1 += iCStride; 2702 } 2703 } 2704 2705 return m_pcColorMappingPic[iTop]; 2706 } 2707 2708 return pPicYuvRec; 2709 } 2710 #endif 2711 2389 2712 //! \} -
branches/SHM-6-dev/source/Lib/TLibDecoder/TDecTop.h
r677 r694 64 64 // ==================================================================================================================== 65 65 66 #if Q0074_SEI_COLOR_MAPPING 67 class TDecColorMapping 68 { 69 Int m_colorMapId; 70 Bool m_colorMapCancelFlag; 71 Bool m_colorMapPersistenceFlag; 72 Bool m_colorMap_video_signal_type_present_flag; 73 Bool m_colorMap_video_full_range_flag; 74 UChar m_colorMap_primaries; 75 UChar m_colorMap_transfer_characteristics; 76 UChar m_colorMap_matrix_coeffs; 77 UChar m_colorMapModelId; 78 79 Int m_colour_map_coded_data_bit_depth; 80 Int m_colour_map_target_bit_depth; 81 82 Int m_num_input_pivots[3]; 83 Int* m_coded_input_pivot_value[3]; 84 Int* m_target_input_pivot_value[3]; 85 86 Bool m_matrix_flag; 87 Int m_log2_matrix_denom; 88 Int m_matrix_coef[3][3]; 89 90 Int m_num_output_pivots[3]; 91 Int* m_coded_output_pivot_value[3]; 92 Int* m_target_output_pivot_value[3]; 93 94 Bool m_lut1d_computed[3]; 95 Int* m_lut1d_input[3]; 96 Int* m_lut1d_output[3]; 97 TComPicYuv* m_pcColorMappingPic[2]; 98 99 public: 100 TDecColorMapping(); 101 ~TDecColorMapping(); 102 103 Bool getColorMappingFlag() { return(!m_colorMapCancelFlag);}; 104 105 Void setColorMapping( SEIMessages m_SEIs ); 106 Void setColorMapping( Int bitDepthY, Int bitDepthC ); 107 TComPicYuv* getColorMapping( TComPicYuv* pPicYuvRec, Int iTop=0, Int curlayerId=0 ); 108 };// END CLASS DEFINITION TDecColorMapping 109 #endif 110 66 111 /// decoder class 67 112 class TDecTop … … 159 204 #endif 160 205 public: 206 #if Q0074_SEI_COLOR_MAPPING 207 TDecColorMapping* m_ColorMapping; 208 #endif 209 161 210 TDecTop(); 162 211 virtual ~TDecTop();
Note: See TracChangeset for help on using the changeset viewer.