/* * Copyright (C) 2003 - 2016 Sony Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef _LDAC_H #define _LDAC_H #include "ldaclib.h" #include "struct_ldac.h" /*************************************************************************************************** Macro Definitions ***************************************************************************************************/ /* Configuration */ #define LDAC_SYNCWORDBITS 8 #define LDAC_SYNCWORD 0xAA /** Sampling Rate **/ #define LDAC_SMPLRATEBITS 3 #define LDAC_NSMPLRATEID 6 #define LDAC_NSUPSMPLRATEID 4 #define LDAC_SMPLRATEID_0 0x0 #define LDAC_SMPLRATEID_1 0x1 #define LDAC_SMPLRATEID_2 0x2 #define LDAC_SMPLRATEID_3 0x3 /** Channel **/ #define LDAC_CHCONFIG1BITS 3 #define LDAC_CHCONFIG2BITS 2 #define LDAC_NCHCONFIGID 8 #define LDAC_MAXNCH 2 #define LDAC_CHANNEL_1CH 1 #define LDAC_CHANNEL_2CH 2 #define LDAC_CHCONFIGID_MN 0 #define LDAC_CHCONFIGID_DL 1 #define LDAC_CHCONFIGID_ST 2 /** Frame Length **/ #define LDAC_FRAMELEN1BITS 11 #define LDAC_FRAMELEN2BITS 9 #define LDAC_MAXNBYTES 1024 #define LDAC_MAXSUPNBYTES 512 #define LDAC_MINSUPNBYTES 22 /** Frame Status **/ #define LDAC_FRAMESTATBITS 2 #define LDAC_FRMSTAT_LEV_0 0 #define LDAC_FRMSTAT_LEV_1 1 #define LDAC_FRMSTAT_LEV_2 2 #define LDAC_FRMSTAT_LEV_3 3 /** Other **/ #define LDAC_RESERVE1BITS 2 #define LDAC_RESERVE2BITS 5 #define LDAC_DUMMYCODE 0x00 /* Signal Processing */ #define LDAC_NFRAME 2 #define LDAC_NSFTSTEP 5 /** Frame Samples (log base 2 of) **/ #define LDAC_NUMLNN 2 #define LDAC_MAXLNN 8 #define LDAC_2FSLNN 8 #define LDAC_1FSLNN 7 /** Frame Samples **/ #define LDAC_MAXLSU (1<(b)) ? (a) : (b)) /* Get Huffman Codeword Property */ #define hc_len_ldac(p) ((p)->len) #define hc_word_ldac(p) ((p)->word) /* Convert a Signed Number with nbits to a Signed Integer */ #define bs_to_int_ldac(bs, nbits) (((bs)&(0x1<<((nbits)-1))) ? ((bs)|((~0x0)<<(nbits))) : bs) #ifdef _32BIT_FIXED_POINT #include "fixp_ldac.h" #endif /* _32BIT_FIXED_POINT */ #include "proto_ldac.h" #endif /* _LDAC_H */