alpha
multiple_arf
spatial_svc
+ denoising
"
CONFIG_LIST="
external_build
--- /dev/null
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include "vp9/encoder/vp9_denoiser.h"
+#include "vpx_scale/yv12config.h"
+
+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};
+
+int vp9_denoiser_filter() {
+ return 0;
+}
+
+void vp9_denoiser_denoise(VP9_DENOISER *denoiser,
+ MACROBLOCK *mb, MODE_INFO **grid,
+ int mi_row, int mi_col, BLOCK_SIZE bs) {
+ return;
+}
+
+void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
+ FRAME_TYPE frame_type,
+ int refresh_alt_ref_frame,
+ int refresh_golden_frame,
+ int refresh_last_frame) {
+ return;
+}
+
+void vp9_denoiser_update_frame_stats() {
+ return;
+}
+
+int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
+ int border) {
+ return 0;
+}
+
+void vp9_denoiser_free(VP9_DENOISER *denoiser) {
+ return;
+}
+
--- /dev/null
+/*
+ * Copyright (c) 2012 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef VP9_ENCODER_DENOISER_H_
+#define VP9_ENCODER_DENOISER_H_
+
+#include "vp9/encoder/vp9_block.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum vp9_denoiser_decision {
+ COPY_BLOCK,
+ FILTER_BLOCK
+};
+
+typedef struct vp9_denoiser {
+ struct buf_2d running_avg_y;
+ struct buf_2d mc_running_avg_y;
+} VP9_DENOISER;
+
+void vp9_denoiser_update_frame_info(VP9_DENOISER *denoiser,
+ FRAME_TYPE frame_type,
+ int refresh_alt_ref_frame,
+ int refresh_golden_frame,
+ int refresh_last_frame);
+
+void vp9_denoiser_denoise(VP9_DENOISER *denoiser,
+ MACROBLOCK *mb, MODE_INFO **grid,
+ int mi_row, int mi_col, BLOCK_SIZE bs);
+
+void vp9_denoiser_update_frame_stats();
+
+int vp9_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
+ int border);
+
+void vp9_denoiser_free(VP9_DENOISER *denoiser);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // VP9_ENCODER_DENOISER_H_
cpi->ext_refresh_frame_flags_pending = 0;
cpi->ext_refresh_frame_context_pending = 0;
+
+#if CONFIG_DENOISING
+ vp9_denoiser_alloc(&(cpi->denoiser), cm->width, cm->height,
+ VP9_ENC_BORDER_IN_PIXELS);
+#endif
}
#ifndef M_LOG2_E
#endif
}
+#if CONFIG_DENOISING
+ vp9_denoiser_free(&(cpi->denoiser));
+#endif
+
dealloc_compressor_data(cpi);
vpx_free(cpi->tok);
ref_cnt_fb(cm->frame_bufs,
&cm->ref_frame_map[cpi->lst_fb_idx], cm->new_fb_idx);
}
+#if CONFIG_DENOISING
+ vp9_denoiser_update_frame_info(&cpi->denoiser,
+ cpi->common.frame_type,
+ cpi->refresh_alt_ref_frame,
+ cpi->refresh_golden_frame,
+ cpi->refresh_last_frame);
+#endif
}
static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
#include "vp9/encoder/vp9_svc_layercontext.h"
#include "vp9/encoder/vp9_tokenize.h"
#include "vp9/encoder/vp9_variance.h"
+#if CONFIG_DENOISING
+#include "vp9/encoder/vp9_denoiser.h"
+#endif
#ifdef __cplusplus
extern "C" {
int this_frame_weight;
int max_arf_level;
#endif
+
+#if CONFIG_DENOISING
+ VP9_DENOISER denoiser;
+#endif
} VP9_COMP;
void vp9_initialize_enc();
}
}
+#if CONFIG_DENOISING
+ vp9_denoiser_update_frame_stats();
+#endif
+
if (this_rd < best_rd || x->skip) {
best_rd = this_rd;
*returnrate = rate;
}
}
+
mbmi->mode = best_mode;
mbmi->interp_filter = best_pred_filter;
mbmi->ref_frame[0] = best_ref_frame;
}
}
}
+#if CONFIG_DENOISING
+ vp9_denoiser_denoise(&cpi->denoiser, x, cpi->common.mi_grid_visible, mi_row,
+ mi_col, bsize);
+#endif
return INT64_MAX;
}
VP9_CX_SRCS-yes += encoder/vp9_cost.h
VP9_CX_SRCS-yes += encoder/vp9_cost.c
VP9_CX_SRCS-yes += encoder/vp9_dct.c
+VP9_CX_SRCS-$(CONFIG_DENOISING) += encoder/vp9_denoiser.c
+VP9_CX_SRCS-$(CONFIG_DENOISING) += encoder/vp9_denoiser.h
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.c
VP9_CX_SRCS-yes += encoder/vp9_encodeframe.h
VP9_CX_SRCS-yes += encoder/vp9_encodemb.c