    static void data_to_host(void *data, pj_uint8_t bits, unsigned count)
    {
	unsigned i;

        count /= (bits == 32? 4 : 2);

	if (bits == 32) {
	    pj_int32_t *data32 = (pj_int32_t *)data;
	    for (i=0; i<count; ++i)
		data32[i] = pj_swap32(data32[i]);
	} else {
	    pj_int16_t *data16 = (pj_int16_t *)data;
	    for (i=0; i<count; ++i)
		data16[i] = pj_swap16(data16[i]);
	}

    }
    static void data_to_host(void *data, pj_uint8_t bits, unsigned count)
    {
	unsigned i;

        count /= (bits == 32? 4 : 2);

	if (bits == 32) {
	    pj_int32_t *data32 = (pj_int32_t *)data;
	    for (i=0; i<count; ++i)
		data32[i] = pj_swap32(data32[i]);
	} else {
	    pj_int16_t *data16 = (pj_int16_t *)data;
	    for (i=0; i<count; ++i)
		data16[i] = pj_swap16(data16[i]);
	}

    }