VAEncSequenceParameterBufferMPEG2 *seq_param = (VAEncSequenceParameterBufferMPEG2 *)encode_state->seq_param_ext->buffer;
int width_in_mbs = ALIGN(seq_param->picture_width, 16) / 16;
int height_in_mbs = ALIGN(seq_param->picture_height, 16) / 16;
+ uint32_t mv_x, mv_y;
+
+ if (vme_context->mpeg2_level == MPEG2_LEVEL_LOW) {
+ mv_x = 512;
+ mv_y = 64;
+ } else if (vme_context->mpeg2_level == MPEG2_LEVEL_MAIN) {
+ mv_x = 1024;
+ mv_y = 128;
+ } else if (vme_context->mpeg2_level == MPEG2_LEVEL_HIGH) {
+ mv_x = 2048;
+ mv_y = 128;
+ } else {
+ WARN_ONCE("Incorrect Mpeg2 level setting!\n");
+ mv_x = 512;
+ mv_y = 64;
+ }
+
+ vme_state_message[MPEG2_MV_RANGE] = (mv_y << 16) | (mv_x);
vme_state_message[MPEG2_PIC_WIDTH_HEIGHT] = (height_in_mbs << 16) |
width_in_mbs;
unsigned int h264_level;
unsigned int video_coding_type;
unsigned int vme_kernel_sum;
+ unsigned int mpeg2_level;
};
#define MPEG2_PIC_WIDTH_HEIGHT 30
+#define MPEG2_MV_RANGE 29
+#define MPEG2_LEVEL_MASK 0x0f
+#define MPEG2_LEVEL_LOW 0x0a
+#define MPEG2_LEVEL_MAIN 0x08
+#define MPEG2_LEVEL_HIGH 0x04
Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context *encoder_context);
VAStatus vaStatus = VA_STATUS_SUCCESS;
VAEncSliceParameterBufferMPEG2 *slice_param = (VAEncSliceParameterBufferMPEG2 *)encode_state->slice_params_ext[0]->buffer;
+ VAEncSequenceParameterBufferMPEG2 *seq_param = (VAEncSequenceParameterBufferMPEG2 *)encode_state->seq_param_ext->buffer;
+ struct gen6_vme_context *vme_context = encoder_context->vme_context;
+
+ 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;
+ }
+
/*Setup all the memory object*/
gen75_vme_mpeg2_surface_setup(ctx, encode_state, slice_param->is_intra_slice, encoder_context);
gen75_vme_interface_setup(ctx, encode_state, encoder_context);
/* The right/bottom coordinate of reference window */
add (1) TEMP_VAR0.16<1>:w TEMP_VAR0.0<0,1,0>:w 48:w {align1};
add (1) TEMP_VAR0.18<1>:w TEMP_VAR0.2<0,1,0>:w 40:w {align1};
+
+/* Firstly the MV range is checked */
+mul (2) TEMP_VAR1.16<1>:w INPUT_ARG1.16<2,2,1>:w -1:w {align1};
+add (2) TEMP_VAR1.0<1>:w INPUT_ARG0.8<2,2,1>:w TEMP_VAR1.16<2,2,1>:w {align1};
+add (2) TEMP_VAR1.4<1>:w INPUT_ARG0.8<2,2,1>:w INPUT_ARG1.16<2,2,1>:w {align1};
+
+cmp.l.f0.0 (1) null:w TEMP_VAR0.0<0,1,0>:w TEMP_VAR1.0<0,1,0>:w {align1};
+(f0.0) mov (1) TEMP_VAR0.0<1>:w TEMP_VAR1.0<0,1,0>:w {align1};
+cmp.g.f0.0 (1) null:w TEMP_VAR0.16<0,1,0>:w TEMP_VAR1.4<0,1,0>:w {align1};
+(f0.0) add (1) TEMP_VAR0.0<1>:w TEMP_VAR1.4<0,1,0>:w -48:w {align1};
+cmp.l.f0.0 (1) null:w TEMP_VAR0.2<0,1,0>:w TEMP_VAR1.2<0,1,0>:w {align1};
+(f0.0) mov (1) TEMP_VAR0.2<1>:w TEMP_VAR1.2<0,1,0>:w {align1};
+cmp.g.f0.0 (1) null:w TEMP_VAR0.18<0,1,0>:w TEMP_VAR1.6<0,1,0>:w {align1};
+(f0.0) add (1) TEMP_VAR0.2<1>:w TEMP_VAR1.6<0,1,0>:w -40:w {align1};
+
x_left_cmp:
cmp.l.f0.0 (1) null:w TEMP_VAR0.0<0,1,0>:w 0:w {align1};
(-f0.0) jmpi (1) x_right_cmp;
{ 0x00200040, 0x2f6035ad, 0x00450fa8, 0x00450fa0 },
{ 0x00000040, 0x2f703dad, 0x00000f60, 0x00300030 },
{ 0x00000040, 0x2f723dad, 0x00000f62, 0x00280028 },
+ { 0x00200041, 0x2f903dad, 0x00450fd0, 0xffffffff },
+ { 0x00200040, 0x2f8035ad, 0x00450fa8, 0x00450f90 },
+ { 0x00200040, 0x2f8435ad, 0x00450fa8, 0x00450fd0 },
+ { 0x05000010, 0x200035ac, 0x00000f60, 0x00000f80 },
+ { 0x00010001, 0x2f6001ad, 0x00000f80, 0x00000000 },
+ { 0x03000010, 0x200035ac, 0x00000f70, 0x00000f84 },
+ { 0x00010040, 0x2f603dad, 0x00000f84, 0xffd0ffd0 },
+ { 0x05000010, 0x200035ac, 0x00000f62, 0x00000f82 },
+ { 0x00010001, 0x2f6201ad, 0x00000f82, 0x00000000 },
+ { 0x03000010, 0x200035ac, 0x00000f72, 0x00000f86 },
+ { 0x00010040, 0x2f623dad, 0x00000f86, 0xffd8ffd8 },
{ 0x05000010, 0x20003dac, 0x00000f60, 0x00000000 },
{ 0x00110020, 0x34001c00, 0x00001400, 0x00000020 },
{ 0x00010001, 0x2f6001ed, 0x00000000, 0x00000000 },