On Thu, Jan 12, 2012 at 06:29:46AM +0100, Luca Barbato wrote:
> From: Chris Berov <chrisbe...@gmail.com>
> 
> Signed-off-by: Luca Barbato <lu_z...@gentoo.org>
> ---
>  libavcodec/golomb.h |  300 
> +++++++++++++++++++++++++++++----------------------
>  1 files changed, 172 insertions(+), 128 deletions(-)

Looks mostly fine, but did you check the file with the patch applied?
Many of the GCI patches I reviewed looked fine after some iterations,
but I would find many instances of issues to fix when looking at the
files themselves.

I have some comments below.  Feel free to push with those changes applied,
I think we have seen enough revisions of this patch fly by.

> --- a/libavcodec/golomb.h
> +++ b/libavcodec/golomb.h
> @@ -145,90 +148,100 @@ static inline int svq3_get_ue_golomb(GetBitContext 
> *gb){
>  
> -static inline int get_te_golomb(GetBitContext *gb, int range){
> +static inline int get_te_golomb(GetBitContext *gb, int range)
> +{
>      assert(range >= 1);
>  
> -    if(range==2) return get_bits1(gb)^1;
> -    else         return get_ue_golomb(gb);
> +    if (range == 2) return get_bits1(gb) ^ 1;
> +    else            return get_ue_golomb(gb);

Break the lines.

> -        for(log=31; (buf & 0x80000000) == 0; log--){
> +        for (log = 31; (buf & 0x80000000) == 0; log--) {
>              buf = (buf << 2) - ((buf << log) >> (log - 1)) + (buf >> 30);
>          }

maybe drop {}

> @@ -249,24 +262,25 @@ static inline int dirac_get_se_golomb(GetBitContext 
> *gb){
>  
> -    if(log > 31-limit){
> +    if (log > 31 - limit) {
>          buf >>= log - k;
> -        buf += (30-log)<<k;
> +        buf += (30 - log) << k;

The = could be aligned.

> @@ -282,48 +296,51 @@ static inline int get_ur_golomb(GetBitContext *gb, int 
> k, int limit, int esc_len
> -    if(log - k >= 32-MIN_CACHE_BITS+(MIN_CACHE_BITS==32) && 32-log < limit){
> +    if (log - k >= 32 - MIN_CACHE_BITS + (MIN_CACHE_BITS == 32) &&
> +        32 - log < limit) {
>          buf >>= log - k;
> -        buf += (30-log)<<k;
> +        buf += (30 - log) << k;

ditto

> -static inline int get_ue(GetBitContext *s, char *file, const char *func, int 
> line){
> -    int show= show_bits(s, 24);
> -    int pos= get_bits_count(s);
> -    int i= get_ue_golomb(s);
> -    int len= get_bits_count(s) - pos;
> -    int bits= show>>(24-len);
> +static inline int get_ue(GetBitContext *s, char *file, const char *func, int 
> line)
> +{
> +    int show = show_bits(s, 24);
> +    int pos  = get_bits_count(s);
> +    int i    = get_ue_golomb(s);
> +    int len  = get_bits_count(s) - pos;
> +    int bits = show>>(24 - len);

spaces around >>

> -static inline int get_se(GetBitContext *s, char *file, const char *func, int 
> line){
> -    int show= show_bits(s, 24);
> -    int pos= get_bits_count(s);
> -    int i= get_se_golomb(s);
> -    int len= get_bits_count(s) - pos;
> -    int bits= show>>(24-len);
> +static inline int get_se(GetBitContext *s, char *file, const char *func, int 
> line)
> +{
> +    int show = show_bits(s, 24);
> +    int pos  = get_bits_count(s);
> +    int i    = get_se_golomb(s);
> +    int len  = get_bits_count(s) - pos;
> +    int bits = show>>(24 - len);

ditto

> -static inline int get_te(GetBitContext *s, int r, char *file, const char 
> *func, int line){
> -    int show= show_bits(s, 24);
> -    int pos= get_bits_count(s);
> -    int i= get_te0_golomb(s, r);
> -    int len= get_bits_count(s) - pos;
> -    int bits= show>>(24-len);
> +static inline int get_te(GetBitContext *s, int r, char *file, const char 
> *func, int line)
> +{
> +    int show = show_bits(s, 24);
> +    int pos  = get_bits_count(s);
> +    int i    = get_te0_golomb(s, r);
> +    int len  = get_bits_count(s) - pos;
> +    int bits = show>>(24 - len);

again

> @@ -424,52 +452,60 @@ static inline int get_te(GetBitContext *s, int r, char 
> *file, const char *func,
>  #if 0
> -    if(i<=0) i= -2*i;
> -    else     i=  2*i-1;
> +    if (i <= 0)
> +        i = -2 * i;
> +    else
> +        i =  2 * i - 1;
>  #elif 1
> -    i= 2*i-1;
> -    if(i<0) i^= -1; //FIXME check if gcc does the right thing
> +    i = 2 * i - 1;
> +    if (i < 0)
> +        i ^= -1; //FIXME check if gcc does the right thing
>  #else
> -    i= 2*i-1;
> -    i^= (i>>31);
> +    i   = 2 * i - 1;
> +    i ^= (i >> 31);

align

Diego
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to