OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 return 0; | 471 return 0; |
472 } | 472 } |
473 | 473 |
474 void vp9_denoiser_free(VP9_DENOISER *denoiser) { | 474 void vp9_denoiser_free(VP9_DENOISER *denoiser) { |
475 int i; | 475 int i; |
476 denoiser->frame_buffer_initialized = 0; | 476 denoiser->frame_buffer_initialized = 0; |
477 if (denoiser == NULL) { | 477 if (denoiser == NULL) { |
478 return; | 478 return; |
479 } | 479 } |
480 for (i = 0; i < MAX_REF_FRAMES; ++i) { | 480 for (i = 0; i < MAX_REF_FRAMES; ++i) { |
481 if (&denoiser->running_avg_y[i] != NULL) { | 481 vp9_free_frame_buffer(&denoiser->running_avg_y[i]); |
482 vp9_free_frame_buffer(&denoiser->running_avg_y[i]); | |
483 } | |
484 } | 482 } |
485 if (&denoiser->mc_running_avg_y != NULL) { | 483 vp9_free_frame_buffer(&denoiser->mc_running_avg_y); |
486 vp9_free_frame_buffer(&denoiser->mc_running_avg_y); | |
487 } | |
488 } | 484 } |
489 | 485 |
490 #ifdef OUTPUT_YUV_DENOISED | 486 #ifdef OUTPUT_YUV_DENOISED |
491 static void make_grayscale(YV12_BUFFER_CONFIG *yuv) { | 487 static void make_grayscale(YV12_BUFFER_CONFIG *yuv) { |
492 int r, c; | 488 int r, c; |
493 uint8_t *u = yuv->u_buffer; | 489 uint8_t *u = yuv->u_buffer; |
494 uint8_t *v = yuv->v_buffer; | 490 uint8_t *v = yuv->v_buffer; |
495 | 491 |
496 for (r = 0; r < yuv->uv_height; ++r) { | 492 for (r = 0; r < yuv->uv_height; ++r) { |
497 for (c = 0; c < yuv->uv_width; ++c) { | 493 for (c = 0; c < yuv->uv_width; ++c) { |
498 u[c] = UINT8_MAX / 2; | 494 u[c] = UINT8_MAX / 2; |
499 v[c] = UINT8_MAX / 2; | 495 v[c] = UINT8_MAX / 2; |
500 } | 496 } |
501 u += yuv->uv_stride; | 497 u += yuv->uv_stride; |
502 v += yuv->uv_stride; | 498 v += yuv->uv_stride; |
503 } | 499 } |
504 } | 500 } |
505 #endif | 501 #endif |
OLD | NEW |