Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Unified Diff: source/libvpx/vp8/encoder/x86/denoising_sse2.c

Issue 290613006: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: source/libvpx/vp8/encoder/x86/denoising_sse2.c
===================================================================
--- source/libvpx/vp8/encoder/x86/denoising_sse2.c (revision 271138)
+++ source/libvpx/vp8/encoder/x86/denoising_sse2.c (working copy)
@@ -26,19 +26,24 @@
int mc_avg_y_stride,
unsigned char *running_avg_y, int avg_y_stride,
unsigned char *sig, int sig_stride,
- unsigned int motion_magnitude)
+ unsigned int motion_magnitude,
+ int increase_denoising)
{
unsigned char *running_avg_y_start = running_avg_y;
unsigned char *sig_start = sig;
+ int sum_diff_thresh;
int r;
+ int shift_inc = (increase_denoising &&
+ motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 1 : 0;
__m128i acc_diff = _mm_setzero_si128();
const __m128i k_0 = _mm_setzero_si128();
- const __m128i k_4 = _mm_set1_epi8(4);
+ const __m128i k_4 = _mm_set1_epi8(4 + shift_inc);
const __m128i k_8 = _mm_set1_epi8(8);
const __m128i k_16 = _mm_set1_epi8(16);
/* Modify each level's adjustment according to motion_magnitude. */
const __m128i l3 = _mm_set1_epi8(
- (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ? 7 : 6);
+ (motion_magnitude <= MOTION_MAGNITUDE_THRESHOLD) ?
+ 7 + shift_inc : 6);
/* Difference between level 3 and level 2 is 2. */
const __m128i l32 = _mm_set1_epi8(2);
/* Difference between level 2 and level 1 is 1. */
@@ -105,7 +110,9 @@
+ s.e[6] + s.e[7] + s.e[8] + s.e[9] + s.e[10] + s.e[11]
+ s.e[12] + s.e[13] + s.e[14] + s.e[15];
- if (abs(sum_diff) > SUM_DIFF_THRESHOLD)
+ sum_diff_thresh = SUM_DIFF_THRESHOLD;
+ if (increase_denoising) sum_diff_thresh = SUM_DIFF_THRESHOLD_HIGH;
+ if (abs(sum_diff) > sum_diff_thresh)
{
return COPY_BLOCK;
}

Powered by Google App Engine
This is Rietveld 408576698