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 |
11 #ifndef VP8_ENCODER_DENOISING_H_ | 11 #ifndef VP8_ENCODER_DENOISING_H_ |
12 #define VP8_ENCODER_DENOISING_H_ | 12 #define VP8_ENCODER_DENOISING_H_ |
13 | 13 |
14 #include "block.h" | 14 #include "block.h" |
| 15 #include "vp8/common/loopfilter.h" |
15 | 16 |
16 #ifdef __cplusplus | 17 #ifdef __cplusplus |
17 extern "C" { | 18 extern "C" { |
18 #endif | 19 #endif |
19 | 20 |
20 #define SUM_DIFF_THRESHOLD (16 * 16 * 2) | 21 #define SUM_DIFF_THRESHOLD (16 * 16 * 2) |
21 #define SUM_DIFF_THRESHOLD_HIGH (16 * 16 * 3) | 22 #define SUM_DIFF_THRESHOLD_HIGH (16 * 16 * 3) |
22 #define MOTION_MAGNITUDE_THRESHOLD (8*3) | 23 #define MOTION_MAGNITUDE_THRESHOLD (8*3) |
23 | 24 |
24 enum vp8_denoiser_decision | 25 enum vp8_denoiser_decision |
25 { | 26 { |
26 COPY_BLOCK, | 27 COPY_BLOCK, |
27 FILTER_BLOCK | 28 FILTER_BLOCK |
28 }; | 29 }; |
29 | 30 |
| 31 enum vp8_denoiser_filter_state { |
| 32 kNoFilter, |
| 33 kFilterZeroMV, |
| 34 kFilterNonZeroMV |
| 35 }; |
| 36 |
30 typedef struct vp8_denoiser | 37 typedef struct vp8_denoiser |
31 { | 38 { |
32 YV12_BUFFER_CONFIG yv12_running_avg[MAX_REF_FRAMES]; | 39 YV12_BUFFER_CONFIG yv12_running_avg[MAX_REF_FRAMES]; |
33 YV12_BUFFER_CONFIG yv12_mc_running_avg; | 40 YV12_BUFFER_CONFIG yv12_mc_running_avg; |
| 41 unsigned char* denoise_state; |
| 42 int num_mb_cols; |
34 } VP8_DENOISER; | 43 } VP8_DENOISER; |
35 | 44 |
36 int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height); | 45 int vp8_denoiser_allocate(VP8_DENOISER *denoiser, int width, int height, |
| 46 int num_mb_rows, int num_mb_cols); |
37 | 47 |
38 void vp8_denoiser_free(VP8_DENOISER *denoiser); | 48 void vp8_denoiser_free(VP8_DENOISER *denoiser); |
39 | 49 |
40 void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, | 50 void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser, |
41 MACROBLOCK *x, | 51 MACROBLOCK *x, |
42 unsigned int best_sse, | 52 unsigned int best_sse, |
43 unsigned int zero_mv_sse, | 53 unsigned int zero_mv_sse, |
44 int recon_yoffset, | 54 int recon_yoffset, |
45 int recon_uvoffset); | 55 int recon_uvoffset, |
| 56 loop_filter_info_n *lfi_n, |
| 57 int mb_row, |
| 58 int mb_col, |
| 59 int block_index); |
46 | 60 |
47 #ifdef __cplusplus | 61 #ifdef __cplusplus |
48 } // extern "C" | 62 } // extern "C" |
49 #endif | 63 #endif |
50 | 64 |
51 #endif // VP8_ENCODER_DENOISING_H_ | 65 #endif // VP8_ENCODER_DENOISING_H_ |
OLD | NEW |