On Mon, Sep 08, 2014 at 01:40:28PM -0400, Gabriel Dume wrote:
>
> --- a/libavcodec/dvdec.c
> +++ b/libavcodec/dvdec.c
> @@ -164,16 +165,16 @@ static int dv_decode_video_segment(AVCodecContext
> *avctx, void *arg)
> BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
> - LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [ 80 +
> FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
> - LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 +
> FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
> + LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 +
> FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
> + LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5 * 80 +
> FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
The alignment looked good before, maybe
LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [80 +
FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [80 * 5 +
FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
> /* pass 1: read DC and AC coefficients in blocks */
> buf_ptr = &s->buf[work_chunk->buf_offset*80];
spaces around *
> @@ -199,13 +200,13 @@ static int dv_decode_video_segment(AVCodecContext
> *avctx, void *arg)
> mb->scan_table = s->dv_zigzag[dct_mode];
> - mb->factor_table = &s->idct_factor[(class1 == 3)*2*22*64 +
> dct_mode*22*64 +
> - (quant +
> ff_dv_quant_offset[class1])*64];
> + mb->factor_table = &s->idct_factor[(class1 == 3) * 2 * 22 *
> 64 + dct_mode * 22 * 64 +
> + (quant + ff_dv_quant_offset[class1]) *
> 64];
The second line should align with the array parenthesis.
> --- a/libavcodec/dvenc.c
> +++ b/libavcodec/dvenc.c
> @@ -186,21 +187,24 @@ static av_always_inline PutBitContext*
> dv_encode_ac(EncBlockInfo* bi,
> bi->cur_ac = bi->next[prev];
> - if (bi->cur_ac < 64){
> + if (bi->cur_ac < 64)
> size = dv_rl2vlc(bi->cur_ac - prev - 1, bi->mb[bi->cur_ac],
> bi->sign[bi->cur_ac], &vlc);
> - } else {
> - size = 4; vlc = 6; /* End Of Block stamp */
> + else {
> + size = 4;
> + vlc = 6; /* End Of Block stamp */
> }
Maybe leave the {}.
> @@ -249,31 +255,34 @@ static av_always_inline int
> dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
> #if 0 /* SMPTE spec method */
> static const int classes[] = {12, 24, 36, 0xffff};
spaces inside {}
> @@ -286,51 +295,55 @@ static av_always_inline int
> dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
> /* weight it and and shift down into range, adding for
> rounding */
> /* the extra division by a factor of 2^4 reverses the 8x
> expansion of the DCT
> AND the 2x doubling of the weights */
Start the comment line with *.
> @@ -345,27 +358,27 @@ static inline void dv_guess_qnos(EncBlockInfo* blks,
> int* qnos)
> assert(b->mb[b->next[k]]);
> - b->bit_size[a2] += dv_rl2vlc_size(b->next[k]
> - prev - 1, b->mb[b->next[k]])
> - -dv_rl2vlc_size(b->next[k]
> - k - 1, b->mb[b->next[k]]);
> + b->bit_size[a2] += dv_rl2vlc_size(b->next[k]
> - prev - 1, b->mb[b->next[k]]) -
> + dv_rl2vlc_size(b->next[k]
> - k - 1, b->mb[b->next[k]]);
The alignment looked good before.
> @@ -373,18 +386,18 @@ static inline void dv_guess_qnos(EncBlockInfo* blks,
> int* qnos)
> for (a = 2; a == 2 || vs_total_ac_bits < size[0]; a += a){
space between ) and {
I'll fix my comments and queue your patch.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel