ReactOS 0.4.15-dev-7958-gcd0bb1a
pcmconverter.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "mmsystem.h"
#include "mmreg.h"
#include "msacm.h"
#include "wingdi.h"
#include "winnls.h"
#include "winuser.h"
#include "msacmdrv.h"
#include "wineacm.h"
#include "wine/debug.h"
Include dependency graph for pcmconverter.c:

Go to the source code of this file.

Classes

struct  tagAcmPcmData
 

Macros

#define NOBITMAP
 
#define NUM_OF(a, b)   ((a)/(b))
 
#define PCM_RESAMPLE   1
 

Typedefs

typedef void(* PCM_CONVERT_KEEP_RATE) (const unsigned char *, int, unsigned char *)
 
typedef void(* PCM_CONVERT_CHANGE_RATE) (const DWORD, const unsigned char *, DWORD *, const DWORD, unsigned char *, DWORD *)
 
typedef struct tagAcmPcmData AcmPcmData
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (msacm)
 
static DWORD PCM_drvOpen (LPCSTR str, PACMDRVOPENDESCW adod)
 
static DWORD PCM_drvClose (DWORD dwDevID)
 
static DWORD PCM_GetFormatIndex (LPWAVEFORMATEX wfx)
 
static short C816 (unsigned char b)
 
static unsigned char C168 (short s)
 
static unsigned char C248 (int s)
 
static short C2416 (int s)
 
static short R16 (const unsigned char *src)
 
static int R24 (const unsigned char *src)
 
static void W16 (unsigned char *dst, short s)
 
static void W24 (unsigned char *dst, int s)
 
static int M24 (int l, int r)
 
static short M16 (short l, short r)
 
static unsigned char M8 (unsigned char a, unsigned char b)
 
static void cvtMM88K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS88K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMM1616K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS1616K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMS88K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMS816K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMS168K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMS1616K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSM88K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSM816K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSM168K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSM1616K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMM816K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS816K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMM168K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS168K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMS248K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSM248K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMM248K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS248K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMS2416K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSM2416K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtMM2416K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS2416K (const unsigned char *src, int ns, unsigned char *dst)
 
static void cvtSS88C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSM88C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMS88C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMM88C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSS816C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSM816C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMS816C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMM816C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSS168C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSM168C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMS168C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMM168C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSS1616C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSM1616C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMS1616C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMM1616C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSS2424C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtSM2424C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMS2424C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static void cvtMM2424C (const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
 
static LRESULT PCM_DriverDetails (PACMDRIVERDETAILSW add)
 
static LRESULT PCM_FormatTagDetails (PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
 
static LRESULT PCM_FormatDetails (PACMFORMATDETAILSW afd, DWORD dwQuery)
 
static LRESULT PCM_FormatSuggest (PACMDRVFORMATSUGGEST adfs)
 
static LRESULT PCM_StreamOpen (PACMDRVSTREAMINSTANCE adsi)
 
static LRESULT PCM_StreamClose (PACMDRVSTREAMINSTANCE adsi)
 
static DWORD PCM_round (DWORD a, DWORD b, DWORD c)
 
static LRESULT PCM_StreamSize (PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
 
static LRESULT PCM_StreamConvert (PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
 
LRESULT CALLBACK PCM_DriverProc (DWORD_PTR dwDevID, HDRVR hDriv, UINT wMsg, LPARAM dwParam1, LPARAM dwParam2)
 

Variables

struct {
   int   nChannels
 
   int   nBits
 
   int   rate
 
PCM_Formats []
 
static const PCM_CONVERT_KEEP_RATE PCM_ConvertKeepRate []
 
static const PCM_CONVERT_CHANGE_RATE PCM_ConvertChangeRate []
 

Macro Definition Documentation

◆ NOBITMAP

#define NOBITMAP

Definition at line 37 of file pcmconverter.c.

◆ NUM_OF

#define NUM_OF (   a,
  b 
)    ((a)/(b))

Definition at line 73 of file pcmconverter.c.

◆ PCM_RESAMPLE

#define PCM_RESAMPLE   1

Definition at line 76 of file pcmconverter.c.

Typedef Documentation

◆ AcmPcmData

◆ PCM_CONVERT_CHANGE_RATE

typedef void(* PCM_CONVERT_CHANGE_RATE) (const DWORD, const unsigned char *, DWORD *, const DWORD, unsigned char *, DWORD *)

Definition at line 80 of file pcmconverter.c.

◆ PCM_CONVERT_KEEP_RATE

typedef void(* PCM_CONVERT_KEEP_RATE) (const unsigned char *, int, unsigned char *)

Definition at line 78 of file pcmconverter.c.

Function Documentation

◆ C168()

static unsigned char C168 ( short  s)
inlinestatic

Definition at line 151 of file pcmconverter.c.

152{
153 return HIBYTE(s) ^ (unsigned char)0x80;
154}
unsigned char
Definition: typeof.h:29
GLdouble s
Definition: gl.h:2039
#define HIBYTE(W)
Definition: jmemdos.c:486

Referenced by cvtMM168C(), cvtMM168K(), cvtMS168C(), cvtMS168K(), cvtSM168C(), cvtSM168K(), cvtSS168C(), and cvtSS168K().

◆ C2416()

static short C2416 ( int  s)
inlinestatic

Definition at line 171 of file pcmconverter.c.

172{
173 return HIWORD(s);
174}
#define HIWORD(l)
Definition: typedefs.h:247

Referenced by cvtMM2416K(), cvtMS2416K(), cvtSM2416K(), and cvtSS2416K().

◆ C248()

static unsigned char C248 ( int  s)
inlinestatic

Definition at line 161 of file pcmconverter.c.

162{
163 return HIBYTE(HIWORD(s)) ^ (unsigned char)0x80;
164}

Referenced by cvtMM248K(), cvtMS248K(), cvtSM248K(), and cvtSS248K().

◆ C816()

static short C816 ( unsigned char  b)
inlinestatic

Definition at line 141 of file pcmconverter.c.

142{
143 return (b - 128) << 8;
144}
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Referenced by cvtMM816C(), cvtMM816K(), cvtMS816C(), cvtMS816K(), cvtSM816C(), cvtSM816K(), cvtSS816C(), and cvtSS816K().

◆ cvtMM1616C()

static void cvtMM1616C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 854 of file pcmconverter.c.

856{
857 DWORD error = srcRate / 2;
858 DWORD maxSrc = *nsrc, maxDst = *ndst;
859 *ndst = 0;
860 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
861 error += dstRate;
862 while (error > srcRate) {
863 if (*ndst == maxDst)
864 return;
865 (*ndst)++;
866 error -= srcRate;
867
868 W16(dst, R16(src)); dst += 2;
869 }
870 src += 2;
871 }
872}
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
#define error(str)
Definition: mkdosfs.c:1605
static void W16(unsigned char *dst, short s)
Definition: pcmconverter.c:203
static short R16(const unsigned char *src)
Definition: pcmconverter.c:181

◆ cvtMM1616K()

static void cvtMM1616K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 303 of file pcmconverter.c.

304{
305 TRACE("(%p, %d, %p)\n", src, ns, dst);
306 memcpy(dst, src, ns * 2);
307}
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define TRACE(s)
Definition: solgame.cpp:4
Definition: mxnamespace.c:45

◆ cvtMM168C()

static void cvtMM168C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 772 of file pcmconverter.c.

774{
775 DWORD error = srcRate / 2;
776 DWORD maxSrc = *nsrc, maxDst = *ndst;
777 *ndst = 0;
778 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
779 error += dstRate;
780 while (error > srcRate) {
781 if (*ndst == maxDst)
782 return;
783 (*ndst)++;
784 error -= srcRate;
785
786 *dst++ = C168(R16(src));
787 }
788 src += 2;
789 }
790}
static unsigned char C168(short s)
Definition: pcmconverter.c:151

◆ cvtMM168K()

static void cvtMM168K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 422 of file pcmconverter.c.

423{
424 TRACE("(%p, %d, %p)\n", src, ns, dst);
425
426 while (ns--) {
427 *dst++ = C168(R16(src)); src += 2;
428 }
429}

◆ cvtMM2416K()

static void cvtMM2416K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 505 of file pcmconverter.c.

506{
507 TRACE("(%p, %d, %p)\n", src, ns, dst);
508
509 while (ns--) {
510 W16(dst, C2416(R24(src))); dst += 2; src += 3;
511 }
512}
static int R24(const unsigned char *src)
Definition: pcmconverter.c:193
static short C2416(int s)
Definition: pcmconverter.c:171

◆ cvtMM2424C()

static void cvtMM2424C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 936 of file pcmconverter.c.

938{
939 DWORD error = srcRate / 2;
940 DWORD maxSrc = *nsrc, maxDst = *ndst;
941 *ndst = 0;
942 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
943 error += dstRate;
944 while (error > srcRate) {
945 if (*ndst == maxDst)
946 return;
947 (*ndst)++;
948 error -= srcRate;
949
950 W24(dst, R24(src)); dst += 3;
951 }
952 src += 3;
953 }
954}
static void W24(unsigned char *dst, int s)
Definition: pcmconverter.c:214

◆ cvtMM248K()

static void cvtMM248K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 463 of file pcmconverter.c.

464{
465 TRACE("(%p, %d, %p)\n", src, ns, dst);
466
467 while (ns--) {
468 *dst++ = C248(R24(src)); src += 3;
469 }
470}
static unsigned char C248(int s)
Definition: pcmconverter.c:161

◆ cvtMM816C()

static void cvtMM816C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 690 of file pcmconverter.c.

692{
693 DWORD error = srcRate / 2;
694 DWORD maxSrc = *nsrc, maxDst = *ndst;
695 *ndst = 0;
696 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
697 error += dstRate;
698 while (error > srcRate) {
699 if (*ndst == maxDst)
700 return;
701 (*ndst)++;
702 error -= srcRate;
703
704 W16(dst, C816(src[0])); dst += 2;
705 }
706 src += 1;
707 }
708}
static short C816(unsigned char b)
Definition: pcmconverter.c:141

