/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.
*******************************************************************************/
#include <stdint.h>
#include <stdio.h>
#define NCHANNELS 2
#define NSAMPLES 4
#define NDUMMY 1
typedef int16_t sample;
typedef sample input_sample[NCHANNELS];
typedef input_sample input_buffer[NSAMPLES + NDUMMY];
typedef sample output_channel[NSAMPLES];
typedef output_channel output_buffer[NCHANNELS];
input_buffer Input =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
};
output_buffer Output;
void shuffle(int channel)
{
for(int i = 0; i < NSAMPLES; ++i)
Output[channel][i] = Input[i + NDUMMY][channel];
}
int main()
{
for(int i = 0; i < NCHANNELS; ++i)
shuffle(i);
sample * pOutSample = Output[0];
for(int i = 0; i < sizeof(Output) / sizeof(Output[0][0]); ++i)
printf(" %d", *pOutSample++);
return 0;
}