diff options
author | Zhao Yakui <yakui.zhao@intel.com> | 2012-12-28 16:30:50 +0800 |
---|---|---|
committer | Xiang, Haihao <haihao.xiang@intel.com> | 2013-01-17 13:08:40 +0800 |
commit | f3d28947b7e4ba91fa7c273433ec54de56a9e83e (patch) | |
tree | 264d6c42d439e7e37c0377e94914a0ba71d28aaf /src | |
parent | 855a7f1fbf97c718bfdc7cab33348e3b333d1cbb (diff) | |
download | libva-intel-driver-f3d28947b7e4ba91fa7c273433ec54de56a9e83e.tar.gz |
Add the bidirectional MV prediction for B-frame on Haswell
Now the B-frame only supports the forward prediction. In order to
get the better prediction result, the bidirection prediction is added
for B-frame. At the same time the MV prediction is also added.
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gen6_mfc_common.c | 4 | ||||
-rw-r--r-- | src/gen75_mfc.c | 15 | ||||
-rw-r--r-- | src/gen75_vme.c | 39 | ||||
-rw-r--r-- | src/shaders/vme/Makefile.am | 6 | ||||
-rw-r--r-- | src/shaders/vme/inter_bframe_haswell.asm | 828 | ||||
-rw-r--r-- | src/shaders/vme/inter_bframe_haswell.g75a | 2 | ||||
-rw-r--r-- | src/shaders/vme/inter_bframe_haswell.g75b | 397 | ||||
-rw-r--r-- | src/shaders/vme/vme75.inc | 23 |
8 files changed, 1299 insertions, 15 deletions
diff --git a/src/gen6_mfc_common.c b/src/gen6_mfc_common.c index 2ece62bf..1cab68cf 100644 --- a/src/gen6_mfc_common.c +++ b/src/gen6_mfc_common.c @@ -789,7 +789,7 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx, vme_state_message[MODE_INTER_8X8] = 0x4a; vme_state_message[MODE_INTER_8X4] = 0x4a; vme_state_message[MODE_INTER_4X4] = 0x4a; - vme_state_message[MODE_INTER_BWD] = 0x4a; + vme_state_message[MODE_INTER_BWD] = 0x2a; return; } m_costf = lambda * 10; @@ -836,7 +836,7 @@ void intel_vme_update_mbmv_cost(VADriverContextP ctx, m_costf = lambda * 6.5; m_cost = m_costf; vme_state_message[MODE_INTER_4X4] = intel_format_lutvalue(m_cost, 0x6f); - m_costf = lambda * 2.5; + m_costf = lambda * 1.5; m_cost = m_costf; vme_state_message[MODE_INTER_BWD] = intel_format_lutvalue(m_cost, 0x6f); } diff --git a/src/gen75_mfc.c b/src/gen75_mfc.c index 184fcb7a..dd8bf715 100644 --- a/src/gen75_mfc.c +++ b/src/gen75_mfc.c @@ -259,11 +259,13 @@ gen75_mfc_avc_img_state(VADriverContextP ctx, struct encode_state *encode_state, BEGIN_BCS_BATCH(batch, 16); OUT_BCS_BATCH(batch, MFX_AVC_IMG_STATE | (16 - 2)); + /*DW1. MB setting of frame */ OUT_BCS_BATCH(batch, ((width_in_mbs * height_in_mbs) & 0xFFFF)); OUT_BCS_BATCH(batch, ((height_in_mbs - 1) << 16) | ((width_in_mbs - 1) << 0)); + /* DW3 QP setting */ OUT_BCS_BATCH(batch, (0 << 24) | /* Second Chroma QP Offset */ (0 << 16) | /* Chroma QP Offset */ @@ -289,17 +291,22 @@ gen75_mfc_avc_img_state(VADriverContextP ctx, struct encode_state *encode_state, (1 << 2) | /* Frame MB only flag */ (0 << 1) | /* MBAFF mode is in active */ (0 << 0)); /* Field picture flag */ + /* DW5 Trellis quantization */ OUT_BCS_BATCH(batch, 0); /* Mainly about MB rate control and debug, just ignoring */ OUT_BCS_BATCH(batch, /* Inter and Intra Conformance Max size limit */ (0xBB8 << 16) | /* InterMbMaxSz */ (0xEE8) ); /* IntraMbMaxSz */ OUT_BCS_BATCH(batch, 0); /* Reserved */ + /* DW8. QP delta */ OUT_BCS_BATCH(batch, 0); /* Slice QP Delta for bitrate control */ - OUT_BCS_BATCH(batch, 0); /* Slice QP Delta for bitrate control */ + OUT_BCS_BATCH(batch, 0); /* Slice QP Delta for bitrate control */ + /* DW10. Bit setting for MB */ OUT_BCS_BATCH(batch, 0x8C000000); OUT_BCS_BATCH(batch, 0x00010000); + /* DW12. */ OUT_BCS_BATCH(batch, 0); - OUT_BCS_BATCH(batch, 0); + OUT_BCS_BATCH(batch, 0x02010100); + /* DW14. For short format */ OUT_BCS_BATCH(batch, 0); OUT_BCS_BATCH(batch, 0); @@ -893,6 +900,7 @@ gen75_mfc_avc_slice_state(VADriverContextP ctx, int bit_rate_control_target, maxQpN, maxQpP; unsigned char correct[6], grow, shrink; int i; + int bslice = 0; int weighted_pred_idc = 0; unsigned int luma_log2_weight_denom = slice_param->luma_log2_weight_denom; unsigned int chroma_log2_weight_denom = slice_param->chroma_log2_weight_denom; @@ -910,6 +918,7 @@ gen75_mfc_avc_slice_state(VADriverContextP ctx, weighted_pred_idc = pic_param->pic_fields.bits.weighted_pred_flag; } else if (slice_type == SLICE_TYPE_B) { weighted_pred_idc = pic_param->pic_fields.bits.weighted_bipred_idc; + bslice = 1; if (weighted_pred_idc == 2) { /* 8.4.3 - Derivation process for prediction weights (8-279) */ @@ -938,7 +947,7 @@ gen75_mfc_avc_slice_state(VADriverContextP ctx, OUT_BCS_BATCH(batch, 0); /*no reference frames and pred_weight_table*/ } else { OUT_BCS_BATCH(batch, - (1 << 16) | /*1 reference frame*/ + (1 << 16) | (bslice << 24) | /*1 reference frame*/ (chroma_log2_weight_denom << 8) | (luma_log2_weight_denom << 0)); } diff --git a/src/gen75_vme.c b/src/gen75_vme.c index 60eb19a1..b53155d9 100644 --- a/src/gen75_vme.c +++ b/src/gen75_vme.c @@ -55,6 +55,7 @@ #define VME_INTRA_SHADER 0 #define VME_INTER_SHADER 1 +#define VME_BINTER_SHADER 3 #define VME_BATCHBUFFER 2 #define CURBE_ALLOCATION_SIZE 37 /* in 256-bit */ @@ -75,6 +76,10 @@ static const uint32_t gen75_vme_inter_frame[][4] = { #include "shaders/vme/inter_frame_haswell.g75b" }; +static const uint32_t gen75_vme_inter_bframe[][4] = { +#include "shaders/vme/inter_bframe_haswell.g75b" +}; + static const uint32_t gen75_vme_batchbuffer[][4] = { #include "shaders/vme/batchbuffer.g75b" }; @@ -101,6 +106,13 @@ static struct i965_kernel gen75_vme_kernels[] = { sizeof(gen75_vme_batchbuffer), NULL }, + { + "VME inter BFrame", + VME_BINTER_SHADER, + gen75_vme_inter_bframe, + sizeof(gen75_vme_inter_bframe), + NULL + } }; static const uint32_t gen75_vme_mpeg2_intra_frame[][4] = { @@ -305,7 +317,7 @@ static VAStatus gen75_vme_interface_setup(VADriverContextP ctx, assert(bo->virtual); desc = bo->virtual; - for (i = 0; i < GEN6_VME_KERNEL_NUMBER; i++) { + for (i = 0; i < vme_context->vme_kernel_sum; i++) { struct i965_kernel *kernel; kernel = &vme_context->gpe_context.kernels[i]; assert(sizeof(*desc) == 32); @@ -738,6 +750,7 @@ static void gen75_vme_pipeline_programing(VADriverContextP ctx, int is_intra = pSliceParameter->slice_type == SLICE_TYPE_I; int width_in_mbs = pSequenceParameter->picture_width_in_mbs; int height_in_mbs = pSequenceParameter->picture_height_in_mbs; + int kernel_shader; bool allow_hwscore = true; int s; @@ -748,19 +761,29 @@ static void gen75_vme_pipeline_programing(VADriverContextP ctx, break; } } - + if ((pSliceParameter->slice_type == SLICE_TYPE_I) || + (pSliceParameter->slice_type == SLICE_TYPE_I)) { + kernel_shader = VME_INTRA_SHADER; + } else if ((pSliceParameter->slice_type == SLICE_TYPE_P) || + (pSliceParameter->slice_type == SLICE_TYPE_SP)) { + kernel_shader = VME_INTER_SHADER; + } else { + kernel_shader = VME_BINTER_SHADER; + if (!allow_hwscore) + kernel_shader = VME_INTER_SHADER; + } if (allow_hwscore) gen75_vme_walker_fill_vme_batchbuffer(ctx, encode_state, width_in_mbs, height_in_mbs, - is_intra ? VME_INTRA_SHADER : VME_INTER_SHADER, + kernel_shader, pPicParameter->pic_fields.bits.transform_8x8_mode_flag, encoder_context); else gen75_vme_fill_vme_batchbuffer(ctx, encode_state, width_in_mbs, height_in_mbs, - is_intra ? VME_INTRA_SHADER : VME_INTER_SHADER, + kernel_shader, pPicParameter->pic_fields.bits.transform_8x8_mode_flag, encoder_context); @@ -1122,6 +1145,7 @@ Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context * { struct gen6_vme_context *vme_context = calloc(1, sizeof(struct gen6_vme_context)); struct i965_kernel *vme_kernel_list = NULL; + int i965_kernel_num; switch (encoder_context->profile) { case VAProfileH264Baseline: @@ -1129,13 +1153,14 @@ Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context * case VAProfileH264High: vme_kernel_list = gen75_vme_kernels; encoder_context->vme_pipeline = gen75_vme_pipeline; - + i965_kernel_num = sizeof(gen75_vme_kernels) / sizeof(struct i965_kernel); break; case VAProfileMPEG2Simple: case VAProfileMPEG2Main: vme_kernel_list = gen75_vme_mpeg2_kernels; encoder_context->vme_pipeline = gen75_vme_mpeg2_pipeline; + i965_kernel_num = sizeof(gen75_vme_mpeg2_kernels) / sizeof(struct i965_kernel); break; @@ -1145,7 +1170,7 @@ Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context * break; } - + vme_context->vme_kernel_sum = i965_kernel_num; vme_context->gpe_context.surface_state_binding_table.length = (SURFACE_STATE_PADDED_SIZE + sizeof(unsigned int)) * MAX_MEDIA_SURFACES_GEN6; vme_context->gpe_context.idrt.max_entries = MAX_INTERFACE_DESC_GEN6; @@ -1181,7 +1206,7 @@ Bool gen75_vme_context_init(VADriverContextP ctx, struct intel_encoder_context * i965_gpe_load_kernels(ctx, &vme_context->gpe_context, vme_kernel_list, - GEN6_VME_KERNEL_NUMBER); + i965_kernel_num); vme_context->vme_surface2_setup = gen7_gpe_surface2_setup; vme_context->vme_media_rw_surface_setup = gen7_gpe_media_rw_surface_setup; vme_context->vme_buffer_suface_setup = gen7_gpe_buffer_suface_setup; diff --git a/src/shaders/vme/Makefile.am b/src/shaders/vme/Makefile.am index 5ccf6d22..cfe8f5f3 100644 --- a/src/shaders/vme/Makefile.am +++ b/src/shaders/vme/Makefile.am @@ -1,5 +1,5 @@ VME_CORE = batchbuffer.asm intra_frame.asm inter_frame.asm -VME75_CORE = batchbuffer.asm intra_frame_haswell.asm inter_frame_haswell.asm +VME75_CORE = batchbuffer.asm intra_frame_haswell.asm inter_frame_haswell.asm inter_bframe_haswell.asm INTEL_G6B = batchbuffer.g6b intra_frame.g6b inter_frame.g6b INTEL_G6A = batchbuffer.g6a intra_frame.g6a inter_frame.g6a @@ -11,8 +11,8 @@ INTEL_G7A = batchbuffer.g7a intra_frame.g7a inter_frame.g7a mpeg2_inter_frame.g7 INTEL_GEN7_INC = batchbuffer.inc vme.inc vme7_mpeg2.inc INTEL_GEN7_ASM = $(INTEL_G7A:%.g7a=%.gen7.asm) -INTEL_G75B = batchbuffer.g75b intra_frame_haswell.g75b inter_frame_haswell.g75b mpeg2_inter_frame_haswell.g75b -INTEL_G75A = batchbuffer.g75a intra_frame_haswell.g75a inter_frame_haswell.g75a mpeg2_inter_frame_haswell.g75a +INTEL_G75B = batchbuffer.g75b intra_frame_haswell.g75b inter_frame_haswell.g75b mpeg2_inter_frame_haswell.g75b inter_bframe_haswell.g75b +INTEL_G75A = batchbuffer.g75a intra_frame_haswell.g75a inter_frame_haswell.g75a mpeg2_inter_frame_haswell.g75a inter_bframe_haswell.g75a INTEL_GEN75_INC = batchbuffer.inc vme75.inc vme75_mpeg2.inc INTEL_GEN75_ASM = $(INTEL_G75A:%.g75a=%.gen75.asm) diff --git a/src/shaders/vme/inter_bframe_haswell.asm b/src/shaders/vme/inter_bframe_haswell.asm new file mode 100644 index 00000000..9ab35d32 --- /dev/null +++ b/src/shaders/vme/inter_bframe_haswell.asm @@ -0,0 +1,828 @@ +/* + * Copyright © <2010>, Intel Corporation. + * + * This program is licensed under the terms and conditions of the + * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at + * http://www.opensource.org/licenses/eclipse-1.0.php. + * Authors: Zhao Yakui <yakui.zhao@intel.com> + */ +// Modual name: Inter_bframe_haswell.asm +// +// Make intra predition estimation for Inter frame for B-frame +// + +// +// Now, begin source code.... +// + +#define SAVE_RET add (1) RETURN_REG<1>:ud ip:ud 32:ud +#define RETURN mov (1) ip:ud RETURN_REG<0,1,0>:ud + +/* + * __START + */ +__INTRA_START: +mov (16) tmp_reg0.0<1>:UD 0x0:UD {align1}; +mov (16) tmp_reg2.0<1>:UD 0x0:UD {align1}; +mov (16) tmp_reg4.0<1>:UD 0x0:UD {align1} ; +mov (16) tmp_reg6.0<1>:UD 0x0:UD {align1} ; + +shl (2) read0_header.0<1>:D orig_xy_ub<2,2,1>:UB 4:UW {align1}; /* (x, y) * 16 */ +add (1) read0_header.0<1>:D read0_header.0<0,1,0>:D -8:W {align1}; /* X offset */ +add (1) read0_header.4<1>:D read0_header.4<0,1,0>:D -1:W {align1}; /* Y offset */ +mov (1) read0_header.8<1>:UD BLOCK_32X1 {align1}; +mov (1) read0_header.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +shl (2) read1_header.0<1>:D orig_xy_ub<2,2,1>:UB 4:UW {align1}; /* (x, y) * 16 */ +add (1) read1_header.0<1>:D read1_header.0<0,1,0>:D -4:W {align1}; /* X offset */ +mov (1) read1_header.8<1>:UD BLOCK_4X16 {align1}; +mov (1) read1_header.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +shl (2) vme_m0.8<1>:UW orig_xy_ub<2,2,1>:UB 4:UW {align1}; /* (x, y) * 16 */ +mov (1) vme_m0.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +mul (1) obw_m0.8<1>:UD w_in_mb_uw<0,1,0>:UW orig_y_ub<0,1,0>:UB {align1}; +add (1) obw_m0.8<1>:UD obw_m0.8<0,1,0>:UD orig_x_ub<0,1,0>:UB {align1}; +mul (1) obw_m0.8<1>:UD obw_m0.8<0,1,0>:UD 24:UD {align1}; +mov (1) obw_m0.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +/* + * Media Read Message -- fetch Luma neighbor edge pixels + */ +/* ROW */ +mov (8) msg_reg0.0<1>:UD read0_header.0<8,8,1>:UD {align1}; +send (8) msg_ind INEP_ROW<1>:UB null read(BIND_IDX_INEP, 0, 0, 4) mlen 1 rlen 1 {align1}; + +/* COL */ +mov (8) msg_reg0.0<1>:UD read1_header.0<8,8,1>:UD {align1}; +send (8) msg_ind INEP_COL0<1>:UB null read(BIND_IDX_INEP, 0, 0, 4) mlen 1 rlen 2 {align1}; + +/* + * Media Read Message -- fetch Chroma neighbor edge pixels + */ +/* ROW */ +shl (2) read0_header.0<1>:D orig_xy_ub<2,2,1>:UB 3:UW {align1}; /* x * 16 , y * 8 */ +mul (1) read0_header.0<1>:D read0_header.0<0,1,0>:D 2:W {align1}; +add (1) read0_header.0<1>:D read0_header.0<0,1,0>:D -8:W {align1}; /* X offset */ +add (1) read0_header.4<1>:D read0_header.4<0,1,0>:D -1:W {align1}; /* Y offset */ +mov (8) msg_reg0.0<1>:UD read0_header.0<8,8,1>:UD {align1}; +send (8) msg_ind CHROMA_ROW<1>:UB null read(BIND_IDX_CBCR, 0, 0, 4) mlen 1 rlen 1 {align1}; + +/* COL */ +shl (2) read1_header.0<1>:D orig_xy_ub<2,2,1>:UB 3:UW {align1}; /* x * 16, y * 8 */ +mul (1) read1_header.0<1>:D read1_header.0<0,1,0>:D 2:W {align1}; +add (1) read1_header.0<1>:D read1_header.0<0,1,0>:D -4:W {align1}; /* X offset */ +mov (1) read1_header.8<1>:UD BLOCK_8X4 {align1}; +mov (8) msg_reg0.0<1>:UD read1_header.0<8,8,1>:UD {align1}; +send (8) msg_ind CHROMA_COL<1>:UB null read(BIND_IDX_CBCR, 0, 0, 4) mlen 1 rlen 1 {align1}; + +mov (8) vme_m1.0<1>:ud 0:ud {align1}; +mov (8) mb_mvp_ref.0<1>:ud 0:ud {align1}; +and.z.f0.0 (1) null:uw mb_hwdep<0,1,0>:uw 0x04:uw {align1}; +(f0.0) jmpi (1) __mb_hwdep_end; + +/* read back the data for MB A */ +/* the layout of MB result is: rx.0(Available). rx.4(MVa), rX.8(MVb), rX.16(Pred_L0 flag), +* rX.18 (Pred_L1 flag), rX.20(Forward reference ID), rX.22(Backwared reference ID) +*/ +mov (8) mba_result.0<1>:ud 0x0:ud {align1}; +mov (8) mbb_result.0<1>:ud 0x0:ud {align1}; +mov (8) mbc_result.0<1>:ud 0x0:ud {align1}; +mba_start: +mov (8) mb_msg0.0<1>:ud 0:ud {align1}; +and.z.f0.0 (1) null:uw input_mb_intra_ub<0,1,0>:ub INTRA_PRED_AVAIL_FLAG_AE:uw {align1}; +/* MB A doesn't exist. Zero MV. mba_flag is zero and ref ID = -1 */ +(f0.0) mov (2) mba_result.20<1>:w -1:w {align1}; +(f0.0) jmpi (1) mbb_start; +mov (1) mba_result.0<1>:d MB_AVAIL {align1}; +mov (2) tmp_reg0.0<1>:UW orig_xy_ub<2,2,1>:UB {align1}; +add (1) tmp_reg0.0<1>:w tmp_reg0.0<0,1,0>:w -1:w {align1}; +mul (1) mb_msg0.8<1>:UD w_in_mb_uw<0,1,0>:UW tmp_reg0.2<0,1,0>:UW {align1}; +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD tmp_reg0.0<0,1,0>:uw {align1}; +mul (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD 24:UD {align1}; +mov (1) mb_msg0.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +/* bind index 3, read 4 oword (64bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_wb.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_4, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 2 + {align1}; + +/* TODO: RefID is required after multi-references are added */ +cmp.l.f0.0 (1) null:w mb_intra_wb.16<0,1,0>:uw mb_inter_wb.8<0,1,0>:uw {align1}; +(f0.0) mov (2) mba_result.20<1>:w -1:w {align1}; +(f0.0) jmpi (1) mbb_start; + +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:ud 3:ud {align1}; +/* Read MV for MB A */ +/* bind index 3, read 8 oword (128bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_mv0.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_8, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 4 + {align1}; +/* TODO: RefID is required after multi-references are added */ +/* MV */ +mov (2) mba_result.4<1>:ud mb_mv1.8<2,2,1>:ud {align1}; +mov (2) mba_result.20<1>:w -1:w {align1}; +mov (1) INPUT_ARG0.0<1>:ud mb_inter_wb.4<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.4<1>:ud mb_inter_wb.0<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.8<1>:ud INTER_BLOCK1:ud {align1}; +SAVE_RET {align1}; +jmpi (1) mb_pred_func; +mov (1) mb_pred_mode.0<1>:uw RET_ARG<0,1,0>:uw {align1}; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L0 {align1}; +(f0.0) mov (1) mba_result.16<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mba_result.20<1>:w 0:w {align1}; +(f0.0) jmpi (1) mbb_start; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L1 {align1}; +(f0.0) mov (1) mba_result.18<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mba_result.22<1>:w 0:w {align1}; +(f0.0) jmpi (1) mbb_start; +mov (2) mba_result.16<1>:uw MB_PRED_FLAG {align1}; +mov (2) mba_result.20<1>:w 0:w {align1}; + +mbb_start: +mov (8) mb_msg0.0<1>:ud 0:ud {align1}; +and.z.f0.0 (1) null:uw input_mb_intra_ub<0,1,0>:ub INTRA_PRED_AVAIL_FLAG_B:uw {align1}; +/* MB B doesn't exist. Zero MV. mba_flag is zero */ +/* If MB B doesn't exist, neight of MB C nor D exists */ +(f0.0) mov (2) mbb_result.20<1>:w -1:w {align1}; +(f0.0) mov (2) mbc_result.20<1>:w -1:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; +mov (1) mbb_result.0<1>:d MB_AVAIL {align1}; +mov (2) tmp_reg0.0<1>:UW orig_xy_ub<2,2,1>:UB {align1}; +add (1) tmp_reg0.2<1>:w tmp_reg0.2<0,1,0>:w -1:w {align1}; +mul (1) mb_msg0.8<1>:UD w_in_mb_uw<0,1,0>:UW tmp_reg0.2<0,1,0>:UW {align1}; +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD tmp_reg0.0<0,1,0>:uw {align1}; +mul (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD 24:UD {align1}; +mov (1) mb_msg0.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +/* bind index 3, read 4 oword (64bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_wb.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_4, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 2 + {align1}; + +/* TODO: RefID is required after multi-references are added */ +cmp.l.f0.0 (1) null:w mb_intra_wb.16<0,1,0>:uw mb_inter_wb.8<0,1,0>:uw {align1}; +(f0.0) mov (2) mbb_result.20<1>:w -1:w {align1}; +(f0.0) jmpi (1) mbc_start; +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:ud 3:ud {align1}; +/* Read MV for MB B */ +/* bind index 3, read 8 oword (128bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_mv0.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_8, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 4 + {align1}; +/* TODO: RefID is required after multi-references are added */ +mov (2) mbb_result.4<1>:ud mb_mv2.16<2,2,1>:ud {align1}; +mov (2) mbb_result.20<1>:w -1:w {align1}; +mov (1) INPUT_ARG0.0<1>:ud mb_inter_wb.4<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.4<1>:ud mb_inter_wb.0<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.8<1>:ud INTER_BLOCK2:ud {align1}; +SAVE_RET {align1}; +jmpi (1) mb_pred_func; +mov (1) mb_pred_mode.0<1>:uw RET_ARG<0,1,0>:uw {align1}; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L0 {align1}; +(f0.0) mov (1) mbb_result.16<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mbb_result.20<1>:w 0:w {align1}; +(f0.0) jmpi (1) mbc_start; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L1 {align1}; +(f0.0) mov (1) mbb_result.18<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mbb_result.22<1>:w 0:w {align1}; +(f0.0) jmpi (1) mbc_start; +mov (2) mbb_result.16<1>:uw MB_PRED_FLAG {align1}; +mov (2) mbb_result.20<1>:w 0:w {align1}; + +mbc_start: +mov (8) mb_msg0.0<1>:ud 0:ud {align1}; +and.z.f0.0 (1) null:uw input_mb_intra_ub<0,1,0>:ub INTRA_PRED_AVAIL_FLAG_C:uw {align1}; +/* MB C doesn't exist. Zero MV. mba_flag is zero */ +/* Based on h264 spec the MB D will be replaced if MB C doesn't exist */ +(f0.0) jmpi (1) mbd_start; +mov (1) mbc_result.0<1>:d MB_AVAIL {align1}; +mov (2) tmp_reg0.0<1>:UW orig_xy_ub<2,2,1>:UB {align1}; +add (1) tmp_reg0.2<1>:w tmp_reg0.2<0,1,0>:w -1:w {align1}; +add (1) tmp_reg0.0<1>:w tmp_reg0.0<0,1,0>:w 1:w {align1}; +mul (1) mb_msg0.8<1>:UD w_in_mb_uw<0,1,0>:UW tmp_reg0.2<0,1,0>:UW {align1}; +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD tmp_reg0.0<0,1,0>:uw {align1}; +mul (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD 24:UD {align1}; +mov (1) mb_msg0.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +/* bind index 3, read 4 oword (64bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_wb.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_4, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 2 + {align1}; + +/* TODO: RefID is required after multi-references are added */ +cmp.l.f0.0 (1) null:w mb_intra_wb.16<0,1,0>:uw mb_inter_wb.8<0,1,0>:uw {align1}; +(f0.0) mov (2) mbc_result.20<1>:w -1:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:ud 3:ud {align1}; +/* Read MV for MB C */ +/* bind index 3, read 8 oword (128bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_mv0.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_8, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 4 + {align1}; +/* TODO: RefID is required after multi-references are added */ +/* Forward MV */ +mov (2) mbc_result.4<1>:ud mb_mv2.16<2,2,1>:ud {align1}; +mov (2) mbc_result.20<1>:w -1:w {align1}; +mov (1) INPUT_ARG0.0<1>:ud mb_inter_wb.4<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.4<1>:ud mb_inter_wb.0<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.8<1>:ud INTER_BLOCK2:ud {align1}; +SAVE_RET {align1}; +jmpi (1) mb_pred_func; +mov (1) mb_pred_mode.0<1>:uw RET_ARG<0,1,0>:uw {align1}; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L0 {align1}; +(f0.0) mov (1) mbc_result.16<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mbc_result.20<1>:w 0:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L1 {align1}; +(f0.0) mov (1) mbc_result.18<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mbc_result.22<1>:w 0:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; +mov (2) mbc_result.16<1>:uw MB_PRED_FLAG {align1}; +mov (2) mbc_result.20<1>:w 0:w {align1}; + +jmpi (1) mb_mvp_start; +mbd_start: +mov (1) mbc_result.0<1>:d MB_AVAIL {align1}; +mov (2) tmp_reg0.0<1>:UW orig_xy_ub<2,2,1>:UB {align1}; +add (2) tmp_reg0.0<1>:w tmp_reg0.0<2,2,1>:w -1:w {align1}; +mul (1) mb_msg0.8<1>:UD w_in_mb_uw<0,1,0>:UW tmp_reg0.2<0,1,0>:UW {align1}; +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD tmp_reg0.0<0,1,0>:uw {align1}; +mul (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:UD 24:UD {align1}; +mov (1) mb_msg0.20<1>:UB thread_id_ub {align1}; /* dispatch id */ + +/* bind index 3, read 4 oword (64bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_wb.0<1>:ud + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_4, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 2 + {align1}; + +cmp.l.f0.0 (1) null:w mb_intra_wb.16<0,1,0>:uw mb_inter_wb.8<0,1,0>:uw {align1}; +(f0.0) mov (2) mbc_result.20<1>:w -1:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; + +add (1) mb_msg0.8<1>:UD mb_msg0.8<0,1,0>:ud 3:ud {align1}; +/* Read MV for MB D */ +/* bind index 3, read 8 oword (128bytes), msg type: 0(OWord Block Read) */ +send (16) + mb_ind + mb_mv0.0<1>:ub + NULL + data_port( + OBR_CACHE_TYPE, + OBR_MESSAGE_TYPE, + OBR_CONTROL_8, + OBR_BIND_IDX, + OBR_WRITE_COMMIT_CATEGORY, + OBR_HEADER_PRESENT + ) + mlen 1 + rlen 4 + {align1}; + +/* TODO: RefID is required after multi-references are added */ + +/* Forward MV */ +mov (2) mbc_result.4<1>:ud mb_mv3.24<2,2,1>:ud {align1}; +mov (2) mbc_result.20<1>:w -1:w {align1}; +mov (1) INPUT_ARG0.0<1>:ud mb_inter_wb.4<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.4<1>:ud mb_inter_wb.0<0,1,0>:ud {align1}; +mov (1) INPUT_ARG0.8<1>:ud INTER_BLOCK3:ud {align1}; +SAVE_RET {align1}; +jmpi (1) mb_pred_func; +mov (1) mb_pred_mode.0<1>:uw RET_ARG<0,1,0>:uw {align1}; +mov (1) mbc_result.18<1>:w MB_PRED_FLAG {align1}; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L0 {align1}; +(f0.0) mov (1) mbc_result.16<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mbc_result.20<1>:w 0:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; +cmp.e.f0.0 (1) null:uw mb_pred_mode.0<0,1,0>:uw PRED_L1 {align1}; +(f0.0) mov (1) mbc_result.18<1>:uw MB_PRED_FLAG {align1}; +(f0.0) mov (1) mbc_result.22<1>:w 0:w {align1}; +(f0.0) jmpi (1) mb_mvp_start; +mov (2) mbc_result.16<1>:uw MB_PRED_FLAG {align1}; +mov (2) mbc_result.20<1>:w 0:w {align1}; + +mb_mvp_start: +/*TODO: Add the skip prediction */ +/* Check whether both MB and C are invailable */ +add (1) tmp_reg0.0<1>:d mbb_result.0<0,1,0>:d mbc_result.0<0,1,0>:d {align1}; +cmp.z.f0.0 (1) null:d tmp_reg0.0<0,1,0>:d 0:d {align1}; +(-f0.0) jmpi (1) mb_median_start; +cmp.nz.f0.0 (1) null:d mba_result.0<0,1,0>:d 1:d {align1}; +(f0.0) mov (2) mbb_result.4<1>:ud mba_result.4<2,2,1>:ud {align1}; +(f0.0) mov (2) mbc_result.4<1>:ud mba_result.4<2,2,1>:ud {align1}; +(f0.0) mov (2) mbb_result.20<1>:uw mba_result.20<2,2,1>:uw {align1}; +(f0.0) mov (2) mbc_result.20<1>:uw mba_result.20<2,2,1>:uw {align1}; +(f0.0) mov (2) mb_mvp_ref.0<1>:ud mba_result.4<2,2,1>:ud {align1}; +(-f0.0) mov (2) mb_mvp_ref.0<1>:ud 0:ud {align1}; +jmpi (1) __mb_hwdep_end; + +mb_median_start: +/* forward_MVP */ +/* check whether only one neighbour MB has the same ref ID with the current MB */ +mov (8) tmp_reg0.0<1>:ud 0:ud {align1}; +cmp.z.f0.0 (1) null:d mba_result.20<1>:w 0:w {align1}; +(f0.0) add (1) tmp_reg0.0<1>:w tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) tmp_reg0.4<1>:ud mba_result.4<0,1,0>:ud {align1}; +cmp.z.f0.0 (1) null:d mbb_result.20<1>:w 0:w {align1}; +(f0.0) add (1) tmp_reg0.0<1>:w tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) tmp_reg0.4<1>:ud mbb_result.4<0,1,0>:ud {align1}; +cmp.z.f0.0 (1) null:d mbc_result.20<1>:w 0:w {align1}; +(f0.0) add (1) tmp_reg0.0<1>:w tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) tmp_reg0.4<1>:ud mbc_result.4<0,1,0>:ud {align1}; +cmp.e.f0.0 (1) null:d tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) mb_mvp_ref.0<1>:ud tmp_reg0.4<0,1,0>:ud {align1}; +(f0.0) jmpi (1) mvp_backward; + +mov (1) INPUT_ARG0.0<1>:w mba_result.4<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.4<1>:w mbb_result.4<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.8<1>:w mbc_result.4<0,1,0>:w {align1}; +SAVE_RET {align1}; + jmpi (1) word_imedian; +mov (1) mb_mvp_ref.0<1>:w RET_ARG<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.0<1>:w mba_result.6<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.4<1>:w mbb_result.6<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.8<1>:w mbc_result.6<0,1,0>:w {align1}; +SAVE_RET {align1}; +jmpi (1) word_imedian; +mov (1) mb_mvp_ref.2<1>:w RET_ARG<0,1,0>:w {align1}; + + +mvp_backward: +/* check whether only one neighbour MB has the same ref ID with the current MB */ +mov (8) tmp_reg0.0<1>:ud 0:ud {align1}; +cmp.z.f0.0 (1) null:d mba_result.22<1>:w 0:w {align1}; +(f0.0) add (1) tmp_reg0.0<1>:w tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) tmp_reg0.4<1>:ud mba_result.8<0,1,0>:ud {align1}; +cmp.z.f0.0 (1) null:d mbb_result.22<1>:w 0:w {align1}; +(f0.0) add (1) tmp_reg0.0<1>:w tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) tmp_reg0.4<1>:ud mbb_result.8<0,1,0>:ud {align1}; +cmp.z.f0.0 (1) null:d mbc_result.20<1>:w 0:w {align1}; +(f0.0) add (1) tmp_reg0.0<1>:w tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) tmp_reg0.4<1>:ud mbc_result.8<0,1,0>:ud {align1}; +cmp.e.f0.0 (1) null:d tmp_reg0.0<1>:w 1:w {align1}; +(f0.0) mov (1) mb_mvp_ref.4<1>:ud tmp_reg0.4<0,1,0>:ud {align1}; +(f0.0) jmpi (1) __mb_hwdep_end; + +mov (1) INPUT_ARG0.0<1>:w mba_result.8<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.4<1>:w mbb_result.8<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.8<1>:w mbc_result.8<0,1,0>:w {align1}; +SAVE_RET {align1}; + jmpi (1) word_imedian; +mov (1) mb_mvp_ref.4<1>:w RET_ARG<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.0<1>:w mba_result.10<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.4<1>:w mbb_result.10<0,1,0>:w {align1}; +mov (1) INPUT_ARG0.8<1>:w mbc_result.10<0,1,0>:w {align1}; +SAVE_RET {align1}; +jmpi (1) word_imedian; +mov (1) mb_mvp_ref.6<1>:w RET_ARG<0,1,0>:w {align1}; + +__mb_hwdep_end: +/* m2, get the MV/Mb cost passed from constant buffer when +spawning thread by MEDIA_OBJECT */ +mov (8) vme_m2<1>:UD r1.0<8,8,1>:UD {align1}; + +mov (8) vme_msg_2<1>:UD vme_m2.0<8,8,1>:UD {align1}; + +/* m3 */ +mov (8) vme_msg_3<1>:UD 0x0:UD {align1}; + +/* m4 */ +mov (1) INEP_ROW.0<1>:UD 0x0:UD {align1}; +and (1) INEP_ROW.4<1>:UD INEP_ROW.4<0,1,0>:UD 0xFF000000:UD {align1}; +mov (8) vme_msg_4<1>:UD INEP_ROW.0<8,8,1>:UD {align1}; + +/* m5 */ +mov (8) vme_msg_5<1>:UD 0x0:UD {align1}; +mov (16) vme_msg_5.0<1>:UB INEP_COL0.3<32,8,4>:UB {align1}; +mov (1) vme_msg_5.16<1>:UD INTRA_PREDICTORE_MODE {align1}; + +/* the penalty for Intra mode */ +mov (1) vme_msg_5.28<1>:UD 0x010101:UD {align1}; +mov (1) vme_msg_5.20<1>:UW CHROMA_ROW.6<0,1,0>:UW {align1}; + + +/* m6 */ + +mov (4) vme_msg_6.16<1>:UD CHROMA_ROW.8<4,4,1>:UD {align1}; +mov (8) vme_msg_6.0<1>:UW CHROMA_COL.2<16,8,2>:UW {align1}; + +/* + * SIC VME message + */ +/* m0 */ +mov (8) vme_msg_0.0<1>:UD vme_m0.0<8,8,1>:UD {align1}; +mov (1) tmp_reg0.0<1>:UW LUMA_INTRA_MODE:UW {align1}; +/* Use the Luma mode */ +mov (1) vme_msg_4.5<1>:UB tmp_reg0.0<0,1,0>:UB {align1}; + +/* m1 */ +mov (1) intra_flag<1>:UW 0x0:UW {align1} ; +and.z.f0.0 (1) null<1>:UW transform_8x8_ub<0,1,0>:UB 1:UW {align1}; +(f0.0) mov (1) intra_part_mask_ub<1>:UB LUMA_INTRA_8x8_DISABLE {align1}; + +/* assign MB intra struct from the thread payload*/ +mov (1) mb_intra_struct_ub<1>:UB input_mb_intra_ub<0,1,0>:UB {align1}; + +/* Disable DC HAAR component when calculating HARR SATD block */ +mov (1) tmp_reg0.0<1>:UW DC_HARR_DISABLE:UW {align1}; +mov (1) vme_m1.30<1>:UB tmp_reg0.0<0,1,0>:UB {align1}; + +mov (1) vme_m0.12<1>:UD INTRA_SAD_HAAR:UD {align1}; /* 16x16 Source, Intra_harr */ +/* m0 */ +mov (8) vme_msg_0.0<1>:UD vme_m0.0<8,8,1>:UD {align1}; +mov (8) vme_msg_1<1>:UD vme_m1.0<8,8,1>:UD {align1}; + +/* after verification it will be passed by using payload */ +send (8) + vme_msg_ind + vme_wb<1>:UD + null + cre( + BIND_IDX_VME, + VME_SIC_MESSAGE_TYPE + ) + mlen sic_vme_msg_length + rlen vme_wb_length + {align1}; +/* + * Oword Block Write message + */ +mov (8) msg_reg0.0<1>:UD obw_m0<8,8,1>:UD {align1}; + +mov (1) msg_reg1.0<1>:UD vme_wb.0<0,1,0>:UD {align1}; +mov (1) msg_reg1.4<1>:UD vme_wb.16<0,1,0>:UD {align1}; +mov (1) msg_reg1.8<1>:UD vme_wb.20<0,1,0>:UD {align1}; +mov (1) msg_reg1.12<1>:UD vme_wb.24<0,1,0>:UD {align1}; + +/* Distortion, Intra (17-16), */ +mov (1) msg_reg1.16<1>:UW vme_wb.12<0,1,0>:UW {align1}; + +mov (1) msg_reg1.20<1>:UD vme_wb.8<0,1,0>:UD {align1}; +/* VME clock counts */ +mov (1) msg_reg1.24<1>:UD vme_wb.28<0,1,0>:UD {align1}; + +mov (1) msg_reg1.28<1>:UD obw_m0.8<0,1,0>:UD {align1}; + +/* bind index 3, write 2 oword (32bytes), msg type: 8(OWord Block Write) */ +send (16) + msg_ind + obw_wb + null + data_port( + OBW_CACHE_TYPE, + OBW_MESSAGE_TYPE, + OBW_CONTROL_2, + OBW_BIND_IDX, + OBW_WRITE_COMMIT_CATEGORY, + OBW_HEADER_PRESENT + ) + mlen 2 + rlen obw_wb_length + {align1}; + +/* IME search */ +mov (1) vme_m0.12<1>:UD SEARCH_CTRL_DUAL_REFERENCE + INTER_PART_MASK + INTER_SAD_HAAR:UD {align1}; /* 16x16 Source, harr */ +mov (1) vme_m0.22<1>:UW DREF_REGION_SIZE {align1}; +/* Dual Reference Width&Height,32x32 */ + +mov (1) vme_m0.0<1>:UD vme_m0.8<0,1,0>:UD {align1}; + +/* Reference = (x-8,y-8)-(x+8,y+8) */ +add (1) vme_m0.0<1>:W vme_m0.0<0,1,0>:W -8:W {align1}; +add (1) vme_m0.2<1>:W vme_m0.2<0,1,0>:W -8:W {align1}; + +mov (1) vme_m0.0<1>:W -8:W {align1}; +mov (1) vme_m0.2<1>:W -8:W {align1}; + +mov (1) vme_m0.4<1>:UD vme_m0.0<0,1,0>:UD {align1}; + +mov (8) vme_msg_0.0<1>:UD vme_m0.0<8,8,1>:UD {align1}; + +mov (1) vme_m1.0<1>:UD ADAPTIVE_SEARCH_ENABLE:ud {align1} ; +/* the Max MV number is passed by constant buffer */ +mov (1) vme_m1.4<1>:UB r4.28<0,1,0>:UB {align1}; +mov (1) vme_m1.8<1>:UD DSTART_CENTER + DSEARCH_PATH_LEN:UD {align1}; +/* Set the MV cost center */ +mov (1) vme_m1.16<1>:ud mb_mvp_ref.0<0,1,0>:ud {align1}; +mov (1) vme_m1.20<1>:ud mb_mvp_ref.4<0,1,0>:ud {align1}; +mov (8) vme_msg_1.0<1>:UD vme_m1.0<8,8,1>:UD {align1}; + +mov (8) vme_msg_2<1>:UD vme_m2.0<8,8,1>:UD {align1}; +/* M3/M4 search path */ + +mov (1) vme_msg_3.0<1>:UD 0x10010101:UD {align1}; +mov (1) vme_msg_3.4<1>:UD 0x100F0F0F:UD {align1}; +mov (1) vme_msg_3.8<1>:UD 0x10010101:UD {align1}; +mov (1) vme_msg_3.12<1>:UD 0x000F0F0F:UD {align1}; + +mov (4) vme_msg_3.16<1>:UD 0x0:UD {align1}; +mov (8) vme_msg_4.16<1>:UD 0x0:UD {align1}; + +send (8) + vme_msg_ind + vme_wb<1>:UD + null + vme( + BIND_IDX_VME, + 0, + 0, + VME_IME_MESSAGE_TYPE + ) + mlen ime_vme_msg_length + rlen vme_wb_length {align1}; + +/* Set Macroblock-shape/mode for FBR */ + +mov (1) vme_m2.20<1>:UD 0x0:UD {align1}; +mov (1) vme_m2.21<1>:UB vme_wb.25<0,1,0>:UB {align1}; +mov (1) vme_m2.22<1>:UB vme_wb.26<0,1,0>:UB {align1}; + +and (1) tmp_reg0.0<1>:UW vme_wb.0<0,1,0>:UW 0x03:UW {align1}; +mov (1) vme_m2.20<1>:UB tmp_reg0.0<0,1,0>:UB {align1}; + +/* Send FBR message into CRE */ + +mov (8) vme_msg_3.0<1>:UD vme_wb1.0<8,8,1>:UD {align1}; +mov (8) vme_msg_4.0<1>:ud vme_wb2.0<8,8,1>:ud {align1}; +mov (8) vme_msg_5.0<1>:ud vme_wb3.0<8,8,1>:ud {align1}; +mov (8) vme_msg_6.0<1>:ud vme_wb4.0<8,8,1>:ud {align1}; + + /* 16x16 Source, 1/4 pixel, harr, BME ENABLE */ +mov (1) vme_m0.12<1>:UD INTER_SAD_HAAR + SUB_PEL_MODE_QUARTER + FBR_BME_ENABLE:UD {align1}; + +mov (8) vme_msg_0.0<1>:UD vme_m0.0<8,8,1>:UD {align1}; + +mov (1) tmp_reg0.0<1>:uw BI_WEIGHT {align1}; +mov (1) vme_m1.6<1>:UB tmp_reg0.0<0,1,0>:ub {align1}; +mov (8) vme_msg_1.0<1>:UD vme_m1.0<8,8,1>:UD {align1}; + +mov (8) vme_msg_2.0<1>:UD vme_m2.0<8,8,1>:UD {align1}; + +/* after verification it will be passed by using payload */ +send (8) + vme_msg_ind + vme_wb<1>:UD + null + cre( + BIND_IDX_VME, + VME_FBR_MESSAGE_TYPE + ) + mlen fbr_vme_msg_length + rlen vme_wb_length + {align1}; + +add (1) obw_m0.8<1>:UD obw_m0.8<0,1,0>:UD 0x02:UD {align1}; +mov (8) msg_reg0.0<1>:UD obw_m0<8,8,1>:UD {align1}; +/* write FME info */ +mov (1) msg_reg1.0<1>:UD vme_wb.0<0,1,0>:UD {align1}; + +mov (1) msg_reg1.4<1>:UD vme_wb.24<0,1,0>:UD {align1}; +/* Inter distortion of FME */ +mov (1) msg_reg1.8<1>:UD vme_wb.8<0,1,0>:UD {align1}; + +mov (1) msg_reg1.12<1>:UD vme_m2.20<0,1,0>:UD {align1}; + +/* bind index 3, write oword (16bytes), msg type: 8(OWord Block Write) */ +send (16) + msg_ind + obw_wb + null + data_port( + OBW_CACHE_TYPE, + OBW_MESSAGE_TYPE, + OBW_CONTROL_0, + OBW_BIND_IDX, + OBW_WRITE_COMMIT_CATEGORY, + OBW_HEADER_PRESENT + ) + mlen 2 + rlen obw_wb_length + {align1}; + +/* Write FME/BME MV */ +add (1) obw_m0.8<1>:UD obw_m0.8<0,1,0>:UD 0x01:UD {align1}; +mov (8) msg_reg0.0<1>:UD obw_m0.0<8,8,1>:UD {align1}; + + +mov (8) msg_reg1.0<1>:UD vme_wb1.0<8,8,1>:UD {align1}; +mov (8) msg_reg2.0<1>:ud vme_wb2.0<8,8,1>:ud {align1}; +mov (8) msg_reg3.0<1>:ud vme_wb3.0<8,8,1>:ud {align1}; +mov (8) msg_reg4.0<1>:ud vme_wb4.0<8,8,1>:ud {align1}; +/* bind index 3, write 8 oword (128 bytes), msg type: 8(OWord Block Write) */ +send (16) + msg_ind + obw_wb + null + data_port( + OBW_CACHE_TYPE, + OBW_MESSAGE_TYPE, + OBW_CONTROL_8, + OBW_BIND_IDX, + OBW_WRITE_COMMIT_CATEGORY, + OBW_HEADER_PRESENT + ) + mlen 5 + rlen obw_wb_length + {align1}; + +/* Write FME/BME RefID */ +add (1) obw_m0.8<1>:UD obw_m0.8<0,1,0>:UD 0x08:UD {align1}; +mov (8) msg_reg0.0<1>:UD obw_m0<8,8,1>:UD {align1}; + +mov (8) msg_reg1.0<1>:UD vme_wb6.0<8,8,1>:UD {align1}; + +/* bind index 3, write 2 oword (32bytes), msg type: 8(OWord Block Write) */ +send (16) + msg_ind + obw_wb + null + data_port( + OBW_CACHE_TYPE, + OBW_MESSAGE_TYPE, + OBW_CONTROL_2, + OBW_BIND_IDX, + OBW_WRITE_COMMIT_CATEGORY, + OBW_HEADER_PRESENT + ) + mlen 2 + rlen obw_wb_length + {align1}; + +__EXIT: +/* + * kill thread + */ +mov (8) ts_msg_reg0<1>:UD r0<8,8,1>:UD {align1}; +send (16) ts_msg_ind acc0<1>UW null thread_spawner(0, 0, 1) mlen 1 rlen 0 {align1 EOT}; + + + nop ; + nop ; +/* Compare three word data to get the min value */ +word_imin: + cmp.le.f0.0 (1) null:w INPUT_ARG0.0<0,1,0>:w INPUT_ARG0.4<0,1,0>:w {align1}; + (f0.0) mov (1) TEMP_VAR0.0<1>:w INPUT_ARG0.0<0,1,0>:w {align1}; + (-f0.0) mov (1) TEMP_VAR0.0<1>:w INPUT_ARG0.4<0,1,0>:w {align1}; + cmp.le.f0.0 (1) null:w TEMP_VAR0.0<0,1,0>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (f0.0) mov (1) RET_ARG<1>:w TEMP_VAR0.0<0,1,0>:w {align1}; + (-f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.8<0,1,0>:w {align1}; + RETURN {align1}; + +/* Compare three word data to get the max value */ +word_imax: + cmp.ge.f0.0 (1) null:w INPUT_ARG0.0<0,1,0>:w INPUT_ARG0.4<0,1,0>:w {align1}; + (f0.0) mov (1) TEMP_VAR0.0<1>:w INPUT_ARG0.0<0,1,0>:w {align1}; + (-f0.0) mov (1) TEMP_VAR0.0<1>:w INPUT_ARG0.4<0,1,0>:w {align1}; + cmp.ge.f0.0 (1) null:w TEMP_VAR0.0<0,1,0>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (f0.0) mov (1) RET_ARG<1>:w TEMP_VAR0.0<0,1,0>:w {align1}; + (-f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.8<0,1,0>:w {align1}; + RETURN {align1}; + +word_imedian: + cmp.ge.f0.0 (1) null:w INPUT_ARG0.0<0,1,0>:w INPUT_ARG0.4<0,1,0>:w {align1}; + (f0.0) jmpi (1) cmp_a_ge_b; + cmp.ge.f0.0 (1) null:w INPUT_ARG0.0<0,1,0>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.0<0,1,0>:w {align1}; + (f0.0) jmpi (1) cmp_end; + cmp.ge.f0.0 (1) null:w INPUT_ARG0.4<0,1,0>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (-f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.4<0,1,0>:w {align1}; + jmpi (1) cmp_end; +cmp_a_ge_b: + cmp.ge.f0.0 (1) null:w INPUT_ARG0.4<0,1,0>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.4<0,1,0>:w {align1}; + (f0.0) jmpi (1) cmp_end; + cmp.ge.f0.0 (1) null:w INPUT_ARG0.0<0,1,0>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.8<0,1,0>:w {align1}; + (-f0.0) mov (1) RET_ARG<1>:w INPUT_ARG0.0<0,1,0>:w {align1}; +cmp_end: + RETURN {align1}; + +mb_pred_func: + mov (8) TEMP_VAR0.0<1>:ud 0:ud {align1}; + mov (1) TEMP_VAR0.0<1>:ub INPUT_ARG0.2<0,1,0>:ub {align1}; + and (1) TEMP_VAR0.4<1>:uw INPUT_ARG0.4<0,1,0>:uw INTER_MASK:uw {align1}; + /* INTER16x16 mode. The bit1-0 is the prediction mode */ + cmp.e.f0.0 (1) null:uw TEMP_VAR0.4<1>:uw INTER_16X16MODE:uw {align1}; + (f0.0) and (1) RET_ARG<1>:uw TEMP_VAR0.0<0,1,0>:uw PRED_MASK {align1}; + (f0.0) jmpi (1) end_mb_pred; + /* Check whether it is INTER8x8 mode. */ + cmp.e.f0.0 (1) null:uw TEMP_VAR0.4<1>:uw INTER_8X8MODE:uw {align1}; + (f0.0) jmpi (1) mb_pred_func_8; + + /* Check whether it is INTER16x8 mode. */ + cmp.e.f0.0 (1) null:uw TEMP_VAR0.4<1>:uw INTER_16X8MODE:uw {align1}; + (f0.0) jmpi (1) mb_pred_func_168; +mb_pred_func_816: + /* Block 0/2 uses the bit1-0. Block 1/3 uses the bit3-2 */ + mov (1) TEMP_VAR0.8<1>:uw INPUT_ARG0.8<0,1,0>:uw {align1}; + and.z.f0.0 (1) null:uw TEMP_VAR0.8<1>:uw INTER_BLOCK1:uw {align1}; + (f0.0) and (1) RET_ARG<1>:uw TEMP_VAR0.0<0,1,0>:uw PRED_MASK {align1}; + (f0.0) jmpi (1) end_mb_pred; + shr (1) TEMP_VAR0.16<1>:uw TEMP_VAR0.0<0,1,0>:uw 2:uw {align1}; + and (1) RET_ARG<1>:uw TEMP_VAR0.16<1>:uw PRED_MASK {align1}; + jmpi (1) end_mb_pred; + +mb_pred_func_168: + /* Block 0/1 uses the bit1-0. Block 2/3 uses the bit3-2 */ + mov (1) TEMP_VAR0.8<1>:uw INPUT_ARG0.8<0,1,0>:uw {align1}; + cmp.l.f0.0 (1) null:uw TEMP_VAR0.8<1>:uw INTER_BLOCK2:uw {align1}; + (f0.0) and (1) RET_ARG<1>:uw TEMP_VAR0.0<0,1,0>:uw PRED_MASK {align1}; + (f0.0) jmpi (1) end_mb_pred; + shr (1) TEMP_VAR0.16<1>:uw TEMP_VAR0.0<0,1,0>:uw 2:uw {align1}; + and (1) RET_ARG<1>:uw TEMP_VAR0.16<1>:uw PRED_MASK {align1}; + jmpi (1) end_mb_pred; + +mb_pred_func_8: + /* 8X8 mode. Every block uses two bits as the prediction mode. */ + mul (1) TEMP_VAR0.8<1>:uw INPUT_ARG0.8<0,1,0>:uw 2:uw {align1}; + shr (1) TEMP_VAR0.16<1>:uw TEMP_VAR0.0<0,1,0>:uw TEMP_VAR0.8<0,1,0>:uw {align1}; + and (1) RET_ARG<1>:uw TEMP_VAR0.16<1>:uw PRED_MASK {align1}; +end_mb_pred: + RETURN {align1}; + diff --git a/src/shaders/vme/inter_bframe_haswell.g75a b/src/shaders/vme/inter_bframe_haswell.g75a new file mode 100644 index 00000000..b5eca7e3 --- /dev/null +++ b/src/shaders/vme/inter_bframe_haswell.g75a @@ -0,0 +1,2 @@ +#include "vme75.inc" +#include "inter_bframe_haswell.asm" diff --git a/src/shaders/vme/inter_bframe_haswell.g75b b/src/shaders/vme/inter_bframe_haswell.g75b new file mode 100644 index 00000000..6327a320 --- /dev/null +++ b/src/shaders/vme/inter_bframe_haswell.g75b @@ -0,0 +1,397 @@ + { 0x00800001, 0x24000061, 0x00000000, 0x00000000 }, + { 0x00800001, 0x24400061, 0x00000000, 0x00000000 }, + { 0x00800001, 0x24800061, 0x00000000, 0x00000000 }, + { 0x00800001, 0x24c00061, 0x00000000, 0x00000000 }, + { 0x00200009, 0x24002e25, 0x004500a0, 0x00040004 }, + { 0x00000040, 0x24003ca5, 0x00000400, 0xfff8fff8 }, + { 0x00000040, 0x24043ca5, 0x00000404, 0xffffffff }, + { 0x00000001, 0x240800e1, 0x00000000, 0x0000001f }, + { 0x00000001, 0x24140231, 0x00000014, 0x00000000 }, + { 0x00200009, 0x24202e25, 0x004500a0, 0x00040004 }, + { 0x00000040, 0x24203ca5, 0x00000420, 0xfffcfffc }, + { 0x00000001, 0x242800e1, 0x00000000, 0x000f0003 }, + { 0x00000001, 0x24340231, 0x00000014, 0x00000000 }, + { 0x00200009, 0x24482e29, 0x004500a0, 0x00040004 }, + { 0x00000001, 0x24540231, 0x00000014, 0x00000000 }, + { 0x00000041, 0x24884521, 0x000000a2, 0x000000a1 }, + { 0x00000040, 0x24884421, 0x00000488, 0x000000a0 }, + { 0x00000041, 0x24880c21, 0x00000488, 0x00000018 }, + { 0x00000001, 0x24940231, 0x00000014, 0x00000000 }, + { 0x00600001, 0x28000021, 0x008d0400, 0x00000000 }, + { 0x04600031, 0x23801cb1, 0x00000800, 0x02190004 }, + { 0x00600001, 0x28000021, 0x008d0420, 0x00000000 }, + { 0x04600031, 0x23a01cb1, 0x00000800, 0x02290004 }, + { 0x00200009, 0x24002e25, 0x004500a0, 0x00030003 }, + { 0x00000041, 0x24003ca5, 0x00000400, 0x00020002 }, + { 0x00000040, 0x24003ca5, 0x00000400, 0xfff8fff8 }, + { 0x00000040, 0x24043ca5, 0x00000404, 0xffffffff }, + { 0x00600001, 0x28000021, 0x008d0400, 0x00000000 }, + { 0x04600031, 0x26001cb1, 0x00000800, 0x02190006 }, + { 0x00200009, 0x24202e25, 0x004500a0, 0x00030003 }, + { 0x00000041, 0x24203ca5, 0x00000420, 0x00020002 }, + { 0x00000040, 0x24203ca5, 0x00000420, 0xfffcfffc }, + { 0x00000001, 0x242800e1, 0x00000000, 0x00070003 }, + { 0x00600001, 0x28000021, 0x008d0420, 0x00000000 }, + { 0x04600031, 0x26201cb1, 0x00000800, 0x02190006 }, + { 0x00600001, 0x24600061, 0x00000000, 0x00000000 }, + { 0x00600001, 0x2ac00061, 0x00000000, 0x00000000 }, + { 0x01000005, 0x20002d28, 0x000000a6, 0x00040004 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000cb0 }, + { 0x00600001, 0x2ae00061, 0x00000000, 0x00000000 }, + { 0x00600001, 0x2b000061, 0x00000000, 0x00000000 }, + { 0x00600001, 0x2b200061, 0x00000000, 0x00000000 }, + { 0x00600001, 0x2b400061, 0x00000000, 0x00000000 }, + { 0x01000005, 0x20002e28, 0x000000a5, 0x00600060 }, + { 0x00210001, 0x2af401ed, 0x00000000, 0xffffffff }, + { 0x00010020, 0x34001c00, 0x00001400, 0x000001f0 }, + { 0x00000001, 0x2ae000e5, 0x00000000, 0x00000001 }, + { 0x00200001, 0x24000229, 0x004500a0, 0x00000000 }, + { 0x00000040, 0x24003dad, 0x00000400, 0xffffffff }, + { 0x00000041, 0x2b482521, 0x000000a2, 0x00000402 }, + { 0x00000040, 0x2b482421, 0x00000b48, 0x00000400 }, + { 0x00000041, 0x2b480c21, 0x00000b48, 0x00000018 }, + { 0x00000001, 0x2b540231, 0x00000014, 0x00000000 }, + { 0x0a800031, 0x2b601ca1, 0x00000b40, 0x02280303 }, + { 0x05000010, 0x2000252c, 0x00000b70, 0x00000b88 }, + { 0x00210001, 0x2af401ed, 0x00000000, 0xffffffff }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000140 }, + { 0x00000040, 0x2b480c21, 0x00000b48, 0x00000003 }, + { 0x0a800031, 0x2ba01ca1, 0x00000b40, 0x02480403 }, + { 0x00200001, 0x2ae40021, 0x00450bc8, 0x00000000 }, + { 0x00200001, 0x2af401ed, 0x00000000, 0xffffffff }, + { 0x00000001, 0x2fa00021, 0x00000b84, 0x00000000 }, + { 0x00000001, 0x2fa40021, 0x00000b80, 0x00000000 }, + { 0x00000001, 0x2fa80061, 0x00000000, 0x00000001 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x000012f0 }, + { 0x00000001, 0x2aa00129, 0x00000fe4, 0x00000000 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00000000 }, + { 0x00010001, 0x2af001e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2af401ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000060 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00010001 }, + { 0x00010001, 0x2af201e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2af601ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000020 }, + { 0x00200001, 0x2af001e9, 0x00000000, 0x00010001 }, + { 0x00200001, 0x2af401ed, 0x00000000, 0x00000000 }, + { 0x00600001, 0x2b400061, 0x00000000, 0x00000000 }, + { 0x01000005, 0x20002e28, 0x000000a5, 0x00100010 }, + { 0x00210001, 0x2b1401ed, 0x00000000, 0xffffffff }, + { 0x00210001, 0x2b3401ed, 0x00000000, 0xffffffff }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000630 }, + { 0x00000001, 0x2b0000e5, 0x00000000, 0x00000001 }, + { 0x00200001, 0x24000229, 0x004500a0, 0x00000000 }, + { 0x00000040, 0x24023dad, 0x00000402, 0xffffffff }, + { 0x00000041, 0x2b482521, 0x000000a2, 0x00000402 }, + { 0x00000040, 0x2b482421, 0x00000b48, 0x00000400 }, + { 0x00000041, 0x2b480c21, 0x00000b48, 0x00000018 }, + { 0x00000001, 0x2b540231, 0x00000014, 0x00000000 }, + { 0x0a800031, 0x2b601ca1, 0x00000b40, 0x02280303 }, + { 0x05000010, 0x2000252c, 0x00000b70, 0x00000b88 }, + { 0x00210001, 0x2b1401ed, 0x00000000, 0xffffffff }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000140 }, + { 0x00000040, 0x2b480c21, 0x00000b48, 0x00000003 }, + { 0x0a800031, 0x2ba01ca1, 0x00000b40, 0x02480403 }, + { 0x00200001, 0x2b040021, 0x00450bf0, 0x00000000 }, + { 0x00200001, 0x2b1401ed, 0x00000000, 0xffffffff }, + { 0x00000001, 0x2fa00021, 0x00000b84, 0x00000000 }, + { 0x00000001, 0x2fa40021, 0x00000b80, 0x00000000 }, + { 0x00000001, 0x2fa80061, 0x00000000, 0x00000002 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x000010b0 }, + { 0x00000001, 0x2aa00129, 0x00000fe4, 0x00000000 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00000000 }, + { 0x00010001, 0x2b1001e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2b1401ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000060 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00010001 }, + { 0x00010001, 0x2b1201e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2b1601ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000020 }, + { 0x00200001, 0x2b1001e9, 0x00000000, 0x00010001 }, + { 0x00200001, 0x2b1401ed, 0x00000000, 0x00000000 }, + { 0x00600001, 0x2b400061, 0x00000000, 0x00000000 }, + { 0x01000005, 0x20002e28, 0x000000a5, 0x00080008 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000210 }, + { 0x00000001, 0x2b2000e5, 0x00000000, 0x00000001 }, + { 0x00200001, 0x24000229, 0x004500a0, 0x00000000 }, + { 0x00000040, 0x24023dad, 0x00000402, 0xffffffff }, + { 0x00000040, 0x24003dad, 0x00000400, 0x00010001 }, + { 0x00000041, 0x2b482521, 0x000000a2, 0x00000402 }, + { 0x00000040, 0x2b482421, 0x00000b48, 0x00000400 }, + { 0x00000041, 0x2b480c21, 0x00000b48, 0x00000018 }, + { 0x00000001, 0x2b540231, 0x00000014, 0x00000000 }, + { 0x0a800031, 0x2b601ca1, 0x00000b40, 0x02280303 }, + { 0x05000010, 0x2000252c, 0x00000b70, 0x00000b88 }, + { 0x00210001, 0x2b3401ed, 0x00000000, 0xffffffff }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000350 }, + { 0x00000040, 0x2b480c21, 0x00000b48, 0x00000003 }, + { 0x0a800031, 0x2ba01ca1, 0x00000b40, 0x02480403 }, + { 0x00200001, 0x2b240021, 0x00450bf0, 0x00000000 }, + { 0x00200001, 0x2b3401ed, 0x00000000, 0xffffffff }, + { 0x00000001, 0x2fa00021, 0x00000b84, 0x00000000 }, + { 0x00000001, 0x2fa40021, 0x00000b80, 0x00000000 }, + { 0x00000001, 0x2fa80061, 0x00000000, 0x00000002 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000e80 }, + { 0x00000001, 0x2aa00129, 0x00000fe4, 0x00000000 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00000000 }, + { 0x00010001, 0x2b3001e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2b3401ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000270 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00010001 }, + { 0x00010001, 0x2b3201e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2b3601ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000230 }, + { 0x00200001, 0x2b3001e9, 0x00000000, 0x00010001 }, + { 0x00200001, 0x2b3401ed, 0x00000000, 0x00000000 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000200 }, + { 0x00000001, 0x2b2000e5, 0x00000000, 0x00000001 }, + { 0x00200001, 0x24000229, 0x004500a0, 0x00000000 }, + { 0x00200040, 0x24003dad, 0x00450400, 0xffffffff }, + { 0x00000041, 0x2b482521, 0x000000a2, 0x00000402 }, + { 0x00000040, 0x2b482421, 0x00000b48, 0x00000400 }, + { 0x00000041, 0x2b480c21, 0x00000b48, 0x00000018 }, + { 0x00000001, 0x2b540231, 0x00000014, 0x00000000 }, + { 0x0a800031, 0x2b601ca1, 0x00000b40, 0x02280303 }, + { 0x05000010, 0x2000252c, 0x00000b70, 0x00000b88 }, + { 0x00210001, 0x2b3401ed, 0x00000000, 0xffffffff }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000150 }, + { 0x00000040, 0x2b480c21, 0x00000b48, 0x00000003 }, + { 0x0a800031, 0x2ba01cb1, 0x00000b40, 0x02480403 }, + { 0x00200001, 0x2b240021, 0x00450c18, 0x00000000 }, + { 0x00200001, 0x2b3401ed, 0x00000000, 0xffffffff }, + { 0x00000001, 0x2fa00021, 0x00000b84, 0x00000000 }, + { 0x00000001, 0x2fa40021, 0x00000b80, 0x00000000 }, + { 0x00000001, 0x2fa80061, 0x00000000, 0x00000003 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000c80 }, + { 0x00000001, 0x2aa00129, 0x00000fe4, 0x00000000 }, + { 0x00000001, 0x2b3201ed, 0x00000000, 0x00010001 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00000000 }, + { 0x00010001, 0x2b3001e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2b3401ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000060 }, + { 0x01000010, 0x20002d28, 0x00000aa0, 0x00010001 }, + { 0x00010001, 0x2b3201e9, 0x00000000, 0x00010001 }, + { 0x00010001, 0x2b3601ed, 0x00000000, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000020 }, + { 0x00200001, 0x2b3001e9, 0x00000000, 0x00010001 }, + { 0x00200001, 0x2b3401ed, 0x00000000, 0x00000000 }, + { 0x00000040, 0x240014a5, 0x00000b00, 0x00000b20 }, + { 0x01000010, 0x20001ca4, 0x00000400, 0x00000000 }, + { 0x00110020, 0x34001c00, 0x00001400, 0x00000080 }, + { 0x02000010, 0x20001ca4, 0x00000ae0, 0x00000001 }, + { 0x00210001, 0x2b040021, 0x00450ae4, 0x00000000 }, + { 0x00210001, 0x2b240021, 0x00450ae4, 0x00000000 }, + { 0x00210001, 0x2b140129, 0x00450af4, 0x00000000 }, + { 0x00210001, 0x2b340129, 0x00450af4, 0x00000000 }, + { 0x00210001, 0x2ac00021, 0x00450ae4, 0x00000000 }, + { 0x00310001, 0x2ac00061, 0x00000000, 0x00000000 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000320 }, + { 0x00600001, 0x24000061, 0x00000000, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200af4, 0x00000000 }, + { 0x00010040, 0x24003dad, 0x00200400, 0x00010001 }, + { 0x00010001, 0x24040021, 0x00000ae4, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200b14, 0x00000000 }, + { 0x00010040, 0x24003dad, 0x00200400, 0x00010001 }, + { 0x00010001, 0x24040021, 0x00000b04, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200b34, 0x00000000 }, + { 0x00010040, 0x24003dad, 0x00200400, 0x00010001 }, + { 0x00010001, 0x24040021, 0x00000b24, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200400, 0x00010001 }, + { 0x00010001, 0x2ac00021, 0x00000404, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x000000c0 }, + { 0x00000001, 0x2fa001ad, 0x00000ae4, 0x00000000 }, + { 0x00000001, 0x2fa401ad, 0x00000b04, 0x00000000 }, + { 0x00000001, 0x2fa801ad, 0x00000b24, 0x00000000 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x000008f0 }, + { 0x00000001, 0x2ac001ad, 0x00000fe4, 0x00000000 }, + { 0x00000001, 0x2fa001ad, 0x00000ae6, 0x00000000 }, + { 0x00000001, 0x2fa401ad, 0x00000b06, 0x00000000 }, + { 0x00000001, 0x2fa801ad, 0x00000b26, 0x00000000 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000890 }, + { 0x00000001, 0x2ac201ad, 0x00000fe4, 0x00000000 }, + { 0x00600001, 0x24000061, 0x00000000, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200af6, 0x00000000 }, + { 0x00010040, 0x24003dad, 0x00200400, 0x00010001 }, + { 0x00010001, 0x24040021, 0x00000ae8, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200b16, 0x00000000 }, + { 0x00010040, 0x24003dad, 0x00200400, 0x00010001 }, + { 0x00010001, 0x24040021, 0x00000b08, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200b34, 0x00000000 }, + { 0x00010040, 0x24003dad, 0x00200400, 0x00010001 }, + { 0x00010001, 0x24040021, 0x00000b28, 0x00000000 }, + { 0x01000010, 0x20003da4, 0x00200400, 0x00010001 }, + { 0x00010001, 0x2ac40021, 0x00000404, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x000000c0 }, + { 0x00000001, 0x2fa001ad, 0x00000ae8, 0x00000000 }, + { 0x00000001, 0x2fa401ad, 0x00000b08, 0x00000000 }, + { 0x00000001, 0x2fa801ad, 0x00000b28, 0x00000000 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000760 }, + { 0x00000001, 0x2ac401ad, 0x00000fe4, 0x00000000 }, + { 0x00000001, 0x2fa001ad, 0x00000aea, 0x00000000 }, + { 0x00000001, 0x2fa401ad, 0x00000b0a, 0x00000000 }, + { 0x00000001, 0x2fa801ad, 0x00000b2a, 0x00000000 }, + { 0x00000040, 0x2fe00c01, 0x00001400, 0x00000020 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000700 }, + { 0x00000001, 0x2ac601ad, 0x00000fe4, 0x00000000 }, + { 0x00600001, 0x25600021, 0x008d0020, 0x00000000 }, + { 0x00600001, 0x28400021, 0x008d0560, 0x00000000 }, + { 0x00600001, 0x28600061, 0x00000000, 0x00000000 }, + { 0x00000001, 0x23800061, 0x00000000, 0x00000000 }, + { 0x00000005, 0x23840c21, 0x00000384, 0xff000000 }, + { 0x00600001, 0x28800021, 0x008d0380, 0x00000000 }, + { 0x00600001, 0x28a00061, 0x00000000, 0x00000000 }, + { 0x00800001, 0x28a00231, 0x00cf03a3, 0x00000000 }, + { 0x00000001, 0x28b00061, 0x00000000, 0x11111111 }, + { 0x00000001, 0x28bc0061, 0x00000000, 0x00010101 }, + { 0x00000001, 0x28b40129, 0x00000606, 0x00000000 }, + { 0x00400001, 0x28d00021, 0x00690608, 0x00000000 }, + { 0x00600001, 0x28c00129, 0x00ae0622, 0x00000000 }, + { 0x00600001, 0x28000021, 0x008d0440, 0x00000000 }, + { 0x00000001, 0x24000169, 0x00000000, 0x00010001 }, + { 0x00000001, 0x28850231, 0x00000400, 0x00000000 }, + { 0x00000001, 0x247c0169, 0x00000000, 0x00000000 }, + { 0x01000005, 0x20002e28, 0x000000a4, 0x00010001 }, + { 0x00010001, 0x247c00f1, 0x00000000, 0x00000002 }, + { 0x00000001, 0x247d0231, 0x000000a5, 0x00000000 }, + { 0x00000001, 0x24000169, 0x00000000, 0x00200020 }, + { 0x00000001, 0x247e0231, 0x00000400, 0x00000000 }, + { 0x00000001, 0x244c0061, 0x00000000, 0x00800000 }, + { 0x00600001, 0x28000021, 0x008d0440, 0x00000000 }, + { 0x00600001, 0x28200021, 0x008d0460, 0x00000000 }, + { 0x0d600031, 0x21801ca1, 0x00000800, 0x0e782000 }, + { 0x00600001, 0x28000021, 0x008d0480, 0x00000000 }, + { 0x00000001, 0x28200021, 0x00000180, 0x00000000 }, + { 0x00000001, 0x28240021, 0x00000190, 0x00000000 }, + { 0x00000001, 0x28280021, 0x00000194, 0x00000000 }, + { 0x00000001, 0x282c0021, 0x00000198, 0x00000000 }, + { 0x00000001, 0x28300129, 0x0000018c, 0x00000000 }, + { 0x00000001, 0x28340021, 0x00000188, 0x00000000 }, + { 0x00000001, 0x28380021, 0x0000019c, 0x00000000 }, + { 0x00000001, 0x283c0021, 0x00000488, 0x00000000 }, + { 0x0a800031, 0x20001cac, 0x00000800, 0x040a0203 }, + { 0x00000001, 0x244c0061, 0x00000000, 0x00200700 }, + { 0x00000001, 0x24560169, 0x00000000, 0x20202020 }, + { 0x00000001, 0x24400021, 0x00000448, 0x00000000 }, + { 0x00000040, 0x24403dad, 0x00000440, 0xfff8fff8 }, + { 0x00000040, 0x24423dad, 0x00000442, 0xfff8fff8 }, + { 0x00000001, 0x244001ed, 0x00000000, 0xfff8fff8 }, + { 0x00000001, 0x244201ed, 0x00000000, 0xfff8fff8 }, + { 0x00000001, 0x24440021, 0x00000440, 0x00000000 }, + { 0x00600001, 0x28000021, 0x008d0440, 0x00000000 }, + { 0x00000001, 0x24600061, 0x00000000, 0x00000002 }, + { 0x00000001, 0x24640231, 0x0000009c, 0x00000000 }, + { 0x00000001, 0x24680061, 0x00000000, 0x00001212 }, + { 0x00000001, 0x24700021, 0x00000ac0, 0x00000000 }, + { 0x00000001, 0x24740021, 0x00000ac4, 0x00000000 }, + { 0x00600001, 0x28200021, 0x008d0460, 0x00000000 }, + { 0x00600001, 0x28400021, 0x008d0560, 0x00000000 }, + { 0x00000001, 0x28600061, 0x00000000, 0x10010101 }, + { 0x00000001, 0x28640061, 0x00000000, 0x100f0f0f }, + { 0x00000001, 0x28680061, 0x00000000, 0x10010101 }, + { 0x00000001, 0x286c0061, 0x00000000, 0x000f0f0f }, + { 0x00400001, 0x28700061, 0x00000000, 0x00000000 }, + { 0x00600001, 0x28900061, 0x00000000, 0x00000000 }, + { 0x08600031, 0x21801ca1, 0x00000800, 0x0a784000 }, + { 0x00000001, 0x25740061, 0x00000000, 0x00000000 }, + { 0x00000001, 0x25750231, 0x00000199, 0x00000000 }, + { 0x00000001, 0x25760231, 0x0000019a, 0x00000000 }, + { 0x00000005, 0x24002d29, 0x00000180, 0x00030003 }, + { 0x00000001, 0x25740231, 0x00000400, 0x00000000 }, + { 0x00600001, 0x28600021, 0x008d01a0, 0x00000000 }, + { 0x00600001, 0x28800021, 0x008d01c0, 0x00000000 }, + { 0x00600001, 0x28a00021, 0x008d01e0, 0x00000000 }, + { 0x00600001, 0x28c00021, 0x008d0200, 0x00000000 }, + { 0x00000001, 0x244c0061, 0x00000000, 0x00203000 }, + { 0x00600001, 0x28000021, 0x008d0440, 0x00000000 }, + { 0x00000001, 0x24000169, 0x00000000, 0x00200020 }, + { 0x00000001, 0x24660231, 0x00000400, 0x00000000 }, + { 0x00600001, 0x28200021, 0x008d0460, 0x00000000 }, + { 0x00600001, 0x28400021, 0x008d0560, 0x00000000 }, + { 0x0d600031, 0x21801ca1, 0x00000800, 0x0e786000 }, + { 0x00000040, 0x24880c21, 0x00000488, 0x00000002 }, + { 0x00600001, 0x28000021, 0x008d0480, 0x00000000 }, + { 0x00000001, 0x28200021, 0x00000180, 0x00000000 }, + { 0x00000001, 0x28240021, 0x00000198, 0x00000000 }, + { 0x00000001, 0x28280021, 0x00000188, 0x00000000 }, + { 0x00000001, 0x282c0021, 0x00000574, 0x00000000 }, + { 0x0a800031, 0x20001cac, 0x00000800, 0x040a0003 }, + { 0x00000040, 0x24880c21, 0x00000488, 0x00000001 }, + { 0x00600001, 0x28000021, 0x008d0480, 0x00000000 }, + { 0x00600001, 0x28200021, 0x008d01a0, 0x00000000 }, + { 0x00600001, 0x28400021, 0x008d01c0, 0x00000000 }, + { 0x00600001, 0x28600021, 0x008d01e0, 0x00000000 }, + { 0x00600001, 0x28800021, 0x008d0200, 0x00000000 }, + { 0x0a800031, 0x20001cac, 0x00000800, 0x0a0a0403 }, + { 0x00000040, 0x24880c21, 0x00000488, 0x00000008 }, + { 0x00600001, 0x28000021, 0x008d0480, 0x00000000 }, + { 0x00600001, 0x28200021, 0x008d0240, 0x00000000 }, + { 0x0a800031, 0x20001cac, 0x00000800, 0x040a0203 }, + { 0x00600001, 0x2e000021, 0x008d0000, 0x00000000 }, + { 0x07800031, 0x24001ca8, 0x00000e00, 0x82000010 }, + { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000007e, 0x00000000, 0x00000000, 0x00000000 }, + { 0x06000010, 0x200035ac, 0x00000fa0, 0x00000fa4 }, + { 0x00010001, 0x2f6001ad, 0x00000fa0, 0x00000000 }, + { 0x00110001, 0x2f6001ad, 0x00000fa4, 0x00000000 }, + { 0x06000010, 0x200035ac, 0x00000f60, 0x00000fa8 }, + { 0x00010001, 0x2fe401ad, 0x00000f60, 0x00000000 }, + { 0x00110001, 0x2fe401ad, 0x00000fa8, 0x00000000 }, + { 0x00000001, 0x34000020, 0x00000fe0, 0x00000000 }, + { 0x04000010, 0x200035ac, 0x00000fa0, 0x00000fa4 }, + { 0x00010001, 0x2f6001ad, 0x00000fa0, 0x00000000 }, + { 0x00110001, 0x2f6001ad, 0x00000fa4, 0x00000000 }, + { 0x04000010, 0x200035ac, 0x00000f60, 0x00000fa8 }, + { 0x00010001, 0x2fe401ad, 0x00000f60, 0x00000000 }, + { 0x00110001, 0x2fe401ad, 0x00000fa8, 0x00000000 }, + { 0x00000001, 0x34000020, 0x00000fe0, 0x00000000 }, + { 0x04000010, 0x200035ac, 0x00000fa0, 0x00000fa4 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000070 }, + { 0x04000010, 0x200035ac, 0x00000fa0, 0x00000fa8 }, + { 0x00010001, 0x2fe401ad, 0x00000fa0, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x000000a0 }, + { 0x04000010, 0x200035ac, 0x00000fa4, 0x00000fa8 }, + { 0x00010001, 0x2fe401ad, 0x00000fa8, 0x00000000 }, + { 0x00110001, 0x2fe401ad, 0x00000fa4, 0x00000000 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000060 }, + { 0x04000010, 0x200035ac, 0x00000fa4, 0x00000fa8 }, + { 0x00010001, 0x2fe401ad, 0x00000fa4, 0x00000000 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000030 }, + { 0x04000010, 0x200035ac, 0x00000fa0, 0x00000fa8 }, + { 0x00010001, 0x2fe401ad, 0x00000fa8, 0x00000000 }, + { 0x00110001, 0x2fe401ad, 0x00000fa0, 0x00000000 }, + { 0x00000001, 0x34000020, 0x00000fe0, 0x00000000 }, + { 0x00600001, 0x2f600061, 0x00000000, 0x00000000 }, + { 0x00000001, 0x2f600231, 0x00000fa2, 0x00000000 }, + { 0x00000005, 0x2f642d29, 0x00000fa4, 0x00030003 }, + { 0x01000010, 0x20002d28, 0x00200f64, 0x00000000 }, + { 0x00010005, 0x2fe42d29, 0x00000f60, 0x00030003 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000150 }, + { 0x01000010, 0x20002d28, 0x00200f64, 0x00030003 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000100 }, + { 0x01000010, 0x20002d28, 0x00200f64, 0x00010001 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000070 }, + { 0x00000001, 0x2f680129, 0x00000fa8, 0x00000000 }, + { 0x01000005, 0x20002d28, 0x00200f68, 0x00010001 }, + { 0x00010005, 0x2fe42d29, 0x00000f60, 0x00030003 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x000000d0 }, + { 0x00000008, 0x2f702d29, 0x00000f60, 0x00020002 }, + { 0x00000005, 0x2fe42d29, 0x00200f70, 0x00030003 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x000000a0 }, + { 0x00000001, 0x2f680129, 0x00000fa8, 0x00000000 }, + { 0x05000010, 0x20002d28, 0x00200f68, 0x00020002 }, + { 0x00010005, 0x2fe42d29, 0x00000f60, 0x00030003 }, + { 0x00010020, 0x34001c00, 0x00001400, 0x00000060 }, + { 0x00000008, 0x2f702d29, 0x00000f60, 0x00020002 }, + { 0x00000005, 0x2fe42d29, 0x00200f70, 0x00030003 }, + { 0x00000020, 0x34001c00, 0x00001400, 0x00000030 }, + { 0x00000041, 0x2f682d29, 0x00000fa8, 0x00020002 }, + { 0x00000008, 0x2f702529, 0x00000f60, 0x00000f68 }, + { 0x00000005, 0x2fe42d29, 0x00200f70, 0x00030003 }, + { 0x00000001, 0x34000020, 0x00000fe0, 0x00000000 }, diff --git a/src/shaders/vme/vme75.inc b/src/shaders/vme/vme75.inc index a65a4eed..5a121b94 100644 --- a/src/shaders/vme/vme75.inc +++ b/src/shaders/vme/vme75.inc @@ -294,6 +294,7 @@ define(`mb_hwdep', `r5.6') define(`MB_AVAIL', `1:d') define(`MB_PRED_FLAG', `1:w') +define(`mb_pred_mode', `r85') define(`mb_mvp_ref', `r86') define(`mba_result', `r87') define(`mbb_result', `r88') @@ -309,3 +310,25 @@ define(`mb_mv2', `r95') define(`mb_mv3', `r96') define(`mb_ref', `r97') +define(`DREF_REGION_SIZE', `0x2020:UW') +define(`PRED_L0', `0x0':uw) +define(`PRED_L1', `0x1':uw) +define(`PRED_BI', `0x2':uw) +define(`PRED_DIRECT', `0x3':uw) +define(`PRED_MASK', `0x3':uw) + +/* The MAX search len per reference is 16 */ +define(`DSEARCH_PATH_LEN', `0x00001212') +define(`BI_WEIGHT', `0x20':uw) +define(`DSTART_CENTER', `0x00000000') +define(`INTER_MASK', `0x03') +define(`INTER_16X16MODE', `0x0') +define(`INTER_16X8MODE', `0x01') +define(`INTER_8X16MODE', `0x02') +define(`INTER_8X8MODE', `0x03') +define(`INTER_BLOCK0', `0x0') +define(`INTER_BLOCK1', `0x1') +define(`INTER_BLOCK2', `0x2') +define(`INTER_BLOCK3', `0x3') +define(`INTER_16X8MODE', `0x01') +define(`INTER_8X16MODE', `0x02') |