Commit 0738390c authored by Yaowu Xu's avatar Yaowu Xu

Remove vp9_temporal denoiser

Change-Id: Id1a12e1aa97e1baa68a640d1233bf8ab01058d89
parent b89861a4
......@@ -56,8 +56,6 @@ Advanced options:
${toggle_postproc_visualizer} macro block / block level visualizers
${toggle_multi_res_encoding} enable multiple-resolution encoding
${toggle_temporal_denoising} enable temporal denoising and disable the spatial denoiser
${toggle_vp9_temporal_denoising}
enable vp9 temporal denoising
${toggle_webm_io} enable input from and output to WebM container
${toggle_libyuv} enable libyuv
......
......@@ -287,23 +287,6 @@ if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
add_proto qw/void vp10_highbd_convolve8_avg_vert/, "const uint8_t *src, ptrdiff_t src_stride, uint8_t *dst, ptrdiff_t dst_stride, const int16_t *filter_x, int x_step_q4, const int16_t *filter_y, int y_step_q4, int w, int h, int bps";
specialize qw/vp10_highbd_convolve8_avg_vert/, "$sse2_x86_64";
#
# post proc
#
if (vpx_config("CONFIG_VP9_POSTPROC") eq "yes") {
add_proto qw/void vp10_highbd_mbpost_proc_down/, "uint16_t *dst, int pitch, int rows, int cols, int flimit";
specialize qw/vp10_highbd_mbpost_proc_down/;
add_proto qw/void vp10_highbd_mbpost_proc_across_ip/, "uint16_t *src, int pitch, int rows, int cols, int flimit";
specialize qw/vp10_highbd_mbpost_proc_across_ip/;
add_proto qw/void vp10_highbd_post_proc_down_and_across/, "const uint16_t *src_ptr, uint16_t *dst_ptr, int src_pixels_per_line, int dst_pixels_per_line, int rows, int cols, int flimit";
specialize qw/vp10_highbd_post_proc_down_and_across/;
add_proto qw/void vp10_highbd_plane_add_noise/, "uint8_t *Start, char *noise, char blackclamp[16], char whiteclamp[16], char bothclamp[16], unsigned int Width, unsigned int Height, int Pitch";
specialize qw/vp10_highbd_plane_add_noise/;
}
#
# dct
#
......@@ -326,14 +309,6 @@ if (vpx_config("CONFIG_VP10_ENCODER") eq "yes") {
# ENCODEMB INVOKE
#
# Denoiser
#
if (vpx_config("CONFIG_VP9_TEMPORAL_DENOISING") eq "yes") {
add_proto qw/int vp10_denoiser_filter/, "const uint8_t *sig, int sig_stride, const uint8_t *mc_avg, int mc_avg_stride, uint8_t *avg, int avg_stride, int increase_denoising, BLOCK_SIZE bs, int motion_magnitude";
specialize qw/vp10_denoiser_filter sse2/;
}
if (vpx_config("CONFIG_VPX_HIGHBITDEPTH") eq "yes") {
# the transform coefficients are held in 32-bit
# values, so the assembler code for vp10_block_error can no longer be used.
......
......@@ -58,15 +58,6 @@ typedef struct {
int rate;
int64_t dist;
#if CONFIG_VP9_TEMPORAL_DENOISING
unsigned int newmv_sse;
unsigned int zeromv_sse;
PREDICTION_MODE best_sse_inter_mode;
int_mv best_sse_mv;
MV_REFERENCE_FRAME best_reference_frame;
MV_REFERENCE_FRAME best_zeromv_reference_frame;
#endif
// motion vector cache for adaptive motion search control in partition
// search loop
MV pred_mv[MAX_REF_FRAMES];
......
This diff is collapsed.
/*
* 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 "vp10/encoder/block.h"
#include "vpx_scale/yv12config.h"
#ifdef __cplusplus
extern "C" {
#endif
#define MOTION_MAGNITUDE_THRESHOLD (8 * 3)
typedef enum vp10_denoiser_decision {
COPY_BLOCK,
FILTER_BLOCK
} VP9_DENOISER_DECISION;
typedef struct vp10_denoiser {
YV12_BUFFER_CONFIG running_avg_y[MAX_REF_FRAMES];
YV12_BUFFER_CONFIG mc_running_avg_y;
int increase_denoising;
int frame_buffer_initialized;
} VP9_DENOISER;
void vp10_denoiser_update_frame_info(VP9_DENOISER *denoiser,
YV12_BUFFER_CONFIG src,
FRAME_TYPE frame_type,
int refresh_alt_ref_frame,
int refresh_golden_frame,
int refresh_last_frame);
void vp10_denoiser_denoise(VP9_DENOISER *denoiser, MACROBLOCK *mb,
int mi_row, int mi_col, BLOCK_SIZE bs,
PICK_MODE_CONTEXT *ctx);
void vp10_denoiser_reset_frame_stats(PICK_MODE_CONTEXT *ctx);
void vp10_denoiser_update_frame_stats(MB_MODE_INFO *mbmi,
unsigned int sse, PREDICTION_MODE mode,
PICK_MODE_CONTEXT *ctx);
int vp10_denoiser_alloc(VP9_DENOISER *denoiser, int width, int height,
int ssx, int ssy,
#if CONFIG_VPX_HIGHBITDEPTH
int use_highbitdepth,
#endif
int border);
#if CONFIG_VP9_TEMPORAL_DENOISING
int total_adj_strong_thresh(BLOCK_SIZE bs, int increase_denoising);
#endif
void vp10_denoiser_free(VP9_DENOISER *denoiser);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // VP9_ENCODER_DENOISER_H_
......@@ -1681,11 +1681,6 @@ VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
cpi->td.mb.nmvsadcost_hp[1] = &cpi->nmvsadcosts_hp[1][MV_MAX];
cal_nmvsadcosts_hp(cpi->td.mb.nmvsadcost_hp);
#if CONFIG_VP9_TEMPORAL_DENOISING
#ifdef OUTPUT_YUV_DENOISED
yuv_denoised_file = fopen("denoised.yuv", "ab");
#endif
#endif
#ifdef OUTPUT_YUV_SKINMAP
yuv_skinmap_file = fopen("skinmap.yuv", "ab");
#endif
......@@ -1923,10 +1918,6 @@ void vp10_remove_compressor(VP10_COMP *cpi) {
#endif
}
#if CONFIG_VP9_TEMPORAL_DENOISING
vp10_denoiser_free(&(cpi->denoiser));
#endif
for (t = 0; t < cpi->num_workers; ++t) {
VPxWorker *const worker = &cpi->workers[t];
EncWorkerData *const thread_data = &cpi->tile_thr_data[t];
......@@ -1965,11 +1956,6 @@ void vp10_remove_compressor(VP10_COMP *cpi) {
vp10_free_ref_frame_buffers(cm->buffer_pool);
vpx_free(cpi);
#if CONFIG_VP9_TEMPORAL_DENOISING
#ifdef OUTPUT_YUV_DENOISED
fclose(yuv_denoised_file);
#endif
#endif
#ifdef OUTPUT_YUV_SKINMAP
fclose(yuv_skinmap_file);
#endif
......@@ -2630,16 +2616,6 @@ void vp10_update_reference_frames(VP10_COMP *cpi) {
cpi->interp_filter_selected[0],
sizeof(cpi->interp_filter_selected[0]));
}
#if CONFIG_VP9_TEMPORAL_DENOISING
if (cpi->oxcf.noise_sensitivity > 0) {
vp10_denoiser_update_frame_info(&cpi->denoiser,
*cpi->Source,
cpi->common.frame_type,
cpi->refresh_alt_ref_frame,
cpi->refresh_golden_frame,
cpi->refresh_last_frame);
}
#endif
}
static void loopfilter_frame(VP10_COMP *cpi, VP10_COMMON *cm) {
......@@ -3572,14 +3548,6 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi,
encode_with_recode_loop(cpi, size, dest);
}
#if CONFIG_VP9_TEMPORAL_DENOISING
#ifdef OUTPUT_YUV_DENOISED
if (oxcf->noise_sensitivity > 0) {
vp10_write_yuv_frame_420(&cpi->denoiser.running_avg_y[INTRA_FRAME],
yuv_denoised_file);
}
#endif
#endif
#ifdef OUTPUT_YUV_SKINMAP
if (cpi->common.current_video_frame > 1) {
vp10_compute_skin_map(cpi, yuv_skinmap_file);
......@@ -3756,21 +3724,6 @@ static void check_initial_width(VP10_COMP *cpi,
}
}
#if CONFIG_VP9_TEMPORAL_DENOISING
static void setup_denoiser_buffer(VP10_COMP *cpi) {
VP10_COMMON *const cm = &cpi->common;
if (cpi->oxcf.noise_sensitivity > 0 &&
!cpi->denoiser.frame_buffer_initialized) {
vp10_denoiser_alloc(&(cpi->denoiser), cm->width, cm->height,
cm->subsampling_x, cm->subsampling_y,
#if CONFIG_VPX_HIGHBITDEPTH
cm->use_highbitdepth,
#endif
VPX_ENC_BORDER_IN_PIXELS);
}
}
#endif
int vp10_receive_raw_frame(VP10_COMP *cpi, unsigned int frame_flags,
YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
int64_t end_time) {
......@@ -3786,9 +3739,6 @@ int vp10_receive_raw_frame(VP10_COMP *cpi, unsigned int frame_flags,
check_initial_width(cpi, subsampling_x, subsampling_y);
#endif // CONFIG_VPX_HIGHBITDEPTH
#if CONFIG_VP9_TEMPORAL_DENOISING
setup_denoiser_buffer(cpi);
#endif
vpx_usec_timer_start(&timer);
if (vp10_lookahead_push(cpi->lookahead, sd, time_stamp, end_time,
......@@ -4318,10 +4268,6 @@ int vp10_set_size_literal(VP10_COMP *cpi, unsigned int width,
check_initial_width(cpi, 1, 1);
#endif // CONFIG_VPX_HIGHBITDEPTH
#if CONFIG_VP9_TEMPORAL_DENOISING
setup_denoiser_buffer(cpi);
#endif
if (width) {
cm->width = width;
if (cm->width > cpi->initial_width) {
......
......@@ -34,10 +34,6 @@
#include "vp10/encoder/speed_features.h"
#include "vp10/encoder/tokenize.h"
#if CONFIG_VP9_TEMPORAL_DENOISING
#include "vp10/encoder/denoiser.h"
#endif
#if CONFIG_INTERNAL_STATS
#include "vpx_dsp/ssim.h"
#endif
......@@ -468,9 +464,6 @@ typedef struct VP10_COMP {
int intra_tx_type_costs[EXT_TX_SIZES][TX_TYPES][TX_TYPES];
int inter_tx_type_costs[EXT_TX_SIZES][TX_TYPES];
#if CONFIG_VP9_TEMPORAL_DENOISING
VP9_DENOISER denoiser;
#endif
int resize_pending;
int resize_state;
......
This diff is collapsed.
......@@ -23,8 +23,6 @@ VP10_CX_SRCS-yes += encoder/context_tree.h
VP10_CX_SRCS-yes += encoder/cost.h
VP10_CX_SRCS-yes += encoder/cost.c
VP10_CX_SRCS-yes += encoder/dct.c
VP10_CX_SRCS-$(CONFIG_VP9_TEMPORAL_DENOISING) += encoder/denoiser.c
VP10_CX_SRCS-$(CONFIG_VP9_TEMPORAL_DENOISING) += encoder/denoiser.h
VP10_CX_SRCS-yes += encoder/encodeframe.c
VP10_CX_SRCS-yes += encoder/encodeframe.h
VP10_CX_SRCS-yes += encoder/encodemb.c
......@@ -102,10 +100,6 @@ endif
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/dct_sse2.c
VP10_CX_SRCS-$(HAVE_SSSE3) += encoder/x86/dct_ssse3.c
ifeq ($(CONFIG_VP9_TEMPORAL_DENOISING),yes)
VP10_CX_SRCS-$(HAVE_SSE2) += encoder/x86/denoiser_sse2.c
endif
VP10_CX_SRCS-$(HAVE_AVX2) += encoder/x86/error_intrin_avx2.c
ifneq ($(CONFIG_VPX_HIGHBITDEPTH),yes)
......
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