◆ cvtMM816K()

static void cvtMM816K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 403 of file pcmconverter.c.

404{
405 TRACE("(%p, %d, %p)\n", src, ns, dst);
406
407 while (ns--) {
408 W16(dst, C816(*src++)); dst += 2;
409 }
410}

◆ cvtMM88C()

static void cvtMM88C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 608 of file pcmconverter.c.

610{
611 DWORD error = srcRate / 2;
612 DWORD maxSrc = *nsrc, maxDst = *ndst;
613 *ndst = 0;
614 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
615 error += dstRate;
616 while (error > srcRate) {
617 if (*ndst == maxDst)
618 return;
619 (*ndst)++;
620 error -= srcRate;
621
622 *dst++ = src[0];
623 }
624 src += 1;
625 }
626}

◆ cvtMM88K()

static void cvtMM88K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 291 of file pcmconverter.c.

292{
293 TRACE("(%p, %d, %p)\n", src, ns, dst);
294 memcpy(dst, src, ns);
295}

◆ cvtMS1616C()

static void cvtMS1616C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 833 of file pcmconverter.c.

835{
836 DWORD error = srcRate / 2;
837 DWORD maxSrc = *nsrc, maxDst = *ndst;
838 *ndst = 0;
839 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
840 error += dstRate;
841 while (error > srcRate) {
842 if (*ndst == maxDst)
843 return;
844 (*ndst)++;
845 error -= srcRate;
846
847 W16(dst, R16(src)); dst += 2;
848 W16(dst, R16(src)); dst += 2;
849 }
850 src += 2;
851 }
852}

◆ cvtMS1616K()

static void cvtMS1616K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 349 of file pcmconverter.c.

350{
351 short v;
352 TRACE("(%p, %d, %p)\n", src, ns, dst);
353
354 while (ns--) {
355 v = R16(src); src += 2;
356 W16(dst, v); dst += 2;
357 W16(dst, v); dst += 2;
358 }
359}
const GLdouble * v
Definition: gl.h:2040

◆ cvtMS168C()

static void cvtMS168C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 751 of file pcmconverter.c.

753{
754 DWORD error = srcRate / 2;
755 DWORD maxSrc = *nsrc, maxDst = *ndst;
756 *ndst = 0;
757 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
758 error += dstRate;
759 while (error > srcRate) {
760 if (*ndst == maxDst)
761 return;
762 (*ndst)++;
763 error -= srcRate;
764
765 *dst++ = C168(R16(src));
766 *dst++ = C168(R16(src));
767 }
768 src += 2;
769 }
770}

◆ cvtMS168K()

static void cvtMS168K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 337 of file pcmconverter.c.

338{
339 unsigned char v;
340 TRACE("(%p, %d, %p)\n", src, ns, dst);
341
342 while (ns--) {
343 v = C168(R16(src)); src += 2;
344 *dst++ = v;
345 *dst++ = v;
346 }
347}

◆ cvtMS2416K()

static void cvtMS2416K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 482 of file pcmconverter.c.

483{
484 short v;
485 TRACE("(%p, %d, %p)\n", src, ns, dst);
486
487 while (ns--) {
488 v = C2416(R24(src)); src += 3;
489 W16(dst, v); dst += 2;
490 W16(dst, v); dst += 2;
491 }
492}

◆ cvtMS2424C()

static void cvtMS2424C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 915 of file pcmconverter.c.

917{
918 DWORD error = srcRate / 2;
919 DWORD maxSrc = *nsrc, maxDst = *ndst;
920 *ndst = 0;
921 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
922 error += dstRate;
923 while (error > srcRate) {
924 if (*ndst == maxDst)
925 return;
926 (*ndst)++;
927 error -= srcRate;
928
929 W24(dst, R24(src)); dst += 3;
930 W24(dst, R24(src)); dst += 3;
931 }
932 src += 3;
933 }
934}

◆ cvtMS248K()

static void cvtMS248K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 441 of file pcmconverter.c.

442{
443 unsigned char v;
444 TRACE("(%p, %d, %p)\n", src, ns, dst);
445
446 while (ns--) {
447 v = C248(R24(src)); src += 3;
448 *dst++ = v;
449 *dst++ = v;
450 }
451}

◆ cvtMS816C()

static void cvtMS816C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 669 of file pcmconverter.c.

671{
672 DWORD error = srcRate / 2;
673 DWORD maxSrc = *nsrc, maxDst = *ndst;
674 *ndst = 0;
675 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
676 error += dstRate;
677 while (error > srcRate) {
678 if (*ndst == maxDst)
679 return;
680 (*ndst)++;
681 error -= srcRate;
682
683 W16(dst, C816(src[0])); dst += 2;
684 W16(dst, C816(src[0])); dst += 2;
685 }
686 src += 1;
687 }
688}

◆ cvtMS816K()

static void cvtMS816K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 325 of file pcmconverter.c.

326{
327 short v;
328 TRACE("(%p, %d, %p)\n", src, ns, dst);
329
330 while (ns--) {
331 v = C816(*src++);
332 W16(dst, v); dst += 2;
333 W16(dst, v); dst += 2;
334 }
335}

◆ cvtMS88C()

static void cvtMS88C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 587 of file pcmconverter.c.

