[Freeswitch-svn] [commit] r2486 - in freeswitch/trunk/src: include mod/codecs/mod_g726

Freeswitch SVN anthm at freeswitch.org
Sun Sep 3 09:29:14 EDT 2006


Author: anthm
Date: Sun Sep  3 09:29:13 2006
New Revision: 2486

Modified:
   freeswitch/trunk/src/include/switch_bitpack.h
   freeswitch/trunk/src/include/switch_types.h
   freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c

Log:
cleanup

Modified: freeswitch/trunk/src/include/switch_bitpack.h
==============================================================================
--- freeswitch/trunk/src/include/switch_bitpack.h	(original)
+++ freeswitch/trunk/src/include/switch_bitpack.h	Sun Sep  3 09:29:13 2006
@@ -88,23 +88,23 @@
 
 static inline void pack_check_over(switch_bitpack_t *pack)
 {
-	switch_byte_t this = pack->this;	
+	switch_byte_t this_byte = pack->this_byte;	
 
 	if (pack->over) {
 		pack->bits_cur = pack->over;
 
 		if (pack->mode == SWITCH_BITPACK_MODE_RFC3551) {
-			this &= SWITCH_BITPACKED_MASKS[pack->over];
-			this <<= pack->under;
-			*pack->cur |= this;
+			this_byte &= SWITCH_BITPACKED_MASKS[pack->over];
+			this_byte <<= pack->under;
+			*pack->cur |= this_byte;
 			pack->cur++;
 		} else {
 			switch_byte_t mask = SWITCH_BITS_PER_BYTE - pack->over;
-			this &= SWITCH_REVERSE_BITPACKED_MASKS[mask];
-			this >>= mask;
+			this_byte &= SWITCH_REVERSE_BITPACKED_MASKS[mask];
+			this_byte >>= mask;
 
 			*pack->cur <<= pack->over;
-			*pack->cur |= this;
+			*pack->cur |= this_byte;
 			pack->cur++;
 		}
 
@@ -145,14 +145,14 @@
 DoxyDefine(int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t in))
 static inline int8_t switch_bitpack_out(switch_bitpack_t *unpack, switch_byte_t in)
 {
-	switch_byte_t this;
+	switch_byte_t this_byte;
 
 	if (unpack->cur - unpack->buf > unpack->buflen) {
 		return -1;
 	}
 
 	unpack->bits_cur = 0;
-	unpack->this = this = in;
+	unpack->this_byte = this_byte = in;
 
 
 
@@ -161,7 +161,7 @@
 		switch_byte_t next = unpack->bits_cur + unpack->frame_bits;
 		switch_byte_t under_in;
 		switch_byte_t mask;
-		this = unpack->this;
+		this_byte = unpack->this_byte;
 
 		if (next > SWITCH_BITS_PER_BYTE) {
 			unpack->over = next - SWITCH_BITS_PER_BYTE;
@@ -170,12 +170,12 @@
 			if (unpack->mode == SWITCH_BITPACK_MODE_RFC3551) {
 				mask = SWITCH_BITS_PER_BYTE - unpack->under;
 
-				under_in = this & SWITCH_REVERSE_BITPACKED_MASKS[mask];
+				under_in = this_byte & SWITCH_REVERSE_BITPACKED_MASKS[mask];
 				under_in >>= mask;
 				*unpack->cur |= under_in;
 			} else {
 				mask = unpack->under;
-				under_in = this & SWITCH_BITPACKED_MASKS[mask];
+				under_in = this_byte & SWITCH_BITPACKED_MASKS[mask];
 				*unpack->cur <<= mask;
 				*unpack->cur |= under_in;
 			}
@@ -184,15 +184,15 @@
 		}
 
 		if (unpack->mode == SWITCH_BITPACK_MODE_RFC3551) {
-			this >>= unpack->bits_cur;
-			this &= SWITCH_BITPACKED_MASKS[unpack->frame_bits];
-			*unpack->cur |= this;
+			this_byte >>= unpack->bits_cur;
+			this_byte &= SWITCH_BITPACKED_MASKS[unpack->frame_bits];
+			*unpack->cur |= this_byte;
 			unpack->cur++;
 		} else {
-			this >>= (SWITCH_BITS_PER_BYTE - next);
-			this &= SWITCH_BITPACKED_MASKS[unpack->frame_bits];
+			this_byte >>= (SWITCH_BITS_PER_BYTE - next);
+			this_byte &= SWITCH_BITPACKED_MASKS[unpack->frame_bits];
 
-			*unpack->cur |= this;
+			*unpack->cur |= this_byte;
 			unpack->cur++;
 		}
 

Modified: freeswitch/trunk/src/include/switch_types.h
==============================================================================
--- freeswitch/trunk/src/include/switch_types.h	(original)
+++ freeswitch/trunk/src/include/switch_types.h	Sun Sep  3 09:29:13 2006
@@ -91,7 +91,7 @@
 	switch_byte_t bits_rem;
 	switch_byte_t frame_bits;
 	switch_byte_t shiftby;
-	switch_byte_t this;
+	switch_byte_t this_byte;
 	switch_byte_t under;
 	switch_byte_t over;
 	switch_bitpack_mode_t mode;

Modified: freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_g726/mod_g726.c	Sun Sep  3 09:29:13 2006
@@ -138,8 +138,7 @@
 		uint32_t new_len = 0;
 		int16_t *ddp = decoded_data;
 		uint8_t *edp = encoded_data;
-		int x;
-		uint32_t loops = decoded_data_len / (sizeof(*ddp));
+		uint32_t x, loops = decoded_data_len / (sizeof(*ddp));
 
 		switch_bitpack_init(&handle->pack, handle->bits_per_frame, edp, *encoded_data_len, handle->mode);
 



More information about the Freeswitch-svn mailing list