Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

174 lines
6.4 KiB

  1. ;/* *************************************************************************
  2. ;** INTEL Corporation Proprietary Information
  3. ;**
  4. ;** This listing is supplied under the terms of a license
  5. ;** agreement with INTEL Corporation and may not be copied
  6. ;** nor disclosed except in accordance with the terms of
  7. ;** that agreement.
  8. ;**
  9. ;** Copyright (c) 1995 Intel Corporation.
  10. ;** All Rights Reserved.
  11. ;**
  12. ;** *************************************************************************
  13. ;*/
  14. ;////////////////////////////////////////////////////////////////////////////
  15. ;//
  16. ;// $Header: R:\h26x\h26x\src\enc\e3mbad.inv 1.10 04 Oct 1996 08:47:58 BNICKERS $
  17. ;// $Log: R:\h26x\h26x\src\enc\e3mbad.inv $
  18. ;//
  19. ;// Rev 1.10 04 Oct 1996 08:47:58 BNICKERS
  20. ;// Add EMV.
  21. ;//
  22. ;// Rev 1.9 14 May 1996 12:18:46 BNICKERS
  23. ;// Initial debugging of MMx B-Frame ME.
  24. ;//
  25. ;// Rev 1.8 02 May 1996 13:41:08 BNICKERS
  26. ;// started integration of MMX PB-frames
  27. ;//
  28. ;// Rev 1.7 22 Feb 1996 15:02:38 BNICKERS
  29. ;// Add unionized field for MMx implementation.
  30. ;//
  31. ;// Rev 1.6 22 Jan 1996 17:13:44 BNICKERS
  32. ;// Add MBEdgeType to MacroBlock Action Descriptor.
  33. ;//
  34. ;// Rev 1.5 27 Dec 1995 15:33:00 RMCKENZX
  35. ;// Added copyright notice
  36. ;//
  37. ;////////////////////////////////////////////////////////////////////////////
  38. IFDEF _ENDMBAD_INC_
  39. ELSE
  40. _ENDMBAD_INC = 1
  41. ;
  42. ; Fields for MacroBlock Action Stream Descriptors for the H26x encoder.
  43. ;
  44. T_Blk STRUCT
  45. BlkOffset DWORD ? ; 0 -- Offset from upper left viewable pel of Y
  46. ; plane to upper left pel of block.
  47. UNION
  48. PastRef DWORD ? ; 4 -- Addr of 8*8 reference block, passed from
  49. ; P-Frame ME to P-Frame frame differencing.
  50. STRUCT
  51. CandidateHMVf BYTE ? ; 4 -- Scratch area for figuring BestHMVf values.
  52. CandidateVMVf BYTE ? ; 5 -- Must be 4 bytes after Best...
  53. CandidateHMVb BYTE ? ; 6
  54. CandidateVMVb BYTE ? ; 7
  55. ENDS
  56. CandidateBiDiMVs DWORD ? ; 4
  57. ENDS
  58. UNION
  59. STRUCT
  60. BestHMVf BYTE ? ; 8 -- "Real" MVs for B-Frame block, passed from
  61. BestVMVf BYTE ? ; 9 -- B-Frame ME to P-Frame frame differencing.
  62. BestHMVb BYTE ? ; 10 -- (Biased by 060H)
  63. BestVMVb BYTE ? ; 11
  64. ENDS
  65. BestBiDiMVs DWORD ? ; 8
  66. ENDS
  67. UNION
  68. STRUCT
  69. PHMV BYTE ? ; 12 -- Horz motion vector for P frame ref blk.
  70. PVMV BYTE ? ; 13 -- Vert motion vector for P frame ref blk.
  71. BHMV BYTE ? ; 14 -- Horz motion vector adjustment for B frm.
  72. BVMV BYTE ? ; 15 -- Vert motion vector adjustment for B frame.
  73. ENDS
  74. MVs DWORD ? ; 12
  75. ENDS
  76. T_Blk ENDS
  77. ; Symbolic offsets for MMx version:
  78. T_MacroBlockActionDescr STRUCT
  79. BlockType BYTE ? ; 0 -- See Block Types below.
  80. MBEdgeType BYTE ? ; 1 -- 1 left | 2 right | 4 top | 8 bottom
  81. Unassigned1 BYTE ?
  82. FirstMEState BYTE ? ; 3 -- First State Num for Motion Estimation engine.
  83. UNION
  84. STRUCT
  85. CodedBlocks BYTE ? ; 4 -- [6] End-Of-Stream indicator
  86. ; [0] indicates Y1 non-empty.
  87. ; [1..5] indicate Y2, Y3, Y4, U, V non-empty.
  88. ; Other bits zero.
  89. CodedBlocksB BYTE ? ; 5 -- [0..5] like CodedBlocks, but for B frame.
  90. ; Set 0 for non-bi-di prediction.
  91. BestFullPelMBHMV BYTE ? ; 6 -- Best full pel HMV at macroblock level.
  92. BestFullPelMBVMV BYTE ? ; 7 -- Best full pel VMV at macroblock level.
  93. ENDS
  94. BestFullPelMBMVs DWORD ? ; 4
  95. ENDS
  96. SWD DWORD ? ; 8 -- Sum of weighted diffs, from motion estimation.
  97. SWDB DWORD ? ; 12 -- Sum of weighted diffs, from ME for B frame.
  98. BlkY1 T_Blk { }
  99. Blk EQU BlkY1
  100. BlkY2 T_Blk { }
  101. BlkY3 T_Blk { }
  102. BlkY4 T_Blk { }
  103. BlkU T_Blk { }
  104. BlkV T_Blk { }
  105. Unassigned4 BYTE 16 DUP (?) ; pad out 16 bytes to 128 bytes total to match C struct
  106. T_MacroBlockActionDescr ENDS
  107. T_MBAD TEXTEQU <T_MacroBlockActionDescr>
  108. IF SIZEOF T_MacroBlockActionDescr-128
  109. **** Size of T_MacroBlockActionDescr MUST BE a power of 2 bytes long.
  110. ENDIF
  111. IF 3*SIZEOF T_MBAD-PITCH
  112. **** Next instr works if PITCH==384 and SizeOf T_MacroBlockActionDescr==128.
  113. **** Here and throughout this file.
  114. ELSE
  115. BlkLvlSWD TEXTEQU <BestBiDiMVs>
  116. CandBlkLvlSWD TEXTEQU <[CONST_384*1-128+CandidateBiDiMVs]>
  117. BestBlkLvlSWD TEXTEQU <[CONST_384*1-128+BestBiDiMVs]>
  118. BlkLvlSWD0Delta TEXTEQU <[CONST_384*1-128+MVs]>
  119. CandBiDiMVs TEXTEQU <[CONST_384*1+CandidateBiDiMVs]>
  120. CandHMVf TEXTEQU <[CONST_384*1+CandidateHMVf]>
  121. CandVMVf TEXTEQU <[CONST_384*1+CandidateVMVf]>
  122. CandHMVb TEXTEQU <[CONST_384*1+CandidateHMVb]>
  123. CandVMVb TEXTEQU <[CONST_384*1+CandidateVMVb]>
  124. BiDiMVs0Delta TEXTEQU <[CONST_384*1+BestBiDiMVs]>
  125. HMVf0Delta TEXTEQU <[CONST_384*1+BestHMVf]>
  126. VMVf0Delta TEXTEQU <[CONST_384*1+BestVMVf]>
  127. HMVb0Delta TEXTEQU <[CONST_384*1+BestHMVb]>
  128. VMVb0Delta TEXTEQU <[CONST_384*1+BestVMVb]>
  129. ENDIF
  130. ; Memory layout constraints:
  131. ;
  132. ; T_MacroBlockActionDescr structure must be 16-byte aligned.
  133. ; Each T_Blk structure must be 16-byte aligned.
  134. ; FirstMEState must be 3rd byte of a DWORD.
  135. ; CodedBlocks must be DWORD aligned.
  136. ; CodedBlocksB must be CodedBlocks plus one.
  137. ; CodedBlocks & CodedBlocksB should be in different memory bank than BlockType.
  138. ; Offset must be 16-byte aligned.
  139. ; PastRef must be at Targ plus four.
  140. ; Candidate MVs must be at DWORD before Best MVs. MVs must be in order given.
  141. ;
  142. ; Block Types
  143. ;
  144. ; Only INTER, INTRA, and INTERSLF used for H261.
  145. ; Only INTER1MV, INTRA, INTER4MV used presently for H263.
  146. INTER1MV = 0
  147. INTER = INTER1MV
  148. INTRA = 1
  149. INTERBIDI = 2
  150. INTRABIDI = 3
  151. INTER4MV = 4
  152. INTERSLF = 2
  153. IsINTRA = 1 ; Mask to check for INTRA or INTER
  154. IsBIDI = 2 ; Mask to check for BIDI or not
  155. Is4MV = 4 ; Mask to check for 4 motion vectors or just 1.
  156. LeftEdge = 1 ; Mask to indicate MB is at left edge of picture.
  157. RightEdge = 2 ; Mask to indicate MB is at right edge of picture.
  158. TopEdge = 4 ; Mask to indicate MB is at top edge of picture.
  159. BottomEdge = 8 ; Mask to indicate MB is at bottom edge of picture.
  160. ENDIF