Fix common misspellings

I stumbled upon the typo in README.draft, so took the opportunity to
grep for common misspellings using List_of_common_misspellings.txt for
hunspell.
diff --git a/README.draft b/README.draft
index 061af23..2215966 100644
--- a/README.draft
+++ b/README.draft
@@ -51,4 +51,4 @@
 -loss <perc>         : simulate packet loss, in percent (0-100); default: 0
 
 input and output are little endian signed 16-bit PCM files or opus bitstreams
-with simple opus_demo propritary framing.
+with simple opus_demo proprietary framing.
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 328a06e..7f5f7dc 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -835,7 +835,7 @@
 # standard header. Note that when using a custom header you are responsible
 # for the proper inclusion of any scripts and style sheets that doxygen
 # needs, which is dependent on the configuration options used.
-# It is adviced to generate a default header using "doxygen -w html
+# It is advised to generate a default header using "doxygen -w html
 # header.html footer.html stylesheet.css YourConfigFile" and then modify
 # that header. Note that the header is subject to change so you typically
 # have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW!
diff --git a/doc/draft-ietf-codec-opus.xml b/doc/draft-ietf-codec-opus.xml
index 79bbf0f..334cad9 100644
--- a/doc/draft-ietf-codec-opus.xml
+++ b/doc/draft-ietf-codec-opus.xml
@@ -7528,7 +7528,7 @@
 additive white noise with a 48 dB SNR (similar to what can be obtained on a cassette deck).
 It is still possible for an implementation to sound very good with such a low quality measure
 (e.g. if the deviation is due to inaudible phase distortion), but unless this is verified by
-listening tests, it is RECOMMENDED that implementations achive a quality above 90 for 48&nbsp;kHz
+listening tests, it is RECOMMENDED that implementations achieve a quality above 90 for 48&nbsp;kHz
 decoding. For other sampling rates, it is normal for the quality metric to be lower
 (typically as low as 50 even for a good implementation) because of harmless mismatch with
 the delay and phase of the internal sampling rate conversion.
diff --git a/doc/draft-spittka-payload-rtp-opus.xml b/doc/draft-spittka-payload-rtp-opus.xml
index 09450d0..05dd3de 100644
--- a/doc/draft-spittka-payload-rtp-opus.xml
+++ b/doc/draft-spittka-payload-rtp-opus.xml
@@ -761,7 +761,7 @@
               "maxcodedaudiobandwidth" as this would lead to inefficient use of network resources. The "maxcodedaudiobandwidth" parameter does not
 	      affect interoperability. Also, this parameter SHOULD NOT be used
 	      to adjust the audio bandwidth as a function of the bitrates, as this
-	      is the responsability of the Opus encoder implementation.
+	      is the responsibility of the Opus encoder implementation.
             </t>
 
             <t>The parameter "maxaveragebitrate" is a unidirectional receive-only
diff --git a/include/opus.h b/include/opus.h
index 2add784..cdd9677 100644
--- a/include/opus.h
+++ b/include/opus.h
@@ -371,7 +371,7 @@
   * @li max_size is the max duration of the frame in samples (per channel) that can fit into the decoded_frame array
   *
   * opus_decode() and opus_decode_float() return the number of samples (per channel) decoded from the packet.
-  * If that value is negative, then an error has occured. This can occur if the packet is corrupted or if the audio
+  * If that value is negative, then an error has occurred. This can occur if the packet is corrupted or if the audio
   * buffer is too small to hold the decoded audio.
   *
   * Opus is a stateful codec with overlapping blocks and as a result Opus
diff --git a/include/opus_multistream.h b/include/opus_multistream.h
index 9ae1711..2bf1dff 100644
--- a/include/opus_multistream.h
+++ b/include/opus_multistream.h
@@ -108,7 +108,7 @@
   * elementary Opus stream, the encoder and decoder must negotiate the channel
   * configuration before the decoder can successfully interpret the data in the
   * packets produced by the encoder. Some basic information, such as packet
