[FFmpeg-devel] [Fwd: Summer of code small task patch]

Kostya kostya.shishkov
Wed Mar 25 06:55:36 CET 2009


On Tue, Mar 24, 2009 at 10:51:41PM +0200, Dylan Yudaken wrote:
> I apologise for being ridiculous and attaching the old file
> 
> Dylan Yudaken wrote:
> >Hi,
> >
> >I have attached a new LGPL'd libavcodec/fdctref.c file as per my 
> >summer of code small task.
> 
> 

[...]
> void init_fdct(void){
>   unsigned int i, j;
>   double c0;
>   
>   c0 = sqrt(0.125);
>   for (i = 0; i < 8; ++i){
>       for (j = 0; j < 8; ++j){
>           A[i*8 + j] = c0 * cos(i*PI_BY_8*(j + 0.5) );
>       }
>       /* c0 = sqrt(0.125) only for i =0 else c0 = 0.5*/
>       c0 = 0.5;
>   }
> }

please use consistent K&R indentation everywhere (4 spaces, spaces before right brace)
i.e.
void foo()
{
    int bar;
    for (bar = 0; bar < 8; bar++) {
        baz();
    }
}

(on Linux "indent -i4 -kr fdctref.c" will format it for you) 

Otherwise it looks more like you've done some cosmetic changes instead of rewrite.
 
> /**
>  * Transform 8x8 block of data with a double precision forward DCT <br>
>  * This is a reference implementation.
>  *
>  * @param block Pointer to 8x8 block of data to transform
>  */
> void fdct(short *block){
>     unsigned int i, j,k;
>     double tmp;
>     double out[8 * 8];
>     
>     /* out = AX */
>     for(i=0; i<8; ++i){
>         for(j = 0; j < 8; ++j){

like the spaces here

[...]



More information about the ffmpeg-devel mailing list