xref: /aosp_15_r20/external/libaom/av1/encoder/pickcdef.h (revision 77c1e3ccc04c968bd2bc212e87364f250e820521)
1*77c1e3ccSAndroid Build Coastguard Worker /*
2*77c1e3ccSAndroid Build Coastguard Worker  * Copyright (c) 2016, Alliance for Open Media. All rights reserved.
3*77c1e3ccSAndroid Build Coastguard Worker  *
4*77c1e3ccSAndroid Build Coastguard Worker  * This source code is subject to the terms of the BSD 2 Clause License and
5*77c1e3ccSAndroid Build Coastguard Worker  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6*77c1e3ccSAndroid Build Coastguard Worker  * was not distributed with this source code in the LICENSE file, you can
7*77c1e3ccSAndroid Build Coastguard Worker  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8*77c1e3ccSAndroid Build Coastguard Worker  * Media Patent License 1.0 was not distributed with this source code in the
9*77c1e3ccSAndroid Build Coastguard Worker  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10*77c1e3ccSAndroid Build Coastguard Worker  */
11*77c1e3ccSAndroid Build Coastguard Worker #ifndef AOM_AV1_ENCODER_PICKCDEF_H_
12*77c1e3ccSAndroid Build Coastguard Worker #define AOM_AV1_ENCODER_PICKCDEF_H_
13*77c1e3ccSAndroid Build Coastguard Worker 
14*77c1e3ccSAndroid Build Coastguard Worker #include "av1/common/cdef.h"
15*77c1e3ccSAndroid Build Coastguard Worker #include "av1/encoder/speed_features.h"
16*77c1e3ccSAndroid Build Coastguard Worker 
17*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
18*77c1e3ccSAndroid Build Coastguard Worker extern "C" {
19*77c1e3ccSAndroid Build Coastguard Worker #endif
20*77c1e3ccSAndroid Build Coastguard Worker 
21*77c1e3ccSAndroid Build Coastguard Worker /*!\enum CDEF_CONTROL
22*77c1e3ccSAndroid Build Coastguard Worker  * \brief This enum controls to which frames CDEF is applied.
23*77c1e3ccSAndroid Build Coastguard Worker  */
24*77c1e3ccSAndroid Build Coastguard Worker typedef enum {
25*77c1e3ccSAndroid Build Coastguard Worker   CDEF_NONE = 0,      /*!< Disable CDEF on all frames. */
26*77c1e3ccSAndroid Build Coastguard Worker   CDEF_ALL = 1,       /*!< Enable CDEF for all frames. */
27*77c1e3ccSAndroid Build Coastguard Worker   CDEF_REFERENCE = 2, /*!< Disable CDEF on non reference frames. */
28*77c1e3ccSAndroid Build Coastguard Worker } CDEF_CONTROL;
29*77c1e3ccSAndroid Build Coastguard Worker 
30*77c1e3ccSAndroid Build Coastguard Worker /*!\cond */
31*77c1e3ccSAndroid Build Coastguard Worker struct MultiThreadInfo;
32*77c1e3ccSAndroid Build Coastguard Worker 
33*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_PRI_STRENGTHS_LVL1 8
34*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_PRI_STRENGTHS_LVL2 5
35*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_SEC_STRENGTHS_LVL3 2
36*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_SEC_STRENGTHS_LVL5 1
37*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_PRI_STRENGTHS_LVL4 2
38*77c1e3ccSAndroid Build Coastguard Worker 
39*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_TOTAL_STRENGTHS_LVL1 \
40*77c1e3ccSAndroid Build Coastguard Worker   (REDUCED_PRI_STRENGTHS_LVL1 * CDEF_SEC_STRENGTHS)
41*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_TOTAL_STRENGTHS_LVL2 \
42*77c1e3ccSAndroid Build Coastguard Worker   (REDUCED_PRI_STRENGTHS_LVL2 * CDEF_SEC_STRENGTHS)
43*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_TOTAL_STRENGTHS_LVL3 \
44*77c1e3ccSAndroid Build Coastguard Worker   (REDUCED_PRI_STRENGTHS_LVL2 * REDUCED_SEC_STRENGTHS_LVL3)
45*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_TOTAL_STRENGTHS_LVL4 \
46*77c1e3ccSAndroid Build Coastguard Worker   (REDUCED_PRI_STRENGTHS_LVL4 * REDUCED_SEC_STRENGTHS_LVL3)
47*77c1e3ccSAndroid Build Coastguard Worker #define REDUCED_TOTAL_STRENGTHS_LVL5 \
48*77c1e3ccSAndroid Build Coastguard Worker   (REDUCED_PRI_STRENGTHS_LVL4 * REDUCED_SEC_STRENGTHS_LVL5)
49*77c1e3ccSAndroid Build Coastguard Worker #define TOTAL_STRENGTHS (CDEF_PRI_STRENGTHS * CDEF_SEC_STRENGTHS)
50*77c1e3ccSAndroid Build Coastguard Worker 
51*77c1e3ccSAndroid Build Coastguard Worker static const int priconv_lvl1[REDUCED_PRI_STRENGTHS_LVL1] = { 0, 1, 2,  3,
52*77c1e3ccSAndroid Build Coastguard Worker                                                               5, 7, 10, 13 };
53*77c1e3ccSAndroid Build Coastguard Worker static const int priconv_lvl2[REDUCED_PRI_STRENGTHS_LVL2] = { 0, 2, 4, 8, 14 };
54*77c1e3ccSAndroid Build Coastguard Worker static const int priconv_lvl4[REDUCED_PRI_STRENGTHS_LVL4] = { 0, 11 };
55*77c1e3ccSAndroid Build Coastguard Worker static const int priconv_lvl5[REDUCED_PRI_STRENGTHS_LVL4] = { 0, 5 };
56*77c1e3ccSAndroid Build Coastguard Worker static const int secconv_lvl3[REDUCED_SEC_STRENGTHS_LVL3] = { 0, 2 };
57*77c1e3ccSAndroid Build Coastguard Worker static const int secconv_lvl5[REDUCED_SEC_STRENGTHS_LVL5] = { 0 };
58*77c1e3ccSAndroid Build Coastguard Worker static const int nb_cdef_strengths[CDEF_PICK_METHODS] = {
59*77c1e3ccSAndroid Build Coastguard Worker   TOTAL_STRENGTHS,
60*77c1e3ccSAndroid Build Coastguard Worker   REDUCED_TOTAL_STRENGTHS_LVL1,
61*77c1e3ccSAndroid Build Coastguard Worker   REDUCED_TOTAL_STRENGTHS_LVL2,
62*77c1e3ccSAndroid Build Coastguard Worker   REDUCED_TOTAL_STRENGTHS_LVL3,
63*77c1e3ccSAndroid Build Coastguard Worker   REDUCED_TOTAL_STRENGTHS_LVL4,
64*77c1e3ccSAndroid Build Coastguard Worker   REDUCED_TOTAL_STRENGTHS_LVL5,
65*77c1e3ccSAndroid Build Coastguard Worker   TOTAL_STRENGTHS
66*77c1e3ccSAndroid Build Coastguard Worker };
67*77c1e3ccSAndroid Build Coastguard Worker 
68*77c1e3ccSAndroid Build Coastguard Worker typedef void (*copy_fn_t)(uint16_t *dst, int dstride, const uint8_t *src,
69*77c1e3ccSAndroid Build Coastguard Worker                           int src_voffset, int src_hoffset, int sstride,
70*77c1e3ccSAndroid Build Coastguard Worker                           int vsize, int hsize);
71*77c1e3ccSAndroid Build Coastguard Worker typedef uint64_t (*compute_cdef_dist_t)(void *dst, int dstride, uint16_t *src,
72*77c1e3ccSAndroid Build Coastguard Worker                                         cdef_list *dlist, int cdef_count,
73*77c1e3ccSAndroid Build Coastguard Worker                                         BLOCK_SIZE bsize, int coeff_shift,
74*77c1e3ccSAndroid Build Coastguard Worker                                         int row, int col);
75*77c1e3ccSAndroid Build Coastguard Worker 
76*77c1e3ccSAndroid Build Coastguard Worker /*! \brief CDEF search context.
77*77c1e3ccSAndroid Build Coastguard Worker  */
78*77c1e3ccSAndroid Build Coastguard Worker typedef struct {
79*77c1e3ccSAndroid Build Coastguard Worker   /*!
80*77c1e3ccSAndroid Build Coastguard Worker    * Pointer to the frame buffer holding the source frame
81*77c1e3ccSAndroid Build Coastguard Worker    */
82*77c1e3ccSAndroid Build Coastguard Worker   const YV12_BUFFER_CONFIG *ref;
83*77c1e3ccSAndroid Build Coastguard Worker   /*!
84*77c1e3ccSAndroid Build Coastguard Worker    * Pointer to params related to MB_MODE_INFO arrays and related info
85*77c1e3ccSAndroid Build Coastguard Worker    */
86*77c1e3ccSAndroid Build Coastguard Worker   CommonModeInfoParams *mi_params;
87*77c1e3ccSAndroid Build Coastguard Worker   /*!
88*77c1e3ccSAndroid Build Coastguard Worker    * Info specific to each plane
89*77c1e3ccSAndroid Build Coastguard Worker    */
90*77c1e3ccSAndroid Build Coastguard Worker   struct macroblockd_plane plane[MAX_MB_PLANE];
91*77c1e3ccSAndroid Build Coastguard Worker   /*!
92*77c1e3ccSAndroid Build Coastguard Worker    * Function pointer of copy_fn
93*77c1e3ccSAndroid Build Coastguard Worker    */
94*77c1e3ccSAndroid Build Coastguard Worker   copy_fn_t copy_fn;
95*77c1e3ccSAndroid Build Coastguard Worker   /*!
96*77c1e3ccSAndroid Build Coastguard Worker    * Function pointer of compute_cdef_dist_fn
97*77c1e3ccSAndroid Build Coastguard Worker    */
98*77c1e3ccSAndroid Build Coastguard Worker   compute_cdef_dist_t compute_cdef_dist_fn;
99*77c1e3ccSAndroid Build Coastguard Worker   /*!
100*77c1e3ccSAndroid Build Coastguard Worker    *  Number of strenghts evaluated in CDEF filter search
101*77c1e3ccSAndroid Build Coastguard Worker    */
102*77c1e3ccSAndroid Build Coastguard Worker   int total_strengths;
103*77c1e3ccSAndroid Build Coastguard Worker   /*!
104*77c1e3ccSAndroid Build Coastguard Worker    * Bit-depth dependent shift
105*77c1e3ccSAndroid Build Coastguard Worker    */
106*77c1e3ccSAndroid Build Coastguard Worker   int coeff_shift;
107*77c1e3ccSAndroid Build Coastguard Worker   /*!
108*77c1e3ccSAndroid Build Coastguard Worker    * CDEF damping factor
109*77c1e3ccSAndroid Build Coastguard Worker    */
110*77c1e3ccSAndroid Build Coastguard Worker   int damping;
111*77c1e3ccSAndroid Build Coastguard Worker   /*!
112*77c1e3ccSAndroid Build Coastguard Worker    * Search method used to select CDEF parameters
113*77c1e3ccSAndroid Build Coastguard Worker    */
114*77c1e3ccSAndroid Build Coastguard Worker   int pick_method;
115*77c1e3ccSAndroid Build Coastguard Worker   /*!
116*77c1e3ccSAndroid Build Coastguard Worker    * Number of planes
117*77c1e3ccSAndroid Build Coastguard Worker    */
118*77c1e3ccSAndroid Build Coastguard Worker   int num_planes;
119*77c1e3ccSAndroid Build Coastguard Worker   /*!
120*77c1e3ccSAndroid Build Coastguard Worker    * Log2 of width of the MI unit in pixels. mi_wide_l2[i]
121*77c1e3ccSAndroid Build Coastguard Worker    * indicates the width of the MI unit in pixels for the ith plane
122*77c1e3ccSAndroid Build Coastguard Worker    */
123*77c1e3ccSAndroid Build Coastguard Worker   int mi_wide_l2[MAX_MB_PLANE];
124*77c1e3ccSAndroid Build Coastguard Worker   /*!
125*77c1e3ccSAndroid Build Coastguard Worker    * Log2 of height of the MI unit in pixels. mi_high_l2[i]
126*77c1e3ccSAndroid Build Coastguard Worker    * indicates the height of the MI unit in pixels for the ith plane
127*77c1e3ccSAndroid Build Coastguard Worker    */
128*77c1e3ccSAndroid Build Coastguard Worker   int mi_high_l2[MAX_MB_PLANE];
129*77c1e3ccSAndroid Build Coastguard Worker   /*!
130*77c1e3ccSAndroid Build Coastguard Worker    * Subsampling in x direction. xdec[i] indicates the subsampling
131*77c1e3ccSAndroid Build Coastguard Worker    * for the ith plane
132*77c1e3ccSAndroid Build Coastguard Worker    */
133*77c1e3ccSAndroid Build Coastguard Worker   int xdec[MAX_MB_PLANE];
134*77c1e3ccSAndroid Build Coastguard Worker   /*!
135*77c1e3ccSAndroid Build Coastguard Worker    * Subsampling in y direction. ydec[i] indicates the subsampling
136*77c1e3ccSAndroid Build Coastguard Worker    * for the ith plane
137*77c1e3ccSAndroid Build Coastguard Worker    */
138*77c1e3ccSAndroid Build Coastguard Worker   int ydec[MAX_MB_PLANE];
139*77c1e3ccSAndroid Build Coastguard Worker   /*!
140*77c1e3ccSAndroid Build Coastguard Worker    * bsize[i] indicates the block size of ith plane
141*77c1e3ccSAndroid Build Coastguard Worker    */
142*77c1e3ccSAndroid Build Coastguard Worker   int bsize[MAX_MB_PLANE];
143*77c1e3ccSAndroid Build Coastguard Worker   /*!
144*77c1e3ccSAndroid Build Coastguard Worker    * Number of 64x64 blocks in vertical direction of a frame
145*77c1e3ccSAndroid Build Coastguard Worker    */
146*77c1e3ccSAndroid Build Coastguard Worker   int nvfb;
147*77c1e3ccSAndroid Build Coastguard Worker   /*!
148*77c1e3ccSAndroid Build Coastguard Worker    * Number of 64x64 blocks in horizontal direction of a frame
149*77c1e3ccSAndroid Build Coastguard Worker    */
150*77c1e3ccSAndroid Build Coastguard Worker   int nhfb;
151*77c1e3ccSAndroid Build Coastguard Worker   /*!
152*77c1e3ccSAndroid Build Coastguard Worker    * Pointer to the mean squared error between the CDEF filtered block and the
153*77c1e3ccSAndroid Build Coastguard Worker    * source block. mse[i][j][k] stores the MSE of the ith plane (i=0 corresponds
154*77c1e3ccSAndroid Build Coastguard Worker    * to Y-plane, i=1 corresponds to U and V planes), jth block and kth strength
155*77c1e3ccSAndroid Build Coastguard Worker    * index
156*77c1e3ccSAndroid Build Coastguard Worker    */
157*77c1e3ccSAndroid Build Coastguard Worker   uint64_t (*mse[2])[TOTAL_STRENGTHS];
158*77c1e3ccSAndroid Build Coastguard Worker   /*!
159*77c1e3ccSAndroid Build Coastguard Worker    * Holds the position (in units of mi's) of the cdef filtered
160*77c1e3ccSAndroid Build Coastguard Worker    * block in raster scan order
161*77c1e3ccSAndroid Build Coastguard Worker    */
162*77c1e3ccSAndroid Build Coastguard Worker   int *sb_index;
163*77c1e3ccSAndroid Build Coastguard Worker   /*!
164*77c1e3ccSAndroid Build Coastguard Worker    * Holds the count of cdef filtered blocks
165*77c1e3ccSAndroid Build Coastguard Worker    */
166*77c1e3ccSAndroid Build Coastguard Worker   int sb_count;
167*77c1e3ccSAndroid Build Coastguard Worker   /*!
168*77c1e3ccSAndroid Build Coastguard Worker    * Indicates if 16bit frame buffers are to be used i.e., the content bit-depth
169*77c1e3ccSAndroid Build Coastguard Worker    * is > 8-bit
170*77c1e3ccSAndroid Build Coastguard Worker    */
171*77c1e3ccSAndroid Build Coastguard Worker   bool use_highbitdepth;
172*77c1e3ccSAndroid Build Coastguard Worker } CdefSearchCtx;
173*77c1e3ccSAndroid Build Coastguard Worker 
sb_all_skip(const CommonModeInfoParams * const mi_params,int mi_row,int mi_col)174*77c1e3ccSAndroid Build Coastguard Worker static inline int sb_all_skip(const CommonModeInfoParams *const mi_params,
175*77c1e3ccSAndroid Build Coastguard Worker                               int mi_row, int mi_col) {
176*77c1e3ccSAndroid Build Coastguard Worker   const int maxr = AOMMIN(mi_params->mi_rows - mi_row, MI_SIZE_64X64);
177*77c1e3ccSAndroid Build Coastguard Worker   const int maxc = AOMMIN(mi_params->mi_cols - mi_col, MI_SIZE_64X64);
178*77c1e3ccSAndroid Build Coastguard Worker   const int stride = mi_params->mi_stride;
179*77c1e3ccSAndroid Build Coastguard Worker   MB_MODE_INFO **mbmi = mi_params->mi_grid_base + mi_row * stride + mi_col;
180*77c1e3ccSAndroid Build Coastguard Worker   for (int r = 0; r < maxr; ++r, mbmi += stride) {
181*77c1e3ccSAndroid Build Coastguard Worker     for (int c = 0; c < maxc; ++c) {
182*77c1e3ccSAndroid Build Coastguard Worker       if (!mbmi[c]->skip_txfm) return 0;
183*77c1e3ccSAndroid Build Coastguard Worker     }
184*77c1e3ccSAndroid Build Coastguard Worker   }
185*77c1e3ccSAndroid Build Coastguard Worker   return 1;
186*77c1e3ccSAndroid Build Coastguard Worker }
187*77c1e3ccSAndroid Build Coastguard Worker 
188*77c1e3ccSAndroid Build Coastguard Worker // Checks if cdef processing can be skipped for particular sb.
189*77c1e3ccSAndroid Build Coastguard Worker // Inputs:
190*77c1e3ccSAndroid Build Coastguard Worker //   cdef_search_ctx: Pointer to the structure containing parameters related to
191*77c1e3ccSAndroid Build Coastguard Worker //   CDEF search context.
192*77c1e3ccSAndroid Build Coastguard Worker //   fbr: Row index in units of 64x64 block
193*77c1e3ccSAndroid Build Coastguard Worker //   fbc: Column index in units of 64x64 block
194*77c1e3ccSAndroid Build Coastguard Worker // Returns:
195*77c1e3ccSAndroid Build Coastguard Worker //   1/0 will be returned to indicate skip/don't skip cdef processing of sb
196*77c1e3ccSAndroid Build Coastguard Worker //   respectively.
cdef_sb_skip(const CommonModeInfoParams * const mi_params,int fbr,int fbc)197*77c1e3ccSAndroid Build Coastguard Worker static inline int cdef_sb_skip(const CommonModeInfoParams *const mi_params,
198*77c1e3ccSAndroid Build Coastguard Worker                                int fbr, int fbc) {
199*77c1e3ccSAndroid Build Coastguard Worker   const MB_MODE_INFO *const mbmi =
200*77c1e3ccSAndroid Build Coastguard Worker       mi_params->mi_grid_base[MI_SIZE_64X64 * fbr * mi_params->mi_stride +
201*77c1e3ccSAndroid Build Coastguard Worker                               MI_SIZE_64X64 * fbc];
202*77c1e3ccSAndroid Build Coastguard Worker   // No filtering if the entire filter block is skipped.
203*77c1e3ccSAndroid Build Coastguard Worker   if (sb_all_skip(mi_params, fbr * MI_SIZE_64X64, fbc * MI_SIZE_64X64))
204*77c1e3ccSAndroid Build Coastguard Worker     return 1;
205*77c1e3ccSAndroid Build Coastguard Worker   // Skip odd numbered 64x64 block rows(cols) when bsize is BLOCK_128X128,
206*77c1e3ccSAndroid Build Coastguard Worker   // BLOCK_64X128(BLOCK_128X128, BLOCK_128X64) as for such blocks CDEF filtering
207*77c1e3ccSAndroid Build Coastguard Worker   // is done at the corresponding block sizes.
208*77c1e3ccSAndroid Build Coastguard Worker   if (((fbc & 1) &&
209*77c1e3ccSAndroid Build Coastguard Worker        (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_128X64)) ||
210*77c1e3ccSAndroid Build Coastguard Worker       ((fbr & 1) &&
211*77c1e3ccSAndroid Build Coastguard Worker        (mbmi->bsize == BLOCK_128X128 || mbmi->bsize == BLOCK_64X128)))
212*77c1e3ccSAndroid Build Coastguard Worker     return 1;
213*77c1e3ccSAndroid Build Coastguard Worker   return 0;
214*77c1e3ccSAndroid Build Coastguard Worker }
215*77c1e3ccSAndroid Build Coastguard Worker 
216*77c1e3ccSAndroid Build Coastguard Worker void av1_cdef_dealloc_data(CdefSearchCtx *cdef_search_ctx);
217*77c1e3ccSAndroid Build Coastguard Worker 
218*77c1e3ccSAndroid Build Coastguard Worker void av1_cdef_mse_calc_block(CdefSearchCtx *cdef_search_ctx,
219*77c1e3ccSAndroid Build Coastguard Worker                              struct aom_internal_error_info *error_info,
220*77c1e3ccSAndroid Build Coastguard Worker                              int fbr, int fbc, int sb_count);
221*77c1e3ccSAndroid Build Coastguard Worker /*!\endcond */
222*77c1e3ccSAndroid Build Coastguard Worker 
223*77c1e3ccSAndroid Build Coastguard Worker /*!\brief AV1 CDEF parameter search
224*77c1e3ccSAndroid Build Coastguard Worker  *
225*77c1e3ccSAndroid Build Coastguard Worker  * \ingroup in_loop_cdef
226*77c1e3ccSAndroid Build Coastguard Worker  *
227*77c1e3ccSAndroid Build Coastguard Worker  * Searches for optimal CDEF parameters for frame
228*77c1e3ccSAndroid Build Coastguard Worker  *
229*77c1e3ccSAndroid Build Coastguard Worker  * \param[in,out]  cpi                 Top level encoder structure
230*77c1e3ccSAndroid Build Coastguard Worker  *
231*77c1e3ccSAndroid Build Coastguard Worker  * \remark Nothing is returned. Instead, optimal CDEF parameters are stored
232*77c1e3ccSAndroid Build Coastguard Worker  * in the \c cdef_info structure of type \ref CdefInfo inside \c cm:
233*77c1e3ccSAndroid Build Coastguard Worker  * \arg \c cdef_bits: Bits of strength parameters
234*77c1e3ccSAndroid Build Coastguard Worker  * \arg \c nb_cdef_strengths: Number of strength parameters
235*77c1e3ccSAndroid Build Coastguard Worker  * \arg \c cdef_strengths: list of \c nb_cdef_strengths strength parameters
236*77c1e3ccSAndroid Build Coastguard Worker  * for the luma plane.
237*77c1e3ccSAndroid Build Coastguard Worker  * \arg \c uv_cdef_strengths: list of \c nb_cdef_strengths strength parameters
238*77c1e3ccSAndroid Build Coastguard Worker  * for the chroma planes.
239*77c1e3ccSAndroid Build Coastguard Worker  * \arg \c damping_factor: CDEF damping factor.
240*77c1e3ccSAndroid Build Coastguard Worker  *
241*77c1e3ccSAndroid Build Coastguard Worker  */
242*77c1e3ccSAndroid Build Coastguard Worker void av1_cdef_search(struct AV1_COMP *cpi);
243*77c1e3ccSAndroid Build Coastguard Worker 
244*77c1e3ccSAndroid Build Coastguard Worker /*!\brief AV1 CDEF level from QP
245*77c1e3ccSAndroid Build Coastguard Worker  *
246*77c1e3ccSAndroid Build Coastguard Worker  * \ingroup in_loop_cdef
247*77c1e3ccSAndroid Build Coastguard Worker  *
248*77c1e3ccSAndroid Build Coastguard Worker  * Calculates CDEF levels from frame QP. Only used for speed 7+ with RT mode.
249*77c1e3ccSAndroid Build Coastguard Worker  *
250*77c1e3ccSAndroid Build Coastguard Worker  * \param[in,out]  cm                 Pointer to top level common structure
251*77c1e3ccSAndroid Build Coastguard Worker  * \param[in]      skip_cdef          Flag to skip CDEF filtering
252*77c1e3ccSAndroid Build Coastguard Worker  * \param[in]      is_screen_content  Flag indicating screen content
253*77c1e3ccSAndroid Build Coastguard Worker  *
254*77c1e3ccSAndroid Build Coastguard Worker  */
255*77c1e3ccSAndroid Build Coastguard Worker void av1_pick_cdef_from_qp(AV1_COMMON *const cm, int skip_cdef,
256*77c1e3ccSAndroid Build Coastguard Worker                            int is_screen_content);
257*77c1e3ccSAndroid Build Coastguard Worker 
258*77c1e3ccSAndroid Build Coastguard Worker #ifdef __cplusplus
259*77c1e3ccSAndroid Build Coastguard Worker }  // extern "C"
260*77c1e3ccSAndroid Build Coastguard Worker #endif
261*77c1e3ccSAndroid Build Coastguard Worker #endif  // AOM_AV1_ENCODER_PICKCDEF_H_
262