Bug 1266791 - manually constant-fold sqrt call for SQRT_ONE_HALF definition; r=dminor; a=gchang
authorNathan Froyd <froydnj@gmail.com>
Thu, 05 May 2016 11:25:23 -0400
changeset 318855 d54effc885ef80a247708f9794bb0091375b309c
parent 318854 efef1c387fcc672f000e26aea5876f32191f6d90
child 318856 dc2c791cbd988ca367356156b8035b56687a98b8
push id9577
push usernfroyd@mozilla.com
push dateFri, 20 May 2016 14:39:50 +0000
treeherdermozilla-aurora@d54effc885ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdminor, gchang
bugs1266791
milestone48.0a2
Bug 1266791 - manually constant-fold sqrt call for SQRT_ONE_HALF definition; r=dminor; a=gchang
dom/media/AudioChannelFormat.h
--- a/dom/media/AudioChannelFormat.h
+++ b/dom/media/AudioChannelFormat.h
@@ -60,17 +60,17 @@ GetAudioChannelsSuperset(uint32_t aChann
 
 /**
  * DownMixMatrix represents a conversion matrix efficiently by exploiting the
  * fact that each input channel contributes to at most one output channel,
  * except possibly for the C input channel in layouts that have one. Also,
  * every input channel is multiplied by the same coefficient for every output
  * channel it contributes to.
  */
-const float SQRT_ONE_HALF = sqrt(0.5);
+const float SQRT_ONE_HALF = 0.7071067811865476f;
 
 struct DownMixMatrix {
   // Every input channel c is copied to output channel mInputDestination[c]
   // after multiplying by mInputCoefficient[c].
   uint8_t mInputDestination[CUSTOM_CHANNEL_LAYOUTS];
   // If not IGNORE, then the C channel is copied to this output channel after
   // multiplying by its coefficient.
   uint8_t mCExtraDestination;