On Wed, Dec 21, 2011 at 11:01 PM, Diego Biurrun <[email protected]> wrote:
> On Wed, Dec 21, 2011 at 10:12:42PM +0200, Chris Berov wrote:
> >
> > --- a/libavcodec/asv1.c
> > +++ b/libavcodec/asv1.c
> > @@ -139,212 +140,247 @@ static av_cold void init_vlcs(ASV1Context *a){
> >
> > -static inline int asv2_get_bits(GetBitContext *gb, int n){
> > - return av_reverse[ get_bits(gb, n) << (8-n) ];
> > +static inline int asv2_get_bits(GetBitContext *gb, int n)
> > +{
> > + return av_reverse[ get_bits(gb, n) << (8 - n) ];
> > }
> >
> > -static inline void asv2_put_bits(PutBitContext *pb, int n, int v){
> > - put_bits(pb, n, av_reverse[ v << (8-n) ]);
> > +static inline void asv2_put_bits(PutBitContext *pb, int n, int v)
> > +{
> > + put_bits(pb, n, av_reverse[ v << (8 - n) ]);
> > }
>
> Drop the spaces inside [].
>
> > - if(code==3) return get_sbits(gb, 8);
> > - else return code - 3;
> > + if (code == 3) return get_sbits(gb, 8);
> > + else return code - 3;
>
> Break these lines, more below.
>
> > - if(ccp&8) block[a->scantable.permutated[4*i+0]]=
> (asv1_get_level(&a->gb) * a->intra_matrix[4*i+0])>>4;
> > - if(ccp&4) block[a->scantable.permutated[4*i+1]]=
> (asv1_get_level(&a->gb) * a->intra_matrix[4*i+1])>>4;
> > - if(ccp&2) block[a->scantable.permutated[4*i+2]]=
> (asv1_get_level(&a->gb) * a->intra_matrix[4*i+2])>>4;
> > - if(ccp&1) block[a->scantable.permutated[4*i+3]]=
> (asv1_get_level(&a->gb) * a->intra_matrix[4*i+3])>>4;
> > + if (ccp&8) block[a->scantable.permutated[4 * i + 0]] =
> > + (asv1_get_level(&a->gb) * a->intra_matrix[4 * i
> + 0]) >> 4;
> > + if (ccp&4) block[a->scantable.permutated[4 * i + 1]] =
> > + (asv1_get_level(&a->gb) * a->intra_matrix[4 * i
> + 1]) >> 4;
> > + if (ccp&2) block[a->scantable.permutated[4 * i + 2]] =
> > + (asv1_get_level(&a->gb) * a->intra_matrix[4 * i
> + 2]) >> 4;
> > + if (ccp&1) block[a->scantable.permutated[4 * i + 3]] =
> > + (asv1_get_level(&a->gb) * a->intra_matrix[4 * i
> + 3]) >> 4;
>
> Break these lines before "block[", not after "=", more below.
>
> > - if( (block[index + 0] = (block[index +
> 0]*a->q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
> > - if( (block[index + 8] = (block[index +
> 8]*a->q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
> > - if( (block[index + 1] = (block[index +
> 1]*a->q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
> > - if( (block[index + 9] = (block[index +
> 9]*a->q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
> > + if ( (block[index + 0] = (block[index + 0] *
> a->q_intra_matrix[index + 0] +
> > + (1 << 15)) >> 16) ) ccp |= 8;
> > + if ( (block[index + 8] = (block[index + 8] *
> a->q_intra_matrix[index + 8] +
> > + (1 << 15)) >> 16) ) ccp |= 4;
> > + if ( (block[index + 1] = (block[index + 1] *
> a->q_intra_matrix[index + 1] +
> > + (1 << 15)) >> 16) ) ccp |= 2;
> > + if ( (block[index + 9] = (block[index + 9] *
> a->q_intra_matrix[index + 9] +
> > + (1 << 15)) >> 16) ) ccp |= 1;
>
> Drop the spaces inside () and break the line before "cpp", more below.
>
> > - if(ccp){
> > - for(;nc_count; nc_count--)
> > + if (ccp) {
> > + for (;nc_count; nc_count--)
>
> space after ;
>
> > - if(ccp&8) asv1_put_level(&a->pb, block[index + 0]);
> > - if(ccp&4) asv1_put_level(&a->pb, block[index + 8]);
> > - if(ccp&2) asv1_put_level(&a->pb, block[index + 1]);
> > - if(ccp&1) asv1_put_level(&a->pb, block[index + 9]);
> > - }else{
> > + if (ccp&8) asv1_put_level(&a->pb, block[index + 0]);
> > + if (ccp&4) asv1_put_level(&a->pb, block[index + 8]);
> > + if (ccp&2) asv1_put_level(&a->pb, block[index + 1]);
> > + if (ccp&1) asv1_put_level(&a->pb, block[index + 9]);
> > + } else {
>
> spaces around &, break the lines
>
> > - if( (block[index]*a->q_intra_matrix[index] + (1<<15))>>16 )
> > + if ( (block[index] * a->q_intra_matrix[index] + (1 << 15)) >>
> 16 )
>
> Drop spaces inside (), more below.
>
> > @@ -375,13 +412,13 @@ static inline void dct_get(ASV1Context *a, int
> mb_x, int mb_y){
> >
> > - if(!(a->avctx->flags&CODEC_FLAG_GRAY)){
> > + if (!(a->avctx->flags&CODEC_FLAG_GRAY)) {
>
> spaces around &
>
>
> I'm stopping here, you get the idea. Please search for the things I
> pointed out above in the rest of your patch and resend it.
> Overall this is looking good, we should get it in quickly.
>
> Diego
> _______________________________________________
> libav-devel mailing list
> [email protected]
> https://lists.libav.org/mailman/listinfo/libav-devel
>
0001-asv1-cosmetics.patch
Description: Binary data
_______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
