Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Initialize parameters
  3.  * Copyright © <2010>, Intel Corporation.
  4.  *
  5.  * This program is licensed under the terms and conditions of the
  6.  * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
  7.  * http://www.opensource.org/licenses/eclipse-1.0.php.
  8.  *
  9.  */
  10. // Kernel name: Initialize_MBPara.asm
  11. //
  12.  
  13.  
  14. //#if !defined(__INITIALIZE_MBPARA__)           // Make sure this is only included once
  15. //#define __INITIALIZE_MBPARA__
  16.  
  17.  
  18. // WA for weighted prediction - 2007/09/06              // shlee
  19. //      mov (1)         guwW128(0)<1>                   guwR1(0)<0;1,0>         // Copy the unique number indicating weight/offset=(128,0)
  20.  
  21.  
  22.  
  23. //      MB Type         Category
  24. //      1                       B_L0_16x16
  25. //      2                       B_L1_16x16
  26. //      3                       B_Bi_16x16
  27. //      4                       B_L0_L0_16x8
  28. //      5                       B_L0_L0_8x16
  29. //      6                       B_L1_L1_16x8
  30. //      7                       B_L1_L1_8x16
  31. //      8                       B_L0_L1_16x8
  32. //      9                       B_L0_L1_8x16
  33. //      10                      B_L1_L0_16x8
  34. //      11                      B_L1_L0_8x16
  35. //      12                      B_L0_Bi_16x8
  36. //      13                      B_L0_Bi_8x16
  37. //      14                      B_L1_Bi_16x8
  38. //      15                      B_L1_Bi_8x16
  39. //      16                      B_Bi_L0_16x8
  40. //      17                      B_Bi_L0_8x16
  41. //      18                      B_Bi_L1_16x8
  42. //      19                      B_Bi_L1_8x16
  43. //      20                      B_Bi_Bi_16x8
  44. //      21                      B_Bi_Bi_8x16
  45. //      22                      B_8x8
  46.  
  47.         // TODO:
  48.         // Initialize interpolation area to eliminate uninitialized registers making the results of mac instructions XX.
  49.         // This issue was reported by Sharath on 5/25/2006, and why multiplication by zero still yields XX has not been understood yet.
  50. #if 0
  51.         mov (16)        gudINTPY0(0)<1>         0:ud    {Compr}
  52.         mov (16)        gudINTPY0(2)<1>         0:ud    {Compr}
  53.         mov (16)        gudINTPY1(0)<1>         0:ud    {Compr}
  54.         mov (16)        gudINTPY1(2)<1>         0:ud    {Compr}
  55.         mov (16)        gudINTPC0(0)<1>         0:ud    {Compr}
  56.         mov (16)        gudINTPC1(0)<1>         0:ud    {Compr}
  57. #endif
  58.  
  59.         mov (1)         gMVSTEP:w                       0:w                                                             // Address increament for MV read
  60.  
  61.         cmp.e.f0.0 (1) null:w                   gwMBTYPE<0;1,0>                                 22:w
  62.         (-f0.0)         jmpi                            INTERLABEL(NOT_8x8_MODE)
  63.  
  64.         //--- 8x8 mode
  65.                
  66.         // Starting address of error data blocks
  67.         cmp.e.f0.1 (2) null<1>:w                gSUBMB_SHAPE<0;1,0>:ub                  0:w
  68.         (f0.1) jmpi INTERLABEL(CONVERT_MVS)
  69.  
  70.         // Note: MVs and Weights/Offsets are already expanded by HW or driver
  71.        
  72.         // MV conversion - Convert each MV to absolute coord. (= MV + MB org. + block offset)
  73.         shl (16)        gwTEMP(0)<1>            gX<0;2,1>:w                                             2:w // Convert MB origin to 1/4-pel unit
  74.         mov (1)         gMVSTEP:w                       24:w                                                    // Address increament for MV read
  75.         add (2)         gwTEMP(0,4)<2>          gwTEMP(0,4)<4;2,2>                              16:w
  76.         add (2)         gwTEMP(0,9)<2>          gwTEMP(0,9)<4;2,2>                              16:w
  77.         add (4)         gwTEMP(0,12)<1>         gwTEMP(0,12)<4;4,1>                             16:w
  78.        
  79.         add (16)        gMV<1>:w                        gMV<16;16,1>:w                                  gwTEMP(0)<16;16,1>
  80.         add (8)         gwTEMP(0)<2>            gwTEMP(0)<16;8,2>                               32:w
  81.         add (16)        gwMV(1,0)<1>            gwMV(1,0)<16;16,1>                              gwTEMP(0)<16;16,1>     
  82.         add (8)         gwTEMP(0,1)<2>          gwTEMP(0,1)<16;8,2>                             32:w
  83.         add (16)        gwMV(3,0)<1>            gwMV(3,0)<16;16,1>                              gwTEMP(0)<16;16,1>     
  84.         add (8)         gwTEMP(0)<2>            gwTEMP(0)<16;8,2>                               -32:w
  85.         add (16)        gwMV(2,0)<1>            gwMV(2,0)<16;16,1>                              gwTEMP(0)<16;16,1>     
  86.  
  87.         jmpi INTERLABEL(INIT_ADDRESS_REGS)
  88.  
  89. INTERLABEL(NOT_8x8_MODE):
  90.  
  91.         //--- !8x8 mode (16x16, 16x8, 8x16)
  92.  
  93.         // MVs and Weights/Offsets are expanded
  94.         cmp.le.f0.1 (8) null<1>:w               gwMBTYPE<0;1,0>                                 3:w // Check 16x16
  95.         mov (1)         gSUBMB_SHAPE:ub         0:uw                                                    // subMB shape
  96.         (f0.1) mov (8)  gMV<1>:d                gMV<0;2,1>:d                                   
  97.         (f0.1) mov (8)  gdWGT(1,0)<1>   gWGT<0;4,1>:d                                  
  98.         (f0.1) mov (4)  gdWGT(0,4)<1>   gWGT<4;4,1>:d                                  
  99.        
  100. INTERLABEL(CONVERT_MVS):
  101.         // MV conversion - Convert each MV to absolute coord. (= MV + MB org. + block offset)
  102.         shl (2)         gwTEMP(0)<1>            gX<2;2,1>:w                                             2:w // Convert MB origin to 1/4-pel unit
  103.         add (16)        gMV<1>:w                        gMV<16;16,1>:w                                  gwTEMP(0)<0;2,1>
  104.         add (2)         gwMV(0,4)<2>            gwMV(0,4)<4;2,2>                                32:w    //{NoDDClr}
  105.         add (2)         gwMV(0,9)<2>            gwMV(0,9)<4;2,2>                                32:w    //{NoDDChk,NoDDClr}
  106.         add (4)         gwMV(0,12)<1>           gwMV(0,12)<4;4,1>                               32:w    //{NoDDChk}
  107.                
  108. INTERLABEL(INIT_ADDRESS_REGS):
  109.         // Initialize the address registers
  110.         mov (2)         pERRORYC:ud                     nOFFSET_ERROR:ud                                {NoDDClr} // Address of Y and C error blocks
  111.         mov (1)         pRECON_MV:ud            nOFFSET_RECON_MV:ud                             {NoDDChk,NoDDClr} // Address of recon area and motion vectors
  112.         mov (1)         pWGT_BIDX:ud            nOFFSET_WGT_BIDX:ud                             {NoDDChk} // Address of weights/offsets and binding tbl idx
  113.        
  114.         // Read the parity of the current field (gPARITY - 0:top, 1:bottom, 3:frame)
  115.         // and set message descriptor for frame/field write
  116. #if defined(MBAFF)
  117.         and.nz.f0.0 (1) null:uw                 gFIELDMBFLAG:ub                                 nFIELDMB_MASK:uw
  118.         (f0.0) and (1)  gPARITY:uw              gMBPARITY:ub                                    nMBPARITY_MASK:uw
  119.         (-f0.0) mov (1) gPARITY:uw              3:uw
  120. #elif defined(FIELD)
  121.         and (1)         gPARITY:uw                      gMBPARITY:ub                                    nMBPARITY_MASK:uw
  122. #endif
  123.        
  124.        
  125. //#endif        // !defined(__INITIALIZE_MBPARA__)
  126.