Coverage Report

Created: 2022-08-24 06:17

/src/aom/aom_dsp/quantize.c
Line
Count
Source (jump to first uncovered line)
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 "aom_dsp/quantize.h"
13
#include "aom_mem/aom_mem.h"
14
15
void aom_quantize_b_adaptive_helper_c(
16
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
17
    const int16_t *round_ptr, const int16_t *quant_ptr,
18
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
19
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
20
    const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr,
21
0
    const qm_val_t *iqm_ptr, const int log_scale) {
22
0
  const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale),
23
0
                         ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) };
24
0
  const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 };
25
0
  int i, non_zero_count = (int)n_coeffs, eob = -1;
26
0
  (void)iscan;
27
28
0
  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
29
0
  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
30
31
0
  int prescan_add[2];
32
0
  for (i = 0; i < 2; ++i)
33
0
    prescan_add[i] = ROUND_POWER_OF_TWO(dequant_ptr[i] * EOB_FACTOR, 7);
34
35
  // Pre-scan pass
36
0
  for (i = (int)n_coeffs - 1; i >= 0; i--) {
37
0
    const int rc = scan[i];
38
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
39
0
    const int coeff = coeff_ptr[rc] * wt;
40
0
    const int prescan_add_val = prescan_add[rc != 0];
41
0
    if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS) + prescan_add_val) &&
42
0
        coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS) - prescan_add_val))
43
0
      non_zero_count--;
44
0
    else
45
0
      break;
46
0
  }
47
48
  // Quantization pass: All coefficients with index >= zero_flag are
49
  // skippable. Note: zero_flag can be zero.
50
0
#if SKIP_EOB_FACTOR_ADJUST
51
0
  int first = -1;
52
0
#endif  // SKIP_EOB_FACTOR_ADJUST
53
0
  for (i = 0; i < non_zero_count; i++) {
54
0
    const int rc = scan[i];
55
0
    const int coeff = coeff_ptr[rc];
56
0
    const int coeff_sign = AOMSIGN(coeff);
57
0
    const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
58
0
    int tmp32;
59
60
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
61
0
    if (abs_coeff * wt >= (zbins[rc != 0] << AOM_QM_BITS)) {
62
0
      int64_t tmp =
63
0
          clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale),
64
0
                INT16_MIN, INT16_MAX);
65
0
      tmp *= wt;
66
0
      tmp32 = (int)(((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) *
67
0
                     quant_shift_ptr[rc != 0]) >>
68
0
                    (16 - log_scale + AOM_QM_BITS));  // quantization
69
0
      qcoeff_ptr[rc] = (tmp32 ^ coeff_sign) - coeff_sign;
70
0
      const int iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
71
0
      const int dequant =
72
0
          (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >>
73
0
          AOM_QM_BITS;
74
0
      const tran_low_t abs_dqcoeff = (tmp32 * dequant) >> log_scale;
75
0
      dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
76
77
0
      if (tmp32) {
78
0
        eob = i;
79
0
#if SKIP_EOB_FACTOR_ADJUST
80
0
        if (first == -1) first = i;
81
0
#endif  // SKIP_EOB_FACTOR_ADJUST
82
0
      }
83
0
    }
84
0
  }
85
0
#if SKIP_EOB_FACTOR_ADJUST
86
0
  if (eob >= 0 && first == eob) {
87
0
    const int rc = scan[eob];
88
0
    if (qcoeff_ptr[rc] == 1 || qcoeff_ptr[rc] == -1) {
89
0
      const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
90
0
      const int coeff = coeff_ptr[rc] * wt;
91
0
      const int factor = EOB_FACTOR + SKIP_EOB_FACTOR_ADJUST;
92
0
      const int prescan_add_val =
93
0
          ROUND_POWER_OF_TWO(dequant_ptr[rc != 0] * factor, 7);
94
0
      if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS) + prescan_add_val) &&
95
0
          coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS) - prescan_add_val)) {
96
0
        qcoeff_ptr[rc] = 0;
97
0
        dqcoeff_ptr[rc] = 0;
98
0
        eob = -1;
99
0
      }
100
0
    }
101
0
  }
102
0
#endif  // SKIP_EOB_FACTOR_ADJUST
103
0
  *eob_ptr = eob + 1;
104
0
}
105
106
void aom_quantize_b_helper_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
107
                             const int16_t *zbin_ptr, const int16_t *round_ptr,
108
                             const int16_t *quant_ptr,
109
                             const int16_t *quant_shift_ptr,
