OSDN Git Service

Fix the incorrect mb_intra_struct for multi-slice on Haswell
authorZhao Yakui <yakui.zhao@intel.com>
Tue, 28 Aug 2012 17:48:01 +0000 (13:48 -0400)
committerXiang, Haihao <haihao.xiang@intel.com>
Tue, 23 Oct 2012 05:50:28 +0000 (13:50 +0800)
Now the incorrect macroblock intra struct is passed under the multi-slice
scenario, which causes the wrong intra prediction for some macroblocks.
At the same time it also consider the scenario that the x coordinate
of the first macroblock in slice is not zero.

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
src/gen75_vme.c

index 2ef6830..79408dd 100644 (file)
@@ -440,7 +440,8 @@ gen75_vme_fill_vme_batchbuffer(VADriverContextP ctx,
         VAEncSliceParameterBufferH264 *pSliceParameter = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[s]->buffer; 
         int slice_mb_begin = pSliceParameter->macroblock_address;
         int slice_mb_number = pSliceParameter->num_macroblocks;
-        unsigned int mb_intra_ub; 
+        unsigned int mb_intra_ub;
+       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;
@@ -456,9 +457,18 @@ gen75_vme_fill_vme_batchbuffer(VADriverContextP ctx,
                if (mb_x != (mb_width -1))
                        mb_intra_ub |= INTRA_PRED_AVAIL_FLAG_C;
            }
-           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_C;
+               }
+           }
+               
+           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;