-  * duration, can be computed without any special negotation.
+  * duration, can be computed without any special negotiation.
   *
   * The format for multistream Opus packets is defined in the
   * <a href="http://tools.ietf.org/html/draft-terriberry-oggopus">Ogg
diff --git a/opus.m4 b/opus.m4
index 20f166b..47f5ec4 100644
--- a/opus.m4
+++ b/opus.m4
@@ -102,7 +102,7 @@
        echo "*** If you have an old version installed, it is best to remove it, although"
        echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
        [ echo "*** The test program failed to compile or link. See the file config.log for the"
-       echo "*** exact error that occured. This usually means Opus was incorrectly installed"
+       echo "*** exact error that occurred. This usually means Opus was incorrectly installed"
        echo "*** or that you have moved Opus since it was installed." ])
        CFLAGS="$ac_save_CFLAGS"
        LIBS="$ac_save_LIBS"
diff --git a/silk/NLSF_stabilize.c b/silk/NLSF_stabilize.c
index fc642af..7498b54 100644
--- a/silk/NLSF_stabilize.c
+++ b/silk/NLSF_stabilize.c
@@ -31,7 +31,7 @@
 
 /* NLSF stabilizer:                                         */
 /*                                                          */
-/* - Moves NLSFs futher apart if they are too close         */
+/* - Moves NLSFs further apart if they are too close        */
 /* - Moves NLSFs away from borders if they are too close    */
 /* - High effort to achieve a modification with minimum     */
 /*     Euclidean distance to input vector                   */
diff --git a/silk/PLC.c b/silk/PLC.c
index 906ad33..8d54729 100644
--- a/silk/PLC.c
+++ b/silk/PLC.c
@@ -363,7 +363,7 @@
     RESTORE_STACK;
 }
 
-/* Glues concealed frames with new good recieved frames */
+/* Glues concealed frames with new good received frames */
 void silk_PLC_glue_frames(
     silk_decoder_state                  *psDec,             /* I/O decoder state        */
     opus_int16                          frame[],            /* I/O signal               */
diff --git a/silk/SigProc_FIX.h b/silk/SigProc_FIX.h
index 72ec26a..daa5fd0 100644
--- a/silk/SigProc_FIX.h
+++ b/silk/SigProc_FIX.h
@@ -313,7 +313,7 @@
     opus_int32                  A_Q16[],            /* O    Prediction coefficients (length order)                      */
     const opus_int16            x[],                /* I    Input signal, length: nb_subfr * ( D + subfr_length )       */
     const opus_int32            minInvGain_Q30,     /* I    Inverse of max prediction gain                              */
-    const opus_int              subfr_length,       /* I    Input signal subframe length (incl. D preceeding samples)   */
+    const opus_int              subfr_length,       /* I    Input signal subframe length (incl. D preceding samples)    */
     const opus_int              nb_subfr,           /* I    Number of subframes stacked in x                            */
     const opus_int              D                   /* I    Order                                                       */
 );
@@ -379,7 +379,7 @@
     }
 }
 
-/* Allocate opus_int16 alligned to 4-byte memory address */
+/* Allocate opus_int16 aligned to 4-byte memory address */
 #if EMBEDDED_ARM
 #define silk_DWORD_ALIGN __attribute__((aligned(4)))
 #else
