#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"

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 (char *buf, int bufsize) |
| static int | ParameterNameToMapIndex (char *s) |
| static int | InitEncoderParams (void) |
| static int | TestEncoderParams (int bitdepth_qp_scale[3]) |
| static int | DisplayEncoderParams (void) |
| static void | PatchInp (void) |
| void | JMHelpExit (void) |
| int64 | getVideoFileSize (int video_file) |
| static void | getNumberOfFrames (VideoDataFile *input_file) |
| static void | updateMaxValue (FrameFormat *format) |
| static void | updateOutFormat (InputParameters *params) |
| void | Configure (int ac, char *av[]) |
| unsigned | CeilLog2 (unsigned uiVal) |
| void | read_slice_group_info () |
| static void | compute_frameno_params (InputParameters *params) |
| void | PatchInputNoFrames (void) |
Variables | |
| static int | mb_width_cr [4] = {0,8, 8,16} |
| static int | mb_height_cr [4] = {0,8,16,16} |
Definition in file configfile.c.
| unsigned CeilLog2 | ( | unsigned | uiVal | ) |
| static void compute_frameno_params | ( | InputParameters * | params | ) | [static] |
Compute frame numbering related parameters.
Definition at line 898 of file configfile.c.
References InputParameters::EnableIDRGOP, InputParameters::frame_skip, InputParameters::idr_period, InputParameters::last_frame, InputParameters::no_frames, InputParameters::no_frm_base, and InputParameters::NumberBFrames.
Referenced by PatchInp().
| void Configure | ( | int | ac, | |
| char * | av[] | |||
| ) |
Parse the command line parameters and read the config files.
| ac | number of command line parameters | |
| av | command line parameters |
Definition at line 256 of file configfile.c.
References DisplayEncoderParams(), InputParameters::DisplayEncParams, error(), errortext, ET_SIZE, GetConfigFileContent(), InitEncoderParams(), JMHelpExit(), no_mem_exit(), ParseContent(), and PatchInp().
Referenced by main().

| static int DisplayEncoderParams | ( | void | ) | [static] |
Outputs encoding parameters.
Definition at line 700 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 391 of file configfile.c.
References errortext, ET_SIZE, f, and no_mem_exit().
Referenced by Configure(), Init_QMatrix(), and Init_QOffsetMatrix().

| static void getNumberOfFrames | ( | VideoDataFile * | input_file | ) | [static] |
Updates the number of frames to encode based on the file size.
Definition at line 145 of file configfile.c.
References getVideoFileSize(), InputParameters::infile_header, InputParameters::no_frames, InputParameters::source, and InputParameters::start_frame.
Referenced by PatchInp().

| int64 getVideoFileSize | ( | int | video_file | ) |
Reads Input File Size.
Definition at line 127 of file configfile.c.
Referenced by getNumberOfFrames().
| static int InitEncoderParams | ( | void | ) | [static] |
Sets initial values for encoding parameters.
Definition at line 600 of file configfile.c.
Referenced by Configure().
| void JMHelpExit | ( | void | ) |
| static int ParameterNameToMapIndex | ( | char * | s | ) | [static] |
Returns the index number from Map[] for a given parameter name.
| s | parameter name string |
Definition at line 580 of file configfile.c.
Referenced by ParseContent().
| void ParseContent | ( | 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[]).
| buf | buffer to be parsed | |
| bufsize | buffer size of buffer |
Definition at line 448 of file configfile.c.
References error(), errortext, ET_SIZE, and ParameterNameToMapIndex().
Referenced by Configure().

