Revision a8380f44

View differences:

libavcodec/common.c
48 48
{
49 49
    s->buf = buffer;
50 50
    s->buf_end = s->buf + buffer_size;
51
    s->data_out_size = 0;
52 51
#ifdef ALT_BITSTREAM_WRITER
53 52
    s->index=0;
54 53
    ((uint32_t*)(s->buf))[0]=0;
......
63 62
#ifdef CONFIG_ENCODERS
64 63

  
65 64
/* return the number of bits output */
66
int64_t get_bit_count(PutBitContext *s)
65
int get_bit_count(PutBitContext *s)
67 66
{
68 67
#ifdef ALT_BITSTREAM_WRITER
69
    return s->data_out_size * 8 + s->index;
68
    return s->index;
70 69
#else
71
    return (s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (int64_t)s->bit_left;
70
    return (s->buf_ptr - s->buf) * 8 + 32 - s->bit_left;
72 71
#endif
73 72
}
74 73

  
libavcodec/common.h
274 274
    int bit_left;
275 275
    uint8_t *buf, *buf_ptr, *buf_end;
276 276
#endif
277
    int64_t data_out_size; /* in bytes */
278 277
} PutBitContext;
279 278

  
280 279
void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size);
281 280

  
282
int64_t get_bit_count(PutBitContext *s); /* XXX: change function name */
281
int get_bit_count(PutBitContext *s); /* XXX: change function name */
283 282
void align_put_bits(PutBitContext *s);
284 283
void flush_put_bits(PutBitContext *s);
285 284
void put_string(PutBitContext * pbc, char *s);
libavcodec/dv.c
645 645
static always_inline int dv_bits_left(PutBitContext* s)
646 646
{
647 647
    return (s->buf_end - s->buf) * 8 - 
648
           ((s->buf_ptr - s->buf + s->data_out_size) * 8 + 32 - (int64_t)s->bit_left);
648
           ((s->buf_ptr - s->buf) * 8 + 32 - (int64_t)s->bit_left);
649 649
}
650 650

  
651 651
static always_inline void dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, 
libavformat/gif.c
274 274
        if(pbBufPtr(&p) - p.buf > 0) {
275 275
            put_byte(pb, pbBufPtr(&p) - p.buf); /* byte count of the packet */
276 276
            put_buffer(pb, p.buf, pbBufPtr(&p) - p.buf); /* the actual buffer */
277
            p.data_out_size += pbBufPtr(&p) - p.buf;
278 277
            p.buf_ptr = p.buf; /* dequeue the bytes off the bitstream */
279 278
        }
280 279
        if(left<=GIF_CHUNKS) {

Also available in: Unified diff