589{
590 DWORD error = srcRate / 2;
591 DWORD maxSrc = *nsrc, maxDst = *ndst;
592 *ndst = 0;
593 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
594 error += dstRate;
595 while (error > srcRate) {
596 if (*ndst == maxDst)
597 return;
598 (*ndst)++;
599 error -= srcRate;
600
601 *dst++ = src[0];
602 *dst++ = src[0];
603 }
604 src += 1;
605 }
606}

◆ cvtMS88K()

static void cvtMS88K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 315 of file pcmconverter.c.

316{
317 TRACE("(%p, %d, %p)\n", src, ns, dst);
318
319 while (ns--) {
320 *dst++ = *src;
321 *dst++ = *src++;
322 }
323}

◆ cvtSM1616C()

static void cvtSM1616C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 813 of file pcmconverter.c.

815{
816 DWORD error = srcRate / 2;
817 DWORD maxSrc = *nsrc, maxDst = *ndst;
818 *ndst = 0;
819 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
820 error += dstRate;
821 while (error > srcRate) {
822 if (*ndst == maxDst)
823 return;
824 (*ndst)++;
825 error -= srcRate;
826
827 W16(dst, M16(R16(src), R16(src + 2))); dst += 2;
828 }
829 src += 4;
830 }
831}
static short M16(short l, short r)
Definition: pcmconverter.c:246

◆ cvtSM1616K()

static void cvtSM1616K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 393 of file pcmconverter.c.

394{
395 TRACE("(%p, %d, %p)\n", src, ns, dst);
396
397 while (ns--) {
398 W16(dst, M16(R16(src),R16(src+2))); dst += 2;
399 src += 4;
400 }
401}

◆ cvtSM168C()

static void cvtSM168C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 731 of file pcmconverter.c.

733{
734 DWORD error = srcRate / 2;
735 DWORD maxSrc = *nsrc, maxDst = *ndst;
736 *ndst = 0;
737 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
738 error += dstRate;
739 while (error > srcRate) {
740 if (*ndst == maxDst)
741 return;
742 (*ndst)++;
743 error -= srcRate;
744
745 *dst++ = C168(M16(R16(src), R16(src + 2)));
746 }
747 src += 4;
748 }
749}

◆ cvtSM168K()

static void cvtSM168K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 383 of file pcmconverter.c.

384{
385 TRACE("(%p, %d, %p)\n", src, ns, dst);
386
387 while (ns--) {
388 *dst++ = C168(M16(R16(src), R16(src + 2)));
389 src += 4;
390 }
391}

◆ cvtSM2416K()

static void cvtSM2416K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 494 of file pcmconverter.c.

495{
496 TRACE("(%p, %d, %p)\n", src, ns, dst);
497
498 while (ns--) {
499 W16(dst, C2416(M24(R24(src), R24(src + 3))));
500 dst += 2;
501 src += 6;
502 }
503}
static int M24(int l, int r)
Definition: pcmconverter.c:227

◆ cvtSM2424C()

static void cvtSM2424C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 895 of file pcmconverter.c.

897{
898 DWORD error = srcRate / 2;
899 DWORD maxSrc = *nsrc, maxDst = *ndst;
900 *ndst = 0;
901 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
902 error += dstRate;
903 while (error > srcRate) {
904 if (*ndst == maxDst)
905 return;
906 (*ndst)++;
907 error -= srcRate;
908
909 W24(dst, M24(R24(src), R24(src + 3))); dst += 3;
910 }
911 src += 6;
912 }
913}

◆ cvtSM248K()

static void cvtSM248K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 453 of file pcmconverter.c.

454{
455 TRACE("(%p, %d, %p)\n", src, ns, dst);
456
457 while (ns--) {
458 *dst++ = C248(M24(R24(src), R24(src + 3)));
459 src += 6;
460 }
461}

◆ cvtSM816C()

static void cvtSM816C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 649 of file pcmconverter.c.

651{
652 DWORD error = srcRate / 2;
653 DWORD maxSrc = *nsrc, maxDst = *ndst;
654 *ndst = 0;
655 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
656 error += dstRate;
657 while (error > srcRate) {
658 if (*ndst == maxDst)
659 return;
660 (*ndst)++;
661 error -= srcRate;
662
663 W16(dst, M16(C816(src[0]), C816(src[1]))); dst += 2;
664 }
665 src += 2;
666 }
667}

◆ cvtSM816K()

static void cvtSM816K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 371 of file pcmconverter.c.

372{
373 short v;
374 TRACE("(%p, %d, %p)\n", src, ns, dst);
375
376 while (ns--) {
377 v = M16(C816(src[0]), C816(src[1]));
378 src += 2;
379 W16(dst, v); dst += 2;
380 }
381}

◆ cvtSM88C()

static void cvtSM88C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 567 of file pcmconverter.c.

569{
570 DWORD error = srcRate / 2;
571 DWORD maxSrc = *nsrc, maxDst = *ndst;
572 *ndst = 0;
573 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
574 error += dstRate;
575 while (error > srcRate) {
576 if (*ndst == maxDst)
577 return;
578 (*ndst)++;
579 error -= srcRate;
580
581 *dst++ = M8(src[0], src[1]);
582 }
583 src += 2;
584 }
585}
static unsigned char M8(unsigned char a, unsigned char b)
Definition: pcmconverter.c:265

◆ cvtSM88K()

static void cvtSM88K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 361 of file pcmconverter.c.

362{
363 TRACE("(%p, %d, %p)\n", src, ns, dst);
364
365 while (ns--) {
366 *dst++ = M8(src[0], src[1]);
367 src += 2;
368 }
369}

◆ cvtSS1616C()

static void cvtSS1616C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 792 of file pcmconverter.c.

794{
795 DWORD error = srcRate / 2;
796 DWORD maxSrc = *nsrc, maxDst = *ndst;
797 *ndst = 0;
798 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
799 error += dstRate;
800 while (error > srcRate) {
801 if (*ndst == maxDst)
802 return;
803 (*ndst)++;
804 error -= srcRate;
805
806 W16(dst, R16(src)); dst += 2;
807 W16(dst, R16(src + 2)); dst += 2;
808 }
809 src += 4;
810 }
811}

◆ cvtSS1616K()

static void cvtSS1616K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 309 of file pcmconverter.c.

310{
311 TRACE("(%p, %d, %p)\n", src, ns, dst);
312 memcpy(dst, src, ns * 4);
313}

◆ cvtSS168C()

static void cvtSS168C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 710 of file pcmconverter.c.

712{
713 DWORD error = srcRate / 2;
714 DWORD maxSrc = *nsrc, maxDst = *ndst;
715 *ndst = 0;
716 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
717 error += dstRate;
718 while (error > srcRate) {
719 if (*ndst == maxDst)
720 return;
721 (*ndst)++;
722 error -= srcRate;
723
724 *dst++ = C168(R16(src));
725 *dst++ = C168(R16(src + 2));
726 }
727 src += 4;
728 }
729}

◆ cvtSS168K()

static void cvtSS168K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 431 of file pcmconverter.c.

432{
433 TRACE("(%p, %d, %p)\n", src, ns, dst);
434
435 while (ns--) {
436 *dst++ = C168(R16(src)); src += 2;
437 *dst++ = C168(R16(src)); src += 2;
438 }
439}

◆ cvtSS2416K()

static void cvtSS2416K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 514 of file pcmconverter.c.

515{
516 TRACE("(%p, %d, %p)\n", src, ns, dst);
517
518 while (ns--) {
519 W16(dst, C2416(R24(src))); dst += 2; src += 3;
520 W16(dst, C2416(R24(src))); dst += 2; src += 3;
521 }
522}

◆ cvtSS2424C()

static void cvtSS2424C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 874 of file pcmconverter.c.

