Hello community,

here is the log from the commit of package opus for openSUSE:Factory checked in 
at 2016-01-23 01:14:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/opus (Old)
 and      /work/SRC/openSUSE:Factory/.opus.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "opus"

Changes:
--------
--- /work/SRC/openSUSE:Factory/opus/opus.changes        2015-12-09 
19:32:47.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.opus.new/opus.changes   2016-01-23 
01:14:35.000000000 +0100
@@ -1,0 +2,11 @@
+Tue Jan 19 13:24:17 UTC 2016 - [email protected]
+
+- Update to version 1.1.2, fixes the following bugs:
+  + Resetting the encoder or decoder state with OPUS_RESET_STATE
+    would disable some run-time selected architecture-specific
+    optimizations.
+  + In hybrid mode discontinuous transmission (DTX) operation,
+    the comfort noise above 8 kHz was incorrectly estimated
+    and could oscillate in time.
+
+-------------------------------------------------------------------

Old:
----
  opus-1.1.1.tar.gz

New:
----
  opus-1.1.2.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ opus.spec ++++++
--- /var/tmp/diff_new_pack.qMwMgp/_old  2016-01-23 01:14:36.000000000 +0100
+++ /var/tmp/diff_new_pack.qMwMgp/_new  2016-01-23 01:14:36.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package opus
 #
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
 # Copyright (c) 2012 Pascal Bleser <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
 
 
 Name:           opus
-Version:        1.1.1
+Version:        1.1.2
 Release:        0
 %define soname      0
 Summary:        Opus Audio Codec Library

++++++ opus-1.1.1.tar.gz -> opus-1.1.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/Makefile.in new/opus-1.1.2/Makefile.in
--- old/opus-1.1.1/Makefile.in  2015-11-25 21:46:28.000000000 +0100
+++ new/opus-1.1.2/Makefile.in  2016-01-12 19:17:49.000000000 +0100
@@ -953,6 +953,7 @@
 OPUS_LT_AGE = @OPUS_LT_AGE@
 OPUS_LT_CURRENT = @OPUS_LT_CURRENT@
 OPUS_LT_REVISION = @OPUS_LT_REVISION@
+OPUS_X86_AVX_CFLAGS = @OPUS_X86_AVX_CFLAGS@
 OPUS_X86_SSE2_CFLAGS = @OPUS_X86_SSE2_CFLAGS@
 OPUS_X86_SSE4_1_CFLAGS = @OPUS_X86_SSE4_1_CFLAGS@
 OPUS_X86_SSE_CFLAGS = @OPUS_X86_SSE_CFLAGS@
@@ -973,6 +974,7 @@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+X86_AVX_CFLAGS = @X86_AVX_CFLAGS@
 X86_SSE2_CFLAGS = @X86_SSE2_CFLAGS@
 X86_SSE4_1_CFLAGS = @X86_SSE4_1_CFLAGS@
 X86_SSE_CFLAGS = @X86_SSE_CFLAGS@
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/Makefile.mips new/opus-1.1.2/Makefile.mips
--- old/opus-1.1.1/Makefile.mips        2015-04-22 02:22:07.000000000 +0200
+++ new/opus-1.1.2/Makefile.mips        2016-01-11 21:48:46.000000000 +0100
@@ -108,11 +108,16 @@
 OPUSCOMPARE_SRCS_C = src/opus_compare.c
 OPUSCOMPARE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSCOMPARE_SRCS_C))
 
+TESTS := test_opus_api test_opus_decode test_opus_encode test_opus_padding
+
 # Rules
-all: lib opus_demo opus_compare test_opus_api test_opus_decode 
test_opus_encode test_opus_padding
+all: lib opus_demo opus_compare $(TESTS)
 
 lib: $(TARGET)
 
+check: all
+       for test in $(TESTS); do ./$$test; done
+
 $(TARGET): $(OBJS)
        $(ARCHIVE.cmdline)
 
@@ -153,4 +158,4 @@
                $(OBJS) $(OPUSDEMO_OBJS) $(OPUSCOMPARE_OBJS) 
$(TESTOPUSAPI_OBJS) \
                 $(TESTOPUSDECODE_OBJS) $(TESTOPUSENCODE_OBJS) 
$(TESTOPUSPADDING_OBJS)
 
-.PHONY: all lib clean
+.PHONY: all lib clean force check
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/Makefile.unix new/opus-1.1.2/Makefile.unix
--- old/opus-1.1.1/Makefile.unix        2015-04-22 02:22:07.000000000 +0200
+++ new/opus-1.1.2/Makefile.unix        2016-01-11 21:48:46.000000000 +0100
@@ -106,11 +106,16 @@
 OPUSCOMPARE_SRCS_C = src/opus_compare.c
 OPUSCOMPARE_OBJS := $(patsubst %.c,%$(OBJSUFFIX),$(OPUSCOMPARE_SRCS_C))
 
+TESTS := test_opus_api test_opus_decode test_opus_encode test_opus_padding
+
 # Rules
-all: lib opus_demo opus_compare test_opus_api test_opus_decode 
test_opus_encode test_opus_padding
+all: lib opus_demo opus_compare $(TESTS)
 
 lib: $(TARGET)
 
+check: all
+       for test in $(TESTS); do ./$$test; done
+
 $(TARGET): $(OBJS)
        $(ARCHIVE.cmdline)
 
@@ -151,4 +156,4 @@
                $(OBJS) $(OPUSDEMO_OBJS) $(OPUSCOMPARE_OBJS) 
$(TESTOPUSAPI_OBJS) \
                 $(TESTOPUSDECODE_OBJS) $(TESTOPUSENCODE_OBJS) 
$(TESTOPUSPADDING_OBJS)
 
-.PHONY: all lib clean
+.PHONY: all lib clean force check
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/celt_decoder.c 
new/opus-1.1.2/celt/celt_decoder.c
--- old/opus-1.1.1/celt/celt_decoder.c  2015-10-08 00:09:20.000000000 +0200
+++ new/opus-1.1.2/celt/celt_decoder.c  2015-12-30 20:16:21.000000000 +0100
@@ -457,10 +457,9 @@
       VARDECL(celt_norm, X);
 #endif
       opus_uint32 seed;
-      opus_val16 *plcLogE;
       int end;
       int effEnd;
-
+      opus_val16 decay;
       end = st->end;
       effEnd = IMAX(start, IMIN(end, mode->effEBands));
 
@@ -472,19 +471,13 @@
       ALLOC(X, C*N, celt_norm);   /**< Interleaved normalised MDCTs */
 #endif
 
-      if (loss_count >= 5)
-         plcLogE = backgroundLogE;
-      else {
-         /* Energy decay */
-         opus_val16 decay = loss_count==0 ?
-               QCONST16(1.5f, DB_SHIFT) : QCONST16(.5f, DB_SHIFT);
-         c=0; do
-         {
-            for (i=start;i<end;i++)
-               oldBandE[c*nbEBands+i] -= decay;
-         } while (++c<C);
-         plcLogE = oldBandE;
-      }
+      /* Energy decay */
+      decay = loss_count==0 ? QCONST16(1.5f, DB_SHIFT) : QCONST16(.5f, 
DB_SHIFT);
+      c=0; do
+      {
+         for (i=start;i<end;i++)
+            oldBandE[c*nbEBands+i] = MAX16(backgroundLogE[c*nbEBands+i], 
oldBandE[c*nbEBands+i] - decay);
+      } while (++c<C);
       seed = st->rng;
       for (c=0;c<C;c++)
       {
@@ -510,7 +503,7 @@
                DECODE_BUFFER_SIZE-N+(overlap>>1));
       } while (++c<C);
 
