~ubuntu-branches/ubuntu/vivid/libav/vivid

« back to all changes in this revision

Viewing changes to libavcodec/put_bits.h

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2013-10-22 23:24:08 UTC
  • mfrom: (1.3.36 sid)
  • Revision ID: package-import@ubuntu.com-20131022232408-b8tvvn4pyzri9mi3
Tags: 6:9.10-1ubuntu1
* Build all -extra flavors from this source package, as libav got demoted
  from main to universe, cf LP: #1243235
* Simplify debian/rules to follow exactly the code that debian executes
* New upstream (LP: #1180288) fixes lots of security issues (LP: #1242802)
* Merge from unstable, remaining changes:
  - build-depend on libtiff5-dev rather than libtiff4-dev,
    avoids FTBFS caused by imlib
  - follow the regular debian codepaths

Show diffs side-by-side

added added

removed removed

Lines of Context:
73
73
}
74
74
 
75
75
/**
 
76
 * @return the number of bits available in the bitstream.
 
77
 */
 
78
static inline int put_bits_left(PutBitContext* s)
 
79
{
 
80
    return (s->buf_end - s->buf_ptr) * 8 - 32 + s->bit_left;
 
81
}
 
82
 
 
83
/**
76
84
 * Pad the end of the output stream with zeros.
77
85
 */
78
86
static inline void flush_put_bits(PutBitContext *s)
98
106
 
99
107
#ifdef BITSTREAM_WRITER_LE
100
108
#define avpriv_align_put_bits align_put_bits_unsupported_here
101
 
#define ff_put_string ff_put_string_unsupported_here
 
109
#define avpriv_put_string ff_put_string_unsupported_here
102
110
#define avpriv_copy_bits avpriv_copy_bits_unsupported_here
103
111
#else
104
112
/**
111
119
 *
112
120
 * @param terminate_string 0-terminates the written string if value is 1
113
121
 */
114
 
void ff_put_string(PutBitContext *pb, const char *string, int terminate_string);
 
122
void avpriv_put_string(PutBitContext *pb, const char *string, int terminate_string);
115
123
 
116
124
/**
117
125
 * Copy the content of src to the bitstream.
130
138
    unsigned int bit_buf;
131
139
    int bit_left;
132
140
 
133
 
    //    printf("put_bits=%d %x\n", n, value);
134
141
    assert(n <= 31 && value < (1U << n));
135
142
 
136
143
    bit_buf = s->bit_buf;
137
144
    bit_left = s->bit_left;
138
145
 
139
 
    //    printf("n=%d value=%x cnt=%d buf=%x\n", n, value, bit_cnt, bit_buf);
140
146
    /* XXX: optimize */
141
147
#ifdef BITSTREAM_WRITER_LE
142
148
    bit_buf |= value << (32 - bit_left);
155
161
        bit_buf<<=bit_left;
156
162
        bit_buf |= value >> (n - bit_left);
157
163
        AV_WB32(s->buf_ptr, bit_buf);
158
 
        //printf("bitbuf = %08x\n", bit_buf);
159
164
        s->buf_ptr+=4;
160
165
        bit_left+=32 - n;
161
166
        bit_buf = value;