[libav-devel] [PATCH 6/6] vcr1enc: Replace obsolete get_bit_count() by put_bits_count().

Kostya Shishkov kostya.shishkov at gmail.com
Wed May 9 17:44:11 CEST 2012


On Wed, May 09, 2012 at 05:10:39PM +0200, Diego Biurrun wrote:
> ---
>  libavcodec/vcr1.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c
> index b395691..b2bc240 100644
> --- a/libavcodec/vcr1.c
> +++ b/libavcodec/vcr1.c
> @@ -151,6 +151,9 @@ AVCodec ff_vcr1_decoder = {
>  #define CONFIG_VCR1_ENCODER 0
>  
>  #if CONFIG_VCR1_ENCODER
> +
> +#include "put_bits.h"
> +
>  static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
>                          int buf_size, void *data)
>  {
> @@ -164,10 +167,10 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
>      p->key_frame = 1;
>  
>      avpriv_align_put_bits(&a->pb);
> -    while (get_bit_count(&a->pb) & 31)
> +    while (put_bits_count(&a->pb) & 31)
>          put_bits(&a->pb, 8, 0);

flush_put_bits(&a->gb); should do the same as this loop

>  
> -    size = get_bit_count(&a->pb) / 32;
> +    size = put_bits_count(&a->pb) / 32;
>  
>      return size * 4;
>  }
> -- 

otherwise looks OK


More information about the libav-devel mailing list