Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: source/libvpx/vp9/vp9_cx_iface.c

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/vp9_common.mk ('k') | source/libvpx/vp9/vp9_dx_iface.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/vp9_cx_iface.c
===================================================================
--- source/libvpx/vp9/vp9_cx_iface.c (revision 254565)
+++ source/libvpx/vp9/vp9_cx_iface.c (working copy)
@@ -264,7 +264,7 @@
static vpx_codec_err_t set_vp9e_config(VP9_CONFIG *oxcf,
vpx_codec_enc_cfg_t cfg,
- struct vp9_extracfg vp8_cfg) {
+ struct vp9_extracfg vp9_cfg) {
oxcf->version = cfg.g_profile;
oxcf->width = cfg.g_w;
oxcf->height = cfg.g_h;
@@ -289,10 +289,8 @@
}
if (cfg.g_pass == VPX_RC_FIRST_PASS) {
- oxcf->allow_lag = 0;
oxcf->lag_in_frames = 0;
} else {
- oxcf->allow_lag = (cfg.g_lag_in_frames) > 0;
oxcf->lag_in_frames = cfg.g_lag_in_frames;
}
@@ -305,11 +303,11 @@
oxcf->end_usage = USAGE_STREAM_FROM_SERVER;
oxcf->target_bandwidth = cfg.rc_target_bitrate;
- oxcf->rc_max_intra_bitrate_pct = vp8_cfg.rc_max_intra_bitrate_pct;
+ oxcf->rc_max_intra_bitrate_pct = vp9_cfg.rc_max_intra_bitrate_pct;
oxcf->best_allowed_q = cfg.rc_min_quantizer;
oxcf->worst_allowed_q = cfg.rc_max_quantizer;
- oxcf->cq_level = vp8_cfg.cq_level;
+ oxcf->cq_level = vp9_cfg.cq_level;
oxcf->fixed_q = -1;
oxcf->under_shoot_pct = cfg.rc_undershoot_pct;
@@ -330,33 +328,40 @@
// oxcf->kf_min_dist = cfg.kf_min_dis;
oxcf->key_freq = cfg.kf_max_dist;
- oxcf->cpu_used = vp8_cfg.cpu_used;
- oxcf->encode_breakout = vp8_cfg.static_thresh;
- oxcf->play_alternate = vp8_cfg.enable_auto_alt_ref;
- oxcf->noise_sensitivity = vp8_cfg.noise_sensitivity;
- oxcf->sharpness = vp8_cfg.sharpness;
+ oxcf->cpu_used = vp9_cfg.cpu_used;
+ oxcf->encode_breakout = vp9_cfg.static_thresh;
+ oxcf->play_alternate = vp9_cfg.enable_auto_alt_ref;
+ oxcf->noise_sensitivity = vp9_cfg.noise_sensitivity;
+ oxcf->sharpness = vp9_cfg.sharpness;
oxcf->two_pass_stats_in = cfg.rc_twopass_stats_in;
- oxcf->output_pkt_list = vp8_cfg.pkt_list;
+ oxcf->output_pkt_list = vp9_cfg.pkt_list;
- oxcf->arnr_max_frames = vp8_cfg.arnr_max_frames;
- oxcf->arnr_strength = vp8_cfg.arnr_strength;
- oxcf->arnr_type = vp8_cfg.arnr_type;
+ oxcf->arnr_max_frames = vp9_cfg.arnr_max_frames;
+ oxcf->arnr_strength = vp9_cfg.arnr_strength;
+ oxcf->arnr_type = vp9_cfg.arnr_type;
- oxcf->tuning = vp8_cfg.tuning;
+ oxcf->tuning = vp9_cfg.tuning;
- oxcf->tile_columns = vp8_cfg.tile_columns;
- oxcf->tile_rows = vp8_cfg.tile_rows;
+ oxcf->tile_columns = vp9_cfg.tile_columns;
+ oxcf->tile_rows = vp9_cfg.tile_rows;
- oxcf->lossless = vp8_cfg.lossless;
+ oxcf->lossless = vp9_cfg.lossless;
oxcf->error_resilient_mode = cfg.g_error_resilient;
- oxcf->frame_parallel_decoding_mode = vp8_cfg.frame_parallel_decoding_mode;
+ oxcf->frame_parallel_decoding_mode = vp9_cfg.frame_parallel_decoding_mode;
- oxcf->aq_mode = vp8_cfg.aq_mode;
+ oxcf->aq_mode = vp9_cfg.aq_mode;
oxcf->ss_number_layers = cfg.ss_number_layers;
+ if (oxcf->ss_number_layers > 1) {
+ memcpy(oxcf->ss_target_bitrate, cfg.ss_target_bitrate,
+ sizeof(cfg.ss_target_bitrate));
+ } else if (oxcf->ss_number_layers == 1) {
+ oxcf->ss_target_bitrate[0] = (int)oxcf->target_bandwidth;
+ }
+
oxcf->ts_number_layers = cfg.ts_number_layers;
if (oxcf->ts_number_layers > 1) {
@@ -365,7 +370,7 @@
memcpy(oxcf->ts_rate_decimator, cfg.ts_rate_decimator,
sizeof(cfg.ts_rate_decimator));
} else if (oxcf->ts_number_layers == 1) {
- oxcf->ts_target_bitrate[0] = oxcf->target_bandwidth;
+ oxcf->ts_target_bitrate[0] = (int)oxcf->target_bandwidth;
oxcf->ts_rate_decimator[0] = 1;
}
@@ -390,7 +395,6 @@
printf("two_pass_vbrbias: %d\n", oxcf->two_pass_vbrbias);
printf("two_pass_vbrmin_section: %d\n", oxcf->two_pass_vbrmin_section);
printf("two_pass_vbrmax_section: %d\n", oxcf->two_pass_vbrmax_section);
- printf("allow_lag: %d\n", oxcf->allow_lag);
printf("lag_in_frames: %d\n", oxcf->lag_in_frames);
printf("play_alternate: %d\n", oxcf->play_alternate);
printf("Version: %d\n", oxcf->Version);
@@ -639,7 +643,7 @@
*x++ = marker;
for (i = 0; i < ctx->pending_frame_count; i++) {
- int this_sz = ctx->pending_frame_sizes[i];
+ unsigned int this_sz = (unsigned int)ctx->pending_frame_sizes[i];
for (j = 0; j <= mag; j++) {
*x++ = this_sz & 0xff;
@@ -1049,7 +1053,7 @@
return VPX_CODEC_INVALID_PARAM;
}
if (cpi->svc.spatial_layer_id < 0 ||
- cpi->svc.spatial_layer_id >= ctx->cfg.ss_number_layers) {
+ cpi->svc.spatial_layer_id >= (int)ctx->cfg.ss_number_layers) {
return VPX_CODEC_INVALID_PARAM;
}
return VPX_CODEC_OK;
@@ -1163,6 +1167,7 @@
9999, /* kf_max_dist */
VPX_SS_DEFAULT_LAYERS, /* ss_number_layers */
+ {0}, /* ss_target_bitrate */
1, /* ts_number_layers */
{0}, /* ts_target_bitrate */
{0}, /* ts_rate_decimator */
« no previous file with comments | « source/libvpx/vp9/vp9_common.mk ('k') | source/libvpx/vp9/vp9_dx_iface.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698