VA-API  2.8.0
va_fei_h264.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007-2017 Intel Corporation. All Rights Reserved.
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 INTEL 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  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  */
24 
30 #ifndef VA_FEI_H264_H
31 #define VA_FEI_H264_H
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 #include <stdint.h>
38 #include "va_fei.h"
39 
47 typedef struct _VAEncMiscParameterFEIFrameControlH264
48 {
49  uint32_t function; /* one of the VAConfigAttribFEIFunctionType values */
87 
89  uint32_t num_mv_predictors_l0 : 16;
90  uint32_t num_mv_predictors_l1 : 16;
91 
97  uint32_t search_path : 8;
102  uint32_t len_sp : 8;
103  uint32_t reserved0 : 16;
115  uint32_t sub_mb_part_mask : 7;
121  uint32_t intra_part_mask : 5;
123  uint32_t multi_pred_l0 : 1;
125  uint32_t multi_pred_l1 : 1;
131  uint32_t sub_pel_mode : 2;
135  uint32_t inter_sad : 2;
139  uint32_t intra_sad : 2;
143  uint32_t distortion_type : 1;
149  uint32_t adaptive_search : 1;
155  uint32_t mv_predictor_enable : 1;
157  uint32_t mb_qp : 1;
159  uint32_t mb_input : 1;
162  uint32_t mb_size_ctrl : 1;
166  uint32_t reserved1 : 4;
167 
169  uint32_t ref_width : 8;
170  uint32_t ref_height : 8;
183  uint32_t search_window : 4;
184  uint32_t reserved2 : 12;
185 
187  uint32_t max_frame_size;
189  uint32_t num_passes;
191  uint8_t *delta_qp;
192  uint32_t reserved3[VA_PADDING_LOW];
194 
196 typedef struct _VAEncFEIMBControlH264
197 {
199  uint32_t force_to_intra : 1;
201  uint32_t force_to_skip : 1;
203  uint32_t force_to_nonskip : 1;
204  uint32_t enable_direct_bias_adjustment : 1;
205  uint32_t enable_motion_bias_adjustment : 1;
206  uint32_t ext_mv_cost_scaling_factor : 3;
207  uint32_t reserved0 : 24;
208 
209  uint32_t reserved1;
210 
211  uint32_t reserved2;
212 
213  uint32_t reserved3 : 16;
215  uint32_t target_size_in_word : 8;
217  uint32_t max_size_in_word : 8;
219 
220 
224 typedef struct _VAEncFEIMVPredictorH264
225 {
230  struct {
231  uint8_t ref_idx_l0 : 4;
232  uint8_t ref_idx_l1 : 4;
233  } ref_idx[4]; /* index is predictor number */
234  uint32_t reserved;
240  VAMotionVector mv[4]; /* MaxNumPredictor is 4 */
242 
274 typedef struct _VAEncFEIMBCodeH264
275 {
276  //DWORD 0~2
277  uint32_t reserved0[3];
278 
279  //DWORD 3
280  uint32_t inter_mb_mode : 2;
281  uint32_t mb_skip_flag : 1;
282  uint32_t reserved1 : 1;
283  uint32_t intra_mb_mode : 2;
284  uint32_t reserved2 : 1;
285  uint32_t field_mb_polarity_flag : 1;
286  uint32_t mb_type : 5;
287  uint32_t intra_mb_flag : 1;
288  uint32_t field_mb_flag : 1;
289  uint32_t transform8x8_flag : 1;
290  uint32_t reserved3 : 1;
291  uint32_t dc_block_coded_cr_flag : 1;
292  uint32_t dc_block_coded_cb_flag : 1;
293  uint32_t dc_block_coded_y_flag : 1;
294  uint32_t reserved4 : 12;
295 
296  //DWORD 4
297  uint32_t horz_origin : 8;
298  uint32_t vert_origin : 8;
299  uint32_t cbp_y : 16;
300 
301  //DWORD 5
302  uint32_t cbp_cb : 16;
303  uint32_t cbp_cr : 16;
304 
305  //DWORD 6
306  uint32_t qp_prime_y : 8;
307  uint32_t reserved5 : 17;
308  uint32_t mb_skip_conv_disable : 1;
309  uint32_t is_last_mb : 1;
310  uint32_t enable_coefficient_clamp : 1;
311  uint32_t direct8x8_pattern : 4;
312 
313  //DWORD 7 8 and 9
314  union
315  {
316  /* Intra MBs */
317  struct
318  {
319  uint32_t luma_intra_pred_modes0 : 16;
320  uint32_t luma_intra_pred_modes1 : 16;
321 
322  uint32_t luma_intra_pred_modes2 : 16;
323  uint32_t luma_intra_pred_modes3 : 16;
324 
325  uint32_t chroma_intra_pred_mode : 2;
326  uint32_t intra_pred_avail_flag : 5;
327  uint32_t intra_pred_avail_flagF : 1;
328  uint32_t reserved6 : 24;
329  } intra_mb;
330 
331  /* Inter MBs */
332  struct
333  {
334  uint32_t sub_mb_shapes : 8;
335  uint32_t sub_mb_pred_modes : 8;
336  uint32_t reserved7 : 16;
337 
338  uint32_t ref_idx_l0_0 : 8;
339  uint32_t ref_idx_l0_1 : 8;
340  uint32_t ref_idx_l0_2 : 8;
341  uint32_t ref_idx_l0_3 : 8;
342 
343  uint32_t ref_idx_l1_0 : 8;
344  uint32_t ref_idx_l1_1 : 8;
345  uint32_t ref_idx_l1_2 : 8;
346  uint32_t ref_idx_l1_3 : 8;
347  } inter_mb;
348  } mb_mode;
349 
350  //DWORD 10
351  uint32_t reserved8 : 16;
352  uint32_t target_size_in_word : 8;
353  uint32_t max_size_in_word : 8;
354 
355  //DWORD 11~14
356  uint32_t reserved9[4];
357 
358  //DWORD 15
359  uint32_t reserved10;
360 } VAEncFEIMBCodeH264; // 64 bytes
361 
366 typedef struct _VAEncFEIDistortionH264 {
370  uint16_t inter_distortion[16];
371  uint32_t best_inter_distortion : 16;
372  uint32_t best_intra_distortion : 16;
373  uint32_t colocated_mb_distortion : 16;
374  uint32_t reserved0 : 16;
375  uint32_t reserved1[2];
376 } VAEncFEIDistortionH264; // 48 bytes
377 
381 typedef struct _VAStatsStatisticsParameterH264
382 {
383  VAStatsStatisticsParameter stats_params;
384 
385  uint32_t frame_qp : 8;
387  uint32_t len_sp : 8;
393  uint32_t search_path : 8;
394  uint32_t reserved0 : 8;
395 
396  uint32_t sub_mb_part_mask : 7;
403  uint32_t sub_pel_mode : 2;
410  uint32_t inter_sad : 2;
417  uint32_t intra_sad : 2;
418  uint32_t adaptive_search : 1;
425  uint32_t mv_predictor_ctrl : 3;
426  uint32_t mb_qp : 1;
431  uint32_t ft_enable : 1;
438  uint32_t intra_part_mask : 5;
439  uint32_t reserved1 : 8;
440 
442  uint32_t ref_width : 8;
443  uint32_t ref_height : 8;
456  uint32_t search_window : 4;
457  uint32_t reserved2 : 12;
458 
460  uint32_t disable_mv_output : 1;
464  uint32_t enable_8x8_statistics : 1;
465  uint32_t reserved3 : 29;
466  uint32_t reserved4[2];
468 
475 typedef struct _VAStatsStatisticsH264
476 {
478  uint32_t best_inter_distortion0 : 16;
479  uint32_t inter_mode0 : 16;
480 
482  uint32_t best_inter_distortion1 : 16;
483  uint32_t inter_mode1 : 16;
484 
485  uint32_t best_intra_distortion : 16;
486  uint32_t intra_mode : 16;
487 
488  uint32_t num_non_zero_coef : 16;
489  uint32_t reserved0 : 16;
490 
491  uint32_t sum_coef;
492 
494  uint32_t mb_is_flat : 1;
495  uint32_t reserved1 : 31;
496 
498  uint32_t variance_16x16;
500  uint32_t variance_8x8[4];
501 
505  uint32_t pixel_average_8x8[4];
506 } VAStatsStatisticsH264; // 64 bytes
507 
508 
509 #ifdef __cplusplus
510 }
511 #endif
512 
513 #endif /* VA_FEI_H264_H */
uint8_t * delta_qp
delta QP list for every pass
Definition: va_fei_h264.h:191
Application can use this definition as reference to allocate the buffer based on MaxNumPredictor retu...
Definition: va_fei_h264.h:224
uint32_t best_inter_distortion1
future reference
Definition: va_fei_h264.h:482
uint32_t ref_width
motion search window(ref_width * ref_height)
Definition: va_fei_h264.h:169
uint32_t inter_sad
Definition: va_fei_h264.h:135
uint32_t intra_part_mask
luma intra mode partition mask xxxx1: luma_intra_16x16 disabled xxx1x: luma_intra_8x8 disabled xx1xx:...
Definition: va_fei_h264.h:438
uint32_t sub_pel_mode
Definition: va_fei_h264.h:131
uint32_t len_sp
maximum number of Search Units, valid range is [1, 63] 0 is treated as 1. reference search locations ...
Definition: va_fei_h264.h:102
VABufferID mb_ctrl
MB (16x16) control input buffer. It is valid only when (mb_input | mb_size_ctrl) is set to 1...
Definition: va_fei_h264.h:57
uint32_t disable_mv_output
MVOutput. When set to 1, MV output is NOT provided.
Definition: va_fei_h264.h:460
uint32_t mb_input
Definition: va_fei_h264.h:159
Generic motion vector data structure.
Definition: va.h:279
FEI MB level control data structure.
Definition: va_fei_h264.h:196
uint32_t target_size_in_word
when mb_size_ctrl is set, size here is used to budget accumulatively. Set to 0xFF if don&#39;t care...
Definition: va_fei_h264.h:215
uint32_t enable_8x8_statistics
block 8x8 data enabling in statistics output
Definition: va_fei_h264.h:464
uint32_t adaptive_search
Definition: va_fei_h264.h:149
uint32_t multi_pred_l0
Definition: va_fei_h264.h:123
FEI frame level control buffer for H.264.
Definition: va_fei_h264.h:47
uint32_t intra_part_mask
Definition: va_fei_h264.h:121
uint32_t len_sp
length of search path
Definition: va_fei_h264.h:387
uint32_t mb_size_ctrl
Definition: va_fei_h264.h:162
uint32_t max_size_in_word
specifies the max size of each MB
Definition: va_fei_h264.h:217
uint32_t ref_width
motion search window(ref_width * ref_height)
Definition: va_fei_h264.h:442
VABufferID mv_predictor
MV predictor. It is valid only when mv_predictor_enable is set to 1. Each 16x16 block has one or more...
Definition: va_fei_h264.h:86
uint32_t inter_sad
distortion measure adjustment for inter search SAD comparison 00b: none 01b: reserved 10b: Haar trans...
Definition: va_fei_h264.h:410
uint32_t search_window
predefined motion search windows. If selected, len_sp, window(ref_width * ref_eight) and search_path ...
Definition: va_fei_h264.h:456
uint32_t force_to_nonskip
specifies whether this macroblock should be coded as a non-skipped macroblock.
Definition: va_fei_h264.h:203
VAGenericID VABufferID
Definition: va.h:1647
uint32_t mv_predictor_enable
Definition: va_fei_h264.h:155
uint32_t sub_mb_part_mask
defines the bit-mask for disabling sub-partition The lower 4 bits are for the major partitions (sub-m...
Definition: va_fei_h264.h:115
VAEncFEIDistortionH264 defines the data structure for VAEncFEIDistortionBufferType per 16x16 MB block...
Definition: va_fei_h264.h:366
The FEI encoding common API.
VAStatsStatisticsH264. H264 Statistics buffer layout for VAStatsStatisticsBufferType and VAStatsStati...
Definition: va_fei_h264.h:475
uint32_t repartition_check_enable
Definition: va_fei_h264.h:145
uint32_t search_path
motion search method definition 0: default value, diamond search 1: full search 2: diamond search ...
Definition: va_fei_h264.h:393
uint32_t intra_sad
distortion measure adjustment for intra search SAD comparison 00b: none 01b: reserved 10b: Haar trans...
Definition: va_fei_h264.h:417
uint32_t best_inter_distortion0
past reference
Definition: va_fei_h264.h:478
uint32_t force_to_skip
when set, correposndent MB is coded as skip
Definition: va_fei_h264.h:201
Motion Vector and Statistics frame level controls. VAStatsStatisticsParameterBufferType for H264 16x1...
Definition: va_fei_h264.h:381
uint32_t pixel_average_16x16
DWORD 11 pixel_average for block16x16.
Definition: va_fei_h264.h:503
uint32_t colocated_mb_distortion
Definition: va_fei_h264.h:165
#define VA_PADDING_LOW
Definition: va.h:260
uint32_t search_path
motion search method definition 0: default value, diamond search 1: full search 2: diamond search ...
Definition: va_fei_h264.h:97
uint32_t search_window
predefined motion search windows. If selected, len_sp, window(ref_width * ref_eight) and search_path ...
Definition: va_fei_h264.h:183
VABufferID qp
QP input buffer with layout VAEncQPBufferH264. It is valid only when mb_qp is set to 1...
Definition: va_fei_h264.h:80
uint32_t variance_16x16
DWORD 6 variance for block16x16.
Definition: va_fei_h264.h:498
VABufferID mv_data
MVs data output of MB ENC. Each 16x16 block has one MVs data with layout VAMotionVector Buffer size s...
Definition: va_fei_h264.h:69
uint32_t mb_qp
Definition: va_fei_h264.h:157
uint32_t intra_sad
Definition: va_fei_h264.h:139
Motion Vector and Statistics frame level controls. common part VAStatsStatisticsParameterBufferType f...
Definition: va_fei.h:108
uint32_t force_to_intra
when set, correposndent MB is coded as intra
Definition: va_fei_h264.h:199
FEI output.
Definition: va_fei_h264.h:274
VABufferID distortion
distortion output of MB ENC or ENC_PAK. Each 16x16 block has one distortion data with VAEncFEIDistort...
Definition: va_fei_h264.h:63
VABufferID mb_code_data
MBCode data output of MB ENC. Each 16x16 block has one MB Code data with layout VAEncFEIMBCodeH264 Bu...
Definition: va_fei_h264.h:75
uint32_t multi_pred_l1
Definition: va_fei_h264.h:125
uint32_t mv_predictor_ctrl
indicate if future or/and past MV in mv_predictor buffer is valid. 0: MV predictor disabled 1: MV pre...
Definition: va_fei_h264.h:425
uint32_t distortion_type
Definition: va_fei_h264.h:143
uint32_t sub_pel_mode
sub pixel mode definition 00b: integer mode searching 01b: half-pel mode searching 10b: reserved 11b:...
Definition: va_fei_h264.h:403
uint32_t num_mv_predictors_l0
number of MV predictors. It must not be greater than maximum supported MV predictor.
Definition: va_fei_h264.h:89
uint32_t ft_enable
forward transform enable 0: disable 1: enable, needs frame_qp or mb_qp input for transform ...
Definition: va_fei_h264.h:431
uint32_t disable_statistics_output
StatisticsOutput. When set to 1, Statistics output is NOT provided.
Definition: va_fei_h264.h:462
uint32_t max_frame_size
max frame size control with multi passes QP setting
Definition: va_fei_h264.h:187
uint32_t mb_is_flat
DWORD 5 flat info.
Definition: va_fei_h264.h:494
uint32_t num_passes
number of passes, every pass has different QP
Definition: va_fei_h264.h:189