Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  *  Copyright 2000-2011 Intel Corporation All Rights Reserved
  3.  *
  4.  *  Licensed under the Apache License, Version 2.0 (the "License");
  5.  *  you may not use this file except in compliance with the License.
  6.  *  You may obtain a copy of the License at
  7.  *
  8.  *      http://www.apache.org/licenses/LICENSE-2.0
  9.  *
  10.  *  Unless required by applicable law or agreed to in writing, software
  11.  *  distributed under the License is distributed on an "AS IS" BASIS,
  12.  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.  *  See the License for the specific language governing permissions and
  14.  *  limitations under the License.
  15.  */
  16. //   84    // Total instruction count
  17. //    1    // Total kernel count
  18.  
  19.  
  20.  
  21. // Module name: common.inc
  22. //
  23. // Common header file for all Video-Processing kernels
  24. //
  25.  
  26. .default_execution_size (16)
  27. .default_register_type  :ub
  28.  
  29. .reg_count_total        128
  30. .reg_count_payload      7
  31.  
  32. //========== Common constants ==========
  33.  
  34.  
  35. //========== Macros ==========
  36.  
  37.  
  38. //Fast Jump, For more details see "Set_Layer_N.asm"
  39.  
  40.  
  41. //========== Defines ====================
  42.  
  43. //========== Static Parameters (Common To All) ==========
  44. //r1
  45.  
  46.  
  47. //r2
  48.  
  49.                                     //  e.g.            byte0   byte1  byte2
  50.                                     // YUYV               0       1      3
  51.                                     // YVYU               0       3      1
  52.  
  53. //Color Pipe (IECP) parameters
  54.  
  55.  
  56. //ByteCopy
  57.  
  58.  
  59. //r4
  60.  
  61.                                     //  e.g.              byte0           byte1           byte2
  62.                                     // YUYV                 0               1               3
  63.                                     // YVYU                 0               3               1
  64.  
  65.  
  66. //========== Inline parameters (Common To All) ===========
  67.  
  68.  
  69. //============== Binding Index Table===========
  70. //Common between DNDI and DNUV
  71.  
  72.  
  73. //================= Common Message Descriptor =====
  74. // Message descriptor for thread spawning
  75. // Message Descriptors
  76. //                = 000 0001 (min message len 1 ) 0,0000 (resp len 0   -add later)
  77. //                  0000,0000,0000
  78. //                  0001(Spawn a root thread),0001 (Root thread spawn thread)
  79. //                = 0x02000011
  80. // Thread Spawner Message Descriptor
  81.  
  82.  
  83. // Message descriptor for atomic operation add
  84. // Message Descriptors
  85. //                = 000 0110 (min message len 6 ) 0,0000 (resp len 0   -add later)
  86. //                  1(header present)001,10(typed atomic operation)0(return enabled)0(slot group, low 8 bits),0111 (AOP_Add)
  87. //                  0000,0000 (Binding table index, added later)
  88. //                = 0x02000011
  89.  
  90. // Atomic Operation Add Message Descriptor
  91.  
  92.  
  93. // Message descriptor for dataport media write
  94.         // Message Descriptors
  95.                 //                = 000 0001 (min message len 1 - add later) 00000 (resp len 0)
  96.                 //                  1 (header present 1) 0 1010 (media block write) 000000
  97.                 //                  00000000 (binding table index - set later)
  98.                 //                = 0x020A8000
  99.  
  100.  
  101. // Message Length defines
  102.  
  103.  
  104. // Response Length defines
  105.  
  106.  
  107. // Block Width and Height Size defines
  108.  
  109.  
  110. // Extended Message Descriptors
  111.  
  112.  
  113. // Common message descriptors:
  114.  
  115.  
  116. //===================== Math Function Control ===================================
  117.  
  118.  
  119. //============ Message Registers ===============
  120.                              // buf4 starts from r28
  121.  
  122.  
  123. //#define mMSGHDR_EOT  r43    // Dummy Message Register for EOT
  124.  
  125.  
  126. .declare    mubMSGPAYLOAD  Base=r30 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  127. .declare    muwMSGPAYLOAD  Base=r30 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  128. .declare    mudMSGPAYLOAD  Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  129. .declare    mfMSGPAYLOAD   Base=r30 ElementSize=4 SrcRegion=<8;8,1> Type=f
  130.  
  131. //=================== End of thread instruction ===========================
  132.  
  133.  
  134. //=====================Pointers Used=====================================
  135.  
  136.  
  137. //=======================================================================
  138.  
  139.  
  140. //r9-r17
  141. // Define temp space for any usages
  142.  
  143.  
  144. // Common Buffers
  145.  
  146.  
  147. // temp space for rotation
  148.  
  149. .declare fROBUF           Base=r9.0             ElementSize=4           SrcRegion=<8;8,1>                 DstRegion=<1>         Type=f
  150.  
  151. .declare udROBUF                Base=r9.0               ElementSize=4           SrcRegion=<8;8,1>                 DstRegion=<1>         Type=ud
  152.  
  153. .declare uwROBUF                Base=r9.0               ElementSize=2           SrcRegion=<16;16,1>             DstRegion=<1>           Type=uw
  154.  
  155. .declare ubROBUF                Base=r9.0               ElementSize=1           SrcRegion=<16;16,1>             DstRegion=<1>           Type=ub
  156.  
  157. .declare ub4ROBUF       Base=r9.0               ElementSize=1           SrcRegion=<32;8,4>              DstRegion=<4>           Type=ub
  158.  
  159.  
  160. // End of common.inc
  161.  
  162.  
  163. // Module name: Save_AVS_PL3.asm
  164. //
  165. // Save PL3 420 frame data block of size 16x16
  166. //
  167. // To save 16x16 block (16x16 byte of Y and 8x8 byte of U and V each) we need 3 send instructions with one of size 16x16 and two of size 8x8.
  168. //  -----------------
  169. //  |    16x16 Y    |
  170. //  |               |
  171. //  -----------------
  172. //  | 8x8 U |
  173. //  ---------
  174. //  | 8x8 V |
  175. //  ---------
  176.  
  177. //-----------------------------------------------------------------
  178. //The layout of data is as follows:
  179. //mMSGHDR0                      : Y data header (16x16)
  180. //mubMSGPAYLOAD0        : Y data payload (8 GRFs)
  181. //mMSGHDR1                      : U data header (8x8)
  182. //mubMSGPAYLOAD1        : U data payload (2 GRFs)
  183. //mMSGHDR2                      : V data header (8x8)
  184. //mubMSGPAYLOAD2        : V data payload (2 GRFs)
  185. //------------------------------------------------------------------
  186.  
  187.  
  188.  
  189. // Module name: Save.inc
  190.  
  191.  
  192.  
  193.  
  194. // Description: Includes all definitions explicit to Fast Composite.
  195.  
  196.  
  197.  
  198.  
  199. // End of common.inc
  200.  
  201.  
  202. //========== GRF partition ==========
  203.      // r0 header            :   r0          (1 GRF)
  204.      // Static parameters    :   r1 - r6     (6 GRFS)
  205.      // Inline parameters    :   r7 - r8     (2 GRFs)
  206.      // MSGSRC               :   r27         (1 GRF)
  207. //===================================
  208.  
  209. //Interface:
  210. //========== Static Parameters (Explicit To Fast Composite) ==========
  211. //r1
  212. //CSC Set 0
  213.  
  214.  
  215. .declare udCSC_CURBE    Base=r1.0      ElementSize=4       Type=ud
  216.  
  217. //Constant alpha
  218.  
  219.  
  220. //r2
  221.  
  222.  
  223. // Gen7 AVS WA
  224.  
  225.  
  226. // WiDi Definitions
  227.  
  228.  
  229. //Colorfill
  230.  
  231.  
  232.                                       // 0: 0-degree, 1: 90, 2: 180, 3: 270-degree, clockwise.     
  233.  
  234. .declare ubCOLOR_PIXEL_VAL      Base=r2.20      ElementSize=1       SrcRegion=<0;1,0>       DstRegion=<1>       Type=ub
  235.  
  236. //r3
  237. //Normalised Ratio of Horizontal step size with main video for all layers
  238.  
  239.  
  240.     //Normalised Ratio of Horizontal step size with main video for all layers becomes
  241.     //Normalised Horizontal step size for all layers in VP_Setup.asm
  242.  
  243.  
  244. //r4
  245. //Normalised Vertical step size for all layers
  246.  
  247.  
  248. //r5
  249. //Normalised Vertical Frame Origin for all layers
  250.  
  251.  
  252. //r6
  253. //Normalised Horizontal Frame Origin for all layers
  254.  
  255.  
  256. //========== Inline Parameters (Explicit To Fast Composite) ==========
  257.  
  258.  
  259. //Main video Step X
  260.  
  261.  
  262. //====================== Binding table (Explicit To Fast Composite)=========================================
  263.  
  264.  
  265. //Used by Interlaced Scaling Kernels
  266.  
  267.  
  268. //========== Sampler State Table Index (Explicit To Fast Composite)==========
  269. //Sampler Index for AVS/IEF messages
  270.  
  271.  
  272. //Sampler Index for SIMD16 sampler messages
  273.  
  274.  
  275. //=============================================================================
  276.  
  277. .declare fBUFFER_0      Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  278. .declare fBUFFER_1      Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  279. .declare fBUFFER_2      Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  280. .declare fBUFFER_3      Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  281. .declare fBUFFER_4      Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  282. .declare fBUFFER_5      Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  283.  
  284. .declare udBUFFER_0     Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  285. .declare udBUFFER_1     Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  286. .declare udBUFFER_2     Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  287. .declare udBUFFER_3     Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  288. .declare udBUFFER_4     Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  289. .declare udBUFFER_5     Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  290.  
  291. .declare uwBUFFER_0     Base=r64.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  292. .declare uwBUFFER_1     Base=r80.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  293. .declare uwBUFFER_2     Base=r96.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  294. .declare uwBUFFER_3     Base=r112.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  295. .declare uwBUFFER_4     Base=r28.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  296. .declare uwBUFFER_5     Base=r46.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  297.  
  298. .declare ubBUFFER_0     Base=r64.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  299. .declare ubBUFFER_1     Base=r80.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  300. .declare ubBUFFER_2     Base=r96.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  301. .declare ubBUFFER_3     Base=r112.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  302. .declare ubBUFFER_4     Base=r28.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  303. .declare ubBUFFER_5     Base=r46.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  304.  
  305. .declare ub4BUFFER_0    Base=r64.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  306. .declare ub4BUFFER_1    Base=r80.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  307. .declare ub4BUFFER_2    Base=r96.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  308. .declare ub4BUFFER_3    Base=r112.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  309. .declare ub4BUFFER_4    Base=r28.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  310. .declare ub4BUFFER_5    Base=r46.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  311.  
  312. //Pointer to mask reg
  313.  
  314.  
  315. //r18
  316.  
  317.  
  318. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  319. // NODDCLR, NODDCHK flags. -rT
  320.  
  321.  
  322. .declare udCSC_COEFF_0  Base=r18.0    ElementSize=4 Type=ud       // 1 GRF
  323.  
  324. //r19
  325.  
  326.  
  327. .declare udCSC_COEFF_1  Base=r19.0    ElementSize=4 Type=ud       // 1 GRF
  328.  
  329.  
  330. //r20
  331.  
  332. .declare uwALPHA_MASK_REG_TEMP  Base=r20.0    ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  333.  
  334. //r21
  335.  
  336. .declare uwALPHA_MASK_REG       Base=r21.0         ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  337.  
  338. //r22
  339.  
  340.  
  341. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  342. // NODDCLR, NODDCHK flags. -rT
  343.  
  344.  
  345. //Keep fORIGIN_X_NLAS, fY_OFFSET_2ND_BLOCK, fSTEP_X_NLAS, pMSGDSC_COPY, ubCONST_ALPHA_COPY as
  346. //sub registers of same GRF to enable using NODDCLR NODDCHK. -rT
  347.  
  348. //r23
  349.  
  350.  
  351. //Lumakey
  352.  
  353.  
  354. //r24
  355.  
  356.  
  357. //r25
  358.  
  359.  
  360. //r26
  361.  
  362.  
  363. //defines to generate LABELS during compile time.
  364.  
  365.  
  366. //Msg payload buffers; upto 4 full-size messages can be written
  367.  
  368.  
  369. .declare    mudMSGPAYLOAD0  Base=r29.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  370. .declare    mudMSGPAYLOAD1  Base=r38.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  371. .declare    mudMSGPAYLOAD2  Base=r47.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  372. .declare    mudMSGPAYLOAD3  Base=r56.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  373.  
  374. .declare    muwMSGPAYLOAD0  Base=r29.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  375. .declare    muwMSGPAYLOAD1  Base=r38.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  376. .declare    muwMSGPAYLOAD2  Base=r47.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  377. .declare    muwMSGPAYLOAD3  Base=r56.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  378.  
  379. .declare    mubMSGPAYLOAD0  Base=r29.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  380. .declare    mubMSGPAYLOAD1  Base=r38.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  381. .declare    mubMSGPAYLOAD2  Base=r47.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  382. .declare    mubMSGPAYLOAD3  Base=r56.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  383. .declare    mubMSGPAYLOAD4  Base=r32.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  384. .declare    mubMSGPAYLOAD5  Base=r41.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  385. .declare    mubMSGPAYLOAD6  Base=r50.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  386. .declare    mubMSGPAYLOAD7  Base=r59.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  387.  
  388.  
  389.         // the r17 register (nTEMP0) is originally defined from "Common.inc"
  390.         // instead of re-defining a nTEMP0 here, we use "SAVE_RGB" suffix for its naming
  391.  
  392.         .declare uwTemp0 Base=r17.0 ElementSize=2 Type=uw
  393.  
  394.  
  395. //_SAVE_INC_
  396.  
  397.  
  398.         // At the save module we have all 8 address sub-registers available.
  399.         // So we will use PING-PONG type of scheme to save the data using
  400.         // pointers pBUF_CHNL_TOP_8x4 and pBUF_CHNL_BOT_8x4. This will help
  401.         // reduce dependency. - rT
  402.  
  403.         //wBUFF_CHNL_PTR points to either buffer 0 or buffer 4.
  404.         //Add appropriate offsets to get pointers for all buffers (1,2,3 or 5).
  405.         //Offsets are zero for buffer 0 and buffer 4.
  406.         add   (4) a0.0:uw   r22.0<4;4,1>:w          0:uw
  407.         add   (4) a0.4:uw   r22.0<4;4,1>:w          512:uw
  408.  
  409.         //Set up header for Y,U and V data
  410.         mov  (8) r28<1>:ud      r27<8;8,1>:ud
  411.         mov  (8) r37<1>:ud      r27<8;8,1>:ud
  412.         mov  (8) r46<1>:ud      r27<8;8,1>:ud
  413.  
  414.         mov  (2) r28.0<1>:d     r7.0<2;2,1>:w                                   { NoDDClr }  //ORI Y (LUMA) = ORI
  415.         shr  (2) r37.0<1>:d     r7.0<2;2,1>:w            1:w            { NoDDClr }  //H/V ORI U        = H/V ORI/2
  416.         shr  (2) r46.0<1>:d     r7.0<2;2,1>:w            1:w            { NoDDClr }  //H/V ORI V        = H/V ORI/2
  417.  
  418.         mov  (1) r28.2<1>:ud    0xF000F:ud      { NoDDChk }  // Y Block width and height (16x16)
  419.         mov  (1)r37.2<1>:ud     0x70007:ud      { NoDDChk }  // U Block width and height (8x8)
  420.         mov  (1)r46.2<1>:ud     0x70007:ud      { NoDDChk }  // V Block width and height (8x8)
  421.  
  422. // Unscramble, and pack data directly to MRFs
  423.  
  424. //      Data 16x16 block is divided as -
  425. //              ---------
  426. //              |   0   |
  427. //              ---------
  428. //              |   1   |
  429. //              ---------
  430. //              |   2   |
  431. //              ---------
  432. //              |   3   |
  433. //              ---------
  434. //              All sub-blocks are of size 16x4
  435. //              0: ubBUFFER_0
  436. //              1: ubBUFFER_1, ubBUFFER_0+16
  437. //              2: ubBUFFER_2
  438. //              3: ubBUFFER_3, ubBUFFER_2+16
  439.  
  440.         //Y Rounding, first
  441.         add.sat (16) r[a0.1,0]<1>:uw            r[a0.1,0]<16;16,1>:uw           0x0080:uw              
  442.         add.sat (16) r[a0.1,32]<1>:uw           r[a0.1,32]<16;16,1>:uw  0x0080:uw              
  443.         add.sat (16) r[a0.1,64]<1>:uw           r[a0.1,64]<16;16,1>:uw  0x0080:uw              
  444.         add.sat (16) r[a0.1,96]<1>:uw           r[a0.1,96]<16;16,1>:uw  0x0080:uw              
  445.  
  446.         // U rounding
  447.         add.sat (8) r[a0.2,0]<2>:uw             r[a0.2,0]<16;8,2>:uw            0x0080:uw              
  448.         add.sat (8) r[a0.2,64]<2>:uw            r[a0.2,64]<16;8,2>:uw           0x0080:uw              
  449.  
  450.         // V rounding
  451.         add.sat (8) r[a0.0,0]<2>:uw             r[a0.0,0]<16;8,2>:uw            0x0080:uw              
  452.         add.sat (8) r[a0.0,64]<2>:uw            r[a0.0,64]<16;8,2>:uw           0x0080:uw              
  453.  
  454.         add   (4) a0.0:uw                       r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  455.  
  456.         //Y Rounding, second
  457.         add.sat (16) r[a0.5,0]<1>:uw            r[a0.5,0]<16;16,1>:uw           0x0080:uw              
  458.         add.sat (16) r[a0.5,32]<1>:uw           r[a0.5,32]<16;16,1>:uw  0x0080:uw              
  459.         add.sat (16) r[a0.5,64]<1>:uw           r[a0.5,64]<16;16,1>:uw  0x0080:uw              
  460.         add.sat (16) r[a0.5,96]<1>:uw           r[a0.5,96]<16;16,1>:uw  0x0080:uw              
  461.  
  462.         // U rounding
  463.         add.sat (8) r[a0.6,0]<2>:uw             r[a0.6,0]<16;8,2>:uw            0x0080:uw              
  464.         add.sat (8) r[a0.6,64]<2>:uw            r[a0.6,64]<16;8,2>:uw           0x0080:uw              
  465.  
  466.         // V rounding
  467.         add.sat (8) r[a0.4,0]<2>:uw             r[a0.4,0]<16;8,2>:uw            0x0080:uw              
  468.         add.sat (8) r[a0.4,64]<2>:uw            r[a0.4,64]<16;8,2>:uw           0x0080:uw              
  469.  
  470.         add   (4) a0.4:uw               r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  471.  
  472.         //Y Rounding, third
  473.         add.sat (16) r[a0.1,0]<1>:uw            r[a0.1,0]<16;16,1>:uw           0x0080:uw              
  474.         add.sat (16) r[a0.1,32]<1>:uw           r[a0.1,32]<16;16,1>:uw  0x0080:uw              
  475.         add.sat (16) r[a0.1,64]<1>:uw           r[a0.1,64]<16;16,1>:uw  0x0080:uw              
  476.         add.sat (16) r[a0.1,96]<1>:uw           r[a0.1,96]<16;16,1>:uw  0x0080:uw              
  477.  
  478.         // U rounding
  479.         add.sat (8) r[a0.2,0]<2>:uw             r[a0.2,0]<16;8,2>:uw            0x0080:uw              
  480.         add.sat (8) r[a0.2,64]<2>:uw            r[a0.2,64]<16;8,2>:uw           0x0080:uw              
  481.  
  482.         // V rounding
  483.         add.sat (8) r[a0.0,0]<2>:uw             r[a0.0,0]<16;8,2>:uw            0x0080:uw              
  484.         add.sat (8) r[a0.0,64]<2>:uw            r[a0.0,64]<16;8,2>:uw           0x0080:uw              
  485.  
  486.  
  487.         //Y Rounding, fourth
  488.         add.sat (16) r[a0.5,0]<1>:uw            r[a0.5,0]<16;16,1>:uw           0x0080:uw              
  489.         add.sat (16) r[a0.5,32]<1>:uw           r[a0.5,32]<16;16,1>:uw  0x0080:uw              
  490.         add.sat (16) r[a0.5,64]<1>:uw           r[a0.5,64]<16;16,1>:uw  0x0080:uw              
  491.         add.sat (16) r[a0.5,96]<1>:uw           r[a0.5,96]<16;16,1>:uw  0x0080:uw              
  492.  
  493.         // U rounding
  494.         add.sat (8) r[a0.6,0]<2>:uw             r[a0.6,0]<16;8,2>:uw            0x0080:uw              
  495.         add.sat (8) r[a0.6,64]<2>:uw            r[a0.6,64]<16;8,2>:uw           0x0080:uw              
  496.  
  497.         // V rounding
  498.         add.sat (8) r[a0.4,0]<2>:uw             r[a0.4,0]<16;8,2>:uw            0x0080:uw              
  499.         add.sat (8) r[a0.4,64]<2>:uw            r[a0.4,64]<16;8,2>:uw           0x0080:uw              
  500.  
  501.         // restore the TOP and BOT pointers
  502.         add   (4) a0.0:uw   r22.0<4;4,1>:w          0:uw
  503.         add   (4) a0.4:uw   r22.0<4;4,1>:w          512:uw
  504.  
  505. //Buffer 0
  506. //Move Y to msg payload
  507.         mov  (16)  mubMSGPAYLOAD0(0,0)<1>                       r[a0.1, 1]<32;16,2>:ub          { NoDDClr }
  508.         mov  (16)  mubMSGPAYLOAD0(0,16)<1>                      r[a0.1, 33]<32;16,2>:ub         { NoDDChk }
  509.         mov  (16)  mubMSGPAYLOAD0(1,0)<1>                       r[a0.1, 65]<32;16,2>:ub         { NoDDClr }
  510.         mov  (16)  mubMSGPAYLOAD0(1,16)<1>                      r[a0.1, 97]<32;16,2>:ub         { NoDDChk }
  511.  
  512. //Move U to msg payload
  513.         mov  (8)  mubMSGPAYLOAD1(0,0)<1>                        r[a0.2, 1]<32;8,4>:ub           { NoDDClr }
  514.         mov  (8)  mubMSGPAYLOAD1(0,8)<1>                        r[a0.2, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  515.  
  516. //Move V to msg payload
  517.         mov  (8)  mubMSGPAYLOAD2(0,0)<1>                        r[a0.0, 1]<32;8,4>:ub           { NoDDClr }
  518.         mov  (8)  mubMSGPAYLOAD2(0,8)<1>                        r[a0.0, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  519.  
  520.         add   (4) a0.0:uw                       r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  521.  
  522. //Buffer 1
  523.         mov  (16)  mubMSGPAYLOAD0(2,0)<1>                       r[a0.5, 1]<32;16,2>:ub          { NoDDClr }
  524.         mov  (16)  mubMSGPAYLOAD0(2,16)<1>                      r[a0.5, 33]<32;16,2>:ub         { NoDDChk }
  525.         mov  (16)  mubMSGPAYLOAD0(3,0)<1>                       r[a0.5, 65]<32;16,2>:ub         { NoDDClr }
  526.         mov  (16)  mubMSGPAYLOAD0(3,16)<1>                      r[a0.5, 97]<32;16,2>:ub         { NoDDChk }
  527.  
  528.         mov  (8)  mubMSGPAYLOAD1(0,16)<1>                       r[a0.6, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  529.         mov  (8)  mubMSGPAYLOAD1(0,24)<1>                       r[a0.6, 65]<32;8,4>:ub          { NoDDChk }
  530.  
  531.         mov  (8)  mubMSGPAYLOAD2(0,16)<1>                       r[a0.4, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  532.         mov  (8)  mubMSGPAYLOAD2(0,24)<1>                       r[a0.4, 65]<32;8,4>:ub          { NoDDChk }
  533.  
  534.         add   (4) a0.4:uw               r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  535.  
  536. //Buffer 2
  537.         mov  (16)  mubMSGPAYLOAD0(4,0)<1>                       r[a0.1, 1]<32;16,2>:ub          { NoDDClr }
  538.         mov  (16)  mubMSGPAYLOAD0(4,16)<1>                      r[a0.1, 33]<32;16,2>:ub         { NoDDChk }
  539.         mov  (16)  mubMSGPAYLOAD0(5,0)<1>                       r[a0.1, 65]<32;16,2>:ub         { NoDDClr }
  540.         mov  (16)  mubMSGPAYLOAD0(5,16)<1>                      r[a0.1, 97]<32;16,2>:ub         { NoDDChk }
  541.  
  542.         mov  (8)  mubMSGPAYLOAD1(1,0)<1>                        r[a0.2, 1]<32;8,4>:ub           { NoDDClr }
  543.         mov  (8)  mubMSGPAYLOAD1(1,8)<1>                        r[a0.2, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  544.  
  545.         mov  (8)  mubMSGPAYLOAD2(1,0)<1>                        r[a0.0, 1]<32;8,4>:ub           { NoDDClr }
  546.         mov  (8)  mubMSGPAYLOAD2(1,8)<1>                        r[a0.0, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  547.  
  548. //Buffer 3
  549.         mov  (16)  mubMSGPAYLOAD0(6,0)<1>                       r[a0.5, 1]<32;16,2>:ub          { NoDDClr }
  550.         mov  (16)  mubMSGPAYLOAD0(6,16)<1>                      r[a0.5, 33]<32;16,2>:ub         { NoDDChk }
  551.         mov  (16)  mubMSGPAYLOAD0(7,0)<1>                       r[a0.5, 65]<32;16,2>:ub         { NoDDClr }
  552.         mov  (16)  mubMSGPAYLOAD0(7,16)<1>                      r[a0.5, 97]<32;16,2>:ub         { NoDDChk }
  553.  
  554.         mov  (8)  mubMSGPAYLOAD1(1,16)<1>                       r[a0.6, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  555.         mov  (8)  mubMSGPAYLOAD1(1,24)<1>                       r[a0.6, 65]<32;8,4>:ub          { NoDDChk }
  556.  
  557.         mov  (8)  mubMSGPAYLOAD2(1,16)<1>                       r[a0.4, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  558.         mov  (8)  mubMSGPAYLOAD2(1,24)<1>                       r[a0.4, 65]<32;8,4>:ub          { NoDDChk }
  559.  
  560. //===========================================================================
  561.  
  562. send (1)    null<1>:d    r28    0x5                     0x120A8018:ud
  563. send (1)    null<1>:d    r37    0x5                     0x60A8019:ud
  564. send (1)    null<1>:d    r46    0x5                     0x60A801A:ud
  565.