Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64b3fe55 authored by Jean-Baptiste Queru's avatar Jean-Baptiste Queru Committed by android code review
Browse files

Merge "stagefright amrnb: Remove unused leftover source files"

parents c1d2777c 223933e8
Loading
Loading
Loading
Loading
+0 −63
Original line number Diff line number Diff line
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * 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.
 * -------------------------------------------------------------------
 */
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:

    3GPP TS 26.073
    ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
    Available from http://www.3gpp.org

(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
Permission to distribute, modify and use this file under the standard license
terms listed above has been obtained from the copyright holder.
****************************************************************************************/
#ifndef __PVGSMAMR_H
#define __PVGSMAMR_H


// includes
#include <e32std.h>
#include <e32base.h>

#include "sp_dec.h"
#include "pvglobals.h"


// PVGsmDecoder AO
class CPVGsmDecoder : public CBase
{
    public:
        IMPORT_C static CPVGsmDecoder* NewL(void);
        IMPORT_C ~CPVGsmDecoder();
        IMPORT_C TInt StartL(void);

        // only port the API's used in PVPlayer 2.0
        IMPORT_C TInt DecodeFrame(enum Mode mode, unsigned char* compressedBlock, unsigned char* audioBuffer);
        IMPORT_C TInt InitDecoder(void);
        IMPORT_C void ExitDecoder(void);

    private:
        CPVGsmDecoder();
        void ConstructL(void);

        Speech_Decode_FrameState* decState;
        enum RXFrameType rx_type;
        struct globalDataStruct *gds;
};

#endif
+0 −149
Original line number Diff line number Diff line
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * 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.
 * -------------------------------------------------------------------
 */
//////////////////////////////////////////////////////////////////////////////////
//                                                                              //
//  File: pvgsmamrdecoderinterface.h                                            //
//                                                                              //
//////////////////////////////////////////////////////////////////////////////////

#ifndef _PVGSMAMR_DECODER_INTERFACE_H
#define _PVGSMAMR_DECODER_INTERFACE_H

/*----------------------------------------------------------------------------
; STRUCTURES TYPEDEF'S
----------------------------------------------------------------------------*/
typedef struct
{
    int16_t prev_ft;
    int16_t prev_mode;
} RX_State;


typedef struct tPVAmrDecoderExternal
{
    /*
     * INPUT:
     * Pointer to the input buffer that contains the encoded bistream data.
     * The data is filled in such that the first bit transmitted is
     * the most-significant bit (MSB) of the first array element.
     * The buffer is accessed in a linear fashion for speed, and the number of
     * bytes consumed varies frame to frame. This is use for mime/ietf data
     */
    uint8_t  *pInputBuffer;

    /*
     * INPUT:
     * Pointer to the input buffer that contains the encoded stream data.
     * The data is filled such that the first bit transmitted is
     * in the  first int16_t element.
     * The buffer is accessed in a linear fashion for speed, and the number of
     * bytes consumed varies frame to frame.
     */
    int16_t  *pInputSampleBuffer;

    /*
     * INPUT: (but what is pointed to is an output)
     * Pointer to the output buffer to hold the 16-bit PCM audio samples.
     */
    int16_t  *pOutputBuffer;

    /*
     * INPUT:
     * Number of requested output audio channels. This relieves the calling
     * environment from having to perform stereo-to-mono or mono-to-stereo
     * conversions.
     */
    int32_t     desiredChannels;

    /*
         * INPUT:
         * Format type of the encoded bitstream.
         */
    bitstream_format     input_format;

    /*
     * OUTPUT:
     * The sampling rate decoded from the bitstream, in units of
     * samples/second. For this release of the library this value does
     * not change from frame to frame, but future versions will.
     */
    int32_t   samplingRate;

    /*
     * OUTPUT:
     * This value is the bitrate in units of bits/second. IT
     * is calculated using the number of bits consumed for the current frame,
     * and then multiplying by the sampling_rate, divided by points in a frame.
     * This value can changes frame to frame.
     */
    int32_t   bitRate;

    /*
     * OUTPUT:
     * The number of channels decoded from the bitstream. The output data
     * will have be the amount specified in the variable desiredChannels,
     * this output is informative only, and can be ignored.
     */
    int32_t     encodedChannels;

    /*
     * OUTPUT:
     * This value is the number of output PCM samples per channel.
     * It is  320.
     */
    int16_t     frameLength;

    /*
     * OUTPUT:
     * This value is the quality indicator. 1 (good)  0 (bad)
    */
    uint8_t     quality;


    /*
     * OUTPUT:
     *  GSM AMR NB and WB mode (i.e. bit-rate )
     */
    int16_t     mode;
    int16_t     mode_old;

    /*
     * OUTPUT:
     *  GSM AMR NB and WB frame type ( speech_good, speech_bad, sid, etc.)
     */
    int16_t     frame_type;

    int16_t reset_flag;
    int16_t reset_flag_old;

    /*
     * OUTPUT:
     *  Decoder  status
     */
    int32_t     status;

    /*
     * OUTPUT:
     *  Rx status state
     */
    RX_State  rx_state;

} tPVAmrDecoderExternal;

#endif
+1 −3
Original line number Diff line number Diff line
@@ -42,8 +42,7 @@ LOCAL_C_INCLUDES := \
        frameworks/av/media/libstagefright/include \
        $(LOCAL_PATH)/src \
        $(LOCAL_PATH)/include \
        $(LOCAL_PATH)/../common/include \
        $(LOCAL_PATH)/../common
        $(LOCAL_PATH)/../common/include

LOCAL_CFLAGS := \
        -DOSCL_UNUSED_ARG= -DOSCL_IMPORT_REF=
@@ -66,7 +65,6 @@ LOCAL_C_INCLUDES := \
        $(LOCAL_PATH)/src \
        $(LOCAL_PATH)/include \
        $(LOCAL_PATH)/../common/include \
        $(LOCAL_PATH)/../common

LOCAL_CFLAGS := -DOSCL_IMPORT_REF=

+0 −122
Original line number Diff line number Diff line
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * 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.
 * -------------------------------------------------------------------
 */
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:

    3GPP TS 26.073
    ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
    Available from http://www.3gpp.org

(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
Permission to distribute, modify and use this file under the standard license
terms listed above has been obtained from the copyright holder.
****************************************************************************************/
/*
 Name: pvamrnbdecoder_api.h

------------------------------------------------------------------------------
 REVISION HISTORY


 Who:                                       Date:
 Description:

------------------------------------------------------------------------------
 INCLUDE DESCRIPTION

 Main header file for the Packet Video AMR Narrow  Band  decoder library. The
 constants, structures, and functions defined within this file, along with
 a basic data types header file, is all that is needed to use and communicate
 with the library. The internal data structures within the library are
 purposely hidden.

------------------------------------------------------------------------------
 REFERENCES

------------------------------------------------------------------------------
*/

/*----------------------------------------------------------------------------
; CONTINUE ONLY IF NOT ALREADY DEFINED
----------------------------------------------------------------------------*/
#ifndef _PVAMRNBDECODER_API_H
#define _PVAMRNBDECODER_API_H

#include    "pvgsmamrdecoderinterface.h"


/*----------------------------------------------------------------------------
; INCLUDES
----------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C"
{
#endif

    /*----------------------------------------------------------------------------
    ; MACROS
    ; Define module specific macros here
    ----------------------------------------------------------------------------*/

    /*----------------------------------------------------------------------------
    ; DEFINES
    ; Include all pre-processor statements here.
    ----------------------------------------------------------------------------*/
#define MAX_NUM_FRAMES_PER_PACKET 20 /* Max number of frames per packet */

#define MAX_NUM_PACKED_INPUT_BYTES 32 /* Max number of packed input bytes */

#define L_FRAME      160

    /*----------------------------------------------------------------------------
    ; EXTERNAL VARIABLES REFERENCES
    ; Declare variables used in this module but defined elsewhere
    ----------------------------------------------------------------------------*/

    /*----------------------------------------------------------------------------
    ; SIMPLE TYPEDEF'S
    ----------------------------------------------------------------------------*/

    /*----------------------------------------------------------------------------
    ; ENUMERATED TYPEDEF'S
    ----------------------------------------------------------------------------*/

    /*----------------------------------------------------------------------------
    ; STRUCTURES TYPEDEF'S
    ----------------------------------------------------------------------------*/


    /*----------------------------------------------------------------------------
    ; GLOBAL FUNCTION DEFINITIONS
    ; Function Prototype declaration
    ----------------------------------------------------------------------------*/



    /*----------------------------------------------------------------------------
    ; END
    ----------------------------------------------------------------------------*/

#ifdef __cplusplus
}
#endif


#endif  /* PVMP4AUDIODECODER_API_H */

+0 −77
Original line number Diff line number Diff line
/* ------------------------------------------------------------------
 * Copyright (C) 1998-2009 PacketVideo
 *
 * 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.
 * -------------------------------------------------------------------
 */
/****************************************************************************************
Portions of this file are derived from the following 3GPP standard:

    3GPP TS 26.073
    ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec
    Available from http://www.3gpp.org

(C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
Permission to distribute, modify and use this file under the standard license
terms listed above has been obtained from the copyright holder.
****************************************************************************************/

#include "PVGSMAMRDecoder.h"


/////////////////////////////////////////////////////////////////////////////
OSCL_EXPORT_REF CPVGSMAMRDecoder::CPVGSMAMRDecoder()
{
}


/////////////////////////////////////////////////////////////////////////////
OSCL_EXPORT_REF CPVGSMAMRDecoder::~CPVGSMAMRDecoder()
{
    delete iDecState;
    iDecState = NULL;
}


/////////////////////////////////////////////////////////////////////////////
OSCL_EXPORT_REF int32 CPVGSMAMRDecoder::InitDecoder(void)
{
    return GSMInitDecode(&iDecState, (int8*)"Decoder");
}


/////////////////////////////////////////////////////////////////////////////
OSCL_EXPORT_REF int32 CPVGSMAMRDecoder::DecodeFrame(Frame_Type_3GPP aType,
        uint8* aCompressedBlock,
        uint8* aAudioBuffer,
        int32 aFormat)
{
    return AMRDecode(iDecState, aType, aCompressedBlock, (Word16*)aAudioBuffer, (Word16) aFormat);
}


/////////////////////////////////////////////////////////////////////////////
OSCL_EXPORT_REF int32 CPVGSMAMRDecoder::ResetDecoder(void)
{
    return Speech_Decode_Frame_reset(iDecState);
}


/////////////////////////////////////////////////////////////////////////////
OSCL_EXPORT_REF void CPVGSMAMRDecoder::TerminateDecoder(void)
{
    GSMDecodeFrameExit(&iDecState);
    iDecState = NULL;
}
Loading