d93846ff9dafc4ec1bba154c142c8a2d48826ef9
[platform/framework/web/crosswalk.git] / src / third_party / libvpx / source / libvpx / vp9 / encoder / vp9_denoiser.h
1 /*
2  *  Copyright (c) 2012 The WebM project authors. All Rights Reserved.
3  *
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
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10
11 #ifndef VP9_ENCODER_DENOISER_H_
12 #define VP9_ENCODER_DENOISER_H_
13
14 #include "vp9/encoder/vp9_block.h"
15 #include "vpx_scale/yv12config.h"
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 typedef enum vp9_denoiser_decision {
22   COPY_BLOCK,
23   FILTER_BLOCK
24 } VP9_DENOISER_DECISION;
25
26 typedef struct vp9_denoiser {
27   YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES];
28   YV12_BUFFER_CONFIG mc_running_avg_y;
29   int increase_denoising;
30 } VP9_DENOISER;
31
32 void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
33                                     YV12_BUFFER_CONFIG src,
34                                     FRAME_TYPE frame_type,
35                                     int refresh_alt_ref_frame,
36                                     int refresh_golden_frame,
37                                     int refresh_last_frame);
38
39 void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
40                           int mi_row, int mi_col, BLOCK_SIZE bs,
41                           PICK_MODE_CONTEXT *ctx);
42
43 void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx);
44
45 void vp9_denoiser_update_frame_stats(VP9_DENOISER *denoiser, MB_MODE_INFO *mbmi,
46                                      unsigned int sse, PREDICTION_MODE mode,
47                                      PICK_MODE_CONTEXT *ctx);
48
49 int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
50                        int ssx, int ssy, int border);
51
52 void vp9_denoiser_free(VP9_DENOISER *denoiser);
53
54 #ifdef __cplusplus
55 }  // extern "C"
56 #endif
57
58 #endif  // VP9_ENCODER_DENOISER_H_