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"
Go to the source code of this file.
|
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) |
|
YUV file I/O class.
Definition in 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
-
dst | destination image plane |
fd | input file stream |
is16bit | true if input file carries > 8bit data, false otherwise. |
stride444 | distance between vertically adjacent pixels of dst. |
width444 | width of active area in dst. |
height444 | height of active area in dst. |
pad_x444 | length of horizontal padding. |
pad_y444 | length of vertical padding. |
compID | chroma component |
destFormat | chroma format of image |
fileFormat | chroma format of file |
fileBitDepth | component bit depth in file |
- Returns
- true for success, false in case of error
Definition at line 249 of file TVideoIOYuv.cpp.
Scale all pixels in img depending upon sign of shiftbits by a factor of 2shiftbits.
- Parameters
-
img | pointer to image to be transformed |
stride | distance between vertically adjacent pixels of img. |
width | width of active area in img. |
height | height of active area in img. |
shiftbits | if zero, no operation performed if > 0, multiply by 2shiftbits, see scalePlane() if < 0, divide and round by 2shiftbits and clip, see invScalePlane(). |
minval | minimum clipping value when dividing. |
maxval | maximum 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 |
Write an image plane (width444*height444 pixels) from src into output stream fd.
- Parameters
-
fd | output file stream |
src | source image |
is16bit | true if input file carries > 8bit data, false otherwise. |
stride444 | distance between vertically adjacent pixels of src. |
width444 | width of active area in src. |
height444 | height of active area in src. |
compID | chroma component |
srcFormat | chroma format of image |
fileFormat | chroma format of file |
fileBitDepth | component bit depth in file |
- Returns
- true for success, false in case of error
Definition at line 401 of file TVideoIOYuv.cpp.