mirror of
				https://github.com/alsa-project/alsa-lib.git
				synced 2025-11-03 09:01:52 -05:00 
			
		
		
		
	Removed voices and volbal plugins. Rewritten interleave plugin. Changed some name in linear
This commit is contained in:
		
							parent
							
								
									afbaf0fde9
								
							
						
					
					
						commit
						43e11d788a
					
				
					 5 changed files with 368 additions and 393 deletions
				
			
		| 
						 | 
				
			
			@ -29,10 +29,15 @@ typedef snd_pcm_runtime_t PLUGIN_BASE;
 | 
			
		|||
#define snd_pcm_plugin_first(pb, channel) ((pb)->oss.plugin_first)
 | 
			
		||||
#define snd_pcm_plugin_last(pb, channel) ((pb)->oss.plugin_last)
 | 
			
		||||
#define snd_pcm_plugin_append(pb, channel, plugin) snd_pcm_oss_plugin_append(pb, plugin)
 | 
			
		||||
#define my_calloc(size) snd_kcalloc(size, GFP_KERNEL)
 | 
			
		||||
#define my_free(ptr) snd_kfree(ptr)
 | 
			
		||||
#else
 | 
			
		||||
#include <malloc.h>
 | 
			
		||||
#include <errno.h>
 | 
			
		||||
#include "pcm_local.h"
 | 
			
		||||
typedef snd_pcm_t PLUGIN_BASE;
 | 
			
		||||
#define my_calloc(size) calloc(1, size)
 | 
			
		||||
#define my_free(ptr) free(ptr)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -225,6 +230,7 @@ int snd_pcm_plugin_hwparams(snd_pcm_channel_params_t *params,
 | 
			
		|||
	return 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#define ROUTE_PLUGIN_RESOLUTION 16
 | 
			
		||||
 | 
			
		||||
