Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Load reference 16x13 area for luma 8x8 MC
  3.  * Copyright © <2010>, Intel Corporation.
  4.  *
  5.  * Permission is hereby granted, free of charge, to any person obtaining a
  6.  * copy of this software and associated documentation files (the
  7.  * "Software"), to deal in the Software without restriction, including
  8.  * without limitation the rights to use, copy, modify, merge, publish,
  9.  * distribute, sub license, and/or sell copies of the Software, and to
  10.  * permit persons to whom the Software is furnished to do so, subject to
  11.  * the following conditions:
  12.  *
  13.  * The above copyright notice and this permission notice (including the
  14.  * next paragraph) shall be included in all copies or substantial portions
  15.  * of the Software.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18.  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19.  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
  20.  * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
  21.  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  22.  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  23.  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24.  *
  25.  * This file was originally licensed under the following license
  26.  *
  27.  *  Licensed under the Apache License, Version 2.0 (the "License");
  28.  *  you may not use this file except in compliance with the License.
  29.  *  You may obtain a copy of the License at
  30.  *
  31.  *      http://www.apache.org/licenses/LICENSE-2.0
  32.  *
  33.  *  Unless required by applicable law or agreed to in writing, software
  34.  *  distributed under the License is distributed on an "AS IS" BASIS,
  35.  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  36.  *  See the License for the specific language governing permissions and
  37.  *  limitations under the License.
  38.  *
  39.  */
  40. // Kernel name: LoadRef_Y_16x13.asm
  41. //
  42. // Load reference 16x13 area for luma 8x8 MC
  43.  
  44.  
  45. //#if !defined(__LOADREF_Y_16x13__)             // Make sure this is only included once
  46. //#define __LOADREF_Y_16x13__
  47.  
  48. #if 1
  49.  
  50. #if 1
  51.  
  52.         // Check whether MVX is integer MV
  53.         and.z.f0.0 (1) null:w                   r[pMV,0]<0;1,0>:w                               0x3:w
  54.  
  55.         // Compute integer and fractional components of MV
  56.     and (2)             gMVX_FRAC<1>:w          r[pMV,0]<2;2,1>:w                               0x03:w  //{NoDDClr}
  57.     asr (2)             gMVX_INT<1>:w           r[pMV,0]<2;2,1>:w                               0x02:w  //{NoDDChk}
  58.    
  59.     // Check whether MVY is integer
  60.         or.z.f0.1 (8) null:w                    gMVY_FRAC<0;1,0>:w                              0:w
  61.        
  62.         // If MVX is a multiple of 4 (..., -4, 0, 4, ...) integer MV, do special handling
  63.         (f0.0)  jmpi (1)        INTERLABEL(LOADREF_MVXZERO)    
  64.        
  65.     // Set message descriptor
  66.     (f0.1) add (1)      pMSGDSC:ud              gMSGDSC_R:ud                                    RESP_LEN(4):ud 
  67.         (-f0.1) add (1) pMSGDSC:ud              gMSGDSC_R:ud                                    RESP_LEN(7):ud
  68.        
  69.         // Compute top-left corner position to be loaded
  70.         // TODO: sel
  71.     (-f0.1) add (2)     gMSGSRC.0<1>:d  gMVX_INT<2;2,1>:w                               -0x02:d //{NoDDClr}
  72.     (-f0.1) mov (1)     gMSGSRC.2:ud    0x000c000c:ud                                                   //{NoDDChk}
  73.     (f0.1) add (1)      gMSGSRC.0<1>:d  gMVX_INT<0;1,0>:w                               -0x02:d //{NoDDClr}
  74.         (f0.1) mov (1)  gMSGSRC.1<1>:d  gMVY_INT<0;1,0>:w                                               //{NoDDChk,NoDDClr}
  75.     (f0.1) mov (1)      gMSGSRC.2:ud    0x0007000c:ud                                                   //{NoDDChk}
  76.  
  77.     // Read 16x13 pixels
  78.     send (8)    gudREF(0)<1>            mMSGHDRY                                                gMSGSRC<8;8,1>:ud       DAPREAD pMSGDSC:ud
  79.    
  80.     jmpi INTERLABEL(EXIT_LOADREF_Y_16x13)
  81.    
  82. INTERLABEL(LOADREF_MVXZERO):
  83.    
  84.     // Set message descriptor
  85. #ifdef DEV_ILK
  86.     (f0.1) add (1)      pMSGDSC:ud              gMSGDSC_R:ud                                    0x00200000:ud  
  87.         (-f0.1) add (1) pMSGDSC:ud              gMSGDSC_R:ud                                    0x00400000:ud
  88. #else
  89.     (f0.1) add (1)      pMSGDSC:ud              gMSGDSC_R:ud                                    0x00020000:ud  
  90.         (-f0.1) add (1) pMSGDSC:ud              gMSGDSC_R:ud                                    0x00040000:ud
  91. #endif
  92.        
  93.         // Compute top-left corner position to be loaded
  94.         // TODO: sel
  95.         mov (2) gMSGSRC.0<1>:d  gMVX_INT<2;2,1>:w
  96.     (-f0.1) add (1)     gMSGSRC.1<1>:d  gMVY_INT<0;1,0>:w                               -0x02:d
  97.     (-f0.1) mov (1)     gMSGSRC.2:ud    0x000c0007:ud                                                   //{NoDDChk}
  98.     (f0.1) mov (1)      gMSGSRC.2:ud    0x00070007:ud                                                   //{NoDDChk}
  99.  
  100.     // Read 16x13 pixels
  101.     send (8)    gudREF(0)<1>            mMSGHDRY                                                gMSGSRC<8;8,1>:ud       DAPREAD pMSGDSC:ud
  102.    
  103.  
  104. #else
  105.         // Compute integer and fractional components of MV
  106.     and (2)             gMVX_FRAC<1>:w          r[pMV,0]<2;2,1>:w                               0x03:w  //{NoDDClr}
  107.     asr (2)             gMVX_INT<1>:w           r[pMV,0]<2;2,1>:w                               0x02:w  //{NoDDChk}
  108.    
  109.     // Check whether MVY is integer
  110.         or.z.f0.1 (8) null:w                    gMVY_FRAC<0;1,0>:w                              0:w
  111.        
  112.     // Set message descriptor
  113. #ifdef DEV_ILK
  114.     (f0.1) add (1)      pMSGDSC:ud              gMSGDSC_R:ud                                    0x00400000:ud  
  115.         (-f0.1) add (1) pMSGDSC:ud              gMSGDSC_R:ud                                    0x00700000:ud
  116. #else
  117.     (f0.1) add (1)      pMSGDSC:ud              gMSGDSC_R:ud                                    0x00040000:ud  
  118.         (-f0.1) add (1) pMSGDSC:ud              gMSGDSC_R:ud                                    0x00070000:ud
  119. #endif
  120.        
  121.         // Compute top-left corner position to be loaded
  122.         // TODO: sel
  123.     (-f0.1) add (2)     gMSGSRC.0<1>:d  gMVX_INT<2;2,1>:w                               -0x02:d //{NoDDClr}
  124.     (-f0.1) mov (1)     gMSGSRC.2:ud    0x000c000c:ud                                                   //{NoDDChk}
  125.     (f0.1) add (1)      gMSGSRC.0<1>:d  gMVX_INT<0;1,0>:w                               -0x02:d //{NoDDClr}
  126.         (f0.1) mov (1)  gMSGSRC.1<1>:d  gMVY_INT<0;1,0>:w                                               //{NoDDChk,NoDDClr}
  127.     (f0.1) mov (1)      gMSGSRC.2:ud    0x0007000c:ud                                                   //{NoDDChk}
  128.  
  129.     // Read 16x13 pixels
  130.     send (8)    gudREF(0)<1>            mMSGHDRY                                                gMSGSRC<8;8,1>:ud       DAPREAD pMSGDSC:ud
  131. #endif
  132.    
  133. #else  
  134.  
  135.         // Compute integer and fractional components of MV
  136.     and (2)             gMVX_FRAC<1>:w          r[pMV,0]<2;2,1>:w                               0x03:w  {NoDDClr} //
  137.     asr (2)             gMVX_INT<1>:w           r[pMV,0]<2;2,1>:w                               0x02:w  {NoDDChk} //
  138.    
  139.     // Set message descriptor
  140. #ifdef DEV_ILK
  141.     add (1)             pMSGDSC:ud                      gMSGDSC_R:ud                                    0x00700000:ud
  142. #else
  143.     add (1)             pMSGDSC:ud                      gMSGDSC_R:ud                                    0x00070000:ud
  144. #endif  // DEV_ILK
  145.    
  146.         // Compute top-left corner position to be loaded
  147.     add (2)             gMSGSRC.0<1>:d          gMVX_INT<2;2,1>:w                               -0x02:d {NoDDClr} //
  148.     mov (1)             gMSGSRC.2:ud            0x000c000c:ud                                                   {NoDDChk} //
  149.  
  150.     // Read 16x13 pixels
  151.     send (8)    gudREF(0)<1>        mMSGHDRY                                            gMSGSRC<8;8,1>:ud       DAPREAD pMSGDSC:ud
  152.    
  153. #endif
  154.  
  155. INTERLABEL(EXIT_LOADREF_Y_16x13):
  156.  
  157. //#endif        // !defined(__LOADREF_Y_16x13__)
  158.