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. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  10. // AVC Child Kernel (Vertical and horizontal de-block a 4:2:0 MB Y comp)
  11. //
  12. // First, de-block vertical edges from left to right.
  13. // Second, de-block horizontal edge from top to bottom.
  14. //
  15. // If transform_size_8x8_flag = 1, luma is de-blocked at 8x8.  Otherwise, luma is de-blocked at 4x4.
  16. //
  17. //////////////////////////////////////////////////////////////////////////////////////////////////////////////
  18. #define AVC_ILDB
  19.  
  20. .kernel AVC_ILDB_CHILD_Y
  21. #if defined(COMBINED_KERNEL)
  22. ILDB_LABEL(AVC_ILDB_CHILD_Y):
  23. #endif
  24.  
  25. #include "SetupVPKernel.asm"
  26. #include "AVC_ILDB.inc"
  27.  
  28. #if defined(_DEBUG)
  29.         mov             (1)             EntrySignatureC:w                       0x9998:w
  30. #endif
  31.  
  32.         // Init local variables
  33.         shl (8)         ORIX_CUR<1>:w           ORIX<0;2,1>:w           4:w             // Expand addr to bytes, repeat (x,y) 4 times
  34.  
  35.         // Init addr register for vertical control data
  36.         mov (1)         ECM_AddrReg<1>:w        CNTRL_DATA_BASE:w                       // Init edge control map AddrReg
  37.  
  38.         //=== Null Kernel ===============================================================
  39. //      jmpi ILDB_LABEL(POST_ILDB_Y)
  40.         //===============================================================================
  41.  
  42.         mul     (1)             URBOffsetC:uw   ORIY:uw         4:w    
  43.        
  44. #if !defined(DEV_CL)   
  45.         //====================================================================================
  46.         // For BearLake-C, 64 bytes are stored in memory and dataport expands to 256 bytes.  Need to use a special read command on BL-C.
  47.         // MB_offset = MBsCntX * CurRow + CurCol
  48.         // MBCntrlDataOffsetY = globel_byte_offset = MB_offset * 64
  49.         mul (1) CntrlDataOffsetY:ud             MBsCntX:w                               ORIY:w
  50.         add (1) CntrlDataOffsetY:ud             CntrlDataOffsetY:ud             ORIX:w
  51.                
  52.         // Assign to MSGSRC.2:ud for memory access
  53.         // mul (1) CntrlDataOffsetY:ud          CntrlDataOffsetY:ud             64:uw
  54.         mul (1) MSGSRC.2:ud             CntrlDataOffsetY:ud             64:uw          
  55.        
  56. #endif
  57.  
  58.         // Load current MB control data
  59. #if defined(DEV_CL)
  60.         #if defined(_APPLE)
  61.                 #include "Load_ILDB_Cntrl_Data_22DW.asm"        // Crestline for Apple, progressive only
  62.         #else
  63.                 #include "Load_ILDB_Cntrl_Data_64DW.asm"        // Crestline
  64.         #endif 
  65. #else
  66.         #include "Load_ILDB_Cntrl_Data_16DW.asm"        // Cantiga and beyond
  67. #endif
  68.  
  69.         // Check loaded control data
  70.         #if defined(_APPLE)
  71.                 and.z.f0.1  (8) null<1>:uw      r[ECM_AddrReg, wEdgeCntlMap_IntLeftVert]<8;8,1>:uw              0xFFFF:uw               // Skip ILDB?
  72.                 (f0.1) and.z.f0.1 (2) null<1>:uw        r[ECM_AddrReg, wEdgeCntlMapA_ExtTopHorz0]<2;2,1>:uw             0xFFFF:uw               // Skip ILDB?
  73.         #else
  74.                 and.z.f0.1  (16) null<1>:uw     r[ECM_AddrReg, wEdgeCntlMap_IntLeftVert]<16;16,1>:uw    0xFFFF:uw               // Skip ILDB?          
  75.         #endif 
  76.  
  77.         and.nz.f0.0  (1) null:w         r[ECM_AddrReg, ExtBitFlags]:ub          DISABLE_ILDB_FLAG:w             // Skip ILDB?
  78.  
  79.         // Use free cycles here
  80.         add (1)         ORIX_LEFT:w                     ORIX_LEFT:w                     -4:w
  81. //      add (1)         ORIY_TOP:w                      ORIY_TOP:w                      -4:w
  82.         mov     (1)             GateWayOffsetC:uw       ORIY:uw                                         // Use row # as Gateway offset
  83.  
  84.         #if defined(_APPLE)
  85.                 (f0.1.all8h)    jmpi    ILDB_LABEL(READ_FOR_URB_Y)                              // Skip ILDB
  86.         #else
  87.                 (f0.1.all16h)   jmpi    ILDB_LABEL(READ_FOR_URB_Y)                              // Skip ILDB
  88.         #endif
  89.  
  90.         (f0.0)                  jmpi    ILDB_LABEL(READ_FOR_URB_Y)                                      // Skip ILDB
  91.  
  92.         add (1)         ORIY_TOP:w                      ORIY_TOP:w                      -4:w
  93.  
  94.         // Bettr performance is observed if boundary MBs are not checked and skipped.
  95.        
  96.         #include "load_Cur_Y_16x16T.asm"                                // Load cur MB Y, 16x16, transpose
  97. //      #include "load_Left_Y_4x16T.asm"                                // Load left MB (4x16) Y data from memory
  98.         #include "load_Top_Y_16x4.asm"                                  // Load top MB (16x4) Y data from memory
  99.  
  100.         #include "Transpose_Cur_Y_16x16.asm"
  101. //      #include "Transpose_Left_Y_4x16.asm"
  102.  
  103.         //---------- Perform vertical ILDB filting on Y ---------
  104.         #include "AVC_ILDB_Filter_Y_v.asm"     
  105.         //-------------------------------------------------------
  106.  
  107.         #include "save_Left_Y_16x4T.asm"                                // Write left MB (4x16) Y data to memory
  108.         #include "Transpose_Cur_Y_16x16.asm"                    // Transpose a MB for horizontal edge de-blocking
  109.  
  110.         //---------- Perform horizontal ILDB filting on Y -------
  111.         #include "AVC_ILDB_Filter_Y_h.asm"     
  112.         //-------------------------------------------------------
  113.  
  114.         #include "save_Cur_Y_16x16.asm"                                 // Write cur MB (16x16)
  115.         #include "save_Top_Y_16x4.asm"                                  // Write top MB (16x4)
  116.  
  117.         //---------- Write right most 4 columns of cur MB to URB ----------
  118.         // Transpose the right most 4 cols 4x16 in GRF to 16x4 in LEFT_TEMP_B.  It is 4 left most cols in cur MB.      
  119.         #include "Transpose_Cur_Y_4x16.asm"                                            
  120.        
  121. ILDB_LABEL(WRITE_URB_Y):
  122.         // Note: LEFT_TEMP_B(2) = TOP_TEMP_B(0), TOP_TEMP_B must be avail
  123.         mov (16)        m1<1>:ud                LEFT_TEMP_D(2)<8;8,1>           // Copy 2 GRFs to 2 URB entries (Y)
  124.        
  125.         #include "writeURB_Y_Child.asm"
  126.         //-----------------------------------------------------------------
  127.  
  128.         //=========== Check write commit of the last write ============
  129.     mov (8)     WritebackResponse(0)<1>         WritebackResponse(0)   
  130.  
  131. ILDB_LABEL(POST_ILDB_Y):
  132.         // Send notification thru Gateway to root thread, update luma Status[CurRow]
  133.         #include "AVC_ILDB_ForwardMsg.asm"     
  134.  
  135. #if !defined(GW_DCN)            // For non-ILK chipsets
  136.         //child send EOT : Request type = 1
  137.         END_CHILD_THREAD
  138. #endif  // !defined(DEV_ILK)
  139.        
  140.         // The thread finishs here
  141.         //------------------------------------------------------------------------------
  142.  
  143. ILDB_LABEL(READ_FOR_URB_Y):
  144.         // Still need to prepare URB data for the right neighbor MB
  145.         #include "load_Cur_Y_Right_Most_4x16.asm"               // Load cur MB ( right most 4x16) Y data from memory
  146.         #include "Transpose_Cur_Y_Right_Most_4x16.asm"                                         
  147. //      jmpi ILDB_LABEL(WRITE_URB_Y)
  148.  
  149.         // Note: LEFT_TEMP_B(2) = TOP_TEMP_B(0), TOP_TEMP_B must be avail
  150.         mov (16)        m1<1>:ud                LEFT_TEMP_D(2)<8;8,1>           // Copy 2 GRFs to 2 URB entries (Y)
  151.        
  152.         #include "writeURB_Y_Child.asm"
  153.         //-----------------------------------------------------------------
  154.  
  155.         // Send notification thru Gateway to root thread, update luma Status[CurRow]
  156.         #include "AVC_ILDB_ForwardMsg.asm"     
  157.  
  158. #if !defined(GW_DCN)            // For non-ILK chipsets
  159.         //child send EOT : Request type = 1
  160.         END_CHILD_THREAD
  161. #endif  // !defined(DEV_ILK)
  162.        
  163.         // The thread finishs here
  164.         //------------------------------------------------------------------------------
  165.        
  166.         ////////////////////////////////////////////////////////////////////////////////
  167.         // Include other subrutines being called
  168.         #include "AVC_ILDB_Luma_Core.asm"
  169. //      #include "AVC_ILDB_Chroma_Core.asm"
  170.  
  171.        
  172. #if !defined(COMBINED_KERNEL)           // For standalone kernel only
  173. .end_code
  174.  
  175. .end_kernel
  176. #endif
  177.