int snd_pcm_plugin_format(PLUGIN_BASE *pb, 
 | 
			
		||||
			  snd_pcm_channel_params_t *params, 
 | 
			
		||||
| 
						 | 
				
			
			@ -263,11 +269,46 @@ int snd_pcm_plugin_format(PLUGIN_BASE *pb,
 | 
			
		|||
		 dstparams.format.format,
 | 
			
		||||
		 dstparams.format.rate,
 | 
			
		||||
		 dstparams.format.voices);
 | 
			
		||||
 | 
			
		||||
	/* voices reduction */
 | 
			
		||||
	if (srcparams->format.voices > dstparams.format.voices) {
 | 
			
		||||
		int sv = srcparams->format.voices;
 | 
			
		||||
		int dv = dstparams.format.voices;
 | 
			
		||||
		int *ttable = my_calloc(dv*sv*sizeof(*ttable));
 | 
			
		||||
#if 1
 | 
			
		||||
		if (sv == 2 && dv == 1) {
 | 
			
		||||
			ttable[0] = ROUTE_PLUGIN_RESOLUTION / 2;
 | 
			
		||||
			ttable[1] = ROUTE_PLUGIN_RESOLUTION / 2;
 | 
			
		||||
		} else
 | 
			
		||||
#endif
 | 
			
		||||
		{
 | 
			
		||||
			int v;
 | 
			
		||||
			for (v = 0; v < dv; ++v)
 | 
			
		||||
				ttable[v * sv + v] = ROUTE_PLUGIN_RESOLUTION;
 | 
			
		||||
		}
 | 
			
		||||
		tmpparams.format.voices = dstparams.format.voices;
 | 
			
		||||
		err = snd_pcm_plugin_build_route(&srcparams->format,
 | 
			
		||||
						  &tmpparams.format,
 | 
			
		||||
						  ttable,
 | 
			
		||||
						  &plugin);
 | 
			
		||||
		my_free(ttable);
 | 
			
		||||
		pdprintf("params voices reduction: src=%i, dst=%i returns %i\n", srcparams->format.voices, tmpparams.format.voices, err);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_pcm_plugin_free(plugin);
 | 
			
		||||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
		err = snd_pcm_plugin_append(pb, params->channel, plugin);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_pcm_plugin_free(plugin);
 | 
			
		||||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
		srcparams->format.voices = tmpparams.format.voices;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
	/* Convert to interleaved format if needed */
 | 
			
		||||
	if (!srcparams->format.interleave &&
 | 
			
		||||
	    (srcparams->format.voices != dstparams.format.voices ||
 | 
			
		||||
	     (srcparams->format.rate != dstparams.format.rate &&
 | 
			
		||||
	      srcparams->format.voices > 1))) {
 | 
			
		||||
	    srcparams->format.voices > 1 &&
 | 
			
		||||
	    srcparams->format.rate != dstparams.format.rate) {
 | 
			
		||||
		tmpparams.format.interleave = 1;
 | 
			
		||||
		err = snd_pcm_plugin_build_interleave(&srcparams->format,
 | 
			
		||||
						      &tmpparams.format,
 | 
			
		||||
| 
						 | 
				
			
			@ -289,25 +330,6 @@ int snd_pcm_plugin_format(PLUGIN_BASE *pb,
 | 
			
		|||
			dstparams.format.interleave = 1;
 | 
			
		||||
      	}
 | 
			
		||||
 | 
			
		||||
	/* voices reduction */
 | 
			
		||||
	if (srcparams->format.voices > dstparams.format.voices) {
 | 
			
		||||
		tmpparams.format.voices = dstparams.format.voices;
 | 
			
		||||
		err = snd_pcm_plugin_build_voices(&srcparams->format,
 | 
			
		||||
						  &tmpparams.format,
 | 
			
		||||
						  &plugin);
 | 
			
		||||
		pdprintf("params voices reduction: src=%i, dst=%i returns %i\n", srcparams->format.voices, tmpparams.format.voices, err);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_pcm_plugin_free(plugin);
 | 
			
		||||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
		err = snd_pcm_plugin_append(pb, params->channel, plugin);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_pcm_plugin_free(plugin);
 | 
			
		||||
			return err;
 | 
			
		||||
		}
 | 
			
		||||
		srcparams->format.voices = tmpparams.format.voices;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
	/* rate down resampling */
 | 
			
		||||
        if (srcparams->format.rate > dstparams.format.rate &&
 | 
			
		||||
	    snd_pcm_format_linear(srcparams->format.format) &&
 | 
			
		||||
| 
						 | 
				
			
			@ -429,11 +451,27 @@ int snd_pcm_plugin_format(PLUGIN_BASE *pb,
 | 
			
		|||
        }
 | 
			
		||||
      
 | 
			
		||||
	/* voices extension  */
 | 
			
		||||
	if (srcparams->format.voices != dstparams.format.voices) {
 | 
			
		||||
	if (srcparams->format.voices < dstparams.format.voices) {
 | 
			
		||||
		int sv = srcparams->format.voices;
 | 
			
		||||
		int dv = dstparams.format.voices;
 | 
			
		||||
		int *ttable = my_calloc(dv * sv * sizeof(*ttable));
 | 
			
		||||
#if 1
 | 
			
		||||
		if (sv == 1 && dv == 2) {
 | 
			
		||||
			ttable[0] = ROUTE_PLUGIN_RESOLUTION;
 | 
			
		||||
			ttable[1] = ROUTE_PLUGIN_RESOLUTION;
 | 
			
		||||
		} else
 | 
			
		||||
#endif
 | 
			
		||||
		{
 | 
			
		||||
			int v;
 | 
			
		||||
			for (v = 0; v < sv; ++v)
 | 
			
		||||
				ttable[v * sv + v] = ROUTE_PLUGIN_RESOLUTION;
 | 
			
		||||
		}
 | 
			
		||||
		tmpparams.format.voices = dstparams.format.voices;
 | 
			
		||||
		err = snd_pcm_plugin_build_voices(&srcparams->format,
 | 
			
		||||
		err = snd_pcm_plugin_build_route(&srcparams->format,
 | 
			
		||||
						  &tmpparams.format,
 | 
			
		||||
						  ttable,
 | 
			
		||||
						  &plugin);
 | 
			
		||||
		my_free(ttable);
 | 
			
		||||
		pdprintf("params voices extension: src=%i, dst=%i returns %i\n", srcparams->format.voices, tmpparams.format.voices, err);
 | 
			
		||||
		if (err < 0) {
 | 
			
		||||
			snd_pcm_plugin_free(plugin);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,7 +1,7 @@
 | 
			
		|||
EXTRA_LTLIBRARIES = libpcmplugin.la
 | 
			
		||||
 | 
			
		||||
libpcmplugin_la_SOURCES = block.c mmap.c stream.c linear.c interleave.c \
 | 
			
		||||
			  mulaw.c alaw.c adpcm.c rate.c voices.c volbal.c
 | 
			
		||||
			  mulaw.c alaw.c adpcm.c rate.c route.c
 | 
			
		||||
all: libpcmplugin.la
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
/*
 | 
			
		||||
 *  Interleave / non-interleave conversion Plug-In
 | 
			
		||||
 *  Copyright (c) 1999 by Jaroslav Kysela <perex@suse.cz>
 | 
			
		||||
 *  Copyright (c) 2000 by Abramo Bagnara <abbagnara@racine.ra.it>
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *   This library is free software; you can redistribute it and/or modify
 | 
			
		||||
| 
						 | 
				
			
			@ -21,6 +21,7 @@
 | 
			
		|||
 | 
			
		||||
#ifdef __KERNEL__
 | 
			
		||||
#include "../../include/driver.h"
 | 
			
		||||
#include "../../include/pcm.h"
 | 
			
		||||
#include "../../include/pcm_plugin.h"
 | 
			
		||||
#else
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
| 
						 | 
				
			
			@ -37,109 +38,58 @@
 | 
			
		|||
 *  Basic interleave / non-interleave conversion plugin
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
typedef enum {
 | 
			
		||||
	_INTERLEAVE_NON,
 | 
			
		||||
	_NON_INTERLEAVE
 | 
			
		||||
} combination_t;
 | 
			
		||||
 
 | 
			
		||||
typedef void (*interleave_f)(void* src_ptr, void* dst_ptr,
 | 
			
		||||
			     int voices, size_t samples);
 | 
			
		||||
 | 
			
		||||
struct interleave_private_data {
 | 
			
		||||
	combination_t cmd;
 | 
			
		||||
	int size;
 | 
			
		||||
	int sample_size;
 | 
			
		||||
	int voices;
 | 
			
		||||
	interleave_f func;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
static void separate_8bit(unsigned char *src_ptr,
 | 
			
		||||
			  unsigned char *dst_ptr,
 | 
			
		||||
			  unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	unsigned char *dst1, *dst2;
 | 
			
		||||
 | 
			
		||||
	dst1 = dst_ptr;
 | 
			
		||||
	dst2 = dst_ptr + (size / 2);
 | 
			
		||||
	size /= 2;
 | 
			
		||||
	while (size--) {
 | 
			
		||||
		*dst1++ = *src_ptr++;
 | 
			
		||||
		*dst2++ = *src_ptr++;
 | 
			
		||||
	}
 | 
			
		||||
#define INTERLEAVE_FUNC(name, type) \
 | 
			
		||||
static void name(void* src_ptr, void* dst_ptr, \
 | 
			
		||||
		       int voices, size_t samples) \
 | 
			
		||||
{ \
 | 
			
		||||
	type* src = src_ptr; \
 | 
			
		||||
	int voice; \
 | 
			
		||||
	for (voice = 0; voice < voices; ++voice) { \
 | 
			
		||||
		type *dst = (type*)dst_ptr + voice; \
 | 
			
		||||
		int s; \
 | 
			
		||||
		for (s = 0; s < samples; ++s) { \
 | 
			
		||||
			*dst = *src; \
 | 
			
		||||
			src++; \
 | 
			
		||||
			dst += voices; \
 | 
			
		||||
		} \
 | 
			
		||||
	} \
 | 
			
		||||
} \
 | 
			
		||||
 | 
			
		||||
#define DEINTERLEAVE_FUNC(name, type) \
 | 
			
		||||
static void name(void* src_ptr, void* dst_ptr, \
 | 
			
		||||
			 int voices, size_t samples) \
 | 
			
		||||
{ \
 | 
			
		||||
	type* dst = dst_ptr; \
 | 
			
		||||
	int voice; \
 | 
			
		||||
	for (voice = 0; voice < voices; ++voice) { \
 | 
			
		||||
		type *src = (type*)src_ptr + voice; \
 | 
			
		||||
		int s; \
 | 
			
		||||
		for (s = 0; s < samples; ++s) { \
 | 
			
		||||
			*dst = *src; \
 | 
			
		||||
			dst++; \
 | 
			
		||||
			src += voices; \
 | 
			
		||||
		} \
 | 
			
		||||
	} \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void separate_16bit(unsigned char *src_ptr,
 | 
			
		||||
			   unsigned char *dst_ptr,
 | 
			
		||||
			   unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	unsigned short *src, *dst1, *dst2;
 | 
			
		||||
#define FUNCS(name, type) \
 | 
			
		||||
INTERLEAVE_FUNC(int_##name, type); \
 | 
			
		||||
DEINTERLEAVE_FUNC(deint_##name, type);
 | 
			
		||||
 | 
			
		||||
	src = (short *)src_ptr;
 | 
			
		||||
	dst1 = (short *)dst_ptr;
 | 
			
		||||
	dst2 = (short *)(dst_ptr + (size / 2));
 | 
			
		||||
	size /= 4;
 | 
			
		||||
	while (size--) {
 | 
			
		||||
		*dst1++ = *src++;
 | 
			
		||||
		*dst2++ = *src++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void separate_32bit(unsigned char *src_ptr,
 | 
			
		||||
			   unsigned char *dst_ptr,
 | 
			
		||||
			   unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	unsigned int *src, *dst1, *dst2;
 | 
			
		||||
 | 
			
		||||
	src = (int *)src_ptr;
 | 
			
		||||
	dst1 = (int *)dst_ptr;
 | 
			
		||||
	dst2 = (int *)(dst_ptr + (size / 2));
 | 
			
		||||
	size /= 8;
 | 
			
		||||
	while (size--) {
 | 
			
		||||
		*dst1++ = *src++;
 | 
			
		||||
		*dst2++ = *src++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void interleave_8bit(unsigned char *src_ptr,
 | 
			
		||||
			    unsigned char *dst_ptr,
 | 
			
		||||
			    unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	unsigned char *src1, *src2;
 | 
			
		||||
 | 
			
		||||
	src1 = src_ptr;
 | 
			
		||||
	src2 = src_ptr + (size / 2);
 | 
			
		||||
	size /= 2;
 | 
			
		||||
	while (size--) {
 | 
			
		||||
		*dst_ptr++ = *src1++;
 | 
			
		||||
		*dst_ptr++ = *src2++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void interleave_16bit(unsigned char *src_ptr,
 | 
			
		||||
			     unsigned char *dst_ptr,
 | 
			
		||||
			     unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	unsigned short *src1, *src2, *dst;
 | 
			
		||||
 | 
			
		||||
	src1 = (short *)src_ptr;
 | 
			
		||||
	src2 = (short *)(src_ptr + (size / 2));
 | 
			
		||||
	dst = (short *)dst_ptr;
 | 
			
		||||
	size /= 4;
 | 
			
		||||
	while (size--) {
 | 
			
		||||
		*dst++ = *src1++;
 | 
			
		||||
		*dst++ = *src2++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void interleave_32bit(unsigned char *src_ptr,
 | 
			
		||||
			     unsigned char *dst_ptr,
 | 
			
		||||
			     unsigned int size)
 | 
			
		||||
{
 | 
			
		||||
	unsigned int *src1, *src2, *dst;
 | 
			
		||||
 | 
			
		||||
	src1 = (int *)src_ptr;
 | 
			
		||||
	src2 = (int *)(src_ptr + (size / 2));
 | 
			
		||||
	dst = (int *)dst_ptr;
 | 
			
		||||
	size /= 8;
 | 
			
		||||
	while (size--) {
 | 
			
		||||
		*dst++ = *src1++;
 | 
			
		||||
		*dst++ = *src2++;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
FUNCS(1, int8_t);
 | 
			
		||||
FUNCS(2, int16_t);
 | 
			
		||||
FUNCS(4, int32_t);
 | 
			
		||||
FUNCS(8, int64_t);
 | 
			
		||||
 | 
			
		||||
static ssize_t interleave_transfer(snd_pcm_plugin_t *plugin,
 | 
			
		||||
				   char *src_ptr, size_t src_size,
 | 
			
		||||
| 
						 | 
				
			
			@ -157,28 +107,8 @@ static ssize_t interleave_transfer(snd_pcm_plugin_t *plugin,
 | 
			
		|||
	data = (struct interleave_private_data *)snd_pcm_plugin_extra_data(plugin);
 | 
			
		||||
	if (data == NULL)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	switch (data->cmd) {
 | 
			
		||||
	case _INTERLEAVE_NON:
 | 
			
		||||
		switch (data->size) {
 | 
			
		||||
		case 1:	separate_8bit(src_ptr, dst_ptr, src_size); break;
 | 
			
		||||
		case 2: separate_16bit(src_ptr, dst_ptr, src_size); break;
 | 
			
		||||
		case 4: separate_32bit(src_ptr, dst_ptr, src_size); break;
 | 
			
		||||
		default:
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	case _NON_INTERLEAVE:
 | 
			
		||||
		switch (data->size) {
 | 
			
		||||
		case 1:	interleave_8bit(src_ptr, dst_ptr, src_size); break;
 | 
			
		||||
		case 2: interleave_16bit(src_ptr, dst_ptr, src_size); break;
 | 
			
		||||
		case 4: interleave_32bit(src_ptr, dst_ptr, src_size); break;
 | 
			
		||||
		default:
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
		}
 | 
			
		||||
		break;
 | 
			
		||||
	default:
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
	data->func(src_ptr, dst_ptr, data->voices,
 | 
			
		||||
		   src_size / (data->voices * data->sample_size));
 | 
			
		||||
	return src_size;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -188,57 +118,66 @@ int snd_pcm_plugin_build_interleave(snd_pcm_format_t *src_format,
 | 
			
		|||
{
 | 
			
		||||
	struct interleave_private_data *data;
 | 
			
		||||
	snd_pcm_plugin_t *plugin;
 | 
			
		||||
	combination_t cmd;
 | 
			
		||||
	interleave_f func;
 | 
			
		||||
	int size;
 | 
			
		||||
 | 
			
		||||
	if (r_plugin == NULL)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	*r_plugin = NULL;
 | 
			
		||||
 | 
			
		||||
	if (src_format->interleave && !dst_format->interleave) {
 | 
			
		||||
		cmd = _INTERLEAVE_NON;
 | 
			
		||||
	} else if (!src_format->interleave && dst_format->interleave) {
 | 
			
		||||
		cmd = _NON_INTERLEAVE;
 | 
			
		||||
	} else {
 | 
			
		||||
	if (src_format->interleave == dst_format->interleave)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	}
 | 
			
		||||
	if (src_format->format != dst_format->format)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	if (src_format->rate != dst_format->rate)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	if (src_format->voices != dst_format->voices)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
 | 
			
		||||
	switch (dst_format->format) {
 | 
			
		||||
	case SND_PCM_SFMT_S8:
 | 
			
		||||
	case SND_PCM_SFMT_U8:		size = 1; break;
 | 
			
		||||
	case SND_PCM_SFMT_S16_LE:
 | 
			
		||||
	case SND_PCM_SFMT_S16_BE:
 | 
			
		||||
	case SND_PCM_SFMT_U16_LE:	size = 2; break;
 | 
			
		||||
	case SND_PCM_SFMT_S24_LE:
 | 
			
		||||
	case SND_PCM_SFMT_S24_BE:
 | 
			
		||||
	case SND_PCM_SFMT_U24_LE:
 | 
			
		||||
	case SND_PCM_SFMT_U24_BE:
 | 
			
		||||
	case SND_PCM_SFMT_S32_LE:
 | 
			
		||||
	case SND_PCM_SFMT_S32_BE:
 | 
			
		||||
	case SND_PCM_SFMT_U32_LE:
 | 
			
		||||
	case SND_PCM_SFMT_U32_BE:
 | 
			
		||||
	case SND_PCM_SFMT_FLOAT:	size = 4; break;
 | 
			
		||||
	case SND_PCM_SFMT_FLOAT64:	size = 8; break;
 | 
			
		||||
	case SND_PCM_SFMT_IEC958_SUBFRAME_LE:
 | 
			
		||||
	case SND_PCM_SFMT_IEC958_SUBFRAME_BE: 	size = 4; break;
 | 
			
		||||
	case SND_PCM_SFMT_MU_LAW:
 | 
			
		||||
	case SND_PCM_SFMT_A_LAW:	size = 1; break;
 | 
			
		||||
	default:
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
	size = snd_pcm_format_size(dst_format->format, 1);
 | 
			
		||||
	if (dst_format->interleave) {
 | 
			
		||||
		switch (size) {
 | 
			
		||||
		case 1:
 | 
			
		||||
			func = int_1;
 | 
			
		||||
			break;
 | 
			
		||||
		case 2:
 | 
			
		||||
			func = int_2;
 | 
			
		||||
			break;
 | 
			
		||||
		case 4:
 | 
			
		||||
			func = int_4;
 | 
			
		||||
			break;
 | 
			
		||||
		case 8:
 | 
			
		||||
			func = int_8;
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		switch (size) {
 | 
			
		||||
		case 1:
 | 
			
		||||
			func = deint_1;
 | 
			
		||||
			break;
 | 
			
		||||
		case 2:
 | 
			
		||||
			func = deint_2;
 | 
			
		||||
			break;
 | 
			
		||||
		case 4:
 | 
			
		||||
			func = deint_4;
 | 
			
		||||
			break;
 | 
			
		||||
		case 8:
 | 
			
		||||
			func = deint_8;
 | 
			
		||||
			break;
 | 
			
		||||
		default:
 | 
			
		||||
			return -EINVAL;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	plugin = snd_pcm_plugin_build("interleave conversion",
 | 
			
		||||
				      sizeof(struct interleave_private_data));
 | 
			
		||||
	if (plugin == NULL)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
	data = (struct interleave_private_data *)snd_pcm_plugin_extra_data(plugin);
 | 
			
		||||
	data->cmd = cmd;
 | 
			
		||||
	data->size = size;
 | 
			
		||||
	data->sample_size = size;
 | 
			
		||||
	data->voices = src_format->voices;
 | 
			
		||||
	data->func = func;
 | 
			
		||||
	plugin->transfer = interleave_transfer;
 | 
			
		||||
	*r_plugin = plugin;
 | 
			
		||||
	return 0;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -40,15 +40,15 @@
 | 
			
		|||
 *  Basic linear conversion plugin
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
typedef void (*conv_f)(void *src, void *dst, size_t size);
 | 
			
		||||
typedef void (*linear_f)(void *src, void *dst, size_t size);
 | 
			
		||||
 | 
			
		||||
struct linear_private_data {
 | 
			
		||||
	int src_sample_size, dst_sample_size;
 | 
			
		||||
	conv_f func;
 | 
			
		||||
	linear_f func;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#define CONV_FUNC(name, srctype, dsttype, val) \
 | 
			
		||||
static void conv_##name(void *src_ptr, void *dst_ptr, size_t size) \
 | 
			
		||||
#define LIN_FUNC(name, srctype, dsttype, val) \
 | 
			
		||||
static void lin_##name(void *src_ptr, void *dst_ptr, size_t size) \
 | 
			
		||||
{ \
 | 
			
		||||
	srctype *srcp = src_ptr; \
 | 
			
		||||
	dsttype *dstp = dst_ptr; \
 | 
			
		||||
| 
						 | 
				
			
			@ -58,240 +58,240 @@ static void conv_##name(void *src_ptr, void *dst_ptr, size_t size) \
 | 
			
		|||
	} \
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(8_sign, u_int8_t, u_int8_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(8_sign, u_int8_t, u_int8_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(8_16, u_int8_t, u_int16_t, (u_int16_t)src << 8)
 | 
			
		||||
CONV_FUNC(8_16_end, u_int8_t, u_int16_t, (u_int16_t)src)
 | 
			
		||||
CONV_FUNC(8_16_sign, u_int8_t, u_int16_t, (u_int16_t)(src ^ 0x80) << 8)
 | 
			
		||||
CONV_FUNC(8_16_sign_end, u_int8_t, u_int16_t, (u_int16_t)src ^ 0x80)
 | 
			
		||||
LIN_FUNC(8_16, u_int8_t, u_int16_t, (u_int16_t)src << 8)
 | 
			
		||||
LIN_FUNC(8_16_end, u_int8_t, u_int16_t, (u_int16_t)src)
 | 
			
		||||
LIN_FUNC(8_16_sign, u_int8_t, u_int16_t, (u_int16_t)(src ^ 0x80) << 8)
 | 
			
		||||
LIN_FUNC(8_16_sign_end, u_int8_t, u_int16_t, (u_int16_t)src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(8_24, u_int8_t, u_int32_t, (u_int32_t)src << 16)
 | 
			
		||||
CONV_FUNC(8_24_end, u_int8_t, u_int32_t, (u_int32_t)src << 8)
 | 
			
		||||
CONV_FUNC(8_24_sign, u_int8_t, u_int32_t, (u_int32_t)(src ^ 0x80) << 16)
 | 
			
		||||
CONV_FUNC(8_24_sign_end, u_int8_t, u_int32_t, (u_int32_t)(src ^ 0x80) << 8)
 | 
			
		||||
LIN_FUNC(8_24, u_int8_t, u_int32_t, (u_int32_t)src << 16)
 | 
			
		||||
LIN_FUNC(8_24_end, u_int8_t, u_int32_t, (u_int32_t)src << 8)
 | 
			
		||||
LIN_FUNC(8_24_sign, u_int8_t, u_int32_t, (u_int32_t)(src ^ 0x80) << 16)
 | 
			
		||||
LIN_FUNC(8_24_sign_end, u_int8_t, u_int32_t, (u_int32_t)(src ^ 0x80) << 8)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(8_32, u_int8_t, u_int32_t, (u_int32_t)src << 24)
 | 
			
		||||
CONV_FUNC(8_32_end, u_int8_t, u_int32_t, (u_int32_t)src)
 | 
			
		||||
CONV_FUNC(8_32_sign, u_int8_t, u_int32_t, (u_int32_t)(src ^ 0x80) << 24)
 | 
			
		||||
CONV_FUNC(8_32_sign_end, u_int8_t, u_int32_t, (u_int32_t)src ^ 0x80)
 | 
			
		||||
LIN_FUNC(8_32, u_int8_t, u_int32_t, (u_int32_t)src << 24)
 | 
			
		||||
LIN_FUNC(8_32_end, u_int8_t, u_int32_t, (u_int32_t)src)
 | 
			
		||||
LIN_FUNC(8_32_sign, u_int8_t, u_int32_t, (u_int32_t)(src ^ 0x80) << 24)
 | 
			
		||||
LIN_FUNC(8_32_sign_end, u_int8_t, u_int32_t, (u_int32_t)src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(16_8, u_int16_t, u_int8_t, src >> 8)
 | 
			
		||||
CONV_FUNC(16_end_8, u_int16_t, u_int8_t, src)
 | 
			
		||||
CONV_FUNC(16_8_sign, u_int16_t, u_int8_t, (src >> 8) ^ 0x80)
 | 
			
		||||
CONV_FUNC(16_end_8_sign, u_int16_t, u_int8_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(16_8, u_int16_t, u_int8_t, src >> 8)
 | 
			
		||||
LIN_FUNC(16_end_8, u_int16_t, u_int8_t, src)
 | 
			
		||||
LIN_FUNC(16_8_sign, u_int16_t, u_int8_t, (src >> 8) ^ 0x80)
 | 
			
		||||
LIN_FUNC(16_end_8_sign, u_int16_t, u_int8_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(16_sign, u_int16_t, u_int16_t, src ^ 0x8000)
 | 
			
		||||
CONV_FUNC(16_end, u_int16_t, u_int16_t, bswap_16(src))
 | 
			
		||||
CONV_FUNC(16_end_sign, u_int16_t, u_int16_t, bswap_16(src) ^ 0x8000)
 | 
			
		||||
CONV_FUNC(16_sign_end, u_int16_t, u_int16_t, bswap_16(src ^ 0x8000))
 | 
			
		||||
CONV_FUNC(16_end_sign_end, u_int16_t, u_int16_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(16_sign, u_int16_t, u_int16_t, src ^ 0x8000)
 | 
			
		||||
LIN_FUNC(16_end, u_int16_t, u_int16_t, bswap_16(src))
 | 
			
		||||
LIN_FUNC(16_end_sign, u_int16_t, u_int16_t, bswap_16(src) ^ 0x8000)
 | 
			
		||||
LIN_FUNC(16_sign_end, u_int16_t, u_int16_t, bswap_16(src ^ 0x8000))
 | 
			
		||||
LIN_FUNC(16_end_sign_end, u_int16_t, u_int16_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(16_24, u_int16_t, u_int32_t, (u_int32_t)src << 8)
 | 
			
		||||
CONV_FUNC(16_24_sign, u_int16_t, u_int32_t, (u_int32_t)(src ^ 0x8000) << 8)
 | 
			
		||||
CONV_FUNC(16_24_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src) << 8)
 | 
			
		||||
CONV_FUNC(16_24_sign_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src ^ 0x8000) << 8)
 | 
			
		||||
CONV_FUNC(16_end_24, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src) << 8)
 | 
			
		||||
CONV_FUNC(16_end_24_sign, u_int16_t, u_int32_t, (u_int32_t)(bswap_16(src) ^ 0x8000) << 8)
 | 
			
		||||
CONV_FUNC(16_end_24_end, u_int16_t, u_int32_t, (u_int32_t)src << 8)
 | 
			
		||||
CONV_FUNC(16_end_24_sign_end, u_int16_t, u_int32_t, ((u_int32_t)src ^ 0x80) << 8)
 | 
			
		||||
LIN_FUNC(16_24, u_int16_t, u_int32_t, (u_int32_t)src << 8)
 | 
			
		||||
LIN_FUNC(16_24_sign, u_int16_t, u_int32_t, (u_int32_t)(src ^ 0x8000) << 8)
 | 
			
		||||
LIN_FUNC(16_24_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src) << 8)
 | 
			
		||||
LIN_FUNC(16_24_sign_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src ^ 0x8000) << 8)
 | 
			
		||||
LIN_FUNC(16_end_24, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src) << 8)
 | 
			
		||||
LIN_FUNC(16_end_24_sign, u_int16_t, u_int32_t, (u_int32_t)(bswap_16(src) ^ 0x8000) << 8)
 | 
			
		||||
LIN_FUNC(16_end_24_end, u_int16_t, u_int32_t, (u_int32_t)src << 8)
 | 
			
		||||
LIN_FUNC(16_end_24_sign_end, u_int16_t, u_int32_t, ((u_int32_t)src ^ 0x80) << 8)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(16_32, u_int16_t, u_int32_t, (u_int32_t)src << 16)
 | 
			
		||||
CONV_FUNC(16_32_sign, u_int16_t, u_int32_t, (u_int32_t)(src ^ 0x8000) << 16)
 | 
			
		||||
CONV_FUNC(16_32_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src))
 | 
			
		||||
CONV_FUNC(16_32_sign_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src ^ 0x8000))
 | 
			
		||||
CONV_FUNC(16_end_32, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src) << 16)
 | 
			
		||||
CONV_FUNC(16_end_32_sign, u_int16_t, u_int32_t, (u_int32_t)(bswap_16(src) ^ 0x8000) << 16)
 | 
			
		||||
CONV_FUNC(16_end_32_end, u_int16_t, u_int32_t, (u_int32_t)src)
 | 
			
		||||
CONV_FUNC(16_end_32_sign_end, u_int16_t, u_int32_t, (u_int32_t)src ^ 0x80)
 | 
			
		||||
LIN_FUNC(16_32, u_int16_t, u_int32_t, (u_int32_t)src << 16)
 | 
			
		||||
LIN_FUNC(16_32_sign, u_int16_t, u_int32_t, (u_int32_t)(src ^ 0x8000) << 16)
 | 
			
		||||
LIN_FUNC(16_32_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src))
 | 
			
		||||
LIN_FUNC(16_32_sign_end, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src ^ 0x8000))
 | 
			
		||||
LIN_FUNC(16_end_32, u_int16_t, u_int32_t, (u_int32_t)bswap_16(src) << 16)
 | 
			
		||||
LIN_FUNC(16_end_32_sign, u_int16_t, u_int32_t, (u_int32_t)(bswap_16(src) ^ 0x8000) << 16)
 | 
			
		||||
LIN_FUNC(16_end_32_end, u_int16_t, u_int32_t, (u_int32_t)src)
 | 
			
		||||
LIN_FUNC(16_end_32_sign_end, u_int16_t, u_int32_t, (u_int32_t)src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(24_8, u_int32_t, u_int8_t, src >> 16)
 | 
			
		||||
CONV_FUNC(24_end_8, u_int32_t, u_int8_t, src >> 8)
 | 
			
		||||
CONV_FUNC(24_8_sign, u_int32_t, u_int8_t, (src >> 16) ^ 0x80)
 | 
			
		||||
CONV_FUNC(24_end_8_sign, u_int32_t, u_int8_t, (src >> 8) ^ 0x80)
 | 
			
		||||
LIN_FUNC(24_8, u_int32_t, u_int8_t, src >> 16)
 | 
			
		||||
LIN_FUNC(24_end_8, u_int32_t, u_int8_t, src >> 8)
 | 
			
		||||
LIN_FUNC(24_8_sign, u_int32_t, u_int8_t, (src >> 16) ^ 0x80)
 | 
			
		||||
LIN_FUNC(24_end_8_sign, u_int32_t, u_int8_t, (src >> 8) ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(24_16, u_int32_t, u_int16_t, src >> 8)
 | 
			
		||||
CONV_FUNC(24_16_sign, u_int32_t, u_int16_t, (src >> 8) ^ 0x8000)
 | 
			
		||||
CONV_FUNC(24_16_end, u_int32_t, u_int16_t, bswap_32(src >> 8))
 | 
			
		||||
CONV_FUNC(24_16_sign_end, u_int32_t, u_int16_t, bswap_32((src >> 8) ^ 0x8000))
 | 
			
		||||
CONV_FUNC(24_end_16, u_int32_t, u_int16_t, bswap_32(src) >> 8)
 | 
			
		||||
CONV_FUNC(24_end_16_sign, u_int32_t, u_int16_t, (bswap_32(src) >> 8) ^ 0x8000)
 | 
			
		||||
CONV_FUNC(24_end_16_end, u_int32_t, u_int16_t, src >> 8)
 | 
			
		||||
CONV_FUNC(24_end_16_sign_end, u_int32_t, u_int16_t, (src >> 8) ^ 0x80)
 | 
			
		||||
LIN_FUNC(24_16, u_int32_t, u_int16_t, src >> 8)
 | 
			
		||||
LIN_FUNC(24_16_sign, u_int32_t, u_int16_t, (src >> 8) ^ 0x8000)
 | 
			
		||||
LIN_FUNC(24_16_end, u_int32_t, u_int16_t, bswap_32(src >> 8))
 | 
			
		||||
LIN_FUNC(24_16_sign_end, u_int32_t, u_int16_t, bswap_32((src >> 8) ^ 0x8000))
 | 
			
		||||
LIN_FUNC(24_end_16, u_int32_t, u_int16_t, bswap_32(src) >> 8)
 | 
			
		||||
LIN_FUNC(24_end_16_sign, u_int32_t, u_int16_t, (bswap_32(src) >> 8) ^ 0x8000)
 | 
			
		||||
LIN_FUNC(24_end_16_end, u_int32_t, u_int16_t, src >> 8)
 | 
			
		||||
LIN_FUNC(24_end_16_sign_end, u_int32_t, u_int16_t, (src >> 8) ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(24_sign, u_int32_t, u_int32_t, src ^ 0x800000)
 | 
			
		||||
CONV_FUNC(24_end, u_int32_t, u_int32_t, bswap_32(src))
 | 
			
		||||
CONV_FUNC(24_end_sign, u_int32_t, u_int32_t, bswap_32(src) ^ 0x800000)
 | 
			
		||||
CONV_FUNC(24_sign_end, u_int32_t, u_int32_t, bswap_32(src) ^ 0x80)
 | 
			
		||||
CONV_FUNC(24_end_sign_end, u_int32_t, u_int32_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(24_sign, u_int32_t, u_int32_t, src ^ 0x800000)
 | 
			
		||||
LIN_FUNC(24_end, u_int32_t, u_int32_t, bswap_32(src))
 | 
			
		||||
LIN_FUNC(24_end_sign, u_int32_t, u_int32_t, bswap_32(src) ^ 0x800000)
 | 
			
		||||
LIN_FUNC(24_sign_end, u_int32_t, u_int32_t, bswap_32(src) ^ 0x80)
 | 
			
		||||
LIN_FUNC(24_end_sign_end, u_int32_t, u_int32_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(24_32, u_int32_t, u_int32_t, src << 8)
 | 
			
		||||
CONV_FUNC(24_32_sign, u_int32_t, u_int32_t, (src << 8) ^ 0x80000000)
 | 
			
		||||
CONV_FUNC(24_32_end, u_int32_t, u_int32_t, bswap_32(src << 8))
 | 
			
		||||
CONV_FUNC(24_32_sign_end, u_int32_t, u_int32_t, bswap_32((src << 8) ^ 0x80000000))
 | 
			
		||||
CONV_FUNC(24_end_32, u_int32_t, u_int32_t, bswap_32(src) << 8)
 | 
			
		||||
CONV_FUNC(24_end_32_sign, u_int32_t, u_int32_t, (bswap_32(src) << 8) ^ 0x80000000)
 | 
			
		||||
CONV_FUNC(24_end_32_end, u_int32_t, u_int32_t, src >> 8)
 | 
			
		||||
CONV_FUNC(24_end_32_sign_end, u_int32_t, u_int32_t, (src >> 8) ^ 0x80)
 | 
			
		||||
LIN_FUNC(24_32, u_int32_t, u_int32_t, src << 8)
 | 
			
		||||
LIN_FUNC(24_32_sign, u_int32_t, u_int32_t, (src << 8) ^ 0x80000000)
 | 
			
		||||
LIN_FUNC(24_32_end, u_int32_t, u_int32_t, bswap_32(src << 8))
 | 
			
		||||
LIN_FUNC(24_32_sign_end, u_int32_t, u_int32_t, bswap_32((src << 8) ^ 0x80000000))
 | 
			
		||||
LIN_FUNC(24_end_32, u_int32_t, u_int32_t, bswap_32(src) << 8)
 | 
			
		||||
LIN_FUNC(24_end_32_sign, u_int32_t, u_int32_t, (bswap_32(src) << 8) ^ 0x80000000)
 | 
			
		||||
LIN_FUNC(24_end_32_end, u_int32_t, u_int32_t, src >> 8)
 | 
			
		||||
LIN_FUNC(24_end_32_sign_end, u_int32_t, u_int32_t, (src >> 8) ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(32_8, u_int32_t, u_int8_t, src >> 24)
 | 
			
		||||
CONV_FUNC(32_end_8, u_int32_t, u_int8_t, src)
 | 
			
		||||
CONV_FUNC(32_8_sign, u_int32_t, u_int8_t, (src >> 24) ^ 0x80)
 | 
			
		||||
CONV_FUNC(32_end_8_sign, u_int32_t, u_int8_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(32_8, u_int32_t, u_int8_t, src >> 24)
 | 
			
		||||
LIN_FUNC(32_end_8, u_int32_t, u_int8_t, src)
 | 
			
		||||
LIN_FUNC(32_8_sign, u_int32_t, u_int8_t, (src >> 24) ^ 0x80)
 | 
			
		||||
LIN_FUNC(32_end_8_sign, u_int32_t, u_int8_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(32_16, u_int32_t, u_int16_t, src >> 16)
 | 
			
		||||
CONV_FUNC(32_16_sign, u_int32_t, u_int16_t, (src >> 16) ^ 0x8000)
 | 
			
		||||
CONV_FUNC(32_16_end, u_int32_t, u_int16_t, bswap_16(src >> 16))
 | 
			
		||||
CONV_FUNC(32_16_sign_end, u_int32_t, u_int16_t, bswap_16((src >> 16) ^ 0x8000))
 | 
			
		||||
CONV_FUNC(32_end_16, u_int32_t, u_int16_t, bswap_16(src))
 | 
			
		||||
CONV_FUNC(32_end_16_sign, u_int32_t, u_int16_t, bswap_16(src) ^ 0x8000)
 | 
			
		||||
CONV_FUNC(32_end_16_end, u_int32_t, u_int16_t, src)
 | 
			
		||||
CONV_FUNC(32_end_16_sign_end, u_int32_t, u_int16_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(32_16, u_int32_t, u_int16_t, src >> 16)
 | 
			
		||||
LIN_FUNC(32_16_sign, u_int32_t, u_int16_t, (src >> 16) ^ 0x8000)
 | 
			
		||||
LIN_FUNC(32_16_end, u_int32_t, u_int16_t, bswap_16(src >> 16))
 | 
			
		||||
LIN_FUNC(32_16_sign_end, u_int32_t, u_int16_t, bswap_16((src >> 16) ^ 0x8000))
 | 
			
		||||
LIN_FUNC(32_end_16, u_int32_t, u_int16_t, bswap_16(src))
 | 
			
		||||
LIN_FUNC(32_end_16_sign, u_int32_t, u_int16_t, bswap_16(src) ^ 0x8000)
 | 
			
		||||
LIN_FUNC(32_end_16_end, u_int32_t, u_int16_t, src)
 | 
			
		||||
LIN_FUNC(32_end_16_sign_end, u_int32_t, u_int16_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(32_24, u_int32_t, u_int32_t, src >> 8)
 | 
			
		||||
CONV_FUNC(32_24_sign, u_int32_t, u_int32_t, (src >> 8) ^ 0x800000)
 | 
			
		||||
CONV_FUNC(32_24_end, u_int32_t, u_int32_t, bswap_32(src >> 8))
 | 
			
		||||
CONV_FUNC(32_24_sign_end, u_int32_t, u_int32_t, bswap_32((src >> 8) ^ 0x800000))
 | 
			
		||||
CONV_FUNC(32_end_24, u_int32_t, u_int32_t, bswap_32(src) >> 8)
 | 
			
		||||
CONV_FUNC(32_end_24_sign, u_int32_t, u_int32_t, (bswap_32(src) >> 8) ^ 0x800000)
 | 
			
		||||
CONV_FUNC(32_end_24_end, u_int32_t, u_int32_t, src << 8)
 | 
			
		||||
CONV_FUNC(32_end_24_sign_end, u_int32_t, u_int32_t, (src << 8) ^ 0x80)
 | 
			
		||||
LIN_FUNC(32_24, u_int32_t, u_int32_t, src >> 8)
 | 
			
		||||
LIN_FUNC(32_24_sign, u_int32_t, u_int32_t, (src >> 8) ^ 0x800000)
 | 
			
		||||
LIN_FUNC(32_24_end, u_int32_t, u_int32_t, bswap_32(src >> 8))
 | 
			
		||||
LIN_FUNC(32_24_sign_end, u_int32_t, u_int32_t, bswap_32((src >> 8) ^ 0x800000))
 | 
			
		||||
LIN_FUNC(32_end_24, u_int32_t, u_int32_t, bswap_32(src) >> 8)
 | 
			
		||||
LIN_FUNC(32_end_24_sign, u_int32_t, u_int32_t, (bswap_32(src) >> 8) ^ 0x800000)
 | 
			
		||||
LIN_FUNC(32_end_24_end, u_int32_t, u_int32_t, src << 8)
 | 
			
		||||
LIN_FUNC(32_end_24_sign_end, u_int32_t, u_int32_t, (src << 8) ^ 0x80)
 | 
			
		||||
 | 
			
		||||
CONV_FUNC(32_sign, u_int32_t, u_int32_t, src ^ 0x80000000)
 | 
			
		||||
CONV_FUNC(32_end, u_int32_t, u_int32_t, bswap_32(src))
 | 
			
		||||
CONV_FUNC(32_end_sign, u_int32_t, u_int32_t, bswap_32(src) ^ 0x80000000)
 | 
			
		||||
CONV_FUNC(32_sign_end, u_int32_t, u_int32_t, bswap_32(src) ^ 0x80)
 | 
			
		||||
CONV_FUNC(32_end_sign_end, u_int32_t, u_int32_t, src ^ 0x80)
 | 
			
		||||
LIN_FUNC(32_sign, u_int32_t, u_int32_t, src ^ 0x80000000)
 | 
			
		||||
LIN_FUNC(32_end, u_int32_t, u_int32_t, bswap_32(src))
 | 
			
		||||
LIN_FUNC(32_end_sign, u_int32_t, u_int32_t, bswap_32(src) ^ 0x80000000)
 | 
			
		||||
LIN_FUNC(32_sign_end, u_int32_t, u_int32_t, bswap_32(src) ^ 0x80)
 | 
			
		||||
LIN_FUNC(32_end_sign_end, u_int32_t, u_int32_t, src ^ 0x80)
 | 
			
		||||
 | 
			
		||||
/* src_wid dst_wid src_endswap, dst_endswap, sign_swap */
 | 
			
		||||
conv_f convert_functions[4 * 4 * 2 * 2 * 2] = {
 | 
			
		||||
linear_f linear_functions[4 * 4 * 2 * 2 * 2] = {
 | 
			
		||||
	NULL,			/* 8->8: Nothing to do */
 | 
			
		||||
	conv_8_sign,		/* 8->8 sign: conv_8_sign */
 | 
			
		||||
	lin_8_sign,		/* 8->8 sign: lin_8_sign */
 | 
			
		||||
	NULL,			/* 8->8 dst_end: Nothing to do */
 | 
			
		||||
	conv_8_sign,		/* 8->8 dst_end sign: conv_8_sign */
 | 
			
		||||
	lin_8_sign,		/* 8->8 dst_end sign: lin_8_sign */
 | 
			
		||||
	NULL,			/* 8->8 src_end: Nothing to do */
 | 
			
		||||
	conv_8_sign,		/* 8->8 src_end sign: conv_8_sign */
 | 
			
		||||
	lin_8_sign,		/* 8->8 src_end sign: lin_8_sign */
 | 
			
		||||
	NULL,			/* 8->8 src_end dst_end: Nothing to do */
 | 
			
		||||
	conv_8_sign,		/* 8->8 src_end dst_end sign: conv_8_sign */
 | 
			
		||||
	conv_8_16,		/* 8->16: conv_8_16 */
 | 
			
		||||
	conv_8_16_sign,		/* 8->16 sign: conv_8_16_sign */
 | 
			
		||||
	conv_8_16_end,		/* 8->16 dst_end: conv_8_16_end */
 | 
			
		||||
	conv_8_16_sign_end,	/* 8->16 dst_end sign: conv_8_16_sign_end */
 | 
			
		||||
	conv_8_16,		/* 8->16 src_end: conv_8_16 */
 | 
			
		||||
	conv_8_16_sign,		/* 8->16 src_end sign: conv_8_16_sign */
 | 
			
		||||
	conv_8_16_end,		/* 8->16 src_end dst_end: conv_8_16_end */
 | 
			
		||||
	conv_8_16_sign_end,	/* 8->16 src_end dst_end sign: conv_8_16_sign_end */
 | 
			
		||||
	conv_8_24,		/* 8->24: conv_8_24 */
 | 
			
		||||
	conv_8_24_sign,		/* 8->24 sign: conv_8_24_sign */
 | 
			
		||||
	conv_8_24_end,		/* 8->24 dst_end: conv_8_24_end */
 | 
			
		||||
	conv_8_24_sign_end,	/* 8->24 dst_end sign: conv_8_24_sign_end */
 | 
			
		||||
	conv_8_24,		/* 8->24 src_end: conv_8_24 */
 | 
			
		||||
	conv_8_24_sign,		/* 8->24 src_end sign: conv_8_24_sign */
 | 
			
		||||
	conv_8_24_end,		/* 8->24 src_end dst_end: conv_8_24_end */
 | 
			
		||||
	conv_8_24_sign_end,	/* 8->24 src_end dst_end sign: conv_8_24_sign_end */
 | 
			
		||||
	conv_8_32,		/* 8->32: conv_8_32 */
 | 
			
		||||
	conv_8_32_sign,		/* 8->32 sign: conv_8_32_sign */
 | 
			
		||||
	conv_8_32_end,		/* 8->32 dst_end: conv_8_32_end */
 | 
			
		||||
	conv_8_32_sign_end,	/* 8->32 dst_end sign: conv_8_32_sign_end */
 | 
			
		||||
	conv_8_32,		/* 8->32 src_end: conv_8_32 */
 | 
			
		||||
	conv_8_32_sign,		/* 8->32 src_end sign: conv_8_32_sign */
 | 
			
		||||
	conv_8_32_end,		/* 8->32 src_end dst_end: conv_8_32_end */
 | 
			
		||||
	conv_8_32_sign_end,	/* 8->32 src_end dst_end sign: conv_8_32_sign_end */
 | 
			
		||||
	conv_16_8,		/* 16->8: conv_16_8 */
 | 
			
		||||
	conv_16_8_sign,		/* 16->8 sign: conv_16_8_sign */
 | 
			
		||||
	conv_16_8,		/* 16->8 dst_end: conv_16_8 */
 | 
			
		||||
	conv_16_8_sign,		/* 16->8 dst_end sign: conv_16_8_sign */
 | 
			
		||||
	conv_16_end_8,		/* 16->8 src_end: conv_16_end_8 */
 | 
			
		||||
	conv_16_end_8_sign,	/* 16->8 src_end sign: conv_16_end_8_sign */
 | 
			
		||||
	conv_16_end_8,		/* 16->8 src_end dst_end: conv_16_end_8 */
 | 
			
		||||
	conv_16_end_8_sign,	/* 16->8 src_end dst_end sign: conv_16_end_8_sign */
 | 
			
		||||
	lin_8_sign,		/* 8->8 src_end dst_end sign: lin_8_sign */
 | 
			
		||||
	lin_8_16,		/* 8->16: lin_8_16 */
 | 
			
		||||
	lin_8_16_sign,		/* 8->16 sign: lin_8_16_sign */
 | 
			
		||||
	lin_8_16_end,		/* 8->16 dst_end: lin_8_16_end */
 | 
			
		||||
	lin_8_16_sign_end,	/* 8->16 dst_end sign: lin_8_16_sign_end */
 | 
			
		||||
	lin_8_16,		/* 8->16 src_end: lin_8_16 */
 | 
			
		||||
	lin_8_16_sign,		/* 8->16 src_end sign: lin_8_16_sign */
 | 
			
		||||
	lin_8_16_end,		/* 8->16 src_end dst_end: lin_8_16_end */
 | 
			
		||||
	lin_8_16_sign_end,	/* 8->16 src_end dst_end sign: lin_8_16_sign_end */
 | 
			
		||||
	lin_8_24,		/* 8->24: lin_8_24 */
 | 
			
		||||
	lin_8_24_sign,		/* 8->24 sign: lin_8_24_sign */
 | 
			
		||||
	lin_8_24_end,		/* 8->24 dst_end: lin_8_24_end */
 | 
			
		||||
	lin_8_24_sign_end,	/* 8->24 dst_end sign: lin_8_24_sign_end */
 | 
			
		||||
	lin_8_24,		/* 8->24 src_end: lin_8_24 */
 | 
			
		||||
	lin_8_24_sign,		/* 8->24 src_end sign: lin_8_24_sign */
 | 
			
		||||
	lin_8_24_end,		/* 8->24 src_end dst_end: lin_8_24_end */
 | 
			
		||||
	lin_8_24_sign_end,	/* 8->24 src_end dst_end sign: lin_8_24_sign_end */
 | 
			
		||||
	lin_8_32,		/* 8->32: lin_8_32 */
 | 
			
		||||
	lin_8_32_sign,		/* 8->32 sign: lin_8_32_sign */
 | 
			
		||||
	lin_8_32_end,		/* 8->32 dst_end: lin_8_32_end */
 | 
			
		||||
	lin_8_32_sign_end,	/* 8->32 dst_end sign: lin_8_32_sign_end */
 | 
			
		||||
	lin_8_32,		/* 8->32 src_end: lin_8_32 */
 | 
			
		||||
	lin_8_32_sign,		/* 8->32 src_end sign: lin_8_32_sign */
 | 
			
		||||
	lin_8_32_end,		/* 8->32 src_end dst_end: lin_8_32_end */
 | 
			
		||||
	lin_8_32_sign_end,	/* 8->32 src_end dst_end sign: lin_8_32_sign_end */
 | 
			
		||||
	lin_16_8,		/* 16->8: lin_16_8 */
 | 
			
		||||
	lin_16_8_sign,		/* 16->8 sign: lin_16_8_sign */
 | 
			
		||||
	lin_16_8,		/* 16->8 dst_end: lin_16_8 */
 | 
			
		||||
	lin_16_8_sign,		/* 16->8 dst_end sign: lin_16_8_sign */
 | 
			
		||||
	lin_16_end_8,		/* 16->8 src_end: lin_16_end_8 */
 | 
			
		||||
	lin_16_end_8_sign,	/* 16->8 src_end sign: lin_16_end_8_sign */
 | 
			
		||||
	lin_16_end_8,		/* 16->8 src_end dst_end: lin_16_end_8 */
 | 
			
		||||
	lin_16_end_8_sign,	/* 16->8 src_end dst_end sign: lin_16_end_8_sign */
 | 
			
		||||
	NULL,			/* 16->16: Nothing to do */
 | 
			
		||||
	conv_16_sign,		/* 16->16 sign: conv_16_sign */
 | 
			
		||||
	conv_16_end,		/* 16->16 dst_end: conv_16_end */
 | 
			
		||||
	conv_16_sign_end,	/* 16->16 dst_end sign: conv_16_sign_end */
 | 
			
		||||
	conv_16_end,		/* 16->16 src_end: conv_16_end */
 | 
			
		||||
	conv_16_end_sign,	/* 16->16 src_end sign: conv_16_end_sign */
 | 
			
		||||
	lin_16_sign,		/* 16->16 sign: lin_16_sign */
 | 
			
		||||
	lin_16_end,		/* 16->16 dst_end: lin_16_end */
 | 
			
		||||
	lin_16_sign_end,	/* 16->16 dst_end sign: lin_16_sign_end */
 | 
			
		||||
	lin_16_end,		/* 16->16 src_end: lin_16_end */
 | 
			
		||||
	lin_16_end_sign,	/* 16->16 src_end sign: lin_16_end_sign */
 | 
			
		||||
	NULL,			/* 16->16 src_end dst_end: Nothing to do */
 | 
			
		||||
	conv_16_end_sign_end,	/* 16->16 src_end dst_end sign: conv_16_end_sign_end */
 | 
			
		||||
	conv_16_24,		/* 16->24: conv_16_24 */
 | 
			
		||||
	conv_16_24_sign,	/* 16->24 sign: conv_16_24_sign */
 | 
			
		||||
	conv_16_24_end,		/* 16->24 dst_end: conv_16_24_end */
 | 
			
		||||
	conv_16_24_sign_end,	/* 16->24 dst_end sign: conv_16_24_sign_end */
 | 
			
		||||
	conv_16_end_24,		/* 16->24 src_end: conv_16_end_24 */
 | 
			
		||||
	conv_16_end_24_sign,	/* 16->24 src_end sign: conv_16_end_24_sign */
 | 
			
		||||
	conv_16_end_24_end,	/* 16->24 src_end dst_end: conv_16_end_24_end */
 | 
			
		||||
	conv_16_end_24_sign_end,/* 16->24 src_end dst_end sign: conv_16_end_24_sign_end */
 | 
			
		||||
	conv_16_32,		/* 16->32: conv_16_32 */
 | 
			
		||||
	conv_16_32_sign,	/* 16->32 sign: conv_16_32_sign */
 | 
			
		||||
	conv_16_32_end,		/* 16->32 dst_end: conv_16_32_end */
 | 
			
		||||
	conv_16_32_sign_end,	/* 16->32 dst_end sign: conv_16_32_sign_end */
 | 
			
		||||
	conv_16_end_32,		/* 16->32 src_end: conv_16_end_32 */
 | 
			
		||||
	conv_16_end_32_sign,	/* 16->32 src_end sign: conv_16_end_32_sign */
 | 
			
		||||
	conv_16_end_32_end,	/* 16->32 src_end dst_end: conv_16_end_32_end */
 | 
			
		||||
	conv_16_end_32_sign_end,/* 16->32 src_end dst_end sign: conv_16_end_32_sign_end */
 | 
			
		||||
	conv_24_8,		/* 24->8: conv_24_8 */
 | 
			
		||||
	conv_24_8_sign,		/* 24->8 sign: conv_24_8_sign */
 | 
			
		||||
	conv_24_8,		/* 24->8 dst_end: conv_24_8 */
 | 
			
		||||
	conv_24_8_sign,		/* 24->8 dst_end sign: conv_24_8_sign */
 | 
			
		||||
	conv_24_end_8,		/* 24->8 src_end: conv_24_end_8 */
 | 
			
		||||
	conv_24_end_8_sign,	/* 24->8 src_end sign: conv_24_end_8_sign */
 | 
			
		||||
	conv_24_end_8,		/* 24->8 src_end dst_end: conv_24_end_8 */
 | 
			
		||||
	conv_24_end_8_sign,	/* 24->8 src_end dst_end sign: conv_24_end_8_sign */
 | 
			
		||||
	conv_24_16,		/* 24->16: conv_24_16 */
 | 
			
		||||
	conv_24_16_sign,	/* 24->16 sign: conv_24_16_sign */
 | 
			
		||||
	conv_24_16_end,		/* 24->16 dst_end: conv_24_16_end */
 | 
			
		||||
	conv_24_16_sign_end,	/* 24->16 dst_end sign: conv_24_16_sign_end */
 | 
			
		||||
	conv_24_end_16,		/* 24->16 src_end: conv_24_end_16 */
 | 
			
		||||
	conv_24_end_16_sign,	/* 24->16 src_end sign: conv_24_end_16_sign */
 | 
			
		||||
	conv_24_end_16_end,	/* 24->16 src_end dst_end: conv_24_end_16_end */
 | 
			
		||||
	conv_24_end_16_sign_end,/* 24->16 src_end dst_end sign: conv_24_end_16_sign_end */
 | 
			
		||||
	lin_16_end_sign_end,	/* 16->16 src_end dst_end sign: lin_16_end_sign_end */
 | 
			
		||||
	lin_16_24,		/* 16->24: lin_16_24 */
 | 
			
		||||
	lin_16_24_sign,	/* 16->24 sign: lin_16_24_sign */
 | 
			
		||||
	lin_16_24_end,		/* 16->24 dst_end: lin_16_24_end */
 | 
			
		||||
	lin_16_24_sign_end,	/* 16->24 dst_end sign: lin_16_24_sign_end */
 | 
			
		||||
	lin_16_end_24,		/* 16->24 src_end: lin_16_end_24 */
 | 
			
		||||
	lin_16_end_24_sign,	/* 16->24 src_end sign: lin_16_end_24_sign */
 | 
			
		||||
	lin_16_end_24_end,	/* 16->24 src_end dst_end: lin_16_end_24_end */
 | 
			
		||||
	lin_16_end_24_sign_end,/* 16->24 src_end dst_end sign: lin_16_end_24_sign_end */
 | 
			
		||||
	lin_16_32,		/* 16->32: lin_16_32 */
 | 
			
		||||
	lin_16_32_sign,	/* 16->32 sign: lin_16_32_sign */
 | 
			
		||||
	lin_16_32_end,		/* 16->32 dst_end: lin_16_32_end */
 | 
			
		||||
	lin_16_32_sign_end,	/* 16->32 dst_end sign: lin_16_32_sign_end */
 | 
			
		||||
	lin_16_end_32,		/* 16->32 src_end: lin_16_end_32 */
 | 
			
		||||
	lin_16_end_32_sign,	/* 16->32 src_end sign: lin_16_end_32_sign */
 | 
			
		||||
	lin_16_end_32_end,	/* 16->32 src_end dst_end: lin_16_end_32_end */
 | 
			
		||||
	lin_16_end_32_sign_end,/* 16->32 src_end dst_end sign: lin_16_end_32_sign_end */
 | 
			
		||||
	lin_24_8,		/* 24->8: lin_24_8 */
 | 
			
		||||
	lin_24_8_sign,		/* 24->8 sign: lin_24_8_sign */
 | 
			
		||||
	lin_24_8,		/* 24->8 dst_end: lin_24_8 */
 | 
			
		||||
	lin_24_8_sign,		/* 24->8 dst_end sign: lin_24_8_sign */
 | 
			
		||||
	lin_24_end_8,		/* 24->8 src_end: lin_24_end_8 */
 | 
			
		||||
	lin_24_end_8_sign,	/* 24->8 src_end sign: lin_24_end_8_sign */
 | 
			
		||||
	lin_24_end_8,		/* 24->8 src_end dst_end: lin_24_end_8 */
 | 
			
		||||
	lin_24_end_8_sign,	/* 24->8 src_end dst_end sign: lin_24_end_8_sign */
 | 
			
		||||
	lin_24_16,		/* 24->16: lin_24_16 */
 | 
			
		||||
	lin_24_16_sign,	/* 24->16 sign: lin_24_16_sign */
 | 
			
		||||
	lin_24_16_end,		/* 24->16 dst_end: lin_24_16_end */
 | 
			
		||||
	lin_24_16_sign_end,	/* 24->16 dst_end sign: lin_24_16_sign_end */
 | 
			
		||||
	lin_24_end_16,		/* 24->16 src_end: lin_24_end_16 */
 | 
			
		||||
	lin_24_end_16_sign,	/* 24->16 src_end sign: lin_24_end_16_sign */
 | 
			
		||||
	lin_24_end_16_end,	/* 24->16 src_end dst_end: lin_24_end_16_end */
 | 
			
		||||
	lin_24_end_16_sign_end,/* 24->16 src_end dst_end sign: lin_24_end_16_sign_end */
 | 
			
		||||
	NULL,			/* 24->24: Nothing to do */
 | 
			
		||||
	conv_24_sign,		/* 24->24 sign: conv_24_sign */
 | 
			
		||||
	conv_24_end,		/* 24->24 dst_end: conv_24_end */
 | 
			
		||||
	conv_24_sign_end,	/* 24->24 dst_end sign: conv_24_sign_end */
 | 
			
		||||
	conv_24_end,		/* 24->24 src_end: conv_24_end */
 | 
			
		||||
	conv_24_end_sign,	/* 24->24 src_end sign: conv_24_end_sign */
 | 
			
		||||
	lin_24_sign,		/* 24->24 sign: lin_24_sign */
 | 
			
		||||
	lin_24_end,		/* 24->24 dst_end: lin_24_end */
 | 
			
		||||
	lin_24_sign_end,	/* 24->24 dst_end sign: lin_24_sign_end */
 | 
			
		||||
	lin_24_end,		/* 24->24 src_end: lin_24_end */
 | 
			
		||||
	lin_24_end_sign,	/* 24->24 src_end sign: lin_24_end_sign */
 | 
			
		||||
	NULL,			/* 24->24 src_end dst_end: Nothing to do */
 | 
			
		||||
	conv_24_end_sign_end,	/* 24->24 src_end dst_end sign: conv_24_end_sign_end */
 | 
			
		||||
	conv_24_32,		/* 24->32: conv_24_32 */
 | 
			
		||||
	conv_24_32_sign,	/* 24->32 sign: conv_24_32_sign */
 | 
			
		||||
	conv_24_32_end,		/* 24->32 dst_end: conv_24_32_end */
 | 
			
		||||
	conv_24_32_sign_end,	/* 24->32 dst_end sign: conv_24_32_sign_end */
 | 
			
		||||
	conv_24_end_32,		/* 24->32 src_end: conv_24_end_32 */
 | 
			
		||||
	conv_24_end_32_sign,	/* 24->32 src_end sign: conv_24_end_32_sign */
 | 
			
		||||
	conv_24_end_32_end,	/* 24->32 src_end dst_end: conv_24_end_32_end */
 | 
			
		||||
	conv_24_end_32_sign_end,/* 24->32 src_end dst_end sign: conv_24_end_32_sign_end */
 | 
			
		||||
	conv_32_8,		/* 32->8: conv_32_8 */
 | 
			
		||||
	conv_32_8_sign,		/* 32->8 sign: conv_32_8_sign */
 | 
			
		||||
	conv_32_8,		/* 32->8 dst_end: conv_32_8 */
 | 
			
		||||
	conv_32_8_sign,		/* 32->8 dst_end sign: conv_32_8_sign */
 | 
			
		||||
	conv_32_end_8,		/* 32->8 src_end: conv_32_end_8 */
 | 
			
		||||
	conv_32_end_8_sign,	/* 32->8 src_end sign: conv_32_end_8_sign */
 | 
			
		||||
	conv_32_end_8,		/* 32->8 src_end dst_end: conv_32_end_8 */
 | 
			
		||||
	conv_32_end_8_sign,	/* 32->8 src_end dst_end sign: conv_32_end_8_sign */
 | 
			
		||||
	conv_32_16,		/* 32->16: conv_32_16 */
 | 
			
		||||
	conv_32_16_sign,	/* 32->16 sign: conv_32_16_sign */
 | 
			
		||||
	conv_32_16_end,		/* 32->16 dst_end: conv_32_16_end */
 | 
			
		||||
	conv_32_16_sign_end,	/* 32->16 dst_end sign: conv_32_16_sign_end */
 | 
			
		||||
	conv_32_end_16,		/* 32->16 src_end: conv_32_end_16 */
 | 
			
		||||
	conv_32_end_16_sign,	/* 32->16 src_end sign: conv_32_end_16_sign */
 | 
			
		||||
	conv_32_end_16_end,	/* 32->16 src_end dst_end: conv_32_end_16_end */
 | 
			
		||||
	conv_32_end_16_sign_end,/* 32->16 src_end dst_end sign: conv_32_end_16_sign_end */
 | 
			
		||||
	conv_32_24,		/* 32->24: conv_32_24 */
 | 
			
		||||
	conv_32_24_sign,	/* 32->24 sign: conv_32_24_sign */
 | 
			
		||||
	conv_32_24_end,		/* 32->24 dst_end: conv_32_24_end */
 | 
			
		||||
	conv_32_24_sign_end,	/* 32->24 dst_end sign: conv_32_24_sign_end */
 | 
			
		||||
	conv_32_end_24,		/* 32->24 src_end: conv_32_end_24 */
 | 
			
		||||
	conv_32_end_24_sign,	/* 32->24 src_end sign: conv_32_end_24_sign */
 | 
			
		||||
	conv_32_end_24_end,	/* 32->24 src_end dst_end: conv_32_end_24_end */
 | 
			
		||||
	conv_32_end_24_sign_end,/* 32->24 src_end dst_end sign: conv_32_end_24_sign_end */
 | 
			
		||||
	lin_24_end_sign_end,	/* 24->24 src_end dst_end sign: lin_24_end_sign_end */
 | 
			
		||||
	lin_24_32,		/* 24->32: lin_24_32 */
 | 
			
		||||
	lin_24_32_sign,	/* 24->32 sign: lin_24_32_sign */
 | 
			
		||||
	lin_24_32_end,		/* 24->32 dst_end: lin_24_32_end */
 | 
			
		||||
	lin_24_32_sign_end,	/* 24->32 dst_end sign: lin_24_32_sign_end */
 | 
			
		||||
	lin_24_end_32,		/* 24->32 src_end: lin_24_end_32 */
 | 
			
		||||
	lin_24_end_32_sign,	/* 24->32 src_end sign: lin_24_end_32_sign */
 | 
			
		||||
	lin_24_end_32_end,	/* 24->32 src_end dst_end: lin_24_end_32_end */
 | 
			
		||||
	lin_24_end_32_sign_end,/* 24->32 src_end dst_end sign: lin_24_end_32_sign_end */
 | 
			
		||||
	lin_32_8,		/* 32->8: lin_32_8 */
 | 
			
		||||
	lin_32_8_sign,		/* 32->8 sign: lin_32_8_sign */
 | 
			
		||||
	lin_32_8,		/* 32->8 dst_end: lin_32_8 */
 | 
			
		||||
	lin_32_8_sign,		/* 32->8 dst_end sign: lin_32_8_sign */
 | 
			
		||||
	lin_32_end_8,		/* 32->8 src_end: lin_32_end_8 */
 | 
			
		||||
	lin_32_end_8_sign,	/* 32->8 src_end sign: lin_32_end_8_sign */
 | 
			
		||||
	lin_32_end_8,		/* 32->8 src_end dst_end: lin_32_end_8 */
 | 
			
		||||
	lin_32_end_8_sign,	/* 32->8 src_end dst_end sign: lin_32_end_8_sign */
 | 
			
		||||
	lin_32_16,		/* 32->16: lin_32_16 */
 | 
			
		||||
	lin_32_16_sign,	/* 32->16 sign: lin_32_16_sign */
 | 
			
		||||
	lin_32_16_end,		/* 32->16 dst_end: lin_32_16_end */
 | 
			
		||||
	lin_32_16_sign_end,	/* 32->16 dst_end sign: lin_32_16_sign_end */
 | 
			
		||||
	lin_32_end_16,		/* 32->16 src_end: lin_32_end_16 */
 | 
			
		||||
	lin_32_end_16_sign,	/* 32->16 src_end sign: lin_32_end_16_sign */
 | 
			
		||||
	lin_32_end_16_end,	/* 32->16 src_end dst_end: lin_32_end_16_end */
 | 
			
		||||
	lin_32_end_16_sign_end,/* 32->16 src_end dst_end sign: lin_32_end_16_sign_end */
 | 
			
		||||
	lin_32_24,		/* 32->24: lin_32_24 */
 | 
			
		||||
	lin_32_24_sign,	/* 32->24 sign: lin_32_24_sign */
 | 
			
		||||
	lin_32_24_end,	/* 32->24 dst_end: lin_32_24_end */
 | 
			
		||||
	lin_32_24_sign_end,	/* 32->24 dst_end sign: lin_32_24_sign_end */
 | 
			
		||||
	lin_32_end_24,	/* 32->24 src_end: lin_32_end_24 */
 | 
			
		||||
	lin_32_end_24_sign,	/* 32->24 src_end sign: lin_32_end_24_sign */
 | 
			
		||||
	lin_32_end_24_end,	/* 32->24 src_end dst_end: lin_32_end_24_end */
 | 
			
		||||
	lin_32_end_24_sign_end,/* 32->24 src_end dst_end sign: lin_32_end_24_sign_end */
 | 
			
		||||
	NULL,			/* 32->32: Nothing to do */
 | 
			
		||||
	conv_32_sign,		/* 32->32 sign: conv_32_sign */
 | 
			
		||||
	conv_32_end,		/* 32->32 dst_end: conv_32_end */
 | 
			
		||||
	conv_32_sign_end,	/* 32->32 dst_end sign: conv_32_sign_end */
 | 
			
		||||
	conv_32_end,		/* 32->32 src_end: conv_32_end */
 | 
			
		||||
	conv_32_end_sign,	/* 32->32 src_end sign: conv_32_end_sign */
 | 
			
		||||
	lin_32_sign,		/* 32->32 sign: lin_32_sign */
 | 
			
		||||
	lin_32_end,		/* 32->32 dst_end: lin_32_end */
 | 
			
		||||
	lin_32_sign_end,	/* 32->32 dst_end sign: lin_32_sign_end */
 | 
			
		||||
	lin_32_end,		/* 32->32 src_end: lin_32_end */
 | 
			
		||||
	lin_32_end_sign,	/* 32->32 src_end sign: lin_32_end_sign */
 | 
			
		||||
	NULL,			/* 32->32 src_end dst_end: Nothing to do */
 | 
			
		||||
	conv_32_end_sign_end	/* 32->32 src_end dst_end sign: conv_32_end_sign_end */
 | 
			
		||||
	lin_32_end_sign_end	/* 32->32 src_end dst_end sign: lin_32_end_sign_end */
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -347,7 +347,7 @@ int snd_pcm_plugin_build_linear(snd_pcm_format_t *src_format,
 | 
			
		|||
{
 | 
			
		||||
	struct linear_private_data *data;
 | 
			
		||||
	snd_pcm_plugin_t *plugin;
 | 
			
		||||
	conv_f func;
 | 
			
		||||
	linear_f func;
 | 
			
		||||
	int src_endian, dst_endian, sign, src_width, dst_width;
 | 
			
		||||
	int src_sample_size, dst_sample_size;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -426,7 +426,7 @@ int snd_pcm_plugin_build_linear(snd_pcm_format_t *src_format,
 | 
			
		|||
	if (dst_endian < 0)
 | 
			
		||||
		dst_endian = 0;
 | 
			
		||||
 | 
			
		||||
	func = ((conv_f(*)[4][2][2][2])convert_functions)[src_width][dst_width][src_endian][dst_endian][sign];
 | 
			
		||||
	func = ((linear_f(*)[4][2][2][2])linear_functions)[src_width][dst_width][src_endian][dst_endian][sign];
 | 
			
		||||
 | 
			
		||||
	if (func == NULL)
 | 
			
		||||
		return -EINVAL;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue