Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright © <2010>, Intel Corporation.
  3.  *
  4.  * Permission is hereby granted, free of charge, to any person obtaining a
  5.  * copy of this software and associated documentation files (the
  6.  * "Software"), to deal in the Software without restriction, including
  7.  * without limitation the rights to use, copy, modify, merge, publish,
  8.  * distribute, sub license, and/or sell copies of the Software, and to
  9.  * permit persons to whom the Software is furnished to do so, subject to
  10.  * the following conditions:
  11.  *
  12.  * The above copyright notice and this permission notice (including the
  13.  * next paragraph) shall be included in all copies or substantial portions
  14.  * of the Software.
  15.  *
  16.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  17.  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  18.  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  19.  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
  20.  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  21.  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  22.  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  23.  *
  24.  */
  25. // Modual name: IntraFrame.asm
  26. //
  27. // Make intra predition estimation for Intra frame
  28. //
  29.  
  30. //
  31. //  Now, begin source code....
  32. //
  33.  
  34. /*
  35.  * __START
  36.  */
  37. __INTRA_START:
  38. mov  (16) tmp_reg0.0<1>:UD      0x0:UD {align1};
  39. mov  (16) tmp_reg2.0<1>:UD      0x0:UD {align1};
  40. mov  (16) tmp_reg4.0<1>:UD      0x0:UD {align1} ;
  41. mov  (16) tmp_reg6.0<1>:UD      0x0:UD {align1} ;
  42.  
  43. shl  (2) read0_header.0<1>:D    orig_xy_ub<2,2,1>:UB 4:UW {align1};    /* (x, y) * 16 */
  44. add  (1) read0_header.0<1>:D    read0_header.0<0,1,0>:D -8:W {align1};     /* X offset */
  45. add  (1) read0_header.4<1>:D    read0_header.4<0,1,0>:D -1:W {align1};     /* Y offset */
  46. mov  (1) read0_header.8<1>:UD   BLOCK_32X1 {align1};
  47. mov  (1) read0_header.20<1>:UB  thread_id_ub {align1};                  /* dispatch id */
  48.  
  49. shl  (2) read1_header.0<1>:D    orig_xy_ub<2,2,1>:UB 4:UW {align1};    /* (x, y) * 16 */
  50. add  (1) read1_header.0<1>:D    read1_header.0<0,1,0>:D -4:W {align1};     /* X offset */
  51. mov  (1) read1_header.8<1>:UD   BLOCK_4X16 {align1};
  52. mov  (1) read1_header.20<1>:UB  thread_id_ub {align1};                  /* dispatch id */
  53.        
  54. shl  (2) vme_m0.8<1>:UW         orig_xy_ub<2,2,1>:UB 4:UW {align1};    /* (x, y) * 16 */
  55. mov  (1) vme_m0.20<1>:UB        thread_id_ub {align1};                  /* dispatch id */
  56.  
  57. mul  (1) obw_m0.8<1>:UD         w_in_mb_uw<0,1,0>:UW orig_y_ub<0,1,0>:UB {align1};
  58. add  (1) obw_m0.8<1>:UD         obw_m0.8<0,1,0>:UD orig_x_ub<0,1,0>:UB {align1};
  59. mov  (1) obw_m0.20<1>:UB        thread_id_ub {align1};                  /* dispatch id */
  60.        
  61. /*
  62.  * Media Read Message -- fetch Luma neighbor edge pixels
  63.  */
  64. /* ROW */
  65. mov  (8) msg_reg0.0<1>:UD       read0_header.0<8,8,1>:UD {align1};        
  66. send (8) msg_ind INEP_ROW<1>:UB null read(BIND_IDX_INEP, 0, 0, 4) mlen 1 rlen 1 {align1};
  67.  
  68. /* COL */
  69. mov  (8) msg_reg0.0<1>:UD       read1_header.0<8,8,1>:UD {align1};                
  70. send (8) msg_ind INEP_COL0<1>:UB null read(BIND_IDX_INEP, 0, 0, 4) mlen 1 rlen 2 {align1};
  71.        
  72. /* m0 */        
  73. mov  (8) vme_msg_0.0<1>:UD      vme_m0.0<8,8,1>:UD {align1};
  74.  
  75. /* m2 */        
  76. mov  (8) vme_msg_2<1>:UD        0x0:UD {align1};
  77.  
  78. /*
  79.  * VME message
  80.  */
  81. /* m0 */        
  82. mov  (8) vme_msg_0.0<1>:UD      vme_m0.0<8,8,1>:UD {align1};
  83.  
  84. /* m1 */
  85. mov  (8) vme_m1.0<1>:ud         0x0:ud  {align1};
  86. and.z.f0.0 (1) null<1>:UW transform_8x8_ub<0,1,0>:UB 1:UW {align1};
  87. (f0.0) mov  (1) intra_part_mask_ub<1>:UB  LUMA_INTRA_8x8_DISABLE:uw {align1};
  88.  
  89. /* assign MB intra struct from the thread payload*/
  90. mov (1) mb_intra_struct_ub<1>:UB input_mb_intra_ub<0,1,0>:UB {align1};
  91.                            
  92. mov  (8) vme_msg_1<1>:UD        vme_m1.0<8,8,1>:UD {align1};
  93.  
  94. /* m2 */        
  95. mov (8) vme_msg_2<1>:UD         0x0:UD {align1};
  96.  
  97. /* m3 */
  98. mov  (1) INEP_ROW.0<1>:UD       0x0:UD {align1};
  99. and  (1) INEP_ROW.4<1>:UD       INEP_ROW.4<0,1,0>:UD            0xFF000000:UD {align1};
  100. mov  (8) vme_msg_3<1>:UD         INEP_ROW.0<8,8,1>:UD {align1};
  101.  
  102. /* m4 */        
  103. mov  (8) vme_msg_4<1>:UD         0x0 {align1};
  104. mov (16) vme_msg_4.0<1>:UB       INEP_COL0.3<32,8,4>:UB {align1};
  105. mov  (1) vme_msg_4.16<1>:UD      INTRA_PREDICTORE_MODE {align1};
  106.  
  107. send (8)
  108.         vme_msg_ind
  109.         vme_wb
  110.         null
  111.         vme(
  112.                 BIND_IDX_VME,
  113.                 0,
  114.                 0,
  115.                 VME_MESSAGE_TYPE_INTRA
  116.         )
  117.         mlen vme_msg_length
  118.         rlen vme_intra_wb_length
  119.         {align1};
  120.  
  121.  
  122. /*
  123.  * Oword Block Write message
  124.  */
  125. mov  (8) msg_reg0.0<1>:UD       obw_m0<8,8,1>:UD {align1};
  126.        
  127. mov  (1) msg_reg1.0<1>:UD       vme_wb.0<0,1,0>:UD      {align1};
  128. mov  (1) msg_reg1.4<1>:UD       vme_wb.16<0,1,0>:UD     {align1};
  129. mov  (1) msg_reg1.8<1>:UD       vme_wb.20<0,1,0>:UD     {align1};
  130. mov  (1) msg_reg1.12<1>:UD      vme_wb.24<0,1,0>:UD     {align1};
  131.  
  132. /* bind index 3, write 2 oword (32bytes), msg type: 8(OWord Block Write) */
  133. send (16)
  134.         msg_ind
  135.         obw_wb
  136.         null
  137.         data_port(
  138.                 OBW_CACHE_TYPE,
  139.                 OBW_MESSAGE_TYPE,
  140.                 OBW_CONTROL_0,
  141.                 OBW_BIND_IDX,
  142.                 OBW_WRITE_COMMIT_CATEGORY,
  143.                 OBW_HEADER_PRESENT
  144.         )
  145.         mlen 2
  146.         rlen obw_wb_length
  147.         {align1};
  148.  
  149. __EXIT:
  150. /*
  151.  * kill thread
  152.  */        
  153. mov  (8) ts_msg_reg0<1>:UD         r0<8,8,1>:UD {align1};
  154. send (16) ts_msg_ind acc0<1>UW null thread_spawner(0, 0, 1) mlen 1 rlen 0 {align1 EOT};
  155.