Copy

Copies the contents of one vector into another.

Syntax

IppStatus ippsCopy_1u(const Ipp8u* pSrc, int srcBitOffset, Ipp8u* pDst, int dstBitOffset, int len);

IppStatus ippsCopy_8u(const Ipp8u* pSrc, Ipp8u* pDst, int len);

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

IppStatus ippsCopy_32s(const Ipp32s* pSrc, Ipp32s* pDst, int len);

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

IppStatus ippsCopy_64s(const Ipp64s* pSrc, Ipp64s* pDst, int len);

IppStatus ippsCopy_64f(const Ipp64f* pSrc, Ipp64f* pDst, int len);

IppStatus ippsCopy_16sc(const Ipp16sc* pSrc, Ipp16sc* pDst, int len);

IppStatus ippsCopy_32sc(const Ipp32sc* pSrc, Ipp32sc* pDst, int len);

IppStatus ippsCopy_32fc(const Ipp32fc* pSrc, Ipp32fc* pDst, int len);

IppStatus ippsCopy_64sc(const Ipp64sc* pSrc, Ipp64sc* pDst, int len);

IppStatus ippsCopy_64fc(const Ipp64fc* pSrc, Ipp64fc* pDst, int len);

Parameters

pSrc

Pointer to the source vector.

pDst

Pointer to the destination vector.

len

Number of elements to copy.

srcBitOffset

Offset (in bits) in the first byte of the source vector.

dstBitOffset

Offset (in bits) in the first byte of the destination vector.

Description

The functionippsCopy is declared in the ipps.h file. This function copies the first len elements from a source vector pSrc into a destination vector pDst.

ippsCopy_1u. This funtion flavor performs copying operation on a vector that has a 8u data type where each byte represents eight consecutive elements. In ths case additional parameters srcBitOffset and dstBitOffset are required to specifiy start positions in the source and destination vectors respectively. Note that the bit order in each byte is inverse relative to the element order, that is, the first element in a vector is represented by the last (7th) bit in the first byte of the vector (see the figure below).

Bit Layout for the Function ippsCopy_1u.

Caution iconCaution

These functions perform only copying operations described above and are not intended to move data. Their behavior is unpredictable if source and destination buffers are overlapping. To move data, the functions ippsMove must be used.

The example below shows how to use the function ippsCopy.

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.

Using the ippsCopy Function

IppStatus copy(void) {
      char src[] = “to be copied\0”;
      char dst[256];
      return ippsCopy_8u(src, dst,
strlen(src)+1);
}




Submit feedback on this help topic

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