On 12/03/2011 03:07 PM, Chris Berov wrote:
> From fd5c8d69407004b4bd086eb98c80c889b1fc5454 Mon Sep 17 00:00:00 2001
> From: unknown <[email protected]>
> Date: Fri, 2 Dec 2011 21:52:49 +0200
> Subject: [PATCH] adpcmenc: cosmetics: pretty-printing
>
> ---
> libavcodec/adpcmenc.c | 451
> +++++++++++++++++++++++++++----------------------
> 1 files changed, 253 insertions(+), 198 deletions(-)
[...]
> @@ -150,33 +160,37 @@ static av_cold int adpcm_encode_close(AVCodecContext
> *avctx)
> }
>
>
> -static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c,
> short sample)
> +static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c,
> + short sample)
> {
> - int delta = sample - c->prev_sample;
> - int nibble = FFMIN(7, abs(delta)*4/ff_adpcm_step_table[c->step_index]) +
> (delta<0)*8;
> - c->prev_sample += ((ff_adpcm_step_table[c->step_index] *
> ff_adpcm_yamaha_difflookup[nibble]) / 8);
> + int delta = sample - c->prev_sample;
> + int nibble = FFMIN(7, abs(delta) * 4 /
> + ff_adpcm_step_table[c->step_index]) + (delta < 0) * 8;
> + c->prev_sample += ((ff_adpcm_step_table[c->step_index] *
> + ff_adpcm_yamaha_difflookup[nibble]) / 8);
this still isn't aligned correctly.
> - if((version == CODEC_ID_ADPCM_IMA_WAV) || (version ==
> CODEC_ID_ADPCM_IMA_QT) || (version == CODEC_ID_ADPCM_SWF))
> + if (version == CODEC_ID_ADPCM_IMA_WAV ||
> + version == CODEC_ID_ADPCM_IMA_QT ||
> + version == CODEC_ID_ADPCM_SWF)
not aligned
> @@ -439,98 +474,112 @@ static int adpcm_encode_frame(AVCodecContext *avctx,
>
> dst = frame;
> samples = (short *)data;
> - st= avctx->channels == 2;
> -/* n = (BLKSIZE - 4 * avctx->channels) / (2 * 8 * avctx->channels); */
> + st = avctx->channels == 2;
> +/* n = (BLKSIZE - 4 * avctx->channels) / (2 * 8 * avctx->channels); */
>
> switch(avctx->codec->id) {
> case CODEC_ID_ADPCM_IMA_WAV:
> n = avctx->frame_size / 8;
> c->status[0].prev_sample = (signed short)samples[0]; /* XXX */
> -/* c->status[0].step_index = 0; *//* XXX: not sure how to init
> the state machine */
> +/* c->status[0].step_index = 0; */
> +/* XXX: not sure how to init the state machine */
> bytestream_put_le16(&dst, c->status[0].prev_sample);
> *dst++ = (unsigned char)c->status[0].step_index;
> *dst++ = 0; /* unknown */
> samples++;
> if (avctx->channels == 2) {
> c->status[1].prev_sample = (signed short)samples[0];
> -/* c->status[1].step_index = 0; */
> +/* c->status[1].step_index = 0; */
for these, i meant align the "/*" correctly with the current indentation
level.
the rest looks ok.
Thanks,
Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel