Changeset 1323 in SHVCSoftware for branches/SHM-dev/source/Lib
- Timestamp:
- 22 Jul 2015, 00:03:09 (9 years ago)
- Location:
- branches/SHM-dev/source/Lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h
r1304 r1323 213 213 #define ADAPT_SR_SCALE 1 ///< division factor for adaptive search range 214 214 215 #define CLIP_TO_709_RANGE 0216 217 215 // Early-skip threshold (encoder) 218 216 #define EARLY_SKIP_THRES 1.50 ///< if RD < thres*avg[BestSkipRD] -
branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.cpp
r1320 r1323 678 678 * @return true for success, false in case of error 679 679 */ 680 Bool TVideoIOYuv::read ( TComPicYuv* pPicYuvUser, TComPicYuv* pPicYuvTrueOrg, const InputColourSpaceConversion ipcsc, Int aiPad[2], ChromaFormat format )680 Bool TVideoIOYuv::read ( TComPicYuv* pPicYuvUser, TComPicYuv* pPicYuvTrueOrg, const InputColourSpaceConversion ipcsc, Int aiPad[2], ChromaFormat format, const Bool bClipToRec709 ) 681 681 { 682 682 // check end-of-file … … 720 720 const Int desired_bitdepth = m_MSBExtendedBitDepth[chType] + m_bitdepthShift[chType]; 721 721 722 #if !CLIP_TO_709_RANGE 723 const Pel minval = 0; 724 const Pel maxval = (1 << desired_bitdepth) - 1; 725 #else 726 const Bool b709Compliance=(m_bitdepthShift[chType] < 0 && desired_bitdepth >= 8); /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 722 const Bool b709Compliance=(bClipToRec709) && (m_bitdepthShift[chType] < 0 && desired_bitdepth >= 8); /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 727 723 const Pel minval = b709Compliance? (( 1 << (desired_bitdepth - 8)) ) : 0; 728 724 const Pel maxval = b709Compliance? ((0xff << (desired_bitdepth - 8)) -1) : (1 << desired_bitdepth) - 1; 729 #endif730 725 731 726 if (! readPlane(pPicYuv->getAddr(compID), m_cHandle, is16bit, stride444, width444, height444, pad_h444, pad_v444, compID, pPicYuv->getChromaFormat(), format, m_fileBitdepth[chType])) … … 760 755 * @return true for success, false in case of error 761 756 */ 762 Bool TVideoIOYuv::write( TComPicYuv* pPicYuvUser, const InputColourSpaceConversion ipCSC, Int confLeft, Int confRight, Int confTop, Int confBottom, ChromaFormat format )757 Bool TVideoIOYuv::write( TComPicYuv* pPicYuvUser, const InputColourSpaceConversion ipCSC, Int confLeft, Int confRight, Int confTop, Int confBottom, ChromaFormat format, const Bool bClipToRec709 ) 763 758 { 764 759 TComPicYuv cPicYuvCSCd; … … 811 806 const ComponentID compID=ComponentID(comp); 812 807 const ChannelType ch=toChannelType(compID); 813 #if !CLIP_TO_709_RANGE 814 const Pel minval = 0; 815 const Pel maxval = (1 << m_MSBExtendedBitDepth[ch]) - 1; 816 #else 817 const Bool b709Compliance=(-m_bitdepthShift[ch] < 0 && m_MSBExtendedBitDepth[ch] >= 8); /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 808 const Bool b709Compliance = bClipToRec709 && (-m_bitdepthShift[ch] < 0 && m_MSBExtendedBitDepth[ch] >= 8); /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 818 809 const Pel minval = b709Compliance? (( 1 << (m_MSBExtendedBitDepth[ch] - 8)) ) : 0; 819 810 const Pel maxval = b709Compliance? ((0xff << (m_MSBExtendedBitDepth[ch] - 8)) -1) : (1 << m_MSBExtendedBitDepth[ch]) - 1; 820 #endif821 811 822 812 scalePlane(dstPicYuv->getAddr(compID), dstPicYuv->getStride(compID), dstPicYuv->getWidth(compID), dstPicYuv->getHeight(compID), -m_bitdepthShift[ch], minval, maxval); … … 852 842 } 853 843 854 Bool TVideoIOYuv::write( TComPicYuv* pPicYuvUserTop, TComPicYuv* pPicYuvUserBottom, const InputColourSpaceConversion ipCSC, Int confLeft, Int confRight, Int confTop, Int confBottom, ChromaFormat format, const Bool isTff )844 Bool TVideoIOYuv::write( TComPicYuv* pPicYuvUserTop, TComPicYuv* pPicYuvUserBottom, const InputColourSpaceConversion ipCSC, Int confLeft, Int confRight, Int confTop, Int confBottom, ChromaFormat format, const Bool isTff, const Bool bClipToRec709 ) 855 845 { 856 846 … … 906 896 const ComponentID compID=ComponentID(comp); 907 897 const ChannelType ch=toChannelType(compID); 908 #if !CLIP_TO_709_RANGE 909 const Pel minval = 0; 910 const Pel maxval = (1 << m_MSBExtendedBitDepth[ch]) - 1; 911 #else 912 const Bool b709Compliance=(-m_bitdepthShift[ch] < 0 && m_MSBExtendedBitDepth[ch] >= 8); /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 898 const Bool b709Compliance=bClipToRec709 && (-m_bitdepthShift[ch] < 0 && m_MSBExtendedBitDepth[ch] >= 8); /* ITU-R BT.709 compliant clipping for converting say 10b to 8b */ 913 899 const Pel minval = b709Compliance? (( 1 << (m_MSBExtendedBitDepth[ch] - 8)) ) : 0; 914 900 const Pel maxval = b709Compliance? ((0xff << (m_MSBExtendedBitDepth[ch] - 8)) -1) : (1 << m_MSBExtendedBitDepth[ch]) - 1; 915 #endif916 901 917 902 scalePlane(dstPicYuv->getAddr(compID), dstPicYuv->getStride(compID), dstPicYuv->getWidth(compID), dstPicYuv->getHeight(compID), -m_bitdepthShift[ch], minval, maxval); -
branches/SHM-dev/source/Lib/TLibVideoIO/TVideoIOYuv.h
r1307 r1323 72 72 73 73 74 Bool read ( TComPicYuv* pPicYuv, TComPicYuv* pPicYuvTrueOrg, const InputColourSpaceConversion ipcsc, Int aiPad[2], ChromaFormat fileFormat=NUM_CHROMA_FORMAT ); ///< read one frame with padding parameter 75 Bool write ( TComPicYuv* pPicYuv, const InputColourSpaceConversion ipCSC, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0, ChromaFormat fileFormat=NUM_CHROMA_FORMAT ); ///< write one YUV frame with padding parameter 76 Bool write ( TComPicYuv* pPicYuvTop, TComPicYuv* pPicYuvBottom, const InputColourSpaceConversion ipCSC, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0, ChromaFormat fileFormat=NUM_CHROMA_FORMAT, Bool isTff=false); 74 // If fileFormat=NUM_CHROMA_FORMAT, use the format defined by pPicYuvTrueOrg 75 Bool read ( TComPicYuv* pPicYuv, TComPicYuv* pPicYuvTrueOrg, const InputColourSpaceConversion ipcsc, Int aiPad[2], ChromaFormat fileFormat=NUM_CHROMA_FORMAT, const Bool bClipToRec709=false ); ///< read one frame with padding parameter 76 77 // If fileFormat=NUM_CHROMA_FORMAT, use the format defined by pPicYuv 78 Bool write ( TComPicYuv* pPicYuv, const InputColourSpaceConversion ipCSC, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0, ChromaFormat fileFormat=NUM_CHROMA_FORMAT, const Bool bClipToRec709=false ); ///< write one YUV frame with padding parameter 79 80 // If fileFormat=NUM_CHROMA_FORMAT, use the format defined by pPicYuvTop and pPicYuvBottom 81 Bool write ( TComPicYuv* pPicYuvTop, TComPicYuv* pPicYuvBottom, const InputColourSpaceConversion ipCSC, Int confLeft=0, Int confRight=0, Int confTop=0, Int confBottom=0, ChromaFormat fileFormat=NUM_CHROMA_FORMAT, const Bool isTff=false, const Bool bClipToRec709=false); 77 82 static Void ColourSpaceConvert(const TComPicYuv &src, TComPicYuv &dest, const InputColourSpaceConversion conversion, Bool bIsForwards); 78 83
Note: See TracChangeset for help on using the changeset viewer.