21#include "./vpx_config.h"
22#include "../vpx_ports/vpx_timer.h"
26#include "../tools_common.h"
27#include "../video_writer.h"
31static const char *exec_name;
33void usage_exit(
void) { exit(EXIT_FAILURE); }
36enum denoiserStateVp8 {
40 kVp8DenoiserOnYUVAggressive,
41 kVp8DenoiserOnAdaptive
45enum denoiserStateVp9 {
49 kVp9DenoiserOnYTwoSpatialLayers
52static int mode_to_num_layers[13] = { 1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3, 3 };
55struct RateControlMetrics {
74 double avg_st_encoding_bitrate;
76 double variance_st_encoding_bitrate;
90static void set_rate_control_metrics(
struct RateControlMetrics *rc,
98 1000.0 * rc->layer_target_bitrate[0] / rc->layer_framerate[0];
102 rc->layer_pfb[i] = 1000.0 * (rc->layer_target_bitrate[i] -
103 rc->layer_target_bitrate[i - 1]) /
104 (rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
106 rc->layer_input_frames[i] = 0;
107 rc->layer_enc_frames[i] = 0;
108 rc->layer_tot_enc_frames[i] = 0;
109 rc->layer_encoding_bitrate[i] = 0.0;
110 rc->layer_avg_frame_size[i] = 0.0;
111 rc->layer_avg_rate_mismatch[i] = 0.0;
113 rc->window_count = 0;
114 rc->window_size = 15;
115 rc->avg_st_encoding_bitrate = 0.0;
116 rc->variance_st_encoding_bitrate = 0.0;
119static void printout_rate_control_summary(
struct RateControlMetrics *rc,
123 int tot_num_frames = 0;
124 double perc_fluctuation = 0.0;
125 printf(
"Total number of processed frames: %d\n\n", frame_cnt - 1);
126 printf(
"Rate control layer stats for %d layer(s):\n\n",
129 const int num_dropped =
130 (i > 0) ? (rc->layer_input_frames[i] - rc->layer_enc_frames[i])
131 : (rc->layer_input_frames[i] - rc->layer_enc_frames[i] - 1);
132 tot_num_frames += rc->layer_input_frames[i];
133 rc->layer_encoding_bitrate[i] = 0.001 * rc->layer_framerate[i] *
134 rc->layer_encoding_bitrate[i] /
136 rc->layer_avg_frame_size[i] =
137 rc->layer_avg_frame_size[i] / rc->layer_enc_frames[i];
138 rc->layer_avg_rate_mismatch[i] =
139 100.0 * rc->layer_avg_rate_mismatch[i] / rc->layer_enc_frames[i];
140 printf(
"For layer#: %d \n", i);
141 printf(
"Bitrate (target vs actual): %d %f \n", rc->layer_target_bitrate[i],
142 rc->layer_encoding_bitrate[i]);
143 printf(
"Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i],
144 rc->layer_avg_frame_size[i]);
145 printf(
"Average rate_mismatch: %f \n", rc->layer_avg_rate_mismatch[i]);
147 "Number of input frames, encoded (non-key) frames, "
148 "and perc dropped frames: %d %d %f \n",
149 rc->layer_input_frames[i], rc->layer_enc_frames[i],
150 100.0 * num_dropped / rc->layer_input_frames[i]);
153 rc->avg_st_encoding_bitrate = rc->avg_st_encoding_bitrate / rc->window_count;
154 rc->variance_st_encoding_bitrate =
155 rc->variance_st_encoding_bitrate / rc->window_count -
156 (rc->avg_st_encoding_bitrate * rc->avg_st_encoding_bitrate);
157 perc_fluctuation = 100.0 * sqrt(rc->variance_st_encoding_bitrate) /
158 rc->avg_st_encoding_bitrate;
159 printf(
"Short-time stats, for window of %d frames: \n", rc->window_size);
160 printf(
"Average, rms-variance, and percent-fluct: %f %f %f \n",
161 rc->avg_st_encoding_bitrate, sqrt(rc->variance_st_encoding_bitrate),
163 if ((frame_cnt - 1) != tot_num_frames)
164 die(
"Error: Number of input frames not equal to output! \n");
170 memset(roi, 0,
sizeof(*roi));
174 roi->
rows = (cfg->
g_h + 15) / 16;
175 roi->
cols = (cfg->
g_w + 15) / 16;
203 for (i = 0; i < roi->
rows; ++i) {
204 for (j = 0; j < roi->
cols; ++j) {
205 if (i > (roi->
rows >> 2) && i < ((roi->
rows * 3) >> 2) &&
206 j > (roi->
cols >> 2) && j < ((roi->
cols * 3) >> 2)) {
219static void set_temporal_layer_pattern(
int layering_mode,
222 int *flag_periodicity) {
223 switch (layering_mode) {
228 *flag_periodicity = 1;
239 int ids[2] = { 0, 1 };
241 *flag_periodicity = 2;
265 int ids[3] = { 0, 1, 1 };
267 *flag_periodicity = 3;
276 layer_flags[1] = layer_flags[2] =
283 int ids[6] = { 0, 2, 2, 1, 2, 2 };
285 *flag_periodicity = 6;
297 layer_flags[1] = layer_flags[2] = layer_flags[4] = layer_flags[5] =
303 int ids[4] = { 0, 2, 1, 2 };
305 *flag_periodicity = 4;
317 layer_flags[1] = layer_flags[3] =
324 int ids[4] = { 0, 2, 1, 2 };
326 *flag_periodicity = 4;
339 layer_flags[1] = layer_flags[3] =
346 int ids[4] = { 0, 2, 1, 2 };
348 *flag_periodicity = 4;
360 layer_flags[1] = layer_flags[3] =
367 int ids[16] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4 };
369 *flag_periodicity = 16;
378 layer_flags[1] = layer_flags[3] = layer_flags[5] = layer_flags[7] =
379 layer_flags[9] = layer_flags[11] = layer_flags[13] = layer_flags[15] =
382 layer_flags[2] = layer_flags[6] = layer_flags[10] = layer_flags[14] =
384 layer_flags[4] = layer_flags[12] =
391 int ids[2] = { 0, 1 };
393 *flag_periodicity = 8;
415 layer_flags[4] = layer_flags[2];
417 layer_flags[5] = layer_flags[3];
419 layer_flags[6] = layer_flags[4];
421 layer_flags[7] = layer_flags[5];
426 int ids[4] = { 0, 2, 1, 2 };
428 *flag_periodicity = 8;
442 layer_flags[3] = layer_flags[5] =
457 int ids[4] = { 0, 2, 1, 2 };
459 *flag_periodicity = 8;
483 layer_flags[5] = layer_flags[3];
487 layer_flags[7] = layer_flags[3];
496 int ids[4] = { 0, 2, 1, 2 };
498 *flag_periodicity = 4;
519 int ids[4] = { 0, 2, 1, 2 };
521 *flag_periodicity = 8;
531 layer_flags[4] = layer_flags[0];
534 layer_flags[6] = layer_flags[2];
538 layer_flags[3] = layer_flags[1];
539 layer_flags[5] = layer_flags[1];
540 layer_flags[7] = layer_flags[1];
546int main(
int argc,
char **argv) {
555 uint32_t error_resilient = 0;
562 int frame_duration = 1;
563 int layering_mode = 0;
565 int flag_periodicity = 1;
570 const VpxInterface *encoder = NULL;
572 struct RateControlMetrics rc;
574 const int min_args_base = 13;
575#if CONFIG_VP9_HIGHBITDEPTH
577 int input_bit_depth = 8;
578 const int min_args = min_args_base + 1;
580 const int min_args = min_args_base;
582 double sum_bitrate = 0.0;
583 double sum_bitrate2 = 0.0;
584 double framerate = 30.0;
588 if (argc < min_args) {
589#if CONFIG_VP9_HIGHBITDEPTH
590 die(
"Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
591 "<rate_num> <rate_den> <speed> <frame_drop_threshold> "
592 "<error_resilient> <threads> <mode> "
593 "<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n",
596 die(
"Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
597 "<rate_num> <rate_den> <speed> <frame_drop_threshold> "
598 "<error_resilient> <threads> <mode> "
599 "<Rate_0> ... <Rate_nlayers-1> \n",
604 encoder = get_vpx_encoder_by_name(argv[3]);
605 if (!encoder) die(
"Unsupported codec.");
609 width = (
unsigned int)strtoul(argv[4], NULL, 0);
610 height = (
unsigned int)strtoul(argv[5], NULL, 0);
611 if (width < 16 || width % 2 || height < 16 || height % 2) {
612 die(
"Invalid resolution: %d x %d", width, height);
615 layering_mode = (int)strtol(argv[12], NULL, 0);
616 if (layering_mode < 0 || layering_mode > 13) {
617 die(
"Invalid layering mode (0..12) %s", argv[12]);
620 if (argc != min_args + mode_to_num_layers[layering_mode]) {
621 die(
"Invalid number of arguments");
624#if CONFIG_VP9_HIGHBITDEPTH
625 switch (strtol(argv[argc - 1], NULL, 0)) {
632 input_bit_depth = 10;
636 input_bit_depth = 12;
638 default: die(
"Invalid bit depth (8, 10, 12) %s", argv[argc - 1]);
642 width, height, 32)) {
643 die(
"Failed to allocate image", width, height);
647 die(
"Failed to allocate image", width, height);
662#if CONFIG_VP9_HIGHBITDEPTH
674 speed = (int)strtol(argv[8], NULL, 0);
676 die(
"Invalid speed setting: must be positive");
679 for (i = min_args_base;
680 (int)i < min_args_base + mode_to_num_layers[layering_mode]; ++i) {
681 rc.layer_target_bitrate[i - 13] = (int)strtol(argv[i], NULL, 0);
682 if (strncmp(encoder->name,
"vp8", 3) == 0)
684 else if (strncmp(encoder->name,
"vp9", 3) == 0)
704 cfg.
g_threads = (
unsigned int)strtoul(argv[11], NULL, 0);
706 error_resilient = (uint32_t)strtoul(argv[10], NULL, 0);
707 if (error_resilient != 0 && error_resilient != 1) {
708 die(
"Invalid value for error resilient (0, 1): %d.", error_resilient);
720 set_temporal_layer_pattern(layering_mode, &cfg, layer_flags,
723 set_rate_control_metrics(&rc, &cfg);
730 if (!(infile = fopen(argv[1],
"rb"))) {
731 die(
"Failed to open %s for reading", argv[1]);
737 char file_name[PATH_MAX];
739 info.codec_fourcc = encoder->fourcc;
740 info.frame_width = cfg.
g_w;
741 info.frame_height = cfg.
g_h;
745 snprintf(file_name,
sizeof(file_name),
"%s_%d.ivf", argv[2], i);
746 outfile[i] = vpx_video_writer_open(file_name, kContainerIVF, &info);
747 if (!outfile[i]) die(
"Failed to open %s for writing", file_name);
749 assert(outfile[i] != NULL);
755#if CONFIG_VP9_HIGHBITDEPTH
757 &codec, encoder->codec_interface(), &cfg,
762 die_codec(&codec,
"Failed to initialize encoder");
764 if (strncmp(encoder->name,
"vp8", 3) == 0) {
770 vp8_set_roi_map(&cfg, &roi);
772 die_codec(&codec,
"Failed to set ROI map");
775 }
else if (strncmp(encoder->name,
"vp9", 3) == 0) {
777 memset(&svc_params, 0,
sizeof(svc_params));
789 if (cfg.
g_threads > 1 && ((cfg.
g_w > 320 && cfg.
g_h > 240) || speed < 7))
794 die_codec(&codec,
"Failed to set SVC");
803 if (strncmp(encoder->name,
"vp8", 3) == 0) {
811 const int max_intra_size_pct = 1000;
817 while (frame_avail || got_data) {
818 struct vpx_usec_timer timer;
825 if (strncmp(encoder->name,
"vp9", 3) == 0) {
827 }
else if (strncmp(encoder->name,
"vp8", 3) == 0) {
831 flags = layer_flags[frame_cnt % flag_periodicity];
832 if (layering_mode == 0) flags = 0;
833 frame_avail = vpx_img_read(&raw, infile);
835 vpx_usec_timer_start(&timer);
838 die_codec(&codec,
"Failed to encode frame");
840 vpx_usec_timer_mark(&timer);
841 cx_time += vpx_usec_timer_elapsed(&timer);
843 if (layering_mode != 7) {
844 layer_flags[0] &= ~VPX_EFLAG_FORCE_KF;
853 vpx_video_writer_write_frame(outfile[i], pkt->
data.
frame.
buf,
855 ++rc.layer_tot_enc_frames[i];
856 rc.layer_encoding_bitrate[i] += 8.0 * pkt->
data.
frame.
sz;
860 rc.layer_avg_frame_size[i] += 8.0 * pkt->
data.
frame.
sz;
861 rc.layer_avg_rate_mismatch[i] +=
864 ++rc.layer_enc_frames[i];
870 if (frame_cnt > rc.window_size) {
871 sum_bitrate += 0.001 * 8.0 * pkt->
data.
frame.
sz * framerate;
872 if (frame_cnt % rc.window_size == 0) {
873 rc.window_count += 1;
874 rc.avg_st_encoding_bitrate += sum_bitrate / rc.window_size;
875 rc.variance_st_encoding_bitrate +=
876 (sum_bitrate / rc.window_size) *
877 (sum_bitrate / rc.window_size);
882 if (frame_cnt > rc.window_size + rc.window_size / 2) {
883 sum_bitrate2 += 0.001 * 8.0 * pkt->
data.
frame.
sz * framerate;
884 if (frame_cnt > 2 * rc.window_size &&
885 frame_cnt % rc.window_size == 0) {
886 rc.window_count += 1;
887 rc.avg_st_encoding_bitrate += sum_bitrate2 / rc.window_size;
888 rc.variance_st_encoding_bitrate +=
889 (sum_bitrate2 / rc.window_size) *
890 (sum_bitrate2 / rc.window_size);
899 pts += frame_duration;
902 printout_rate_control_summary(&rc, &cfg, frame_cnt);
904 printf(
"Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
905 frame_cnt, 1000 * (
float)cx_time / (
double)(frame_cnt * 1000000),
906 1000000 * (
double)frame_cnt / (
double)cx_time);
911 for (i = 0; i < cfg.
ts_number_layers; ++i) vpx_video_writer_close(outfile[i]);
const char * vpx_codec_err_to_string(vpx_codec_err_t err)
Convert error number to printable string.
vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx)
Destroy a codec instance.
const void * vpx_codec_iter_t
Iterator.
Definition: vpx_codec.h:187
const char * vpx_codec_iface_name(vpx_codec_iface_t *iface)
Return the name for a given interface.
enum vpx_bit_depth vpx_bit_depth_t
Bit depth for codecThis enumeration determines the bit depth of the codec.
#define vpx_codec_control(ctx, id, data)
vpx_codec_control wrapper macro
Definition: vpx_codec.h:404
vpx_codec_err_t
Algorithm return codes.
Definition: vpx_codec.h:90
@ VPX_BITS_8
Definition: vpx_codec.h:218
@ VPX_BITS_12
Definition: vpx_codec.h:220
@ VPX_BITS_10
Definition: vpx_codec.h:219
#define VPX_DL_REALTIME
deadline parameter analogous to VPx REALTIME mode.
Definition: vpx_encoder.h:849
#define VPX_TS_MAX_LAYERS
Definition: vpx_encoder.h:40
#define vpx_codec_enc_init(ctx, iface, cfg, flags)
Convenience macro for vpx_codec_enc_init_ver()
Definition: vpx_encoder.h:760
#define VPX_EFLAG_FORCE_KF
Definition: vpx_encoder.h:271
const vpx_codec_cx_pkt_t * vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Encoded data iterator.
#define VPX_TS_MAX_PERIODICITY
Definition: vpx_encoder.h:37
#define VPX_CODEC_USE_HIGHBITDEPTH
Definition: vpx_encoder.h:96
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_MAX_LAYERS
Definition: vpx_encoder.h:46
#define VPX_FRAME_IS_KEY
Definition: vpx_encoder.h:122
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.
@ VPX_CODEC_CX_FRAME_PKT
Definition: vpx_encoder.h:153
@ VPX_KF_AUTO
Definition: vpx_encoder.h:259
@ VPX_CBR
Definition: vpx_encoder.h:244
#define VP8_EFLAG_NO_UPD_ARF
Don't update the alternate reference frame.
Definition: vp8cx.h:95
#define VP8_EFLAG_NO_UPD_ENTROPY
Disable entropy update.
Definition: vp8cx.h:116
#define VP8_EFLAG_NO_UPD_LAST
Don't update the last frame.
Definition: vp8cx.h:81
#define VP8_EFLAG_NO_REF_ARF
Don't reference the alternate reference frame.
Definition: vp8cx.h:74
#define VP8_EFLAG_NO_UPD_GF
Don't update the golden frame.
Definition: vp8cx.h:88
#define VP8_EFLAG_NO_REF_GF
Don't reference the golden frame.
Definition: vp8cx.h:66
#define VP8_EFLAG_NO_REF_LAST
Don't reference the last frame.
Definition: vp8cx.h:58
@ VP9E_SET_FRAME_PERIODIC_BOOST
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:407
@ VP9E_SET_SVC_LAYER_ID
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:441
@ VP8E_SET_MAX_INTRA_BITRATE_PCT
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:251
@ VP8E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:130
@ VP9E_SET_AQ_MODE
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:392
@ VP8E_SET_NOISE_SENSITIVITY
control function to set noise sensitivity
Definition: vp8cx.h:170
@ VP8E_SET_TOKEN_PARTITIONS
Codec control function to set the number of token partitions.
Definition: vp8cx.h:188
@ VP9E_SET_SVC_PARAMETERS
Codec control function to set parameters for SVC.
Definition: vp8cx.h:432
@ VP9E_SET_FRAME_PARALLEL_DECODING
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:379
@ VP8E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:589
@ VP9E_SET_TUNE_CONTENT
Codec control function to set content type.
Definition: vp8cx.h:451
@ VP9E_SET_SVC
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:424
@ VP9E_SET_ROW_MT
Codec control function to set row level multi-threading.
Definition: vp8cx.h:558
@ VP8E_SET_CPUUSED
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:155
@ VP8E_SET_TEMPORAL_LAYER_ID
Codec control function to set the temporal layer id.
Definition: vp8cx.h:298
@ VP9E_SET_TILE_COLUMNS
Codec control function to set number of tile columns.
Definition: vp8cx.h:345
@ VP8E_SET_STATIC_THRESHOLD
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:182
@ VP8E_SET_SCREEN_CONTENT_MODE
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:306
@ VP9E_SET_NOISE_SENSITIVITY
Codec control function to set noise sensitivity.
Definition: vp8cx.h:415
@ VP9E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:287
@ VP9E_TEMPORAL_LAYERING_MODE_BYPASS
Bypass mode. Used when application needs to control temporal layering. This will only work when the n...
Definition: vp8cx.h:628
Codec context structure.
Definition: vpx_codec.h:197
Encoder output packet.
Definition: vpx_encoder.h:170
vpx_codec_frame_flags_t flags
Definition: vpx_encoder.h:180
enum vpx_codec_cx_pkt_kind kind
Definition: vpx_encoder.h:171
struct vpx_codec_cx_pkt::@1::@2 frame
size_t sz
Definition: vpx_encoder.h:175
void * buf
Definition: vpx_encoder.h:174
union vpx_codec_cx_pkt::@1 data
Encoder configuration structure.
Definition: vpx_encoder.h:279
unsigned int rc_resize_allowed
Enable/disable spatial resampling, if supported by the codec.
Definition: vpx_encoder.h:417
int temporal_layering_mode
Temporal layering mode indicating which temporal layering scheme to use.
Definition: vpx_encoder.h:712
unsigned int kf_min_dist
Keyframe minimum interval.
Definition: vpx_encoder.h:624
unsigned int rc_min_quantizer
Minimum (Best Quality) Quantizer.
Definition: vpx_encoder.h:491
unsigned int ts_number_layers
Number of temporal coding layers.
Definition: vpx_encoder.h:663
unsigned int ss_number_layers
Number of spatial coding layers.
Definition: vpx_encoder.h:643
unsigned int g_profile
Bitstream profile to use.
Definition: vpx_encoder.h:309
unsigned int layer_target_bitrate[12]
Target bitrate for each spatial/temporal layer.
Definition: vpx_encoder.h:703
unsigned int g_h
Height of the frame.
Definition: vpx_encoder.h:327
enum vpx_kf_mode kf_mode
Keyframe placement mode.
Definition: vpx_encoder.h:615
unsigned int ts_layer_id[16]
Template defining the membership of frames to temporal layers.
Definition: vpx_encoder.h:695
vpx_codec_er_flags_t g_error_resilient
Enable error resilient modes.
Definition: vpx_encoder.h:365
unsigned int ts_periodicity
Length of the sequence defining frame temporal layer membership.
Definition: vpx_encoder.h:686
unsigned int rc_overshoot_pct
Rate control adaptation overshoot control.
Definition: vpx_encoder.h:535
unsigned int g_w
Width of the frame.
Definition: vpx_encoder.h:318
unsigned int rc_buf_sz
Decoder Buffer Size.
Definition: vpx_encoder.h:550
unsigned int rc_dropframe_thresh
Temporal resampling configuration, if supported by the codec.
Definition: vpx_encoder.h:408
struct vpx_rational g_timebase
Stream timebase units.
Definition: vpx_encoder.h:357
unsigned int rc_max_quantizer
Maximum (Worst Quality) Quantizer.
Definition: vpx_encoder.h:501
unsigned int g_lag_in_frames
Allow lagged encoding.
Definition: vpx_encoder.h:386
enum vpx_rc_mode rc_end_usage
Rate control algorithm to use.
Definition: vpx_encoder.h:457
unsigned int rc_buf_initial_sz
Decoder Buffer Initial Size.
Definition: vpx_encoder.h:559
vpx_bit_depth_t g_bit_depth
Bit-depth of the codec.
Definition: vpx_encoder.h:335
unsigned int rc_buf_optimal_sz
Decoder Buffer Optimal Size.
Definition: vpx_encoder.h:568
unsigned int rc_target_bitrate
Target data rate.
Definition: vpx_encoder.h:477
unsigned int ts_target_bitrate[5]
Target bitrate for each temporal layer.
Definition: vpx_encoder.h:670
unsigned int g_input_bit_depth
Bit-depth of the input frames.
Definition: vpx_encoder.h:343
unsigned int rc_undershoot_pct
Rate control adaptation undershoot control.
Definition: vpx_encoder.h:520
unsigned int ts_rate_decimator[5]
Frame rate decimation factor for each temporal layer.
Definition: vpx_encoder.h:677
unsigned int kf_max_dist
Keyframe maximum interval.
Definition: vpx_encoder.h:633
unsigned int g_threads
Maximum number of threads to use.
Definition: vpx_encoder.h:299
Image Descriptor.
Definition: vpx_image.h:88
int den
Definition: vpx_encoder.h:231
int num
Definition: vpx_encoder.h:230
vpx region of interest map
Definition: vp8cx.h:645
unsigned int static_threshold[4]
Definition: vp8cx.h:656
unsigned int rows
Definition: vp8cx.h:648
int delta_lf[4]
Definition: vp8cx.h:654
unsigned int cols
Definition: vp8cx.h:649
int delta_q[4]
Definition: vp8cx.h:653
unsigned char * roi_map
Definition: vp8cx.h:647
vp9 svc layer parameters
Definition: vp8cx.h:718
int temporal_layer_id
Definition: vp8cx.h:720
int spatial_layer_id
Definition: vp8cx.h:719
vp9 svc extra configure parameters
Definition: vpx_encoder.h:720
int min_quantizers[12]
Definition: vpx_encoder.h:722
int scaling_factor_num[12]
Definition: vpx_encoder.h:723
int max_quantizers[12]
Definition: vpx_encoder.h:721
int scaling_factor_den[12]
Definition: vpx_encoder.h:724
Provides definitions for using VP8 or VP9 encoder algorithm within the vpx Codec Interface.
Describes the encoder algorithm interface to applications.
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.
@ VPX_IMG_FMT_I42016
Definition: vpx_image.h:63
@ VPX_IMG_FMT_I420
Definition: vpx_image.h:55
void vpx_img_free(vpx_image_t *img)
Close an image descriptor.