Ignore:
Timestamp:
25 Sep 2015, 06:51:14 (9 years ago)
Author:
chen
Message:

Commit the integration of 3D depth representation information SEI on behalf of Nokia.

by Yi-Wen Chen (yiwen.chen@…)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-15.1-dev0-Nokia/source/Lib/TLibDecoder/SEIread.cpp

    r1337 r1339  
    360360      xParseSEIThreeDimensionalReferenceDisplaysInfo((SEIThreeDimensionalReferenceDisplaysInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
    361361      break;
    362 #if NH_MV_SEI_TBD
     362#if SEI_DRI_F0169
    363363    case SEI::DEPTH_REPRESENTATION_INFO:
    364       sei = new SEIDepthRepresentationInfo;
    365       xParseSEIDepthRepresentationInfo((SEIDepthRepresentationInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
    366       break;
     364        sei = new SEIDepthRepresentationInfo;
     365        xParseSEIDepthRepresentationInfo((SEIDepthRepresentationInfo&) *sei, payloadSize, pDecodedMessageOutputStream );
     366        break;
    367367#endif
    368368    case SEI::MULTIVIEW_SCENE_INFO:
     
    14741474};
    14751475
    1476 #if NH_MV_SEI_TBD
     1476#if SEI_DRI_F0169
     1477Void SEIReader::xParseSEIDepthRepInfoElement(double& f,std::ostream *pDecodedMessageOutputStream)
     1478{
     1479    UInt val;
     1480    UInt x_sign,x_mantissa_len,x_mantissa;
     1481    Int x_exp;
     1482
     1483    sei_read_flag(pDecodedMessageOutputStream,     val,"da_sign_flag");  x_sign = val ? 1 : 0 ;
     1484    sei_read_code(pDecodedMessageOutputStream,  7, val, "da_exponent" );         x_exp = val-31;
     1485    sei_read_code(pDecodedMessageOutputStream,  5, val, "da_mantissa_len_minus1" );         x_mantissa_len = val+1;
     1486    sei_read_code(pDecodedMessageOutputStream,  x_mantissa_len, val, "da_mantissa" );         x_mantissa = val;
     1487    if (x_mantissa_len>=16)
     1488    {
     1489        f =1.0 +  (x_mantissa*1.0)/(1u<<(x_mantissa_len-16))/(256.0*256.0 );
     1490    }else
     1491    {
     1492        f =1.0 +  (x_mantissa*1.0)/(1u<<x_mantissa_len);
     1493    }
     1494    double m=1.0;
     1495    int i;
     1496    if (x_exp<0)
     1497    {
     1498        for(i=0;i<-x_exp;i++)
     1499            m = m * 2;
     1500
     1501        f = f/m;
     1502    }
     1503    else
     1504    {
     1505        for(i=0;i<x_exp;i++)
     1506            m = m * 2;
     1507
     1508        f= f * m;
     1509    }
     1510    if (x_sign==1)
     1511    {
     1512        f= -f;
     1513    }
     1514};
     1515
    14771516Void SEIReader::xParseSEIDepthRepresentationInfo(SEIDepthRepresentationInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    14781517{
    1479   UInt code;
    1480   output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    1481 
    1482   sei_read_flag( pDecodedMessageOutputStream, code, "z_near_flag" ); sei.m_zNearFlag = (code == 1);
    1483   sei_read_flag( pDecodedMessageOutputStream, code, "z_far_flag" ); sei.m_zFarFlag = (code == 1);
    1484   sei_read_flag( pDecodedMessageOutputStream, code, "d_min_flag" ); sei.m_dMinFlag = (code == 1);
    1485   sei_read_flag( pDecodedMessageOutputStream, code, "d_max_flag" ); sei.m_dMaxFlag = (code == 1);
    1486   sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_representation_type" ); sei.m_depthRepresentationType = code;
    1487   if( sei.m_dMinFlag  | |  sei.m_dMaxFlag )
    1488   {
    1489     sei_read_uvlc( pDecodedMessageOutputStream, code, "disparity_ref_view_id" ); sei.m_disparityRefViewId = code;
    1490   }
    1491   if( sei.m_zNearFlag )
    1492   {
    1493     DepthRepInfoElement(() ZNearSign, ZNearExp, ZNearMantissa, ZNearManLen );
    1494   }
    1495   if( sei.m_zFarFlag )
    1496   {
    1497     DepthRepInfoElement(() ZFarSign, ZFarExp, ZFarMantissa, ZFarManLen );
    1498   }
    1499   if( sei.m_dMinFlag )
    1500   {
    1501     DepthRepInfoElement(() DMinSign, DMinExp, DMinMantissa, DMinManLen );
    1502   }
    1503   if( sei.m_dMaxFlag )
    1504   {
    1505     DepthRepInfoElement(() DMaxSign, DMaxExp, DMaxMantissa, DMaxManLen );
    1506   }
    1507   if( sei.m_depthRepresentationType  ==  3 )
    1508   {
    1509     sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_nonlinear_representation_num_minus1" ); sei.m_depthNonlinearRepresentationNumMinus1 = code;
    1510     for( Int i = 1; i  <=  sei.m_depthNonlinearRepresentationNumMinus1 + 1; i++ )
    1511     {
    1512       DepthNonlinearRepresentationModel( i );
    1513     }
    1514   }
    1515 };
    1516 
    1517 Void SEIReader::xParseSEIDepthRepInfoElement(SEIDepthRepInfoElement& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
    1518 {
    1519   UInt code;
    1520   output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
    1521 
    1522   sei_read_flag( pDecodedMessageOutputStream, code, "da_sign_flag" ); sei.m_daSignFlag = (code == 1);
    1523   sei_read_code( pDecodedMessageOutputStream, 7, code, "da_exponent" ); sei.m_daExponent = code;
    1524   sei_read_code( pDecodedMessageOutputStream, 5, code, "da_mantissa_len_minus1" ); sei.m_daMantissaLenMinus1 = code;
    1525   sei_read_code( pDecodedMessageOutputStream, getDaMantissaLen ), code, "da_mantissa" ); sei.m_daMantissa = code;
    1526 };
     1518    UInt code;
     1519    double zNear,zFar,dMin,dMax;
     1520    bool zNearFlag,zFarFlag,dMinFlag,dMaxFlag;
     1521    int depth_representation_type,disparityRefViewId,depthNonlinearRepresentationNumMinus1;
     1522    std::vector<int> DepthNonlinearRepresentationModel;
     1523
     1524    sei.clear();
     1525
     1526    output_sei_message_header(sei, pDecodedMessageOutputStream, payloadSize);
     1527
     1528    sei_read_flag( pDecodedMessageOutputStream, code, "z_near_flag" );    zNearFlag  = (code == 1);
     1529    sei_read_flag( pDecodedMessageOutputStream, code, "z_far_flag" );     zFarFlag = (code == 1);
     1530    sei_read_flag( pDecodedMessageOutputStream, code, "d_min_flag" );     dMinFlag = (code == 1);
     1531    sei_read_flag( pDecodedMessageOutputStream, code, "d_max_flag" );     dMaxFlag = (code == 1);
     1532    sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_representation_type" ); depth_representation_type = code;
     1533
     1534    sei.m_zNearFlag.push_back(zNearFlag);
     1535    sei.m_zFarFlag.push_back(zFarFlag);
     1536    sei.m_dMinFlag.push_back(dMinFlag);
     1537    sei.m_dMaxFlag.push_back(dMaxFlag);
     1538
     1539    sei.m_depthRepresentationType.push_back(IntAry1d(1,depth_representation_type));
     1540
     1541    if( dMinFlag  ||  dMaxFlag )
     1542    {
     1543        sei_read_uvlc( pDecodedMessageOutputStream, code, "disparity_ref_view_id" ); disparityRefViewId = code;
     1544        sei.m_disparityRefViewId.push_back(IntAry1d(1,disparityRefViewId));
     1545    }
     1546    if( zNearFlag )
     1547    {
     1548        xParseSEIDepthRepInfoElement(zNear , pDecodedMessageOutputStream);
     1549        sei.m_zNear.push_back(std::vector<double>(1,zNear));
     1550    }
     1551    if( zFarFlag )
     1552    {
     1553        xParseSEIDepthRepInfoElement(zFar , pDecodedMessageOutputStream);
     1554        sei.m_zFar.push_back(std::vector<double>(1,zFar));
     1555    }
     1556    if( dMinFlag )
     1557    {
     1558        xParseSEIDepthRepInfoElement(dMin , pDecodedMessageOutputStream);
     1559        sei.m_dMin.push_back(std::vector<double>(1,dMin));
     1560    }
     1561    if( dMaxFlag )
     1562    {
     1563        xParseSEIDepthRepInfoElement(dMax , pDecodedMessageOutputStream);
     1564        sei.m_dMax.push_back(std::vector<double>(1,dMax));
     1565    }
     1566    if( depth_representation_type  ==  3 )
     1567    {
     1568        sei_read_uvlc( pDecodedMessageOutputStream, code, "depth_nonlinear_representation_num_minus1" ); depthNonlinearRepresentationNumMinus1 = code;
     1569        sei.m_depthNonlinearRepresentationNumMinus1.push_back(IntAry1d(1,depthNonlinearRepresentationNumMinus1));
     1570        for( Int i = 1; i  <=  depthNonlinearRepresentationNumMinus1 + 1; i++ )
     1571        {
     1572            sei_read_uvlc(pDecodedMessageOutputStream,code,"DepthNonlinearRepresentationModel" ) ;
     1573            DepthNonlinearRepresentationModel.push_back(code);
     1574        }
     1575
     1576        sei.m_depth_nonlinear_representation_model.push_back(DepthNonlinearRepresentationModel);
     1577    }
     1578}
    15271579#endif
    15281580Void SEIReader::xParseSEIMultiviewSceneInfo(SEIMultiviewSceneInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
Note: See TracChangeset for help on using the changeset viewer.