Mercurial > libavcodec.hg
comparison huffyuv.c @ 10535:95f3daa991a2 libavcodec
Use get_bits_left() instead of size_in_bits - get_bits_count().
author | rbultje |
---|---|
date | Mon, 16 Nov 2009 17:42:43 +0000 |
parents | 71760101783e |
children | a8620b001ed3 |
comparison
equal
deleted
inserted
replaced
10534:4cd2ef16fb63 | 10535:95f3daa991a2 |
---|---|
691 static void decode_422_bitstream(HYuvContext *s, int count){ | 691 static void decode_422_bitstream(HYuvContext *s, int count){ |
692 int i; | 692 int i; |
693 | 693 |
694 count/=2; | 694 count/=2; |
695 | 695 |
696 if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*4)){ | 696 if(count >= (get_bits_left(&s->gb))/(31*4)){ |
697 for(i=0; i<count && get_bits_count(&s->gb) < s->gb.size_in_bits; i++){ | 697 for(i=0; i<count && get_bits_count(&s->gb) < s->gb.size_in_bits; i++){ |
698 READ_2PIX(s->temp[0][2*i ], s->temp[1][i], 1); | 698 READ_2PIX(s->temp[0][2*i ], s->temp[1][i], 1); |
699 READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2); | 699 READ_2PIX(s->temp[0][2*i+1], s->temp[2][i], 2); |
700 } | 700 } |
701 }else{ | 701 }else{ |
709 static void decode_gray_bitstream(HYuvContext *s, int count){ | 709 static void decode_gray_bitstream(HYuvContext *s, int count){ |
710 int i; | 710 int i; |
711 | 711 |
712 count/=2; | 712 count/=2; |
713 | 713 |
714 if(count >= (s->gb.size_in_bits - get_bits_count(&s->gb))/(31*2)){ | 714 if(count >= (get_bits_left(&s->gb))/(31*2)){ |
715 for(i=0; i<count && get_bits_count(&s->gb) < s->gb.size_in_bits; i++){ | 715 for(i=0; i<count && get_bits_count(&s->gb) < s->gb.size_in_bits; i++){ |
716 READ_2PIX(s->temp[0][2*i ], s->temp[0][2*i+1], 0); | 716 READ_2PIX(s->temp[0][2*i ], s->temp[0][2*i+1], 0); |
717 } | 717 } |
718 }else{ | 718 }else{ |
719 for(i=0; i<count; i++){ | 719 for(i=0; i<count; i++){ |