Interleave

Converts signal from non-interleaved to interleaved format.

Syntax

IppStatus ippsInterleave_16s(const Ipp16s** pSrc, int ch_num, int len, Ipp16s* pDst);

IppStatus ippsInterleave_32f(const Ipp32f** pSrc, int ch_num, int len, Ipp32f* pDst);

Parameters

pSrc

Array of pointers to the vectors [len] containing samples for particular channels.

ch_num

Number of channels.

len

Number of samples in each channel.

pDst

Pointer to the destination vector [ch_num * len] in interleaved format.

Description

This function is declared in the ippac.h header file. The function ippsInterleave transforms the signal from the non-interleaved to interleaved format according to the formula

pDst[i ] = pSrc[ i div ch_num ][i mod ch_num], 0i < ch_num * len,

where div is the integer part of the quotient and mod is the remainder.

Below see code example  of using ippsInterleave_16s function.

The function ippsInterleave_32f is used in the float-point version of MP3 encoder included into Intel IPP Samples. See introduction to this section.

Return Values

ippStsNoErr

Indicates no error.

ippStsNullPtrErr

Indicates an error when the pSrc or pDst pointer is NULL.

ippStsSizeErr

Indicates an error when len is less than or equal to 0.

ippStsNumChannelsErr

Indicates an error when ch_num is less than or equal to 0.

ippStsMisalignedBuf

Indicates misaligned data. Supply aligned data for better performance.

ippsInterleave_16s Usage

IppStatus interleave(void) 
{
  Ipp16s i0[5] = {0,1,2,3,4};
  Ipp16s i1[5] = {10,11,12,13,14};
  Ipp16s pDst[10];
  Ipp16s *pSrc[2];
  IppStatus st;
  int i;
		
  pSrc[0] = i0; pSrc[1] = i1;
  st = ippsInterleave_16s(pSrc, 2, 5, pDst);

		
  printf("\n pDst = ");
  for (i = 0; i < 10; i++)
    printf("%i ", pDst[i]);
  printf("\n");
  return st;
}

		
//Output:
//  pDst = 0 10 1 11 2 12 3 13 4 14 

Submit feedback on this help topic

Copyright © 2000 - 2011, Intel Corporation. All rights reserved.