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

Side by Side Diff: source/libvpx/vp9/encoder/vp9_firstpass.c

Issue 1328593002: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 3 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 unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_firstpass.h ('k') | source/libvpx/vp9/encoder/vp9_mbgraph.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 1230
1231 static void setup_rf_level_maxq(VP9_COMP *cpi) { 1231 static void setup_rf_level_maxq(VP9_COMP *cpi) {
1232 int i; 1232 int i;
1233 RATE_CONTROL *const rc = &cpi->rc; 1233 RATE_CONTROL *const rc = &cpi->rc;
1234 for (i = INTER_NORMAL; i < RATE_FACTOR_LEVELS; ++i) { 1234 for (i = INTER_NORMAL; i < RATE_FACTOR_LEVELS; ++i) {
1235 int qdelta = vp9_frame_type_qdelta(cpi, i, rc->worst_quality); 1235 int qdelta = vp9_frame_type_qdelta(cpi, i, rc->worst_quality);
1236 rc->rf_level_maxq[i] = VPXMAX(rc->worst_quality + qdelta, rc->best_quality); 1236 rc->rf_level_maxq[i] = VPXMAX(rc->worst_quality + qdelta, rc->best_quality);
1237 } 1237 }
1238 } 1238 }
1239 1239
1240 void vp9_init_subsampling(VP9_COMP *cpi) { 1240 static void init_subsampling(VP9_COMP *cpi) {
1241 const VP9_COMMON *const cm = &cpi->common; 1241 const VP9_COMMON *const cm = &cpi->common;
1242 RATE_CONTROL *const rc = &cpi->rc; 1242 RATE_CONTROL *const rc = &cpi->rc;
1243 const int w = cm->width; 1243 const int w = cm->width;
1244 const int h = cm->height; 1244 const int h = cm->height;
1245 int i; 1245 int i;
1246 1246
1247 for (i = 0; i < FRAME_SCALE_STEPS; ++i) { 1247 for (i = 0; i < FRAME_SCALE_STEPS; ++i) {
1248 // Note: Frames with odd-sized dimensions may result from this scaling. 1248 // Note: Frames with odd-sized dimensions may result from this scaling.
1249 rc->frame_width[i] = (w * 16) / frame_scale_factor[i]; 1249 rc->frame_width[i] = (w * 16) / frame_scale_factor[i];
1250 rc->frame_height[i] = (h * 16) / frame_scale_factor[i]; 1250 rc->frame_height[i] = (h * 16) / frame_scale_factor[i];
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1325 cpi->rc.vbr_bits_off_target = 0; 1325 cpi->rc.vbr_bits_off_target = 0;
1326 cpi->rc.vbr_bits_off_target_fast = 0; 1326 cpi->rc.vbr_bits_off_target_fast = 0;
1327 1327
1328 cpi->rc.rate_error_estimate = 0; 1328 cpi->rc.rate_error_estimate = 0;
1329 1329
1330 // Static sequence monitor variables. 1330 // Static sequence monitor variables.
1331 twopass->kf_zeromotion_pct = 100; 1331 twopass->kf_zeromotion_pct = 100;
1332 twopass->last_kfgroup_zeromotion_pct = 100; 1332 twopass->last_kfgroup_zeromotion_pct = 100;
1333 1333
1334 if (oxcf->resize_mode != RESIZE_NONE) { 1334 if (oxcf->resize_mode != RESIZE_NONE) {
1335 vp9_init_subsampling(cpi); 1335 init_subsampling(cpi);
1336 } 1336 }
1337 } 1337 }
1338 1338
1339 #define SR_DIFF_PART 0.0015 1339 #define SR_DIFF_PART 0.0015
1340 #define MOTION_AMP_PART 0.003 1340 #define MOTION_AMP_PART 0.003
1341 #define INTRA_PART 0.005 1341 #define INTRA_PART 0.005
1342 #define DEFAULT_DECAY_LIMIT 0.75 1342 #define DEFAULT_DECAY_LIMIT 0.75
1343 #define LOW_SR_DIFF_TRHESH 0.1 1343 #define LOW_SR_DIFF_TRHESH 0.1
1344 #define SR_DIFF_MAX 128.0 1344 #define SR_DIFF_MAX 128.0
1345 1345
(...skipping 1501 matching lines...) Expand 10 before | Expand all | Expand 10 after
2847 twopass->extend_minq_fast, minq_adj_limit - twopass->extend_minq); 2847 twopass->extend_minq_fast, minq_adj_limit - twopass->extend_minq);
2848 } else if (rc->vbr_bits_off_target_fast) { 2848 } else if (rc->vbr_bits_off_target_fast) {
2849 twopass->extend_minq_fast = VPXMIN( 2849 twopass->extend_minq_fast = VPXMIN(
2850 twopass->extend_minq_fast, minq_adj_limit - twopass->extend_minq); 2850 twopass->extend_minq_fast, minq_adj_limit - twopass->extend_minq);
2851 } else { 2851 } else {
2852 twopass->extend_minq_fast = 0; 2852 twopass->extend_minq_fast = 0;
2853 } 2853 }
2854 } 2854 }
2855 } 2855 }
2856 } 2856 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_firstpass.h ('k') | source/libvpx/vp9/encoder/vp9_mbgraph.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698