On Thu, Dec 22, 2011 at 04:47:06PM +0200, Chris Berov wrote:
> [...]
Please snip your quotes, thank you.
> --- a/libavcodec/asv1.c
> +++ b/libavcodec/asv1.c
> @@ -139,212 +140,270 @@ static av_cold void init_vlcs(ASV1Context *a){
>
> -static inline void asv2_put_level(PutBitContext *pb, int level){
> - unsigned int index= level + 31;
> +static inline void asv2_put_level(PutBitContext *pb, int level)
> +{
> + unsigned int index = level + 31;
>
> - if(index <= 62) put_bits(pb, asv2_level_tab[index][1],
> asv2_level_tab[index][0]);
> - else{
> + if (index <= 62)
> + put_bits(pb, asv2_level_tab[index][1], asv2_level_tab[index][0]);
> + else {
> put_bits(pb, asv2_level_tab[31][1], asv2_level_tab[31][0]);
> asv2_put_bits(pb, 8, level&0xFF);
> - }
> + }
You have added trailing whitespace here, get rid of it and make sure you
set up your editor in a way it does not add trailing whitespace. Also
please doublecheck your patches for such things before sending.
> - if(ccp){
> - if(ccp == 16) break;
> + if (ccp) {
> + if (ccp == 16) break;
Break this line.
> - 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;
space around &
> - if(ccp){
> - if(ccp&4) block[a->scantable.permutated[1]]= (asv2_get_level(&a->gb)
> * a->intra_matrix[1])>>4;
> - if(ccp&2) block[a->scantable.permutated[2]]= (asv2_get_level(&a->gb)
> * a->intra_matrix[2])>>4;
> - if(ccp&1) block[a->scantable.permutated[3]]= (asv2_get_level(&a->gb)
> * a->intra_matrix[3])>>4;
> + if (ccp) {
> + if (ccp & 4)
> + block[a->scantable.permutated[1]] = (asv2_get_level(&a->gb) *
> + a->intra_matrix[1]) >> 4;
> + if (ccp & 2)
> + block[a->scantable.permutated[2]] = (asv2_get_level(&a->gb) *
> + a->intra_matrix[2]) >> 4;
> + if (ccp & 1)
> + block[a->scantable.permutated[3]] = (asv2_get_level(&a->gb) *
> + a->intra_matrix[3]) >> 4;
Hmmm, you added it correctly here, please make sure you are consistent.
> + 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;
> +
> + for (i = 0; i <= count; i++) {
> + const int index = scantab[4 * i];
> + int ccp = 0;
> +
> + 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 the () and break the lines.
Notice how you formatted the series of if-blocks differently, so at
least one variant must be changed. They should look like this:
if ((block[index + 9] = (block[index + 9] * a->q_intra_matrix[index + 9] +
(1 << 15)) >> 16))
ccp |= 1;
> + assert(i || ccp < 8);
> + if (i) put_bits(&a->pb, ac_ccp_tab[ccp][1], ac_ccp_tab[ccp][0]);
> + else put_bits(&a->pb, dc_ccp_tab[ccp][1], dc_ccp_tab[ccp][0]);
> +
> + if (ccp) {
> + if (ccp&8) asv2_put_level(&a->pb, block[index + 0]);
> + if (ccp&4) asv2_put_level(&a->pb, block[index + 8]);
> + if (ccp&2) asv2_put_level(&a->pb, block[index + 1]);
> + if (ccp&1) asv2_put_level(&a->pb, block[index + 9]);
Break these lines and add spaces around &.
OK, enough for now. We are making progress, but this still needs some
changes. Please doublecheck the rest of the file yourself from the
suggestions I made above.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel