Ignore:
Timestamp:
27 Feb 2015, 21:05:56 (10 years ago)
Author:
seregin
Message:

implementation of alpha channel SEI (JCTVC-P0123) with macro P0123_ALPHA_CHANNEL_SEI, patch was provided by Matteo Naccari <Matteo.Naccari@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp

    r1029 r1037  
    383383     break;
    384384#endif
     385#if P0123_ALPHA_CHANNEL_SEI
     386   case SEI::ALPHA_CHANNEL_INFO:
     387     sei = new SEIAlphaChannelInfo;
     388     xParseSEIAlphaChannelInfo((SEIAlphaChannelInfo &) *sei, payloadSize, pDecodedMessageOutputStream);
     389     break;
     390#endif
    385391#if Q0096_OVERLAY_SEI
    386392   case SEI::OVERLAY_INFO:
     
    390396#endif
    391397#endif //SVC_EXTENSION
    392       break;
    393     default:
    394       for (UInt i = 0; i < payloadSize; i++)
    395       {
    396         UInt seiByte;
    397         sei_read_code (NULL, 8, seiByte, "unknown prefix SEI payload byte");
    398       }
    399       printf ("Unknown prefix SEI message (payloadType = %d) was found!\n", payloadType);
    400       if (pDecodedMessageOutputStream)
    401       {
    402         (*pDecodedMessageOutputStream) << "Unknown prefix SEI message (payloadType = " << payloadType << ") was found!\n";
    403       }
    404       break;
     398   default:
     399     for (UInt i = 0; i < payloadSize; i++)
     400     {
     401       UInt seiByte;
     402       sei_read_code (NULL, 8, seiByte, "unknown prefix SEI payload byte");
     403     }
     404     printf ("Unknown prefix SEI message (payloadType = %d) was found!\n", payloadType);
     405     if (pDecodedMessageOutputStream)
     406     {
     407       (*pDecodedMessageOutputStream) << "Unknown prefix SEI message (payloadType = " << payloadType << ") was found!\n";
     408     }
     409     break;
    405410    }
    406411  }
     
    18741879}
    18751880
     1881#endif
     1882
     1883#if P0123_ALPHA_CHANNEL_SEI
     1884void SEIReader::xParseSEIAlphaChannelInfo(SEIAlphaChannelInfo &sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream)
     1885{
     1886  UInt value;
     1887  sei_read_flag(pDecodedMessageOutputStream, value, "alpha_channel_cancel_flag"); sei.m_alphaChannelCancelFlag = value;
     1888  if(!sei.m_alphaChannelCancelFlag)
     1889  {
     1890    sei_read_code(pDecodedMessageOutputStream, 3, value, "alpha_channel_use_idc");          sei.m_alphaChannelUseIdc = value;
     1891    sei_read_code(pDecodedMessageOutputStream, 3, value, "alpha_channel_bit_depth_minus8"); sei.m_alphaChannelBitDepthMinus8 = value;
     1892    sei_read_code(pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8 + 9, value, "alpha_transparent_value"); sei.m_alphaTransparentValue = value;
     1893    sei_read_code(pDecodedMessageOutputStream, sei.m_alphaChannelBitDepthMinus8 + 9, value, "alpha_opaque_value"); sei.m_alphaOpaqueValue = value;
     1894    sei_read_flag(pDecodedMessageOutputStream, value, "alpha_channel_incr_flag");        sei.m_alphaChannelIncrFlag = value;
     1895    sei_read_flag(pDecodedMessageOutputStream, value, "alpha_channel_clip_flag");        sei.m_alphaChannelClipFlag = value;
     1896    if(sei.m_alphaChannelClipFlag)
     1897    {
     1898      sei_read_flag(pDecodedMessageOutputStream, value, "alpha_channel_clip_type_flag"); sei.m_alphaChannelClipTypeFlag = value;
     1899    }
     1900  } 
     1901}
    18761902#endif
    18771903
Note: See TracChangeset for help on using the changeset viewer.