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 17 matching lines...) Expand all Loading... |
28 for (r = 0; r < block_size; r++) { | 28 for (r = 0; r < block_size; r++) { |
29 for (c = 0; c < block_size; c++) { | 29 for (c = 0; c < block_size; c++) { |
30 dst[c] = (src[c] * src_weight + dst[c] * dst_weight + rounding_bit) | 30 dst[c] = (src[c] * src_weight + dst[c] * dst_weight + rounding_bit) |
31 >> MFQE_PRECISION; | 31 >> MFQE_PRECISION; |
32 } | 32 } |
33 src += src_stride; | 33 src += src_stride; |
34 dst += dst_stride; | 34 dst += dst_stride; |
35 } | 35 } |
36 } | 36 } |
37 | 37 |
| 38 void vp9_filter_by_weight8x8_c(const uint8_t *src, int src_stride, |
| 39 uint8_t *dst, int dst_stride, int src_weight) { |
| 40 filter_by_weight(src, src_stride, dst, dst_stride, 8, src_weight); |
| 41 } |
| 42 |
| 43 void vp9_filter_by_weight16x16_c(const uint8_t *src, int src_stride, |
| 44 uint8_t *dst, int dst_stride, |
| 45 int src_weight) { |
| 46 filter_by_weight(src, src_stride, dst, dst_stride, 16, src_weight); |
| 47 } |
| 48 |
38 static void filter_by_weight32x32(const uint8_t *src, int src_stride, | 49 static void filter_by_weight32x32(const uint8_t *src, int src_stride, |
39 uint8_t *dst, int dst_stride, int weight) { | 50 uint8_t *dst, int dst_stride, int weight) { |
40 filter_by_weight(src, src_stride, dst, dst_stride, 16, weight); | 51 vp9_filter_by_weight16x16(src, src_stride, dst, dst_stride, weight); |
41 filter_by_weight(src + 16, src_stride, dst + 16, dst_stride, 16, weight); | 52 vp9_filter_by_weight16x16(src + 16, src_stride, dst + 16, dst_stride, |
42 filter_by_weight(src + src_stride * 16, src_stride, dst + dst_stride * 16, | 53 weight); |
43 dst_stride, 16, weight); | 54 vp9_filter_by_weight16x16(src + src_stride * 16, src_stride, |
44 filter_by_weight(src + src_stride * 16 + 16, src_stride, | 55 dst + dst_stride * 16, dst_stride, weight); |
45 dst + dst_stride * 16 + 16, dst_stride, 16, weight); | 56 vp9_filter_by_weight16x16(src + src_stride * 16 + 16, src_stride, |
| 57 dst + dst_stride * 16 + 16, dst_stride, weight); |
46 } | 58 } |
47 | 59 |
48 static void filter_by_weight64x64(const uint8_t *src, int src_stride, | 60 static void filter_by_weight64x64(const uint8_t *src, int src_stride, |
49 uint8_t *dst, int dst_stride, int weight) { | 61 uint8_t *dst, int dst_stride, int weight) { |
50 filter_by_weight32x32(src, src_stride, dst, dst_stride, weight); | 62 filter_by_weight32x32(src, src_stride, dst, dst_stride, weight); |
51 filter_by_weight32x32(src + 32, src_stride, dst + 32, | 63 filter_by_weight32x32(src + 32, src_stride, dst + 32, |
52 dst_stride, weight); | 64 dst_stride, weight); |
53 filter_by_weight32x32(src + src_stride * 32, src_stride, | 65 filter_by_weight32x32(src + src_stride * 32, src_stride, |
54 dst + dst_stride * 32, dst_stride, weight); | 66 dst + dst_stride * 32, dst_stride, weight); |
55 filter_by_weight32x32(src + src_stride * 32 + 32, src_stride, | 67 filter_by_weight32x32(src + src_stride * 32 + 32, src_stride, |
56 dst + dst_stride * 32 + 32, dst_stride, weight); | 68 dst + dst_stride * 32 + 32, dst_stride, weight); |
57 } | 69 } |
58 | 70 |
59 static void apply_ifactor(const uint8_t *y, int y_stride, uint8_t *yd, | 71 static void apply_ifactor(const uint8_t *y, int y_stride, uint8_t *yd, |
60 int yd_stride, const uint8_t *u, const uint8_t *v, | 72 int yd_stride, const uint8_t *u, const uint8_t *v, |
61 int uv_stride, uint8_t *ud, uint8_t *vd, | 73 int uv_stride, uint8_t *ud, uint8_t *vd, |
62 int uvd_stride, BLOCK_SIZE block_size, | 74 int uvd_stride, BLOCK_SIZE block_size, |
63 int weight) { | 75 int weight) { |
64 if (block_size == BLOCK_16X16) { | 76 if (block_size == BLOCK_16X16) { |
65 filter_by_weight(y, y_stride, yd, yd_stride, 16, weight); | 77 vp9_filter_by_weight16x16(y, y_stride, yd, yd_stride, weight); |
66 filter_by_weight(u, uv_stride, ud, uvd_stride, 8, weight); | 78 vp9_filter_by_weight8x8(u, uv_stride, ud, uvd_stride, weight); |
67 filter_by_weight(v, uv_stride, vd, uvd_stride, 8, weight); | 79 vp9_filter_by_weight8x8(v, uv_stride, vd, uvd_stride, weight); |
68 } else if (block_size == BLOCK_32X32) { | 80 } else if (block_size == BLOCK_32X32) { |
69 filter_by_weight32x32(y, y_stride, yd, yd_stride, weight); | 81 filter_by_weight32x32(y, y_stride, yd, yd_stride, weight); |
70 filter_by_weight(u, uv_stride, ud, uvd_stride, 16, weight); | 82 vp9_filter_by_weight16x16(u, uv_stride, ud, uvd_stride, weight); |
71 filter_by_weight(v, uv_stride, vd, uvd_stride, 16, weight); | 83 vp9_filter_by_weight16x16(v, uv_stride, vd, uvd_stride, weight); |
72 } else if (block_size == BLOCK_64X64) { | 84 } else if (block_size == BLOCK_64X64) { |
73 filter_by_weight64x64(y, y_stride, yd, yd_stride, weight); | 85 filter_by_weight64x64(y, y_stride, yd, yd_stride, weight); |
74 filter_by_weight32x32(u, uv_stride, ud, uvd_stride, weight); | 86 filter_by_weight32x32(u, uv_stride, ud, uvd_stride, weight); |
75 filter_by_weight32x32(v, uv_stride, vd, uvd_stride, weight); | 87 filter_by_weight32x32(v, uv_stride, vd, uvd_stride, weight); |
76 } | 88 } |
77 } | 89 } |
78 | 90 |
79 // TODO(jackychen): Determine whether replace it with assembly code. | 91 // TODO(jackychen): Determine whether replace it with assembly code. |
80 static void copy_mem8x8(const uint8_t *src, int src_stride, | 92 static void copy_mem8x8(const uint8_t *src, int src_stride, |
81 uint8_t *dst, int dst_stride) { | 93 uint8_t *dst, int dst_stride) { |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 if (frame_is_intra_only(cm)) { | 384 if (frame_is_intra_only(cm)) { |
373 mi = mi_prev; | 385 mi = mi_prev; |
374 } else { | 386 } else { |
375 mi = mi_local; | 387 mi = mi_local; |
376 } | 388 } |
377 mfqe_partition(cm, mi, BLOCK_64X64, y, u, v, y_stride, uv_stride, yd, ud, | 389 mfqe_partition(cm, mi, BLOCK_64X64, y, u, v, y_stride, uv_stride, yd, ud, |
378 vd, yd_stride, uvd_stride); | 390 vd, yd_stride, uvd_stride); |
379 } | 391 } |
380 } | 392 } |
381 } | 393 } |
OLD | NEW |