shithub: opus

Download patch

ref: 6696a1443bd6da8c8fbe26ddc5e12baa7eb2b75c
parent: 2b98bdf53253b6b85fffe7f1bfa9141ae9b09e61
author: Jean-Marc Valin <[email protected]>
date: Mon Aug 22 06:40:38 EDT 2011

Moves align() to a single header

--- a/opus_headers.txt
+++ b/opus_headers.txt
@@ -1,2 +1,3 @@
 OPUS_HEAD = \
-src/opus.h
+src/opus.h \
+src/opus_private.h
--- a/src/opus.h
+++ b/src/opus.h
@@ -1,5 +1,5 @@
-/* Copyright (c) 2010 Xiph.Org Foundation
-   Written by Jean-Marc Valin */
+/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited
+   Written by Jean-Marc Valin and Koen Vos */
 /*
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
--- a/src/opus_decoder.c
+++ b/src/opus_decoder.c
@@ -40,7 +40,9 @@
 #include "silk_API.h"
 #include "stack_alloc.h"
 #include "float_cast.h"
+#include "opus_private.h"
 
+
 #ifdef FIXED_POINT
 #define celt_decode_native celt_decode
 #else
@@ -70,12 +72,6 @@
 };
 #endif
 
-/* Make sure everything's aligned to 4 bytes (this may need to be increased
-   on really weird architectures) */
-static inline int align(int i)
-{
-	return (i+3)&-4;
-}
 
 int opus_decoder_get_size(int channels)
 {
--- a/src/opus_encoder.c
+++ b/src/opus_encoder.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 Xiph.Org Foundation, Skype Limited
+/* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited
    Written by Jean-Marc Valin and Koen Vos */
 /*
    Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,7 @@
 #include "float_cast.h"
 #include "opus.h"
 #include "arch.h"
+#include "opus_private.h"
 
 #ifdef FIXED_POINT
 #define celt_encode_native celt_encode
@@ -96,12 +97,6 @@
 		33000, 2000, /* SWB<->FB */
 };
 
-/* Make sure everything's aligned to 4 bytes (this may need to be increased
-   on really weird architectures) */
-static inline int align(int i)
-{
-    return (i+3)&-4;
-}
 
 int opus_encoder_get_size(int channels)
 {
--- /dev/null
+++ b/src/opus_private.h
@@ -1,0 +1,39 @@
+/* Copyright (c) 2011 Xiph.Org Foundation
+   Written by Jean-Marc Valin */
+/*
+   Redistribution and use in source and binary forms, with or without
+   modification, are permitted provided that the following conditions
+   are met:
+
+   - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+   - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the distribution.
+
+   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
+   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+
+#ifndef OPUS_PRIVATE_H
+#define OPUS_PRIVATE_H
+
+/* Make sure everything's aligned to 4 bytes (this may need to be increased
+   on really weird architectures) */
+static inline int align(int i)
+{
+    return (i+3)&-4;
+}
+
+#endif /* OPUS_PRIVATE_H_ */