-      celt_synthesis(mode, X, out_syn, plcLogE, start, effEnd, C, C, 0, LM, 
st->downsample, 0, st->arch);
+      celt_synthesis(mode, X, out_syn, oldBandE, start, effEnd, C, C, 0, LM, 
st->downsample, 0, st->arch);
    } else {
       /* Pitch-based PLC */
       const opus_val16 *window;
@@ -1037,10 +1030,18 @@
    /* In case start or end were to change */
    if (!isTransient)
    {
+      opus_val16 max_background_increase;
       OPUS_COPY(oldLogE2, oldLogE, 2*nbEBands);
       OPUS_COPY(oldLogE, oldBandE, 2*nbEBands);
+      /* In normal circumstances, we only allow the noise floor to increase by
+         up to 2.4 dB/second, but when we're in DTX, we allow up to 6 dB
+         increase for each update.*/
+      if (st->loss_count < 10)
+         max_background_increase = M*QCONST16(0.001f,DB_SHIFT);
+      else
+         max_background_increase = QCONST16(1.f,DB_SHIFT);
       for (i=0;i<2*nbEBands;i++)
-         backgroundLogE[i] = MIN16(backgroundLogE[i] + 
M*QCONST16(0.001f,DB_SHIFT), oldBandE[i]);
+         backgroundLogE[i] = MIN16(backgroundLogE[i] + 
max_background_increase, oldBandE[i]);
    } else {
       for (i=0;i<2*nbEBands;i++)
          oldLogE[i] = MIN16(oldLogE[i], oldBandE[i]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/celt_encoder.c 
new/opus-1.1.2/celt/celt_encoder.c
--- old/opus-1.1.1/celt/celt_encoder.c  2015-11-25 03:03:10.000000000 +0100
+++ new/opus-1.1.2/celt/celt_encoder.c  2016-01-12 18:16:54.000000000 +0100
@@ -343,9 +343,9 @@
       {
          int id;
 #ifdef FIXED_POINT
-         id = IMAX(0,IMIN(127,MULT16_32_Q15(tmp[i],norm))); /* Do not round to 
nearest */
+         id = MAX32(0,MIN32(127,MULT16_32_Q15(tmp[i]+EPSILON,norm))); /* Do 
not round to nearest */
 #else
-         id = IMAX(0,IMIN(127,(int)floor(64*norm*tmp[i]))); /* Do not round to 
nearest */
+         id = (int)MAX32(0,MIN32(127,floor(64*norm*(tmp[i]+EPSILON)))); /* Do 
not round to nearest */
 #endif
          unmask += inv_table[id];
       }
@@ -375,8 +375,8 @@
 
 /* Looks for sudden increases of energy to decide whether we need to patch
    the transient decision */
-int patch_transient_decision(opus_val16 *newE, opus_val16 *oldE, int nbEBands,
-      int end, int C)
+static int patch_transient_decision(opus_val16 *newE, opus_val16 *oldE, int 
nbEBands,
+      int start, int end, int C)
 {
    int i, c;
    opus_val32 mean_diff=0;
@@ -385,28 +385,28 @@
       avoid false detection caused by irrelevant bands */
    if (C==1)
    {
-      spread_old[0] = oldE[0];
-      for (i=1;i<end;i++)
+      spread_old[start] = oldE[start];
+      for (i=start+1;i<end;i++)
          spread_old[i] = MAX16(spread_old[i-1]-QCONST16(1.0f, DB_SHIFT), 
oldE[i]);
    } else {
-      spread_old[0] = MAX16(oldE[0],oldE[nbEBands]);
-      for (i=1;i<end;i++)
+      spread_old[start] = MAX16(oldE[start],oldE[start+nbEBands]);
+      for (i=start+1;i<end;i++)
          spread_old[i] = MAX16(spread_old[i-1]-QCONST16(1.0f, DB_SHIFT),
                                MAX16(oldE[i],oldE[i+nbEBands]));
    }
-   for (i=end-2;i>=0;i--)
+   for (i=end-2;i>=start;i--)
       spread_old[i] = MAX16(spread_old[i], spread_old[i+1]-QCONST16(1.0f, 
DB_SHIFT));
    /* Compute mean increase */
    c=0; do {
-      for (i=2;i<end-1;i++)
+      for (i=IMAX(2,start);i<end-1;i++)
       {
          opus_val16 x1, x2;
-         x1 = MAX16(0, newE[i]);
+         x1 = MAX16(0, newE[i + c*nbEBands]);
          x2 = MAX16(0, spread_old[i]);
          mean_diff = ADD32(mean_diff, EXTEND32(MAX16(0, SUB16(x1, x2))));
       }
    } while (++c<C);
-   mean_diff = DIV32(mean_diff, C*(end-3));
+   mean_diff = DIV32(mean_diff, C*(end-1-IMAX(2,start)));
    /*printf("%f %f %d\n", mean_diff, max_diff, count);*/
    return mean_diff > QCONST16(1.f, DB_SHIFT);
 }
@@ -1735,7 +1735,7 @@
       time-domain analysis */
    if (LM>0 && ec_tell(enc)+3<=total_bits && !isTransient && st->complexity>=5 
&& !st->lfe)
    {
-      if (patch_transient_decision(bandLogE, oldBandE, nbEBands, end, C))
+      if (patch_transient_decision(bandLogE, oldBandE, nbEBands, start, end, 
C))
       {
          isTransient = 1;
          shortBlocks = M;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/cpu_support.h 
new/opus-1.1.2/celt/cpu_support.h
--- old/opus-1.1.1/celt/cpu_support.h   2015-11-25 03:03:10.000000000 +0100
+++ new/opus-1.1.2/celt/cpu_support.h   2015-12-30 20:16:21.000000000 +0100
@@ -45,16 +45,18 @@
 
 #elif (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
   (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
-  (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1))
+  (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
+  (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))
 
 #include "x86/x86cpu.h"
-/* We currently support 4 x86 variants:
+/* We currently support 5 x86 variants:
  * arch[0] -> non-sse
  * arch[1] -> sse
  * arch[2] -> sse2
  * arch[3] -> sse4.1
+ * arch[4] -> avx
  */
-#define OPUS_ARCHMASK 3
+#define OPUS_ARCHMASK 7
 int opus_select_arch(void);
 
 #else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/quant_bands.c 
new/opus-1.1.2/celt/quant_bands.c
--- old/opus-1.1.1/celt/quant_bands.c   2015-08-03 17:17:17.000000000 +0200
+++ new/opus-1.1.2/celt/quant_bands.c   2015-12-30 20:16:21.000000000 +0100
@@ -292,7 +292,7 @@
 #endif
    }
    if (lfe)
-      max_decay=3;
+      max_decay = QCONST16(3.f,DB_SHIFT);
    enc_start_state = *enc;
 
    ALLOC(oldEBands_intra, C*m->nbEBands, opus_val16);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/rate.c new/opus-1.1.2/celt/rate.c
--- old/opus-1.1.1/celt/rate.c  2015-11-25 03:03:10.000000000 +0100
+++ new/opus-1.1.2/celt/rate.c  2016-01-11 21:48:46.000000000 +0100
@@ -131,7 +131,7 @@
    for (i=0;i<nbEntries;i++)
    {
       unsigned char *ptr = bits+entryI[i];
-      opus_int16 tmp[MAX_PULSES+1];
+      opus_int16 tmp[CELT_MAX_PULSES+1];
       get_required_bits(tmp, entryN[i], get_pulses(entryK[i]), BITRES);
       for (j=1;j<=entryK[i];j++)
          ptr[j] = tmp[get_pulses(j)]-1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/rate.h new/opus-1.1.2/celt/rate.h
--- old/opus-1.1.1/celt/rate.h  2015-08-31 18:14:35.000000000 +0200
+++ new/opus-1.1.2/celt/rate.h  2016-01-11 21:48:46.000000000 +0100
@@ -32,7 +32,7 @@
 #define MAX_PSEUDO 40
 #define LOG_MAX_PSEUDO 6
 
-#define MAX_PULSES 128
+#define CELT_MAX_PULSES 128
 
 #define MAX_FINE_BITS 8
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/tests/test_unit_dft.c 
new/opus-1.1.2/celt/tests/test_unit_dft.c
--- old/opus-1.1.1/celt/tests/test_unit_dft.c   2015-11-13 00:45:23.000000000 
+0100
+++ new/opus-1.1.2/celt/tests/test_unit_dft.c   2015-12-30 20:16:21.000000000 
+0100
@@ -149,7 +149,7 @@
 
     free(in);
     free(out);
-    free(cfg);
+    opus_fft_free(cfg, arch);
 }
 
 int main(int argc,char ** argv)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/tests/test_unit_laplace.c 
new/opus-1.1.2/celt/tests/test_unit_laplace.c
--- old/opus-1.1.1/celt/tests/test_unit_laplace.c       2014-02-14 
20:54:59.000000000 +0100
+++ new/opus-1.1.2/celt/tests/test_unit_laplace.c       2015-12-30 
20:16:21.000000000 +0100
@@ -88,5 +88,6 @@
       }
    }
 
+   free(ptr);
    return ret;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/tests/test_unit_mdct.c 
new/opus-1.1.2/celt/tests/test_unit_mdct.c
--- old/opus-1.1.1/celt/tests/test_unit_mdct.c  2015-11-13 00:45:23.000000000 
+0100
+++ new/opus-1.1.2/celt/tests/test_unit_mdct.c  2015-12-30 20:16:21.000000000 
+0100
@@ -179,7 +179,9 @@
 
 
     free(in);
+    free(in_copy);
     free(out);
+    free(window);
     clt_mdct_clear(&cfg, arch);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/x86/x86_celt_map.c 
new/opus-1.1.2/celt/x86/x86_celt_map.c
--- old/opus-1.1.1/celt/x86/x86_celt_map.c      2015-11-25 03:03:10.000000000 
+0100
+++ new/opus-1.1.2/celt/x86/x86_celt_map.c      2015-12-30 20:16:21.000000000 
+0100
@@ -53,6 +53,7 @@
   celt_fir_c,
   celt_fir_c,
   MAY_HAVE_SSE4_1(celt_fir), /* sse4.1  */
+  MAY_HAVE_SSE4_1(celt_fir)  /* avx  */
 };
 
 void (*const XCORR_KERNEL_IMPL[OPUS_ARCHMASK + 1])(
@@ -65,6 +66,7 @@
   xcorr_kernel_c,
   xcorr_kernel_c,
   MAY_HAVE_SSE4_1(xcorr_kernel), /* sse4.1  */
+  MAY_HAVE_SSE4_1(xcorr_kernel)  /* avx  */
 };
 
 #endif
@@ -81,6 +83,7 @@
   celt_inner_prod_c,
   MAY_HAVE_SSE2(celt_inner_prod),
   MAY_HAVE_SSE4_1(celt_inner_prod), /* sse4.1  */
+  MAY_HAVE_SSE4_1(celt_inner_prod)  /* avx  */
 };
 
 #endif
