diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 2ff6f9cc04..d66dcfd150 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -164,7 +164,7 @@ static void put_audio_specific_config(AVCodecContext *avctx) PutBitContext pb; AACEncContext *s = avctx->priv_data; - init_put_bits(&pb, avctx->extradata, avctx->extradata_size*8); + init_put_bits(&pb, avctx->extradata, avctx->extradata_size); put_bits(&pb, 5, 2); //object type - AAC-LC put_bits(&pb, 4, s->samplerate_index); //sample rate index put_bits(&pb, 4, s->channels); diff --git a/libavcodec/adpcmenc.c b/libavcodec/adpcmenc.c index 1b3d1bcd01..73da9272ec 100644 --- a/libavcodec/adpcmenc.c +++ b/libavcodec/adpcmenc.c @@ -551,7 +551,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, { int ch, i; PutBitContext pb; - init_put_bits(&pb, dst, buf_size * 8); + init_put_bits(&pb, dst, buf_size); for (ch = 0; ch < avctx->channels; ch++) { put_bits(&pb, 9, (c->status[ch].prev_sample & 0xFFFF) >> 7); @@ -582,7 +582,7 @@ static int adpcm_encode_frame(AVCodecContext *avctx, { int i; PutBitContext pb; - init_put_bits(&pb, dst, buf_size * 8); + init_put_bits(&pb, dst, buf_size); n = avctx->frame_size - 1; diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c index d358940690..01c8c61ae1 100644 --- a/libavcodec/faxcompr.c +++ b/libavcodec/faxcompr.c @@ -243,7 +243,7 @@ static void put_line(uint8_t *dst, int size, int width, const int *runs) PutBitContext pb; int run, mode = ~0, pix_left = width, run_idx = 0; - init_put_bits(&pb, dst, size*8); + init_put_bits(&pb, dst, size); while(pix_left > 0){ run = runs[run_idx++]; mode = ~mode; diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c index 6466be7858..dd477d420d 100644 --- a/libavcodec/flashsv2enc.c +++ b/libavcodec/flashsv2enc.c @@ -270,7 +270,7 @@ static int write_header(FlashSV2Context * s, uint8_t * buf, int buf_size) if (buf_size < 5) return -1; - init_put_bits(&pb, buf, buf_size * 8); + init_put_bits(&pb, buf, buf_size); put_bits(&pb, 4, (s->block_width >> 4) - 1); put_bits(&pb, 12, s->image_width); diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c index 7e21e7d534..8ed92a6381 100644 --- a/libavcodec/flashsvenc.c +++ b/libavcodec/flashsvenc.c @@ -130,7 +130,7 @@ static int encode_bitstream(FlashSVContext *s, AVFrame *p, uint8_t *buf, int buf_pos, res; int pred_blocks = 0; - init_put_bits(&pb, buf, buf_size * 8); + init_put_bits(&pb, buf, buf_size); put_bits(&pb, 4, block_width / 16 - 1); put_bits(&pb, 12, s->image_width); diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 725270c9fa..54820ad315 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -288,7 +288,7 @@ static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int apply_mdct(s); - init_put_bits(&pb, output, output_size * 8); + init_put_bits(&pb, output, output_size); i = 0; for (band = 0; band < NELLY_BANDS; band++) { diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c index 09678a002f..26afe5914f 100644 --- a/libavcodec/proresenc.c +++ b/libavcodec/proresenc.c @@ -302,7 +302,7 @@ static int encode_slice_plane(AVCodecContext *avctx, int mb_count, } blocks_per_slice = mb_count << (2 - chroma); - init_put_bits(&pb, buf, buf_size << 3); + init_put_bits(&pb, buf, buf_size); encode_dc_coeffs(&pb, blocks, blocks_per_slice, qmat); encode_ac_coeffs(avctx, &pb, blocks, blocks_per_slice, qmat);