a backwards loop to avoid sample crash, because inbuf and outbuf are just the same buffer.