diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-09-30 20:47:59 +0000 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2009-09-30 20:47:59 +0000 |
commit | 5200b901476fa939f8792204d90b053f134e97a1 (patch) | |
tree | c6c0b447b997125b9ed66ec1a563921ea165abcf | |
parent | f2ad907060c830ff230e1817ed6b57dfbb6ad1a5 (diff) | |
download | ffmpeg-5200b901476fa939f8792204d90b053f134e97a1.tar.gz |
Do not needlessly add 7 to put_buts_count before dividing by 8,
flush_put_bits ensures it is divisible 8.
Originally committed as revision 20103 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/vorbis_enc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 68cd41822e..508a4f3fa3 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -542,7 +542,7 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out) put_bits(&pb, 1, 1); // framing flush_put_bits(&pb); - hlens[0] = (put_bits_count(&pb) + 7) / 8; + hlens[0] = put_bits_count(&pb) >> 3; buffer_len -= hlens[0]; p += hlens[0]; @@ -555,7 +555,7 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out) put_bits(&pb, 1, 1); // framing flush_put_bits(&pb); - hlens[1] = (put_bits_count(&pb) + 7) / 8; + hlens[1] = put_bits_count(&pb) >> 3; buffer_len -= hlens[1]; p += hlens[1]; @@ -628,7 +628,7 @@ static int put_main_header(vorbis_enc_context *venc, uint8_t **out) put_bits(&pb, 1, 1); // framing flush_put_bits(&pb); - hlens[2] = (put_bits_count(&pb) + 7) / 8; + hlens[2] = put_bits_count(&pb) >> 3; len = hlens[0] + hlens[1] + hlens[2]; p = *out = av_mallocz(64 + len + len/255); @@ -1023,7 +1023,7 @@ static int vorbis_encode_frame(AVCodecContext *avccontext, avccontext->coded_frame->pts = venc->sample_count; venc->sample_count += avccontext->frame_size; flush_put_bits(&pb); - return (put_bits_count(&pb) + 7) / 8; + return put_bits_count(&pb) >> 3; } |