21 #include "./vpx_config.h"
22 #include "./y4minput.h"
23 #include "../vpx_ports/vpx_timer.h"
26 #include "vpx_ports/bitops.h"
28 #include "../tools_common.h"
29 #include "../video_writer.h"
33 #define zero(Dest) memset(&(Dest), 0, sizeof(Dest));
35 static const char *exec_name;
37 void usage_exit(
void) { exit(EXIT_FAILURE); }
40 enum denoiserStateVp8 {
44 kVp8DenoiserOnYUVAggressive,
45 kVp8DenoiserOnAdaptive
49 enum denoiserStateVp9 {
53 kVp9DenoiserOnYTwoSpatialLayers
56 static int mode_to_num_layers[13] = { 1, 2, 2, 3, 3, 3, 3, 5, 2, 3, 3, 3, 3 };
59 struct RateControlMetrics {
78 double avg_st_encoding_bitrate;
80 double variance_st_encoding_bitrate;
94 static void set_rate_control_metrics(
struct RateControlMetrics *rc,
103 1000.0 * rc->layer_target_bitrate[0] / rc->layer_framerate[0];
104 for (i = 0; i < ts_number_layers; ++i) {
109 (rc->layer_target_bitrate[i] - rc->layer_target_bitrate[i - 1]) /
110 (rc->layer_framerate[i] - rc->layer_framerate[i - 1]);
112 rc->layer_input_frames[i] = 0;
113 rc->layer_enc_frames[i] = 0;
114 rc->layer_tot_enc_frames[i] = 0;
115 rc->layer_encoding_bitrate[i] = 0.0;
116 rc->layer_avg_frame_size[i] = 0.0;
117 rc->layer_avg_rate_mismatch[i] = 0.0;
119 rc->window_count = 0;
120 rc->window_size = 15;
121 rc->avg_st_encoding_bitrate = 0.0;
122 rc->variance_st_encoding_bitrate = 0.0;
128 static void printout_rate_control_summary(
struct RateControlMetrics *rc,
132 int tot_num_frames = 0;
133 double perc_fluctuation = 0.0;
134 printf(
"Total number of processed frames: %d\n\n", frame_cnt - 1);
135 printf(
"Rate control layer stats for %d layer(s):\n\n",
138 const int num_dropped =
139 (i > 0) ? (rc->layer_input_frames[i] - rc->layer_enc_frames[i])
140 : (rc->layer_input_frames[i] - rc->layer_enc_frames[i] - 1);
141 tot_num_frames += rc->layer_input_frames[i];
142 rc->layer_encoding_bitrate[i] = 0.001 * rc->layer_framerate[i] *
143 rc->layer_encoding_bitrate[i] /
145 rc->layer_avg_frame_size[i] =
146 rc->layer_avg_frame_size[i] / rc->layer_enc_frames[i];
147 rc->layer_avg_rate_mismatch[i] =
148 100.0 * rc->layer_avg_rate_mismatch[i] / rc->layer_enc_frames[i];
149 printf(
"For layer#: %d \n", i);
150 printf(
"Bitrate (target vs actual): %d %f \n", rc->layer_target_bitrate[i],
151 rc->layer_encoding_bitrate[i]);
152 printf(
"Average frame size (target vs actual): %f %f \n", rc->layer_pfb[i],
153 rc->layer_avg_frame_size[i]);
154 printf(
"Average rate_mismatch: %f \n", rc->layer_avg_rate_mismatch[i]);
156 "Number of input frames, encoded (non-key) frames, "
157 "and perc dropped frames: %d %d %f \n",
158 rc->layer_input_frames[i], rc->layer_enc_frames[i],
159 100.0 * num_dropped / rc->layer_input_frames[i]);
162 rc->avg_st_encoding_bitrate = rc->avg_st_encoding_bitrate / rc->window_count;
163 rc->variance_st_encoding_bitrate =
164 rc->variance_st_encoding_bitrate / rc->window_count -
165 (rc->avg_st_encoding_bitrate * rc->avg_st_encoding_bitrate);
166 perc_fluctuation = 100.0 * sqrt(rc->variance_st_encoding_bitrate) /
167 rc->avg_st_encoding_bitrate;
168 printf(
"Short-time stats, for window of %d frames: \n", rc->window_size);
169 printf(
"Average, rms-variance, and percent-fluct: %f %f %f \n",
170 rc->avg_st_encoding_bitrate, sqrt(rc->variance_st_encoding_bitrate),
172 if ((frame_cnt - 1) != tot_num_frames)
173 die(
"Error: Number of input frames not equal to output! \n");
181 uint8_t is_vp8 = strncmp(enc_name,
"vp8", 3) == 0 ? 1 : 0;
182 uint8_t is_vp9 = strncmp(enc_name,
"vp9", 3) == 0 ? 1 : 0;
183 if (!is_vp8 && !is_vp9) {
184 die(
"unsupported codec.");
188 block_size = is_vp9 && !is_vp8 ? 8 : 16;
192 roi->
rows = (cfg->
g_h + block_size - 1) / block_size;
193 roi->
cols = (cfg->
g_w + block_size - 1) / block_size;
234 for (i = 0; i < roi->
rows; ++i) {
235 for (j = 0; j < roi->
cols; ++j) {
236 if (i > (roi->
rows >> 2) && i < ((roi->
rows * 3) >> 2) &&
237 j > (roi->
cols >> 2) && j < ((roi->
cols * 3) >> 2)) {
250 static void set_temporal_layer_pattern(
int layering_mode,
253 int *flag_periodicity) {
254 switch (layering_mode) {
259 *flag_periodicity = 1;
270 int ids[2] = { 0, 1 };
272 *flag_periodicity = 2;
296 int ids[3] = { 0, 1, 1 };
298 *flag_periodicity = 3;
307 layer_flags[1] = layer_flags[2] =
314 int ids[6] = { 0, 2, 2, 1, 2, 2 };
316 *flag_periodicity = 6;
328 layer_flags[1] = layer_flags[2] = layer_flags[4] = layer_flags[5] =
334 int ids[4] = { 0, 2, 1, 2 };
336 *flag_periodicity = 4;
348 layer_flags[1] = layer_flags[3] =
355 int ids[4] = { 0, 2, 1, 2 };
357 *flag_periodicity = 4;
370 layer_flags[1] = layer_flags[3] =
377 int ids[4] = { 0, 2, 1, 2 };
379 *flag_periodicity = 4;
391 layer_flags[1] = layer_flags[3] =
398 int ids[16] = { 0, 4, 3, 4, 2, 4, 3, 4, 1, 4, 3, 4, 2, 4, 3, 4 };
400 *flag_periodicity = 16;
409 layer_flags[1] = layer_flags[3] = layer_flags[5] = layer_flags[7] =
410 layer_flags[9] = layer_flags[11] = layer_flags[13] = layer_flags[15] =
413 layer_flags[2] = layer_flags[6] = layer_flags[10] = layer_flags[14] =
415 layer_flags[4] = layer_flags[12] =
422 int ids[2] = { 0, 1 };
424 *flag_periodicity = 8;
446 layer_flags[4] = layer_flags[2];
448 layer_flags[5] = layer_flags[3];
450 layer_flags[6] = layer_flags[4];
452 layer_flags[7] = layer_flags[5];
457 int ids[4] = { 0, 2, 1, 2 };
459 *flag_periodicity = 8;
473 layer_flags[3] = layer_flags[5] =
488 int ids[4] = { 0, 2, 1, 2 };
490 *flag_periodicity = 8;
514 layer_flags[5] = layer_flags[3];
518 layer_flags[7] = layer_flags[3];
527 int ids[4] = { 0, 2, 1, 2 };
529 *flag_periodicity = 4;
550 int ids[4] = { 0, 2, 1, 2 };
552 *flag_periodicity = 8;
562 layer_flags[4] = layer_flags[0];
565 layer_flags[6] = layer_flags[2];
569 layer_flags[3] = layer_flags[1];
570 layer_flags[5] = layer_flags[1];
571 layer_flags[7] = layer_flags[1];
577 int main(
int argc,
char **argv) {
586 uint32_t error_resilient = 0;
593 int frame_duration = 1;
594 int layering_mode = 0;
596 int flag_periodicity = 1;
601 const VpxInterface *encoder = NULL;
602 struct VpxInputContext input_ctx;
603 struct RateControlMetrics rc;
605 const int min_args_base = 13;
606 #if CONFIG_VP9_HIGHBITDEPTH
608 int input_bit_depth = 8;
609 const int min_args = min_args_base + 1;
611 const int min_args = min_args_base;
613 double sum_bitrate = 0.0;
614 double sum_bitrate2 = 0.0;
615 double framerate = 30.0;
617 zero(rc.layer_target_bitrate);
619 memset(&input_ctx, 0,
sizeof(input_ctx));
621 input_ctx.framerate.numerator = 30;
622 input_ctx.framerate.denominator = 1;
623 input_ctx.only_i420 = 1;
624 input_ctx.bit_depth = 0;
628 if (argc < min_args) {
629 #if CONFIG_VP9_HIGHBITDEPTH
630 die(
"Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
631 "<rate_num> <rate_den> <speed> <frame_drop_threshold> "
632 "<error_resilient> <threads> <mode> "
633 "<Rate_0> ... <Rate_nlayers-1> <bit-depth> \n",
636 die(
"Usage: %s <infile> <outfile> <codec_type(vp8/vp9)> <width> <height> "
637 "<rate_num> <rate_den> <speed> <frame_drop_threshold> "
638 "<error_resilient> <threads> <mode> "
639 "<Rate_0> ... <Rate_nlayers-1> \n",
644 encoder = get_vpx_encoder_by_name(argv[3]);
645 if (!encoder) die(
"Unsupported codec.");
649 width = (
unsigned int)strtoul(argv[4], NULL, 0);
650 height = (
unsigned int)strtoul(argv[5], NULL, 0);
651 if (width < 16 || width % 2 || height < 16 || height % 2) {
652 die(
"Invalid resolution: %d x %d", width, height);
655 layering_mode = (int)strtol(argv[12], NULL, 0);
656 if (layering_mode < 0 || layering_mode > 13) {
657 die(
"Invalid layering mode (0..12) %s", argv[12]);
660 if (argc != min_args + mode_to_num_layers[layering_mode]) {
661 die(
"Invalid number of arguments");
664 input_ctx.filename = argv[1];
665 open_input_file(&input_ctx);
667 #if CONFIG_VP9_HIGHBITDEPTH
668 switch (strtol(argv[argc - 1], NULL, 0)) {
675 input_bit_depth = 10;
679 input_bit_depth = 12;
681 default: die(
"Invalid bit depth (8, 10, 12) %s", argv[argc - 1]);
685 if (input_ctx.file_type != FILE_TYPE_Y4M) {
689 width, height, 32)) {
690 die(
"Failed to allocate image", width, height);
695 if (input_ctx.file_type != FILE_TYPE_Y4M) {
697 die(
"Failed to allocate image", width, height);
713 #if CONFIG_VP9_HIGHBITDEPTH
725 speed = (int)strtol(argv[8], NULL, 0);
727 die(
"Invalid speed setting: must be positive");
729 if (strncmp(encoder->name,
"vp9", 3) == 0 && speed > 9) {
730 warn(
"Mapping speed %d to speed 9.\n", speed);
733 for (i = min_args_base;
734 (int)i < min_args_base + mode_to_num_layers[layering_mode]; ++i) {
735 rc.layer_target_bitrate[i - 13] = (int)strtol(argv[i], NULL, 0);
736 if (strncmp(encoder->name,
"vp8", 3) == 0)
738 else if (strncmp(encoder->name,
"vp9", 3) == 0)
758 cfg.
g_threads = (
unsigned int)strtoul(argv[11], NULL, 0);
760 error_resilient = (uint32_t)strtoul(argv[10], NULL, 0);
761 if (error_resilient != 0 && error_resilient != 1) {
762 die(
"Invalid value for error resilient (0, 1): %d.", error_resilient);
774 set_temporal_layer_pattern(layering_mode, &cfg, layer_flags,
777 set_rate_control_metrics(&rc, &cfg);
779 if (input_ctx.file_type == FILE_TYPE_Y4M) {
780 if (input_ctx.width != cfg.
g_w || input_ctx.height != cfg.
g_h) {
781 die(
"Incorrect width or height: %d x %d", cfg.
g_w, cfg.
g_h);
785 die(
"Incorrect framerate: numerator %d denominator %d",
793 char file_name[PATH_MAX];
795 info.codec_fourcc = encoder->fourcc;
796 info.frame_width = cfg.
g_w;
797 info.frame_height = cfg.
g_h;
801 snprintf(file_name,
sizeof(file_name),
"%s_%d.ivf", argv[2], i);
802 outfile[i] = vpx_video_writer_open(file_name, kContainerIVF, &info);
803 if (!outfile[i]) die(
"Failed to open %s for writing", file_name);
805 assert(outfile[i] != NULL);
811 #if CONFIG_VP9_HIGHBITDEPTH
813 &codec, encoder->codec_interface(), &cfg,
818 die(
"Failed to initialize encoder");
820 if (strncmp(encoder->name,
"vp8", 3) == 0) {
826 set_roi_map(encoder->name, &cfg, &roi);
828 die_codec(&codec,
"Failed to set ROI map");
831 }
else if (strncmp(encoder->name,
"vp9", 3) == 0) {
833 memset(&svc_params, 0,
sizeof(svc_params));
844 set_roi_map(encoder->name, &cfg, &roi);
846 die_codec(&codec,
"Failed to set ROI map");
854 die_codec(&codec,
"Failed to set SVC");
863 if (strncmp(encoder->name,
"vp8", 3) == 0) {
871 const int max_intra_size_pct = 1000;
877 while (frame_avail || got_data) {
878 struct vpx_usec_timer timer;
886 if (strncmp(encoder->name,
"vp9", 3) == 0) {
888 }
else if (strncmp(encoder->name,
"vp8", 3) == 0) {
892 flags = layer_flags[frame_cnt % flag_periodicity];
893 if (layering_mode == 0) flags = 0;
894 frame_avail = read_frame(&input_ctx, &raw);
896 vpx_usec_timer_start(&timer);
899 die_codec(&codec,
"Failed to encode frame");
901 vpx_usec_timer_mark(&timer);
902 cx_time += vpx_usec_timer_elapsed(&timer);
904 if (layering_mode != 7) {
914 vpx_video_writer_write_frame(outfile[i], pkt->
data.
frame.buf,
916 ++rc.layer_tot_enc_frames[i];
917 rc.layer_encoding_bitrate[i] += 8.0 * pkt->
data.
frame.sz;
921 rc.layer_avg_frame_size[i] += 8.0 * pkt->
data.
frame.sz;
922 rc.layer_avg_rate_mismatch[i] +=
923 fabs(8.0 * pkt->
data.
frame.sz - rc.layer_pfb[i]) /
925 ++rc.layer_enc_frames[i];
931 if (frame_cnt > rc.window_size) {
932 sum_bitrate += 0.001 * 8.0 * pkt->
data.
frame.sz * framerate;
933 if (frame_cnt % rc.window_size == 0) {
934 rc.window_count += 1;
935 rc.avg_st_encoding_bitrate += sum_bitrate / rc.window_size;
936 rc.variance_st_encoding_bitrate +=
937 (sum_bitrate / rc.window_size) *
938 (sum_bitrate / rc.window_size);
943 if (frame_cnt > rc.window_size + rc.window_size / 2) {
944 sum_bitrate2 += 0.001 * 8.0 * pkt->
data.
frame.sz * framerate;
945 if (frame_cnt > 2 * rc.window_size &&
946 frame_cnt % rc.window_size == 0) {
947 rc.window_count += 1;
948 rc.avg_st_encoding_bitrate += sum_bitrate2 / rc.window_size;
949 rc.variance_st_encoding_bitrate +=
950 (sum_bitrate2 / rc.window_size) *
951 (sum_bitrate2 / rc.window_size);
960 pts += frame_duration;
962 close_input_file(&input_ctx);
963 printout_rate_control_summary(&rc, &cfg, frame_cnt);
965 printf(
"Frame cnt and encoding time/FPS stats for encoding: %d %f %f \n",
966 frame_cnt, 1000 * (
float)cx_time / (
double)(frame_cnt * 1000000),
967 1000000 * (
double)frame_cnt / (
double)cx_time);
972 for (i = 0; i < cfg.
ts_number_layers; ++i) vpx_video_writer_close(outfile[i]);
974 if (input_ctx.file_type != FILE_TYPE_Y4M) {
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:190
enum vpx_bit_depth vpx_bit_depth_t
Bit depth for codecThis enumeration determines the bit depth of the codec.
const char * vpx_codec_iface_name(vpx_codec_iface_t *iface)
Return the name for a given interface.
const char * vpx_codec_err_to_string(vpx_codec_err_t err)
Convert error number to printable string.
#define vpx_codec_control(ctx, id, data)
vpx_codec_control wrapper macro
Definition: vpx_codec.h:407
vpx_codec_err_t
Algorithm return codes.
Definition: vpx_codec.h:93
@ VPX_BITS_8
Definition: vpx_codec.h:221
@ VPX_BITS_12
Definition: vpx_codec.h:223
@ VPX_BITS_10
Definition: vpx_codec.h:222
#define VPX_DL_REALTIME
deadline parameter analogous to VPx REALTIME mode.
Definition: vpx_encoder.h:830
#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:741
#define VPX_EFLAG_FORCE_KF
Definition: vpx_encoder.h:260
#define VPX_TS_MAX_PERIODICITY
Definition: vpx_encoder.h:37
#define VPX_CODEC_USE_HIGHBITDEPTH
Definition: vpx_encoder.h:90
#define VPX_MAX_LAYERS
Definition: vpx_encoder.h:43
#define VPX_FRAME_IS_KEY
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 usage)
Get a default configuration.
const vpx_codec_cx_pkt_t * vpx_codec_get_cx_data(vpx_codec_ctx_t *ctx, vpx_codec_iter_t *iter)
Encoded data iterator.
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:147
@ VPX_KF_AUTO
Definition: vpx_encoder.h:248
@ VPX_CBR
Definition: vpx_encoder.h:233
#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:413
@ VP9E_SET_SVC_LAYER_ID
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:453
@ VP8E_SET_MAX_INTRA_BITRATE_PCT
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:257
@ VP9E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:436
@ 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:398
@ VP8E_SET_NOISE_SENSITIVITY
control function to set noise sensitivity
Definition: vp8cx.h:173
@ VP8E_SET_TOKEN_PARTITIONS
Codec control function to set the number of token partitions.
Definition: vp8cx.h:194
@ VP9E_SET_SVC_PARAMETERS
Codec control function to set parameters for SVC.
Definition: vp8cx.h:444
@ VP9E_SET_FRAME_PARALLEL_DECODING
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:385
@ VP8E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:601
@ VP9E_SET_TUNE_CONTENT
Codec control function to set content type.
Definition: vp8cx.h:463
@ VP9E_SET_SVC
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:430
@ VP9E_SET_ROW_MT
Codec control function to set row level multi-threading.
Definition: vp8cx.h:570
@ 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:304
@ VP9E_SET_TILE_COLUMNS
Codec control function to set number of tile columns.
Definition: vp8cx.h:351
@ VP8E_SET_STATIC_THRESHOLD
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:188
@ VP8E_SET_SCREEN_CONTENT_MODE
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:312
@ VP9E_SET_NOISE_SENSITIVITY
Codec control function to set noise sensitivity.
Definition: vp8cx.h:421
@ VP9E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:293
@ 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:716
Codec context structure.
Definition: vpx_codec.h:200
Encoder output packet.
Definition: vpx_encoder.h:159
enum vpx_codec_cx_pkt_kind kind
Definition: vpx_encoder.h:160
struct vpx_codec_cx_pkt::@1::@2 frame
union vpx_codec_cx_pkt::@1 data
Encoder configuration structure.
Definition: vpx_encoder.h:268
unsigned int rc_resize_allowed
Enable/disable spatial resampling, if supported by the codec.
Definition: vpx_encoder.h:400
int temporal_layering_mode
Temporal layering mode indicating which temporal layering scheme to use.
Definition: vpx_encoder.h:693
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
unsigned int ts_number_layers
Number of temporal coding layers.
Definition: vpx_encoder.h:644
unsigned int ss_number_layers
Number of spatial coding layers.
Definition: vpx_encoder.h:624
unsigned int g_profile
Bitstream profile to use.
Definition: vpx_encoder.h:295
unsigned int layer_target_bitrate[12]
Target bitrate for each spatial/temporal layer.
Definition: vpx_encoder.h:684
unsigned int g_h
Height of the frame.
Definition: vpx_encoder.h:313
enum vpx_kf_mode kf_mode
Keyframe placement mode.
Definition: vpx_encoder.h:596
unsigned int ts_layer_id[16]
Template defining the membership of frames to temporal layers.
Definition: vpx_encoder.h:676
vpx_codec_er_flags_t g_error_resilient
Enable error resilient modes.
Definition: vpx_encoder.h:351
unsigned int ts_periodicity
Length of the sequence defining frame temporal layer membership.
Definition: vpx_encoder.h:667
unsigned int rc_overshoot_pct
Rate control adaptation overshoot control.
Definition: vpx_encoder.h:516
unsigned int g_w
Width of the frame.
Definition: vpx_encoder.h:304
unsigned int rc_buf_sz
Decoder Buffer Size.
Definition: vpx_encoder.h:531
unsigned int rc_dropframe_thresh
Temporal resampling configuration, if supported by the codec.
Definition: vpx_encoder.h:391
struct vpx_rational g_timebase
Stream timebase units.
Definition: vpx_encoder.h:343
unsigned int rc_max_quantizer
Maximum (Worst Quality) Quantizer.
Definition: vpx_encoder.h:482
unsigned int g_lag_in_frames
Allow lagged encoding.
Definition: vpx_encoder.h:372
enum vpx_rc_mode rc_end_usage
Rate control algorithm to use.
Definition: vpx_encoder.h:440
unsigned int rc_buf_initial_sz
Decoder Buffer Initial Size.
Definition: vpx_encoder.h:540
vpx_bit_depth_t g_bit_depth
Bit-depth of the codec.
Definition: vpx_encoder.h:321
unsigned int rc_buf_optimal_sz
Decoder Buffer Optimal Size.
Definition: vpx_encoder.h:549
unsigned int rc_target_bitrate
Target data rate.
Definition: vpx_encoder.h:460
unsigned int ts_target_bitrate[5]
Target bitrate for each temporal layer.
Definition: vpx_encoder.h:651
unsigned int g_input_bit_depth
Bit-depth of the input frames.
Definition: vpx_encoder.h:329
unsigned int rc_undershoot_pct
Rate control adaptation undershoot control.
Definition: vpx_encoder.h:501
unsigned int ts_rate_decimator[5]
Frame rate decimation factor for each temporal layer.
Definition: vpx_encoder.h:658
unsigned int kf_max_dist
Keyframe maximum interval.
Definition: vpx_encoder.h:614
unsigned int g_threads
Maximum number of threads to use.
Definition: vpx_encoder.h:285
Image Descriptor.
Definition: vpx_image.h:72
int den
Definition: vpx_encoder.h:220
int num
Definition: vpx_encoder.h:219
vpx region of interest map
Definition: vp8cx.h:733
int skip[8]
Definition: vp8cx.h:745
unsigned int static_threshold[4]
Definition: vp8cx.h:748
unsigned int rows
Definition: vp8cx.h:739
unsigned int cols
Definition: vp8cx.h:740
int ref_frame[8]
Definition: vp8cx.h:746
int delta_q[8]
Definition: vp8cx.h:742
unsigned char * roi_map
Definition: vp8cx.h:738
int delta_lf[8]
Definition: vp8cx.h:743
vp9 svc layer parameters
Definition: vp8cx.h:810
int temporal_layer_id
Definition: vp8cx.h:813
int temporal_layer_id_per_spatial[5]
Definition: vp8cx.h:814
int spatial_layer_id
Definition: vp8cx.h:811
vp9 svc extra configure parameters
Definition: vpx_encoder.h:701
int min_quantizers[12]
Definition: vpx_encoder.h:703
int scaling_factor_num[12]
Definition: vpx_encoder.h:704
int max_quantizers[12]
Definition: vpx_encoder.h:702
int scaling_factor_den[12]
Definition: vpx_encoder.h:705
Provides definitions for using VP8 or VP9 encoder algorithm within the vpx Codec Interface.
Describes the encoder algorithm interface to applications.
@ VPX_IMG_FMT_I42016
Definition: vpx_image.h:47
@ VPX_IMG_FMT_I420
Definition: vpx_image.h:42
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.
void vpx_img_free(vpx_image_t *img)
Close an image descriptor.