From: Deb Mukherjee Date: Tue, 18 Nov 2014 20:25:31 +0000 (-0800) Subject: Changes SvcContext_t to SvcContext X-Git-Tag: v1.4.0~489^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c12046a7da1c4b18c2b9803e15a79766a1640f9;p=platform%2Fupstream%2Flibvpx.git Changes SvcContext_t to SvcContext Fixes a borg build. Change-Id: I8cb510577e8d8bbc7a2e64f9e1bdfe883f49cb61 --- diff --git a/examples/vp9_spatial_svc_encoder.c b/examples/vp9_spatial_svc_encoder.c index a193c67..a4a9edb 100644 --- a/examples/vp9_spatial_svc_encoder.c +++ b/examples/vp9_spatial_svc_encoder.c @@ -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; diff --git a/vpx/src/svc_encodeframe.c b/vpx/src/svc_encodeframe.c index 4606f08..e711cf9 100644 --- a/vpx/src/svc_encodeframe.c +++ b/vpx/src/svc_encodeframe.c @@ -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=,,... * 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 diff --git a/vpx/svc_context.h b/vpx/svc_context.h index c2abec4..cf791bd 100644 --- a/vpx/svc_context.h +++ b/vpx/svc_context.h @@ -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=/,/,... * quantizers=,,... */ -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"