11/* Automatically generated by
2- VMPluginCodeGenerator VMMaker.oscog-eem.3475 uuid: d9ef6856-42d8-4074-bde7-82f1e1d41282
3- (Compiler-eem.512 )
2+ VMPluginCodeGenerator VMMaker.oscog-eem.3668 uuid: d0a2c840-707b-457e-9ff3-c455828ac41c
3+ (Compiler-eem.523 )
44 from
5- ADPCMCodecPlugin VMMaker.oscog-eem.3475 uuid: d9ef6856-42d8-4074-bde7-82f1e1d41282
6- ADPCMCodec * Sound-mt.97 uuid: 122e8e23-da9c-9b48-b787-b6478bd54df7
5+ ADPCMCodecPlugin VMMaker.oscog-eem.3668 uuid: d0a2c840-707b-457e-9ff3-c455828ac41c
6+ ADPCMCodec * Sound-ct.99 uuid: 7a1c260a-5b6b-4cb3-8482-de3a78628508
77 */
8- static char __buildInfo [] = "ADPCMCodecPlugin VMMaker.oscog-eem.3475 uuid: d9ef6856-42d8-4074-bde7-82f1e1d41282 \n\
9- ADPCMCodec * Sound-mt.97 uuid: 122e8e23-da9c-9b48-b787-b6478bd54df7 " __DATE__ ;
8+ static char __buildInfo [] = "ADPCMCodecPlugin VMMaker.oscog-eem.3668 uuid: d0a2c840-707b-457e-9ff3-c455828ac41c \n\
9+ ADPCMCodec * Sound-ct.99 uuid: 7a1c260a-5b6b-4cb3-8482-de3a78628508 " __DATE__ ;
1010
1111
1212#include "config.h"
@@ -68,7 +68,7 @@ extern sqInt success(sqInt aBoolean);
6868extern
6969#endif
7070struct VirtualMachine * interpreterProxy ;
71- static const char * moduleName = "ADPCMCodecPlugin VMMaker.oscog-eem.3475 " INT_EXT ;
71+ static const char * moduleName = "ADPCMCodecPlugin VMMaker.oscog-eem.3668 " INT_EXT ;
7272
7373
7474/*** Methods ***/
@@ -148,18 +148,22 @@ primitiveDecodeMono(void)
148148 delta = 0 ;
149149 for (i = 1 ; i <= count ; i += 1 ) {
150150 if ((i & frameSizeMask ) == 1 ) {
151+ /* start of frame; read frame header */
152+
151153 /* begin nextBits: */
152154 result = 0 ;
153155 remaining = 16 ;
154156 while (1 ) {
155157 shift = remaining - bitPosition ;
156158 if (shift > 0 ) {
159+ /* consumed currentByte buffer; fetch next byte */
157160 result += (((usqInt )(currentByte ) << shift ));
158161 remaining -= bitPosition ;
159162 currentByte = encodedBytes [(byteIndex += 1 )];
160163 bitPosition = 8 ;
161164 }
162165 else {
166+ /* still some bits left in currentByte buffer */
163167 result += ((usqInt )(currentByte )) >> (0 - shift );
164168 bitPosition -= remaining ;
165169
@@ -181,12 +185,14 @@ primitiveDecodeMono(void)
181185 while (1 ) {
182186 shiftSqInt = remainingSqInt - bitPosition ;
183187 if (shiftSqInt > 0 ) {
188+ /* consumed currentByte buffer; fetch next byte */
184189 resultSqInt += (((usqInt )(currentByte ) << shiftSqInt ));
185190 remainingSqInt -= bitPosition ;
186191 currentByte = encodedBytes [(byteIndex += 1 )];
187192 bitPosition = 8 ;
188193 }
189194 else {
195+ /* still some bits left in currentByte buffer */
190196 resultSqInt += ((usqInt )(currentByte )) >> (0 - shiftSqInt );
191197 bitPosition -= remainingSqInt ;
192198
@@ -207,12 +213,14 @@ primitiveDecodeMono(void)
207213 while (1 ) {
208214 shift1 = remainingSqInt - bitPosition ;
209215 if (shift1 > 0 ) {
216+ /* consumed currentByte buffer; fetch next byte */
210217 result1 += (((usqInt )(currentByte ) << shift1 ));
211218 remainingSqInt -= bitPosition ;
212219 currentByte = encodedBytes [(byteIndex += 1 )];
213220 bitPosition = 8 ;
214221 }
215222 else {
223+ /* still some bits left in currentByte buffer */
216224 result1 += ((usqInt )(currentByte )) >> (0 - shift1 );
217225 bitPosition -= remainingSqInt ;
218226
@@ -354,18 +362,22 @@ primitiveDecodeStereo(void)
354362 indexRight = index [2 ];
355363 for (i = 1 ; i <= count ; i += 1 ) {
356364 if ((i & frameSizeMask ) == 1 ) {
365+ /* start of frame; read frame header */
366+
357367 /* begin nextBits: */
358368 result = 0 ;
359369 remaining = 16 ;
360370 while (1 ) {
361371 shift = remaining - bitPosition ;
362372 if (shift > 0 ) {
373+ /* consumed currentByte buffer; fetch next byte */
363374 result += (((usqInt )(currentByte ) << shift ));
364375 remaining -= bitPosition ;
365376 currentByte = encodedBytes [(byteIndex += 1 )];
366377 bitPosition = 8 ;
367378 }
368379 else {
380+ /* still some bits left in currentByte buffer */
369381 result += ((usqInt )(currentByte )) >> (0 - shift );
370382 bitPosition -= remaining ;
371383
@@ -384,12 +396,14 @@ primitiveDecodeStereo(void)
384396 while (1 ) {
385397 shiftSqInt = remainingSqInt - bitPosition ;
386398 if (shiftSqInt > 0 ) {
399+ /* consumed currentByte buffer; fetch next byte */
387400 resultSqInt += (((usqInt )(currentByte ) << shiftSqInt ));
388401 remainingSqInt -= bitPosition ;
389402 currentByte = encodedBytes [(byteIndex += 1 )];
390403 bitPosition = 8 ;
391404 }
392405 else {
406+ /* still some bits left in currentByte buffer */
393407 resultSqInt += ((usqInt )(currentByte )) >> (0 - shiftSqInt );
394408 bitPosition -= remainingSqInt ;
395409
@@ -408,12 +422,14 @@ primitiveDecodeStereo(void)
408422 while (1 ) {
409423 shift1 = remainingSqInt - bitPosition ;
410424 if (shift1 > 0 ) {
425+ /* consumed currentByte buffer; fetch next byte */
411426 result1 += (((usqInt )(currentByte ) << shift1 ));
412427 remainingSqInt -= bitPosition ;
413428 currentByte = encodedBytes [(byteIndex += 1 )];
414429 bitPosition = 8 ;
415430 }
416431 else {
432+ /* still some bits left in currentByte buffer */
417433 result1 += ((usqInt )(currentByte )) >> (0 - shift1 );
418434 bitPosition -= remainingSqInt ;
419435
@@ -432,12 +448,14 @@ primitiveDecodeStereo(void)
432448 while (1 ) {
433449 shift1 = remainingSqInt - bitPosition ;
434450 if (shift1 > 0 ) {
451+ /* consumed currentByte buffer; fetch next byte */
435452 result1 += (((usqInt )(currentByte ) << shift1 ));
436453 remainingSqInt -= bitPosition ;
437454 currentByte = encodedBytes [(byteIndex += 1 )];
438455 bitPosition = 8 ;
439456 }
440457 else {
458+ /* still some bits left in currentByte buffer */
441459 result1 += ((usqInt )(currentByte )) >> (0 - shift1 );
442460 bitPosition -= remainingSqInt ;
443461
@@ -465,12 +483,14 @@ primitiveDecodeStereo(void)
465483 while (1 ) {
466484 shift1 = remainingSqInt - bitPosition ;
467485 if (shift1 > 0 ) {
486+ /* consumed currentByte buffer; fetch next byte */
468487 result1 += (((usqInt )(currentByte ) << shift1 ));
469488 remainingSqInt -= bitPosition ;
470489 currentByte = encodedBytes [(byteIndex += 1 )];
471490 bitPosition = 8 ;
472491 }
473492 else {
493+ /* still some bits left in currentByte buffer */
474494 result1 += ((usqInt )(currentByte )) >> (0 - shift1 );
475495 bitPosition -= remainingSqInt ;
476496
@@ -489,12 +509,14 @@ primitiveDecodeStereo(void)
489509 while (1 ) {
490510 shift1 = remainingSqInt - bitPosition ;
491511 if (shift1 > 0 ) {
512+ /* consumed currentByte buffer; fetch next byte */
492513 result1 += (((usqInt )(currentByte ) << shift1 ));
493514 remainingSqInt -= bitPosition ;
494515 currentByte = encodedBytes [(byteIndex += 1 )];
495516 bitPosition = 8 ;
496517 }
497518 else {
519+ /* still some bits left in currentByte buffer */
498520 result1 += ((usqInt )(currentByte )) >> (0 - shift1 );
499521 bitPosition -= remainingSqInt ;
500522
@@ -672,6 +694,7 @@ primitiveEncodeMono(void)
672694 /* append high bits of buf to end of currentByte: */
673695 shift = bitsAvailable - bufBits ;
674696 if (shift < 0 ) {
697+ /* currentByte buffer filled; output it */
675698 currentByte += ((usqInt )(buf )) >> (0 - shift );
676699 encodedBytes [(byteIndex += 1 )] = currentByte ;
677700 bitPosition = 0 ;
@@ -682,6 +705,7 @@ primitiveEncodeMono(void)
682705 bufBits -= bitsAvailable ;
683706 }
684707 else {
708+ /* still some bits available in currentByte buffer */
685709 currentByte += (((usqInt )(buf ) << shift ));
686710 bitPosition += bufBits ;
687711 goto l1 ;
@@ -716,6 +740,7 @@ primitiveEncodeMono(void)
716740 /* append high bits of buf to end of currentByte: */
717741 shiftSqInt = bitsAvailableSqInt - bufBitsSqInt ;
718742 if (shiftSqInt < 0 ) {
743+ /* currentByte buffer filled; output it */
719744 currentByte += ((usqInt )(bufSqInt )) >> (0 - shiftSqInt );
720745 encodedBytes [(byteIndex += 1 )] = currentByte ;
721746 bitPosition = 0 ;
@@ -726,6 +751,7 @@ primitiveEncodeMono(void)
726751 bufBitsSqInt -= bitsAvailableSqInt ;
727752 }
728753 else {
754+ /* still some bits available in currentByte buffer */
729755 currentByte += (((usqInt )(bufSqInt ) << shiftSqInt ));
730756 bitPosition += bufBitsSqInt ;
731757 goto l2 ;
@@ -735,6 +761,7 @@ primitiveEncodeMono(void)
735761l2 :;
736762 }
737763 else {
764+ /* compute sign and magnitude of difference from the predicted sample */
738765 sign = 0 ;
739766 diff = (samples [(sampleIndex += 1 )]) - predicted ;
740767 if (diff < 0 ) {
800827 /* append high bits of buf to end of currentByte: */
801828 shift1 = bitsAvailable1 - bufBitsSqInt ;
802829 if (shift1 < 0 ) {
830+ /* currentByte buffer filled; output it */
803831 currentByte += ((usqInt )(bufSqInt )) >> (0 - shift1 );
804832 encodedBytes [(byteIndex += 1 )] = currentByte ;
805833 bitPosition = 0 ;
810838 bufBitsSqInt -= bitsAvailable1 ;
811839 }
812840 else {
841+ /* still some bits available in currentByte buffer */
813842 currentByte += (((usqInt )(bufSqInt ) << shift1 ));
814843 bitPosition += bufBitsSqInt ;
815844 goto l3 ;
820849 }
821850 }
822851 if (bitPosition > 0 ) {
852+ /* flush the last output byte, if necessary */
823853 encodedBytes [(byteIndex += 1 )] = currentByte ;
824854 }
825855 if (failed ()) {
0 commit comments