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

Commit 2177d443 authored by Dheeraj Sharma's avatar Dheeraj Sharma Committed by Android (Google) Code Review
Browse files

Merge "VideEditor:Fix for 3369908 Removed redundant code." into honeycomb

parents 9ce06f4c 1526a338
Loading
Loading
Loading
Loading
+45 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2011 NXP Software
 * Copyright (C) 2011 The Android Open Source Project
 *
 * 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 VIDEOEDITORRESAMPLER_H
#define VIDEOEDITORRESAMPLER_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "M4OSA_Types.h"

M4OSA_Int32 LVAudioResamplerCreate(M4OSA_Int32 bitDepth, M4OSA_Int32 inChannelCount,
                                     M4OSA_Int32 sampleRate, M4OSA_Int32 quality);
void LVAudiosetSampleRate(M4OSA_Int32 resamplerContext,M4OSA_Int32 inSampleRate);
void LVAudiosetVolume(M4OSA_Int32 resamplerContext, M4OSA_Int16 left, M4OSA_Int16 right) ;
void LVAudioresample_LowQuality(M4OSA_Int16* out, M4OSA_Int16* input,
                                     M4OSA_Int32 outFrameCount, M4OSA_Int32 resamplerContext);

void MonoTo2I_16( const M4OSA_Int16 *src,
                        M4OSA_Int16 *dst,
                        M4OSA_Int16 n);

void From2iToMono_16( const M4OSA_Int16 *src,
                            M4OSA_Int16 *dst,
                            M4OSA_Int16 n);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* VIDEOEDITORRESAMPLER_H */

+0 −119
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2004-2011 NXP Software
 * Copyright (C) 2011 The Android Open Source Project
 *
 * 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 GLVAUDIORESAMPLER_H
#define GLVAUDIORESAMPLER_H
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#ifndef int8_t
#define  int8_t signed char
#endif

#ifndef int32_t
#define int32_t long int
#endif

#ifndef uint32_t
#define uint32_t unsigned long int
#endif

#ifndef int16_t
#define int16_t signed short
#endif

#ifndef uint16_t
#define uint16_t unsigned short
#endif

#ifndef status_t
#define status_t long int
#endif

    static const int kNumPhaseBits = 30;
    // phase mask for fraction
    static const uint32_t kPhaseMask = (1<<30)-1;
    // multiplier to calculate fixed point phase increment
    static const uint32_t kPhaseMultiplier = (1 << 30);

    static const int kNumInterpBits = 15;

    // bits to shift the phase fraction down to avoid overflow
    static const int kPreInterpShift = 15; //=kNumPhaseBits - kNumInterpBits;

typedef struct Buffer {
            void*       raw;
            short*      i16;
            int8_t*     i8;
            long frameCount;
        }Buffer;

typedef enum src_quality {
            DEFAULT=0,
            LOW_QUALITY=1,
            MED_QUALITY=2,
            HIGH_QUALITY=3
        }src_quality;

typedef struct LVAudioResampler
{

    int32_t mBitDepth;
    int32_t mChannelCount;
    int32_t mSampleRate;
    int32_t mInSampleRate;
    Buffer mBuffer;
    int16_t mVolume[2];
    int16_t mTargetVolume[2];
    int mFormat;
    long mInputIndex;
    int32_t mPhaseIncrement;
    uint32_t mPhaseFraction;
    int mX0L;
    int mX0R;
    int32_t kPreInterpShift;
    int32_t kNumInterpBits;
    src_quality mQuality;
}LVAudioResampler;


int32_t LVAudioResamplerCreate(int bitDepth, int inChannelCount,
        int32_t sampleRate, int quality);
void LVAudiosetSampleRate(int32_t context,int32_t inSampleRate);
void LVAudiosetVolume(int32_t context, int16_t left, int16_t right) ;

void LVAudioresample_LowQuality(int16_t* out, int16_t* input, long outFrameCount, int32_t context);
void LVResampler_LowQualityInit(int bitDepth, int inChannelCount,
        int32_t sampleRate, int32_t context);


void MonoTo2I_16( const short *src,
                        short *dst,
                        short n);

void From2iToMono_16( const short *src,
                            short *dst,
                            short n);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* GLVAUDIORESAMPLER_H */

+1 −1
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@
#include "M4OSA_Debug.h"  /**< OSAL debug management */
#include "M4OSA_Debug.h"  /**< OSAL debug management */


/* PCM samples */
/* PCM samples */
#include "gLVAudioResampler.h"
#include "VideoEditorResampler.h"
/**
/**
 * Decoder interface */
 * Decoder interface */
#include "M4DECODER_Common.h"
#include "M4DECODER_Common.h"
+6 −3
Original line number Original line Diff line number Diff line
@@ -38,7 +38,6 @@ LOCAL_SRC_FILES:= \
      M4VSS3GPP_EditAudio.c \
      M4VSS3GPP_EditAudio.c \
      M4VSS3GPP_EditVideo.c \
      M4VSS3GPP_EditVideo.c \
      M4VSS3GPP_MediaAndCodecSubscription.c \
      M4VSS3GPP_MediaAndCodecSubscription.c \
      glvaudioresampler.c \
      M4ChannelCoverter.c \
      M4ChannelCoverter.c \
      M4VD_EXTERNAL_BitstreamParser.c \
      M4VD_EXTERNAL_BitstreamParser.c \
      M4VD_EXTERNAL_Interface.c \
      M4VD_EXTERNAL_Interface.c \
@@ -48,7 +47,8 @@ LOCAL_SRC_FILES:= \
      M4AD_Null.c \
      M4AD_Null.c \
      M4AMRR_CoreReader.c \
      M4AMRR_CoreReader.c \
      M4READER_Amr.c \
      M4READER_Amr.c \
      M4VD_Tools.c
      M4VD_Tools.c \
      VideoEditorResampler.cpp




LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_TAGS := optional
@@ -63,11 +63,14 @@ LOCAL_STATIC_LIBRARIES := \
    libvideoeditor_stagefrightshells
    libvideoeditor_stagefrightshells


LOCAL_C_INCLUDES += \
LOCAL_C_INCLUDES += \
    $(TOP)/frameworks/base/include \
    $(TOP)/frameworks/media/libvideoeditor/osal/inc \
    $(TOP)/frameworks/media/libvideoeditor/osal/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/mcs/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/mcs/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/common/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/common/inc \
    $(TOP)/frameworks/media/libvideoeditor/vss/stagefrightshells/inc
    $(TOP)/frameworks/media/libvideoeditor/vss/stagefrightshells/inc \
    $(TOP)/frameworks/base/services/audioflinger \



ifeq ($(TARGET_SIMULATOR),true)
ifeq ($(TARGET_SIMULATOR),true)
else
else
+1 −1
Original line number Original line Diff line number Diff line
@@ -44,7 +44,7 @@
#include "M4OSA_Debug.h"  /**< OSAL debug management */
#include "M4OSA_Debug.h"  /**< OSAL debug management */




#include "gLVAudioResampler.h"
#include "VideoEditorResampler.h"
/**
/**
 ******************************************************************************
 ******************************************************************************
 * @brief    Static functions
 * @brief    Static functions
Loading