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 VP9_ENCODER_DENOISER_H_ | 11 #ifndef VP9_ENCODER_DENOISER_H_ |
12 #define VP9_ENCODER_DENOISER_H_ | 12 #define VP9_ENCODER_DENOISER_H_ |
13 | 13 |
14 #include "vp9/encoder/vp9_block.h" | 14 #include "vp9/encoder/vp9_block.h" |
15 #include "vpx_scale/yv12config.h" | 15 #include "vpx_scale/yv12config.h" |
16 | 16 |
17 #ifdef __cplusplus | 17 #ifdef __cplusplus |
18 extern "C" { | 18 extern "C" { |
19 #endif | 19 #endif |
20 | 20 |
| 21 #define MOTION_MAGNITUDE_THRESHOLD (8*3) |
| 22 |
21 typedef enum vp9_denoiser_decision { | 23 typedef enum vp9_denoiser_decision { |
22 COPY_BLOCK, | 24 COPY_BLOCK, |
23 FILTER_BLOCK | 25 FILTER_BLOCK |
24 } VP9_DENOISER_DECISION; | 26 } VP9_DENOISER_DECISION; |
25 | 27 |
26 typedef struct vp9_denoiser { | 28 typedef struct vp9_denoiser { |
27 YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES]; | 29 YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES]; |
28 YV12_BUFFER_CONFIG mc_running_avg_y; | 30 YV12_BUFFER_CONFIG mc_running_avg_y; |
29 int increase_denoising; | 31 int increase_denoising; |
30 } VP9_DENOISER; | 32 } VP9_DENOISER; |
31 | 33 |
32 void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, | 34 void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, |
33 YV12_BUFFER_CONFIG src, | 35 YV12_BUFFER_CONFIG src, |
34 FRAME_TYPE frame_type, | 36 FRAME_TYPE frame_type, |
35 int refresh_alt_ref_frame, | 37 int refresh_alt_ref_frame, |
36 int refresh_golden_frame, | 38 int refresh_golden_frame, |
37 int refresh_last_frame); | 39 int refresh_last_frame); |
38 | 40 |
39 void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, | 41 void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, |
40 int mi_row, int mi_col, BLOCK_SIZE bs, | 42 int mi_row, int mi_col, BLOCK_SIZE bs, |
41 PICK_MODE_CONTEXT *ctx); | 43 PICK_MODE_CONTEXT *ctx); |
42 | 44 |
43 void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx); | 45 void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx); |
44 | 46 |
45 void vp9_denoiser_update_frame_stats(VP9_DENOISER *denoiser, MB_MODE_INFO *mbmi, | 47 void vp9_denoiser_update_frame_stats(MB_MODE_INFO *mbmi, |
46 unsigned int sse, PREDICTION_MODE mode, | 48 unsigned int sse, PREDICTION_MODE mode, |
47 PICK_MODE_CONTEXT *ctx); | 49 PICK_MODE_CONTEXT *ctx); |
48 | 50 |
49 int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height, | 51 int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height, |
50 int ssx, int ssy, int border); | 52 int ssx, int ssy, |
| 53 #if CONFIG_VP9_HIGHBITDEPTH |
| 54 int use_highbitdepth, |
| 55 #endif |
| 56 int border); |
51 | 57 |
52 void vp9_denoiser_free(VP9_DENOISER *denoiser); | 58 void vp9_denoiser_free(VP9_DENOISER *denoiser); |
53 | 59 |
54 #ifdef __cplusplus | 60 #ifdef __cplusplus |
55 } // extern "C" | 61 } // extern "C" |
56 #endif | 62 #endif |
57 | 63 |
58 #endif // VP9_ENCODER_DENOISER_H_ | 64 #endif // VP9_ENCODER_DENOISER_H_ |
OLD | NEW |