mirror of
				https://github.com/brmlab/osmo-tetra.git
				synced 2025-10-31 15:33:59 +01:00 
			
		
		
		
	add a quilt patch series against the ETSI TETRA codec
This commit is contained in:
		
							parent
							
								
									5868bbf87f
								
							
						
					
					
						commit
						a40aa8133b
					
				
					 6 changed files with 296 additions and 0 deletions
				
			
		
							
								
								
									
										6
									
								
								etsi_codec-patches/README
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								etsi_codec-patches/README
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| This directory contains a series of patches against the TETRA codec reference | ||||
| source code as published by the ETSI at in the file named | ||||
| 	en_30039502v010301p0.zip | ||||
| 
 | ||||
| Due to the use of uppercase file names in the zip file, you should use the "-L" | ||||
| flag to the unzip program, which ensures all files are completely lower-case. | ||||
							
								
								
									
										26
									
								
								etsi_codec-patches/build_as_32bit.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								etsi_codec-patches/build_as_32bit.patch
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,26 @@ | |||
| Index: etsi/amr-code/makefile
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/amr-code/makefile	2011-05-29 11:40:11.000000000 +0200
 | ||||
| +++ etsi/amr-code/makefile	2011-05-29 11:40:17.000000000 +0200
 | ||||
| @@ -21,7 +21,7 @@
 | ||||
|   | ||||
|  CC=gcc | ||||
|   | ||||
| -CFLAGS	=	-g -I. -Wall
 | ||||
| +CFLAGS	=	-g -I. -Wall -m32
 | ||||
|   | ||||
|  SRCS1		=	ccoder.c	ccod_tet.c	init_params.c	sub_cc.c \ | ||||
|  			tetra_op.c | ||||
| Index: etsi/c-code/makefile
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/makefile	2011-05-29 11:40:02.000000000 +0200
 | ||||
| +++ etsi/c-code/makefile	2011-05-29 11:40:07.000000000 +0200
 | ||||
| @@ -23,7 +23,7 @@
 | ||||
|   | ||||
|  CC=gcc | ||||
|   | ||||
| -CFLAGS	=	-I. -Wall
 | ||||
| +CFLAGS	=	-I. -Wall -m32
 | ||||
|   | ||||
|  SRCS1		=	scoder.c		scod_tet.c		sub_sc_d.c \ | ||||
|  			sub_dsp.c		fbas_tet.c		fexp_tet.c \ | ||||
							
								
								
									
										20
									
								
								etsi_codec-patches/filename-case.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								etsi_codec-patches/filename-case.patch
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,20 @@ | |||
| Index: etsi/amr-code/init_params.c
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/amr-code/init_params.c	2011-05-29 12:11:52.000000000 +0200
 | ||||
| +++ etsi/amr-code/init_params.c	2011-05-29 12:11:21.000000000 +0200
 | ||||
| @@ -26,11 +26,11 @@
 | ||||
|  #include "const.tab" /* contains constants for channel coding/decoding */ | ||||
|  #include "arrays.h" /* contains constants for channel coding/decoding */ | ||||
|   | ||||
| -#include "const_TETRA.tab"   /* contains constants for channel coding/decoding */
 | ||||
| -#include "arrays_TETRA.tab"  /* contains arrays for channel coding/decoding */
 | ||||
| +#include "const_tetra.tab"   /* contains constants for channel coding/decoding */
 | ||||
| +#include "arrays_tetra.tab"  /* contains arrays for channel coding/decoding */
 | ||||
|   | ||||
| -#include "const_AMR475.tab"   /* contains constants for channel coding/decoding */
 | ||||
| -#include "arrays_AMR475.tab"  /* contains arrays for channel coding/decoding */
 | ||||
| +#include "const_amr475.tab"   /* contains constants for channel coding/decoding */
 | ||||
| +#include "arrays_amr475.tab"  /* contains arrays for channel coding/decoding */
 | ||||
|   | ||||
|  #define ALLOW_NEG(x) (((x) < 0) ? (((-x)%2 == 1) ?  (-x)/2 - N1_2 + 1 :  (x)/2 + 1) : (x)) | ||||
|   | ||||
							
								
								
									
										66
									
								
								etsi_codec-patches/makefile-cleanups.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								etsi_codec-patches/makefile-cleanups.patch
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,66 @@ | |||
| Index: etsi/amr-code/makefile
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/amr-code/makefile	2011-05-29 11:38:48.000000000 +0200
 | ||||