110
                             tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
111
                             const int16_t *dequant_ptr, uint16_t *eob_ptr,
112
                             const int16_t *scan, const int16_t *iscan,
113
                             const qm_val_t *qm_ptr, const qm_val_t *iqm_ptr,
114
0
                             const int log_scale) {
115
0
  const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale),
116
0
                         ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) };
117
0
  const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 };
118
0
  int i, non_zero_count = (int)n_coeffs, eob = -1;
119
0
  (void)iscan;
120
121
0
  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
122
0
  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
123
124
  // Pre-scan pass
125
0
  for (i = (int)n_coeffs - 1; i >= 0; i--) {
126
0
    const int rc = scan[i];
127
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
128
0
    const int coeff = coeff_ptr[rc] * wt;
129
130
0
    if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS)) &&
131
0
        coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS)))
132
0
      non_zero_count--;
133
0
    else
134
0
      break;
135
0
  }
136
137
  // Quantization pass: All coefficients with index >= zero_flag are
138
  // skippable. Note: zero_flag can be zero.
139
0
  for (i = 0; i < non_zero_count; i++) {
140
0
    const int rc = scan[i];
141
0
    const int coeff = coeff_ptr[rc];
142
0
    const int coeff_sign = AOMSIGN(coeff);
143
0
    const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
144
0
    int tmp32;
145
146
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
147
0
    if (abs_coeff * wt >= (zbins[rc != 0] << AOM_QM_BITS)) {
148
0
      int64_t tmp =
149
0
          clamp(abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale),
150
0
                INT16_MIN, INT16_MAX);
151
0
      tmp *= wt;
152
0
      tmp32 = (int)(((((tmp * quant_ptr[rc != 0]) >> 16) + tmp) *
153
0
                     quant_shift_ptr[rc != 0]) >>
154
0
                    (16 - log_scale + AOM_QM_BITS));  // quantization
155
0
      qcoeff_ptr[rc] = (tmp32 ^ coeff_sign) - coeff_sign;
156
0
      const int iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
157
0
      const int dequant =
158
0
          (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >>
159
0
          AOM_QM_BITS;
160
0
      const tran_low_t abs_dqcoeff = (tmp32 * dequant) >> log_scale;
161
0
      dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
162
163
0
      if (tmp32) eob = i;
164
0
    }
165
0
  }
166
0
  *eob_ptr = eob + 1;
167
0
}
168
169
#if CONFIG_AV1_HIGHBITDEPTH
170
void aom_highbd_quantize_b_adaptive_helper_c(
171
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
172
    const int16_t *round_ptr, const int16_t *quant_ptr,
173
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
174
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
175
    const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr,
176
0
    const qm_val_t *iqm_ptr, const int log_scale) {
177
0
  const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale),
178
0
                         ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) };
179
0
  const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 };
180
0
  (void)iscan;
181
0
  int i, non_zero_count = (int)n_coeffs, eob = -1;
182
183
0
  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
184
0
  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
185
186
0
  int prescan_add[2];
187
0
  for (i = 0; i < 2; ++i)
188
0
    prescan_add[i] = ROUND_POWER_OF_TWO(dequant_ptr[i] * EOB_FACTOR, 7);
189
190
  // Pre-scan pass
191
0
  for (i = (int)n_coeffs - 1; i >= 0; i--) {
192
0
    const int rc = scan[i];
193
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
194
0
    const int coeff = coeff_ptr[rc] * wt;
195
0
    const int prescan_add_val = prescan_add[rc != 0];
196
0
    if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS) + prescan_add_val) &&
197
0
        coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS) - prescan_add_val))
198
0
      non_zero_count--;
199
0
    else
200
0
      break;
201
0
  }
202
203
  // Quantization pass: All coefficients with index >= zero_flag are
204
  // skippable. Note: zero_flag can be zero.
205
0
#if SKIP_EOB_FACTOR_ADJUST
206
0
  int first = -1;
