/src/aom/av1/common/quant_common.h
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 | | #ifndef AOM_AV1_COMMON_QUANT_COMMON_H_ |
13 | | #define AOM_AV1_COMMON_QUANT_COMMON_H_ |
14 | | |
15 | | #include <stdbool.h> |
16 | | #include "aom/aom_codec.h" |
17 | | #include "av1/common/seg_common.h" |
18 | | #include "av1/common/enums.h" |
19 | | #include "av1/common/entropy.h" |
20 | | |
21 | | #ifdef __cplusplus |
22 | | extern "C" { |
23 | | #endif |
24 | | |
25 | 656k | #define MINQ 0 |
26 | 5.24M | #define MAXQ 255 |
27 | 656k | #define QINDEX_RANGE (MAXQ - MINQ + 1) |
28 | 1.26k | #define QINDEX_BITS 8 |
29 | | // Total number of QM sets stored |
30 | 1.73M | #define QM_LEVEL_BITS 4 |
31 | 1.73M | #define NUM_QM_LEVELS (1 << QM_LEVEL_BITS) |
32 | | /* Range of QMS is between first and last value, with offset applied to inter |
33 | | * blocks*/ |
34 | | #define DEFAULT_QM_Y 10 |
35 | | #define DEFAULT_QM_U 11 |
36 | | #define DEFAULT_QM_V 12 |
37 | | #define DEFAULT_QM_FIRST 5 |
38 | | #define DEFAULT_QM_LAST 9 |
39 | 0 | #define LOSSLESS_Q_STEP 4 // this should equal to dc/ac_qlookup_QTX[0] |
40 | | |
41 | | struct AV1Common; |
42 | | struct CommonQuantParams; |
43 | | struct macroblockd; |
44 | | |
45 | | int16_t av1_dc_quant_QTX(int qindex, int delta, aom_bit_depth_t bit_depth); |
46 | | int16_t av1_ac_quant_QTX(int qindex, int delta, aom_bit_depth_t bit_depth); |
47 | | |
48 | | int av1_get_qindex(const struct segmentation *seg, int segment_id, |
49 | | int base_qindex); |
50 | | |
51 | | // Returns true if we are using quantization matrix. |
52 | | bool av1_use_qmatrix(const struct CommonQuantParams *quant_params, |
53 | | const struct macroblockd *xd, int segment_id); |
54 | | |
55 | | // Reduce the large number of quantizers to a smaller number of levels for which |
56 | | // different matrices may be defined |
57 | 2.52k | static INLINE int aom_get_qmlevel(int qindex, int first, int last) { |
58 | 2.52k | return first + (qindex * (last + 1 - first)) / QINDEX_RANGE; |
59 | 2.52k | } Unexecuted instantiation: av1_dx_iface.c:aom_get_qmlevel Unexecuted instantiation: decodeframe.c:aom_get_qmlevel Unexecuted instantiation: decodemv.c:aom_get_qmlevel Unexecuted instantiation: decoder.c:aom_get_qmlevel Unexecuted instantiation: decodetxb.c:aom_get_qmlevel Unexecuted instantiation: detokenize.c:aom_get_qmlevel Unexecuted instantiation: obu.c:aom_get_qmlevel Unexecuted instantiation: av1_cx_iface.c:aom_get_qmlevel av1_quantize.c:aom_get_qmlevel Line | Count | Source | 57 | 2.52k | static INLINE int aom_get_qmlevel(int qindex, int first, int last) { | 58 | 2.52k | return first + (qindex * (last + 1 - first)) / QINDEX_RANGE; | 59 | 2.52k | } |
Unexecuted instantiation: bitstream.c:aom_get_qmlevel Unexecuted instantiation: encodemv.c:aom_get_qmlevel Unexecuted instantiation: encoder.c:aom_get_qmlevel Unexecuted instantiation: encoder_utils.c:aom_get_qmlevel Unexecuted instantiation: encodetxb.c:aom_get_qmlevel Unexecuted instantiation: ethread.c:aom_get_qmlevel Unexecuted instantiation: firstpass.c:aom_get_qmlevel Unexecuted instantiation: global_motion_facade.c:aom_get_qmlevel Unexecuted instantiation: hash_motion.c:aom_get_qmlevel Unexecuted instantiation: level.c:aom_get_qmlevel Unexecuted instantiation: lookahead.c:aom_get_qmlevel Unexecuted instantiation: mcomp.c:aom_get_qmlevel Unexecuted instantiation: mv_prec.c:aom_get_qmlevel Unexecuted instantiation: palette.c:aom_get_qmlevel Unexecuted instantiation: pass2_strategy.c:aom_get_qmlevel Unexecuted instantiation: pickcdef.c:aom_get_qmlevel Unexecuted instantiation: picklpf.c:aom_get_qmlevel Unexecuted instantiation: pickrst.c:aom_get_qmlevel Unexecuted instantiation: ratectrl.c:aom_get_qmlevel Unexecuted instantiation: rd.c:aom_get_qmlevel Unexecuted instantiation: rdopt.c:aom_get_qmlevel Unexecuted instantiation: reconinter_enc.c:aom_get_qmlevel Unexecuted instantiation: segmentation.c:aom_get_qmlevel Unexecuted instantiation: speed_features.c:aom_get_qmlevel Unexecuted instantiation: superres_scale.c:aom_get_qmlevel Unexecuted instantiation: svc_layercontext.c:aom_get_qmlevel Unexecuted instantiation: temporal_filter.c:aom_get_qmlevel Unexecuted instantiation: thirdpass.c:aom_get_qmlevel Unexecuted instantiation: tokenize.c:aom_get_qmlevel Unexecuted instantiation: tpl_model.c:aom_get_qmlevel Unexecuted instantiation: tx_search.c:aom_get_qmlevel Unexecuted instantiation: txb_rdopt.c:aom_get_qmlevel Unexecuted instantiation: intra_mode_search.c:aom_get_qmlevel Unexecuted instantiation: var_based_part.c:aom_get_qmlevel Unexecuted instantiation: av1_noise_estimate.c:aom_get_qmlevel Unexecuted instantiation: dwt.c:aom_get_qmlevel Unexecuted instantiation: aom_dsp_rtcd.c:aom_get_qmlevel Unexecuted instantiation: av1_rtcd.c:aom_get_qmlevel Unexecuted instantiation: aom_convolve.c:aom_get_qmlevel Unexecuted instantiation: blend_a64_mask.c:aom_get_qmlevel Unexecuted instantiation: avg.c:aom_get_qmlevel Unexecuted instantiation: blk_sse_sum.c:aom_get_qmlevel Unexecuted instantiation: noise_util.c:aom_get_qmlevel Unexecuted instantiation: psnr.c:aom_get_qmlevel Unexecuted instantiation: sad.c:aom_get_qmlevel Unexecuted instantiation: sad_av1.c:aom_get_qmlevel Unexecuted instantiation: sse.c:aom_get_qmlevel Unexecuted instantiation: sum_squares.c:aom_get_qmlevel Unexecuted instantiation: variance.c:aom_get_qmlevel Unexecuted instantiation: alloccommon.c:aom_get_qmlevel Unexecuted instantiation: av1_loopfilter.c:aom_get_qmlevel Unexecuted instantiation: blockd.c:aom_get_qmlevel Unexecuted instantiation: cdef.c:aom_get_qmlevel Unexecuted instantiation: cdef_block.c:aom_get_qmlevel Unexecuted instantiation: cfl.c:aom_get_qmlevel Unexecuted instantiation: debugmodes.c:aom_get_qmlevel Unexecuted instantiation: entropy.c:aom_get_qmlevel Unexecuted instantiation: entropymode.c:aom_get_qmlevel Unexecuted instantiation: entropymv.c:aom_get_qmlevel Unexecuted instantiation: idct.c:aom_get_qmlevel Unexecuted instantiation: mvref_common.c:aom_get_qmlevel Unexecuted instantiation: pred_common.c:aom_get_qmlevel Unexecuted instantiation: quant_common.c:aom_get_qmlevel Unexecuted instantiation: reconinter.c:aom_get_qmlevel Unexecuted instantiation: reconintra.c:aom_get_qmlevel Unexecuted instantiation: resize.c:aom_get_qmlevel Unexecuted instantiation: restoration.c:aom_get_qmlevel Unexecuted instantiation: scale.c:aom_get_qmlevel Unexecuted instantiation: scan.c:aom_get_qmlevel Unexecuted instantiation: seg_common.c:aom_get_qmlevel Unexecuted instantiation: thread_common.c:aom_get_qmlevel Unexecuted instantiation: tile_common.c:aom_get_qmlevel Unexecuted instantiation: txb_common.c:aom_get_qmlevel Unexecuted instantiation: warped_motion.c:aom_get_qmlevel Unexecuted instantiation: aq_complexity.c:aom_get_qmlevel Unexecuted instantiation: aq_cyclicrefresh.c:aom_get_qmlevel Unexecuted instantiation: aq_variance.c:aom_get_qmlevel Unexecuted instantiation: allintra_vis.c:aom_get_qmlevel Unexecuted instantiation: av1_fwd_txfm2d.c:aom_get_qmlevel Unexecuted instantiation: compound_type.c:aom_get_qmlevel Unexecuted instantiation: context_tree.c:aom_get_qmlevel Unexecuted instantiation: encodeframe.c:aom_get_qmlevel Unexecuted instantiation: encodeframe_utils.c:aom_get_qmlevel Unexecuted instantiation: encodemb.c:aom_get_qmlevel Unexecuted instantiation: encode_strategy.c:aom_get_qmlevel Unexecuted instantiation: global_motion.c:aom_get_qmlevel Unexecuted instantiation: gop_structure.c:aom_get_qmlevel Unexecuted instantiation: hybrid_fwd_txfm.c:aom_get_qmlevel Unexecuted instantiation: interp_search.c:aom_get_qmlevel Unexecuted instantiation: ml.c:aom_get_qmlevel Unexecuted instantiation: motion_search_facade.c:aom_get_qmlevel Unexecuted instantiation: partition_search.c:aom_get_qmlevel Unexecuted instantiation: partition_strategy.c:aom_get_qmlevel Unexecuted instantiation: nonrd_pickmode.c:aom_get_qmlevel Unexecuted instantiation: wedge_utils.c:aom_get_qmlevel Unexecuted instantiation: blend_a64_hmask.c:aom_get_qmlevel Unexecuted instantiation: blend_a64_vmask.c:aom_get_qmlevel Unexecuted instantiation: intrapred.c:aom_get_qmlevel Unexecuted instantiation: loopfilter.c:aom_get_qmlevel Unexecuted instantiation: subtract.c:aom_get_qmlevel Unexecuted instantiation: fwd_txfm.c:aom_get_qmlevel Unexecuted instantiation: av1_inv_txfm2d.c:aom_get_qmlevel Unexecuted instantiation: av1_txfm.c:aom_get_qmlevel Unexecuted instantiation: convolve.c:aom_get_qmlevel Unexecuted instantiation: av1_fwd_txfm1d.c:aom_get_qmlevel Unexecuted instantiation: cnn.c:aom_get_qmlevel Unexecuted instantiation: corner_match.c:aom_get_qmlevel Unexecuted instantiation: av1_inv_txfm1d.c:aom_get_qmlevel |
60 | | |
61 | | // Initialize all global quant/dequant matrices. |
62 | | void av1_qm_init(struct CommonQuantParams *quant_params, int num_planes); |
63 | | |
64 | | // Get global dequant matrix. |
65 | | const qm_val_t *av1_iqmatrix(const struct CommonQuantParams *quant_params, |
66 | | int qmlevel, int plane, TX_SIZE tx_size); |
67 | | // Get global quant matrix. |
68 | | const qm_val_t *av1_qmatrix(const struct CommonQuantParams *quant_params, |
69 | | int qmlevel, int plane, TX_SIZE tx_size); |
70 | | |
71 | | // Get either local / global dequant matrix as appropriate. |
72 | | const qm_val_t *av1_get_iqmatrix(const struct CommonQuantParams *quant_params, |
73 | | const struct macroblockd *xd, int plane, |
74 | | TX_SIZE tx_size, TX_TYPE tx_type); |
75 | | // Get either local / global quant matrix as appropriate. |
76 | | const qm_val_t *av1_get_qmatrix(const struct CommonQuantParams *quant_params, |
77 | | const struct macroblockd *xd, int plane, |
78 | | TX_SIZE tx_size, TX_TYPE tx_type); |
79 | | |
80 | | #ifdef __cplusplus |
81 | | } // extern "C" |
82 | | #endif |
83 | | |
84 | | #endif // AOM_AV1_COMMON_QUANT_COMMON_H_ |