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

Side by Side Diff: source/libvpx/vp9/common/vp9_subpelvar.h

Issue 23600008: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/common/vp9_scale.c ('k') | source/libvpx/vp9/common/vp9_tile_common.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
11 #ifndef VP9_COMMON_VP9_SUBPELVAR_H_ 11 #ifndef VP9_COMMON_VP9_SUBPELVAR_H_
12 #define VP9_COMMON_VP9_SUBPELVAR_H_ 12 #define VP9_COMMON_VP9_SUBPELVAR_H_
13 13
14 #include "vp9/common/vp9_filter.h" 14 #include "vp9/common/vp9_common.h"
15 #include "vp9/common/vp9_convolve.h"
15 16
16 static void variance(const uint8_t *src_ptr, 17 static void variance(const uint8_t *src_ptr,
17 int source_stride, 18 int source_stride,
18 const uint8_t *ref_ptr, 19 const uint8_t *ref_ptr,
19 int recon_stride, 20 int recon_stride,
20 int w, 21 int w,
21 int h, 22 int h,
22 unsigned int *sse, 23 unsigned int *sse,
23 int *sum) { 24 int *sum) {
24 int i, j; 25 int i, j;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 uint16_t *output_ptr, 72 uint16_t *output_ptr,
72 unsigned int src_pixels_per_line, 73 unsigned int src_pixels_per_line,
73 int pixel_step, 74 int pixel_step,
74 unsigned int output_height, 75 unsigned int output_height,
75 unsigned int output_width, 76 unsigned int output_width,
76 const int16_t *vp9_filter) { 77 const int16_t *vp9_filter) {
77 unsigned int i, j; 78 unsigned int i, j;
78 79
79 for (i = 0; i < output_height; i++) { 80 for (i = 0; i < output_height; i++) {
80 for (j = 0; j < output_width; j++) { 81 for (j = 0; j < output_width; j++) {
81 // Apply bilinear filter 82 output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
82 output_ptr[j] = (((int)src_ptr[0] * vp9_filter[0]) + 83 (int)src_ptr[pixel_step] * vp9_filter[1],
83 ((int)src_ptr[pixel_step] * vp9_filter[1]) + 84 FILTER_BITS);
84 (VP9_FILTER_WEIGHT / 2)) >> VP9_FILTER_SHIFT; 85
85 src_ptr++; 86 src_ptr++;
86 } 87 }
87 88
88 // Next row... 89 // Next row...
89 src_ptr += src_pixels_per_line - output_width; 90 src_ptr += src_pixels_per_line - output_width;
90 output_ptr += output_width; 91 output_ptr += output_width;
91 } 92 }
92 } 93 }
93 94
94 /**************************************************************************** 95 /****************************************************************************
(...skipping 25 matching lines...) Expand all
120 * 121 *
121 ****************************************************************************/ 122 ****************************************************************************/
122 static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr, 123 static void var_filter_block2d_bil_second_pass(const uint16_t *src_ptr,
123 uint8_t *output_ptr, 124 uint8_t *output_ptr,
124 unsigned int src_pixels_per_line, 125 unsigned int src_pixels_per_line,
125 unsigned int pixel_step, 126 unsigned int pixel_step,
126 unsigned int output_height, 127 unsigned int output_height,
127 unsigned int output_width, 128 unsigned int output_width,
128 const int16_t *vp9_filter) { 129 const int16_t *vp9_filter) {
129 unsigned int i, j; 130 unsigned int i, j;
130 int Temp;
131 131
132 for (i = 0; i < output_height; i++) { 132 for (i = 0; i < output_height; i++) {
133 for (j = 0; j < output_width; j++) { 133 for (j = 0; j < output_width; j++) {
134 // Apply filter 134 output_ptr[j] = ROUND_POWER_OF_TWO((int)src_ptr[0] * vp9_filter[0] +
135 Temp = ((int)src_ptr[0] * vp9_filter[0]) + 135 (int)src_ptr[pixel_step] * vp9_filter[1],
136 ((int)src_ptr[pixel_step] * vp9_filter[1]) + 136 FILTER_BITS);
137 (VP9_FILTER_WEIGHT / 2);
138 output_ptr[j] = (unsigned int)(Temp >> VP9_FILTER_SHIFT);
139 src_ptr++; 137 src_ptr++;
140 } 138 }
141 139
142 // Next row... 140 src_ptr += src_pixels_per_line - output_width;
143 src_ptr += src_pixels_per_line - output_width;
144 output_ptr += output_width; 141 output_ptr += output_width;
145 } 142 }
146 } 143 }
147 144
148 #endif // VP9_COMMON_VP9_SUBPELVAR_H_ 145 #endif // VP9_COMMON_VP9_SUBPELVAR_H_
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_scale.c ('k') | source/libvpx/vp9/common/vp9_tile_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698