207
0
#endif  // SKIP_EOB_FACTOR_ADJUST
208
0
  for (i = 0; i < non_zero_count; i++) {
209
0
    const int rc = scan[i];
210
0
    const int coeff = coeff_ptr[rc];
211
0
    const int coeff_sign = AOMSIGN(coeff);
212
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
213
0
    const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
214
0
    if (abs_coeff * wt >= (zbins[rc != 0] << AOM_QM_BITS)) {
215
0
      const int64_t tmp1 =
216
0
          abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale);
217
0
      const int64_t tmpw = tmp1 * wt;
218
0
      const int64_t tmp2 = ((tmpw * quant_ptr[rc != 0]) >> 16) + tmpw;
219
0
      const int abs_qcoeff = (int)((tmp2 * quant_shift_ptr[rc != 0]) >>
220
0
                                   (16 - log_scale + AOM_QM_BITS));
221
0
      qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
222
0
      const qm_val_t iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
223
0
      const int dequant =
224
0
          (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >>
225
0
          AOM_QM_BITS;
226
0
      const tran_low_t abs_dqcoeff = (abs_qcoeff * dequant) >> log_scale;
227
0
      dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
228
0
      if (abs_qcoeff) {
229
0
        eob = i;
230
0
#if SKIP_EOB_FACTOR_ADJUST
231
0
        if (first == -1) first = eob;
232
0
#endif  // SKIP_EOB_FACTOR_ADJUST
233
0
      }
234
0
    }
235
0
  }
236
0
#if SKIP_EOB_FACTOR_ADJUST
237
0
  if (eob >= 0 && first == eob) {
238
0
    const int rc = scan[eob];
239
0
    if (qcoeff_ptr[rc] == 1 || qcoeff_ptr[rc] == -1) {
240
0
      const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
241
0
      const int coeff = coeff_ptr[rc] * wt;
242
0
      const int factor = EOB_FACTOR + SKIP_EOB_FACTOR_ADJUST;
243
0
      const int prescan_add_val =
244
0
          ROUND_POWER_OF_TWO(dequant_ptr[rc != 0] * factor, 7);
245
0
      if (coeff < (zbins[rc != 0] * (1 << AOM_QM_BITS) + prescan_add_val) &&
246
0
          coeff > (nzbins[rc != 0] * (1 << AOM_QM_BITS) - prescan_add_val)) {
247
0
        qcoeff_ptr[rc] = 0;
248
0
        dqcoeff_ptr[rc] = 0;
249
0
        eob = -1;
250
0
      }
251
0
    }
252
0
  }
253
0
#endif  // SKIP_EOB_FACTOR_ADJUST
254
0
  *eob_ptr = eob + 1;
255
0
}
256
257
void aom_highbd_quantize_b_helper_c(
258
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
259
    const int16_t *round_ptr, const int16_t *quant_ptr,
260
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
261
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
262
    const int16_t *scan, const int16_t *iscan, const qm_val_t *qm_ptr,
263
0
    const qm_val_t *iqm_ptr, const int log_scale) {
264
0
  int i, eob = -1;
265
0
  const int zbins[2] = { ROUND_POWER_OF_TWO(zbin_ptr[0], log_scale),
266
0
                         ROUND_POWER_OF_TWO(zbin_ptr[1], log_scale) };
267
0
  const int nzbins[2] = { zbins[0] * -1, zbins[1] * -1 };
268
0
  int dequant;
269
0
  int idx_arr[4096];
270
0
  (void)iscan;
271
0
  int idx = 0;
272
273
0
  memset(qcoeff_ptr, 0, n_coeffs * sizeof(*qcoeff_ptr));
274
0
  memset(dqcoeff_ptr, 0, n_coeffs * sizeof(*dqcoeff_ptr));
275
276
  // Pre-scan pass
277
0
  for (i = 0; i < n_coeffs; i++) {
278
0
    const int rc = scan[i];
279
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
280
0
    const int coeff = coeff_ptr[rc] * wt;
281
282
    // If the coefficient is out of the base ZBIN range, keep it for
283
    // quantization.
284
0
    if (coeff >= (zbins[rc != 0] * (1 << AOM_QM_BITS)) ||
285
0
        coeff <= (nzbins[rc != 0] * (1 << AOM_QM_BITS)))
286
0
      idx_arr[idx++] = i;
287
0
  }
288
289
  // Quantization pass: only process the coefficients selected in
290
  // pre-scan pass. Note: idx can be zero.
291
0
  for (i = 0; i < idx; i++) {
292
0
    const int rc = scan[idx_arr[i]];
293
0
    const int coeff = coeff_ptr[rc];
294
0
    const int coeff_sign = AOMSIGN(coeff);
295
0
    const qm_val_t wt = qm_ptr != NULL ? qm_ptr[rc] : (1 << AOM_QM_BITS);
296
0
    const qm_val_t iwt = iqm_ptr != NULL ? iqm_ptr[rc] : (1 << AOM_QM_BITS);
297
0
    const int abs_coeff = (coeff ^ coeff_sign) - coeff_sign;
298
0
    const int64_t tmp1 =
299
0
        abs_coeff + ROUND_POWER_OF_TWO(round_ptr[rc != 0], log_scale);
300
0
    const int64_t tmpw = tmp1 * wt;
301
0
    const int64_t tmp2 = ((tmpw * quant_ptr[rc != 0]) >> 16) + tmpw;
302
0
    const int abs_qcoeff = (int)((tmp2 * quant_shift_ptr[rc != 0]) >>
303
0
                                 (16 - log_scale + AOM_QM_BITS));
304
0
    qcoeff_ptr[rc] = (tran_low_t)((abs_qcoeff ^ coeff_sign) - coeff_sign);
305
0
    dequant =
306
0
        (dequant_ptr[rc != 0] * iwt + (1 << (AOM_QM_BITS - 1))) >> AOM_QM_BITS;
307
0
    const tran_low_t abs_dqcoeff = (abs_qcoeff * dequant) >> log_scale;
308
0
    dqcoeff_ptr[rc] = (tran_low_t)((abs_dqcoeff ^ coeff_sign) - coeff_sign);
309
0
    if (abs_qcoeff) eob = idx_arr[i];
310
0
  }
311
0
  *eob_ptr = eob + 1;
312
0
}
313
#endif  // CONFIG_AV1_HIGHBITDEPTH
314
315
/* These functions should only be called when quantisation matrices
316
   are not used. */
