Changeset 1442 in SHVCSoftware for branches/SHM-dev/source/Lib/TLibCommon
- Timestamp:
- 13 Aug 2015, 19:11:53 (10 years ago)
- Location:
- branches/SHM-dev/source/Lib/TLibCommon
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/Debug.cpp
r1398 r1442 49 49 #if DEBUG_STRING 50 50 // these strings are used to reorder the debug output so that the encoder and decoder match. 51 const Char *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1]51 const TChar *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1] 52 52 = {"Start of channel 0 inter debug\n", "Start of channel 1 inter debug\n", "Start of channel 2 inter debug\n", "End of inter residual debug\n"} ; 53 const Char *partSizeToString[NUMBER_OF_PART_SIZES]={"2Nx2N(0)", "2NxN(1)", "Nx2N(2)", "NxN(3)", "2Nx(N/2+3N/2)(4)", "2Nx(3N/2+N/2)(5)", "(N/2+3N/2)x2N(6)", "(3N/2+N/2)x2N(7)"};53 const TChar *partSizeToString[NUMBER_OF_PART_SIZES]={"2Nx2N(0)", "2NxN(1)", "Nx2N(2)", "NxN(3)", "2Nx(N/2+3N/2)(4)", "2Nx(3N/2+N/2)(5)", "(N/2+3N/2)x2N(6)", "(3N/2+N/2)x2N(7)"}; 54 54 #endif 55 55 … … 421 421 422 422 423 Void printBlockToStream( std::ostream &ss, const Char *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth )423 Void printBlockToStream( std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross, const UInt numSubBlocksUp, const UInt defWidth ) 424 424 { 425 425 const UInt numValidComp=src.getNumberValidComponents(); -
branches/SHM-dev/source/Lib/TLibCommon/Debug.h
r1335 r1442 48 48 49 49 #if DEBUG_STRING 50 extern const Char *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1];51 extern const Char *partSizeToString[NUMBER_OF_PART_SIZES];50 extern const TChar *debug_reorder_data_inter_token[MAX_NUM_COMPONENT+1]; 51 extern const TChar *partSizeToString[NUMBER_OF_PART_SIZES]; 52 52 #endif 53 53 … … 150 150 UInt getZScanIndex(const UInt x, const UInt y); 151 151 152 //template specialisation for Char types to get it to render as a number152 //template specialisation for SChar/UChar types to get it to render as a number 153 153 template <typename ValueType> inline Void writeValueToStream (const ValueType &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) << value; } 154 template <> inline Void writeValueToStream< Char >(const Char&value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) << Int(value); }154 template <> inline Void writeValueToStream<SChar>(const SChar &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) << Int(value); } 155 155 template <> inline Void writeValueToStream<UChar>(const UChar &value, std::ostream &stream, const UInt outputWidth) { stream << std::setw(outputWidth) << UInt(value); } 156 156 … … 232 232 233 233 template <typename T> 234 Void printBlockToStream( std::ostream &ss, const Char *pLinePrefix, const T * blkSrc, const UInt width, const UInt height, const UInt stride, const UInt subBlockWidth=0, const UInt subBlockHeight=0, const UInt defWidth=3 )234 Void printBlockToStream( std::ostream &ss, const TChar *pLinePrefix, const T * blkSrc, const UInt width, const UInt height, const UInt stride, const UInt subBlockWidth=0, const UInt subBlockHeight=0, const UInt defWidth=3 ) 235 235 { 236 236 for (UInt y=0; y<height; y++) … … 256 256 257 257 class TComYuv; 258 Void printBlockToStream( std::ostream &ss, const Char *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross=1, const UInt numSubBlocksUp=1, const UInt defWidth=3 );258 Void printBlockToStream( std::ostream &ss, const TChar *pLinePrefix, TComYuv &src, const UInt numSubBlocksAcross=1, const UInt numSubBlocksUp=1, const UInt defWidth=3 ); 259 259 260 260 // ---------------------------------------------------------------------------------------------- // -
branches/SHM-dev/source/Lib/TLibCommon/SEI.cpp
r1434 r1442 115 115 116 116 // Static member 117 const Char *SEI::getSEIMessageString(SEI::PayloadType payloadType)117 const TChar *SEI::getSEIMessageString(SEI::PayloadType payloadType) 118 118 { 119 119 switch (payloadType) -
branches/SHM-dev/source/Lib/TLibCommon/SEI.h
r1434 r1442 124 124 virtual ~SEI() {} 125 125 126 static const Char *getSEIMessageString(SEI::PayloadType payloadType);126 static const TChar *getSEIMessageString(SEI::PayloadType payloadType); 127 127 128 128 virtual PayloadType payloadType() const = 0; -
branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.cpp
r1347 r1442 91 91 } 92 92 93 Char* TComOutputBitstream::getByteStream() const94 { 95 return ( Char*) &m_fifo.front();93 UChar* TComOutputBitstream::getByteStream() const 94 { 95 return (UChar*) &m_fifo.front(); 96 96 } 97 97 -
branches/SHM-dev/source/Lib/TLibCommon/TComBitStream.h
r1352 r1442 115 115 * bytestream are stored in ascending addresses. 116 116 */ 117 Char* getByteStream() const;117 UChar* getByteStream() const; 118 118 119 119 /** -
branches/SHM-dev/source/Lib/TLibCommon/TComCodingStatistics.h
r1335 r1442 95 95 }; 96 96 97 static inline const Char* getName(TComCodingStatisticsType name)97 static inline const TChar* getName(TComCodingStatisticsType name) 98 98 { 99 static const Char *statNames[]=99 static const TChar *statNames[]= 100 100 { 101 101 "NAL_UNIT_TOTAL_BODY", // This is a special case and is not included in the total sums. … … 143 143 "CABAC_BITS__ALIGNED_ESCAPE_BITS" 144 144 }; 145 assert(STATS__NUM_STATS == sizeof(statNames)/sizeof( Char *) && name < STATS__NUM_STATS);145 assert(STATS__NUM_STATS == sizeof(statNames)/sizeof(TChar *) && name < STATS__NUM_STATS); 146 146 return statNames[name]; 147 147 } … … 183 183 } 184 184 185 static const Char *GetSubClassString(const UInt subClass)185 static const TChar *GetSubClassString(const UInt subClass) 186 186 { 187 187 assert (subClass<CODING_STATS_NUM_SUBCLASSES); 188 static const Char *strings[1+MAX_NUM_COMPONENT+MAX_NUM_CHANNEL_TYPE]={"-", "Y", "Cb", "Cr", "Luma", "Chroma"};188 static const TChar *strings[1+MAX_NUM_COMPONENT+MAX_NUM_CHANNEL_TYPE]={"-", "Y", "Cb", "Cr", "Luma", "Chroma"}; 189 189 return strings[subClass/CODING_STATS_NUM_WIDTHS]; 190 190 } … … 243 243 { } 244 244 245 static Void OutputLine(const Char *pName, const Char sep, UInt width, constChar *pSubClassStr, const SStat &sCABAC, const SStat &sEP)245 static Void OutputLine(const TChar *pName, const TChar sep, UInt width, const TChar *pSubClassStr, const SStat &sCABAC, const SStat &sEP) 246 246 { 247 247 if (width==0) … … 256 256 } 257 257 } 258 static Void OutputLine(const Char *pName, const Char sep, const Char *pWidthString, constChar *pSubClassStr, const SStat &sCABAC, const SStat &sEP)258 static Void OutputLine(const TChar *pName, const TChar sep, const TChar *pWidthString, const TChar *pSubClassStr, const SStat &sCABAC, const SStat &sEP) 259 259 { 260 260 printf("%c%-45s%c %6s %6s %12lld %12lld %12lld %12lld %12lld %12lld %12lld (%12lld)%c\n", … … 262 262 sCABAC.count, sCABAC.sum, sCABAC.bits, sEP.count, sEP.sum, sEP.bits, sCABAC.bits+sEP.bits, (sCABAC.bits+sEP.bits)/8, sep=='~'?']':' '); 263 263 } 264 static Void OutputLine(const Char *pName, const Char sep, const Char *pWidthString, constChar *pSubClassStr, const SStat &sEP)264 static Void OutputLine(const TChar *pName, const TChar sep, const TChar *pWidthString, const TChar *pSubClassStr, const SStat &sEP) 265 265 { 266 266 printf("%c%-45s%c %6s %6s %12s %12s %12s %12lld %12lld %12lld %12lld (%12lld)%c\n", … … 269 269 } 270 270 271 static Void OutputDashedLine(const Char *pText)271 static Void OutputDashedLine(const TChar *pText) 272 272 { 273 273 printf("--%s",pText); … … 314 314 SStat cabacSubTotal, epSubTotal; 315 315 Bool bHadClassifiedEntry=false; 316 const Char *pName=getName(TComCodingStatisticsType(i));316 const TChar *pName=getName(TComCodingStatisticsType(i)); 317 317 318 318 for(UInt c=0; c<CODING_STATS_NUM_SUBCLASSES; c++) … … 442 442 static SStat &GetStatisticEP(const std::string &str) { return GetSingletonInstance().data.mappings_ep[str]; } 443 443 444 static SStat &GetStatisticEP(const Char *pKey) {return GetStatisticEP(std::string(pKey)); }444 static SStat &GetStatisticEP(const TChar *pKey) {return GetStatisticEP(std::string(pKey)); } 445 445 446 446 static Void IncrementStatisticEP(const TComCodingStatisticsClassType &stat, const Int numBits, const Int value) … … 460 460 } 461 461 462 static Void IncrementStatisticEP(const Char *pKey, const Int numBits, const Int value)462 static Void IncrementStatisticEP(const TChar *pKey, const Int numBits, const Int value) 463 463 { 464 464 SStat &s=GetStatisticEP(pKey); -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.cpp
r1421 r1442 127 127 if ( !bDecSubCu ) 128 128 { 129 m_phQP = ( Char* )xMalloc(Char,uiNumPartition);129 m_phQP = (SChar* )xMalloc(SChar, uiNumPartition); 130 130 m_puhDepth = (UChar* )xMalloc(UChar, uiNumPartition); 131 131 m_puhWidth = (UChar* )xMalloc(UChar, uiNumPartition); … … 134 134 m_ChromaQpAdj = new UChar[ uiNumPartition ]; 135 135 m_skipFlag = new Bool[ uiNumPartition ]; 136 m_pePartSize = new Char[ uiNumPartition ];136 m_pePartSize = new SChar[ uiNumPartition ]; 137 137 memset( m_pePartSize, NUMBER_OF_PART_SIZES,uiNumPartition * sizeof( *m_pePartSize ) ); 138 m_pePredMode = new Char[ uiNumPartition ];138 m_pePredMode = new SChar[ uiNumPartition ]; 139 139 m_CUTransquantBypass = new Bool[ uiNumPartition ]; 140 140 … … 153 153 { 154 154 const RefPicList rpl=RefPicList(i); 155 m_apiMVPIdx[rpl] = new Char[ uiNumPartition ];156 m_apiMVPNum[rpl] = new Char[ uiNumPartition ];157 memset( m_apiMVPIdx[rpl], -1,uiNumPartition * sizeof( Char ) );155 m_apiMVPIdx[rpl] = new SChar[ uiNumPartition ]; 156 m_apiMVPNum[rpl] = new SChar[ uiNumPartition ]; 157 memset( m_apiMVPIdx[rpl], -1,uiNumPartition * sizeof( SChar ) ); 158 158 } 159 159 … … 164 164 const UInt totalSize = (uiWidth * uiHeight) >> chromaShift; 165 165 166 m_crossComponentPredictionAlpha[compID] = ( Char* )xMalloc(Char,uiNumPartition);166 m_crossComponentPredictionAlpha[compID] = (SChar* )xMalloc(SChar, uiNumPartition); 167 167 m_puhTransformSkip[compID] = (UChar* )xMalloc(UChar, uiNumPartition); 168 168 m_explicitRdpcmMode[compID] = (UChar* )xMalloc(UChar, uiNumPartition); … … 660 660 Int iSizeInUchar = sizeof( UChar ) * m_uiNumPartition; 661 661 Int iSizeInBool = sizeof( Bool ) * m_uiNumPartition; 662 Int sizeInChar = sizeof( Char ) * m_uiNumPartition;662 Int sizeInChar = sizeof( SChar ) * m_uiNumPartition; 663 663 664 664 memset( m_phQP, qp, sizeInChar ); … … 887 887 Int iSizeInBool = sizeof( Bool ) * uiNumPartition; 888 888 889 Int sizeInChar = sizeof( Char ) * uiNumPartition;889 Int sizeInChar = sizeof( SChar ) * uiNumPartition; 890 890 memcpy( m_skipFlag + uiOffset, pcCU->getSkipFlag(), sizeof( *m_skipFlag ) * uiNumPartition ); 891 891 memcpy( m_phQP + uiOffset, pcCU->getQP(), sizeInChar ); … … 969 969 Int iSizeInUchar = sizeof( UChar ) * m_uiNumPartition; 970 970 Int iSizeInBool = sizeof( Bool ) * m_uiNumPartition; 971 Int sizeInChar = sizeof( Char ) * m_uiNumPartition;971 Int sizeInChar = sizeof( SChar ) * m_uiNumPartition; 972 972 973 973 memcpy( pCtu->getSkipFlag() + m_absZIdxInCtu, m_skipFlag, sizeof( *m_skipFlag ) * m_uiNumPartition ); … … 1158 1158 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 1159 1159 UInt uiAbsZorderCUIdxLB = g_auiZscanToRaster[ m_absZIdxInCtu ] + ((m_puhHeight[0] / m_pcPic->getMinCUHeight()) - 1)*numPartInCtuWidth; 1160 1160 1161 1161 #if SVC_EXTENSION 1162 1162 if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelY() + g_auiRasterToPelY[uiAbsPartIdxLB] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicHeightInLumaSamples()) … … 1206 1206 UInt uiAbsZorderCUIdx = g_auiZscanToRaster[ m_absZIdxInCtu ] + (m_puhWidth[0] / m_pcPic->getMinCUWidth()) - 1; 1207 1207 const UInt numPartInCtuWidth = m_pcPic->getNumPartInCtuWidth(); 1208 1208 1209 1209 #if SVC_EXTENSION 1210 1210 if( ( m_pcPic->getCtu(m_ctuRsAddr)->getCUPelX() + g_auiRasterToPelX[uiAbsPartIdxRT] + (m_pcPic->getPicSym()->getMinCUHeight() * uiPartUnitOffset)) >= m_pcSlice->getPicWidthInLumaSamples() ) … … 1318 1318 /** Get reference QP from left QpMinCu or latest coded QP 1319 1319 *\param uiCurrAbsIdxInCtu 1320 *\returns Char reference QP value1320 *\returns SChar reference QP value 1321 1321 */ 1322 Char TComDataCU::getRefQP( UInt uiCurrAbsIdxInCtu )1322 SChar TComDataCU::getRefQP( UInt uiCurrAbsIdxInCtu ) 1323 1323 { 1324 1324 UInt lPartIdx = MAX_UINT; … … 1341 1341 } 1342 1342 1343 Char TComDataCU::getLastCodedQP( UInt uiAbsPartIdx )1343 SChar TComDataCU::getLastCodedQP( UInt uiAbsPartIdx ) 1344 1344 { 1345 1345 UInt uiQUPartIdxMask = ~((1<<((getSlice()->getSPS()->getMaxTotalCUDepth() - getSlice()->getPPS()->getMaxCuDQPDepth())<<1))-1); … … 1836 1836 Void TComDataCU::setMVPIdxSubParts( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1837 1837 { 1838 setSubPart< Char>( iMVPIdx, m_apiMVPIdx[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );1838 setSubPart<SChar>( iMVPIdx, m_apiMVPIdx[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx ); 1839 1839 } 1840 1840 1841 1841 Void TComDataCU::setMVPNumSubParts( Int iMVPNum, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ) 1842 1842 { 1843 setSubPart< Char>( iMVPNum, m_apiMVPNum[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx );1843 setSubPart<SChar>( iMVPNum, m_apiMVPNum[eRefPicList], uiAbsPartIdx, uiDepth, uiPartIdx ); 1844 1844 } 1845 1845 … … 1874 1874 } 1875 1875 1876 Void TComDataCU::setCrossComponentPredictionAlphaPartRange( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes )1877 { 1878 memset((m_crossComponentPredictionAlpha[compID] + uiAbsPartIdx), alphaValue, (sizeof( Char) * uiCoveredPartIdxes));1876 Void TComDataCU::setCrossComponentPredictionAlphaPartRange( SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ) 1877 { 1878 memset((m_crossComponentPredictionAlpha[compID] + uiAbsPartIdx), alphaValue, (sizeof(SChar) * uiCoveredPartIdxes)); 1879 1879 } 1880 1880 -
branches/SHM-dev/source/Lib/TLibCommon/TComDataCU.h
r1421 r1442 86 86 UChar* m_puhDepth; ///< array of depths 87 87 Int m_unitSize; ///< size of a "minimum partition" 88 88 89 89 #if SVC_EXTENSION 90 90 UInt m_layerId; ///< layer id … … 99 99 100 100 Bool* m_skipFlag; ///< array of skip flags 101 Char*m_pePartSize; ///< array of partition sizes102 Char*m_pePredMode; ///< array of prediction modes103 Char*m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values101 SChar* m_pePartSize; ///< array of partition sizes 102 SChar* m_pePredMode; ///< array of prediction modes 103 SChar* m_crossComponentPredictionAlpha[MAX_NUM_COMPONENT]; ///< array of cross-component prediction alpha values 104 104 Bool* m_CUTransquantBypass; ///< array of cu_transquant_bypass flags 105 Char*m_phQP; ///< array of QP values105 SChar* m_phQP; ///< array of QP values 106 106 UChar* m_ChromaQpAdj; ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 107 107 UInt m_codedChromaQpAdj; … … 143 143 UChar* m_puhIntraDir[MAX_NUM_CHANNEL_TYPE]; // 0-> Luma, 1-> Chroma 144 144 UChar* m_puhInterDir; ///< array of inter directions 145 Char*m_apiMVPIdx[NUM_REF_PIC_LIST_01]; ///< array of motion vector predictor candidates146 Char*m_apiMVPNum[NUM_REF_PIC_LIST_01]; ///< array of number of possible motion vectors predictors145 SChar* m_apiMVPIdx[NUM_REF_PIC_LIST_01]; ///< array of motion vector predictor candidates 146 SChar* m_apiMVPNum[NUM_REF_PIC_LIST_01]; ///< array of number of possible motion vectors predictors 147 147 Bool* m_pbIPCMFlag; ///< array of intra_pcm flags 148 148 … … 156 156 UInt m_uiTotalBits; ///< sum of partition bits 157 157 UInt m_uiTotalBins; ///< sum of partition bins 158 Charm_codedQP;158 SChar m_codedQP; 159 159 UChar* m_explicitRdpcmMode[MAX_NUM_COMPONENT]; ///< Stores the explicit RDPCM mode for all TUs belonging to this CU 160 160 … … 223 223 // ------------------------------------------------------------------------------------------------------------------- 224 224 225 Char*getPartitionSize () { return m_pePartSize; }225 SChar* getPartitionSize () { return m_pePartSize; } 226 226 PartSize getPartitionSize ( UInt uiIdx ) { return static_cast<PartSize>( m_pePartSize[uiIdx] ); } 227 227 Void setPartitionSize ( UInt uiIdx, PartSize uh){ m_pePartSize[uiIdx] = uh; } … … 234 234 Void setSkipFlagSubParts ( Bool skip, UInt absPartIdx, UInt depth ); 235 235 236 Char*getPredictionMode () { return m_pePredMode; }236 SChar* getPredictionMode () { return m_pePredMode; } 237 237 PredMode getPredictionMode ( UInt uiIdx ) { return static_cast<PredMode>( m_pePredMode[uiIdx] ); } 238 238 Void setPredictionMode ( UInt uiIdx, PredMode uh){ m_pePredMode[uiIdx] = uh; } 239 239 Void setPredModeSubParts ( PredMode eMode, UInt uiAbsPartIdx, UInt uiDepth ); 240 240 241 Char*getCrossComponentPredictionAlpha( ComponentID compID ) { return m_crossComponentPredictionAlpha[compID]; }242 ChargetCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx]; }241 SChar* getCrossComponentPredictionAlpha( ComponentID compID ) { return m_crossComponentPredictionAlpha[compID]; } 242 SChar getCrossComponentPredictionAlpha( UInt uiIdx, ComponentID compID ) { return m_crossComponentPredictionAlpha[compID][uiIdx]; } 243 243 244 244 Bool* getCUTransquantBypass () { return m_CUTransquantBypass; } … … 255 255 Void setSizeSubParts ( UInt uiWidth, UInt uiHeight, UInt uiAbsPartIdx, UInt uiDepth ); 256 256 257 Char*getQP () { return m_phQP; }258 ChargetQP ( UInt uiIdx ) const { return m_phQP[uiIdx]; }259 Void setQP ( UInt uiIdx, Char value){ m_phQP[uiIdx] = value; }257 SChar* getQP () { return m_phQP; } 258 SChar getQP ( UInt uiIdx ) const { return m_phQP[uiIdx]; } 259 Void setQP ( UInt uiIdx, SChar value){ m_phQP[uiIdx] = value; } 260 260 Void setQPSubParts ( Int qp, UInt uiAbsPartIdx, UInt uiDepth ); 261 261 Int getLastValidPartIdx ( Int iAbsPartIdx ); 262 ChargetLastCodedQP ( UInt uiAbsPartIdx );262 SChar getLastCodedQP ( UInt uiAbsPartIdx ); 263 263 Void setQPSubCUs ( Int qp, UInt absPartIdx, UInt depth, Bool &foundNonZeroCbf ); 264 Void setCodedQP ( Char qp ){ m_codedQP = qp; }265 ChargetCodedQP () { return m_codedQP; }264 Void setCodedQP ( SChar qp ) { m_codedQP = qp; } 265 SChar getCodedQP () { return m_codedQP; } 266 266 267 267 UChar* getChromaQpAdj () { return m_ChromaQpAdj; } ///< array of chroma QP adjustments (indexed). when value = 0, cu_chroma_qp_offset_flag=0; when value>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=value-1 … … 269 269 Void setChromaQpAdj (Int idx, UChar val) { m_ChromaQpAdj[idx] = val; } ///< When val = 0, cu_chroma_qp_offset_flag=0; when val>0, indicates cu_chroma_qp_offset_flag=1 and cu_chroma_qp_offset_idx=val-1 270 270 Void setChromaQpAdjSubParts( UChar val, Int absPartIdx, Int depth ); 271 Void setCodedChromaQpAdj ( Char qp ){ m_codedChromaQpAdj = qp; }272 ChargetCodedChromaQpAdj () { return m_codedChromaQpAdj; }271 Void setCodedChromaQpAdj ( SChar qp ) { m_codedChromaQpAdj = qp; } 272 SChar getCodedChromaQpAdj () { return m_codedChromaQpAdj; } 273 273 274 274 Bool isLosslessCoded ( UInt absPartIdx ); … … 289 289 Bool isRDPCMEnabled ( UInt uiAbsPartIdx ) { return getSlice()->getSPS()->getSpsRangeExtension().getRdpcmEnabledFlag(isIntra(uiAbsPartIdx) ? RDPCM_SIGNAL_IMPLICIT : RDPCM_SIGNAL_EXPLICIT); } 290 290 291 Void setCrossComponentPredictionAlphaPartRange ( Char alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes );291 Void setCrossComponentPredictionAlphaPartRange ( SChar alphaValue, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 292 292 Void setTransformSkipPartRange ( UInt useTransformSkip, ComponentID compID, UInt uiAbsPartIdx, UInt uiCoveredPartIdxes ); 293 293 … … 375 375 Void setMVPIdx ( RefPicList eRefPicList, UInt uiIdx, Int iMVPIdx) { m_apiMVPIdx[eRefPicList][uiIdx] = iMVPIdx; } 376 376 Int getMVPIdx ( RefPicList eRefPicList, UInt uiIdx) { return m_apiMVPIdx[eRefPicList][uiIdx]; } 377 Char*getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; }377 SChar* getMVPIdx ( RefPicList eRefPicList ) { return m_apiMVPIdx[eRefPicList]; } 378 378 379 379 Void setMVPNum ( RefPicList eRefPicList, UInt uiIdx, Int iMVPNum ) { m_apiMVPNum[eRefPicList][uiIdx] = iMVPNum; } 380 380 Int getMVPNum ( RefPicList eRefPicList, UInt uiIdx ) { return m_apiMVPNum[eRefPicList][uiIdx]; } 381 Char*getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; }381 SChar* getMVPNum ( RefPicList eRefPicList ) { return m_apiMVPNum[eRefPicList]; } 382 382 383 383 Void setMVPIdxSubParts ( Int iMVPIdx, RefPicList eRefPicList, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth ); … … 420 420 TComDataCU* getQpMinCuLeft ( UInt& uiLPartUnitIdx , UInt uiCurrAbsIdxInCtu ); 421 421 TComDataCU* getQpMinCuAbove ( UInt& uiAPartUnitIdx , UInt uiCurrAbsIdxInCtu ); 422 ChargetRefQP ( UInt uiCurrAbsIdxInCtu );422 SChar getRefQP ( UInt uiCurrAbsIdxInCtu ); 423 423 424 424 /// returns CU and part index of the PU above the top row of the current uiCurrPartUnitIdx of the CU, at a horizontal offset (to the right) of uiPartUnitOffset (in parts) … … 475 475 476 476 UInt getCoefScanIdx(const UInt uiAbsPartIdx, const UInt uiWidth, const UInt uiHeight, const ComponentID compID) const ; 477 477 478 478 #if SVC_EXTENSION 479 479 Void setLayerId (UInt layerId) { m_layerId = layerId; } -
branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.cpp
r1259 r1442 60 60 m_pcMv = new TComMv[ uiNumPartition ]; 61 61 m_pcMvd = new TComMv[ uiNumPartition ]; 62 m_piRefIdx = new Char[ uiNumPartition ];62 m_piRefIdx = new SChar [ uiNumPartition ]; 63 63 64 64 m_uiNumPartition = uiNumPartition; … … 315 315 Void TComCUMvField::setAllRefIdx ( Int iRefIdx, PartSize eCUMode, Int iPartAddr, UInt uiDepth, Int iPartIdx ) 316 316 { 317 setAll(m_piRefIdx, static_cast< Char>(iRefIdx), eCUMode, iPartAddr, uiDepth, iPartIdx);317 setAll(m_piRefIdx, static_cast<SChar>(iRefIdx), eCUMode, iPartAddr, uiDepth, iPartIdx); 318 318 } 319 319 … … 328 328 * \param scale Factor by which to subsample motion information 329 329 */ 330 Void TComCUMvField::compress( Char* pePredMode, Int scale)330 Void TComCUMvField::compress(SChar* pePredMode, Int scale) 331 331 { 332 332 Int N = scale * scale; -
branches/SHM-dev/source/Lib/TLibCommon/TComMotionInfo.h
r1259 r1442 94 94 TComMv* m_pcMv; 95 95 TComMv* m_pcMvd; 96 Char*m_piRefIdx;96 SChar* m_piRefIdx; 97 97 UInt m_uiNumPartition; 98 98 AMVPInfo m_cAMVPInfo; … … 153 153 } 154 154 155 Void compress( Char* pePredMode, Int scale);155 Void compress(SChar* pePredMode, Int scale); 156 156 157 157 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibCommon/TComPic.cpp
r1428 r1442 363 363 } 364 364 } 365 memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof( Char)*numPartitions );365 memset( pcCUDes->getPartitionSize(), SIZE_2Nx2N, sizeof(SChar)*numPartitions ); 366 366 } 367 367 } -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.cpp
r1427 r1442 296 296 297 297 // NOTE: This function is never called, but may be useful for developers. 298 Void TComPicYuv::dump (const Char* pFileName, const BitDepths &bitDepths, Bool bAdd) const 299 { 300 FILE* pFile; 301 if (!bAdd) 302 { 303 pFile = fopen (pFileName, "wb"); 304 } 305 else 306 { 307 pFile = fopen (pFileName, "ab"); 308 } 309 298 Void TComPicYuv::dump (const std::string &fileName, const BitDepths &bitDepths, Bool bAdd) const 299 { 300 FILE* pFile = fopen (fileName.c_str(), bAdd?"ab":"wb"); 310 301 311 302 for(Int comp = 0; comp < getNumberValidComponents(); comp++) … … 333 324 } 334 325 335 Void TComPicYuv::dump( Char* pFileName, Bool bAdd, Int bitDepth ) 336 { 337 FILE* pFile; 338 if (!bAdd) 339 { 340 pFile = fopen (pFileName, "wb"); 341 } 342 else 343 { 344 pFile = fopen (pFileName, "ab"); 345 } 326 Void TComPicYuv::dump( const std::string &fileName, const Bool bAdd, const Int bitDepth ) 327 { 328 FILE* pFile = fopen (fileName.c_str(), bAdd?"ab":"wb"); 346 329 347 330 if( bitDepth == 8 ) 348 331 { 349 dump( pFileName, bitDepth, bAdd );332 dump( fileName, bitDepth, bAdd ); 350 333 return; 351 334 } … … 378 361 379 362 #if AUXILIARY_PICTURES 380 Void TComPicYuv::convertToMonochrome( Int bitDepthChroma)363 Void TComPicYuv::convertToMonochrome(const Int bitDepthChroma) 381 364 { 382 365 Pel grayVal = (1 << (bitDepthChroma - 1)); -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuv.h
r1428 r1442 180 180 181 181 // Dump picture 182 Void dump (const Char* pFileName, const BitDepths &bitDepths, Bool bAdd = false) const ;182 Void dump (const std::string &fileName, const BitDepths &bitDepths, Bool bAdd = false) const ; 183 183 184 184 // Set border extension flag … … 192 192 Bool isReconstructed() { return m_isReconstructed; } 193 193 #if AUXILIARY_PICTURES 194 Void convertToMonochrome( Int bitDepthChroma);195 #endif 196 #endif 197 198 Void dump( Char* pFileName, Bool bAdd,Int bitDepth );194 Void convertToMonochrome(const Int bitDepthChroma); 195 #endif 196 #endif 197 198 Void dump( const std::string &fileName, const Bool bAdd, const Int bitDepth ); 199 199 200 200 };// END CLASS DEFINITION TComPicYuv -
branches/SHM-dev/source/Lib/TLibCommon/TComPicYuvMD5.cpp
r1287 r1442 209 209 std::string hashToString(const TComPictureHash &digest, Int numChar) 210 210 { 211 static const Char* hex = "0123456789abcdef";211 static const TChar* hex = "0123456789abcdef"; 212 212 std::string result; 213 213 -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.cpp
r1419 r1442 51 51 //! \{ 52 52 53 const Char* nalUnitTypeToString(NalUnitType type)53 const TChar* nalUnitTypeToString(NalUnitType type) 54 54 { 55 55 #if SVC_EXTENSION … … 602 602 // ==================================================================================================================== 603 603 604 Char g_aucConvertToBit [ MAX_CU_SIZE+1 ];604 SChar g_aucConvertToBit [ MAX_CU_SIZE+1 ]; 605 605 606 606 #if ENC_DEC_TRACE … … 630 630 const UInt g_uiGroupIdx[ MAX_TU_SIZE ] = {0,1,2,3,4,4,5,5,6,6,6,6,7,7,7,7,8,8,8,8,8,8,8,8,9,9,9,9,9,9,9,9}; 631 631 632 const Char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =632 const TChar *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] = 633 633 { 634 634 { … … 666 666 }; 667 667 668 const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] =668 const TChar *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] = 669 669 { 670 670 { -
branches/SHM-dev/source/Lib/TLibCommon/TComRom.h
r1419 r1442 125 125 // ==================================================================================================================== 126 126 127 extern Char g_aucConvertToBit [ MAX_CU_SIZE+1 ]; // from width to log2(width)-2127 extern SChar g_aucConvertToBit [ MAX_CU_SIZE+1 ]; // from width to log2(width)-2 128 128 129 129 … … 159 159 #endif 160 160 161 const Char* nalUnitTypeToString(NalUnitType type);161 const TChar* nalUnitTypeToString(NalUnitType type); 162 162 163 extern const Char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];164 extern const Char *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM];163 extern const TChar *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; 164 extern const TChar *MatrixType_DC[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM]; 165 165 166 166 extern const Int g_quantTSDefault4x4[4*4]; -
branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.cpp
r1289 r1442 324 324 m_signLineBuf1 = NULL; 325 325 } 326 m_signLineBuf1 = new Char[m_lineBufWidth+1];326 m_signLineBuf1 = new SChar[m_lineBufWidth+1]; 327 327 328 328 if (m_signLineBuf2) … … 331 331 m_signLineBuf2 = NULL; 332 332 } 333 m_signLineBuf2 = new Char[m_lineBufWidth+1];333 m_signLineBuf2 = new SChar[m_lineBufWidth+1]; 334 334 } 335 335 … … 338 338 Int x,y, startX, startY, endX, endY, edgeType; 339 339 Int firstLineStartX, firstLineEndX, lastLineStartX, lastLineEndX; 340 Char signLeft, signRight, signDown;340 SChar signLeft, signRight, signDown; 341 341 342 342 Pel* srcLine = srcBlk; … … 352 352 for (y=0; y< height; y++) 353 353 { 354 signLeft = ( Char)sgn(srcLine[startX] - srcLine[startX-1]);354 signLeft = (SChar)sgn(srcLine[startX] - srcLine[startX-1]); 355 355 for (x=startX; x< endX; x++) 356 356 { 357 signRight = ( Char)sgn(srcLine[x] - srcLine[x+1]);357 signRight = (SChar)sgn(srcLine[x] - srcLine[x+1]); 358 358 edgeType = signRight + signLeft; 359 359 signLeft = -signRight; … … 370 370 { 371 371 offset += 2; 372 Char *signUpLine = m_signLineBuf1;372 SChar *signUpLine = m_signLineBuf1; 373 373 374 374 startY = isAboveAvail ? 0 : 1; … … 383 383 for (x=0; x< width; x++) 384 384 { 385 signUpLine[x] = ( Char)sgn(srcLine[x] - srcLineAbove[x]);385 signUpLine[x] = (SChar)sgn(srcLine[x] - srcLineAbove[x]); 386 386 } 387 387 … … 393 393 for (x=0; x< width; x++) 394 394 { 395 signDown = ( Char)sgn(srcLine[x] - srcLineBelow[x]);395 signDown = (SChar)sgn(srcLine[x] - srcLineBelow[x]); 396 396 edgeType = signDown + signUpLine[x]; 397 397 signUpLine[x]= -signDown; … … 408 408 { 409 409 offset += 2; 410 Char *signUpLine, *signDownLine, *signTmpLine;410 SChar *signUpLine, *signDownLine, *signTmpLine; 411 411 412 412 signUpLine = m_signLineBuf1; … … 420 420 for (x=startX; x< endX+1; x++) 421 421 { 422 signUpLine[x] = ( Char)sgn(srcLineBelow[x] - srcLine[x- 1]);422 signUpLine[x] = (SChar)sgn(srcLineBelow[x] - srcLine[x- 1]); 423 423 } 424 424 … … 444 444 for (x=startX; x<endX; x++) 445 445 { 446 signDown = ( Char)sgn(srcLine[x] - srcLineBelow[x+ 1]);446 signDown = (SChar)sgn(srcLine[x] - srcLineBelow[x+ 1]); 447 447 edgeType = signDown + signUpLine[x]; 448 448 resLine[x] = Clip3<Int>(0, maxSampleValueIncl, srcLine[x] + offset[edgeType]); … … 450 450 signDownLine[x+1] = -signDown; 451 451 } 452 signDownLine[startX] = ( Char)sgn(srcLineBelow[startX] - srcLine[startX-1]);452 signDownLine[startX] = (SChar)sgn(srcLineBelow[startX] - srcLine[startX-1]); 453 453 454 454 signTmpLine = signUpLine; … … 475 475 { 476 476 offset += 2; 477 Char *signUpLine = m_signLineBuf1+1;477 SChar *signUpLine = m_signLineBuf1+1; 478 478 479 479 startX = isLeftAvail ? 0 : 1; … … 484 484 for (x=startX-1; x< endX; x++) 485 485 { 486 signUpLine[x] = ( Char)sgn(srcLineBelow[x] - srcLine[x+1]);486 signUpLine[x] = (SChar)sgn(srcLineBelow[x] - srcLine[x+1]); 487 487 } 488 488 … … 507 507 for(x= startX; x< endX; x++) 508 508 { 509 signDown = ( Char)sgn(srcLine[x] - srcLineBelow[x-1]);509 signDown = (SChar)sgn(srcLine[x] - srcLineBelow[x-1]); 510 510 edgeType = signDown + signUpLine[x]; 511 511 resLine[x] = Clip3<Int>(0, maxSampleValueIncl, srcLine[x] + offset[edgeType]); 512 512 signUpLine[x-1] = -signDown; 513 513 } 514 signUpLine[endX-1] = ( Char)sgn(srcLineBelow[endX-1] - srcLine[endX]);514 signUpLine[endX-1] = (SChar)sgn(srcLineBelow[endX-1] - srcLine[endX]); 515 515 srcLine += srcStride; 516 516 resLine += resStride; -
branches/SHM-dev/source/Lib/TLibCommon/TComSampleAdaptiveOffset.h
r1287 r1442 96 96 97 97 Int m_lineBufWidth; 98 Char* m_signLineBuf1;99 Char* m_signLineBuf2;98 SChar* m_signLineBuf1; 99 SChar* m_signLineBuf2; 100 100 ChromaFormat m_chromaFormatIDC; 101 101 private: -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.cpp
r1439 r1442 2444 2444 } 2445 2445 2446 Bool TComScalingList::xParseScalingList( Char* pchFile)2446 Bool TComScalingList::xParseScalingList(const std::string &fileName) 2447 2447 { 2448 2448 static const Int LINE_SIZE=1024; 2449 2449 FILE *fp = NULL; 2450 Char line[LINE_SIZE];2451 2452 if ( pchFile == NULL)2450 TChar line[LINE_SIZE]; 2451 2452 if (fileName.empty()) 2453 2453 { 2454 2454 fprintf(stderr, "Error: no scaling list file specified. Help on scaling lists being output\n"); … … 2459 2459 return true; 2460 2460 } 2461 else if ((fp = fopen( pchFile,"r")) == (FILE*)NULL)2462 { 2463 fprintf(stderr, "Error: cannot open scaling list file %s for reading\n", pchFile);2461 else if ((fp = fopen(fileName.c_str(),"r")) == (FILE*)NULL) 2462 { 2463 fprintf(stderr, "Error: cannot open scaling list file %s for reading\n", fileName.c_str()); 2464 2464 return true; 2465 2465 } … … 2489 2489 while ((!feof(fp)) && (!bFound)) 2490 2490 { 2491 Char *ret = fgets(line, LINE_SIZE, fp);2492 Char *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType[sizeIdc][listIdc]);2491 TChar *ret = fgets(line, LINE_SIZE, fp); 2492 TChar *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType[sizeIdc][listIdc]); 2493 2493 // This could be a match against the DC string as well, so verify it isn't 2494 2494 if (findNamePosition!= NULL && (MatrixType_DC[sizeIdc][listIdc]==NULL || strstr(line, MatrixType_DC[sizeIdc][listIdc])==NULL)) … … 2499 2499 if (!bFound) 2500 2500 { 2501 fprintf(stderr, "Error: cannot find Matrix %s from scaling list file %s\n", MatrixType[sizeIdc][listIdc], pchFile);2501 fprintf(stderr, "Error: cannot find Matrix %s from scaling list file %s\n", MatrixType[sizeIdc][listIdc], fileName.c_str()); 2502 2502 return true; 2503 2503 } … … 2508 2508 if (fscanf(fp, "%d,", &data)!=1) 2509 2509 { 2510 fprintf(stderr, "Error: cannot read value #%d for Matrix %s from scaling list file %s at file position %ld\n", i, MatrixType[sizeIdc][listIdc], pchFile, ftell(fp));2510 fprintf(stderr, "Error: cannot read value #%d for Matrix %s from scaling list file %s at file position %ld\n", i, MatrixType[sizeIdc][listIdc], fileName.c_str(), ftell(fp)); 2511 2511 return true; 2512 2512 } 2513 2513 if (data<0 || data>255) 2514 2514 { 2515 fprintf(stderr, "Error: QMatrix entry #%d of value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", i, data, MatrixType[sizeIdc][listIdc], pchFile, ftell(fp));2515 fprintf(stderr, "Error: QMatrix entry #%d of value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", i, data, MatrixType[sizeIdc][listIdc], fileName.c_str(), ftell(fp)); 2516 2516 return true; 2517 2517 } … … 2529 2529 while ((!feof(fp)) && (!bFound)) 2530 2530 { 2531 Char *ret = fgets(line, LINE_SIZE, fp);2532 Char *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType_DC[sizeIdc][listIdc]);2531 TChar *ret = fgets(line, LINE_SIZE, fp); 2532 TChar *findNamePosition= ret==NULL ? NULL : strstr(line, MatrixType_DC[sizeIdc][listIdc]); 2533 2533 if (findNamePosition!= NULL) 2534 2534 { … … 2539 2539 if (!bFound) 2540 2540 { 2541 fprintf(stderr, "Error: cannot find DC Matrix %s from scaling list file %s\n", MatrixType_DC[sizeIdc][listIdc], pchFile);2541 fprintf(stderr, "Error: cannot find DC Matrix %s from scaling list file %s\n", MatrixType_DC[sizeIdc][listIdc], fileName.c_str()); 2542 2542 return true; 2543 2543 } … … 2546 2546 if (fscanf(fp, "%d,", &data)!=1) 2547 2547 { 2548 fprintf(stderr, "Error: cannot read DC %s from scaling list file %s at file position %ld\n", MatrixType_DC[sizeIdc][listIdc], pchFile, ftell(fp));2548 fprintf(stderr, "Error: cannot read DC %s from scaling list file %s at file position %ld\n", MatrixType_DC[sizeIdc][listIdc], fileName.c_str(), ftell(fp)); 2549 2549 return true; 2550 2550 } 2551 2551 if (data<0 || data>255) 2552 2552 { 2553 fprintf(stderr, "Error: DC value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", data, MatrixType[sizeIdc][listIdc], pchFile, ftell(fp));2553 fprintf(stderr, "Error: DC value %d for Matrix %s from scaling list file %s at file position %ld is out of range (0 to 255)\n", data, MatrixType[sizeIdc][listIdc], fileName.c_str(), ftell(fp)); 2554 2554 return true; 2555 2555 } -
branches/SHM-dev/source/Lib/TLibCommon/TComSlice.h
r1439 r1442 176 176 Void checkDcOfMatrix(); 177 177 Void processRefMatrix(UInt sizeId, UInt listId , UInt refListId ); 178 Bool xParseScalingList( Char* pchFile);178 Bool xParseScalingList(const std::string &fileName); 179 179 Void setDefaultScalingList(); 180 180 Bool checkDefaultScalingList(); … … 789 789 UInt getNumHrdParameters() const { return m_numHrdParameters; } 790 790 Void setNumHrdParameters(UInt v) { m_numHrdParameters = v; } 791 791 792 792 #if !SVC_EXTENSION 793 793 UInt getMaxNuhReservedZeroLayerId() const { return m_maxNuhReservedZeroLayerId; } … … 1140 1140 #endif //SVC_EXTENSION 1141 1141 }; 1142 1142 1143 1143 1144 class TComVUI -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1433 r1442 259 259 typedef bool Bool; 260 260 261 #ifdef __arm__ 262 typedef signed char Char; 263 #else 264 typedef char Char; 265 #endif 266 typedef unsigned char UChar; 261 typedef char TChar; // Used for text/characters 262 typedef signed char SChar; // Signed 8-bit values 263 typedef unsigned char UChar; // Unsigned 8-bit values 267 264 typedef short Short; 268 265 typedef unsigned short UShort;
Note: See TracChangeset for help on using the changeset viewer.