*(UINT32 *)s->buf_ptr = htonl(bit_buf);
*(UINT32 *)s->buf_ptr = be2me_32(bit_buf);
void put_bits(PutBitContext *s, int n, unsigned int value){    unsigned int bit_buf;    int bit_cnt;#ifdef STATS    st_out_bit_counts[st_current_index] += n;#endif    //    printf("put_bits=%d %x\n", n, value);    assert(n == 32 || value < (1U << n));    bit_buf = s->bit_buf;    bit_cnt = s->bit_cnt;    //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);    /* XXX: optimize */    if (n < (32-bit_cnt)) {        bit_buf |= value << (32 - n - bit_cnt);        bit_cnt+=n;    } else {        bit_buf |= value >> (n + bit_cnt - 32);        *(UINT32 *)s->buf_ptr = htonl(bit_buf);        //printf("bitbuf = %08x\n", bit_buf);        s->buf_ptr+=4;        if (s->buf_ptr >= s->buf_end)            flush_buffer(s);        bit_cnt=bit_cnt + n - 32;        if (bit_cnt == 0) {            bit_buf = 0;        } else {            bit_buf = value << (32 - bit_cnt);        }    }        s->bit_buf = bit_buf;    s->bit_cnt = bit_cnt;}