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

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

Issue 958693004: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_lookahead.c ('k') | source/libvpx/vp9/encoder/vp9_pickmode.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const MV diff = { mv->row - ref->row, 83 const MV diff = { mv->row - ref->row,
84 mv->col - ref->col }; 84 mv->col - ref->col };
85 return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) * 85 return ROUND_POWER_OF_TWO(mv_cost(&diff, mvjcost, mvcost) *
86 error_per_bit, 13); 86 error_per_bit, 13);
87 } 87 }
88 return 0; 88 return 0;
89 } 89 }
90 90
91 static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref, 91 static int mvsad_err_cost(const MACROBLOCK *x, const MV *mv, const MV *ref,
92 int error_per_bit) { 92 int error_per_bit) {
93 if (x->nmvsadcost) { 93 const MV diff = { mv->row - ref->row,
94 const MV diff = { mv->row - ref->row, 94 mv->col - ref->col };
95 mv->col - ref->col }; 95 return ROUND_POWER_OF_TWO(mv_cost(&diff, x->nmvjointsadcost,
96 return ROUND_POWER_OF_TWO(mv_cost(&diff, x->nmvjointsadcost, 96 x->nmvsadcost) * error_per_bit, 8);
97 x->nmvsadcost) * error_per_bit, 8);
98 }
99 return 0;
100 } 97 }
101 98
102 void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride) { 99 void vp9_init_dsmotion_compensation(search_site_config *cfg, int stride) {
103 int len, ss_count = 1; 100 int len, ss_count = 1;
104 101
105 cfg->ss[0].mv.col = cfg->ss[0].mv.row = 0; 102 cfg->ss[0].mv.col = cfg->ss[0].mv.row = 0;
106 cfg->ss[0].offset = 0; 103 cfg->ss[0].offset = 0;
107 104
108 for (len = MAX_FIRST_STEP; len > 0; len /= 2) { 105 for (len = MAX_FIRST_STEP; len > 0; len /= 2) {
109 // Generate offsets for 4 search sites per step. 106 // Generate offsets for 4 search sites per step.
(...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 break; 2140 break;
2144 default: 2141 default:
2145 assert(0 && "Invalid search method."); 2142 assert(0 && "Invalid search method.");
2146 } 2143 }
2147 2144
2148 if (method != NSTEP && rd && var < var_max) 2145 if (method != NSTEP && rd && var < var_max)
2149 var = vp9_get_mvpred_var(x, tmp_mv, ref_mv, fn_ptr, 1); 2146 var = vp9_get_mvpred_var(x, tmp_mv, ref_mv, fn_ptr, 1);
2150 2147
2151 return var; 2148 return var;
2152 } 2149 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_lookahead.c ('k') | source/libvpx/vp9/encoder/vp9_pickmode.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698