+ else if(bps == 24) {
+ if(is_unsigned_samples) {
+ for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++)
+ for(channel = 0; channel < channels; channel++, sample++)
+ ulbuffer[sample] = buffer[channel][wide_sample] + 0x800000;
+ }
+ else {
+ for(sample = wide_sample = 0; wide_sample < wide_samples; wide_sample++)
+ for(channel = 0; channel < channels; channel++, sample++)
+ slbuffer[sample] = buffer[channel][wide_sample];
+ }
+/*@@@
+ if(is_big_endian != is_big_endian_host) {
+ unsigned char tmp;
+ unsigned lbyte;
+ const unsigned bytes = sample * 4;
+ for(lbyte = byte = 0; byte < bytes; byte += 4, lbyte += 3) {
+ tmp = ucbuffer[byte];
+ ucbuffer[lbyte] = ucbuffer[byte+2];
+ ucbuffer[lbyte+2] = tmp;
+ ucbuffer[lbyte+1] = ucbuffer[byte+1];
+ }
+ }
+ else {
+ unsigned lbyte;
+ const unsigned bytes = sample * 4;
+ for(lbyte = byte = 0; byte < bytes; ) {
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ byte++;
+ }
+ }
+*/
+ if(is_big_endian != is_big_endian_host) {
+ unsigned char tmp;
+ const unsigned bytes = sample * 4;
+ for(byte = 0; byte < bytes; byte += 4) {
+ tmp = ucbuffer[byte];
+ ucbuffer[byte] = ucbuffer[byte+3];
+ ucbuffer[byte+3] = tmp;
+ tmp = ucbuffer[byte+1];
+ ucbuffer[byte+1] = ucbuffer[byte+2];
+ ucbuffer[byte+2] = tmp;
+ }
+ }
+ if(is_big_endian) {
+ unsigned lbyte;
+ const unsigned bytes = sample * 4;
+ for(lbyte = byte = 0; byte < bytes; ) {
+ byte++;
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ }
+ }
+ else {
+ unsigned lbyte;
+ const unsigned bytes = sample * 4;
+ for(lbyte = byte = 0; byte < bytes; ) {
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ ucbuffer[lbyte++] = ucbuffer[byte++];
+ byte++;
+ }
+ }
+ if(fwrite(ucbuffer, 3, sample, fout) != sample)
+ return FLAC__STREAM_DECODER_WRITE_ABORT;
+ }
+ else {
+ assert(0);
+ }