10 #ifndef VPX_VPX_ENCODER_H_
11 #define VPX_VPX_ENCODER_H_
37 #define VPX_TS_MAX_PERIODICITY 16
40 #define VPX_TS_MAX_LAYERS 5
43 #define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY
46 #define MAX_LAYERS VPX_TS_MAX_LAYERS
49 #define VPX_SS_MAX_LAYERS 5
52 #define VPX_SS_DEFAULT_LAYERS 1
62 #define VPX_ENCODER_ABI_VERSION (4 + VPX_CODEC_ABI_VERSION)
74 #define VPX_CODEC_CAP_PSNR 0x10000
81 #define VPX_CODEC_CAP_OUTPUT_PARTITION 0x20000
85 #define VPX_CODEC_CAP_HIGHBITDEPTH 0x40000
94 #define VPX_CODEC_USE_PSNR 0x10000
95 #define VPX_CODEC_USE_OUTPUT_PARTITION 0x20000
97 #define VPX_CODEC_USE_HIGHBITDEPTH 0x40000
104 typedef struct vpx_fixed_buf {
126 #define VPX_FRAME_IS_KEY 0x1
127 #define VPX_FRAME_IS_DROPPABLE 0x2
130 #define VPX_FRAME_IS_INVISIBLE 0x4
132 #define VPX_FRAME_IS_FRAGMENT 0x8
141 typedef uint32_t vpx_codec_er_flags_t;
142 #define VPX_ERROR_RESILIENT_DEFAULT 0x1
144 #define VPX_ERROR_RESILIENT_PARTITIONS 0x2
159 enum vpx_codec_cx_pkt_kind {
166 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
167 VPX_CODEC_SPATIAL_SVC_LAYER_SIZES,
168 VPX_CODEC_SPATIAL_SVC_LAYER_PSNR,
200 struct vpx_psnr_pkt {
208 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
289 #define VPX_EFLAG_FORCE_KF (1<<0)
298 typedef struct vpx_codec_enc_cfg {
310 unsigned int g_usage;
319 unsigned int g_threads;
330 unsigned int g_profile;
367 unsigned int g_input_bit_depth;
413 unsigned int g_lag_in_frames;
436 unsigned int rc_dropframe_thresh;
446 unsigned int rc_resize_allowed;
453 unsigned int rc_scaled_width;
460 unsigned int rc_scaled_height;
468 unsigned int rc_resize_up_thresh;
477 unsigned int rc_resize_down_thresh;
509 unsigned int rc_target_bitrate;
525 unsigned int rc_min_quantizer;
536 unsigned int rc_max_quantizer;
554 unsigned int rc_undershoot_pct;
567 unsigned int rc_overshoot_pct;
584 unsigned int rc_buf_sz;
594 unsigned int rc_buf_initial_sz;
604 unsigned int rc_buf_optimal_sz;
620 unsigned int rc_2pass_vbr_bias_pct;
628 unsigned int rc_2pass_vbr_minsection_pct;
636 unsigned int rc_2pass_vbr_maxsection_pct;
659 unsigned int kf_min_dist;
669 unsigned int kf_max_dist;
679 unsigned int ss_number_layers;
699 unsigned int ts_number_layers;
722 unsigned int ts_periodicity;
780 #define vpx_codec_enc_init(ctx, iface, cfg, flags) \
781 vpx_codec_enc_init_ver(ctx, iface, cfg, flags, VPX_ENCODER_ABI_VERSION)
817 #define vpx_codec_enc_init_multi(ctx, iface, cfg, num_enc, flags, dsf) \
818 vpx_codec_enc_init_multi_ver(ctx, iface, cfg, num_enc, flags, dsf, \
819 VPX_ENCODER_ABI_VERSION)
843 unsigned int reserved);
878 #define VPX_DL_REALTIME (1)
880 #define VPX_DL_GOOD_QUALITY (1000000)
882 #define VPX_DL_BEST_QUALITY (0)
920 vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx,
923 unsigned long duration,
925 unsigned long deadline);
972 unsigned int pad_before,
973 unsigned int pad_after);
1022 #endif // VPX_VPX_ENCODER_H_
Rational Number.
Definition: vpx_encoder.h:256
vpx_fixed_buf_t twopass_stats
Definition: vpx_encoder.h:211
struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:173
vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, const vpx_fixed_buf_t *buf, unsigned int pad_before, unsigned int pad_after)
Set compressed data output buffer.
Definition: vpx_encoder.h:275
Image Descriptor.
Definition: vpx_image.h:82
vpx_codec_pts_t pts
Definition: vpx_encoder.h:198
vpx_kf_mode
Keyframe placement mode.
Definition: vpx_encoder.h:287
#define VPX_TS_MAX_LAYERS
Definition: vpx_encoder.h:40
Definition: vpx_encoder.h:273
struct vpx_codec_enc_cfg vpx_codec_enc_cfg_t
Encoder configuration structure.
struct vpx_fixed_buf vpx_fixed_buf_t
Generic fixed size buffer structure.
int min_quantizers[5]
Definition: vpx_encoder.h:754
vpx_codec_enc_output_cx_pkt_cb_fn_t output_cx_pkt
Definition: vpx_encoder.h:248
int den
Definition: vpx_encoder.h:258
struct vpx_svc_parameters vpx_svc_extra_cfg_t
vp9 svc extra configure parameters
Definition: vpx_encoder.h:174
int partition_id
Definition: vpx_encoder.h:203
vpx_enc_pass
Multi-pass Encoding Pass.
Definition: vpx_encoder.h:263
Encoder configuration structure.
Definition: vpx_encoder.h:311
Definition: vpx_encoder.h:183
Definition: vpx_encoder.h:176
Definition: vpx_encoder.h:289
void * user_priv
Definition: vpx_encoder.h:249
Encoder output packet.
Definition: vpx_encoder.h:192
vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, const vpx_codec_enc_cfg_t *cfg)
Set or change configuration.
Generic fixed size buffer structure.
Definition: vpx_encoder.h:105
uint32_t vpx_codec_frame_flags_t
Compressed Frame Flags.
Definition: vpx_encoder.h:126
Definition: vpx_encoder.h:265
Definition: vpx_encoder.h:266
struct vpx_codec_cx_pkt::@1::@2 frame
#define VPX_SS_MAX_LAYERS
Definition: vpx_encoder.h:49
int max_quantizers[5]
Definition: vpx_encoder.h:753
enum vpx_bit_depth vpx_bit_depth_t
Bit depth for codecThis enumeration determines the bit depth of the codec.
uint64_t sse[4]
Definition: vpx_encoder.h:215
void(* vpx_codec_enc_output_cx_pkt_cb_fn_t)(vpx_codec_cx_pkt_t *pkt, void *user_data)
Encoder return output buffer callback.
Definition: vpx_encoder.h:243
int scaling_factor_den[5]
Definition: vpx_encoder.h:756
size_t sz
Definition: vpx_encoder.h:197
enum vpx_codec_cx_pkt_kind kind
Definition: vpx_encoder.h:193
vpx_fixed_buf_t raw
Definition: vpx_encoder.h:218
Callback function pointer / user data pair storage.
Definition: vpx_encoder.h:247
long vpx_enc_frame_flags_t
Encoded Frame Flags.
Definition: vpx_encoder.h:301
int num
Definition: vpx_encoder.h:257
char pad[128-sizeof(enum vpx_codec_cx_pkt_kind)]
Definition: vpx_encoder.h:231
int scaling_factor_num[5]
Definition: vpx_encoder.h:755
long vpx_codec_flags_t
Initialization-time Feature Enabling.
Definition: vpx_codec.h:165
vpx_codec_cx_pkt_kind
Encoder output packet variants.
Definition: vpx_encoder.h:172
Definition: vpx_encoder.h:272
double psnr[4]
Definition: vpx_encoder.h:216
Definition: vpx_encoder.h:288
unsigned int samples[4]
Definition: vpx_encoder.h:214
vpx_fixed_buf_t firstpass_mb_stats
Definition: vpx_encoder.h:212
vpx_rc_mode
Rate control mode.
Definition: vpx_encoder.h:271
const vpx_image_t * vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx)
Get Preview Frame.
unsigned long duration
Definition: vpx_encoder.h:200
uint32_t vpx_codec_er_flags_t
Error Resilient flags.
Definition: vpx_encoder.h:146
vpx_codec_err_t
Algorithm return codes.
Definition: vpx_codec.h:89
const vpx_codec_cx_pkt_t * vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Encoded data iterator.
union vpx_codec_cx_pkt::@1 data
struct vpx_codec_cx_pkt vpx_codec_cx_pkt_t
Encoder output packet.
struct vpx_rational vpx_rational_t
Rational Number.
struct vpx_codec_enc_output_cx_cb_pair vpx_codec_priv_output_cx_pkt_cb_pair_t
Callback function pointer / user data pair storage.
Definition: vpx_encoder.h:290
Definition: vpx_encoder.h:175
int64_t vpx_codec_pts_t
Time Stamp Type.
Definition: vpx_encoder.h:116
vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, vpx_codec_enc_cfg_t *cfg, unsigned int reserved)
Get a default configuration.
#define VPX_TS_MAX_PERIODICITY
Definition: vpx_encoder.h:37
vpx_fixed_buf_t * vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx)
Get global stream headers.
Definition: vpx_encoder.h:274
Describes the codec algorithm interface to applications.
vpx_codec_err_t vpx_codec_enc_init_multi_ver(vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface, vpx_codec_enc_cfg_t *cfg, int num_enc, vpx_codec_flags_t flags, vpx_rational_t *dsf, int ver)
Initialize multi-encoder instance.
vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface, const vpx_codec_enc_cfg_t *cfg, vpx_codec_flags_t flags, int ver)
Initialize an encoder instance.
const void * vpx_codec_iter_t
Iterator.
Definition: vpx_codec.h:188
Definition: vpx_encoder.h:173
vpx_codec_frame_flags_t flags
Definition: vpx_encoder.h:202
void * buf
Definition: vpx_encoder.h:196
vp9 svc extra configure parameters
Definition: vpx_encoder.h:752
Definition: vpx_encoder.h:264
Codec context structure.
Definition: vpx_codec.h:199