Changeset 1232 in SHVCSoftware for branches/SHM-dev/source
- Timestamp:
- 9 Jul 2015, 00:59:44 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1228 r1232 2713 2713 2714 2714 // pcSlice is currently slice 0. 2715 Int64binCountsInNalUnits = 0; // For implementation of cabac_zero_word stuffing (section 7.4.3.10)2716 Int64numBytesInVclNalUnits = 0; // For implementation of cabac_zero_word stuffing (section 7.4.3.10)2715 std::size_t binCountsInNalUnits = 0; // For implementation of cabac_zero_word stuffing (section 7.4.3.10) 2716 std::size_t numBytesInVclNalUnits = 0; // For implementation of cabac_zero_word stuffing (section 7.4.3.10) 2717 2717 2718 2718 for( UInt sliceSegmentStartCtuTsAddr = 0, sliceIdxCount=0; sliceSegmentStartCtuTsAddr < pcPic->getPicSym()->getNumberOfCtusInFrame(); sliceIdxCount++, sliceSegmentStartCtuTsAddr=pcSlice->getSliceSegmentCurEndCtuTsAddr() ) … … 2829 2829 accessUnit.push_back(new NALUnitEBSP(nalu)); 2830 2830 actualTotalBits += UInt(accessUnit.back()->m_nalUnitData.str().size()) * 8; 2831 numBytesInVclNalUnits += Int64(accessUnit.back()->m_nalUnitData.str().size());2831 numBytesInVclNalUnits += (std::size_t)(accessUnit.back()->m_nalUnitData.str().size()); 2832 2832 bNALUAlignedWrittenToList = true; 2833 2833 … … 2874 2874 const Int rawBits = paddedWidth * paddedHeight * 2875 2875 (g_bitDepth[CHANNEL_TYPE_LUMA] + 2*(g_bitDepth[CHANNEL_TYPE_CHROMA]>>log2subWidthCxsubHeightC)); 2876 const Int64 threshold = (32LL/3)*numBytesInVclNalUnits + (rawBits/32);2876 const std::size_t threshold = (32/3)*numBytesInVclNalUnits + (rawBits/32); 2877 2877 if (binCountsInNalUnits >= threshold) 2878 2878 { 2879 2879 // need to add additional cabac zero words (each one accounts for 3 bytes (=00 00 03)) to increase numBytesInVclNalUnits 2880 const Int64targetNumBytesInVclNalUnits = ((binCountsInNalUnits - (rawBits/32))*3+31)/32;2881 const Int64 numberOfAdditionalBytesNeeded=targetNumBytesInVclNalUnits - numBytesInVclNalUnits; 2882 2883 if (numberOfAdditionalBytesNeeded>0) // It should be!2884 {2885 const Int64numberOfAdditionalCabacZeroWords=(numberOfAdditionalBytesNeeded+2)/3;2886 const Int64numberOfAdditionalCabacZeroBytes=numberOfAdditionalCabacZeroWords*3;2880 const std::size_t targetNumBytesInVclNalUnits = ((binCountsInNalUnits - (rawBits/32))*3+31)/32; 2881 2882 if (targetNumBytesInVclNalUnits>numBytesInVclNalUnits) // It should be! 2883 { 2884 const std::size_t numberOfAdditionalBytesNeeded=targetNumBytesInVclNalUnits - numBytesInVclNalUnits; 2885 const std::size_t numberOfAdditionalCabacZeroWords=(numberOfAdditionalBytesNeeded+2)/3; 2886 const std::size_t numberOfAdditionalCabacZeroBytes=numberOfAdditionalCabacZeroWords*3; 2887 2887 if (m_pcCfg->getCabacZeroWordPaddingEnabled()) 2888 2888 { 2889 2889 std::vector<Char> zeroBytesPadding((size_t)numberOfAdditionalCabacZeroBytes, Char(0)); 2890 for(s ize_t i=0; i<numberOfAdditionalCabacZeroWords; i++)2890 for(std::size_t i=0; i<numberOfAdditionalCabacZeroWords; i++) 2891 2891 { 2892 2892 zeroBytesPadding[i*3+2]=3; // 00 00 03 2893 2893 } 2894 2894 accessUnit.back()->m_nalUnitData.write(&(zeroBytesPadding[0]), (size_t)numberOfAdditionalCabacZeroBytes); 2895 printf("Adding % lld bytes of padding\n", numberOfAdditionalCabacZeroWords*3);2895 printf("Adding %d bytes of padding\n", UInt(numberOfAdditionalCabacZeroWords*3)); 2896 2896 } 2897 2897 else 2898 2898 { 2899 printf("Standard would normally require adding % lld bytes of padding\n", numberOfAdditionalCabacZeroWords*3);2899 printf("Standard would normally require adding %d bytes of padding\n", UInt(numberOfAdditionalCabacZeroWords*3)); 2900 2900 } 2901 2901 }
Note: See TracChangeset for help on using the changeset viewer.