[FFmpeg-devel] [PATCH] change all get_bits(.., 1) to get_bits1

Michael Niedermayer michaelni
Wed Aug 8 23:34:24 CEST 2007


Hi

On Wed, Aug 08, 2007 at 10:43:31PM +0200, Alex Beregszaszi wrote:
> Hi,
> 
> the attached patch changes all get_bits(.., 1) calls to get_bits1(..)
[...]
> Index: dca.c
> ===================================================================
> --- dca.c	(revision 9994)
> +++ dca.c	(working copy)
> @@ -253,27 +253,27 @@
>      if (!s->bit_rate)
>          return -1;
>  
> -    s->downmix           = get_bits(&s->gb, 1);
> -    s->dynrange          = get_bits(&s->gb, 1);
> -    s->timestamp         = get_bits(&s->gb, 1);
> -    s->aux_data          = get_bits(&s->gb, 1);
> -    s->hdcd              = get_bits(&s->gb, 1);
> +    s->downmix           = get_bits1(&s->gb);
> +    s->dynrange          = get_bits1(&s->gb);
> +    s->timestamp         = get_bits1(&s->gb);
> +    s->aux_data          = get_bits1(&s->gb);
> +    s->hdcd              = get_bits1(&s->gb);
>      s->ext_descr         = get_bits(&s->gb, 3);
> -    s->ext_coding        = get_bits(&s->gb, 1);
> -    s->aspf              = get_bits(&s->gb, 1);
> +    s->ext_coding        = get_bits1(&s->gb);
> +    s->aspf              = get_bits1(&s->gb);
>      s->lfe               = get_bits(&s->gb, 2);
> -    s->predictor_history = get_bits(&s->gb, 1);
> +    s->predictor_history = get_bits1(&s->gb);
>  
>      /* TODO: check CRC */
>      if (s->crc_present)
>          s->header_crc    = get_bits(&s->gb, 16);
>  
> -    s->multirate_inter   = get_bits(&s->gb, 1);
> +    s->multirate_inter   = get_bits1(&s->gb);
>      s->version           = get_bits(&s->gb, 4);
>      s->copy_history      = get_bits(&s->gb, 2);
>      s->source_pcm_res    = get_bits(&s->gb, 3);
> -    s->front_sum         = get_bits(&s->gb, 1);
> -    s->surround_sum      = get_bits(&s->gb, 1);
> +    s->front_sum         = get_bits1(&s->gb);
> +    s->surround_sum      = get_bits1(&s->gb);
>      s->dialog_norm       = get_bits(&s->gb, 4);

these where nicely aligned before now they are no longer
so i leave this to the dca maintainer ...


[...]
> @@ -2407,9 +2407,9 @@
>              if (v->pq == 1)
>                  dcdiff = (dcdiff<<2) + get_bits(gb, 2) - 3;
>              else if (v->pq == 2)
> -                dcdiff = (dcdiff<<1) + get_bits(gb, 1) - 1;
> +                dcdiff = (dcdiff<<1) + get_bits1(gb) - 1;

please maintain the alignment of - X


[...]

iam ok with the remainder

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070808/5a3747f9/attachment.pgp>



More information about the ffmpeg-devel mailing list