Chris Berov <[email protected]> writes:
> From 479e768e986dcf0e6567f6e719473a97058c7d72 Mon Sep 17 00:00:00 2001
> From: unknown <[email protected]>
Please figure out who you are.
> Date: Sat, 17 Dec 2011 19:27:06 +0200
> Subject: [PATCH] golomb:cosmetics
>
> ---
> libavcodec/golomb.h | 260
> ++++++++++++++++++++++++++++-----------------------
> 1 files changed, 144 insertions(+), 116 deletions(-)
>
> diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
> index 503aa14..4612da2 100644
> --- a/libavcodec/golomb.h
> +++ b/libavcodec/golomb.h
> @@ -56,17 +56,17 @@ static inline int get_ue_golomb(GetBitContext *gb){
>
> OPEN_READER(re, gb);
> UPDATE_CACHE(re, gb);
> - buf=GET_CACHE(re, gb);
> + buf = GET_CACHE(re, gb);
>
> - if(buf >= (1<<27)){
> + if (buf >= (1 << 27)) {
> buf >>= 32 - 9;
> LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
> CLOSE_READER(re, gb);
>
> return ff_ue_golomb_vlc_code[buf];
> - }else{
> - log= 2*av_log2(buf) - 31;
> - buf>>= log;
> + } else {
> + log = 2 * av_log2(buf) - 31;
> + buf >>= log;
> buf--;
> LAST_SKIP_BITS(re, gb, 32 - log);
> CLOSE_READER(re, gb);
> @@ -98,7 +98,7 @@ static inline int get_ue_golomb_31(GetBitContext *gb){
>
> OPEN_READER(re, gb);
> UPDATE_CACHE(re, gb);
> - buf=GET_CACHE(re, gb);
> + buf = GET_CACHE(re, gb);
>
> buf >>= 32 - 9;
> LAST_SKIP_BITS(re, gb, ff_golomb_vlc_len[buf]);
> @@ -112,15 +112,15 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
>
> OPEN_READER(re, gb);
> UPDATE_CACHE(re, gb);
> - buf=GET_CACHE(re, gb);
> + buf = GET_CACHE(re, gb);
>
> - if(buf&0xAA800000){
> + if (buf & 0xAA800000) {
> buf >>= 32 - 8;
> LAST_SKIP_BITS(re, gb, ff_interleaved_golomb_vlc_len[buf]);
> CLOSE_READER(re, gb);
>
> return ff_interleaved_ue_golomb_vlc_code[buf];
> - }else{
> + } else {
> int ret = 1;
>
> while (1) {
These changes look OK.
> @@ -148,9 +148,12 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
> static inline int get_te0_golomb(GetBitContext *gb, int range){
> assert(range >= 1);
>
> - if(range==1) return 0;
> - else if(range==2) return get_bits1(gb)^1;
> - else return get_ue_golomb(gb);
> + if (range == 1)
> + return 0;
> + else if (range == 2)
> + return get_bits1(gb) ^ 1;
> + else
> + return get_ue_golomb(gb);
> }
>
> /**
> @@ -159,8 +162,10 @@ static inline int get_te0_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);
> }
I'm not sure about these. The "tabular" format has a certain appeal
here, although some spaces should be added either way.
[...]
> LAST_SKIP_BITS(re, gb, limit);
> - UPDATE_CACHE(re, gb);
> + UPDATE_CACHE (re, gb);
>
> buf = SHOW_UBITS(re, gb, esc_len);
>
> LAST_SKIP_BITS(re, gb, esc_len);
> - CLOSE_READER(re, gb);
> + CLOSE_READER (re, gb);
This spacing is weird. Don't make such changes. There are more of
these in the remainder of the patch. Please fix them.
--
Måns Rullgård
[email protected]
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel