Revision 43d7c611

View differences:

libavcodec/alacenc.c
123 123
    put_bits(&s->pbctx, 1,  1);                             // Sample count is in the header
124 124
    put_bits(&s->pbctx, 2,  0);                             // FIXME: Wasted bytes field
125 125
    put_bits(&s->pbctx, 1,  is_verbatim);                   // Audio block is verbatim
126
    put_bits(&s->pbctx, 32, s->avctx->frame_size);          // No. of samples in the frame
126
    put_bits32(&s->pbctx, s->avctx->frame_size);            // No. of samples in the frame
127 127
}
128 128

  
129 129
static void calc_predictor_params(AlacEncodeContext *s, int ch)
libavcodec/put_bits.h
136 136
 */
137 137
void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length);
138 138

  
139
/**
140
 * Write up to 31 bits into a bitstream.
141
 * Use put_bits32 to write 32 bits.
142
 */
139 143
static inline void put_bits(PutBitContext *s, int n, unsigned int value)
140 144
#ifndef ALT_BITSTREAM_WRITER
141 145
{
......
143 147
    int bit_left;
144 148

  
145 149
    //    printf("put_bits=%d %x\n", n, value);
146
    assert(n == 32 || value < (1U << n));
150
    assert(n <= 31 && value < (1U << n));
147 151

  
148 152
    bit_buf = s->bit_buf;
149 153
    bit_left = s->bit_left;
......
260 264
}
261 265

  
262 266
/**
267
 * Write exactly 32 bits into a bitstream
268
 */
269
static void av_unused put_bits32(PutBitContext *s, uint32_t value)
270
{
271
    int lo = value & 0xffff;
272
    int hi = value >> 16;
273
#ifdef ALT_BITSTREAM_WRITER_LE
274
    put_bits(s, 16, lo);
275
    put_bits(s, 16, hi);
276
#else
277
    put_bits(s, 16, hi);
278
    put_bits(s, 16, lo);
279
#endif
280
}
281

  
282
/**
263 283
 * Returns the pointer to the byte where the bitstream writer will put
264 284
 * the next bit.
265 285
 */
libavcodec/vorbis_enc.c
386 386
        mant = -mant;
387 387
    }
388 388
    res |= mant | (exp << 21);
389
    put_bits(pb, 32, res);
389
    put_bits32(pb, res);
390 390
}
391 391

  
392 392
static void put_codebook_header(PutBitContext *pb, vorbis_enc_codebook *cb)
......
531 531
    init_put_bits(&pb, p, buffer_len);
532 532
    put_bits(&pb, 8, 1); //magic
533 533
    ff_put_string(&pb, "vorbis", 0);
534
    put_bits(&pb, 32, 0); // version
534
    put_bits32(&pb, 0); // version
535 535
    put_bits(&pb,  8, venc->channels);
536
    put_bits(&pb, 32, venc->sample_rate);
537
    put_bits(&pb, 32, 0); // bitrate
538
    put_bits(&pb, 32, 0); // bitrate
539
    put_bits(&pb, 32, 0); // bitrate
536
    put_bits32(&pb, venc->sample_rate);
537
    put_bits32(&pb, 0); // bitrate
538
    put_bits32(&pb, 0); // bitrate
539
    put_bits32(&pb, 0); // bitrate
540 540
    put_bits(&pb,  4, venc->log2_blocksize[0]);
541 541
    put_bits(&pb,  4, venc->log2_blocksize[1]);
542 542
    put_bits(&pb,  1, 1); // framing
......
550 550
    init_put_bits(&pb, p, buffer_len);
551 551
    put_bits(&pb, 8, 3); //magic
552 552
    ff_put_string(&pb, "vorbis", 0);
553
    put_bits(&pb, 32, 0); // vendor length TODO
554
    put_bits(&pb, 32, 0); // amount of comments
553
    put_bits32(&pb, 0); // vendor length TODO
554
    put_bits32(&pb, 0); // amount of comments
555 555
    put_bits(&pb,  1, 1); // framing
556 556

  
557 557
    flush_put_bits(&pb);
libavformat/mpegenc.c
89 89

  
90 90
    init_put_bits(&pb, buf, 128);
91 91

  
92
    put_bits(&pb, 32, PACK_START_CODE);
92
    put_bits32(&pb, PACK_START_CODE);
93 93
    if (s->is_mpeg2) {
94 94
        put_bits(&pb, 2, 0x1);
95 95
    } else {
......
125 125

  
126 126
    init_put_bits(&pb, buf, 128);
127 127

  
128
    put_bits(&pb, 32, SYSTEM_HEADER_START_CODE);
128
    put_bits32(&pb, SYSTEM_HEADER_START_CODE);
129 129
    put_bits(&pb, 16, 0);
130 130
    put_bits(&pb, 1, 1);
131 131

  

Also available in: Unified diff