summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQu,Pengfei <Pengfei.Qu@intel.com>2015-01-08 16:41:26 +0800
committerXiang, Haihao <haihao.xiang@intel.com>2015-03-20 13:06:28 +0800
commit119ac34233b37b5f0630499331f648fc37084510 (patch)
tree06341fd243e7b8edd59c424ee50e5b7b79d3caa4
parentc19bd83824c80b8e2039f937c096aae91da7f1e1 (diff)
Just Style alignment
Signed-off-by: Qu,Pengfei <Pengfei.Qu@intel.com> (cherry picked from commit 22439f1fcebbd2c1d563503720b1123a4bb97160)
-rw-r--r--src/gen6_mfc_common.c460
-rw-r--r--src/gen9_vme.c440
-rw-r--r--src/i965_device_info.c16
-rw-r--r--src/i965_drv_video.c56
4 files changed, 486 insertions, 486 deletions
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c
index 3e876c9..a6b418c 100644
--- a/src/gen6_mfc_common.c
+++ b/src/gen6_mfc_common.c
@@ -631,8 +631,8 @@ VAStatus intel_mfc_avc_prepare(VADriverContextP ctx,
int height_in_mbs = pSequenceParameter->picture_height_in_mbs;
if (IS_GEN6(i965->intel.device_info)) {
- /* On the SNB it should be fixed to 128 for the DMV buffer */
- width_in_mbs = 128;
+ /* On the SNB it should be fixed to 128 for the DMV buffer */
+ width_in_mbs = 128;
}
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,
break;
}
}
-
+
mfc_context->uncompressed_picture_source.bo = encode_state->input_yuv_object->bo;
dri_bo_reference(mfc_context->uncompressed_picture_source.bo);
@@ -807,7 +807,7 @@ int intel_format_lutvalue(int value, int max)
if (temp1 > temp2)
ret = max;
return ret;
-
+
}
@@ -842,40 +842,40 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
if (encoder_context->rate_control_mode == VA_RC_CQP)
- qp = pic_param->pic_init_qp + slice_param->slice_qp_delta;
+ qp = pic_param->pic_init_qp + slice_param->slice_qp_delta;
else
- qp = mfc_context->bit_rate_control_context[slice_type].QpPrimeY;
-
+ qp = mfc_context->bit_rate_control_context[slice_type].QpPrimeY;
+
if (vme_state_message == NULL)
- return;
-
+ return;
+
assert(qp <= QP_MAX);
lambda = intel_lambda_qp(qp);
if (slice_type == SLICE_TYPE_I) {
- vme_state_message[MODE_INTRA_16X16] = 0;
- m_cost = lambda * 4;
- vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
- m_cost = lambda * 16;
- vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
- m_cost = lambda * 3;
- vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
+ vme_state_message[MODE_INTRA_16X16] = 0;
+ m_cost = lambda * 4;
+ vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
+ m_cost = lambda * 16;
+ vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
+ m_cost = lambda * 3;
+ vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
} else {
- m_cost = 0;
- vme_state_message[MODE_INTER_MV0] = intel_format_lutvalue(m_cost, 0x6f);
- for (j = 1; j < 3; j++) {
+ m_cost = 0;
+ vme_state_message[MODE_INTER_MV0] = intel_format_lutvalue(m_cost, 0x6f);
+ for (j = 1; j < 3; j++) {
m_costf = (log2f((float)(j + 1)) + 1.718f) * lambda;
m_cost = (int)m_costf;
vme_state_message[MODE_INTER_MV0 + j] = intel_format_lutvalue(m_cost, 0x6f);
- }
- mv_count = 3;
- for (j = 4; j <= 64; j *= 2) {
+ }
+ mv_count = 3;
+ for (j = 4; j <= 64; j *= 2) {
m_costf = (log2f((float)(j + 1)) + 1.718f) * lambda;
m_cost = (int)m_costf;
vme_state_message[MODE_INTER_MV0 + mv_count] = intel_format_lutvalue(m_cost, 0x6f);
mv_count++;
- }
+ }
- if (qp <= 25) {
+ if (qp <= 25) {
vme_state_message[MODE_INTRA_16X16] = 0x4a;
vme_state_message[MODE_INTRA_8X8] = 0x4a;
vme_state_message[MODE_INTRA_4X4] = 0x4a;
@@ -887,17 +887,17 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
vme_state_message[MODE_INTER_4X4] = 0x4a;
vme_state_message[MODE_INTER_BWD] = 0x2a;
return;
- }
- m_costf = lambda * 10;
- vme_state_message[MODE_INTRA_16X16] = intel_format_lutvalue(m_cost, 0x8f);
- m_cost = lambda * 14;
- vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
- m_cost = lambda * 24;
- vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
- m_costf = lambda * 3.5;
- m_cost = m_costf;
- vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
- if (slice_type == SLICE_TYPE_P) {
+ }
+ m_costf = lambda * 10;
+ vme_state_message[MODE_INTRA_16X16] = intel_format_lutvalue(m_cost, 0x8f);
+ m_cost = lambda * 14;
+ vme_state_message[MODE_INTRA_8X8] = intel_format_lutvalue(m_cost, 0x8f);
+ m_cost = lambda * 24;
+ vme_state_message[MODE_INTRA_4X4] = intel_format_lutvalue(m_cost, 0x8f);
+ m_costf = lambda * 3.5;
+ m_cost = m_costf;
+ vme_state_message[MODE_INTRA_NONPRED] = intel_format_lutvalue(m_cost, 0x6f);
+ if (slice_type == SLICE_TYPE_P) {
m_costf = lambda * 2.5;
m_cost = m_costf;
vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
@@ -915,7 +915,7 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
vme_state_message[MODE_INTER_4X4] = intel_format_lutvalue(m_cost, 0x6f);
/* BWD is not used in P-frame */
vme_state_message[MODE_INTER_BWD] = 0;
- } else {
+ } else {
m_costf = lambda * 2.5;
m_cost = m_costf;
vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
@@ -934,7 +934,7 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx,
m_costf = lambda * 1.5;
m_cost = m_costf;
vme_state_message[MODE_INTER_BWD] = intel_format_lutvalue(m_cost, 0x6f);
- }
+ }
}
}
@@ -1030,7 +1030,7 @@ gen7_vme_scoreboard_init(VADriverContextP ctx, struct gen6_vme_context *vme_cont
vme_context->gpe_context.vfe_desc6.scoreboard1.delta_y1 = -1;
vme_context->gpe_context.vfe_desc6.scoreboard1.delta_x2 = 1;
vme_context->gpe_context.vfe_desc6.scoreboard1.delta_y2 = -1;
-
+
vme_context->gpe_context.vfe_desc7.dword = 0;
return;
}
@@ -1043,7 +1043,7 @@ static inline int loop_in_bounds(int x_index, int y_index, int first_mb, int num
return -1;
if (y_index < 0 || y_index >= mb_height)
return -1;
-
+
mb_index = y_index * mb_width + x_index;
if (mb_index < first_mb || mb_index > (first_mb + num_mb))
return -1;
@@ -1069,103 +1069,103 @@ gen7_vme_walker_fill_vme_batchbuffer(VADriverContextP ctx,
command_ptr = vme_context->vme_batchbuffer.bo->virtual;
for (s = 0; s < encode_state->num_slice_params_ext; s++) {
- VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
- int first_mb = pSliceParameter->macroblock_address;
- int num_mb = pSliceParameter->num_macroblocks;
- unsigned int mb_intra_ub, score_dep;
- int x_outer, y_outer, x_inner, y_inner;
- int xtemp_outer = 0;
-
- x_outer = first_mb % mb_width;
- y_outer = first_mb / mb_width;
- mb_row = y_outer;
-
- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
- x_inner = x_outer;
- y_inner = y_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
- }
- if (y_inner != mb_row) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
+ VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
+ int first_mb = pSliceParameter->macroblock_address;
+ int num_mb = pSliceParameter->num_macroblocks;
+ unsigned int mb_intra_ub, score_dep;
+ int x_outer, y_outer, x_inner, y_inner;
+ int xtemp_outer = 0;
+
+ x_outer = first_mb % mb_width;
+ y_outer = first_mb / mb_width;
+ mb_row = y_outer;
+
+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ x_inner = x_outer;
+ y_inner = y_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
+ }
+ if (y_inner != mb_row) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
}
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = USE_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer += 1;
- }
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = USE_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer += 1;
+ }
- xtemp_outer = mb_width - 2;
- if (xtemp_outer < 0)
+ xtemp_outer = mb_width - 2;
+ if (xtemp_outer < 0)
xtemp_outer = 0;
- x_outer = xtemp_outer;
- y_outer = first_mb / mb_width;
- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
- y_inner = y_outer;
- x_inner = x_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
- }
- if (y_inner != mb_row) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
-
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
+ x_outer = xtemp_outer;
+ y_outer = first_mb / mb_width;
+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ y_inner = y_outer;
+ x_inner = x_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
+ }
+ if (y_inner != mb_row) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
}
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = USE_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
-
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer++;
- if (x_outer >= mb_width) {
- y_outer += 1;
- x_outer = xtemp_outer;
- }
- }
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = USE_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
+
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer++;
+ if (x_outer >= mb_width) {
+ y_outer += 1;
+ x_outer = xtemp_outer;
+ }
+ }
}
*command_ptr++ = 0;
@@ -1339,7 +1339,7 @@ void intel_vme_mpeg2_state_setup(VADriverContextP ctx,
*/
vme_state_message[MODE_INTRA_16X16] = intel_format_lutvalue(m_cost, 0x8f);
vme_state_message[MODE_INTER_16X16] = intel_format_lutvalue(m_cost, 0x8f);
-
+
vme_state_message[MODE_INTER_16X8] = 0;
vme_state_message[MODE_INTER_8X8] = 0;
vme_state_message[MODE_INTER_8X4] = 0;
@@ -1369,105 +1369,105 @@ gen7_vme_mpeg2_walker_fill_vme_batchbuffer(VADriverContextP ctx,
command_ptr = vme_context->vme_batchbuffer.bo->virtual;
{
- unsigned int mb_intra_ub, score_dep;
- int x_outer, y_outer, x_inner, y_inner;
- int xtemp_outer = 0;
- int first_mb = 0;
- int num_mb = mb_width * mb_height;
-
- x_outer = 0;
- y_outer = 0;
-
-
- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
- x_inner = x_outer;
- y_inner = y_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
- }
- if (y_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
-
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
-
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
- }
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = MPEG2_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer += 1;
- }
+ unsigned int mb_intra_ub, score_dep;
+ int x_outer, y_outer, x_inner, y_inner;
+ int xtemp_outer = 0;
+ int first_mb = 0;
+ int num_mb = mb_width * mb_height;
+
+ x_outer = 0;
+ y_outer = 0;
+
+
+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ x_inner = x_outer;
+ y_inner = y_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
+ }
+ if (y_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
+ }
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = MPEG2_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer += 1;
+ }
- xtemp_outer = mb_width - 2;
- if (xtemp_outer < 0)
+ xtemp_outer = mb_width - 2;
+ if (xtemp_outer < 0)
xtemp_outer = 0;
- x_outer = xtemp_outer;
- y_outer = 0;
- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
- y_inner = y_outer;
- x_inner = x_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
- }
- if (y_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
-
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
-
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
- }
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = MPEG2_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
-
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer++;
- if (x_outer >= mb_width) {
- y_outer += 1;
- x_outer = xtemp_outer;
- }
- }
+ x_outer = xtemp_outer;
+ y_outer = 0;
+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ y_inner = y_outer;
+ x_inner = x_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
+ }
+ if (y_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
+ }
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = MPEG2_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
+
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer++;
+ if (x_outer >= mb_width) {
+ y_outer += 1;
+ x_outer = xtemp_outer;
+ }
+ }
}
*command_ptr++ = 0;
diff --git a/src/gen9_vme.c b/src/gen9_vme.c
index 1d2a814..39ac180 100644
--- a/src/gen9_vme.c
+++ b/src/gen9_vme.c
@@ -51,13 +51,13 @@
#define VME_INTRA_SHADER 0
#define VME_INTER_SHADER 1
-#define VME_BINTER_SHADER 2
+#define VME_BINTER_SHADER 2
#define CURBE_ALLOCATION_SIZE 37 /* in 256-bit */
#define CURBE_TOTAL_DATA_LENGTH (4 * 32) /* in byte, it should be less than or equal to CURBE_ALLOCATION_SIZE * 32 */
#define CURBE_URB_ENTRY_LENGTH 4 /* in 256-bit, it should be less than or equal to CURBE_TOTAL_DATA_LENGTH / 32 */
-#define VME_MSG_LENGTH 32
+#define VME_MSG_LENGTH 32
static const uint32_t gen9_vme_intra_frame[][4] = {
#include "shaders/vme/intra_frame_gen9.g9b"
@@ -337,15 +337,15 @@ gen9_vme_surface_setup(VADriverContextP ctx,
gen9_vme_media_chroma_source_surface_state(ctx, 6, obj_surface, encoder_context);
if (!is_intra) {
- VAEncSliceParameterBufferH264 *slice_param = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[0]->buffer;
- int slice_type;
+ VAEncSliceParameterBufferH264 *slice_param = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[0]->buffer;
+ int slice_type;
- slice_type = intel_avc_enc_slice_type_fixup(slice_param->slice_type);
- assert(slice_type != SLICE_TYPE_I && slice_type != SLICE_TYPE_SI);
+ slice_type = intel_avc_enc_slice_type_fixup(slice_param->slice_type);
+ assert(slice_type != SLICE_TYPE_I && slice_type != SLICE_TYPE_SI);
- intel_avc_vme_reference_state(ctx, encode_state, encoder_context, 0, 1, gen9_vme_source_surface_state);
+ intel_avc_vme_reference_state(ctx, encode_state, encoder_context, 0, 1, gen9_vme_source_surface_state);
- if (slice_type == SLICE_TYPE_B)
+ if (slice_type == SLICE_TYPE_B)
intel_avc_vme_reference_state(ctx, encode_state, encoder_context, 1, 2, gen9_vme_source_surface_state);
}
@@ -481,107 +481,107 @@ gen9wa_vme_walker_fill_vme_batchbuffer(VADriverContextP ctx,
command_ptr = vme_context->vme_batchbuffer.bo->virtual;
for (s = 0; s < encode_state->num_slice_params_ext; s++) {
- VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
- int first_mb = pSliceParameter->macroblock_address;
- int num_mb = pSliceParameter->num_macroblocks;
- unsigned int mb_intra_ub, score_dep;
- int x_outer, y_outer, x_inner, y_inner;
- int xtemp_outer = 0;
-
- x_outer = first_mb % mb_width;
- y_outer = first_mb / mb_width;
- mb_row = y_outer;
-
- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
- x_inner = x_outer;
- y_inner = y_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
+ VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer;
+ int first_mb = pSliceParameter->macroblock_address;
+ int num_mb = pSliceParameter->num_macroblocks;
+ unsigned int mb_intra_ub, score_dep;
+ int x_outer, y_outer, x_inner, y_inner;
+ int xtemp_outer = 0;
+
+ x_outer = first_mb % mb_width;
+ y_outer = first_mb / mb_width;
+ mb_row = y_outer;
+
+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ x_inner = x_outer;
+ y_inner = y_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
}
- if (y_inner != mb_row) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
+ if (y_inner != mb_row) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
}
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = USE_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = USE_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
*command_ptr++ = CMD_MEDIA_STATE_FLUSH;
*command_ptr++ = 0;
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer += 1;
- }
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer += 1;
+ }
- xtemp_outer = mb_width - 2;
- if (xtemp_outer < 0)
+ xtemp_outer = mb_width - 2;
+ if (xtemp_outer < 0)
xtemp_outer = 0;
- x_outer = xtemp_outer;
- y_outer = first_mb / mb_width;
- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ x_outer = xtemp_outer;
+ y_outer = first_mb / mb_width;
+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
y_inner = y_outer;
- x_inner = x_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
+ x_inner = x_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
}
- if (y_inner != mb_row) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
-
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
+ if (y_inner != mb_row) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
}
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = USE_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = USE_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
*command_ptr++ = CMD_MEDIA_STATE_FLUSH;
*command_ptr++ = 0;
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer++;
- if (x_outer >= mb_width) {
- y_outer += 1;
- x_outer = xtemp_outer;
- }
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer++;
+ if (x_outer >= mb_width) {
+ y_outer += 1;
+ x_outer = xtemp_outer;
+ }
}
}
@@ -612,34 +612,34 @@ gen9_vme_fill_vme_batchbuffer(VADriverContextP ctx,
int slice_mb_begin = pSliceParameter->macroblock_address;
int slice_mb_number = pSliceParameter->num_macroblocks;
unsigned int mb_intra_ub;
- int slice_mb_x = pSliceParameter->macroblock_address % mb_width;
+ int slice_mb_x = pSliceParameter->macroblock_address % mb_width;
for (i = 0; i < slice_mb_number; ) {
int mb_count = i + slice_mb_begin;
mb_x = mb_count % mb_width;
mb_y = mb_count / mb_width;
- mb_intra_ub = 0;
- if (mb_x != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- }
- if (mb_y != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- if (mb_x != 0)
+ mb_intra_ub = 0;
+ if (mb_x != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ }
+ if (mb_y != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ if (mb_x != 0)
mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
- if (mb_x != (mb_width -1))
+ if (mb_x != (mb_width -1))
mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- }
- if (i < mb_width) {
- if (i == 0)
+ }
+ if (i < mb_width) {
+ if (i == 0)
mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_AE);
- mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_BCD_MASK);
- if ((i == (mb_width - 1)) && slice_mb_x) {
+ mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_BCD_MASK);
+ if ((i == (mb_width - 1)) && slice_mb_x) {
mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- }
- }
+ }
+ }
- if ((i == mb_width) && slice_mb_x) {
- mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_D);
- }
+ if ((i == mb_width) && slice_mb_x) {
+ mb_intra_ub &= ~(INTRA_PRED_AVAIL_FLAG_D);
+ }
*command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
*command_ptr++ = kernel;
*command_ptr++ = 0;
@@ -763,7 +763,7 @@ static VAStatus gen9_vme_prepare(VADriverContextP ctx,
if (!vme_context->h264_level ||
(vme_context->h264_level != pSequenceParameter->level_idc)) {
- vme_context->h264_level = pSequenceParameter->level_idc;
+ vme_context->h264_level = pSequenceParameter->level_idc;
}
intel_vme_update_mbmv_cost(ctx, encode_state, encoder_context);
@@ -893,109 +893,109 @@ gen9wa_vme_mpeg2_walker_fill_vme_batchbuffer(VADriverContextP ctx,
command_ptr = vme_context->vme_batchbuffer.bo->virtual;
{
- unsigned int mb_intra_ub, score_dep;
- int x_outer, y_outer, x_inner, y_inner;
- int xtemp_outer = 0;
- int first_mb = 0;
- int num_mb = mb_width * mb_height;
-
- x_outer = 0;
- y_outer = 0;
-
- for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
- x_inner = x_outer;
- y_inner = y_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
+ unsigned int mb_intra_ub, score_dep;
+ int x_outer, y_outer, x_inner, y_inner;
+ int xtemp_outer = 0;
+ int first_mb = 0;
+ int num_mb = mb_width * mb_height;
+
+ x_outer = 0;
+ y_outer = 0;
+
+ for (; x_outer < (mb_width -2 ) && !loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ x_inner = x_outer;
+ y_inner = y_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
}
- if (y_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
-
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
-
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
- }
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = MPEG2_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
+ if (y_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
+ }
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = MPEG2_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
*command_ptr++ = CMD_MEDIA_STATE_FLUSH;
*command_ptr++ = 0;
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer += 1;
- }
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer += 1;
+ }
- xtemp_outer = mb_width - 2;
- if (xtemp_outer < 0)
+ xtemp_outer = mb_width - 2;
+ if (xtemp_outer < 0)
xtemp_outer = 0;
- x_outer = xtemp_outer;
- y_outer = 0;
- for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
+ x_outer = xtemp_outer;
+ y_outer = 0;
+ for (;!loop_in_bounds(x_outer, y_outer, first_mb, num_mb, mb_width, mb_height); ) {
y_inner = y_outer;
- x_inner = x_outer;
- for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
- mb_intra_ub = 0;
- score_dep = 0;
- if (x_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
- score_dep |= MB_SCOREBOARD_A;
+ x_inner = x_outer;
+ for (; !loop_in_bounds(x_inner, y_inner, first_mb, num_mb, mb_width, mb_height);) {
+ mb_intra_ub = 0;
+ score_dep = 0;
+ if (x_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_AE;
+ score_dep |= MB_SCOREBOARD_A;
}
- if (y_inner != 0) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
- score_dep |= MB_SCOREBOARD_B;
-
- if (x_inner != 0)
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
-
- if (x_inner != (mb_width -1)) {
- mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
- score_dep |= MB_SCOREBOARD_C;
- }
- }
-
- *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
- *command_ptr++ = kernel;
- *command_ptr++ = MPEG2_SCOREBOARD;
- /* Indirect data */
- *command_ptr++ = 0;
- /* the (X, Y) term of scoreboard */
- *command_ptr++ = ((y_inner << 16) | x_inner);
- *command_ptr++ = score_dep;
- /*inline data */
- *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
- *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
+ if (y_inner != 0) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_B;
+ score_dep |= MB_SCOREBOARD_B;
+
+ if (x_inner != 0)
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_D;
+
+ if (x_inner != (mb_width -1)) {
+ mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
+ score_dep |= MB_SCOREBOARD_C;
+ }
+ }
+
+ *command_ptr++ = (CMD_MEDIA_OBJECT | (8 - 2));
+ *command_ptr++ = kernel;
+ *command_ptr++ = MPEG2_SCOREBOARD;
+ /* Indirect data */
+ *command_ptr++ = 0;
+ /* the (X, Y) term of scoreboard */
+ *command_ptr++ = ((y_inner << 16) | x_inner);
+ *command_ptr++ = score_dep;
+ /*inline data */
+ *command_ptr++ = (mb_width << 16 | y_inner << 8 | x_inner);
+ *command_ptr++ = ((1 << 18) | (1 << 16) | (mb_intra_ub << 8));
*command_ptr++ = CMD_MEDIA_STATE_FLUSH;
*command_ptr++ = 0;
- x_inner -= 2;
- y_inner += 1;
- }
- x_outer++;
- if (x_outer >= mb_width) {
- y_outer += 1;
- x_outer = xtemp_outer;
+ x_inner -= 2;
+ y_inner += 1;
+ }
+ x_outer++;
+ if (x_outer >= mb_width) {
+ y_outer += 1;
+ x_outer = xtemp_outer;
}
- }
+ }
}
*command_ptr++ = MI_BATCH_BUFFER_END;
@@ -1094,23 +1094,23 @@ gen9_vme_mpeg2_pipeline_programing(VADriverContextP ctx,
VAEncPictureParameterBufferMPEG2 *pic_param = NULL;
for (s = 0; s < encode_state->num_slice_params_ext; s++) {
- int j;
+ int j;
VAEncSliceParameterBufferMPEG2 *slice_param = (VAEncSliceParameterBufferMPEG2 *)encode_state->slice_params_ext[s]->buffer;
for (j = 0; j < encode_state->slice_params_ext[s]->num_elements; j++) {
- if (slice_param->macroblock_address % width_in_mbs) {
- allow_hwscore = false;
- break;
- }
- }
+ if (slice_param->macroblock_address % width_in_mbs) {
+ allow_hwscore = false;
+ break;
+ }
+ }
}
pic_param = (VAEncPictureParameterBufferMPEG2 *)encode_state->pic_param_ext->buffer;
if (pic_param->picture_type == VAEncPictureTypeIntra) {
- allow_hwscore = false;
- kernel_shader = VME_INTRA_SHADER;
+ allow_hwscore = false;
+ kernel_shader = VME_INTRA_SHADER;
} else {
- kernel_shader = VME_INTER_SHADER;
+ kernel_shader = VME_INTER_SHADER;
}
if (allow_hwscore)
@@ -1120,7 +1120,7 @@ gen9_vme_mpeg2_pipeline_programing(VADriverContextP ctx,
kernel_shader,
encoder_context);
else
- gen9_vme_mpeg2_fill_vme_batchbuffer(ctx,
+ gen9_vme_mpeg2_fill_vme_batchbuffer(ctx,
encode_state,
width_in_mbs, height_in_mbs,
is_intra ? VME_INTRA_SHADER : VME_INTER_SHADER,
@@ -1156,7 +1156,7 @@ gen9_vme_mpeg2_prepare(VADriverContextP ctx,
if ((!vme_context->mpeg2_level) ||
(vme_context->mpeg2_level != (seq_param->sequence_extension.bits.profile_and_level_indication & MPEG2_LEVEL_MASK))) {
- vme_context->mpeg2_level = seq_param->sequence_extension.bits.profile_and_level_indication & MPEG2_LEVEL_MASK;
+ vme_context->mpeg2_level = seq_param->sequence_extension.bits.profile_and_level_indication & MPEG2_LEVEL_MASK;
}
/*Setup all the memory object*/
@@ -1772,8 +1772,8 @@ gen9_vme_context_destroy(void *context)
vme_context->vme_batchbuffer.bo = NULL;
if (vme_context->vme_state_message) {
- free(vme_context->vme_state_message);
- vme_context->vme_state_message = NULL;
+ free(vme_context->vme_state_message);
+ vme_context->vme_state_message = NULL;
}
free(vme_context);
diff --git a/src/i965_device_info.c b/src/i965_device_info.c
index 23a66f1..0c8dcf2 100644
--- a/src/i965_device_info.c
+++ b/src/i965_device_info.c
@@ -501,7 +501,7 @@ static void cpuid(unsigned int op,
uint32_t *eax, uint32_t *ebx,
uint32_t *ecx, uint32_t *edx)
{
- __cpuid_count(op, 0, *eax, *ebx, *ecx, *edx);
+ __cpuid_count(op, 0, *eax, *ebx, *ecx, *edx);
}
/*
@@ -522,7 +522,7 @@ static int intel_driver_detect_cpustring(char *model_id)
/* If the max extended CPUID info is less than 0x80000004, fail */
if (rdata[0] < 0x80000004)
- return -EINVAL;
+ return -EINVAL;
/* obtain the CPUID string */
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
model_ptr = (char *)hsw_cpu_hook_list[i];
if (strlen(model_ptr) != model_len)
- continue;
+ continue;
if (strncasecmp(model_string, model_ptr, model_len) == 0) {
found = true;
break;
- }
+ }
}
if (found) {
- codec_info->has_h264_encoding = 0;
- codec_info->has_h264_mvc_encoding = 0;
- codec_info->has_mpeg2_encoding = 0;
+ codec_info->has_h264_encoding = 0;
+ codec_info->has_h264_mvc_encoding = 0;
+ codec_info->has_mpeg2_encoding = 0;
}
return;
}
@@ -712,7 +712,7 @@ static void gen7_hw_codec_preinit(VADriverContextP ctx, struct hw_codec_info *co
if (strncasecmp(model_string, model_ptr, model_len) == 0) {
found = true;
break;
- }
+ }
}
if (found) {
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index ae6e5a3..8260911 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -753,37 +753,37 @@ i965_GetConfigAttributes(VADriverContextP ctx,
}
break;
- case VAConfigAttribEncMaxRefFrames:
- if (entrypoint == VAEntrypointEncSlice) {
- attrib_list[i].value = (1 << 16) | (1 << 0);
- break;
- }
+ case VAConfigAttribEncMaxRefFrames:
+ if (entrypoint == VAEntrypointEncSlice) {
+ attrib_list[i].value = (1 << 16) | (1 << 0);
+ break;
+ }
break;
- case VAConfigAttribEncQualityRange:
- if (entrypoint == VAEntrypointEncSlice) {
- attrib_list[i].value = 1;
+ case VAConfigAttribEncQualityRange:
+ if (entrypoint == VAEntrypointEncSlice) {
+ attrib_list[i].value = 1;
if (profile == VAProfileH264ConstrainedBaseline ||
profile == VAProfileH264Main ||
profile == VAProfileH264High )
attrib_list[i].value = ENCODER_QUALITY_RANGE;
- break;
- }
+ break;
+ }
break;
- case VAConfigAttribEncJPEG:
- if( entrypoint == VAEntrypointEncPicture) {
- VAConfigAttribValEncJPEG *configVal = (VAConfigAttribValEncJPEG*)&(attrib_list[i].value);
- (configVal->bits).arithmatic_coding_mode = 0; // Huffman coding is used
- (configVal->bits).progressive_dct_mode = 0; // Only Sequential DCT is supported
- (configVal->bits).non_interleaved_mode = 1; // Support both interleaved and non-interleaved
- (configVal->bits).differential_mode = 0; // Baseline DCT is non-differential
- (configVal->bits).max_num_components = 3; // Only 3 components supported
- (configVal->bits).max_num_scans = 1; // Only 1 scan per frame
- (configVal->bits).max_num_huffman_tables = 3; // Max 3 huffman tables
- (configVal->bits).max_num_quantization_tables = 3; // Max 3 quantization tables
- }
- break;
+ case VAConfigAttribEncJPEG:
+ if( entrypoint == VAEntrypointEncPicture) {
+ VAConfigAttribValEncJPEG *configVal = (VAConfigAttribValEncJPEG*)&(attrib_list[i].value);
+ (configVal->bits).arithmatic_coding_mode = 0; // Huffman coding is used
+ (configVal->bits).progressive_dct_mode = 0; // Only Sequential DCT is supported
+ (configVal->bits).non_interleaved_mode = 1; // Support both interleaved and non-interleaved
+ (configVal->bits).differential_mode = 0; // Baseline DCT is non-differential
+ (configVal->bits).max_num_components = 3; // Only 3 components supported
+ (configVal->bits).max_num_scans = 1; // Only 1 scan per frame
+ (configVal->bits).max_num_huffman_tables = 3; // Max 3 huffman tables
+ (configVal->bits).max_num_quantization_tables = 3; // Max 3 quantization tables
+ }
+ break;
default:
/* Do nothing */
@@ -987,7 +987,7 @@ i965_surface_native_memory(VADriverContextP ctx,
expected_fourcc == VA_FOURCC_YV12 ||
expected_fourcc == VA_FOURCC_YV16)
tiling = 0;
-
+
i965_check_alloc_surface_bo(ctx, obj_surface, tiling, expected_fourcc, get_sampling_from_fourcc(expected_fourcc));
return VA_STATUS_SUCCESS;
@@ -3236,10 +3236,10 @@ i965_CreateImage(VADriverContextP ctx,
awidth = ALIGN(width, i965->codec_info->min_linear_wpitch);
if ((format->fourcc == VA_FOURCC_YV12) ||
- (format->fourcc == VA_FOURCC_I420)) {
- if (awidth % 128 != 0) {
- awidth = ALIGN(width, 128);
- }
+ (format->fourcc == VA_FOURCC_I420)) {
+ if (awidth % 128 != 0) {
+ awidth = ALIGN(width, 128);
+ }
}
aheight = ALIGN(height, i965->codec_info->min_linear_hpitch);