diff --git a/silk/fixed/LTP_analysis_filter_FIX.c b/silk/fixed/LTP_analysis_filter_FIX.c
index 155eea8..a8fee55 100644
--- a/silk/fixed/LTP_analysis_filter_FIX.c
+++ b/silk/fixed/LTP_analysis_filter_FIX.c
@@ -33,13 +33,13 @@
 
 void silk_LTP_analysis_filter_FIX(
     opus_int16                      *LTP_res,                               /* O    LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )  */
-    const opus_int16                *x,                                     /* I    Pointer to input signal with at least max( pitchL ) preceeding samples      */
+    const opus_int16                *x,                                     /* I    Pointer to input signal with at least max( pitchL ) preceding samples       */
     const opus_int16                LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I    LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe                   */
     const opus_int                  pitchL[ MAX_NB_SUBFR ],                 /* I    Pitch lag, one for each subframe                                            */
     const opus_int32                invGains_Q16[ MAX_NB_SUBFR ],           /* I    Inverse quantization gains, one for each subframe                           */
     const opus_int                  subfr_length,                           /* I    Length of each subframe                                                     */
     const opus_int                  nb_subfr,                               /* I    Number of subframes                                                         */
-    const opus_int                  pre_length                              /* I    Length of the preceeding samples starting at &x[0] for each subframe        */
+    const opus_int                  pre_length                              /* I    Length of the preceding samples starting at &x[0] for each subframe         */
 )
 {
     const opus_int16 *x_ptr, *x_lag_ptr;
diff --git a/silk/fixed/burg_modified_FIX.c b/silk/fixed/burg_modified_FIX.c
index ecbba03..26a66b1 100644
--- a/silk/fixed/burg_modified_FIX.c
+++ b/silk/fixed/burg_modified_FIX.c
@@ -47,7 +47,7 @@
     opus_int32                  A_Q16[],            /* O    Prediction coefficients (length order)                      */
     const opus_int16            x[],                /* I    Input signal, length: nb_subfr * ( D + subfr_length )       */
     const opus_int32            minInvGain_Q30,     /* I    Inverse of max prediction gain                              */
-    const opus_int              subfr_length,       /* I    Input signal subframe length (incl. D preceeding samples)   */
+    const opus_int              subfr_length,       /* I    Input signal subframe length (incl. D preceding samples)    */
     const opus_int              nb_subfr,           /* I    Number of subframes stacked in x                            */
     const opus_int              D                   /* I    Order                                                       */
 )
@@ -238,7 +238,7 @@
             /* Scale coefficients */
             A_Q16[ k ] = -silk_RSHIFT_ROUND( Af_QA[ k ], QA - 16 );
         }