| +++ etsi/amr-code/makefile	2011-05-29 11:38:50.000000000 +0200
 | ||||
| @@ -21,7 +21,7 @@
 | ||||
|   | ||||
|  CC=gcc | ||||
|   | ||||
| -CFLAGS	=	-g -I.
 | ||||
| +CFLAGS	=	-g -I. -Wall
 | ||||
|   | ||||
|  SRCS1		=	ccoder.c	ccod_tet.c	init_params.c	sub_cc.c \ | ||||
|  			tetra_op.c | ||||
| @@ -33,10 +33,10 @@
 | ||||
|   | ||||
|  all:		ccoder	cdecoder | ||||
|   | ||||
| -ccoder:
 | ||||
| +ccoder: $(SRCS1)
 | ||||
|  	$(CC) $(SRCS1) $(CFLAGS) -o ccoder | ||||
|   | ||||
| -cdecoder:
 | ||||
| +cdecoder: $(SRCS2)
 | ||||
|  	$(CC) $(SRCS2) $(CFLAGS) -o cdecoder | ||||
|   | ||||
|  clean: | ||||
| Index: etsi/c-code/makefile
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/makefile	2011-05-29 11:38:59.000000000 +0200
 | ||||
| +++ etsi/c-code/makefile	2011-05-29 11:39:31.000000000 +0200
 | ||||
| @@ -21,9 +21,9 @@
 | ||||
|   | ||||
|  # macro definitions | ||||
|   | ||||
| -CC=acc
 | ||||
| +CC=gcc
 | ||||
|   | ||||
| -CFLAGS	=	-I.
 | ||||
| +CFLAGS	=	-I. -Wall
 | ||||
|   | ||||
|  SRCS1		=	scoder.c		scod_tet.c		sub_sc_d.c \ | ||||
|  			sub_dsp.c		fbas_tet.c		fexp_tet.c \ | ||||
| @@ -43,18 +43,18 @@
 | ||||
|   | ||||
|  all:		scoder	ccoder	sdecoder	cdecoder | ||||
|   | ||||
| -scoder:
 | ||||
| +scoder: $(SRCS1)
 | ||||
|  	$(CC) $(SRCS1) $(CFLAGS) -o scoder | ||||
|   | ||||
| -ccoder:
 | ||||
| +ccoder: $(SRCS2)
 | ||||
|  	$(CC) $(SRCS2) $(CFLAGS) -o ccoder | ||||
|   | ||||
| -sdecoder:
 | ||||
| +sdecoder: $(SRCS3)
 | ||||
|  	$(CC) $(SRCS3) $(CFLAGS) -o sdecoder | ||||
|   | ||||
| -cdecoder:
 | ||||
| +cdecoder: $(SRCS4)
 | ||||
|  	$(CC) $(SRCS4) $(CFLAGS) -o cdecoder | ||||
|   | ||||
|  clean: | ||||
| -	rm -f core *.o
 | ||||
| +	rm -f core *.o cdecoder sdecoder ccoder scoder
 | ||||
|   | ||||
							
								
								
									
										174
									
								
								etsi_codec-patches/round_private.patch
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								etsi_codec-patches/round_private.patch
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,174 @@ | |||
| Index: etsi/amr-code/channel.h
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/amr-code/channel.h	2011-05-29 11:42:12.000000000 +0200
 | ||||
| +++ etsi/amr-code/channel.h	2011-05-29 11:42:23.000000000 +0200
 | ||||
| @@ -139,7 +139,7 @@
 | ||||
|  Word16 negate(Word16 var1);               /* Short negate,        1 */ | ||||
|  Word16 norm_l(Word32 L_var1);             /* Long norm,          30 */ | ||||
|  Word16 norm_s(Word16 var1);               /* Short norm,         15 */ | ||||
| -Word16 round(Word32 L_var1);              /* Round,               1 */
 | ||||
| +Word16 etsi_round(Word32 L_var1);              /* Round,               1 */
 | ||||
|  Word16 shl(Word16 var1, Word16 var2);     /* Short shift left,    1 */ | ||||
|  Word16 shr(Word16 var1, Word16 var2);     /* Short shift right,   1 */ | ||||
|  Word16 sub(Word16 var1, Word16 var2);     /* Short sub,           1 */ | ||||
| Index: etsi/amr-code/source.h
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/amr-code/source.h	2011-05-29 11:41:07.000000000 +0200
 | ||||
| +++ etsi/amr-code/source.h	2011-05-29 11:41:20.000000000 +0200
 | ||||
