]>
iEval git - fdkaac.git/blob - src/lpcm.h
2 * Copyright (C) 2013 nu774
3 * For conditions of distribution and use, see copyright notice in COPYING
13 PCM_TYPE_SINT_BE
= (8|1),
14 PCM_TYPE_UINT_BE
= (8|2),
15 PCM_TYPE_FLOAT_BE
= (8|4),
18 typedef struct pcm_sample_description_t
{
19 enum pcm_type sample_type
;
21 uint8_t bits_per_channel
;
22 uint8_t bytes_per_frame
;
23 uint8_t channels_per_frame
;
24 uint32_t channel_mask
;
25 } pcm_sample_description_t
;
27 #define PCM_IS_SINT(desc) ((desc)->sample_type & 1)
28 #define PCM_IS_UINT(desc) ((desc)->sample_type & 2)
29 #define PCM_IS_FLOAT(desc) ((desc)->sample_type & 4)
30 #define PCM_IS_BIG_ENDIAN(desc) ((desc)->sample_type & 8)
31 #define PCM_BYTES_PER_CHANNEL(desc) \
32 ((desc)->bytes_per_frame / (desc)->channels_per_frame)
34 #if defined(_MSC_VER) && _MSC_VER < 1800
36 static inline int lrint(double x
)
46 # include <emmintrin.h>
47 static inline int lrint(double x
)
49 return _mm_cvtsd_si32(_mm_load_sd(&x
));
55 inline double pcm_clip(double n
, double min_value
, double max_value
)
59 else if (n
> max_value
)
64 int pcm_convert_to_native_sint16(const pcm_sample_description_t
*format
,
65 const void *input
, uint32_t nframes
,
This page took 0.044245 seconds and 4 git commands to generate.