OSDN Git Service

i965_drv_video: add support for H264 on Clarkdale/Arrandale
[android-x86/hardware-intel-common-libva.git] / i965_drv_video / shaders / h264 / ildb / save_Top_Y_16x4_Mbaff.asm
1 /*\r
2  * Copyright © <2010>, Intel Corporation.\r
3  *\r
4  * This program is licensed under the terms and conditions of the\r
5  * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at\r
6  * http://www.opensource.org/licenses/eclipse-1.0.php.\r
7  *\r
8  */\r
9 // Module name: save_Top_Y_16x4.asm\r
10 //\r
11 // Save a Y 16x4 block \r
12 //\r
13 //----------------------------------------------------------------\r
14 //  Symbols need to be defined before including this module\r
15 //\r
16 //      Source region in :ud\r
17 //      SRC_YD:                 SRC_YD Base=rxx ElementSize=4 SrcRegion=REGION(8,1) Type=ud                     // 2 GRFs\r
18 //\r
19 //      Binding table index: \r
20 //      BI_DEST_Y:              Binding table index of Y surface\r
21 //\r
22 //----------------------------------------------------------------\r
23 \r
24 #if defined(_DEBUG) \r
25         mov             (1)             EntrySignatureC:w                       0xDDD5:w\r
26 #endif\r
27 \r
28         and.z.f0.1 (16) NULLREGW                DualFieldMode<0;1,0>:w          1:w\r
29 \r
30     // FieldModeCurrentMbFlag determines how to access above MB\r
31         and.z.f0.0 (1)  null:w          r[ECM_AddrReg, BitFlags]:ub             FieldModeCurrentMbFlag:w                \r
32 \r
33     mov (2)     MSGSRC.0<1>:ud  ORIX_TOP<2;2,1>:w               { NoDDClr }                     // Block origin\r
34     mov (1)     MSGSRC.2<1>:ud  0x0003000F:ud                   { NoDDChk }                     // Block width and height (16x4)\r
35 \r
36         // Pack Y\r
37         // Dual field mode\r
38         (f0.1) mov      (16) MSGPAYLOADD(0)<1>          PREV_MB_YD(0)                           // Compressed inst\r
39     (-f0.1)  mov (16) MSGPAYLOADD(0)<1>         PREV_MB_YD(2)                           // for dual field mode, write last 4 rows\r
40     \r
41     // Set message descriptor\r
42 \r
43     and.nz.f0.1 (1) NULLREGW            BitFields:w   BotFieldFlag:w\r
44 \r
45         (f0.0)  if      (1)             ELSE_Y_16x4_SAVE\r
46     \r
47     // Frame picture\r
48     mov (1)     MSGDSC  MSG_LEN(2)+DWBWMSGDSC_WC+BI_DEST_Y:ud                   // Write 2 GRFs to DEST_Y\r
49 \r
50         // Add vertical offset 16 for bot MB in MBAFF mode\r
51         (f0.1) add (1)  MSGSRC.1:d              MSGSRC.1:d              16:w            \r
52 \r
53 ELSE_Y_16x4_SAVE: \r
54         else    (1)             ENDIF_Y_16x4_SAVE\r
55 \r
56         asr (1) MSGSRC.1:d              ORIY_CUR:w              1:w                                     // Reduce y by half in field access mode\r
57 \r
58         // Field picture\r
59     (f0.1) mov (1)      MSGDSC  MSG_LEN(2)+DWBWMSGDSC_WC+ENMSGDSCBF+BI_DEST_Y:ud  // Write 2 GRFs to DEST_Y bottom field\r
60     (-f0.1) mov (1)     MSGDSC  MSG_LEN(2)+DWBWMSGDSC_WC+ENMSGDSCTF+BI_DEST_Y:ud  // Write 2 GRFs to DEST_Y top field\r
61 \r
62         add (1) MSGSRC.1:d              MSGSRC.1:d              -4:w    // for last 4 rows of above MB\r
63 \r
64         endif\r
65 ENDIF_Y_16x4_SAVE:\r
66     \r
67     send (8)    WritebackResponse(0)<1>         MSGHDR          MSGSRC<8;8,1>:ud        DAPWRITE        MSGDSC\r
68 \r
69 // End of save_Top_Y_16x4.asm\r