[FFmpeg-devel] [PATCH] K&R style format of submitted code in g729* files (cosmetics)

Vladimir Voroshilov voroshil
Fri Jun 5 20:19:02 CEST 2009


2009/6/5 Diego Biurrun <diego at biurrun.de>:
> On Fri, Jun 05, 2009 at 04:51:24PM +0700, Vladimir Voroshilov wrote:
>> 2009/6/5 Diego Biurrun <diego at biurrun.de>:
>> > On Fri, Jun 05, 2009 at 02:11:21PM +0700, Vladimir Voroshilov wrote:
>> >>
>> >> Here is reformatting patch for g729dec.c and g729data.h
>> >
>> > OK, but note that this does not make g729dec.c comply with K&R
>> > completely.
>>
>> Spaces after "if", "switch", structures, etc and braces at the same line.
>> No spaces after routine name before parenthesis.
>> Spaces around operators.
>>
>> What did i miss ? I'll try to fix it in other patches too.
>
> ?}
> ?else
> ?{
>
> -->
>
> ?} else {
>
> Your function calls still look quite idiosyncratic. ?You could change
>
> ?ff_acelp_weighted_vector_sum(
> ? ? ? ? ?fc + pitch_delay_int[i],
> ? ? ? ? ?fc + pitch_delay_int[i],
> ? ? ? ? ?fc,
> ? ? ? ? ?1 << 14,
> ? ? ? ? ?av_clip(ctx->gain_pitch, SHARP_MIN, SHARP_MAX),
> ? ? ? ? ?0,
> ? ? ? ? ?14,
> ? ? ? ? ?ctx->subframe_size - pitch_delay_int[i]);
>
> to something like
>
> ?ff_acelp_weighted_vector_sum(fc + pitch_delay_int[i],
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fc + pitch_delay_int[i],
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? fc, 1 << 14,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? av_clip(ctx->gain_pitch, SHARP_MIN, SHARP_MAX),
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0, 14,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ctx->subframe_size - pitch_delay_int[i]);
>
> or similar, depending on where you wish to break the lines.
>
> Also, you could align things like
>
> ?ctx->gain_pitch = (29491 * ctx->gain_pitch) >> 15; // 0.9 (0.15)
> ?ctx->gain_code ?= (2007 * ctx->gain_code) >> 11; ? // 0.98 in (0.11)
>
> to
>
> ?ctx->gain_pitch = (29491 * ctx->gain_pitch) >> 15; // 0.9 (0.15)
> ?ctx->gain_code ?= ( 2007 * ctx->gain_code) ?>> 11; // 0.98 in (0.11)
>
> in order to improve readability.

Updated patch


-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-K-R-formatting-of-submitted-code.118.patch
Type: text/x-diff
Size: 5793 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090606/69a02fea/attachment.patch>



More information about the ffmpeg-devel mailing list