Changeset 912 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
- Timestamp:
- 31 Oct 2014, 18:18:38 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibDecoder/SEIread.cpp
r900 r912 146 146 break; 147 147 #endif 148 #if Q0096_OVERLAY_SEI 149 case SEI::OVERLAY_INFO: 150 fprintf( g_hTrace, "=========== Overlay Information SEI message ===========\n"); 151 break; 152 #endif 148 153 #endif //SVC_EXTENSION 149 154 default: … … 412 417 break; 413 418 #endif 419 #if Q0096_OVERLAY_SEI 420 case SEI::OVERLAY_INFO: 421 sei = new SEIOverlayInfo; 422 xParseSEIOverlayInfo((SEIOverlayInfo&) *sei, payloadSize); 423 break; 424 #endif 414 425 #endif //SVC_EXTENSION 415 426 break; … … 1726 1737 #endif 1727 1738 1739 #if Q0096_OVERLAY_SEI 1740 Void SEIReader::xParseSEIOverlayInfo(SEIOverlayInfo& sei, UInt /*payloadSize*/){ 1741 Int i, j; 1742 UInt val; 1743 READ_FLAG( val, "overlay_info_cancel_flag" ); sei.m_overlayInfoCancelFlag = val; 1744 if ( !sei.m_overlayInfoCancelFlag ) 1745 { 1746 READ_UVLC( val, "overlay_content_aux_id_minus128" ); sei.m_overlayContentAuxIdMinus128 = val; 1747 READ_UVLC( val, "overlay_label_aux_id_minus128" ); sei.m_overlayLabelAuxIdMinus128 = val; 1748 READ_UVLC( val, "overlay_alpha_aux_id_minus128" ); sei.m_overlayAlphaAuxIdMinus128 = val; 1749 READ_UVLC( val, "overlay_element_label_value_length_minus8" ); sei.m_overlayElementLabelValueLengthMinus8 = val; 1750 READ_UVLC( val, "num_overlays_minus1" ); sei.m_numOverlaysMinus1 = val; 1751 1752 assert( sei.m_numOverlaysMinus1 < MAX_OVERLAYS ); 1753 sei.m_overlayIdx.resize( sei.m_numOverlaysMinus1+1 ); 1754 sei.m_languageOverlayPresentFlag.resize( sei.m_numOverlaysMinus1+1 ); 1755 sei.m_overlayContentLayerId.resize( sei.m_numOverlaysMinus1+1 ); 1756 sei.m_overlayLabelPresentFlag.resize( sei.m_numOverlaysMinus1+1 ); 1757 sei.m_overlayLabelLayerId.resize( sei.m_numOverlaysMinus1+1 ); 1758 sei.m_overlayAlphaPresentFlag.resize( sei.m_numOverlaysMinus1+1 ); 1759 sei.m_overlayAlphaLayerId.resize( sei.m_numOverlaysMinus1+1 ); 1760 sei.m_numOverlayElementsMinus1.resize( sei.m_numOverlaysMinus1+1 ); 1761 sei.m_overlayElementLabelMin.resize( sei.m_numOverlaysMinus1+1 ); 1762 sei.m_overlayElementLabelMax.resize( sei.m_numOverlaysMinus1+1 ); 1763 for ( i=0 ; i<=sei.m_numOverlaysMinus1 ; i++ ) 1764 { 1765 READ_UVLC( val, "overlay_idx" ); sei.m_overlayIdx[i] = val; 1766 READ_FLAG( val, "language_overlay_present_flag" ); sei.m_languageOverlayPresentFlag[i] = val; 1767 READ_CODE( 6, val, "overlay_content_layer_id"); sei.m_overlayContentLayerId[i] = val; 1768 READ_FLAG( val, "overlay_label_present_flag" ); sei.m_overlayLabelPresentFlag[i] = val; 1769 if ( sei.m_overlayLabelPresentFlag[i] ) 1770 { 1771 READ_CODE( 6, val, "overlay_label_layer_id"); sei.m_overlayLabelLayerId[i] = val; 1772 } 1773 READ_FLAG( val, "overlay_alpha_present_flag" ); sei.m_overlayAlphaPresentFlag[i] = val; 1774 if ( sei.m_overlayAlphaPresentFlag[i] ) 1775 { 1776 READ_CODE( 6, val, "overlay_alpha_layer_id"); sei.m_overlayAlphaLayerId[i] = val; 1777 } 1778 if ( sei.m_overlayLabelPresentFlag[i] ) 1779 { 1780 READ_UVLC( val, "num_overlay_elements_minus1"); sei.m_numOverlayElementsMinus1[i] = val; 1781 assert( sei.m_numOverlayElementsMinus1[i] < MAX_OVERLAY_ELEMENTS ); 1782 sei.m_overlayElementLabelMin[i].resize( sei.m_numOverlayElementsMinus1[i]+1 ); 1783 sei.m_overlayElementLabelMax[i].resize( sei.m_numOverlayElementsMinus1[i]+1 ); 1784 for ( j=0 ; j<=sei.m_numOverlayElementsMinus1[i] ; j++ ) 1785 { 1786 READ_CODE(sei.m_overlayElementLabelValueLengthMinus8 + 8, val, "overlay_element_label_min"); sei.m_overlayElementLabelMin[i][j] = val; 1787 READ_CODE(sei.m_overlayElementLabelValueLengthMinus8 + 8, val, "overlay_element_label_max"); sei.m_overlayElementLabelMax[i][j] = val; 1788 } 1789 } 1790 else 1791 { 1792 sei.m_numOverlayElementsMinus1[i] = 0; 1793 } 1794 } 1795 1796 // byte alignment 1797 while ( m_pcBitstream->getNumBitsRead() % 8 != 0 ) 1798 { 1799 READ_FLAG( val, "overlay_zero_bit" ); 1800 assert( val==0 ); 1801 } 1802 1803 UChar* sval = new UChar[MAX_OVERLAY_STRING_BYTES]; 1804 UInt slen; 1805 sei.m_overlayLanguage.resize( sei.m_numOverlaysMinus1+1, NULL ); 1806 sei.m_overlayLanguageLength.resize( sei.m_numOverlaysMinus1+1 ); 1807 sei.m_overlayName.resize( sei.m_numOverlaysMinus1+1, NULL ); 1808 sei.m_overlayNameLength.resize( sei.m_numOverlaysMinus1+1 ); 1809 sei.m_overlayElementName.resize( sei.m_numOverlaysMinus1+1 ); 1810 sei.m_overlayElementNameLength.resize( sei.m_numOverlaysMinus1+1 ); 1811 for ( i=0 ; i<=sei.m_numOverlaysMinus1 ; i++ ) 1812 { 1813 if ( sei.m_languageOverlayPresentFlag[i] ) 1814 { 1815 READ_STRING( MAX_OVERLAY_STRING_BYTES, sval, slen, "overlay_language" ); 1816 sei.m_overlayLanguage[i] = new UChar[slen]; 1817 memcpy(sei.m_overlayLanguage[i], sval, slen); 1818 sei.m_overlayLanguageLength[i] = slen; 1819 } 1820 READ_STRING( MAX_OVERLAY_STRING_BYTES, sval, slen, "overlay_name" ); 1821 sei.m_overlayName[i] = new UChar[slen]; 1822 memcpy(sei.m_overlayName[i], sval, slen); 1823 sei.m_overlayNameLength[i] = slen; 1824 if ( sei.m_overlayLabelPresentFlag[i] ) 1825 { 1826 sei.m_overlayElementName[i].resize( sei.m_numOverlayElementsMinus1[i]+1, NULL ); 1827 sei.m_overlayElementNameLength[i].resize( sei.m_numOverlayElementsMinus1[i]+1 ); 1828 for ( j=0 ; j<=sei.m_numOverlayElementsMinus1[i] ; j++) 1829 { 1830 READ_STRING( MAX_OVERLAY_STRING_BYTES, sval, slen, "overlay_element_name" ); 1831 sei.m_overlayElementName[i][j] = new UChar[slen]; 1832 memcpy(sei.m_overlayElementName[i][j], sval, slen); 1833 sei.m_overlayElementNameLength[i][j] = slen; 1834 } 1835 } 1836 } 1837 READ_FLAG( val, "overlay_info_persistence_flag" ); sei.m_overlayInfoPersistenceFlag = val; 1838 } 1839 xParseByteAlign(); 1840 } 1841 #endif 1842 1728 1843 #endif //SVC_EXTENSION 1729 1844
Note: See TracChangeset for help on using the changeset viewer.