Commit 1a66dab9 authored by Tim Kopp's avatar Tim Kopp
Browse files

VP9 denoiser used s/int/enum where appropriate

Change-Id: Id52a7869fd1f31bb060de170e3295da7435adb9e
parent 2f71de77
...@@ -22,14 +22,13 @@ static void make_grayscale(YV12_BUFFER_CONFIG *yuv); ...@@ -22,14 +22,13 @@ static void make_grayscale(YV12_BUFFER_CONFIG *yuv);
static const int widths[] = {4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64}; static const int widths[] = {4, 4, 8, 8, 8, 16, 16, 16, 32, 32, 32, 64, 64};
static const int heights[] = {4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64}; static const int heights[] = {4, 8, 4, 8, 16, 8, 16, 32, 16, 32, 64, 32, 64};
int vp9_denoiser_filter() { static VP9_DENOISER_DECISION update_running_avg(const uint8_t *mc_avg,
return 0; int mc_avg_stride,
} uint8_t *avg, int avg_stride,
const uint8_t *sig,
static int update_running_avg(const uint8_t *mc_avg, int mc_avg_stride, int sig_stride,
uint8_t *avg, int avg_stride, int increase_denoising,
const uint8_t *sig, int sig_stride, BLOCK_SIZE bs) {
int increase_denoising, BLOCK_SIZE bs) {
int r, c; int r, c;
int diff, adj, absdiff; int diff, adj, absdiff;
int shift_inc1 = 0, shift_inc2 = 1; int shift_inc1 = 0, shift_inc2 = 1;
...@@ -94,9 +93,12 @@ void copy_block(uint8_t *dest, int dest_stride, ...@@ -94,9 +93,12 @@ void copy_block(uint8_t *dest, int dest_stride,
} }
} }
static int perform_motion_compensation(VP9_DENOISER *denoiser, MACROBLOCK *mb, static VP9_DENOISER_DECISION perform_motion_compensation(VP9_DENOISER *denoiser,
BLOCK_SIZE bs, int increase_denoising, MACROBLOCK *mb,
int mi_row, int mi_col) { BLOCK_SIZE bs,
int increase_denoising,
int mi_row,
int mi_col) {
// constants // constants
// TODO(tkopp): empirically determine good constants, or functions of block // TODO(tkopp): empirically determine good constants, or functions of block
// size. // size.
...@@ -228,7 +230,7 @@ static int perform_motion_compensation(VP9_DENOISER *denoiser, MACROBLOCK *mb, ...@@ -228,7 +230,7 @@ static int perform_motion_compensation(VP9_DENOISER *denoiser, MACROBLOCK *mb,
void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb, void vp9_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
int mi_row, int mi_col, BLOCK_SIZE bs) { int mi_row, int mi_col, BLOCK_SIZE bs) {
int decision = COPY_BLOCK; VP9_DENOISER_DECISION decision = FILTER_BLOCK;
YV12_BUFFER_CONFIG avg = denoiser->running_avg_y[INTRA_FRAME]; YV12_BUFFER_CONFIG avg = denoiser->running_avg_y[INTRA_FRAME];
YV12_BUFFER_CONFIG mc_avg = denoiser->mc_running_avg_y; YV12_BUFFER_CONFIG mc_avg = denoiser->mc_running_avg_y;
......
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
extern "C" { extern "C" {
#endif #endif
enum vp9_denoiser_decision { typedef enum vp9_denoiser_decision {
COPY_BLOCK, COPY_BLOCK,
FILTER_BLOCK FILTER_BLOCK
}; } VP9_DENOISER_DECISION;
typedef struct vp9_denoiser { typedef struct vp9_denoiser {
YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES]; YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment