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));
}
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;
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,
* 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;
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) {
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);
}
}
-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;
* 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,
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;
}
// 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;
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
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
// 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
* 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,
/**
* 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"