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 typedef enum vp9_denoiser_decision { | 21 typedef enum vp9_denoiser_decision { |
22 COPY_BLOCK, | 22 COPY_BLOCK, |
23 FILTER_BLOCK | 23 FILTER_BLOCK |
24 } VP9_DENOISER_DECISION; | 24 } VP9_DENOISER_DECISION; |
25 | 25 |
26 typedef struct vp9_denoiser { | 26 typedef struct vp9_denoiser { |
27 YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES]; | 27 YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES]; |
28 YV12_BUFFER_CONFIG mc_running_avg_y; | 28 YV12_BUFFER_CONFIG mc_running_avg_y; |
29 | |
30 unsigned int zero_mv_sse; | |
31 unsigned int best_sse; | |
32 int increase_denoising; | 29 int increase_denoising; |
33 PREDICTION_MODE best_sse_inter_mode; | |
34 int_mv best_sse_mv; | |
35 MV_REFERENCE_FRAME best_reference_frame; | |
36 MV_REFERENCE_FRAME best_zeromv_reference_frame; | |
37 } VP9_DENOISER; | 30 } VP9_DENOISER; |
38 | 31 |
39 void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, | 32 void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser, |
40 YV12_BUFFER_CONFIG src, | 33 YV12_BUFFER_CONFIG src, |
41 FRAME_TYPE frame_type, | 34 FRAME_TYPE frame_type, |
42 int refresh_alt_ref_frame, | 35 int refresh_alt_ref_frame, |
43 int refresh_golden_frame, | 36 int refresh_golden_frame, |
44 int refresh_last_frame); | 37 int refresh_last_frame); |
45 | 38 |
46 void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, | 39 void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, |
47 int mi_row, int mi_col, BLOCK_SIZE bs); | 40 int mi_row, int mi_col, BLOCK_SIZE bs, |
| 41 PICK_MODE_CONTEXT *ctx); |
48 | 42 |
49 void vp9_denoiser_reset_frame_stats(VP9_DENOISER *denoiser); | 43 void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx); |
50 | 44 |
51 void vp9_denoiser_update_frame_stats(VP9_DENOISER *denoiser, MB_MODE_INFO *mbmi, | 45 void vp9_denoiser_update_frame_stats(VP9_DENOISER *denoiser, MB_MODE_INFO *mbmi, |
52 unsigned int sse, PREDICTION_MODE mode); | 46 unsigned int sse, PREDICTION_MODE mode, |
| 47 PICK_MODE_CONTEXT *ctx); |
53 | 48 |
54 int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height, | 49 int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height, |
55 int ssx, int ssy, int border); | 50 int ssx, int ssy, int border); |
56 | 51 |
57 void vp9_denoiser_free(VP9_DENOISER *denoiser); | 52 void vp9_denoiser_free(VP9_DENOISER *denoiser); |
58 | 53 |
59 #ifdef __cplusplus | 54 #ifdef __cplusplus |
60 } // extern "C" | 55 } // extern "C" |
61 #endif | 56 #endif |
62 | 57 |
63 #endif // VP9_ENCODER_DENOISER_H_ | 58 #endif // VP9_ENCODER_DENOISER_H_ |
OLD | NEW |