Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright © <2010>, Intel Corporation.
  3.  *
  4.  * This program is licensed under the terms and conditions of the
  5.  * Eclipse Public License (EPL), version 1.0.  The full text of the EPL is at
  6.  * http://www.opensource.org/licenses/eclipse-1.0.php.
  7.  *
  8.  */
  9. ////////// AVC LDB filter vertical UV ///////////////////////////////////////////////////////
  10. //
  11. //      This filter code prepares the src data and control data for ILDB filtering on all vertical edges of UV.
  12. //
  13. //      It sssumes the data for vertical de-blocking is already transposed.  
  14. //
  15. //              Chroma:
  16. //
  17. //              +-------+-------+
  18. //              |               |               |
  19. //              |               |               |
  20. //              |               |               |
  21. //              +-------+-------+
  22. //              |               |               |
  23. //              |               |               |
  24. //              |               |               |
  25. //              +-------+-------+
  26. //
  27. //              V0              V1             
  28. //              Edge    Edge   
  29. //
  30. /////////////////////////////////////////////////////////////////////////////
  31.  
  32. #if defined(_DEBUG)
  33.         mov             (1)             EntrySignatureC:w                       0xBBBC:w
  34. #endif 
  35.  
  36. //=============== Chroma deblocking ================
  37.  
  38.         and.z.f0.0  (1) null:w          r[ECM_AddrReg, BitFlags]:ub             FilterLeftMbEdgeFlag:w          // Check for FilterLeftMbEdgeFlag
  39. //    (f0.0)    jmpi    BYPASS_EXT_LEFT_EDGE_UV
  40.  
  41.         // Get vertical border edge control data.  
  42.        
  43.         // Get Luma maskA and maskB    
  44.         shr (16)        TempRow0(0)<1>          r[ECM_AddrReg, wEdgeCntlMapA_ExtLeftVert0]<0;1,0>:uw            RRampW(0)
  45.         shr (16)        TempRow1(0)<1>          r[ECM_AddrReg, wEdgeCntlMapB_ExtLeftVert0]<0;1,0>:uw            RRampW(0)
  46.        
  47.     (f0.0)      jmpi    ILDB_LABEL(BYPASS_EXT_LEFT_EDGE_UV)
  48.  
  49.         // Extract UV MaskA and MaskB from every other bit of Y masks
  50.         and.nz.f0.0 (8) null:w                  TempRow0(0)<16;8,2>             1:w
  51.         and.nz.f0.1 (8) null:w                  TempRow1(0)<16;8,2>             1:w
  52.  
  53. //---------- Deblock U external edge ----------
  54.         //      p1 = Prev MB U row 0
  55.         //      p0 = Prev MB U row 1
  56.         //      q0 = Cur MB U row 0
  57.         //      q1 = Cur MB U row 1
  58.         mov (1) P_AddrReg:w             PREV_MB_U_BASE:w                                                                        { NoDDClr }
  59.         mov (1) Q_AddrReg:w             SRC_MB_U_BASE:w                                                                         { NoDDChk }
  60.  
  61.         // alpha = bAlphaLeft0_Cb, beta = bBetaLeft0_Cb
  62.         mov     (2)     alpha<1>:w      r[ECM_AddrReg, bAlphaLeft0_Cb]<2;2,1>:ub                                { NoDDClr }
  63.         // tc0 has bTc0_v30_0_Cb + bTc0_v20_0_Cb + bTc0_v10_0_Cb + bTc0_v00_0_Cb
  64.         mov (4) tc0<1>:ub       r[ECM_AddrReg, bTc0_v00_0_Cb]<4;4,1>:ub                                 { NoDDChk }
  65.        
  66.         // UV MaskA and MaskB
  67.         mov (2)         MaskA<1>:uw                     f0.0<2;2,1>:uw
  68.  
  69.         CALL(FILTER_UV, 1)     
  70.  
  71. //---------- Deblock V external edge ----------
  72.         //      p1 = Prev MB V row 0
  73.         //      p0 = Prev MB V row 1
  74.         //      q0 = Cur MB V row 0
  75.         //      q1 = Cur MB V row 1
  76.         mov (1) P_AddrReg:w             PREV_MB_V_BASE:w                                                                        { NoDDClr }            
  77.         mov (1) Q_AddrReg:w             SRC_MB_V_BASE:w                                                                         { NoDDChk }
  78.  
  79.         // for vert edge: alpha = bAlphaLeft0_Cr, beta = bBetaLeft0_Cr
  80.         mov     (2)     alpha<1>:w      r[ECM_AddrReg, bAlphaLeft0_Cr]<2;2,1>:ub                                { NoDDClr }
  81.        
  82.         // tc0 has bTc0_v30_0_Cr + bTc0_v20_0_Cr + bTc0_v10_0_Cr + bTc0_v00_0_Cr
  83.         mov (4) tc0<1>:ub       r[ECM_AddrReg, bTc0_v00_0_Cr]<4;4,1>:ub                                 { NoDDChk }
  84.  
  85.         // UV MaskA and MaskB
  86.         mov (2)         f0.0<1>:uw              MaskA<2;2,1>:uw
  87.  
  88.         CALL(FILTER_UV, 1)     
  89.  
  90.  
  91. ILDB_LABEL(BYPASS_EXT_LEFT_EDGE_UV):
  92.         // Set EdgeCntlMap2 = 0, so it always uses bS < 4 algorithm.
  93.         // Same alpha and beta for all internal vert and horiz edges
  94.  
  95.  
  96.         //***** Need to take every other bit to form U or V maskA
  97.         // Get Luma maskA and maskB    
  98.         shr (16)        TempRow0(0)<1>          r[ECM_AddrReg, wEdgeCntlMap_IntMidVert]<0;1,0>:uw               RRampW(0)
  99.  
  100. //---------- Deblock U internal edge ----------
  101.         //      p1 = Cur MB U row 2
  102.         //      p0 = Cur MB U row 3
  103.         //      q0 = Cur MB U row 4
  104.         //      q1 = Cur MB U row 5
  105.         mov (1) P_AddrReg:w             4*UV_ROW_WIDTH+SRC_MB_U_BASE:w                                  { NoDDClr }
  106.         mov (1) Q_AddrReg:w             8*UV_ROW_WIDTH+SRC_MB_U_BASE:w                                  { NoDDChk }
  107.  
  108.         // alpha = bAlphaInternal_Cb, beta = bBetaInternal_Cb
  109.         mov     (2)     alpha<1>:w      r[ECM_AddrReg, bAlphaInternal_Cb]<2;2,1>:ub             { NoDDClr }
  110.  
  111.         // tc0 has bTc0_v32_Cb + bTc0_v22_Cb + bTc0_v12_Cb + bTc0_v02_Cb       
  112.         mov (4) tc0<1>:ub       r[ECM_AddrReg, bTc0_v02_Cb]<4;4,1>:ub                           { NoDDChk }
  113.  
  114.         // Extract UV MaskA and MaskB from every other bit of Y masks
  115.         and.nz.f0.0 (8) null:w                  TempRow0(0)<16;8,2>             1:w
  116.  
  117.         // UV MaskA and MaskB
  118.         mov (1) f0.1:uw         0:w
  119.         mov (1) MaskB:uw        0:w                                                                                                     { NoDDClr }
  120.         mov (1) MaskA:uw        f0.0:uw                                                                                         { NoDDChk }
  121.        
  122.         CALL(FILTER_UV, 1)     
  123.  
  124.  
  125. //---------- Deblock V internal edge ----------
  126.         //      P1 = Cur MB V row 2
  127.         //      P0 = Cur MB V row 3
  128.         //      Q0 = Cur MB V row 4
  129.         //      Q1 = Cur MB V row 5
  130.         mov (1) P_AddrReg:w             4*UV_ROW_WIDTH+SRC_MB_V_BASE:w                                  { NoDDClr }
  131.         mov (1) Q_AddrReg:w             8*UV_ROW_WIDTH+SRC_MB_V_BASE:w                                  { NoDDChk }
  132.  
  133.         // alpha = bAlphaInternal_Cr, beta = bBetaInternal_Cr
  134.         mov     (2)     alpha<1>:w      r[ECM_AddrReg, bAlphaInternal_Cr]<2;2,1>:ub             { NoDDClr }    
  135.  
  136.         // tc0 has bTc0_v32_Cr + bTc0_v22_Cr + bTc0_v12_Cr + bTc0_v02_Cr       
  137.         mov (4) tc0<1>:ub       r[ECM_AddrReg, bTc0_v02_Cr]<4;4,1>:ub                           { NoDDChk }
  138.  
  139.         // UV MaskA and MaskB
  140.         mov (2)         f0.0<1>:uw              MaskA<2;2,1>:uw
  141.  
  142.         CALL(FILTER_UV, 1)     
  143.  
  144.  
  145. //BYPASS_4x4_DEBLOCK_V:
  146.