876{
877 DWORD error = srcRate / 2;
878 DWORD maxSrc = *nsrc, maxDst = *ndst;
879 *ndst = 0;
880 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
881 error += dstRate;
882 while (error > srcRate) {
883 if (*ndst == maxDst)
884 return;
885 (*ndst)++;
886 error -= srcRate;
887
888 W24(dst, R24(src)); dst += 3;
889 W24(dst, R24(src + 3)); dst += 3;
890 }
891 src += 6;
892 }
893}

◆ cvtSS248K()

static void cvtSS248K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 472 of file pcmconverter.c.

473{
474 TRACE("(%p, %d, %p)\n", src, ns, dst);
475
476 while (ns--) {
477 *dst++ = C248(R24(src)); src += 3;
478 *dst++ = C248(R24(src)); src += 3;
479 }
480}

◆ cvtSS816C()

static void cvtSS816C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 628 of file pcmconverter.c.

630{
631 DWORD error = srcRate / 2;
632 DWORD maxSrc = *nsrc, maxDst = *ndst;
633 *ndst = 0;
634 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
635 error += dstRate;
636 while (error > srcRate) {
637 if (*ndst == maxDst)
638 return;
639 (*ndst)++;
640 error -= srcRate;
641
642 W16(dst, C816(src[0])); dst += 2;
643 W16(dst, C816(src[1])); dst += 2;
644 }
645 src += 2;
646 }
647}

◆ cvtSS816K()

static void cvtSS816K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 412 of file pcmconverter.c.

413{
414 TRACE("(%p, %d, %p)\n", src, ns, dst);
415
416 while (ns--) {
417 W16(dst, C816(*src++)); dst += 2;
418 W16(dst, C816(*src++)); dst += 2;
419 }
420}

◆ cvtSS88C()

static void cvtSS88C ( const DWORD  srcRate,
const unsigned char src,
DWORD nsrc,
const DWORD  dstRate,
unsigned char dst,
DWORD ndst 
)
static

Definition at line 546 of file pcmconverter.c.

548{
549 DWORD error = srcRate / 2;
550 DWORD maxSrc = *nsrc, maxDst = *ndst;
551 *ndst = 0;
552 for (*nsrc = 0; *nsrc < maxSrc; (*nsrc)++) {
553 error += dstRate;
554 while (error > srcRate) {
555 if (*ndst == maxDst)
556 return;
557 (*ndst)++;
558 error -= srcRate;
559
560 *dst++ = src[0];
561 *dst++ = src[1];
562 }
563 src += 2;
564 }
565}

◆ cvtSS88K()

static void cvtSS88K ( const unsigned char src,
int  ns,
unsigned char dst 
)
static

Definition at line 297 of file pcmconverter.c.

298{
299 TRACE("(%p, %d, %p)\n", src, ns, dst);
300 memcpy(dst, src, ns * 2);
301}

◆ M16()

static short M16 ( short  l,
short  r 
)
inlinestatic

Definition at line 246 of file pcmconverter.c.

247{
248 int sum = l + r;
249
250 /* clip sum to saturation */
251 if (sum > 32767)
252 sum = 32767;
253 else if (sum < -32768)
254 sum = -32768;
255
256 return sum;
257}
r l[0]
Definition: byte_order.h:168
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static int sum(int x_, int y_)
Definition: ptr2_test.cpp:35

Referenced by cvtSM1616C(), cvtSM1616K(), cvtSM168C(), cvtSM168K(), cvtSM816C(), and cvtSM816K().

◆ M24()

static int M24 ( int  l,
int  r 
)
inlinestatic

Definition at line 227 of file pcmconverter.c.

228{
229 LONGLONG sum = l + r;
230
231 /* clip sum to saturation */
232 if (sum > 0x7fffff00)
233 sum = 0x7fffff00;
234 else if (sum < -0x7fffff00)
235 sum = -0x7fffff00;
236
237 return sum;
238}
int64_t LONGLONG
Definition: typedefs.h:68

Referenced by cvtSM2416K(), cvtSM2424C(), and cvtSM248K().

◆ M8()

static unsigned char M8 ( unsigned char  a,
unsigned char  b 
)
inlinestatic

Definition at line 265 of file pcmconverter.c.

266{
267 int l = a - 128;
268 int r = b - 128;
269 int sum = (l + r) + 128;
270
271 /* clip sum to saturation */
272 if (sum > 0xff)
273 sum = 0xff;
274 else if (sum < 0)
275 sum = 0;
276
277 return sum;
278}
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by cvtSM88C(), and cvtSM88K().

◆ PCM_DriverDetails()

static LRESULT PCM_DriverDetails ( PACMDRIVERDETAILSW  add)
static

Definition at line 972 of file pcmconverter.c.

