[Libva] [PATCH 2/7] Use the same shader to configure quality level

lizhong zhong.li at intel.com
Sun Jul 27 23:47:51 PDT 2014


On 07/28/2014 02:15 PM, Zhao, Yakui wrote:
> On Thu, 2014-07-24 at 03:47 -0600, Zhong Li wrote:
>> Using the same shader to configure gen7 avc quality level,
>> it is benefit to make code clear and reduce profile limitation.
> It seems that two things are mixed in one patch.
>     a. use the same shader to configure the quality level
>     b. restore to the original mechanism of batch buffer.
>
> It will be better that one thing is done in one patch.
Ok, I'll split this patch...
>
>> Signed-off-by: Zhong Li <zhong.li at intel.com>
>> ---
>>   src/gen6_mfc.c                      |  130 +++++++++--------------------------
>>   src/gen7_vme.c                      |   73 +++-----------------
>>   src/shaders/vme/inter_frame_ivb.asm |   22 +++++-
>>   src/shaders/vme/inter_frame_ivb.g7b |   16 ++++-
>>   src/shaders/vme/vme7.inc            |    8 ++-
>>   5 files changed, 80 insertions(+), 169 deletions(-)
>>
>> diff --git a/src/gen6_mfc.c b/src/gen6_mfc.c
>> index 30cdb66..0a10054 100644
>> --- a/src/gen6_mfc.c
>> +++ b/src/gen6_mfc.c
>> @@ -676,6 +676,8 @@ gen6_mfc_stop(VADriverContextP ctx,
>>       return VA_STATUS_SUCCESS;
>>   }
>>   
>> +#if __SOFTWARE__
>> +
>>   static int
>>   gen6_mfc_avc_pak_object_intra(VADriverContextP ctx, int x, int y, int end_mb, int qp,unsigned int *msg,
>>                                 struct intel_encoder_context *encoder_context,
>> @@ -766,58 +768,6 @@ gen6_mfc_avc_pak_object_inter(VADriverContextP ctx, int x, int y, int end_mb, in
>>   
>>       return len_in_dwords;
>>   }
>> -
>> -static int
>> -gen6_mfc_avc_pak_object_inter2(VADriverContextP ctx, int x, int y, int end_mb, int qp,
>> -                              unsigned int offset,
>> -                              struct intel_encoder_context *encoder_context,
>> -                              struct intel_batchbuffer *batch)
>> -{
>> -    struct gen6_vme_context *vme_context = encoder_context->vme_context;
>> -    int len_in_dwords = 11;
>> -
>> -    if (batch == NULL)
>> -        batch = encoder_context->base.batch;
>> -
>> -    BEGIN_BCS_BATCH(batch, len_in_dwords);
>> -
>> -    OUT_BCS_BATCH(batch, MFC_AVC_PAK_OBJECT | (len_in_dwords - 2));
>> -
>> -    OUT_BCS_BATCH(batch, 32);         /* 32 MV*/
>> -    OUT_BCS_BATCH(batch, offset);
>> -
>> -    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 */
>> -    OUT_BCS_BATCH(batch, (0 << 27) | (end_mb << 26) | qp);    /* Last MB */
>> -
>> -    /*Stuff for Inter MB*/
>> -    OUT_BCS_BATCH(batch, 0x0);
>> -    OUT_BCS_BATCH(batch, 0x0);
>> -    OUT_BCS_BATCH(batch, 0x0);
>> -
>> -    OUT_BCS_BATCH(batch, 0xF0020000); /*MaxSizeInWord and TargetSzieInWord*/
>> -
>> -    ADVANCE_BCS_BATCH(batch);
>> -
>> -    return len_in_dwords;
>> -}
>>   
>>   static void
>>   gen6_mfc_avc_pipeline_slice_programing(VADriverContextP ctx,
>> @@ -841,7 +791,6 @@ gen6_mfc_avc_pipeline_slice_programing(VADriverContextP ctx,
>>       unsigned int tail_data[] = { 0x0, 0x0 };
>>       int slice_type = intel_avc_enc_slice_type_fixup(pSliceParameter->slice_type);
>>       int is_intra = slice_type == SLICE_TYPE_I;
>> -    int is_low_quality = (encoder_context->quality_level == ENCODER_LOW_QUALITY);
>>   
>>       if (rate_control_mode == VA_RC_CBR) {
>>           qp = mfc_context->bit_rate_control_context[slice_type].QpPrimeY;
>> @@ -869,54 +818,36 @@ gen6_mfc_avc_pipeline_slice_programing(VADriverContextP ctx,
>>       dri_bo_map(vme_context->vme_output.bo , 1);
>>       msg = (unsigned int *)vme_context->vme_output.bo->virtual;
>>   
>> -    if (is_low_quality) {
>> -        for (i = pSliceParameter->macroblock_address;
>> -                i < pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks; i++) {
>> -            int last_mb = (i == (pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks - 1) );
>> -            x = i % width_in_mbs;
>> -            y = i / width_in_mbs;
>> -
>> -            if (is_intra) {
>> -                assert(msg);
>> -                gen6_mfc_avc_pak_object_intra(ctx, x, y, last_mb, qp, msg, encoder_context, 0, 0, slice_batch);
>> -                msg += 4;
>> -            } else {
>> -                gen6_mfc_avc_pak_object_inter2(ctx, x, y, last_mb, qp, offset, encoder_context, slice_batch);
>> -                offset += 64;
>> -            }
>> -        }
>> +    if (is_intra) {
>> +        msg += pSliceParameter->macroblock_address * INTRA_VME_OUTPUT_IN_DWS;
>>       } else {
>> +        msg += pSliceParameter->macroblock_address * INTER_VME_OUTPUT_IN_DWS;
>> +        msg += 32; /* the first 32 DWs are MVs */
>> +        offset = pSliceParameter->macroblock_address * INTER_VME_OUTPUT_IN_BYTES;
>> +    }
>> +
>> +    for (i = pSliceParameter->macroblock_address;
>> +         i < pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks; i++) {
>> +        int last_mb = (i == (pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks - 1) );
>> +        x = i % width_in_mbs;
>> +        y = i / width_in_mbs;
>> +
>>           if (is_intra) {
>> -            msg += pSliceParameter->macroblock_address * INTRA_VME_OUTPUT_IN_DWS;
>> +            assert(msg);
>> +            gen6_mfc_avc_pak_object_intra(ctx, x, y, last_mb, qp, msg, encoder_context, 0, 0, slice_batch);
>> +            msg += INTRA_VME_OUTPUT_IN_DWS;
>>           } else {
>> -            msg += pSliceParameter->macroblock_address * INTER_VME_OUTPUT_IN_DWS;
>> -            msg += 32; /* the first 32 DWs are MVs */
>> -            offset = pSliceParameter->macroblock_address * INTER_VME_OUTPUT_IN_BYTES;
>> -        }
>> -
>> -        for (i = pSliceParameter->macroblock_address;
>> -                i < pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks; i++) {
>> -            int last_mb = (i == (pSliceParameter->macroblock_address + pSliceParameter->num_macroblocks - 1) );
>> -            x = i % width_in_mbs;
>> -            y = i / width_in_mbs;
>> -
>> -            if (is_intra) {
>> -                assert(msg);
>> +            if (msg[0] & INTRA_MB_FLAG_MASK) {
>>                   gen6_mfc_avc_pak_object_intra(ctx, x, y, last_mb, qp, msg, encoder_context, 0, 0, slice_batch);
>> -                msg += INTRA_VME_OUTPUT_IN_DWS;
>>               } else {
>> -                if (msg[0] & INTRA_MB_FLAG_MASK) {
>> -                    gen6_mfc_avc_pak_object_intra(ctx, x, y, last_mb, qp, msg, encoder_context, 0, 0, slice_batch);
>> -                } else {
>> -                    gen6_mfc_avc_pak_object_inter(ctx, x, y, last_mb, qp, msg, offset, encoder_context, 0, 0, slice_type, slice_batch);
>> -                }
>> -
>> -                msg += INTER_VME_OUTPUT_IN_DWS;
>> -                offset += INTER_VME_OUTPUT_IN_BYTES;
>> +                gen6_mfc_avc_pak_object_inter(ctx, x, y, last_mb, qp, msg, offset, encoder_context, 0, 0, slice_type, slice_batch);
>>               }
>> +
>> +            msg += INTER_VME_OUTPUT_IN_DWS;
>> +            offset += INTER_VME_OUTPUT_IN_BYTES;
>>           }
>>       }
>> -
>> +
>>       dri_bo_unmap(vme_context->vme_output.bo);
>>   
>>       if ( last_slice ) {
>> @@ -965,6 +896,8 @@ gen6_mfc_avc_software_batchbuffer(VADriverContextP ctx,
>>       return batch_bo;
>>   }
>>   
>> +#else
>> +
>>   static void
>>   gen6_mfc_batchbuffer_surfaces_input(VADriverContextP ctx,
>>                                       struct encode_state *encode_state,
>> @@ -1358,6 +1291,9 @@ gen6_mfc_avc_hardware_batchbuffer(VADriverContextP ctx,
>>       return mfc_context->mfc_batchbuffer_surface.bo;
>>   }
>>   
>> +#endif
>> +
>> +
>>   static void
>>   gen6_mfc_avc_pipeline_programing(VADriverContextP ctx,
>>                                    struct encode_state *encode_state,
>> @@ -1372,15 +1308,11 @@ gen6_mfc_avc_pipeline_programing(VADriverContextP ctx,
>>           return;
>>       }
>>   
>> -    if (encoder_context->quality_level == ENCODER_LOW_QUALITY )
>> -        slice_batch_bo = gen6_mfc_avc_software_batchbuffer(ctx, encode_state, encoder_context);
>> -    else {
>>   #if __SOFTWARE__
>> -        slice_batch_bo = gen6_mfc_avc_software_batchbuffer(ctx, encode_state, encoder_context);
>> +    slice_batch_bo = gen6_mfc_avc_software_batchbuffer(ctx, encode_state, encoder_context);
>>   #else
>> -        slice_batch_bo = gen6_mfc_avc_hardware_batchbuffer(ctx, encode_state, encoder_context);
>> +    slice_batch_bo = gen6_mfc_avc_hardware_batchbuffer(ctx, encode_state, encoder_context);
>>   #endif
>> -    }
>>   
>>       // begin programing
>>       intel_batchbuffer_start_atomic_bcs(batch, 0x4000);
>> diff --git a/src/gen7_vme.c b/src/gen7_vme.c
>> index 135a5ad..dc15445 100644
>> --- a/src/gen7_vme.c
>> +++ b/src/gen7_vme.c
>> @@ -63,8 +63,6 @@ enum VIDEO_CODING_TYPE{
>>   enum AVC_VME_KERNEL_TYPE{
>>       AVC_VME_INTRA_SHADER = 0,
>>       AVC_VME_INTER_SHADER,
>> -    AVC_VME_OLD_INTRA_SHADER,
>> -    AVC_VME_OLD_INTER_SHADER,
>>       AVC_VME_BATCHBUFFER,
>>       AVC_VME_BINTER_SHADER,
>>       AVC_VME_KERNEL_SUM
>> @@ -85,14 +83,6 @@ static const uint32_t gen7_vme_inter_frame[][4] = {
>>   #include "shaders/vme/inter_frame_ivb.g7b"
>>   };
>>   
>> -static const uint32_t gen7_vme_old_intra_frame[][4] = {
>> -#include "shaders/vme_old/intra_frame.g7b"
>> -};
>> -
>> -static const uint32_t gen7_vme_old_inter_frame[][4] = {
>> -#include "shaders/vme_old/inter_frame.g7b"
>> -};
>> -
>>   static const uint32_t gen7_vme_batchbuffer[][4] = {
>>   #include "shaders/vme/batchbuffer.g7b"
>>   };
>> @@ -117,20 +107,6 @@ static struct i965_kernel gen7_vme_kernels[] = {
>>           NULL
>>       },
>>       {
>> -        "AVC VME Old Intra Frame",
>> -        AVC_VME_OLD_INTRA_SHADER,
>> -        gen7_vme_old_intra_frame, 			
>> -        sizeof(gen7_vme_old_intra_frame),		
>> -        NULL
>> -    },
>> -    {
>> -        "AVC VME Old Inter Frame",
>> -        AVC_VME_OLD_INTER_SHADER,
>> -        gen7_vme_old_inter_frame,
>> -        sizeof(gen7_vme_old_inter_frame),
>> -        NULL
>> -    },
>> -    {
>>           "AVC VME BATCHBUFFER",
>>           AVC_VME_BATCHBUFFER,
>>           gen7_vme_batchbuffer,
>> @@ -383,36 +359,6 @@ static VAStatus gen7_vme_constant_setup(VADriverContextP ctx,
>>       return VA_STATUS_SUCCESS;
>>   }
>>   
>> -static VAStatus
>> -gen7_vme_vme_state_setup(VADriverContextP ctx,
>> -        struct encode_state *encode_state,
>> -        int is_intra,
>> -        struct intel_encoder_context *encoder_context)
>> -{
>> -    struct gen6_vme_context *vme_context = encoder_context->vme_context;
>> -    unsigned int *vme_state_message;
>> -    int i;
>> -
>> -    //building VME state message
>> -    dri_bo_map(vme_context->vme_state.bo, 1);
>> -    assert(vme_context->vme_state.bo->virtual);
>> -    vme_state_message = (unsigned int *)vme_context->vme_state.bo->virtual;
>> -
>> -    vme_state_message[0] = 0x10010101;
>> -    vme_state_message[1] = 0x100F0F0F;
>> -    vme_state_message[2] = 0x10010101;
>> -    vme_state_message[3] = 0x000F0F0F;
>> -    for(i = 4; i < 14; i++) {
>> -        vme_state_message[i] = 0x00000000;
>> -    }	
>> -
>> -    for(i = 14; i < 32; i++) {
>> -        vme_state_message[i] = 0x00000000;
>> -    }
>> -
>> -    dri_bo_unmap( vme_context->vme_state.bo);
>> -    return VA_STATUS_SUCCESS;
>> -}
>>   
>>   static VAStatus gen7_vme_avc_state_setup(VADriverContextP ctx,
>>                                            struct encode_state *encode_state,
>> @@ -424,6 +370,7 @@ static VAStatus gen7_vme_avc_state_setup(VADriverContextP ctx,
>>       unsigned int *mb_cost_table;
>>       int i;
>>       VAEncSliceParameterBufferH264 *slice_param = (VAEncSliceParameterBufferH264 *)encode_state->slice_params_ext[0]->buffer;
>> +    unsigned int is_low_quality = (encoder_context->quality_level == ENCODER_LOW_QUALITY);
>>   
>>       mb_cost_table = (unsigned int *)vme_context->vme_state_message;
>>       //building VME state message
>> @@ -431,8 +378,9 @@ static VAStatus gen7_vme_avc_state_setup(VADriverContextP ctx,
>>       assert(vme_context->vme_state.bo->virtual);
>>       vme_state_message = (unsigned int *)vme_context->vme_state.bo->virtual;
>>   
>> -    if ((slice_param->slice_type == SLICE_TYPE_P) ||
>> -        (slice_param->slice_type == SLICE_TYPE_SP)) {
>> +    if (((slice_param->slice_type == SLICE_TYPE_P) ||
>> +        (slice_param->slice_type == SLICE_TYPE_SP) &&
>> +        !is_low_quality)) {
> Maybe it should be
>      if (((slice_param->slice_type == SLICE_TYPE_P) ||
>          (slice_param->slice_type == SLICE_TYPE_SP)) &&
>          !is_low_quality)
>
>
>>           vme_state_message[0] = 0x01010101;
>>           vme_state_message[1] = 0x10010101;
>>           vme_state_message[2] = 0x0F0F0F0F;
>> @@ -598,7 +546,7 @@ gen7_vme_fill_vme_batchbuffer(VADriverContextP ctx,
>>      
>>                   /*inline data */
>>                   *command_ptr++ = (mb_width << 16 | mb_y << 8 | mb_x);
>> -                *command_ptr++ = ( (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
>> +                *command_ptr++ = ((encoder_context->quality_level << 24) | (1 << 16) | transform_8x8_mode_flag | (mb_intra_ub << 8));
>>   
>>                   i += 1;
>>               }
>> @@ -668,14 +616,14 @@ static void gen7_vme_pipeline_programing(VADriverContextP ctx,
>>   
>>       if ((pSliceParameter->slice_type == SLICE_TYPE_I) ||
>>   	(pSliceParameter->slice_type == SLICE_TYPE_I)) {
>> -	kernel_shader = (is_low_quality ? AVC_VME_OLD_INTRA_SHADER : AVC_VME_INTRA_SHADER);
>> +	kernel_shader = AVC_VME_INTRA_SHADER;
>>       } else if ((pSliceParameter->slice_type == SLICE_TYPE_P) ||
>>                  (pSliceParameter->slice_type == SLICE_TYPE_SP)) {
>> -	kernel_shader = (is_low_quality ? AVC_VME_OLD_INTER_SHADER : AVC_VME_INTER_SHADER);
>> +	kernel_shader = AVC_VME_INTER_SHADER;
>>       } else {
>>   	kernel_shader = AVC_VME_BINTER_SHADER;
>>   	if (!allow_hwscore)
>> -            kernel_shader = (is_low_quality ? AVC_VME_OLD_INTER_SHADER : AVC_VME_INTER_SHADER);
>> +            kernel_shader = AVC_VME_INTER_SHADER;
>>       }
>>   
>>       if (allow_hwscore)
>> @@ -727,10 +675,7 @@ static VAStatus gen7_vme_prepare(VADriverContextP ctx,
>>       gen7_vme_surface_setup(ctx, encode_state, is_intra, encoder_context);
>>       gen7_vme_interface_setup(ctx, encode_state, encoder_context);
>>       gen7_vme_constant_setup(ctx, encode_state, encoder_context);
>> -    if (encoder_context->quality_level == ENCODER_LOW_QUALITY)
>> -        gen7_vme_vme_state_setup(ctx, encode_state, is_intra, encoder_context);
>> -    else
>> -        gen7_vme_avc_state_setup(ctx, encode_state, is_intra, encoder_context);
>> +    gen7_vme_avc_state_setup(ctx, encode_state, is_intra, encoder_context);
>>   
>>       /*Programing media pipeline*/
>>       gen7_vme_pipeline_programing(ctx, encode_state, encoder_context);
>> diff --git a/src/shaders/vme/inter_frame_ivb.asm b/src/shaders/vme/inter_frame_ivb.asm
>> index 3c08851..46f2b4b 100644
>> --- a/src/shaders/vme/inter_frame_ivb.asm
>> +++ b/src/shaders/vme/inter_frame_ivb.asm
>> @@ -391,12 +391,14 @@ mov (1) mb_intra_struct_ub<1>:UB input_mb_intra_ub<0,1,0>:UB {align1};
>>   
>>   /* M0 */
>>   /* IME search */
>> +cmp.z.f0.0 (1)		null<1>:uw	quality_level_ub<0,1,0>:ub		LOW_QUALITY_LEVEL:uw   {align1};
>> +(f0.0) jmpi (1) __low_quality_search;
>> +
>> +__high_quality_search:
>>   mov  (1) vme_m0.12<1>:UD   SEARCH_CTRL_SINGLE + INTER_PART_MASK + INTER_SAD_HAAR + SUB_PEL_MODE_QUARTER:UD {align1};
>>   /* 16x16 Source, 1/4 pixel, harr */
>>   mov  (1) vme_m0.22<1>:UW        REF_REGION_SIZE {align1};         /* Reference Width&Height, 48x40 */
>>   
>> -mov  (1) vme_m0.0<1>:UD		vme_m0.8<0,1,0>:UD      {align1};
>> -
>>   mov  (1) vme_m0.0<1>:W		-16:W			{align1};
>>   mov  (1) vme_m0.2<1>:W		-12:W			{align1};
>>   
>> @@ -405,6 +407,22 @@ and.z.f0.0 (1)		null:uw	input_mb_intra_ub<0,1,0>:ub	INTRA_PRED_AVAIL_FLAG_AE:uw
>>   and.z.f0.0 (1)		null:uw	input_mb_intra_ub<0,1,0>:ub	INTRA_PRED_AVAIL_FLAG_B:uw   {align1};
>>   (f0.0)	add 	(1)	vme_m0.2<1>:w	vme_m0.2<0,1,0>:w	8:w	{align1};
>>   
>> +jmpi __vme_msg;
>> +
>> +__low_quality_search:
>> +mov  (1) vme_m0.12<1>:UD   SEARCH_CTRL_SINGLE + INTER_PART_MASK + INTER_SAD_HAAR + SUB_PEL_MODE_HALF:UD {align1};
>> +/* 16x16 Source, 1/2 pixel, harr */
>> +mov  (1) vme_m0.22<1>:UW        MIN_REF_REGION_SIZE {align1};         /* Reference Width&Height, 32x32 */
>> +
>> +mov  (1) vme_m0.0<1>:W		-8:W			{align1};
>> +mov  (1) vme_m0.2<1>:W		-8:W			{align1};
>> +
>> +and.z.f0.0 (1)		null:uw	input_mb_intra_ub<0,1,0>:ub	INTRA_PRED_AVAIL_FLAG_AE:uw   {align1};
>> +(f0.0)	add 	(1)	vme_m0.0<1>:w	vme_m0.0<0,1,0>:w	4:w	{align1};
>> +and.z.f0.0 (1)		null:uw	input_mb_intra_ub<0,1,0>:ub	INTRA_PRED_AVAIL_FLAG_B:uw   {align1};
>> +(f0.0)	add 	(1)	vme_m0.2<1>:w	vme_m0.2<0,1,0>:w	4:w	{align1};
>> +
>> +__vme_msg:
>>   mov  (1) vme_m0.4<1>:UD		vme_m0.0<0,1,0>:UD	{align1};
>>   add  (2) vme_m0.0<1>:w		vme_m0.0<2,2,1>:w	mb_ref_win.16<2,2,1>:w	{align1};
>>   add  (2) vme_m0.4<1>:w		vme_m0.4<2,2,1>:w	mb_ref_win.16<2,2,1>:w	{align1};
>> diff --git a/src/shaders/vme/inter_frame_ivb.g7b b/src/shaders/vme/inter_frame_ivb.g7b
>> index e4db6ea..7ed38c5 100644
>> --- a/src/shaders/vme/inter_frame_ivb.g7b
>> +++ b/src/shaders/vme/inter_frame_ivb.g7b
>> @@ -141,13 +141,13 @@
>>      { 0x00000001, 0x2fa401ad, 0x00000b04, 0x00000000 },
>>      { 0x00000001, 0x2fa801ad, 0x00000b24, 0x00000000 },
>>      { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 },
>> -   { 0x00000020, 0x34001c00, 0x00001400, 0x000000bc },
>> +   { 0x00000020, 0x34001c00, 0x00001400, 0x000000d0 },
>>      { 0x00000001, 0x2ac001ad, 0x00000fe4, 0x00000000 },
>>      { 0x00000001, 0x2fa001ad, 0x00000ae6, 0x00000000 },
>>      { 0x00000001, 0x2fa401ad, 0x00000b06, 0x00000000 },
>>      { 0x00000001, 0x2fa801ad, 0x00000b26, 0x00000000 },
>>      { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 },
>> -   { 0x00000020, 0x34001c00, 0x00001400, 0x000000b0 },
>> +   { 0x00000020, 0x34001c00, 0x00001400, 0x000000c4 },
>>      { 0x00000001, 0x2ac201ad, 0x00000fe4, 0x00000000 },
>>      { 0x0020000c, 0x2a803dad, 0x00450ac0, 0x00020002 },
>>      { 0x00200040, 0x2a883dad, 0x00450a80, 0x00030003 },
>> @@ -163,15 +163,25 @@
>>      { 0x01000005, 0x20002e28, 0x000000a4, 0x00010001 },
>>      { 0x00010001, 0x247c0171, 0x00000000, 0x00020002 },
>>      { 0x00000001, 0x247d0231, 0x000000a5, 0x00000000 },
>> +   { 0x01000010, 0x20002e28, 0x000000a7, 0x00020002 },
>> +   { 0x00010020, 0x34001c00, 0x00001400, 0x00000012 },
>>      { 0x00000001, 0x244c0061, 0x00000000, 0x00203000 },
>>      { 0x00000001, 0x24560169, 0x00000000, 0x28302830 },
>> -   { 0x00000001, 0x24400021, 0x00000448, 0x00000000 },
>>      { 0x00000001, 0x244001ed, 0x00000000, 0xfff0fff0 },
>>      { 0x00000001, 0x244201ed, 0x00000000, 0xfff4fff4 },
>>      { 0x01000005, 0x20002e28, 0x000000a5, 0x00600060 },
>>      { 0x00010040, 0x24403dad, 0x00000440, 0x000c000c },
>>      { 0x01000005, 0x20002e28, 0x000000a5, 0x00100010 },
>>      { 0x00010040, 0x24423dad, 0x00000442, 0x00080008 },
>> +   { 0x00000020, 0x34001c00, 0x00001400, 0x00000010 },
>> +   { 0x00000001, 0x244c0061, 0x00000000, 0x00201000 },
>> +   { 0x00000001, 0x24560169, 0x00000000, 0x20202020 },
>> +   { 0x00000001, 0x244001ed, 0x00000000, 0xfff8fff8 },
>> +   { 0x00000001, 0x244201ed, 0x00000000, 0xfff8fff8 },
>> +   { 0x01000005, 0x20002e28, 0x000000a5, 0x00600060 },
>> +   { 0x00010040, 0x24403dad, 0x00000440, 0x00040004 },
>> +   { 0x01000005, 0x20002e28, 0x000000a5, 0x00100010 },
>> +   { 0x00010040, 0x24423dad, 0x00000442, 0x00040004 },
>>      { 0x00000001, 0x24440021, 0x00000440, 0x00000000 },
>>      { 0x00200040, 0x244035ad, 0x00450440, 0x00450a90 },
>>      { 0x00200040, 0x244435ad, 0x00450444, 0x00450a90 },
>> diff --git a/src/shaders/vme/vme7.inc b/src/shaders/vme/vme7.inc
>> index 3fa99b7..8a8c32a 100644
>> --- a/src/shaders/vme/vme7.inc
>> +++ b/src/shaders/vme/vme7.inc
>> @@ -54,6 +54,8 @@ define(`SEARCH_CTRL_DUAL_RECORD',       `0x00000300')
>>   define(`SEARCH_CTRL_DUAL_REFERENCE',    `0x00000700')
>>   
>>   define(`REF_REGION_SIZE',               `0x2830:UW')
>> +define(`MIN_REF_REGION_SIZE',           `0x2020:UW')
>> +define(`DREF_REGION_SIZE',              `0x2020:UW')
>>   
>>   define(`BI_SUB_MB_PART_MASK',           `0x0c000000')
>>   define(`MAX_NUM_MV',                    `0x00000020')
>> @@ -132,6 +134,7 @@ define(`orig_y_ub',             `inline_reg0.1')
>>   define(`transform_8x8_ub',      `inline_reg0.4')
>>   define(`input_mb_intra_ub',     `inline_reg0.5')
>>   define(`num_macroblocks',       `inline_reg0.6')
>> +define(`quality_level_ub',      `inline_reg0.7')
>>   
>>   /*
>>    * GRF 6~11 -- reserved
>> @@ -291,7 +294,6 @@ define(`mb_mv3',		`r96')
>>   define(`mb_ref',		`r97')
>>   define(`mb_ref_win',		`r84')
>>   
>> -define(`DREF_REGION_SIZE',               `0x2020:UW')
>>   define(`PRED_L0',               `0x0':uw)
>>   define(`PRED_L1',               `0x1':uw)
>>   define(`PRED_BI',               `0x2':uw)
>> @@ -317,3 +319,7 @@ define(`INTER_8X16MODE',		`0x02')
>>   define(`OBR_MESSAGE_FENCE',              `7')
>>   define(`OBR_MF_NOCOMMIT',		 `0')
>>   define(`OBR_MF_COMMIT',			 `0x20')
>> +
>> +define(`DEFAULT_QUALITY_LEVEL',           `0x00')
>> +define(`HIGH_QUALITY_LEVEL',              `0x01')
>> +define(`LOW_QUALITY_LEVEL',               `0x02')
>
>
>



More information about the Libva mailing list