Mercurial > libavcodec.hg
changeset 6771:7613bea3ee92 libavcodec
Simplify a list of array allocations with a loop.
patch by Vitor Sessak, vitor1001 gmail com
author | diego |
---|---|
date | Sun, 11 May 2008 03:40:14 +0000 |
parents | e6338dd4a6e3 |
children | 695f4ab2db4c |
files | ra144.c |
diffstat | 1 files changed, 3 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/ra144.c Sun May 11 03:18:18 2008 +0000 +++ b/ra144.c Sun May 11 03:40:14 2008 +0000 @@ -249,7 +249,7 @@ static void final(Real144_internal *glob, short *i1, short *i2, void *out, int *statbuf, int len) { - int x, sum; + int x, sum, i; int buffer[10]; short *ptr; short *ptr2; @@ -257,16 +257,8 @@ memcpy(glob->work, statbuf,20); memcpy(glob->work + 10, i2, len * 2); - buffer[9] = i1[0]; - buffer[8] = i1[1]; - buffer[7] = i1[2]; - buffer[6] = i1[3]; - buffer[5] = i1[4]; - buffer[4] = i1[5]; - buffer[3] = i1[6]; - buffer[2] = i1[7]; - buffer[1] = i1[8]; - buffer[0] = i1[9]; + for(i=0; i<10; i++) + buffer[9-i] = i1[i]; ptr2 = (ptr = glob->work) + len;