TUT HEVC Encoder
Loading...
Searching...
No Matches
cli.c File Reference
#include "cli.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <ctype.h>
Include dependency graph for cli.c:

Functions

static int select_input_res_auto (const char *file_name, int32_t *out_width, int32_t *out_height)
 Try to detect resolution from file name automatically.
 
static int detect_file_format (const char *file_name)
 Try to detect file format from file name automatically.
 
cmdline_opts_tcmdline_opts_parse (const kvz_api *const api, int argc, char *argv[])
 Parse command line arguments.
 
void cmdline_opts_free (const kvz_api *const api, cmdline_opts_t *opts)
 Deallocate a cmdline_opts_t structure.
 
void print_usage (void)
 
void print_version (void)
 
void print_help (void)
 
void print_frame_info (const kvz_frame_info *const info, const double frame_psnr[3], const uint32_t bytes, const bool print_psnr, const double avg_qp)
 

Variables

static const char short_options [] = "i:o:d:w:h:n:q:p:r:"
 
static const struct option long_options []
 

Function Documentation

◆ cmdline_opts_free()

void cmdline_opts_free ( const kvz_api *const api,
cmdline_opts_t * opts )
Here is the caller graph for this function:

◆ cmdline_opts_parse()

cmdline_opts_t * cmdline_opts_parse ( const kvz_api *const api,
int argc,
char * argv[] )
Parameters
argcNumber of arguments
argvArgument list
Returns
Pointer to the parsed options, or NULL on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ detect_file_format()

static int detect_file_format ( const char * file_name)
static
Parameters
file_namefile name to get format from
Returns
0 (auto) if no format is detected, or id of the format
Here is the caller graph for this function:

◆ print_frame_info()

void print_frame_info ( const kvz_frame_info *const info,
const double frame_psnr[3],
const uint32_t bytes,
const bool print_psnr,
const double avg_qp )
Here is the caller graph for this function:

◆ print_help()

void print_help ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_usage()

void print_usage ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_version()

void print_version ( void )
Here is the caller graph for this function:

◆ select_input_res_auto()

static int select_input_res_auto ( const char * file_name,
int32_t * out_width,
int32_t * out_height )
static
Parameters
file_namefile name to get dimensions from
out_widthdetected width
out_heightdetected height
Returns
1 if the resolution is set, 0 on fail
Here is the caller graph for this function:

Variable Documentation

◆ long_options

const struct option long_options[]
static

◆ short_options

const char short_options[] = "i:o:d:w:h:n:q:p:r:"
static