I have studied a little more.
One of the interesting things of the official DNG specification is that you should be able to read in any endianness. But it fixes the endianness in two specific places, and it must be "Big endian" in:
1.The Tiff tag with the opcodes info.
2.The image data(stripes data) in case number of bits is not multiple of 8, like 8, 16,32.
As we use 14 bits per channel, we have to use Big Endian, so I suppose that is the reason for the "ReverseBytesorder()" function in chdk-dng.c as the camera works natively in little endian.
Personally I don't like using camera CPU cycles to convert a big amount of data, for undoing that later on the computer, so I am converting the image buffer I get from the USB to "wasteful" 16 bits, so I can use little endian, and then compress it.
I suspect there is going to be way more software able to handle 16bit little endian compressed dng that 14 bits. Anyway I need this thing to work as fast as possible and don't have time to deal with endianness, at least until it works.