Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 1 | /* |
Lester Lu | 6bc30d6 | 2021-12-16 19:13:21 +0000 | [diff] [blame^] | 2 | * Copyright (c) 2021, Alliance for Open Media. All rights reserved |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 3 | * |
Lester Lu | 6bc30d6 | 2021-12-16 19:13:21 +0000 | [diff] [blame^] | 4 | * This source code is subject to the terms of the BSD 3-Clause Clear License |
| 5 | * and the Alliance for Open Media Patent License 1.0. If the BSD 3-Clause Clear |
| 6 | * License was not distributed with this source code in the LICENSE file, you |
| 7 | * can obtain it at aomedia.org/license/software-license/bsd-3-c-c/. If the |
| 8 | * Alliance for Open Media Patent License 1.0 was not distributed with this |
| 9 | * source code in the PATENTS file, you can obtain it at |
| 10 | * aomedia.org/license/patent-license/. |
Yaowu Xu | 2ab7ff0 | 2016-09-02 12:04:54 -0700 | [diff] [blame] | 11 | */ |
Steinar Midtskogen | a9d41e8 | 2017-03-17 12:48:15 +0100 | [diff] [blame] | 12 | |
| 13 | #include <math.h> |
| 14 | #include <stdlib.h> |
| 15 | |
Tom Finegan | 44702c8 | 2018-05-22 13:00:39 -0700 | [diff] [blame] | 16 | #include "config/aom_dsp_rtcd.h" |
| 17 | #include "config/av1_rtcd.h" |
| 18 | |
Tom Finegan | dd3e2a5 | 2018-05-23 14:33:09 -0700 | [diff] [blame] | 19 | #include "av1/common/cdef.h" |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 20 | |
| 21 | /* Generated from gen_filter_tables.c. */ |
Yaowu Xu | c466182 | 2017-10-12 10:00:22 -0700 | [diff] [blame] | 22 | DECLARE_ALIGNED(16, const int, cdef_directions[8][2]) = { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 23 | { -1 * CDEF_BSTRIDE + 1, -2 * CDEF_BSTRIDE + 2 }, |
| 24 | { 0 * CDEF_BSTRIDE + 1, -1 * CDEF_BSTRIDE + 2 }, |
| 25 | { 0 * CDEF_BSTRIDE + 1, 0 * CDEF_BSTRIDE + 2 }, |
| 26 | { 0 * CDEF_BSTRIDE + 1, 1 * CDEF_BSTRIDE + 2 }, |
| 27 | { 1 * CDEF_BSTRIDE + 1, 2 * CDEF_BSTRIDE + 2 }, |
| 28 | { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE + 1 }, |
| 29 | { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE + 0 }, |
| 30 | { 1 * CDEF_BSTRIDE + 0, 2 * CDEF_BSTRIDE - 1 } |
| 31 | }; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 32 | |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 33 | /* Detect direction. 0 means 45-degree up-right, 2 is horizontal, and so on. |
| 34 | The search minimizes the weighted variance along all the lines in a |
| 35 | particular direction, i.e. the squared error between the input and a |
| 36 | "predicted" block where each pixel is replaced by the average along a line |
| 37 | in a particular direction. Since each direction have the same sum(x^2) term, |
| 38 | that term is never computed. See Section 2, step 2, of: |
| 39 | http://jmvalin.ca/notes/intra_paint.pdf */ |
Steinar Midtskogen | 94de0aa | 2017-08-02 10:30:12 +0200 | [diff] [blame] | 40 | int cdef_find_dir_c(const uint16_t *img, int stride, int32_t *var, |
| 41 | int coeff_shift) { |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 42 | int i; |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 43 | int32_t cost[8] = { 0 }; |
| 44 | int partial[8][15] = { { 0 } }; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 45 | int32_t best_cost = 0; |
| 46 | int best_dir = 0; |
| 47 | /* Instead of dividing by n between 2 and 8, we multiply by 3*5*7*8/n. |
| 48 | The output is then 840 times larger, but we don't care for finding |
| 49 | the max. */ |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 50 | static const int div_table[] = { 0, 840, 420, 280, 210, 168, 140, 120, 105 }; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 51 | for (i = 0; i < 8; i++) { |
| 52 | int j; |
| 53 | for (j = 0; j < 8; j++) { |
| 54 | int x; |
| 55 | /* We subtract 128 here to reduce the maximum range of the squared |
| 56 | partial sums. */ |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 57 | x = (img[i * stride + j] >> coeff_shift) - 128; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 58 | partial[0][i + j] += x; |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 59 | partial[1][i + j / 2] += x; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 60 | partial[2][i] += x; |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 61 | partial[3][3 + i - j / 2] += x; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 62 | partial[4][7 + i - j] += x; |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 63 | partial[5][3 - i / 2 + j] += x; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 64 | partial[6][j] += x; |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 65 | partial[7][i / 2 + j] += x; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 66 | } |
| 67 | } |
| 68 | for (i = 0; i < 8; i++) { |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 69 | cost[2] += partial[2][i] * partial[2][i]; |
| 70 | cost[6] += partial[6][i] * partial[6][i]; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 71 | } |
| 72 | cost[2] *= div_table[8]; |
| 73 | cost[6] *= div_table[8]; |
| 74 | for (i = 0; i < 7; i++) { |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 75 | cost[0] += (partial[0][i] * partial[0][i] + |
| 76 | partial[0][14 - i] * partial[0][14 - i]) * |
| 77 | div_table[i + 1]; |
| 78 | cost[4] += (partial[4][i] * partial[4][i] + |
| 79 | partial[4][14 - i] * partial[4][14 - i]) * |
| 80 | div_table[i + 1]; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 81 | } |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 82 | cost[0] += partial[0][7] * partial[0][7] * div_table[8]; |
| 83 | cost[4] += partial[4][7] * partial[4][7] * div_table[8]; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 84 | for (i = 1; i < 8; i += 2) { |
| 85 | int j; |
| 86 | for (j = 0; j < 4 + 1; j++) { |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 87 | cost[i] += partial[i][3 + j] * partial[i][3 + j]; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 88 | } |
| 89 | cost[i] *= div_table[8]; |
| 90 | for (j = 0; j < 4 - 1; j++) { |
clang-format | 21a0c2c | 2016-08-18 15:10:22 -0700 | [diff] [blame] | 91 | cost[i] += (partial[i][j] * partial[i][j] + |
| 92 | partial[i][10 - j] * partial[i][10 - j]) * |
| 93 | div_table[2 * j + 2]; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 94 | } |
| 95 | } |
| 96 | for (i = 0; i < 8; i++) { |
| 97 | if (cost[i] > best_cost) { |
| 98 | best_cost = cost[i]; |
| 99 | best_dir = i; |
| 100 | } |
| 101 | } |
| 102 | /* Difference between the optimal variance and the variance along the |
| 103 | orthogonal direction. Again, the sum(x^2) terms cancel out. */ |
| 104 | *var = best_cost - cost[(best_dir + 4) & 7]; |
| 105 | /* We'd normally divide by 840, but dividing by 1024 is close enough |
| 106 | for what we're going to do with this. */ |
| 107 | *var >>= 10; |
| 108 | return best_dir; |
| 109 | } |
| 110 | |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 111 | const int cdef_pri_taps[2][2] = { { 4, 2 }, { 3, 3 } }; |
Johann | ecfb315 | 2019-10-10 10:15:17 -0700 | [diff] [blame] | 112 | const int cdef_sec_taps[2] = { 2, 1 }; |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 113 | |
| 114 | /* Smooth in the direction detected. */ |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 115 | void cdef_filter_block_c(uint8_t *dst8, uint16_t *dst16, int dstride, |
| 116 | const uint16_t *in, int pri_strength, int sec_strength, |
| 117 | int dir, int pri_damping, int sec_damping, int bsize, |
Johann | 83607dc | 2018-11-02 11:50:31 -0700 | [diff] [blame] | 118 | int coeff_shift) { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 119 | int i, j, k; |
| 120 | const int s = CDEF_BSTRIDE; |
Steinar Midtskogen | bc75305 | 2017-10-23 12:32:10 +0200 | [diff] [blame] | 121 | const int *pri_taps = cdef_pri_taps[(pri_strength >> coeff_shift) & 1]; |
Johann | ecfb315 | 2019-10-10 10:15:17 -0700 | [diff] [blame] | 122 | const int *sec_taps = cdef_sec_taps; |
Steinar Midtskogen | ab6c9c7 | 2017-11-30 13:38:26 +0100 | [diff] [blame] | 123 | for (i = 0; i < 4 << (bsize == BLOCK_8X8 || bsize == BLOCK_4X8); i++) { |
| 124 | for (j = 0; j < 4 << (bsize == BLOCK_8X8 || bsize == BLOCK_8X4); j++) { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 125 | int16_t sum = 0; |
| 126 | int16_t y; |
| 127 | int16_t x = in[i * s + j]; |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 128 | int max = x; |
| 129 | int min = x; |
Steinar Midtskogen | 612eb2e | 2018-01-02 15:50:50 +0100 | [diff] [blame] | 130 | for (k = 0; k < 2; k++) { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 131 | int16_t p0 = in[i * s + j + cdef_directions[dir][k]]; |
| 132 | int16_t p1 = in[i * s + j - cdef_directions[dir][k]]; |
| 133 | sum += pri_taps[k] * constrain(p0 - x, pri_strength, pri_damping); |
| 134 | sum += pri_taps[k] * constrain(p1 - x, pri_strength, pri_damping); |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 135 | if (p0 != CDEF_VERY_LARGE) max = AOMMAX(p0, max); |
| 136 | if (p1 != CDEF_VERY_LARGE) max = AOMMAX(p1, max); |
| 137 | min = AOMMIN(p0, min); |
| 138 | min = AOMMIN(p1, min); |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 139 | int16_t s0 = in[i * s + j + cdef_directions[(dir + 2) & 7][k]]; |
| 140 | int16_t s1 = in[i * s + j - cdef_directions[(dir + 2) & 7][k]]; |
| 141 | int16_t s2 = in[i * s + j + cdef_directions[(dir + 6) & 7][k]]; |
| 142 | int16_t s3 = in[i * s + j - cdef_directions[(dir + 6) & 7][k]]; |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 143 | if (s0 != CDEF_VERY_LARGE) max = AOMMAX(s0, max); |
| 144 | if (s1 != CDEF_VERY_LARGE) max = AOMMAX(s1, max); |
| 145 | if (s2 != CDEF_VERY_LARGE) max = AOMMAX(s2, max); |
| 146 | if (s3 != CDEF_VERY_LARGE) max = AOMMAX(s3, max); |
| 147 | min = AOMMIN(s0, min); |
| 148 | min = AOMMIN(s1, min); |
| 149 | min = AOMMIN(s2, min); |
| 150 | min = AOMMIN(s3, min); |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 151 | sum += sec_taps[k] * constrain(s0 - x, sec_strength, sec_damping); |
| 152 | sum += sec_taps[k] * constrain(s1 - x, sec_strength, sec_damping); |
| 153 | sum += sec_taps[k] * constrain(s2 - x, sec_strength, sec_damping); |
| 154 | sum += sec_taps[k] * constrain(s3 - x, sec_strength, sec_damping); |
| 155 | } |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 156 | y = clamp((int16_t)x + ((8 + sum - (sum < 0)) >> 4), min, max); |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 157 | if (dst8) |
| 158 | dst8[i * dstride + j] = (uint8_t)y; |
| 159 | else |
| 160 | dst16[i * dstride + j] = (uint16_t)y; |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | |
Steinar Midtskogen | 94de0aa | 2017-08-02 10:30:12 +0200 | [diff] [blame] | 165 | /* Compute the primary filter strength for an 8x8 block based on the |
| 166 | directional variance difference. A high variance difference means |
| 167 | that we have a highly directional pattern (e.g. a high contrast |
| 168 | edge), so we can apply more deringing. A low variance means that we |
| 169 | either have a low contrast edge, or a non-directional texture, so |
| 170 | we want to be careful not to blur. */ |
| 171 | static INLINE int adjust_strength(int strength, int32_t var) { |
Steinar Midtskogen | fade463 | 2017-04-14 20:29:05 +0200 | [diff] [blame] | 172 | const int i = var >> 6 ? AOMMIN(get_msb(var >> 6), 12) : 0; |
Steinar Midtskogen | 94de0aa | 2017-08-02 10:30:12 +0200 | [diff] [blame] | 173 | /* We use the variance of 8x8 blocks to adjust the strength. */ |
| 174 | return var ? (strength * (4 + i) + 8) >> 4 : 0; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 175 | } |
| 176 | |
Hui Su | 584ba48 | 2019-06-19 11:48:05 -0700 | [diff] [blame] | 177 | void av1_cdef_filter_fb(uint8_t *dst8, uint16_t *dst16, int dstride, |
| 178 | uint16_t *in, int xdec, int ydec, |
| 179 | int dir[CDEF_NBLOCKS][CDEF_NBLOCKS], int *dirinit, |
| 180 | int var[CDEF_NBLOCKS][CDEF_NBLOCKS], int pli, |
| 181 | cdef_list *dlist, int cdef_count, int level, |
| 182 | int sec_strength, int damping, int coeff_shift) { |
Jean-Marc Valin | 3e44bcc | 2016-10-11 16:53:59 -0400 | [diff] [blame] | 183 | int bi; |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 184 | int bx; |
| 185 | int by; |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 186 | const int pri_strength = level << coeff_shift; |
Steinar Midtskogen | 830d2ac | 2017-10-21 08:07:19 +0200 | [diff] [blame] | 187 | sec_strength <<= coeff_shift; |
Hui Su | 584ba48 | 2019-06-19 11:48:05 -0700 | [diff] [blame] | 188 | damping += coeff_shift - (pli != AOM_PLANE_Y); |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 189 | const int bw_log2 = 3 - xdec; |
| 190 | const int bh_log2 = 3 - ydec; |
Steinar Midtskogen | 8322ff0 | 2017-12-20 15:39:52 +0100 | [diff] [blame] | 191 | if (dirinit && pri_strength == 0 && sec_strength == 0) { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 192 | // If we're here, both primary and secondary strengths are 0, and |
| 193 | // we still haven't written anything to y[] yet, so we just copy |
| 194 | // the input to y[]. This is necessary only for av1_cdef_search() |
| 195 | // and only av1_cdef_search() sets dirinit. |
| 196 | for (bi = 0; bi < cdef_count; bi++) { |
| 197 | by = dlist[bi].by; |
| 198 | bx = dlist[bi].bx; |
Steinar Midtskogen | 95a2f86 | 2017-04-07 09:24:02 +0200 | [diff] [blame] | 199 | // TODO(stemidts/jmvalin): SIMD optimisations |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 200 | for (int iy = 0; iy < 1 << bh_log2; iy++) { |
| 201 | memcpy(&dst16[(bi << (bw_log2 + bh_log2)) + (iy << bw_log2)], |
| 202 | &in[((by << bh_log2) + iy) * CDEF_BSTRIDE + (bx << bw_log2)], |
Fyodor Kyslov | e08fbd2 | 2019-06-28 10:49:19 -0700 | [diff] [blame] | 203 | ((size_t)1 << bw_log2) * sizeof(*dst16)); |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 204 | } |
Steinar Midtskogen | 95a2f86 | 2017-04-07 09:24:02 +0200 | [diff] [blame] | 205 | } |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 206 | return; |
Steinar Midtskogen | a9d41e8 | 2017-03-17 12:48:15 +0100 | [diff] [blame] | 207 | } |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 208 | |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 209 | if (pli == 0) { |
| 210 | if (!dirinit || !*dirinit) { |
| 211 | for (bi = 0; bi < cdef_count; bi++) { |
| 212 | by = dlist[bi].by; |
| 213 | bx = dlist[bi].bx; |
| 214 | dir[by][bx] = cdef_find_dir(&in[8 * by * CDEF_BSTRIDE + 8 * bx], |
| 215 | CDEF_BSTRIDE, &var[by][bx], coeff_shift); |
| 216 | } |
| 217 | if (dirinit) *dirinit = 1; |
| 218 | } |
| 219 | } |
Steinar Midtskogen | ab6c9c7 | 2017-11-30 13:38:26 +0100 | [diff] [blame] | 220 | if (pli == 1 && xdec != ydec) { |
| 221 | for (bi = 0; bi < cdef_count; bi++) { |
| 222 | static const int conv422[8] = { 7, 0, 2, 4, 5, 6, 6, 6 }; |
| 223 | static const int conv440[8] = { 1, 2, 2, 2, 3, 4, 6, 0 }; |
| 224 | by = dlist[bi].by; |
| 225 | bx = dlist[bi].bx; |
| 226 | dir[by][bx] = (xdec ? conv422 : conv440)[dir[by][bx]]; |
| 227 | } |
| 228 | } |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 229 | |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 230 | const int bsize = |
| 231 | ydec ? (xdec ? BLOCK_4X4 : BLOCK_8X4) : (xdec ? BLOCK_4X8 : BLOCK_8X8); |
| 232 | const int t = pri_strength; |
| 233 | const int s = sec_strength; |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 234 | for (bi = 0; bi < cdef_count; bi++) { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 235 | by = dlist[bi].by; |
| 236 | bx = dlist[bi].bx; |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 237 | if (dst8) { |
Johann | 83607dc | 2018-11-02 11:50:31 -0700 | [diff] [blame] | 238 | cdef_filter_block( |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 239 | &dst8[(by << bh_log2) * dstride + (bx << bw_log2)], NULL, dstride, |
| 240 | &in[(by * CDEF_BSTRIDE << bh_log2) + (bx << bw_log2)], |
Johann | 83607dc | 2018-11-02 11:50:31 -0700 | [diff] [blame] | 241 | (pli ? t : adjust_strength(t, var[by][bx])), s, t ? dir[by][bx] : 0, |
Hui Su | 584ba48 | 2019-06-19 11:48:05 -0700 | [diff] [blame] | 242 | damping, damping, bsize, coeff_shift); |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 243 | } else { |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 244 | cdef_filter_block( |
clang-format | 4eafefe | 2017-09-04 12:51:20 -0700 | [diff] [blame] | 245 | NULL, |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 246 | &dst16[dirinit ? bi << (bw_log2 + bh_log2) |
| 247 | : (by << bh_log2) * dstride + (bx << bw_log2)], |
| 248 | dirinit ? 1 << bw_log2 : dstride, |
| 249 | &in[(by * CDEF_BSTRIDE << bh_log2) + (bx << bw_log2)], |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 250 | (pli ? t : adjust_strength(t, var[by][bx])), s, t ? dir[by][bx] : 0, |
Hui Su | 584ba48 | 2019-06-19 11:48:05 -0700 | [diff] [blame] | 251 | damping, damping, bsize, coeff_shift); |
Hui Su | 3af4d13 | 2019-06-19 16:03:54 -0700 | [diff] [blame] | 252 | } |
Steinar Midtskogen | 5978212 | 2017-07-20 08:49:43 +0200 | [diff] [blame] | 253 | } |
Yaowu Xu | 253c001 | 2016-08-15 10:27:19 -0700 | [diff] [blame] | 254 | } |