[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sox-commits
Subject:    [SoX-commits] [git] f064ffb0d5 fix floating point precisions to take account of sign bit
From:       "robs" <robs () users ! sourceforge ! net>
Date:       2012-03-07 21:21:48
Message-ID: E1S5OIx-0003R0-BJ () sfs-ml-4 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "sox".

The branch, master has been updated
       via  f064ffb0d54974009c04c0001aa1ac55e02423e3 (commit)
      from  7b31db37bb4ee734cea03d8587a24b428e6d59b8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit f064ffb0d54974009c04c0001aa1ac55e02423e3
Author: Rob Sykes <robs@users.sourceforge.net>
Date:   Wed Mar 7 21:21:21 2012 +0000

    fix floating point precisions to take account of sign bit

diff --git a/src/formats.c b/src/formats.c
index 7e231ca..f6de0d2 100644
--- a/src/formats.c
+++ b/src/formats.c
@@ -186,8 +186,8 @@ unsigned sox_precision(sox_encoding_t encoding, unsigned \
bits_per_sample)  case SOX_ENCODING_LPC10:      return !bits_per_sample? 16: 0;
 
     case SOX_ENCODING_WAVPACKF:
-    case SOX_ENCODING_FLOAT:      return bits_per_sample == 32 ? 24: bits_per_sample \
                == 64 ? 53: 0;
-    case SOX_ENCODING_FLOAT_TEXT: return !bits_per_sample? 53: 0;
+    case SOX_ENCODING_FLOAT:      return bits_per_sample == 32 ? 25: bits_per_sample \
== 64 ? 54: 0; +    case SOX_ENCODING_FLOAT_TEXT: return !bits_per_sample? 54: 0;
 
     case SOX_ENCODINGS:
     case SOX_ENCODING_UNKNOWN:    break;
diff --git a/src/sox.h b/src/sox.h
index eb9510e..9fea86b 100644
--- a/src/sox.h
+++ b/src/sox.h
@@ -976,7 +976,8 @@ Converts SoX native sample to a 32-bit float.
 @param d Input sample to be converted.
 @param clips Variable to increment if input sample is too large.
 */
-#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) \
(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SO \
X_SAMPLE_MAX-128?++(clips),1:(((sox_macro_temp_sample+128)&~255)*(1./(SOX_SAMPLE_MAX+1.))))
 +#define SOX_SAMPLE_TO_FLOAT_32BIT(d,clips) \
(LSX_USE_VAR(sox_macro_temp_double),sox_macro_temp_sample=(d),sox_macro_temp_sample>SO \
X_SAMPLE_MAX-64?++(clips),1:(((sox_macro_temp_sample+64)&~127)*(1./(SOX_SAMPLE_MAX+1.))))
 +#define SOX_SAMPLE_TO_FLOAT_64BIT(d,clips) ((d)*(1./(SOX_SAMPLE_MAX+1.)))
 
 /**
 Client API:

-----------------------------------------------------------------------

Summary of changes:
 src/formats.c |    4 ++--
 src/sox.h     |    3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
sox

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
SoX-commits mailing list
SoX-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic