HEVC Test Model (HM)  HM-16.18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
TVideoIOYuv.cpp File Reference

YUV file I/O class. More...

#include <cstdlib>
#include <fcntl.h>
#include <assert.h>
#include <sys/stat.h>
#include <fstream>
#include <iostream>
#include <memory.h>
#include "TLibCommon/TComRom.h"
#include "TVideoIOYuv.h"
Include dependency graph for TVideoIOYuv.cpp:

Go to the source code of this file.

Functions

static Void scalePlane (Pel *img, const UInt stride, const UInt width, const UInt height, Int shiftbits, Pel minval, Pel maxval)
 
static Void copyPlane (const TComPicYuv &src, const ComponentID srcPlane, TComPicYuv &dest, const ComponentID destPlane)
 
static Bool readPlane (Pel *dst, istream &fd, Bool is16bit, UInt stride444, UInt width444, UInt height444, UInt pad_x444, UInt pad_y444, const ComponentID compID, const ChromaFormat destFormat, const ChromaFormat fileFormat, const UInt fileBitDepth)
 
static Bool writePlane (ostream &fd, Pel *src, Bool is16bit, UInt stride444, UInt width444, UInt height444, const ComponentID compID, const ChromaFormat srcFormat, const ChromaFormat fileFormat, const UInt fileBitDepth)
 
static Bool writeField (ostream &fd, Pel *top, Pel *bottom, Bool is16bit, UInt stride444, UInt width444, UInt height444, const ComponentID compID, const ChromaFormat srcFormat, const ChromaFormat fileFormat, const UInt fileBitDepth, const Bool isTff)
 

Detailed Description

YUV file I/O class.

Definition in file TVideoIOYuv.cpp.

Function Documentation

static Void copyPlane ( const TComPicYuv src,
const ComponentID  srcPlane,
TComPicYuv dest,
const ComponentID  destPlane 
)
static

Definition at line 964 of file TVideoIOYuv.cpp.

static Bool readPlane ( Pel dst,
istream &  fd,
Bool  is16bit,
UInt  stride444,
UInt  width444,
UInt  height444,
UInt  pad_x444,
UInt  pad_y444,
const ComponentID  compID,
const ChromaFormat  destFormat,
const ChromaFormat  fileFormat,
const UInt  fileBitDepth 
)
static

Read width*height pixels from fd into dst, optionally padding the left and right edges by edge-extension. Input may be either 8bit or 16bit little-endian lsb-aligned words.

Parameters
dstdestination image plane
fdinput file stream
is16bittrue if input file carries > 8bit data, false otherwise.
stride444distance between vertically adjacent pixels of dst.
width444width of active area in dst.
height444height of active area in dst.
pad_x444length of horizontal padding.
pad_y444length of vertical padding.
compIDchroma component
destFormatchroma format of image
fileFormatchroma format of file
fileBitDepthcomponent bit depth in file
Returns
true for success, false in case of error

Definition at line 249 of file TVideoIOYuv.cpp.

static Void scalePlane ( Pel img,
const UInt  stride,
const UInt  width,
const UInt  height,
Int  shiftbits,
Pel  minval,
Pel  maxval 
)
static

Scale all pixels in img depending upon sign of shiftbits by a factor of 2shiftbits.

Parameters
imgpointer to image to be transformed
stridedistance between vertically adjacent pixels of img.
widthwidth of active area in img.
heightheight of active area in img.
shiftbitsif zero, no operation performed if > 0, multiply by 2shiftbits, see scalePlane() if < 0, divide and round by 2shiftbits and clip, see invScalePlane().
minvalminimum clipping value when dividing.
maxvalmaximum clipping value when dividing.

Definition at line 70 of file TVideoIOYuv.cpp.

static Bool writeField ( ostream &  fd,
Pel top,
Pel bottom,
Bool  is16bit,
UInt  stride444,
UInt  width444,
UInt  height444,
const ComponentID  compID,
const ChromaFormat  srcFormat,
const ChromaFormat  fileFormat,
const UInt  fileBitDepth,
const Bool  isTff 
)
static

Definition at line 524 of file TVideoIOYuv.cpp.

static Bool writePlane ( ostream &  fd,
Pel src,
Bool  is16bit,
UInt  stride444,
UInt  width444,
UInt  height444,
const ComponentID  compID,
const ChromaFormat  srcFormat,
const ChromaFormat  fileFormat,
const UInt  fileBitDepth 
)
static

Write an image plane (width444*height444 pixels) from src into output stream fd.

Parameters
fdoutput file stream
srcsource image
is16bittrue if input file carries > 8bit data, false otherwise.
stride444distance between vertically adjacent pixels of src.
width444width of active area in src.
height444height of active area in src.
compIDchroma component
srcFormatchroma format of image
fileFormatchroma format of file
fileBitDepthcomponent bit depth in file
Returns
true for success, false in case of error

Definition at line 401 of file TVideoIOYuv.cpp.