@@ -99,6 +102,7 @@
   MAY_HAVE_SSE(xcorr_kernel),
   MAY_HAVE_SSE(xcorr_kernel),
   MAY_HAVE_SSE(xcorr_kernel),
+  MAY_HAVE_SSE(xcorr_kernel)
 };
 
 opus_val32 (*const CELT_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
@@ -110,6 +114,7 @@
   MAY_HAVE_SSE(celt_inner_prod),
   MAY_HAVE_SSE(celt_inner_prod),
   MAY_HAVE_SSE(celt_inner_prod),
+  MAY_HAVE_SSE(celt_inner_prod)
 };
 
 void (*const DUAL_INNER_PROD_IMPL[OPUS_ARCHMASK + 1])(
@@ -124,6 +129,7 @@
   MAY_HAVE_SSE(dual_inner_prod),
   MAY_HAVE_SSE(dual_inner_prod),
   MAY_HAVE_SSE(dual_inner_prod),
+  MAY_HAVE_SSE(dual_inner_prod)
 };
 
 void (*const COMB_FILTER_CONST_IMPL[OPUS_ARCHMASK + 1])(
@@ -139,6 +145,7 @@
   MAY_HAVE_SSE(comb_filter_const),
   MAY_HAVE_SSE(comb_filter_const),
   MAY_HAVE_SSE(comb_filter_const),
+  MAY_HAVE_SSE(comb_filter_const)
 };
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/x86/x86cpu.c 
new/opus-1.1.2/celt/x86/x86cpu.c
--- old/opus-1.1.1/celt/x86/x86cpu.c    2015-11-25 03:03:10.000000000 +0100
+++ new/opus-1.1.2/celt/x86/x86cpu.c    2015-12-30 20:16:21.000000000 +0100
@@ -37,7 +37,8 @@
 
 #if (defined(OPUS_X86_MAY_HAVE_SSE) && !defined(OPUS_X86_PRESUME_SSE)) || \
   (defined(OPUS_X86_MAY_HAVE_SSE2) && !defined(OPUS_X86_PRESUME_SSE2)) || \
-  (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1))
+  (defined(OPUS_X86_MAY_HAVE_SSE4_1) && !defined(OPUS_X86_PRESUME_SSE4_1)) || \
+  (defined(OPUS_X86_MAY_HAVE_AVX) && !defined(OPUS_X86_PRESUME_AVX))
 
 
 #if defined(_MSC_VER)
@@ -91,6 +92,8 @@
     int HW_SSE;
     int HW_SSE2;
     int HW_SSE41;
+    /*  SIMD: 256-bit */
+    int HW_AVX;
 } CPU_Feature;
 
 static void opus_cpu_feature_check(CPU_Feature *cpu_feature)
@@ -106,11 +109,13 @@
         cpu_feature->HW_SSE = (info[3] & (1 << 25)) != 0;
         cpu_feature->HW_SSE2 = (info[3] & (1 << 26)) != 0;
         cpu_feature->HW_SSE41 = (info[2] & (1 << 19)) != 0;
+        cpu_feature->HW_AVX = (info[2] & (1 << 28)) != 0;
     }
     else {
         cpu_feature->HW_SSE = 0;
         cpu_feature->HW_SSE2 = 0;
         cpu_feature->HW_SSE41 = 0;
+        cpu_feature->HW_AVX = 0;
     }
 }
 
@@ -138,6 +143,12 @@
     {
         return arch;
     }
+    arch++;
+
+    if (!cpu_feature.HW_AVX)
+    {
+        return arch;
+    }
     arch++;
 
     return arch;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/celt/x86/x86cpu.h 
new/opus-1.1.2/celt/x86/x86cpu.h
--- old/opus-1.1.1/celt/x86/x86cpu.h    2015-11-25 03:03:10.000000000 +0100
+++ new/opus-1.1.2/celt/x86/x86cpu.h    2015-12-30 20:16:21.000000000 +0100
@@ -46,6 +46,12 @@
 #  define MAY_HAVE_SSE4_1(name) name ## _c
 # endif
 
