comparison ra144.c @ 7100:a17b3a67a719 libavcodec

Simplify rotate_buffer()
author vitor
date Mon, 23 Jun 2008 19:59:42 +0000
parents 206ad3177459
children 6ee204e8d9ae
comparison
equal deleted inserted replaced
7099:07172377ec9f 7100:a17b3a67a719
95 } 95 }
96 96
97 /* rotate block */ 97 /* rotate block */
98 static void rotate_block(const int16_t *source, int16_t *target, int offset) 98 static void rotate_block(const int16_t *source, int16_t *target, int offset)
99 { 99 {
100 int i=0, k=0;
101 source += BUFFERSIZE - offset; 100 source += BUFFERSIZE - offset;
102 101
103 while (i<BLOCKSIZE) { 102 if (offset > BLOCKSIZE) {
104 target[i++] = source[k++]; 103 memcpy(target, source, BLOCKSIZE*sizeof(*target));
105 104 } else {
106 if (k == offset) 105 memcpy(target, source, offset*sizeof(*target));
107 k = 0; 106 memcpy(target + offset, source, (BLOCKSIZE - offset)*sizeof(*target));
108 } 107 }
109 } 108 }
110 109
111 /* inverse root mean square */ 110 /* inverse root mean square */
112 static int irms(const int16_t *data, int factor) 111 static int irms(const int16_t *data, int factor)