-        /* Subtract energy of preceeding samples from C0 */
+        /* Subtract energy of preceding samples from C0 */
         if( rshifts > 0 ) {
             for( s = 0; s < nb_subfr; s++ ) {
                 x_ptr = x + s * subfr_length;
diff --git a/silk/fixed/find_pitch_lags_FIX.c b/silk/fixed/find_pitch_lags_FIX.c
index a323411..9b83c70 100644
--- a/silk/fixed/find_pitch_lags_FIX.c
+++ b/silk/fixed/find_pitch_lags_FIX.c
@@ -54,7 +54,7 @@
     /******************************************/
     buf_len = psEnc->sCmn.la_pitch + psEnc->sCmn.frame_length + psEnc->sCmn.ltp_mem_length;
 
-    /* Safty check */
+    /* Safety check */
     silk_assert( buf_len >= psEnc->sCmn.pitch_LPC_win_length );
 
     x_buf = x - psEnc->sCmn.ltp_mem_length;
diff --git a/silk/fixed/main_FIX.h b/silk/fixed/main_FIX.h
index 1e60f88..369b31e 100644
--- a/silk/fixed/main_FIX.h
+++ b/silk/fixed/main_FIX.h
@@ -168,17 +168,17 @@
 
 void silk_LTP_analysis_filter_FIX(
     opus_int16                      *LTP_res,                               /* O    LTP residual signal of length MAX_NB_SUBFR * ( pre_length + subfr_length )  */
-    const opus_int16                *x,                                     /* I    Pointer to input signal with at least max( pitchL ) preceeding samples      */
+    const opus_int16                *x,                                     /* I    Pointer to input signal with at least max( pitchL ) preceding samples       */
     const opus_int16                LTPCoef_Q14[ LTP_ORDER * MAX_NB_SUBFR ],/* I    LTP_ORDER LTP coefficients for each MAX_NB_SUBFR subframe                   */
     const opus_int                  pitchL[ MAX_NB_SUBFR ],                 /* I    Pitch lag, one for each subframe                                            */
     const opus_int32                invGains_Q16[ MAX_NB_SUBFR ],           /* I    Inverse quantization gains, one for each subframe                           */
     const opus_int                  subfr_length,                           /* I    Length of each subframe                                                     */
     const opus_int                  nb_subfr,                               /* I    Number of subframes                                                         */
-    const opus_int                  pre_length                              /* I    Length of the preceeding samples starting at &x[0] for each subframe        */
+    const opus_int                  pre_length                              /* I    Length of the preceding samples starting at &x[0] for each subframe         */
 );
 
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */
-/* of preceeding samples                                                                */
+/* of preceding samples                                                                 */
 void silk_residual_energy_FIX(
           opus_int32                nrgs[ MAX_NB_SUBFR ],                   /* O    Residual energy per subframe                                                */
           opus_int                  nrgsQ[ MAX_NB_SUBFR ],                  /* O    Q value per subframe                                                        */
diff --git a/silk/fixed/noise_shape_analysis_FIX.c b/silk/fixed/noise_shape_analysis_FIX.c
index b0e35de..d230e48 100644
--- a/silk/fixed/noise_shape_analysis_FIX.c
+++ b/silk/fixed/noise_shape_analysis_FIX.c
@@ -199,7 +199,7 @@
     /*************************/
     /* Set quantizer offset */
     if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {
-        /* Initally set to 0; may be overruled in process_gains(..) */
+        /* Initially set to 0; may be overruled in process_gains(..) */
         psEnc->sCmn.indices.quantOffsetType = 0;
         psEncCtrl->sparseness_Q8 = 0;
     } else {
diff --git a/silk/fixed/pitch_analysis_core_FIX.c b/silk/fixed/pitch_analysis_core_FIX.c
index bb9166e..d43f444 100644
--- a/silk/fixed/pitch_analysis_core_FIX.c
+++ b/silk/fixed/pitch_analysis_core_FIX.c
@@ -500,7 +500,7 @@
         silk_assert( lag == silk_SAT16( lag ) );
         contour_bias_Q20 = silk_DIV32_16( SILK_FIX_CONST( PE_FLATCONTOUR_BIAS, 20 ), lag );
 
-        /* Set up codebook parameters acording to complexity setting and frame length */
+        /* Set up codebook parameters according to complexity setting and frame length */
         if( nb_subfr == PE_MAX_NB_SUBFR ) {
             nb_cbk_search   = (opus_int)silk_nb_cbk_searchs_stage3[ complexity ];
             cbk_size        = PE_NB_CBKS_STAGE3_MAX;
diff --git a/silk/fixed/residual_energy_FIX.c b/silk/fixed/residual_energy_FIX.c
index 912b16b..f284e51 100644
--- a/silk/fixed/residual_energy_FIX.c
+++ b/silk/fixed/residual_energy_FIX.c
@@ -32,7 +32,7 @@
 #include "main_FIX.h"
 
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */
-/* of preceeding samples                                                                */
+/* of preceding samples                                                                 */
 void silk_residual_energy_FIX(
           opus_int32                nrgs[ MAX_NB_SUBFR ],                   /* O    Residual energy per subframe                                                */
           opus_int                  nrgsQ[ MAX_NB_SUBFR ],                  /* O    Q value per subframe                                                        */
@@ -54,7 +54,7 @@
 
     /* Filter input to create the LPC residual for each frame half, and measure subframe energies */
     for( i = 0; i < nb_subfr >> 1; i++ ) {
-        /* Calculate half frame LPC residual signal including preceeding samples */
+        /* Calculate half frame LPC residual signal including preceding samples */
         silk_LPC_analysis_filter( LPC_res, x_ptr, a_Q12[ i ], ( MAX_NB_SUBFR >> 1 ) * offset, LPC_order );
 
         /* Point to first subframe of the just calculated LPC residual signal */
diff --git a/silk/float/LTP_analysis_filter_FLP.c b/silk/float/LTP_analysis_filter_FLP.c
index 297c813..d3a6a5a 100644
--- a/silk/float/LTP_analysis_filter_FLP.c
+++ b/silk/float/LTP_analysis_filter_FLP.c
@@ -33,13 +33,13 @@
 
 void silk_LTP_analysis_filter_FLP(
     silk_float                      *LTP_res,                           /* O    LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */
-    const silk_float                *x,                                 /* I    Input signal, with preceeding samples       */
+    const silk_float                *x,                                 /* I    Input signal, with preceding samples        */
     const silk_float                B[ LTP_ORDER * MAX_NB_SUBFR ],      /* I    LTP coefficients for each subframe          */
     const opus_int                  pitchL[   MAX_NB_SUBFR ],           /* I    Pitch lags                                  */
     const silk_float                invGains[ MAX_NB_SUBFR ],           /* I    Inverse quantization gains                  */
     const opus_int                  subfr_length,                       /* I    Length of each subframe                     */
     const opus_int                  nb_subfr,                           /* I    number of subframes                         */
-    const opus_int                  pre_length                          /* I    Preceeding samples for each subframe        */
+    const opus_int                  pre_length                          /* I    Preceding samples for each subframe         */
 )
 {
     const silk_float *x_ptr, *x_lag_ptr;
diff --git a/silk/float/SigProc_FLP.h b/silk/float/SigProc_FLP.h
index 18e2571..036b46d 100644
--- a/silk/float/SigProc_FLP.h
+++ b/silk/float/SigProc_FLP.h
@@ -109,7 +109,7 @@
     silk_float          A[],                /* O    prediction coefficients (length order)                      */
     const silk_float    x[],                /* I    input signal, length: nb_subfr*(D+L_sub)                    */
     const silk_float    minInvGain,         /* I    minimum inverse prediction gain                             */
-    const opus_int      subfr_length,       /* I    input signal subframe length (incl. D preceeding samples)   */
+    const opus_int      subfr_length,       /* I    input signal subframe length (incl. D preceding samples)    */
     const opus_int      nb_subfr,           /* I    number of subframes stacked in x                            */
     const opus_int      D                   /* I    order                                                       */
 );
diff --git a/silk/float/burg_modified_FLP.c b/silk/float/burg_modified_FLP.c
index 0add3a6..31c9b22 100644
--- a/silk/float/burg_modified_FLP.c
+++ b/silk/float/burg_modified_FLP.c
@@ -40,7 +40,7 @@
     silk_float          A[],                /* O    prediction coefficients (length order)                      */
     const silk_float    x[],                /* I    input signal, length: nb_subfr*(D+L_sub)                    */
     const silk_float    minInvGain,         /* I    minimum inverse prediction gain                             */
-    const opus_int      subfr_length,       /* I    input signal subframe length (incl. D preceeding samples)   */
+    const opus_int      subfr_length,       /* I    input signal subframe length (incl. D preceding samples)    */
     const opus_int      nb_subfr,           /* I    number of subframes stacked in x                            */
     const opus_int      D                   /* I    order                                                       */
 )
@@ -162,7 +162,7 @@
         for( k = 0; k < D; k++ ) {
             A[ k ] = (silk_float)( -Af[ k ] );
         }
-        /* Subtract energy of preceeding samples from C0 */
+        /* Subtract energy of preceding samples from C0 */
         for( s = 0; s < nb_subfr; s++ ) {
             C0 -= silk_energy_FLP( x + s * subfr_length, D );
         }
diff --git a/silk/float/find_pitch_lags_FLP.c b/silk/float/find_pitch_lags_FLP.c
index b3ade8f..9f06eff 100644
--- a/silk/float/find_pitch_lags_FLP.c
+++ b/silk/float/find_pitch_lags_FLP.c
@@ -54,7 +54,7 @@
     /******************************************/
     buf_len = psEnc->sCmn.la_pitch + psEnc->sCmn.frame_length + psEnc->sCmn.ltp_mem_length;
 
-    /* Safty check */
+    /* Safety check */
     silk_assert( buf_len >= psEnc->sCmn.pitch_LPC_win_length );
 
     x_buf = x - psEnc->sCmn.ltp_mem_length;
diff --git a/silk/float/main_FLP.h b/silk/float/main_FLP.h
index 202a7fe..93455d4 100644
--- a/silk/float/main_FLP.h
+++ b/silk/float/main_FLP.h
@@ -164,17 +164,17 @@
 
 void silk_LTP_analysis_filter_FLP(
     silk_float                      *LTP_res,                           /* O    LTP res MAX_NB_SUBFR*(pre_lgth+subfr_lngth) */
-    const silk_float                *x,                                 /* I    Input signal, with preceeding samples       */
+    const silk_float                *x,                                 /* I    Input signal, with preceding samples        */
     const silk_float                B[ LTP_ORDER * MAX_NB_SUBFR ],      /* I    LTP coefficients for each subframe          */
     const opus_int                  pitchL[   MAX_NB_SUBFR ],           /* I    Pitch lags                                  */
     const silk_float                invGains[ MAX_NB_SUBFR ],           /* I    Inverse quantization gains                  */
     const opus_int                  subfr_length,                       /* I    Length of each subframe                     */
     const opus_int                  nb_subfr,                           /* I    number of subframes                         */
-    const opus_int                  pre_length                          /* I    Preceeding samples for each subframe        */
+    const opus_int                  pre_length                          /* I    Preceding samples for each subframe         */
 );
 
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */
-/* of preceeding samples                                                                */
+/* of preceding samples                                                                 */
 void silk_residual_energy_FLP(
     silk_float                      nrgs[ MAX_NB_SUBFR ],               /* O    Residual energy per subframe                */
     const silk_float                x[],                                /* I    Input signal                                */
diff --git a/silk/float/noise_shape_analysis_FLP.c b/silk/float/noise_shape_analysis_FLP.c
index 1c203b3..33bfd20 100644
--- a/silk/float/noise_shape_analysis_FLP.c
+++ b/silk/float/noise_shape_analysis_FLP.c
@@ -174,7 +174,7 @@
     /*************************/
     /* Set quantizer offset */
     if( psEnc->sCmn.indices.signalType == TYPE_VOICED ) {
-        /* Initally set to 0; may be overruled in process_gains(..) */
+        /* Initially set to 0; may be overruled in process_gains(..) */
         psEnc->sCmn.indices.quantOffsetType = 0;
         psEncCtrl->sparseness = 0.0f;
     } else {
diff --git a/silk/float/pitch_analysis_core_FLP.c b/silk/float/pitch_analysis_core_FLP.c
index d23e4ee..fbff90c 100644
--- a/silk/float/pitch_analysis_core_FLP.c
+++ b/silk/float/pitch_analysis_core_FLP.c
@@ -419,7 +419,7 @@
         silk_assert( lag == silk_SAT16( lag ) );
         contour_bias = PE_FLATCONTOUR_BIAS / lag;
 
-        /* Set up cbk parameters acording to complexity setting and frame length */
+        /* Set up cbk parameters according to complexity setting and frame length */
         if( nb_subfr == PE_MAX_NB_SUBFR ) {
             nb_cbk_search = (opus_int)silk_nb_cbk_searchs_stage3[ complexity ];
             cbk_size      = PE_NB_CBKS_STAGE3_MAX;
diff --git a/silk/float/residual_energy_FLP.c b/silk/float/residual_energy_FLP.c
index 4fa0e67..e65457a 100644
--- a/silk/float/residual_energy_FLP.c
+++ b/silk/float/residual_energy_FLP.c
@@ -87,7 +87,7 @@
 }
 
 /* Calculates residual energies of input subframes where all subframes have LPC_order   */
-/* of preceeding samples                                                                */
+/* of preceding samples                                                                 */
 void silk_residual_energy_FLP(
     silk_float                      nrgs[ MAX_NB_SUBFR ],               /* O    Residual energy per subframe                */
     const silk_float                x[],                                /* I    Input signal                                */
diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c
index b5348c3..cae8a75 100644
--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -1538,7 +1538,7 @@
 #ifdef MALLOC_FAIL
 /* GLIBC 2.14 declares __malloc_hook as deprecated, generating a warning
  * under GCC. However, this is the cleanest way to test malloc failure
- * handling in our codebase, and the lack of thread saftey isn't an
+ * handling in our codebase, and the lack of thread safety isn't an
  * issue here. We therefore disable the warning for this function.
  */
 #if OPUS_GNUC_PREREQ(4,6)