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

Side by Side Diff: source/libvpx/vp9/common/vp9_reconintra.c

Issue 1302353004: 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/common/vp9_reconinter.c ('k') | source/libvpx/vp9/common/vp9_rtcd_defs.pl » ('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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 } 179 }
180 180
181 // TODO(hkuang) do not extend 2*bs pixels for all modes. 181 // TODO(hkuang) do not extend 2*bs pixels for all modes.
182 // above 182 // above
183 if (up_available) { 183 if (up_available) {
184 const uint16_t *above_ref = ref - ref_stride; 184 const uint16_t *above_ref = ref - ref_stride;
185 if (xd->mb_to_right_edge < 0) { 185 if (xd->mb_to_right_edge < 0) {
186 /* slower path if the block needs border extension */ 186 /* slower path if the block needs border extension */
187 if (x0 + 2 * bs <= frame_width) { 187 if (x0 + 2 * bs <= frame_width) {
188 if (right_available && bs == 4) { 188 if (right_available && bs == 4) {
189 memcpy(above_row, above_ref, 2 * bs * sizeof(uint16_t)); 189 memcpy(above_row, above_ref, 2 * bs * sizeof(above_row[0]));
190 } else { 190 } else {
191 memcpy(above_row, above_ref, bs * sizeof(uint16_t)); 191 memcpy(above_row, above_ref, bs * sizeof(above_row[0]));
192 vpx_memset16(above_row + bs, above_row[bs - 1], bs); 192 vpx_memset16(above_row + bs, above_row[bs - 1], bs);
193 } 193 }
194 } else if (x0 + bs <= frame_width) { 194 } else if (x0 + bs <= frame_width) {
195 const int r = frame_width - x0; 195 const int r = frame_width - x0;
196 if (right_available && bs == 4) { 196 if (right_available && bs == 4) {
197 memcpy(above_row, above_ref, r * sizeof(uint16_t)); 197 memcpy(above_row, above_ref, r * sizeof(above_row[0]));
198 vpx_memset16(above_row + r, above_row[r - 1], 198 vpx_memset16(above_row + r, above_row[r - 1],
199 x0 + 2 * bs - frame_width); 199 x0 + 2 * bs - frame_width);
200 } else { 200 } else {
201 memcpy(above_row, above_ref, bs * sizeof(uint16_t)); 201 memcpy(above_row, above_ref, bs * sizeof(above_row[0]));
202 vpx_memset16(above_row + bs, above_row[bs - 1], bs); 202 vpx_memset16(above_row + bs, above_row[bs - 1], bs);
203 } 203 }
204 } else if (x0 <= frame_width) { 204 } else if (x0 <= frame_width) {
205 const int r = frame_width - x0; 205 const int r = frame_width - x0;
206 memcpy(above_row, above_ref, r * sizeof(uint16_t)); 206 memcpy(above_row, above_ref, r * sizeof(above_row[0]));
207 vpx_memset16(above_row + r, above_row[r - 1], 207 vpx_memset16(above_row + r, above_row[r - 1],
208 x0 + 2 * bs - frame_width); 208 x0 + 2 * bs - frame_width);
209 } 209 }
210 // TODO(Peter) this value should probably change for high bitdepth 210 // TODO(Peter) this value should probably change for high bitdepth
211 above_row[-1] = left_available ? above_ref[-1] : (base+1); 211 above_row[-1] = left_available ? above_ref[-1] : (base+1);
212 } else { 212 } else {
213 /* faster path if the block does not need extension */ 213 /* faster path if the block does not need extension */
214 if (bs == 4 && right_available && left_available) { 214 if (bs == 4 && right_available && left_available) {
215 const_above_row = above_ref; 215 const_above_row = above_ref;
216 } else { 216 } else {
217 memcpy(above_row, above_ref, bs * sizeof(uint16_t)); 217 memcpy(above_row, above_ref, bs * sizeof(above_row[0]));
218 if (bs == 4 && right_available) 218 if (bs == 4 && right_available)
219 memcpy(above_row + bs, above_ref + bs, bs * sizeof(uint16_t)); 219 memcpy(above_row + bs, above_ref + bs, bs * sizeof(above_row[0]));
220 else 220 else
221 vpx_memset16(above_row + bs, above_row[bs - 1], bs); 221 vpx_memset16(above_row + bs, above_row[bs - 1], bs);
222 // TODO(Peter): this value should probably change for high bitdepth 222 // TODO(Peter): this value should probably change for high bitdepth
223 above_row[-1] = left_available ? above_ref[-1] : (base+1); 223 above_row[-1] = left_available ? above_ref[-1] : (base+1);
224 } 224 }
225 } 225 }
226 } else { 226 } else {
227 vpx_memset16(above_row, base - 1, bs * 2); 227 vpx_memset16(above_row, base - 1, bs * 2);
228 // TODO(Peter): this value should probably change for high bitdepth 228 // TODO(Peter): this value should probably change for high bitdepth
229 above_row[-1] = base - 1; 229 above_row[-1] = base - 1;
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 return; 406 return;
407 } 407 }
408 #endif 408 #endif
409 build_intra_predictors(xd, ref, ref_stride, dst, dst_stride, mode, tx_size, 409 build_intra_predictors(xd, ref, ref_stride, dst, dst_stride, mode, tx_size,
410 have_top, have_left, have_right, x, y, plane); 410 have_top, have_left, have_right, x, y, plane);
411 } 411 }
412 412
413 void vp9_init_intra_predictors(void) { 413 void vp9_init_intra_predictors(void) {
414 once(vp9_init_intra_predictors_internal); 414 once(vp9_init_intra_predictors_internal);
415 } 415 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_reconinter.c ('k') | source/libvpx/vp9/common/vp9_rtcd_defs.pl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698