1 /*****************************************************************************
2 * set.h: quantization init
3 *****************************************************************************
4 * Copyright (C) 2003-2016 x264 project
6 * Authors: Loren Merritt <lorenm@u.washington.edu>
7 * Laurent Aimar <fenrir@via.ecp.fr>
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.
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.
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.
23 * This program is also available under a commercial proprietary license.
24 * For more information, contact us at licensing@x264.com.
25 *****************************************************************************/
32 PROFILE_BASELINE = 66,
36 PROFILE_HIGH422 = 122,
37 PROFILE_HIGH444_PREDICTIVE = 244,
70 int b_constraint_set0;
71 int b_constraint_set1;
72 int b_constraint_set2;
73 int b_constraint_set3;
75 int i_log2_max_frame_num;
79 int i_log2_max_poc_lsb;
82 int b_gaps_in_frame_num_value_allowed;
86 int b_mb_adaptive_frame_field;
87 int b_direct8x8_inference;
101 int b_aspect_ratio_info_present;
105 int b_overscan_info_present;
108 int b_signal_type_present;
111 int b_color_description_present;
116 int b_chroma_loc_info_present;
117 int i_chroma_loc_top;
118 int i_chroma_loc_bottom;
120 int b_timing_info_present;
121 uint32_t i_num_units_in_tick;
122 uint32_t i_time_scale;
123 int b_fixed_frame_rate;
125 int b_nal_hrd_parameters_present;
126 int b_vcl_hrd_parameters_present;
131 int i_bit_rate_scale;
132 int i_cpb_size_scale;
133 int i_bit_rate_value;
134 int i_cpb_size_value;
135 int i_bit_rate_unscaled;
136 int i_cpb_size_unscaled;
139 int i_initial_cpb_removal_delay_length;
140 int i_cpb_removal_delay_length;
141 int i_dpb_output_delay_length;
142 int i_time_offset_length;
145 int b_pic_struct_present;
146 int b_bitstream_restriction;
147 int b_motion_vectors_over_pic_boundaries;
148 int i_max_bytes_per_pic_denom;
149 int i_max_bits_per_mb_denom;
150 int i_log2_max_mv_length_horizontal;
151 int i_log2_max_mv_length_vertical;
152 int i_num_reorder_frames;
153 int i_max_dec_frame_buffering;
155 /* FIXME to complete */
158 int b_qpprime_y_zero_transform_bypass;
159 int i_chroma_format_idc;
171 int i_num_slice_groups;
173 int i_num_ref_idx_l0_default_active;
174 int i_num_ref_idx_l1_default_active;
177 int b_weighted_bipred;
182 int i_chroma_qp_index_offset;
184 int b_deblocking_filter_control;
185 int b_constrained_intra_pred;
186 int b_redundant_pic_cnt;
188 int b_transform_8x8_mode;
191 const uint8_t *scaling_list[8]; /* could be 12, but we don't allow separate Cb/Cr lists */
195 /* default quant matrices */
196 static const uint8_t x264_cqm_jvt4i[16] =
203 static const uint8_t x264_cqm_jvt4p[16] =
210 static const uint8_t x264_cqm_jvt8i[64] =
212 6,10,13,16,18,23,25,27,
213 10,11,16,18,23,25,27,29,
214 13,16,18,23,25,27,29,31,
215 16,18,23,25,27,29,31,33,
216 18,23,25,27,29,31,33,36,
217 23,25,27,29,31,33,36,38,
218 25,27,29,31,33,36,38,40,
219 27,29,31,33,36,38,40,42
221 static const uint8_t x264_cqm_jvt8p[64] =
223 9,13,15,17,19,21,22,24,
224 13,13,17,19,21,22,24,25,
225 15,17,19,21,22,24,25,27,
226 17,19,21,22,24,25,27,28,
227 19,21,22,24,25,27,28,30,
228 21,22,24,25,27,28,30,32,
229 22,24,25,27,28,30,32,33,
230 24,25,27,28,30,32,33,35
232 static const uint8_t x264_cqm_flat16[64] =
234 16,16,16,16,16,16,16,16,
235 16,16,16,16,16,16,16,16,
236 16,16,16,16,16,16,16,16,
237 16,16,16,16,16,16,16,16,
238 16,16,16,16,16,16,16,16,
239 16,16,16,16,16,16,16,16,
240 16,16,16,16,16,16,16,16,
241 16,16,16,16,16,16,16,16
243 static const uint8_t * const x264_cqm_jvt[8] =
245 x264_cqm_jvt4i, x264_cqm_jvt4p,
246 x264_cqm_jvt4i, x264_cqm_jvt4p,
247 x264_cqm_jvt8i, x264_cqm_jvt8p,
248 x264_cqm_jvt8i, x264_cqm_jvt8p
251 // 1080i25_avci50, 1080p25_avci50
252 static const uint8_t x264_cqm_avci50_4ic[16] =
261 static const uint8_t x264_cqm_avci50_1080i_8iy[64] =
263 16,18,19,21,27,33,81,87,
264 18,19,21,24,30,33,81,87,
265 19,21,24,27,30,78,84,90,
266 21,24,27,30,33,78,84,90,
267 24,27,30,33,78,81,84,90,
268 24,27,30,33,78,81,84,93,
269 27,30,33,78,78,81,87,93,
270 30,33,33,78,81,84,87,96
273 // 1080p25_avci50, 720p25_avci50, 720p50_avci50
274 static const uint8_t x264_cqm_avci50_p_8iy[64] =
276 16,18,19,21,24,27,30,33,
277 18,19,21,24,27,30,33,78,
278 19,21,24,27,30,33,78,81,
279 21,24,27,30,33,78,81,84,
280 24,27,30,33,78,81,84,87,
281 27,30,33,78,81,84,87,90,
282 30,33,78,81,84,87,90,93,
283 33,78,81,84,87,90,93,96
286 // 1080i25_avci100, 1080p25_avci100
287 static const uint8_t x264_cqm_avci100_1080_4ic[16] =
295 // 720p25_avci100, 720p50_avci100
296 static const uint8_t x264_cqm_avci100_720p_4ic[16] =
305 static const uint8_t x264_cqm_avci100_1080i_8iy[64] =
307 16,19,20,23,24,26,32,42,
308 18,19,22,24,26,32,36,42,
309 18,20,23,24,26,32,36,63,
310 19,20,23,26,32,36,42,63,
311 20,22,24,26,32,36,59,63,
312 22,23,24,26,32,36,59,68,
313 22,23,24,26,32,42,59,68,
314 22,23,24,26,36,42,59,72
318 static const uint8_t x264_cqm_avci100_1080p_8iy[64] =
320 16,18,19,20,22,23,24,26,
321 18,19,20,22,23,24,26,32,
322 19,20,22,23,24,26,32,36,
323 20,22,23,24,26,32,36,42,
324 22,23,24,26,32,36,42,59,
325 23,24,26,32,36,42,59,63,
326 24,26,32,36,42,59,63,68,
327 26,32,36,42,59,63,68,72
330 // 720p25_avci100, 720p50_avci100
331 static const uint8_t x264_cqm_avci100_720p_8iy[64] =
333 16,18,19,21,22,24,26,32,
334 18,19,19,21,22,24,26,32,
335 19,19,21,22,22,24,26,32,
336 21,21,22,22,23,24,26,34,
337 22,22,22,23,24,25,26,34,
338 24,24,24,24,25,26,34,36,
339 26,26,26,26,26,34,36,38,
340 32,32,32,34,34,36,38,42
343 int x264_cqm_init( x264_t *h );
344 void x264_cqm_delete( x264_t *h );
345 int x264_cqm_parse_file( x264_t *h, const char *filename );