diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2003-01-21 17:34:12 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2003-01-21 17:34:12 +0000 |
commit | 68f593b48433842f3407586679fe07f3e5199ab9 (patch) | |
tree | d4630fb579685c92841ecf5b78d3cc47456d07d1 /libavcodec/h263dec.c | |
parent | fe50f38577887ea8e1a66a95503a97438e2d768f (diff) | |
download | ffmpeg-68f593b48433842f3407586679fe07f3e5199ab9.tar.gz |
GetBitContext.size is allways multiplied by 8 -> use size_in_bits to avoid useless *8 in a few inner loops
Originally committed as revision 1486 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263dec.c')
-rw-r--r-- | libavcodec/h263dec.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index b0e7a0a7ea..3e4610658c 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -249,13 +249,13 @@ static int decode_slice(MpegEncContext *s){ /* try to detect the padding bug */ if( s->codec_id==CODEC_ID_MPEG4 && (s->workaround_bugs&FF_BUG_AUTODETECT) - && s->gb.size*8 - get_bits_count(&s->gb) >=0 - && s->gb.size*8 - get_bits_count(&s->gb) < 48 + && s->gb.size_in_bits - get_bits_count(&s->gb) >=0 + && s->gb.size_in_bits - get_bits_count(&s->gb) < 48 // && !s->resync_marker && !s->data_partitioning){ const int bits_count= get_bits_count(&s->gb); - const int bits_left = s->gb.size*8 - bits_count; + const int bits_left = s->gb.size_in_bits - bits_count; if(bits_left==0){ s->padding_bug_score+=16; @@ -274,7 +274,7 @@ static int decode_slice(MpegEncContext *s){ // handle formats which dont have unique end markers if(s->msmpeg4_version || (s->workaround_bugs&FF_BUG_NO_PADDING)){ //FIXME perhaps solve this more cleanly - int left= s->gb.size*8 - get_bits_count(&s->gb); + int left= s->gb.size_in_bits - get_bits_count(&s->gb); int max_extra=7; /* no markers in M$ crap */ @@ -299,7 +299,7 @@ static int decode_slice(MpegEncContext *s){ } fprintf(stderr, "slice end not reached but screenspace end (%d left %06X)\n", - s->gb.size*8 - get_bits_count(&s->gb), + s->gb.size_in_bits - get_bits_count(&s->gb), show_bits(&s->gb, 24)); return -1; } @@ -441,9 +441,9 @@ uint64_t time= rdtsc(); retry: if(s->bitstream_buffer_size && buf_size<20){ //divx 5.01+ frame reorder - init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size); + init_get_bits(&s->gb, s->bitstream_buffer, s->bitstream_buffer_size*8); }else - init_get_bits(&s->gb, buf, buf_size); + init_get_bits(&s->gb, buf, buf_size*8); s->bitstream_buffer_size=0; if (!s->context_initialized) { @@ -460,7 +460,7 @@ retry: if(s->avctx->extradata_size && s->picture_number==0){ GetBitContext gb; - init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size); + init_get_bits(&gb, s->avctx->extradata, s->avctx->extradata_size*8); ret = ff_mpeg4_decode_picture_header(s, &gb); } ret = ff_mpeg4_decode_picture_header(s, &s->gb); @@ -632,7 +632,7 @@ retry: decode_slice(s); s->error_status_table[0]|= VP_START; - while(s->mb_y<s->mb_height && s->gb.size*8 - get_bits_count(&s->gb)>16){ + while(s->mb_y<s->mb_height && s->gb.size_in_bits - get_bits_count(&s->gb)>16){ if(s->msmpeg4_version){ if(s->mb_x!=0 || (s->mb_y%s->slice_height)!=0) break; |