+# if defined(OPUS_X86_MAY_HAVE_AVX)
+#  define MAY_HAVE_AVX(name) name ## _avx
+# else
+#  define MAY_HAVE_AVX(name) name ## _c
+# endif
+
 # if defined(OPUS_HAVE_RTCD)
 int opus_select_arch(void);
 # endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/config.h.in new/opus-1.1.2/config.h.in
--- old/opus-1.1.1/config.h.in  2015-11-25 21:46:32.000000000 +0100
+++ new/opus-1.1.2/config.h.in  2016-01-12 19:17:55.000000000 +0100
@@ -121,6 +121,9 @@
 /* Use run-time CPU capabilities detection */
 #undef OPUS_HAVE_RTCD
 
+/* Compiler supports X86 AVX Intrinsics */
+#undef OPUS_X86_MAY_HAVE_AVX
+
 /* Compiler supports X86 SSE Intrinsics */
 #undef OPUS_X86_MAY_HAVE_SSE
 
@@ -130,6 +133,9 @@
 /* Compiler supports X86 SSE4.1 Intrinsics */
 #undef OPUS_X86_MAY_HAVE_SSE4_1
 
+/* Define if binary requires AVX intrinsics support */
+#undef OPUS_X86_PRESUME_AVX
+
 /* Define if binary requires SSE intrinsics support */
 #undef OPUS_X86_PRESUME_SSE
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/configure new/opus-1.1.2/configure
--- old/opus-1.1.1/configure    2015-11-25 21:46:28.000000000 +0100
+++ new/opus-1.1.2/configure    2016-01-12 19:17:49.000000000 +0100
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for opus 1.1.1.
+# Generated by GNU Autoconf 2.69 for opus 1.1.2.
 #
 # Report bugs to <[email protected]>.
 #
@@ -590,8 +590,8 @@
 # Identity of this package.
 PACKAGE_NAME='opus'
 PACKAGE_TARNAME='opus'
-PACKAGE_VERSION='1.1.1'
-PACKAGE_STRING='opus 1.1.1'
+PACKAGE_VERSION='1.1.2'
+PACKAGE_STRING='opus 1.1.2'
 PACKAGE_BUGREPORT='[email protected]'
 PACKAGE_URL=''
 
@@ -649,6 +649,7 @@
 OPUS_ARM_NEON_INTR_TRUE
 CPU_ARM_FALSE
 CPU_ARM_TRUE
+OPUS_X86_AVX_CFLAGS
 OPUS_X86_SSE4_1_CFLAGS
 OPUS_X86_SSE2_CFLAGS
 OPUS_X86_SSE_CFLAGS
@@ -657,9 +658,12 @@
 HAVE_ARM_NE10
 OPUS_ARM_NEON_INTR_CFLAGS
 ARM_NEON_INTR_CFLAGS
+X86_AVX_CFLAGS
 X86_SSE4_1_CFLAGS
 X86_SSE2_CFLAGS
 X86_SSE_CFLAGS
+HAVE_AVX_FALSE
+HAVE_AVX_TRUE
 HAVE_SSE4_1_FALSE
 HAVE_SSE4_1_TRUE
 HAVE_SSE2_FALSE
@@ -848,6 +852,7 @@
 X86_SSE_CFLAGS
 X86_SSE2_CFLAGS
 X86_SSE4_1_CFLAGS
+X86_AVX_CFLAGS
 ARM_NEON_INTR_CFLAGS'
 
 