| @@ -164,7 +164,7 @@
 | ||||
|  Word16 negate(Word16 var1);               /* Short negate,        1 */ | ||||
|  Word16 norm_l(Word32 L_var1);             /* Long norm,          30 */ | ||||
|  Word16 norm_s(Word16 var1);               /* Short norm,         15 */ | ||||
| -Word16 round(Word32 L_var1);              /* Round,               1 */
 | ||||
| +Word16 etsi_round(Word32 L_var1);              /* Round,               1 */
 | ||||
|  Word16 shl(Word16 var1, Word16 var2);     /* Short shift left,    1 */ | ||||
|  Word16 shr(Word16 var1, Word16 var2);     /* Short shift right,   1 */ | ||||
|  Word16 sub(Word16 var1, Word16 var2);     /* Short sub,           1 */ | ||||
| Index: etsi/amr-code/tetra_op.c
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/amr-code/tetra_op.c	2011-05-29 11:41:07.000000000 +0200
 | ||||
| +++ etsi/amr-code/tetra_op.c	2011-05-29 11:41:54.000000000 +0200
 | ||||
| @@ -31,7 +31,7 @@
 | ||||
|  *					- negate() | ||||
|  *					- norm_l() | ||||
|  *					- norm_s() | ||||
| -*					- round()
 | ||||
| +*					- etsi_round()
 | ||||
|  *					- sature() | ||||
|  *					- shl() | ||||
|  *					- shr() | ||||
| @@ -1336,14 +1336,14 @@
 | ||||
|   | ||||
|  /************************************************************************ | ||||
|  * | ||||
| -*	Function Name : round
 | ||||
| +*	Function Name : etsi_round
 | ||||
|  * | ||||
|  *	Purpose : | ||||
|  * | ||||
|  *		Round the lower 16 bits of the 32 bit input number into its MS 16 bits | ||||
|  *		with saturation. Shift the resulting bits right by 16 and return the 16 | ||||
|  *		bit number: | ||||
| -*			round(L_var1) = extract_h(L_add(L_var1,32768))
 | ||||
| +*			etsi_round(L_var1) = extract_h(L_add(L_var1,32768))
 | ||||
|  * | ||||
|  *	Complexity Weight : 1 | ||||
|  * | ||||
| @@ -1365,7 +1365,7 @@
 | ||||
|  * | ||||
|  ************************************************************************/ | ||||
|   | ||||
| -Word16 round(Word32 L_var1)
 | ||||
| +Word16 etsi_round(Word32 L_var1)
 | ||||
|    { | ||||
|     Word16 var_out; | ||||
|     Word32 L_arrondi; | ||||
| Index: etsi/c-code/channel.h
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/channel.h	2011-05-29 11:46:28.000000000 +0200
 | ||||
| +++ etsi/c-code/channel.h	2011-05-29 11:46:57.000000000 +0200
 | ||||
| @@ -130,7 +130,7 @@
 | ||||
|  Word16 negate(Word16 var1);               /* Short negate,        1 */ | ||||
|  Word16 norm_l(Word32 L_var1);             /* Long norm,          30 */ | ||||
|  Word16 norm_s(Word16 var1);               /* Short norm,         15 */ | ||||
| -Word16 round(Word32 L_var1);              /* Round,               1 */
 | ||||
| +Word16 etsi_round(Word32 L_var1);              /* Round,               1 */
 | ||||
|  Word16 shl(Word16 var1, Word16 var2);     /* Short shift left,    1 */ | ||||
|  Word16 shr(Word16 var1, Word16 var2);     /* Short shift right,   1 */ | ||||
|  Word16 sub(Word16 var1, Word16 var2);     /* Short sub,           1 */ | ||||
| Index: etsi/c-code/source.h
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/source.h	2011-05-29 11:46:28.000000000 +0200
 | ||||
| +++ etsi/c-code/source.h	2011-05-29 11:47:06.000000000 +0200
 | ||||
| @@ -164,7 +164,7 @@
 | ||||
|  Word16 negate(Word16 var1);               /* Short negate,        1 */ | ||||
|  Word16 norm_l(Word32 L_var1);             /* Long norm,          30 */ | ||||
|  Word16 norm_s(Word16 var1);               /* Short norm,         15 */ | ||||
| -Word16 round(Word32 L_var1);              /* Round,               1 */
 | ||||
| +Word16 etsi_round(Word32 L_var1);              /* Round,               1 */
 | ||||
|  Word16 shl(Word16 var1, Word16 var2);     /* Short shift left,    1 */ | ||||
|  Word16 shr(Word16 var1, Word16 var2);     /* Short shift right,   1 */ | ||||
|  Word16 sub(Word16 var1, Word16 var2);     /* Short sub,           1 */ | ||||
| Index: etsi/c-code/sub_dsp.c
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/sub_dsp.c	2011-05-29 11:46:28.000000000 +0200
 | ||||
| +++ etsi/c-code/sub_dsp.c	2011-05-29 11:47:19.000000000 +0200
 | ||||
| @@ -554,7 +554,7 @@
 | ||||
|   | ||||
|    fac[0] = gamma; | ||||
|    for(i=1; i<pp; i++) | ||||
| -    fac[i] = round( L_mult(fac[i-1], gamma) );
 | ||||
| +    fac[i] = etsi_round( L_mult(fac[i-1], gamma) );
 | ||||
|   | ||||
|    return; | ||||
|  } | ||||
| @@ -1088,7 +1088,7 @@
 | ||||
