Add flag for external VNR rectangle diagnostics on NEON.
TBR=marpan@webrtc.org Review URL: https://codereview.webrtc.org/1897013002 Cr-Commit-Position: refs/heads/master@{#12452}
This commit is contained in:
parent
eb3603bd5e
commit
8556c48a09
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "webrtc/modules/video_processing/util/noise_estimation.h"
|
||||
#if DISPLAY
|
||||
#if DISPLAYNEON
|
||||
#include <android/log.h>
|
||||
#endif
|
||||
|
||||
@ -53,12 +53,10 @@ void NoiseEstimation::UpdateNoiseLevel() {
|
||||
(0.65 * mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL) ||
|
||||
!num_noisy_block_) {
|
||||
#if DISPLAY
|
||||
if (cpu_type_) {
|
||||
printf("Not enough samples. %d \n", num_static_block_);
|
||||
} else {
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
|
||||
"Not enough samples. %d \n", num_static_block_);
|
||||
}
|
||||
printf("Not enough samples. %d \n", num_static_block_);
|
||||
#elif DISPLAYNEON
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
|
||||
"Not enough samples. %d \n", num_static_block_);
|
||||
#endif
|
||||
noise_var_ = 0;
|
||||
noise_var_accum_ = 0;
|
||||
@ -67,16 +65,14 @@ void NoiseEstimation::UpdateNoiseLevel() {
|
||||
return;
|
||||
} else {
|
||||
#if DISPLAY
|
||||
if (cpu_type_) {
|
||||
printf("%d %d fraction = %.3f\n", num_static_block_,
|
||||
mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
|
||||
percent_static_block_);
|
||||
} else {
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
|
||||
"%d %d fraction = %.3f\n", num_static_block_,
|
||||
mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
|
||||
percent_static_block_);
|
||||
}
|
||||
printf("%d %d fraction = %.3f\n", num_static_block_,
|
||||
mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
|
||||
percent_static_block_);
|
||||
#elif DISPLAYNEON
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "DISPLAY", "%d %d fraction = %.3f\n",
|
||||
num_static_block_,
|
||||
mb_cols_ * mb_rows_ / NOISE_SUBSAMPLE_INTERVAL,
|
||||
percent_static_block_);
|
||||
#endif
|
||||
// Normalized by the number of noisy blocks.
|
||||
noise_var_ /= num_noisy_block_;
|
||||
@ -94,14 +90,12 @@ void NoiseEstimation::UpdateNoiseLevel() {
|
||||
noise_var_accum_ = (noise_var_accum_ * 15 + noise_var_) / 16;
|
||||
}
|
||||
#if DISPLAY
|
||||
if (cpu_type_) {
|
||||
printf("noise_var_accum_ = %.1f, noise_var_ = %d.\n", noise_var_accum_,
|
||||
noise_var_);
|
||||
} else {
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
|
||||
"noise_var_accum_ = %.1f, noise_var_ = %d.\n",
|
||||
noise_var_accum_, noise_var_);
|
||||
}
|
||||
printf("noise_var_accum_ = %.1f, noise_var_ = %d.\n", noise_var_accum_,
|
||||
noise_var_);
|
||||
#elif DISPLAYNEON
|
||||
__android_log_print(ANDROID_LOG_DEBUG, "DISPLAY",
|
||||
"noise_var_accum_ = %.1f, noise_var_ = %d.\n",
|
||||
noise_var_accum_, noise_var_);
|
||||
#endif
|
||||
// Reset noise_var_ for the next frame.
|
||||
noise_var_ = 0;
|
||||
|
||||
@ -18,7 +18,8 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
#define DISPLAY 0
|
||||
#define DISPLAY 0 // Rectangle diagnostics
|
||||
#define DISPLAYNEON 0 // Rectangle diagnostics on NEON
|
||||
|
||||
const int kNoiseThreshold = 200;
|
||||
const int kNoiseThresholdNeon = 70;
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
#if DISPLAY // Rectangle diagnostics
|
||||
#if DISPLAY || DISPLAYNEON
|
||||
static void CopyMem8x8(const uint8_t* src,
|
||||
int src_stride,
|
||||
uint8_t* dst,
|
||||
@ -318,7 +318,7 @@ void VideoDenoiser::DenoiseFrame(const VideoFrame& frame,
|
||||
denoised_frame->set_timestamp(frame.timestamp());
|
||||
denoised_frame->set_render_time_ms(frame.render_time_ms());
|
||||
|
||||
#if DISPLAY // Rectangle diagnostics
|
||||
#if DISPLAY || DISPLAYNEON
|
||||
// Show rectangular region
|
||||
ShowRect(filter_, moving_edge_, moving_object_, x_density_, y_density_, u_src,
|
||||
v_src, u_dst, v_dst, mb_rows_, mb_cols_, stride_u_, stride_v_);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user