On Wed, Oct 26, 2011 at 04:09:16PM -0400, Justin Ruggles wrote:
> ---
> libavcodec/mpegaudiodec.c | 867
> ++++++++++++++++++++++-----------------------
> 1 files changed, 432 insertions(+), 435 deletions(-)
Patch OK, optional suggestions below.
> --- a/libavcodec/mpegaudiodec.c
> +++ b/libavcodec/mpegaudiodec.c
> @@ -112,18 +112,16 @@ typedef struct MPADecodeContext {
> static VLC huff_quad_vlc[2];
> -static VLC_TYPE huff_quad_vlc_tables[128+16][2];
> -static const int huff_quad_vlc_tables_sizes[2] = {
> - 128, 16
> -};
> +static VLC_TYPE huff_quad_vlc_tables[128+16][2];
spaces around '+'
> @@ -428,27 +429,27 @@ static av_cold int decode_init(AVCodecContext * avctx)
>
> - if(j==2)
> + if (j == 2)
> mdct_win[j][i/3] = FIXHR((d / (1<<5)));
> else
> mdct_win[j][i ] = FIXHR((d / (1<<5)));
spaces around '<<'
> @@ -506,41 +507,41 @@ static void imdct12(INTFLOAT *out, INTFLOAT *in)
>
> - in0= in[0*3];
> - in1= in[1*3] + in[0*3];
> - in2= in[2*3] + in[1*3];
> - in3= in[3*3] + in[2*3];
> - in4= in[4*3] + in[3*3];
> - in5= in[5*3] + in[4*3];
> + in0 = in[0*3];
> + in1 = in[1*3] + in[0*3];
> + in2 = in[2*3] + in[1*3];
> + in3 = in[3*3] + in[2*3];
> + in4 = in[4*3] + in[3*3];
> + in5 = in[5*3] + in[4*3];
spaces around '*'
> + in5 += 2*in1;
same
> @@ -985,13 +983,15 @@ static void switch_buffer(MPADecodeContext *s, int
> *pos, int *end_pos, int *end_
> #if CONFIG_FLOAT
> -#define READ_FLIP_SIGN(dst,src)\
> - v = AV_RN32A(src) ^ (get_bits1(&s->gb)<<31);\
> - AV_WN32A(dst, v);
> +#define READ_FLIP_SIGN(dst,src) do { \
> + v = AV_RN32A(src) ^ (get_bits1(&s->gb) << 31); \
> + AV_WN32A(dst, v); \
> + } while (0)
> #else
> -#define READ_FLIP_SIGN(dst,src)\
> - v= -get_bits1(&s->gb);\
> - *(dst) = (*(src) ^ v) - v;
> +#define READ_FLIP_SIGN(dst,src) do { \
> + v = -get_bits1(&s->gb); \
> + *(dst) = (*(src) ^ v) - v; \
> + } while (0)
> #endif
Not sure if adding do/while counts as cosmetics.
> @@ -1160,34 +1160,32 @@ static void reorder_block(MPADecodeContext *s,
> GranuleDef *g)
>
> ptr1 = ptr;
> - dst = tmp;
> - for(j=len;j>0;j--) {
> + dst = tmp;
> + for (j = len; j > 0; j--) {
> *dst++ = ptr[0*len];
> *dst++ = ptr[1*len];
> *dst++ = ptr[2*len];
spaces around '*'
> @@ -1323,8 +1321,8 @@ static void compute_stereo(MPADecodeContext *s,
> int tmp0 = ptr[-1-j]; \
> int tmp1 = ptr[ j]; \
> int tmp2 = MULH(tmp0 + tmp1, csa_table[j][0]); \
> - ptr[-1-j] = 4*(tmp2 - MULH(tmp1, csa_table[j][2])); \
> - ptr[ j] = 4*(tmp2 + MULH(tmp0, csa_table[j][3])); \
> + ptr[-1-j] = 4 * (tmp2 - MULH(tmp1, csa_table[j][2])); \
> + ptr[ j] = 4 * (tmp2 + MULH(tmp0, csa_table[j][3])); \
spaces around '-'
> @@ -1828,19 +1823,19 @@ static int decode_frame(AVCodecContext * avctx,
>
> #if CONFIG_MP3ADU_DECODER || CONFIG_MP3ADUFLOAT_DECODER
> -static int decode_frame_adu(AVCodecContext * avctx,
> - void *data, int *data_size,
> - AVPacket *avpkt)
> +static int decode_frame_adu(AVCodecContext * avctx, void *data, int
> *data_size,
> + AVPacket *avpkt)
*avctx
> @@ -1893,9 +1887,9 @@ static int decode_frame_adu(AVCodecContext * avctx,
> typedef struct MP3On4DecodeContext {
> - int frames; ///< number of mp3 frames per block (number of mp3 decoder
> instances)
> - int syncword; ///< syncword patch
> - const uint8_t *coff; ///< channels offsets in output buffer
> + int frames; ///< number of mp3 frames per block
> (number of mp3 decoder instances)
> + int syncword; ///< syncword patch
> + const uint8_t *coff; ///< channels offsets in output buffer
channel
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel