OLD | NEW |
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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 state->last_noise = a; | 359 state->last_noise = a; |
360 } | 360 } |
361 | 361 |
362 void vp9_plane_add_noise_c(uint8_t *start, char *noise, | 362 void vp9_plane_add_noise_c(uint8_t *start, char *noise, |
363 char blackclamp[16], | 363 char blackclamp[16], |
364 char whiteclamp[16], | 364 char whiteclamp[16], |
365 char bothclamp[16], | 365 char bothclamp[16], |
366 unsigned int width, unsigned int height, int pitch) { | 366 unsigned int width, unsigned int height, int pitch) { |
367 unsigned int i, j; | 367 unsigned int i, j; |
368 | 368 |
| 369 // TODO(jbb): why does simd code use both but c doesn't, normalize and |
| 370 // fix.. |
| 371 (void) bothclamp; |
369 for (i = 0; i < height; i++) { | 372 for (i = 0; i < height; i++) { |
370 uint8_t *pos = start + i * pitch; | 373 uint8_t *pos = start + i * pitch; |
371 char *ref = (char *)(noise + (rand() & 0xff)); // NOLINT | 374 char *ref = (char *)(noise + (rand() & 0xff)); // NOLINT |
372 | 375 |
373 for (j = 0; j < width; j++) { | 376 for (j = 0; j < width; j++) { |
374 if (pos[j] < blackclamp[0]) | 377 if (pos[j] < blackclamp[0]) |
375 pos[j] = blackclamp[0]; | 378 pos[j] = blackclamp[0]; |
376 | 379 |
377 if (pos[j] > 255 + whiteclamp[0]) | 380 if (pos[j] > 255 + whiteclamp[0]) |
378 pos[j] = 255 + whiteclamp[0]; | 381 pos[j] = 255 + whiteclamp[0]; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 435 |
433 /* handle problem with extending borders */ | 436 /* handle problem with extending borders */ |
434 dest->y_width = cm->width; | 437 dest->y_width = cm->width; |
435 dest->y_height = cm->height; | 438 dest->y_height = cm->height; |
436 dest->uv_width = dest->y_width >> cm->subsampling_x; | 439 dest->uv_width = dest->y_width >> cm->subsampling_x; |
437 dest->uv_height = dest->y_height >> cm->subsampling_y; | 440 dest->uv_height = dest->y_height >> cm->subsampling_y; |
438 | 441 |
439 return 0; | 442 return 0; |
440 } | 443 } |
441 #endif | 444 #endif |
OLD | NEW |