Revision 81ada1ce libavcodec/common.c

View differences:

libavcodec/common.c
87 87
#endif
88 88
}
89 89

  
90
/* pad the end of the output stream with zeros */
91
#ifndef ALT_BITSTREAM_WRITER
92
void jflush_put_bits(PutBitContext *s)
93
{
94
    unsigned int b;
95
    s->bit_buf<<= s->bit_left;
96
    s->bit_buf |= ~1U >> (32 - s->bit_left); /* set all the unused bits to one */
97

  
98
    while (s->bit_left < 32) {
99
        b = s->bit_buf >> 24;
100
        *s->buf_ptr++ = b;
101
        if (b == 0xff)
102
            *s->buf_ptr++ = 0;
103
        s->bit_buf<<=8;
104
        s->bit_left+=8;
105
    }
106
    s->bit_left=32;
107
    s->bit_buf=0;
108
}
109
#else
110
void jflush_put_bits(PutBitContext *s)
111
{
112
    int num= (  - s->index) & 7;
113
    jput_bits(s, num,0xFF>>(8-num));
114
}
115
#endif
116

  
117 90
void put_string(PutBitContext * pbc, char *s)
118 91
{
119 92
    while(*s){

Also available in: Unified diff