973{
974 TRACE("(%p)\n", add);
975
978 add->wMid = MM_MICROSOFT;
979 add->wPid = MM_MSFT_ACM_PCM;
980 add->vdwACM = 0x01000000;
981 add->vdwDriver = 0x01000000;
983 add->cFormatTags = 1;
984 add->cFilterTags = 0;
985 add->hicon = NULL;
986 MultiByteToWideChar(CP_ACP, 0, "MS-PCM", -1, add->szShortName, ARRAY_SIZE(add->szShortName));
987 MultiByteToWideChar(CP_ACP, 0, "Wine PCM converter", -1,
988 add->szLongName, ARRAY_SIZE(add->szLongName));
989 MultiByteToWideChar(CP_ACP, 0, "Brought to you by the Wine team...", -1,
991 MultiByteToWideChar(CP_ACP, 0, "Refer to LICENSE file", -1,
992 add->szLicensing, ARRAY_SIZE(add->szLicensing) );
993 add->szFeatures[0] = 0;
994
995 return MMSYSERR_NOERROR;
996}
#define ARRAY_SIZE(A)
Definition: main.h:33
#define NULL
Definition: types.h:112
#define CP_ACP
Definition: compat.h:109
#define MultiByteToWideChar
Definition: compat.h:110
#define MM_MSFT_ACM_PCM
Definition: mmreg.h:150
#define MM_MICROSOFT
Definition: mmreg.h:144
#define MMSYSERR_NOERROR
Definition: mmsystem.h:96
#define ACMDRIVERDETAILS_SUPPORTF_CONVERTER
Definition: msacm.h:62
#define ACMDRIVERDETAILS_FCCCOMP_UNDEFINED
Definition: msacm.h:59
#define ACMDRIVERDETAILS_FCCTYPE_AUDIOCODEC
Definition: msacm.h:58
DWORD cFilterTags
Definition: msacm.h:311
WCHAR szCopyright[ACMDRIVERDETAILS_COPYRIGHT_CHARS]
Definition: msacm.h:317
WCHAR szLongName[ACMDRIVERDETAILS_LONGNAME_CHARS]
Definition: msacm.h:316
WCHAR szShortName[ACMDRIVERDETAILS_SHORTNAME_CHARS]
Definition: msacm.h:315
FOURCC fccComp
Definition: msacm.h:301
WCHAR szLicensing[ACMDRIVERDETAILS_LICENSING_CHARS]
Definition: msacm.h:318
FOURCC fccType
Definition: msacm.h:300
WCHAR szFeatures[ACMDRIVERDETAILS_FEATURES_CHARS]
Definition: msacm.h:319
DWORD cFormatTags
Definition: msacm.h:310
DWORD fdwSupport
Definition: msacm.h:309
DWORD vdwDriver
Definition: msacm.h:307

Referenced by PCM_DriverProc().

◆ PCM_DriverProc()

LRESULT CALLBACK PCM_DriverProc ( DWORD_PTR  dwDevID,
HDRVR  hDriv,
UINT  wMsg,
LPARAM  dwParam1,
LPARAM  dwParam2 
)

Definition at line 1325 of file pcmconverter.c.

1327{
1328 TRACE("(%08lx %p %u %08lx %08lx);\n",
1329 dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1330
1331 switch (wMsg) {
1332 case DRV_LOAD: return 1;
1333 case DRV_FREE: return 1;
1334 case DRV_OPEN: return PCM_drvOpen((LPSTR)dwParam1, (PACMDRVOPENDESCW)dwParam2);
1335 case DRV_CLOSE: return PCM_drvClose(dwDevID);
1336 case DRV_ENABLE: return 1;
1337 case DRV_DISABLE: return 1;
1338 case DRV_QUERYCONFIGURE: return 1;
1339 case DRV_CONFIGURE: MessageBoxA(0, "MSACM PCM filter !", "Wine Driver", MB_OK); return 1;
1340 case DRV_INSTALL: return DRVCNF_RESTART;
1341 case DRV_REMOVE: return DRVCNF_RESTART;
1342
1344 /* no caching from other ACM drivers is done so far */
1345 return MMSYSERR_NOERROR;
1346
1348 return PCM_DriverDetails((PACMDRIVERDETAILSW)dwParam1);
1349
1351 return PCM_FormatTagDetails((PACMFORMATTAGDETAILSW)dwParam1, dwParam2);
1352
1354 return PCM_FormatDetails((PACMFORMATDETAILSW)dwParam1, dwParam2);
1355
1357 return PCM_FormatSuggest((PACMDRVFORMATSUGGEST)dwParam1);
1358
1359 case ACMDM_STREAM_OPEN:
1360 return PCM_StreamOpen((PACMDRVSTREAMINSTANCE)dwParam1);
1361
1362 case ACMDM_STREAM_CLOSE:
1363 return PCM_StreamClose((PACMDRVSTREAMINSTANCE)dwParam1);
1364
1365 case ACMDM_STREAM_SIZE:
1366 return PCM_StreamSize((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMSIZE)dwParam2);
1367
1369 return PCM_StreamConvert((PACMDRVSTREAMINSTANCE)dwParam1, (PACMDRVSTREAMHEADER)dwParam2);
1370
1373 /* this converter is not a hardware driver */
1376 /* this converter is not a filter */
1377 case ACMDM_STREAM_RESET:
1378 /* only needed for asynchronous driver... we aren't, so just say it */
1381 /* nothing special to do here... so don't do anything */
1382 return MMSYSERR_NOTSUPPORTED;
1383
1384 default:
1385 return DefDriverProc(dwDevID, hDriv, wMsg, dwParam1, dwParam2);
1386 }
1387}
LRESULT WINAPI DefDriverProc(DWORD_PTR dwDriverIdentifier, HDRVR hDrv, UINT Msg, LPARAM lParam1, LPARAM lParam2)
Definition: driver.c:554
#define DRV_LOAD(x)
#define DRV_CLOSE
Definition: mmsystem.h:122
#define DRV_QUERYCONFIGURE
Definition: mmsystem.h:126
#define MMSYSERR_NOTSUPPORTED
Definition: mmsystem.h:104
#define DRVCNF_RESTART
Definition: mmsystem.h:135
#define DRV_REMOVE
Definition: mmsystem.h:128
#define DRV_ENABLE
Definition: mmsystem.h:120
#define DRV_CONFIGURE
Definition: mmsystem.h:125
#define DRV_OPEN
Definition: mmsystem.h:121
#define DRV_INSTALL
Definition: mmsystem.h:127
#define DRV_FREE
Definition: mmsystem.h:124
#define DRV_DISABLE
Definition: mmsystem.h:123
#define ACMDM_STREAM_PREPARE
Definition: msacmdrv.h:63
#define ACMDM_STREAM_CLOSE
Definition: msacmdrv.h:59
#define ACMDM_STREAM_CONVERT
Definition: msacmdrv.h:61
#define ACMDM_FORMAT_SUGGEST
Definition: msacmdrv.h:53
#define ACMDM_FILTER_DETAILS
Definition: msacmdrv.h:56
#define ACMDM_HARDWARE_WAVE_CAPS_INPUT
Definition: msacmdrv.h:48
#define ACMDM_DRIVER_NOTIFY
Definition: msacmdrv.h:45
#define ACMDM_FORMAT_DETAILS
Definition: msacmdrv.h:52
#define ACMDM_STREAM_SIZE
Definition: msacmdrv.h:60
#define ACMDM_FILTERTAG_DETAILS
Definition: msacmdrv.h:55
#define ACMDM_HARDWARE_WAVE_CAPS_OUTPUT
Definition: msacmdrv.h:49
#define ACMDM_FORMATTAG_DETAILS
Definition: msacmdrv.h:51
#define ACMDM_STREAM_UNPREPARE
Definition: msacmdrv.h:64
#define ACMDM_STREAM_OPEN
Definition: msacmdrv.h:58
#define ACMDM_DRIVER_DETAILS
Definition: msacmdrv.h:46
#define ACMDM_STREAM_RESET
Definition: msacmdrv.h:62
static LRESULT PCM_StreamOpen(PACMDRVSTREAMINSTANCE adsi)
static DWORD PCM_drvOpen(LPCSTR str, PACMDRVOPENDESCW adod)
Definition: pcmconverter.c:54
static LRESULT PCM_StreamConvert(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMHEADER adsh)
static LRESULT PCM_DriverDetails(PACMDRIVERDETAILSW add)
Definition: pcmconverter.c:972
static LRESULT PCM_FormatDetails(PACMFORMATDETAILSW afd, DWORD dwQuery)
static LRESULT PCM_FormatTagDetails(PACMFORMATTAGDETAILSW aftd, DWORD dwQuery)
static LRESULT PCM_StreamSize(PACMDRVSTREAMINSTANCE adsi, PACMDRVSTREAMSIZE adss)
static DWORD PCM_drvClose(DWORD dwDevID)
Definition: pcmconverter.c:66
static LRESULT PCM_FormatSuggest(PACMDRVFORMATSUGGEST adfs)
static LRESULT PCM_StreamClose(PACMDRVSTREAMINSTANCE adsi)
int WINAPI MessageBoxA(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
#define MB_OK
Definition: winuser.h:790
char * LPSTR
Definition: xmlstorage.h:182

◆ PCM_drvClose()

static DWORD PCM_drvClose ( DWORD  dwDevID)
static

Definition at line 66 of file pcmconverter.c.

67{
68 TRACE("(%d)\n", dwDevID);
69
70 return 1;
71}

Referenced by PCM_DriverProc().

◆ PCM_drvOpen()

static DWORD PCM_drvOpen ( LPCSTR  str,
PACMDRVOPENDESCW  adod 
)
static

Definition at line 54 of file pcmconverter.c.

55{
56 TRACE("(%p, %p)\n", str, adod);
57
58 return (adod == NULL) ||
61}
const WCHAR * str
FOURCC fccType
Definition: msacmdrv.h:87
FOURCC fccComp
Definition: msacmdrv.h:88

Referenced by PCM_DriverProc().

◆ PCM_FormatDetails()

static LRESULT PCM_FormatDetails ( PACMFORMATDETAILSW  afd,
DWORD  dwQuery 
)
static

Definition at line 1045 of file pcmconverter.c.

1046{
1047 TRACE("(%p, %08x)\n", afd, dwQuery);
1048
1049 switch (dwQuery) {
1051 if (PCM_GetFormatIndex(afd->pwfx) == 0xFFFFFFFF) {
1052 WARN("not possible\n");
1053 return ACMERR_NOTPOSSIBLE;
1054 }
1055 break;
1059 afd->pwfx->nChannels = PCM_Formats[afd->dwFormatIndex].nChannels;
1060 afd->pwfx->nSamplesPerSec = PCM_Formats[afd->dwFormatIndex].rate;
1061 afd->pwfx->wBitsPerSample = PCM_Formats[afd->dwFormatIndex].nBits;
1062 /* native MSACM uses a PCMWAVEFORMAT structure, so cbSize is not
1063 * accessible afd->pwfx->cbSize = 0;
1064 */
1065 afd->pwfx->nBlockAlign =
1066 (afd->pwfx->nChannels * afd->pwfx->wBitsPerSample) / 8;
1067 afd->pwfx->nAvgBytesPerSec =
1068 afd->pwfx->nSamplesPerSec * afd->pwfx->nBlockAlign;
1069 break;
1070 default:
1071 WARN("Unsupported query %08x\n", dwQuery);
1072 return MMSYSERR_NOTSUPPORTED;
1073 }
1074
1077 afd->szFormat[0] = 0; /* let MSACM format this for us... */
1078 afd->cbwfx = sizeof(PCMWAVEFORMAT);
1079
1080 return MMSYSERR_NOERROR;
1081}
#define WAVE_FORMAT_PCM
Definition: constants.h:425
#define WARN(fmt,...)
Definition: debug.h:112
#define assert(x)
Definition: debug.h:53
struct pcmwaveformat_tag PCMWAVEFORMAT
#define ACMERR_NOTPOSSIBLE
Definition: msacm.h:36
#define ACM_FORMATDETAILSF_FORMAT
Definition: msacm.h:161
#define ACM_FORMATDETAILSF_INDEX
Definition: msacm.h:160
static DWORD PCM_GetFormatIndex(LPWAVEFORMATEX wfx)
Definition: pcmconverter.c:110
static const struct @481 PCM_Formats[]
WCHAR szFormat[ACMFORMATDETAILS_FORMAT_CHARS]
Definition: msacm.h:509
DWORD dwFormatTag
Definition: msacm.h:505
DWORD dwFormatIndex
Definition: msacm.h:504
DWORD fdwSupport
Definition: msacm.h:506
PWAVEFORMATEX pwfx
Definition: msacm.h:507
WORD nBlockAlign
Definition: mmreg.h:82
DWORD nAvgBytesPerSec
Definition: mmreg.h:81
DWORD nSamplesPerSec
Definition: mmreg.h:80
WORD nChannels
Definition: mmreg.h:79
WORD wFormatTag
Definition: mmreg.h:78
WORD wBitsPerSample
Definition: mmreg.h:83

Referenced by PCM_DriverProc().

◆ PCM_FormatSuggest()

static LRESULT PCM_FormatSuggest ( PACMDRVFORMATSUGGEST  adfs)
static

Definition at line 1087 of file pcmconverter.c.

1088{
1089 TRACE("(%p)\n", adfs);
1090
1091 /* some tests ... */
1092 if (adfs->cbwfxSrc < sizeof(PCMWAVEFORMAT) ||
1093 adfs->cbwfxDst < sizeof(PCMWAVEFORMAT) ||
1094 PCM_GetFormatIndex(adfs->pwfxSrc) == 0xFFFFFFFF) {
1095 WARN("not possible\n");
1096 return ACMERR_NOTPOSSIBLE;
1097 }
1098
1099 /* is no suggestion for destination, then copy source value */
1101 adfs->pwfxDst->nChannels = adfs->pwfxSrc->nChannels;
1102 }
1105 }
1108 }
1110 if (adfs->pwfxSrc->wFormatTag != WAVE_FORMAT_PCM) {
1111 WARN("source format 0x%x not supported\n", adfs->pwfxSrc->wFormatTag);
1112 return ACMERR_NOTPOSSIBLE;
1113 }
1114 adfs->pwfxDst->wFormatTag = adfs->pwfxSrc->wFormatTag;
1115 } else {
1116 if (adfs->pwfxDst->wFormatTag != WAVE_FORMAT_PCM) {
1117 WARN("destination format 0x%x not supported\n", adfs->pwfxDst->wFormatTag);
1118 return ACMERR_NOTPOSSIBLE;
1119 }
1120 }
1121 /* check if result is ok */
1122 if (PCM_GetFormatIndex(adfs->pwfxDst) == 0xFFFFFFFF) {
1123 WARN("not possible\n");
1124 return ACMERR_NOTPOSSIBLE;
1125 }
1126
1127 /* recompute other values */
1128 adfs->pwfxDst->nBlockAlign = (adfs->pwfxDst->nChannels * adfs->pwfxDst->wBitsPerSample) / 8;
1130
1131 return MMSYSERR_NOERROR;
1132}
#define ACM_FORMATSUGGESTF_WFORMATTAG
Definition: msacm.h:174
#define ACM_FORMATSUGGESTF_NCHANNELS
Definition: msacm.h:175
#define ACM_FORMATSUGGESTF_WBITSPERSAMPLE
Definition: msacm.h:177
#define ACM_FORMATSUGGESTF_NSAMPLESPERSEC
Definition: msacm.h:176
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:151
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:153

