41 namespace po = df::program_options_lite;
46 string filename_in, filename_out;
48 UInt bitdepth_in, bitdepth_out, chromaFormatRaw;
54 (
"help", do_help,
false,
"this help text")
55 (
"InputFile,i", filename_in,
string(
""),
"input file to convert")
56 (
"OutputFile,o", filename_out,
string(
""),
"output file")
57 (
"SourceWidth", width, 0u,
"source picture width")
58 (
"SourceHeight", height, 0u,
"source picture height")
59 (
"InputBitDepth", bitdepth_in, 8u,
"bit-depth of input file")
60 (
"OutputBitDepth", bitdepth_out, 8u,
"bit-depth of output file")
61 (
"ChromaFormat", chromaFormatRaw, 420u,
"chroma format. 400, 420, 422 or 444 only")
62 (
"NumFrames", num_frames, 0xffffffffu,
"number of frames to process")
63 (
"FrameSkip,-fs", num_frames_skip, 0u,
"Number of frames to skip at start of input YUV")
70 if (argc == 1 || do_help)
78 switch (chromaFormatRaw)
85 fprintf(stderr,
"Bad chroma format string\n");
97 inputBitDepths [channelTypeIndex] = bitdepth_in;
98 outputBitDepths[channelTypeIndex] = bitdepth_out;
101 input.
open((
char*)filename_in.c_str(),
false, inputBitDepths, inputBitDepths, outputBitDepths);
102 output.
open((
char*)filename_out.c_str(),
true, outputBitDepths, outputBitDepths, outputBitDepths);
104 input.
skipFrames(num_frames_skip, width, height, chromaFormatIDC);
114 UInt num_frames_processed = 0;
115 while (!input.
isEof())
123 for (
Int y = 0; y < height; y++)
125 for (
Int x = 0; x < height; x++)
136 num_frames_processed++;
137 if (num_frames_processed == num_frames)
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
void doHelp(ostream &out, Options &opts, unsigned columns)
Int getStride(const ComponentID id) const
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
Void createWithoutCUInfo(const Int picWidth, const Int picHeight, const ChromaFormat chromaFormatIDC, const Bool bUseMargin=false, const UInt maxCUWidth=0, const UInt maxCUHeight=0)
used for margin only
Bool isEof()
check for end-of-file
void setDefaults(Options &opts)
list< const char * > scanArgv(Options &opts, unsigned argc, const char *argv[], ErrorReporter &error_reporter)
YUV file I/O class (header)
OptionSpecific addOptions()
int main(int argc, char *argv[])
ChromaFormat
chroma formats (according to semantics of chroma_format_idc)
picture YUV buffer class (header)
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
Pel * getAddr(const ComponentID ch)
Void skipFrames(Int numFrames, UInt width, UInt height, ChromaFormat format)