Revision e9c10459 tests/rotozoom.c

View differences:

tests/rotozoom.c
135 135
    unsigned char *lum_tab, *cb_tab, *cr_tab;
136 136

  
137 137
    lum_tab = malloc(w * h);
138
    cb_tab  = malloc((w * h) / 4);
139
    cr_tab  = malloc((w * h) / 4);
138
    cb_tab  = malloc(w * h / 4);
139
    cr_tab  = malloc(w * h / 4);
140 140

  
141 141
    rgb24_to_yuv420p(lum_tab, cb_tab, cr_tab, rgb_tab, w, h);
142 142

  
143 143
    f = fopen(filename, "wb");
144
    fprintf(f, "P5\n%d %d\n%d\n", w, (h * 3) / 2, 255);
144
    fprintf(f, "P5\n%d %d\n%d\n", w, h * 3 / 2, 255);
145 145
    fwrite(lum_tab, 1, w * h, f);
146 146
    h2 = h / 2;
147 147
    w2 = w / 2;
......
264 264
    for (i = 0; i < 360; i++) {
265 265
        radian = 2 * i * MY_PI / 360;
266 266
        h      = 2 * FIXP + int_sin (radian);
267
        h_cos[i] = (h * int_sin(radian + MY_PI / 2)) / 2 / FIXP;
268
        h_sin[i] = (h * int_sin(radian)            ) / 2 / FIXP;
267
        h_cos[i] = h * int_sin(radian + MY_PI / 2) / 2 / FIXP;
268
        h_sin[i] = h * int_sin(radian)             / 2 / FIXP;
269 269
    }
270 270
}
271 271

  

Also available in: Unified diff