Referenced by PCM_DriverProc().

◆ PCM_FormatTagDetails()

static LRESULT PCM_FormatTagDetails ( PACMFORMATTAGDETAILSW  aftd,
DWORD  dwQuery 
)
static

Definition at line 1002 of file pcmconverter.c.

1003{
1004 TRACE("(%p, %08x)\n", aftd, dwQuery);
1005
1006 switch (dwQuery) {
1008 if (aftd->dwFormatTagIndex != 0) {
1009 WARN("not possible\n");
1010 return ACMERR_NOTPOSSIBLE;
1011 }
1012 break;
1014 if (aftd->dwFormatTag != WAVE_FORMAT_PCM) {
1015 WARN("not possible\n");
1016 return ACMERR_NOTPOSSIBLE;
1017 }
1018 break;
1020 if (aftd->dwFormatTag != WAVE_FORMAT_UNKNOWN &&
1021 aftd->dwFormatTag != WAVE_FORMAT_PCM) {
1022 WARN("not possible\n");
1023 return ACMERR_NOTPOSSIBLE;
1024 }
1025 break;
1026 default:
1027 WARN("Unsupported query %08x\n", dwQuery);
1028 return MMSYSERR_NOTSUPPORTED;
1029 }
1030
1031 aftd->dwFormatTagIndex = 0;
1033 aftd->cbFormatSize = sizeof(PCMWAVEFORMAT);
1036 aftd->szFormatTag[0] = 0;
1037
1038 return MMSYSERR_NOERROR;
1039}
#define WAVE_FORMAT_UNKNOWN
Definition: mmreg.h:95
#define ACM_FORMATTAGDETAILSF_FORMATTAG
Definition: msacm.h:183
#define ACM_FORMATTAGDETAILSF_LARGESTSIZE
Definition: msacm.h:184
#define ACM_FORMATTAGDETAILSF_INDEX
Definition: msacm.h:182
WCHAR szFormatTag[ACMFORMATTAGDETAILS_FORMATTAG_CHARS]
Definition: msacm.h:535
DWORD dwFormatTagIndex
Definition: msacm.h:530
DWORD cStandardFormats
Definition: msacm.h:534

Referenced by PCM_DriverProc().

◆ PCM_GetFormatIndex()

static DWORD PCM_GetFormatIndex ( LPWAVEFORMATEX  wfx)
static

Definition at line 110 of file pcmconverter.c.

111{
112 unsigned int i;
113 TRACE("(%p)\n", wfx);
114
115 for (i = 0; i < ARRAY_SIZE(PCM_Formats); i++) {
116 if (wfx->nChannels == PCM_Formats[i].nChannels &&
117 wfx->nSamplesPerSec == PCM_Formats[i].rate &&
118 wfx->wBitsPerSample == PCM_Formats[i].nBits)
119 return i;
120 }
121 return 0xFFFFFFFF;
122}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by PCM_FormatDetails(), and PCM_FormatSuggest().

