Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Commit

Permalink
whitespace cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Oct 5, 2012
1 parent fcb7970 commit dc56845
Show file tree
Hide file tree
Showing 7 changed files with 109 additions and 115 deletions.
12 changes: 6 additions & 6 deletions src/filters/renderer/VideoRenderers/RM7AllocatorPresenter.cpp
Expand Up @@ -46,7 +46,7 @@ HRESULT CRM7AllocatorPresenter::AllocSurfaces()
{
CAutoLock cAutoLock(this);

m_pVideoSurfaceOff = NULL;
m_pVideoSurfaceOff = NULL;
m_pVideoSurfaceYUY2 = NULL;

DDSURFACEDESC2 ddsd;
Expand All @@ -60,10 +60,10 @@ HRESULT CRM7AllocatorPresenter::AllocSurfaces()
ddsd.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
ddsd.ddpfPixelFormat.dwFlags = DDPF_RGB;
ddsd.ddpfPixelFormat.dwRGBBitCount = 32;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xFF000000;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF;
ddsd.ddpfPixelFormat.dwRGBAlphaBitMask = 0xFF000000;
ddsd.ddpfPixelFormat.dwRBitMask = 0x00FF0000;
ddsd.ddpfPixelFormat.dwGBitMask = 0x0000FF00;
ddsd.ddpfPixelFormat.dwBBitMask = 0x000000FF;

HRESULT hr = m_pDD->CreateSurface(&ddsd, &m_pVideoSurfaceOff, NULL);
if (FAILED(hr)) {
Expand Down Expand Up @@ -103,7 +103,7 @@ void CRM7AllocatorPresenter::DeleteSurfaces()
{
CAutoLock cAutoLock(this);

m_pVideoSurfaceOff = NULL;
m_pVideoSurfaceOff = NULL;
m_pVideoSurfaceYUY2 = NULL;

__super::DeleteSurfaces();
Expand Down
Expand Up @@ -46,7 +46,7 @@ HRESULT CRM9AllocatorPresenter::AllocSurfaces()
CAutoLock cAutoLock(this);
CAutoLock cRenderLock(&m_RenderLock);

m_pVideoSurfaceOff = NULL;
m_pVideoSurfaceOff = NULL;
m_pVideoSurfaceYUY2 = NULL;

HRESULT hr;
Expand Down
17 changes: 9 additions & 8 deletions src/filters/transform/MPCVideoDec/CpuId.cpp
Expand Up @@ -22,24 +22,24 @@
#include <intrin.h>
#include "CpuId.h"

#define CPUID_MMX (1 << 23)
#define CPUID_SSE (1 << 25)
#define CPUID_SSE2 (1 << 26)
#define CPUID_SSE3 (1 << 0)
#define CPUID_MMX (1 << 23)
#define CPUID_SSE (1 << 25)
#define CPUID_SSE2 (1 << 26)
#define CPUID_SSE3 (1 << 0)

// Intel specific
#define CPUID_SSSE3 (1 << 9)
#define CPUID_SSSE3 (1 << 9)

// AMD specific
#define CPUID_3DNOW (1 << 31)
#define CPUID_MMXEXT (1 << 22)
#define CPUID_3DNOW (1 << 31)
#define CPUID_MMXEXT (1 << 22)


CCpuId::CCpuId(void)
{
unsigned nHighestFeature;
unsigned nHighestFeatureEx;
int nBuff[4];
int nBuff[4];
char szMan[13];

// Get CPU manufacturer and highest CPUID
Expand All @@ -49,6 +49,7 @@ CCpuId::CCpuId(void)
*(int*)&szMan[4] = nBuff[3];
*(int*)&szMan[8] = nBuff[2];
szMan[12] = 0;

if (strcmp(szMan, "AuthenticAMD") == 0) {
m_nType = PROCESSOR_AMD;
} else if (strcmp(szMan, "GenuineIntel") == 0) {
Expand Down
16 changes: 8 additions & 8 deletions src/filters/transform/MPCVideoDec/CpuId.h
Expand Up @@ -30,15 +30,15 @@ class CCpuId
PROCESSOR_UNKNOWN
} PROCESSOR_TYPE;

// Enum codes identical to FFmpeg cpu features define !
// Enum codes identical to FFmpeg cpu features define
typedef enum {
MPC_MM_MMX = 0x0001, /* standard MMX */
MPC_MM_3DNOW = 0x0004, /* AMD 3DNOW */
MPC_MM_MMXEXT = 0x0002, /* SSE integer functions or AMD MMX ext */
MPC_MM_SSE = 0x0008, /* SSE functions */
MPC_MM_SSE2 = 0x0010, /* PIV SSE2 functions */
MPC_MM_SSE3 = 0x0040, /* AMD64 & PIV SSE3 functions */
MPC_MM_SSSE3 = 0x0080 /* PIV Core 2 SSSE3 functions */
MPC_MM_MMX = 0x0001, /* standard MMX */
MPC_MM_3DNOW = 0x0004, /* AMD 3DNOW */
MPC_MM_MMXEXT = 0x0002, /* SSE integer functions or AMD MMX ext */
MPC_MM_SSE = 0x0008, /* SSE functions */
MPC_MM_SSE2 = 0x0010, /* PIV SSE2 functions */
MPC_MM_SSE3 = 0x0040, /* AMD64 & PIV SSE3 functions */
MPC_MM_SSSE3 = 0x0080 /* PIV Core 2 SSSE3 functions */
} PROCESSOR_FEATURES;

CCpuId();
Expand Down
2 changes: 1 addition & 1 deletion src/filters/transform/MPCVideoDec/MPCVideoDecFilter.cpp
Expand Up @@ -2228,7 +2228,7 @@ HRESULT CMPCVideoDecFilter::ConfigureDXVA2(IPin* pPin)

if (SUCCEEDED(hr)) {

//Intel patch for Ivy Bridge and Sandy Bridge
// Intel patch for Ivy Bridge and Sandy Bridge
if (m_nPCIVendor == PCIV_Intel) {
for (UINT iCnt = 0; iCnt < cDecoderGuids; iCnt++) {
if (pDecoderGuids[iCnt] == DXVA_Intel_H264_ClearVideo) {
Expand Down
4 changes: 2 additions & 2 deletions src/filters/transform/MPCVideoDec/VideoDecDXVAAllocator.cpp
Expand Up @@ -97,8 +97,8 @@ STDMETHODIMP_(int) CDXVA2Sample::GetDXSurfaceId()
CVideoDecDXVAAllocator::CVideoDecDXVAAllocator(CMPCVideoDecFilter* pVideoDecFilter, HRESULT* phr)
: CBaseAllocator(NAME("CVideoDecDXVAAllocator"), NULL, phr)
{
m_pVideoDecFilter = pVideoDecFilter;
m_ppRTSurfaceArray = NULL;
m_pVideoDecFilter = pVideoDecFilter;
m_ppRTSurfaceArray = NULL;
}

CVideoDecDXVAAllocator::~CVideoDecDXVAAllocator()
Expand Down
171 changes: 82 additions & 89 deletions src/filters/transform/MpaDecFilter/FFAudioDecoder.cpp
Expand Up @@ -35,8 +35,8 @@ extern "C" {
#include "../../../DSUtil/AudioParser.h"
#include "../../../mpc-hc/InternalFiltersConfig.h"

#define INT16_PEAK 32768
#define INT32_PEAK 2147483648
#define INT16_PEAK 32768
#define INT32_PEAK 2147483648

typedef struct {
const CLSID* clsMinorType;
Expand Down Expand Up @@ -228,9 +228,9 @@ bool CFFAudioDecoder::Init(enum AVCodecID nCodecId, CTransformInputPin* pInput)
}

const void* format = pInput->CurrentMediaType().Format();
GUID format_type = pInput->CurrentMediaType().formattype;
DWORD formatlen = pInput->CurrentMediaType().cbFormat;
unsigned extralen = 0;
GUID format_type = pInput->CurrentMediaType().formattype;
DWORD formatlen = pInput->CurrentMediaType().cbFormat;
unsigned extralen = 0;
getExtraData((BYTE*)format, &format_type, formatlen, NULL, &extralen);

memset(&m_raData, 0, sizeof(m_raData));
Expand Down Expand Up @@ -365,17 +365,16 @@ HRESULT CFFAudioDecoder::Decode(enum AVCodecID nCodecId, BYTE* p, int buffsize,
samplefmt = m_pAVCtx->sample_fmt;

switch (samplefmt) {
case AV_SAMPLE_FMT_U8:
{
// convert unsigned 8 bit to signed 16 bit
BuffOut.SetCount(nSamples * 2);
int16_t* pOut = (int16_t*)BuffOut.GetData();
for (size_t i = 0; i < nSamples; ++i) {
pOut[i] = (int16_t)(int8_t)(((uint8_t*)m_pFrame->data[0])[i] + 128) * 256;
}
samplefmt = AV_SAMPLE_FMT_S16;
case AV_SAMPLE_FMT_U8: {
// convert unsigned 8 bit to signed 16 bit
BuffOut.SetCount(nSamples * 2);
int16_t* pOut = (int16_t*)BuffOut.GetData();
for (size_t i = 0; i < nSamples; ++i) {
pOut[i] = (int16_t)(int8_t)(((uint8_t*)m_pFrame->data[0])[i] + 128) * 256;
}
break;
samplefmt = AV_SAMPLE_FMT_S16;
}
break;
case AV_SAMPLE_FMT_S16:
BuffOut.SetCount(nSamples * 2);
memcpy(BuffOut.GetData(), m_pFrame->data[0], BuffOut.GetCount());
Expand All @@ -385,80 +384,74 @@ HRESULT CFFAudioDecoder::Decode(enum AVCodecID nCodecId, BYTE* p, int buffsize,
BuffOut.SetCount(nSamples * 4);
memcpy(BuffOut.GetData(), m_pFrame->data[0], BuffOut.GetCount());
break;
case AV_SAMPLE_FMT_DBL:
{
// convert double to float
BuffOut.SetCount(nSamples * 4);
float* pOut = (float*)BuffOut.GetData();
for (size_t i = 0; i < nSamples; ++i) {
pOut[i] = (float)((double*)m_pFrame->data[0])[i];
}
samplefmt = AV_SAMPLE_FMT_FLT;
case AV_SAMPLE_FMT_DBL: {
// convert double to float
BuffOut.SetCount(nSamples * 4);
float* pOut = (float*)BuffOut.GetData();
for (size_t i = 0; i < nSamples; ++i) {
pOut[i] = (float)((double*)m_pFrame->data[0])[i];
}
break;
samplefmt = AV_SAMPLE_FMT_FLT;
}
break;
// planar sample formats
case AV_SAMPLE_FMT_U8P:
{
// convert unsigned 8 bit to signed 16 bit
BuffOut.SetCount(nSamples * 2);
int16_t* pOut = (int16_t*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for(int ch = 0; ch < nChannels; ++ch) {
*pOut++ = (int16_t)(int8_t)(((uint8_t*)m_pFrame->extended_data[ch])[i] + 128) * 256;
}
case AV_SAMPLE_FMT_U8P: {
// convert unsigned 8 bit to signed 16 bit
BuffOut.SetCount(nSamples * 2);
int16_t* pOut = (int16_t*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for (int ch = 0; ch < nChannels; ++ch) {
*pOut++ = (int16_t)(int8_t)(((uint8_t*)m_pFrame->extended_data[ch])[i] + 128) * 256;
}
samplefmt = AV_SAMPLE_FMT_S16;
}
break;
case AV_SAMPLE_FMT_S16P:
{
BuffOut.SetCount(nSamples * 2);
int16_t* pOut = (int16_t*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for(int ch = 0; ch < nChannels; ++ch) {
*pOut++ = ((int16_t*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_S16;
}
break;
case AV_SAMPLE_FMT_S16P: {
BuffOut.SetCount(nSamples * 2);
int16_t* pOut = (int16_t*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for (int ch = 0; ch < nChannels; ++ch) {
*pOut++ = ((int16_t*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_S16;
}
break;
case AV_SAMPLE_FMT_S32P:
{
BuffOut.SetCount(nSamples * 4);
int32_t* pOut = (int32_t*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for(int ch = 0; ch < nChannels; ++ch) {
*pOut++ = ((int32_t*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_S16;
}
break;
case AV_SAMPLE_FMT_S32P: {
BuffOut.SetCount(nSamples * 4);
int32_t* pOut = (int32_t*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for (int ch = 0; ch < nChannels; ++ch) {
*pOut++ = ((int32_t*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_S32;
}
break;
case AV_SAMPLE_FMT_FLTP:
{
BuffOut.SetCount(nSamples * 4);
float *pOut = (float*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for(int ch = 0; ch < nChannels; ++ch) {
*pOut++ = ((float*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_S32;
}
break;
case AV_SAMPLE_FMT_FLTP: {
BuffOut.SetCount(nSamples * 4);
float* pOut = (float*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for (int ch = 0; ch < nChannels; ++ch) {
*pOut++ = ((float*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_FLT;
}
break;
case AV_SAMPLE_FMT_DBLP:
{
// convert double to float
BuffOut.SetCount(nSamples * 4);
float *pOut = (float*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for(int ch = 0; ch < nChannels; ++ch) {
*pOut++ = (float)((double*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_FLT;
}
break;
case AV_SAMPLE_FMT_DBLP: {
// convert double to float
BuffOut.SetCount(nSamples * 4);
float* pOut = (float*)BuffOut.GetData();
for (size_t i = 0, n = nSamples / nChannels; i < n; ++i) {
for (int ch = 0; ch < nChannels; ++ch) {
*pOut++ = (float)((double*)m_pFrame->extended_data[ch])[i];
}
samplefmt = AV_SAMPLE_FMT_FLT;
}
break;
samplefmt = AV_SAMPLE_FMT_FLT;
}
break;
default:
ASSERT(FALSE);
break;
Expand Down Expand Up @@ -511,22 +504,22 @@ HRESULT CFFAudioDecoder::ParseRealAudioHeader(const BYTE* extra, const int extra
return VFW_E_UNSUPPORTED_AUDIO;
} else if (version == 4 || version == 5 && extralen > 50) {
// main format block
fmt += 2; // word - unused (always 0)
fmt += 4; // byte[4] - .ra4/.ra5 signature
fmt += 4; // dword - unknown
fmt += 2; // word - Version2
fmt += 4; // dword - header size
fmt += 2; // word - unused (always 0)
fmt += 4; // byte[4] - .ra4/.ra5 signature
fmt += 4; // dword - unknown
fmt += 2; // word - Version2
fmt += 4; // dword - header size
m_raData.flavor = AV_RB16(fmt);
fmt += 2; // word - codec flavor
fmt += 2; // word - codec flavor
m_raData.coded_frame_size = AV_RB32(fmt);
fmt += 4; // dword - coded frame size
fmt += 12; // byte[12] - unknown
fmt += 4; // dword - coded frame size
fmt += 12; // byte[12] - unknown
m_raData.sub_packet_h = AV_RB16(fmt);
fmt += 2; // word - sub packet h
fmt += 2; // word - frame size
fmt += 2; // word - sub packet h
fmt += 2; // word - frame size
m_raData.sub_packet_size = m_pAVCtx->block_align = AV_RB16(fmt);
fmt += 2; // word - subpacket size
fmt += 2; // word - unknown
fmt += 2; // word - subpacket size
fmt += 2; // word - unknown
// 6 Unknown bytes in ver 5
if (version == 5) {
fmt += 6;
Expand Down

0 comments on commit dc56845

Please sign in to comment.