This SDK includes a number of sample applications. Each sample documents a feature of the SDK in both prose and the associated C code. The following samples are included:
In addition, the SDK contains a number of utilities. Since these utilities are built upon the concepts described in the sample code listed above, they are not documented in pieces like the samples are. Their source is included here for reference. The following utilities are included:
unsigned int rc_2pass_vbr_minsection_pct
Two-pass mode per-GOP minimum bitrate.
Definition: vpx_encoder.h:570
int alt_fb_idx[5]
Definition: vp8cx.h:820
Definition: vpx_image.h:60
Definition: vpx_image.h:56
Definition: vpx_image.h:40
int gld_fb_idx[5]
Definition: vp8cx.h:819
int lst_fb_idx[5]
Definition: vp8cx.h:818
#define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf)
Convenience macro for vpx_codec_enc_init_multi_ver()
Definition: vpx_encoder.h:772
vpx region of interest map
Definition: vp8cx.h:725
unsigned int ts_rate_decimator[5]
Frame rate decimation factor for each temporal layer.
Definition: vpx_encoder.h:658
Codec control function to set the filter strength for the arf.
Definition: vp8cx.h:223
unsigned int d_h
Definition: vpx_image.h:83
unsigned int threads
Definition: vpx_decoder.h:108
int ref_frame[8]
Definition: vp8cx.h:738
Definition: vpx_image.h:61
vp9 svc extra configure parameters
Definition: vpx_encoder.h:701
int max_quantizers[12]
Definition: vpx_encoder.h:702
#define VPX_IMG_FMT_HIGHBITDEPTH
Definition: vpx_image.h:35
Codec context structure.
Definition: vpx_codec.h:197
Codec control function to set target level.
Definition: vp8cx.h:562
Definition: vpx_image.h:58
unsigned int sz
Definition: vpx_decoder.h:90
Definition: vpx_codec.h:218
const char * vpx_codec_err_to_string(vpx_codec_err_t err)
Convert error number to printable string.
#define VPX_SS_MAX_LAYERS
Definition: vpx_encoder.h:46
unsigned int h
Definition: vpx_decoder.h:92
unsigned int cols
Definition: vp8cx.h:753
Generic fixed size buffer structure.
Definition: vpx_encoder.h:96
Codec control function to enable automatic use of arf frames.
Definition: vp8cx.h:164
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:398
enum vpx_codec_cx_pkt_kind kind
Definition: vpx_encoder.h:160
Codec control function to get svc layer ID.
Definition: vp8cx.h:471
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:436
void vpx_img_free(vpx_image_t *img)
Close an image descriptor.
Codec control function to set lossless encoding mode.
Definition: vp8cx.h:327
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:312
Bypass mode. Used when application needs to control temporal layering. This will only work when the n...
Definition: vp8cx.h:708
unsigned int ss_number_layers
Number of spatial coding layers.
Definition: vpx_encoder.h:624
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:211
#define VP8_EFLAG_NO_REF_LAST
Don't reference the last frame.
Definition: vp8cx.h:58
vpx_fixed_buf_t rc_twopass_stats_in
Two-pass stats buffer.
Definition: vpx_encoder.h:447
Encoder configuration structure.
Definition: vpx_encoder.h:268
int reference_golden[5]
Definition: vp8cx.h:827
vpx_codec_err_t vpx_codec_decode(vpx_codec_ctx_t *ctx, const uint8_t *data, unsigned int data_sz, void *user_priv, long deadline)
Decode data.
unsigned int kf_max_dist
Keyframe maximum interval.
Definition: vpx_encoder.h:614
#define VPX_PLANE_U
Definition: vpx_image.h:96
const char * vpx_codec_iface_name(vpx_codec_iface_t *iface)
Return the name for a given interface.
Definition: vpx_encoder.h:150
int min_quantizers[12]
Definition: vpx_encoder.h:703
#define VPX_DL_BEST_QUALITY
deadline parameter analogous to VPx BEST QUALITY mode.
Definition: vpx_encoder.h:834
Definition: vpx_encoder.h:232
Codec control function to set row level multi-threading.
Definition: vp8dx.h:133
control function to set noise sensitivity
Definition: vp8cx.h:173
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:413
long vpx_enc_frame_flags_t
Encoded Frame Flags.
Definition: vpx_encoder.h:259
unsigned int rc_buf_sz
Decoder Buffer Size.
Definition: vpx_encoder.h:531
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:293
Definition: vpx_image.h:47
vpx_image_t * vpx_codec_get_frame(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Decoded frames iterator.
#define VPX_FRAME_IS_FRAGMENT
this is a fragment of the encoded frame
Definition: vpx_encoder.h:123
vpx_image_t * vpx_img_alloc(vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int align)
Open a descriptor, allocating storage for the underlying image.
int num
Definition: vpx_encoder.h:219
#define VPX_CODEC_USE_POSTPROC
Definition: vpx_decoder.h:74
int max_consec_drop
Definition: vp8cx.h:857
#define VPX_DL_REALTIME
deadline parameter analogous to VPx REALTIME mode.
Definition: vpx_encoder.h:830
int temporal_layer_id_per_spatial[5]
Definition: vp8cx.h:806
vpx_image_t img
Definition: vp8.h:103
const char * name
Definition: vpx_codec.h:198
Operation completed without error.
Definition: vpx_codec.h:92
vpx_fixed_buf_t firstpass_mb_stats
Definition: vpx_encoder.h:183
Provides definitions for using VP8 or VP9 within the vpx Decoder interface.
uint8_t * data
Definition: vpx_frame_buffer.h:40
#define VP8_EFLAG_NO_UPD_ENTROPY
Disable entropy update.
Definition: vp8cx.h:116
const vpx_codec_cx_pkt_t * vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Encoded data iterator.
Encoder output packet.
Definition: vpx_encoder.h:159
const typedef void * vpx_codec_iter_t
Iterator.
Definition: vpx_codec.h:187
unsigned int g_w
Width of the frame.
Definition: vpx_encoder.h:304
Definition: vpx_encoder.h:147
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:514
int idx
Definition: vp8.h:111
VP9 specific reference frame data struct.
Definition: vp8.h:110
Definition: vpx_image.h:48
Definition: vpx_image.h:43
unsigned int d_w
Definition: vpx_image.h:82
vp9 svc frame flag parameters.
Definition: vp8cx.h:817
unsigned char * planes[4]
Definition: vpx_image.h:99
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:522
unsigned int rows
Definition: vp8cx.h:731
unsigned int bit_depth
Definition: vpx_image.h:79
#define VPX_TS_MAX_LAYERS
Definition: vpx_encoder.h:40
vpx_img_fmt_t fmt
Definition: vpx_image.h:72
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:430
int post_proc_flag
the types of post processing to be done, should be combination of "vp8_postproc_level"
Definition: vp8.h:82
unsigned int g_profile
Bitstream profile to use.
Definition: vpx_encoder.h:295
Definition: vpx_codec.h:220
#define VP8_EFLAG_NO_UPD_LAST
Don't update the last frame.
Definition: vp8cx.h:81
unsigned int rc_overshoot_pct
Rate control adaptation overshoot control.
Definition: vpx_encoder.h:516
Codec control function to constrain the inter-layer prediction (prediction of lower spatial resolutio...
Definition: vp8cx.h:619
#define VPX_MAX_LAYERS
Definition: vpx_encoder.h:43
#define vpx_codec_enc_init(ctx, iface, cfg, flags)
Convenience macro for vpx_codec_enc_init_ver()
Definition: vpx_encoder.h:741
Definition: vpx_encoder.h:148
int64_t vpx_codec_pts_t
Time Stamp Type.
Definition: vpx_encoder.h:106
Definition: vpx_encoder.h:227
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:385
int scaling_factor_den[12]
Definition: vpx_encoder.h:705
Codec control function to set max data rate for Inter frames.
Definition: vp8cx.h:278
External frame buffer.
Definition: vpx_frame_buffer.h:39
vpx_ref_frame_type_t frame_type
Definition: vp8.h:102
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:188
vpx_bit_depth_t g_bit_depth
Bit-depth of the codec.
Definition: vpx_encoder.h:321
reference frame data struct
Definition: vp8.h:101
struct vpx_rational g_timebase
Stream timebase units.
Definition: vpx_encoder.h:343
Definition: vpx_image.h:42
int reference_last[5]
Definition: vp8cx.h:826
Definition: vpx_image.h:55
double psnr[4]
Definition: vpx_encoder.h:187
#define VPX_TS_MAX_PERIODICITY
Definition: vpx_encoder.h:37
unsigned int rc_dropframe_thresh
Temporal resampling configuration, if supported by the codec.
Definition: vpx_encoder.h:391
Codec control function to set number of tile rows.
Definition: vp8cx.h:371
int scaling_factor_num[12]
Definition: vpx_encoder.h:704
Codec control function to set higher sharpness at the expense of a lower PSNR.
Definition: vp8cx.h:182
The coded data for this stream is corrupt or incomplete.
Definition: vpx_codec.h:130
vpx_codec_er_flags_t g_error_resilient
Enable error resilient modes.
Definition: vpx_encoder.h:351
unsigned int cols
Definition: vp8cx.h:732
Image Descriptor.
Definition: vpx_image.h:71
size_t size
Definition: vpx_frame_buffer.h:41
enum vpx_enc_pass g_pass
Multi-pass Encoding Mode.
Definition: vpx_encoder.h:358
unsigned int g_h
Height of the frame.
Definition: vpx_encoder.h:313
Codec control function to enable/disable special mode for altref adaptive quantization....
Definition: vp8cx.h:586
int update_buffer_slot[5]
Definition: vp8cx.h:821
int delta_q[8]
Definition: vp8cx.h:734
int stride[4]
Definition: vpx_image.h:100
int delta_lf[8]
Definition: vp8cx.h:735
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:453
unsigned int rc_max_quantizer
Maximum (Worst Quality) Quantizer.
Definition: vpx_encoder.h:482
enum vpx_rc_mode rc_end_usage
Rate control algorithm to use.
Definition: vpx_encoder.h:440
Definition: vpx_image.h:57
unsigned int g_lag_in_frames
Allow lagged encoding.
Definition: vpx_encoder.h:372
Codec control function to set loopfilter optimization.
Definition: vp8dx.h:143
unsigned char * roi_map
Definition: vp8cx.h:730
enum vpx_bit_depth vpx_bit_depth_t
Bit depth for codecThis enumeration determines the bit depth of the codec.
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:155
#define VPX_CODEC_USE_HIGHBITDEPTH
Definition: vpx_encoder.h:90
vpx_codec_err_t
Algorithm return codes.
Definition: vpx_codec.h:90
Codec control function to set constrained / constant quality level.
Definition: vp8cx.h:242
unsigned int rc_resize_allowed
Enable/disable spatial resampling, if supported by the codec.
Definition: vpx_encoder.h:400
#define VP8_EFLAG_NO_REF_ARF
Don't reference the alternate reference frame.
Definition: vp8cx.h:74
const char * vpx_codec_error_detail(vpx_codec_ctx_t *ctx)
Retrieve detailed error information for codec context.
Codec control function to enable temporal dependency model.
Definition: vp8cx.h:668
Definition: vpx_image.h:44
unsigned int w
Definition: vpx_decoder.h:91
#define VPX_EFLAG_FORCE_KF
Definition: vpx_encoder.h:260
SVC_LAYER_DROP_MODE framedrop_mode
Definition: vp8cx.h:856
post process flags
Definition: vp8.h:79
vp9 svc layer parameters
Definition: vp8cx.h:802
Codec control function to set content type.
Definition: vp8cx.h:463
Codec control function to get last decoded frame quantizer.
Definition: vp8dx.h:125
Codec control function to set noise sensitivity.
Definition: vp8cx.h:421
#define VPX_PLANE_V
Definition: vpx_image.h:97
void * priv
Definition: vpx_frame_buffer.h:42
Stream properties.
Definition: vpx_decoder.h:89
pass in an external frame into decoder to be used as reference frame
Definition: vp8.h:47
enum vpx_img_fmt vpx_img_fmt_t
List of supported image formats.
vpx_fixed_buf_t raw
Definition: vpx_encoder.h:189
unsigned int layer_target_bitrate[12]
Target bitrate for each spatial/temporal layer.
Definition: vpx_encoder.h:684
int temporal_layer_id
Definition: vp8cx.h:805
unsigned int g_input_bit_depth
Bit-depth of the input frames.
Definition: vpx_encoder.h:329
Definition: vpx_encoder.h:234
union vpx_codec_cx_pkt::@1 data
Definition: vpx_encoder.h:226
unsigned char * active_map
specify an on (1) or off (0) each 16x16 region within a frame
Definition: vp8cx.h:751
unsigned int ts_target_bitrate[5]
Target bitrate for each temporal layer.
Definition: vpx_encoder.h:651
int framedrop_thresh[5]
Definition: vp8cx.h:854
Definition: vpx_image.h:46
Codec control function to pass an Active map to encoder.
Definition: vp8cx.h:136
#define VPX_FRAME_IS_KEY
Definition: vpx_encoder.h:116
Codec control function to set reference and update frame flags.
Definition: vp8cx.h:263
Provides definitions for using VP8 or VP9 encoder algorithm within the vpx Codec Interface.
unsigned int kf_min_dist
Keyframe minimum interval.
Definition: vpx_encoder.h:605
unsigned int rc_min_quantizer
Minimum (Best Quality) Quantizer.
Definition: vpx_encoder.h:473
#define VPX_CODEC_USE_ERROR_CONCEALMENT
Conceal errors in decoded frames.
Definition: vpx_decoder.h:76
#define VPX_PLANE_Y
Definition: vpx_image.h:95
#define vpx_codec_dec_init(ctx, iface, cfg, flags)
Convenience macro for vpx_codec_dec_init_ver()
Definition: vpx_decoder.h:144
Algorithm does not have required capability.
Definition: vpx_codec.h:104
unsigned int h
Definition: vpx_image.h:78
unsigned int rc_buf_initial_sz
Decoder Buffer Initial Size.
Definition: vpx_encoder.h:540
size_t sz
Definition: vpx_encoder.h:98
Codec control function to set visual tuning.
Definition: vp8cx.h:232
Definition: vpx_codec.h:219
unsigned int rows
Definition: vp8cx.h:752
Codec control function to set row level multi-threading.
Definition: vp8cx.h:570
vp9 svc frame dropping parameters.
Definition: vp8cx.h:853
#define VPX_CODEC_USE_OUTPUT_PARTITION
Make the encoder output one partition at a time.
Definition: vpx_encoder.h:89
vpx_codec_err_t err
Definition: vpx_codec.h:200
unsigned int rc_buf_optimal_sz
Decoder Buffer Optimal Size.
Definition: vpx_encoder.h:549
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:257
int spatial_layer_id
Definition: vp8cx.h:803
vpx_codec_err_t vpx_codec_set_frame_buffer_functions(vpx_codec_ctx_t *ctx, vpx_get_frame_buffer_cb_fn_t cb_get, vpx_release_frame_buffer_cb_fn_t cb_release, void *cb_priv)
Pass in external frame buffers for the decoder to use.
int deblocking_level
Definition: vp8.h:83
Definition: vpx_encoder.h:248
Definition: vpx_image.h:45
unsigned int ts_layer_id[16]
Template defining the membership of frames to temporal layers.
Definition: vpx_encoder.h:676
vpx_image_t img
Definition: vp8.h:112
Codec control function to set the number of token partitions.
Definition: vp8cx.h:194
unsigned int rc_target_bitrate
Target data rate.
Definition: vpx_encoder.h:460
unsigned int rc_2pass_vbr_maxsection_pct
Two-pass mode per-GOP maximum bitrate.
Definition: vpx_encoder.h:577
Codec control function to set number of tile columns.
Definition: vp8cx.h:351
void * buf
Definition: vpx_encoder.h:97
int noise_level
Definition: vp8.h:84
vpx_fixed_buf_t twopass_stats
Definition: vpx_encoder.h:182
unsigned int g_threads
Maximum number of threads to use.
Definition: vpx_encoder.h:285
#define VP8_EFLAG_NO_REF_GF
Don't reference the golden frame.
Definition: vp8cx.h:66
#define vpx_codec_control(ctx, id, data)
vpx_codec_control wrapper macro
Definition: vpx_codec.h:404
#define VP8_EFLAG_NO_UPD_ARF
Don't update the alternate reference frame.
Definition: vp8cx.h:95
Definition: vpx_image.h:49
vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, const vpx_image_t *img, vpx_codec_pts_t pts, unsigned long duration, vpx_enc_frame_flags_t flags, unsigned long deadline)
Encode a frame.
Codec control function to set the frame flags and buffer indices for spatial layers....
Definition: vp8cx.h:545
unsigned int static_threshold[4]
Definition: vp8cx.h:740
Describes the decoder algorithm interface to applications.
Initialization Configurations.
Definition: vpx_decoder.h:107
Codec control function to set mode and thresholds for frame dropping in SVC. Drop frame thresholds ar...
Definition: vp8cx.h:628
int den
Definition: vpx_encoder.h:220
int64_t duration[5]
Definition: vp8cx.h:829
int skip[8]
Definition: vp8cx.h:737
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:130
vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, vpx_codec_enc_cfg_t *cfg, unsigned int usage)
Get a default configuration.
uint32_t vpx_codec_er_flags_t
Error Resilient flags.
Definition: vpx_encoder.h:131
vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx)
Destroy a codec instance.
vpx active region map
Definition: vp8cx.h:749
vpx_codec_err_t vpx_codec_control_(vpx_codec_ctx_t *ctx, int ctrl_id,...)
Control algorithm.
int temporal_layering_mode
Temporal layering mode indicating which temporal layering scheme to use.
Definition: vpx_encoder.h:693
Codec control function to set color space info.
Definition: vp8cx.h:494
#define VP8_EFLAG_NO_UPD_GF
Don't update the golden frame.
Definition: vp8cx.h:88
Definition: vpx_encoder.h:249
#define VPX_CODEC_USE_PSNR
Initialization-time Feature Enabling.
Definition: vpx_encoder.h:87
Describes the encoder algorithm interface to applications.
Definition: vpx_image.h:54
Rational Number.
Definition: vpx_encoder.h:218
Definition: vpx_encoder.h:225
Definition: vpx_encoder.h:233
const char * vpx_codec_error(vpx_codec_ctx_t *ctx)
Retrieve error synopsis for codec context.
#define VPX_DL_GOOD_QUALITY
deadline parameter analogous to VPx GOOD QUALITY mode.
Definition: vpx_encoder.h:832
unsigned int ts_number_layers
Number of temporal coding layers.
Definition: vpx_encoder.h:644
struct vpx_codec_cx_pkt::@1::@2 frame
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:601
unsigned int rc_undershoot_pct
Rate control adaptation undershoot control.
Definition: vpx_encoder.h:501
Definition: vpx_image.h:59
Codec control function to set parameters for SVC.
Definition: vp8cx.h:444
int reference_alt_ref[5]
Definition: vp8cx.h:828
Definition: vpx_encoder.h:149
Definition: vpx_encoder.h:235
unsigned int w
Definition: vpx_image.h:77
Codec control function to set the temporal layer id.
Definition: vp8cx.h:304
vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, const uint8_t *data, unsigned int data_sz, vpx_codec_stream_info_t *si)
Parse stream info from a buffer.
Codec control function to set the max no of frames to create arf.
Definition: vp8cx.h:217
enum vpx_kf_mode kf_mode
Keyframe placement mode.
Definition: vpx_encoder.h:596
unsigned int ts_periodicity
Length of the sequence defining frame temporal layer membership.
Definition: vpx_encoder.h:667