On 09/06/16 17:13, Diego Biurrun wrote:
> From: Alexandra Hájková <[email protected]>
> 
> ---
>  libavcodec/aic.c                       |  2 +-
>  libavcodec/alac.c                      |  2 +-
>  libavcodec/alsdec.c                    |  3 ++-
>  libavcodec/apedec.c                    |  2 +-
>  libavcodec/dca_xll.c                   |  2 +-
>  libavcodec/dxtory.c                    |  2 +-
>  libavcodec/ituh263dec.c                |  2 +-
>  libavcodec/mss4.c                      |  2 +-
>  libavcodec/ralf.c                      |  2 +-
>  libavcodec/takdec.c                    |  2 +-
>  libavcodec/unary.h                     | 19 ++++++++++---------
>  libavcodec/{unary.h => unary_legacy.h} |  0
>  libavcodec/vc1.c                       |  2 +-
>  libavcodec/vc1_block.c                 |  2 +-
>  libavcodec/wavpack.c                   |  2 +-
>  libavformat/mpc8.c                     |  3 ++-
>  16 files changed, 26 insertions(+), 23 deletions(-)
>  copy libavcodec/{unary.h => unary_legacy.h} (100%)
> 
> diff --git a/libavcodec/aic.c b/libavcodec/aic.c
> index 7c6dddd..2c9b6f8 100644
> --- a/libavcodec/aic.c
> +++ b/libavcodec/aic.c
> @@ -29,7 +29,7 @@
>  #include "golomb.h"
>  #include "idctdsp.h"
>  #include "thread.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  
>  #define AIC_HDR_SIZE    24
>  #define AIC_BAND_COEFFS (64 + 32 + 192 + 96)
> diff --git a/libavcodec/alac.c b/libavcodec/alac.c
> index 1f24e1b..236f177 100644
> --- a/libavcodec/alac.c
> +++ b/libavcodec/alac.c
> @@ -52,8 +52,8 @@
>  #include "get_bits.h"
>  #include "bytestream.h"
>  #include "internal.h"
> -#include "unary.h"
>  #include "mathops.h"
> +#include "unary_legacy.h"
>  #include "alac_data.h"
>  
>  #define ALAC_EXTRADATA_SIZE 36
> diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
> index f356a70..9d7133e 100644
> --- a/libavcodec/alsdec.c
> +++ b/libavcodec/alsdec.c
> @@ -29,12 +29,13 @@
>  
>  #include "avcodec.h"
>  #include "get_bits.h"
> -#include "unary.h"
>  #include "mpeg4audio.h"
>  #include "bytestream.h"
>  #include "bgmc.h"
>  #include "bswapdsp.h"
>  #include "internal.h"
> +#include "unary_legacy.h"
> +
>  #include "libavutil/samplefmt.h"
>  #include "libavutil/crc.h"
>  
> diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
> index 2f64488..69ded9a 100644
> --- a/libavcodec/apedec.c
> +++ b/libavcodec/apedec.c
> @@ -31,7 +31,7 @@
>  #include "bytestream.h"
>  #include "internal.h"
>  #include "get_bits.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  
>  /**
>   * @file
> diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c
> index 5a558b8..5d76793 100644
> --- a/libavcodec/dca_xll.c
> +++ b/libavcodec/dca_xll.c
> @@ -29,7 +29,7 @@
>  #include "dca.h"
>  #include "dcadata.h"
>  #include "get_bits.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  
>  /* Sign as bit 0 */
>  static inline int get_bits_sm(GetBitContext *s, unsigned n)
> diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c
> index 937b96c..27b2e2f 100644
> --- a/libavcodec/dxtory.c
> +++ b/libavcodec/dxtory.c
> @@ -30,7 +30,7 @@
>  #include "bytestream.h"
>  #include "get_bits.h"
>  #include "internal.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  
>  static int dxtory_decode_v1_rgb(AVCodecContext *avctx, AVFrame *pic,
>                                  const uint8_t *src, int src_size,
> diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
> index 9199f5c..ca0dd2c 100644
> --- a/libavcodec/ituh263dec.c
> +++ b/libavcodec/ituh263dec.c
> @@ -40,7 +40,7 @@
>  #include "internal.h"
>  #include "mathops.h"
>  #include "mpegutils.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  #include "flv.h"
>  #include "rv10.h"
>  #include "mpeg4video.h"
> diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
> index a953a57..666ca48 100644
> --- a/libavcodec/mss4.c
> +++ b/libavcodec/mss4.c
> @@ -30,7 +30,7 @@
>  #include "get_bits.h"
>  #include "internal.h"
>  #include "mss34dsp.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  
>  #define HEADER_SIZE 8
>  
> diff --git a/libavcodec/ralf.c b/libavcodec/ralf.c
> index bed5adf..9812837 100644
> --- a/libavcodec/ralf.c
> +++ b/libavcodec/ralf.c
> @@ -32,7 +32,7 @@
>  #include "get_bits.h"
>  #include "golomb.h"
>  #include "internal.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  #include "ralfdata.h"
>  
>  #define FILTER_NONE 0
> diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
> index c9db928..48d029e 100644
> --- a/libavcodec/takdec.c
> +++ b/libavcodec/takdec.c
> @@ -32,7 +32,7 @@
>  #include "audiodsp.h"
>  #include "avcodec.h"
>  #include "internal.h"
> -#include "unary.h"
> +#include "unary_legacy.h"
>  #include "tak.h"
>  
>  #define MAX_SUBFRAMES     8                         // max number of 
> subframes per channel
> diff --git a/libavcodec/unary.h b/libavcodec/unary.h
> index d14929f..2115e1c 100644
> --- a/libavcodec/unary.h
> +++ b/libavcodec/unary.h
> @@ -21,36 +21,37 @@
>  #ifndef AVCODEC_UNARY_H
>  #define AVCODEC_UNARY_H
>  
> -#include "get_bits.h"
> +#include "bitstream.h"
>  
>  /**
>   * Get unary code of limited length
> - * @param gb GetBitContext
> +:* @param bc BitstreamContext

Looks a typo

>   * @param[in] stop The bitstop value (unary code of 1's or 0's)
>   * @param[in] len Maximum length
>   * @return Unary length/index
>   */
> -static inline int get_unary(GetBitContext *gb, int stop, int len)
> +static inline int get_unary(BitstreamContext *bc, int stop, int len)
>  {
>      int i;
>  
> -    for(i = 0; i < len && get_bits1(gb) != stop; i++);
> +    for (i = 0; i < len && bitstream_read_bit(bc) != stop; i++)
> +        ;

looks ugly.

>      return i;
>  }
>  

The rest is fine.

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to