Skip to content

Commit

Permalink
Cleanup: Convert tabs to spaces and remove trailing spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Degawa <ccom@randomderp.com>
  • Loading branch information
1480c1 committed Feb 3, 2020
1 parent ee708ce commit 3b24511
Show file tree
Hide file tree
Showing 221 changed files with 47,389 additions and 47,389 deletions.
46 changes: 23 additions & 23 deletions Source/API/EbApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,12 @@ typedef struct EB_H265_ENC_CONFIGURATION

/* A preset defining the quality vs density tradeoff point that the encoding
* is to be performed at. 0 is the highest quality mode, 11 is the highest
* density mode.
*
* density mode.
*
* [0, 11] for >= 4k resolution.
* [0, 10] for >= 1080p resolution.
* [0, 9] for all resolution.
*
*
* Default is 7. */
uint8_t encMode;

Expand All @@ -190,8 +190,8 @@ typedef struct EB_H265_ENC_CONFIGURATION
*/
uint8_t tune;

/* Flag to enable for lower latency mode. The change is lossless.
*
/* Flag to enable for lower latency mode. The change is lossless.
*
* Default is 0. */
uint8_t latencyMode;

Expand Down Expand Up @@ -225,7 +225,7 @@ typedef struct EB_H265_ENC_CONFIGURATION

/* Prediction structure used to construct GOP. There are two main structures
* supported, which are: Low Delay (P or B) and Random Access.
*
*
* In Low Delay structure, pictures within a mini GOP refer to the previously
* encoded pictures in display order. In other words, pictures with display
* order N can only be referenced by pictures with display order greater than
Expand Down Expand Up @@ -261,7 +261,7 @@ typedef struct EB_H265_ENC_CONFIGURATION
*
* Default is 0. */
uint32_t sourceHeight;

/* The frequecy of images being displayed. If the number is less than 1000,
* the input frame rate is an integer number between 1 and 60, else the input
* number is in Q16 format, shifted by 16 bits, where max allowed is 240 fps.
Expand Down Expand Up @@ -319,7 +319,7 @@ typedef struct EB_H265_ENC_CONFIGURATION

/* Enables subjective quality algorithms to reduce the output bitrate with
* minimal or no subjective visual quality impact. Only applicable to tune 0.
*
*
* Default is 0. */
uint8_t bitRateReduction;

Expand Down Expand Up @@ -352,7 +352,7 @@ typedef struct EB_H265_ENC_CONFIGURATION
uint32_t qp;

/* Path to file that contains qp values.
*
*
* Default is null.*/
uint8_t useQpFile;

Expand All @@ -377,7 +377,7 @@ typedef struct EB_H265_ENC_CONFIGURATION


// Motion Estimation Tools

/* Flag to enable the use of default ME HME parameters.
*
* Default is 1. */
Expand Down Expand Up @@ -412,7 +412,7 @@ typedef struct EB_H265_ENC_CONFIGURATION


// Rate Control

/* Rate control mode.
*
* 0 = Constant QP.
Expand Down Expand Up @@ -477,7 +477,7 @@ typedef struct EB_H265_ENC_CONFIGURATION
uint32_t highDynamicRangeInput;

/* Flag to simplify the detection of boundary between access units.
*
*
* Default is 0. */
uint32_t accessUnitDelimiter;

Expand Down Expand Up @@ -542,24 +542,24 @@ typedef struct EB_H265_ENC_CONFIGURATION

// VBV Parameters
/* Sets the maximum rate the VBV buffer should be assumed to refill at
*
*
* Default is 0. */
uint32_t vbvMaxrate;

/* Sets the size of the VBV buffer in bits.
/* Sets the size of the VBV buffer in bits.
*
* Default is 0. */
uint32_t vbvBufsize;

/* Sets how full the VBV buffer must be before playback starts. If picture
* number is 0, then the initial fill is vbv-init * vbvBufferSize.
* Otherwise, it is interpreted as the initial fill in bits.
* number is 0, then the initial fill is vbv-init * vbvBufferSize.
* Otherwise, it is interpreted as the initial fill in bits.
*
* Default is 90. */
uint64_t vbvBufInit;

