1 /* 2 * Copyright 2021 Rockchip Electronics Co. LTD 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #ifndef AV1_ENTROPYMODE_H_ 18 #define AV1_ENTROPYMODE_H_ 19 20 #include "av1d_common.h" 21 22 #define DEFAULT_COMP_INTRA_PROB 32 23 24 #define AV1_DEF_INTERINTRA_PROB 248 25 #define AV1_UPD_INTERINTRA_PROB 192 26 #define SEPARATE_INTERINTRA_UV 0 27 28 typedef RK_U8 av1_prob; 29 30 extern const RK_S8 av1hwd_intra_mode_tree[]; 31 32 extern const av1_prob av1_kf_default_bmode_probs[AV1_INTRA_MODES] 33 [AV1_INTRA_MODES] 34 [AV1_INTRA_MODES - 1]; 35 36 extern const RK_S8 av1hwd_intra_mode_tree[]; 37 38 extern const RK_S8 av1_sb_mv_ref_tree[]; 39 40 /* probability models for partition information */ 41 extern const RK_S8 av1hwd_partition_tree[]; 42 // extern struct av1_token av1_partition_encodings[PARTITION_TYPES]; 43 // extern const av1_prob av1_partition_probs[NUM_FRAME_TYPES] 44 // [NUM_PARTITION_CONTEXTS] 45 // [PARTITION_TYPES]; 46 47 void Av1EntropyModeInit(void); 48 void AV1SetDefaultCDFs(AV1CDFs *cdfs, MvCDFs *cdfs_ndvc); 49 void Av1DefaultCoeffProbs(RK_U32 base_qindex, void *ptr); 50 struct AV1Common; 51 52 // void Av1InitMbmodeProbs(struct Av1Decoder *x); 53 54 // extern void Av1InitModeContexts(struct Av1Decoder *pc); 55 56 extern const enum InterpolationFilterType av1hwd_switchable_interp[AV1_SWITCHABLE_FILTERS]; 57 58 extern const int av1hwd_switchable_interp_map[SWITCHABLE + 1]; 59 60 extern const RK_S8 av1hwd_switchable_interp_tree[2 * (AV1_SWITCHABLE_FILTERS - 1)]; 61 62 // extern struct av1_token av1hwd_switchable_interp_encodings[AV1_SWITCHABLE_FILTERS]; 63 64 extern const av1_prob av1hwd_switchable_interp_prob[AV1_SWITCHABLE_FILTERS + 1][AV1_SWITCHABLE_FILTERS - 1]; 65 66 extern const av1_prob av1_default_tx_probs_32x32p[TX_SIZE_CONTEXTS] [TX_SIZE_MAX_SB - 1]; 67 extern const av1_prob av1_default_tx_probs_16x16p[TX_SIZE_CONTEXTS] [TX_SIZE_MAX_SB - 2]; 68 extern const av1_prob av1_default_tx_probs_8x8p[TX_SIZE_CONTEXTS] [TX_SIZE_MAX_SB - 3]; 69 70 extern const av1_prob av1_default_intra_ext_tx_prob[EXT_TX_SIZES][TX_TYPES] [TX_TYPES - 1]; 71 extern const av1_prob av1_default_inter_ext_tx_prob[EXT_TX_SIZES][TX_TYPES - 1]; 72 73 extern const RK_S8 av1_segment_tree[]; 74 75 #endif 76