mirror of
https://codeberg.org/ashley/poke.git
synced 2025-06-17 19:17:01 -04:00
add alac source code - part 4 :3
This commit is contained in:
parent
14eaf2c537
commit
0337286d4b
3 changed files with 813 additions and 0 deletions
81
alac/codec/aglib.h
Normal file
81
alac/codec/aglib.h
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* Copyright (c) 2011 Apple Inc. All rights reserved.
|
||||
*
|
||||
* @APPLE_APACHE_LICENSE_HEADER_START@
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* @APPLE_APACHE_LICENSE_HEADER_END@
|
||||
*/
|
||||
|
||||
/*
|
||||
File: aglib.h
|
||||
|
||||
Copyright: (C) 2001-2011 Apple, Inc.
|
||||
*/
|
||||
|
||||
#ifndef AGLIB_H
|
||||
#define AGLIB_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define QBSHIFT 9
|
||||
#define QB (1<<QBSHIFT)
|
||||
#define PB0 40
|
||||
#define MB0 10
|
||||
#define KB0 14
|
||||
#define MAX_RUN_DEFAULT 255
|
||||
|
||||
#define MMULSHIFT 2
|
||||
#define MDENSHIFT (QBSHIFT - MMULSHIFT - 1)
|
||||
#define MOFF ((1<<(MDENSHIFT-2)))
|
||||
|
||||
#define BITOFF 24
|
||||
|
||||
/* Max. prefix of 1's. */
|
||||
#define MAX_PREFIX_16 9
|
||||
#define MAX_PREFIX_TOLONG_16 15
|
||||
#define MAX_PREFIX_32 9
|
||||
|
||||
/* Max. bits in 16-bit data type */
|
||||
#define MAX_DATATYPE_BITS_16 16
|
||||
|
||||
typedef struct AGParamRec
|
||||
{
|
||||
uint32_t mb, mb0, pb, kb, wb, qb;
|
||||
uint32_t fw, sw;
|
||||
|
||||
uint32_t maxrun;
|
||||
|
||||
// fw = 1, sw = 1;
|
||||
|
||||
} AGParamRec, *AGParamRecPtr;
|
||||
|
||||
struct BitBuffer;
|
||||
|
||||
void set_standard_ag_params(AGParamRecPtr params, uint32_t fullwidth, uint32_t sectorwidth);
|
||||
void set_ag_params(AGParamRecPtr params, uint32_t m, uint32_t p, uint32_t k, uint32_t f, uint32_t s, uint32_t maxrun);
|
||||
|
||||
int32_t dyn_comp(AGParamRecPtr params, int32_t * pc, struct BitBuffer * bitstream, int32_t numSamples, int32_t bitSize, uint32_t * outNumBits);
|
||||
int32_t dyn_decomp(AGParamRecPtr params, struct BitBuffer * bitstream, int32_t * pc, int32_t numSamples, int32_t maxSize, uint32_t * outNumBits);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //#ifndef AGLIB_H
|
Loading…
Add table
Add a link
Reference in a new issue