Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Load all reference U/V samples from neighboring macroblocks
  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. #if !defined(__LOAD_INTRA_REF_UV__)             // Make sure this is only included once
  11. #define __LOAD_INTRA_REF_UV__
  12.  
  13. // Module name: load_Intra_Ref_UV.asm
  14. //
  15. // Load all reference U/V samples from neighboring macroblocks
  16. //
  17. // Note: Since loading of U/V data always follows writing of Y, the message descriptor is manipulated
  18. // to avoid recalculating due to frame/field variztions.
  19.  
  20. // First load top 20x1 row U/V reference samples
  21. // 4 from macroblock D (actually use 2), 16 from macroblock B
  22. //
  23.     shr (1)     I_ORIY<1>:w             I_ORIY<0;1,0>:w 1:w             // Adjust I_ORIY for NV12 format
  24.     add (2)     MSGSRC.0<1>:d   I_ORIX<2;2,1>:w TOP_REF_OFFSET<2;2,1>:b {NoDDClr}       // Reference samples positioned at (-4, -1)
  25.     mov (1)     MSGSRC.2:ud             0x00000013:ud {NoDDChk}                 // Block width and height (20x1)
  26.  
  27. //  Update message descriptor based on previous Y block write
  28. //
  29. #ifdef DEV_ILK
  30.     add (1)     MSGDSC  MSGDSC  RESP_LEN(1)+DWBRMSGDSC_RC+DESTUV-DWBWMSGDSC_WC-0x10000000-DESTY:ud  // Set message descriptor
  31. #else
  32.     add (1)     MSGDSC  MSGDSC  RESP_LEN(1)+DWBRMSGDSC_RC+DESTUV-DWBWMSGDSC_WC-0x00800000-DESTY:ud  // Set message descriptor
  33. #endif  // DEV_ILK
  34.  
  35.     send (8)    INTRA_REF_TOP_D(0)      MSGHDR  MSGSRC<8;8,1>:ud        DAPREAD MSGDSC
  36.  
  37. // Then load left 4x8 reference samples (actually use 1x8 column)
  38. //
  39.     add (1)     MSGSRC.1<1>:d   MSGSRC.1<0;1,0>:d       1:w {NoDDClr}   // Reference samples positioned next row
  40.     mov (1)     MSGSRC.2:ud             0x00070003:ud {NoDDChk}                 // Block width and height (4x8)
  41.     send (8)    INTRA_REF_LEFT_D(0)     MSGHDRUV        MSGSRC<8;8,1>:ud        DAPREAD MSGDSC
  42.  
  43. // End of load_Intra_Ref_UV
  44. #endif  // !defined(__LOAD_INTRA_REF_UV__)
  45.