HEVC Test Model (HM)  HM-16.3
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
TVideoIOYuv Class Reference

YUV file I/O class. More...

#include <TVideoIOYuv.h>

Collaboration diagram for TVideoIOYuv:
Collaboration graph
[legend]

Public Member Functions

 TVideoIOYuv ()
 
virtual ~TVideoIOYuv ()
 
Void open (Char *pchFile, 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 (UInt numFrames, UInt width, UInt height, ChromaFormat format)
 
Bool read (TComPicYuv *pPicYuv, TComPicYuv *pPicYuvTrueOrg, const InputColourSpaceConversion ipcsc, Int aiPad[2], ChromaFormat fileFormat=NUM_CHROMA_FORMAT)
 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)
 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, Bool isTff=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, const Int bitDepths[MAX_NUM_CHANNEL_TYPE], 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...
 

Detailed Description

YUV file I/O class.

Definition at line 54 of file TVideoIOYuv.h.

Constructor & Destructor Documentation

TVideoIOYuv::TVideoIOYuv ( )
inline

Definition at line 63 of file TVideoIOYuv.h.

virtual TVideoIOYuv::~TVideoIOYuv ( )
inlinevirtual

Definition at line 64 of file TVideoIOYuv.h.

Member Function Documentation

Void TVideoIOYuv::close ( )

close file

Definition at line 165 of file TVideoIOYuv.cpp.

Void TVideoIOYuv::ColourSpaceConvert ( const TComPicYuv src,
TComPicYuv dest,
const InputColourSpaceConversion  conversion,
const Int  bitDepths[MAX_NUM_CHANNEL_TYPE],
Bool  bIsForwards 
)
static

Definition at line 1013 of file TVideoIOYuv.cpp.

Bool TVideoIOYuv::isEof ( )

check for end-of-file

Definition at line 170 of file TVideoIOYuv.cpp.

Bool TVideoIOYuv::isFail ( )

check for failure

Definition at line 175 of file TVideoIOYuv.cpp.

Void TVideoIOYuv::open ( Char pchFile,
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).

Parameters
pchFilefile name string
bWriteModefile open mode: true=read, false=write
fileBitDepthbit-depth array of input/output file data.
MSBExtendedBitDepth
internalBitDepthbit-depth array to scale image data to/from when reading/writing.

Definition at line 118 of file TVideoIOYuv.cpp.

Bool TVideoIOYuv::read ( TComPicYuv pPicYuvUser,
TComPicYuv pPicYuvTrueOrg,
const InputColourSpaceConversion  ipcsc,
Int  aiPad[2],
ChromaFormat  format = NUM_CHROMA_FORMAT 
)

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.

Parameters
pPicYuvUserinput picture YUV buffer class pointer
pPicYuvTrueOrg
ipcsc
aiPadsource padding size, aiPad[0] = horizontal, aiPad[1] = vertical
formatchroma format
Returns
true for success, false in case of error

Definition at line 680 of file TVideoIOYuv.cpp.

Void TVideoIOYuv::skipFrames ( UInt  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 186 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 
)

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.

Parameters
pPicYuvUserinput picture YUV buffer class pointer
ipCSC
confLeftconformance window left border
confRightconformance window right border
confTopconformance window top border
confBottomconformance window bottom border
formatchroma format
Returns
true for success, false in case of error

Definition at line 767 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,
Bool  isTff = false 
)

Definition at line 864 of file TVideoIOYuv.cpp.

Member Data Documentation

Int TVideoIOYuv::m_bitdepthShift[MAX_NUM_CHANNEL_TYPE]
private

number of bits to increase or decrease image by before/after write/read

Definition at line 60 of file TVideoIOYuv.h.

fstream TVideoIOYuv::m_cHandle
private

file handle

Definition at line 57 of file TVideoIOYuv.h.

Int TVideoIOYuv::m_fileBitdepth[MAX_NUM_CHANNEL_TYPE]
private

bitdepth of input/output video file

Definition at line 58 of file TVideoIOYuv.h.

Int TVideoIOYuv::m_MSBExtendedBitDepth[MAX_NUM_CHANNEL_TYPE]
private

bitdepth after addition of MSBs (with value 0)

Definition at line 59 of file TVideoIOYuv.h.


The documentation for this class was generated from the following files: