• Home
  • Raw
  • Download

Lines Matching refs:pState

49 static EAS_RESULT IMADecoderInit (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState);
50 static EAS_RESULT IMADecoderSample (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState);
51 static void IMADecoderADPCM (S_DECODER_STATE *pState, EAS_U8 nibble);
52 static EAS_RESULT IMADecoderLocate (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState, EAS_I32 time);
82 static EAS_RESULT IMADecoderInit (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState) in IMADecoderInit() argument
84 pState->decoderL.step = 0; in IMADecoderInit()
85 pState->decoderR.step = 0; in IMADecoderInit()
105 static EAS_RESULT IMADecoderSample (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState) in IMADecoderSample() argument
111 if (pState->hiNibble) in IMADecoderSample()
113 IMADecoderADPCM(&pState->decoderL, (EAS_U8)(pState->srcByte >> 4)); in IMADecoderSample()
114 pState->hiNibble = EAS_FALSE; in IMADecoderSample()
121 if ((pState->bytesLeft == 0) && (pState->loopSamples != 0)) in IMADecoderSample()
124 …((result = EAS_HWFileSeek(pEASData->hwInstData, pState->fileHandle, (EAS_I32) (pState->startPos + in IMADecoderSample()
126 pState->bytesLeft = pState->byteCount = (EAS_I32) pState->bytesLeftLoop; in IMADecoderSample()
127 pState->blockCount = 0; in IMADecoderSample()
128 pState->flags &= ~PCM_FLAGS_EMPTY; in IMADecoderSample()
133 if ((pState->blockSize != 0) && (pState->blockCount == 0) && (pState->bytesLeft != 0)) in IMADecoderSample()
137 …if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_S… in IMADecoderSample()
142 pState->decoderL.acc = pState->decoderL.x1 = sTemp; in IMADecoderSample()
145 …if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_S… in IMADecoderSample()
150 pState->decoderL.step = sTemp & 0xff; in IMADecoderSample()
152 if (pState->flags & PCM_FLAGS_STEREO) in IMADecoderSample()
155 …if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_S… in IMADecoderSample()
157 pState->decoderR.acc = pState->decoderR.x1 = sTemp; in IMADecoderSample()
160 …if ((result = EAS_HWGetWord(pEASData->hwInstData, pState->fileHandle, &sTemp, EAS_FALSE)) != EAS_S… in IMADecoderSample()
165 pState->decoderR.step = sTemp & 0xff; in IMADecoderSample()
167 pState->blockCount = pState->blockSize - 8; in IMADecoderSample()
168 pState->bytesLeft -= 8; in IMADecoderSample()
172 pState->blockCount = pState->blockSize - 4; in IMADecoderSample()
173 pState->bytesLeft -= 4; in IMADecoderSample()
180 if (pState->bytesLeft) in IMADecoderSample()
183 …if ((result = EAS_HWGetByte(pEASData->hwInstData, pState->fileHandle, &pState->srcByte)) != EAS_SU… in IMADecoderSample()
187 pState->bytesLeft--; in IMADecoderSample()
188 pState->blockCount--; in IMADecoderSample()
189 IMADecoderADPCM(&pState->decoderL, (EAS_U8)(pState->srcByte & 0x0f)); in IMADecoderSample()
191 if (pState->flags & PCM_FLAGS_STEREO) in IMADecoderSample()
192 IMADecoderADPCM(&pState->decoderR, (EAS_U8)(pState->srcByte >> 4)); in IMADecoderSample()
194 pState->hiNibble = EAS_TRUE; in IMADecoderSample()
200 pState->decoderL.x1 = pState->decoderL.x0; in IMADecoderSample()
201 pState->decoderR.x1 = pState->decoderR.x0; in IMADecoderSample()
225 static void IMADecoderADPCM (S_DECODER_STATE *pState, EAS_U8 nibble) in IMADecoderADPCM() argument
231 stepSize = imaStepSizeTable[pState->step]; in IMADecoderADPCM()
251 pState->acc -= delta; in IMADecoderADPCM()
253 pState->acc += delta; in IMADecoderADPCM()
256 if (pState->acc > 32767) in IMADecoderADPCM()
257 pState->acc = 32767; in IMADecoderADPCM()
258 if (pState->acc < -32768) in IMADecoderADPCM()
259 pState->acc = -32768; in IMADecoderADPCM()
260 pState->x1 = (EAS_PCM) pState->acc; in IMADecoderADPCM()
263 pState->step += imaIndexTable[nibble]; in IMADecoderADPCM()
264 if (pState->step < 0) in IMADecoderADPCM()
265 pState->step = 0; in IMADecoderADPCM()
266 if (pState->step > 88) in IMADecoderADPCM()
267 pState->step = 88; in IMADecoderADPCM()
280 static EAS_RESULT IMADecoderLocate (EAS_DATA_HANDLE pEASData, S_PCM_STATE *pState, EAS_I32 time) in IMADecoderLocate() argument
296 if (pState->blockSize == 0) in IMADecoderLocate()
300 if (pState->flags & PCM_FLAGS_STEREO) in IMADecoderLocate()
301 samplesPerBlock = pState->blockSize - 7; in IMADecoderLocate()
303 samplesPerBlock = (pState->blockSize << 1) - 7; in IMADecoderLocate()
310 temp = (msecs * pState->sampleRate); in IMADecoderLocate()
314 temp += secs * pState->sampleRate; in IMADecoderLocate()
321 if ((temp > pState->byteCount) && (pState->loopSamples != 0)) in IMADecoderLocate()
327 numBlocks = (EAS_I32) (pState->loopStart / pState->blockSize); in IMADecoderLocate()
328 samplesInLastBlock = (EAS_I32) pState->loopStart - (numBlocks * pState->blockSize); in IMADecoderLocate()
331 if (pState->flags & PCM_FLAGS_STEREO) in IMADecoderLocate()
345 temp = (temp / samplesPerBlock) * pState->blockSize; in IMADecoderLocate()
353 if ((result = EAS_PESeek(pEASData, pState, &temp)) != EAS_SUCCESS) in IMADecoderLocate()
357 EAS_ReportEx(_EAS_SEVERITY_NOFILTER, 0x2380b977, 0x00000009 , pState->bytesLeft); in IMADecoderLocate()
361 pState->blockCount = 0; in IMADecoderLocate()
362 pState->hiNibble = EAS_FALSE; in IMADecoderLocate()
363 if ((pState->state != EAS_STATE_PAUSING) && (pState->state != EAS_STATE_PAUSED)) in IMADecoderLocate()
364 pState->state = EAS_STATE_READY; in IMADecoderLocate()