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.

1826 lines
71 KiB

  1. //==========================================================================;
  2. //
  3. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. // PURPOSE.
  7. //
  8. // Copyright (c) 1993-1999 Microsoft Corporation
  9. //
  10. //--------------------------------------------------------------------------;
  11. //
  12. // g711.c
  13. //
  14. // Description:
  15. // This file contains encode and decode routines for
  16. // CCITT Rec. G.711 (A-law and u-law).
  17. //
  18. //==========================================================================;
  19. #include <windows.h>
  20. #include <windowsx.h>
  21. #include <mmsystem.h>
  22. #include <mmreg.h>
  23. #include <msacm.h>
  24. #include <msacmdrv.h>
  25. #include "codec.h"
  26. #include "g711.h"
  27. #include "debug.h"
  28. typedef BYTE HUGE *HPBYTE;
  29. typedef WORD HUGE *HPWORD;
  30. //
  31. //
  32. //
  33. extern const SHORT BCODE AlawToPcmTable[256];
  34. extern const SHORT BCODE UlawToPcmTable[256];
  35. extern const BYTE BCODE AlawToUlawTable[256];
  36. extern const BYTE BCODE UlawToAlawTable[256];
  37. //==========================================================================;
  38. //
  39. //
  40. //
  41. //
  42. //==========================================================================;
  43. //--------------------------------------------------------------------------;
  44. //
  45. // LRESULT FNGLOBAL AlawToUlaw
  46. //
  47. // Description:
  48. // This function handles the ACMDM_STREAM_CONVERT message when
  49. // converting from A-law to u-law. This is the whole purpose
  50. // of writing an ACM driver--to convert data. This message
  51. // is sent after a stream has been opened (the driver receives and
  52. // succeeds the ACMDM_STREAM_OPEN message).
  53. //
  54. // Arguments:
  55. // LPACMDRVSTREAMINSTANCE padsi: Pointer to instance data for the
  56. // conversion stream. This structure was allocated by the ACM and
  57. // filled with the most common instance data needed for conversions.
  58. // The information in this structure is exactly the same as it was
  59. // during the ACMDM_STREAM_OPEN message--so it is not necessary
  60. // to re-verify the information referenced by this structure.
  61. //
  62. // LPACMDRVSTREAMHEADER padsh: Pointer to stream header structure
  63. // that defines the source data and destination buffer to convert.
  64. //
  65. // Return (LRESULT):
  66. // The return value is zero (MMSYSERR_NOERROR) if this function
  67. // succeeds with no errors. The return value is a non-zero error code
  68. // if the function fails.
  69. //
  70. //
  71. // History:
  72. // 08/01/93 Created.
  73. //
  74. //--------------------------------------------------------------------------;
  75. LRESULT FNGLOBAL AlawToUlaw
  76. (
  77. LPACMDRVSTREAMINSTANCE padsi,
  78. LPACMDRVSTREAMHEADER padsh
  79. )
  80. {
  81. HPBYTE hpbSrc, hpbDst;
  82. DWORD cb;
  83. DWORD i;
  84. PSTREAMINSTANCE psi;
  85. psi = (PSTREAMINSTANCE)padsi->dwDriver;
  86. cb = padsh->cbSrcLength;
  87. cb = G711_BYTESTOSAMPLES(padsi->pwfxSrc, cb);
  88. cb = G711_SAMPLESTOBYTES(padsi->pwfxSrc, cb);
  89. padsh->cbSrcLengthUsed = cb;
  90. if (cb > padsh->cbDstLength) return (ACMERR_NOTPOSSIBLE);
  91. hpbSrc = (HPBYTE) padsh->pbSrc;
  92. hpbDst = (HPBYTE) padsh->pbDst;
  93. for (i=cb; i>0; i--)
  94. *(hpbDst++) = AlawToUlawTable[*(hpbSrc++)];
  95. //
  96. // because the actual length of the converted data may not be the
  97. // exact same amount as the estimate we gave in codecQueryBufferSize,
  98. // we need to fill in the actual length we used for the destination
  99. // buffer.
  100. //
  101. padsh->cbDstLengthUsed = cb;
  102. return (MMSYSERR_NOERROR);
  103. } // AlawToUlaw()
  104. //--------------------------------------------------------------------------;
  105. //
  106. // LRESULT FNGLOBAL UlawToAlaw
  107. //
  108. // Description:
  109. // This function handles the ACMDM_STREAM_CONVERT message when
  110. // converting from u-law to A-law. This is the whole purpose
  111. // of writing an ACM driver--to convert data. This message
  112. // is sent after a stream has been opened (the driver receives and
  113. // succeeds the ACMDM_STREAM_OPEN message).
  114. //
  115. // Arguments:
  116. // LPACMDRVSTREAMINSTANCE padsi: Pointer to instance data for the
  117. // conversion stream. This structure was allocated by the ACM and
  118. // filled with the most common instance data needed for conversions.
  119. // The information in this structure is exactly the same as it was
  120. // during the ACMDM_STREAM_OPEN message--so it is not necessary
  121. // to re-verify the information referenced by this structure.
  122. //
  123. // LPACMDRVSTREAMHEADER padsh: Pointer to stream header structure
  124. // that defines the source data and destination buffer to convert.
  125. //
  126. // Return (LRESULT):
  127. // The return value is zero (MMSYSERR_NOERROR) if this function
  128. // succeeds with no errors. The return value is a non-zero error code
  129. // if the function fails.
  130. //
  131. //
  132. // History:
  133. // 08/01/93 Created.
  134. //
  135. //--------------------------------------------------------------------------;
  136. LRESULT FNGLOBAL UlawToAlaw
  137. (
  138. LPACMDRVSTREAMINSTANCE padsi,
  139. LPACMDRVSTREAMHEADER padsh
  140. )
  141. {
  142. HPBYTE hpbSrc, hpbDst;
  143. DWORD cb;
  144. DWORD i;
  145. PSTREAMINSTANCE psi;
  146. psi = (PSTREAMINSTANCE)padsi->dwDriver;
  147. cb = padsh->cbSrcLength;
  148. cb = G711_BYTESTOSAMPLES(padsi->pwfxSrc, cb);
  149. cb = G711_SAMPLESTOBYTES(padsi->pwfxSrc, cb);
  150. padsh->cbSrcLengthUsed = cb;
  151. if (cb > padsh->cbDstLength) return (ACMERR_NOTPOSSIBLE);
  152. hpbSrc = (HPBYTE) padsh->pbSrc;
  153. hpbDst = (HPBYTE) padsh->pbDst;
  154. for (i=cb; i>0; i--)
  155. *(hpbDst++) = UlawToAlawTable[*(hpbSrc++)];
  156. //
  157. // because the actual length of the converted data may not be the
  158. // exact same amount as the estimate we gave in codecQueryBufferSize,
  159. // we need to fill in the actual length we used for the destination
  160. // buffer.
  161. //
  162. padsh->cbDstLengthUsed = cb;
  163. return (MMSYSERR_NOERROR);
  164. } // UlawToAlaw()
  165. //--------------------------------------------------------------------------;
  166. //
  167. // LRESULT FNGLOBAL AlawToPcm
  168. //
  169. // Description:
  170. // This function handles the ACMDM_STREAM_CONVERT message when
  171. // converting from A-law to PCM. This is the whole purpose
  172. // of writing an ACM driver--to convert data. This message
  173. // is sent after a stream has been opened (the driver receives and
  174. // succeeds the ACMDM_STREAM_OPEN message).
  175. //
  176. // Arguments:
  177. // LPACMDRVSTREAMINSTANCE padsi: Pointer to instance data for the
  178. // conversion stream. This structure was allocated by the ACM and
  179. // filled with the most common instance data needed for conversions.
  180. // The information in this structure is exactly the same as it was
  181. // during the ACMDM_STREAM_OPEN message--so it is not necessary
  182. // to re-verify the information referenced by this structure.
  183. //
  184. // LPACMDRVSTREAMHEADER padsh: Pointer to stream header structure
  185. // that defines the source data and destination buffer to convert.
  186. //
  187. // Return (LRESULT):
  188. // The return value is zero (MMSYSERR_NOERROR) if this function
  189. // succeeds with no errors. The return value is a non-zero error code
  190. // if the function fails.
  191. //
  192. //
  193. // History:
  194. // 07/28/93 Created.
  195. //
  196. //--------------------------------------------------------------------------;
  197. LRESULT FNGLOBAL AlawToPcm
  198. (
  199. LPACMDRVSTREAMINSTANCE padsi,
  200. LPACMDRVSTREAMHEADER padsh
  201. )
  202. {
  203. HPWORD hpwDst;
  204. HPBYTE hpbSrc;
  205. DWORD cb;
  206. DWORD cSamples;
  207. DWORD i;
  208. PSTREAMINSTANCE psi;
  209. psi = (PSTREAMINSTANCE)padsi->dwDriver;
  210. cb = padsh->cbSrcLength;
  211. cSamples = G711_BYTESTOSAMPLES(padsi->pwfxSrc, cb);
  212. cb = PCM_SAMPLESTOBYTES((LPPCMWAVEFORMAT)padsi->pwfxDst, cSamples);
  213. if (cb > padsh->cbDstLength) return (ACMERR_NOTPOSSIBLE);
  214. cb = G711_SAMPLESTOBYTES(padsi->pwfxSrc, cSamples);
  215. padsh->cbSrcLengthUsed = cb;
  216. hpbSrc = (HPBYTE) padsh->pbSrc;
  217. hpwDst = (HPWORD) padsh->pbDst;
  218. for ( i=cb; i>0; i--)
  219. *(hpwDst++) = AlawToPcmTable[*(hpbSrc++)];
  220. //
  221. // because the actual length of the converted data may not be the
  222. // exact same amount as the estimate we gave in codecQueryBufferSize,
  223. // we need to fill in the actual length we used for the destination
  224. // buffer.
  225. //
  226. padsh->cbDstLengthUsed = (DWORD)(((HPBYTE)hpwDst) - (HPBYTE)padsh->pbDst);
  227. return (MMSYSERR_NOERROR);
  228. } // AlawToPcm()
  229. //--------------------------------------------------------------------------;
  230. //
  231. // LRESULT FNGLOBAL PcmToAlaw
  232. //
  233. // Description:
  234. // This function handles the ACMDM_STREAM_CONVERT message when
  235. // converting from PCM to A-law. This is the whole purpose
  236. // of writing an ACM driver--to convert data. This message
  237. // is sent after a stream has been opened (the driver receives and
  238. // succeeds the ACMDM_STREAM_OPEN message).
  239. //
  240. // Arguments:
  241. // LPACMDRVSTREAMINSTANCE padsi: Pointer to instance data for the
  242. // conversion stream. This structure was allocated by the ACM and
  243. // filled with the most common instance data needed for conversions.
  244. // The information in this structure is exactly the same as it was
  245. // during the ACMDM_STREAM_OPEN message--so it is not necessary
  246. // to re-verify the information referenced by this structure.
  247. //
  248. // LPACMDRVSTREAMHEADER padsh: Pointer to stream header structure
  249. // that defines the source data and destination buffer to convert.
  250. //
  251. // Return (LRESULT):
  252. // The return value is zero (MMSYSERR_NOERROR) if this function
  253. // succeeds with no errors. The return value is a non-zero error code
  254. // if the function fails.
  255. //
  256. //
  257. // History:
  258. // 07/28/93 Created.
  259. //
  260. //--------------------------------------------------------------------------;
  261. LRESULT FNGLOBAL PcmToAlaw
  262. (
  263. LPACMDRVSTREAMINSTANCE padsi,
  264. LPACMDRVSTREAMHEADER padsh
  265. )
  266. {
  267. HPBYTE hpbDst;
  268. HPWORD hpwSrc;
  269. DWORD cb;
  270. DWORD cSamples;
  271. DWORD i;
  272. signed short int wSample;
  273. BYTE alaw;
  274. PSTREAMINSTANCE psi;
  275. psi = (PSTREAMINSTANCE)padsi->dwDriver;
  276. cb = padsh->cbSrcLength;
  277. cSamples = PCM_BYTESTOSAMPLES((LPPCMWAVEFORMAT)padsi->pwfxSrc, cb);
  278. cb = G711_SAMPLESTOBYTES(padsi->pwfxDst, cSamples);
  279. if (cb > padsh->cbDstLength) return (ACMERR_NOTPOSSIBLE);
  280. cb = PCM_SAMPLESTOBYTES((LPPCMWAVEFORMAT)padsi->pwfxSrc, cSamples);
  281. padsh->cbSrcLengthUsed = cb;
  282. // hpwSrc, hpdDst will walk thru src and dst buffers
  283. hpbDst = (HPBYTE) padsh->pbDst;
  284. hpwSrc = (HPWORD) padsh->pbSrc;
  285. //
  286. //
  287. // Compression from 16-bit PCM
  288. //
  289. //
  290. // Walk thru the source buffer. Since the source buffer has 16-bit PCM we
  291. // need to convert cb/2 samples.
  292. for (i=cb/2; i>0; i--)
  293. {
  294. // Get a signed 16-bit PCM sample from the src buffer
  295. wSample = (signed short int) *(hpwSrc++);
  296. // We'll init our A-law value per the sign of the PCM sample. A-law
  297. // characters have the MSB=1 for positive PCM data. Also, we'll
  298. // convert our signed 16-bit PCM value to it's absolute value and
  299. // then work on that to get the rest of the A-law character bits.
  300. if (wSample < 0)
  301. {
  302. alaw = 0x00;
  303. wSample = -wSample;
  304. if (wSample < 0) wSample = 0x7FFF;
  305. }
  306. else
  307. {
  308. alaw = 0x80;
  309. }
  310. // Now we test the PCM sample amplitude and create the A-law character.
  311. // Study the CCITT A-law for more detail.
  312. if (wSample >= 2048)
  313. // 2048 <= wSample < 32768
  314. {
  315. if (wSample >= 8192)
  316. // 8192 <= wSample < 32768
  317. {
  318. if (wSample >= 16384)
  319. // 16384 <= wSample < 32768
  320. {
  321. alaw |= 0x70 | ((wSample >> 10) & 0x0F);
  322. }
  323. else
  324. // 8192 <= wSample < 16384
  325. {
  326. alaw |= 0x60 | ((wSample >> 9) & 0x0F);
  327. }
  328. }
  329. else
  330. // 2048 <= wSample < 8192
  331. {
  332. if (wSample >= 4096)
  333. // 4096 <= wSample < 8192
  334. {
  335. alaw |= 0x50 | ((wSample >> 8) & 0x0F);
  336. }
  337. else
  338. // 2048 <= wSample < 4096
  339. {
  340. alaw |= 0x40 | ((wSample >> 7) & 0x0F);
  341. }
  342. }
  343. }
  344. else
  345. // 0 <= wSample < 2048
  346. {
  347. if (wSample >= 512)
  348. // 512 <= wSample < 2048
  349. {
  350. if (wSample >= 1024)
  351. // 1024 <= wSample < 2048
  352. {
  353. alaw |= 0x30 | ((wSample >> 6) & 0x0F);
  354. }
  355. else
  356. // 512 <= wSample < 1024
  357. {
  358. alaw |= 0x20 | ((wSample >> 5) & 0x0F);
  359. }
  360. }
  361. else
  362. // 0 <= wSample < 512
  363. {
  364. alaw |= 0x00 | ((wSample >> 4) & 0x1F);
  365. }
  366. }
  367. *(hpbDst++) = alaw ^ 0x55; // Invert even bits
  368. } // end for
  369. //
  370. // because the actual length of the converted data may not be the
  371. // exact same amount as the estimate we gave in codecQueryBufferSize,
  372. // we need to fill in the actual length we used for the destination
  373. // buffer.
  374. //
  375. padsh->cbDstLengthUsed = (DWORD)(hpbDst - (HPBYTE)padsh->pbDst);
  376. return (MMSYSERR_NOERROR);
  377. } // PcmToAlaw()
  378. //--------------------------------------------------------------------------;
  379. //
  380. // LRESULT FNGLOBAL UlawToPcm
  381. //
  382. // Description:
  383. // This function handles the ACMDM_STREAM_CONVERT message when
  384. // converting from u-law to PCM. This is the whole purpose
  385. // of writing an ACM driver--to convert data. This message
  386. // is sent after a stream has been opened (the driver receives and
  387. // succeeds the ACMDM_STREAM_OPEN message).
  388. //
  389. // Arguments:
  390. // LPACMDRVSTREAMINSTANCE padsi: Pointer to instance data for the
  391. // conversion stream. This structure was allocated by the ACM and
  392. // filled with the most common instance data needed for conversions.
  393. // The information in this structure is exactly the same as it was
  394. // during the ACMDM_STREAM_OPEN message--so it is not necessary
  395. // to re-verify the information referenced by this structure.
  396. //
  397. // LPACMDRVSTREAMHEADER padsh: Pointer to stream header structure
  398. // that defines the source data and destination buffer to convert.
  399. //
  400. // Return (LRESULT):
  401. // The return value is zero (MMSYSERR_NOERROR) if this function
  402. // succeeds with no errors. The return value is a non-zero error code
  403. // if the function fails.
  404. //
  405. //
  406. // History:
  407. // 08/01/93 Created.
  408. //
  409. //--------------------------------------------------------------------------;
  410. LRESULT FNGLOBAL UlawToPcm
  411. (
  412. LPACMDRVSTREAMINSTANCE padsi,
  413. LPACMDRVSTREAMHEADER padsh
  414. )
  415. {
  416. HPBYTE hpbSrc;
  417. HPWORD hpwDst;
  418. DWORD cb;
  419. DWORD cSamples;
  420. DWORD i;
  421. PSTREAMINSTANCE psi;
  422. psi = (PSTREAMINSTANCE)padsi->dwDriver;
  423. cb = padsh->cbSrcLength;
  424. cSamples = G711_BYTESTOSAMPLES(padsi->pwfxSrc, cb);
  425. cb = PCM_SAMPLESTOBYTES((LPPCMWAVEFORMAT)padsi->pwfxDst, cSamples);
  426. if (cb > padsh->cbDstLength) return (ACMERR_NOTPOSSIBLE);
  427. cb = G711_SAMPLESTOBYTES(padsi->pwfxSrc, cSamples);
  428. padsh->cbSrcLengthUsed = cb;
  429. hpbSrc = (HPBYTE) padsh->pbSrc;
  430. hpwDst = (HPWORD) padsh->pbDst;
  431. for ( i=cb; i>0; i--)
  432. *(hpwDst++) = UlawToPcmTable[*(hpbSrc++)];
  433. //
  434. // because the actual length of the converted data may not be the
  435. // exact same amount as the estimate we gave in codecQueryBufferSize,
  436. // we need to fill in the actual length we used for the destination
  437. // buffer.
  438. //
  439. padsh->cbDstLengthUsed = (DWORD)(((HPBYTE)hpwDst) - (HPBYTE)padsh->pbDst);
  440. return (MMSYSERR_NOERROR);
  441. } // UlawToPcm()
  442. //--------------------------------------------------------------------------;
  443. //
  444. // LRESULT FNGLOBAL PcmToUlaw
  445. //
  446. // Description:
  447. // This function handles the ACMDM_STREAM_CONVERT message when
  448. // converting from PCM to u-law. This is the whole purpose
  449. // of writing an ACM driver--to convert data. This message
  450. // is sent after a stream has been opened (the driver receives and
  451. // succeeds the ACMDM_STREAM_OPEN message).
  452. //
  453. // Arguments:
  454. // LPACMDRVSTREAMINSTANCE padsi: Pointer to instance data for the
  455. // conversion stream. This structure was allocated by the ACM and
  456. // filled with the most common instance data needed for conversions.
  457. // The information in this structure is exactly the same as it was
  458. // during the ACMDM_STREAM_OPEN message--so it is not necessary
  459. // to re-verify the information referenced by this structure.
  460. //
  461. // LPACMDRVSTREAMHEADER padsh: Pointer to stream header structure
  462. // that defines the source data and destination buffer to convert.
  463. //
  464. // Return (LRESULT):
  465. // The return value is zero (MMSYSERR_NOERROR) if this function
  466. // succeeds with no errors. The return value is a non-zero error code
  467. // if the function fails.
  468. //
  469. //
  470. // History:
  471. // 08/01/93 Created.
  472. //
  473. //--------------------------------------------------------------------------;
  474. LRESULT FNGLOBAL PcmToUlaw
  475. (
  476. LPACMDRVSTREAMINSTANCE padsi,
  477. LPACMDRVSTREAMHEADER padsh
  478. )
  479. {
  480. HPWORD hpwSrc;
  481. HPBYTE hpbDst;
  482. DWORD cb;
  483. DWORD cSamples;
  484. DWORD i;
  485. signed short int wSample;
  486. BYTE ulaw;
  487. PSTREAMINSTANCE psi;
  488. psi = (PSTREAMINSTANCE)padsi->dwDriver;
  489. //
  490. // For now we are using a straight-forward/brute-force method
  491. // for converting from 16-bit PCM to u-law. This can probably
  492. // be made more efficient if some thought is put into it...
  493. //
  494. cb = padsh->cbSrcLength;
  495. cSamples = PCM_BYTESTOSAMPLES((LPPCMWAVEFORMAT)padsi->pwfxSrc, cb);
  496. cb = G711_SAMPLESTOBYTES(padsi->pwfxDst, cSamples);
  497. if (cb > padsh->cbDstLength) return (ACMERR_NOTPOSSIBLE);
  498. cb = PCM_SAMPLESTOBYTES((LPPCMWAVEFORMAT)padsi->pwfxSrc, cSamples);
  499. padsh->cbSrcLengthUsed = cb;
  500. // hpwSrc and hpbDst will walk thru the src and dst buffers
  501. hpwSrc = (HPWORD) padsh->pbSrc;
  502. hpbDst = (HPBYTE) padsh->pbDst;
  503. //
  504. //
  505. // Handle compression from 16-bit PCM
  506. //
  507. //
  508. // Walk thru the source buffer. Since the source buffer has 16-bit PCM we
  509. // need to convert cb/2 samples.
  510. for (i=cb/2; i>0; i--)
  511. {
  512. // Get a signed 16-bit PCM sample from the src buffer
  513. wSample = (signed short int) *(hpwSrc++);
  514. // We'll init our u-law value per the sign of the PCM sample. u-law
  515. // characters have the MSB=1 for positive PCM data. Also, we'll
  516. // convert our signed 16-bit PCM value to it's absolute value and
  517. // then work on that to get the rest of the u-law character bits.
  518. if (wSample < 0)
  519. {
  520. ulaw = 0x00;
  521. wSample = -wSample;
  522. if (wSample < 0) wSample = 0x7FFF;
  523. }
  524. else
  525. {
  526. ulaw = 0x80;
  527. }
  528. // For now, let's shift this 16-bit value
  529. // so that it is within the range defined
  530. // by CCITT u-law.
  531. wSample = wSample >> 2;
  532. // Now we test the PCM sample amplitude and create the u-law character.
  533. // Study the CCITT u-law for more details.
  534. if (wSample >= 8159)
  535. goto Gotulaw;
  536. if (wSample >= 4063)
  537. {
  538. ulaw |= 0x00 + 15-((wSample-4063)/256);
  539. goto Gotulaw;
  540. }
  541. if (wSample >= 2015)
  542. {
  543. ulaw |= 0x10 + 15-((wSample-2015)/128);
  544. goto Gotulaw;
  545. }
  546. if (wSample >= 991)
  547. {
  548. ulaw |= 0x20 + 15-((wSample-991)/64);
  549. goto Gotulaw;
  550. }
  551. if (wSample >= 479)
  552. {
  553. ulaw |= 0x30 + 15-((wSample-479)/32);
  554. goto Gotulaw;
  555. }
  556. if (wSample >= 223)
  557. {
  558. ulaw |= 0x40 + 15-((wSample-223)/16);
  559. goto Gotulaw;
  560. }
  561. if (wSample >= 95)
  562. {
  563. ulaw |= 0x50 + 15-((wSample-95)/8);
  564. goto Gotulaw;
  565. }
  566. if (wSample >= 31)
  567. {
  568. ulaw |= 0x60 + 15-((wSample-31)/4);
  569. goto Gotulaw;
  570. }
  571. ulaw |= 0x70 + 15-((wSample)/2);
  572. Gotulaw:
  573. *(hpbDst++) = ulaw;
  574. }
  575. //
  576. // because the actual length of the converted data may not be the
  577. // exact same amount as the estimate we gave in codecQueryBufferSize,
  578. // we need to fill in the actual length we used for the destination
  579. // buffer.
  580. //
  581. padsh->cbDstLengthUsed = (DWORD)(hpbDst - (HPBYTE) padsh->pbDst);
  582. return (MMSYSERR_NOERROR);
  583. } // PcmToUlaw()
  584. //==========================================================================;
  585. //
  586. //
  587. //
  588. //
  589. //==========================================================================;
  590. //--------------------------------------------------------------------------;
  591. //
  592. // Name:
  593. // AlawToPcmTable
  594. //
  595. //
  596. // Description:
  597. // this array maps A-law characters to 16-bit PCM
  598. //
  599. //
  600. // Arguments:
  601. // the index into the array is an A-law character
  602. //
  603. // Return:
  604. // an element of the array is a 16-bit PCM value
  605. //
  606. // Notes:
  607. //
  608. //
  609. // History:
  610. // 07/28/93 Created.
  611. //
  612. //
  613. //--------------------------------------------------------------------------;
  614. const SHORT BCODE AlawToPcmTable[256] =
  615. {
  616. -5504, // y[00]= -688
  617. -5248, // y[01]= -656
  618. -6016, // y[02]= -752
  619. -5760, // y[03]= -720
  620. -4480, // y[04]= -560
  621. -4224, // y[05]= -528
  622. -4992, // y[06]= -624
  623. -4736, // y[07]= -592
  624. -7552, // y[08]= -944
  625. -7296, // y[09]= -912
  626. -8064, // y[0a]= -1008
  627. -7808, // y[0b]= -976
  628. -6528, // y[0c]= -816
  629. -6272, // y[0d]= -784
  630. -7040, // y[0e]= -880
  631. -6784, // y[0f]= -848
  632. -2752, // y[10]= -344
  633. -2624, // y[11]= -328
  634. -3008, // y[12]= -376
  635. -2880, // y[13]= -360
  636. -2240, // y[14]= -280
  637. -2112, // y[15]= -264
  638. -2496, // y[16]= -312
  639. -2368, // y[17]= -296
  640. -3776, // y[18]= -472
  641. -3648, // y[19]= -456
  642. -4032, // y[1a]= -504
  643. -3904, // y[1b]= -488
  644. -3264, // y[1c]= -408
  645. -3136, // y[1d]= -392
  646. -3520, // y[1e]= -440
  647. -3392, // y[1f]= -424
  648. -22016, // y[20]= -2752
  649. -20992, // y[21]= -2624
  650. -24064, // y[22]= -3008
  651. -23040, // y[23]= -2880
  652. -17920, // y[24]= -2240
  653. -16896, // y[25]= -2112
  654. -19968, // y[26]= -2496
  655. -18944, // y[27]= -2368
  656. -30208, // y[28]= -3776
  657. -29184, // y[29]= -3648
  658. -32256, // y[2a]= -4032
  659. -31232, // y[2b]= -3904
  660. -26112, // y[2c]= -3264
  661. -25088, // y[2d]= -3136
  662. -28160, // y[2e]= -3520
  663. -27136, // y[2f]= -3392
  664. -11008, // y[30]= -1376
  665. -10496, // y[31]= -1312
  666. -12032, // y[32]= -1504
  667. -11520, // y[33]= -1440
  668. -8960, // y[34]= -1120
  669. -8448, // y[35]= -1056
  670. -9984, // y[36]= -1248
  671. -9472, // y[37]= -1184
  672. -15104, // y[38]= -1888
  673. -14592, // y[39]= -1824
  674. -16128, // y[3a]= -2016
  675. -15616, // y[3b]= -1952
  676. -13056, // y[3c]= -1632
  677. -12544, // y[3d]= -1568
  678. -14080, // y[3e]= -1760
  679. -13568, // y[3f]= -1696
  680. -344, // y[40]= -43
  681. -328, // y[41]= -41
  682. -376, // y[42]= -47
  683. -360, // y[43]= -45
  684. -280, // y[44]= -35
  685. -264, // y[45]= -33
  686. -312, // y[46]= -39
  687. -296, // y[47]= -37
  688. -472, // y[48]= -59
  689. -456, // y[49]= -57
  690. -504, // y[4a]= -63
  691. -488, // y[4b]= -61
  692. -408, // y[4c]= -51
  693. -392, // y[4d]= -49
  694. -440, // y[4e]= -55
  695. -424, // y[4f]= -53
  696. -88, // y[50]= -11
  697. -72, // y[51]= -9
  698. -120, // y[52]= -15
  699. -104, // y[53]= -13
  700. -24, // y[54]= -3
  701. -8, // y[55]= -1
  702. -56, // y[56]= -7
  703. -40, // y[57]= -5
  704. -216, // y[58]= -27
  705. -200, // y[59]= -25
  706. -248, // y[5a]= -31
  707. -232, // y[5b]= -29
  708. -152, // y[5c]= -19
  709. -136, // y[5d]= -17
  710. -184, // y[5e]= -23
  711. -168, // y[5f]= -21
  712. -1376, // y[60]= -172
  713. -1312, // y[61]= -164
  714. -1504, // y[62]= -188
  715. -1440, // y[63]= -180
  716. -1120, // y[64]= -140
  717. -1056, // y[65]= -132
  718. -1248, // y[66]= -156
  719. -1184, // y[67]= -148
  720. -1888, // y[68]= -236
  721. -1824, // y[69]= -228
  722. -2016, // y[6a]= -252
  723. -1952, // y[6b]= -244
  724. -1632, // y[6c]= -204
  725. -1568, // y[6d]= -196
  726. -1760, // y[6e]= -220
  727. -1696, // y[6f]= -212
  728. -688, // y[70]= -86
  729. -656, // y[71]= -82
  730. -752, // y[72]= -94
  731. -720, // y[73]= -90
  732. -560, // y[74]= -70
  733. -528, // y[75]= -66
  734. -624, // y[76]= -78
  735. -592, // y[77]= -74
  736. -944, // y[78]= -118
  737. -912, // y[79]= -114
  738. -1008, // y[7a]= -126
  739. -976, // y[7b]= -122
  740. -816, // y[7c]= -102
  741. -784, // y[7d]= -98
  742. -880, // y[7e]= -110
  743. -848, // y[7f]= -106
  744. 5504, // y[80]= 688
  745. 5248, // y[81]= 656
  746. 6016, // y[82]= 752
  747. 5760, // y[83]= 720
  748. 4480, // y[84]= 560
  749. 4224, // y[85]= 528
  750. 4992, // y[86]= 624
  751. 4736, // y[87]= 592
  752. 7552, // y[88]= 944
  753. 7296, // y[89]= 912
  754. 8064, // y[8a]= 1008
  755. 7808, // y[8b]= 976
  756. 6528, // y[8c]= 816
  757. 6272, // y[8d]= 784
  758. 7040, // y[8e]= 880
  759. 6784, // y[8f]= 848
  760. 2752, // y[90]= 344
  761. 2624, // y[91]= 328
  762. 3008, // y[92]= 376
  763. 2880, // y[93]= 360
  764. 2240, // y[94]= 280
  765. 2112, // y[95]= 264
  766. 2496, // y[96]= 312
  767. 2368, // y[97]= 296
  768. 3776, // y[98]= 472
  769. 3648, // y[99]= 456
  770. 4032, // y[9a]= 504
  771. 3904, // y[9b]= 488
  772. 3264, // y[9c]= 408
  773. 3136, // y[9d]= 392
  774. 3520, // y[9e]= 440
  775. 3392, // y[9f]= 424
  776. 22016, // y[a0]= 2752
  777. 20992, // y[a1]= 2624
  778. 24064, // y[a2]= 3008
  779. 23040, // y[a3]= 2880
  780. 17920, // y[a4]= 2240
  781. 16896, // y[a5]= 2112
  782. 19968, // y[a6]= 2496
  783. 18944, // y[a7]= 2368
  784. 30208, // y[a8]= 3776
  785. 29184, // y[a9]= 3648
  786. 32256, // y[aa]= 4032
  787. 31232, // y[ab]= 3904
  788. 26112, // y[ac]= 3264
  789. 25088, // y[ad]= 3136
  790. 28160, // y[ae]= 3520
  791. 27136, // y[af]= 3392
  792. 11008, // y[b0]= 1376
  793. 10496, // y[b1]= 1312
  794. 12032, // y[b2]= 1504
  795. 11520, // y[b3]= 1440
  796. 8960, // y[b4]= 1120
  797. 8448, // y[b5]= 1056
  798. 9984, // y[b6]= 1248
  799. 9472, // y[b7]= 1184
  800. 15104, // y[b8]= 1888
  801. 14592, // y[b9]= 1824
  802. 16128, // y[ba]= 2016
  803. 15616, // y[bb]= 1952
  804. 13056, // y[bc]= 1632
  805. 12544, // y[bd]= 1568
  806. 14080, // y[be]= 1760
  807. 13568, // y[bf]= 1696
  808. 344, // y[c0]= 43
  809. 328, // y[c1]= 41
  810. 376, // y[c2]= 47
  811. 360, // y[c3]= 45
  812. 280, // y[c4]= 35
  813. 264, // y[c5]= 33
  814. 312, // y[c6]= 39
  815. 296, // y[c7]= 37
  816. 472, // y[c8]= 59
  817. 456, // y[c9]= 57
  818. 504, // y[ca]= 63
  819. 488, // y[cb]= 61
  820. 408, // y[cc]= 51
  821. 392, // y[cd]= 49
  822. 440, // y[ce]= 55
  823. 424, // y[cf]= 53
  824. 88, // y[d0]= 11
  825. 72, // y[d1]= 9
  826. 120, // y[d2]= 15
  827. 104, // y[d3]= 13
  828. 24, // y[d4]= 3
  829. 8, // y[d5]= 1
  830. 56, // y[d6]= 7
  831. 40, // y[d7]= 5
  832. 216, // y[d8]= 27
  833. 200, // y[d9]= 25
  834. 248, // y[da]= 31
  835. 232, // y[db]= 29
  836. 152, // y[dc]= 19
  837. 136, // y[dd]= 17
  838. 184, // y[de]= 23
  839. 168, // y[df]= 21
  840. 1376, // y[e0]= 172
  841. 1312, // y[e1]= 164
  842. 1504, // y[e2]= 188
  843. 1440, // y[e3]= 180
  844. 1120, // y[e4]= 140
  845. 1056, // y[e5]= 132
  846. 1248, // y[e6]= 156
  847. 1184, // y[e7]= 148
  848. 1888, // y[e8]= 236
  849. 1824, // y[e9]= 228
  850. 2016, // y[ea]= 252
  851. 1952, // y[eb]= 244
  852. 1632, // y[ec]= 204
  853. 1568, // y[ed]= 196
  854. 1760, // y[ee]= 220
  855. 1696, // y[ef]= 212
  856. 688, // y[f0]= 86
  857. 656, // y[f1]= 82
  858. 752, // y[f2]= 94
  859. 720, // y[f3]= 90
  860. 560, // y[f4]= 70
  861. 528, // y[f5]= 66
  862. 624, // y[f6]= 78
  863. 592, // y[f7]= 74
  864. 944, // y[f8]= 118
  865. 912, // y[f9]= 114
  866. 1008, // y[fa]= 126
  867. 976, // y[fb]= 122
  868. 816, // y[fc]= 102
  869. 784, // y[fd]= 98
  870. 880, // y[fe]= 110
  871. 848 // y[ff]= 106
  872. };
  873. //--------------------------------------------------------------------------;
  874. //
  875. // Name:
  876. // UlawToPcmTable
  877. //
  878. //
  879. // Description:
  880. // this array maps u-law characters to 16-bit PCM
  881. //
  882. // Arguments:
  883. // the index into the array is a u-law character
  884. //
  885. // Return:
  886. // an element of the array is a 16-bit PCM value
  887. //
  888. // Notes:
  889. //
  890. //
  891. // History:
  892. // 07/28/93 Created.
  893. //
  894. //
  895. //--------------------------------------------------------------------------;
  896. const SHORT BCODE UlawToPcmTable[256] =
  897. {
  898. -32124, // y[00]= -8031
  899. -31100, // y[01]= -7775
  900. -30076, // y[02]= -7519
  901. -29052, // y[03]= -7263
  902. -28028, // y[04]= -7007
  903. -27004, // y[05]= -6751
  904. -25980, // y[06]= -6495
  905. -24956, // y[07]= -6239
  906. -23932, // y[08]= -5983
  907. -22908, // y[09]= -5727
  908. -21884, // y[0a]= -5471
  909. -20860, // y[0b]= -5215
  910. -19836, // y[0c]= -4959
  911. -18812, // y[0d]= -4703
  912. -17788, // y[0e]= -4447
  913. -16764, // y[0f]= -4191
  914. -15996, // y[10]= -3999
  915. -15484, // y[11]= -3871
  916. -14972, // y[12]= -3743
  917. -14460, // y[13]= -3615
  918. -13948, // y[14]= -3487
  919. -13436, // y[15]= -3359
  920. -12924, // y[16]= -3231
  921. -12412, // y[17]= -3103
  922. -11900, // y[18]= -2975
  923. -11388, // y[19]= -2847
  924. -10876, // y[1a]= -2719
  925. -10364, // y[1b]= -2591
  926. -9852, // y[1c]= -2463
  927. -9340, // y[1d]= -2335
  928. -8828, // y[1e]= -2207
  929. -8316, // y[1f]= -2079
  930. -7932, // y[20]= -1983
  931. -7676, // y[21]= -1919
  932. -7420, // y[22]= -1855
  933. -7164, // y[23]= -1791
  934. -6908, // y[24]= -1727
  935. -6652, // y[25]= -1663
  936. -6396, // y[26]= -1599
  937. -6140, // y[27]= -1535
  938. -5884, // y[28]= -1471
  939. -5628, // y[29]= -1407
  940. -5372, // y[2a]= -1343
  941. -5116, // y[2b]= -1279
  942. -4860, // y[2c]= -1215
  943. -4604, // y[2d]= -1151
  944. -4348, // y[2e]= -1087
  945. -4092, // y[2f]= -1023
  946. -3900, // y[30]= -975
  947. -3772, // y[31]= -943
  948. -3644, // y[32]= -911
  949. -3516, // y[33]= -879
  950. -3388, // y[34]= -847
  951. -3260, // y[35]= -815
  952. -3132, // y[36]= -783
  953. -3004, // y[37]= -751
  954. -2876, // y[38]= -719
  955. -2748, // y[39]= -687
  956. -2620, // y[3a]= -655
  957. -2492, // y[3b]= -623
  958. -2364, // y[3c]= -591
  959. -2236, // y[3d]= -559
  960. -2108, // y[3e]= -527
  961. -1980, // y[3f]= -495
  962. -1884, // y[40]= -471
  963. -1820, // y[41]= -455
  964. -1756, // y[42]= -439
  965. -1692, // y[43]= -423
  966. -1628, // y[44]= -407
  967. -1564, // y[45]= -391
  968. -1500, // y[46]= -375
  969. -1436, // y[47]= -359
  970. -1372, // y[48]= -343
  971. -1308, // y[49]= -327
  972. -1244, // y[4a]= -311
  973. -1180, // y[4b]= -295
  974. -1116, // y[4c]= -279
  975. -1052, // y[4d]= -263
  976. -988, // y[4e]= -247
  977. -924, // y[4f]= -231
  978. -876, // y[50]= -219
  979. -844, // y[51]= -211
  980. -812, // y[52]= -203
  981. -780, // y[53]= -195
  982. -748, // y[54]= -187
  983. -716, // y[55]= -179
  984. -684, // y[56]= -171
  985. -652, // y[57]= -163
  986. -620, // y[58]= -155
  987. -588, // y[59]= -147
  988. -556, // y[5a]= -139
  989. -524, // y[5b]= -131
  990. -492, // y[5c]= -123
  991. -460, // y[5d]= -115
  992. -428, // y[5e]= -107
  993. -396, // y[5f]= -99
  994. -372, // y[60]= -93
  995. -356, // y[61]= -89
  996. -340, // y[62]= -85
  997. -324, // y[63]= -81
  998. -308, // y[64]= -77
  999. -292, // y[65]= -73
  1000. -276, // y[66]= -69
  1001. -260, // y[67]= -65
  1002. -244, // y[68]= -61
  1003. -228, // y[69]= -57
  1004. -212, // y[6a]= -53
  1005. -196, // y[6b]= -49
  1006. -180, // y[6c]= -45
  1007. -164, // y[6d]= -41
  1008. -148, // y[6e]= -37
  1009. -132, // y[6f]= -33
  1010. -120, // y[70]= -30
  1011. -112, // y[71]= -28
  1012. -104, // y[72]= -26
  1013. -96, // y[73]= -24
  1014. -88, // y[74]= -22
  1015. -80, // y[75]= -20
  1016. -72, // y[76]= -18
  1017. -64, // y[77]= -16
  1018. -56, // y[78]= -14
  1019. -48, // y[79]= -12
  1020. -40, // y[7a]= -10
  1021. -32, // y[7b]= -8
  1022. -24, // y[7c]= -6
  1023. -16, // y[7d]= -4
  1024. -8, // y[7e]= -2
  1025. 0, // y[7f]= 0
  1026. 32124, // y[80]= 8031
  1027. 31100, // y[81]= 7775
  1028. 30076, // y[82]= 7519
  1029. 29052, // y[83]= 7263
  1030. 28028, // y[84]= 7007
  1031. 27004, // y[85]= 6751
  1032. 25980, // y[86]= 6495
  1033. 24956, // y[87]= 6239
  1034. 23932, // y[88]= 5983
  1035. 22908, // y[89]= 5727
  1036. 21884, // y[8a]= 5471
  1037. 20860, // y[8b]= 5215
  1038. 19836, // y[8c]= 4959
  1039. 18812, // y[8d]= 4703
  1040. 17788, // y[8e]= 4447
  1041. 16764, // y[8f]= 4191
  1042. 15996, // y[90]= 3999
  1043. 15484, // y[91]= 3871
  1044. 14972, // y[92]= 3743
  1045. 14460, // y[93]= 3615
  1046. 13948, // y[94]= 3487
  1047. 13436, // y[95]= 3359
  1048. 12924, // y[96]= 3231
  1049. 12412, // y[97]= 3103
  1050. 11900, // y[98]= 2975
  1051. 11388, // y[99]= 2847
  1052. 10876, // y[9a]= 2719
  1053. 10364, // y[9b]= 2591
  1054. 9852, // y[9c]= 2463
  1055. 9340, // y[9d]= 2335
  1056. 8828, // y[9e]= 2207
  1057. 8316, // y[9f]= 2079
  1058. 7932, // y[a0]= 1983
  1059. 7676, // y[a1]= 1919
  1060. 7420, // y[a2]= 1855
  1061. 7164, // y[a3]= 1791
  1062. 6908, // y[a4]= 1727
  1063. 6652, // y[a5]= 1663
  1064. 6396, // y[a6]= 1599
  1065. 6140, // y[a7]= 1535
  1066. 5884, // y[a8]= 1471
  1067. 5628, // y[a9]= 1407
  1068. 5372, // y[aa]= 1343
  1069. 5116, // y[ab]= 1279
  1070. 4860, // y[ac]= 1215
  1071. 4604, // y[ad]= 1151
  1072. 4348, // y[ae]= 1087
  1073. 4092, // y[af]= 1023
  1074. 3900, // y[b0]= 975
  1075. 3772, // y[b1]= 943
  1076. 3644, // y[b2]= 911
  1077. 3516, // y[b3]= 879
  1078. 3388, // y[b4]= 847
  1079. 3260, // y[b5]= 815
  1080. 3132, // y[b6]= 783
  1081. 3004, // y[b7]= 751
  1082. 2876, // y[b8]= 719
  1083. 2748, // y[b9]= 687
  1084. 2620, // y[ba]= 655
  1085. 2492, // y[bb]= 623
  1086. 2364, // y[bc]= 591
  1087. 2236, // y[bd]= 559
  1088. 2108, // y[be]= 527
  1089. 1980, // y[bf]= 495
  1090. 1884, // y[c0]= 471
  1091. 1820, // y[c1]= 455
  1092. 1756, // y[c2]= 439
  1093. 1692, // y[c3]= 423
  1094. 1628, // y[c4]= 407
  1095. 1564, // y[c5]= 391
  1096. 1500, // y[c6]= 375
  1097. 1436, // y[c7]= 359
  1098. 1372, // y[c8]= 343
  1099. 1308, // y[c9]= 327
  1100. 1244, // y[ca]= 311
  1101. 1180, // y[cb]= 295
  1102. 1116, // y[cc]= 279
  1103. 1052, // y[cd]= 263
  1104. 988, // y[ce]= 247
  1105. 924, // y[cf]= 231
  1106. 876, // y[d0]= 219
  1107. 844, // y[d1]= 211
  1108. 812, // y[d2]= 203
  1109. 780, // y[d3]= 195
  1110. 748, // y[d4]= 187
  1111. 716, // y[d5]= 179
  1112. 684, // y[d6]= 171
  1113. 652, // y[d7]= 163
  1114. 620, // y[d8]= 155
  1115. 588, // y[d9]= 147
  1116. 556, // y[da]= 139
  1117. 524, // y[db]= 131
  1118. 492, // y[dc]= 123
  1119. 460, // y[dd]= 115
  1120. 428, // y[de]= 107
  1121. 396, // y[df]= 99
  1122. 372, // y[e0]= 93
  1123. 356, // y[e1]= 89
  1124. 340, // y[e2]= 85
  1125. 324, // y[e3]= 81
  1126. 308, // y[e4]= 77
  1127. 292, // y[e5]= 73
  1128. 276, // y[e6]= 69
  1129. 260, // y[e7]= 65
  1130. 244, // y[e8]= 61
  1131. 228, // y[e9]= 57
  1132. 212, // y[ea]= 53
  1133. 196, // y[eb]= 49
  1134. 180, // y[ec]= 45
  1135. 164, // y[ed]= 41
  1136. 148, // y[ee]= 37
  1137. 132, // y[ef]= 33
  1138. 120, // y[f0]= 30
  1139. 112, // y[f1]= 28
  1140. 104, // y[f2]= 26
  1141. 96, // y[f3]= 24
  1142. 88, // y[f4]= 22
  1143. 80, // y[f5]= 20
  1144. 72, // y[f6]= 18
  1145. 64, // y[f7]= 16
  1146. 56, // y[f8]= 14
  1147. 48, // y[f9]= 12
  1148. 40, // y[fa]= 10
  1149. 32, // y[fb]= 8
  1150. 24, // y[fc]= 6
  1151. 16, // y[fd]= 4
  1152. 8, // y[fe]= 2
  1153. 0 // y[ff]= 0
  1154. };
  1155. //--------------------------------------------------------------------------;
  1156. //
  1157. // Name:
  1158. // AlawToUlawTable
  1159. //
  1160. //
  1161. // Description:
  1162. // this array maps A-law characters to u-law characters
  1163. //
  1164. // Arguments:
  1165. // the index into the array is an A-law character
  1166. //
  1167. // Return:
  1168. // an element of the array is a u-law character
  1169. //
  1170. // Notes:
  1171. //
  1172. //
  1173. // History:
  1174. // 08/01/93 Created.
  1175. //
  1176. //
  1177. //--------------------------------------------------------------------------;
  1178. const BYTE BCODE AlawToUlawTable[256] =
  1179. {
  1180. 0x2a, // A-law[00] ==> u-law[2a]
  1181. 0x2b, // A-law[01] ==> u-law[2b]
  1182. 0x28, // A-law[02] ==> u-law[28]
  1183. 0x29, // A-law[03] ==> u-law[29]
  1184. 0x2e, // A-law[04] ==> u-law[2e]
  1185. 0x2f, // A-law[05] ==> u-law[2f]
  1186. 0x2c, // A-law[06] ==> u-law[2c]
  1187. 0x2d, // A-law[07] ==> u-law[2d]
  1188. 0x22, // A-law[08] ==> u-law[22]
  1189. 0x23, // A-law[09] ==> u-law[23]
  1190. 0x20, // A-law[0a] ==> u-law[20]
  1191. 0x21, // A-law[0b] ==> u-law[21]
  1192. 0x26, // A-law[0c] ==> u-law[26]
  1193. 0x27, // A-law[0d] ==> u-law[27]
  1194. 0x24, // A-law[0e] ==> u-law[24]
  1195. 0x25, // A-law[0f] ==> u-law[25]
  1196. 0x39, // A-law[10] ==> u-law[39]
  1197. 0x3a, // A-law[11] ==> u-law[3a]
  1198. 0x37, // A-law[12] ==> u-law[37]
  1199. 0x38, // A-law[13] ==> u-law[38]
  1200. 0x3d, // A-law[14] ==> u-law[3d]
  1201. 0x3e, // A-law[15] ==> u-law[3e]
  1202. 0x3b, // A-law[16] ==> u-law[3b]
  1203. 0x3c, // A-law[17] ==> u-law[3c]
  1204. 0x31, // A-law[18] ==> u-law[31]
  1205. 0x32, // A-law[19] ==> u-law[32]
  1206. 0x30, // A-law[1a] ==> u-law[30]
  1207. 0x30, // A-law[1b] ==> u-law[30]
  1208. 0x35, // A-law[1c] ==> u-law[35]
  1209. 0x36, // A-law[1d] ==> u-law[36]
  1210. 0x33, // A-law[1e] ==> u-law[33]
  1211. 0x34, // A-law[1f] ==> u-law[34]
  1212. 0x0a, // A-law[20] ==> u-law[0a]
  1213. 0x0b, // A-law[21] ==> u-law[0b]
  1214. 0x08, // A-law[22] ==> u-law[08]
  1215. 0x09, // A-law[23] ==> u-law[09]
  1216. 0x0e, // A-law[24] ==> u-law[0e]
  1217. 0x0f, // A-law[25] ==> u-law[0f]
  1218. 0x0c, // A-law[26] ==> u-law[0c]
  1219. 0x0d, // A-law[27] ==> u-law[0d]
  1220. 0x02, // A-law[28] ==> u-law[02]
  1221. 0x03, // A-law[29] ==> u-law[03]
  1222. 0x00, // A-law[2a] ==> u-law[00]
  1223. 0x01, // A-law[2b] ==> u-law[01]
  1224. 0x06, // A-law[2c] ==> u-law[06]
  1225. 0x07, // A-law[2d] ==> u-law[07]
  1226. 0x04, // A-law[2e] ==> u-law[04]
  1227. 0x05, // A-law[2f] ==> u-law[05]
  1228. 0x1a, // A-law[30] ==> u-law[1a]
  1229. 0x1b, // A-law[31] ==> u-law[1b]
  1230. 0x18, // A-law[32] ==> u-law[18]
  1231. 0x19, // A-law[33] ==> u-law[19]
  1232. 0x1e, // A-law[34] ==> u-law[1e]
  1233. 0x1f, // A-law[35] ==> u-law[1f]
  1234. 0x1c, // A-law[36] ==> u-law[1c]
  1235. 0x1d, // A-law[37] ==> u-law[1d]
  1236. 0x12, // A-law[38] ==> u-law[12]
  1237. 0x13, // A-law[39] ==> u-law[13]
  1238. 0x10, // A-law[3a] ==> u-law[10]
  1239. 0x11, // A-law[3b] ==> u-law[11]
  1240. 0x16, // A-law[3c] ==> u-law[16]
  1241. 0x17, // A-law[3d] ==> u-law[17]
  1242. 0x14, // A-law[3e] ==> u-law[14]
  1243. 0x15, // A-law[3f] ==> u-law[15]
  1244. 0x62, // A-law[40] ==> u-law[62]
  1245. 0x63, // A-law[41] ==> u-law[63]
  1246. 0x60, // A-law[42] ==> u-law[60]
  1247. 0x61, // A-law[43] ==> u-law[61]
  1248. 0x66, // A-law[44] ==> u-law[66]
  1249. 0x67, // A-law[45] ==> u-law[67]
  1250. 0x64, // A-law[46] ==> u-law[64]
  1251. 0x65, // A-law[47] ==> u-law[65]
  1252. 0x5d, // A-law[48] ==> u-law[5d]
  1253. 0x5d, // A-law[49] ==> u-law[5d]
  1254. 0x5c, // A-law[4a] ==> u-law[5c]
  1255. 0x5c, // A-law[4b] ==> u-law[5c]
  1256. 0x5f, // A-law[4c] ==> u-law[5f]
  1257. 0x5f, // A-law[4d] ==> u-law[5f]
  1258. 0x5e, // A-law[4e] ==> u-law[5e]
  1259. 0x5e, // A-law[4f] ==> u-law[5e]
  1260. 0x74, // A-law[50] ==> u-law[74]
  1261. 0x76, // A-law[51] ==> u-law[76]
  1262. 0x70, // A-law[52] ==> u-law[70]
  1263. 0x72, // A-law[53] ==> u-law[72]
  1264. 0x7c, // A-law[54] ==> u-law[7c]
  1265. 0x7e, // A-law[55] ==> u-law[7e]
  1266. 0x78, // A-law[56] ==> u-law[78]
  1267. 0x7a, // A-law[57] ==> u-law[7a]
  1268. 0x6a, // A-law[58] ==> u-law[6a]
  1269. 0x6b, // A-law[59] ==> u-law[6b]
  1270. 0x68, // A-law[5a] ==> u-law[68]
  1271. 0x69, // A-law[5b] ==> u-law[69]
  1272. 0x6e, // A-law[5c] ==> u-law[6e]
  1273. 0x6f, // A-law[5d] ==> u-law[6f]
  1274. 0x6c, // A-law[5e] ==> u-law[6c]
  1275. 0x6d, // A-law[5f] ==> u-law[6d]
  1276. 0x48, // A-law[60] ==> u-law[48]
  1277. 0x49, // A-law[61] ==> u-law[49]
  1278. 0x46, // A-law[62] ==> u-law[46]
  1279. 0x47, // A-law[63] ==> u-law[47]
  1280. 0x4c, // A-law[64] ==> u-law[4c]
  1281. 0x4d, // A-law[65] ==> u-law[4d]
  1282. 0x4a, // A-law[66] ==> u-law[4a]
  1283. 0x4b, // A-law[67] ==> u-law[4b]
  1284. 0x40, // A-law[68] ==> u-law[40]
  1285. 0x41, // A-law[69] ==> u-law[41]
  1286. 0x3f, // A-law[6a] ==> u-law[3f]
  1287. 0x3f, // A-law[6b] ==> u-law[3f]
  1288. 0x44, // A-law[6c] ==> u-law[44]
  1289. 0x45, // A-law[6d] ==> u-law[45]
  1290. 0x42, // A-law[6e] ==> u-law[42]
  1291. 0x43, // A-law[6f] ==> u-law[43]
  1292. 0x56, // A-law[70] ==> u-law[56]
  1293. 0x57, // A-law[71] ==> u-law[57]
  1294. 0x54, // A-law[72] ==> u-law[54]
  1295. 0x55, // A-law[73] ==> u-law[55]
  1296. 0x5a, // A-law[74] ==> u-law[5a]
  1297. 0x5b, // A-law[75] ==> u-law[5b]
  1298. 0x58, // A-law[76] ==> u-law[58]
  1299. 0x59, // A-law[77] ==> u-law[59]
  1300. 0x4f, // A-law[78] ==> u-law[4f]
  1301. 0x4f, // A-law[79] ==> u-law[4f]
  1302. 0x4e, // A-law[7a] ==> u-law[4e]
  1303. 0x4e, // A-law[7b] ==> u-law[4e]
  1304. 0x52, // A-law[7c] ==> u-law[52]
  1305. 0x53, // A-law[7d] ==> u-law[53]
  1306. 0x50, // A-law[7e] ==> u-law[50]
  1307. 0x51, // A-law[7f] ==> u-law[51]
  1308. 0xaa, // A-law[80] ==> u-law[aa]
  1309. 0xab, // A-law[81] ==> u-law[ab]
  1310. 0xa8, // A-law[82] ==> u-law[a8]
  1311. 0xa9, // A-law[83] ==> u-law[a9]
  1312. 0xae, // A-law[84] ==> u-law[ae]
  1313. 0xaf, // A-law[85] ==> u-law[af]
  1314. 0xac, // A-law[86] ==> u-law[ac]
  1315. 0xad, // A-law[87] ==> u-law[ad]
  1316. 0xa2, // A-law[88] ==> u-law[a2]
  1317. 0xa3, // A-law[89] ==> u-law[a3]
  1318. 0xa0, // A-law[8a] ==> u-law[a0]
  1319. 0xa1, // A-law[8b] ==> u-law[a1]
  1320. 0xa6, // A-law[8c] ==> u-law[a6]
  1321. 0xa7, // A-law[8d] ==> u-law[a7]
  1322. 0xa4, // A-law[8e] ==> u-law[a4]
  1323. 0xa5, // A-law[8f] ==> u-law[a5]
  1324. 0xb9, // A-law[90] ==> u-law[b9]
  1325. 0xba, // A-law[91] ==> u-law[ba]
  1326. 0xb7, // A-law[92] ==> u-law[b7]
  1327. 0xb8, // A-law[93] ==> u-law[b8]
  1328. 0xbd, // A-law[94] ==> u-law[bd]
  1329. 0xbe, // A-law[95] ==> u-law[be]
  1330. 0xbb, // A-law[96] ==> u-law[bb]
  1331. 0xbc, // A-law[97] ==> u-law[bc]
  1332. 0xb1, // A-law[98] ==> u-law[b1]
  1333. 0xb2, // A-law[99] ==> u-law[b2]
  1334. 0xb0, // A-law[9a] ==> u-law[b0]
  1335. 0xb0, // A-law[9b] ==> u-law[b0]
  1336. 0xb5, // A-law[9c] ==> u-law[b5]
  1337. 0xb6, // A-law[9d] ==> u-law[b6]
  1338. 0xb3, // A-law[9e] ==> u-law[b3]
  1339. 0xb4, // A-law[9f] ==> u-law[b4]
  1340. 0x8a, // A-law[a0] ==> u-law[8a]
  1341. 0x8b, // A-law[a1] ==> u-law[8b]
  1342. 0x88, // A-law[a2] ==> u-law[88]
  1343. 0x89, // A-law[a3] ==> u-law[89]
  1344. 0x8e, // A-law[a4] ==> u-law[8e]
  1345. 0x8f, // A-law[a5] ==> u-law[8f]
  1346. 0x8c, // A-law[a6] ==> u-law[8c]
  1347. 0x8d, // A-law[a7] ==> u-law[8d]
  1348. 0x82, // A-law[a8] ==> u-law[82]
  1349. 0x83, // A-law[a9] ==> u-law[83]
  1350. 0x80, // A-law[aa] ==> u-law[80]
  1351. 0x81, // A-law[ab] ==> u-law[81]
  1352. 0x86, // A-law[ac] ==> u-law[86]
  1353. 0x87, // A-law[ad] ==> u-law[87]
  1354. 0x84, // A-law[ae] ==> u-law[84]
  1355. 0x85, // A-law[af] ==> u-law[85]
  1356. 0x9a, // A-law[b0] ==> u-law[9a]
  1357. 0x9b, // A-law[b1] ==> u-law[9b]
  1358. 0x98, // A-law[b2] ==> u-law[98]
  1359. 0x99, // A-law[b3] ==> u-law[99]
  1360. 0x9e, // A-law[b4] ==> u-law[9e]
  1361. 0x9f, // A-law[b5] ==> u-law[9f]
  1362. 0x9c, // A-law[b6] ==> u-law[9c]
  1363. 0x9d, // A-law[b7] ==> u-law[9d]
  1364. 0x92, // A-law[b8] ==> u-law[92]
  1365. 0x93, // A-law[b9] ==> u-law[93]
  1366. 0x90, // A-law[ba] ==> u-law[90]
  1367. 0x91, // A-law[bb] ==> u-law[91]
  1368. 0x96, // A-law[bc] ==> u-law[96]
  1369. 0x97, // A-law[bd] ==> u-law[97]
  1370. 0x94, // A-law[be] ==> u-law[94]
  1371. 0x95, // A-law[bf] ==> u-law[95]
  1372. 0xe2, // A-law[c0] ==> u-law[e2]
  1373. 0xe3, // A-law[c1] ==> u-law[e3]
  1374. 0xe0, // A-law[c2] ==> u-law[e0]
  1375. 0xe1, // A-law[c3] ==> u-law[e1]
  1376. 0xe6, // A-law[c4] ==> u-law[e6]
  1377. 0xe7, // A-law[c5] ==> u-law[e7]
  1378. 0xe4, // A-law[c6] ==> u-law[e4]
  1379. 0xe5, // A-law[c7] ==> u-law[e5]
  1380. 0xdd, // A-law[c8] ==> u-law[dd]
  1381. 0xdd, // A-law[c9] ==> u-law[dd]
  1382. 0xdc, // A-law[ca] ==> u-law[dc]
  1383. 0xdc, // A-law[cb] ==> u-law[dc]
  1384. 0xdf, // A-law[cc] ==> u-law[df]
  1385. 0xdf, // A-law[cd] ==> u-law[df]
  1386. 0xde, // A-law[ce] ==> u-law[de]
  1387. 0xde, // A-law[cf] ==> u-law[de]
  1388. 0xf4, // A-law[d0] ==> u-law[f4]
  1389. 0xf6, // A-law[d1] ==> u-law[f6]
  1390. 0xf0, // A-law[d2] ==> u-law[f0]
  1391. 0xf2, // A-law[d3] ==> u-law[f2]
  1392. 0xfc, // A-law[d4] ==> u-law[fc]
  1393. 0xfe, // A-law[d5] ==> u-law[fe]
  1394. 0xf8, // A-law[d6] ==> u-law[f8]
  1395. 0xfa, // A-law[d7] ==> u-law[fa]
  1396. 0xea, // A-law[d8] ==> u-law[ea]
  1397. 0xeb, // A-law[d9] ==> u-law[eb]
  1398. 0xe8, // A-law[da] ==> u-law[e8]
  1399. 0xe9, // A-law[db] ==> u-law[e9]
  1400. 0xee, // A-law[dc] ==> u-law[ee]
  1401. 0xef, // A-law[dd] ==> u-law[ef]
  1402. 0xec, // A-law[de] ==> u-law[ec]
  1403. 0xed, // A-law[df] ==> u-law[ed]
  1404. 0xc8, // A-law[e0] ==> u-law[c8]
  1405. 0xc9, // A-law[e1] ==> u-law[c9]
  1406. 0xc6, // A-law[e2] ==> u-law[c6]
  1407. 0xc7, // A-law[e3] ==> u-law[c7]
  1408. 0xcc, // A-law[e4] ==> u-law[cc]
  1409. 0xcd, // A-law[e5] ==> u-law[cd]
  1410. 0xca, // A-law[e6] ==> u-law[ca]
  1411. 0xcb, // A-law[e7] ==> u-law[cb]
  1412. 0xc0, // A-law[e8] ==> u-law[c0]
  1413. 0xc1, // A-law[e9] ==> u-law[c1]
  1414. 0xbf, // A-law[ea] ==> u-law[bf]
  1415. 0xbf, // A-law[eb] ==> u-law[bf]
  1416. 0xc4, // A-law[ec] ==> u-law[c4]
  1417. 0xc5, // A-law[ed] ==> u-law[c5]
  1418. 0xc2, // A-law[ee] ==> u-law[c2]
  1419. 0xc3, // A-law[ef] ==> u-law[c3]
  1420. 0xd6, // A-law[f0] ==> u-law[d6]
  1421. 0xd7, // A-law[f1] ==> u-law[d7]
  1422. 0xd4, // A-law[f2] ==> u-law[d4]
  1423. 0xd5, // A-law[f3] ==> u-law[d5]
  1424. 0xda, // A-law[f4] ==> u-law[da]
  1425. 0xdb, // A-law[f5] ==> u-law[db]
  1426. 0xd8, // A-law[f6] ==> u-law[d8]
  1427. 0xd9, // A-law[f7] ==> u-law[d9]
  1428. 0xcf, // A-law[f8] ==> u-law[cf]
  1429. 0xcf, // A-law[f9] ==> u-law[cf]
  1430. 0xce, // A-law[fa] ==> u-law[ce]
  1431. 0xce, // A-law[fb] ==> u-law[ce]
  1432. 0xd2, // A-law[fc] ==> u-law[d2]
  1433. 0xd3, // A-law[fd] ==> u-law[d3]
  1434. 0xd0, // A-law[fe] ==> u-law[d0]
  1435. 0xd1 // A-law[ff] ==> u-law[d1]
  1436. };
  1437. //--------------------------------------------------------------------------;
  1438. //
  1439. // Name:
  1440. // UlawToAlawTable
  1441. //
  1442. //
  1443. // Description:
  1444. // this array maps u-law characters to A-law characters
  1445. //
  1446. // Arguments:
  1447. // the index into the array is a u-law character
  1448. //
  1449. // Return:
  1450. // an element of the array is an A-law character
  1451. //
  1452. // Notes:
  1453. //
  1454. //
  1455. // History:
  1456. // 08/01/93 Created.
  1457. //
  1458. //
  1459. //--------------------------------------------------------------------------;
  1460. const BYTE BCODE UlawToAlawTable[256] =
  1461. {
  1462. 0x2a, // u-law[00] ==> A-law[2a]
  1463. 0x2b, // u-law[01] ==> A-law[2b]
  1464. 0x28, // u-law[02] ==> A-law[28]
  1465. 0x29, // u-law[03] ==> A-law[29]
  1466. 0x2e, // u-law[04] ==> A-law[2e]
  1467. 0x2f, // u-law[05] ==> A-law[2f]
  1468. 0x2c, // u-law[06] ==> A-law[2c]
  1469. 0x2d, // u-law[07] ==> A-law[2d]
  1470. 0x22, // u-law[08] ==> A-law[22]
  1471. 0x23, // u-law[09] ==> A-law[23]
  1472. 0x20, // u-law[0a] ==> A-law[20]
  1473. 0x21, // u-law[0b] ==> A-law[21]
  1474. 0x26, // u-law[0c] ==> A-law[26]
  1475. 0x27, // u-law[0d] ==> A-law[27]
  1476. 0x24, // u-law[0e] ==> A-law[24]
  1477. 0x25, // u-law[0f] ==> A-law[25]
  1478. 0x3a, // u-law[10] ==> A-law[3a]
  1479. 0x3b, // u-law[11] ==> A-law[3b]
  1480. 0x38, // u-law[12] ==> A-law[38]
  1481. 0x39, // u-law[13] ==> A-law[39]
  1482. 0x3e, // u-law[14] ==> A-law[3e]
  1483. 0x3f, // u-law[15] ==> A-law[3f]
  1484. 0x3c, // u-law[16] ==> A-law[3c]
  1485. 0x3d, // u-law[17] ==> A-law[3d]
  1486. 0x32, // u-law[18] ==> A-law[32]
  1487. 0x33, // u-law[19] ==> A-law[33]
  1488. 0x30, // u-law[1a] ==> A-law[30]
  1489. 0x31, // u-law[1b] ==> A-law[31]
  1490. 0x36, // u-law[1c] ==> A-law[36]
  1491. 0x37, // u-law[1d] ==> A-law[37]
  1492. 0x34, // u-law[1e] ==> A-law[34]
  1493. 0x35, // u-law[1f] ==> A-law[35]
  1494. 0x0a, // u-law[20] ==> A-law[0a]
  1495. 0x0b, // u-law[21] ==> A-law[0b]
  1496. 0x08, // u-law[22] ==> A-law[08]
  1497. 0x09, // u-law[23] ==> A-law[09]
  1498. 0x0e, // u-law[24] ==> A-law[0e]
  1499. 0x0f, // u-law[25] ==> A-law[0f]
  1500. 0x0c, // u-law[26] ==> A-law[0c]
  1501. 0x0d, // u-law[27] ==> A-law[0d]
  1502. 0x02, // u-law[28] ==> A-law[02]
  1503. 0x03, // u-law[29] ==> A-law[03]
  1504. 0x00, // u-law[2a] ==> A-law[00]
  1505. 0x01, // u-law[2b] ==> A-law[01]
  1506. 0x06, // u-law[2c] ==> A-law[06]
  1507. 0x07, // u-law[2d] ==> A-law[07]
  1508. 0x04, // u-law[2e] ==> A-law[04]
  1509. 0x05, // u-law[2f] ==> A-law[05]
  1510. 0x1b, // u-law[30] ==> A-law[1b]
  1511. 0x18, // u-law[31] ==> A-law[18]
  1512. 0x19, // u-law[32] ==> A-law[19]
  1513. 0x1e, // u-law[33] ==> A-law[1e]
  1514. 0x1f, // u-law[34] ==> A-law[1f]
  1515. 0x1c, // u-law[35] ==> A-law[1c]
  1516. 0x1d, // u-law[36] ==> A-law[1d]
  1517. 0x12, // u-law[37] ==> A-law[12]
  1518. 0x13, // u-law[38] ==> A-law[13]
  1519. 0x10, // u-law[39] ==> A-law[10]
  1520. 0x11, // u-law[3a] ==> A-law[11]
  1521. 0x16, // u-law[3b] ==> A-law[16]
  1522. 0x17, // u-law[3c] ==> A-law[17]
  1523. 0x14, // u-law[3d] ==> A-law[14]
  1524. 0x15, // u-law[3e] ==> A-law[15]
  1525. 0x6a, // u-law[3f] ==> A-law[6a]
  1526. 0x68, // u-law[40] ==> A-law[68]
  1527. 0x69, // u-law[41] ==> A-law[69]
  1528. 0x6e, // u-law[42] ==> A-law[6e]
  1529. 0x6f, // u-law[43] ==> A-law[6f]
  1530. 0x6c, // u-law[44] ==> A-law[6c]
  1531. 0x6d, // u-law[45] ==> A-law[6d]
  1532. 0x62, // u-law[46] ==> A-law[62]
  1533. 0x63, // u-law[47] ==> A-law[63]
  1534. 0x60, // u-law[48] ==> A-law[60]
  1535. 0x61, // u-law[49] ==> A-law[61]
  1536. 0x66, // u-law[4a] ==> A-law[66]
  1537. 0x67, // u-law[4b] ==> A-law[67]
  1538. 0x64, // u-law[4c] ==> A-law[64]
  1539. 0x65, // u-law[4d] ==> A-law[65]
  1540. 0x7a, // u-law[4e] ==> A-law[7a]
  1541. 0x78, // u-law[4f] ==> A-law[78]
  1542. 0x7e, // u-law[50] ==> A-law[7e]
  1543. 0x7f, // u-law[51] ==> A-law[7f]
  1544. 0x7c, // u-law[52] ==> A-law[7c]
  1545. 0x7d, // u-law[53] ==> A-law[7d]
  1546. 0x72, // u-law[54] ==> A-law[72]
  1547. 0x73, // u-law[55] ==> A-law[73]
  1548. 0x70, // u-law[56] ==> A-law[70]
  1549. 0x71, // u-law[57] ==> A-law[71]
  1550. 0x76, // u-law[58] ==> A-law[76]
  1551. 0x77, // u-law[59] ==> A-law[77]
  1552. 0x74, // u-law[5a] ==> A-law[74]
  1553. 0x75, // u-law[5b] ==> A-law[75]
  1554. 0x4b, // u-law[5c] ==> A-law[4b]
  1555. 0x49, // u-law[5d] ==> A-law[49]
  1556. 0x4f, // u-law[5e] ==> A-law[4f]
  1557. 0x4d, // u-law[5f] ==> A-law[4d]
  1558. 0x42, // u-law[60] ==> A-law[42]
  1559. 0x43, // u-law[61] ==> A-law[43]
  1560. 0x40, // u-law[62] ==> A-law[40]
  1561. 0x41, // u-law[63] ==> A-law[41]
  1562. 0x46, // u-law[64] ==> A-law[46]
  1563. 0x47, // u-law[65] ==> A-law[47]
  1564. 0x44, // u-law[66] ==> A-law[44]
  1565. 0x45, // u-law[67] ==> A-law[45]
  1566. 0x5a, // u-law[68] ==> A-law[5a]
  1567. 0x5b, // u-law[69] ==> A-law[5b]
  1568. 0x58, // u-law[6a] ==> A-law[58]
  1569. 0x59, // u-law[6b] ==> A-law[59]
  1570. 0x5e, // u-law[6c] ==> A-law[5e]
  1571. 0x5f, // u-law[6d] ==> A-law[5f]
  1572. 0x5c, // u-law[6e] ==> A-law[5c]
  1573. 0x5d, // u-law[6f] ==> A-law[5d]
  1574. 0x52, // u-law[70] ==> A-law[52]
  1575. 0x52, // u-law[71] ==> A-law[52]
  1576. 0x53, // u-law[72] ==> A-law[53]
  1577. 0x53, // u-law[73] ==> A-law[53]
  1578. 0x50, // u-law[74] ==> A-law[50]
  1579. 0x50, // u-law[75] ==> A-law[50]
  1580. 0x51, // u-law[76] ==> A-law[51]
  1581. 0x51, // u-law[77] ==> A-law[51]
  1582. 0x56, // u-law[78] ==> A-law[56]
  1583. 0x56, // u-law[79] ==> A-law[56]
  1584. 0x57, // u-law[7a] ==> A-law[57]
  1585. 0x57, // u-law[7b] ==> A-law[57]
  1586. 0x54, // u-law[7c] ==> A-law[54]
  1587. 0x54, // u-law[7d] ==> A-law[54]
  1588. 0x55, // u-law[7e] ==> A-law[55]
  1589. 0x55, // u-law[7f] ==> A-law[55]
  1590. 0xaa, // u-law[80] ==> A-law[aa]
  1591. 0xab, // u-law[81] ==> A-law[ab]
  1592. 0xa8, // u-law[82] ==> A-law[a8]
  1593. 0xa9, // u-law[83] ==> A-law[a9]
  1594. 0xae, // u-law[84] ==> A-law[ae]
  1595. 0xaf, // u-law[85] ==> A-law[af]
  1596. 0xac, // u-law[86] ==> A-law[ac]
  1597. 0xad, // u-law[87] ==> A-law[ad]
  1598. 0xa2, // u-law[88] ==> A-law[a2]
  1599. 0xa3, // u-law[89] ==> A-law[a3]
  1600. 0xa0, // u-law[8a] ==> A-law[a0]
  1601. 0xa1, // u-law[8b] ==> A-law[a1]
  1602. 0xa6, // u-law[8c] ==> A-law[a6]
  1603. 0xa7, // u-law[8d] ==> A-law[a7]
  1604. 0xa4, // u-law[8e] ==> A-law[a4]
  1605. 0xa5, // u-law[8f] ==> A-law[a5]
  1606. 0xba, // u-law[90] ==> A-law[ba]
  1607. 0xbb, // u-law[91] ==> A-law[bb]
  1608. 0xb8, // u-law[92] ==> A-law[b8]
  1609. 0xb9, // u-law[93] ==> A-law[b9]
  1610. 0xbe, // u-law[94] ==> A-law[be]
  1611. 0xbf, // u-law[95] ==> A-law[bf]
  1612. 0xbc, // u-law[96] ==> A-law[bc]
  1613. 0xbd, // u-law[97] ==> A-law[bd]
  1614. 0xb2, // u-law[98] ==> A-law[b2]
  1615. 0xb3, // u-law[99] ==> A-law[b3]
  1616. 0xb0, // u-law[9a] ==> A-law[b0]
  1617. 0xb1, // u-law[9b] ==> A-law[b1]
  1618. 0xb6, // u-law[9c] ==> A-law[b6]
  1619. 0xb7, // u-law[9d] ==> A-law[b7]
  1620. 0xb4, // u-law[9e] ==> A-law[b4]
  1621. 0xb5, // u-law[9f] ==> A-law[b5]
  1622. 0x8a, // u-law[a0] ==> A-law[8a]
  1623. 0x8b, // u-law[a1] ==> A-law[8b]
  1624. 0x88, // u-law[a2] ==> A-law[88]
  1625. 0x89, // u-law[a3] ==> A-law[89]
  1626. 0x8e, // u-law[a4] ==> A-law[8e]
  1627. 0x8f, // u-law[a5] ==> A-law[8f]
  1628. 0x8c, // u-law[a6] ==> A-law[8c]
  1629. 0x8d, // u-law[a7] ==> A-law[8d]
  1630. 0x82, // u-law[a8] ==> A-law[82]
  1631. 0x83, // u-law[a9] ==> A-law[83]
  1632. 0x80, // u-law[aa] ==> A-law[80]
  1633. 0x81, // u-law[ab] ==> A-law[81]
  1634. 0x86, // u-law[ac] ==> A-law[86]
  1635. 0x87, // u-law[ad] ==> A-law[87]
  1636. 0x84, // u-law[ae] ==> A-law[84]
  1637. 0x85, // u-law[af] ==> A-law[85]
  1638. 0x9b, // u-law[b0] ==> A-law[9b]
  1639. 0x98, // u-law[b1] ==> A-law[98]
  1640. 0x99, // u-law[b2] ==> A-law[99]
  1641. 0x9e, // u-law[b3] ==> A-law[9e]
  1642. 0x9f, // u-law[b4] ==> A-law[9f]
  1643. 0x9c, // u-law[b5] ==> A-law[9c]
  1644. 0x9d, // u-law[b6] ==> A-law[9d]
  1645. 0x92, // u-law[b7] ==> A-law[92]
  1646. 0x93, // u-law[b8] ==> A-law[93]
  1647. 0x90, // u-law[b9] ==> A-law[90]
  1648. 0x91, // u-law[ba] ==> A-law[91]
  1649. 0x96, // u-law[bb] ==> A-law[96]
  1650. 0x97, // u-law[bc] ==> A-law[97]
  1651. 0x94, // u-law[bd] ==> A-law[94]
  1652. 0x95, // u-law[be] ==> A-law[95]
  1653. 0xea, // u-law[bf] ==> A-law[ea]
  1654. 0xe8, // u-law[c0] ==> A-law[e8]
  1655. 0xe9, // u-law[c1] ==> A-law[e9]
  1656. 0xee, // u-law[c2] ==> A-law[ee]
  1657. 0xef, // u-law[c3] ==> A-law[ef]
  1658. 0xec, // u-law[c4] ==> A-law[ec]
  1659. 0xed, // u-law[c5] ==> A-law[ed]
  1660. 0xe2, // u-law[c6] ==> A-law[e2]
  1661. 0xe3, // u-law[c7] ==> A-law[e3]
  1662. 0xe0, // u-law[c8] ==> A-law[e0]
  1663. 0xe1, // u-law[c9] ==> A-law[e1]
  1664. 0xe6, // u-law[ca] ==> A-law[e6]
  1665. 0xe7, // u-law[cb] ==> A-law[e7]
  1666. 0xe4, // u-law[cc] ==> A-law[e4]
  1667. 0xe5, // u-law[cd] ==> A-law[e5]
  1668. 0xfa, // u-law[ce] ==> A-law[fa]
  1669. 0xf8, // u-law[cf] ==> A-law[f8]
  1670. 0xfe, // u-law[d0] ==> A-law[fe]
  1671. 0xff, // u-law[d1] ==> A-law[ff]
  1672. 0xfc, // u-law[d2] ==> A-law[fc]
  1673. 0xfd, // u-law[d3] ==> A-law[fd]
  1674. 0xf2, // u-law[d4] ==> A-law[f2]
  1675. 0xf3, // u-law[d5] ==> A-law[f3]
  1676. 0xf0, // u-law[d6] ==> A-law[f0]
  1677. 0xf1, // u-law[d7] ==> A-law[f1]
  1678. 0xf6, // u-law[d8] ==> A-law[f6]
  1679. 0xf7, // u-law[d9] ==> A-law[f7]
  1680. 0xf4, // u-law[da] ==> A-law[f4]
  1681. 0xf5, // u-law[db] ==> A-law[f5]
  1682. 0xcb, // u-law[dc] ==> A-law[cb]
  1683. 0xc9, // u-law[dd] ==> A-law[c9]
  1684. 0xcf, // u-law[de] ==> A-law[cf]
  1685. 0xcd, // u-law[df] ==> A-law[cd]
  1686. 0xc2, // u-law[e0] ==> A-law[c2]
  1687. 0xc3, // u-law[e1] ==> A-law[c3]
  1688. 0xc0, // u-law[e2] ==> A-law[c0]
  1689. 0xc1, // u-law[e3] ==> A-law[c1]
  1690. 0xc6, // u-law[e4] ==> A-law[c6]
  1691. 0xc7, // u-law[e5] ==> A-law[c7]
  1692. 0xc4, // u-law[e6] ==> A-law[c4]
  1693. 0xc5, // u-law[e7] ==> A-law[c5]
  1694. 0xda, // u-law[e8] ==> A-law[da]
  1695. 0xdb, // u-law[e9] ==> A-law[db]
  1696. 0xd8, // u-law[ea] ==> A-law[d8]
  1697. 0xd9, // u-law[eb] ==> A-law[d9]
  1698. 0xde, // u-law[ec] ==> A-law[de]
  1699. 0xdf, // u-law[ed] ==> A-law[df]
  1700. 0xdc, // u-law[ee] ==> A-law[dc]
  1701. 0xdd, // u-law[ef] ==> A-law[dd]
  1702. 0xd2, // u-law[f0] ==> A-law[d2]
  1703. 0xd2, // u-law[f1] ==> A-law[d2]
  1704. 0xd3, // u-law[f2] ==> A-law[d3]
  1705. 0xd3, // u-law[f3] ==> A-law[d3]
  1706. 0xd0, // u-law[f4] ==> A-law[d0]
  1707. 0xd0, // u-law[f5] ==> A-law[d0]
  1708. 0xd1, // u-law[f6] ==> A-law[d1]
  1709. 0xd1, // u-law[f7] ==> A-law[d1]
  1710. 0xd6, // u-law[f8] ==> A-law[d6]
  1711. 0xd6, // u-law[f9] ==> A-law[d6]
  1712. 0xd7, // u-law[fa] ==> A-law[d7]
  1713. 0xd7, // u-law[fb] ==> A-law[d7]
  1714. 0xd4, // u-law[fc] ==> A-law[d4]
  1715. 0xd4, // u-law[fd] ==> A-law[d4]
  1716. 0xd5, // u-law[fe] ==> A-law[d5]
  1717. 0xd5 // u-law[ff] ==> A-law[d5]
  1718. };