• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/intel-driver


Commit MetaInfo

Revisionebcfb7c9c3e6ce77ea813fa711c3b59b067623ea (tree)
Time2015-03-19 11:01:29
AuthorQu,Pengfei <Pengfei.Qu@inte...>
CommiterXiang, Haihao

Log Message

Just Style alignment

Signed-off-by: Qu,Pengfei <Pengfei.Qu@intel.com>
(cherry picked from commit 22439f1fcebbd2c1d563503720b1123a4bb97160)

Change Summary

Incremental Difference

--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -631,8 +631,8 @@ VAStatus intel_mfc_avc_prepare(VADriverContextP ctx,
631631 int height_in_mbs = pSequenceParameter->picture_height_in_mbs;
632632
633633 if (IS_GEN6(i965->intel.device_info)) {
634- /* On the SNB it should be fixed to 128 for the DMV buffer */
635- width_in_mbs = 128;
634+ /* On the SNB it should be fixed to 128 for the DMV buffer */
635+ width_in_mbs = 128;
636636 }
637637
638638 for (j = 0; j < encode_state->num_slice_params_ext && enable_avc_ildb == 0; j++) {
@@ -735,7 +735,7 @@ VAStatus intel_mfc_avc_prepare(VADriverContextP ctx,
735735 break;
736736 }
737737 }
738-
738+
739739 mfc_context->uncompressed_picture_source.bo = encode_state->input_yuv_object->bo;
740740 dri_bo_reference(mfc_context->uncompressed_picture_source.bo);
741741
@@ -807,7 +807,7 @@ int intel_format_lutvalue(int value, int max)
807807 if (temp1 > temp2)
808808 ret = max;
809809 return ret;
810-
810+
811811 }
812812
813813
@@ -842,40 +842,40 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
842842
843843
844844 if (encoder_context->rate_control_mode == VA_RC_CQP)
845- qp = pic_param->pic_init_qp + slice_param->slice_qp_delta;
845+ qp = pic_param->pic_init_qp + slice_param->slice_qp_delta;
846846 else
847- qp = mfc_context->bit_rate_control_context[slice_type].QpPrimeY;
848-
847+ qp = mfc_context->bit_rate_control_context[slice_type].QpPrimeY;
848+
849849 if (vme_state_message == NULL)
850- return;
851-
850+ return;
851+
852852 assert(qp <= QP_MAX);
853853 lambda = intel_lambda_qp(qp);
854854 if (slice_type == SLICE_TYPE_I) {
855- vme_state_message[MODE_INTRA_16X16] = 0;
856- m_cost = lambda * 4;
857- vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
858- m_cost = lambda * 16;
859- vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
860- m_cost = lambda * 3;
861- vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
855+ vme_state_message[MODE_INTRA_16X16] = 0;
856+ m_cost = lambda * 4;
857+ vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
858+ m_cost = lambda * 16;
859+ vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
860+ m_cost = lambda * 3;
861+ vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
862862 } else {
863- m_cost = 0;
864- vme_state_message[MODE_INTER_MV0] = intel_format_lutvalue(m_cost, 0x6f);
865- for (j = 1; j < 3; j++) {
863+ m_cost = 0;
864+ vme_state_message[MODE_INTER_MV0] = intel_format_lutvalue(m_cost, 0x6f);
865+ for (j = 1; j < 3; j++) {
866866 m_costf = (log2f((float)(j + 1)) + 1.718f) * lambda;
867867 m_cost = (int)m_costf;
868868 vme_state_message[MODE_INTER_MV0 + j] = intel_format_lutvalue(m_cost, 0x6f);
869- }
870- mv_count = 3;
871- for (j = 4; j <= 64; j *= 2) {
869+ }
870+ mv_count = 3;
871+ for (j = 4; j <= 64; j *= 2) {
872872 m_costf = (log2f((float)(j + 1)) + 1.718f) * lambda;
873873 m_cost = (int)m_costf;
874874 vme_state_message[MODE_INTER_MV0 + mv_count] = intel_format_lutvalue(m_cost, 0x6f);
875875 mv_count++;
876- }
876+ }
877877
878- if (qp <= 25) {
878+ if (qp <= 25) {
879879 vme_state_message[MODE_INTRA_16X16] = 0x4a;
880880 vme_state_message[MODE_INTRA_8X8] = 0x4a;
881881 vme_state_message[MODE_INTRA_4X4] = 0x4a;
@@ -887,17 +887,17 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
887887 vme_state_message[MODE_INTER_4X4] = 0x4a;
888888 vme_state_message[MODE_INTER_BWD] = 0x2a;
889889 return;
890- }
891- m_costf = lambda * 10;
892- vme_state_message[MODE_INTRA_16X16] = intel_format_lutvalue(m_cost, 0x8f);
893- m_cost = lambda * 14;
894- vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
895- m_cost = lambda * 24;
896- vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
897- m_costf = lambda * 3.5;
898- m_cost = m_costf;
899- vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
900- if (slice_type == SLICE_TYPE_P) {
890+ }
891+ m_costf = lambda * 10;
892+ vme_state_message[MODE_INTRA_16X16] = intel_format_lutvalue(m_cost, 0x8f);
893+ m_cost = lambda * 14;
894+ vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
895+ m_cost = lambda * 24;
896+ vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
897+ m_costf = lambda * 3.5;
898+ m_cost = m_costf;
899+ vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
900+ if (slice_type == SLICE_TYPE_P) {
901901 m_costf = lambda * 2.5;
902902 m_cost = m_costf;
903903 vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
@@ -915,7 +915,7 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
915915 vme_state_message[MODE_INTER_4X4] = intel_format_lutvalue(m_cost, 0x6f);
916916 /* BWD is not used in P-frame */
917917 vme_state_message[MODE_INTER_BWD] = 0;
918- } else {
918+ } else {
919919 m_costf = lambda * 2.5;
920920 m_cost = m_costf;
921921 vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
@@ -934,7 +934,7 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
934934 m_costf = lambda * 1.5;
935935 m_cost = m_costf;
936936 vme_state_message[MODE_INTER_BWD] = intel_format_lutvalue(m_cost, 0x6f);
937- }
937+ }
938938 }
939939 }
940940
@@ -1030,7 +1030,7 @@ gen7_vme_scoreboard_init(VADriverContextP ctx, struct gen6_vme_context *vme_cont
10301030 vme_context->gpe_context.vfe_desc6.scoreboard1.delta_y1 = -1;
10311031 vme_context->gpe_context.vfe_desc6.scoreboard1.delta_x2 = 1;
10321032 vme_context->gpe_context.vfe_desc6.scoreboard1.delta_y2 = -1;
1033-
1033+
10341034 vme_context->gpe_context.vfe_desc7.dword = 0;
10351035 return;
10361036 }
@@ -1043,7 +1043,7 @@ static inline int loop_in_bounds(int x_index, int y_index, int first_mb, int num
10431043 return -1;
10441044 if (y_index < 0 || y_index >= mb_height)
10451045 return -1;
1046-
1046+
10471047 mb_index = y_index * mb_width + x_index;
10481048 if (mb_index < first_mb || mb_index > (first_mb + num_mb))
10491049 return -1;
@@ -1069,103 +1069,103 @@ gen7_vme_walker_fill_vme_batchbuffer(VADriverContextP ctx,
10691069 command_ptr = vme_context->vme_batchbuffer.bo->virtual;
10701070
10711071 for (s = 0; s < encode_state->num_slice_params_ext; s++) {
1072- VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
1073- int first_mb = pSliceParameter->macroblock_address;
1074- int num_mb = pSliceParameter->num_macroblocks;
1075- unsigned int mb_intra_ub, score_dep;
1076- int x_outer, y_outer, x_inner, y_inner;
1077- int xtemp_outer = 0;
1078-
1079- x_outer = first_mb % mb_width;
1080- y_outer = first_mb / mb_width;
1081- mb_row = y_outer;
1082-
1083- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1084- x_inner = x_outer;
1085- y_inner = y_outer;
1086- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1087- mb_intra_ub = 0;
1088- score_dep = 0;
1089- if (x_inner != 0) {
1090- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1091- score_dep |= MB_SCOREBOARD_A;
1092- }
1093- if (y_inner != mb_row) {
1094- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1095- score_dep |= MB_SCOREBOARD_B;
1096- if (x_inner != 0)
1097- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1098- if (x_inner != (mb_width -1)) {
1099- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1100- score_dep |= MB_SCOREBOARD_C;
1072+ VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
1073+ int first_mb = pSliceParameter->macroblock_address;
1074+ int num_mb = pSliceParameter->num_macroblocks;
1075+ unsigned int mb_intra_ub, score_dep;
1076+ int x_outer, y_outer, x_inner, y_inner;
1077+ int xtemp_outer = 0;
1078+
1079+ x_outer = first_mb % mb_width;
1080+ y_outer = first_mb / mb_width;
1081+ mb_row = y_outer;
1082+
1083+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1084+ x_inner = x_outer;
1085+ y_inner = y_outer;
1086+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1087+ mb_intra_ub = 0;
1088+ score_dep = 0;
1089+ if (x_inner != 0) {
1090+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1091+ score_dep |= MB_SCOREBOARD_A;
1092+ }
1093+ if (y_inner != mb_row) {
1094+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1095+ score_dep |= MB_SCOREBOARD_B;
1096+ if (x_inner != 0)
1097+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1098+ if (x_inner != (mb_width -1)) {
1099+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1100+ score_dep |= MB_SCOREBOARD_C;
11011101 }
1102- }
1103-
1104- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1105- *command_ptr++ = kernel;
1106- *command_ptr++ = USE_SCOREBOARD;
1107- /* Indirect data */
1108- *command_ptr++ = 0;
1109- /* the (X, Y) term of scoreboard */
1110- *command_ptr++ = ((y_inner << 16) | x_inner);
1111- *command_ptr++ = score_dep;
1112- /*inline data */
1113- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1114- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
1115- x_inner -= 2;
1116- y_inner += 1;
1117- }
1118- x_outer += 1;
1119- }
1102+ }
1103+
1104+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1105+ *command_ptr++ = kernel;
1106+ *command_ptr++ = USE_SCOREBOARD;
1107+ /* Indirect data */
1108+ *command_ptr++ = 0;
1109+ /* the (X, Y) term of scoreboard */
1110+ *command_ptr++ = ((y_inner << 16) | x_inner);
1111+ *command_ptr++ = score_dep;
1112+ /*inline data */
1113+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1114+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
1115+ x_inner -= 2;
1116+ y_inner += 1;
1117+ }
1118+ x_outer += 1;
1119+ }
11201120
1121- xtemp_outer = mb_width - 2;
1122- if (xtemp_outer < 0)
1121+ xtemp_outer = mb_width - 2;
1122+ if (xtemp_outer < 0)
11231123 xtemp_outer = 0;
1124- x_outer = xtemp_outer;
1125- y_outer = first_mb / mb_width;
1126- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1127- y_inner = y_outer;
1128- x_inner = x_outer;
1129- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1130- mb_intra_ub = 0;
1131- score_dep = 0;
1132- if (x_inner != 0) {
1133- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1134- score_dep |= MB_SCOREBOARD_A;
1135- }
1136- if (y_inner != mb_row) {
1137- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1138- score_dep |= MB_SCOREBOARD_B;
1139- if (x_inner != 0)
1140- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1141-
1142- if (x_inner != (mb_width -1)) {
1143- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1144- score_dep |= MB_SCOREBOARD_C;
1124+ x_outer = xtemp_outer;
1125+ y_outer = first_mb / mb_width;
1126+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1127+ y_inner = y_outer;
1128+ x_inner = x_outer;
1129+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1130+ mb_intra_ub = 0;
1131+ score_dep = 0;
1132+ if (x_inner != 0) {
1133+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1134+ score_dep |= MB_SCOREBOARD_A;
1135+ }
1136+ if (y_inner != mb_row) {
1137+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1138+ score_dep |= MB_SCOREBOARD_B;
1139+ if (x_inner != 0)
1140+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1141+
1142+ if (x_inner != (mb_width -1)) {
1143+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1144+ score_dep |= MB_SCOREBOARD_C;
11451145 }
1146- }
1147-
1148- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1149- *command_ptr++ = kernel;
1150- *command_ptr++ = USE_SCOREBOARD;
1151- /* Indirect data */
1152- *command_ptr++ = 0;
1153- /* the (X, Y) term of scoreboard */
1154- *command_ptr++ = ((y_inner << 16) | x_inner);
1155- *command_ptr++ = score_dep;
1156- /*inline data */
1157- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1158- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
1159-
1160- x_inner -= 2;
1161- y_inner += 1;
1162- }
1163- x_outer++;
1164- if (x_outer >= mb_width) {
1165- y_outer += 1;
1166- x_outer = xtemp_outer;
1167- }
1168- }
1146+ }
1147+
1148+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1149+ *command_ptr++ = kernel;
1150+ *command_ptr++ = USE_SCOREBOARD;
1151+ /* Indirect data */
1152+ *command_ptr++ = 0;
1153+ /* the (X, Y) term of scoreboard */
1154+ *command_ptr++ = ((y_inner << 16) | x_inner);
1155+ *command_ptr++ = score_dep;
1156+ /*inline data */
1157+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1158+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
1159+
1160+ x_inner -= 2;
1161+ y_inner += 1;
1162+ }
1163+ x_outer++;
1164+ if (x_outer >= mb_width) {
1165+ y_outer += 1;
1166+ x_outer = xtemp_outer;
1167+ }
1168+ }
11691169 }
11701170
11711171 *command_ptr++ = 0;
@@ -1339,7 +1339,7 @@ void intel_vme_mpeg2_state_setup(VADriverContextP ctx,
13391339 */
13401340 vme_state_message[MODE_INTRA_16X16] = intel_format_lutvalue(m_cost, 0x8f);
13411341 vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
1342-
1342+
13431343 vme_state_message[MODE_INTER_16X8] = 0;
13441344 vme_state_message[MODE_INTER_8X8] = 0;
13451345 vme_state_message[MODE_INTER_8X4] = 0;
@@ -1369,105 +1369,105 @@ gen7_vme_mpeg2_walker_fill_vme_batchbuffer(VADriverContextP ctx,
13691369 command_ptr = vme_context->vme_batchbuffer.bo->virtual;
13701370
13711371 {
1372- unsigned int mb_intra_ub, score_dep;
1373- int x_outer, y_outer, x_inner, y_inner;
1374- int xtemp_outer = 0;
1375- int first_mb = 0;
1376- int num_mb = mb_width * mb_height;
1377-
1378- x_outer = 0;
1379- y_outer = 0;
1380-
1381-
1382- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1383- x_inner = x_outer;
1384- y_inner = y_outer;
1385- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1386- mb_intra_ub = 0;
1387- score_dep = 0;
1388- if (x_inner != 0) {
1389- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1390- score_dep |= MB_SCOREBOARD_A;
1391- }
1392- if (y_inner != 0) {
1393- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1394- score_dep |= MB_SCOREBOARD_B;
1395-
1396- if (x_inner != 0)
1397- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1398-
1399- if (x_inner != (mb_width -1)) {
1400- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1401- score_dep |= MB_SCOREBOARD_C;
1402- }
1403- }
1404-
1405- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1406- *command_ptr++ = kernel;
1407- *command_ptr++ = MPEG2_SCOREBOARD;
1408- /* Indirect data */
1409- *command_ptr++ = 0;
1410- /* the (X, Y) term of scoreboard */
1411- *command_ptr++ = ((y_inner << 16) | x_inner);
1412- *command_ptr++ = score_dep;
1413- /*inline data */
1414- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1415- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
1416- x_inner -= 2;
1417- y_inner += 1;
1418- }
1419- x_outer += 1;
1420- }
1372+ unsigned int mb_intra_ub, score_dep;
1373+ int x_outer, y_outer, x_inner, y_inner;
1374+ int xtemp_outer = 0;
1375+ int first_mb = 0;
1376+ int num_mb = mb_width * mb_height;
1377+
1378+ x_outer = 0;
1379+ y_outer = 0;
1380+
1381+
1382+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1383+ x_inner = x_outer;
1384+ y_inner = y_outer;
1385+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1386+ mb_intra_ub = 0;
1387+ score_dep = 0;
1388+ if (x_inner != 0) {
1389+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1390+ score_dep |= MB_SCOREBOARD_A;
1391+ }
1392+ if (y_inner != 0) {
1393+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1394+ score_dep |= MB_SCOREBOARD_B;
1395+
1396+ if (x_inner != 0)
1397+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1398+
1399+ if (x_inner != (mb_width -1)) {
1400+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1401+ score_dep |= MB_SCOREBOARD_C;
1402+ }
1403+ }
1404+
1405+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1406+ *command_ptr++ = kernel;
1407+ *command_ptr++ = MPEG2_SCOREBOARD;
1408+ /* Indirect data */
1409+ *command_ptr++ = 0;
1410+ /* the (X, Y) term of scoreboard */
1411+ *command_ptr++ = ((y_inner << 16) | x_inner);
1412+ *command_ptr++ = score_dep;
1413+ /*inline data */
1414+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1415+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
1416+ x_inner -= 2;
1417+ y_inner += 1;
1418+ }
1419+ x_outer += 1;
1420+ }
14211421
1422- xtemp_outer = mb_width - 2;
1423- if (xtemp_outer < 0)
1422+ xtemp_outer = mb_width - 2;
1423+ if (xtemp_outer < 0)
14241424 xtemp_outer = 0;
1425- x_outer = xtemp_outer;
1426- y_outer = 0;
1427- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1428- y_inner = y_outer;
1429- x_inner = x_outer;
1430- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1431- mb_intra_ub = 0;
1432- score_dep = 0;
1433- if (x_inner != 0) {
1434- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1435- score_dep |= MB_SCOREBOARD_A;
1436- }
1437- if (y_inner != 0) {
1438- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1439- score_dep |= MB_SCOREBOARD_B;
1440-
1441- if (x_inner != 0)
1442- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1443-
1444- if (x_inner != (mb_width -1)) {
1445- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1446- score_dep |= MB_SCOREBOARD_C;
1447- }
1448- }
1449-
1450- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1451- *command_ptr++ = kernel;
1452- *command_ptr++ = MPEG2_SCOREBOARD;
1453- /* Indirect data */
1454- *command_ptr++ = 0;
1455- /* the (X, Y) term of scoreboard */
1456- *command_ptr++ = ((y_inner << 16) | x_inner);
1457- *command_ptr++ = score_dep;
1458- /*inline data */
1459- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1460- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
1461-
1462- x_inner -= 2;
1463- y_inner += 1;
1464- }
1465- x_outer++;
1466- if (x_outer >= mb_width) {
1467- y_outer += 1;
1468- x_outer = xtemp_outer;
1469- }
1470- }
1425+ x_outer = xtemp_outer;
1426+ y_outer = 0;
1427+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
1428+ y_inner = y_outer;
1429+ x_inner = x_outer;
1430+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
1431+ mb_intra_ub = 0;
1432+ score_dep = 0;
1433+ if (x_inner != 0) {
1434+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
1435+ score_dep |= MB_SCOREBOARD_A;
1436+ }
1437+ if (y_inner != 0) {
1438+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
1439+ score_dep |= MB_SCOREBOARD_B;
1440+
1441+ if (x_inner != 0)
1442+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
1443+
1444+ if (x_inner != (mb_width -1)) {
1445+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
1446+ score_dep |= MB_SCOREBOARD_C;
1447+ }
1448+ }
1449+
1450+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
1451+ *command_ptr++ = kernel;
1452+ *command_ptr++ = MPEG2_SCOREBOARD;
1453+ /* Indirect data */
1454+ *command_ptr++ = 0;
1455+ /* the (X, Y) term of scoreboard */
1456+ *command_ptr++ = ((y_inner << 16) | x_inner);
1457+ *command_ptr++ = score_dep;
1458+ /*inline data */
1459+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
1460+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
1461+
1462+ x_inner -= 2;
1463+ y_inner += 1;
1464+ }
1465+ x_outer++;
1466+ if (x_outer >= mb_width) {
1467+ y_outer += 1;
1468+ x_outer = xtemp_outer;
1469+ }
1470+ }
14711471 }
14721472
14731473 *command_ptr++ = 0;
--- a/src/gen9_vme.c
+++ b/src/gen9_vme.c
@@ -51,13 +51,13 @@
5151
5252 #define VME_INTRA_SHADER 0
5353 #define VME_INTER_SHADER 1
54-#define VME_BINTER_SHADER 2
54+#define VME_BINTER_SHADER 2
5555
5656 #define CURBE_ALLOCATION_SIZE 37 /* in 256-bit */
5757 #define CURBE_TOTAL_DATA_LENGTH (4 * 32) /* in byte, it should be less than or equal to CURBE_ALLOCATION_SIZE * 32 */
5858 #define CURBE_URB_ENTRY_LENGTH 4 /* in 256-bit, it should be less than or equal to CURBE_TOTAL_DATA_LENGTH / 32 */
5959
60-#define VME_MSG_LENGTH 32
60+#define VME_MSG_LENGTH 32
6161
6262 static const uint32_t gen9_vme_intra_frame[][4] = {
6363 #include "shaders/vme/intra_frame_gen9.g9b"
@@ -337,15 +337,15 @@ gen9_vme_surface_setup(VADriverContextP ctx,
337337 gen9_vme_media_chroma_source_surface_state(ctx, 6, obj_surface, encoder_context);
338338
339339 if (!is_intra) {
340- VAEncSliceParameterBufferH264 *slice_param = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[0]->buffer;
341- int slice_type;
340+ VAEncSliceParameterBufferH264 *slice_param = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[0]->buffer;
341+ int slice_type;
342342
343- slice_type = intel_avc_enc_slice_type_fixup(slice_param->slice_type);
344- assert(slice_type != SLICE_TYPE_I && slice_type != SLICE_TYPE_SI);
343+ slice_type = intel_avc_enc_slice_type_fixup(slice_param->slice_type);
344+ assert(slice_type != SLICE_TYPE_I && slice_type != SLICE_TYPE_SI);
345345
346- intel_avc_vme_reference_state(ctx, encode_state, encoder_context, 0, 1, gen9_vme_source_surface_state);
346+ intel_avc_vme_reference_state(ctx, encode_state, encoder_context, 0, 1, gen9_vme_source_surface_state);
347347
348- if (slice_type == SLICE_TYPE_B)
348+ if (slice_type == SLICE_TYPE_B)
349349 intel_avc_vme_reference_state(ctx, encode_state, encoder_context, 1, 2, gen9_vme_source_surface_state);
350350 }
351351
@@ -481,107 +481,107 @@ gen9wa_vme_walker_fill_vme_batchbuffer(VADriverContextP ctx,
481481 command_ptr = vme_context->vme_batchbuffer.bo->virtual;
482482
483483 for (s = 0; s < encode_state->num_slice_params_ext; s++) {
484- VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
485- int first_mb = pSliceParameter->macroblock_address;
486- int num_mb = pSliceParameter->num_macroblocks;
487- unsigned int mb_intra_ub, score_dep;
488- int x_outer, y_outer, x_inner, y_inner;
489- int xtemp_outer = 0;
490-
491- x_outer = first_mb % mb_width;
492- y_outer = first_mb / mb_width;
493- mb_row = y_outer;
494-
495- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
496- x_inner = x_outer;
497- y_inner = y_outer;
498- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
499- mb_intra_ub = 0;
500- score_dep = 0;
501- if (x_inner != 0) {
502- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
503- score_dep |= MB_SCOREBOARD_A;
484+ VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
485+ int first_mb = pSliceParameter->macroblock_address;
486+ int num_mb = pSliceParameter->num_macroblocks;
487+ unsigned int mb_intra_ub, score_dep;
488+ int x_outer, y_outer, x_inner, y_inner;
489+ int xtemp_outer = 0;
490+
491+ x_outer = first_mb % mb_width;
492+ y_outer = first_mb / mb_width;
493+ mb_row = y_outer;
494+
495+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
496+ x_inner = x_outer;
497+ y_inner = y_outer;
498+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
499+ mb_intra_ub = 0;
500+ score_dep = 0;
501+ if (x_inner != 0) {
502+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
503+ score_dep |= MB_SCOREBOARD_A;
504504 }
505- if (y_inner != mb_row) {
506- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
507- score_dep |= MB_SCOREBOARD_B;
508- if (x_inner != 0)
509- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
510- if (x_inner != (mb_width -1)) {
511- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
512- score_dep |= MB_SCOREBOARD_C;
505+ if (y_inner != mb_row) {
506+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
507+ score_dep |= MB_SCOREBOARD_B;
508+ if (x_inner != 0)
509+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
510+ if (x_inner != (mb_width -1)) {
511+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
512+ score_dep |= MB_SCOREBOARD_C;
513513 }
514- }
515-
516- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
517- *command_ptr++ = kernel;
518- *command_ptr++ = USE_SCOREBOARD;
519- /* Indirect data */
520- *command_ptr++ = 0;
521- /* the (X, Y) term of scoreboard */
522- *command_ptr++ = ((y_inner << 16) | x_inner);
523- *command_ptr++ = score_dep;
524- /*inline data */
525- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
526- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
514+ }
515+
516+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
517+ *command_ptr++ = kernel;
518+ *command_ptr++ = USE_SCOREBOARD;
519+ /* Indirect data */
520+ *command_ptr++ = 0;
521+ /* the (X, Y) term of scoreboard */
522+ *command_ptr++ = ((y_inner << 16) | x_inner);
523+ *command_ptr++ = score_dep;
524+ /*inline data */
525+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
526+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
527527 *command_ptr++ = CMD_MEDIA_STATE_FLUSH;
528528 *command_ptr++ = 0;
529529
530- x_inner -= 2;
531- y_inner += 1;
532- }
533- x_outer += 1;
534- }
530+ x_inner -= 2;
531+ y_inner += 1;
532+ }
533+ x_outer += 1;
534+ }
535535
536- xtemp_outer = mb_width - 2;
537- if (xtemp_outer < 0)
536+ xtemp_outer = mb_width - 2;
537+ if (xtemp_outer < 0)
538538 xtemp_outer = 0;
539- x_outer = xtemp_outer;
540- y_outer = first_mb / mb_width;
541- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
539+ x_outer = xtemp_outer;
540+ y_outer = first_mb / mb_width;
541+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
542542 y_inner = y_outer;
543- x_inner = x_outer;
544- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
545- mb_intra_ub = 0;
546- score_dep = 0;
547- if (x_inner != 0) {
548- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
549- score_dep |= MB_SCOREBOARD_A;
543+ x_inner = x_outer;
544+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
545+ mb_intra_ub = 0;
546+ score_dep = 0;
547+ if (x_inner != 0) {
548+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
549+ score_dep |= MB_SCOREBOARD_A;
550550 }
551- if (y_inner != mb_row) {
552- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
553- score_dep |= MB_SCOREBOARD_B;
554- if (x_inner != 0)
555- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
556-
557- if (x_inner != (mb_width -1)) {
558- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
559- score_dep |= MB_SCOREBOARD_C;
551+ if (y_inner != mb_row) {
552+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
553+ score_dep |= MB_SCOREBOARD_B;
554+ if (x_inner != 0)
555+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
556+
557+ if (x_inner != (mb_width -1)) {
558+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
559+ score_dep |= MB_SCOREBOARD_C;
560560 }
561- }
562-
563- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
564- *command_ptr++ = kernel;
565- *command_ptr++ = USE_SCOREBOARD;
566- /* Indirect data */
567- *command_ptr++ = 0;
568- /* the (X, Y) term of scoreboard */
569- *command_ptr++ = ((y_inner << 16) | x_inner);
570- *command_ptr++ = score_dep;
571- /*inline data */
572- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
573- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
561+ }
562+
563+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
564+ *command_ptr++ = kernel;
565+ *command_ptr++ = USE_SCOREBOARD;
566+ /* Indirect data */
567+ *command_ptr++ = 0;
568+ /* the (X, Y) term of scoreboard */
569+ *command_ptr++ = ((y_inner << 16) | x_inner);
570+ *command_ptr++ = score_dep;
571+ /*inline data */
572+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
573+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
574574
575575 *command_ptr++ = CMD_MEDIA_STATE_FLUSH;
576576 *command_ptr++ = 0;
577- x_inner -= 2;
578- y_inner += 1;
579- }
580- x_outer++;
581- if (x_outer >= mb_width) {
582- y_outer += 1;
583- x_outer = xtemp_outer;
584- }
577+ x_inner -= 2;
578+ y_inner += 1;
579+ }
580+ x_outer++;
581+ if (x_outer >= mb_width) {
582+ y_outer += 1;
583+ x_outer = xtemp_outer;
584+ }
585585 }
586586 }
587587
@@ -612,34 +612,34 @@ gen9_vme_fill_vme_batchbuffer(VADriverContextP ctx,
612612 int slice_mb_begin = pSliceParameter->macroblock_address;
613613 int slice_mb_number = pSliceParameter->num_macroblocks;
614614 unsigned int mb_intra_ub;
615- int slice_mb_x = pSliceParameter->macroblock_address % mb_width;
615+ int slice_mb_x = pSliceParameter->macroblock_address % mb_width;
616616 for (i = 0; i < slice_mb_number; ) {
617617 int mb_count = i + slice_mb_begin;
618618 mb_x = mb_count % mb_width;
619619 mb_y = mb_count / mb_width;
620- mb_intra_ub = 0;
621- if (mb_x != 0) {
622- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
623- }
624- if (mb_y != 0) {
625- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
626- if (mb_x != 0)
620+ mb_intra_ub = 0;
621+ if (mb_x != 0) {
622+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
623+ }
624+ if (mb_y != 0) {
625+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
626+ if (mb_x != 0)
627627 mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
628- if (mb_x != (mb_width -1))
628+ if (mb_x != (mb_width -1))
629629 mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
630- }
631- if (i < mb_width) {
632- if (i == 0)
630+ }
631+ if (i < mb_width) {
632+ if (i == 0)
633633 mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_AE);
634- mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_BCD_MASK);
635- if ((i == (mb_width - 1)) && slice_mb_x) {
634+ mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_BCD_MASK);
635+ if ((i == (mb_width - 1)) && slice_mb_x) {
636636 mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
637- }
638- }
637+ }
638+ }
639639
640- if ((i == mb_width) && slice_mb_x) {
641- mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_D);
642- }
640+ if ((i == mb_width) && slice_mb_x) {
641+ mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_D);
642+ }
643643 *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
644644 *command_ptr++ = kernel;
645645 *command_ptr++ = 0;
@@ -763,7 +763,7 @@ static VAStatus gen9_vme_prepare(VADriverContextP ctx,
763763
764764 if (!vme_context->h264_level ||
765765 (vme_context->h264_level != pSequenceParameter->level_idc)) {
766- vme_context->h264_level = pSequenceParameter->level_idc;
766+ vme_context->h264_level = pSequenceParameter->level_idc;
767767 }
768768
769769 intel_vme_update_mbmv_cost(ctx, encode_state, encoder_context);
@@ -893,109 +893,109 @@ gen9wa_vme_mpeg2_walker_fill_vme_batchbuffer(VADriverContextP ctx,
893893 command_ptr = vme_context->vme_batchbuffer.bo->virtual;
894894
895895 {
896- unsigned int mb_intra_ub, score_dep;
897- int x_outer, y_outer, x_inner, y_inner;
898- int xtemp_outer = 0;
899- int first_mb = 0;
900- int num_mb = mb_width * mb_height;
901-
902- x_outer = 0;
903- y_outer = 0;
904-
905- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
906- x_inner = x_outer;
907- y_inner = y_outer;
908- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
909- mb_intra_ub = 0;
910- score_dep = 0;
911- if (x_inner != 0) {
912- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
913- score_dep |= MB_SCOREBOARD_A;
896+ unsigned int mb_intra_ub, score_dep;
897+ int x_outer, y_outer, x_inner, y_inner;
898+ int xtemp_outer = 0;
899+ int first_mb = 0;
900+ int num_mb = mb_width * mb_height;
901+
902+ x_outer = 0;
903+ y_outer = 0;
904+
905+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
906+ x_inner = x_outer;
907+ y_inner = y_outer;
908+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
909+ mb_intra_ub = 0;
910+ score_dep = 0;
911+ if (x_inner != 0) {
912+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
913+ score_dep |= MB_SCOREBOARD_A;
914914 }
915- if (y_inner != 0) {
916- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
917- score_dep |= MB_SCOREBOARD_B;
918-
919- if (x_inner != 0)
920- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
921-
922- if (x_inner != (mb_width -1)) {
923- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
924- score_dep |= MB_SCOREBOARD_C;
925- }
926- }
927-
928- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
929- *command_ptr++ = kernel;
930- *command_ptr++ = MPEG2_SCOREBOARD;
931- /* Indirect data */
932- *command_ptr++ = 0;
933- /* the (X, Y) term of scoreboard */
934- *command_ptr++ = ((y_inner << 16) | x_inner);
935- *command_ptr++ = score_dep;
936- /*inline data */
937- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
938- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
915+ if (y_inner != 0) {
916+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
917+ score_dep |= MB_SCOREBOARD_B;
918+
919+ if (x_inner != 0)
920+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
921+
922+ if (x_inner != (mb_width -1)) {
923+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
924+ score_dep |= MB_SCOREBOARD_C;
925+ }
926+ }
927+
928+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
929+ *command_ptr++ = kernel;
930+ *command_ptr++ = MPEG2_SCOREBOARD;
931+ /* Indirect data */
932+ *command_ptr++ = 0;
933+ /* the (X, Y) term of scoreboard */
934+ *command_ptr++ = ((y_inner << 16) | x_inner);
935+ *command_ptr++ = score_dep;
936+ /*inline data */
937+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
938+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
939939 *command_ptr++ = CMD_MEDIA_STATE_FLUSH;
940940 *command_ptr++ = 0;
941941
942- x_inner -= 2;
943- y_inner += 1;
944- }
945- x_outer += 1;
946- }
942+ x_inner -= 2;
943+ y_inner += 1;
944+ }
945+ x_outer += 1;
946+ }
947947
948- xtemp_outer = mb_width - 2;
949- if (xtemp_outer < 0)
948+ xtemp_outer = mb_width - 2;
949+ if (xtemp_outer < 0)
950950 xtemp_outer = 0;
951- x_outer = xtemp_outer;
952- y_outer = 0;
953- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
951+ x_outer = xtemp_outer;
952+ y_outer = 0;
953+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
954954 y_inner = y_outer;
955- x_inner = x_outer;
956- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
957- mb_intra_ub = 0;
958- score_dep = 0;
959- if (x_inner != 0) {
960- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
961- score_dep |= MB_SCOREBOARD_A;
955+ x_inner = x_outer;
956+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
957+ mb_intra_ub = 0;
958+ score_dep = 0;
959+ if (x_inner != 0) {
960+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
961+ score_dep |= MB_SCOREBOARD_A;
962962 }
963- if (y_inner != 0) {
964- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
965- score_dep |= MB_SCOREBOARD_B;
966-
967- if (x_inner != 0)
968- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
969-
970- if (x_inner != (mb_width -1)) {
971- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
972- score_dep |= MB_SCOREBOARD_C;
973- }
974- }
975-
976- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
977- *command_ptr++ = kernel;
978- *command_ptr++ = MPEG2_SCOREBOARD;
979- /* Indirect data */
980- *command_ptr++ = 0;
981- /* the (X, Y) term of scoreboard */
982- *command_ptr++ = ((y_inner << 16) | x_inner);
983- *command_ptr++ = score_dep;
984- /*inline data */
985- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
986- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
963+ if (y_inner != 0) {
964+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
965+ score_dep |= MB_SCOREBOARD_B;
966+
967+ if (x_inner != 0)
968+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
969+
970+ if (x_inner != (mb_width -1)) {
971+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
972+ score_dep |= MB_SCOREBOARD_C;
973+ }
974+ }
975+
976+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
977+ *command_ptr++ = kernel;
978+ *command_ptr++ = MPEG2_SCOREBOARD;
979+ /* Indirect data */
980+ *command_ptr++ = 0;
981+ /* the (X, Y) term of scoreboard */
982+ *command_ptr++ = ((y_inner << 16) | x_inner);
983+ *command_ptr++ = score_dep;
984+ /*inline data */
985+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
986+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
987987
988988 *command_ptr++ = CMD_MEDIA_STATE_FLUSH;
989989 *command_ptr++ = 0;
990- x_inner -= 2;
991- y_inner += 1;
992- }
993- x_outer++;
994- if (x_outer >= mb_width) {
995- y_outer += 1;
996- x_outer = xtemp_outer;
990+ x_inner -= 2;
991+ y_inner += 1;
992+ }
993+ x_outer++;
994+ if (x_outer >= mb_width) {
995+ y_outer += 1;
996+ x_outer = xtemp_outer;
997997 }
998- }
998+ }
999999 }
10001000
10011001 *command_ptr++ = MI_BATCH_BUFFER_END;
@@ -1094,23 +1094,23 @@ gen9_vme_mpeg2_pipeline_programing(VADriverContextP ctx,
10941094 VAEncPictureParameterBufferMPEG2 *pic_param = NULL;
10951095
10961096 for (s = 0; s < encode_state->num_slice_params_ext; s++) {
1097- int j;
1097+ int j;
10981098 VAEncSliceParameterBufferMPEG2 *slice_param = (VAEncSliceParameterBufferMPEG2 *)encode_state->slice_params_ext[s]->buffer;
10991099
11001100 for (j = 0; j < encode_state->slice_params_ext[s]->num_elements; j++) {
1101- if (slice_param->macroblock_address % width_in_mbs) {
1102- allow_hwscore = false;
1103- break;
1104- }
1105- }
1101+ if (slice_param->macroblock_address % width_in_mbs) {
1102+ allow_hwscore = false;
1103+ break;
1104+ }
1105+ }
11061106 }
11071107
11081108 pic_param = (VAEncPictureParameterBufferMPEG2 *)encode_state->pic_param_ext->buffer;
11091109 if (pic_param->picture_type == VAEncPictureTypeIntra) {
1110- allow_hwscore = false;
1111- kernel_shader = VME_INTRA_SHADER;
1110+ allow_hwscore = false;
1111+ kernel_shader = VME_INTRA_SHADER;
11121112 } else {
1113- kernel_shader = VME_INTER_SHADER;
1113+ kernel_shader = VME_INTER_SHADER;
11141114 }
11151115
11161116 if (allow_hwscore)
@@ -1120,7 +1120,7 @@ gen9_vme_mpeg2_pipeline_programing(VADriverContextP ctx,
11201120 kernel_shader,
11211121 encoder_context);
11221122 else
1123- gen9_vme_mpeg2_fill_vme_batchbuffer(ctx,
1123+ gen9_vme_mpeg2_fill_vme_batchbuffer(ctx,
11241124 encode_state,
11251125 width_in_mbs, height_in_mbs,
11261126 is_intra ? VME_INTRA_SHADER : VME_INTER_SHADER,
@@ -1156,7 +1156,7 @@ gen9_vme_mpeg2_prepare(VADriverContextP ctx,
11561156
11571157 if ((!vme_context->mpeg2_level) ||
11581158 (vme_context->mpeg2_level != (seq_param->sequence_extension.bits.profile_and_level_indication & MPEG2_LEVEL_MASK))) {
1159- vme_context->mpeg2_level = seq_param->sequence_extension.bits.profile_and_level_indication & MPEG2_LEVEL_MASK;
1159+ vme_context->mpeg2_level = seq_param->sequence_extension.bits.profile_and_level_indication & MPEG2_LEVEL_MASK;
11601160 }
11611161
11621162 /*Setup all the memory object*/
@@ -1772,8 +1772,8 @@ gen9_vme_context_destroy(void *context)
17721772 vme_context->vme_batchbuffer.bo = NULL;
17731773
17741774 if (vme_context->vme_state_message) {
1775- free(vme_context->vme_state_message);
1776- vme_context->vme_state_message = NULL;
1775+ free(vme_context->vme_state_message);
1776+ vme_context->vme_state_message = NULL;
17771777 }
17781778
17791779 free(vme_context);
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -501,7 +501,7 @@ static void cpuid(unsigned int op,
501501 uint32_t *eax, uint32_t *ebx,
502502 uint32_t *ecx, uint32_t *edx)
503503 {
504- __cpuid_count(op, 0, *eax, *ebx, *ecx, *edx);
504+ __cpuid_count(op, 0, *eax, *ebx, *ecx, *edx);
505505 }
506506
507507 /*
@@ -522,7 +522,7 @@ static int intel_driver_detect_cpustring(char *model_id)
522522
523523 /* If the max extended CPUID info is less than 0x80000004, fail */
524524 if (rdata[0] < 0x80000004)
525- return -EINVAL;
525+ return -EINVAL;
526526
527527 /* obtain the CPUID string */
528528 cpuid(0x80000002, &rdata[0], &rdata[1], &rdata[2], &rdata[3]);
@@ -584,18 +584,18 @@ static void hsw_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *cod
584584 model_ptr = (char *)hsw_cpu_hook_list[i];
585585
586586 if (strlen(model_ptr) != model_len)
587- continue;
587+ continue;
588588
589589 if (strncasecmp(model_string, model_ptr, model_len) == 0) {
590590 found = true;
591591 break;
592- }
592+ }
593593 }
594594
595595 if (found) {
596- codec_info->has_h264_encoding = 0;
597- codec_info->has_h264_mvc_encoding = 0;
598- codec_info->has_mpeg2_encoding = 0;
596+ codec_info->has_h264_encoding = 0;
597+ codec_info->has_h264_mvc_encoding = 0;
598+ codec_info->has_mpeg2_encoding = 0;
599599 }
600600 return;
601601 }
@@ -712,7 +712,7 @@ static void gen7_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *co
712712 if (strncasecmp(model_string, model_ptr, model_len) == 0) {
713713 found = true;
714714 break;
715- }
715+ }
716716 }
717717
718718 if (found) {
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -753,37 +753,37 @@ i965_GetConfigAttributes(VADriverContextP ctx,
753753 }
754754 break;
755755
756- case VAConfigAttribEncMaxRefFrames:
757- if (entrypoint == VAEntrypointEncSlice) {
758- attrib_list[i].value = (1 << 16) | (1 << 0);
759- break;
760- }
756+ case VAConfigAttribEncMaxRefFrames:
757+ if (entrypoint == VAEntrypointEncSlice) {
758+ attrib_list[i].value = (1 << 16) | (1 << 0);
759+ break;
760+ }
761761 break;
762762
763- case VAConfigAttribEncQualityRange:
764- if (entrypoint == VAEntrypointEncSlice) {
765- attrib_list[i].value = 1;
763+ case VAConfigAttribEncQualityRange:
764+ if (entrypoint == VAEntrypointEncSlice) {
765+ attrib_list[i].value = 1;
766766 if (profile == VAProfileH264ConstrainedBaseline ||
767767 profile == VAProfileH264Main ||
768768 profile == VAProfileH264High )
769769 attrib_list[i].value = ENCODER_QUALITY_RANGE;
770- break;
771- }
770+ break;
771+ }
772772 break;
773773
774- case VAConfigAttribEncJPEG:
775- if( entrypoint == VAEntrypointEncPicture) {
776- VAConfigAttribValEncJPEG *configVal = (VAConfigAttribValEncJPEG*)&(attrib_list[i].value);
777- (configVal->bits).arithmatic_coding_mode = 0; // Huffman coding is used
778- (configVal->bits).progressive_dct_mode = 0; // Only Sequential DCT is supported
779- (configVal->bits).non_interleaved_mode = 1; // Support both interleaved and non-interleaved
780- (configVal->bits).differential_mode = 0; // Baseline DCT is non-differential
781- (configVal->bits).max_num_components = 3; // Only 3 components supported
782- (configVal->bits).max_num_scans = 1; // Only 1 scan per frame
783- (configVal->bits).max_num_huffman_tables = 3; // Max 3 huffman tables
784- (configVal->bits).max_num_quantization_tables = 3; // Max 3 quantization tables
785- }
786- break;
774+ case VAConfigAttribEncJPEG:
775+ if( entrypoint == VAEntrypointEncPicture) {
776+ VAConfigAttribValEncJPEG *configVal = (VAConfigAttribValEncJPEG*)&(attrib_list[i].value);
777+ (configVal->bits).arithmatic_coding_mode = 0; // Huffman coding is used
778+ (configVal->bits).progressive_dct_mode = 0; // Only Sequential DCT is supported
779+ (configVal->bits).non_interleaved_mode = 1; // Support both interleaved and non-interleaved
780+ (configVal->bits).differential_mode = 0; // Baseline DCT is non-differential
781+ (configVal->bits).max_num_components = 3; // Only 3 components supported
782+ (configVal->bits).max_num_scans = 1; // Only 1 scan per frame
783+ (configVal->bits).max_num_huffman_tables = 3; // Max 3 huffman tables
784+ (configVal->bits).max_num_quantization_tables = 3; // Max 3 quantization tables
785+ }
786+ break;
787787
788788 default:
789789 /* Do nothing */
@@ -987,7 +987,7 @@ i965_surface_native_memory(VADriverContextP ctx,
987987 expected_fourcc == VA_FOURCC_YV12 ||
988988 expected_fourcc == VA_FOURCC_YV16)
989989 tiling = 0;
990-
990+
991991 i965_check_alloc_surface_bo(ctx, obj_surface, tiling, expected_fourcc, get_sampling_from_fourcc(expected_fourcc));
992992
993993 return VA_STATUS_SUCCESS;
@@ -3236,10 +3236,10 @@ i965_CreateImage(VADriverContextP ctx,
32363236 awidth = ALIGN(width, i965->codec_info->min_linear_wpitch);
32373237
32383238 if ((format->fourcc == VA_FOURCC_YV12) ||
3239- (format->fourcc == VA_FOURCC_I420)) {
3240- if (awidth % 128 != 0) {
3241- awidth = ALIGN(width, 128);
3242- }
3239+ (format->fourcc == VA_FOURCC_I420)) {
3240+ if (awidth % 128 != 0) {
3241+ awidth = ALIGN(width, 128);
3242+ }
32433243 }
32443244
32453245 aheight = ALIGN(height, i965->codec_info->min_linear_hpitch);