2 * Copyright (c) 2013 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
12 * SvcContext - input parameters and state to encode a multi-layered
16 #ifndef VPX_SVC_CONTEXT_H_
17 #define VPX_SVC_CONTEXT_H_
20 #include "./vpx_encoder.h"
26 typedef enum SVC_LOG_LEVEL {
33 // public interface to svc_command options
34 int spatial_layers; // number of spatial layers
35 int temporal_layers; // number of temporal layers
36 SVC_LOG_LEVEL log_level; // amount of information to display
37 int log_print; // when set, printf log messages instead of returning the
38 // message with svc_get_message
40 // private storage for vpx_svc_encode
46 * options are supplied as a single string separated by spaces
47 * Format: encoding-mode=<i|ip|alt-ip|gf>
48 * layers=<layer_count>
49 * scaling-factors=<n1>/<d1>,<n2>/<d2>,...
50 * quantizers=<q1>,<q2>,...
52 vpx_codec_err_t vpx_svc_set_options(SvcContext *svc_ctx, const char *options);
55 * initialize SVC encoding
57 vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
58 vpx_codec_iface_t *iface,
59 vpx_codec_enc_cfg_t *cfg);
61 * encode a frame of video with multiple layers
63 vpx_codec_err_t vpx_svc_encode(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
64 struct vpx_image *rawimg, vpx_codec_pts_t pts,
65 int64_t duration, int deadline);
68 * finished with svc encoding, release allocated resources
70 void vpx_svc_release(SvcContext *svc_ctx);
73 * dump accumulated statistics and reset accumulated values
75 const char *vpx_svc_dump_statistics(SvcContext *svc_ctx);
78 * get status message from previous encode
80 const char *vpx_svc_get_message(const SvcContext *svc_ctx);
83 * return spatial resolution of the specified layer
85 vpx_codec_err_t vpx_svc_get_layer_resolution(const SvcContext *svc_ctx,
88 unsigned int *height);
94 #endif // VPX_SVC_CONTEXT_H_