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. //  131    // 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_NV12.asm
  164. //
  165. // Save NV12 420 frame data block of size 16x16
  166. //
  167. // To save 16x16 block (16x16 bytes of Y and 16x8 bytes of interleaved UV), we need 2 send instructions with of size 16x16 and 16x8 each.
  168. //  ---------------
  169. //  |    16x16    |
  170. //  |    YUYV     |
  171. //  ---------------
  172. //  | 16x8  UV    |
  173. //  ---------------
  174.  
  175. //-----------------------------------------------------------------
  176. //The layout of data is as follows:
  177. //mMSGHDR0                      : Y data header (16x16)
  178. //mubMSGPAYLOAD0        : Y data payload (8 GRFs)
  179. //mMSGHDR1                      : U data header (16x8)
  180. //mubMSGPAYLOAD1        : U data payload (4 GRFs)
  181. //------------------------------------------------------------------
  182.  
  183.  
  184.  
  185. // Module name: Save.inc
  186.  
  187.  
  188.  
  189.  
  190. // Description: Includes all definitions explicit to Fast Composite.
  191.  
  192.  
  193.  
  194.  
  195. // End of common.inc
  196.  
  197.  
  198. //========== GRF partition ==========
  199.      // r0 header            :   r0          (1 GRF)
  200.      // Static parameters    :   r1 - r6     (6 GRFS)
  201.      // Inline parameters    :   r7 - r8     (2 GRFs)
  202.      // MSGSRC               :   r27         (1 GRF)
  203. //===================================
  204.  
  205. //Interface:
  206. //========== Static Parameters (Explicit To Fast Composite) ==========
  207. //r1
  208. //CSC Set 0
  209.  
  210.  
  211. .declare udCSC_CURBE    Base=r1.0      ElementSize=4       Type=ud
  212.  
  213. //Constant alpha
  214.  
  215.  
  216. //r2
  217.  
  218.  
  219. // Gen7 AVS WA
  220.  
  221.  
  222. // WiDi Definitions
  223.  
  224.  
  225. //Colorfill
  226.  
  227.  
  228.                                       // 0: 0-degree, 1: 90, 2: 180, 3: 270-degree, clockwise.     
  229.  
  230. .declare ubCOLOR_PIXEL_VAL      Base=r2.20      ElementSize=1       SrcRegion=<0;1,0>       DstRegion=<1>       Type=ub
  231.  
  232. //r3
  233. //Normalised Ratio of Horizontal step size with main video for all layers
  234.  
  235.  
  236.     //Normalised Ratio of Horizontal step size with main video for all layers becomes
  237.     //Normalised Horizontal step size for all layers in VP_Setup.asm
  238.  
  239.  
  240. //r4
  241. //Normalised Vertical step size for all layers
  242.  
  243.  
  244. //r5
  245. //Normalised Vertical Frame Origin for all layers
  246.  
  247.  
  248. //r6
  249. //Normalised Horizontal Frame Origin for all layers
  250.  
  251.  
  252. //========== Inline Parameters (Explicit To Fast Composite) ==========
  253.  
  254.  
  255. //Main video Step X
  256.  
  257.  
  258. //====================== Binding table (Explicit To Fast Composite)=========================================
  259.  
  260.  
  261. //Used by Interlaced Scaling Kernels
  262.  
  263.  
  264. //========== Sampler State Table Index (Explicit To Fast Composite)==========
  265. //Sampler Index for AVS/IEF messages
  266.  
  267.  
  268. //Sampler Index for SIMD16 sampler messages
  269.  
  270.  
  271. //=============================================================================
  272.  
  273. .declare fBUFFER_0      Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  274. .declare fBUFFER_1      Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  275. .declare fBUFFER_2      Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  276. .declare fBUFFER_3      Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  277. .declare fBUFFER_4      Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  278. .declare fBUFFER_5      Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=f
  279.  
  280. .declare udBUFFER_0     Base=r64.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  281. .declare udBUFFER_1     Base=r80.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  282. .declare udBUFFER_2     Base=r96.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  283. .declare udBUFFER_3     Base=r112.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  284. .declare udBUFFER_4     Base=r28.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  285. .declare udBUFFER_5     Base=r46.0       ElementSize=4       SrcRegion=<8;8,1>       DstRegion=<1>       Type=ud
  286.  
  287. .declare uwBUFFER_0     Base=r64.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  288. .declare uwBUFFER_1     Base=r80.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  289. .declare uwBUFFER_2     Base=r96.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  290. .declare uwBUFFER_3     Base=r112.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  291. .declare uwBUFFER_4     Base=r28.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  292. .declare uwBUFFER_5     Base=r46.0       ElementSize=2       SrcRegion=<16;16,1>     DstRegion=<1>       Type=uw
  293.  
  294. .declare ubBUFFER_0     Base=r64.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  295. .declare ubBUFFER_1     Base=r80.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  296. .declare ubBUFFER_2     Base=r96.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  297. .declare ubBUFFER_3     Base=r112.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  298. .declare ubBUFFER_4     Base=r28.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  299. .declare ubBUFFER_5     Base=r46.0       ElementSize=1       SrcRegion=<16;16,1>     DstRegion=<1>       Type=ub
  300.  
  301. .declare ub4BUFFER_0    Base=r64.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  302. .declare ub4BUFFER_1    Base=r80.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  303. .declare ub4BUFFER_2    Base=r96.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  304. .declare ub4BUFFER_3    Base=r112.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  305. .declare ub4BUFFER_4    Base=r28.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  306. .declare ub4BUFFER_5    Base=r46.0       ElementSize=1       SrcRegion=<32;8,4>      DstRegion=<4>       Type=ub
  307.  
  308. //Pointer to mask reg
  309.  
  310.  
  311. //r18
  312.  
  313.  
  314. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  315. // NODDCLR, NODDCHK flags. -rT
  316.  
  317.  
  318. .declare udCSC_COEFF_0  Base=r18.0    ElementSize=4 Type=ud       // 1 GRF
  319.  
  320. //r19
  321.  
  322.  
  323. .declare udCSC_COEFF_1  Base=r19.0    ElementSize=4 Type=ud       // 1 GRF
  324.  
  325.  
  326. //r20
  327.  
  328. .declare uwALPHA_MASK_REG_TEMP  Base=r20.0    ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  329.  
  330. //r21
  331.  
  332. .declare uwALPHA_MASK_REG       Base=r21.0         ElementSize=2 SrcRegion=<16;16,1> Type=uw        // 1 GRF
  333.  
  334. //r22
  335.  
  336.  
  337. //Always keep Cannel Pointers and Offsets in same GRF, so that we can use
  338. // NODDCLR, NODDCHK flags. -rT
  339.  
  340.  
  341. //Keep fORIGIN_X_NLAS, fY_OFFSET_2ND_BLOCK, fSTEP_X_NLAS, pMSGDSC_COPY, ubCONST_ALPHA_COPY as
  342. //sub registers of same GRF to enable using NODDCLR NODDCHK. -rT
  343.  
  344. //r23
  345.  
  346.  
  347. //Lumakey
  348.  
  349.  
  350. //r24
  351.  
  352.  
  353. //r25
  354.  
  355.  
  356. //r26
  357.  
  358.  
  359. //defines to generate LABELS during compile time.
  360.  
  361.  
  362. //Msg payload buffers; upto 4 full-size messages can be written
  363.  
  364.  
  365. .declare    mudMSGPAYLOAD0  Base=r29.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  366. .declare    mudMSGPAYLOAD1  Base=r38.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  367. .declare    mudMSGPAYLOAD2  Base=r47.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  368. .declare    mudMSGPAYLOAD3  Base=r56.0 ElementSize=4 SrcRegion=<8;8,1> Type=ud
  369.  
  370. .declare    muwMSGPAYLOAD0  Base=r29.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  371. .declare    muwMSGPAYLOAD1  Base=r38.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  372. .declare    muwMSGPAYLOAD2  Base=r47.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  373. .declare    muwMSGPAYLOAD3  Base=r56.0 ElementSize=2 SrcRegion=<16;16,1> Type=uw
  374.  
  375. .declare    mubMSGPAYLOAD0  Base=r29.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  376. .declare    mubMSGPAYLOAD1  Base=r38.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  377. .declare    mubMSGPAYLOAD2  Base=r47.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  378. .declare    mubMSGPAYLOAD3  Base=r56.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  379. .declare    mubMSGPAYLOAD4  Base=r32.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  380. .declare    mubMSGPAYLOAD5  Base=r41.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  381. .declare    mubMSGPAYLOAD6  Base=r50.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  382. .declare    mubMSGPAYLOAD7  Base=r59.0 ElementSize=1 SrcRegion=<16;16,1> Type=ub
  383.  
  384.  
  385.         // the r17 register (nTEMP0) is originally defined from "Common.inc"
  386.         // instead of re-defining a nTEMP0 here, we use "SAVE_RGB" suffix for its naming
  387.  
  388.         .declare uwTemp0 Base=r17.0 ElementSize=2 Type=uw
  389.  
  390.  
  391. //_SAVE_INC_
  392.  
  393.  
  394.         // At the save module we have all 8 address sub-registers available.
  395.         // So we will use PING-PONG type of scheme to save the data using
  396.         // pointers pBUF_CHNL_TOP_8x4 and pBUF_CHNL_BOT_8x4. This will help
  397.         // reduce dependency. - rT
  398.  
  399.         //wBUFF_CHNL_PTR points to either buffer 0 or buffer 4.
  400.         //Add appropriate offsets to get pointers for all buffers (1,2,3 or 5).
  401.         //Offsets are zero for buffer 0 and buffer 4.
  402.         add   (4) a0.0:uw   r22.0<4;4,1>:w          0:uw
  403.         add   (4) a0.4:uw   r22.0<4;4,1>:w          512:uw
  404.  
  405.         //Set up header for Y,U and V data
  406.         mov  (8) r28<1>:ud      r27<8;8,1>:ud
  407.         mov  (8) r37<1>:ud      r27<8;8,1>:ud
  408.  
  409.         mov  (2) r28.0<1>:d     r7.0<2;2,1>:w                                   { NoDDClr }             //ORI Y (LUMA)  = ORI
  410.         mov  (1) r37.0<1>:d     r7.0<0;1,0>:w                                   { NoDDClr }             //H ORI (CHROMA)        = H ORI
  411.         shr  (1) r37.1<1>:d     r7.1<0;1,0>:w            1:w            { NoDDClr, NoDDChk }    //V ORI (CHROMA)        = V ORI/2
  412.  
  413.         mov  (1) r28.2<1>:ud    0xF000F:ud      { NoDDChk }  // Y Block width and height (16x16)
  414.         mov  (1) r37.2<1>:ud    0x7000F:ud      { NoDDChk }  // UV Block width and height(16x8)
  415.  
  416. // Unscramble, and pack data directly to MRFs
  417.  
  418. //      Data 16x16 block is divided as -
  419. //              ---------
  420. //              |   0   |
  421. //              ---------
  422. //              |   1   |
  423. //              ---------
  424. //              |   2   |
  425. //              ---------
  426. //              |   3   |
  427. //              ---------
  428. //              All sub-blocks are of size 16x4
  429. //              0: ubBUFFER_0
  430. //              1: ubBUFFER_1, ubBUFFER_0+16
  431. //              2: ubBUFFER_2
  432. //              3: ubBUFFER_3, ubBUFFER_2+16
  433.  
  434.         //Y Rounding 16x4 top part
  435.         add.sat (16) r[a0.1,0]<1>:uw            r[a0.1,0]<16;16,1>:uw                   0x0080:uw              
  436.         add.sat (16) r[a0.1,32]<1>:uw           r[a0.1,32]<16;16,1>:uw          0x0080:uw              
  437.         add.sat (16) r[a0.1,64]<1>:uw           r[a0.1,64]<16;16,1>:uw          0x0080:uw              
  438.         add.sat (16) r[a0.1,96]<1>:uw           r[a0.1,96]<16;16,1>:uw          0x0080:uw              
  439.  
  440.         // U Averaging and Rounding, 8x2 top part
  441.         shr   (8)       uwBUFFER_5(0,0)<2>                      r[a0.2,0]<16;8,2>:uw                    1:w
  442.         shr       (8)   uwBUFFER_5(1,0)<2>                      r[a0.2,32]<16;8,2>:uw                   1:w
  443.         shr       (8)   uwBUFFER_5(2,0)<2>                      r[a0.2,64]<16;8,2>:uw                   1:w
  444.         shr   (8)       uwBUFFER_5(3,0)<2>                      r[a0.2,96]<16;8,2>:uw                   1:w
  445.  
  446.         add       (8)   uwBUFFER_5(0,0)<2>                      uwBUFFER_5(0,0)<16;8,2>                         uwBUFFER_5(1,0)<16;8,2>
  447.         add.sat (8) r[a0.2,0]<2>:uw             uwBUFFER_5(0,0)<16;8,2>                         0x0080:uw
  448.  
  449.         add       (8)   uwBUFFER_5(2,0)<2>                      uwBUFFER_5(2,0)<16;8,2>                         uwBUFFER_5(3,0)<16;8,2>
  450.         add.sat (8) r[a0.2,64]<2>:uw            uwBUFFER_5(2,0)<16;8,2>                         0x0080:uw
  451.  
  452.         // V Averaging and Rounding, 8x2 top part
  453.         shr   (8)       uwBUFFER_5(4,0)<2>                      r[a0.0,0]<16;8,2>:uw                    1:w
  454.         shr       (8)   uwBUFFER_5(5,0)<2>                      r[a0.0,32]<16;8,2>:uw                   1:w
  455.         shr       (8)   uwBUFFER_5(6,0)<2>                      r[a0.0,64]<16;8,2>:uw                   1:w
  456.         shr   (8)       uwBUFFER_5(7,0)<2>                      r[a0.0,96]<16;8,2>:uw                   1:w
  457.  
  458.         add       (8)   uwBUFFER_5(4,0)<2>                      uwBUFFER_5(4,0)<16;8,2>                         uwBUFFER_5(5,0)<16;8,2>
  459.         add.sat (8) r[a0.0,0]<2>:uw             uwBUFFER_5(4,0)<16;8,2>                         0x0080:uw
  460.  
  461.         add       (8)   uwBUFFER_5(6,0)<2>                      uwBUFFER_5(6,0)<16;8,2>                         uwBUFFER_5(7,0)<16;8,2>
  462.         add.sat (8) r[a0.0,64]<2>:uw            uwBUFFER_5(6,0)<16;8,2>                         0x0080:uw
  463.  
  464.         add   (4) a0.0:uw                       r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  465.  
  466.         //Y Rounding, 16x4 bottom part
  467.         add.sat (16) r[a0.5,0]<1>:uw            r[a0.5,0]<16;16,1>:uw                   0x0080:uw              
  468.         add.sat (16) r[a0.5,32]<1>:uw           r[a0.5,32]<16;16,1>:uw          0x0080:uw              
  469.         add.sat (16) r[a0.5,64]<1>:uw           r[a0.5,64]<16;16,1>:uw          0x0080:uw              
  470.         add.sat (16) r[a0.5,96]<1>:uw           r[a0.5,96]<16;16,1>:uw          0x0080:uw              
  471.  
  472.         // U Averaging and Rounding, 8x2 bottom part
  473.         shr   (8)       uwBUFFER_5(0,0)<2>                      r[a0.6,0]<16;8,2>:uw                    1:w
  474.         shr       (8)   uwBUFFER_5(1,0)<2>                      r[a0.6,32]<16;8,2>:uw                   1:w
  475.         shr       (8)   uwBUFFER_5(2,0)<2>                      r[a0.6,64]<16;8,2>:uw                   1:w
  476.         shr   (8)       uwBUFFER_5(3,0)<2>                      r[a0.6,96]<16;8,2>:uw                   1:w
  477.  
  478.         add       (8)   uwBUFFER_5(0,0)<2>                      uwBUFFER_5(0,0)<16;8,2>                         uwBUFFER_5(1,0)<16;8,2>
  479.         add.sat (8) r[a0.6,0]<2>:uw             uwBUFFER_5(0,0)<16;8,2>                         0x0080:uw
  480.  
  481.         add       (8)   uwBUFFER_5(2,0)<2>                      uwBUFFER_5(2,0)<16;8,2>                         uwBUFFER_5(3,0)<16;8,2>
  482.         add.sat (8) r[a0.6,64]<2>:uw            uwBUFFER_5(2,0)<16;8,2>                         0x0080:uw
  483.  
  484.         // V Averaging and Rounding, 8x2 bottom part
  485.         shr   (8)       uwBUFFER_5(4,0)<2>                      r[a0.4,0]<16;8,2>:uw                    1:w
  486.         shr       (8)   uwBUFFER_5(5,0)<2>                      r[a0.4,32]<16;8,2>:uw                   1:w
  487.         shr       (8)   uwBUFFER_5(6,0)<2>                      r[a0.4,64]<16;8,2>:uw                   1:w
  488.         shr   (8)       uwBUFFER_5(7,0)<2>                      r[a0.4,96]<16;8,2>:uw                   1:w
  489.  
  490.         add       (8)   uwBUFFER_5(4,0)<2>                      uwBUFFER_5(4,0)<16;8,2>                         uwBUFFER_5(5,0)<16;8,2>
  491.         add.sat (8) r[a0.4,0]<2>:uw             uwBUFFER_5(4,0)<16;8,2>                         0x0080:uw
  492.  
  493.         add       (8)   uwBUFFER_5(6,0)<2>                      uwBUFFER_5(6,0)<16;8,2>                         uwBUFFER_5(7,0)<16;8,2>
  494.         add.sat (8) r[a0.4,64]<2>:uw            uwBUFFER_5(6,0)<16;8,2>                         0x0080:uw
  495.  
  496.         add   (4) a0.4:uw               r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  497.         //Y Rounding 16x4 top part
  498.         add.sat (16) r[a0.1,0]<1>:uw            r[a0.1,0]<16;16,1>:uw                   0x0080:uw              
  499.         add.sat (16) r[a0.1,32]<1>:uw           r[a0.1,32]<16;16,1>:uw          0x0080:uw              
  500.         add.sat (16) r[a0.1,64]<1>:uw           r[a0.1,64]<16;16,1>:uw          0x0080:uw              
  501.         add.sat (16) r[a0.1,96]<1>:uw           r[a0.1,96]<16;16,1>:uw          0x0080:uw              
  502.  
  503.         // U Averaging and Rounding, 8x2 top part
  504.         shr   (8)       uwBUFFER_5(0,0)<2>                      r[a0.2,0]<16;8,2>:uw                    1:w
  505.         shr       (8)   uwBUFFER_5(1,0)<2>                      r[a0.2,32]<16;8,2>:uw                   1:w
  506.         shr       (8)   uwBUFFER_5(2,0)<2>                      r[a0.2,64]<16;8,2>:uw                   1:w
  507.         shr   (8)       uwBUFFER_5(3,0)<2>                      r[a0.2,96]<16;8,2>:uw                   1:w
  508.  
  509.         add       (8)   uwBUFFER_5(0,0)<2>                      uwBUFFER_5(0,0)<16;8,2>                         uwBUFFER_5(1,0)<16;8,2>
  510.         add.sat (8) r[a0.2,0]<2>:uw             uwBUFFER_5(0,0)<16;8,2>                         0x0080:uw
  511.  
  512.         add       (8)   uwBUFFER_5(2,0)<2>                      uwBUFFER_5(2,0)<16;8,2>                         uwBUFFER_5(3,0)<16;8,2>
  513.         add.sat (8) r[a0.2,64]<2>:uw            uwBUFFER_5(2,0)<16;8,2>                         0x0080:uw
  514.  
  515.         // V Averaging and Rounding, 8x2 top part
  516.         shr   (8)       uwBUFFER_5(4,0)<2>                      r[a0.0,0]<16;8,2>:uw                    1:w
  517.         shr       (8)   uwBUFFER_5(5,0)<2>                      r[a0.0,32]<16;8,2>:uw                   1:w
  518.         shr       (8)   uwBUFFER_5(6,0)<2>                      r[a0.0,64]<16;8,2>:uw                   1:w
  519.         shr   (8)       uwBUFFER_5(7,0)<2>                      r[a0.0,96]<16;8,2>:uw                   1:w
  520.  
  521.         add       (8)   uwBUFFER_5(4,0)<2>                      uwBUFFER_5(4,0)<16;8,2>                         uwBUFFER_5(5,0)<16;8,2>
  522.         add.sat (8) r[a0.0,0]<2>:uw             uwBUFFER_5(4,0)<16;8,2>                         0x0080:uw
  523.  
  524.         add       (8)   uwBUFFER_5(6,0)<2>                      uwBUFFER_5(6,0)<16;8,2>                         uwBUFFER_5(7,0)<16;8,2>
  525.         add.sat (8) r[a0.0,64]<2>:uw            uwBUFFER_5(6,0)<16;8,2>                         0x0080:uw
  526.  
  527.         add   (4) a0.0:uw                       r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  528.  
  529.         //Y Rounding, 16x4 bottom part
  530.         add.sat (16) r[a0.5,0]<1>:uw            r[a0.5,0]<16;16,1>:uw                   0x0080:uw              
  531.         add.sat (16) r[a0.5,32]<1>:uw           r[a0.5,32]<16;16,1>:uw          0x0080:uw              
  532.         add.sat (16) r[a0.5,64]<1>:uw           r[a0.5,64]<16;16,1>:uw          0x0080:uw              
  533.         add.sat (16) r[a0.5,96]<1>:uw           r[a0.5,96]<16;16,1>:uw          0x0080:uw              
  534.  
  535.         // U Averaging and Rounding, 8x2 bottom part
  536.         shr   (8)       uwBUFFER_5(0,0)<2>                      r[a0.6,0]<16;8,2>:uw                    1:w
  537.         shr       (8)   uwBUFFER_5(1,0)<2>                      r[a0.6,32]<16;8,2>:uw                   1:w
  538.         shr       (8)   uwBUFFER_5(2,0)<2>                      r[a0.6,64]<16;8,2>:uw                   1:w
  539.         shr   (8)       uwBUFFER_5(3,0)<2>                      r[a0.6,96]<16;8,2>:uw                   1:w
  540.  
  541.         add       (8)   uwBUFFER_5(0,0)<2>                      uwBUFFER_5(0,0)<16;8,2>                         uwBUFFER_5(1,0)<16;8,2>
  542.         add.sat (8) r[a0.6,0]<2>:uw             uwBUFFER_5(0,0)<16;8,2>                         0x0080:uw
  543.  
  544.         add       (8)   uwBUFFER_5(2,0)<2>                      uwBUFFER_5(2,0)<16;8,2>                         uwBUFFER_5(3,0)<16;8,2>
  545.         add.sat (8) r[a0.6,64]<2>:uw            uwBUFFER_5(2,0)<16;8,2>                         0x0080:uw
  546.  
  547.         // V Averaging and Rounding, 8x2 bottom part
  548.         shr   (8)       uwBUFFER_5(4,0)<2>                      r[a0.4,0]<16;8,2>:uw                    1:w
  549.         shr       (8)   uwBUFFER_5(5,0)<2>                      r[a0.4,32]<16;8,2>:uw                   1:w
  550.         shr       (8)   uwBUFFER_5(6,0)<2>                      r[a0.4,64]<16;8,2>:uw                   1:w
  551.         shr   (8)       uwBUFFER_5(7,0)<2>                      r[a0.4,96]<16;8,2>:uw                   1:w
  552.  
  553.         add       (8)   uwBUFFER_5(4,0)<2>                      uwBUFFER_5(4,0)<16;8,2>                         uwBUFFER_5(5,0)<16;8,2>
  554.         add.sat (8) r[a0.4,0]<2>:uw             uwBUFFER_5(4,0)<16;8,2>                         0x0080:uw
  555.  
  556.         add       (8)   uwBUFFER_5(6,0)<2>                      uwBUFFER_5(6,0)<16;8,2>                         uwBUFFER_5(7,0)<16;8,2>
  557.         add.sat (8) r[a0.4,64]<2>:uw            uwBUFFER_5(6,0)<16;8,2>                         0x0080:uw
  558.  
  559.         add   (4) a0.4:uw               r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  560.         // restore pBUF_CHNL_TOP_8x4 and pBUF_CHNL_BOT_8x4 registers
  561.         add   (4) a0.0:uw   r22.0<4;4,1>:w          0:uw
  562.         add   (4) a0.4:uw   r22.0<4;4,1>:w          512:uw
  563.  
  564. //Buffer 0
  565. //Move Y to msg payload
  566.         mov  (16)  mubMSGPAYLOAD0(0,0)<1>                       r[a0.1, 1]<32;16,2>:ub          { NoDDClr }
  567.         mov  (16)  mubMSGPAYLOAD0(0,16)<1>                      r[a0.1, 33]<32;16,2>:ub         { NoDDChk }
  568.         mov  (16)  mubMSGPAYLOAD0(1,0)<1>                       r[a0.1, 65]<32;16,2>:ub         { NoDDClr }
  569.         mov  (16)  mubMSGPAYLOAD0(1,16)<1>                      r[a0.1, 97]<32;16,2>:ub         { NoDDChk }
  570.  
  571. //Move U to msg payload
  572.         mov  (8)  mubMSGPAYLOAD1(0,0)<2>                        r[a0.2, 1]<32;8,4>:ub           { NoDDClr }
  573.         mov  (8)  mubMSGPAYLOAD1(0,16)<2>                       r[a0.2, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  574.  
  575. //Move V to msg payload
  576.         mov  (8)  mubMSGPAYLOAD1(0,1)<2>                        r[a0.0, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  577.         mov  (8)  mubMSGPAYLOAD1(0,17)<2>                       r[a0.0, 65]<32;8,4>:ub          { NoDDChk }
  578.  
  579.         add   (4) a0.0:uw                       r22.0<4;4,1>:w          1024:uw //Update Buffer 2 pointers
  580.  
  581. //Buffer 1
  582.         mov  (16)  mubMSGPAYLOAD0(2,0)<1>                       r[a0.5, 1]<32;16,2>:ub          { NoDDClr }
  583.         mov  (16)  mubMSGPAYLOAD0(2,16)<1>                      r[a0.5, 33]<32;16,2>:ub         { NoDDChk }
  584.         mov  (16)  mubMSGPAYLOAD0(3,0)<1>                       r[a0.5, 65]<32;16,2>:ub         { NoDDClr }
  585.         mov  (16)  mubMSGPAYLOAD0(3,16)<1>                      r[a0.5, 97]<32;16,2>:ub         { NoDDChk }
  586.  
  587.         mov  (8)  mubMSGPAYLOAD1(1,0)<2>                        r[a0.6, 1]<32;8,4>:ub           { NoDDClr }
  588.         mov  (8)  mubMSGPAYLOAD1(1,16)<2>                       r[a0.6, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  589.  
  590.         mov  (8)  mubMSGPAYLOAD1(1,1)<2>                        r[a0.4, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  591.         mov  (8)  mubMSGPAYLOAD1(1,17)<2>                       r[a0.4, 65]<32;8,4>:ub          { NoDDChk }
  592.  
  593.         add   (4) a0.4:uw               r22.0<4;4,1>:w          1536:uw //Update Buffer 3 pointers
  594.  
  595. //Buffer 2
  596.         mov  (16)  mubMSGPAYLOAD0(4,0)<1>                       r[a0.1, 1]<32;16,2>:ub          { NoDDClr }
  597.         mov  (16)  mubMSGPAYLOAD0(4,16)<1>                      r[a0.1, 33]<32;16,2>:ub         { NoDDChk }
  598.         mov  (16)  mubMSGPAYLOAD0(5,0)<1>                       r[a0.1, 65]<32;16,2>:ub         { NoDDClr }
  599.         mov  (16)  mubMSGPAYLOAD0(5,16)<1>                      r[a0.1, 97]<32;16,2>:ub         { NoDDChk }
  600.  
  601.         mov  (8)  mubMSGPAYLOAD1(2,0)<2>                        r[a0.2, 1]<32;8,4>:ub           { NoDDClr }
  602.         mov  (8)  mubMSGPAYLOAD1(2,16)<2>                       r[a0.2, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  603.  
  604.         mov  (8)  mubMSGPAYLOAD1(2,1)<2>                        r[a0.0, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  605.         mov  (8)  mubMSGPAYLOAD1(2,17)<2>                       r[a0.0, 65]<32;8,4>:ub          { NoDDChk }
  606.  
  607. //Buffer 3
  608.         mov  (16)  mubMSGPAYLOAD0(6,0)<1>                       r[a0.5, 1]<32;16,2>:ub          { NoDDClr }
  609.         mov  (16)  mubMSGPAYLOAD0(6,16)<1>                      r[a0.5, 33]<32;16,2>:ub         { NoDDChk }
  610.         mov  (16)  mubMSGPAYLOAD0(7,0)<1>                       r[a0.5, 65]<32;16,2>:ub         { NoDDClr }
  611.         mov  (16)  mubMSGPAYLOAD0(7,16)<1>                      r[a0.5, 97]<32;16,2>:ub         { NoDDChk }
  612.  
  613.         mov  (8)  mubMSGPAYLOAD1(3,0)<2>                        r[a0.6, 1]<32;8,4>:ub           { NoDDClr }
  614.         mov  (8)  mubMSGPAYLOAD1(3,16)<2>                       r[a0.6, 65]<32;8,4>:ub          { NoDDClr, NoDDChk }
  615.  
  616.         mov  (8)  mubMSGPAYLOAD1(3,1)<2>                        r[a0.4, 1]<32;8,4>:ub           { NoDDClr, NoDDChk }
  617.         mov  (8)  mubMSGPAYLOAD1(3,17)<2>                       r[a0.4, 65]<32;8,4>:ub          { NoDDChk }
  618. //===========================================================================
  619.  
  620. send (1)    null<1>:d    r28    0x5                     0x120A8018:ud
  621. send (1)    null<1>:d    r37    0x5                     0xA0A8019:ud
  622.