1 /* 2 * Copyright © 2018-2021, VideoLAN and dav1d authors 3 * Copyright © 2018, Two Orioles, LLC 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice, this 10 * list of conditions and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice, 13 * this list of conditions and the following disclaimer in the documentation 14 * and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28 #ifndef DAV1D_SRC_TABLES_H 29 #define DAV1D_SRC_TABLES_H 30 31 #include <stdint.h> 32 33 #include "common/intops.h" 34 35 #include "src/levels.h" 36 37 EXTERN const uint8_t dav1d_al_part_ctx[2][N_BL_LEVELS][N_PARTITIONS]; 38 EXTERN const uint8_t /* enum BlockSize */ 39 dav1d_block_sizes[N_BL_LEVELS][N_PARTITIONS][2]; 40 // width, height (in 4px blocks), log2 versions of these two 41 EXTERN const uint8_t dav1d_block_dimensions[N_BS_SIZES][4]; 42 typedef struct TxfmInfo { 43 // width, height (in 4px blocks), log2 of them, min/max of log2, sub, pad 44 uint8_t w, h, lw, lh, min, max, sub, ctx; 45 } TxfmInfo; 46 EXTERN const TxfmInfo dav1d_txfm_dimensions[N_RECT_TX_SIZES]; 47 EXTERN const uint8_t /* enum (Rect)TxfmSize */ 48 dav1d_max_txfm_size_for_bs[N_BS_SIZES][4 /* y, 420, 422, 444 */]; 49 EXTERN const uint8_t /* enum TxfmType */ 50 dav1d_txtp_from_uvmode[N_UV_INTRA_PRED_MODES]; 51 52 EXTERN const uint8_t /* enum InterPredMode */ 53 dav1d_comp_inter_pred_modes[N_COMP_INTER_PRED_MODES][2]; 54 55 EXTERN const uint8_t dav1d_partition_type_count[N_BL_LEVELS]; 56 EXTERN const uint8_t /* enum TxfmType */ dav1d_tx_types_per_set[40]; 57 58 EXTERN const uint8_t dav1d_filter_mode_to_y_mode[5]; 59 EXTERN const uint8_t dav1d_ymode_size_context[N_BS_SIZES]; 60 EXTERN const uint8_t dav1d_lo_ctx_offsets[3][5][5]; 61 EXTERN const uint8_t dav1d_skip_ctx[5][5]; 62 EXTERN const uint8_t /* enum TxClass */ 63 dav1d_tx_type_class[N_TX_TYPES_PLUS_LL]; 64 EXTERN const uint8_t /* enum Filter2d */ 65 dav1d_filter_2d[DAV1D_N_FILTERS /* h */][DAV1D_N_FILTERS /* v */]; 66 EXTERN const uint8_t /* enum Dav1dFilterMode */ dav1d_filter_dir[N_2D_FILTERS][2]; 67 EXTERN const uint8_t dav1d_intra_mode_context[N_INTRA_PRED_MODES]; 68 EXTERN const uint8_t dav1d_wedge_ctx_lut[N_BS_SIZES]; 69 70 static const unsigned cfl_allowed_mask = 71 (1 << BS_32x32) | 72 (1 << BS_32x16) | 73 (1 << BS_32x8) | 74 (1 << BS_16x32) | 75 (1 << BS_16x16) | 76 (1 << BS_16x8) | 77 (1 << BS_16x4) | 78 (1 << BS_8x32) | 79 (1 << BS_8x16) | 80 (1 << BS_8x8) | 81 (1 << BS_8x4) | 82 (1 << BS_4x16) | 83 (1 << BS_4x8) | 84 (1 << BS_4x4); 85 86 static const unsigned wedge_allowed_mask = 87 (1 << BS_32x32) | 88 (1 << BS_32x16) | 89 (1 << BS_32x8) | 90 (1 << BS_16x32) | 91 (1 << BS_16x16) | 92 (1 << BS_16x8) | 93 (1 << BS_8x32) | 94 (1 << BS_8x16) | 95 (1 << BS_8x8); 96 97 static const unsigned interintra_allowed_mask = 98 (1 << BS_32x32) | 99 (1 << BS_32x16) | 100 (1 << BS_16x32) | 101 (1 << BS_16x16) | 102 (1 << BS_16x8) | 103 (1 << BS_8x16) | 104 (1 << BS_8x8); 105 106 EXTERN const Dav1dWarpedMotionParams dav1d_default_wm_params; 107 108 EXTERN const int8_t dav1d_cdef_directions[12][2]; 109 110 EXTERN const uint16_t dav1d_sgr_params[16][2]; 111 EXTERN const uint8_t dav1d_sgr_x_by_x[256]; 112 113 EXTERN const int8_t dav1d_mc_subpel_filters[6][15][8]; 114 EXTERN const int8_t dav1d_mc_warp_filter[193][8]; 115 EXTERN const int8_t dav1d_resize_filter[64][8]; 116 117 EXTERN const uint8_t dav1d_sm_weights[128]; 118 EXTERN const uint16_t dav1d_dr_intra_derivative[44]; 119 EXTERN const int8_t dav1d_filter_intra_taps[5][64]; 120 121 EXTERN const uint8_t dav1d_obmc_masks[64]; 122 123 EXTERN const int16_t dav1d_gaussian_sequence[2048]; // for fgs 124 125 #endif /* DAV1D_SRC_TABLES_H */ 126