Alien-FreeImage
view release on metacpan or search on metacpan
src/Source/LibJXR/image/decode/strdec.c view on Meta::CPAN
pb = malloc(cb);
if(pb == NULL)
return WMP_errOutOfMemory;
memset(pb, 0, cb);
//================================================
pSC = (CWMImageStrCodec*)pb; pb += sizeof(*pSC);
if(pSC == NULL)
return ICERR_ERROR;
// Set up perf timers
PERFTIMER_ONLY(pSC->m_fMeasurePerf = pSCP->fMeasurePerf);
PERFTIMER_NEW(pSC->m_fMeasurePerf, &pSC->m_ptEndToEndPerf);
PERFTIMER_NEW(pSC->m_fMeasurePerf, &pSC->m_ptEncDecPerf);
PERFTIMER_START(pSC->m_fMeasurePerf, pSC->m_ptEndToEndPerf);
PERFTIMER_START(pSC->m_fMeasurePerf, pSC->m_ptEncDecPerf);
PERFTIMER_COPYSTARTTIME(pSC->m_fMeasurePerf, pSC->m_ptEncDecPerf, pSC->m_ptEndToEndPerf);
pSC->m_Dparam = (CWMDecoderParameters*)pb; pb += sizeof(CWMDecoderParameters);
pSC->cbChannel = cbChannel;
//pSC->cNumChannels = SC.WMISCP.cChannel;
src/Source/LibJXR/image/encode/strenc.c view on Meta::CPAN
pb = malloc(cb);
if (NULL == pb)
{
goto ErrorExit;
}
memset(pb, 0, cb);
//================================================
pSC = (CWMImageStrCodec*)pb; pb += sizeof(*pSC);
// Set up perf timers
PERFTIMER_ONLY(pSC->m_fMeasurePerf = pSCP->fMeasurePerf);
PERFTIMER_NEW(pSC->m_fMeasurePerf, &pSC->m_ptEndToEndPerf);
PERFTIMER_NEW(pSC->m_fMeasurePerf, &pSC->m_ptEncDecPerf);
PERFTIMER_START(pSC->m_fMeasurePerf, pSC->m_ptEndToEndPerf);
PERFTIMER_START(pSC->m_fMeasurePerf, pSC->m_ptEncDecPerf);
PERFTIMER_COPYSTARTTIME(pSC->m_fMeasurePerf, pSC->m_ptEncDecPerf, pSC->m_ptEndToEndPerf);
pSC->m_param.cfColorFormat = pSCP->cfColorFormat;
pSC->m_param.bAlphaChannel = (pSCP->uAlphaMode == 3);
pSC->m_param.cNumChannels = pSCP->cChannel;
src/Source/LibJXR/image/sys/perfTimer.h view on Meta::CPAN
// POSSIBILITY OF SUCH DAMAGE.
//
//*@@@---@@@@******************************************************************
#ifndef __PERFTIMER_H_
#define __PERFTIMER_H_
//***************************************************************************
// Description
//
// Performance timer API used to measure codec performance. The underlying
// implementation of this API may vary - from ANSI-C implementation via clock,
// Win32 implementation via QueryPerformanceCounter or GetProcessTimes. At
// present we only support one implementation of this PerfTimer "object".
// You choose the implementation by choosing which one of the many files
// to compile and link with your application.
//***************************************************************************
#ifdef DISABLE_PERF_MEASUREMENT
#define PERFTIMER_ONLY(code)
src/Source/LibJXR/image/sys/perfTimerANSI.c view on Meta::CPAN
TraceResult(E_INVALIDARG);
goto exit;
}
if (NULL == pSrcPerfTimer)
{
TraceResult(E_INVALIDARG);
goto exit;
}
// Check that both timers are in proper state - both must be running
if (CS_RUNNING != pDestPerfTimer->eState)
{
TraceResult(WM_E_INVALIDSTATE);
goto exit;
}
if (CS_RUNNING != pSrcPerfTimer->eState)
{
TraceResult(WM_E_INVALIDSTATE);
goto exit;
src/Source/LibJXR/image/sys/strcodec.c view on Meta::CPAN
if (pPerfTimer)
{
fResult = PerfTimerGetResults(pPerfTimer, &rResults);
if (fResult)
{
printf("%.3f milliseconds, %.6f MP/sec\n", (float)rResults.iElapsedTime / 1000000,
1000000000 * fltMegaPixels / rResults.iElapsedTime);
if (rResults.iZeroTimeIntervals > 0)
{
printf(" *** WARNING: %d time intervals were measured as zero. "
"This perf timer has insufficient precision!\n\n",
(int) rResults.iZeroTimeIntervals);
}
}
}
if (FALSE == fResult)
printf("Results not available!\n");
}
void OutputPerfTimerReport(CWMImageStrCodec *pState)
src/Source/LibJXR/image/sys/strcodec.h view on Meta::CPAN
#define PACKET1(ps, pc, s) (((INTPTR_T)(ps) ^ (INTPTR_T)(pc)) & ((UINTPTR_T)(s)))
// alternate pointer p between 2 values aligned to s, s=pow(2,n)
//#define ALTPTR(p, s) ((void*)((uintptr_t)(p) ^ (s)))
// align point, s=pow(2,n), p aligns to s
#define ALIGNUP(p, s) ((void*)(((UINTPTR_T)(p) + ((UINTPTR_T)(s) - 1)) & ~((UINTPTR_T)(s) - 1)))
#define ALIGNDOWN(p, s) ((void*)((UINTPTR_T)(p) & ~((UINTPTR_T)(s) - 1)))
//================================================================
// timer support
//================================================================
#define TraceResult(a)
//================================================================
typedef enum tagPacketType
{
PK_NULL = 0,
PK_DC = 1, PK_AD, PK_AC, PK_CP,
PK_MAX,
( run in 0.844 second using v1.01-cache-2.11-cpan-49f99fa48dc )