Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * All Video Processing kernels
  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.  
  11. /////////////////////////////////////////////////////////////////////////////////
  12. // Multiple_Loop.asm
  13.  
  14.  
  15. // This lable is for satisfying component kernel build.
  16. // DL will remove this label and reference the real one in Multiple_Loop_Head.asm.
  17. #if defined(COMPONENT)
  18. VIDEO_PROCESSING_LOOP:
  19. #endif
  20.  
  21.  
  22. //===== Possible build flags for component kernels
  23. // 1) INC_SCALING
  24. // 2) INC_BLENDING
  25. // 3) INC_BLENDING and INC_SCALING
  26. // 4) (no flags)
  27.  
  28.  
  29. #define MxN_MULTIPLE_BLOCKS
  30.  
  31. //------------------------------------------------------------------------------
  32. #if defined(MxN_MULTIPLE_BLOCKS)
  33. // Do Multiple Block Processing ------------------------------------------------
  34.  
  35.         // The 1st block has been processed before entering the loop
  36.  
  37.         // Processed all blocks?
  38.         add.z.f0.0      (1)     wNUM_BLKS:w     wNUM_BLKS:w     -1:w
  39.  
  40.         // Reached multi-block width?
  41.         add                     (1)     wORIX:w         wORIX:w         16:w
  42.         cmp.l.f0.1      (1)     null:w          wORIX:w wFRAME_ENDX:w   // acc0.0 has wORIX
  43.  
  44.         #if defined(INC_SCALING)
  45.         // Update SRC_VID_H_ORI for scaling
  46.                 mul     (1)     REG(r,nTEMP0):f         fVIDEO_STEP_X:f         16.0:f
  47.                 add     (1)     fSRC_VID_H_ORI:f        REG(r,nTEMP0):f         fSRC_VID_H_ORI:f
  48.         #endif
  49.  
  50.         #if defined(INC_BLENDING)
  51.         // Update SRC_ALPHA_H_ORI for blending
  52.                 mul     (1)     REG(r,nTEMP0):f         fALPHA_STEP_X:f         16.0:f
  53.                 add     (1)     fSRC_ALPHA_H_ORI:f      REG(r,nTEMP0):f         fSRC_ALPHA_H_ORI:f
  54.         #endif
  55.  
  56.         (f0.0)jmpi      (1)     END_VIDEO_PROCESSING    // All blocks are done - Exit loop
  57.  
  58.     // blocks in the middle of the loop (neither the first nor the last one)?
  59.     // it may be on the left edge (Mx1) or not (1xN)
  60.     mov (1) uwBLOCK_MASK_H<1>:uw            uwBLOCK_MASK_H_MIDDLE:uw
  61.  
  62.     // the last block?
  63.     cmp.e.f0.0  (1) null:w      wNUM_BLKS:w     1:w
  64.     (f0.0)  mov (1) uwBLOCK_MASK_H<1>:uw  uwBLOCK_MASK_H_RIGHT:uw
  65.     (f0.0)  mov (1) ubBLOCK_MASK_V<1>:ub  ubBLOCK_MASK_V_BOTTOM:ub
  66.    
  67.         (f0.1)jmpi      (1)     VIDEO_PROCESSING_LOOP   // If not the end of row, goto the beginning of the loop
  68.  
  69.         //If end of row, restart Horizontal offset and calculate Vertical offsets next row.
  70.         mov     (1)             wORIX:w         wCOPY_ORIX:w
  71.         add     (1)             wORIY:w         wORIY:w                 8:w
  72.  
  73.         #if defined(INC_SCALING)
  74.         // Update SRC_VID_H_ORI and SRC_VID_V_ORI for scaling
  75.                 mov     (1)             fSRC_VID_H_ORI:f        fFRAME_VID_ORIX:f       // Reset normalised X origin to 0 for video and alpha
  76.                 mul     (1)             REG(r,nTEMP0):f         fVIDEO_STEP_Y:f         8.0:f
  77.                 add     (1)             fSRC_VID_V_ORI:f        REG(r,nTEMP0):f         fSRC_VID_V_ORI:f
  78.         #endif
  79.  
  80.         #if defined(INC_BLENDING)
  81.         // Update SRC_ALPHA_H_ORI and SRC_ALPHA_V_ORI for blending
  82.                 mov     (1)             fSRC_ALPHA_H_ORI:f      fFRAME_ALPHA_ORIX:f     // Reset normalised X origin to 0 for video and alpha
  83.                 mul     (1)             REG(r,nTEMP0):f         fALPHA_STEP_Y:f         8.0:f
  84.                 add     (1)             fSRC_ALPHA_V_ORI:f      REG(r,nTEMP0):f         fSRC_ALPHA_V_ORI:f
  85.         #endif
  86.  
  87.         jmpi (1)        VIDEO_PROCESSING_LOOP   // Continue Loop
  88.  
  89. END_VIDEO_PROCESSING:
  90.         nop
  91.  
  92. #endif
  93. END_THREAD      // End of Thread
  94.