summaryrefslogtreecommitdiff
path: root/apps/codecs/libpcm
diff options
context:
space:
mode:
Diffstat (limited to 'apps/codecs/libpcm')
-rw-r--r--apps/codecs/libpcm/adpcm_seek.h2
-rw-r--r--apps/codecs/libpcm/ima_adpcm_common.c16
-rw-r--r--apps/codecs/libpcm/ima_adpcm_common.h1
-rw-r--r--apps/codecs/libpcm/pcm_common.h2
4 files changed, 10 insertions, 11 deletions
diff --git a/apps/codecs/libpcm/adpcm_seek.h b/apps/codecs/libpcm/adpcm_seek.h
index 66ec390097..2dd3f000b1 100644
--- a/apps/codecs/libpcm/adpcm_seek.h
+++ b/apps/codecs/libpcm/adpcm_seek.h
@@ -21,9 +21,9 @@
21#ifndef CODEC_LIBPCM_ADPCM_SEEK_H 21#ifndef CODEC_LIBPCM_ADPCM_SEEK_H
22#define CODEC_LIBPCM_ADPCM_SEEK_H 22#define CODEC_LIBPCM_ADPCM_SEEK_H
23 23
24#include <sys/types.h>
25#include <stdbool.h> 24#include <stdbool.h>
26#include <inttypes.h> 25#include <inttypes.h>
26#include <string.h>
27 27
28struct adpcm_data { 28struct adpcm_data {
29 int16_t pcmdata[2]; 29 int16_t pcmdata[2];
diff --git a/apps/codecs/libpcm/ima_adpcm_common.c b/apps/codecs/libpcm/ima_adpcm_common.c
index ff5051f166..724cce31b0 100644
--- a/apps/codecs/libpcm/ima_adpcm_common.c
+++ b/apps/codecs/libpcm/ima_adpcm_common.c
@@ -63,7 +63,7 @@ static const int index_tables[4][16] ICONST_ATTR = {
63}; 63};
64 64
65static int32_t pcmdata[2]; 65static int32_t pcmdata[2];
66static int8_t index[2]; 66static int8_t indices[2];
67 67
68static int adpcm_data_size; 68static int adpcm_data_size;
69static uint8_t step_mask; 69static uint8_t step_mask;
@@ -107,7 +107,7 @@ void set_decode_parameters(int channels, int32_t *init_pcmdata, int8_t *init_ind
107 for (ch = 0; ch < channels; ch++) 107 for (ch = 0; ch < channels; ch++)
108 { 108 {
109 pcmdata[ch] = init_pcmdata[ch]; 109 pcmdata[ch] = init_pcmdata[ch];
110 index[ch] = init_index[ch]; 110 indices[ch] = init_index[ch];
111 } 111 }
112} 112}
113 113
@@ -121,7 +121,7 @@ int16_t create_pcmdata(int ch, uint8_t nibble)
121{ 121{
122 int check_bit = 1 << step_shift; 122 int check_bit = 1 << step_shift;
123 int32_t delta = 0; 123 int32_t delta = 0;
124 int16_t step = step_table[index[ch]]; 124 int16_t step = step_table[indices[ch]];
125 125
126 do { 126 do {
127 if (nibble & check_bit) 127 if (nibble & check_bit)
@@ -136,8 +136,8 @@ int16_t create_pcmdata(int ch, uint8_t nibble)
136 else 136 else
137 pcmdata[ch] += delta; 137 pcmdata[ch] += delta;
138 138
139 index[ch] += use_index_table[nibble & step_mask]; 139 indices[ch] += use_index_table[nibble & step_mask];
140 CLIP(index[ch], 0, 88); 140 CLIP(indices[ch], 0, 88);
141 141
142 CLIP(pcmdata[ch], -32768, 32767); 142 CLIP(pcmdata[ch], -32768, 32767);
143 143
@@ -150,7 +150,7 @@ int16_t create_pcmdata(int ch, uint8_t nibble)
150int16_t create_pcmdata_size4(int ch, uint8_t nibble) 150int16_t create_pcmdata_size4(int ch, uint8_t nibble)
151{ 151{
152 int32_t delta; 152 int32_t delta;
153 int16_t step = step_table[index[ch]]; 153 int16_t step = step_table[indices[ch]];
154 154
155 delta = (step >> 3); 155 delta = (step >> 3);
156 if (nibble & 4) delta += step; 156 if (nibble & 4) delta += step;
@@ -162,8 +162,8 @@ int16_t create_pcmdata_size4(int ch, uint8_t nibble)
162 else 162 else
163 pcmdata[ch] += delta; 163 pcmdata[ch] += delta;
164 164
165 index[ch] += use_index_table[nibble & 0x07]; 165 indices[ch] += use_index_table[nibble & 0x07];
166 CLIP(index[ch], 0, 88); 166 CLIP(indices[ch], 0, 88);
167 167
168 CLIP(pcmdata[ch], -32768, 32767); 168 CLIP(pcmdata[ch], -32768, 32767);
169 169
diff --git a/apps/codecs/libpcm/ima_adpcm_common.h b/apps/codecs/libpcm/ima_adpcm_common.h
index 0a2129bdf2..46fd6083ec 100644
--- a/apps/codecs/libpcm/ima_adpcm_common.h
+++ b/apps/codecs/libpcm/ima_adpcm_common.h
@@ -21,7 +21,6 @@
21#ifndef CODEC_LIBPCM_IMA_ADPCM_COMMON_H 21#ifndef CODEC_LIBPCM_IMA_ADPCM_COMMON_H
22#define CODEC_LIBPCM_IMA_ADPCM_COMMON_H 22#define CODEC_LIBPCM_IMA_ADPCM_COMMON_H
23 23
24#include <sys/types.h>
25#include <stdbool.h> 24#include <stdbool.h>
26#include <inttypes.h> 25#include <inttypes.h>
27 26
diff --git a/apps/codecs/libpcm/pcm_common.h b/apps/codecs/libpcm/pcm_common.h
index 91c3ab7f1e..90e29c98ee 100644
--- a/apps/codecs/libpcm/pcm_common.h
+++ b/apps/codecs/libpcm/pcm_common.h
@@ -21,9 +21,9 @@
21#ifndef CODEC_LIBPCM_PCM_COMMON_H 21#ifndef CODEC_LIBPCM_PCM_COMMON_H
22#define CODEC_LIBPCM_PCM_COMMON_H 22#define CODEC_LIBPCM_PCM_COMMON_H
23 23
24#include <sys/types.h>
25#include <stdbool.h> 24#include <stdbool.h>
26#include <inttypes.h> 25#include <inttypes.h>
26#include <string.h>
27 27
28/* decoded pcm sample depth (sample 28bit + sign 1bit) */ 28/* decoded pcm sample depth (sample 28bit + sign 1bit) */
29#define PCM_OUTPUT_DEPTH 29 29#define PCM_OUTPUT_DEPTH 29