We're getting somewhere ...

On Fri, Dec 30, 2011 at 11:40:37PM +0530, Shitiz Garg wrote:
> --- a/libavcodec/cook.c
> +++ b/libavcodec/cook.c
> @@ -274,26 +279,27 @@ static av_cold void init_cplscales_table (COOKContext 
> *q) {
>   * @param bytes     number of bytes
>   */
>  
> -static inline int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int 
> bytes){
> +static inline int decode_bytes(const uint8_t *inbuffer, uint8_t *out, int 
> bytes)
> +{

Drop the empty lines between Doxygen comments and function declaration.

>      /* FIXME: 64 bit platforms would be able to do 64 bits at a time.
>       * I'm too lazy though, should be something like
>       * for(i=0 ; i<bitamount/64 ; i++)
>       *     (int64_t)out[i] = 0x37c511f237c511f2^av_be2ne64(int64_t)in[i]);
>       * Buffer alignment needs to be checked. */

Reformat this as well please.

> @@ -343,7 +349,8 @@ static void decode_gain_info(GetBitContext *gb, int 
> *gaininfo)
>  {
>      int i, n;
>  
> -    while (get_bits1(gb)) {}
> +    while (get_bits1(gb)) {
> +    }

    while (get_bits1(gb)) {
        /* NOTHING */
    }

>      n = get_bits_count(gb) - 1;     //amount of elements*2 to update

space after //, more in other places ...

> @@ -363,24 +370,25 @@ static void decode_gain_info(GetBitContext *gb, int 
> *gaininfo)
>   * @param quant_index_table pointer to the array
>   */
>  
> -static void decode_envelope(COOKContext *q, COOKSubpacket *p, int* 
> quant_index_table) {
> -    int i,j, vlc_index;
> +static void decode_envelope(COOKContext *q, COOKSubpacket *p, int 
> *quant_index_table)
> +{

That's a long line that you can shorten easily, likely more in other places.

> @@ -393,47 +401,48 @@ static void decode_envelope(COOKContext *q, 
> COOKSubpacket *p, int* quant_index_t
>  
> -    memset(&exp_index1,           0, sizeof(exp_index1));
> -    memset(&exp_index2,           0, sizeof(exp_index2));
> +    memset(&exp_index1, 0, sizeof(exp_index1));
> +    memset(&exp_index2, 0, sizeof(exp_index2));
>      memset(&tmp_categorize_array, 0, sizeof(tmp_categorize_array));

This was done on purpose, keep it.

> @@ -977,30 +990,30 @@ static int cook_decode_frame(AVCodecContext *avctx, 
> void *data,
>  
>      /* decode supbackets */
> -    for(i=0;i<q->num_subpackets;i++){
> -        q->subpacket[i].bits_per_subpacket = 
> (q->subpacket[i].size*8)>>q->subpacket[i].bits_per_subpdiv;
> +    for (i = 0; i < q->num_subpackets; i++) {
> +        q->subpacket[i].bits_per_subpacket = (q->subpacket[i].size * 8) >> 
> q->subpacket[i].bits_per_subpdiv;
>          q->subpacket[i].ch_idx = chidx;
> -        av_log(avctx,AV_LOG_DEBUG,"subpacket[%i] size %i js %i %i 
> block_align 
> %i\n",i,q->subpacket[i].size,q->subpacket[i].joint_stereo,offset,avctx->block_align);
> +        av_log(avctx, AV_LOG_DEBUG, "subpacket[%i] size %i js %i %i 
> block_align %i\n", i, q->subpacket[i].size, q->subpacket[i].joint_stereo, 
> offset, avctx->block_align);

This (and other) av_log lines could easily be broken.

> -                }else
> -                    q->subpacket[s].samples_per_channel = 
> q->subpacket[s].samples_per_frame;
> +            }else
> +                q->subpacket[s].samples_per_channel = 
> q->subpacket[s].samples_per_frame;

space after }

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

Reply via email to