tables.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*****************************************************************************
  2. * tables.h: const tables
  3. *****************************************************************************
  4. * Copyright (C) 2003-2018 x264 project
  5. *
  6. * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  7. * Loren Merritt <lorenm@u.washington.edu>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA.
  22. *
  23. * This program is also available under a commercial proprietary license.
  24. * For more information, contact us at licensing@x264.com.
  25. *****************************************************************************/
  26. #ifndef X264_TABLES_H
  27. #define X264_TABLES_H
  28. typedef struct
  29. {
  30. uint8_t i_bits;
  31. uint8_t i_size;
  32. } vlc_t;
  33. extern const x264_level_t x264_levels[];
  34. extern const uint8_t x264_exp2_lut[64];
  35. extern const float x264_log2_lut[128];
  36. extern const float x264_log2_lz_lut[32];
  37. #define QP_MAX_MAX (51+6*2+18)
  38. extern const uint16_t x264_lambda_tab[QP_MAX_MAX+1];
  39. extern const int x264_lambda2_tab[QP_MAX_MAX+1];
  40. extern const int x264_trellis_lambda2_tab[2][QP_MAX_MAX+1];
  41. #define MAX_CHROMA_LAMBDA_OFFSET 36
  42. extern const uint16_t x264_chroma_lambda2_offset_tab[MAX_CHROMA_LAMBDA_OFFSET+1];
  43. extern const uint8_t x264_hpel_ref0[16];
  44. extern const uint8_t x264_hpel_ref1[16];
  45. extern const uint8_t x264_cqm_jvt4i[16];
  46. extern const uint8_t x264_cqm_jvt4p[16];
  47. extern const uint8_t x264_cqm_jvt8i[64];
  48. extern const uint8_t x264_cqm_jvt8p[64];
  49. extern const uint8_t x264_cqm_flat16[64];
  50. extern const uint8_t * const x264_cqm_jvt[8];
  51. extern const uint8_t x264_cqm_avci50_4ic[16];
  52. extern const uint8_t x264_cqm_avci50_p_8iy[64];
  53. extern const uint8_t x264_cqm_avci50_1080i_8iy[64];
  54. extern const uint8_t x264_cqm_avci100_720p_4ic[16];
  55. extern const uint8_t x264_cqm_avci100_720p_8iy[64];
  56. extern const uint8_t x264_cqm_avci100_1080_4ic[16];
  57. extern const uint8_t x264_cqm_avci100_1080i_8iy[64];
  58. extern const uint8_t x264_cqm_avci100_1080p_8iy[64];
  59. extern const uint8_t x264_decimate_table4[16];
  60. extern const uint8_t x264_decimate_table8[64];
  61. extern const uint32_t x264_dct4_weight_tab[16];
  62. extern const uint32_t x264_dct8_weight_tab[64];
  63. extern const uint32_t x264_dct4_weight2_tab[16];
  64. extern const uint32_t x264_dct8_weight2_tab[64];
  65. extern const int8_t x264_cabac_context_init_I[1024][2];
  66. extern const int8_t x264_cabac_context_init_PB[3][1024][2];
  67. extern const uint8_t x264_cabac_range_lps[64][4];
  68. extern const uint8_t x264_cabac_transition[128][2];
  69. extern const uint8_t x264_cabac_renorm_shift[64];
  70. extern const uint16_t x264_cabac_entropy[128];
  71. extern const uint8_t x264_significant_coeff_flag_offset_8x8[2][64];
  72. extern const uint8_t x264_last_coeff_flag_offset_8x8[63];
  73. extern const uint8_t x264_coeff_flag_offset_chroma_422_dc[7];
  74. extern const uint16_t x264_significant_coeff_flag_offset[2][16];
  75. extern const uint16_t x264_last_coeff_flag_offset[2][16];
  76. extern const uint16_t x264_coeff_abs_level_m1_offset[16];
  77. extern const uint8_t x264_count_cat_m1[14];
  78. extern const vlc_t x264_coeff0_token[6];
  79. extern const vlc_t x264_coeff_token[6][16][4];
  80. extern const vlc_t x264_total_zeros[15][16];
  81. extern const vlc_t x264_total_zeros_2x2_dc[3][4];
  82. extern const vlc_t x264_total_zeros_2x4_dc[7][8];
  83. extern const vlc_t x264_run_before_init[7][16];
  84. extern uint8_t x264_zero[1024];
  85. #endif