Merge "Changes SvcContext_t to SvcContext"
This commit is contained in:
Коммит
f94c7a8f35
|
@ -125,7 +125,7 @@ void usage_exit() {
|
|||
}
|
||||
|
||||
static void parse_command_line(int argc, const char **argv_,
|
||||
AppInput *app_input, SvcContext_t *svc_ctx,
|
||||
AppInput *app_input, SvcContext *svc_ctx,
|
||||
vpx_codec_enc_cfg_t *enc_cfg) {
|
||||
struct arg arg = {0};
|
||||
char **argv = NULL;
|
||||
|
@ -322,7 +322,7 @@ int main(int argc, const char **argv) {
|
|||
VpxVideoInfo info = {0};
|
||||
vpx_codec_ctx_t codec;
|
||||
vpx_codec_enc_cfg_t enc_cfg;
|
||||
SvcContext_t svc_ctx;
|
||||
SvcContext svc_ctx;
|
||||
uint32_t i;
|
||||
uint32_t frame_cnt = 0;
|
||||
vpx_image_t raw;
|
||||
|
|
|
@ -79,7 +79,7 @@ typedef struct FrameData {
|
|||
struct FrameData *next;
|
||||
} FrameData;
|
||||
|
||||
static SvcInternal_t *get_svc_internal(SvcContext_t *svc_ctx) {
|
||||
static SvcInternal_t *get_svc_internal(SvcContext *svc_ctx) {
|
||||
if (svc_ctx == NULL) return NULL;
|
||||
if (svc_ctx->internal == NULL) {
|
||||
SvcInternal_t *const si = (SvcInternal_t *)malloc(sizeof(*si));
|
||||
|
@ -92,17 +92,17 @@ static SvcInternal_t *get_svc_internal(SvcContext_t *svc_ctx) {
|
|||
}
|
||||
|
||||
static const SvcInternal_t *get_const_svc_internal(
|
||||
const SvcContext_t *svc_ctx) {
|
||||
const SvcContext *svc_ctx) {
|
||||
if (svc_ctx == NULL) return NULL;
|
||||
return (const SvcInternal_t *)svc_ctx->internal;
|
||||
}
|
||||
|
||||
static void svc_log_reset(SvcContext_t *svc_ctx) {
|
||||
static void svc_log_reset(SvcContext *svc_ctx) {
|
||||
SvcInternal_t *const si = (SvcInternal_t *)svc_ctx->internal;
|
||||
si->message_buffer[0] = '\0';
|
||||
}
|
||||
|
||||
static int svc_log(SvcContext_t *svc_ctx, SVC_LOG_LEVEL level,
|
||||
static int svc_log(SvcContext *svc_ctx, SVC_LOG_LEVEL level,
|
||||
const char *fmt, ...) {
|
||||
char buf[512];
|
||||
int retval = 0;
|
||||
|
@ -155,7 +155,7 @@ static vpx_codec_err_t extract_option(LAYER_OPTION_TYPE type,
|
|||
return VPX_CODEC_OK;
|
||||
}
|
||||
|
||||
static vpx_codec_err_t parse_layer_options_from_string(SvcContext_t *svc_ctx,
|
||||
static vpx_codec_err_t parse_layer_options_from_string(SvcContext *svc_ctx,
|
||||
LAYER_OPTION_TYPE type,
|
||||
const char *input,
|
||||
int *option0,
|
||||
|
@ -200,7 +200,7 @@ static vpx_codec_err_t parse_layer_options_from_string(SvcContext_t *svc_ctx,
|
|||
* quantizers=<q1>,<q2>,...
|
||||
* svc_mode = [i|ip|alt_ip|gf]
|
||||
*/
|
||||
static vpx_codec_err_t parse_options(SvcContext_t *svc_ctx, const char *options) {
|
||||
static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) {
|
||||
char *input_string;
|
||||
char *option_name;
|
||||
char *option_value;
|
||||
|
@ -287,7 +287,7 @@ static vpx_codec_err_t parse_options(SvcContext_t *svc_ctx, const char *options)
|
|||
return res;
|
||||
}
|
||||
|
||||
vpx_codec_err_t vpx_svc_set_options(SvcContext_t *svc_ctx,
|
||||
vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx,
|
||||
const char *options) {
|
||||
SvcInternal_t *const si = get_svc_internal(svc_ctx);
|
||||
if (svc_ctx == NULL || options == NULL || si == NULL) {
|
||||
|
@ -298,7 +298,7 @@ vpx_codec_err_t vpx_svc_set_options(SvcContext_t *svc_ctx,
|
|||
return VPX_CODEC_OK;
|
||||
}
|
||||
|
||||
void assign_layer_bitrates(const SvcContext_t *svc_ctx,
|
||||
void assign_layer_bitrates(const SvcContext *svc_ctx,
|
||||
vpx_codec_enc_cfg_t *const enc_cfg) {
|
||||
int i;
|
||||
const SvcInternal_t *const si = get_const_svc_internal(svc_ctx);
|
||||
|
@ -332,7 +332,7 @@ void assign_layer_bitrates(const SvcContext_t *svc_ctx,
|
|||
}
|
||||
}
|
||||
|
||||
vpx_codec_err_t vpx_svc_init(SvcContext_t *svc_ctx, vpx_codec_ctx_t *codec_ctx,
|
||||
vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
|
||||
vpx_codec_iface_t *iface,
|
||||
vpx_codec_enc_cfg_t *enc_cfg) {
|
||||
vpx_codec_err_t res;
|
||||
|
@ -427,7 +427,7 @@ vpx_codec_err_t vpx_svc_init(SvcContext_t *svc_ctx, vpx_codec_ctx_t *codec_ctx,
|
|||
* Encode a frame into multiple layers
|
||||
* Create a superframe containing the individual layers
|
||||
*/
|
||||
vpx_codec_err_t vpx_svc_encode(SvcContext_t *svc_ctx,
|
||||
vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx,
|
||||
vpx_codec_ctx_t *codec_ctx,
|
||||
struct vpx_image *rawimg,
|
||||
vpx_codec_pts_t pts,
|
||||
|
@ -498,7 +498,7 @@ vpx_codec_err_t vpx_svc_encode(SvcContext_t *svc_ctx,
|
|||
return VPX_CODEC_OK;
|
||||
}
|
||||
|
||||
const char *vpx_svc_get_message(const SvcContext_t *svc_ctx) {
|
||||
const char *vpx_svc_get_message(const SvcContext *svc_ctx) {
|
||||
const SvcInternal_t *const si = get_const_svc_internal(svc_ctx);
|
||||
if (svc_ctx == NULL || si == NULL) return NULL;
|
||||
return si->message_buffer;
|
||||
|
@ -510,7 +510,7 @@ static double calc_psnr(double d) {
|
|||
}
|
||||
|
||||
// dump accumulated statistics and reset accumulated values
|
||||
const char *vpx_svc_dump_statistics(SvcContext_t *svc_ctx) {
|
||||
const char *vpx_svc_dump_statistics(SvcContext *svc_ctx) {
|
||||
int number_of_frames;
|
||||
int i, j;
|
||||
uint32_t bytes_total = 0;
|
||||
|
@ -569,7 +569,7 @@ const char *vpx_svc_dump_statistics(SvcContext_t *svc_ctx) {
|
|||
return vpx_svc_get_message(svc_ctx);
|
||||
}
|
||||
|
||||
void vpx_svc_release(SvcContext_t *svc_ctx) {
|
||||
void vpx_svc_release(SvcContext *svc_ctx) {
|
||||
SvcInternal_t *si;
|
||||
if (svc_ctx == NULL) return;
|
||||
// do not use get_svc_internal as it will unnecessarily allocate an
|
||||
|
|
|
@ -29,7 +29,7 @@ typedef enum SVC_LOG_LEVEL {
|
|||
SVC_LOG_DEBUG
|
||||
} SVC_LOG_LEVEL;
|
||||
|
||||
typedef struct SvcContext {
|
||||
typedef struct {
|
||||
// public interface to svc_command options
|
||||
int spatial_layers; // number of spatial layers
|
||||
int temporal_layers; // number of temporal layers
|
||||
|
@ -39,7 +39,7 @@ typedef struct SvcContext {
|
|||
|
||||
// private storage for vpx_svc_encode
|
||||
void *internal;
|
||||
} SvcContext_t;
|
||||
} SvcContext;
|
||||
|
||||
#define OPTION_BUFFER_SIZE 1024
|
||||
#define COMPONENTS 4 // psnr & sse statistics maintained for total, y, u, v
|
||||
|
@ -79,19 +79,19 @@ typedef struct SvcInternal {
|
|||
* scaling-factors=<n1>/<d1>,<n2>/<d2>,...
|
||||
* quantizers=<q1>,<q2>,...
|
||||
*/
|
||||
vpx_codec_err_t vpx_svc_set_options(SvcContext_t *svc_ctx, const char *options);
|
||||
vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options);
|
||||
|
||||
/**
|
||||
* initialize SVC encoding
|
||||
*/
|
||||
vpx_codec_err_t vpx_svc_init(SvcContext_t *svc_ctx,
|
||||
vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx,
|
||||
vpx_codec_ctx_t *codec_ctx,
|
||||
vpx_codec_iface_t *iface,
|
||||
vpx_codec_enc_cfg_t *cfg);
|
||||
/**
|
||||
* encode a frame of video with multiple layers
|
||||
*/
|
||||
vpx_codec_err_t vpx_svc_encode(SvcContext_t *svc_ctx,
|
||||
vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx,
|
||||
vpx_codec_ctx_t *codec_ctx,
|
||||
struct vpx_image *rawimg,
|
||||
vpx_codec_pts_t pts,
|
||||
|
@ -100,17 +100,17 @@ vpx_codec_err_t vpx_svc_encode(SvcContext_t *svc_ctx,
|
|||
/**
|
||||
* finished with svc encoding, release allocated resources
|
||||
*/
|
||||
void vpx_svc_release(SvcContext_t *svc_ctx);
|
||||
void vpx_svc_release(SvcContext *svc_ctx);
|
||||
|
||||
/**
|
||||
* dump accumulated statistics and reset accumulated values
|
||||
*/
|
||||
const char *vpx_svc_dump_statistics(SvcContext_t *svc_ctx);
|
||||
const char *vpx_svc_dump_statistics(SvcContext *svc_ctx);
|
||||
|
||||
/**
|
||||
* get status message from previous encode
|
||||
*/
|
||||
const char *vpx_svc_get_message(const SvcContext_t *svc_ctx);
|
||||
const char *vpx_svc_get_message(const SvcContext *svc_ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
Загрузка…
Ссылка в новой задаче