◆ PCM_round()

static DWORD PCM_round ( DWORD  a,
DWORD  b,
DWORD  c 
)
inlinestatic

Definition at line 1231 of file pcmconverter.c.

1232{
1233 assert(c);
1234 /* to be sure, always return an entire number of c... */
1235 return ((double)a * (double)b + (double)c - 1) / (double)c;
1236}
const GLubyte * c
Definition: glext.h:8905
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
Definition: string.c:80

Referenced by PCM_StreamSize().

◆ PCM_StreamClose()

static LRESULT PCM_StreamClose ( PACMDRVSTREAMINSTANCE  adsi)
static

Definition at line 1219 of file pcmconverter.c.

1220{
1221 TRACE("(%p)\n", adsi);
1222
1223 HeapFree(GetProcessHeap(), 0, (void*)adsi->dwDriver);
1224 return MMSYSERR_NOERROR;
1225}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapFree(x, y, z)
Definition: compat.h:735
DWORD_PTR dwDriver
Definition: msacmdrv.h:107

Referenced by PCM_DriverProc().

◆ PCM_StreamConvert()

static LRESULT PCM_StreamConvert ( PACMDRVSTREAMINSTANCE  adsi,
PACMDRVSTREAMHEADER  adsh 
)
static

Definition at line 1273 of file pcmconverter.c.

1274{
1275 AcmPcmData* apd = (AcmPcmData*)adsi->dwDriver;
1276 DWORD nsrc = NUM_OF(adsh->cbSrcLength, adsi->pwfxSrc->nBlockAlign);
1277 DWORD ndst = NUM_OF(adsh->cbDstLength, adsi->pwfxDst->nBlockAlign);
1278
1279 TRACE("(%p, %p)\n", adsi, adsh);
1280
1281 TRACE("nsrc=%d,adsh->cbSrcLength=%d\n", nsrc, adsh->cbSrcLength);
1282 TRACE("ndst=%d,adsh->cbDstLength=%d\n", ndst, adsh->cbDstLength);
1283 TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%u, nAvgBytesPerSec=%u, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n",
1285 adsi->pwfxSrc->nBlockAlign, adsi->pwfxSrc->wBitsPerSample, adsi->pwfxSrc->cbSize);
1286 TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%u, nAvgBytesPerSec=%u, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n",
1288 adsi->pwfxDst->nBlockAlign, adsi->pwfxDst->wBitsPerSample, adsi->pwfxDst->cbSize);
1289
1290 if (adsh->fdwConvert &
1294 FIXME("Unsupported fdwConvert (%08x), ignoring it\n", adsh->fdwConvert);
1295 }
1296 /* ACM_STREAMCONVERTF_BLOCKALIGN
1297 * currently all conversions are block aligned, so do nothing for this flag
1298 * ACM_STREAMCONVERTF_END
1299 * no pending data, so do nothing for this flag
1300 */
1301 if ((adsh->fdwConvert & ACM_STREAMCONVERTF_START) &&
1302 (adsi->fdwDriver & PCM_RESAMPLE)) {
1303 }
1304
1305 /* do the job */
1306 if (adsi->fdwDriver & PCM_RESAMPLE) {
1307 apd->cvt.cvtChangeRate(adsi->pwfxSrc->nSamplesPerSec, adsh->pbSrc, &nsrc,
1308 adsi->pwfxDst->nSamplesPerSec, adsh->pbDst, &ndst);
1309 } else {
1310 if (nsrc < ndst) ndst = nsrc; else nsrc = ndst;
1311
1312 /* nsrc is now equal to ndst */
1313 apd->cvt.cvtKeepRate(adsh->pbSrc, nsrc, adsh->pbDst);
1314 }
1315
1316 adsh->cbSrcLengthUsed = nsrc * adsi->pwfxSrc->nBlockAlign;
1317 adsh->cbDstLengthUsed = ndst * adsi->pwfxDst->nBlockAlign;
1318
1319 return MMSYSERR_NOERROR;
1320}
#define FIXME(fmt,...)
Definition: debug.h:111
#define ACM_STREAMCONVERTF_START
Definition: msacm.h:206
#define ACM_STREAMCONVERTF_BLOCKALIGN
Definition: msacm.h:205
#define ACM_STREAMCONVERTF_END
Definition: msacm.h:207
#define NUM_OF(a, b)
Definition: pcmconverter.c:73
#define PCM_RESAMPLE
Definition: pcmconverter.c:76
PWAVEFORMATEX pwfxSrc
Definition: msacmdrv.h:100
PWAVEFORMATEX pwfxDst
Definition: msacmdrv.h:101
WORD cbSize
Definition: mmreg.h:84
PCM_CONVERT_KEEP_RATE cvtKeepRate
Definition: pcmconverter.c:86
PCM_CONVERT_CHANGE_RATE cvtChangeRate
Definition: pcmconverter.c:87
union tagAcmPcmData::@482 cvt

Referenced by PCM_DriverProc().

◆ PCM_StreamOpen()

static LRESULT PCM_StreamOpen ( PACMDRVSTREAMINSTANCE  adsi)
static

Definition at line 1138 of file pcmconverter.c.

1139{
1140 AcmPcmData* apd;
1141 int idx;
1142 DWORD flags;
1143
1144 TRACE("(%p)\n", adsi);
1145
1147
1148 switch(adsi->pwfxSrc->wBitsPerSample){
1149 case 8:
1150 idx = 0;
1151 break;
1152 case 16:
1153 idx = 12;
1154 break;
1155 case 24:
1156 if (adsi->pwfxSrc->nBlockAlign != 3 * adsi->pwfxSrc->nChannels) {
1157 FIXME("Source: 24-bit samples must be packed\n");
1158 return MMSYSERR_NOTSUPPORTED;
1159 }
1160 idx = 24;
1161 break;
1162 default:
1163 FIXME("Unsupported source bit depth: %u\n", adsi->pwfxSrc->wBitsPerSample);
1164 return MMSYSERR_NOTSUPPORTED;
1165 }
1166
1167 switch(adsi->pwfxDst->wBitsPerSample){
1168 case 8:
1169 break;
1170 case 16:
1171 idx += 4;
1172 break;
1173 case 24:
1174 if (adsi->pwfxDst->nBlockAlign != 3 * adsi->pwfxDst->nChannels) {
1175 FIXME("Destination: 24-bit samples must be packed\n");
1176 return MMSYSERR_NOTSUPPORTED;
1177 }
1178 idx += 8;
1179 break;
1180 default:
1181 FIXME("Unsupported destination bit depth: %u\n", adsi->pwfxDst->wBitsPerSample);
1182 return MMSYSERR_NOTSUPPORTED;
1183 }
1184
1185 if (adsi->pwfxSrc->nChannels == 1) idx += 2;
1186
1187 if (adsi->pwfxDst->nChannels == 1) idx += 1;
1188
1189 apd = HeapAlloc(GetProcessHeap(), 0, sizeof(AcmPcmData));
1190 if (!apd)
1191 return MMSYSERR_NOMEM;
1192
1193 if (adsi->pwfxSrc->nSamplesPerSec == adsi->pwfxDst->nSamplesPerSec) {
1194 flags = 0;
1196 } else {
1199 }
1200
1201 if(!apd->cvt.cvtChangeRate && !apd->cvt.cvtKeepRate){
1202 FIXME("Unimplemented conversion from %u -> %u bps\n",
1203 adsi->pwfxSrc->wBitsPerSample,
1204 adsi->pwfxDst->wBitsPerSample);
1205 HeapFree(GetProcessHeap(), 0, apd);
1206 return MMSYSERR_NOTSUPPORTED;
1207 }
1208
1209 adsi->dwDriver = (DWORD_PTR)apd;
1210 adsi->fdwDriver = flags;
1211
1212 return MMSYSERR_NOERROR;
1213}
unsigned int idx
Definition: utils.c:41
#define HeapAlloc
Definition: compat.h:733
GLbitfield flags
Definition: glext.h:7161
#define MMSYSERR_NOMEM
Definition: mmsystem.h:103
#define ACM_STREAMOPENF_ASYNC
Definition: msacm.h:214
static const PCM_CONVERT_CHANGE_RATE PCM_ConvertChangeRate[]
Definition: pcmconverter.c:956
static const PCM_CONVERT_KEEP_RATE PCM_ConvertKeepRate[]
Definition: pcmconverter.c:525
#define DWORD_PTR
Definition: treelist.c:76