/* Enables the buffering period SEI and picture timing SEI to signal the HRD
* parameters.
* parameters.
*
* 0 = disable.
* 1 = enable.
Expand Down Expand Up @@ -602,16 +602,16 @@ typedef struct EB_H265_ENC_CONFIGURATION
uint32_t threadCount;

// ASM Type

/* Assembly instruction set used by encoder.
*
* 0 = non-AVX2, C only.
* 1 = up to AVX512, auto-select highest assembly instruction set supported.
*
*
* Default is 1. */
uint32_t asmType;


// Demo features

/* Flag to enable the Speed Control functionality to achieve the real-time
Expand All @@ -637,7 +637,7 @@ typedef struct EB_H265_ENC_CONFIGURATION

// Debug tools

/* Output reconstructed yuv used for debug purposes. The value is set through
/* Output reconstructed yuv used for debug purposes. The value is set through
* ReconFile token (-o) and using the feature will affect the speed of encoder.
*
* Default is 0. */
Expand Down Expand Up @@ -683,7 +683,7 @@ EB_API EB_ERRORTYPE EbInitHandle(
/* STEP 2: Set all configuration parameters.
*
* Parameter:
* @ *h265EncComponent Encoder handler.
* @ *h265EncComponent Encoder handler.
* @ *pComponentParameterStructure Encoder and buffer configurations will be copied to the library. */
EB_API EB_ERRORTYPE EbH265EncSetParameter(
EB_COMPONENTTYPE *h265EncComponent,
Expand All @@ -699,7 +699,7 @@ EB_API EB_ERRORTYPE EbInitEncoder(
/* OPTIONAL: Get VPS / SPS / PPS headers at init time.
*
* Parameter:
* @ *h265EncComponent Encoder handler.
* @ *h265EncComponent Encoder handler.
* @ **outputStreamPtr Output stream. */
EB_API EB_ERRORTYPE EbH265EncStreamHeader(
EB_COMPONENTTYPE *h265EncComponent,
Expand Down
24 changes: 12 additions & 12 deletions Source/App/EbAppConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@
#define HRD_TOKEN "-hrd"
#define MAX_QP_TOKEN "-max-qp"
#define MIN_QP_TOKEN "-min-qp"
#define TEMPORAL_ID "-temporal-id" // no Eval
#define TEMPORAL_ID "-temporal-id" // no Eval
#define LOOK_AHEAD_DIST_TOKEN "-lad"
#define SCENE_CHANGE_DETECTION_TOKEN "-scd"
#define INJECTOR_TOKEN "-inj" // no Eval
#define INJECTOR_FRAMERATE_TOKEN "-inj-frm-rt" // no Eval
#define SPEED_CONTROL_TOKEN "-speed-ctrl"
#define ASM_TYPE_TOKEN "-asm" // no Eval
#define ASM_TYPE_TOKEN "-asm" // no Eval
#define THREAD_MGMNT "-lp"
#define TARGET_SOCKET "-ss"
#define THREAD_COUNT "-thread-count"
Expand Down Expand Up @@ -176,7 +176,7 @@ static void SetCfgSegmentOvFile(const char *value, EbConfig_t *cfg)
else
printf("Error segment Override file: %s does not exist, won't use\n",value);
};
static void SetCfgDolbyVisionRpuFile (const char *value, EbConfig_t *cfg)
static void SetCfgDolbyVisionRpuFile (const char *value, EbConfig_t *cfg)
{
if (cfg->dolbyVisionRpuFile) { fclose(cfg->dolbyVisionRpuFile); }
FOPEN(cfg->dolbyVisionRpuFile, value, "rb");
Expand Down Expand Up @@ -234,10 +234,10 @@ static void SetEnableConstrainedIntra (const char *value, EbConfig_t *
static void SetCfgTune (const char *value, EbConfig_t *cfg) {cfg->tune = (uint8_t)strtoul(value, NULL, 0); };
static void SetBitRateReduction (const char *value, EbConfig_t *cfg) {cfg->bitRateReduction = (EB_BOOL)strtol(value, NULL, 0); };
static void SetImproveSharpness (const char *value, EbConfig_t *cfg) {cfg->improveSharpness = (EB_BOOL)strtol(value, NULL, 0);};
static void SetVbvMaxrate (const char *value, EbConfig_t *cfg) { cfg->vbvMaxRate = strtoul(value, NULL, 0);};
static void SetVbvBufsize (const char *value, EbConfig_t *cfg) { cfg->vbvBufsize = strtoul(value, NULL, 0);};
static void SetVbvBufInit (const char *value, EbConfig_t *cfg) { cfg->vbvBufInit = strtoul(value, NULL, 0);};
static void SetHrdFlag (const char *value, EbConfig_t *cfg) { cfg->hrdFlag = strtoul(value, NULL, 0);};
static void SetVbvMaxrate (const char *value, EbConfig_t *cfg) { cfg->vbvMaxRate = strtoul(value, NULL, 0);};
static void SetVbvBufsize (const char *value, EbConfig_t *cfg) { cfg->vbvBufsize = strtoul(value, NULL, 0);};
static void SetVbvBufInit (const char *value, EbConfig_t *cfg) { cfg->vbvBufInit = strtoul(value, NULL, 0);};
static void SetHrdFlag (const char *value, EbConfig_t *cfg) { cfg->hrdFlag = strtoul(value, NULL, 0);};
static void SetVideoUsabilityInfo (const char *value, EbConfig_t *cfg) {cfg->videoUsabilityInfo = strtol(value, NULL, 0);};
static void SetHighDynamicRangeInput (const char *value, EbConfig_t *cfg) {cfg->highDynamicRangeInput = strtol(value, NULL, 0);};
static void SetAccessUnitDelimiter (const char *value, EbConfig_t *cfg) {cfg->accessUnitDelimiter = strtol(value, NULL, 0);};
Expand Down Expand Up @@ -379,7 +379,7 @@ config_entry_t config_entry[] = {
{ SINGLE_INPUT, CONSTRAINED_INTRA_ENABLE_TOKEN, "ConstrainedIntra", SetEnableConstrainedIntra },

// Rate Control
{ SINGLE_INPUT, RATE_CONTROL_ENABLE_TOKEN, "RateControlMode", SetRateControlMode },
{ SINGLE_INPUT, RATE_CONTROL_ENABLE_TOKEN, "RateControlMode", SetRateControlMode },
{ SINGLE_INPUT, TARGET_BIT_RATE_TOKEN, "TargetBitRate", SetTargetBitRate },
{ SINGLE_INPUT, MAX_QP_TOKEN, "MaxQpAllowed", SetMaxQpAllowed },
{ SINGLE_INPUT, MIN_QP_TOKEN, "MinQpAllowed", SetMinQpAllowed },
Expand Down Expand Up @@ -593,7 +593,7 @@ void EbConfigCtor(EbConfig_t *configPtr)

configPtr->performanceContext.encodeStartTime[0]= 0;
configPtr->performanceContext.encodeStartTime[1]= 0;

configPtr->performanceContext.totalExecutionTime= 0;
configPtr->performanceContext.totalEncodeTime = 0;
configPtr->performanceContext.frameCount = 0;
Expand Down Expand Up @@ -840,7 +840,7 @@ static int32_t FindToken(
**********************************/
static int32_t ReadConfigFile(
EbConfig_t *config,
char *configPath,
char *configPath,
uint32_t instanceIdx)
{
int32_t return_error = 0;
Expand Down Expand Up @@ -1217,8 +1217,8 @@ EB_ERRORTYPE ReadCommandLine(
{

EB_ERRORTYPE return_error = EB_ErrorBadParameter;
char config_string[COMMAND_LINE_MAX_SIZE]; // for one input options
char *config_strings[MAX_CHANNEL_NUMBER]; // for multiple input options
char config_string[COMMAND_LINE_MAX_SIZE]; // for one input options
char *config_strings[MAX_CHANNEL_NUMBER]; // for multiple input options
char *cmd_copy[MAX_NUM_TOKENS]; // keep track of extra tokens
uint32_t index = 0;
int32_t cmd_token_cnt = 0; // total number of tokens
Expand Down
62 changes: 31 additions & 31 deletions Source/App/EbAppConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,20 @@ typedef struct EB_PARAM_PORTDEFINITIONTYPE {
pointer = (type)malloc(nElements); \
if (pointer == (type)EB_NULL){ \
return returnType; \
} \
else { \
} \
else { \
appMemoryMap[*(appMemoryMapIndex)].ptrType = pointerClass; \
appMemoryMap[(*(appMemoryMapIndex))++].ptr = pointer; \
if (nElements % 8 == 0) { \
*totalAppMemory += (nElements); \
} \
else { \
*totalAppMemory += ((nElements) + (8 - ((nElements) % 8))); \
} \
} \
if (nElements % 8 == 0) { \
*totalAppMemory += (nElements); \
} \
else { \
*totalAppMemory += ((nElements) + (8 - ((nElements) % 8))); \
} \
} \
if (*(appMemoryMapIndex) >= MAX_APP_NUM_PTR) { \
return returnType; \
} \
} \
appMallocCount++;

#define EB_APP_MALLOC_NR(type, pointer, nElements, pointerClass,returnType) \
Expand All @@ -115,22 +115,22 @@ typedef struct EB_PARAM_PORTDEFINITIONTYPE {
returnType = EB_ErrorInsufficientResources; \
printf("Malloc has failed due to insuffucient resources"); \
return; \
} \
else { \
} \
else { \
appMemoryMap[*(appMemoryMapIndex)].ptrType = pointerClass; \
appMemoryMap[(*(appMemoryMapIndex))++].ptr = pointer; \
if (nElements % 8 == 0) { \
*totalAppMemory += (nElements); \
} \
else { \
*totalAppMemory += ((nElements) + (8 - ((nElements) % 8))); \
} \
} \
if (nElements % 8 == 0) { \
*totalAppMemory += (nElements); \
} \
else { \
*totalAppMemory += ((nElements) + (8 - ((nElements) % 8))); \
} \
} \
if (*(appMemoryMapIndex) >= MAX_APP_NUM_PTR) { \
returnType = EB_ErrorInsufficientResources; \
printf("Malloc has failed due to insuffucient resources"); \
return; \
} \
} \
appMallocCount++;

#define EB_APP_MEMORY() \
Expand Down Expand Up @@ -176,7 +176,7 @@ typedef struct EbPerformanceContext_s {
double totalEncodeTime; // not including init

uint64_t totalLatency;
uint32_t maxLatency;
uint32_t maxLatency;

uint64_t startsTime;
uint64_t startuTime;
Expand All @@ -199,7 +199,7 @@ typedef struct EbConfig_s
FILE *bitstreamFile;
FILE *reconFile;
FILE *errorLogFile;
FILE *bufferFile;
FILE *bufferFile;

FILE *qpFile;

Expand All @@ -220,7 +220,7 @@ typedef struct EbConfig_s
uint32_t speedControlFlag;
uint32_t encoderBitDepth;
uint32_t encoderColorFormat;
uint32_t compressedTenBitFormat;
uint32_t compressedTenBitFormat;
uint32_t sourceWidth;
uint32_t sourceHeight;

Expand All @@ -247,8 +247,8 @@ typedef struct EbConfig_s
uint8_t encMode;
int32_t intraPeriod;
int32_t intraRefreshType;
uint32_t hierarchicalLevels;
uint32_t predStructure;
uint32_t hierarchicalLevels;
uint32_t predStructure;


/****************************************
Expand Down Expand Up @@ -305,7 +305,7 @@ typedef struct EbConfig_s
* Optional Features
****************************************/

EB_BOOL bitRateReduction;
EB_BOOL bitRateReduction;
EB_BOOL improveSharpness;
uint32_t videoUsabilityInfo;
uint32_t highDynamicRangeInput;
Expand All @@ -331,13 +331,13 @@ typedef struct EbConfig_s
/****************************************
* On-the-fly Testing
****************************************/
uint32_t testUserData;
EB_BOOL eosFlag;
uint32_t testUserData;
EB_BOOL eosFlag;

/****************************************
* Optimization Type
****************************************/
uint32_t asmType;
uint32_t asmType;

/****************************************
* Computational Performance Data
Expand Down Expand Up @@ -382,9 +382,9 @@ typedef struct EbConfig_s
extern void EbConfigCtor(EbConfig_t *configPtr);
extern void EbConfigDtor(EbConfig_t *configPtr);

extern EB_ERRORTYPE ReadCommandLine(int32_t argc, char *const argv[], EbConfig_t **config, uint32_t numChannels, EB_ERRORTYPE *return_errors);
extern EB_ERRORTYPE ReadCommandLine(int32_t argc, char *const argv[], EbConfig_t **config, uint32_t numChannels, EB_ERRORTYPE *return_errors);
extern uint32_t GetHelp(int32_t argc, char *const argv[]);
extern uint32_t GetSVTVersion(int32_t argc, char *const argv[]);
extern uint32_t GetNumberOfChannels(int32_t argc, char *const argv[]);
extern uint32_t GetNumberOfChannels(int32_t argc, char *const argv[]);

#endif //EbAppConfig_h

0 comments on commit 3b24511

Please sign in to comment.