| OLD | NEW |
| 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 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 static void mfqe_block(BLOCK_SIZE bs, const uint8_t *y, const uint8_t *u, | 164 static void mfqe_block(BLOCK_SIZE bs, const uint8_t *y, const uint8_t *u, |
| 165 const uint8_t *v, int y_stride, int uv_stride, | 165 const uint8_t *v, int y_stride, int uv_stride, |
| 166 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, |
| 167 int uvd_stride, int qdiff) { | 167 int uvd_stride, int qdiff) { |
| 168 int sad, sad_thr, vdiff, vdiff_thr; | 168 int sad, sad_thr, vdiff, vdiff_thr; |
| 169 uint32_t sse; | 169 uint32_t sse; |
| 170 | 170 |
| 171 get_thr(bs, qdiff, &sad_thr, &vdiff_thr); | 171 get_thr(bs, qdiff, &sad_thr, &vdiff_thr); |
| 172 | 172 |
| 173 if (bs == BLOCK_16X16) { | 173 if (bs == BLOCK_16X16) { |
| 174 vdiff = (vp9_variance16x16(y, y_stride, yd, yd_stride, &sse) + 128) >> 8; | 174 vdiff = (vpx_variance16x16(y, y_stride, yd, yd_stride, &sse) + 128) >> 8; |
| 175 sad = (vpx_sad16x16(y, y_stride, yd, yd_stride) + 128) >> 8; | 175 sad = (vpx_sad16x16(y, y_stride, yd, yd_stride) + 128) >> 8; |
| 176 } else if (bs == BLOCK_32X32) { | 176 } else if (bs == BLOCK_32X32) { |
| 177 vdiff = (vp9_variance32x32(y, y_stride, yd, yd_stride, &sse) + 512) >> 10; | 177 vdiff = (vpx_variance32x32(y, y_stride, yd, yd_stride, &sse) + 512) >> 10; |
| 178 sad = (vpx_sad32x32(y, y_stride, yd, yd_stride) + 512) >> 10; | 178 sad = (vpx_sad32x32(y, y_stride, yd, yd_stride) + 512) >> 10; |
| 179 } else /* if (bs == BLOCK_64X64) */ { | 179 } else /* if (bs == BLOCK_64X64) */ { |
| 180 vdiff = (vp9_variance64x64(y, y_stride, yd, yd_stride, &sse) + 2048) >> 12; | 180 vdiff = (vpx_variance64x64(y, y_stride, yd, yd_stride, &sse) + 2048) >> 12; |
| 181 sad = (vpx_sad64x64(y, y_stride, yd, yd_stride) + 2048) >> 12; | 181 sad = (vpx_sad64x64(y, y_stride, yd, yd_stride) + 2048) >> 12; |
| 182 } | 182 } |
| 183 | 183 |
| 184 // vdiff > sad * 3 means vdiff should not be too small, otherwise, | 184 // vdiff > sad * 3 means vdiff should not be too small, otherwise, |
| 185 // 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 |
| 186 // lighting change in smooth area, it is dangerous to do MFQE. | 186 // lighting change in smooth area, it is dangerous to do MFQE. |
| 187 if (sad > 1 && vdiff > sad * 3) { | 187 if (sad > 1 && vdiff > sad * 3) { |
| 188 const int weight = 1 << MFQE_PRECISION; | 188 const int weight = 1 << MFQE_PRECISION; |
| 189 int ifactor = weight * sad * vdiff / (sad_thr * vdiff_thr); | 189 int ifactor = weight * sad * vdiff / (sad_thr * vdiff_thr); |
| 190 // When ifactor equals weight, no MFQE is done. | 190 // When ifactor equals weight, no MFQE is done. |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 if (frame_is_intra_only(cm)) { | 385 if (frame_is_intra_only(cm)) { |
| 386 mi = mi_prev; | 386 mi = mi_prev; |
| 387 } else { | 387 } else { |
| 388 mi = mi_local; | 388 mi = mi_local; |
| 389 } | 389 } |
| 390 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, |
| 391 vd, yd_stride, uvd_stride); | 391 vd, yd_stride, uvd_stride); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 } | 394 } |
| OLD | NEW |