Moves align() to a single header

This commit is contained in:
Jean-Marc Valin 2011-08-22 10:40:38 -04:00
parent 2b98bdf532
commit 6696a1443b
5 changed files with 47 additions and 16 deletions

View file

@ -1,2 +1,3 @@
OPUS_HEAD = \
src/opus.h
src/opus.h \
src/opus_private.h

View file

@ -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

View file

@ -40,6 +40,8 @@
#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
@ -70,12 +72,6 @@ static inline opus_int16 SAT16(opus_int32 x) {
};
#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)
{

View file

@ -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 @@ static const int audio_bandwidth_thresholds[10] = {
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)
{

39
src/opus_private.h Normal file
View file

@ -0,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_ */