| 1 |
/* |
| 2 |
* Copyright @ 2017 Intel Corporation |
| 3 |
* |
| 4 |
* Permission is hereby granted, free of charge, to any person obtaining a |
| 5 |
* copy of this software and associated documentation files (the |
| 6 |
* "Software"), to deal in the Software without restriction, including |
| 7 |
* without limitation the rights to use, copy, modify, merge, publish, |
| 8 |
* distribute, sub license, and/or sell copies of the Software, and to |
| 9 |
* permit persons to whom the Software is furnished to do so, subject to |
| 10 |
* the following conditions: |
| 11 |
* |
| 12 |
* The above copyright notice and this permission notice (including the |
| 13 |
* next paragraph) shall be included in all copies or substantial portions |
| 14 |
* of the Software. |
| 15 |
* |
| 16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 17 |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 18 |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. |
| 19 |
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR |
| 20 |
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 21 |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 22 |
* SOFTWAR OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 23 |
* |
| 24 |
* Authors: |
| 25 |
* Pengfei Qu <[email protected]> |
| 26 |
* Sreerenj Balachandran <[email protected]> |
| 27 |
* |
| 28 |
*/ |
| 29 |
|
| 30 |
#ifndef I965_AVC_const_DEF_H |
| 31 |
#define I965_AVC_const_DEF_H |
| 32 |
|
| 33 |
#include <stdio.h> |
| 34 |
#include <stdlib.h> |
| 35 |
#include <stdint.h> |
| 36 |
#include <stdbool.h> |
| 37 |
|
| 38 |
#define GEN9_AVC_NUM_REF_CHECK_WIDTH 3840 |
| 39 |
#define GEN9_AVC_NUM_REF_CHECK_HEIGHT 2160 |
| 40 |
#define GEN9_AVC_MBENC_CURBE_SIZE 88 |
| 41 |
#define GEN9_AVC_FEI_MBENC_CURBE_SIZE 104 |
| 42 |
#define GEN9_AVC_PREPROC_CURBE_SIZE 49 |
| 43 |
#define AVC_QP_MAX 52 |
| 44 |
#define PRESET_NUM 8 |
| 45 |
#define GEN95_AVC_MAX_LAMBDA 0xEFFF |
| 46 |
#define GEN95_AVC_DEFAULT_TRELLIS_QUANT_INTRA_ROUNDING 5 |
| 47 |
|
| 48 |
#define GEN8_AVC_MBENC_CURBE_SIZE 96 |
| 49 |
#define GEN8_AVC_ME_CURBE_SIZE 39 |
| 50 |
|
| 51 |
extern const char gen9_avc_sfd_cost_table_p_frame[AVC_QP_MAX]; |
| 52 |
extern const char gen9_avc_sfd_cost_table_b_frame[AVC_QP_MAX]; |
| 53 |
|
| 54 |
extern const unsigned int gen9_avc_old_intra_mode_cost[AVC_QP_MAX]; |
| 55 |
extern const unsigned int gen9_avc_mv_cost_p_skip_adjustment[AVC_QP_MAX]; |
| 56 |
extern const unsigned short gen9_avc_skip_value_p[2][2][64]; |
| 57 |
extern const unsigned short gen9_avc_skip_value_b[2][2][64]; |
| 58 |
|
| 59 |
// QP is from 0 - 51, pad it to 64 since BRC needs array size to be 64 bytes |
| 60 |
extern const unsigned char gen9_avc_adaptive_intra_scaling_factor[64]; |
| 61 |
extern const unsigned char gen9_avc_intra_scaling_factor[64]; |
| 62 |
// AVC MBEnc CURBE init data |
| 63 |
extern const unsigned int gen9_avc_mbenc_curbe_normal_i_frame_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 64 |
extern const unsigned int gen9_avc_mbenc_curbe_normal_p_frame_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 65 |
extern const unsigned int gen9_avc_mbenc_curbe_normal_b_frame_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 66 |
// AVC I_DIST CURBE init data |
| 67 |
extern const unsigned int gen9_avc_mbenc_curbe_i_frame_dist_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 68 |
// AVC ME CURBE init data |
| 69 |
extern const unsigned int gen9_avc_me_curbe_init_data[39]; |
| 70 |
//extern const unsigned int gen9_avc_brc_init_reset_curbe_init_data[24]; |
| 71 |
//extern const unsigned int gen9_avc_frame_brc_update_curbe_init_data[16]; |
| 72 |
//extern const unsigned int gen9_avc_mb_brc_update_curbe_init_data[7]; |
| 73 |
extern const unsigned int gen75_avc_mode_mv_cost_table[3][52][8]; |
| 74 |
extern const unsigned int gen9_avc_mode_mv_cost_table[3][52][8]; |
| 75 |
extern const unsigned char gen75_avc_qp_adjustment_dist_threshold_max_frame_threshold_dist_qp_adjustment_ipb[576]; |
| 76 |
extern const unsigned char gen9_avc_qp_adjustment_dist_threshold_max_frame_threshold_dist_qp_adjustment_ipb[576]; |
| 77 |
// SkipVal (DW offset 9) in the following table needs to be changed by Driver based on the BlockbasedSkip and Transform Flag. |
| 78 |
// Kernel indexes this table based on the MB QP. |
| 79 |
extern const unsigned int gen9_avc_mb_brc_const_data[3][AVC_QP_MAX][16]; |
| 80 |
extern const unsigned short gen9_avc_ref_cost[3][64]; |
| 81 |
|
| 82 |
// |
| 83 |
extern const bool gen9_avc_mbbrc_enable[PRESET_NUM]; |
| 84 |
extern const unsigned int gen9_avc_super_hme[PRESET_NUM]; |
| 85 |
extern const unsigned int gen9_avc_ultra_hme[PRESET_NUM]; |
| 86 |
|
| 87 |
// 1 for P, 3 for P & B |
| 88 |
extern const unsigned int gen9_avc_all_fractional[PRESET_NUM]; |
| 89 |
extern const unsigned char gen9_avc_max_ref_id0_progressive_4k[PRESET_NUM]; |
| 90 |
extern const unsigned char gen9_avc_max_ref_id0[PRESET_NUM]; |
| 91 |
extern const unsigned char gen9_avc_max_b_ref_id0[PRESET_NUM]; |
| 92 |
extern const unsigned char gen9_avc_max_ref_id1[PRESET_NUM]; |
| 93 |
extern const unsigned int gen9_avc_inter_rounding_p[PRESET_NUM]; |
| 94 |
extern const unsigned int gen9_avc_inter_rounding_b_ref[PRESET_NUM]; |
| 95 |
extern const unsigned int gen9_avc_inter_rounding_b[PRESET_NUM]; |
| 96 |
// This applies only for progressive pictures. For interlaced, CAF is currently not disabled. |
| 97 |
extern const unsigned int gen9_avc_disable_all_fractional_check_for_high_res[PRESET_NUM]; |
| 98 |
extern const unsigned char gen9_avc_adaptive_inter_rounding_p[AVC_QP_MAX]; |
| 99 |
extern const unsigned char gen9_avc_adaptive_inter_rounding_b[AVC_QP_MAX]; |
| 100 |
extern const unsigned char gen9_avc_adaptive_inter_rounding_p_without_b[AVC_QP_MAX]; |
| 101 |
extern const unsigned int gen9_avc_trellis_quantization_enable[PRESET_NUM]; |
| 102 |
extern const unsigned int gen9_avc_trellis_quantization_rounding[PRESET_NUM]; |
| 103 |
extern const unsigned int gen9_avc_enable_adaptive_trellis_quantization[PRESET_NUM]; |
| 104 |
|
| 105 |
//new add |
| 106 |
extern const unsigned int gen9_avc_super_combine_dist[PRESET_NUM + 1]; |
| 107 |
extern const unsigned char gen9_avc_p_me_method[PRESET_NUM + 1]; |
| 108 |
extern const unsigned char gen9_avc_b_me_method[PRESET_NUM + 1]; |
| 109 |
extern const unsigned int gen9_avc_enable_adaptive_search[PRESET_NUM]; |
| 110 |
extern const unsigned int gen9_avc_max_len_sp[PRESET_NUM]; |
| 111 |
extern const unsigned int gen9_avc_max_ftq_based_skip[PRESET_NUM]; |
| 112 |
extern const unsigned int gen9_avc_mr_disable_qp_check[PRESET_NUM]; |
| 113 |
extern const unsigned int gen9_avc_multi_pred[PRESET_NUM]; |
| 114 |
extern const unsigned int gen9_avc_hme_b_combine_len[PRESET_NUM]; |
| 115 |
extern const unsigned int gen9_avc_hme_combine_len[PRESET_NUM]; |
| 116 |
|
| 117 |
extern const unsigned int gen9_avc_search_x[PRESET_NUM]; |
| 118 |
extern const unsigned int gen9_avc_search_y[PRESET_NUM]; |
| 119 |
extern const unsigned int gen9_avc_b_search_x[PRESET_NUM]; |
| 120 |
extern const unsigned int gen9_avc_b_search_y[PRESET_NUM]; |
| 121 |
extern const unsigned char gen9_avc_enable_adaptive_tx_decision[PRESET_NUM]; |
| 122 |
extern const unsigned char gen9_avc_kernel_mode[PRESET_NUM]; |
| 123 |
|
| 124 |
/*==== GEN9 (SKL) AVC FEI specific constants ====*/ |
| 125 |
|
| 126 |
/* GEN9 AVC FEI MBEnc CURBE init data */ |
| 127 |
extern const unsigned int gen9_avc_fei_mbenc_curbe_i_frame_init_data[GEN9_AVC_FEI_MBENC_CURBE_SIZE]; |
| 128 |
extern const unsigned int gen9_avc_fei_mbenc_curbe_p_frame_init_data[GEN9_AVC_FEI_MBENC_CURBE_SIZE]; |
| 129 |
extern const unsigned int gen9_avc_fei_mbenc_curbe_b_frame_init_data[GEN9_AVC_FEI_MBENC_CURBE_SIZE]; |
| 130 |
extern const unsigned int gen9_avc_fei_mbenc_curbe_i_frame_dist_init_data[GEN9_AVC_FEI_MBENC_CURBE_SIZE]; |
| 131 |
|
| 132 |
/* GEN9 AVC PreEnc CURBE init data */ |
| 133 |
extern const unsigned int gen9_avc_preenc_preproc_curbe_i_frame_init_data [GEN9_AVC_PREPROC_CURBE_SIZE]; |
| 134 |
extern const unsigned int gen9_avc_preenc_preproc_curbe_p_frame_init_data [GEN9_AVC_PREPROC_CURBE_SIZE]; |
| 135 |
extern const unsigned int gen9_avc_preenc_preproc_curbe_b_frame_init_data [GEN9_AVC_PREPROC_CURBE_SIZE]; |
| 136 |
|
| 137 |
/* GEN9 AVC PreProc FTQ Lut Butter init data */ |
| 138 |
extern const unsigned int gen9_avc_preenc_preproc_ftq_lut [AVC_QP_MAX][16]; |
| 139 |
|
| 140 |
/* Gen95 */ |
| 141 |
extern const unsigned int gen95_avc_trellis_quantization_rounding[PRESET_NUM]; |
| 142 |
extern const unsigned int gen95_avc_mbenc_curbe_normal_i_frame_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 143 |
extern const unsigned int gen95_avc_mbenc_curbe_normal_p_frame_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 144 |
extern const unsigned int gen95_avc_mbenc_curbe_normal_b_frame_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 145 |
extern const unsigned int gen95_avc_mbenc_curbe_i_frame_dist_init_data[GEN9_AVC_MBENC_CURBE_SIZE]; |
| 146 |
extern const unsigned int gen95_avc_tq_lambda_i_frame[AVC_QP_MAX][2]; |
| 147 |
extern const unsigned int gen95_avc_tq_lambda_p_frame[AVC_QP_MAX][2]; |
| 148 |
extern const unsigned int gen95_avc_tq_lambda_b_frame[AVC_QP_MAX][2]; |
| 149 |
extern const unsigned short gen95_avc_lambda_data[256]; |
| 150 |
extern const unsigned char gen95_avc_ftq25[64]; |
| 151 |
|
| 152 |
/* gen8 */ |
| 153 |
extern const unsigned int gen8_avc_mbenc_curbe_i_frame_dist_init_data[GEN8_AVC_MBENC_CURBE_SIZE]; |
| 154 |
extern const unsigned int gen8_avc_mbenc_curbe_normal_i_frame_init_data[GEN8_AVC_MBENC_CURBE_SIZE]; |
| 155 |
extern const unsigned int gen8_avc_mbenc_curbe_normal_p_frame_init_data[GEN8_AVC_MBENC_CURBE_SIZE]; |
| 156 |
extern const unsigned int gen8_avc_mbenc_curbe_normal_b_frame_init_data[GEN8_AVC_MBENC_CURBE_SIZE]; |
| 157 |
extern const unsigned int gen8_avc_me_curbe_init_data[GEN8_AVC_ME_CURBE_SIZE]; |
| 158 |
extern const unsigned short gen8_avc_ref_cost[3][64]; |
| 159 |
#endif //I965_AVC_const_DEF_H |