Coverage Report

Created: 2025-11-16 07:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/aom/av1/common/cfl.c
Line
Count
Source
1
/*
2
 * Copyright (c) 2016, Alliance for Open Media. All rights reserved
3
 *
4
 * This source code is subject to the terms of the BSD 2 Clause License and
5
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6
 * was not distributed with this source code in the LICENSE file, you can
7
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8
 * Media Patent License 1.0 was not distributed with this source code in the
9
 * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10
 */
11
12
#include "av1/common/av1_common_int.h"
13
#include "av1/common/cfl.h"
14
#include "av1/common/common_data.h"
15
16
#include "config/av1_rtcd.h"
17
18
55.9k
void cfl_init(CFL_CTX *cfl, const SequenceHeader *seq_params) {
19
55.9k
  assert(block_size_wide[CFL_MAX_BLOCK_SIZE] == CFL_BUF_LINE);
20
55.9k
  assert(block_size_high[CFL_MAX_BLOCK_SIZE] == CFL_BUF_LINE);
21
22
55.9k
  memset(&cfl->recon_buf_q3, 0, sizeof(cfl->recon_buf_q3));
23
55.9k
  memset(&cfl->ac_buf_q3, 0, sizeof(cfl->ac_buf_q3));
24
55.9k
  cfl->subsampling_x = seq_params->subsampling_x;
25
55.9k
  cfl->subsampling_y = seq_params->subsampling_y;
26
55.9k
  cfl->are_parameters_computed = 0;
27
55.9k
  cfl->store_y = 0;
28
  // The DC_PRED cache is disabled by default and is only enabled in
29
  // cfl_rd_pick_alpha
30
55.9k
  cfl->use_dc_pred_cache = 0;
31
55.9k
  cfl->dc_pred_is_cached[CFL_PRED_U] = 0;
32
55.9k
  cfl->dc_pred_is_cached[CFL_PRED_V] = 0;
33
55.9k
}
34
35
void cfl_store_dc_pred(MACROBLOCKD *const xd, const uint8_t *input,
36
0
                       CFL_PRED_TYPE pred_plane, int width) {
37
0
  assert(pred_plane < CFL_PRED_PLANES);
38
0
  assert(width <= CFL_BUF_LINE);
39
40
0
  if (is_cur_buf_hbd(xd)) {
41
0
    uint16_t *const input_16 = CONVERT_TO_SHORTPTR(input);
42
0
    memcpy(xd->cfl.dc_pred_cache[pred_plane], input_16, width << 1);
43
0
    return;
44
0
  }
45
46
0
  memcpy(xd->cfl.dc_pred_cache[pred_plane], input, width);
47
0
}
48
49
static void cfl_load_dc_pred_lbd(const int16_t *dc_pred_cache, uint8_t *dst,
50
0
                                 int dst_stride, int width, int height) {
51
0
  for (int j = 0; j < height; j++) {
52
0
    memcpy(dst, dc_pred_cache, width);
53
0
    dst += dst_stride;
54
0
  }
55
0
}
56
57
static void cfl_load_dc_pred_hbd(const int16_t *dc_pred_cache, uint16_t *dst,
58
0
                                 int dst_stride, int width, int height) {
59
0
  const size_t num_bytes = width << 1;
60
0
  for (int j = 0; j < height; j++) {
61
0
    memcpy(dst, dc_pred_cache, num_bytes);
62
0
    dst += dst_stride;
63
0
  }
64
0
}
65
void cfl_load_dc_pred(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride,
66
0
                      TX_SIZE tx_size, CFL_PRED_TYPE pred_plane) {
67
0
  const int width = tx_size_wide[tx_size];
68
0
  const int height = tx_size_high[tx_size];
69
0
  assert(pred_plane < CFL_PRED_PLANES);
70
0
  assert(width <= CFL_BUF_LINE);
71
0
  assert(height <= CFL_BUF_LINE);
72
0
  if (is_cur_buf_hbd(xd)) {
73
0
    uint16_t *dst_16 = CONVERT_TO_SHORTPTR(dst);
74
0
    cfl_load_dc_pred_hbd(xd->cfl.dc_pred_cache[pred_plane], dst_16, dst_stride,
75
0
                         width, height);
76
0
    return;
77
0
  }
78
0
  cfl_load_dc_pred_lbd(xd->cfl.dc_pred_cache[pred_plane], dst, dst_stride,
79
0
                       width, height);
80
0
}
81
82
// Due to frame boundary issues, it is possible that the total area covered by
83
// chroma exceeds that of luma. When this happens, we fill the missing pixels by
84
// repeating the last columns and/or rows.
85
2.29M
static INLINE void cfl_pad(CFL_CTX *cfl, int width, int height) {
86
2.29M
  const int diff_width = width - cfl->buf_width;
87
2.29M
  const int diff_height = height - cfl->buf_height;
88
89
2.29M
  if (diff_width > 0) {
90
3.10k
    const int min_height = height - diff_height;
91
3.10k
    uint16_t *recon_buf_q3 = cfl->recon_buf_q3 + (width - diff_width);
92
55.9k
    for (int j = 0; j < min_height; j++) {
93
52.8k
      const uint16_t last_pixel = recon_buf_q3[-1];
94
52.8k
      assert(recon_buf_q3 + diff_width <= cfl->recon_buf_q3 + CFL_BUF_SQUARE);
95
371k
      for (int i = 0; i < diff_width; i++) {
96
318k
        recon_buf_q3[i] = last_pixel;
97
318k
      }
98
52.8k
      recon_buf_q3 += CFL_BUF_LINE;
99
52.8k
    }
100
3.10k
    cfl->buf_width = width;
101
3.10k
  }
102
2.29M
  if (diff_height > 0) {
103
5.42k
    uint16_t *recon_buf_q3 =
104
5.42k
        cfl->recon_buf_q3 + ((height - diff_height) * CFL_BUF_LINE);
105
28.0k
    for (int j = 0; j < diff_height; j++) {
106
22.6k
      const uint16_t *last_row_q3 = recon_buf_q3 - CFL_BUF_LINE;
107
22.6k
      assert(recon_buf_q3 + width <= cfl->recon_buf_q3 + CFL_BUF_SQUARE);
108
174k
      for (int i = 0; i < width; i++) {
109
151k
        recon_buf_q3[i] = last_row_q3[i];
110
151k
      }
111
22.6k
      recon_buf_q3 += CFL_BUF_LINE;
112
22.6k
    }
113
5.42k
    cfl->buf_height = height;
114
5.42k
  }
115
2.29M
}
116
117
static void subtract_average_c(const uint16_t *src, int16_t *dst, int width,
118
2.29M
                               int height, int round_offset, int num_pel_log2) {
119
2.29M
  int sum = round_offset;
120
2.29M
  const uint16_t *recon = src;
121
26.4M
  for (int j = 0; j < height; j++) {
122
298M
    for (int i = 0; i < width; i++) {
123
274M
      sum += recon[i];
124
274M
    }
125
24.1M
    recon += CFL_BUF_LINE;
126
24.1M
  }
127
2.29M
  const int avg = sum >> num_pel_log2;
128
26.4M
  for (int j = 0; j < height; j++) {
129
298M
    for (int i = 0; i < width; i++) {
130
274M
      dst[i] = src[i] - avg;
131
274M
    }
132
24.1M
    src += CFL_BUF_LINE;
133
24.1M
    dst += CFL_BUF_LINE;
134
24.1M
  }
135
2.29M
}
136
137
2.29M
CFL_SUB_AVG_FN(c)
138
139
static INLINE int cfl_idx_to_alpha(uint8_t alpha_idx, int8_t joint_sign,
140
4.59M
                                   CFL_PRED_TYPE pred_type) {
141
4.59M
  const int alpha_sign = (pred_type == CFL_PRED_U) ? CFL_SIGN_U(joint_sign)
142
4.59M
                                                   : CFL_SIGN_V(joint_sign);
143
4.59M
  if (alpha_sign == CFL_SIGN_ZERO) return 0;
144
3.82M
  const int abs_alpha_q3 =
145
3.82M
      (pred_type == CFL_PRED_U) ? CFL_IDX_U(alpha_idx) : CFL_IDX_V(alpha_idx);
146
3.82M
  return (alpha_sign == CFL_SIGN_POS) ? abs_alpha_q3 + 1 : -abs_alpha_q3 - 1;
147
4.59M
}
148
149
static INLINE void cfl_predict_lbd_c(const int16_t *ac_buf_q3, uint8_t *dst,
150
                                     int dst_stride, int alpha_q3, int width,
151
2.64M
                                     int height) {
152
30.7M
  for (int j = 0; j < height; j++) {
153
368M
    for (int i = 0; i < width; i++) {
154
339M
      dst[i] = clip_pixel(get_scaled_luma_q0(alpha_q3, ac_buf_q3[i]) + dst[i]);
155
339M
    }
156
28.1M
    dst += dst_stride;
157
28.1M
    ac_buf_q3 += CFL_BUF_LINE;
158
28.1M
  }
159
2.64M
}
160
161
2.64M
CFL_PREDICT_FN(c, lbd)
162
163
#if CONFIG_AV1_HIGHBITDEPTH
164
void cfl_predict_hbd_c(const int16_t *ac_buf_q3, uint16_t *dst, int dst_stride,
165
1.94M
                       int alpha_q3, int bit_depth, int width, int height) {
166
22.1M
  for (int j = 0; j < height; j++) {
167
229M
    for (int i = 0; i < width; i++) {
168
209M
      dst[i] = clip_pixel_highbd(
169
209M
          get_scaled_luma_q0(alpha_q3, ac_buf_q3[i]) + dst[i], bit_depth);
170
209M
    }
171
20.1M
    dst += dst_stride;
172
20.1M
    ac_buf_q3 += CFL_BUF_LINE;
173
20.1M
  }
174
1.94M
}
175
176
1.94M
CFL_PREDICT_FN(c, hbd)
177
#endif
178
179
2.29M
static void cfl_compute_parameters(MACROBLOCKD *const xd, TX_SIZE tx_size) {
180
2.29M
  CFL_CTX *const cfl = &xd->cfl;
181
  // Do not call cfl_compute_parameters multiple time on the same values.
182
2.29M
  assert(cfl->are_parameters_computed == 0);
183
184
2.29M
  cfl_pad(cfl, tx_size_wide[tx_size], tx_size_high[tx_size]);
185
2.29M
  cfl_get_subtract_average_fn(tx_size)(cfl->recon_buf_q3, cfl->ac_buf_q3);
186
2.29M
  cfl->are_parameters_computed = 1;
187
2.29M
}
188
189
void cfl_predict_block(MACROBLOCKD *const xd, uint8_t *dst, int dst_stride,
190
4.59M
                       TX_SIZE tx_size, int plane) {
191
4.59M
  CFL_CTX *const cfl = &xd->cfl;
192
4.59M
  MB_MODE_INFO *mbmi = xd->mi[0];
193
4.59M
  assert(is_cfl_allowed(xd));
194
195
4.59M
  if (!cfl->are_parameters_computed) cfl_compute_parameters(xd, tx_size);
196
197
4.59M
  const int alpha_q3 =
198
4.59M
      cfl_idx_to_alpha(mbmi->cfl_alpha_idx, mbmi->cfl_alpha_signs, plane - 1);
199
4.59M
  assert((tx_size_high[tx_size] - 1) * CFL_BUF_LINE + tx_size_wide[tx_size] <=
200
4.59M
         CFL_BUF_SQUARE);
201
4.59M
#if CONFIG_AV1_HIGHBITDEPTH
202
4.59M
  if (is_cur_buf_hbd(xd)) {
203
1.94M
    uint16_t *dst_16 = CONVERT_TO_SHORTPTR(dst);
204
1.94M
    cfl_get_predict_hbd_fn(tx_size)(cfl->ac_buf_q3, dst_16, dst_stride,
205
1.94M
                                    alpha_q3, xd->bd);
206
1.94M
    return;
207
1.94M
  }
208
2.64M
#endif
209
2.64M
  cfl_get_predict_lbd_fn(tx_size)(cfl->ac_buf_q3, dst, dst_stride, alpha_q3);
210
2.64M
}
211
212
static void cfl_luma_subsampling_420_lbd_c(const uint8_t *input,
213
                                           int input_stride,
214
                                           uint16_t *output_q3, int width,
215
761k
                                           int height) {
216
4.40M
  for (int j = 0; j < height; j += 2) {
217
20.5M
    for (int i = 0; i < width; i += 2) {
218
16.8M
      const int bot = i + input_stride;
219
16.8M
      output_q3[i >> 1] =
220
16.8M
          (input[i] + input[i + 1] + input[bot] + input[bot + 1]) << 1;
221
16.8M
    }
222
3.64M
    input += input_stride << 1;
223
3.64M
    output_q3 += CFL_BUF_LINE;
224
3.64M
  }
225
761k
}
226
227
static void cfl_luma_subsampling_422_lbd_c(const uint8_t *input,
228
                                           int input_stride,
229
                                           uint16_t *output_q3, int width,
230
2.98k
                                           int height) {
231
2.98k
  assert((height - 1) * CFL_BUF_LINE + width <= CFL_BUF_SQUARE);
232
25.5k
  for (int j = 0; j < height; j++) {
233
229k
    for (int i = 0; i < width; i += 2) {
234
206k
      output_q3[i >> 1] = (input[i] + input[i + 1]) << 2;
235
206k
    }
236
22.5k
    input += input_stride;
237
22.5k
    output_q3 += CFL_BUF_LINE;
238
22.5k
  }
239
2.98k
}
240
241
static void cfl_luma_subsampling_444_lbd_c(const uint8_t *input,
242
                                           int input_stride,
243
                                           uint16_t *output_q3, int width,
244
1.41M
                                           int height) {
245
1.41M
  assert((height - 1) * CFL_BUF_LINE + width <= CFL_BUF_SQUARE);
246
14.7M
  for (int j = 0; j < height; j++) {
247
167M
    for (int i = 0; i < width; i++) {
248
154M
      output_q3[i] = input[i] << 3;
249
154M
    }
250
13.3M
    input += input_stride;
251
13.3M
    output_q3 += CFL_BUF_LINE;
252
13.3M
  }
253
1.41M
}
254
255
#if CONFIG_AV1_HIGHBITDEPTH
256
static void cfl_luma_subsampling_420_hbd_c(const uint16_t *input,
257
                                           int input_stride,
258
                                           uint16_t *output_q3, int width,
259
1.20M
                                           int height) {
260
6.93M
  for (int j = 0; j < height; j += 2) {
261
36.0M
    for (int i = 0; i < width; i += 2) {
262
30.3M
      const int bot = i + input_stride;
263
30.3M
      output_q3[i >> 1] =
264
30.3M
          (input[i] + input[i + 1] + input[bot] + input[bot + 1]) << 1;
265
30.3M
    }
266
5.73M
    input += input_stride << 1;
267
5.73M
    output_q3 += CFL_BUF_LINE;
268
5.73M
  }
269
1.20M
}
270
271
static void cfl_luma_subsampling_422_hbd_c(const uint16_t *input,
272
                                           int input_stride,
273
                                           uint16_t *output_q3, int width,
274
10.2k
                                           int height) {
275
10.2k
  assert((height - 1) * CFL_BUF_LINE + width <= CFL_BUF_SQUARE);
276
114k
  for (int j = 0; j < height; j++) {
277
1.06M
    for (int i = 0; i < width; i += 2) {
278
955k
      output_q3[i >> 1] = (input[i] + input[i + 1]) << 2;
279
955k
    }
280
104k
    input += input_stride;
281
104k
    output_q3 += CFL_BUF_LINE;
282
104k
  }
283
10.2k
}
284
285
static void cfl_luma_subsampling_444_hbd_c(const uint16_t *input,
286
                                           int input_stride,
287
                                           uint16_t *output_q3, int width,
288
733k
                                           int height) {
289
733k
  assert((height - 1) * CFL_BUF_LINE + width <= CFL_BUF_SQUARE);
290
7.98M
  for (int j = 0; j < height; j++) {
291
83.9M
    for (int i = 0; i < width; i++) {
292
76.6M
      output_q3[i] = input[i] << 3;
293
76.6M
    }
294
7.25M
    input += input_stride;
295
7.25M
    output_q3 += CFL_BUF_LINE;
296
7.25M
  }
297
733k
}
298
#endif
299
300
20.6M
CFL_GET_SUBSAMPLE_FUNCTION(c)
cfl_get_luma_subsampling_420_lbd_c
Line
Count
Source
300
CFL_GET_SUBSAMPLE_FUNCTION(c)
cfl_get_luma_subsampling_422_lbd_c
Line
Count
Source
300
CFL_GET_SUBSAMPLE_FUNCTION(c)
cfl_get_luma_subsampling_444_lbd_c
Line
Count
Source
300
CFL_GET_SUBSAMPLE_FUNCTION(c)
cfl_get_luma_subsampling_420_hbd_c
Line
Count
Source
300
CFL_GET_SUBSAMPLE_FUNCTION(c)
cfl_get_luma_subsampling_422_hbd_c
Line
Count
Source
300
CFL_GET_SUBSAMPLE_FUNCTION(c)
cfl_get_luma_subsampling_444_hbd_c
Line
Count
Source
300
CFL_GET_SUBSAMPLE_FUNCTION(c)
301
20.6M
302
20.6M
#if CONFIG_AV1_HIGHBITDEPTH
303
20.6M
static INLINE cfl_subsample_hbd_fn cfl_subsampling_hbd(TX_SIZE tx_size,
304
20.6M
                                                       int sub_x, int sub_y) {
305
1.94M
  if (sub_x == 1) {
306
1.21M
    if (sub_y == 1) {
307
1.20M
      return cfl_get_luma_subsampling_420_hbd(tx_size);
308
1.20M
    }
309
10.2k
    return cfl_get_luma_subsampling_422_hbd(tx_size);
310
1.21M
  }
311
733k
  return cfl_get_luma_subsampling_444_hbd(tx_size);
312
1.94M
}
313
#endif
314
315
static INLINE cfl_subsample_lbd_fn cfl_subsampling_lbd(TX_SIZE tx_size,
316
2.17M
                                                       int sub_x, int sub_y) {
317
2.17M
  if (sub_x == 1) {
318
764k
    if (sub_y == 1) {
319
761k
      return cfl_get_luma_subsampling_420_lbd(tx_size);
320
761k
    }
321
2.98k
    return cfl_get_luma_subsampling_422_lbd(tx_size);
322
764k
  }
323
1.41M
  return cfl_get_luma_subsampling_444_lbd(tx_size);
324
2.17M
}
325
326
static void cfl_store(CFL_CTX *cfl, const uint8_t *input, int input_stride,
327
4.12M
                      int row, int col, TX_SIZE tx_size, int use_hbd) {
328
4.12M
  const int width = tx_size_wide[tx_size];
329
4.12M
  const int height = tx_size_high[tx_size];
330
4.12M
  const int tx_off_log2 = MI_SIZE_LOG2;
331
4.12M
  const int sub_x = cfl->subsampling_x;
332
4.12M
  const int sub_y = cfl->subsampling_y;
333
4.12M
  const int store_row = row << (tx_off_log2 - sub_y);
334
4.12M
  const int store_col = col << (tx_off_log2 - sub_x);
335
4.12M
  const int store_height = height >> sub_y;
336
4.12M
  const int store_width = width >> sub_x;
337
338
  // Invalidate current parameters
339
4.12M
  cfl->are_parameters_computed = 0;
340
341
  // Store the surface of the pixel buffer that was written to, this way we
342
  // can manage chroma overrun (e.g. when the chroma surfaces goes beyond the
343
  // frame boundary)
344
4.12M
  if (col == 0 && row == 0) {
345
2.71M
    cfl->buf_width = store_width;
346
2.71M
    cfl->buf_height = store_height;
347
2.71M
  } else {
348
1.40M
    cfl->buf_width = OD_MAXI(store_col + store_width, cfl->buf_width);
349
1.40M
    cfl->buf_height = OD_MAXI(store_row + store_height, cfl->buf_height);
350
1.40M
  }
351
352
  // Check that we will remain inside the pixel buffer.
353
4.12M
  assert(store_row + store_height <= CFL_BUF_LINE);
354
4.12M
  assert(store_col + store_width <= CFL_BUF_LINE);
355
356
  // Store the input into the CfL pixel buffer
357
4.12M
  uint16_t *recon_buf_q3 =
358
4.12M
      cfl->recon_buf_q3 + (store_row * CFL_BUF_LINE + store_col);
359
4.12M
#if CONFIG_AV1_HIGHBITDEPTH
360
4.12M
  if (use_hbd) {
361
1.94M
    cfl_subsampling_hbd(tx_size, sub_x, sub_y)(CONVERT_TO_SHORTPTR(input),
362
1.94M
                                               input_stride, recon_buf_q3);
363
2.17M
  } else {
364
2.17M
    cfl_subsampling_lbd(tx_size, sub_x, sub_y)(input, input_stride,
365
2.17M
                                               recon_buf_q3);
366
2.17M
  }
367
#else
368
  (void)use_hbd;
369
  cfl_subsampling_lbd(tx_size, sub_x, sub_y)(input, input_stride, recon_buf_q3);
370
#endif
371
4.12M
}
372
373
// Adjust the row and column of blocks smaller than 8X8, as chroma-referenced
374
// and non-chroma-referenced blocks are stored together in the CfL buffer.
375
static INLINE void sub8x8_adjust_offset(const CFL_CTX *cfl, int mi_row,
376
                                        int mi_col, int *row_out,
377
1.74M
                                        int *col_out) {
378
  // Increment row index for bottom: 8x4, 16x4 or both bottom 4x4s.
379
1.74M
  if ((mi_row & 0x01) && cfl->subsampling_y) {
380
182k
    assert(*row_out == 0);
381
182k
    (*row_out)++;
382
182k
  }
383
384
  // Increment col index for right: 4x8, 4x16 or both right 4x4s.
385
1.74M
  if ((mi_col & 0x01) && cfl->subsampling_x) {
386
232k
    assert(*col_out == 0);
387
232k
    (*col_out)++;
388
232k
  }
389
1.74M
}
390
391
void cfl_store_tx(MACROBLOCKD *const xd, int row, int col, TX_SIZE tx_size,
392
4.10M
                  BLOCK_SIZE bsize) {
393
4.10M
  CFL_CTX *const cfl = &xd->cfl;
394
4.10M
  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
395
4.10M
  uint8_t *dst = &pd->dst.buf[(row * pd->dst.stride + col) << MI_SIZE_LOG2];
396
397
4.10M
  if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
398
    // Only dimensions of size 4 can have an odd offset.
399
1.72M
    assert(!((col & 1) && tx_size_wide[tx_size] != 4));
400
1.72M
    assert(!((row & 1) && tx_size_high[tx_size] != 4));
401
1.72M
    sub8x8_adjust_offset(cfl, xd->mi_row, xd->mi_col, &row, &col);
402
1.72M
  }
