/************************************************************************ * Copyright (C) 2002-2009, Xiph.org Foundation * Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd * All rights reserved. * * 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. * * Neither the names of the Xiph.org Foundation nor Pinknoise * Productions Ltd nor the names of its contributors may be used to * endorse or promote products derived from this software without * specific prior written permission. * * 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 COPYRIGHT * OWNER 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. ************************************************************************ function: libvorbis codec headers ************************************************************************/ #ifndef _V_CODECI_H_ #define _V_CODECI_H_ #define CHUNKSIZE 1024 #include "codebook.h" #include "ivorbiscodec.h" #define VI_TRANSFORMB 1 #define VI_WINDOWB 1 #define VI_TIMEB 1 #define VI_FLOORB 2 #define VI_RESB 3 #define VI_MAPB 1 typedef void vorbis_info_floor; /* vorbis_dsp_state buffers the current vorbis audio analysis/synthesis state. The DSP state belongs to a specific logical bitstream ****************************************************/ struct vorbis_dsp_state{ vorbis_info *vi; oggpack_buffer opb; ogg_int32_t **work; ogg_int32_t **mdctright; int out_begin; int out_end; long lW; long W; ogg_int64_t granulepos; ogg_int64_t sequence; ogg_int64_t sample_count; }; /* Floor backend generic *****************************************/ extern vorbis_info_floor *floor0_info_unpack(vorbis_info *,oggpack_buffer *); extern void floor0_free_info(vorbis_info_floor *); extern int floor0_memosize(vorbis_info_floor *); extern ogg_int32_t *floor0_inverse1(struct vorbis_dsp_state *, vorbis_info_floor *,ogg_int32_t *); extern int floor0_inverse2 (struct vorbis_dsp_state *,vorbis_info_floor *, ogg_int32_t *buffer,ogg_int32_t *); extern vorbis_info_floor *floor1_info_unpack(vorbis_info *,oggpack_buffer *); extern void floor1_free_info(vorbis_info_floor *); extern int floor1_memosize(vorbis_info_floor *); extern ogg_int32_t *floor1_inverse1(struct vorbis_dsp_state *, vorbis_info_floor *,ogg_int32_t *); extern int floor1_inverse2 (struct vorbis_dsp_state *,vorbis_info_floor *, ogg_int32_t *buffer,ogg_int32_t *); typedef struct{ int order; long rate; long barkmap; int ampbits; int ampdB; int numbooks; /* <= 16 */ char books[16]; } vorbis_info_floor0; typedef struct{ char class_dim; /* 1 to 8 */ char class_subs; /* 0,1,2,3 (bits: 1<