11#ifndef AOM_AV1_ENCODER_PICKCDEF_H_
12#define AOM_AV1_ENCODER_PICKCDEF_H_
14#include "av1/common/cdef.h"
34#define REDUCED_PRI_STRENGTHS_LVL1 8
35#define REDUCED_PRI_STRENGTHS_LVL2 5
36#define REDUCED_SEC_STRENGTHS_LVL3 2
37#define REDUCED_SEC_STRENGTHS_LVL5 1
38#define REDUCED_PRI_STRENGTHS_LVL4 2
40#define REDUCED_TOTAL_STRENGTHS_LVL1 \
41 (REDUCED_PRI_STRENGTHS_LVL1 * CDEF_SEC_STRENGTHS)
42#define REDUCED_TOTAL_STRENGTHS_LVL2 \
43 (REDUCED_PRI_STRENGTHS_LVL2 * CDEF_SEC_STRENGTHS)
44#define REDUCED_TOTAL_STRENGTHS_LVL3 \
45 (REDUCED_PRI_STRENGTHS_LVL2 * REDUCED_SEC_STRENGTHS_LVL3)
46#define REDUCED_TOTAL_STRENGTHS_LVL4 \
47 (REDUCED_PRI_STRENGTHS_LVL4 * REDUCED_SEC_STRENGTHS_LVL3)
48#define REDUCED_TOTAL_STRENGTHS_LVL5 \
49 (REDUCED_PRI_STRENGTHS_LVL4 * REDUCED_SEC_STRENGTHS_LVL5)
50#define TOTAL_STRENGTHS (CDEF_PRI_STRENGTHS * CDEF_SEC_STRENGTHS)
52static const int priconv_lvl1[REDUCED_PRI_STRENGTHS_LVL1] = { 0, 1, 2, 3,
54static const int priconv_lvl2[REDUCED_PRI_STRENGTHS_LVL2] = { 0, 2, 4, 8, 14 };
55static const int priconv_lvl4[REDUCED_PRI_STRENGTHS_LVL4] = { 0, 11 };
56static const int priconv_lvl5[REDUCED_PRI_STRENGTHS_LVL4] = { 0, 5 };
57static const int secconv_lvl3[REDUCED_SEC_STRENGTHS_LVL3] = { 0, 2 };
58static const int secconv_lvl5[REDUCED_SEC_STRENGTHS_LVL5] = { 0 };
59static const int nb_cdef_strengths[CDEF_PICK_METHODS] = {
61 REDUCED_TOTAL_STRENGTHS_LVL1,
62 REDUCED_TOTAL_STRENGTHS_LVL2,
63 REDUCED_TOTAL_STRENGTHS_LVL3,
64 REDUCED_TOTAL_STRENGTHS_LVL4,
65 REDUCED_TOTAL_STRENGTHS_LVL5,
69typedef void (*copy_fn_t)(uint16_t *dst,
int dstride,
const uint8_t *src,
70 int src_voffset,
int src_hoffset,
int sstride,
71 int vsize,
int hsize);
72typedef uint64_t (*compute_cdef_dist_t)(
void *dst,
int dstride, uint16_t *src,
73 cdef_list *dlist,
int cdef_count,
74 BLOCK_SIZE bsize,
int coeff_shift,
83 const YV12_BUFFER_CONFIG *ref;
87 CommonModeInfoParams *mi_params;
91 struct macroblockd_plane plane[MAX_MB_PLANE];
99 compute_cdef_dist_t compute_cdef_dist_fn;
124 int mi_wide_l2[MAX_MB_PLANE];
129 int mi_high_l2[MAX_MB_PLANE];
134 int xdec[MAX_MB_PLANE];
139 int ydec[MAX_MB_PLANE];
143 int bsize[MAX_MB_PLANE];
158 uint64_t (*mse[2])[TOTAL_STRENGTHS];
172 bool use_highbitdepth;
176 int mi_row,
int mi_col) {
177 const int maxr = AOMMIN(mi_params->
mi_rows - mi_row, MI_SIZE_64X64);
178 const int maxc = AOMMIN(mi_params->
mi_cols - mi_col, MI_SIZE_64X64);
181 for (
int r = 0; r < maxr; ++r, mbmi += stride) {
182 for (
int c = 0; c < maxc; ++c) {
183 if (!mbmi[c]->skip_txfm)
return 0;
202 MI_SIZE_64X64 * fbc];
204 if (sb_all_skip(mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64))
210 (mbmi->
bsize == BLOCK_128X128 || mbmi->
bsize == BLOCK_128X64)) ||
212 (mbmi->
bsize == BLOCK_128X128 || mbmi->
bsize == BLOCK_64X128)))
217void av1_cdef_dealloc_data(CdefSearchCtx *cdef_search_ctx);
219void av1_cdef_mse_calc_block(CdefSearchCtx *cdef_search_ctx,
220 struct aom_internal_error_info *error_info,
221 int fbr,
int fbc,
int sb_count);
257 int is_screen_content);
void av1_cdef_search(struct AV1_COMP *cpi)
AV1 CDEF parameter search.
void av1_pick_cdef_from_qp(AV1_COMMON *const cm, int skip_cdef, int is_screen_content)
AV1 CDEF level from QP.
Top level encoder structure.
Definition encoder.h:2878
Params related to MB_MODE_INFO arrays and related info.
Definition av1_common_int.h:508
int mi_rows
Definition av1_common_int.h:529
int mi_cols
Definition av1_common_int.h:534
int mi_stride
Definition av1_common_int.h:574
MB_MODE_INFO ** mi_grid_base
Definition av1_common_int.h:566
Stores the prediction/txfm mode of the current coding block.
Definition blockd.h:222
BLOCK_SIZE bsize
The block size of the current coding block.
Definition blockd.h:228
Encoder parameters related to multi-threading.
Definition encoder.h:1753