| static void PatchInp | ( | void | ) | [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 938 of file configfile.c.
References InputParameters::adaptive_idr_period, InputParameters::AdaptiveRounding, ImageParameters::auto_crop_bottom, ImageParameters::auto_crop_right, InputParameters::B_List0_refs, InputParameters::B_List1_refs, InputParameters::basicunit, InputParameters::BiPredMESearchRange, InputParameters::BiPredMotionEstimation, InputParameters::BiPredSearch, InputParameters::blc_size, InputParameters::BRefPictures, CeilLog2(), InputParameters::ChromaMCBuffer, InputParameters::ChromaMEEnable, CloseFiles(), compute_frameno_params(), DIR_SPATIAL, DIR_TEMPORAL, InputParameters::direct_spatial_mv_pred_flag, InputParameters::directInferenceFlag, InputParameters::DisableIntra16x16, InputParameters::DisableIntra4x4, InputParameters::DisableSubpelME, InputParameters::EnableIDRGOP, InputParameters::EnableIPCM, InputParameters::EnableOpenGOP, InputParameters::EPZSGrid, InputParameters::EPZSSubPelGrid, error(), errortext, ET_SIZE, F_PEL, InputParameters::FastIntra16x16, InputParameters::FastIntra4x4, InputParameters::FastIntra8x8, InputParameters::FastIntraChroma, InputParameters::FastIntraMD, InputParameters::FastMDEnable, InputParameters::frame_skip, FREXT_CAVLC444, FREXT_Hi422, FREXT_Hi444, FREXT_HP, InputParameters::GenerateMultiplePPS, getNumberOfFrames(), H_PEL, InputParameters::HierarchicalCoding, InputParameters::idr_period, InputParameters::input_file1, InputParameters::intra_delay, InputParameters::intra_period, InputParameters::jumpd, LevelCheck(), InputParameters::Log2MaxFNumMinus4, InputParameters::Log2MaxPOCLsbMinus4, InputParameters::MbInterlace, InputParameters::MEErrorMetric, InputParameters::ModeDecisionMetric, InputParameters::no_frames, InputParameters::no_frm_base, InputParameters::num_ref_frames, InputParameters::num_slice_groups_minus1, InputParameters::NumberBFrames, InputParameters::NumFramesInELSubSeq, InputParameters::NumRedundantHierarchy, InputParameters::of_mode, OneComponentChromaPrediction4x4_regenerate(), OneComponentChromaPrediction4x4_retrieve(), OpenFiles(), InputParameters::output, p_dec, InputParameters::P_List0_refs, p_trace, PAR_OF_ANNEXB, PAR_OF_RTP, ParseFrameNoFormatFromString(), ParseSizeFromString(), InputParameters::part_size, InputParameters::pic_order_cnt_type, InputParameters::PicInterlace, InputParameters::PocMemoryManagement, InputParameters::PrimaryGOPLength, ProfileCheck(), InputParameters::ProfileIDC, Q_PEL, InputParameters::RCEnable, InputParameters::RCUpdateMode, InputParameters::rdopt, InputParameters::RDOQ_CP_Mode, InputParameters::RDOQ_CP_MV, InputParameters::RDOQ_QP_Num, InputParameters::RDPictureDecision, read_slice_group_info(), InputParameters::ReconFile, InputParameters::redundant_pic_flag, InputParameters::ReferenceReorder, InputParameters::ScalingMatrixPresentFlag, InputParameters::search_range, InputParameters::SearchMode, InputParameters::separate_colour_plane_flag, InputParameters::slice_argument, InputParameters::slice_group_map_type, InputParameters::slice_mode, InputParameters::source, InputParameters::sp_periodicity, InputParameters::SparePictureOption, InputParameters::src_BitDepthRescale, TestEncoderParams(), InputParameters::TraceFile, InputParameters::Transform8x8Mode, updateOutFormat(), InputParameters::UseRDOQuant, InputParameters::WeightedBiprediction, InputParameters::WeightedPrediction, InputParameters::WPMCPrecFullRef, InputParameters::WPMCPrecision, YUV400, YUV422, YUV444, and InputParameters::yuv_format.
Referenced by Configure().

| void read_slice_group_info | ( | ) |
read the slice group configuration file. Returns without action if type is not 0, 2 or 6
Definition at line 747 of file configfile.c.
References ImageParameters::auto_crop_bottom, ImageParameters::auto_crop_right, InputParameters::bottom_right, error(), errortext, ET_SIZE, InputParameters::MbInterlace, no_mem_exit(), InputParameters::num_slice_groups_minus1, InputParameters::output, InputParameters::PicInterlace, InputParameters::run_length_minus1, InputParameters::slice_group_id, InputParameters::slice_group_map_type, InputParameters::SliceGroupConfigFileName, and InputParameters::top_left.
Referenced by PatchInp().

| static int TestEncoderParams | ( | int | bitdepth_qp_scale[3] | ) | [static] |
Validates encoding parameters.
Definition at line 623 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 162 of file configfile.c.
Referenced by updateOutFormat().
| static void updateOutFormat | ( | InputParameters * | params | ) | [static] |
Update output format parameters (resolution & bit-depth) given input.
Definition at line 179 of file configfile.c.
References InputParameters::frame_skip, InputParameters::output, InputParameters::source, InputParameters::src_BitDepthRescale, InputParameters::src_resize, updateMaxValue(), YUV400, and InputParameters::yuv_format.
Referenced by PatchInp().
