Changeset 1384 in 3DVCSoftware for branches/HTM-15.2-dev1/source/App/TAppEncoder


Ignore:
Timestamp:
12 Nov 2015, 18:56:31 (10 years ago)
Author:
tech
Message:

Remmoved 3D-HEVC.

Location:
branches/HTM-15.2-dev1/source/App/TAppEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.2-dev1/source/App/TAppEncoder/TAppEncCfg.cpp

    r1380 r1384  
    7373#if NH_MV
    7474  MULTIVIEWMAIN = 6,
    75 #if NH_3D
    76   MAIN3D = 8,
    77 #endif
    7875#endif
    7976  MONOCHROME_8      = 1008,
     
    120117  m_targetPivotValue = NULL;
    121118
    122 #if KWU_RC_MADPRED_E0227
    123   m_depthMADPred = 0;
    124 #endif
    125119}
    126120
     
    181175  {
    182176    free ( m_pchBaseViewCameraNumbers );
    183   }
    184 #endif
    185 #if NH_3D_VSO
    186   if (  m_pchVSOConfig != NULL)
    187   {
    188     free (  m_pchVSOConfig );
    189   }
    190  
    191   if ( m_pchCameraParameterFile != NULL )
    192   {
    193     free ( m_pchCameraParameterFile );
    194177  }
    195178#endif
     
    276259  }
    277260#endif
    278 #if NH_3D
    279   in>>entry.m_interCompPredFlag;
    280 #endif
    281261
    282262  return in;
     
    312292#if NH_MV
    313293  ,{"multiview-main"     , Profile::MULTIVIEWMAIN      },
    314 #if NH_3D
    315    {"3d-main"            , Profile::MAIN3D             }
    316 #endif
    317294#endif
    318295
     
    341318#if NH_MV
    342319    {"multiview-main"     , MULTIVIEWMAIN   },
    343 #if NH_3D
    344     {"3d-main"            , MAIN3D          },
    345 #endif
    346320#endif
    347321    {"monochrome",         MONOCHROME_8     },
     
    726700  string        cfg_levels;
    727701  string        cfg_tiers;
    728 #if NH_3D
    729   cfg_dimensionLength.push_back( 2  );  // depth
    730   cfg_dimensionLength.push_back( 32 );  // texture
    731 #else
    732702  cfg_dimensionLength.push_back( 64 );
    733 #endif
    734703#endif
    735704
     
    807776#if NH_MV
    808777  ("NumberOfLayers",                 m_numberOfLayers     , 1,                     "Number of layers")
    809 #if !NH_3D                           
    810778  ("ScalabilityMask",                m_scalabilityMask    , 2                    , "Scalability Mask: 2: Multiview, 8: Auxiliary, 10: Multiview + Auxiliary")   
    811 #else                               
    812   ("ScalabilityMask",                m_scalabilityMask    , 3                    , "Scalability Mask, 1: Texture 3: Texture + Depth ")   
    813 #endif 
    814779  ("DimensionIdLen",                 m_dimensionIdLen     , cfg_dimensionLength  , "Number of bits used to store dimensions Id")
    815780  ("ViewOrderIndex",                 m_viewOrderIndex              , IntAry1d(1,0),                                 "View Order Index per layer")
    816781  ("ViewId",                         m_viewId                      , IntAry1d(1,0),                                 "View Id per View Order Index")
    817782  ("AuxId",                          m_auxId                       , IntAry1d(1,0),                                 "AuxId per layer")
    818 #if NH_3D_VSO
    819   ("DepthFlag",                      m_depthFlag                   , IntAry1d(1,0),                                 "Depth Flag")
    820 #endif
    821783  ("TargetEncLayerIdList",           m_targetEncLayerIdList        , IntAry1d(0,0),                                 "LayerIds in Nuh to be encoded") 
    822784  ("LayerIdInNuh",                   m_layerIdInNuh                , IntAry1d(1,0),                                 "LayerId in Nuh") 
     
    10951057#endif
    10961058
    1097 #if KWU_RC_VIEWRC_E0227
    1098   ("ViewWiseTargetBits, -vtbr" ,  m_viewTargetBits,  std::vector<Int>(1, 32), "View-wise target bit-rate setting")
    1099   ("TargetBitAssign, -ta", m_viewWiseRateCtrl, false, "View-wise rate control on/off")
    1100 #endif
    1101 #if KWU_RC_MADPRED_E0227
    1102   ("DepthMADPred, -dm", m_depthMADPred, (UInt)0, "Depth based MAD prediction on/off")
    1103 #endif
    11041059#if NH_MV
    11051060// A lot of this stuff could should actually be derived by the encoder.
     
    12821237  ("BaseViewCameraNumbers",                           m_pchBaseViewCameraNumbers,   (TChar *) 0                 , "Numbers of base views")
    12831238#endif
    1284 #if NH_3D
    1285   ("Depth420OutputFlag",                              m_depth420OutputFlag,           true                     , "Output depth layers in 4:2:0 ")
    1286 #endif
    1287 #if NH_3D_VSO 
    1288   ("CameraParameterFile,cpf",                         m_pchCameraParameterFile,    (TChar *) 0                 , "Camera Parameter File Name")
    1289   ("CodedCamParsPrecision",                           m_iCodedCamParPrecision,      STD_CAM_PARAMETERS_PRECISION, "precision for coding of camera parameters (in units of 2^(-x) luma samples)" )
    1290 
    1291   /* View Synthesis Optimization */
    1292   ("VSOConfig",                                       m_pchVSOConfig            , (TChar *) 0                   ,"VSO configuration")
    1293   ("VSO",                                             m_bUseVSO                 , false                         ,"Use VSO" )   
    1294   ("VSOMode",                                         m_uiVSOMode               , (UInt)   4                    ,"VSO Mode")
    1295   ("LambdaScaleVSO",                                  m_dLambdaScaleVSO         , (Double) 1                    ,"Lambda Scaling for VSO")
    1296   ("VSOLSTable",                                      m_bVSOLSTable             , true                          ,"Depth QP dependent video/depth rate allocation by Lagrange multiplier" )     
    1297   ("ForceLambdaScaleVSO",                             m_bForceLambdaScaleVSO    , false                         ,"Force using Lambda Scale VSO also in non-VSO-Mode")
    1298   ("AllowNegDist",                                    m_bAllowNegDist           , true                          ,"Allow negative Distortion in VSO")
    1299                                                                                                              
    1300   ("UseEstimatedVSD",                                 m_bUseEstimatedVSD        , true                          ,"Model based VSD estimation instead of rendering based for some encoder decisions" )     
    1301   ("VSOEarlySkip",                                    m_bVSOEarlySkip           , true                          ,"Early skip of VSO computation if synthesis error assumed to be zero" )     
    1302                                                                                                                
    1303   ("WVSO",                                            m_bUseWVSO                , true                          ,"Use depth fidelity term for VSO" )
    1304   ("VSOWeight",                                       m_iVSOWeight              , 10                            ,"Synthesized View Distortion Change weight" )
    1305   ("VSDWeight",                                       m_iVSDWeight              , 1                             ,"View Synthesis Distortion estimate weight" )
    1306   ("DWeight",                                         m_iDWeight                , 1                             ,"Depth Distortion weight" )
    1307 #endif //HHI_VSO
    13081239/* 3D- HEVC Tools */                                                           
    1309 #if NH_3D_QTL
    1310   ("QTL"                   ,                          m_bUseQTL                 , true                          , "Use depth quad tree limitation (encoder only)" )
    1311 #endif
    1312 #if NH_3D
    1313 
    1314   ("IvMvPredFlag"          ,                          m_ivMvPredFlag            , BoolAry1d(2,true)             , "Inter-view motion prediction"              )
    1315   ("IvMvScalingFlag"       ,                          m_ivMvScalingFlag         , BoolAry1d(2,true)             , "Inter-view motion vector scaling"          )
    1316   ("Log2SubPbSizeMinus3"   ,                          m_log2SubPbSizeMinus3     , 0                             , "Log2 minus 3 of sub Pb size"               )
    1317   ("IvResPredFlag"         ,                          m_ivResPredFlag           , true                          , "Inter-view residual prediction"            )
    1318   ("DepthRefinementFlag"   ,                          m_depthRefinementFlag     , true                          , "Depth to refine disparity"                 )
    1319   ("ViewSynthesisPredFlag" ,                          m_viewSynthesisPredFlag   , true                          , "View synthesis prediction"                 )
    1320   ("DepthBasedBlkPartFlag" ,                          m_depthBasedBlkPartFlag   , true                          , "Depth base block partitioning"             )
    1321   ("MpiFlag"               ,                          m_mpiFlag                 , true                          , "Motion inheritance from texture to depth"  )
    1322   ("Log2MpiSubPbSizeMinus3",                          m_log2MpiSubPbSizeMinus3  , 0                             , "Log2 minus 3 of sub Pb size for MPI"       )
    1323   ("IntraContourFlag"      ,                          m_intraContourFlag        , true                          , "Intra contour mode"                        )
    1324   ("IntraWedgeFlag"        ,                          m_intraWedgeFlag          , true                          , "Intra wedge mode and segmental depth DCs"  )
    1325   ("IntraSdcFlag"          ,                          m_intraSdcFlag            , true                          , "Intra depth DCs"                           )
    1326   ("QtPredFlag"            ,                          m_qtPredFlag              , true                          , "Quad tree prediction from texture to depth")
    1327   ("InterSdcFlag"          ,                          m_interSdcFlag            , true                          , "Inter depth DCs"                           )
    1328   ("DepthIntraSkip"        ,                          m_depthIntraSkipFlag      , true                          , "Depth intra skip mode"                     )
    1329   ("DLT"                   ,                          m_useDLT                  , true                          , "Depth lookup table"                        )
    1330   ("IlluCompEnable"        ,                          m_abUseIC                 , true                          , "Enable illumination compensation"          )
    1331   ("IlluCompLowLatencyEnc" ,                          m_bUseLowLatencyICEnc     , false                         , "Enable low-latency illumination compensation encoding")
    1332 #endif //NH_3D
    13331240   
    13341241  ;
     
    15361443  if( cfg_profiles.empty() )
    15371444  {
    1538 #if NH_3D
    1539     cfg_profiles = string("main main 3d-main");
    1540 #else
    15411445    cfg_profiles = string("main main multiview-main");   
    1542 #endif
    15431446    fprintf(stderr, "\nWarning: No profiles given, using defaults: %s", cfg_profiles.c_str() );
    15441447    anyEmpty = true;
     
    18071710  xResizeVector( m_auxId );
    18081711
    1809 #if NH_3D_VSO
    1810   xResizeVector( m_depthFlag );
    1811 #endif
    18121712  xResizeVector( m_fQP );
    18131713
     
    20171917
    20181918
    2019 #if NH_3D_VSO
    2020   // Table base optimization
    2021   // Q&D
    2022   Double adLambdaScaleTable[] =
    2023   {  0.031250, 0.031639, 0.032029, 0.032418, 0.032808, 0.033197, 0.033586, 0.033976, 0.034365, 0.034755,
    2024   0.035144, 0.035533, 0.035923, 0.036312, 0.036702, 0.037091, 0.037480, 0.037870, 0.038259, 0.038648,
    2025   0.039038, 0.039427, 0.039817, 0.040206, 0.040595, 0.040985, 0.041374, 0.041764, 0.042153, 0.042542,
    2026   0.042932, 0.043321, 0.043711, 0.044100, 0.044194, 0.053033, 0.061872, 0.070711, 0.079550, 0.088388,
    2027   0.117851, 0.147314, 0.176777, 0.235702, 0.294628, 0.353553, 0.471405, 0.589256, 0.707107, 0.707100,
    2028   0.753550, 0.800000 
    2029   };
    2030   if ( m_bUseVSO && m_bVSOLSTable )
    2031   {
    2032     Int firstDepthLayer = -1;
    2033     for (Int layer = 0; layer < m_numberOfLayers; layer++ )
    2034     {
    2035       if ( m_depthFlag[ layer ]  || m_auxId[ layer ] == 2 )
    2036       {
    2037         firstDepthLayer = layer;
    2038         break;
    2039       }
    2040     }
    2041     AOT( firstDepthLayer == -1 );
    2042     AOT( (m_iQP[firstDepthLayer] < 0) || (m_iQP[firstDepthLayer] > 51));
    2043     m_dLambdaScaleVSO *= adLambdaScaleTable[m_iQP[firstDepthLayer]];
    2044   }
    2045   if ( m_bUseVSO && m_uiVSOMode == 4)
    2046   {
    2047     m_cRenModStrParser.setString( m_iNumberOfViews, m_pchVSOConfig );
    2048     m_cCameraData     .init     ( ((UInt) m_iNumberOfViews ),
    2049       m_internalBitDepth[ CHANNEL_TYPE_LUMA],
    2050       (UInt)m_iCodedCamParPrecision,
    2051       m_FrameSkip,
    2052       (UInt)m_framesToBeEncoded,
    2053       m_pchCameraParameterFile,
    2054       m_pchBaseViewCameraNumbers,
    2055       NULL,
    2056       m_cRenModStrParser.getSynthViews(),
    2057       LOG2_DISP_PREC_LUT );
    2058   }
    2059   else if ( m_bUseVSO && m_uiVSOMode != 4 )
    2060   {
    2061     m_cCameraData     .init     ( ((UInt) m_iNumberOfViews ),
    2062       m_internalBitDepth[ CHANNEL_TYPE_LUMA],
    2063       (UInt)m_iCodedCamParPrecision,
    2064       m_FrameSkip,
    2065       (UInt)m_framesToBeEncoded,
    2066       m_pchCameraParameterFile,
    2067       m_pchBaseViewCameraNumbers,
    2068       m_pchVSOConfig,
    2069       NULL,
    2070       LOG2_DISP_PREC_LUT );
    2071   }
    2072 #if NH_3D
    2073   else
    2074   {
    2075     m_cCameraData     .init     ( ((UInt) m_iNumberOfViews ),
    2076       m_internalBitDepth[ CHANNEL_TYPE_LUMA],
    2077       (UInt) m_iCodedCamParPrecision,
    2078       m_FrameSkip,
    2079       (UInt) m_framesToBeEncoded,
    2080       m_pchCameraParameterFile,
    2081       m_pchBaseViewCameraNumbers,
    2082       NULL,
    2083       NULL,
    2084       LOG2_DISP_PREC_LUT );
    2085   }
    2086   m_cCameraData.check( false, true );
    2087 #endif
    2088 #endif
    20891919
    20901920  // check validity of input parameters
     
    22642094  xConfirmPara( (m_layerIdInNuh.size()!=1) && (m_layerIdInNuh.size() < m_numberOfLayers) , "LayerIdInNuh must be given for all layers. ");
    22652095
    2266 #if NH_3D
    2267   xConfirmPara( m_scalabilityMask != 2 && m_scalabilityMask != 3, "Scalability Mask must be equal to 2 or 3. ");
    2268 #else
    22692096  xConfirmPara( m_scalabilityMask != 2 && m_scalabilityMask != 8 && m_scalabilityMask != 10, "Scalability Mask must be equal to 2, 8 or 10");
    2270 #endif
    2271 
    2272 #if NH_3D_VSO
    2273   if ( m_scalabilityMask & ( 1 << DEPTH_ID ) )
    2274   {
    2275     m_dimIds.push_back( m_depthFlag );
    2276   }
    2277 #endif
     2097
    22782098
    22792099  m_dimIds.push_back( m_viewOrderIndex );   
     
    23422162      xConfirmPara( allEqual , "Each layer shall have a different position in scalability space." );
    23432163
    2344 #if !H_3D_FCO
    23452164      if ( numDiff  == 1 )
    23462165      {
     
    23532172        xConfirmPara( shallBeButIsNotIncreasing,  "DimensionIds shall be increasing within one dimension. " );
    23542173      }
    2355 #endif
    23562174    }
    23572175  }
     
    25602378  xConfirmPara(  m_maxNumMergeCand < 1,  "MaxNumMergeCand must be 1 or greater.");
    25612379  xConfirmPara(  m_maxNumMergeCand > 5,  "MaxNumMergeCand must be 5 or smaller.");
    2562 #if NH_3D
    2563   xConfirmPara( m_log2SubPbSizeMinus3 < 0,                                        "Log2SubPbSizeMinus3 must be equal to 0 or greater.");
    2564   xConfirmPara( m_log2SubPbSizeMinus3 > 3,                                        "Log2SubPbSizeMinus3 must be equal to 3 or smaller.");
    2565   xConfirmPara( (1<< ( m_log2SubPbSizeMinus3 + 3) ) > m_uiMaxCUWidth,              "Log2SubPbSizeMinus3 must be  equal to log2(maxCUSize)-3 or smaller.");
    2566  
    2567   xConfirmPara( m_log2MpiSubPbSizeMinus3 < 0,                                        "Log2MpiSubPbSizeMinus3 must be equal to 0 or greater.");
    2568   xConfirmPara( m_log2MpiSubPbSizeMinus3 > 3,                                        "Log2MpiSubPbSizeMinus3 must be equal to 3 or smaller.");
    2569   xConfirmPara( (1<< (m_log2MpiSubPbSizeMinus3 + 3)) > m_uiMaxCUWidth,               "Log2MpiSubPbSizeMinus3 must be equal to log2(maxCUSize)-3 or smaller.");
    2570 #endif
    25712380#if ADAPTIVE_QP_SELECTION
    25722381#if NH_MV
     
    26292438  }
    26302439
    2631 #if NH_3D_VSO
    2632   xConfirmPara( m_pchCameraParameterFile    == 0                ,   "CameraParameterFile must be given");
    2633   xConfirmPara( m_pchBaseViewCameraNumbers  == 0                ,   "BaseViewCameraNumbers must be given" );
    2634   xConfirmPara( m_iNumberOfViews != m_cCameraData.getBaseViewNumbers().size() ,   "Number of Views in BaseViewCameraNumbers must be equal to NumberOfViews" );
    2635   xConfirmPara    ( m_iCodedCamParPrecision < 0 || m_iCodedCamParPrecision > 5,       "CodedCamParsPrecision must be in range of 0..5" );
    2636     if( m_bUseVSO )
    2637     {
    2638       xConfirmPara(   m_pchVSOConfig            == 0                             ,   "VSO Setup string must be given");
    2639       xConfirmPara( m_uiVSOMode > 4 ,                                                "VSO Mode must be less than 5");
    2640     }
    2641 #endif
    26422440  // max CU width and height should be power of 2
    26432441  UInt ui = m_uiMaxCUWidth;
     
    33933191  xPrintParaVector( "AuxId", m_auxId );
    33943192#endif
    3395 #if NH_3D_VSO
    3396   xPrintParaVector( "DepthLayerFlag", m_depthFlag );
    3397   printf("Coded Camera Param. Precision     : %d\n", m_iCodedCamParPrecision); 
    3398 #endif
    33993193#if NH_MV 
    34003194  xPrintParaVector( "QP"               , m_fQP                );
     
    35733367#endif
    35743368
    3575 #if KWU_RC_MADPRED_E0227
    3576     printf("Depth based MAD prediction   : %d\n", m_depthMADPred);
    3577 #endif
    3578 #if KWU_RC_VIEWRC_E0227
    3579     printf("View-wise Rate control       : %d\n", m_viewWiseRateCtrl);
    3580     if(m_viewWiseRateCtrl)
    3581     {
    3582 
    3583       printf("ViewWiseTargetBits           : ");
    3584       for (Int i = 0 ; i < m_iNumberOfViews ; i++)
    3585         printf("%d ", m_viewTargetBits[i]);
    3586       printf("\n");
    3587     }
    3588     else
    3589     {
    3590       printf("TargetBitrate                : %d\n", m_RCTargetBitrate );
    3591     }
    3592 #endif
    35933369
    35943370  }
    35953371
    35963372  printf("Max Num Merge Candidates          : %d\n", m_maxNumMergeCand);
    3597 #if NH_3D_VSO
    3598   printf("BaseViewCameraNumbers             : %s\n", m_pchBaseViewCameraNumbers );
    3599   printf("Coded Camera Param. Precision     : %d\n", m_iCodedCamParPrecision);
    3600   printf("Force use of Lambda Scale         : %d\n", m_bForceLambdaScaleVSO );
    3601 
    3602   if ( m_bUseVSO )
    3603   {   
    3604     printf("VSO Lambda Scale                  : %5.2f\n", m_dLambdaScaleVSO );
    3605     printf("VSO Mode                          : %d\n",    m_uiVSOMode       );
    3606     printf("VSO Config                        : %s\n",    m_pchVSOConfig    );
    3607     printf("VSO Negative Distortion           : %d\n",    m_bAllowNegDist ? 1 : 0);
    3608     printf("VSO LS Table                      : %d\n",    m_bVSOLSTable ? 1 : 0);
    3609     printf("VSO Estimated VSD                 : %d\n",    m_bUseEstimatedVSD ? 1 : 0);
    3610     printf("VSO Early Skip                    : %d\n",    m_bVSOEarlySkip ? 1 : 0);   
    3611     if ( m_bUseWVSO )
    3612     {
    3613       printf("Dist. Weights (VSO/VSD/SAD)       : %d/%d/%d\n ", m_iVSOWeight, m_iVSDWeight, m_iDWeight );   
    3614     }   
    3615   }
    3616 #endif //HHI_VSO
    36173373  printf("\n");
    36183374#if NH_MV
     
    36773433  printf(" SignBitHidingFlag:%d ", m_signHideFlag);
    36783434  printf("RecalQP:%d", m_recalculateQPAccordingToLambda ? 1 : 0 );
    3679 #if NH_3D_VSO
    3680   printf(" VSO:%d ", m_bUseVSO   );
    3681   printf("WVSO:%d ", m_bUseWVSO ); 
    3682 #endif
    3683 #if NH_3D_QTL
    3684   printf( "QTL:%d "                  , m_bUseQTL);
    3685 #endif
    3686 #if NH_3D
    3687   printf( "IlluCompEnable:%d "       , m_abUseIC);
    3688   printf( "IlluCompLowLatencyEnc:%d ",  m_bUseLowLatencyICEnc);
    3689   printf( "DLT:%d ", m_useDLT );
    3690 
    3691 
    3692   printf( "IvMvPred:%d %d "            , m_ivMvPredFlag[0] ? 1 : 0, m_ivMvPredFlag[1]  ? 1 : 0);
    3693   printf( "IvMvScaling:%d %d "         , m_ivMvScalingFlag[0] ? 1 : 0 , m_ivMvScalingFlag[1]  ? 1 : 0);
    3694 
    3695   printf( "Log2SubPbSizeMinus3:%d "    , m_log2SubPbSizeMinus3            );
    3696   printf( "IvResPred:%d "              , m_ivResPredFlag          ? 1 : 0 );
    3697   printf( "DepthRefinement:%d "        , m_depthRefinementFlag    ? 1 : 0 );
    3698   printf( "ViewSynthesisPred:%d "      , m_viewSynthesisPredFlag  ? 1 : 0 );
    3699   printf( "DepthBasedBlkPart:%d "      , m_depthBasedBlkPartFlag  ? 1 : 0 );
    3700   printf( "Mpi:%d "                    , m_mpiFlag                ? 1 : 0 );
    3701   printf( "Log2MpiSubPbSizeMinus3:%d " , m_log2MpiSubPbSizeMinus3         );
    3702   printf( "IntraContour:%d "           , m_intraContourFlag       ? 1 : 0 );
    3703   printf( "IntraWedge:%d "             , m_intraWedgeFlag         ? 1 : 0 );
    3704   printf( "IntraSdc:%d "               , m_intraSdcFlag           ? 1 : 0 );
    3705   printf( "QtPred:%d "                 , m_qtPredFlag             ? 1 : 0 );
    3706   printf( "InterSdc:%d "               , m_interSdcFlag           ? 1 : 0 );
    3707   printf( "DepthIntraSkip:%d "         , m_depthIntraSkipFlag     ? 1 : 0 );
    3708 #endif
    37093435
    37103436  printf("\n\n");
  • branches/HTM-15.2-dev1/source/App/TAppEncoder/TAppEncCfg.h

    r1380 r1384  
    4444#include <sstream>
    4545#include <vector>
    46 #if NH_3D
    47 #include "TAppCommon/TAppComCamPara.h"
    48 #include "TLibRenderer/TRenModel.h"
    49 #include "TLibRenderer/TRenModSetupStrParser.h"
    50 #endif
    5146//! \ingroup TAppEncoder
    5247//! \{
     
    8075  IntAry1d               m_viewOrderIndex;                    ///< view order index 
    8176  IntAry1d               m_auxId;                             ///< auxiliary id
    82 #if NH_3D_VSO
    83   IntAry1d               m_depthFlag;                         ///< depth flag
    84 #endif
    8577  IntAry1d               m_targetEncLayerIdList;              ///< layer Ids in Nuh to be encoded
    8678  IntAry1d               m_layerIdInNuh;                      ///< layer Id in Nuh for each layer
     
    131123  Bool      m_singleLayerForNonIrapFlag;
    132124  Bool      m_higherLayerIrapSkipFlag;
    133 #if NH_3D
    134   Bool      m_abUseIC;
    135   Bool      m_bUseLowLatencyICEnc;
    136 #endif
    137125#endif
    138126  // Lambda modifiers
     
    464452#endif
    465453
    466 #if KWU_RC_VIEWRC_E0227
    467   vector<Int>     m_viewTargetBits;
    468   Bool      m_viewWiseRateCtrl;                              ///< Flag for using view-wise rate control
    469 #endif
    470 #if KWU_RC_MADPRED_E0227
    471   UInt       m_depthMADPred;
    472 #endif
    473454
    474455  ScalingListMode m_useScalingListId;                         ///< using quantization matrix
     
    527508#endif
    528509
    529 #if NH_3D
    530   // Output Format
    531   Bool      m_depth420OutputFlag;                             ///< Output depth layers in 4:2:0 format
    532 #endif
    533510    // Camera parameters
    534 #if NH_3D_VSO
    535   TChar*    m_pchCameraParameterFile;                         ///< camera parameter file
    536   TAppComCamPara m_cCameraData;
    537   Int       m_iCodedCamParPrecision;                          ///< precision for coding of camera parameters
    538   TChar*    m_pchVSOConfig;
    539   Bool      m_bUseVSO;                                        ///< flag for using View Synthesis Optimization
    540   Bool      m_bVSOLSTable;                                    ///< Depth QP dependent Lagrange parameter optimization (m23714)
    541   Bool      m_bVSOEarlySkip;                                  ///< Early skip of VSO computation (JCT3V-A0093 modification 4)
    542                                                              
    543   //// Used for development by GT, might be removed later     
    544   Double    m_dLambdaScaleVSO;                                ///< Scaling factor for Lambda in VSO mode
    545   Bool      m_bForceLambdaScaleVSO;                           ///< Use Lambda Scale for depth even if VSO is turned off
    546   Bool      m_bAllowNegDist;                                  ///< Allow negative distortion in VSO
    547   UInt      m_uiVSOMode;                                      ///< Number of VSO Mode, 1 = , 2 = simple, org vs. ren, 3 = simple, ren vs. ren, 4 = full 
    548                                                              
    549   // SAIT_VSO_EST_A0033                                       
    550   Bool      m_bUseEstimatedVSD;                               ///< Flag for using model based VSD estimation instead of VSO for some encoder decisions (JCT3V-A0033 modification 3) 
    551                                                              
    552   // LGE_WVSO_A0119                                           
    553   Bool      m_bUseWVSO;                                       ///< flag for using View Synthesis Optimization 
    554   Int       m_iVSOWeight;
    555   Int       m_iVSDWeight;
    556   Int       m_iDWeight;
    557 
    558   // Ren Model String
    559   TRenModSetupStrParser       m_cRenModStrParser;
    560 #endif
    561 #if NH_3D
    562   Bool       m_useDLT;                                        ///< flag for using DLT
    563 #endif
    564 #if NH_3D_QTL
    565   Bool       m_bUseQTL;                                        ///< flag for using depth QuadTree Limitation
    566 #endif
    567 #if NH_3D
    568   BoolAry1d  m_ivMvPredFlag;
    569   BoolAry1d  m_ivMvScalingFlag;
    570   Int        m_log2SubPbSizeMinus3;
    571   Bool       m_ivResPredFlag;
    572   Bool       m_depthRefinementFlag;
    573   Bool       m_viewSynthesisPredFlag;
    574   Bool       m_depthBasedBlkPartFlag;
    575   Bool       m_mpiFlag;
    576   Int        m_log2MpiSubPbSizeMinus3;
    577   Bool       m_intraContourFlag;
    578   Bool       m_intraWedgeFlag;
    579   Bool       m_intraSdcFlag;
    580   Bool       m_qtPredFlag;
    581   Bool       m_interSdcFlag;
    582   Bool       m_depthIntraSkipFlag;
    583 #endif
    584511  // internal member functions
    585512  Void  xCheckParameter ();                                   ///< check validity of configuration values
  • branches/HTM-15.2-dev1/source/App/TAppEncoder/TAppEncTop.cpp

    r1380 r1384  
    8787#endif
    8888 
    89 #if NH_3D
    90   vps.createCamPars(m_iNumberOfViews); 
    91 #endif
    92 
    93 #if NH_3D_DLT
    94   TComDLT dlt = TComDLT();
    95 #endif
     89
    9690
    9791#if NH_MV
     
    145139  xSetDpbSize              ( vps );
    146140  xSetVPSVUI               ( vps );
    147 #if NH_3D
    148   xSetCamPara              ( vps );
    149 #endif
    150 #if NH_3D_VSO
    151   m_ivPicLists.setVPS      ( &vps );
    152 #endif
    153 #if NH_3D_DLT
    154   xDeriveDltArray          ( vps, &dlt );
    155 #endif
    156141  if ( m_targetEncLayerIdList.size() == 0 )
    157142  {
     
    184169  }
    185170
    186 #if NH_3D
    187   // Set 3d tool parameters
    188   for (Int d = 0; d < 2; d++)
    189   { 
    190     m_sps3dExtension.setIvDiMcEnabledFlag          ( d, m_ivMvPredFlag[d]       );
    191     m_sps3dExtension.setIvMvScalEnabledFlag       ( d, m_ivMvScalingFlag[d]    );
    192     if (d == 0 )
    193     {   
    194       m_sps3dExtension.setLog2IvmcSubPbSizeMinus3   ( d, m_log2SubPbSizeMinus3   );
    195       m_sps3dExtension.setIvResPredEnabledFlag         ( d, m_ivResPredFlag         );
    196       m_sps3dExtension.setDepthRefEnabledFlag   ( d, m_depthRefinementFlag   );
    197       m_sps3dExtension.setVspMcEnabledFlag ( d, m_viewSynthesisPredFlag );
    198       m_sps3dExtension.setDbbpEnabledFlag ( d, m_depthBasedBlkPartFlag );
    199     }
    200     else
    201     {   
    202       m_sps3dExtension.setTexMcEnabledFlag               ( d, m_mpiFlag               );
    203       m_sps3dExtension.setLog2TexmcSubPbSizeMinus3( d, m_log2MpiSubPbSizeMinus3);
    204       m_sps3dExtension.setIntraContourEnabledFlag      ( d, m_intraContourFlag      );
    205       m_sps3dExtension.setIntraDcOnlyWedgeEnabledFlag     ( d, m_intraSdcFlag || m_intraWedgeFlag     );
    206       m_sps3dExtension.setCqtCuPartPredEnabledFlag            ( d, m_qtPredFlag            );
    207       m_sps3dExtension.setInterDcOnlyEnabledFlag          ( d, m_interSdcFlag          );
    208       m_sps3dExtension.setSkipIntraEnabledFlag    ( d, m_depthIntraSkipFlag    ); 
    209     }
    210   }
    211 #endif
    212171
    213172
     
    219178    m_acTVideoIOYuvInputFileList.push_back(new TVideoIOYuv);
    220179    m_acTVideoIOYuvReconFileList.push_back(new TVideoIOYuv);
    221 #if NH_3D   
    222     Int profileIdc = -1;
    223     for (Int olsIdx = 0; olsIdx < vps.getNumOutputLayerSets(); olsIdx++ )
    224     {   
    225       Int lsIdx = vps.olsIdxToLsIdx( olsIdx );
    226       for(Int i = 0; i < vps.getNumLayersInIdList( lsIdx ); i++ )
    227       {
    228         if( vps.getLayerIdInNuh( layerIdInVps) == vps.getLayerSetLayerIdList(lsIdx, i) )
    229         {
    230           Int ptlIdx = vps.getProfileTierLevelIdx( olsIdx, i );
    231           if ( ptlIdx != -1 )
    232           {
    233             Int curProfileIdc = vps.getPTL(ptlIdx)->getGeneralPTL()->getProfileIdc();
    234             if (profileIdc == -1)   
    235             {
    236               profileIdc = curProfileIdc;
    237             }
    238             else
    239             {   
    240               if ( profileIdc != curProfileIdc )
    241               {             
    242                 fprintf(stderr, "Error: ProfileIdc for layer with index %d in VPS not equal in all OLSs. \n", layerIdInVps );
    243                 exit(EXIT_FAILURE);
    244               }
    245             }
    246           }
    247         }
    248       }
    249     }
    250 
    251     if (profileIdc == -1 )
    252     {
    253       fprintf(stderr, "Error: No profile given for layer with index %d in VPS not equal in all OLS. \n", layerIdInVps );
    254       exit(EXIT_FAILURE);
    255     }
    256     m_acTEncTopList[ layerIdInVps ]->setProfileIdc( profileIdc );
    257 #endif
    258180  }
    259181
     
    278200    m_cTEncTop.setViewId                       ( vps.getViewId      (  layerId ) );
    279201    m_cTEncTop.setViewIndex                    ( vps.getViewIndex   (  layerId ) );
    280 #if NH_3D_VSO
    281     Bool isDepth    = ( vps.getDepthId     ( layerId ) != 0  ) ;
    282     Bool isAuxDepth = ( vps.getAuxId       ( layerId ) ==  2 ) ; // TBD: define 2 as AUX_DEPTH
    283     m_cTEncTop.setIsDepth                  ( isDepth    );
    284     m_cTEncTop.setIsAuxDepth               ( isAuxDepth );
    285     //====== Camera Parameters =========
    286     m_cTEncTop.setCameraParameters             ( &m_cCameraData );     
    287     //====== VSO =========
    288     m_cTEncTop.setRenderModelParameters        ( &m_cRenModStrParser );
    289     m_cTEncTop.setForceLambdaScaleVSO          ( isDepth || isAuxDepth ? m_bForceLambdaScaleVSO : false );
    290     m_cTEncTop.setLambdaScaleVSO               ( isDepth || isAuxDepth ? m_dLambdaScaleVSO      : 1     );
    291     m_cTEncTop.setVSOMode                      ( isDepth || isAuxDepth ? m_uiVSOMode            : 0     );
    292 
    293     m_cTEncTop.setAllowNegDist                 ( isDepth || isAuxDepth ? m_bAllowNegDist        : false );
    294 
    295     // SAIT_VSO_EST_A0033
    296     m_cTEncTop.setUseEstimatedVSD              ( isDepth || isAuxDepth ? m_bUseEstimatedVSD     : false );
    297 
    298     // LGE_WVSO_A0119
    299     m_cTEncTop.setUseWVSO                      ( isDepth || isAuxDepth ? m_bUseWVSO             : false );   
    300     m_cTEncTop.setVSOWeight                    ( isDepth || isAuxDepth ? m_iVSOWeight           : 0     );
    301     m_cTEncTop.setVSDWeight                    ( isDepth || isAuxDepth ? m_iVSDWeight           : 0     );
    302     m_cTEncTop.setDWeight                      ( isDepth || isAuxDepth ? m_iDWeight             : 0     );
    303 #endif // H_3D_VSO
    304 #if NH_3D
    305 #if NH_3D_IC
    306     m_cTEncTop.setUseIC                        ( vps.getViewIndex( layerId ) == 0 || isDepth ? false : m_abUseIC );
    307     m_cTEncTop.setUseICLowLatencyEnc           ( m_bUseLowLatencyICEnc );
    308 #endif
    309 
    310    
    311     m_cTEncTop.setUseDMM                       ( isDepth ? m_intraWedgeFlag   : false );
    312     m_cTEncTop.setUseSDC                       ( isDepth ? m_intraSdcFlag     : false );
    313     m_cTEncTop.setUseDLT                       ( isDepth ? m_useDLT   : false );
    314 #endif
    315 #if NH_3D_QTL
    316     m_cTEncTop.setUseQTL                       ( isDepth || isAuxDepth ? m_bUseQTL  : false );
    317 #endif
    318 #if NH_3D
    319     m_cTEncTop.setSps3dExtension               ( m_sps3dExtension );
    320 #endif // NH_3D
    321202
    322203    m_cTEncTop.setIvPicLists                   ( &m_ivPicLists );
     
    324205  m_cTEncTop.setVPS(&vps);
    325206
    326 #if NH_3D_DLT
    327   m_cTEncTop.setDLT(dlt);
    328 #endif
    329207
    330208#if NH_MV
     
    438316  m_cTEncTop.setChromaCrQpOffset                                  ( m_crQpOffset  );
    439317
    440 #if NH_3D
    441   m_cTEncTop.setChromaFormatIdc                                   ( isDepth ? CHROMA_400 : m_chromaFormatIDC );
    442 #else
    443318  m_cTEncTop.setChromaFormatIdc                                   ( m_chromaFormatIDC  );
    444 #endif
    445319
    446320#if ADAPTIVE_QP_SELECTION
     
    651525  m_cTEncTop.setScalingListFileName                               ( m_scalingListFileName );
    652526  m_cTEncTop.setSignHideFlag                                      ( m_signHideFlag);
    653 #if KWU_RC_VIEWRC_E0227 || KWU_RC_MADPRED_E0227
    654   if(!m_cTEncTop.getIsDepth())    //only for texture
    655   {
    656     m_cTEncTop.setUseRateCtrl                                     ( m_RCEnableRateControl );
    657   }                                                         
    658   else                                                       
    659   {                                                         
    660     m_cTEncTop.setUseRateCtrl                                     ( 0 );
    661   }
    662 #else
    663527  m_cTEncTop.setUseRateCtrl                                       ( m_RCEnableRateControl );
    664 #endif
    665 #if !KWU_RC_VIEWRC_E0227
    666528  m_cTEncTop.setTargetBitrate                                     ( m_RCTargetBitrate );
    667 #endif
    668529  m_cTEncTop.setKeepHierBit                                       ( m_RCKeepHierarchicalBit );
    669530  m_cTEncTop.setLCULevelRC                                        ( m_RCLCULevelRC );
     
    677538#endif
    678539
    679 #if KWU_RC_MADPRED_E0227
    680   if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
    681   {
    682     m_cTEncTop.setUseDepthMADPred(layerIdInVps ? m_depthMADPred       : 0);
    683     if(m_cTEncTop.getUseDepthMADPred())
    684     {
    685       m_cTEncTop.setCamParam(&m_cCameraData);
    686     }
    687   }
    688 #endif
    689 #if KWU_RC_VIEWRC_E0227
    690   if(m_cTEncTop.getUseRateCtrl() && !m_cTEncTop.getIsDepth())
    691   {
    692     m_cTEncTop.setUseViewWiseRateCtrl(m_viewWiseRateCtrl);
    693     if(m_iNumberOfViews == 1)
    694     {
    695       if(m_viewWiseRateCtrl)
    696       {
    697         m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]);
    698       }
    699       else
    700       {
    701         m_cTEncTop.setTargetBitrate       ( m_RCTargetBitrate );
    702       }
    703     }
    704     else
    705     {
    706       if(m_viewWiseRateCtrl)
    707       {
    708         m_cTEncTop.setTargetBitrate(m_viewTargetBits[layerIdInVps>>1]);
    709       }
    710       else
    711       {
    712         if(m_iNumberOfViews == 2)
    713         {
    714           if(m_cTEncTop.getViewId() == 0)
    715           {
    716             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*80)/100 );
    717           }
    718           else if(m_cTEncTop.getViewId() == 1)
    719           {
    720             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*20)/100 );
    721           }
    722         }
    723         else if(m_iNumberOfViews == 3)
    724         {
    725           if(m_cTEncTop.getViewId() == 0)
    726           {
    727             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*66)/100 );
    728           }
    729           else if(m_cTEncTop.getViewId() == 1)
    730           {
    731             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*17)/100 );
    732           }
    733           else if(m_cTEncTop.getViewId() == 2)
    734           {
    735             m_cTEncTop.setTargetBitrate              ( (m_RCTargetBitrate*17)/100 );
    736           }
    737         }
    738         else
    739         {
    740           m_cTEncTop.setTargetBitrate              ( m_RCTargetBitrate );
    741         }
    742       }
    743     }
    744   }
    745 #endif
    746540  m_cTEncTop.setTransquantBypassEnableFlag                        ( m_TransquantBypassEnableFlag );
    747541  m_cTEncTop.setCUTransquantBypassFlagForceValue                  ( m_CUTransquantBypassFlagForce );
     
    790584  }
    791585#endif
    792 #if NH_3D_VSO
    793   if ( m_bUseVSO )
    794   {
    795     if ( m_uiVSOMode == 4 )
    796     {
    797 #if H_3D_VSO_EARLY_SKIP
    798       m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0, m_bVSOEarlySkip );
    799 #else
    800       m_cRendererModel.create( m_cRenModStrParser.getNumOfBaseViews(), m_cRenModStrParser.getNumOfModels(), m_iSourceWidth, m_uiMaxCUHeight , LOG2_DISP_PREC_LUT, 0 );
    801 #endif
    802       for ( Int layer = 0; layer < m_numberOfLayers ; layer++ )
    803       {
    804         TEncTop* pcEncTop =  m_acTEncTopList[ layer ];
    805         Int iViewNum      = pcEncTop->getViewIndex();
    806         Int iContent      = pcEncTop->getIsDepth() || pcEncTop->getIsAuxDepth() ? 1 : 0;
    807         Int iNumOfModels  = m_cRenModStrParser.getNumOfModelsForView(iViewNum, iContent);
    808 
    809         Bool bUseVSO      = (iNumOfModels != 0);
    810 
    811         pcEncTop->setUseVSO( bUseVSO );
    812         pcEncTop->getRdCost()->setRenModel( bUseVSO ? &m_cRendererModel : NULL );
    813 
    814         for (Int iCurModel = 0; iCurModel < iNumOfModels; iCurModel++ )
    815         {
    816           Int iModelNum; Int iLeftViewNum; Int iRightViewNum; Int iDump; Int iOrgRefNum; Int iBlendMode;
    817 
    818           m_cRenModStrParser.getSingleModelData  ( iViewNum, iContent, iCurModel, iModelNum, iBlendMode, iLeftViewNum, iRightViewNum, iOrgRefNum, iDump ) ;
    819           m_cRendererModel  .createSingleModel   ( iViewNum, iContent, iModelNum, iLeftViewNum, iRightViewNum, (iOrgRefNum != -1), iBlendMode );
    820         }           
    821       }
    822     }
    823     else
    824     {
    825       AOT(true);
    826     }
    827   }
    828 #endif
    829586}
    830587
     
    834591  // initialize global variables
    835592  initROM();
    836 #if NH_3D_DMM
    837   initWedgeLists( true );
    838 #endif
    839593
    840594  for( Int layer=0; layer < m_numberOfLayers; layer++)
     
    900654  for(Int layer=0; layer<m_numberOfLayers; layer++)
    901655  {
    902 #if KWU_RC_MADPRED_E0227
    903     m_acTEncTopList[layer]->init( isFieldCoding, this );
    904 #else
    905656    m_acTEncTopList[layer]->init( isFieldCoding );
    906 #endif
    907657  }
    908658#else
     
    932682  }
    933683
    934 #if !NH_3D
    935684  TComPicYuv*       pcPicYuvOrg = new TComPicYuv;
    936 #endif
    937685  TComPicYuv*       pcPicYuvRec = NULL;
    938686
     
    968716  list<AccessUnit> outputAccessUnits; ///< list of access units to write out.  is populated by the encoding process
    969717 
    970 #if NH_3D
    971   TComPicYuv* picYuvOrg[2];
    972   TComPicYuv  picYuvTrueOrg[2];
    973   for (Int d = 0; d < 2 ; d++)
    974   {
    975     picYuvOrg[d] = new TComPicYuv;
    976     picYuvOrg[d]   ->create( m_iSourceWidth, m_isField ? m_iSourceHeightOrg : m_iSourceHeight, ( d > 0 ) ? CHROMA_400 : m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    977     picYuvTrueOrg[d].create( m_iSourceWidth, m_isField ? m_iSourceHeightOrg : m_iSourceHeight, ( d > 0 ) ? CHROMA_400 : m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    978   }
    979 #else
    980718  TComPicYuv cPicYuvTrueOrg;
    981719
     
    991729    cPicYuvTrueOrg.create(m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    992730  }
    993 #endif
    994731#if NH_MV
    995732  while ( (m_targetEncLayerIdList.size() != 0 ) && !allEos )
     
    997734    for(Int layer=0; layer < m_numberOfLayers; layer++ )
    998735    {
    999 #if NH_3D
    1000       TComPicYuv* pcPicYuvOrg    =  picYuvOrg    [ m_depthFlag[layer] ];
    1001       TComPicYuv& cPicYuvTrueOrg =  picYuvTrueOrg[ m_depthFlag[layer] ];
    1002 #endif
    1003736      if (!xLayerIdInTargetEncLayerIdList( m_vps->getLayerIdInNuh( layer ) ))
    1004737      {
     
    1036769    for ( Int gopId=0; gopId < gopSize; gopId++ )
    1037770    {
    1038 #if NH_3D_VSO
    1039       UInt iNextPoc = m_acTEncTopList[0] -> getFrameId( gopId );
    1040       if ( iNextPoc < m_framesToBeEncoded )
    1041       {
    1042         m_cCameraData.update( iNextPoc );
    1043       }
    1044 #endif
    1045771      for(Int layer=0; layer < m_numberOfLayers; layer++ )
    1046772      {
    1047 #if NH_3D
    1048         TComPicYuv* pcPicYuvOrg    =  picYuvOrg    [ m_depthFlag[layer] ];
    1049         TComPicYuv& cPicYuvTrueOrg =  picYuvTrueOrg[ m_depthFlag[layer] ];
    1050 #endif
    1051773        if (!xLayerIdInTargetEncLayerIdList( m_vps->getLayerIdInNuh( layer ) ))
    1052774        {
     
    1054776        }
    1055777
    1056 #if NH_3D_VSO       
    1057           if( m_bUseVSO && m_bUseEstimatedVSD && iNextPoc < m_framesToBeEncoded )
    1058           {
    1059             m_cCameraData.setDispCoeff( iNextPoc, m_acTEncTopList[layer]->getViewIndex() );
    1060             m_acTEncTopList[layer]  ->setDispCoeff( m_cCameraData.getDispCoeff() );
    1061           }
    1062 #endif
    1063778
    1064779        Int   iNumEncoded = 0;
     
    1127842#endif
    1128843
    1129 #if NH_3D
    1130   // delete original YUV buffer
    1131   for (Int d = 0; d < 2; d++)
    1132   {
    1133     picYuvOrg[d]->destroy();
    1134     delete picYuvOrg[d];
    1135     picYuvOrg[d] = NULL;
    1136 
    1137     picYuvTrueOrg[d].destroy();
    1138   }
    1139 #else
    1140844  // delete original YUV buffer
    1141845  pcPicYuvOrg->destroy();
    1142846  delete pcPicYuvOrg;
    1143847  pcPicYuvOrg = NULL;
    1144 #endif
    1145848
    1146849#if !NH_MV
     
    1148851  m_cTEncTop.deletePicBuffer();
    1149852#endif
    1150 #if !NH_3D
    1151853  cPicYuvTrueOrg.destroy();
    1152 #endif
    1153854
    1154855  // delete buffers & classes
     
    1158859  printRateSummary();
    1159860
    1160 #if NH_3D_REN_MAX_DEV_OUT
    1161   Double dMaxDispDiff = m_cCameraData.getMaxShiftDeviation();
    1162 
    1163   if ( !(dMaxDispDiff < 0) )
    1164   { 
    1165     printf("\n Max. possible shift error: %12.3f samples.\n", dMaxDispDiff );
    1166   }
    1167 #endif
    1168861
    1169862  return;
     
    1202895  {
    1203896    rpcPicYuvRec = new TComPicYuv;
    1204 #if NH_3D
    1205     rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_depthFlag[layer] > 0 ? CHROMA_400 : m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    1206 #else
    1207897    rpcPicYuvRec->create( m_iSourceWidth, m_iSourceHeight, m_chromaFormatIDC, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, true );
    1208 #endif
    1209898
    1210899  }
     
    1284973      if (m_pchReconFileList[layerIdx])
    1285974      {
    1286 #if NH_3D
    1287         m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, m_depth420OutputFlag && m_depthFlag[layerIdx ] ? CHROMA_420 : NUM_CHROMA_FORMAT, m_isTopFieldFirst );
    1288 #else
    1289975        m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRecTop, pcPicYuvRecBottom, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, NUM_CHROMA_FORMAT, m_isTopFieldFirst );
    1290 #endif
    1291976      }
    1292977    }
     
    13411026      if (m_pchReconFileList[layerIdx])
    13421027      {
    1343 #if NH_3D
    1344         m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom, m_depth420OutputFlag && m_depthFlag[layerIdx ] ? CHROMA_420 : NUM_CHROMA_FORMAT  );
    1345 #else
    13461028        m_acTVideoIOYuvReconFileList[layerIdx]->write( pcPicYuvRec, ipCSC, m_confWinLeft, m_confWinRight, m_confWinTop, m_confWinBottom );
    1347 #endif
    13481029
    13491030      }   
     
    14701151}
    14711152
    1472 #if NH_3D_DLT
    1473 Void TAppEncTop::xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt)
    1474 {
    1475   TComPicYuv*       pcDepthPicYuvOrg = new TComPicYuv;
    1476   TComPicYuv*       pcDepthPicYuvTrueOrg = new TComPicYuv;
    1477   // allocate original YUV buffer
    1478   pcDepthPicYuvOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, false );
    1479   pcDepthPicYuvTrueOrg->create( m_iSourceWidth, m_iSourceHeight, CHROMA_420, m_uiMaxCUWidth, m_uiMaxCUHeight, m_uiMaxTotalCUDepth, false );
    1480  
    1481   TVideoIOYuv* depthVideoFile = new TVideoIOYuv;
    1482  
    1483   UInt uiMaxDepthValue = ((1 << m_inputBitDepth[CHANNEL_TYPE_LUMA])-1);
    1484  
    1485   std::vector<Bool> abValidDepths(256, false);
    1486  
    1487   depthVideoFile->open( m_pchInputFileList[layer], false, m_inputBitDepth, m_MSBExtendedBitDepth, m_internalBitDepth );
    1488  
    1489   Int iHeight   = pcDepthPicYuvOrg->getHeight(COMPONENT_Y);
    1490   Int iWidth    = pcDepthPicYuvOrg->getWidth(COMPONENT_Y);
    1491   Int iStride   = pcDepthPicYuvOrg->getStride(COMPONENT_Y);
    1492  
    1493   Pel* pInDM    = pcDepthPicYuvOrg->getAddr(COMPONENT_Y);
    1494  
    1495   for(Int uiFrame=0; uiFrame < uiNumFrames; uiFrame++ )
    1496   {
    1497     depthVideoFile->read( pcDepthPicYuvOrg, pcDepthPicYuvTrueOrg, IPCOLOURSPACE_UNCHANGED, m_aiPad, m_InputChromaFormatIDC, m_bClipInputVideoToRec709Range );
    1498    
    1499     // check all pixel values
    1500     for (Int i=0; i<iHeight; i++)
    1501     {
    1502       Int rowOffset = i*iStride;
    1503      
    1504       for (Int j=0; j<iWidth; j++)
    1505       {
    1506         Pel depthValue = pInDM[rowOffset+j];
    1507         abValidDepths[depthValue] = true;
    1508       }
    1509     }
    1510   }
    1511  
    1512   depthVideoFile->close();
    1513   delete depthVideoFile;
    1514  
    1515   pcDepthPicYuvOrg->destroy();
    1516   delete pcDepthPicYuvOrg;
    1517   pcDepthPicYuvTrueOrg->destroy();
    1518   delete pcDepthPicYuvTrueOrg;
    1519  
    1520   // convert boolean array to idx2Depth LUT
    1521   std::vector<Int> aiIdx2DepthValue(256, 0);
    1522   Int iNumDepthValues = 0;
    1523   for(Int p=0; p<=uiMaxDepthValue; p++)
    1524   {
    1525     if( abValidDepths[p] == true)
    1526     {
    1527       aiIdx2DepthValue[iNumDepthValues++] = p;
    1528     }
    1529   }
    1530  
    1531   if( uiNumFrames == 0 || gCeilLog2(iNumDepthValues) == m_inputBitDepth[CHANNEL_TYPE_LUMA] )
    1532   {
    1533     dlt->setUseDLTFlag(layer, false);
    1534   }
    1535  
    1536   // assign LUT
    1537   if( dlt->getUseDLTFlag(layer) )
    1538   {
    1539     dlt->setDepthLUTs(layer, aiIdx2DepthValue, iNumDepthValues);
    1540   }
    1541 }
    1542 #endif
    15431153
    15441154#if NH_MV
     
    15701180
    15711181
    1572 #if NH_3D
    1573   vps.initViewCompLayer( );
    1574 #endif
    15751182}
    15761183
     
    16491256      Int curLayerIdInNuh = vps.getLayerIdInNuh( curLayerIdInVps );     
    16501257      Int maxTid = -1;
    1651 #if NH_3D
    1652       if ( vps.getDirectDependencyFlag( curLayerIdInVps, refLayerIdInVps ) )
    1653       {
    1654         if ( m_depthFlag[ curLayerIdInVps] == m_depthFlag[ refLayerIdInVps ] )
    1655         {
    1656 #endif
    16571258          for( Int i = 0; i < ( getGOPSize() + 1); i++ )
    16581259          {       
     
    16611262            for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++)
    16621263            {
    1663 #if NH_3D
    1664               if ( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[ j ] ) == refLayerIdInNuh )
    1665 #else
    16661264              if ( vps.getIdDirectRefLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[ j ] ) == refLayerIdInNuh )
    1667 #endif
    16681265              {
    16691266                Bool refLayerZero   = ( i == getGOPSize() ) && ( refLayerIdInVps == 0 );
     
    16721269            }
    16731270          }             
    1674 #if NH_3D
    1675         }
    1676         else
    1677         {       
    1678           if( m_depthFlag[ curLayerIdInVps ] && ( m_mpiFlag|| m_qtPredFlag || m_intraContourFlag ) )
    1679           {         
    1680             Int nuhLayerIdTex = vps.getLayerIdInNuh( vps.getViewIndex( curLayerIdInNuh ), false, 0 );
    1681             if ( nuhLayerIdTex == refLayerIdInNuh )
    1682             {
    1683               for( Int i = 0; i < ( getGOPSize() + 1); i++ )
    1684               {       
    1685                 GOPEntry geCur =  m_GOPListMvc[curLayerIdInVps][( i < getGOPSize()  ? i : MAX_GOP )];
    1686                 GOPEntry geRef =  m_GOPListMvc[refLayerIdInVps][( i < getGOPSize()  ? i : MAX_GOP )];
    1687                 if ( geCur.m_interCompPredFlag )
    1688                 {
    1689                   Bool refLayerZero   = ( i == getGOPSize() ) && ( refLayerIdInVps == 0 );
    1690                   maxTid = std::max( maxTid, refLayerZero ? 0 : geRef.m_temporalId );
    1691                 }
    1692               }
    1693             }
    1694           }
    1695           if( !m_depthFlag[ curLayerIdInVps ] && vps.getNumRefListLayers( curLayerIdInNuh) > 0  && ( m_depthRefinementFlag || m_viewSynthesisPredFlag || m_depthBasedBlkPartFlag ) )
    1696           {             
    1697             for( Int i = 0; i < ( getGOPSize() + 1); i++ )
    1698             {       
    1699               GOPEntry geCur =  m_GOPListMvc[curLayerIdInVps][( i < getGOPSize()  ? i : MAX_GOP )];
    1700               GOPEntry geRef =  m_GOPListMvc[refLayerIdInVps][( i < getGOPSize()  ? i : MAX_GOP )];
    1701 
    1702               if ( geCur.m_interCompPredFlag )
    1703               {
    1704                 for (Int j = 0; j < geCur.m_numActiveRefLayerPics; j++ )
    1705                 {
    1706                   Int nuhLayerIdDep = vps.getLayerIdInNuh( vps.getViewIndex( vps.getIdRefListLayer( curLayerIdInNuh, geCur.m_interLayerPredLayerIdc[j] ) ), true, 0 );
    1707                   if ( nuhLayerIdDep == refLayerIdInNuh )
    1708                   {
    1709                     Bool refLayerZero   = ( i == getGOPSize() ) && ( refLayerIdInVps == 0 );
    1710                     maxTid = std::max( maxTid, refLayerZero ? 0 : geRef.m_temporalId );
    1711                   }
    1712                 }
    1713               }
    1714             }
    1715           }       
    1716         }
    1717       } // if ( vps.getDirectDependencyFlag( curLayerIdInVps, refLayerIdInVps ) )
    1718       vps.setMaxTidIlRefPicsPlus1( refLayerIdInVps, curLayerIdInVps, maxTid + 1 );
    1719 #endif
    17201271    }  // Loop curLayerIdInVps
    17211272  } // Loop refLayerIdInVps
     
    17661317     
    17671318      // check if all reference layers when allRefLayerActiveFlag is equal to 1 are reference layer pictures specified in the gop entry
    1768 #if NH_3D
    1769       for (Int k = 0; k < vps.getNumRefListLayers( layerIdInNuh ) && allRefLayersActiveFlag; k++ )
    1770       {
    1771         Int refLayerIdInVps = vps.getLayerIdInVps( vps.getIdRefListLayer( layerIdInNuh , k ) );
    1772 #else
    17731319      for (Int k = 0; k < vps.getNumDirectRefLayers( layerIdInNuh ) && allRefLayersActiveFlag; k++ )
    17741320      {
    17751321        Int refLayerIdInVps = vps.getLayerIdInVps( vps.getIdDirectRefLayer( layerIdInNuh , k ) );
    1776 #endif
    17771322        if ( vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId  && ( tId == 0 || vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId )  )
    17781323        {
     
    17921337      {   
    17931338        Bool referenceLayerFoundFlag = false;
    1794 #if NH_3D
    1795         for (Int k = 0; k < vps.getNumRefListLayers( layerIdInNuh ); k++ )
    1796         {
    1797           Int refLayerIdInVps = vps.getLayerIdInVps( vps.getIdRefListLayer( layerIdInNuh, k) );
    1798 #else
    17991339        for (Int k = 0; k < vps.getNumDirectRefLayers( layerIdInNuh ); k++ )
    18001340        {
    18011341          Int refLayerIdInVps = vps.getLayerIdInVps( vps.getIdDirectRefLayer( layerIdInNuh, k) );
    1802 #endif
    18031342          if ( vps.getSubLayersVpsMaxMinus1(refLayerIdInVps) >= tId  && ( tId == 0 || vps.getMaxTidIlRefPicsPlus1(refLayerIdInVps,layerIdInVps) > tId )  )
    18041343          {         
     
    19291468    break;
    19301469  case Profile::MULTIVIEWMAIN:
    1931 #if NH_3D
    1932   case Profile::MAIN3D:
    1933 #endif
    19341470    ptl->setMax12bitConstraintFlag      ( true  );
    19351471    ptl->setMax12bitConstraintFlag      ( true  );
     
    19531489
    19541490  Bool anyDepth = false;
    1955 #if NH_3D
    1956   for ( Int i = 0; i < m_numberOfLayers; i++ )
    1957   {
    1958     vps.setVpsRepFormatIdx( i, m_depthFlag[ i ] ? 1 : 0 );
    1959     anyDepth = anyDepth || m_depthFlag[ i ];
    1960   }
    1961 #endif
    19621491
    19631492  vps.setRepFormatIdxPresentFlag( anyDepth );
     
    23641893}
    23651894
    2366 #if NH_3D
    2367 Void TAppEncTop::xSetCamPara                ( TComVPS& vps )
    2368 {
    2369   vps.setCpPrecision( m_cCameraData.getCamParsCodedPrecision());
    2370 
    2371   for ( Int n = 1; n < vps.getNumViews(); n++ )
    2372   { 
    2373     Int i      = vps.getViewOIdxList( n );
    2374     Int iInVps = vps.getVoiInVps    ( i );
    2375     vps.setNumCp( iInVps,  n);   
    2376 
    2377     if ( vps.getNumCp( iInVps ) > 0 )
    2378     {
    2379       vps.setCpInSliceSegmentHeaderFlag( iInVps, m_cCameraData.getVaryingCameraParameters() );
    2380 
    2381       for( Int m = 0; m < vps.getNumCp( iInVps ); m++ )
    2382       {
    2383         vps.setCpRefVoi( iInVps, m, vps.getViewOIdxList( m ) );
    2384         if( !vps.getCpInSliceSegmentHeaderFlag( iInVps ) )
    2385         {
    2386           Int j = vps.getCpRefVoi( iInVps, m );
    2387           Int jInVps = vps.getVoiInVps( j );         
    2388 
    2389           vps.setVpsCpScale   ( iInVps, jInVps, m_cCameraData.getCodedScale() [ jInVps ][ iInVps ] ) ;
    2390           vps.setVpsCpInvScale( iInVps, jInVps, m_cCameraData.getCodedScale() [ iInVps ][ jInVps ] ) ;
    2391           vps.setVpsCpOff     ( iInVps, jInVps, m_cCameraData.getCodedOffset()[ jInVps ][ iInVps ] ) ;
    2392           vps.setVpsCpInvOff  ( iInVps, jInVps, m_cCameraData.getCodedOffset()[ iInVps ][ jInVps ] ) ;
    2393         }
    2394       }
    2395     }
    2396   }
    2397   vps.deriveCpPresentFlag();
    2398 }
    2399 #endif
    24001895
    24011896
     
    24091904
    24101905
    2411 #if NH_3D_DLT
    2412 Void TAppEncTop::xDeriveDltArray( TComVPS& vps, TComDLT* dlt )
    2413 {
    2414   Int  iNumDepthViews  = 0;
    2415   Bool bDltPresentFlag = false;
    2416 
    2417   for ( Int layer = 0; layer <= vps.getMaxLayersMinus1(); layer++ )
    2418   {
    2419     Bool isDepth = ( vps.getDepthId( layer ) == 1 );
    2420 
    2421     if ( isDepth )
    2422     {
    2423       iNumDepthViews++;
    2424     }
    2425 
    2426     dlt->setUseDLTFlag( layer , isDepth && m_useDLT );
    2427     if( dlt->getUseDLTFlag( layer ) )
    2428     {
    2429       xAnalyzeInputBaseDepth(layer, max(m_iIntraPeriod[layer], 24), &vps, dlt);
    2430       bDltPresentFlag = bDltPresentFlag || dlt->getUseDLTFlag(layer);
    2431       dlt->setInterViewDltPredEnableFlag(layer, (dlt->getUseDLTFlag(layer) && (layer>1)));
    2432      
    2433       // ----------------------------- determine whether to use bit-map -----------------------------
    2434       Bool bDltBitMapRepFlag       = false;
    2435       UInt uiNumBitsNonBitMap      = 0;
    2436       UInt uiNumBitsBitMap         = 0;
    2437      
    2438       UInt uiMaxDiff               = 0;
    2439       UInt uiMinDiff               = MAX_INT;
    2440       UInt uiLengthMinDiff         = 0;
    2441       UInt uiLengthDltDiffMinusMin = 0;
    2442      
    2443       std::vector<Int> aiIdx2DepthValue_coded(256, 0);
    2444       UInt uiNumDepthValues_coded = 0;
    2445      
    2446       uiNumDepthValues_coded = dlt->getNumDepthValues(layer);
    2447       for( UInt ui = 0; ui<uiNumDepthValues_coded; ui++ )
    2448       {
    2449         aiIdx2DepthValue_coded[ui] = dlt->idx2DepthValue(layer, ui);
    2450       }
    2451      
    2452       if( dlt->getInterViewDltPredEnableFlag( layer ) )
    2453       {
    2454         AOF( vps.getDepthId( 1 ) == 1 );
    2455         AOF( layer > 1 );
    2456         // assumes ref layer id to be 1
    2457         std::vector<Int> piRefDLT = dlt->idx2DepthValue( 1 );
    2458         UInt uiRefNum = dlt->getNumDepthValues( 1 );
    2459         dlt->getDeltaDLT(layer, piRefDLT, uiRefNum, aiIdx2DepthValue_coded, uiNumDepthValues_coded);
    2460       }
    2461      
    2462       std::vector<UInt> puiDltDiffValues(uiNumDepthValues_coded, 0);
    2463      
    2464       for (UInt d = 1; d < uiNumDepthValues_coded; d++)
    2465       {
    2466         puiDltDiffValues[d] = aiIdx2DepthValue_coded[d] - aiIdx2DepthValue_coded[d-1];
    2467        
    2468         if ( uiMaxDiff < puiDltDiffValues[d] )
    2469         {
    2470           uiMaxDiff = puiDltDiffValues[d];
    2471         }
    2472        
    2473         if ( uiMinDiff > puiDltDiffValues[d] )
    2474         {
    2475           uiMinDiff = puiDltDiffValues[d];
    2476         }
    2477       }
    2478      
    2479       // counting bits
    2480       // diff coding branch
    2481       uiNumBitsNonBitMap += 8;                          // u(v) bits for num_depth_values_in_dlt[layerId] (i.e. num_entry[ layerId ])
    2482      
    2483       if ( uiNumDepthValues_coded > 1 )
    2484       {
    2485         uiNumBitsNonBitMap += 8;                        // u(v) bits for max_diff[ layerId ]
    2486       }
    2487      
    2488       if ( uiNumDepthValues_coded > 2 )
    2489       {
    2490         uiLengthMinDiff    = (UInt) gCeilLog2(uiMaxDiff + 1);
    2491         uiNumBitsNonBitMap += uiLengthMinDiff;          // u(v)  bits for min_diff[ layerId ]
    2492       }
    2493      
    2494       uiNumBitsNonBitMap += 8;                          // u(v) bits for dlt_depth_value0[ layerId ]
    2495      
    2496       if (uiMaxDiff > uiMinDiff)
    2497       {
    2498         uiLengthDltDiffMinusMin = (UInt) gCeilLog2(uiMaxDiff - uiMinDiff + 1);
    2499         uiNumBitsNonBitMap += uiLengthDltDiffMinusMin * (uiNumDepthValues_coded - 1);  // u(v) bits for dlt_depth_value_diff_minus_min[ layerId ][ j ]
    2500       }
    2501      
    2502       // bit map branch
    2503       uiNumBitsBitMap = 1 << m_inputBitDepth[CHANNEL_TYPE_LUMA];
    2504      
    2505       // determine bDltBitMapFlag
    2506       bDltBitMapRepFlag = (uiNumBitsBitMap > uiNumBitsNonBitMap) ? false : true;
    2507      
    2508       dlt->setUseBitmapRep(layer, bDltBitMapRepFlag);
    2509     }
    2510   }
    2511 
    2512   dlt->setDltPresentFlag( bDltPresentFlag );
    2513   dlt->setNumDepthViews ( iNumDepthViews  );
    2514   dlt->setDepthViewBitDepth( m_inputBitDepth[CHANNEL_TYPE_LUMA] );
    2515 }
    2516 #endif
    25171906//! \}
  • branches/HTM-15.2-dev1/source/App/TAppEncoder/TAppEncTop.h

    r1373 r1384  
    4646#include "TLibCommon/AccessUnit.h"
    4747#include "TAppEncCfg.h"
    48 #if NH_3D_VSO
    49 #include "../../Lib/TLibRenderer/TRenTop.h"
    50 #endif
    5148
    52 #if KWU_RC_MADPRED_E0227
    53 class TEncTop;
    54 #endif
    5549//! \ingroup TAppEncoder
    5650//! \{
     
    9084#endif
    9185
    92 #if NH_3D
    93   TComSps3dExtension         m_sps3dExtension;              ///< Currently all layers share the same sps 3D Extension 
    94 #endif
    9586
    9687  UInt m_essentialBytes;
    9788  UInt m_totalBytes;
    98 #if NH_3D_VSO
    99   TRenTop                     m_cRendererTop;
    100   TRenModel                   m_cRendererModel;   
    101 #endif
    10289protected:
    10390  // initialization
     
    144131  Void xSetDpbSize                ( TComVPS& vps );
    145132  Void xSetVPSVUI                 ( TComVPS& vps );
    146 #if NH_3D
    147   Void xSetCamPara                ( TComVPS& vps );
    148 #endif
    149133  GOPEntry* xGetGopEntry( Int layerIdInVps, Int poc );
    150134  Int  xGetMax( std::vector<Int>& vec);
    151135  Bool xLayerIdInTargetEncLayerIdList( Int nuhLayerId );
    152 #endif
    153 #if NH_3D_DLT
    154   Void xDeriveDltArray( TComVPS& vps, TComDLT* dlt );
    155   Void xAnalyzeInputBaseDepth(UInt layer, UInt uiNumFrames, TComVPS* vps, TComDLT* dlt);
    156136#endif
    157137
Note: See TracChangeset for help on using the changeset viewer.