@@ -1389,7 +1394,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures opus 1.1.1 to adapt to many kinds of systems.
+\`configure' configures opus 1.1.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1459,7 +1464,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of opus 1.1.1:";;
+     short | recursive ) echo "Configuration of opus 1.1.2:";;
    esac
   cat <<\_ACEOF
 
@@ -1532,6 +1537,8 @@
               C compiler flags to compile SSE2 intrinsics [default=-msse2]
   X86_SSE4_1_CFLAGS
               C compiler flags to compile SSE4.1 intrinsics [default=-msse4.1]
+  X86_AVX_CFLAGS
+              C compiler flags to compile AVX intrinsics [default=-mavx]
   ARM_NEON_INTR_CFLAGS
               C compiler flags to compile ARM NEON intrinsics
               [default=-mfpu=neon / -mfpu=neon -mfloat-abi=softfp]
@@ -1602,7 +1609,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-opus configure 1.1.1
+opus configure 1.1.2
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1971,7 +1978,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by opus $as_me 1.1.1, which was
+It was created by opus $as_me 1.1.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2365,7 +2372,7 @@
 
 # For libtool.
 OPUS_LT_CURRENT=5
-OPUS_LT_REVISION=1
+OPUS_LT_REVISION=2
 OPUS_LT_AGE=5
 
 
@@ -2848,7 +2855,7 @@
 
 # Define the identity of the package.
  PACKAGE='opus'
- VERSION='1.1.1'
+ VERSION='1.1.2'
 
 
 # Some tools Automake needs.
@@ -12944,6 +12951,15 @@
   HAVE_SSE4_1_FALSE=
 fi
 
+ if false; then
+  HAVE_AVX_TRUE=
+  HAVE_AVX_FALSE='#'
+else
+  HAVE_AVX_TRUE='#'
+  HAVE_AVX_FALSE=
+fi
+
+
 
 
 
@@ -12970,6 +12986,7 @@
 
 
 
+
 if ${X86_SSE_CFLAGS+:} false; then :
 
 else
@@ -12985,6 +13002,11 @@
 else
   X86_SSE4_1_CFLAGS="-msse4.1"
 fi
+if ${X86_AVX_CFLAGS+:} false; then :
+
+else
+  X86_AVX_CFLAGS="-mavx"
+fi
 if ${ARM_NEON_INTR_CFLAGS+:} false; then :
 
 else
@@ -13468,6 +13490,83 @@
 
 fi
 
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports AVX 
intrinsics" >&5
+$as_echo_n "checking if compiler supports AVX intrinsics... " >&6; }
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <immintrin.h>
+
+int
+main ()
+{
+
+            static __m256 mtest;
+            mtest = _mm256_setzero_ps();
+
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+        OPUS_X86_MAY_HAVE_AVX=1
+        OPUS_X86_PRESUME_AVX=1
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+        OPUS_X86_PRESUME_AVX=0
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports 
AVX intrinsics with $X86_AVX_CFLAGS" >&5
+$as_echo_n "checking if compiler supports AVX intrinsics with 
$X86_AVX_CFLAGS... " >&6; }
+        save_CFLAGS="$CFLAGS"; CFLAGS="$X86_AVX_CFLAGS $CFLAGS"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <immintrin.h>
+
+int
+main ()
+{
+
+            static __m256 mtest;
+            mtest = _mm256_setzero_ps();
+
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+           OPUS_X86_MAY_HAVE_AVX=1
+
+else
+
+           { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+           OPUS_X86_MAY_HAVE_AVX=0
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        CFLAGS="$save_CFLAGS"
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+      if test x"$OPUS_X86_MAY_HAVE_AVX" = x"1" && test 
x"$OPUS_X86_PRESUME_AVX" != x"1"; then :
+
+             OPUS_X86_AVX_CFLAGS="$X86_AVX_CFLAGS"
+
+
+
+fi
          if test x"$rtcd_support" = x"no"; then :
   rtcd_support=""
 fi
@@ -13536,6 +13635,28 @@
 $as_echo "$as_me: WARNING: Compiler does not support SSE4.1 intrinsics" >&2;}
 
 fi
+         if test x"$OPUS_X86_MAY_HAVE_AVX" = x"1"; then :
+
+
+$as_echo "#define OPUS_X86_MAY_HAVE_AVX 1" >>confdefs.h
+
+            intrinsics_support="$intrinsics_support AVX"
+
+            if test x"$OPUS_X86_PRESUME_AVX" = x"1"; then :
+
+$as_echo "#define OPUS_X86_PRESUME_AVX 1" >>confdefs.h
+
+else
+  rtcd_support="$rtcd_support AVX"
+fi
+
+else
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Compiler does 
not support AVX intrinsics" >&5
+$as_echo "$as_me: WARNING: Compiler does not support AVX intrinsics" >&2;}
+
+fi
+
          if test x"$intrinsics_support" = x""; then :
   intrinsics_support=no
 else
@@ -13686,6 +13807,14 @@
   HAVE_SSE4_1_FALSE=
 fi
 
+ if test x"$OPUS_X86_MAY_HAVE_AVX" = x"1"; then
+  HAVE_AVX_TRUE=
+  HAVE_AVX_FALSE='#'
+else
+  HAVE_AVX_TRUE='#'
+  HAVE_AVX_FALSE=
+fi
+
 
 if test x"$enable_rtcd" = x"yes"; then :
 
@@ -14086,6 +14215,10 @@
   as_fn_error $? "conditional \"HAVE_SSE4_1\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_AVX_TRUE}" && test -z "${HAVE_AVX_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_AVX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${CPU_ARM_TRUE}" && test -z "${CPU_ARM_FALSE}"; then
   as_fn_error $? "conditional \"CPU_ARM\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -14110,6 +14243,10 @@
   as_fn_error $? "conditional \"HAVE_SSE4_1\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${HAVE_AVX_TRUE}" && test -z "${HAVE_AVX_FALSE}"; then
+  as_fn_error $? "conditional \"HAVE_AVX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -14515,7 +14652,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by opus $as_me 1.1.1, which was
+This file was extended by opus $as_me 1.1.2, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -14581,7 +14718,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-opus config.status 1.1.1
+opus config.status 1.1.2
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/configure.ac new/opus-1.1.2/configure.ac
--- old/opus-1.1.1/configure.ac 2015-11-25 21:46:26.000000000 +0100
+++ new/opus-1.1.2/configure.ac 2016-01-12 19:17:47.000000000 +0100
@@ -23,7 +23,7 @@
 # For libtool.
 dnl Please update these for releases.
 OPUS_LT_CURRENT=5
-OPUS_LT_REVISION=1
+OPUS_LT_REVISION=2
 OPUS_LT_AGE=5
 
 AC_SUBST(OPUS_LT_CURRENT)
@@ -351,10 +351,12 @@
 AM_CONDITIONAL([HAVE_SSE], [false])
 AM_CONDITIONAL([HAVE_SSE2], [false])
 AM_CONDITIONAL([HAVE_SSE4_1], [false])
+AM_CONDITIONAL([HAVE_AVX], [false])
 
 m4_define([DEFAULT_X86_SSE_CFLAGS], [-msse])
 m4_define([DEFAULT_X86_SSE2_CFLAGS], [-msse2])
 m4_define([DEFAULT_X86_SSE4_1_CFLAGS], [-msse4.1])
+m4_define([DEFAULT_X86_AVX_CFLAGS], [-mavx])
 m4_define([DEFAULT_ARM_NEON_INTR_CFLAGS], [-mfpu=neon])
 # With GCC on ARM32 softfp architectures (e.g. Android, or older Ubuntu) you 
need to specify
 # -mfloat-abi=softfp for -mfpu=neon to work.  However, on ARM32 hardfp 
architectures (e.g. newer Ubuntu),
@@ -371,11 +373,13 @@
 AC_ARG_VAR([X86_SSE_CFLAGS], [C compiler flags to compile SSE intrinsics 
@<:@default=]DEFAULT_X86_SSE_CFLAGS[@:>@])
 AC_ARG_VAR([X86_SSE2_CFLAGS], [C compiler flags to compile SSE2 intrinsics 
@<:@default=]DEFAULT_X86_SSE2_CFLAGS[@:>@])
 AC_ARG_VAR([X86_SSE4_1_CFLAGS], [C compiler flags to compile SSE4.1 intrinsics 
@<:@default=]DEFAULT_X86_SSE4_1_CFLAGS[@:>@])
+AC_ARG_VAR([X86_AVX_CFLAGS], [C compiler flags to compile AVX intrinsics 
@<:@default=]DEFAULT_X86_AVX_CFLAGS[@:>@])
 AC_ARG_VAR([ARM_NEON_INTR_CFLAGS], [C compiler flags to compile ARM NEON 
intrinsics @<:@default=]DEFAULT_ARM_NEON_INTR_CFLAGS / 
DEFAULT_ARM_NEON_SOFTFP_INTR_CFLAGS[@:>@])
 
 AS_VAR_SET_IF([X86_SSE_CFLAGS], [], [AS_VAR_SET([X86_SSE_CFLAGS], 
"DEFAULT_X86_SSE_CFLAGS")])
 AS_VAR_SET_IF([X86_SSE2_CFLAGS], [], [AS_VAR_SET([X86_SSE2_CFLAGS], 
"DEFAULT_X86_SSE2_CFLAGS")])
 AS_VAR_SET_IF([X86_SSE4_1_CFLAGS], [], [AS_VAR_SET([X86_SSE4_1_CFLAGS], 
"DEFAULT_X86_SSE4_1_CFLAGS")])
+AS_VAR_SET_IF([X86_AVX_CFLAGS], [], [AS_VAR_SET([X86_AVX_CFLAGS], 
"DEFAULT_X86_AVX_CFLAGS")])
 AS_VAR_SET_IF([ARM_NEON_INTR_CFLAGS], [], [AS_VAR_SET([ARM_NEON_INTR_CFLAGS], 
["$RESOLVED_DEFAULT_ARM_NEON_INTR_CFLAGS"])])
 
 AC_DEFUN([OPUS_PATH_NE10],
@@ -566,7 +570,24 @@
              AC_SUBST([OPUS_X86_SSE4_1_CFLAGS])
           ]
       )
-
+      OPUS_CHECK_INTRINSICS(
+         [AVX],
+         [$X86_AVX_CFLAGS],
+         [OPUS_X86_MAY_HAVE_AVX],
+         [OPUS_X86_PRESUME_AVX],
+         [[#include <immintrin.h>
+         ]],
+         [[
+            static __m256 mtest;
+            mtest = _mm256_setzero_ps();
+         ]]
+      )
+      AS_IF([test x"$OPUS_X86_MAY_HAVE_AVX" = x"1" && test 
x"$OPUS_X86_PRESUME_AVX" != x"1"],
+          [
+             OPUS_X86_AVX_CFLAGS="$X86_AVX_CFLAGS"
+             AC_SUBST([OPUS_X86_AVX_CFLAGS])
+          ]
+      )
          AS_IF([test x"$rtcd_support" = x"no"], [rtcd_support=""])
          AS_IF([test x"$OPUS_X86_MAY_HAVE_SSE" = x"1"],
          [
@@ -606,6 +627,19 @@
          [
             AC_MSG_WARN([Compiler does not support SSE4.1 intrinsics])
          ])
+         AS_IF([test x"$OPUS_X86_MAY_HAVE_AVX" = x"1"],
+         [
+            AC_DEFINE([OPUS_X86_MAY_HAVE_AVX], 1, [Compiler supports X86 AVX 
Intrinsics])
+            intrinsics_support="$intrinsics_support AVX"
+
+            AS_IF([test x"$OPUS_X86_PRESUME_AVX" = x"1"],
+               [AC_DEFINE([OPUS_X86_PRESUME_AVX], 1, [Define if binary 
requires AVX intrinsics support])],
+               [rtcd_support="$rtcd_support AVX"])
+         ],
+         [
+            AC_MSG_WARN([Compiler does not support AVX intrinsics])
+         ])
+
          AS_IF([test x"$intrinsics_support" = x""],
             [intrinsics_support=no],
             [intrinsics_support="x86$intrinsics_support"]
@@ -672,6 +706,8 @@
     [test x"$OPUS_X86_MAY_HAVE_SSE2" = x"1"])
 AM_CONDITIONAL([HAVE_SSE4_1],
     [test x"$OPUS_X86_MAY_HAVE_SSE4_1" = x"1"])
+AM_CONDITIONAL([HAVE_AVX],
+    [test x"$OPUS_X86_MAY_HAVE_AVX" = x"1"])
 
 AS_IF([test x"$enable_rtcd" = x"yes"],[
     AS_IF([test x"$rtcd_support" != x"no"],[
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/doc/Makefile.in 
new/opus-1.1.2/doc/Makefile.in
--- old/opus-1.1.1/doc/Makefile.in      2015-11-25 21:46:28.000000000 +0100
+++ new/opus-1.1.2/doc/Makefile.in      2016-01-12 19:17:49.000000000 +0100
@@ -189,6 +189,7 @@
 OPUS_LT_AGE = @OPUS_LT_AGE@
 OPUS_LT_CURRENT = @OPUS_LT_CURRENT@
 OPUS_LT_REVISION = @OPUS_LT_REVISION@
+OPUS_X86_AVX_CFLAGS = @OPUS_X86_AVX_CFLAGS@
 OPUS_X86_SSE2_CFLAGS = @OPUS_X86_SSE2_CFLAGS@
 OPUS_X86_SSE4_1_CFLAGS = @OPUS_X86_SSE4_1_CFLAGS@
 OPUS_X86_SSE_CFLAGS = @OPUS_X86_SSE_CFLAGS@
@@ -209,6 +210,7 @@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+X86_AVX_CFLAGS = @X86_AVX_CFLAGS@
 X86_SSE2_CFLAGS = @X86_SSE2_CFLAGS@
 X86_SSE4_1_CFLAGS = @X86_SSE4_1_CFLAGS@
 X86_SSE_CFLAGS = @X86_SSE_CFLAGS@
@@ -388,8 +390,8 @@
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
-@HAVE_DOXYGEN_FALSE@uninstall-local:
 @HAVE_DOXYGEN_FALSE@clean-local:
+@HAVE_DOXYGEN_FALSE@uninstall-local:
 @HAVE_DOXYGEN_FALSE@install-data-local:
 clean: clean-am
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/include/opus_defines.h 
new/opus-1.1.2/include/opus_defines.h
--- old/opus-1.1.1/include/opus_defines.h       2015-10-23 19:17:41.000000000 
+0200
+++ new/opus-1.1.2/include/opus_defines.h       2016-01-12 18:17:00.000000000 
+0100
@@ -523,10 +523,19 @@
   * @hideinitializer */
 #define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x)
 /** Configures the depth of signal being encoded.
+  *
   * This is a hint which helps the encoder identify silence and near-silence.
+  * It represents the number of significant bits of linear intensity below
+  * which the signal contains ignorable quantization or other noise.
+  *
+  * For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting
+  * for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate
+  * for 16-bit linear pcm input with opus_encode_float().
+  *
   * When using opus_encode() instead of opus_encode_float(), or when libopus
   * is compiled for fixed-point, the encoder uses the minimum of the value
   * set here and the value 16.
+  *
   * @see OPUS_GET_LSB_DEPTH
   * @param[in] x <tt>opus_int32</tt>: Input precision in bits, between 8 and 24
   *                                   (default: 24).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/package_version 
new/opus-1.1.2/package_version
--- old/opus-1.1.1/package_version      2015-11-25 21:46:32.000000000 +0100
+++ new/opus-1.1.2/package_version      2016-01-12 19:17:56.000000000 +0100
@@ -1 +1 @@
-PACKAGE_VERSION="1.1.1"
+PACKAGE_VERSION="1.1.2"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/silk/decode_pulses.c 
new/opus-1.1.2/silk/decode_pulses.c
--- old/opus-1.1.1/silk/decode_pulses.c 2015-04-22 02:22:07.000000000 +0200
+++ new/opus-1.1.2/silk/decode_pulses.c 2016-01-11 21:48:46.000000000 +0100
@@ -69,9 +69,9 @@
         sum_pulses[ i ] = ec_dec_icdf( psRangeDec, cdf_ptr, 8 );
 
         /* LSB indication */
-        while( sum_pulses[ i ] == MAX_PULSES + 1 ) {
+        while( sum_pulses[ i ] == SILK_MAX_PULSES + 1 ) {
             nLshifts[ i ]++;
-            /* When we've already got 10 LSBs, we shift the table to not allow 
(MAX_PULSES + 1) */
+            /* When we've already got 10 LSBs, we shift the table to not allow 
(SILK_MAX_PULSES + 1) */
             sum_pulses[ i ] = ec_dec_icdf( psRangeDec,
                     silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1] + ( 
nLshifts[ i ] == 10 ), 8 );
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/silk/define.h new/opus-1.1.2/silk/define.h
--- old/opus-1.1.1/silk/define.h        2014-02-14 20:54:59.000000000 +0100
+++ new/opus-1.1.2/silk/define.h        2016-01-11 21:48:46.000000000 +0100
@@ -169,7 +169,7 @@
 #define N_RATE_LEVELS                           10
 
 /* Maximum sum of pulses per shell coding frame */
-#define MAX_PULSES                              16
+#define SILK_MAX_PULSES                         16
 
 #define MAX_MATRIX_SIZE                         MAX_LPC_ORDER /* Max of LPC 
Order and LTP order */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/silk/encode_pulses.c 
new/opus-1.1.2/silk/encode_pulses.c
--- old/opus-1.1.1/silk/encode_pulses.c 2014-02-14 20:54:59.000000000 +0100
+++ new/opus-1.1.2/silk/encode_pulses.c 2016-01-11 21:48:46.000000000 +0100
@@ -142,7 +142,7 @@
         sumBits_Q5 = silk_rate_levels_BITS_Q5[ signalType >> 1 ][ k ];
         for( i = 0; i < iter; i++ ) {
             if( nRshifts[ i ] > 0 ) {
-                sumBits_Q5 += nBits_ptr[ MAX_PULSES + 1 ];
+                sumBits_Q5 += nBits_ptr[ SILK_MAX_PULSES + 1 ];
             } else {
                 sumBits_Q5 += nBits_ptr[ sum_pulses[ i ] ];
             }
@@ -162,9 +162,9 @@
         if( nRshifts[ i ] == 0 ) {
             ec_enc_icdf( psRangeEnc, sum_pulses[ i ], cdf_ptr, 8 );
         } else {
-            ec_enc_icdf( psRangeEnc, MAX_PULSES + 1, cdf_ptr, 8 );
+            ec_enc_icdf( psRangeEnc, SILK_MAX_PULSES + 1, cdf_ptr, 8 );
             for( k = 0; k < nRshifts[ i ] - 1; k++ ) {
-                ec_enc_icdf( psRangeEnc, MAX_PULSES + 1, 
silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1 ], 8 );
+                ec_enc_icdf( psRangeEnc, SILK_MAX_PULSES + 1, 
silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1 ], 8 );
             }
             ec_enc_icdf( psRangeEnc, sum_pulses[ i ], 
silk_pulses_per_block_iCDF[ N_RATE_LEVELS - 1 ], 8 );
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/silk/tables.h new/opus-1.1.2/silk/tables.h
--- old/opus-1.1.1/silk/tables.h        2014-02-14 20:54:59.000000000 +0100
+++ new/opus-1.1.2/silk/tables.h        2016-01-11 21:48:46.000000000 +0100
@@ -47,8 +47,8 @@
 extern const opus_uint8  silk_pitch_contour_10_ms_iCDF[ 12 ];                  
                     /*  12 */
 extern const opus_uint8  silk_pitch_contour_10_ms_NB_iCDF[ 3 ];                
                     /*   3 */
 
-extern const opus_uint8  silk_pulses_per_block_iCDF[ N_RATE_LEVELS ][ 
MAX_PULSES + 2 ];             /* 180 */
-extern const opus_uint8  silk_pulses_per_block_BITS_Q5[ N_RATE_LEVELS - 1 ][ 
MAX_PULSES + 2 ];      /* 162 */
+extern const opus_uint8  silk_pulses_per_block_iCDF[ N_RATE_LEVELS ][ 
SILK_MAX_PULSES + 2 ];        /* 180 */
+extern const opus_uint8  silk_pulses_per_block_BITS_Q5[ N_RATE_LEVELS - 1 ][ 
SILK_MAX_PULSES + 2 ]; /* 162 */
 
 extern const opus_uint8  silk_rate_levels_iCDF[ 2 ][ N_RATE_LEVELS - 1 ];      
                     /*  18 */
 extern const opus_uint8  silk_rate_levels_BITS_Q5[ 2 ][ N_RATE_LEVELS - 1 ];   
                     /*  18 */
@@ -59,7 +59,7 @@
 extern const opus_uint8  silk_shell_code_table1[ 152 ];                        
                     /* 152 */
 extern const opus_uint8  silk_shell_code_table2[ 152 ];                        
                     /* 152 */
 extern const opus_uint8  silk_shell_code_table3[ 152 ];                        
                     /* 152 */
-extern const opus_uint8  silk_shell_code_table_offsets[ MAX_PULSES + 1 ];      
                     /*  17 */
+extern const opus_uint8  silk_shell_code_table_offsets[ SILK_MAX_PULSES + 1 ]; 
                     /*  17 */
 
 extern const opus_uint8  silk_lsb_iCDF[ 2 ];                                   
                     /*   2 */
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/silk/x86/x86_silk_map.c 
new/opus-1.1.2/silk/x86/x86_silk_map.c
--- old/opus-1.1.1/silk/x86/x86_silk_map.c      2015-11-25 03:03:10.000000000 
+0100
+++ new/opus-1.1.2/silk/x86/x86_silk_map.c      2015-12-30 20:16:21.000000000 
+0100
@@ -50,6 +50,7 @@
   silk_inner_prod16_aligned_64_c,
   silk_inner_prod16_aligned_64_c,
   MAY_HAVE_SSE4_1( silk_inner_prod16_aligned_64 ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_inner_prod16_aligned_64 )  /* avx */
 };
 
 #endif
@@ -62,6 +63,7 @@
   silk_VAD_GetSA_Q8_c,
   silk_VAD_GetSA_Q8_c,
   MAY_HAVE_SSE4_1( silk_VAD_GetSA_Q8 ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_VAD_GetSA_Q8 )  /* avx */
 };
 
 void (*const SILK_NSQ_IMPL[ OPUS_ARCHMASK + 1 ] )(
@@ -85,6 +87,7 @@
   silk_NSQ_c,
   silk_NSQ_c,
   MAY_HAVE_SSE4_1( silk_NSQ ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_NSQ )  /* avx */
 };
 
 void (*const SILK_VQ_WMAT_EC_IMPL[ OPUS_ARCHMASK + 1 ] )(
@@ -104,6 +107,7 @@
   silk_VQ_WMat_EC_c,
   silk_VQ_WMat_EC_c,
   MAY_HAVE_SSE4_1( silk_VQ_WMat_EC ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_VQ_WMat_EC )  /* avx */
 };
 
 void (*const SILK_NSQ_DEL_DEC_IMPL[ OPUS_ARCHMASK + 1 ] )(
@@ -127,6 +131,7 @@
   silk_NSQ_del_dec_c,
   silk_NSQ_del_dec_c,
   MAY_HAVE_SSE4_1( silk_NSQ_del_dec ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_NSQ_del_dec )  /* avx */
 };
 
 #if defined(FIXED_POINT)
@@ -144,6 +149,7 @@
   silk_warped_LPC_analysis_filter_FIX_c,
   silk_warped_LPC_analysis_filter_FIX_c,
   MAY_HAVE_SSE4_1( silk_warped_LPC_analysis_filter_FIX ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_warped_LPC_analysis_filter_FIX )  /* avx */
 };
 
 void (*const SILK_BURG_MODIFIED_IMPL[ OPUS_ARCHMASK + 1 ] )(
@@ -161,6 +167,7 @@
   silk_burg_modified_c,
   silk_burg_modified_c,
   MAY_HAVE_SSE4_1( silk_burg_modified ), /* sse4.1 */
+  MAY_HAVE_SSE4_1( silk_burg_modified )  /* avx */
 };
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/src/analysis.c 
new/opus-1.1.2/src/analysis.c
--- old/opus-1.1.1/src/analysis.c       2015-10-08 00:09:20.000000000 +0200
+++ new/opus-1.1.2/src/analysis.c       2016-01-12 18:16:54.000000000 +0100
@@ -138,6 +138,21 @@
    }
 }
 
+void tonality_analysis_init(TonalityAnalysisState *tonal)
+{
+  /* Initialize reusable fields. */
+  tonal->arch = opus_select_arch();
+  /* Clear remaining fields. */
+  tonality_analysis_reset(tonal);
+}
+
+void tonality_analysis_reset(TonalityAnalysisState *tonal)
+{
+  /* Clear non-reusable fields. */
+  char *start = (char*)&tonal->TONALITY_ANALYSIS_RESET_START;
+  OPUS_CLEAR(start, sizeof(TonalityAnalysisState) - (start - (char*)tonal));
+}
+
 void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, 
int len)
 {
    int pos;
@@ -187,7 +202,7 @@
    info_out->music_prob = psum;
 }
 
-static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode 
*celt_mode, const void *x, int len, int offset, int c1, int c2, int C, int 
lsb_depth, downmix_func downmix, int arch)
+static void tonality_analysis(TonalityAnalysisState *tonal, const CELTMode 
*celt_mode, const void *x, int len, int offset, int c1, int c2, int C, int 
lsb_depth, downmix_func downmix)
 {
     int i, b;
     const kiss_fft_state *kfft;
@@ -260,7 +275,7 @@
     remaining = len - (ANALYSIS_BUF_SIZE-tonal->mem_fill);
     downmix(x, &tonal->inmem[240], remaining, 
offset+ANALYSIS_BUF_SIZE-tonal->mem_fill, c1, c2, C);
     tonal->mem_fill = 240 + remaining;
-    opus_fft(kfft, in, out, arch);
+    opus_fft(kfft, in, out, tonal->arch);
 #ifndef FIXED_POINT
     /* If there's any NaN on the input, the entire output will be NaN, so we 
only need to check one value. */
     if (celt_isnan(out[0].r))
@@ -633,7 +648,7 @@
 
 void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, 
const void *analysis_pcm,
                  int analysis_frame_size, int frame_size, int c1, int c2, int 
C, opus_int32 Fs,
-                 int lsb_depth, downmix_func downmix, AnalysisInfo 
*analysis_info, int arch)
+                 int lsb_depth, downmix_func downmix, AnalysisInfo 
*analysis_info)
 {
    int offset;
    int pcm_len;
@@ -646,7 +661,7 @@
       pcm_len = analysis_frame_size - analysis->analysis_offset;
       offset = analysis->analysis_offset;
       do {
-         tonality_analysis(analysis, celt_mode, analysis_pcm, IMIN(480, 
pcm_len), offset, c1, c2, C, lsb_depth, downmix, arch);
+         tonality_analysis(analysis, celt_mode, analysis_pcm, IMIN(480, 
pcm_len), offset, c1, c2, C, lsb_depth, downmix);
          offset += 480;
          pcm_len -= 480;
       } while (pcm_len>0);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/src/analysis.h 
new/opus-1.1.2/src/analysis.h
--- old/opus-1.1.1/src/analysis.h       2015-10-08 00:09:20.000000000 +0200
+++ new/opus-1.1.2/src/analysis.h       2016-01-11 21:48:46.000000000 +0100
@@ -39,6 +39,8 @@
 #define DETECT_SIZE 200
 
 typedef struct {
+   int arch;
+#define TONALITY_ANALYSIS_RESET_START angle
    float angle[240];
    float d_angle[240];
    float d2_angle[240];
@@ -78,10 +80,24 @@
    AnalysisInfo info[DETECT_SIZE];
 } TonalityAnalysisState;
 
+/** Initialize a TonalityAnalysisState struct.
+ *
+ * This performs some possibly slow initialization steps which should
+ * not be repeated every analysis step. No allocated memory is retained
+ * by the state struct, so no cleanup call is required.
+ */
+void tonality_analysis_init(TonalityAnalysisState *analysis);
+
+/** Reset a TonalityAnalysisState stuct.
+ *
+ * Call this when there's a discontinuity in the data.
+ */
+void tonality_analysis_reset(TonalityAnalysisState *analysis);
+
 void tonality_get_info(TonalityAnalysisState *tonal, AnalysisInfo *info_out, 
int len);
 
 void run_analysis(TonalityAnalysisState *analysis, const CELTMode *celt_mode, 
const void *analysis_pcm,
                  int analysis_frame_size, int frame_size, int c1, int c2, int 
C, opus_int32 Fs,
-                 int lsb_depth, downmix_func downmix, AnalysisInfo 
*analysis_info, int arch);
+                 int lsb_depth, downmix_func downmix, AnalysisInfo 
*analysis_info);
 
 #endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/src/opus_decoder.c 
new/opus-1.1.2/src/opus_decoder.c
--- old/opus-1.1.1/src/opus_decoder.c   2015-08-24 00:02:52.000000000 +0200
+++ new/opus-1.1.2/src/opus_decoder.c   2016-01-11 21:48:46.000000000 +0100
@@ -59,6 +59,7 @@
    opus_int32   Fs;          /** Sampling rate (at the API level) */
    silk_DecControlStruct DecControl;
    int          decode_gain;
+   int          arch;
 
    /* Everything beyond this point gets cleared on a reset */
 #define OPUS_DECODER_RESET_START stream_channels
@@ -75,7 +76,6 @@
 #endif
 
    opus_uint32  rangeFinal;
-   int          arch;
 };
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/src/opus_demo.c 
new/opus-1.1.2/src/opus_demo.c
--- old/opus-1.1.1/src/opus_demo.c      2015-08-20 15:43:36.000000000 +0200
+++ new/opus-1.1.2/src/opus_demo.c      2016-01-12 18:16:54.000000000 +0100
@@ -866,7 +866,7 @@
                      1e-3*bits_max*sampling_rate/frame_size);
     if (!decode_only)
        fprintf (stderr, "active bitrate:              %7.3f kb/s\n",
-               1e-3*bits_act*sampling_rate/(frame_size*(double)count_act));
+               
1e-3*bits_act*sampling_rate/(1e-15+frame_size*(double)count_act));
     fprintf (stderr, "bitrate standard deviation:  %7.3f kb/s\n",
             1e-3*sqrt(bits2/count - 
bits*bits/(count*(double)count))*sampling_rate/frame_size);
     /* Close any files to which intermediate results were stored */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/src/opus_encoder.c 
new/opus-1.1.2/src/opus_encoder.c
--- old/opus-1.1.1/src/opus_encoder.c   2015-11-25 03:03:10.000000000 +0100
+++ new/opus-1.1.2/src/opus_encoder.c   2016-01-12 18:16:54.000000000 +0100
@@ -81,6 +81,10 @@
     int          lsb_depth;
     int          encoder_buffer;
     int          lfe;
+    int          arch;
+#ifndef DISABLE_FLOAT_API
+    TonalityAnalysisState analysis;
+#endif
 
 #define OPUS_ENCODER_RESET_START stream_channels
     int          stream_channels;
@@ -100,12 +104,9 @@
     StereoWidthState width_mem;
     opus_val16   delay_buffer[MAX_ENCODER_BUFFER*2];
 #ifndef DISABLE_FLOAT_API
-    TonalityAnalysisState analysis;
     int          detected_bandwidth;
-    int          analysis_offset;
 #endif
     opus_uint32  rangeFinal;
-    int          arch;
 };
 
 /* Transition tables for the voice and music. First column is the
@@ -243,6 +244,10 @@
     st->mode = MODE_HYBRID;
     st->bandwidth = OPUS_BANDWIDTH_FULLBAND;
 
+#ifndef DISABLE_FLOAT_API
+    tonality_analysis_init(&st->analysis);
+#endif
+
     return OPUS_OK;
 }
 
@@ -1006,7 +1011,7 @@
        analysis_read_subframe_bak = st->analysis.read_subframe;
        run_analysis(&st->analysis, celt_mode, analysis_pcm, analysis_size, 
frame_size,
              c1, c2, analysis_channels, st->Fs,
-             lsb_depth, downmix, &analysis_info, st->arch);
+             lsb_depth, downmix, &analysis_info);
     }
 #else
     (void)analysis_pcm;
@@ -2449,11 +2454,14 @@
         {
            void *silk_enc;
            silk_EncControlStruct dummy;
+           char *start;
            silk_enc = (char*)st+st->silk_enc_offset;
+#ifndef DISABLE_FLOAT_API
+           tonality_analysis_reset(&st->analysis);
+#endif
 
-           OPUS_CLEAR((char*)&st->OPUS_ENCODER_RESET_START,
-                 sizeof(OpusEncoder)-
-                 ((char*)&st->OPUS_ENCODER_RESET_START - (char*)st));
+           start = (char*)&st->OPUS_ENCODER_RESET_START;
+           OPUS_CLEAR(start, sizeof(OpusEncoder) - (start - (char*)st));
 
            celt_encoder_ctl(celt_enc, OPUS_RESET_STATE);
            silk_InitEncoder( silk_enc, st->arch, &dummy );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/opus-1.1.1/version.mk new/opus-1.1.2/version.mk
--- old/opus-1.1.1/version.mk   2015-11-25 03:06:45.000000000 +0100
+++ new/opus-1.1.2/version.mk   2016-01-12 19:14:41.000000000 +0100
@@ -1,2 +1,2 @@
 # static version string; update manually every release.
-PACKAGE_VERSION = "1.1.1"
+PACKAGE_VERSION = "1.1.2"


Reply via email to