comparison ra144.c @ 6874:5b50e6adf804 libavcodec

Move evaluation of variable a to where it is trivial
author vitor
date Sun, 25 May 2008 16:29:07 +0000
parents c3a92478875d
children b0028cbf2154
comparison
equal deleted inserted replaced
6873:c3a92478875d 6874:5b50e6adf804
286 } 286 }
287 return retval; 287 return retval;
288 } 288 }
289 289
290 static int dec2(signed short *decsp, const int *data, const int *inp, 290 static int dec2(signed short *decsp, const int *data, const int *inp,
291 int f, const int *inp2, int l) 291 int f, const int *inp2, int a)
292 { 292 {
293 unsigned const int *ptr1,*ptr2; 293 unsigned const int *ptr1,*ptr2;
294 int work[10]; 294 int work[10];
295 int a,b; 295 int b;
296 int x; 296 int x;
297 int result; 297 int result;
298 unsigned short *sptr = decsp; 298 unsigned short *sptr = decsp;
299
300 if(l + 1 < NBLOCKS / 2)
301 a = NBLOCKS - (l + 1);
302 else
303 a = l + 1;
304 299
305 b = NBLOCKS - a; 300 b = NBLOCKS - a;
306 301
307 ptr1 = inp; 302 ptr1 = inp;
308 ptr2 = inp2; 303 ptr2 = inp2;
349 do_voice(glob->swapbuf1, glob->swapbuf2); 344 do_voice(glob->swapbuf1, glob->swapbuf2);
350 345
351 val = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries? 346 val = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries?
352 a = t_sqrt(val*glob->oldval) >> 12; 347 a = t_sqrt(val*glob->oldval) >> 12;
353 348
354 gbuf1[0] = dec2(gbuf2[0], glob->swapbuf1alt, glob->swapbuf2alt, glob->oldval, glob->swapbuf2, 0); 349 gbuf1[0] = dec2(gbuf2[0], glob->swapbuf1alt, glob->swapbuf2alt, glob->oldval, glob->swapbuf2, 3);
355 if (glob->oldval < val) { 350 if (glob->oldval < val) {
356 gbuf1[1] = dec2(gbuf2[1], glob->swapbuf1, glob->swapbuf2, a, glob->swapbuf2alt, 1); 351 gbuf1[1] = dec2(gbuf2[1], glob->swapbuf1, glob->swapbuf2, a, glob->swapbuf2alt, 2);
357 } else { 352 } else {
358 gbuf1[1] = dec2(gbuf2[1], glob->swapbuf1alt, glob->swapbuf2alt, a, glob->swapbuf2, 1); 353 gbuf1[1] = dec2(gbuf2[1], glob->swapbuf1alt, glob->swapbuf2alt, a, glob->swapbuf2, 2);
359 } 354 }
360 gbuf1[2] = dec2(gbuf2[2], glob->swapbuf1, glob->swapbuf2, val, glob->swapbuf2alt, 2); 355 gbuf1[2] = dec2(gbuf2[2], glob->swapbuf1, glob->swapbuf2, val, glob->swapbuf2alt, 3);
361 gbuf1[3] = dec1(gbuf2[3], glob->swapbuf1, glob->swapbuf2, val); 356 gbuf1[3] = dec1(gbuf2[3], glob->swapbuf1, glob->swapbuf2, val);
362 357
363 /* do output */ 358 /* do output */
364 for (c=0; c<4; c++) { 359 for (c=0; c<4; c++) {
365 do_output_subblock(glob, gbuf2[c], gbuf1[c], data, &gb); 360 do_output_subblock(glob, gbuf2[c], gbuf1[c], data, &gb);