ref: 4c12046a7da1c4b18c2b9803e15a79766a1640f9
parent: 3c715863da0afdc42fb44c9f6d04e983d25a8de7
author: Deb Mukherjee <[email protected]>
date: Tue Nov 18 07:25:31 EST 2014
Changes SvcContext_t to SvcContext Fixes a borg build. Change-Id: I8cb510577e8d8bbc7a2e64f9e1bdfe883f49cb61
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -125,7 +125,7 @@
}
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 @@
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;
--- a/vpx/src/svc_encodeframe.c
+++ b/vpx/src/svc_encodeframe.c
@@ -79,7 +79,7 @@
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 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 @@
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 @@
* 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 @@
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 @@
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 @@
}
}
-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 @@
* 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 @@
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 @@
}
// 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 @@
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
--- a/vpx/svc_context.h
+++ b/vpx/svc_context.h
@@ -29,7 +29,7 @@
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 @@
// 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,12 +79,12 @@
* 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);
@@ -91,7 +91,7 @@
/**
* 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 @@
/**
* 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"