summaryrefslogtreecommitdiff
path: root/vpx/src/svc_encodeframe.c
diff options
context:
space:
mode:
Diffstat (limited to 'vpx/src/svc_encodeframe.c')
-rw-r--r--vpx/src/svc_encodeframe.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/vpx/src/svc_encodeframe.c b/vpx/src/svc_encodeframe.c
index 810e881c8..4f5ba6f20 100644
--- a/vpx/src/svc_encodeframe.c
+++ b/vpx/src/svc_encodeframe.c
@@ -95,7 +95,8 @@ struct LayerData {
// create LayerData from encoder output
static struct LayerData *ld_create(void *buf, size_t size) {
- struct LayerData *const layer_data = malloc(sizeof(*layer_data));
+ struct LayerData *const layer_data =
+ (struct LayerData *)malloc(sizeof(*layer_data));
if (layer_data == NULL) {
return NULL;
}
@@ -201,18 +202,18 @@ static void sf_create_index(struct Superframe *sf) {
static SvcInternal *get_svc_internal(SvcContext *svc_ctx) {
if (svc_ctx == NULL) return NULL;
if (svc_ctx->internal == NULL) {
- SvcInternal *const si = malloc(sizeof(*si));
+ SvcInternal *const si = (SvcInternal *)malloc(sizeof(*si));
if (si != NULL) {
memset(si, 0, sizeof(*si));
}
svc_ctx->internal = si;
}
- return svc_ctx->internal;
+ return (SvcInternal *)svc_ctx->internal;
}
static const SvcInternal *get_const_svc_internal(const SvcContext *svc_ctx) {
if (svc_ctx == NULL) return NULL;
- return svc_ctx->internal;
+ return (const SvcInternal *)svc_ctx->internal;
}
static void svc_log_reset(SvcContext *svc_ctx) {
@@ -272,7 +273,7 @@ static vpx_codec_err_t parse_quantizer_values(SvcContext *svc_ctx,
char *save_ptr;
int found = 0;
int i, q;
- int res = VPX_CODEC_OK;
+ vpx_codec_err_t res = VPX_CODEC_OK;
SvcInternal *const si = get_svc_internal(svc_ctx);
if (quantizer_values == NULL || strlen(quantizer_values) == 0) {
@@ -322,7 +323,7 @@ static vpx_codec_err_t parse_scale_factors(SvcContext *svc_ctx,
int found = 0;
int i;
int64_t num, den;
- int res = VPX_CODEC_OK;
+ vpx_codec_err_t res = VPX_CODEC_OK;
SvcInternal *const si = get_svc_internal(svc_ctx);
if (scale_factors == NULL || strlen(scale_factors) == 0) {
@@ -381,7 +382,7 @@ static vpx_codec_err_t parse_options(SvcContext *svc_ctx, const char *options) {
char *option_name;
char *option_value;
char *input_ptr;
- int res = VPX_CODEC_OK;
+ vpx_codec_err_t res = VPX_CODEC_OK;
if (options == NULL) return VPX_CODEC_OK;
input_string = strdup(options);
@@ -499,6 +500,7 @@ vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
// modify encoder configuration
enc_cfg->ss_number_layers = si->layers;
+ enc_cfg->ts_number_layers = 1; // Temporal layers not used in this encoder.
enc_cfg->kf_mode = VPX_KF_DISABLED;
enc_cfg->g_pass = VPX_RC_ONE_PASS;
// Lag in frames not currently supported
@@ -691,7 +693,8 @@ static void set_svc_parameters(SvcContext *svc_ctx,
SvcInternal *const si = get_svc_internal(svc_ctx);
memset(&svc_params, 0, sizeof(svc_params));
- svc_params.layer = si->layer;
+ svc_params.temporal_layer = 0;
+ svc_params.spatial_layer = si->layer;
svc_params.flags = si->enc_frame_flags;
layer = si->layer;
@@ -817,7 +820,7 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
ld_create(cx_pkt->data.frame.buf, (size_t)frame_pkt_size);
if (layer_data == NULL) {
svc_log(svc_ctx, SVC_LOG_ERROR, "Error allocating LayerData\n");
- return 0;
+ return VPX_CODEC_OK;
}
ld_list_add(&cx_layer_list, layer_data);
@@ -862,7 +865,7 @@ vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
si->buffer_size = si->frame_size;
}
// copy layer data into packet
- ld_list_copy_to_buffer(cx_layer_list, si->buffer);
+ ld_list_copy_to_buffer(cx_layer_list, (uint8_t *)si->buffer);
ld_list_free(cx_layer_list);