[Scummvm-cvs-logs] scummvm master -> 3d576c184a54d9fb1114e0c46ba96c2a86b88b43

dhewg dhewg at wiibrew.org
Fri Mar 11 20:57:50 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a2a5083dc9 AUDIO: Work around ARM code volume limits
3d576c184a AUDIO: Fix some whitespaces


Commit: a2a5083dc9bf51d92f7c001d60fc554b901eade0
    https://github.com/scummvm/scummvm/commit/a2a5083dc9bf51d92f7c001d60fc554b901eade0
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-03-11T11:54:52-08:00

Commit Message:
AUDIO: Work around ARM code volume limits

The ARM specific rate converters work with 8bit volume vars. Limit
volumes to 0xff to prevent crackling.

Changed paths:
    audio/rate_arm.cpp



diff --git a/audio/rate_arm.cpp b/audio/rate_arm.cpp
index 41944ef..d43a531 100644
--- a/audio/rate_arm.cpp
+++ b/audio/rate_arm.cpp
@@ -320,6 +320,12 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioStream &input, st_samp
 #endif
 	st_sample_t *ostart = obuf;
 
+	if (vol_l > 0xff)
+		vol_l = 0xff;
+
+	if (vol_r > 0xff)
+		vol_r = 0xff;
+
 	if (!stereo) {
 		obuf = ARM_LinearRate_M(input,
 		                        &SimpleRate_readFudge,


Commit: 3d576c184a54d9fb1114e0c46ba96c2a86b88b43
    https://github.com/scummvm/scummvm/commit/3d576c184a54d9fb1114e0c46ba96c2a86b88b43
Author: dhewg (dhewg at wiibrew.org)
Date: 2011-03-11T11:54:57-08:00

Commit Message:
AUDIO: Fix some whitespaces

Changed paths:
    audio/rate_arm.cpp



diff --git a/audio/rate_arm.cpp b/audio/rate_arm.cpp
index d43a531..43172f6 100644
--- a/audio/rate_arm.cpp
+++ b/audio/rate_arm.cpp
@@ -60,7 +60,7 @@ namespace Audio {
  * ARM routine we call doesn't respect those definitions.
  */
 #define FRAC_BITS 16
-#define FRAC_ONE  (1<<FRAC_BITS)
+#define FRAC_ONE  (1 << FRAC_BITS)
 
 /**
  * The size of the intermediate input cache. Bigger values may increase
@@ -138,34 +138,33 @@ extern "C" {
 }
 
 extern "C" st_sample_t *ARM_SimpleRate_M(
-                                 AudioStream       &input,
-                                 int (*fn)(Audio::AudioStream&,int16*,int),
-                                 SimpleRateDetails *sr,
-                                 st_sample_t       *obuf,
-                                 st_size_t          osamp,
-                                 st_volume_t        vol_l,
-                                 st_volume_t        vol_r);
+								AudioStream &input,
+								int (*fn)(Audio::AudioStream&,int16*,int),
+								SimpleRateDetails *sr,
+								st_sample_t *obuf,
+								st_size_t osamp,
+								st_volume_t vol_l,
+								st_volume_t vol_r);
 
 extern "C" st_sample_t *ARM_SimpleRate_S(
-                                 AudioStream       &input,
-                                 int (*fn)(Audio::AudioStream&,int16*,int),
-                                 SimpleRateDetails *sr,
-                                 st_sample_t       *obuf,
-                                 st_size_t          osamp,
-                                 st_volume_t        vol_l,
-                                 st_volume_t        vol_r);
+								AudioStream &input,
+								int (*fn)(Audio::AudioStream&,int16*,int),
+								SimpleRateDetails *sr,
+								st_sample_t *obuf,
+								st_size_t osamp,
+								st_volume_t vol_l,
+								st_volume_t vol_r);
 
 extern "C" st_sample_t *ARM_SimpleRate_R(
-                                 AudioStream       &input,
-                                 int (*fn)(Audio::AudioStream&,int16*,int),
-                                 SimpleRateDetails *sr,
-                                 st_sample_t       *obuf,
-                                 st_size_t          osamp,
-                                 st_volume_t        vol_l,
-                                 st_volume_t        vol_r);
-
-extern "C" int SimpleRate_readFudge(Audio::AudioStream &input,
-                                    int16 *a, int b)
+								AudioStream &input,
+								int (*fn)(Audio::AudioStream&,int16*,int),
+								SimpleRateDetails *sr,
+								st_sample_t *obuf,
+								st_size_t osamp,
+								st_volume_t vol_l,
+								st_volume_t vol_r);
+
+extern "C" int SimpleRate_readFudge(Audio::AudioStream &input, int16 *a, int b)
 {
 #ifdef DEBUG_RATECONV
 	debug("Reading ptr=%x n%d", a, b);
@@ -183,21 +182,22 @@ int SimpleRateConverter<stereo, reverseStereo>::flow(AudioStream &input, st_samp
 
 	if (!stereo) {
 		obuf = ARM_SimpleRate_M(input,
-		                        &SimpleRate_readFudge,
-		                        &sr,
-			                obuf, osamp, vol_l, vol_r);
+								&SimpleRate_readFudge,
+								&sr,
+								obuf, osamp, vol_l, vol_r);
 	} else if (reverseStereo) {
 		obuf = ARM_SimpleRate_R(input,
-		                        &SimpleRate_readFudge,
-		                        &sr,
-				        obuf, osamp, vol_l, vol_r);
+								&SimpleRate_readFudge,
+								&sr,
+								obuf, osamp, vol_l, vol_r);
 	} else {
 		obuf = ARM_SimpleRate_S(input,
-		                        &SimpleRate_readFudge,
-		                        &sr,
-				        obuf, osamp, vol_l, vol_r);
+								&SimpleRate_readFudge,
+								&sr,
+								obuf, osamp, vol_l, vol_r);
 	}
-	return (obuf-ostart)/2;
+
+	return (obuf - ostart) / 2;
 }
 
 /**
@@ -240,31 +240,31 @@ extern "C" {
 }
 
 extern "C" st_sample_t *ARM_LinearRate_M(
-                                 AudioStream       &input,
-                                 int (*fn)(Audio::AudioStream&,int16*,int),
-                                 LinearRateDetails *lr,
-                                 st_sample_t       *obuf,
-                                 st_size_t          osamp,
-                                 st_volume_t        vol_l,
-                                 st_volume_t        vol_r);
+								AudioStream &input,
+								int (*fn)(Audio::AudioStream&,int16*,int),
+								LinearRateDetails *lr,
+								st_sample_t *obuf,
+								st_size_t osamp,
+								st_volume_t vol_l,
+								st_volume_t vol_r);
 
 extern "C" st_sample_t *ARM_LinearRate_S(
-                                 AudioStream       &input,
-                                 int (*fn)(Audio::AudioStream&,int16*,int),
-                                 LinearRateDetails *lr,
-                                 st_sample_t       *obuf,
-                                 st_size_t          osamp,
-                                 st_volume_t        vol_l,
-                                 st_volume_t        vol_r);
+								AudioStream &input,
+								int (*fn)(Audio::AudioStream&,int16*,int),
+								LinearRateDetails *lr,
+								st_sample_t *obuf,
+								st_size_t osamp,
+								st_volume_t vol_l,
+								st_volume_t vol_r);
 
 extern "C" st_sample_t *ARM_LinearRate_R(
-                                 AudioStream       &input,
-                                 int (*fn)(Audio::AudioStream&,int16*,int),
-                                 LinearRateDetails *lr,
-                                 st_sample_t       *obuf,
-                                 st_size_t          osamp,
-                                 st_volume_t        vol_l,
-                                 st_volume_t        vol_r);
+								AudioStream &input,
+								int (*fn)(Audio::AudioStream&,int16*,int),
+								LinearRateDetails *lr,
+								st_sample_t *obuf,
+								st_size_t osamp,
+								st_volume_t vol_l,
+								st_volume_t vol_r);
 
 template<bool stereo, bool reverseStereo>
 class LinearRateConverter : public RateConverter {
@@ -328,21 +328,21 @@ int LinearRateConverter<stereo, reverseStereo>::flow(AudioStream &input, st_samp
 
 	if (!stereo) {
 		obuf = ARM_LinearRate_M(input,
-		                        &SimpleRate_readFudge,
-		                        &lr,
-				        obuf, osamp, vol_l, vol_r);
+								&SimpleRate_readFudge,
+								&lr,
+								obuf, osamp, vol_l, vol_r);
 	} else if (reverseStereo) {
 		obuf = ARM_LinearRate_R(input,
-		                        &SimpleRate_readFudge,
-		                        &lr,
-				        obuf, osamp, vol_l, vol_r);
+								&SimpleRate_readFudge,
+								&lr,
+								obuf, osamp, vol_l, vol_r);
 	} else {
 		obuf = ARM_LinearRate_S(input,
-		                        &SimpleRate_readFudge,
-		                        &lr,
-				        obuf, osamp, vol_l, vol_r);
+								&SimpleRate_readFudge,
+								&lr,
+								obuf, osamp, vol_l, vol_r);
 	}
-	return (obuf-ostart)/2;
+	return (obuf - ostart) / 2;
 }
 
 
@@ -361,31 +361,32 @@ extern "C" {
 }
 
 extern "C" st_sample_t *ARM_CopyRate_M(
-                               st_size_t    len,
-                               st_sample_t *obuf,
-                               st_volume_t  vol_l,
-                               st_volume_t  vol_r,
-                               st_sample_t *_buffer);
+								st_size_t len,
+								st_sample_t *obuf,
+								st_volume_t vol_l,
+								st_volume_t vol_r,
+								st_sample_t *_buffer);
 
 extern "C" st_sample_t *ARM_CopyRate_S(
-                               st_size_t    len,
-                               st_sample_t *obuf,
-                               st_volume_t  vol_l,
-                               st_volume_t  vol_r,
-                               st_sample_t *_buffer);
+								st_size_t len,
+								st_sample_t *obuf,
+								st_volume_t vol_l,
+								st_volume_t vol_r,
+								st_sample_t *_buffer);
 
 extern "C" st_sample_t *ARM_CopyRate_R(
-                               st_size_t    len,
-                               st_sample_t *obuf,
-                               st_volume_t  vol_l,
-                               st_volume_t  vol_r,
-                               st_sample_t *_buffer);
+								st_size_t len,
+								st_sample_t *obuf,
+								st_volume_t vol_l,
+								st_volume_t vol_r,
+								st_sample_t *_buffer);
 
 
 template<bool stereo, bool reverseStereo>
 class CopyRateConverter : public RateConverter {
 	st_sample_t *_buffer;
 	st_size_t _bufferSize;
+
 public:
 	CopyRateConverter() : _buffer(0), _bufferSize(0) {}
 	~CopyRateConverter() {
@@ -399,7 +400,7 @@ public:
 		debug("Copy st=%d rev=%d", stereo, reverseStereo);
 #endif
 		st_size_t len;
-                st_sample_t *ostart = obuf;
+		st_sample_t *ostart = obuf;
 
 		if (stereo)
 			osamp *= 2;
@@ -424,8 +425,9 @@ public:
 		else
 			obuf = ARM_CopyRate_M(len, obuf, vol_l, vol_r, _buffer);
 
-		return (obuf-ostart)/2;
+		return (obuf - ostart) / 2;
 	}
+
 	virtual int drain(st_sample_t *obuf, st_size_t osamp, st_volume_t vol) {
 		return (ST_SUCCESS);
 	}
@@ -469,3 +471,4 @@ RateConverter *makeRateConverter(st_rate_t inrate, st_rate_t outrate, bool stere
 }
 
 } // End of namespace Audio
+






More information about the Scummvm-git-logs mailing list