317
void aom_quantize_b_adaptive_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
318
                               const int16_t *zbin_ptr,
319
                               const int16_t *round_ptr,
320
                               const int16_t *quant_ptr,
321
                               const int16_t *quant_shift_ptr,
322
                               tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
323
                               const int16_t *dequant_ptr, uint16_t *eob_ptr,
324
0
                               const int16_t *scan, const int16_t *iscan) {
325
0
  aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
326
0
                                   quant_ptr, quant_shift_ptr, qcoeff_ptr,
327
0
                                   dqcoeff_ptr, dequant_ptr, eob_ptr, scan,
328
0
                                   iscan, NULL, NULL, 0);
329
0
}
330
331
void aom_quantize_b_32x32_adaptive_c(
332
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
333
    const int16_t *round_ptr, const int16_t *quant_ptr,
334
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
335
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
336
0
    const int16_t *scan, const int16_t *iscan) {
337
0
  aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
338
0
                                   quant_ptr, quant_shift_ptr, qcoeff_ptr,
339
0
                                   dqcoeff_ptr, dequant_ptr, eob_ptr, scan,
340
0
                                   iscan, NULL, NULL, 1);
341
0
}
342
343
void aom_quantize_b_64x64_adaptive_c(
344
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
345
    const int16_t *round_ptr, const int16_t *quant_ptr,
346
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
347
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
348
0
    const int16_t *scan, const int16_t *iscan) {
349
0
  aom_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
350
0
                                   quant_ptr, quant_shift_ptr, qcoeff_ptr,
351
0
                                   dqcoeff_ptr, dequant_ptr, eob_ptr, scan,
352
0
                                   iscan, NULL, NULL, 2);
353
0
}
354
355
#if CONFIG_AV1_HIGHBITDEPTH
356
void aom_highbd_quantize_b_adaptive_c(
357
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
358
    const int16_t *round_ptr, const int16_t *quant_ptr,
359
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
360
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
361
0
    const int16_t *scan, const int16_t *iscan) {
362
0
  aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr,
363
0
                                          round_ptr, quant_ptr, quant_shift_ptr,
364
0
                                          qcoeff_ptr, dqcoeff_ptr, dequant_ptr,
365
0
                                          eob_ptr, scan, iscan, NULL, NULL, 0);
366
0
}
367
368
void aom_highbd_quantize_b_32x32_adaptive_c(
369
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
370
    const int16_t *round_ptr, const int16_t *quant_ptr,
371
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
372
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
373
0
    const int16_t *scan, const int16_t *iscan) {
374
0
  aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr,
375
0
                                          round_ptr, quant_ptr, quant_shift_ptr,
376
0
                                          qcoeff_ptr, dqcoeff_ptr, dequant_ptr,
377
0
                                          eob_ptr, scan, iscan, NULL, NULL, 1);
