|
HEVC Test Model (HM)
HM-16.18
|
YUV file I/O class. More...
#include <TVideoIOYuv.h>

Public Member Functions | |
| TVideoIOYuv () | |
| virtual | ~TVideoIOYuv () |
| Void | open (const std::string &fileName, Bool bWriteMode, const Int fileBitDepth[MAX_NUM_CHANNEL_TYPE], const Int MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], const Int internalBitDepth[MAX_NUM_CHANNEL_TYPE]) |
| open or create file More... | |
| Void | close () |
| close file More... | |
| Void | skipFrames (Int numFrames, UInt width, UInt height, ChromaFormat format) |
| 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 More... | |
| 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 More... | |
| 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) |
| Bool | isEof () |
| check for end-of-file More... | |
| Bool | isFail () |
| check for failure More... | |
Static Public Member Functions | |
| static Void | ColourSpaceConvert (const TComPicYuv &src, TComPicYuv &dest, const InputColourSpaceConversion conversion, Bool bIsForwards) |
Private Attributes | |
| fstream | m_cHandle |
| file handle More... | |
| Int | m_fileBitdepth [MAX_NUM_CHANNEL_TYPE] |
| bitdepth of input/output video file More... | |
| Int | m_MSBExtendedBitDepth [MAX_NUM_CHANNEL_TYPE] |
| bitdepth after addition of MSBs (with value 0) More... | |
| Int | m_bitdepthShift [MAX_NUM_CHANNEL_TYPE] |
| number of bits to increase or decrease image by before/after write/read More... | |
YUV file I/O class.
Definition at line 54 of file TVideoIOYuv.h.
|
inline |
Definition at line 63 of file TVideoIOYuv.h.
|
inlinevirtual |
Definition at line 64 of file TVideoIOYuv.h.
| Void TVideoIOYuv::close | ( | ) |
close file
Definition at line 167 of file TVideoIOYuv.cpp.
|
static |
Definition at line 981 of file TVideoIOYuv.cpp.
| Bool TVideoIOYuv::isEof | ( | ) |
check for end-of-file
Definition at line 172 of file TVideoIOYuv.cpp.
| Bool TVideoIOYuv::isFail | ( | ) |
check for failure
Definition at line 177 of file TVideoIOYuv.cpp.
| Void TVideoIOYuv::open | ( | const std::string & | fileName, |
| Bool | bWriteMode, | ||
| const Int | fileBitDepth[MAX_NUM_CHANNEL_TYPE], | ||
| const Int | MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE], | ||
| const Int | internalBitDepth[MAX_NUM_CHANNEL_TYPE] | ||
| ) |
open or create file
Open file for reading/writing Y'CbCr frames.
Frames read/written have bitdepth fileBitDepth, and are automatically formatted as 8 or 16 bit word values (see TVideoIOYuv::write()).
Image data read or written is converted to/from internalBitDepth (See scalePlane(), TVideoIOYuv::read() and TVideoIOYuv::write() for further details).
| pchFile | file name string |
| bWriteMode | file open mode: true=write, false=read |
| fileBitDepth | bit-depth array of input/output file data. |
| MSBExtendedBitDepth | |
| internalBitDepth | bit-depth array to scale image data to/from when reading/writing. |
Definition at line 120 of file TVideoIOYuv.cpp.
| Bool TVideoIOYuv::read | ( | TComPicYuv * | pPicYuvUser, |
| TComPicYuv * | pPicYuvTrueOrg, | ||
| const InputColourSpaceConversion | ipcsc, | ||
| Int | aiPad[2], | ||
| ChromaFormat | format = NUM_CHROMA_FORMAT, |
||
| const Bool | bClipToRec709 = false |
||
| ) |
read one frame with padding parameter
Read one Y'CbCr frame, performing any required input scaling to change from the bitdepth of the input file to the internal bit-depth.
If a bit-depth reduction is required, and internalBitdepth >= 8, then the input file is assumed to be ITU-R BT.601/709 compliant, and the resulting data is clipped to the appropriate legal range, as if the file had been provided at the lower-bitdepth compliant to Rec601/709.
| pPicYuvUser | input picture YUV buffer class pointer |
| pPicYuvTrueOrg | |
| ipcsc | |
| aiPad | source padding size, aiPad[0] = horizontal, aiPad[1] = vertical |
| format | chroma format |
Definition at line 675 of file TVideoIOYuv.cpp.
| Void TVideoIOYuv::skipFrames | ( | Int | numFrames, |
| UInt | width, | ||
| UInt | height, | ||
| ChromaFormat | format | ||
| ) |
Skip numFrames in input.
This function correctly handles cases where the input file is not seekable, by consuming bytes.
Definition at line 188 of file TVideoIOYuv.cpp.
| Bool TVideoIOYuv::write | ( | TComPicYuv * | pPicYuvUser, |
| const InputColourSpaceConversion | ipCSC, | ||
| Int | confLeft = 0, |
||
| Int | confRight = 0, |
||
| Int | confTop = 0, |
||
| Int | confBottom = 0, |
||
| ChromaFormat | format = NUM_CHROMA_FORMAT, |
||
| const Bool | bClipToRec709 = false |
||
| ) |
write one YUV frame with padding parameter
Write one Y'CbCr frame. No bit-depth conversion is performed, pcPicYuv is assumed to be at TVideoIO::m_fileBitdepth depth.
| pPicYuvUser | input picture YUV buffer class pointer |
| ipCSC | |
| confLeft | conformance window left border |
| confRight | conformance window right border |
| confTop | conformance window top border |
| confBottom | conformance window bottom border |
| format | chroma format |
Definition at line 755 of file TVideoIOYuv.cpp.
| Bool TVideoIOYuv::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 |
||
| ) |
Definition at line 843 of file TVideoIOYuv.cpp.
|
private |
number of bits to increase or decrease image by before/after write/read
Definition at line 60 of file TVideoIOYuv.h.
|
private |
file handle
Definition at line 57 of file TVideoIOYuv.h.
|
private |
bitdepth of input/output video file
Definition at line 58 of file TVideoIOYuv.h.
|
private |
bitdepth after addition of MSBs (with value 0)
Definition at line 59 of file TVideoIOYuv.h.
1.8.5