/work/svt-av1/Source/Lib/Codec/rd_cost.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright(c) 2019 Intel Corporation |
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 https://www.aomedia.org/license/software-license. 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 https://www.aomedia.org/license/patent-license. |
10 | | */ |
11 | | |
12 | | #ifndef EbRateDistortionCost_h |
13 | | #define EbRateDistortionCost_h |
14 | | |
15 | | /*************************************** |
16 | | * Includes |
17 | | ***************************************/ |
18 | | #include "md_process.h" |
19 | | #include "enc_intra_prediction.h" |
20 | | #include "enc_inter_prediction.h" |
21 | | #include "lambda_rate_tables.h" |
22 | | #include "transforms.h" |
23 | | #include "enc_dec_process.h" |
24 | | #include "entropy_coding.h" |
25 | | |
26 | | #ifdef __cplusplus |
27 | | extern "C" { |
28 | | #endif |
29 | | uint64_t svt_av1_cost_coeffs_txb(ModeDecisionContext* ctx, uint8_t allow_update_cdf, FRAME_CONTEXT* ec_ctx, |
30 | | ModeDecisionCandidateBuffer* cand_bf, const TranLow* const qcoeff, uint16_t eob, |
31 | | PlaneType plane_type, TxSize transform_size, TxType transform_type, |
32 | | int16_t txb_skip_ctx, int16_t dc_sign_ctx, bool reduced_transform_set_flag); |
33 | | void svt_aom_coding_loop_context_generation(PictureControlSet* pcs, ModeDecisionContext* ctx); |
34 | 4.11M | #define RDDIV_BITS 7 |
35 | | |
36 | | #define RDCOST(RM, R, D) \ |
37 | 4.11M | (ROUND_POWER_OF_TWO(((int64_t)(R)) * ((int64_t)(RM)), AV1_PROB_COST_SHIFT) + \ |
38 | 4.11M | ((int64_t)(D) * ((int64_t)1 << RDDIV_BITS))) |
39 | | |
40 | | int64_t svt_aom_partition_rate_cost(PictureParentControlSet* pcs, const BlockSize bsize, const int mi_row, |
41 | | const int mi_col, MdRateEstimationContext* md_rate_est_ctx, PartitionType p, |
42 | | const PartitionContextType left_ctx, const PartitionContextType above_ctx); |
43 | | uint64_t svt_aom_get_intra_uv_fast_rate(PictureControlSet* pcs, ModeDecisionContext* ctx, |
44 | | ModeDecisionCandidateBuffer* cand_bf, bool use_accurate_cfl); |
45 | | uint64_t svt_aom_intra_fast_cost(PictureControlSet* pcs, ModeDecisionContext* ctx, ModeDecisionCandidateBuffer* cand_bf, |
46 | | uint64_t lambda, uint64_t luma_distortion); |
47 | | uint64_t svt_aom_inter_fast_cost(PictureControlSet* pcs, ModeDecisionContext* ctx, ModeDecisionCandidateBuffer* cand_bf, |
48 | | uint64_t lambda, uint64_t luma_distortion); |
49 | | EbErrorType svt_aom_full_cost_light_pd0(ModeDecisionContext* ctx, ModeDecisionCandidateBuffer* cand_bf, |
50 | | uint64_t* y_distortion, uint64_t lambda, uint64_t* y_coeff_bits); |
51 | | void svt_aom_full_cost(PictureControlSet* pcs, ModeDecisionContext* ctx, ModeDecisionCandidateBuffer* cand_bf, |
52 | | uint64_t lambda, uint64_t y_distortion[DIST_TOTAL][DIST_CALC_TOTAL], |
53 | | uint64_t cb_distortion[DIST_TOTAL][DIST_CALC_TOTAL], |
54 | | uint64_t cr_distortion[DIST_TOTAL][DIST_CALC_TOTAL], uint64_t* y_coeff_bits, |
55 | | uint64_t* cb_coeff_bits, uint64_t* cr_coeff_bits); |
56 | | uint64_t svt_aom_tx_size_bits(PictureControlSet* pcs, uint8_t segment_id, MdRateEstimationContext* md_rate_est_ctx, |
57 | | MacroBlockD* xd, const MbModeInfo* mbmi, TxSize tx_size, TxMode tx_mode, BlockSize bsize, |
58 | | uint8_t skip, FRAME_CONTEXT* ec_ctx, uint8_t allow_update_cdf); |
59 | | |
60 | | uint64_t svt_aom_get_tx_size_bits(ModeDecisionCandidateBuffer* candidateBuffer, ModeDecisionContext* ctx, |
61 | | PictureControlSet* pcs, uint8_t tx_depth, bool block_has_coeff); |
62 | | |
63 | | MvJointType svt_av1_get_mv_joint(const Mv* mv); |
64 | | int32_t svt_av1_mv_bit_cost(const Mv* mv, const Mv* ref, const int32_t* mvjcost, const int32_t* const mvcost[2], |
65 | | int32_t weight); |
66 | | int32_t svt_av1_mv_bit_cost_light(const Mv* mv, const Mv* ref); |
67 | | int32_t svt_aom_get_switchable_rate(BlockModeInfo* block_mi, const FrameHeader* const frm_hdr, ModeDecisionContext* ctx, |
68 | | const bool enable_dual_filter); |
69 | | |
70 | | // The MD version of this function omits the skip_mode check. If IFS is selected, skip_mode will be disabled. |
71 | 0 | static INLINE int32_t av1_is_interp_needed_md(BlockModeInfo* block_mi, PictureControlSet* pcs, BlockSize bsize) { |
72 | | /*Disable check on skip_mode_allowed (i.e. skip_mode). If IFS is selected, skip_mode will be |
73 | | * disabled.*/ |
74 | 0 | if (block_mi->motion_mode == WARPED_CAUSAL) { |
75 | 0 | return 0; |
76 | 0 | } |
77 | | |
78 | 0 | if (svt_aom_is_nontrans_global_motion(block_mi, bsize, pcs->ppcs)) { |
79 | 0 | return 0; |
80 | 0 | } |
81 | | |
82 | 0 | return 1; |
83 | 0 | } Unexecuted instantiation: av1me.c:av1_is_interp_needed_md Unexecuted instantiation: enc_cdef.c:av1_is_interp_needed_md Unexecuted instantiation: enc_dec_process.c:av1_is_interp_needed_md Unexecuted instantiation: enc_inter_prediction.c:av1_is_interp_needed_md Unexecuted instantiation: enc_mode_config.c:av1_is_interp_needed_md Unexecuted instantiation: entropy_coding.c:av1_is_interp_needed_md Unexecuted instantiation: full_loop.c:av1_is_interp_needed_md Unexecuted instantiation: md_rate_estimation.c:av1_is_interp_needed_md Unexecuted instantiation: mode_decision.c:av1_is_interp_needed_md Unexecuted instantiation: product_coding_loop.c:av1_is_interp_needed_md Unexecuted instantiation: rc_process.c:av1_is_interp_needed_md Unexecuted instantiation: rd_cost.c:av1_is_interp_needed_md Unexecuted instantiation: src_ops_process.c:av1_is_interp_needed_md Unexecuted instantiation: coding_loop.c:av1_is_interp_needed_md Unexecuted instantiation: mcomp.c:av1_is_interp_needed_md |
84 | | |
85 | 0 | static INLINE uint8_t av1_drl_ctx(const CandidateMv* ref_mv_stack, int32_t ref_idx) { |
86 | 0 | return ref_mv_stack[ref_idx].weight >= REF_CAT_LEVEL ? ref_mv_stack[ref_idx + 1].weight >= REF_CAT_LEVEL ? 0 : 1 |
87 | 0 | : ref_mv_stack[ref_idx + 1].weight < REF_CAT_LEVEL ? 2 |
88 | 0 | : 0; |
89 | 0 | } Unexecuted instantiation: av1me.c:av1_drl_ctx Unexecuted instantiation: enc_cdef.c:av1_drl_ctx Unexecuted instantiation: enc_dec_process.c:av1_drl_ctx Unexecuted instantiation: enc_inter_prediction.c:av1_drl_ctx Unexecuted instantiation: enc_mode_config.c:av1_drl_ctx Unexecuted instantiation: entropy_coding.c:av1_drl_ctx Unexecuted instantiation: full_loop.c:av1_drl_ctx Unexecuted instantiation: md_rate_estimation.c:av1_drl_ctx Unexecuted instantiation: mode_decision.c:av1_drl_ctx Unexecuted instantiation: product_coding_loop.c:av1_drl_ctx Unexecuted instantiation: rc_process.c:av1_drl_ctx Unexecuted instantiation: rd_cost.c:av1_drl_ctx Unexecuted instantiation: src_ops_process.c:av1_drl_ctx Unexecuted instantiation: coding_loop.c:av1_drl_ctx |
90 | | |
91 | | // Transform end of block bit estimation |
92 | | int get_eob_cost(int eob, const LvMapEobCost* txb_eob_costs, const LvMapCoeffCost* txb_costs, TxClass tx_class); |
93 | | #ifdef __cplusplus |
94 | | } |
95 | | #endif |
96 | | #endif //EbRateDistortionCost_h |