Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5361 serge 1
/*
2
 * Interpolation kernel for chrominance 4x4 motion compensation
3
 * Copyright © <2010>, Intel Corporation.
4
 *
5
 * This program is licensed under the terms and conditions of the
6
 * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
7
 * http://www.opensource.org/licenses/eclipse-1.0.php.
8
 *
9
 */
10
//	Kernel name: Interpolate_C_4x4_Func.asm
11
//
12
//	Interpolation kernel for chrominance 4x4 motion compensation
13
//
14
//  $Revision: 8 $
15
//  $Date: 10/09/06 4:00p $
16
//
17
 
18
 
19
//#if !defined(__Interpolate_C_4x4_Func__)		// Make sure this is only included once
20
//#define __Interpolate_C_4x4_Func__
21
 
22
 
23
INTERLABEL(Interpolate_C_4x4_Func):
24
 
25
 
26
	// (8-xFrac) and (8-yFrac)
27
    add (2)		gW0<1>:w			gMVX_FRACC<2;2,1>:w				-0x08:w
28
 
29
	// Compute the GRF address of the starting position of the reference area
30
    mov (1)		pREF0:w				nOFFSET_REFC:w		{NoDDClr}
31
	mov (1)		pREF1:uw			nOFFSET_REFC+16:w	{NoDDChk,NoDDClr}
32
	mov (1)		pRESULT:uw			gpINTPC:uw			{NoDDChk}
33
 
34
	// gCOEFA = (8-xFrac)*(8-yFrac)
35
    // gCOEFB = xFrac*(8-yFrac)
36
    // gCOEFC = (8-xFrac)*yFrac
37
    // gCOEFD = xFrac*yFrac
38
    mul (1)		gCOEFD:w	        gMVX_FRACC:w					gMVY_FRACC:w	{NoDDClr}
39
    mul (1)		gCOEFA:w			-gW0:w							-gW1:uw		{NoDDClr,NoDDChk}
40
    mul (1)		gCOEFB:w			gMVX_FRACC:w					-gW1:uw		{NoDDClr,NoDDChk}
41
    mul (1)		gCOEFC:w		    -gW0:w							gMVY_FRACC:w {NoDDChk}
42
 
43
	add (2)		gW0<1>:uw			pREF0<2;2,1>:uw					16:w
44
 
45
    // (8-xFrac)*(8-yFrac)*A
46
    // ---------------------
47
    mul (16)	acc0<1>:uw			r[pREF0,0]<16;8,1>:ub			gCOEFA:uw
48
    mul (16)	acc1<1>:uw			r[pREF0,nGRFWIB]<16;8,1>:ub		gCOEFA:uw
49
 
50
    // xFrac*(8-yFrac)*B
51
    // -------------------
52
    mac (16)	acc0<1>:uw          r[pREF0,2]<16;8,1>:ub			gCOEFB:uw
53
    mac (16)	acc1<1>:uw          r[pREF0,nGRFWIB+2]<16;8,1>:ub	gCOEFB:uw
54
 
55
    // (8-xFrac)*yFrac*C
56
    // -------------------
57
    mov (2)		pREF0<1>:uw			gW0<2;2,1>:uw
58
    mac (16)	acc0<1>:uw          r[pREF0,0]<8,1>:ub				gCOEFC:uw
59
    mac (16)	acc1<1>:uw          r[pREF0,nGRFWIB]<8,1>:ub		gCOEFC:uw
60
 
61
    // xFrac*yFrac*D
62
    // -----------------
63
    mac (16)	r[pRESULT]<1>:uw	r[pREF0,2]<8,1>:ub				gCOEFD:uw
64
    mac (16)	r[pRESULT,GRFWIB]<1>:uw r[pREF0,nGRFWIB+2]<8,1>:ub gCOEFD:uw {SecHalf}
65
 
66
 
67
//#endif	// !defined(__Interpolate_C_4x4_Func__)