INNER CODE UNIT · C++
sample
TheAssemblyArmada/Vanilla-Conquer · common/auduncmp.cpp:46
sample = *(src - 1); // set (sample) to the last byte sent to output
}
break;
case 1: // ADPCM 8-bit -> 4-bit
for (++count; count > 0; --count) { // decode (count+1) bytes
code = *src++;
sample += ZapTabFour[(code & 0x0F)]; // lower nibble
*dst++ = clamp(sample, 0, 255);
sample += ZapTabFour[(code >> 4)]; // higher nibble
*dst++ = clamp(sample, 0, 255);
remaining -= 2; // two bytes added to output
}
break;
case 0: // ADPCM 8-bit -> 2-bit
for (++count; count > 0; --count) { // decode (count+1) bytes
code = *src++;