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.

1002 lines
39 KiB

  1. /*
  2. * @DEC_COPYRIGHT@
  3. */
  4. /*
  5. * HISTORY
  6. * $Log: SC.h,v $
  7. * Revision 1.1.8.10 1996/12/03 23:15:11 Hans_Graves
  8. * Added ScBSBufferedBytes() macros.
  9. * [1996/12/03 23:11:06 Hans_Graves]
  10. *
  11. * Revision 1.1.8.9 1996/11/13 16:10:47 Hans_Graves
  12. * Addition of ScBitstreamSave_t.
  13. * [1996/11/13 15:58:26 Hans_Graves]
  14. *
  15. * Revision 1.1.8.8 1996/11/08 21:50:36 Hans_Graves
  16. * Protos fixed for use with C++. Added bitstream protos for AC3.
  17. * [1996/11/08 21:17:23 Hans_Graves]
  18. *
  19. * Revision 1.1.8.7 1996/10/28 17:32:20 Hans_Graves
  20. * MME-01402. Added TimeStamp support to Callbacks.
  21. * [1996/10/28 16:56:21 Hans_Graves]
  22. *
  23. * Revision 1.1.8.6 1996/10/12 17:18:11 Hans_Graves
  24. * Added ScImageSize().
  25. * [1996/10/12 16:53:38 Hans_Graves]
  26. *
  27. * Revision 1.1.8.5 1996/09/18 23:45:46 Hans_Graves
  28. * Added ScFileClose() proto; ISIZE() macro
  29. * [1996/09/18 23:37:33 Hans_Graves]
  30. *
  31. * Revision 1.1.8.4 1996/08/20 22:11:48 Bjorn_Engberg
  32. * For NT - Made several routines public to support JV3.DLL and SOFTJPEG.DLL.
  33. * [1996/08/20 21:53:23 Bjorn_Engberg]
  34. *
  35. * Revision 1.1.8.3 1996/05/24 22:21:27 Hans_Graves
  36. * Added ScPatScaleIDCT8x8i_S proto
  37. * [1996/05/24 21:56:31 Hans_Graves]
  38. *
  39. * Revision 1.1.8.2 1996/05/07 19:55:49 Hans_Graves
  40. * Added BI_DECHUFFDIB
  41. * [1996/05/07 17:24:17 Hans_Graves]
  42. *
  43. * Revision 1.1.6.9 1996/04/17 16:38:36 Hans_Graves
  44. * Change NT bitstream buffer sizes from 32 to 64-bit
  45. * [1996/04/17 16:37:04 Hans_Graves]
  46. *
  47. * Revision 1.1.6.8 1996/04/15 21:08:39 Hans_Graves
  48. * Define ScBitBuff_t and ScBitString_t as dword or qword
  49. * [1996/04/15 21:05:46 Hans_Graves]
  50. *
  51. * Revision 1.1.6.7 1996/04/10 21:47:16 Hans_Graves
  52. * Added definition for EXTERN
  53. * [1996/04/10 21:23:23 Hans_Graves]
  54. *
  55. * Revision 1.1.6.6 1996/04/09 16:04:32 Hans_Graves
  56. * Added USE_C ifdef.
  57. * [1996/04/09 14:48:04 Hans_Graves]
  58. *
  59. * Revision 1.1.6.5 1996/04/01 16:23:09 Hans_Graves
  60. * NT porting
  61. * [1996/04/01 16:15:48 Hans_Graves]
  62. *
  63. * Revision 1.1.6.4 1996/03/20 22:32:46 Hans_Graves
  64. * {** Merge Information **}
  65. * {** Command used: bsubmit **}
  66. * {** Ancestor revision: 1.1.6.2 **}
  67. * {** Merge revision: 1.1.6.3 **}
  68. * {** End **}
  69. * Added protos for IDCT1x1,1x2,2x1,2x2,3x3,4x4,6x6
  70. * [1996/03/20 22:25:47 Hans_Graves]
  71. *
  72. * Revision 1.1.6.3 1996/03/16 19:22:51 Karen_Dintino
  73. * added NT port changes
  74. * [1996/03/16 19:20:07 Karen_Dintino]
  75. *
  76. * Revision 1.1.6.2 1996/03/08 18:46:27 Hans_Graves
  77. * Added proto for ScScaleIDCT8x8m_S()
  78. * [1996/03/08 18:41:45 Hans_Graves]
  79. *
  80. * Revision 1.1.4.14 1996/02/07 23:23:50 Hans_Graves
  81. * Added prototype for ScFileSeek()
  82. * [1996/02/07 23:18:32 Hans_Graves]
  83. *
  84. * Revision 1.1.4.13 1996/02/01 17:15:50 Hans_Graves
  85. * Added ScBSSkipBitsFast() and ScBSPeekBitsFast() macros
  86. * [1996/02/01 17:14:17 Hans_Graves]
  87. *
  88. * Revision 1.1.4.12 1996/01/24 19:33:18 Hans_Graves
  89. * Added prototype for ScScaleIDCT8x8i_S
  90. * [1996/01/24 18:13:51 Hans_Graves]
  91. *
  92. * Revision 1.1.4.11 1996/01/08 20:15:13 Bjorn_Engberg
  93. * Added one more cast to avoid warnings.
  94. * [1996/01/08 20:14:55 Bjorn_Engberg]
  95. *
  96. * Revision 1.1.4.10 1996/01/08 16:41:21 Hans_Graves
  97. * Added protos for more IDCT routines.
  98. * [1996/01/08 15:44:17 Hans_Graves]
  99. *
  100. * Revision 1.1.4.9 1996/01/02 18:31:13 Bjorn_Engberg
  101. * Added casts to avoid warning messages when compiling.
  102. * [1996/01/02 15:02:16 Bjorn_Engberg]
  103. *
  104. * Revision 1.1.4.8 1995/12/07 19:31:18 Hans_Graves
  105. * Added protos for ScFDCT8x8s_C() and ScIDCT8x8s_C(), Added ScBSAlignPutBits() macro.
  106. * [1995/12/07 17:58:36 Hans_Graves]
  107. *
  108. * Revision 1.1.4.7 1995/11/16 12:33:34 Bjorn_Engberg
  109. * Add BI_BITFIELDS to IsRGBPacked macro
  110. * [1995/11/16 12:33:17 Bjorn_Engberg]
  111. *
  112. * Revision 1.1.4.6 1995/10/13 21:01:42 Hans_Graves
  113. * Added macros for format classes.
  114. * [1995/10/13 20:59:15 Hans_Graves]
  115. *
  116. * Revision 1.1.4.5 1995/09/22 19:41:00 Hans_Graves
  117. * Moved ValidBI_BITFIELDSKinds to SC_convert.h
  118. * [1995/09/22 19:40:42 Hans_Graves]
  119. *
  120. * Revision 1.1.4.4 1995/09/20 18:27:59 Hans_Graves
  121. * Added Bjorn's NT defs
  122. * [1995/09/15 13:21:00 Hans_Graves]
  123. *
  124. * Revision 1.1.4.3 1995/09/14 12:35:22 Hans_Graves
  125. * Added ScCopyClipToPacked422() prototypes.
  126. * [1995/09/14 12:34:58 Hans_Graves]
  127. *
  128. * Revision 1.1.4.2 1995/09/13 14:51:45 Hans_Graves
  129. * Added ScScaleIDCT8x8(). Added buffer Type to queues.
  130. * [1995/09/13 14:29:10 Hans_Graves]
  131. *
  132. * Revision 1.1.2.18 1995/09/11 19:17:23 Hans_Graves
  133. * Moved ValidateBI_BITFIELDS() prototype to SC_convert.h - Removed mmsystem.h include.
  134. * [1995/09/11 19:14:27 Hans_Graves]
  135. *
  136. * Revision 1.1.2.17 1995/09/11 18:51:25 Farokh_Morshed
  137. * Support BI_BITFIELDS format
  138. * [1995/09/11 18:50:48 Farokh_Morshed]
  139. *
  140. * Revision 1.1.2.16 1995/08/31 14:15:43 Farokh_Morshed
  141. * transfer BI_BITFIELDS stuff to SV.h
  142. * [1995/08/31 14:15:20 Farokh_Morshed]
  143. *
  144. * Revision 1.1.2.15 1995/08/31 13:51:53 Farokh_Morshed
  145. * {** Merge Information **}
  146. * {** Command used: bsubmit **}
  147. * {** Ancestor revision: 1.1.2.13 **}
  148. * {** Merge revision: 1.1.2.14 **}
  149. * {** End **}
  150. * Add BI_BITFIELDS support
  151. * [1995/08/31 13:50:46 Farokh_Morshed]
  152. *
  153. * Revision 1.1.2.14 1995/08/29 22:17:05 Hans_Graves
  154. * Fixed-up Bitstream prototypes. Added BI_ image formats and defined BI_DECSEPYUV411DIB == BI_YU12SEP
  155. * [1995/08/29 22:15:27 Hans_Graves]
  156. *
  157. * Revision 1.1.2.13 1995/08/14 19:40:26 Hans_Graves
  158. * Added Flush, ScCopySubClip_S() and ScCopyRev_S() prototypes.
  159. * [1995/08/14 18:43:11 Hans_Graves]
  160. *
  161. * Revision 1.1.2.12 1995/07/21 17:41:01 Hans_Graves
  162. * Mirrored Callbacks with MME structure/naming.
  163. * [1995/07/21 17:30:04 Hans_Graves]
  164. *
  165. * Revision 1.1.2.11 1995/07/17 22:01:31 Hans_Graves
  166. * Added BufSize and BufType to ScCallback_t.
  167. * [1995/07/17 21:42:45 Hans_Graves]
  168. *
  169. * Revision 1.1.2.10 1995/07/12 19:48:23 Hans_Graves
  170. * Added H261_FILE type.
  171. * [1995/07/12 19:33:18 Hans_Graves]
  172. *
  173. * Revision 1.1.2.9 1995/07/11 15:24:30 Hans_Graves
  174. * Fixed ScCopySubClip and ScCopyRev macros.
  175. * [1995/07/11 15:24:09 Hans_Graves]
  176. *
  177. * Revision 1.1.2.8 1995/07/11 14:50:44 Hans_Graves
  178. * Added prototypes for sc_mc2.s and sc_copy2.s
  179. * [1995/07/11 14:23:18 Hans_Graves]
  180. *
  181. * Revision 1.1.2.7 1995/06/27 13:54:21 Hans_Graves
  182. * Added STREAM_USE_NET and prototype for ScBSCreateFromNet()
  183. * [1995/06/26 21:00:17 Hans_Graves]
  184. *
  185. * Revision 1.1.2.6 1995/06/22 21:35:03 Hans_Graves
  186. * Moved filetypes from SV.h to here
  187. * [1995/06/22 21:29:11 Hans_Graves]
  188. *
  189. * Revision 1.1.2.5 1995/06/21 18:37:58 Hans_Graves
  190. * Added prototype for ScBSPutBytes()
  191. * [1995/06/21 18:36:43 Hans_Graves]
  192. *
  193. * Revision 1.1.2.4 1995/06/15 21:17:59 Hans_Graves
  194. * Added prototypes for sc_copy.c
  195. * [1995/06/15 20:41:40 Hans_Graves]
  196. *
  197. * Revision 1.1.2.3 1995/06/01 19:35:36 Hans_Graves
  198. * Added prototype for ScCopyClip()
  199. * [1995/06/01 19:31:28 Hans_Graves]
  200. *
  201. * Revision 1.1.2.2 1995/05/31 18:09:20 Hans_Graves
  202. * Inclusion in new SLIB location.
  203. * [1995/05/31 15:17:35 Hans_Graves]
  204. *
  205. * Revision 1.1.2.2 1995/05/03 19:26:38 Hans_Graves
  206. * Included in SLIB (Oct 95)
  207. * [1995/05/03 19:26:26 Hans_Graves]
  208. *
  209. * Revision 1.1.2.3 1995/04/17 18:04:26 Hans_Graves
  210. * Added math prototypes and defs. Expanding Bitstream defs.
  211. * [1995/04/17 18:02:16 Hans_Graves]
  212. *
  213. * Revision 1.1.2.2 1995/04/07 19:18:43 Hans_Graves
  214. * Inclusion in SLIB
  215. * [1995/04/07 19:04:13 Hans_Graves]
  216. *
  217. * $EndLog$
  218. */
  219. /*****************************************************************************
  220. ** Copyright (c) Digital Equipment Corporation, 1995 **
  221. ** **
  222. ** All Rights Reserved. Unpublished rights reserved under the copyright **
  223. ** laws of the United States. **
  224. ** **
  225. ** The software contained on this media is proprietary to and embodies **
  226. ** the confidential technology of Digital Equipment Corporation. **
  227. ** Possession, use, duplication or dissemination of the software and **
  228. ** media is authorized only pursuant to a valid written license from **
  229. ** Digital Equipment Corporation. **
  230. ** **
  231. ** RESTRICTED RIGHTS LEGEND Use, duplication, or disclosure by the U.S. **
  232. ** Government is subject to restrictions as set forth in Subparagraph **
  233. ** (c)(1)(ii) of DFARS 252.227-7013, or in FAR 52.227-19, as applicable. **
  234. ******************************************************************************/
  235. #ifndef _SC_H_
  236. #define _SC_H_
  237. #define SLIB_VERSION 0x300
  238. /************************* Debug Handling ***********************/
  239. #ifdef _VERBOSE_
  240. #define sc_vprintf printf
  241. #else
  242. #define sc_vprintf
  243. #endif
  244. #ifdef _DEBUG_
  245. #define sc_dprintf printf
  246. #else
  247. #define sc_dprintf
  248. #endif
  249. #ifdef _TEST_
  250. #define sc_tprintf(test, msg) if (test) printf(msg)
  251. #else
  252. #define sc_tprintf
  253. #endif
  254. #ifdef _SLIBDEBUG_
  255. #define _SlibDebug(test, statements) { if (test) { statements; } }
  256. #else
  257. #define _SlibDebug(test, statements)
  258. #endif
  259. #ifndef EXTERN
  260. #ifdef __cplusplus
  261. #if !defined(WIN32) || defined(STATIC_BUILD)
  262. #define EXTERN extern "C"
  263. #else
  264. #define EXTERN __declspec( dllexport ) extern "C"
  265. #endif
  266. #else
  267. #if !defined(WIN32) || defined(STATIC_BUILD)
  268. #define EXTERN extern
  269. #else
  270. #define EXTERN __declspec( dllexport ) extern
  271. #endif
  272. #endif /* __cplusplus */
  273. #endif /* EXTERN */
  274. #ifndef PRIVATE_EXTERN
  275. #ifdef __cplusplus
  276. #define PRIVATE_EXTERN extern "C"
  277. #else /* __cplusplus */
  278. #define PRIVATE_EXTERN extern
  279. #endif /* __cplusplus */
  280. #endif /* PRIVATE_EXTERN */
  281. #ifdef WIN32
  282. /*
  283. * These b* routines are mem* routines on NT.
  284. */
  285. #define bcopy(_src_,_dst_,_len_) memcpy(_dst_,_src_,_len_)
  286. #define bzero(_dst_,_len_) memset(_dst_,0,_len_)
  287. #define bcmp(_src_,_dst_,_len_) memcmp(_src_,_dst_,_len_)
  288. /*
  289. * These cma routines are doing nothing for NT.
  290. * Avoid lots of ifdefs on the code by defining
  291. * null macros for them.
  292. */
  293. #define cma_mutex_lock(foo)
  294. #define cma_mutex_unlock(foo)
  295. #endif /* WIN32 */
  296. /************************* Elementary Types ***********************/
  297. /*
  298. #ifndef UNALIGNED
  299. #if defined(WIN95) || defined(INTEL)
  300. #define UNALIGNED
  301. #else
  302. #define UNALIGNED __unaligned
  303. #endif
  304. #endif
  305. */
  306. #ifndef u_char
  307. #if defined( __VMS ) || defined( WIN32 )
  308. typedef unsigned char u_char; /* 8 bits */
  309. typedef unsigned short u_short; /* 16 bits */
  310. typedef unsigned int u_int; /* 32 bits */
  311. typedef unsigned long u_long; /* 32 bits */
  312. #else
  313. typedef unsigned char u_char; /* 8 bits */
  314. typedef unsigned short u_short; /* 16 bits */
  315. typedef unsigned int u_int; /* 32 bits */
  316. typedef unsigned long u_long; /* 64 bits */
  317. typedef unsigned int UINT;
  318. #endif
  319. #endif /* u_char */
  320. #ifndef WIN32
  321. #ifndef byte /* 8 bit */
  322. #define byte char
  323. #endif
  324. #endif /* !WIN32 */
  325. #ifndef word /* 16 bit */
  326. #define word short
  327. #endif /* word */
  328. #ifndef dword /* 32 bit */
  329. #define dword int
  330. #endif /* dword */
  331. #ifndef qword /* 64 bit */
  332. #if defined(__VMS) || defined(WIN32)
  333. #define qword _int64
  334. #else
  335. #define qword long
  336. #endif
  337. #endif /* qword */
  338. #define MIN_WORD ((-32767)-1)
  339. #define MAX_WORD ( 32767)
  340. #define MIN_DWORD ((-2147483647)-1)
  341. #define MAX_DWORD ( 2147483647)
  342. /************************** Definitions ****************************/
  343. #define RETURN_ON_ERROR(A) {if (A) return (A);}
  344. #ifndef NULL
  345. #define NULL 0L
  346. #endif
  347. #ifndef TRUE
  348. #define TRUE 1
  349. #define FALSE 0
  350. #endif
  351. #ifndef WIN32
  352. #ifndef FAR
  353. #define FAR
  354. #endif
  355. #endif
  356. #ifndef PI
  357. #define PI 3.14159265358979
  358. #define PI4 PI/4
  359. #define PI64 PI/64
  360. #endif
  361. /*
  362. ** public parameter settings
  363. */
  364. /* Algorithm Flags - video */
  365. #define PARAM_ALGFLAG_HALFPEL 0x0001 /* Half pixel accuracy */
  366. #define PARAM_ALGFLAG_SKIPPEL 0x0002 /* Skip-pixel error calculation */
  367. #define PARAM_ALGFLAG_PB 0x0004 /* PB frame encoding */
  368. #define PARAM_ALGFLAG_SAC 0x0008 /* Syntax Arithmetic Coding */
  369. #define PARAM_ALGFLAG_UMV 0x0010 /* Unrestricted Motion Vectors */
  370. #define PARAM_ALGFLAG_ADVANCED 0x0020 /* Advanced Prediction Mode */
  371. /* Algorithm Flags - audio */
  372. #define PARAM_ALGFLAG_VAD 0x1000 /* Voice Activity Detection (G.723) */
  373. /* Format Extensions */
  374. #define PARAM_FORMATEXT_RTPA 0x0001 /* RTP Mode A */
  375. #define PARAM_FORMATEXT_RTPB 0x0002 /* RTP Mode B */
  376. #define PARAM_FORMATEXT_RTPC 0x0004 /* RTP Mode C */
  377. /* Frame types */
  378. #define FRAME_TYPE_NONE 0x0000
  379. #define FRAME_TYPE_I 0x0001 /* Key frame */
  380. #define FRAME_TYPE_P 0x0002 /* Partial frame */
  381. #define FRAME_TYPE_B 0x0004 /* Bi-directional frame */
  382. #define FRAME_TYPE_D 0x0008 /* Preview frame */
  383. /************************** Formats (FOURCC's) ***************************/
  384. /*
  385. ** Image formats
  386. */
  387. #define BI_MSH261DIB mmioFOURCC('M','2','6','1')
  388. #define BI_MSH263DIB mmioFOURCC('M','2','6','3')
  389. #define BI_DECH261DIB mmioFOURCC('D','2','6','1')
  390. #define BI_DECH263DIB mmioFOURCC('D','2','6','3')
  391. #define BI_DECJPEGDIB mmioFOURCC('J','P','E','G')
  392. #define BI_DECMJPGDIB mmioFOURCC('M','J','P','G')
  393. #define BI_DECYUVDIB mmioFOURCC('D','Y','U','V')
  394. #define BI_DECXIMAGEDIB mmioFOURCC('D','X','I','M')
  395. #define BI_DECSEPYUVDIB mmioFOURCC('D','S','Y','U')
  396. #define BI_DECMPEGDIB mmioFOURCC('D','M','P','G')
  397. #define BI_DECHUFFDIB mmioFOURCC('D','H','U','F')
  398. #define BI_DECSEPRGBDIB mmioFOURCC('D','S','R','G')
  399. #define BI_DECGRAYDIB mmioFOURCC('D','G','R','Y')
  400. #define BI_YVU9SEP mmioFOURCC('Y','V','U','9')
  401. #define BI_YU12SEP mmioFOURCC('Y','U','1','2')
  402. #define BI_YU16SEP mmioFOURCC('Y','U','1','6')
  403. #define BI_DECSEPYUV411DIB mmioFOURCC('Y','U','1','2')
  404. #define BI_S422 mmioFOURCC('S','4','2','2')
  405. #define BI_YUY2 mmioFOURCC('Y','U','Y','2')
  406. /*
  407. * FYI - Other image formats that are defined elsewhere:
  408. */
  409. #if 0
  410. #define BI_RGB 0
  411. #define BI_BITFIELDS 3
  412. #define BICOMP_JFIF mmioFOURCC('J','F','I','F')
  413. #endif
  414. /*
  415. * Macros to identify classes of image formats.
  416. */
  417. #define IsJPEG(s) (((s) == JPEG_DIB) || \
  418. ((s) == MJPG_DIB))
  419. #define IsYUV422Packed(s) (((s) == BI_DECYUVDIB) || \
  420. ((s) == BI_S422) || \
  421. ((s) == BI_YUY2))
  422. #define IsYUV422Sep(s) (((s) == BI_DECSEPYUVDIB) || \
  423. ((s) == BI_YU16SEP))
  424. #define IsYUV411Sep(s) (((s) == BI_DECSEPYUV411DIB) || \
  425. ((s) == BI_YU12SEP))
  426. #define IsYUV1611Sep(s) (((s) == BI_YVU9SEP))
  427. #define IsYUVSep(s) ((IsYUV422Sep(s)) || \
  428. (IsYUV411Sep(s)) || \
  429. (IsYUV1611Sep(s)))
  430. #define IsYUV(s) ((IsYUV422Packed(s)) || \
  431. (IsYUVSep(s)))
  432. #define IsRGBPacked(s) (((s) == BI_RGB) || \
  433. ((s) == BI_DECXIMAGEDIB) || \
  434. ((s) == BI_BITFIELDS))
  435. #define IsRGBSep(s) (((s) == BI_DECSEPRGBDIB))
  436. #define IsRGB(s) ((IsRGBPacked(s)) || \
  437. (IsRGBSep(s)))
  438. #define IsGray(s) (((s) == BI_DECGRAYDIB))
  439. #define ISIZE(w,h,c) \
  440. (IsYUV411Sep(c)) ? ((w) * (h) * 3 / 2) : \
  441. ((IsYUV1611Sep(c)) ? \
  442. ((w) * (h) * 9 / 8) : \
  443. ((IsYUV422Sep(c) || IsYUV422Packed(c)) ? \
  444. ((w) * (h) * 2) : ((w) * (h) * 3)));
  445. /*
  446. ** File Types (returned from ScGetFileType)
  447. */
  448. #define UNKNOWN_FILE 0
  449. #define AVI_FILE 201
  450. #define MPEG_VIDEO_FILE 202
  451. #define MPEG_AUDIO_FILE 203
  452. #define MPEG_SYSTEM_FILE 204
  453. #define JFIF_FILE 205
  454. #define QUICKTIME_JPEG_FILE 206
  455. #define GSM_FILE 207
  456. #define WAVE_FILE 208
  457. #define PCM_FILE 209
  458. #define H261_FILE 210
  459. #define AC3_FILE 211
  460. /*
  461. ** Callback messages
  462. */
  463. #define CB_RELEASE_BUFFER 1 /* buffer finished */
  464. #define CB_END_BUFFERS 2 /* no more buffers */
  465. #define CB_RESET_BUFFERS 3 /* reset to beginning */
  466. #define CB_SEQ_HEADER 4 /* sequence header */
  467. #define CB_SEQ_END 5 /* sequence end */
  468. #define CB_FRAME_FOUND 6 /* frame found */
  469. #define CB_FRAME_READY 7 /* frame completed */
  470. #define CB_FRAME_START 8 /* frame starting to be processed */
  471. #define CB_PROCESSING 9 /* processing data */
  472. #define CB_CODEC_DONE 10 /* codec done ended */
  473. /*
  474. ** Data types for callback message
  475. */
  476. #define CB_DATA_NONE 0x0000 /* no data */
  477. #define CB_DATA_COMPRESSED 0x0001 /* data is compressed */
  478. #define CB_DATA_IMAGE 0x0002 /* data is decompressed image */
  479. #define CB_DATA_AUDIO 0x0004 /* data is decompressed audio */
  480. /*
  481. ** Frame flags for callback message
  482. */
  483. #define CB_FLAG_TYPE_KEY 0x0001 /* key frame */
  484. #define CB_FLAG_TYPE_MPEGB 0x0002 /* MPEG B-Frame */
  485. #define CB_FLAG_FRAME_DROPPED 0x0008 /* frame dropped */
  486. #define CB_FLAG_FRAME_BAD 0x0010 /* could not de/compress */
  487. /*
  488. ** Action values in response to callback message
  489. */
  490. #define CB_ACTION_WAIT 0x0000 /* wait - callback still busy */
  491. #define CB_ACTION_CONTINUE 0x0001 /* accept a frame */
  492. #define CB_ACTION_DROP 0x0002 /* drop a frame */
  493. #define CB_ACTION_DUPLICATE 0x0004 /* duplicate a frame */
  494. #define CB_ACTION_END 0x0080 /* end de/compression */
  495. /* These are old definitions
  496. #define CLIENT_CONTINUE CB_ACTION_CONTINUE
  497. #define CLIENT_ABORT CB_ACTION_END
  498. #define CLIENT_PROCESS CB_ACTION_CONTINUE
  499. #define CLIENT_DROP CB_ACTION_DROP
  500. #define CB_IMAGE_BUFFER_READY CB_FRAME_READY
  501. #define CB_PICTURE_FOUND CB_FRAME_FOUND
  502. #define CB_PICTURE_PROCEESSED CB_FRAME_READY
  503. #define CB_FRAME CB_FRAME_FOUND
  504. */
  505. /*
  506. * Stream sources/destinations
  507. */
  508. #define STREAM_USE_SAME -1
  509. #define STREAM_USE_NULL 0
  510. #define STREAM_USE_QUEUE 1
  511. #define STREAM_USE_FILE 2
  512. #define STREAM_USE_BUFFER 3
  513. #define STREAM_USE_DEVICE 4
  514. #define STREAM_USE_STDOUT 5
  515. #define STREAM_USE_NET 6
  516. #define STREAM_USE_NET_TCP 6 /* reliable transport */
  517. #define STREAM_USE_NET_UDP 7 /* unreliable transport */
  518. /************************** Type Definitions *******************************/
  519. typedef int ScStatus_t;
  520. typedef void *ScHandle_t;
  521. typedef unsigned char ScBoolean_t;
  522. #if !defined( _VMS ) && !defined( WIN32 )
  523. /* typedef long _int64; */
  524. #endif
  525. /*
  526. ** Bitstream stuff
  527. */
  528. #if defined( _VMS ) || defined( WIN95 )
  529. #define SC_BITBUFFSZ 32
  530. typedef unsigned dword ScBitBuff_t;
  531. typedef unsigned dword ScBitString_t;
  532. #else
  533. #define SC_BITBUFFSZ 64
  534. typedef unsigned qword ScBitBuff_t;
  535. typedef unsigned qword ScBitString_t;
  536. #endif
  537. #define SC_BITBUFFMASK (ScBitBuff_t)-1
  538. #define ALIGNING 8
  539. #define ScBSPreLoad(bs, bits) if ((int)bs->shift<(bits)) sc_BSLoadDataWord(bs);
  540. #define ScBSPreLoadW(bs, bits) if ((int)bs->shift<(bits)) sc_BSLoadDataWordW(bs);
  541. #define ScBSByteAlign(bs) { \
  542. int len=bs->shift%8; \
  543. if (len) { \
  544. bs->OutBuff=(bs->OutBuff<<len)|(bs->InBuff>>(SC_BITBUFFSZ-len)); \
  545. bs->InBuff<<=len; bs->CurrentBit+=len; bs->shift-=len; } \
  546. }
  547. #define ScBSAlignPutBits(bs) if (bs->shift%8) \
  548. ScBSPutBits(bs, 0, 8-(bs->shift%8));
  549. #define ScBSBitPosition(bs) (bs->CurrentBit)
  550. #define ScBSBytePosition(bs) (bs->CurrentBit>>3)
  551. #define ScBSBufferedBytes(bs) (bs->bufftop)
  552. #define ScBSBufferedBytesUsed(bs) (bs->buffp)
  553. #define ScBSBufferedBytesUnused(bs) (bs->bufftop-bs->buffp)
  554. #define ScBSSkipBit(bs) ScBSSkipBits(bs, 1)
  555. #define ScBSSkipBitsFast(bs, len) { if ((u_int)(len)<=bs->shift) { \
  556. if ((len)==SC_BITBUFFSZ) \
  557. { bs->OutBuff=bs->InBuff; bs->InBuff=0; } \
  558. else { \
  559. bs->OutBuff=(bs->OutBuff<<(len))|(bs->InBuff>>(SC_BITBUFFSZ-(len))); \
  560. bs->InBuff<<=(len); } \
  561. bs->CurrentBit+=len; bs->shift-=len; \
  562. } else ScBSSkipBits(bs, len); }
  563. #define ScBSSkipBitFast(bs) ScBSSkipBitsFast(bs, 1)
  564. #define ScBSPeekBitsFast(bs, len) (!(len) ? 0 \
  565. : (((len)<=bs->shift || !sc_BSLoadDataWord(bs)) && (len)==SC_BITBUFFSZ \
  566. ? bs->OutBuff : (bs->OutBuff >> (SC_BITBUFFSZ-len))) )
  567. #define ScBSPeekBitsFull(bs, result) \
  568. { ScBSPreLoad(bs, SC_BITBUFFSZ); result = bs->OutBuff; }
  569. /*
  570. ** Sort stuff
  571. */
  572. typedef struct ScSortDouble_s {
  573. int index; /* index to actual data */
  574. double num; /* the number to sort by */
  575. } ScSortDouble_t;
  576. typedef struct ScSortFloat_s {
  577. int index; /* index to actual data */
  578. double num; /* the number to sort by */
  579. } ScSortFloat_t;
  580. /*
  581. ** ScBuf_s structure used in Buffer/Image Queue management.
  582. ** Contains info for one buffer.
  583. */
  584. struct ScBuf_s {
  585. u_char *Data; /* Pointer to buffer's data */
  586. int Size; /* Length of buffer in bytes */
  587. int Type; /* Type of buffer */
  588. struct ScBuf_s *Prev; /* Pointer to previous buffer in queue */
  589. };
  590. /*
  591. ** Buffer queue structure. One for each queue.
  592. */
  593. typedef struct ScQueue_s {
  594. int NumBufs; /* Number of buffers currently in queue */
  595. struct ScBuf_s *head, *tail; /* pointers to head & tail of queue */
  596. } ScQueue_t;
  597. /*
  598. ** ScCallbackInfo_t passes info back & forth during callback
  599. */
  600. typedef struct ScCallbackInfo_s {
  601. int Message; /* Callback reason: CB_FRAME_READY, etc. */
  602. int DataType; /* Buffer data type */
  603. u_char *Data; /* Pointer to data buffer. */
  604. dword DataSize; /* Length of data buffer */
  605. dword DataUsed; /* Actual bytes used in buffer */
  606. void *UserData; /* User defined data */
  607. qword TimeStamp; /* Timestamp of decompressed img/audio */
  608. /* relative to start of sequence */
  609. dword Flags; /* decomp/compression details */
  610. int Action; /* drop frame or continue */
  611. dword Value; /* a value for special flags/actions */
  612. void *Format; /* BITMAPINFOHEADER or WAVEFORMATEX */
  613. } ScCallbackInfo_t;
  614. typedef qword ScBSPosition_t;
  615. /*
  616. ** State info for the input bitstream
  617. */
  618. typedef struct ScBitstream_s {
  619. dword DataSource; /* STREAM_USE_BUFFER, _USE_QUEUE,_USE_FILE, */
  620. /* or _USE_DEVICE */
  621. char Mode; /* 'r'=read, 'w'=write, 'b'=both */
  622. ScQueue_t *Q; /* Buffer Queue (STREAM_USE_QUEUE) */
  623. int (*Callback)(ScHandle_t, /* Callback to supply Bufs (STREAM_USE_QUEUE) */
  624. ScCallbackInfo_t *, void *);
  625. int (*FilterCallback)(struct /* Callback to filter data from bitstream */
  626. ScBitstream_s *);
  627. unsigned qword FilterBit; /* Bit to call filter callback at */
  628. unsigned char InFilterCallback; /* TRUE when FilterCallback is busy */
  629. ScHandle_t Sch; /* Handle passed to Callback */
  630. dword DataType; /* Data type passed to Callback */
  631. void *UserData; /* User Data passed to Callback */
  632. int FileFd; /* File descriptor (STREAM_USE_FILE/NET) */
  633. unsigned char *RdBuf; /* Buf to use if (_USE_BUFFER,_USE_FILE) */
  634. unsigned dword RdBufSize; /* Size of RdBuf */
  635. char RdBufAllocated;/* = TRUE if RdBuf was internally allocated */
  636. dword Device; /* Device to use (STREAM_USE_DEVICE) */
  637. ScBitBuff_t InBuff, OutBuff; /* 64-bit or 32-bit data buffers */
  638. unsigned int shift; /* Shift value for current bit position */
  639. ScBSPosition_t CurrentBit; /* Current bit position in bitstream */
  640. unsigned char *buff; /* pointer to bitstream data buffer */
  641. unsigned dword buffstart; /* byte offset of start of buff */
  642. unsigned dword buffp; /* byte offset in buffer */
  643. unsigned dword bufftop; /* number of bytes in buffer */
  644. ScBoolean_t EOI; /* = TRUE when no more data in data source */
  645. ScBoolean_t Flush; /* = TRUE to signal a flush at next 32/64 bit */
  646. } ScBitstream_t;
  647. /*
  648. ** Bitstream context block to save current position of input stream
  649. */
  650. typedef struct ScBitstreamSave_s {
  651. ScBitBuff_t InBuff, OutBuff; /* 64-bit or 32-bit data buffers */
  652. unsigned dword shift; /* Shift value for current bit position */
  653. ScBSPosition_t CurrentBit; /* Current bit position in bitstream */
  654. unsigned char *buff; /* pointer to bitstream data buffer */
  655. unsigned dword buffp; /* byte offset in buffer */
  656. ScBoolean_t EOI; /* = TRUE when no more data in data source */
  657. ScBoolean_t Flush; /* = TRUE to signal a flush at next 32/64 bit */
  658. } ScBitstreamSave_t;
  659. /************************** Prototypes *****************************/
  660. /*
  661. * sc_file.c
  662. */
  663. PRIVATE_EXTERN ScBoolean_t ScFileExists(char *filename);
  664. PRIVATE_EXTERN int ScFileOpenForReading(char *filename);
  665. PRIVATE_EXTERN int ScFileOpenForWriting(char *filename, ScBoolean_t truncate);
  666. PRIVATE_EXTERN ScStatus_t ScFileSize(char *filename, unsigned qword *size);
  667. PRIVATE_EXTERN dword ScFileRead(int fd, void *buffer, unsigned dword bytes);
  668. PRIVATE_EXTERN dword ScFileWrite(int fd, void *buffer, unsigned dword bytes);
  669. PRIVATE_EXTERN ScStatus_t ScFileSeek(int fd, qword bytepos);
  670. PRIVATE_EXTERN void ScFileClose(int fd);
  671. PRIVATE_EXTERN ScStatus_t ScFileMap(char *filename, int *fd, u_char **buffer,
  672. unsigned qword *size);
  673. PRIVATE_EXTERN ScStatus_t ScFileUnMap(int fd, u_char *buffer, unsigned int size);
  674. PRIVATE_EXTERN int ScGetFileType(char *filename);
  675. /*
  676. * sc_mem.c
  677. */
  678. PRIVATE_EXTERN void *ScAlloc(unsigned long bytes);
  679. PRIVATE_EXTERN void *ScAlloc2(unsigned long bytes, char *name);
  680. PRIVATE_EXTERN void *ScCalloc(unsigned long bytes);
  681. PRIVATE_EXTERN void ScFree(void *);
  682. PRIVATE_EXTERN int ScMemCheck(char *array,int test,int num);
  683. EXTERN char *ScPaMalloc(int);
  684. EXTERN void ScPaFree(void *);
  685. EXTERN int getpagesize();
  686. /*
  687. * sc_util.c
  688. */
  689. extern int sc_Dummy();
  690. PRIVATE_EXTERN unsigned int ScImageSize(unsigned int fourcc, int w, int h, int bits);
  691. extern void ScReadCommandSwitches(char *argv[],int argc,
  692. void (*error_routine)(),char *,...);
  693. extern void ScShowBuffer(unsigned char *, int);
  694. extern void ScShowBufferFloat(float *, int);
  695. extern void ScShowBufferInt(int *, int);
  696. extern int ScDumpChar(unsigned char *ptr, int nbytes, int startpos);
  697. /*
  698. * sc_errors.c
  699. */
  700. PRIVATE_EXTERN ScStatus_t ScGetErrorText (int errno, char *ReturnMsg, u_int MaxChars);
  701. PRIVATE_EXTERN char *ScGetErrorStr(int errno);
  702. extern char _serr_msg[80];
  703. /*
  704. * sc_buf.c
  705. */
  706. PRIVATE_EXTERN ScStatus_t ScBSSetFilter(ScBitstream_t *BS,
  707. int (*Callback)(ScBitstream_t *BS));
  708. PRIVATE_EXTERN ScStatus_t ScBSCreate(ScBitstream_t **BS);
  709. PRIVATE_EXTERN ScStatus_t ScBSCreateFromBuffer(ScBitstream_t **BS,
  710. u_char *Buffer, unsigned int BufSize);
  711. PRIVATE_EXTERN ScStatus_t ScBSCreateFromBufferQueue(ScBitstream_t **BS,
  712. ScHandle_t Sch, int DataType, ScQueue_t *Q,
  713. int (*Callback)(ScHandle_t,ScCallbackInfo_t *,void *),
  714. void *UserData);
  715. PRIVATE_EXTERN ScStatus_t ScBSCreateFromFile(ScBitstream_t **BS,int FileFd,
  716. u_char *Buffer, int BufSize);
  717. PRIVATE_EXTERN ScStatus_t ScBSCreateFromNet(ScBitstream_t **BS, int SocketFd,
  718. u_char *Buffer, int BufSize);
  719. PRIVATE_EXTERN ScStatus_t ScBSCreateFromDevice(ScBitstream_t **BS, int device);
  720. PRIVATE_EXTERN ScStatus_t ScBSDestroy(ScBitstream_t *BS);
  721. PRIVATE_EXTERN ScStatus_t ScBSFlush(ScBitstream_t *BS);
  722. PRIVATE_EXTERN ScStatus_t ScBSFlushSoon(ScBitstream_t *BS);
  723. PRIVATE_EXTERN ScStatus_t ScBSReset(ScBitstream_t *BS);
  724. PRIVATE_EXTERN ScStatus_t ScBSResetCounters(ScBitstream_t *BS);
  725. PRIVATE_EXTERN ScStatus_t ScBSSkipBits(ScBitstream_t *BS, u_int length);
  726. PRIVATE_EXTERN ScStatus_t ScBSSkipBitsW(ScBitstream_t *BS, u_int length);
  727. PRIVATE_EXTERN ScStatus_t ScBSSkipBytes(ScBitstream_t *BS, u_int length);
  728. PRIVATE_EXTERN int ScBSPeekBit(ScBitstream_t *BS);
  729. PRIVATE_EXTERN ScBitString_t ScBSPeekBits(ScBitstream_t *BS, u_int length);
  730. PRIVATE_EXTERN ScBitString_t ScBSPeekBytes(ScBitstream_t *BS, u_int length);
  731. PRIVATE_EXTERN int ScBSGetBytes(ScBitstream_t *BS, u_char *buffer, u_int length,
  732. u_int *ret_length);
  733. PRIVATE_EXTERN int ScBSGetBytesStopBefore(ScBitstream_t *BS, u_char *buffer,
  734. u_int length, u_int *ret_length,
  735. ScBitString_t seek_word, int word_len);
  736. PRIVATE_EXTERN ScBitString_t ScBSGetBits(ScBitstream_t *BS, u_int length);
  737. PRIVATE_EXTERN ScBitString_t ScBSGetBitsW(ScBitstream_t *BS, u_int length);
  738. PRIVATE_EXTERN int ScBSGetBitsVarLen(ScBitstream_t *BS, const int *table,
  739. int len);
  740. PRIVATE_EXTERN ScStatus_t ScBSPutBytes(ScBitstream_t *BS, u_char *buffer,
  741. u_int length);
  742. PRIVATE_EXTERN ScStatus_t ScBSPutBits(ScBitstream_t *BS, ScBitString_t bits,
  743. u_int length);
  744. PRIVATE_EXTERN ScStatus_t ScBSPutBit(ScBitstream_t *BS, char bit);
  745. PRIVATE_EXTERN int ScBSGetBit(ScBitstream_t *BS);
  746. PRIVATE_EXTERN ScStatus_t ScBSSeekToPosition(ScBitstream_t *BS, unsigned long pos);
  747. PRIVATE_EXTERN int ScBSSeekStopBefore(ScBitstream_t *BS, ScBitString_t seek_word, int word_len);
  748. PRIVATE_EXTERN int ScBSSeekAlign(ScBitstream_t *BS, ScBitString_t seek_word,int word_len);
  749. PRIVATE_EXTERN int ScBSSeekAlignStopBefore(ScBitstream_t *BS,ScBitString_t seek_word,int word_len);
  750. PRIVATE_EXTERN int ScBSSeekAlignStopBeforeW(ScBitstream_t *BS,ScBitString_t seek_word,int word_len);
  751. PRIVATE_EXTERN int ScBSSeekAlignStopAt(ScBitstream_t *BS,
  752. ScBitString_t seek_word,
  753. int word_len, unsigned long end_byte_pos);
  754. extern ScStatus_t sc_BSLoadDataWord(ScBitstream_t *BS);
  755. extern ScStatus_t sc_BSStoreDataWord(ScBitstream_t *BS, ScBitBuff_t Buff);
  756. PRIVATE_EXTERN ScStatus_t ScBufQueueCreate(ScQueue_t **Q);
  757. PRIVATE_EXTERN ScStatus_t ScBufQueueDestroy(ScQueue_t *Q);
  758. PRIVATE_EXTERN ScStatus_t ScBufQueueAdd(ScQueue_t *Q, u_char *Data, int Size);
  759. PRIVATE_EXTERN ScStatus_t ScBufQueueAddExt(ScQueue_t *Q, u_char *Data, int Size,
  760. int Type);
  761. PRIVATE_EXTERN ScStatus_t ScBufQueueRemove(ScQueue_t *Q);
  762. PRIVATE_EXTERN int ScBufQueueGetNum(ScQueue_t *Q);
  763. PRIVATE_EXTERN ScStatus_t ScBufQueueGetHead(ScQueue_t *Q, u_char **Data,
  764. int *Size);
  765. PRIVATE_EXTERN ScStatus_t ScBufQueueGetHeadExt(ScQueue_t *Q, u_char **Data,
  766. int *Size, int *Type);
  767. /*
  768. ** sc_math.c
  769. */
  770. /* #define ScAbs(val) (val > 0.0) ? val : -val */
  771. extern float ScAbs(float val);
  772. extern double ScSqr(double x);
  773. extern double ScDistance(double x1, double y1, double z1,
  774. double x2, double y2, double z2);
  775. extern void ScDigrv4(float *real, float *imag, int n);
  776. extern float ScArcTan(float Q,float I);
  777. /*
  778. ** sc_dct.c
  779. */
  780. extern void ScFDCT(float in_block[32], float out_block1[32],
  781. float out_block2[32]);
  782. extern void ScIFDCT(float in_block[32], float out_block[32]);
  783. extern void ScFDCT8x8_C(float *ipbuf, float *outbuf);
  784. extern void ScFDCT8x8s_C(short *inbuf, short *outbuf);
  785. /*
  786. ** sc_dct2.c
  787. */
  788. extern void ScFDCT8x8_S(float *ipbuf, float *outbuf);
  789. /*
  790. ** sc_idct.c
  791. */
  792. extern void ScIDCT8x8(int *outbuf);
  793. extern void ScScaleIDCT8x8_C(float *ipbuf, int *outbuf);
  794. extern void ScIDCT8x8s_C(short *inbuf, short *outbuf);
  795. /*
  796. ** sc_idct_scaled.c
  797. */
  798. extern void ScScaleIDCT8x8i_C(int *inbuf, int *outbuf);
  799. extern void ScScaleIDCT8x8i128_C(int *inbuf, int *outbuf);
  800. extern void ScScaleIDCT1x1i_C(int *inbuf, int *outbuf);
  801. extern void ScScaleIDCT1x2i_C(int *inbuf, int *outbuf);
  802. extern void ScScaleIDCT2x1i_C(int *inbuf, int *outbuf);
  803. extern void ScScaleIDCT2x2i_C(int *inbuf, int *outbuf);
  804. extern void ScScaleIDCT3x3i_C(int *inbuf, int *outbuf);
  805. extern void ScScaleIDCT4x4i_C(int *inbuf, int *outbuf);
  806. extern void ScScaleIDCT6x6i_C(int *inbuf, int *outbuf);
  807. /*
  808. ** sc_idct2.s
  809. */
  810. extern void ScIDCT8x8s_S(short *inbuf, short *outbuf);
  811. extern void ScScaleIDCT8x8i_S(int *inbuf, int *outbuf);
  812. /*
  813. ** sc_idct3.s
  814. */
  815. extern void ScScaleIDCT8x8m_S(int *inbuf);
  816. /*
  817. ** sc_idctp2.s
  818. */
  819. extern void ScPatScaleIDCT8x8i_S(int *inbuf, int *outbuf);
  820. /*
  821. ** sc_fft.c
  822. */
  823. extern void ScFFTtrl(float *real,float *imag,int n,int max_fft,float *c1,
  824. float *s1,float *c2,float *s2,float *c3,float *s3);
  825. extern void ScFFTtl(float *real, float *imag, int n, int max_fft, float *c1,
  826. float *s1, float *c2, float *s2, float *c3, float *s3);
  827. extern void ScFFTt4l(float *real, float *imag, int n, int *angle_increment,
  828. int max_fft, float *c1, float *s1, float *c2, float *s2,
  829. float *c3, float *s3);
  830. /*
  831. ** sc_sort.c
  832. */
  833. extern void ScSortDoubles(ScSortDouble_t *a, int n);
  834. /*
  835. ** sc_copy.c
  836. */
  837. extern void ScCopyClip_C(int *buf, unsigned int *pos, int inc);
  838. extern void ScCopyClipToPacked422_C(int *buf, unsigned char *pos, int inc);
  839. extern void ScCopyAddClip_C(unsigned char *mvbuf, int *idctbuf,
  840. unsigned int *pbuf, int mvinc, int pwidth);
  841. extern void ScCopySubClip_C(unsigned char *mvbuf, float *idctbuf,
  842. unsigned int *pbuf, int mvinc, int pwidth);
  843. extern void ScCopyRev_C(unsigned int *yptr, float *Idctptr, int Inc);
  844. extern void ScCopyMV8_C(unsigned char *mvbuf, unsigned int *pbuf,
  845. int mvinc, int pwidth);
  846. extern void ScLoopFilter_C(unsigned char *input, unsigned int *work, int inc);
  847. extern void ScCopyBlock_C(unsigned char *linmemu, unsigned char *linmemv,
  848. int xpos, unsigned char *blkmemu,
  849. unsigned char *blkmemv, int cwidth, int wsis);
  850. extern void ScCopyMB_C(unsigned char *ysrc, int xpos, unsigned char *ymb,
  851. int ywidth, int yywidth);
  852. extern void ScCopyMB8_C(unsigned char *ysrc, unsigned char *ymb,
  853. int ywidth, int yywidth);
  854. extern void ScCopyMB16_C(unsigned char *ysrc, unsigned char *ymb,
  855. int ywidth, int yywidth);
  856. /*
  857. ** sc_copy2.s
  858. */
  859. extern void ScCopyClip_S(int *buf, unsigned int *pos, int inc);
  860. extern void ScCopyClipToPacked422_S(int *buf, unsigned char *pos, int inc);
  861. extern void ScCopyAddClip_S(unsigned char *mvbuf, int *idctbuf,
  862. unsigned int *pbuf, int mvinc, int pwidth);
  863. extern void ScCopySubClip_S(unsigned char *mvbuf, float *idctbuf,
  864. unsigned int *pbuf, int mvinc, int pinc);
  865. extern void ScCopyRev_S(unsigned int *yptr, float *Idctptr, int yinc);
  866. extern void ScLoopFilter_S(unsigned char *input, unsigned int *work, int inc);
  867. extern void ScCopyMV8_S(unsigned char *mvbuf, unsigned int *pbuf,
  868. int mvinc, int pwidth);
  869. extern void ScCopyMV16_S(unsigned char *mvbuf, unsigned int *pbuf,
  870. int mvinc, int pwidth);
  871. extern void ScCopyMB8_S(unsigned char *ysrc, unsigned char *ymb,
  872. int ywidth, int yywidth);
  873. extern void ScCopyMB16_S(unsigned char *ysrc, unsigned char *ymb,
  874. int ywidth, int yywidth);
  875. extern void ScAvgMV_S(unsigned char *, unsigned char *);
  876. /*
  877. ** sc_mc2.s
  878. */
  879. extern void ScMCy8(unsigned char *, unsigned char *, int);
  880. extern void ScMCy16(unsigned char *, unsigned char *, int);
  881. extern void ScMCx8(unsigned char *, unsigned char *, int);
  882. extern void ScMCx16(unsigned char *, unsigned char *, int);
  883. extern void ScMCxy8(unsigned char *, unsigned char *, int);
  884. extern void ScMCxy16(unsigned char *, unsigned char *, int);
  885. /*
  886. ** macros for using C or assembly versions
  887. */
  888. #ifdef USE_C
  889. #define ScCopyClip ScCopyClip_C
  890. #define ScCopyClipToPacked422 ScCopyClipToPacked422_C
  891. #define ScCopyAddClip ScCopyAddClip_C
  892. #define ScCopySubClip ScCopySubClip_C
  893. #define ScCopyRev ScCopyRev_C
  894. #define ScLoopFilter ScLoopFilter_C
  895. #define ScCopyMV8 ScCopyMV8_C
  896. #define ScCopyMV16 ScCopyMV16_C
  897. #define ScCopyMB8 ScCopyMB8_C
  898. #define ScCopyMB16 ScCopyMB16_C
  899. #define ScAvgMV ScAvgMV_C
  900. #define ScScaleIDCT8x8 ScScaleIDCT8x8_C
  901. #define ScScaleIDCT8x8i ScScaleIDCT8x8i_C
  902. #define ScScaleIDCT8x8i128 ScScaleIDCT8x8i128_C
  903. #define ScPatScaleIDCT8x8i ScScaleIDCT8x8i_C
  904. #define ScFDCT8x8 ScFDCT8x8_C
  905. #define ScFDCT8x8s ScFDCT8x8s_C
  906. #define ScIDCT8x8s ScIDCT8x8s_C
  907. #define ScIDCT8x8sAndCopy ScIDCT8x8sAndCopy_C
  908. #else /* USE_C */
  909. #define ScCopyClip ScCopyClip_S
  910. #define ScCopyClipToPacked422 ScCopyClipToPacked422_S
  911. #define ScCopyAddClip ScCopyAddClip_S
  912. #define ScCopySubClip ScCopySubClip_S
  913. #define ScCopyRev ScCopyRev_S
  914. #define ScLoopFilter ScLoopFilter_S
  915. #define ScCopyMV8 ScCopyMV8_S
  916. #define ScCopyMV16 ScCopyMV16_S
  917. #define ScCopyMB8 ScCopyMB8_S
  918. #define ScCopyMB16 ScCopyMB16_S
  919. #define ScAvgMV ScAvgMV_S
  920. #define ScScaleIDCT8x8 ScScaleIDCT8x8_C
  921. #define ScScaleIDCT8x8i ScScaleIDCT8x8i_C
  922. #define ScScaleIDCT8x8i128 ScScaleIDCT8x8i128_C
  923. #define ScPatScaleIDCT8x8i ScPatScaleIDCT8x8i_S
  924. #define ScFDCT8x8 ScFDCT8x8_S
  925. #define ScFDCT8x8s ScFDCT8x8s_C
  926. #define ScIDCT8x8s ScIDCT8x8s_S
  927. #define ScIDCT8x8sAndCopy ScIDCT8x8sAndCopy_S
  928. #endif /* USE_C */
  929. #endif /* _SC_H_ */