AOMedia AV1 Codec
intra_mode_search_utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2020, 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 
17 #ifndef AOM_AV1_ENCODER_INTRA_MODE_SEARCH_UTILS_H_
18 #define AOM_AV1_ENCODER_INTRA_MODE_SEARCH_UTILS_H_
19 
20 #include "av1/common/enums.h"
21 #include "av1/common/pred_common.h"
22 #include "av1/common/reconintra.h"
23 
24 #include "av1/encoder/encoder.h"
25 #include "av1/encoder/model_rd.h"
26 #include "av1/encoder/palette.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
33 #define BINS 32
34 static const float av1_intra_hog_model_bias[DIRECTIONAL_MODES] = {
35  0.450578f, 0.695518f, -0.717944f, -0.639894f,
36  -0.602019f, -0.453454f, 0.055857f, -0.465480f,
37 };
38 
39 static const float av1_intra_hog_model_weights[BINS * DIRECTIONAL_MODES] = {
40  -3.076402f, -3.757063f, -3.275266f, -3.180665f, -3.452105f, -3.216593f,
41  -2.871212f, -3.134296f, -1.822324f, -2.401411f, -1.541016f, -1.195322f,
42  -0.434156f, 0.322868f, 2.260546f, 3.368715f, 3.989290f, 3.308487f,
43  2.277893f, 0.923793f, 0.026412f, -0.385174f, -0.718622f, -1.408867f,
44  -1.050558f, -2.323941f, -2.225827f, -2.585453f, -3.054283f, -2.875087f,
45  -2.985709f, -3.447155f, 3.758139f, 3.204353f, 2.170998f, 0.826587f,
46  -0.269665f, -0.702068f, -1.085776f, -2.175249f, -1.623180f, -2.975142f,
47  -2.779629f, -3.190799f, -3.521900f, -3.375480f, -3.319355f, -3.897389f,
48  -3.172334f, -3.594528f, -2.879132f, -2.547777f, -2.921023f, -2.281844f,
49  -1.818988f, -2.041771f, -0.618268f, -1.396458f, -0.567153f, -0.285868f,
50  -0.088058f, 0.753494f, 2.092413f, 3.215266f, -3.300277f, -2.748658f,
51  -2.315784f, -2.423671f, -2.257283f, -2.269583f, -2.196660f, -2.301076f,
52  -2.646516f, -2.271319f, -2.254366f, -2.300102f, -2.217960f, -2.473300f,
53  -2.116866f, -2.528246f, -3.314712f, -1.701010f, -0.589040f, -0.088077f,
54  0.813112f, 1.702213f, 2.653045f, 3.351749f, 3.243554f, 3.199409f,
55  2.437856f, 1.468854f, 0.533039f, -0.099065f, -0.622643f, -2.200732f,
56  -4.228861f, -2.875263f, -1.273956f, -0.433280f, 0.803771f, 1.975043f,
57  3.179528f, 3.939064f, 3.454379f, 3.689386f, 3.116411f, 1.970991f,
58  0.798406f, -0.628514f, -1.252546f, -2.825176f, -4.090178f, -3.777448f,
59  -3.227314f, -3.479403f, -3.320569f, -3.159372f, -2.729202f, -2.722341f,
60  -3.054913f, -2.742923f, -2.612703f, -2.662632f, -2.907314f, -3.117794f,
61  -3.102660f, -3.970972f, -4.891357f, -3.935582f, -3.347758f, -2.721924f,
62  -2.219011f, -1.702391f, -0.866529f, -0.153743f, 0.107733f, 1.416882f,
63  2.572884f, 3.607755f, 3.974820f, 3.997783f, 2.970459f, 0.791687f,
64  -1.478921f, -1.228154f, -1.216955f, -1.765932f, -1.951003f, -1.985301f,
65  -1.975881f, -1.985593f, -2.422371f, -2.419978f, -2.531288f, -2.951853f,
66  -3.071380f, -3.277027f, -3.373539f, -4.462010f, -0.967888f, 0.805524f,
67  2.794130f, 3.685984f, 3.745195f, 3.252444f, 2.316108f, 1.399146f,
68  -0.136519f, -0.162811f, -1.004357f, -1.667911f, -1.964662f, -2.937579f,
69  -3.019533f, -3.942766f, -5.102767f, -3.882073f, -3.532027f, -3.451956f,
70  -2.944015f, -2.643064f, -2.529872f, -2.077290f, -2.809965f, -1.803734f,
71  -1.783593f, -1.662585f, -1.415484f, -1.392673f, -0.788794f, -1.204819f,
72  -1.998864f, -1.182102f, -0.892110f, -1.317415f, -1.359112f, -1.522867f,
73  -1.468552f, -1.779072f, -2.332959f, -2.160346f, -2.329387f, -2.631259f,
74  -2.744936f, -3.052494f, -2.787363f, -3.442548f, -4.245075f, -3.032172f,
75  -2.061609f, -1.768116f, -1.286072f, -0.706587f, -0.192413f, 0.386938f,
76  0.716997f, 1.481393f, 2.216702f, 2.737986f, 3.109809f, 3.226084f,
77  2.490098f, -0.095827f, -3.864816f, -3.507248f, -3.128925f, -2.908251f,
78  -2.883836f, -2.881411f, -2.524377f, -2.624478f, -2.399573f, -2.367718f,
79  -1.918255f, -1.926277f, -1.694584f, -1.723790f, -0.966491f, -1.183115f,
80  -1.430687f, 0.872896f, 2.766550f, 3.610080f, 3.578041f, 3.334928f,
81  2.586680f, 1.895721f, 1.122195f, 0.488519f, -0.140689f, -0.799076f,
82  -1.222860f, -1.502437f, -1.900969f, -3.206816f,
83 };
84 
85 static const NN_CONFIG av1_intra_hog_model_nnconfig = {
86  BINS, // num_inputs
87  DIRECTIONAL_MODES, // num_outputs
88  0, // num_hidden_layers
89  { 0 },
90  {
91  av1_intra_hog_model_weights,
92  },
93  {
94  av1_intra_hog_model_bias,
95  },
96 };
97 
98 #define FIX_PREC_BITS (16)
99 static AOM_INLINE int get_hist_bin_idx(int dx, int dy) {
100  const int32_t ratio = (dy * (1 << FIX_PREC_BITS)) / dx;
101 
102  // Find index by bisection
103  static const int thresholds[BINS] = {
104  -1334015, -441798, -261605, -183158, -138560, -109331, -88359, -72303,
105  -59392, -48579, -39272, -30982, -23445, -16400, -9715, -3194,
106  3227, 9748, 16433, 23478, 31015, 39305, 48611, 59425,
107  72336, 88392, 109364, 138593, 183191, 261638, 441831, INT32_MAX
108  };
109 
110  int lo_idx = 0, hi_idx = BINS - 1;
111  // Divide into segments of size 8 gives better performance than binary search
112  // here.
113  if (ratio <= thresholds[7]) {
114  lo_idx = 0;
115  hi_idx = 7;
116  } else if (ratio <= thresholds[15]) {
117  lo_idx = 8;
118  hi_idx = 15;
119  } else if (ratio <= thresholds[23]) {
120  lo_idx = 16;
121  hi_idx = 23;
122  } else {
123  lo_idx = 24;
124  hi_idx = 31;
125  }
126 
127  for (int idx = lo_idx; idx <= hi_idx; idx++) {
128  if (ratio <= thresholds[idx]) {
129  return idx;
130  }
131  }
132  assert(0 && "No valid histogram bin found!");
133  return BINS - 1;
134 }
135 #undef FIX_PREC_BITS
136 
137 static AOM_INLINE void generate_hog(const uint8_t *src, int stride, int rows,
138  int cols, float *hist) {
139  float total = 0.1f;
140  src += stride;
141  for (int r = 1; r < rows - 1; ++r) {
142  for (int c = 1; c < cols - 1; ++c) {
143  const uint8_t *above = &src[c - stride];
144  const uint8_t *below = &src[c + stride];
145  const uint8_t *left = &src[c - 1];
146  const uint8_t *right = &src[c + 1];
147  // Calculate gradient using Sobel fitlers.
148  const int dx = (right[-stride] + 2 * right[0] + right[stride]) -
149  (left[-stride] + 2 * left[0] + left[stride]);
150  const int dy = (below[-1] + 2 * below[0] + below[1]) -
151  (above[-1] + 2 * above[0] + above[1]);
152  if (dx == 0 && dy == 0) continue;
153  const int temp = abs(dx) + abs(dy);
154  if (!temp) continue;
155  total += temp;
156  if (dx == 0) {
157  hist[0] += temp / 2;
158  hist[BINS - 1] += temp / 2;
159  } else {
160  const int idx = get_hist_bin_idx(dx, dy);
161  assert(idx >= 0 && idx < BINS);
162  hist[idx] += temp;
163  }
164  }
165  src += stride;
166  }
167 
168  for (int i = 0; i < BINS; ++i) hist[i] /= total;
169 }
170 
171 static AOM_INLINE void generate_hog_hbd(const uint8_t *src8, int stride,
172  int rows, int cols, float *hist) {
173  float total = 0.1f;
174  uint16_t *src = CONVERT_TO_SHORTPTR(src8);
175  src += stride;
176  for (int r = 1; r < rows - 1; ++r) {
177  for (int c = 1; c < cols - 1; ++c) {
178  const uint16_t *above = &src[c - stride];
179  const uint16_t *below = &src[c + stride];
180  const uint16_t *left = &src[c - 1];
181  const uint16_t *right = &src[c + 1];
182  // Calculate gradient using Sobel fitlers.
183  const int dx = (right[-stride] + 2 * right[0] + right[stride]) -
184  (left[-stride] + 2 * left[0] + left[stride]);
185  const int dy = (below[-1] + 2 * below[0] + below[1]) -
186  (above[-1] + 2 * above[0] + above[1]);
187  if (dx == 0 && dy == 0) continue;
188  const int temp = abs(dx) + abs(dy);
189  if (!temp) continue;
190  total += temp;
191  if (dx == 0) {
192  hist[0] += temp / 2;
193  hist[BINS - 1] += temp / 2;
194  } else {
195  const int idx = get_hist_bin_idx(dx, dy);
196  assert(idx >= 0 && idx < BINS);
197  hist[idx] += temp;
198  }
199  }
200  src += stride;
201  }
202 
203  for (int i = 0; i < BINS; ++i) hist[i] /= total;
204 }
205 
206 static INLINE void collect_hog_data(const MACROBLOCK *x, BLOCK_SIZE bsize,
207  int plane, float *hog) {
208  const MACROBLOCKD *xd = &x->e_mbd;
209  const struct macroblockd_plane *const pd = &xd->plane[plane];
210  const int ss_x = pd->subsampling_x;
211  const int ss_y = pd->subsampling_y;
212  const int bh = block_size_high[bsize];
213  const int bw = block_size_wide[bsize];
214  const int rows =
215  ((xd->mb_to_bottom_edge >= 0) ? bh : (xd->mb_to_bottom_edge >> 3) + bh) >>
216  ss_y;
217  const int cols =
218  ((xd->mb_to_right_edge >= 0) ? bw : (xd->mb_to_right_edge >> 3) + bw) >>
219  ss_x;
220  const int src_stride = x->plane[plane].src.stride;
221  const uint8_t *src = x->plane[plane].src.buf;
222  if (is_cur_buf_hbd(xd)) {
223  generate_hog_hbd(src, src_stride, rows, cols, hog);
224  } else {
225  generate_hog(src, src_stride, rows, cols, hog);
226  }
227 
228  // Scale the hog so the luma and chroma are on the same scale
229  for (int b = 0; b < BINS; ++b) {
230  hog[b] *= (1 + ss_x) * (1 + ss_y);
231  }
232 }
233 
234 static AOM_INLINE void prune_intra_mode_with_hog(
235  const MACROBLOCK *x, BLOCK_SIZE bsize, float th,
236  uint8_t *directional_mode_skip_mask, int is_chroma) {
237  aom_clear_system_state();
238 
239  const int plane = is_chroma ? AOM_PLANE_U : AOM_PLANE_Y;
240  float hist[BINS] = { 0.0f };
241  collect_hog_data(x, bsize, plane, hist);
242 
243  // Make prediction for each of the mode
244  float scores[DIRECTIONAL_MODES] = { 0.0f };
245  aom_clear_system_state();
246  av1_nn_predict(hist, &av1_intra_hog_model_nnconfig, 1, scores);
247  for (UV_PREDICTION_MODE uv_mode = UV_V_PRED; uv_mode <= UV_D67_PRED;
248  uv_mode++) {
249  if (scores[uv_mode - UV_V_PRED] <= th) {
250  directional_mode_skip_mask[uv_mode] = 1;
251  }
252  }
253 
254  aom_clear_system_state();
255 }
256 #undef BINS
257 
258 // Returns the cost needed to send a uniformly distributed r.v.
259 static AOM_INLINE int write_uniform_cost(int n, int v) {
260  const int l = get_unsigned_bits(n);
261  const int m = (1 << l) - n;
262  if (l == 0) return 0;
263  if (v < m)
264  return av1_cost_literal(l - 1);
265  else
266  return av1_cost_literal(l);
267 }
274 static AOM_INLINE int intra_mode_info_cost_y(const AV1_COMP *cpi,
275  const MACROBLOCK *x,
276  const MB_MODE_INFO *mbmi,
277  BLOCK_SIZE bsize, int mode_cost) {
278  int total_rate = mode_cost;
279  const ModeCosts *mode_costs = &x->mode_costs;
280  const int use_palette = mbmi->palette_mode_info.palette_size[0] > 0;
281  const int use_filter_intra = mbmi->filter_intra_mode_info.use_filter_intra;
282  const int use_intrabc = mbmi->use_intrabc;
283  // Can only activate one mode.
284  assert(((mbmi->mode != DC_PRED) + use_palette + use_intrabc +
285  use_filter_intra) <= 1);
286  const int try_palette = av1_allow_palette(
288  if (try_palette && mbmi->mode == DC_PRED) {
289  const MACROBLOCKD *xd = &x->e_mbd;
290  const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
291  const int mode_ctx = av1_get_palette_mode_ctx(xd);
292  total_rate +=
293  mode_costs->palette_y_mode_cost[bsize_ctx][mode_ctx][use_palette];
294  if (use_palette) {
295  const uint8_t *const color_map = xd->plane[0].color_index_map;
296  int block_width, block_height, rows, cols;
297  av1_get_block_dimensions(bsize, 0, xd, &block_width, &block_height, &rows,
298  &cols);
299  const int plt_size = mbmi->palette_mode_info.palette_size[0];
300  int palette_mode_cost =
301  mode_costs
302  ->palette_y_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
303  write_uniform_cost(plt_size, color_map[0]);
304  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
305  const int n_cache = av1_get_palette_cache(xd, 0, color_cache);
306  palette_mode_cost +=
307  av1_palette_color_cost_y(&mbmi->palette_mode_info, color_cache,
308  n_cache, cpi->common.seq_params.bit_depth);
309  palette_mode_cost +=
310  av1_cost_color_map(x, 0, bsize, mbmi->tx_size, PALETTE_MAP);
311  total_rate += palette_mode_cost;
312  }
313  }
314  if (av1_filter_intra_allowed(&cpi->common, mbmi)) {
315  total_rate += mode_costs->filter_intra_cost[mbmi->bsize][use_filter_intra];
316  if (use_filter_intra) {
317  total_rate +=
319  .filter_intra_mode];
320  }
321  }
322  if (av1_is_directional_mode(mbmi->mode)) {
323  if (av1_use_angle_delta(bsize)) {
324  total_rate +=
325  mode_costs->angle_delta_cost[mbmi->mode - V_PRED]
326  [MAX_ANGLE_DELTA +
327  mbmi->angle_delta[PLANE_TYPE_Y]];
328  }
329  }
330  if (av1_allow_intrabc(&cpi->common))
331  total_rate += mode_costs->intrabc_cost[use_intrabc];
332  return total_rate;
333 }
334 
339 static AOM_INLINE int intra_mode_info_cost_uv(const AV1_COMP *cpi,
340  const MACROBLOCK *x,
341  const MB_MODE_INFO *mbmi,
342  BLOCK_SIZE bsize, int mode_cost) {
343  int total_rate = mode_cost;
344  const ModeCosts *mode_costs = &x->mode_costs;
345  const int use_palette = mbmi->palette_mode_info.palette_size[1] > 0;
346  const UV_PREDICTION_MODE mode = mbmi->uv_mode;
347  // Can only activate one mode.
348  assert(((mode != UV_DC_PRED) + use_palette + mbmi->use_intrabc) <= 1);
349 
350  const int try_palette = av1_allow_palette(
352  if (try_palette && mode == UV_DC_PRED) {
353  const PALETTE_MODE_INFO *pmi = &mbmi->palette_mode_info;
354  total_rate +=
355  mode_costs->palette_uv_mode_cost[pmi->palette_size[0] > 0][use_palette];
356  if (use_palette) {
357  const int bsize_ctx = av1_get_palette_bsize_ctx(bsize);
358  const int plt_size = pmi->palette_size[1];
359  const MACROBLOCKD *xd = &x->e_mbd;
360  const uint8_t *const color_map = xd->plane[1].color_index_map;
361  int palette_mode_cost =
362  mode_costs
363  ->palette_uv_size_cost[bsize_ctx][plt_size - PALETTE_MIN_SIZE] +
364  write_uniform_cost(plt_size, color_map[0]);
365  uint16_t color_cache[2 * PALETTE_MAX_SIZE];
366  const int n_cache = av1_get_palette_cache(xd, 1, color_cache);
367  palette_mode_cost += av1_palette_color_cost_uv(
368  pmi, color_cache, n_cache, cpi->common.seq_params.bit_depth);
369  palette_mode_cost +=
370  av1_cost_color_map(x, 1, bsize, mbmi->tx_size, PALETTE_MAP);
371  total_rate += palette_mode_cost;
372  }
373  }
374  if (av1_is_directional_mode(get_uv_mode(mode))) {
375  if (av1_use_angle_delta(bsize)) {
376  total_rate +=
377  mode_costs->angle_delta_cost[mode - V_PRED]
378  [mbmi->angle_delta[PLANE_TYPE_UV] +
379  MAX_ANGLE_DELTA];
380  }
381  }
382  return total_rate;
383 }
384 
386 // Makes a quick luma prediction and estimate the rdcost with a model without
387 // going through the whole txfm/quantize/itxfm process.
388 static int64_t intra_model_yrd(const AV1_COMP *const cpi, MACROBLOCK *const x,
389  BLOCK_SIZE bsize, int mode_cost) {
390  const AV1_COMMON *cm = &cpi->common;
391  MACROBLOCKD *const xd = &x->e_mbd;
392  MB_MODE_INFO *const mbmi = xd->mi[0];
393  assert(!is_inter_block(mbmi));
394  RD_STATS this_rd_stats;
395  int row, col;
396  int64_t temp_sse, this_rd;
397  const ModeCosts *mode_costs = &x->mode_costs;
398  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
399  TX_SIZE tx_size =
400  tx_size_from_tx_mode(bsize, txfm_params->tx_mode_search_type);
401  const int stepr = tx_size_high_unit[tx_size];
402  const int stepc = tx_size_wide_unit[tx_size];
403  const int max_blocks_wide = max_block_wide(xd, bsize, 0);
404  const int max_blocks_high = max_block_high(xd, bsize, 0);
405  mbmi->tx_size = tx_size;
406  // Prediction.
407  for (row = 0; row < max_blocks_high; row += stepr) {
408  for (col = 0; col < max_blocks_wide; col += stepc) {
409  av1_predict_intra_block_facade(cm, xd, 0, col, row, tx_size);
410  }
411  }
412  // RD estimation.
413  model_rd_sb_fn[cpi->sf.rt_sf.use_simple_rd_model ? MODELRD_LEGACY
414  : MODELRD_TYPE_INTRA](
415  cpi, bsize, x, xd, 0, 0, &this_rd_stats.rate, &this_rd_stats.dist,
416  &this_rd_stats.skip_txfm, &temp_sse, NULL, NULL, NULL);
417  if (av1_is_directional_mode(mbmi->mode) && av1_use_angle_delta(bsize)) {
418  mode_cost += mode_costs->angle_delta_cost[mbmi->mode - V_PRED]
419  [MAX_ANGLE_DELTA +
420  mbmi->angle_delta[PLANE_TYPE_Y]];
421  }
422  if (mbmi->mode == DC_PRED &&
423  av1_filter_intra_allowed_bsize(cm, mbmi->bsize)) {
424  if (mbmi->filter_intra_mode_info.use_filter_intra) {
425  const int mode = mbmi->filter_intra_mode_info.filter_intra_mode;
426  mode_cost += mode_costs->filter_intra_cost[mbmi->bsize][1] +
427  mode_costs->filter_intra_mode_cost[mode];
428  } else {
429  mode_cost += mode_costs->filter_intra_cost[mbmi->bsize][0];
430  }
431  }
432  this_rd =
433  RDCOST(x->rdmult, this_rd_stats.rate + mode_cost, this_rd_stats.dist);
434  return this_rd;
435 }
448 static AOM_INLINE int model_intra_yrd_and_prune(const AV1_COMP *const cpi,
449  MACROBLOCK *x, BLOCK_SIZE bsize,
450  int mode_info_cost,
451  int64_t *best_model_rd) {
452  const int64_t this_model_rd = intra_model_yrd(cpi, x, bsize, mode_info_cost);
453  if (*best_model_rd != INT64_MAX &&
454  this_model_rd > *best_model_rd + (*best_model_rd >> 1)) {
455  return 1;
456  } else if (this_model_rd < *best_model_rd) {
457  *best_model_rd = this_model_rd;
458  }
459  return 0;
460 }
461 
462 #ifdef __cplusplus
463 } // extern "C"
464 #endif
465 
466 #endif // AOM_AV1_ENCODER_INTRA_MODE_SEARCH_UTILS_H_
#define AOM_PLANE_U
Definition: aom_image.h:200
#define AOM_PLANE_Y
Definition: aom_image.h:199
Declares top-level encoder structures and functions.
static int model_intra_yrd_and_prune(const AV1_COMP *const cpi, MACROBLOCK *x, BLOCK_SIZE bsize, int mode_info_cost, int64_t *best_model_rd)
Estimate the luma rdcost of a given intra mode and try to prune it.
Definition: intra_mode_search_utils.h:448
int av1_palette_color_cost_y(const PALETTE_MODE_INFO *const pmi, const uint16_t *color_cache, int n_cache, int bit_depth)
Gets the rate cost for transmitting luma palette color values.
Definition: palette.c:125
int av1_palette_color_cost_uv(const PALETTE_MODE_INFO *const pmi, const uint16_t *color_cache, int n_cache, int bit_depth)
Gets the rate cost for transmitting luma palette chroma values.
Definition: palette.c:139
static int intra_mode_info_cost_uv(const AV1_COMP *cpi, const MACROBLOCK *x, const MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mode_cost)
Return the rate cost for chroma prediction mode info of intra blocks.
Definition: intra_mode_search_utils.h:339
static int intra_mode_info_cost_y(const AV1_COMP *cpi, const MACROBLOCK *x, const MB_MODE_INFO *mbmi, BLOCK_SIZE bsize, int mode_cost)
Returns the rate cost for luma prediction mode info of intra blocks.
Definition: intra_mode_search_utils.h:274
Declares functions used in palette search.
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:723
SequenceHeader seq_params
Definition: av1_common_int.h:953
FeatureFlags features
Definition: av1_common_int.h:882
Top level encoder structure.
Definition: encoder.h:2042
SPEED_FEATURES sf
Definition: encoder.h:2264
AV1_COMMON common
Definition: encoder.h:2080
bool allow_screen_content_tools
Definition: av1_common_int.h:351
Stores the prediction/txfm mode of the current coding block.
Definition: blockd.h:221
PREDICTION_MODE mode
The prediction mode used.
Definition: blockd.h:231
UV_PREDICTION_MODE uv_mode
The UV mode when intra is used.
Definition: blockd.h:233
PALETTE_MODE_INFO palette_mode_info
Stores the size and colors of palette mode.
Definition: blockd.h:279
int8_t angle_delta[PLANE_TYPES]
Directional mode delta: the angle is base angle + (angle_delta * step).
Definition: blockd.h:271
FILTER_INTRA_MODE_INFO filter_intra_mode_info
The type of filter intra mode used (if applicable).
Definition: blockd.h:273
BLOCK_SIZE bsize
The block size of the current coding block.
Definition: blockd.h:227
TX_SIZE tx_size
Transform size when fixed size txfm is used (e.g. intra modes).
Definition: blockd.h:289
uint8_t use_intrabc
Whether intrabc is used.
Definition: blockd.h:317
Holds the entropy costs for various modes sent to the bitstream.
Definition: block.h:583
int intrabc_cost[2]
intrabc_cost
Definition: block.h:618
int palette_uv_mode_cost[2][2]
palette_uv_mode_cost
Definition: block.h:633
int palette_y_size_cost[7][PALETTE_SIZES]
palette_y_size_cost
Definition: block.h:621
int palette_uv_size_cost[7][PALETTE_SIZES]
palette_uv_size_cost
Definition: block.h:623
int filter_intra_cost[BLOCK_SIZES_ALL][2]
filter_intra_cost
Definition: block.h:603
int filter_intra_mode_cost[FILTER_INTRA_MODES]
filter_intra_mode_cost
Definition: block.h:605
int angle_delta_cost[DIRECTIONAL_MODES][2 *MAX_ANGLE_DELTA+1]
angle_delta_cost
Definition: block.h:607
int palette_y_mode_cost[7][3][2]
palette_y_mode_cost
Definition: block.h:631
REAL_TIME_SPEED_FEATURES rt_sf
Definition: speed_features.h:1128
Defines the parameters used to perform txfm search.
Definition: block.h:425
TX_MODE tx_mode_search_type
How to search for the optimal tx_size.
Definition: block.h:468
struct buf_2d src
A buffer containing the source frame.
Definition: block.h:117
Encoder's parameters related to the current coding block.
Definition: block.h:829
MACROBLOCKD e_mbd
Decoder's view of current coding block.
Definition: block.h:847
ModeCosts mode_costs
The rate needed to signal a mode to the bitstream.
Definition: block.h:942
struct macroblock_plane plane[3]
Each of the encoding plane.
Definition: block.h:839
TxfmSearchParams txfm_search_params
Parameters that control how motion search is done.
Definition: block.h:1168
Variables related to current coding block.
Definition: blockd.h:577
int mb_to_bottom_edge
Definition: blockd.h:687
struct macroblockd_plane plane[3]
Definition: blockd.h:613
int mb_to_right_edge
Definition: blockd.h:685
MB_MODE_INFO ** mi
Definition: blockd.h:624