Revert "The MV's quarlity has been improved and multi MB type is enabled."
authorZhou Chang <chang.zhou@intel.com>
Fri, 29 Jul 2011 02:05:59 +0000 (10:05 +0800)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 25 Aug 2011 12:29:01 +0000 (14:29 +0200)
This reverts commit a9d641303dfda37b843b7b36e11889173110a83a.

src/gen6_mfc.c
src/gen6_vme.c
src/shaders/vme/gen6_vme_header.inc
src/shaders/vme/gen7_vme_header.inc
src/shaders/vme/inter_frame.asm
src/shaders/vme/inter_frame.g6b
src/shaders/vme/inter_frame.g7b

index a6aa366..a96c840 100644 (file)
@@ -698,7 +698,7 @@ gen6_mfc_avc_pak_object_intra(VADriverContextP ctx, int x, int y, int end_mb, in
     return len_in_dwords;
 }
 
-static int gen6_mfc_avc_pak_object_inter(VADriverContextP ctx, int x, int y, int end_mb, int qp, unsigned int *msg, unsigned int offset,
+static int gen6_mfc_avc_pak_object_inter(VADriverContextP ctx, int x, int y, int end_mb, int qp, unsigned int offset,
                                          struct gen6_encoder_context *gen6_encoder_context,
                                          int inter_mb_size_in_bits, int slice_type)
 {
@@ -713,31 +713,26 @@ static int gen6_mfc_avc_pak_object_inter(VADriverContextP ctx, int x, int y, int
 
     OUT_BCS_BATCH(batch, 32);         /* 32 MV*/
     OUT_BCS_BATCH(batch, offset);
-    
-    if ( (msg[8] & 0x04) ) {    /*FIXME can't apply SKIP directly */
-        OUT_BCS_BATCH(batch, 
-                (0 << 24) |     /* PackedMvNum, Debug*/
-                (4 << 20) |     /* 8 MV, SNB don't use it*/
-                (0 << 19) |     /* CbpDcY */
-                (0 << 18) |     /* CbpDcU */
-                (0 << 17) |     /* CbpDcV */
-                (0x0100) );  
-        OUT_BCS_BATCH(batch, (0x0000<<16) | (y << 8) | x);        /* Code Block Pattern for Y*/
-        OUT_BCS_BATCH(batch, 0x00000000);                         /* Code Block Pattern */  
-    }
-    else {
-        OUT_BCS_BATCH(batch, 
-                (1 << 24) |     /* PackedMvNum, Debug*/
-                (4 << 20) |     /* 8 MV, SNB don't use it*/
-                (1 << 19) |     /* CbpDcY */
-                (1 << 18) |     /* CbpDcU */
-                (1 << 17) |     /* CbpDcV */
-                (msg[8] & 0xFFFF) );  
-        OUT_BCS_BATCH(batch, (0xFFFF<<16) | (y << 8) | x);        /* Code Block Pattern for Y*/
-
-        OUT_BCS_BATCH(batch, 0x000F000F);                         /* Code Block Pattern */  
 
-    }
+    OUT_BCS_BATCH(batch, 
+                  (1 << 24) |     /* PackedMvNum, Debug*/
+                  (4 << 20) |     /* 8 MV, SNB don't use it*/
+                  (1 << 19) |     /* CbpDcY */
+                  (1 << 18) |     /* CbpDcU */
+                  (1 << 17) |     /* CbpDcV */
+                  (0 << 15) |     /* Transform8x8Flag = 0*/
+                  (0 << 14) |     /* Frame based*/
+                  (0 << 13) |     /* Inter MB */
+                  (1 << 8)  |     /* MbType = P_L0_16x16 */   
+                  (0 << 7)  |     /* MBZ for frame */
+                  (0 << 6)  |     /* MBZ */
+                  (2 << 4)  |     /* MBZ for inter*/
+                  (0 << 3)  |     /* MBZ */
+                  (0 << 2)  |     /* SkipMbFlag */
+                  (0 << 0));      /* InterMbMode */
+
+    OUT_BCS_BATCH(batch, (0xFFFF<<16) | (y << 8) | x);        /* Code Block Pattern for Y*/
+    OUT_BCS_BATCH(batch, 0x000F000F);                         /* Code Block Pattern */  
 #if 0 
     if ( slice_type == SLICE_TYPE_B) {
         OUT_BCS_BATCH(batch, (0xF<<28) | (end_mb << 26) | qp); /* Last MB */
@@ -885,8 +880,10 @@ void gen6_mfc_avc_pipeline_programing(VADriverContextP ctx,
 
     intel_batchbuffer_start_atomic_bcs(batch, 0x1000); 
     
-    dri_bo_map(vme_context->vme_output.bo , 1);
-    msg = (unsigned int *)vme_context->vme_output.bo->virtual;
+    if (is_intra) {
+        dri_bo_map(vme_context->vme_output.bo , 1);
+        msg = (unsigned int *)vme_context->vme_output.bo->virtual;
+    }
 
     for (y = 0; y < height_in_mbs; y++) {
         for (x = 0; x < width_in_mbs; x++) { 
@@ -948,9 +945,8 @@ void gen6_mfc_avc_pipeline_programing(VADriverContextP ctx,
                 object_len_in_bytes = gen6_mfc_avc_pak_object_intra(ctx, x, y, last_mb, qp, msg, gen6_encoder_context, intra_mb_size);
                 msg += 4;
             } else {
-                object_len_in_bytes = gen6_mfc_avc_pak_object_inter(ctx, x, y, last_mb, qp, msg, offset, gen6_encoder_context, inter_mb_size, pSliceParameter->slice_type);
+                object_len_in_bytes = gen6_mfc_avc_pak_object_inter(ctx, x, y, last_mb, qp, offset, gen6_encoder_context, inter_mb_size, pSliceParameter->slice_type);
                 offset += 64;
-                msg += 16;
             }
 
             if (intel_batchbuffer_check_free_space(batch, object_len_in_bytes) == 0) {
@@ -967,7 +963,8 @@ void gen6_mfc_avc_pipeline_programing(VADriverContextP ctx,
                                tail_data, sizeof(tail_data) >> 2, 32,
                                sizeof(tail_data), 1, 1, 1);
 
-    dri_bo_unmap(vme_context->vme_output.bo);
+    if (is_intra)
+        dri_bo_unmap(vme_context->vme_output.bo);
 
     free(slice_header);
 
index e48ac4e..dd6fb65 100644 (file)
@@ -677,11 +677,8 @@ static VAStatus gen6_vme_vme_state_setup(VADriverContextP ctx,
     vme_state_message[13] = 0x01010100;
 
     for(i = 14; i < 32; i++) {
-        vme_state_message[i] = 0x11111111;
+        vme_state_message[i] = 0x00000000;
     }
-     
-    vme_state_message[18] = 0x41312111;
-    vme_state_message[19] = 0x81716151;
 
     //vme_state_message[16] = 0x42424242;                      //cost function LUT set 0 for Intra
 
index 770a3bd..5e27fa7 100644 (file)
@@ -46,7 +46,7 @@ define(`INTER_SAD_HAAR',                `0x00200000')
 define(`INTRA_SAD_NONE',                `0x00000000')
 define(`INTRA_SAD_HAAR',                `0x00800000')
 
-define(`INTER_PART_MASK',               `0x70000000')
+define(`INTER_PART_MASK',               `0x7E000000')
 
 define(`REF_REGION_SIZE',               `0x2830:UW')
 
index 81b43b0..44ab7b6 100644 (file)
@@ -46,7 +46,7 @@ define(`INTER_SAD_HAAR',                `0x00200000')
 define(`INTRA_SAD_NONE',                `0x00000000')
 define(`INTRA_SAD_HAAR',                `0x00800000')
 
-define(`INTER_PART_MASK',               `0x70000000')
+define(`INTER_PART_MASK',               `0x7E000000')
 
 define(`REF_REGION_SIZE',               `0x2830:UW')
 
index 625e1d1..0a4db66 100644 (file)
@@ -37,15 +37,8 @@ mov  (1) tmp_reg0.22<1>:UW      REF_REGION_SIZE {align1};               /* Refer
 mov  (8) vme_msg_0.0<1>:UD      tmp_reg0.0<8,8,1>:UD {align1};
         
 /* m1 */
-mov  (1) tmp_reg1.0<1>:UD       0x00002803:UD {align1};     /*Enable adapitive search and skip enable*/
-mov  (1) tmp_reg1.4<1>:UD       0x20100010:UD {align1};     /*16 MVs */
-mov  (1) tmp_reg1.8<1>:UD       0x00003F3F:UD {align1};     /*Max searhc path length is 63*/
-mov  (1) tmp_reg1.12<1>:UD      0x00000000:UD {align1};     
-mov  (1) tmp_reg1.16<1>:UD      0x00300040:UD {align1};
-mov  (1) tmp_reg1.20<1>:UD      0x00300040:UD {align1};
-mov  (1) tmp_reg1.24<1>:UD      0x00003040:UD {align1};
-mov  (1) tmp_reg1.28<1>:UD      0x00000060:UD {align1};
-
+mov  (1) tmp_reg1.4<1>:UD       MAX_NUM_MV:UD {align1};                                   /* Default value MAX 32 MVs */
+mov  (1) tmp_reg1.8<1>:UD       SEARCH_PATH_LEN:UD {align1};
 
 mov  (8) vme_msg_1<1>:UD        tmp_reg1.0<8,8,1>:UD {align1};
         
@@ -81,23 +74,14 @@ mul  (1) tmp_reg3.8<1>:UD       tmp_reg3.8<0,1,0>:UD 0x4:UD {align1};
 mov  (1) tmp_reg3.20<1>:UB      thread_id_ub {align1};                  /* dispatch id */
 mov  (8) msg_reg0.0<1>:UD       tmp_reg3.0<8,8,1>:UD {align1};
 
-mov  (16) tmp_reg3.0<1>:UW      vme_wb1.0<32,32,1>:UB  {align1};
-add  (8) tmp_reg3.0<2>:W        tmp_reg3.0<16,8,2>:W -64:W {align1};
-add  (8) tmp_reg3.2<2>:W        tmp_reg3.2<16,8,2>:W -48:W {align1}; 
-mov  (4) tmp_reg3.4<2>:UD       0x00000000:UD {align1};
-
-/* Detecting zero MV issue */
-mov  (1) tmp_reg1.0<1>:UD       0x00000000:UD {align1};
-add  (1) tmp_reg1.0<1>:UW       vme_wb0.14<0,1,0>:UW 0x1000 {align1};
-shr  (1) tmp_reg1.0<1>:UW       tmp_reg1.0<0,1,0>:UW 12  {align1};
-mul  (2) tmp_reg3.0<1>:UW       tmp_reg3.0<0,2,1>:UW tmp_reg1.0<0,1,0>:UB {align1};
-mul  (2) tmp_reg3.8<1>:UW       tmp_reg3.8<0,2,1>:UW tmp_reg1.0<0,1,0>:UB {align1};
-mul  (2) tmp_reg3.16<1>:UW      tmp_reg3.16<0,2,1>:UW tmp_reg1.0<0,1,0>:UB {align1};
-mul  (2) tmp_reg3.24<1>:UW      tmp_reg3.24<0,2,1>:UW tmp_reg1.0<0,1,0>:UB {align1};
-
+mov  (2) tmp_reg3.0<1>:UW       vme_wb1.0<2,2,1>:UB  {align1};
+add  (1) tmp_reg3.0<1>:W        tmp_reg3.0<2,2,1>:W -64:W {align1};
+add  (1) tmp_reg3.2<1>:W        tmp_reg3.2<2,2,1>:W -48:W {align1}; 
+        
+        
+mov  (8) msg_reg1.0<1>:UD       tmp_reg3.0<8,8,0>:UD   {align1};
 
-mov  (8) msg_reg1.0<1>:UD       tmp_reg3.0<8,8,1>:UD   {align1};
-mov  (8) msg_reg2.0<1>:UD       vme_wb0.0<8,8,1>:UD   {align1};
+mov  (8) msg_reg2.0<1>:UD       tmp_reg3.0<8,8,0>:UD   {align1};
 
 /* bind index 3, write 4 oword, msg type: 8(OWord Block Write) */
 send (16)
index 381fb56..45fa058 100644 (file)
@@ -4,18 +4,12 @@
    { 0x00200041, 0x24002e29, 0x004500a0, 0x00100010 },
    { 0x00000040, 0x24003dad, 0x00450400, 0xfff0fff0 },
    { 0x00000040, 0x24023dad, 0x00450402, 0xfff4fff4 },
-   { 0x00000001, 0x240c0061, 0x00000000, 0x70203000 },
+   { 0x00000001, 0x240c0061, 0x00000000, 0x7e203000 },
    { 0x00000001, 0x24140231, 0x00000014, 0x00000000 },
    { 0x00000001, 0x24160169, 0x00000000, 0x28302830 },
    { 0x00600001, 0x20000022, 0x008d0400, 0x00000000 },
-   { 0x00000001, 0x24200061, 0x00000000, 0x00002803 },
-   { 0x00000001, 0x24240061, 0x00000000, 0x20100010 },
+   { 0x00000001, 0x24240061, 0x00000000, 0x00000020 },
    { 0x00000001, 0x24280061, 0x00000000, 0x00003f3f },
-   { 0x00000001, 0x242c0061, 0x00000000, 0x00000000 },
-   { 0x00000001, 0x24300061, 0x00000000, 0x00300040 },
-   { 0x00000001, 0x24340061, 0x00000000, 0x00300040 },
-   { 0x00000001, 0x24380061, 0x00000000, 0x00003040 },
-   { 0x00000001, 0x243c0061, 0x00000000, 0x00000060 },
    { 0x00600001, 0x20200022, 0x008d0420, 0x00000000 },
    { 0x00600001, 0x20400062, 0x00000000, 0x00000000 },
    { 0x00600001, 0x20400062, 0x00000000, 0x00000000 },
    { 0x00000041, 0x24680c21, 0x00000468, 0x00000004 },
    { 0x00000001, 0x24740231, 0x00000014, 0x00000000 },
    { 0x00600001, 0x20000022, 0x008d0460, 0x00000000 },
-   { 0x00800001, 0x24600229, 0x00d501a0, 0x00000000 },
-   { 0x00600040, 0x44603dad, 0x00ae0460, 0xffc0ffc0 },
-   { 0x00600040, 0x44623dad, 0x00ae0462, 0xffd0ffd0 },
-   { 0x00400001, 0x44640061, 0x00000000, 0x00000000 },
-   { 0x00000001, 0x24200061, 0x00000000, 0x00000000 },
-   { 0x00000040, 0x24201d29, 0x0000018e, 0x00001000 },
-   { 0x00000008, 0x24201d29, 0x00000420, 0x0000000c },
-   { 0x00200041, 0x24604529, 0x00050460, 0x00000420 },
-   { 0x00200041, 0x24684529, 0x00050468, 0x00000420 },
-   { 0x00200041, 0x24704529, 0x00050470, 0x00000420 },
-   { 0x00200041, 0x24784529, 0x00050478, 0x00000420 },
-   { 0x00600001, 0x20200022, 0x008d0460, 0x00000000 },
-   { 0x00600001, 0x20400022, 0x008d0180, 0x00000000 },
+   { 0x00200001, 0x24600229, 0x004501a0, 0x00000000 },
+   { 0x00000040, 0x24603dad, 0x00450460, 0xffc0ffc0 },
+   { 0x00000040, 0x24623dad, 0x00450462, 0xffd0ffd0 },
+   { 0x00600001, 0x20200022, 0x008c0460, 0x00000000 },
+   { 0x00600001, 0x20400022, 0x008c0460, 0x00000000 },
    { 0x05800031, 0x22001cdd, 0x00000000, 0x061b0303 },
    { 0x00600001, 0x20000022, 0x008d0000, 0x00000000 },
    { 0x07800031, 0x24001cc8, 0x00000000, 0x82000010 },
index 4dc9203..68fe540 100644 (file)
@@ -4,18 +4,12 @@
    { 0x00200041, 0x24002e29, 0x004500a0, 0x00100010 },
    { 0x00000040, 0x24003dad, 0x00450400, 0xfff0fff0 },
    { 0x00000040, 0x24023dad, 0x00450402, 0xfff4fff4 },
-   { 0x00000001, 0x240c0061, 0x00000000, 0x70203000 },
+   { 0x00000001, 0x240c0061, 0x00000000, 0x7e203000 },
    { 0x00000001, 0x24140231, 0x00000014, 0x00000000 },
    { 0x00000001, 0x24160169, 0x00000000, 0x28302830 },
    { 0x00600001, 0x28000021, 0x008d0400, 0x00000000 },
-   { 0x00000001, 0x24200061, 0x00000000, 0x00002803 },
-   { 0x00000001, 0x24240061, 0x00000000, 0x20100010 },
+   { 0x00000001, 0x24240061, 0x00000000, 0x00000020 },
    { 0x00000001, 0x24280061, 0x00000000, 0x00003f3f },
-   { 0x00000001, 0x242c0061, 0x00000000, 0x00000000 },
-   { 0x00000001, 0x24300061, 0x00000000, 0x00300040 },
-   { 0x00000001, 0x24340061, 0x00000000, 0x00300040 },
-   { 0x00000001, 0x24380061, 0x00000000, 0x00003040 },
-   { 0x00000001, 0x243c0061, 0x00000000, 0x00000060 },
    { 0x00600001, 0x28200021, 0x008d0420, 0x00000000 },
    { 0x00600001, 0x28400061, 0x00000000, 0x00000000 },
    { 0x00600001, 0x28600061, 0x00000000, 0x00000000 },
    { 0x00000041, 0x24680c21, 0x00000468, 0x00000004 },
    { 0x00000001, 0x24740231, 0x00000014, 0x00000000 },
    { 0x00600001, 0x28000021, 0x008d0460, 0x00000000 },
-   { 0x00800001, 0x24600229, 0x00d501a0, 0x00000000 },
-   { 0x00600040, 0x44603dad, 0x00ae0460, 0xffc0ffc0 },
-   { 0x00600040, 0x44623dad, 0x00ae0462, 0xffd0ffd0 },
-   { 0x00400001, 0x44640061, 0x00000000, 0x00000000 },
-   { 0x00000001, 0x24200061, 0x00000000, 0x00000000 },
-   { 0x00000040, 0x24201d29, 0x0000018e, 0x00001000 },
-   { 0x00000008, 0x24201d29, 0x00000420, 0x0000000c },
-   { 0x00200041, 0x24604529, 0x00050460, 0x00000420 },
-   { 0x00200041, 0x24684529, 0x00050468, 0x00000420 },
-   { 0x00200041, 0x24704529, 0x00050470, 0x00000420 },
-   { 0x00200041, 0x24784529, 0x00050478, 0x00000420 },
-   { 0x00600001, 0x28200021, 0x008d0460, 0x00000000 },
-   { 0x00600001, 0x28400021, 0x008d0180, 0x00000000 },
+   { 0x00200001, 0x24600229, 0x004501a0, 0x00000000 },
+   { 0x00000040, 0x24603dad, 0x00450460, 0xffc0ffc0 },
+   { 0x00000040, 0x24623dad, 0x00450462, 0xffd0ffd0 },
+   { 0x00600001, 0x28200021, 0x008c0460, 0x00000000 },
+   { 0x00600001, 0x28400021, 0x008c0460, 0x00000000 },
    { 0x0a800031, 0x20001cac, 0x00000800, 0x060a0300 },
    { 0x00600001, 0x28000021, 0x008d0000, 0x00000000 },
    { 0x07800031, 0x24001ca8, 0x00000800, 0x82000010 },