Changeset 1037 in SHVCSoftware
- Timestamp:
- 27 Feb 2015, 21:05:56 (10 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1030 r1037 1688 1688 ("SEIMasteringDisplayWhitePoint", cfg_DisplayWhitePointCode, cfg_DisplayWhitePointCode, "Mastering display white point CIE xy coordinates in normalised increments of 1/50000 (e.g. 0.333 = 16667)") 1689 1689 1690 #if P0123_ALPHA_CHANNEL_SEI 1691 ("SEIAlphaChannelInfo", m_alphaSEIEnabled, false, "Enables transmission of information associated with alpha channel (default : 0)") 1692 ("SEIAlphaCancelFlag", m_alphaCancelFlag, true, "Denotes that this SEI message cancels the persistence of any previously received alpha channel SEI message (default : 1)") 1693 ("SEIAlphaUseIdc", m_alphaUseIdc, 2, "Denotes the use of the received alpha channel in final picture composition (e.g. pre-multiplied alpha, default : 2)") 1694 ("SEIAlphaBitDepthMinus8", m_alphaBitDepthMinus8, 0, "Denotes the bit depth associated with the received alpha channel (default : 0)") 1695 ("SEIAlphaTransparentValue", m_alphaTransparentValue, 0, "Denotes the sample value which is considered transparent for alpha blending purposes (default : 0)") 1696 ("SEIAlphaOpaqueValue", m_alphaOpaqueValue, 255, "Denotes the sample value which is considered opaque for alpha blending purposes (default : 255)") 1697 ("SEIAlphaIncrementFlag", m_alphaIncrementFlag, false, "Denotes whether the sample values should be incremented by one for the purposes of alpha blending (default : 0)") 1698 ("SEIAlphaClipFlag", m_alphaClipFlag, false, "Denotes whether clipping is applied to the sample values (default : 0)") 1699 ("SEIAlphaClipType", m_alphaClipTypeFlag, false, "Denotes the type of clipping applied to the sample values (0 = binary, 1 = linear, default : 0)") 1700 #endif 1690 1701 #if Q0096_OVERLAY_SEI 1691 1702 ("SEIOverlayInfo", m_overlaySEIEnabled, false, "Control generation of Selectable Overlays SEI messages") … … 4473 4484 } 4474 4485 4486 #if P0123_ALPHA_CHANNEL_SEI 4487 if( m_alphaSEIEnabled && !m_alphaCancelFlag ) 4488 { 4489 xConfirmPara(0 < m_alphaUseIdc || m_alphaUseIdc > 2, "SEIAlphaUseIdc greater than 2 is reserved for future use by ITU-T | ISO/IEC"); 4490 xConfirmPara(m_alphaBitDepthMinus8 < 0 || m_alphaBitDepthMinus8 > 7, "SEIAlphaBitDepthMinus8 shall be in the range 0 to 7 inclusive"); 4491 } 4492 #endif 4475 4493 #if Q0096_OVERLAY_SEI 4476 4494 if( m_overlaySEIEnabled && !m_overlayInfoCancelFlag ) -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1029 r1037 436 436 Int m_layersNotPresentSEIEnabled; 437 437 #endif 438 438 #if P0123_ALPHA_CHANNEL_SEI 439 Bool m_alphaSEIEnabled; 440 Bool m_alphaCancelFlag; 441 Int m_alphaUseIdc; 442 Int m_alphaBitDepthMinus8; 443 Int m_alphaTransparentValue; 444 Int m_alphaOpaqueValue; 445 Bool m_alphaIncrementFlag; 446 Bool m_alphaClipFlag; 447 Bool m_alphaClipTypeFlag; 448 #endif 439 449 #if SVC_EXTENSION 440 450 #if FAST_INTRA_SHVC -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1031 r1037 612 612 m_acTEncTop[layer].setKneeSEIOutputKneePoint ( m_kneeSEIOutputKneePoint ); 613 613 m_acTEncTop[layer].setMasteringDisplaySEI ( m_masteringDisplay ); 614 #if P0123_ALPHA_CHANNEL_SEI 615 m_acTEncTop[layer].setAlphaSEIEnabled ( m_alphaSEIEnabled ); 616 m_acTEncTop[layer].setAlphaCancelFlag ( m_alphaCancelFlag ); 617 m_acTEncTop[layer].setAlphaUseIdc ( m_alphaUseIdc ); 618 m_acTEncTop[layer].setAlphaBitDepthMinus8 ( m_alphaBitDepthMinus8 ); 619 m_acTEncTop[layer].setAlphaTransparentValue ( m_alphaTransparentValue ); 620 m_acTEncTop[layer].setAlphaOpaqueValue ( m_alphaOpaqueValue ); 621 m_acTEncTop[layer].setAlphaIncrementFlag ( m_alphaIncrementFlag ); 622 m_acTEncTop[layer].setAlphaClipFlag ( m_alphaClipFlag ); 623 m_acTEncTop[layer].setAlphaClipTypeFlag ( m_alphaClipTypeFlag ); 624 #endif 614 625 #if Q0096_OVERLAY_SEI 615 626 m_acTEncTop[layer].setOverlaySEIEnabled ( m_overlaySEIEnabled ); -
branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
r1029 r1037 162 162 case SEI::OVERLAY_INFO: return "Overlay Information"; 163 163 #endif 164 #if P0123_ALPHA_CHANNEL_SEI 165 case SEI::ALPHA_CHANNEL_INFO: return "Alpha Channel Information"; 166 #endif 164 167 #endif 165 168 default: return "Unknown"; -
branches/SHM-dev/source/Lib/TLibCommon/SEI.h
r1029 r1037 121 121 #endif 122 122 #if Q0096_OVERLAY_SEI 123 OVERLAY_INFO = 153, 123 OVERLAY_INFO = 153, 124 #endif 125 #if P0123_ALPHA_CHANNEL_SEI 126 ALPHA_CHANNEL_INFO = 165, 124 127 #endif 125 128 }; … … 670 673 #endif 671 674 675 #if P0123_ALPHA_CHANNEL_SEI 676 class SEIAlphaChannelInfo : public SEI 677 { 678 public: 679 PayloadType payloadType() const { return ALPHA_CHANNEL_INFO; } 680 SEIAlphaChannelInfo() {} 681 virtual ~SEIAlphaChannelInfo() {} 682 Bool m_alphaChannelCancelFlag; 683 UInt m_alphaChannelUseIdc; 684 UInt m_alphaChannelBitDepthMinus8; 685 UInt m_alphaTransparentValue; 686 UInt m_alphaOpaqueValue; 687 Bool m_alphaChannelIncrFlag; 688 Bool m_alphaChannelClipFlag; 689 Bool m_alphaChannelClipTypeFlag; 690 }; 691 #endif 692 672 693 #if Q0096_OVERLAY_SEI 673 694 class SEIOverlayInfo : public SEI -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1031 r1037 341 341 # define MAX_OVERLAY_STRING_BYTES 256 342 342 #endif 343 #define P0123_ALPHA_CHANNEL_SEI 1 ///< JCTVC-P0123: SEI message for alpha channel information 343 344 344 345 #endif // SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r1029 r1037 383 383 break; 384 384 #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 385 391 #if Q0096_OVERLAY_SEI 386 392 case SEI::OVERLAY_INFO: … … 390 396 #endif 391 397 #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; 405 410 } 406 411 } … … 1874 1879 } 1875 1880 1881 #endif 1882 1883 #if P0123_ALPHA_CHANNEL_SEI 1884 void 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 } 1876 1902 #endif 1877 1903 -
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.h
r1029 r1037 154 154 Void xParseSEIFrameFieldInfo (SEIFrameFieldInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 155 155 #endif 156 #if P0123_ALPHA_CHANNEL_SEI 157 Void xParseSEIAlphaChannelInfo (SEIAlphaChannelInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); 158 #endif 156 159 #if Q0096_OVERLAY_SEI 157 160 Void xParseSEIOverlayInfo (SEIOverlayInfo& sei, UInt payloadSize, std::ostream *pDecodedMessageOutputStream); -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.cpp
r1029 r1037 209 209 break; 210 210 #endif 211 #if P0123_ALPHA_CHANNEL_SEI 212 case SEI::ALPHA_CHANNEL_INFO: 213 xWriteSEIAlphaChannelInfo(*static_cast<const SEIAlphaChannelInfo*>(&sei)); 214 break; 215 #endif 211 216 #if Q0096_OVERLAY_SEI 212 217 case SEI::OVERLAY_INFO: … … 1417 1422 #endif 1418 1423 1424 #if P0123_ALPHA_CHANNEL_SEI 1425 Void SEIWriter::xWriteSEIAlphaChannelInfo(const SEIAlphaChannelInfo &sei) 1426 { 1427 WRITE_FLAG(sei.m_alphaChannelCancelFlag, "alpha_channel_cancel_flag"); 1428 if(!sei.m_alphaChannelCancelFlag) 1429 { 1430 WRITE_CODE(sei.m_alphaChannelUseIdc, 3, "alpha_channel_use_idc"); 1431 WRITE_CODE(sei.m_alphaChannelBitDepthMinus8, 3, "alpha_channel_bit_depth_minus8"); 1432 WRITE_CODE(sei.m_alphaTransparentValue, sei.m_alphaChannelBitDepthMinus8 + 9, "alpha_transparent_value"); 1433 WRITE_CODE(sei.m_alphaOpaqueValue, sei.m_alphaChannelBitDepthMinus8 + 9, "alpha_opaque_value"); 1434 WRITE_FLAG(sei.m_alphaChannelIncrFlag, "alpha_channel_incr_flag"); 1435 WRITE_FLAG(sei.m_alphaChannelClipFlag, "alpha_channel_clip_flag"); 1436 if(sei.m_alphaChannelClipFlag) 1437 { 1438 WRITE_FLAG(sei.m_alphaChannelClipTypeFlag, "alpha_channel_clip_type_flag"); 1439 } 1440 } 1441 xWriteByteAlign(); 1442 } 1443 #endif 1444 1419 1445 #if Q0096_OVERLAY_SEI 1420 1446 Void SEIWriter::xWriteSEIOverlayInfo(const SEIOverlayInfo &sei) -
branches/SHM-dev/source/Lib/TLibEncoder/SEIwrite.h
r1029 r1037 131 131 Void xWriteSEIVPSRewriting(const SEIVPSRewriting &sei); 132 132 #endif 133 #if P0123_ALPHA_CHANNEL_SEI 134 Void xWriteSEIAlphaChannelInfo(const SEIAlphaChannelInfo &sei); 135 #endif 133 136 #if Q0096_OVERLAY_SEI 134 137 Void xWriteSEIOverlayInfo(const SEIOverlayInfo &sei); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1029 r1037 415 415 #endif 416 416 #if Q0048_CGS_3D_ASYMLUT 417 Int m_nCGSFlag;418 Int m_nCGSMaxOctantDepth;419 Int m_nCGSMaxYPartNumLog2;420 Int m_nCGSLUTBit;417 Int m_nCGSFlag; 418 Int m_nCGSMaxOctantDepth; 419 Int m_nCGSMaxYPartNumLog2; 420 Int m_nCGSLUTBit; 421 421 #if R0151_CGS_3D_ASYMLUT_IMPROVE 422 Int m_nCGSAdaptiveChroma;422 Int m_nCGSAdaptiveChroma; 423 423 #endif 424 424 #if R0179_ENC_OPT_3DLUT_SIZE 425 Int m_nCGSLutSizeRDO; 426 #endif 425 Int m_nCGSLutSizeRDO; 426 #endif 427 #endif 428 #if P0123_ALPHA_CHANNEL_SEI 429 Bool m_alphaSEIEnabled; 430 Bool m_alphaCancelFlag; 431 Int m_alphaUseIdc; 432 Int m_alphaBitDepthMinus8; 433 Int m_alphaTransparentValue; 434 Int m_alphaOpaqueValue; 435 Bool m_alphaIncrementFlag; 436 Int m_alphaClipFlag; 437 Int m_alphaClipTypeFlag; 427 438 #endif 428 439 #if Q0096_OVERLAY_SEI … … 994 1005 995 1006 #if Q0189_TMVP_CONSTRAINTS 996 Void setTMVPConstraintsSEIEnabled(Int b) { m_TMVPConstraintsSEIEnabled = b; } 997 Int getTMVPConstraintsSEIEnabled() { return m_TMVPConstraintsSEIEnabled; } 998 1007 Void setTMVPConstraintsSEIEnabled(Int b) { m_TMVPConstraintsSEIEnabled = b; } 1008 Int getTMVPConstraintsSEIEnabled() { return m_TMVPConstraintsSEIEnabled; } 1009 1010 #endif 1011 #if P0123_ALPHA_CHANNEL_SEI 1012 Void setAlphaSEIEnabled(Bool b) { m_alphaSEIEnabled = b; } 1013 Bool getAlphaSEIEnabled() { return m_alphaSEIEnabled; } 1014 Void setAlphaCancelFlag(Bool b) { m_alphaCancelFlag = b; } 1015 Bool getAlphaCancelFlag() { return m_alphaCancelFlag; } 1016 Void setAlphaUseIdc(Int idc) { m_alphaUseIdc = idc; } 1017 Int getAlphaUseIdc() { return m_alphaUseIdc; } 1018 Void setAlphaBitDepthMinus8(Int d) { m_alphaBitDepthMinus8 = d; } 1019 Int getAlphaBitDepthMinus8() { return m_alphaBitDepthMinus8; } 1020 Void setAlphaTransparentValue(Int v) { m_alphaTransparentValue = v; } 1021 Int getAlphaTransparentValue() { return m_alphaTransparentValue; } 1022 Void setAlphaOpaqueValue(Int v) { m_alphaOpaqueValue = v; } 1023 Int getAlphaOpaqueValue() { return m_alphaOpaqueValue; } 1024 Void setAlphaIncrementFlag(Bool b) { m_alphaIncrementFlag = b; } 1025 Int getAlphaIncrementFlag() { return m_alphaIncrementFlag; } 1026 Void setAlphaClipFlag(Bool b) { m_alphaClipFlag = b; } 1027 Bool getAlphaClipFlag() { return m_alphaClipFlag; } 1028 Void setAlphaClipTypeFlag(Bool b) { m_alphaClipTypeFlag = b; } 1029 Bool getAlphaClipTypeFlag() { return m_alphaClipTypeFlag; } 999 1030 #endif 1000 1031 #if Q0074_COLOUR_REMAPPING_SEI -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1035 r1037 684 684 #else 685 685 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 686 #endif 687 writeRBSPTrailingBits(nalu.m_Bitstream); 688 accessUnit.push_back(new NALUnitEBSP(nalu)); 689 delete sei; 690 } 691 #endif 692 693 #if P0123_ALPHA_CHANNEL_SEI 694 if( m_pcCfg->getAlphaSEIEnabled() && m_pcEncTop->getVPS()->getScalabilityId(m_layerId, AUX_ID) && m_pcEncTop->getVPS()->getDimensionId(m_layerId, m_pcEncTop->getVPS()->getNumScalabilityTypes() - 1) == AUX_ALPHA ) 695 { 696 SEIAlphaChannelInfo *sei = xCreateSEIAlphaChannelInfo(); 697 m_pcEntropyCoder->setBitstream(&nalu.m_Bitstream); 698 #if O0164_MULTI_LAYER_HRD 699 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, m_pcEncTop->getVPS(), sps); 700 #else 701 m_seiWriter.writeSEImessage(nalu.m_Bitstream, *sei, sps); 686 702 #endif 687 703 writeRBSPTrailingBits(nalu.m_Bitstream); … … 4364 4380 } 4365 4381 4382 #if P0123_ALPHA_CHANNEL_SEI 4383 SEIAlphaChannelInfo* TEncGOP::xCreateSEIAlphaChannelInfo() 4384 { 4385 SEIAlphaChannelInfo *sei = new SEIAlphaChannelInfo(); 4386 sei->m_alphaChannelCancelFlag = m_pcCfg->getAlphaCancelFlag(); 4387 if(!sei->m_alphaChannelCancelFlag) 4388 { 4389 sei->m_alphaChannelUseIdc = m_pcCfg->getAlphaUseIdc(); 4390 sei->m_alphaChannelBitDepthMinus8 = m_pcCfg->getAlphaBitDepthMinus8(); 4391 sei->m_alphaTransparentValue = m_pcCfg->getAlphaTransparentValue(); 4392 sei->m_alphaOpaqueValue = m_pcCfg->getAlphaOpaqueValue(); 4393 sei->m_alphaChannelIncrFlag = m_pcCfg->getAlphaIncrementFlag(); 4394 sei->m_alphaChannelClipFlag = m_pcCfg->getAlphaClipFlag(); 4395 sei->m_alphaChannelClipTypeFlag = m_pcCfg->getAlphaClipTypeFlag(); 4396 } 4397 return sei; 4398 } 4399 #endif 4366 4400 #if Q0096_OVERLAY_SEI 4367 4401 SEIOverlayInfo* TEncGOP::xCreateSEIOverlayInfo() -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1029 r1037 262 262 #endif 263 263 #endif 264 #if P0123_ALPHA_CHANNEL_SEI 265 SEIAlphaChannelInfo* xCreateSEIAlphaChannelInfo(); 266 #endif 264 267 #if Q0096_OVERLAY_SEI 265 268 SEIOverlayInfo* xCreateSEIOverlayInfo();
Note: See TracChangeset for help on using the changeset viewer.