set.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. /*****************************************************************************
  2. * set.h: quantization init
  3. *****************************************************************************
  4. * Copyright (C) 2003-2018 x264 project
  5. *
  6. * Authors: Loren Merritt <lorenm@u.washington.edu>
  7. * Laurent Aimar <fenrir@via.ecp.fr>
  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_SET_H
  27. #define X264_SET_H
  28. enum cqm4_e
  29. {
  30. CQM_4IY = 0,
  31. CQM_4PY = 1,
  32. CQM_4IC = 2,
  33. CQM_4PC = 3
  34. };
  35. enum cqm8_e
  36. {
  37. CQM_8IY = 0,
  38. CQM_8PY = 1,
  39. CQM_8IC = 2,
  40. CQM_8PC = 3,
  41. };
  42. typedef struct
  43. {
  44. int i_id;
  45. int i_profile_idc;
  46. int i_level_idc;
  47. int b_constraint_set0;
  48. int b_constraint_set1;
  49. int b_constraint_set2;
  50. int b_constraint_set3;
  51. int i_log2_max_frame_num;
  52. int i_poc_type;
  53. /* poc 0 */
  54. int i_log2_max_poc_lsb;
  55. int i_num_ref_frames;
  56. int b_gaps_in_frame_num_value_allowed;
  57. int i_mb_width;
  58. int i_mb_height;
  59. int b_frame_mbs_only;
  60. int b_mb_adaptive_frame_field;
  61. int b_direct8x8_inference;
  62. int b_crop;
  63. struct
  64. {
  65. int i_left;
  66. int i_right;
  67. int i_top;
  68. int i_bottom;
  69. } crop;
  70. int b_vui;
  71. struct
  72. {
  73. int b_aspect_ratio_info_present;
  74. int i_sar_width;
  75. int i_sar_height;
  76. int b_overscan_info_present;
  77. int b_overscan_info;
  78. int b_signal_type_present;
  79. int i_vidformat;
  80. int b_fullrange;
  81. int b_color_description_present;
  82. int i_colorprim;
  83. int i_transfer;
  84. int i_colmatrix;
  85. int b_chroma_loc_info_present;
  86. int i_chroma_loc_top;
  87. int i_chroma_loc_bottom;
  88. int b_timing_info_present;
  89. uint32_t i_num_units_in_tick;
  90. uint32_t i_time_scale;
  91. int b_fixed_frame_rate;
  92. int b_nal_hrd_parameters_present;
  93. int b_vcl_hrd_parameters_present;
  94. struct
  95. {
  96. int i_cpb_cnt;
  97. int i_bit_rate_scale;
  98. int i_cpb_size_scale;
  99. int i_bit_rate_value;
  100. int i_cpb_size_value;
  101. int i_bit_rate_unscaled;
  102. int i_cpb_size_unscaled;
  103. int b_cbr_hrd;
  104. int i_initial_cpb_removal_delay_length;
  105. int i_cpb_removal_delay_length;
  106. int i_dpb_output_delay_length;
  107. int i_time_offset_length;
  108. } hrd;
  109. int b_pic_struct_present;
  110. int b_bitstream_restriction;
  111. int b_motion_vectors_over_pic_boundaries;
  112. int i_max_bytes_per_pic_denom;
  113. int i_max_bits_per_mb_denom;
  114. int i_log2_max_mv_length_horizontal;
  115. int i_log2_max_mv_length_vertical;
  116. int i_num_reorder_frames;
  117. int i_max_dec_frame_buffering;
  118. /* FIXME to complete */
  119. } vui;
  120. int b_qpprime_y_zero_transform_bypass;
  121. int i_chroma_format_idc;
  122. int b_avcintra;
  123. int i_cqm_preset;
  124. const uint8_t *scaling_list[8]; /* could be 12, but we don't allow separate Cb/Cr lists */
  125. } x264_sps_t;
  126. typedef struct
  127. {
  128. int i_id;
  129. int i_sps_id;
  130. int b_cabac;
  131. int b_pic_order;
  132. int i_num_slice_groups;
  133. int i_num_ref_idx_l0_default_active;
  134. int i_num_ref_idx_l1_default_active;
  135. int b_weighted_pred;
  136. int b_weighted_bipred;
  137. int i_pic_init_qp;
  138. int i_pic_init_qs;
  139. int i_chroma_qp_index_offset;
  140. int b_deblocking_filter_control;
  141. int b_constrained_intra_pred;
  142. int b_redundant_pic_cnt;
  143. int b_transform_8x8_mode;
  144. } x264_pps_t;
  145. #define x264_cqm_init x264_template(cqm_init)
  146. int x264_cqm_init( x264_t *h );
  147. #define x264_cqm_delete x264_template(cqm_delete)
  148. void x264_cqm_delete( x264_t *h );
  149. #define x264_cqm_parse_file x264_template(cqm_parse_file)
  150. int x264_cqm_parse_file( x264_t *h, const char *filename );
  151. #endif