378
0
}
379
380
void aom_highbd_quantize_b_64x64_adaptive_c(
381
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
382
    const int16_t *round_ptr, const int16_t *quant_ptr,
383
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
384
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
385
0
    const int16_t *scan, const int16_t *iscan) {
386
0
  aom_highbd_quantize_b_adaptive_helper_c(coeff_ptr, n_coeffs, zbin_ptr,
387
0
                                          round_ptr, quant_ptr, quant_shift_ptr,
388
0
                                          qcoeff_ptr, dqcoeff_ptr, dequant_ptr,
389
0
                                          eob_ptr, scan, iscan, NULL, NULL, 2);
390
0
}
391
#endif  // CONFIG_AV1_HIGHBITDEPTH
392
393
void aom_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
394
                      const int16_t *zbin_ptr, const int16_t *round_ptr,
395
                      const int16_t *quant_ptr, const int16_t *quant_shift_ptr,
396
                      tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
397
                      const int16_t *dequant_ptr, uint16_t *eob_ptr,
398
0
                      const int16_t *scan, const int16_t *iscan) {
399
0
  aom_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr,
400
0
                          quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr,
401
0
                          eob_ptr, scan, iscan, NULL, NULL, 0);
402
0
}
403
404
void aom_quantize_b_32x32_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
405
                            const int16_t *zbin_ptr, const int16_t *round_ptr,
406
                            const int16_t *quant_ptr,
407
                            const int16_t *quant_shift_ptr,
408
                            tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
409
                            const int16_t *dequant_ptr, uint16_t *eob_ptr,
410
0
                            const int16_t *scan, const int16_t *iscan) {
411
0
  aom_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr,
412
0
                          quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr,
413
0
                          eob_ptr, scan, iscan, NULL, NULL, 1);
414
0
}
415
416
void aom_quantize_b_64x64_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
417
                            const int16_t *zbin_ptr, const int16_t *round_ptr,
418
                            const int16_t *quant_ptr,
419
                            const int16_t *quant_shift_ptr,
420
                            tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
421
                            const int16_t *dequant_ptr, uint16_t *eob_ptr,
422
0
                            const int16_t *scan, const int16_t *iscan) {
423
0
  aom_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr, quant_ptr,
424
0
                          quant_shift_ptr, qcoeff_ptr, dqcoeff_ptr, dequant_ptr,
425
0
                          eob_ptr, scan, iscan, NULL, NULL, 2);
426
0
}
427
428
#if CONFIG_AV1_HIGHBITDEPTH
429
void aom_highbd_quantize_b_c(const tran_low_t *coeff_ptr, intptr_t n_coeffs,
430
                             const int16_t *zbin_ptr, const int16_t *round_ptr,
431
                             const int16_t *quant_ptr,
432
                             const int16_t *quant_shift_ptr,
433
                             tran_low_t *qcoeff_ptr, tran_low_t *dqcoeff_ptr,
434
                             const int16_t *dequant_ptr, uint16_t *eob_ptr,
435
0
                             const int16_t *scan, const int16_t *iscan) {
436
0
  aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
437
0
                                 quant_ptr, quant_shift_ptr, qcoeff_ptr,
438
0
                                 dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan,
439
0
                                 NULL, NULL, 0);
440
0
}
441
442
void aom_highbd_quantize_b_32x32_c(
443
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
444
    const int16_t *round_ptr, const int16_t *quant_ptr,
445
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
446
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
447
0
    const int16_t *scan, const int16_t *iscan) {
448
0
  aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
449
0
                                 quant_ptr, quant_shift_ptr, qcoeff_ptr,
450
0
                                 dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan,
451
0
                                 NULL, NULL, 1);
452
0
}
453
454
void aom_highbd_quantize_b_64x64_c(
455
    const tran_low_t *coeff_ptr, intptr_t n_coeffs, const int16_t *zbin_ptr,
456
    const int16_t *round_ptr, const int16_t *quant_ptr,
457
    const int16_t *quant_shift_ptr, tran_low_t *qcoeff_ptr,
458
    tran_low_t *dqcoeff_ptr, const int16_t *dequant_ptr, uint16_t *eob_ptr,
459
0
    const int16_t *scan, const int16_t *iscan) {
460
0
  aom_highbd_quantize_b_helper_c(coeff_ptr, n_coeffs, zbin_ptr, round_ptr,
461
0
                                 quant_ptr, quant_shift_ptr, qcoeff_ptr,
462
0
                                 dqcoeff_ptr, dequant_ptr, eob_ptr, scan, iscan,
463
0
                                 NULL, NULL, 2);
464
0
}
465
#endif  // CONFIG_AV1_HIGHBITDEPTH