Do not copy tables to a context var, use them directly
Originally committed as revision 13164 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
		
							parent
							
								
									bd0d10c2f1
								
							
						
					
					
						commit
						4aa485a3f6
					
				| @ -48,9 +48,6 @@ typedef struct { | |||||||
|     unsigned short int buffer_2[148]; |     unsigned short int buffer_2[148]; | ||||||
| 
 | 
 | ||||||
|     unsigned short *sptr; |     unsigned short *sptr; | ||||||
| 
 |  | ||||||
|     signed short wavtable1[2304]; |  | ||||||
|     unsigned short wavtable2[2304]; |  | ||||||
| } Real144_internal; | } Real144_internal; | ||||||
| 
 | 
 | ||||||
| static int ra144_decode_init(AVCodecContext * avctx) | static int ra144_decode_init(AVCodecContext * avctx) | ||||||
| @ -62,9 +59,6 @@ static int ra144_decode_init(AVCodecContext * avctx) | |||||||
|     glob->swapbuf1alt = glob->swapbuffers[2]; |     glob->swapbuf1alt = glob->swapbuffers[2]; | ||||||
|     glob->swapbuf2alt = glob->swapbuffers[3]; |     glob->swapbuf2alt = glob->swapbuffers[3]; | ||||||
| 
 | 
 | ||||||
|     memcpy(glob->wavtable1, wavtable1, sizeof(wavtable1)); |  | ||||||
|     memcpy(glob->wavtable2, wavtable2, sizeof(wavtable2)); |  | ||||||
| 
 |  | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| @ -183,11 +177,11 @@ static int irms(short *data, int factor) | |||||||
| static void add_wav(Real144_internal *glob, int n, int f, int m1, int m2, | static void add_wav(Real144_internal *glob, int n, int f, int m1, int m2, | ||||||
|                     int m3, short *s1, short *s2, short *s3, short *dest) |                     int m3, short *s1, short *s2, short *s3, short *dest) | ||||||
| { | { | ||||||
|     int a, b, c; |     int a, b, c, i; | ||||||
|     short *ptr, *ptr2; |     const short *ptr, *ptr2; | ||||||
| 
 | 
 | ||||||
|     ptr  = glob->wavtable1 + n * 9; |     ptr  = wavtable1 + n * 9; | ||||||
|     ptr2 = glob->wavtable2 + n * 9; |     ptr2 = wavtable2 + n * 9; | ||||||
| 
 | 
 | ||||||
|     if (f != 0) |     if (f != 0) | ||||||
|         a = ((*ptr) * m1) >> ((*ptr2) + 1); |         a = ((*ptr) * m1) >> ((*ptr2) + 1); | ||||||
| @ -200,14 +194,13 @@ static void add_wav(Real144_internal *glob, int n, int f, int m1, int m2, | |||||||
|     ptr++; |     ptr++; | ||||||
|     ptr2++; |     ptr2++; | ||||||
|     c = ((*ptr) * m3) >> ((*ptr2) + 1); |     c = ((*ptr) * m3) >> ((*ptr2) + 1); | ||||||
|     ptr2 = (ptr = dest) + BLOCKSIZE; |  | ||||||
| 
 | 
 | ||||||
|     if (f != 0) |     if (f != 0) | ||||||
|         while (ptr < ptr2) |         for (i=0; i < BLOCKSIZE; i++) | ||||||
|             *(ptr++) = ((*(s1++)) * a + (*(s2++)) * b + (*(s3++)) * c) >> 12; |             dest[i] = ((*(s1++)) * a + (*(s2++)) * b + (*(s3++)) * c) >> 12; | ||||||
|     else |     else | ||||||
|         while (ptr < ptr2) |         for (i=0; i < BLOCKSIZE; i++) | ||||||
|             *(ptr++) = ((*(s2++)) * b + (*(s3++)) * c) >> 12; |             dest[i] = ((*(s2++)) * b + (*(s3++)) * c) >> 12; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user