Lines Matching +full:8 +full:- +full:channel
2 * Linear conversion Plug-In
4 * Abramo Bagnara <abramo@alsa-project.org>
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
48 memcpy(p + data->copy_ofs, src + data->src_ofs, data->copy_bytes); in do_convert()
49 if (data->cvt_endian) in do_convert()
51 tmp ^= data->flip; in do_convert()
52 memcpy(dst, p + data->dst_ofs, data->dst_bytes); in do_convert()
60 struct linear_priv *data = (struct linear_priv *)plugin->extra_data; in convert()
61 int channel; in convert() local
62 int nchannels = plugin->src_format.channels; in convert()
63 for (channel = 0; channel < nchannels; ++channel) { in convert()
68 if (!src_channels[channel].enabled) { in convert()
69 if (dst_channels[channel].wanted) in convert()
70 snd_pcm_area_silence(&dst_channels[channel].area, 0, frames, plugin->dst_format.format); in convert()
71 dst_channels[channel].enabled = 0; in convert()
74 dst_channels[channel].enabled = 1; in convert()
75 src = src_channels[channel].area.addr + src_channels[channel].area.first / 8; in convert()
76 dst = dst_channels[channel].area.addr + dst_channels[channel].area.first / 8; in convert()
77 src_step = src_channels[channel].area.step / 8; in convert()
78 dst_step = dst_channels[channel].area.step / 8; in convert()
80 while (frames1-- > 0) { in convert()
94 return -ENXIO; in linear_transfer()
99 unsigned int channel; in linear_transfer() local
100 for (channel = 0; channel < plugin->src_format.channels; channel++) { in linear_transfer()
101 if (snd_BUG_ON(src_channels[channel].area.first % 8 || in linear_transfer()
102 src_channels[channel].area.step % 8)) in linear_transfer()
103 return -ENXIO; in linear_transfer()
104 if (snd_BUG_ON(dst_channels[channel].area.first % 8 || in linear_transfer()
105 dst_channels[channel].area.step % 8)) in linear_transfer()
106 return -ENXIO; in linear_transfer()
121 src_bytes = snd_pcm_format_width(src_format) / 8; in init_data()
122 dst_bytes = snd_pcm_format_width(dst_format) / 8; in init_data()
126 data->dst_bytes = dst_bytes; in init_data()
127 data->cvt_endian = src_le != dst_le; in init_data()
128 data->copy_bytes = src_bytes < dst_bytes ? src_bytes : dst_bytes; in init_data()
130 data->copy_ofs = 4 - data->copy_bytes; in init_data()
131 data->src_ofs = src_bytes - data->copy_bytes; in init_data()
133 data->src_ofs = snd_pcm_format_physical_width(src_format) / 8 - in init_data()
136 data->dst_ofs = 4 - data->dst_bytes; in init_data()
138 data->dst_ofs = snd_pcm_format_physical_width(dst_format) / 8 - in init_data()
143 data->flip = (__force u32)cpu_to_le32(0x80000000); in init_data()
145 data->flip = (__force u32)cpu_to_be32(0x80000000); in init_data()
159 return -ENXIO; in snd_pcm_plugin_build_linear()
162 if (snd_BUG_ON(src_format->rate != dst_format->rate)) in snd_pcm_plugin_build_linear()
163 return -ENXIO; in snd_pcm_plugin_build_linear()
164 if (snd_BUG_ON(src_format->channels != dst_format->channels)) in snd_pcm_plugin_build_linear()
165 return -ENXIO; in snd_pcm_plugin_build_linear()
166 if (snd_BUG_ON(!snd_pcm_format_linear(src_format->format) || in snd_pcm_plugin_build_linear()
167 !snd_pcm_format_linear(dst_format->format))) in snd_pcm_plugin_build_linear()
168 return -ENXIO; in snd_pcm_plugin_build_linear()
175 data = (struct linear_priv *)plugin->extra_data; in snd_pcm_plugin_build_linear()
176 init_data(data, src_format->format, dst_format->format); in snd_pcm_plugin_build_linear()
177 plugin->transfer = linear_transfer; in snd_pcm_plugin_build_linear()