2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
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.
11 #ifndef VP9_ENCODER_DENOISER_H_
12 #define VP9_ENCODER_DENOISER_H_
14 #include "vp9/encoder/vp9_block.h"
15 #include "vpx_scale/yv12config.h"
21 #define MOTION_MAGNITUDE_THRESHOLD (8 * 3)
23 typedef enum vp9_denoiser_decision {
26 } VP9_DENOISER_DECISION;
28 typedef struct vp9_denoiser {
29 YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES];
30 YV12_BUFFER_CONFIG mc_running_avg_y;
31 int increase_denoising;
34 void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
35 YV12_BUFFER_CONFIG src,
36 FRAME_TYPE frame_type,
37 int refresh_alt_ref_frame,
38 int refresh_golden_frame,
39 int refresh_last_frame);
41 void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
42 int mi_row, int mi_col, BLOCK_SIZE bs,
43 PICK_MODE_CONTEXT *ctx);
45 void vp9_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx);
47 void vp9_denoiser_update_frame_stats(MB_MODE_INFO *mbmi,
48 unsigned int sse, PREDICTION_MODE mode,
49 PICK_MODE_CONTEXT *ctx);
51 int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
53 #if CONFIG_VP9_HIGHBITDEPTH
58 void vp9_denoiser_free(VP9_DENOISER *denoiser);
64 #endif // VP9_ENCODER_DENOISER_H_