403
4.10M
  cfl_store(cfl, dst, pd->dst.stride, row, col, tx_size, is_cur_buf_hbd(xd));
404
4.10M
}
405
406
static INLINE int max_intra_block_width(const MACROBLOCKD *xd,
407
                                        BLOCK_SIZE plane_bsize, int plane,
408
19.2k
                                        TX_SIZE tx_size) {
409
19.2k
  const int max_blocks_wide = max_block_wide(xd, plane_bsize, plane)
410
19.2k
                              << MI_SIZE_LOG2;
411
19.2k
  return ALIGN_POWER_OF_TWO(max_blocks_wide, tx_size_wide_log2[tx_size]);
412
19.2k
}
413
414
static INLINE int max_intra_block_height(const MACROBLOCKD *xd,
415
                                         BLOCK_SIZE plane_bsize, int plane,
416
19.2k
                                         TX_SIZE tx_size) {
417
19.2k
  const int max_blocks_high = max_block_high(xd, plane_bsize, plane)
418
19.2k
                              << MI_SIZE_LOG2;
419
19.2k
  return ALIGN_POWER_OF_TWO(max_blocks_high, tx_size_high_log2[tx_size]);
420
19.2k
}
421
422
19.2k
void cfl_store_block(MACROBLOCKD *const xd, BLOCK_SIZE bsize, TX_SIZE tx_size) {
423
19.2k
  CFL_CTX *const cfl = &xd->cfl;
424
19.2k
  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_Y];
425
19.2k
  int row = 0;
426
19.2k
  int col = 0;
427
428
19.2k
  if (block_size_high[bsize] == 4 || block_size_wide[bsize] == 4) {
429
19.2k
    sub8x8_adjust_offset(cfl, xd->mi_row, xd->mi_col, &row, &col);
430
19.2k
  }
431
19.2k
  const int width = max_intra_block_width(xd, bsize, AOM_PLANE_Y, tx_size);
432
19.2k
  const int height = max_intra_block_height(xd, bsize, AOM_PLANE_Y, tx_size);
433
19.2k
  tx_size = get_tx_size(width, height);
434
19.2k
  cfl_store(cfl, pd->dst.buf, pd->dst.stride, row, col, tx_size,
435
19.2k
            is_cur_buf_hbd(xd));
436
19.2k
}