#include <sys/stat.h>
#include "global.h"
#include "configfile.h"
#include "fmo.h"
#include "conformance.h"
#include "mc_prediction.h"
#include "mv_search.h"
#include "img_io.h"
#include "ratectl.h"
Go to the source code of this file.
Defines | |
#define | INCLUDED_BY_CONFIGFILE_C |
#define | MAX_ITEMS_TO_PARSE 10000 |
Functions | |
char * | GetConfigFileContent (char *Filename) |
static void | ParseContent (InputParameters *p_Inp, Mapping *Map, char *buf, int bufsize) |
static void | PatchInp (ImageParameters *p_Img, InputParameters *p_Inp) |
static int | ParameterNameToMapIndex (Mapping *Map, char *s) |
static int | InitEncoderParams (Mapping *Map) |
static int | TestEncoderParams (Mapping *Map, int bitdepth_qp_scale[3]) |
static int | DisplayEncoderParams (Mapping *Map) |
void | JMHelpExit (void) |
int64 | getVideoFileSize (int video_file) |
static void | getNumberOfFrames (InputParameters *p_Inp, VideoDataFile *input_file) |
static void | updateMaxValue (FrameFormat *format) |
static void | updateOutFormat (InputParameters *p_Inp) |
void | Configure (ImageParameters *p_Img, InputParameters *p_Inp, int ac, char *av[]) |
unsigned | CeilLog2 (unsigned uiVal) |
void | read_slice_group_info (ImageParameters *p_Img, InputParameters *p_Inp) |
static void | compute_frameno_params (InputParameters *p_Inp) |
void | PatchInputNoFrames (InputParameters *p_Inp) |
Variables | |
static const int | mb_width_cr [4] = {0,8, 8,16} |
static const int | mb_height_cr [4] = {0,8,16,16} |
Definition in file configfile.c.
unsigned CeilLog2 | ( | unsigned | uiVal | ) |
static void compute_frameno_params | ( | InputParameters * | p_Inp | ) | [static] |
Compute frame numbering related parameters.
Definition at line 919 of file configfile.c.
References inp_par_enc::EnableIDRGOP, inp_par_enc::frame_skip, inp_par_enc::idr_period, inp_par_enc::no_frames, inp_par_enc::no_frm_base, and inp_par_enc::NumberBFrames.
Referenced by PatchInp().
void Configure | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp, | |||
int | ac, | |||
char * | av[] | |||
) |
Parse the command line parameters and read the config files.
p_Img | ImageParameters structure for encoding | |
p_Inp | InputParameters structure as input configuration | |
ac | number of command line parameters | |
av | command line parameters |
Definition at line 266 of file configfile.c.
References DisplayEncoderParams(), error(), errortext, ET_SIZE, GetConfigFileContent(), InitEncoderParams(), JMHelpExit(), no_mem_exit(), ParseContent(), and PatchInp().
Referenced by main().
static int DisplayEncoderParams | ( | Mapping * | Map | ) | [static] |
Outputs encoding parameters.
Definition at line 721 of file configfile.c.
Referenced by Configure().
char * GetConfigFileContent | ( | char * | Filename | ) |
allocates memory buf, opens file Filename in f, reads contents into buf and returns buf
Filename | name of config file |
Definition at line 407 of file configfile.c.
References errortext, ET_SIZE, and no_mem_exit().
Referenced by Configure(), Init_QMatrix(), and Init_QOffsetMatrix().
static void getNumberOfFrames | ( | InputParameters * | p_Inp, | |
VideoDataFile * | input_file | |||
) | [static] |
Updates the number of frames to encode based on the file size.
Definition at line 146 of file configfile.c.
References getVideoFileSize(), inp_par_enc::infile_header, inp_par_enc::no_frames, inp_par_enc::source, and inp_par_enc::start_frame.
Referenced by PatchInp().
int64 getVideoFileSize | ( | int | video_file | ) |
Reads Input File Size.
Definition at line 128 of file configfile.c.
Referenced by getNumberOfFrames().
static int InitEncoderParams | ( | Mapping * | Map | ) | [static] |
Sets initial values for encoding parameters.
Definition at line 621 of file configfile.c.
Referenced by Configure().
void JMHelpExit | ( | void | ) |
static int ParameterNameToMapIndex | ( | Mapping * | Map, | |
char * | s | |||
) | [static] |
Returns the index number from Map[] for a given parameter name.
Map | Mapping structure | |
s | parameter name string |
Definition at line 601 of file configfile.c.
Referenced by ParseContent().
void ParseContent | ( | InputParameters * | p_Inp, | |
Mapping * | Map, | |||
char * | buf, | |||
int | bufsize | |||
) | [static] |
Parses the character array buf and writes global variable input, which is defined in configfile.h. This hack will continue to be necessary to facilitate the addition of new parameters through the Map[] mechanism (Need compiler-generated addresses in map[]).
p_Inp | InputParameters of configuration | |
Map | Mapping structure to specify the name and value mapping relation | |
buf | buffer to be parsed | |
bufsize | buffer size of buffer |
Definition at line 468 of file configfile.c.
References error(), errortext, ET_SIZE, and ParameterNameToMapIndex().
Referenced by Configure().
static void PatchInp | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp | |||
) | [static] |
Checks the input parameters for consistency.
the number of slice groups is forced to be 1 for slice group type 3-5
Definition at line 959 of file configfile.c.
References inp_par_enc::AdaptiveRounding, inp_par_enc::B_List0_refs, inp_par_enc::B_List1_refs, inp_par_enc::BiPredMESearchRange, inp_par_enc::BiPredMotionEstimation, inp_par_enc::BiPredSearch, inp_par_enc::BRefPictures, CeilLog2(), CloseFiles(), compute_frameno_params(), DIR_SPATIAL, DIR_TEMPORAL, inp_par_enc::direct_spatial_mv_pred_flag, inp_par_enc::directInferenceFlag, inp_par_enc::DisableSubpelME, inp_par_enc::EnableIDRGOP, inp_par_enc::EnableOpenGOP, error(), errortext, ET_SIZE, F_PEL, inp_par_enc::frame_skip, FREXT_CAVLC444, FREXT_Hi422, FREXT_Hi444, FREXT_HP, getNumberOfFrames(), inp_par_enc::idr_period, inp_par_enc::input_file1, inp_par_enc::intra_delay, inp_par_enc::intra_period, inp_par_enc::jumpd, LevelCheck(), inp_par_enc::Log2MaxFNumMinus4, inp_par_enc::Log2MaxPOCLsbMinus4, inp_par_enc::MbInterlace, inp_par_enc::no_frames, inp_par_enc::no_frm_base, inp_par_enc::num_ref_frames, inp_par_enc::num_slice_groups_minus1, inp_par_enc::NumberBFrames, inp_par_enc::NumRedundantHierarchy, inp_par_enc::of_mode, OpenFiles(), inp_par_enc::output, img_par::p_dec, inp_par_enc::P_List0_refs, PAR_OF_ANNEXB, PAR_OF_RTP, ParseFrameNoFormatFromString(), ParseSizeFromString(), inp_par_enc::pic_order_cnt_type, inp_par_enc::PicInterlace, inp_par_enc::PocMemoryManagement, inp_par_enc::PrimaryGOPLength, ProfileCheck(), inp_par_enc::ProfileIDC, Q_PEL, inp_par_enc::RCEnable, inp_par_enc::RDPictureDecision, read_slice_group_info(), inp_par_enc::ReconFile, inp_par_enc::ReferenceReorder, inp_par_enc::search_range, inp_par_enc::SetFirstAsLongTerm, inp_par_enc::slice_argument, inp_par_enc::slice_mode, inp_par_enc::source, inp_par_enc::sp_periodicity, inp_par_enc::src_BitDepthRescale, inp_par_enc::symbol_mode, TestEncoderParams(), inp_par_enc::TraceFile, updateOutFormat(), inp_par_enc::WeightedBiprediction, inp_par_enc::WeightedPrediction, YUV400, YUV422, YUV444, and inp_par_enc::yuv_format.
Referenced by Configure().
void read_slice_group_info | ( | ImageParameters * | p_Img, | |
InputParameters * | p_Inp | |||
) |
read the slice group configuration file. Returns without action if type is not 0, 2 or 6
Definition at line 768 of file configfile.c.
References error(), errortext, ET_SIZE, inp_par_enc::MbInterlace, no_mem_exit(), inp_par_enc::num_slice_groups_minus1, inp_par_enc::output, inp_par_enc::PicInterlace, inp_par_enc::run_length_minus1, inp_par_enc::slice_group_id, inp_par_enc::SliceGroupConfigFileName, and inp_par_enc::top_left.
Referenced by PatchInp().
static int TestEncoderParams | ( | Mapping * | Map, | |
int | bitdepth_qp_scale[3] | |||
) | [static] |
Validates encoding parameters.
Definition at line 644 of file configfile.c.
References error(), errortext, and ET_SIZE.
Referenced by PatchInp().
static void updateMaxValue | ( | FrameFormat * | format | ) | [static] |
Updates images max values.
Definition at line 163 of file configfile.c.
Referenced by updateOutFormat().
static void updateOutFormat | ( | InputParameters * | p_Inp | ) | [static] |
Update output format parameters (resolution & bit-depth) given input.
Definition at line 180 of file configfile.c.
References inp_par_enc::frame_skip, inp_par_enc::output, inp_par_enc::source, inp_par_enc::src_BitDepthRescale, inp_par_enc::src_resize, updateMaxValue(), YUV400, and inp_par_enc::yuv_format.
Referenced by PatchInp().