hardware/intel/intel-driver
Révision | 1ae22a0549d30dd24991c4c2c9902e7b7a8d935e (tree) |
---|---|
l'heure | 2014-06-16 12:53:35 |
Auteur | Li Xiaowei <xiaowei.a.li@inte...> |
Commiter | Xiang, Haihao |
encoder: MVC: Add support for MVC profiles
This is a part of bd630edd844b88ea543a027654db296ff7da16cd on staging
Signed-off-by: Li Xiaowei <xiaowei.a.li@intel.com>
Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
@@ -427,7 +427,8 @@ static void gen75_mfc_init(VADriverContextP ctx, | ||
427 | 427 | int height_in_mbs = 0; |
428 | 428 | int slice_batchbuffer_size; |
429 | 429 | |
430 | - if (encoder_context->codec == CODEC_H264) { | |
430 | + if (encoder_context->codec == CODEC_H264 || | |
431 | + encoder_context->codec == CODEC_H264_MVC) { | |
431 | 432 | VAEncSequenceParameterBufferH264 *pSequenceParameter = (VAEncSequenceParameterBufferH264 *)encode_state->seq_param_ext->buffer; |
432 | 433 | width_in_mbs = pSequenceParameter->picture_width_in_mbs; |
433 | 434 | height_in_mbs = pSequenceParameter->picture_height_in_mbs; |
@@ -1182,13 +1183,13 @@ gen75_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, | ||
1182 | 1183 | assert(pPicParameter->pic_init_qp >= 0 && pPicParameter->pic_init_qp < 52); |
1183 | 1184 | assert(qp >= 0 && qp < 52); |
1184 | 1185 | |
1185 | - gen75_mfc_avc_slice_state(ctx, | |
1186 | + gen75_mfc_avc_slice_state(ctx, | |
1186 | 1187 | pPicParameter, |
1187 | 1188 | pSliceParameter, |
1188 | 1189 | encode_state, encoder_context, |
1189 | 1190 | (rate_control_mode == VA_RC_CBR), qp, slice_batch); |
1190 | 1191 | |
1191 | - if ( slice_index == 0) | |
1192 | + if ( slice_index == 0) | |
1192 | 1193 | intel_mfc_avc_pipeline_header_programing(ctx, encode_state, encoder_context, slice_batch); |
1193 | 1194 | |
1194 | 1195 | slice_header_length_in_bits = build_avc_slice_header(pSequenceParameter, pPicParameter, pSliceParameter, &slice_header); |
@@ -1199,6 +1200,8 @@ gen75_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, | ||
1199 | 1200 | 5, /* first 5 bytes are start code + nal unit type */ |
1200 | 1201 | 1, 0, 1, slice_batch); |
1201 | 1202 | |
1203 | + free(slice_header); | |
1204 | + | |
1202 | 1205 | dri_bo_map(vme_context->vme_output.bo , 1); |
1203 | 1206 | msg_ptr = (unsigned char *)vme_context->vme_output.bo->virtual; |
1204 | 1207 |
@@ -1244,7 +1247,6 @@ gen75_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, | ||
1244 | 1247 | 1, 1, 1, 0, slice_batch); |
1245 | 1248 | } |
1246 | 1249 | |
1247 | - free(slice_header); | |
1248 | 1250 | |
1249 | 1251 | } |
1250 | 1252 |
@@ -1556,6 +1558,7 @@ gen75_mfc_avc_batchbuffer_slice(VADriverContextP ctx, | ||
1556 | 1558 | 0, |
1557 | 1559 | 1, |
1558 | 1560 | slice_batch); |
1561 | + | |
1559 | 1562 | free(slice_header); |
1560 | 1563 | |
1561 | 1564 | intel_batchbuffer_align(slice_batch, 16); /* aligned by an Oword */ |
@@ -2534,6 +2537,8 @@ static VAStatus gen75_mfc_pipeline(VADriverContextP ctx, | ||
2534 | 2537 | case VAProfileH264ConstrainedBaseline: |
2535 | 2538 | case VAProfileH264Main: |
2536 | 2539 | case VAProfileH264High: |
2540 | + case VAProfileH264MultiviewHigh: | |
2541 | + case VAProfileH264StereoHigh: | |
2537 | 2542 | vaStatus = gen75_mfc_avc_encode_picture(ctx, encode_state, encoder_context); |
2538 | 2543 | break; |
2539 | 2544 |
@@ -336,7 +336,8 @@ static VAStatus gen75_vme_constant_setup(VADriverContextP ctx, | ||
336 | 336 | |
337 | 337 | vme_state_message = (unsigned int *)vme_context->vme_state_message; |
338 | 338 | |
339 | - if (encoder_context->codec == CODEC_H264) { | |
339 | + if (encoder_context->codec == CODEC_H264 || | |
340 | + encoder_context->codec == CODEC_H264_MVC) { | |
340 | 341 | if (vme_context->h264_level >= 30) { |
341 | 342 | mv_num = 16; |
342 | 343 |
@@ -462,6 +463,7 @@ static VAStatus gen75_vme_vme_state_setup(VADriverContextP ctx, | ||
462 | 463 | |
463 | 464 | switch (encoder_context->codec) { |
464 | 465 | case CODEC_H264: |
466 | + case CODEC_H264_MVC: | |
465 | 467 | gen75_vme_state_setup_fixup(ctx, encode_state, encoder_context, vme_state_message); |
466 | 468 | |
467 | 469 | break; |
@@ -1010,6 +1012,7 @@ Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context * | ||
1010 | 1012 | |
1011 | 1013 | switch (encoder_context->codec) { |
1012 | 1014 | case CODEC_H264: |
1015 | + case CODEC_H264_MVC: | |
1013 | 1016 | vme_kernel_list = gen75_vme_kernels; |
1014 | 1017 | encoder_context->vme_pipeline = gen75_vme_pipeline; |
1015 | 1018 | i965_kernel_num = sizeof(gen75_vme_kernels) / sizeof(struct i965_kernel); |
@@ -401,7 +401,8 @@ static void gen8_mfc_init(VADriverContextP ctx, | ||
401 | 401 | int height_in_mbs = 0; |
402 | 402 | int slice_batchbuffer_size; |
403 | 403 | |
404 | - if (encoder_context->codec == CODEC_H264) { | |
404 | + if (encoder_context->codec == CODEC_H264 || | |
405 | + encoder_context->codec == CODEC_H264_MVC) { | |
405 | 406 | VAEncSequenceParameterBufferH264 *pSequenceParameter = (VAEncSequenceParameterBufferH264 *)encode_state->seq_param_ext->buffer; |
406 | 407 | width_in_mbs = pSequenceParameter->picture_width_in_mbs; |
407 | 408 | height_in_mbs = pSequenceParameter->picture_height_in_mbs; |
@@ -1046,13 +1047,13 @@ gen8_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, | ||
1046 | 1047 | assert(pPicParameter->pic_init_qp >= 0 && pPicParameter->pic_init_qp < 52); |
1047 | 1048 | assert(qp >= 0 && qp < 52); |
1048 | 1049 | |
1049 | - gen8_mfc_avc_slice_state(ctx, | |
1050 | + gen8_mfc_avc_slice_state(ctx, | |
1050 | 1051 | pPicParameter, |
1051 | 1052 | pSliceParameter, |
1052 | 1053 | encode_state, encoder_context, |
1053 | 1054 | (rate_control_mode == VA_RC_CBR), qp, slice_batch); |
1054 | 1055 | |
1055 | - if ( slice_index == 0) | |
1056 | + if ( slice_index == 0) | |
1056 | 1057 | intel_mfc_avc_pipeline_header_programing(ctx, encode_state, encoder_context, slice_batch); |
1057 | 1058 | |
1058 | 1059 | slice_header_length_in_bits = build_avc_slice_header(pSequenceParameter, pPicParameter, pSliceParameter, &slice_header); |
@@ -1063,6 +1064,8 @@ gen8_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, | ||
1063 | 1064 | 5, /* first 5 bytes are start code + nal unit type */ |
1064 | 1065 | 1, 0, 1, slice_batch); |
1065 | 1066 | |
1067 | + free(slice_header); | |
1068 | + | |
1066 | 1069 | dri_bo_map(vme_context->vme_output.bo , 1); |
1067 | 1070 | msg_ptr = (unsigned char *)vme_context->vme_output.bo->virtual; |
1068 | 1071 |
@@ -1108,7 +1111,6 @@ gen8_mfc_avc_pipeline_slice_programing(VADriverContextP ctx, | ||
1108 | 1111 | 1, 1, 1, 0, slice_batch); |
1109 | 1112 | } |
1110 | 1113 | |
1111 | - free(slice_header); | |
1112 | 1114 | |
1113 | 1115 | } |
1114 | 1116 |
@@ -1452,6 +1454,7 @@ gen8_mfc_avc_batchbuffer_slice(VADriverContextP ctx, | ||
1452 | 1454 | 0, |
1453 | 1455 | 1, |
1454 | 1456 | slice_batch); |
1457 | + | |
1455 | 1458 | free(slice_header); |
1456 | 1459 | |
1457 | 1460 | intel_batchbuffer_align(slice_batch, 16); /* aligned by an Oword */ |
@@ -2435,6 +2438,8 @@ static VAStatus gen8_mfc_pipeline(VADriverContextP ctx, | ||
2435 | 2438 | case VAProfileH264ConstrainedBaseline: |
2436 | 2439 | case VAProfileH264Main: |
2437 | 2440 | case VAProfileH264High: |
2441 | + case VAProfileH264MultiviewHigh: | |
2442 | + case VAProfileH264StereoHigh: | |
2438 | 2443 | vaStatus = gen8_mfc_avc_encode_picture(ctx, encode_state, encoder_context); |
2439 | 2444 | break; |
2440 | 2445 |
@@ -321,7 +321,8 @@ static VAStatus gen8_vme_constant_setup(VADriverContextP ctx, | ||
321 | 321 | |
322 | 322 | vme_state_message = (unsigned int *)vme_context->vme_state_message; |
323 | 323 | |
324 | - if (encoder_context->codec == CODEC_H264) { | |
324 | + if (encoder_context->codec == CODEC_H264 || | |
325 | + encoder_context->codec == CODEC_H264_MVC) { | |
325 | 326 | if (vme_context->h264_level >= 30) { |
326 | 327 | mv_num = 16; |
327 | 328 |
@@ -1155,6 +1156,7 @@ Bool gen8_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *e | ||
1155 | 1156 | |
1156 | 1157 | switch (encoder_context->codec) { |
1157 | 1158 | case CODEC_H264: |
1159 | + case CODEC_H264_MVC: | |
1158 | 1160 | vme_kernel_list = gen8_vme_kernels; |
1159 | 1161 | encoder_context->vme_pipeline = gen8_vme_pipeline; |
1160 | 1162 | i965_kernel_num = sizeof(gen8_vme_kernels) / sizeof(struct i965_kernel); |