2 * Initialize parameters
\r
3 * Copyright © <2010>, Intel Corporation.
\r
5 * This program is licensed under the terms and conditions of the
\r
6 * Eclipse Public License (EPL), version 1.0. The full text of the EPL is at
\r
7 * http://www.opensource.org/licenses/eclipse-1.0.php.
\r
10 // Kernel name: Initialize_MBPara.asm
\r
14 //#if !defined(__INITIALIZE_MBPARA__) // Make sure this is only included once
\r
15 //#define __INITIALIZE_MBPARA__
\r
18 // WA for weighted prediction - 2007/09/06 // shlee
\r
19 // mov (1) guwW128(0)<1> guwR1(0)<0;1,0> // Copy the unique number indicating weight/offset=(128,0)
\r
48 // Initialize interpolation area to eliminate uninitialized registers making the results of mac instructions XX.
\r
49 // This issue was reported by Sharath on 5/25/2006, and why multiplication by zero still yields XX has not been understood yet.
\r
51 mov (16) gudINTPY0(0)<1> 0:ud {Compr}
\r
52 mov (16) gudINTPY0(2)<1> 0:ud {Compr}
\r
53 mov (16) gudINTPY1(0)<1> 0:ud {Compr}
\r
54 mov (16) gudINTPY1(2)<1> 0:ud {Compr}
\r
55 mov (16) gudINTPC0(0)<1> 0:ud {Compr}
\r
56 mov (16) gudINTPC1(0)<1> 0:ud {Compr}
\r
59 mov (1) gMVSTEP:w 0:w // Address increament for MV read
\r
61 cmp.e.f0.0 (1) null:w gwMBTYPE<0;1,0> 22:w
\r
62 (-f0.0) jmpi INTERLABEL(NOT_8x8_MODE)
\r
66 // Starting address of error data blocks
\r
67 cmp.e.f0.1 (2) null<1>:w gSUBMB_SHAPE<0;1,0>:ub 0:w
\r
68 (f0.1) jmpi INTERLABEL(CONVERT_MVS)
\r
70 // Note: MVs and Weights/Offsets are already expanded by HW or driver
\r
72 // MV conversion - Convert each MV to absolute coord. (= MV + MB org. + block offset)
\r
73 shl (16) gwTEMP(0)<1> gX<0;2,1>:w 2:w // Convert MB origin to 1/4-pel unit
\r
74 mov (1) gMVSTEP:w 24:w // Address increament for MV read
\r
75 add (2) gwTEMP(0,4)<2> gwTEMP(0,4)<4;2,2> 16:w
\r
76 add (2) gwTEMP(0,9)<2> gwTEMP(0,9)<4;2,2> 16:w
\r
77 add (4) gwTEMP(0,12)<1> gwTEMP(0,12)<4;4,1> 16:w
\r
79 add (16) gMV<1>:w gMV<16;16,1>:w gwTEMP(0)<16;16,1>
\r
80 add (8) gwTEMP(0)<2> gwTEMP(0)<16;8,2> 32:w
\r
81 add (16) gwMV(1,0)<1> gwMV(1,0)<16;16,1> gwTEMP(0)<16;16,1>
\r
82 add (8) gwTEMP(0,1)<2> gwTEMP(0,1)<16;8,2> 32:w
\r
83 add (16) gwMV(3,0)<1> gwMV(3,0)<16;16,1> gwTEMP(0)<16;16,1>
\r
84 add (8) gwTEMP(0)<2> gwTEMP(0)<16;8,2> -32:w
\r
85 add (16) gwMV(2,0)<1> gwMV(2,0)<16;16,1> gwTEMP(0)<16;16,1>
\r
87 jmpi INTERLABEL(INIT_ADDRESS_REGS)
\r
89 INTERLABEL(NOT_8x8_MODE):
\r
91 //--- !8x8 mode (16x16, 16x8, 8x16)
\r
93 // MVs and Weights/Offsets are expanded
\r
94 cmp.le.f0.1 (8) null<1>:w gwMBTYPE<0;1,0> 3:w // Check 16x16
\r
95 mov (1) gSUBMB_SHAPE:ub 0:uw // subMB shape
\r
96 (f0.1) mov (8) gMV<1>:d gMV<0;2,1>:d
\r
97 (f0.1) mov (8) gdWGT(1,0)<1> gWGT<0;4,1>:d
\r
98 (f0.1) mov (4) gdWGT(0,4)<1> gWGT<4;4,1>:d
\r
100 INTERLABEL(CONVERT_MVS):
\r
101 // MV conversion - Convert each MV to absolute coord. (= MV + MB org. + block offset)
\r
102 shl (2) gwTEMP(0)<1> gX<2;2,1>:w 2:w // Convert MB origin to 1/4-pel unit
\r
103 add (16) gMV<1>:w gMV<16;16,1>:w gwTEMP(0)<0;2,1>
\r
104 add (2) gwMV(0,4)<2> gwMV(0,4)<4;2,2> 32:w //{NoDDClr}
\r
105 add (2) gwMV(0,9)<2> gwMV(0,9)<4;2,2> 32:w //{NoDDChk,NoDDClr}
\r
106 add (4) gwMV(0,12)<1> gwMV(0,12)<4;4,1> 32:w //{NoDDChk}
\r
108 INTERLABEL(INIT_ADDRESS_REGS):
\r
109 // Initialize the address registers
\r
110 mov (2) pERRORYC:ud nOFFSET_ERROR:ud {NoDDClr} // Address of Y and C error blocks
\r
111 mov (1) pRECON_MV:ud nOFFSET_RECON_MV:ud {NoDDChk,NoDDClr} // Address of recon area and motion vectors
\r
112 mov (1) pWGT_BIDX:ud nOFFSET_WGT_BIDX:ud {NoDDChk} // Address of weights/offsets and binding tbl idx
\r
114 // Read the parity of the current field (gPARITY - 0:top, 1:bottom, 3:frame)
\r
115 // and set message descriptor for frame/field write
\r
117 and.nz.f0.0 (1) null:uw gFIELDMBFLAG:ub nFIELDMB_MASK:uw
\r
118 (f0.0) and (1) gPARITY:uw gMBPARITY:ub nMBPARITY_MASK:uw
\r
119 (-f0.0) mov (1) gPARITY:uw 3:uw
\r
120 #elif defined(FIELD)
\r
121 and (1) gPARITY:uw gMBPARITY:ub nMBPARITY_MASK:uw
\r
125 //#endif // !defined(__INITIALIZE_MBPARA__)
\r