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

Side by Side Diff: source/libvpx/vp9/common/vp9_mfqe.c

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 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 unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_loopfilter.c ('k') | source/libvpx/vp9/common/vp9_mvref_common.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #include "./vpx_config.h" 11 #include "./vpx_config.h"
12 #include "./vp9_rtcd.h"
13 #include "./vpx_dsp_rtcd.h"
12 #include "./vpx_scale_rtcd.h" 14 #include "./vpx_scale_rtcd.h"
13 #include "./vp9_rtcd.h"
14 15
15 #include "vp9/common/vp9_onyxc_int.h" 16 #include "vp9/common/vp9_onyxc_int.h"
16 #include "vp9/common/vp9_postproc.h" 17 #include "vp9/common/vp9_postproc.h"
17 18
18 // TODO(jackychen): Replace this function with SSE2 code. There is 19 // TODO(jackychen): Replace this function with SSE2 code. There is
19 // one SSE2 implementation in vp8, so will consider how to share it 20 // one SSE2 implementation in vp8, so will consider how to share it
20 // between vp8 and vp9. 21 // between vp8 and vp9.
21 static void filter_by_weight(const uint8_t *src, int src_stride, 22 static void filter_by_weight(const uint8_t *src, int src_stride,
22 uint8_t *dst, int dst_stride, 23 uint8_t *dst, int dst_stride,
23 int block_size, int src_weight) { 24 int block_size, int src_weight) {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 const uint8_t *v, int y_stride, int uv_stride, 165 const uint8_t *v, int y_stride, int uv_stride,
165 uint8_t *yd, uint8_t *ud, uint8_t *vd, int yd_stride, 166 uint8_t *yd, uint8_t *ud, uint8_t *vd, int yd_stride,
166 int uvd_stride, int qdiff) { 167 int uvd_stride, int qdiff) {
167 int sad, sad_thr, vdiff, vdiff_thr; 168 int sad, sad_thr, vdiff, vdiff_thr;
168 uint32_t sse; 169 uint32_t sse;
169 170
170 get_thr(bs, qdiff, &sad_thr, &vdiff_thr); 171 get_thr(bs, qdiff, &sad_thr, &vdiff_thr);
171 172
172 if (bs == BLOCK_16X16) { 173 if (bs == BLOCK_16X16) {
173 vdiff = (vp9_variance16x16(y, y_stride, yd, yd_stride, &sse) + 128) >> 8; 174 vdiff = (vp9_variance16x16(y, y_stride, yd, yd_stride, &sse) + 128) >> 8;
174 sad = (vp9_sad16x16(y, y_stride, yd, yd_stride) + 128) >> 8; 175 sad = (vpx_sad16x16(y, y_stride, yd, yd_stride) + 128) >> 8;
175 } else if (bs == BLOCK_32X32) { 176 } else if (bs == BLOCK_32X32) {
176 vdiff = (vp9_variance32x32(y, y_stride, yd, yd_stride, &sse) + 512) >> 10; 177 vdiff = (vp9_variance32x32(y, y_stride, yd, yd_stride, &sse) + 512) >> 10;
177 sad = (vp9_sad32x32(y, y_stride, yd, yd_stride) + 512) >> 10; 178 sad = (vpx_sad32x32(y, y_stride, yd, yd_stride) + 512) >> 10;
178 } else /* if (bs == BLOCK_64X64) */ { 179 } else /* if (bs == BLOCK_64X64) */ {
179 vdiff = (vp9_variance64x64(y, y_stride, yd, yd_stride, &sse) + 2048) >> 12; 180 vdiff = (vp9_variance64x64(y, y_stride, yd, yd_stride, &sse) + 2048) >> 12;
180 sad = (vp9_sad64x64(y, y_stride, yd, yd_stride) + 2048) >> 12; 181 sad = (vpx_sad64x64(y, y_stride, yd, yd_stride) + 2048) >> 12;
181 } 182 }
182 183
183 // vdiff > sad * 3 means vdiff should not be too small, otherwise, 184 // vdiff > sad * 3 means vdiff should not be too small, otherwise,
184 // it might be a lighting change in smooth area. When there is a 185 // it might be a lighting change in smooth area. When there is a
185 // lighting change in smooth area, it is dangerous to do MFQE. 186 // lighting change in smooth area, it is dangerous to do MFQE.
186 if (sad > 1 && vdiff > sad * 3) { 187 if (sad > 1 && vdiff > sad * 3) {
187 const int weight = 1 << MFQE_PRECISION; 188 const int weight = 1 << MFQE_PRECISION;
188 int ifactor = weight * sad * vdiff / (sad_thr * vdiff_thr); 189 int ifactor = weight * sad * vdiff / (sad_thr * vdiff_thr);
189 // When ifactor equals weight, no MFQE is done. 190 // When ifactor equals weight, no MFQE is done.
190 if (ifactor > weight) { 191 if (ifactor > weight) {
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 if (frame_is_intra_only(cm)) { 385 if (frame_is_intra_only(cm)) {
385 mi = mi_prev; 386 mi = mi_prev;
386 } else { 387 } else {
387 mi = mi_local; 388 mi = mi_local;
388 } 389 }
389 mfqe_partition(cm, mi, BLOCK_64X64, y, u, v, y_stride, uv_stride, yd, ud, 390 mfqe_partition(cm, mi, BLOCK_64X64, y, u, v, y_stride, uv_stride, yd, ud,
390 vd, yd_stride, uvd_stride); 391 vd, yd_stride, uvd_stride);
391 } 392 }
392 } 393 }
393 } 394 }
OLDNEW
« no previous file with comments | « source/libvpx/vp9/common/vp9_loopfilter.c ('k') | source/libvpx/vp9/common/vp9_mvref_common.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698