Commit 7ead0021 authored by Giuseppe Pagano's avatar Giuseppe Pagano
Browse files

First import.

parent 82b35403
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
include $(BUILD_MULTI_PREBUILT)
MAJOR_VERSION := $(shell echo $(PLATFORM_VERSION) | cut -d "." -f1)
ANDROID_VERSION_GE_O := $(shell if [ $(MAJOR_VERSION) -ge 8 ];then echo "true";fi)
ifeq ($(ANDROID_VERSION_GE_O), true)
FSL_CODEC_OUT_PATH := $(TARGET_OUT_VENDOR)
else
FSL_CODEC_OUT_PATH := $(TARGET_OUT)
endif
include $(CLEAR_VARS)
LOCAL_MODULE := lib_nb_amr_dec_v2_arm9_elinux
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
ifeq ($(ANDROID_VERSION_GE_O), true)
LOCAL_VENDOR_MODULE := true
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := both
LOCAL_MODULE_PATH_64 := $(FSL_CODEC_OUT_PATH)/lib64/
LOCAL_SRC_FILES_64 := ./lib64/lib_nb_amr_dec_arm_android.so
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := ./lib/lib_nb_amr_dec_v2_arm9_elinux.so
else
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/lib_nb_amr_dec_v2_arm9_elinux.so
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_POST_INSTALL_CMD := cd $(FSL_CODEC_OUT_PATH); \
ln -sf ./lib_nb_amr_dec_v2_arm9_elinux.so lib/lib_nb_amr_dec.so; \
ln -sf ./lib_nb_amr_dec_v2_arm9_elinux.so lib64/lib_nb_amr_dec.so; \
ln -sf ./lib_aac_dec_v2_arm12_elinux.so lib/lib_aac_dec.so; \
ln -sf ./lib_aac_dec_v2_arm12_elinux.so lib64/lib_aac_dec.so; \
ln -sf ./lib_mp3_dec_v2_arm12_elinux.so lib/lib_mp3_dec.so; \
ln -sf ./lib_mp3_dec_v2_arm12_elinux.so lib64/lib_mp3_dec.so; \
ln -sf ./lib_oggvorbis_dec_v2_arm11_elinux.so lib/lib_oggvorbis_dec.so; \
ln -sf ./lib_oggvorbis_dec_v2_arm11_elinux.so lib64/lib_oggvorbis_dec.so;
else
LOCAL_POST_INSTALL_CMD := cd $(FSL_CODEC_OUT_PATH); \
ln -sf ./lib_nb_amr_dec_v2_arm9_elinux.so lib/lib_nb_amr_dec.so; \
ln -sf ./lib_aac_dec_v2_arm12_elinux lib/lib_aac_dec.so; \
ln -sf ./lib_mp3_dec_v2_arm12_elinux.so lib/lib_mp3_dec.so; \
ln -sf ./lib_oggvorbis_dec_v2_arm11_elinux.so lib/lib_oggvorbis_dec.so;
endif
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lib_wb_amr_dec_arm9_elinux
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
ifeq ($(ANDROID_VERSION_GE_O), true)
LOCAL_VENDOR_MODULE := true
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := both
LOCAL_MODULE_PATH_64 := $(FSL_CODEC_OUT_PATH)/lib64/
LOCAL_SRC_FILES_64 := lib64/lib_wb_amr_dec_arm_android.so
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := lib/lib_wb_amr_dec_arm9_elinux.so
LOCAL_POST_INSTALL_CMD := cd $(FSL_CODEC_OUT_PATH); \
ln -sf ./lib_wb_amr_dec_arm9_elinux.so lib/lib_wb_amr_dec.so; \
ln -sf ./lib_wb_amr_dec_arm9_elinux.so lib64/lib_wb_amr_dec.so;
else
LOCAL_POST_INSTALL_CMD := cd $(FSL_CODEC_OUT_PATH); \
ln -sf ./lib_wb_amr_dec_arm9_elinux.so lib/lib_wb_amr_dec.so;
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/lib_wb_amr_dec_arm9_elinux.so
endif
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lib_flac_dec_v2_arm11_elinux
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
ifeq ($(ANDROID_VERSION_GE_O), true)
LOCAL_VENDOR_MODULE := true
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := both
LOCAL_MODULE_PATH_64 := $(FSL_CODEC_OUT_PATH)/lib64/
LOCAL_SRC_FILES_64 := lib64/lib_flac_dec_arm_android.so
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := lib/lib_flac_dec_v2_arm11_elinux.so
LOCAL_POST_INSTALL_CMD := cd $(FSL_CODEC_OUT_PATH); \
ln -sf ./lib_flac_dec_v2_arm11_elinux.so lib/lib_flac_dec.so; \
ln -sf ./lib_flac_dec_v2_arm11_elinux.so lib64/lib_flac_dec.so;
else
LOCAL_POST_INSTALL_CMD := cd $(FSL_CODEC_OUT_PATH); \
ln -sf ./lib_flac_dec_v2_arm11_elinux.so lib/lib_flac_dec.so;
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/lib_flac_dec_v2_arm11_elinux.so
endif
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lib_H263_dec_v2_arm11_elinux
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
ifeq ($(ANDROID_VERSION_GE_O), true)
LOCAL_VENDOR_MODULE := true
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := 32
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := lib/lib_H263_dec_v2_arm11_elinux.so
else
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/lib_H263_dec_v2_arm11_elinux.so
endif
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lib_peq_v2_arm11_elinux
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
ifeq ($(ANDROID_VERSION_GE_O), true)
LOCAL_VENDOR_MODULE := true
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := 32
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := lib/lib_peq_v2_arm11_elinux.so
else
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/lib_peq_v2_arm11_elinux.so
endif
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := lib_mp3_parser_v2_arm11_elinux
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
ifeq ($(ANDROID_VERSION_GE_O), true)
LOCAL_VENDOR_MODULE := true
endif
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := both
LOCAL_MODULE_PATH_64 := $(FSL_CODEC_OUT_PATH)/lib64/
LOCAL_SRC_FILES_64 := lib64/lib_mp3_parser_v2_arm11_elinux.so
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := lib/lib_mp3_parser_v2_arm11_elinux.so
else
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/lib_mp3_parser_v2_arm11_elinux.so
endif
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
LOCAL_MODULE := libvpu-malone
LOCAL_MODULE_SUFFIX := .so
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_VENDOR_MODULE := true
ifeq ($(TARGET_ARCH),arm64)
LOCAL_MULTILIB := both
LOCAL_MODULE_PATH_64 := $(FSL_CODEC_OUT_PATH)/lib64/
LOCAL_SRC_FILES_64 := lib64/libvpu-malone.so
LOCAL_MODULE_PATH_32 := $(FSL_CODEC_OUT_PATH)/lib/
LOCAL_SRC_FILES_32 := lib/libvpu-malone.so
else
LOCAL_MODULE_PATH := $(FSL_CODEC_OUT_PATH)/lib
LOCAL_SRC_FILES := lib/libvpu-malone.so
endif
include $(BUILD_PREBUILT)
MAJOR_VERSION := $(shell echo $(PLATFORM_VERSION) | cut -d "." -f1)
ANDROID_VERSION_GE_O := $(shell if [ $(MAJOR_VERSION) -ge 8 ];then echo "true";fi)
ifeq ($(ANDROID_VERSION_GE_O), true)
FSL_CODEC_OUT_PATH := vendor/lib
else
FSL_CODEC_OUT_PATH := system/lib
endif
ifeq ($(FSL_CODEC_PATH),)
FSL_CODEC_PATH := device
endif
FSL_PARSER_OUT_PATH := system/lib
PRODUCT_COPY_FILES += \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_avi_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_avi_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_aac_dec_v2_arm12_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_aac_dec_v2_arm12_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_aacd_wrap_arm12_elinux_android.so:$(FSL_CODEC_OUT_PATH)/lib_aacd_wrap_arm12_elinux_android.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mp3_dec_v2_arm12_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_mp3_dec_v2_arm12_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mp3d_wrap_arm12_elinux_android.so:$(FSL_CODEC_OUT_PATH)/lib_mp3d_wrap_arm12_elinux_android.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_oggvorbis_dec_v2_arm11_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_oggvorbis_dec_v2_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_vorbisd_wrap_arm11_elinux_android.so:$(FSL_CODEC_OUT_PATH)/lib_vorbisd_wrap_arm11_elinux_android.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_flv_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_flv_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mkv_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_mkv_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mp4_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_mp4_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mpg2_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_mpg2_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_ogg_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_ogg_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_amr_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_amr_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_aac_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_aac_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mp3_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_mp3_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_wav_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_wav_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_flac_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_flac_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_ape_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_ape_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_dsf_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)/lib_dsf_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_nb_amr_enc_v2_arm11_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_nb_amr_enc_v2_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_wb_amr_enc_arm11_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_wb_amr_enc_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mp4_muxer_arm11_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_mp4_muxer_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_flac_parser_arm11_elinux.so:$(FSL_PARSER_OUT_PATH)/lib_flac_parser_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_aac_parser_arm11_elinux.so:$(FSL_PARSER_OUT_PATH)/lib_aac_parser_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_wav_parser_arm11_elinux.so:$(FSL_PARSER_OUT_PATH)/lib_wav_parser_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib/lib_mp3_enc_v2_arm12_elinux.so:$(FSL_CODEC_OUT_PATH)/lib_mp3_enc_v2_arm12_elinux.so
ifeq ($(TARGET_ARCH),arm64)
PRODUCT_COPY_FILES += \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_avi_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_avi_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_aac_dec_arm_android.so:$(FSL_CODEC_OUT_PATH)64/lib_aac_dec_v2_arm12_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_aacd_wrap_arm_android.so:$(FSL_CODEC_OUT_PATH)64/lib_aacd_wrap_arm_android.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_mp3_dec_arm_android.so:$(FSL_CODEC_OUT_PATH)64/lib_mp3_dec_v2_arm12_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_mp3d_wrap_arm_android.so:$(FSL_CODEC_OUT_PATH)64/lib_mp3d_wrap_arm12_elinux_android.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_oggvorbis_dec_arm_android.so:$(FSL_CODEC_OUT_PATH)64/lib_oggvorbis_dec_v2_arm11_elinux.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_vorbisd_wrap_arm_android.so:$(FSL_CODEC_OUT_PATH)64/lib_vorbisd_wrap_arm11_elinux_android.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_flv_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_flv_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_mkv_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_mkv_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_mp4_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_mp4_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_mpg2_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_mpg2_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_ogg_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_ogg_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_amr_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_amr_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_aac_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_aac_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_mp3_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_mp3_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_wav_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_wav_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_dsf_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_dsf_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_flac_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_flac_parser_arm11_elinux.3.0.so \
$(FSL_CODEC_PATH)/fsl-codec/lib64/lib_ape_parser_arm11_elinux.3.0.so:$(FSL_PARSER_OUT_PATH)64/lib_ape_parser_arm11_elinux.3.0.so
endif
/**
* Copyright (c) 2010-2012, Freescale Semiconductors, Inc.
* All Rights Reserved.
*
* The following programs are the sole property of Freescale Semiconductors Inc.,
* and contain its proprietary and confidential information.
*
*/
/**
* @file AacCoreParser.h
* @brief AAC core parser.
* @ingroup AacCoreParser
*/
#ifndef AacCoreParser_h
#define AacCoreParser_h
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#include "AudioCoreParser.h"
//#include "aacd_dec_interface.h"
typedef enum {
FILETYPEADTS,
FILETYPEADIF,
FILETYPERAW
}AAC_FILETYPE;
typedef enum {
AAC_PARSERRETURNSUCESS,
AAC_PARSERRETURNFAIL
}AAC_PARSERRETURNTYPE;
enum {
FLAG_SUCCESS,
FLAG_NEEDMORE_DATA
};
enum
{
LN = 2048,
LN2 = LN / 2,
LEN_ELE_IS_CPE = 1,
LEN_PROFILE = 2,
LEN_SAMP_IDX = 4,
LEN_NUM_ELE = 4,
LEN_NUM_LFE = 2,
LEN_NUM_DAT = 3,
LEN_NUM_CCE = 4,
LEN_MIX_PRES = 1,
LEN_MMIX_IDX = 2,
LEN_PSUR_ENAB = 1,
LEN_COMMENT_BYTES = 8,
/*
* audio data transport stream frame format header
*/
/* fixed header */
LEN_SYNCWORD = 12,
LEN_ID = 1,
LEN_LAYER = 2,
LEN_PROTECT_ABS = 1,
LEN_PRIVTE_BIT = 1,
LEN_CHANNEL_CONF = 3,
/* variable header */
LEN_COPYRT_START = 1,
LEN_FRAME_LEN = 13,
LEN_ADTS_BUF_FULLNESS = 11,
LEN_NUM_OF_RDB =2,
/* CRC */
LEN_CRC = 16,
/* Some encoders (PsyTEL) put an addtional field 'Emphasis'
in MPEG-4 ADTS streams, though it a violation of the
standard.
But defining OLD_FORMAT_ADTS_HEADER will correctly decode
such streams.
*/
#ifdef OLD_FORMAT_ADTS_HEADER
LEN_EMPHASIS = 2,
#endif
/* audio data interchange format header */
LEN_ADIF_ID = (32 / 8),
LEN_COPYRT_ID = (72 / 8),
LEN_COPYRT_ID_ADTS = 1,
LEN_COPYRT_PRES = 1,
LEN_ORIG = 1,
LEN_HOME = 1,
LEN_BS_TYPE = 1,
LEN_BIT_RATE = 23,
LEN_NUM_PCE = 4,
LEN_ADIF_BF = 20,
LEN_TAG = 4,
LEN_BYTE = 8
};
enum
{
/*
* channels for 5.1 main profile configuration
* (modify for any desired decoder configuration)
*/
FCHANS = 3, /* front channels: left, center, right */
FCenter = 1, /* 1 if decoder has front center channel */
SCHANS = 0, /* side channels: */
BCHANS = 2, /* back channels: left surround, right surround */
BCenter = 0, /* 1 if decoder has back center channel */
LCHANS = 1, /* LFE channels */
XCHANS = 0, /* scratch space for parsing unused channels */
CHANS = FCHANS + SCHANS + BCHANS + LCHANS + XCHANS
};
#ifndef AACD_UINT32
typedef unsigned int AACD_UINT32;
#endif
#ifndef AACD_INT32
typedef int AACD_INT32;
#endif
#ifndef AACD_UINT16
typedef unsigned short AACD_UINT16;
#endif
#ifndef AACD_INT16
typedef short AACD_INT16;
#endif
#ifndef AACD_UCHAR
typedef unsigned char AACD_UCHAR;
#endif
#ifndef AACD_UINT8
typedef unsigned char AACD_UINT8;
#endif
#ifndef AACD_INT8
typedef char AACD_INT8;
#endif
#define AAC_FRAME_SIZE 1024
#define AACD_LEN_TAG 4
#define BIT_COUNTER_INIT (24)
#define MIN_REQD_BITS (24)
#define ADTS_FRAME_MAX_SIZE (8192)
#define ADTS_FRAME_HEADER_SIZE (7)
/* #define is required in order to use these args in #if () directive */
#define ICCHANS 0 /* independently switched coupling channels */
#define DCCHANS 0 /* dependently switched coupling channels */
#define XCCHANS 0 /* scratch space index for parsing unused coupling
* channels */
#define CCHANS (ICCHANS + DCCHANS + XCCHANS)
typedef struct
{
char adif_id[LEN_ADIF_ID + 1];
int copy_id_present;
char copy_id[LEN_COPYRT_ID + 1];
int original_copy;
int home;
int bitstream_type;
int bitrate;
int num_pce;
int prog_tags[(1 << LEN_TAG)];
} ADIF_Header;
typedef struct
{
int syncword;
int id;
int layer;
int protection_abs;
int profile;
int sampling_freq_idx;
int private_bit;
int channel_config;
int original_copy;
int home;
int copyright_id_bit;
int copyright_id_start;
int frame_length;
int adts_buffer_fullness;
int num_of_rdb;
int crc_check;
} ADTS_Header;
typedef struct
{
AACD_INT32 num_ele;
AACD_INT32 ele_is_cpe[(1 << AACD_LEN_TAG)];
AACD_INT32 ele_tag[(1 << AACD_LEN_TAG)];
} AACD_EleList;
typedef struct
{
AACD_INT32 present;
AACD_INT32 ele_tag;
AACD_INT32 pseudo_enab;
} AACD_MIXdown;
typedef struct
{
AACD_INT32 profile;
AACD_INT32 sampling_rate_idx;
AACD_EleList front;
AACD_EleList side;
AACD_EleList back;
AACD_EleList lfe;
AACD_EleList data;
AACD_EleList coupling;
AACD_MIXdown mono_mix;
AACD_MIXdown stereo_mix;
AACD_MIXdown matrix_mix;
/* Ignore the comment field to minimize memory usage */
AACD_INT8 comments[1];
AACD_INT32 buffer_fullness; /* put this transport level info here */
/* Added the following the 'tag' field, to process ProgConfigElements outside
of the header-parsing routines */
AACD_INT32 tag;
} AACD_ProgConfig;
typedef struct
{
AACD_INT32 num_pce;
AACD_ProgConfig *pce;
AACD_INT32 ChannelConfig;
AACD_INT32 SamplingFreqIndex;
AACD_INT32 BitstreamType;
AACD_INT32 BitRate;
AACD_INT32 BufferFullness; /*No. of bits in encoder buffer after encoding first raw_data_block */
AACD_INT32 ProtectionAbsent;
AACD_INT32 CrcCheck;
AACD_INT32 frame_length;
AACD_INT32 scalOutObjectType;
AACD_INT32 scalOutNumChannels;
AACD_INT32 sampleRate;
AACD_INT32 framelengthflag;
AACD_INT32 iMulti_Channel_Support;
AACD_INT32 bsacDecLayer;
/* Please see FileHeader at the top for explanation */
#ifdef OLD_FORMAT_ADTS_HEADER
AACD_INT32 Flush_LEN_EMPHASIS_Bits;
#endif
} AACD_Block_Params;
AAC_FILETYPE Aac_FindFileType(uint8 *pBuffer, int32 nBufferLen);
FRAME_INFO ParserADTS(AACD_Block_Params *params, uint8 *pBuffer, uint32 nBufferLen, FRAME_INFO *in_info);
FRAME_INFO ParserADIF(AACD_Block_Params *params, uint8 *pBuffer, int32 nBufferLen);
AAC_PARSERRETURNTYPE AacDec_InitRaw(AACD_Block_Params *params, int32 nChannels, int32 nSamplingFreq);
AUDIO_PARSERRETURNTYPE AacParserFileHeader(AUDIO_FILE_INFO *pFileInfo, uint8 *pBuffer, \
uint32 nBufferLen);
AUDIO_PARSERRETURNTYPE AacParserFrame(AUDIO_FRAME_INFO *pFrameInfo, uint8 *pBuffer, \
uint32 nBufferLen);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif
/* File EOF */
/*******************************************************************************
* (C) 2004 MOTOROLA INDIA ELECTRONICS LTD.
************************************************************************
* Copyright (C) 2005-2010, 2014 Freescale Semiconductor, Inc.
* All modifications are confidential and proprietary information
* of Freescale Semiconductor, Inc.
************************************************************************
* CHANGE HISTORY
* dd/mm/yy Code Ver Description Author
* -------- ------- ----------- ------
* 08/04/2003 01 Created B.Venkatarao
* 19/02/2004 02 Added global structure for Vishala
* relocatability
* 12/07/2004 03 Added prototypes for swap
* buffer function and removed
* global structure and moved it
* to other file Vishala
*
* 19/08/2004 04 Defined struct AACD_Block_Params, S.Nachiappan
* which is to be passed to the
* decoder, along with the block to
* be decoded. This struct has
* parameters similar to ADIF/ADTS
* header data.
*
* aacd_decode_frame() additionally
* receives:
* (1) a pointer to the buffer
* containing the block to be
* decoded
* (2) Length of the buffer
* (3) Pointer to AACD_Block_Params
*
* For MPEG-4 vectors, some encoders, put
* in an 'emphasis' field in the ADTS Header
* and don't perform a byte-alignment
* after the header ends. So header is 58-bits
* long instead of 56-bits. To handle
* this situation, the decoder has to
* flush LEN_EMPHASIS no.of bits from the
* first-byte of the input-buffer.
* to start off correctly.
*
* 23/08/2004 04 Moved BitCreditType to here S.Nachiappan
* from aac_common.h
*
*
* 23/07/2004 04 Modified the prototype for
* aacd_decode_frame for 24 bit
* output Pradeep V
*
* 03/09/2004 06 Removed BitCreditType typedef S.Nachiappan
* 09/09/2004 07 App will write pointer to S.Nachiappan
* AACD_Block_Params data into
* AACD_Decoder_config
*
* Moved structs ProgConfig, EleList
* and MIXdown from aac_fix_types.h to
* here
* 09/09/2004 08 Added enum for pcm length and
* memory type Pradeep V
*
* 15/09/2004 09 Modified proto-type of S.Nachiappan
* (*app_swap_buf)()
*
* 16/09/2004 10 Added new error code S.Nachiappan
* AACD_ERROR_PNS
*
* 16/09/2004 11 Added more error codes S.Nachiappan
* 25/04/2008 12 Add error concealment feature Bing Song
* 13/02/2009 13 support aacplus envoke aac lib Lyon Wang
*
******************************************************************************/
#ifndef _AACD_DEC_INTERFACE_H
#define _AACD_DEC_INTERFACE_H
#ifdef UNDER_CE
#ifndef EXPORT_C
#define EXPORT_C __declspec(dllexport)
#endif
#ifndef IMPORT_C
#define IMPORT_C __declspec(dllimport)
#endif
#else
#ifndef EXPORT_C
#define EXPORT_C
#endif
#ifndef IMPORT_C
#define IMPORT_C
#endif
#endif
#define AACD_TRUE 1
#define AACD_FALSE 0
#define AAC_FRAME_SIZE 1024
#define AACD_GLOBAL_STRUCT_SIZE 100000
#define AACD_FAST_MEMORY 0
#define AACD_SLOW_MEMORY 1
#define AACD_MAX_NUM_MEM_REQS 5+1+1+1 //5 note this should modified in case aac lib was used for aac+
#define AACD_DATA_SIZE 0
#define AACD_DATA_ALIGN_IN_BYTES 16
#define AACD_DATA_BEGIN 0 /* some known symbol */
#define AACD_MEM_TYPE AACD_FAST_MEMORY /* can be changed */