Referenced by PCM_DriverProc().

◆ PCM_StreamSize()

static LRESULT PCM_StreamSize ( PACMDRVSTREAMINSTANCE  adsi,
PACMDRVSTREAMSIZE  adss 
)
static

Definition at line 1242 of file pcmconverter.c.

1243{
1244 DWORD srcMask = ~(adsi->pwfxSrc->nBlockAlign - 1);
1245 DWORD dstMask = ~(adsi->pwfxDst->nBlockAlign - 1);
1246
1247 TRACE("(%p, %p)\n", adsi, adss);
1248
1249 switch (adss->fdwSize) {
1251 /* cbDstLength => cbSrcLength */
1252 adss->cbSrcLength = PCM_round(adss->cbDstLength & dstMask,
1253 adsi->pwfxSrc->nAvgBytesPerSec,
1254 adsi->pwfxDst->nAvgBytesPerSec) & srcMask;
1255 break;
1257 /* cbSrcLength => cbDstLength */
1258 adss->cbDstLength = PCM_round(adss->cbSrcLength & srcMask,
1259 adsi->pwfxDst->nAvgBytesPerSec,
1261 break;
1262 default:
1263 WARN("Unsupported query %08x\n", adss->fdwSize);
1264 return MMSYSERR_NOTSUPPORTED;
1265 }
1266 return MMSYSERR_NOERROR;
1267}
GLuint GLuint dstMask
Definition: glext.h:9513
#define ACM_STREAMSIZEF_SOURCE
Definition: msacm.h:217
#define ACM_STREAMSIZEF_DESTINATION
Definition: msacm.h:218
static DWORD PCM_round(DWORD a, DWORD b, DWORD c)

Referenced by PCM_DriverProc().

◆ R16()

static short R16 ( const unsigned char src)
inlinestatic

Definition at line 181 of file pcmconverter.c.

182{
183 return (short)((unsigned short)src[0] | ((unsigned short)src[1] << 8));
184}
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94

Referenced by cvtMM1616C(), cvtMM168C(), cvtMM168K(), cvtMS1616C(), cvtMS1616K(), cvtMS168C(), cvtMS168K(), cvtSM1616C(), cvtSM1616K(), cvtSM168C(), cvtSM168K(), cvtSS1616C(), cvtSS168C(), and cvtSS168K().

◆ R24()

static int R24 ( const unsigned char src)
inlinestatic

Definition at line 193 of file pcmconverter.c.

194{
195 return ((int)src[0] | (int)src[1] << 8 | (int)src[2] << 16) << 8;
196}

Referenced by cvtMM2416K(), cvtMM2424C(), cvtMM248K(), cvtMS2416K(), cvtMS2424C(), cvtMS248K(), cvtSM2416K(), cvtSM2424C(), cvtSM248K(), cvtSS2416K(), cvtSS2424C(), and cvtSS248K().

◆ W16()

static void W16 ( unsigned char dst,
short  s 
)
inlinestatic

◆ W24()

static void W24 ( unsigned char dst,
int  s 
)
inlinestatic

Definition at line 214 of file pcmconverter.c.

215{
216 dst[0] = HIBYTE(LOWORD(s));
217 dst[1] = LOBYTE(HIWORD(s));
218 dst[2] = HIBYTE(HIWORD(s));
219}
#define LOWORD(l)
Definition: pedump.c:82

Referenced by cvtMM2424C(), cvtMS2424C(), cvtSM2424C(), and cvtSS2424C().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( msacm  )

Variable Documentation

◆ nBits

int nBits

Definition at line 96 of file pcmconverter.c.

◆ nChannels

◆ PCM_ConvertChangeRate

const PCM_CONVERT_CHANGE_RATE PCM_ConvertChangeRate[]
static
Initial value:
= {
}
static void cvtMS816C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:669
static void cvtSS88C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:546
static void cvtSM816C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:649
static void cvtMS88C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:587
static void cvtSM2424C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:895
static void cvtSS2424C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:874
static void cvtMM2424C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:936
static void cvtMS168C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:751
static void cvtSS816C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:628
static void cvtSS168C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:710
static void cvtMM1616C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:854
static void cvtSM168C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:731
static void cvtSS1616C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:792
static void cvtMM168C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:772
static void cvtMM88C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:608
static void cvtMS2424C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:915
static void cvtMM816C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:690
static void cvtMS1616C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:833
static void cvtSM88C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:567
static void cvtSM1616C(const DWORD srcRate, const unsigned char *src, DWORD *nsrc, const DWORD dstRate, unsigned char *dst, DWORD *ndst)
Definition: pcmconverter.c:813

Definition at line 956 of file pcmconverter.c.

Referenced by PCM_StreamOpen().

◆ PCM_ConvertKeepRate

const PCM_CONVERT_KEEP_RATE PCM_ConvertKeepRate[]
static
Initial value:
= {
}
static void cvtSS88K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:297
static void cvtMS168K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:337
static void cvtMM816K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:403
static void cvtSM1616K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:393
static void cvtSS248K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:472
static void cvtSS2416K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:514
static void cvtMS2416K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:482
static void cvtMS1616K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:349
static void cvtSS1616K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:309
static void cvtSM248K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:453
static void cvtMM88K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:291
static void cvtSM2416K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:494
static void cvtMM168K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:422
static void cvtSS168K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:431
static void cvtMM248K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:463
static void cvtSS816K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:412
static void cvtMS88K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:315
static void cvtMM2416K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:505
static void cvtMS248K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:441
static void cvtSM816K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:371
static void cvtSM168K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:383
static void cvtMM1616K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:303
static void cvtSM88K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:361
static void cvtMS816K(const unsigned char *src, int ns, unsigned char *dst)
Definition: pcmconverter.c:325

Definition at line 525 of file pcmconverter.c.

Referenced by PCM_StreamOpen().

◆ 

const struct { ... } PCM_Formats[]
Initial value:
= {
{1, 8, 8000}, {2, 8, 8000}, {1, 16, 8000}, {2, 16, 8000}, {1, 24, 8000}, {2, 24, 8000},
{1, 8, 11025}, {2, 8, 11025}, {1, 16, 11025}, {2, 16, 11025}, {1, 24, 11025}, {2, 24, 11025},
{1, 8, 22050}, {2, 8, 22050}, {1, 16, 22050}, {2, 16, 22050}, {1, 24, 22050}, {2, 24, 22050},
{1, 8, 44100}, {2, 8, 44100}, {1, 16, 44100}, {2, 16, 44100}, {1, 24, 44100}, {2, 24, 44100},
{1, 8, 48000}, {2, 8, 48000}, {1, 16, 48000}, {2, 16, 48000}, {1, 24, 48000}, {2, 24, 48000},
{1, 8, 96000}, {2, 8, 96000}, {1, 16, 96000}, {2, 16, 96000}, {1, 24, 96000}, {2, 24, 96000},
}

Referenced by PCM_FormatDetails(), PCM_FormatTagDetails(), and PCM_GetFormatIndex().

◆ rate