|   | ||||
|    a_exp[0] = a[0]; | ||||
|    for(i=1; i<=pp; i++) | ||||
| -    a_exp[i] = round( L_mult(a[i], fac[i-1]) );
 | ||||
| +    a_exp[i] = etsi_round( L_mult(a[i], fac[i-1]) );
 | ||||
|   | ||||
|    return; | ||||
|  } | ||||
| Index: etsi/c-code/sub_sc_d.c
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/sub_sc_d.c	2011-05-29 11:46:28.000000000 +0200
 | ||||
| +++ etsi/c-code/sub_sc_d.c	2011-05-29 11:47:36.000000000 +0200
 | ||||
| @@ -1829,7 +1829,7 @@
 | ||||
|      s = L_mac0(s, x[i-15], coef[i]); | ||||
|   | ||||
|    s = L_add(s, s); | ||||
| -  i = round(s);
 | ||||
| +  i = etsi_round(s);
 | ||||
|    return(i); | ||||
|  } | ||||
|   | ||||
| @@ -1877,7 +1877,7 @@
 | ||||
|      s = L_mac0(s, x[i-16], coef[i]); | ||||
|   | ||||
|    s = L_add(s, s); | ||||
| -  i = round(s);
 | ||||
| +  i = etsi_round(s);
 | ||||
|    return(i); | ||||
|  } | ||||
|   | ||||
| Index: etsi/c-code/tetra_op.c
 | ||||
| ===================================================================
 | ||||
| --- etsi.orig/c-code/tetra_op.c	2011-05-29 11:46:28.000000000 +0200
 | ||||
| +++ etsi/c-code/tetra_op.c	2011-05-29 11:46:48.000000000 +0200
 | ||||
| @@ -31,7 +31,7 @@
 | ||||
|  *					- negate() | ||||
|  *					- norm_l() | ||||
|  *					- norm_s() | ||||
| -*					- round()
 | ||||
| +*					- etsi_round()
 | ||||
|  *					- sature() | ||||
|  *					- shl() | ||||
|  *					- shr() | ||||
| @@ -1335,14 +1335,14 @@
 | ||||
|   | ||||
|  /************************************************************************ | ||||
|  * | ||||
| -*	Function Name : round
 | ||||
| +*	Function Name : etsi_round
 | ||||
|  * | ||||
|  *	Purpose : | ||||
|  * | ||||
|  *		Round the lower 16 bits of the 32 bit input number into its MS 16 bits | ||||
|  *		with saturation. Shift the resulting bits right by 16 and return the 16 | ||||
|  *		bit number: | ||||
| -*			round(L_var1) = extract_h(L_add(L_var1,32768))
 | ||||
| +*			etsi_round(L_var1) = extract_h(L_add(L_var1,32768))
 | ||||
|  * | ||||
|  *	Complexity Weight : 1 | ||||
|  * | ||||
| @@ -1364,7 +1364,7 @@
 | ||||
|  * | ||||
|  ************************************************************************/ | ||||
|   | ||||
| -Word16 round(Word32 L_var1)
 | ||||
| +Word16 etsi_round(Word32 L_var1)
 | ||||
|    { | ||||
|     Word16 var_out; | ||||
|     Word32 L_arrondi; | ||||
							
								
								
									
										4
									
								
								etsi_codec-patches/series
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								etsi_codec-patches/series
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| makefile-cleanups.patch | ||||
| build_as_32bit.patch | ||||
| round_private.patch | ||||
| filename-case.patch | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Harald Welte
						Harald Welte