How to Build Intel® IPP Legacy Samples with Intel IPP 9.0 Legacy Libraries

ID 678659
Updated 3/18/2016
Version Latest
Public

author-image

By

This article provides instructions on how to build the Intel® Integrated Performance Primitives (Intel® IPP) legacy samples with Intel IPP Legacy Libraries. The Intel IPP deprecated functions were moved from the Intel IPP product to Legacy Libraries. It means that the legacy functions will not be optimized for future architectures (the latest optimization are targeted for Intel® Advanced Vector Extensions 2 (Intel® AVX2) instruction set). Support for these legacy functions and sample code is also discontinued. Use alternative solutions for Intel® IPP legacy domains.

Problem Statement

Starting from Intel® IPP 8.0, some old and unused library functionality has been deprecated. In general, several functional domains were moved from the Intel IPP package to Legacy Libraries, including:

  • Small Matrix Operations (ippMX),
  • Realistic Rendering (ippRR),
  • Video codecs (ippVC),
  • Image Compression (ippJ),
  • Spiral Generated (ippGen),
  • Data Integrity (ippDI),
  • Audio codecs (ippAC),
  • Speech codecs (ippSC).

In the remaining domains, several functions were also moved to Legacy Libraries, including:

  • 103 functions from the Color Conversion (ippCC) domain,
  • 47 functions from the String (ippCH) domain,
  • 184 functions from the Computer Vision (ippCV) domain,
  • 71 functions from the Data Compression (ippDC) domain,
  • 1439 functions from the Image Processing (ippI) domain,
  • 708 functions from the Signal Processing (ippS) domain.

This deprecation leads to inability to build the former Intel IPP samples, which were also removed in Intel IPP 9.0, using the Intel IPP 9.0 standard (active) library. Fortunately, all those missed Intel IPP domains and functions were not removed forever, they are available in the Intel® IPP 9.0 Legacy Libraries package.

Content of Intel(R) IPP 9.0 Legacy Libraries

The content and main features of Intel IPP Legacy Libraries are described in the Intel® IPP Legacy Libraries article  (/content/www/us/en/develop/articles/intel-ipp-legacy-libraries.html), which also describes the process of obtaining Intel IPP 9.0 Legacy Libraries for your operating system.

Last Known Intel(R) IPP Samples

The last Intel IPP version still containing all the samples described in this article is Intel IPP 8.0. The sample package has the _p_8.0.0.005 suffix, which means product version 8.0 and package number 005.

Intel IPP 8.0 package contains the following example packages (Windows* style):

Package Name

Content

w_ipp-audio_video_codecs_p_8.0.0.005.zip

Audio/video Unified Media Classes (UMC) libraries and applications

w_ipp-data_compression_p_8.0.0.005.zip

Several data compression libraries and examples

w_ipp-ijg_p_8.0.0.005.zip

JPEG IJG library and examples

w_ipp-speech_codecs_p_8.0.0.005.zip

Unified Speech Components (USC) library and applications

w_ipp-uic_p_8.0.0.005.zip

Unified Image Codecs (UIC) library and applications

None of these samples can be built with the Intel IPP 9.0 library without adding the Legacy Libraries. This article describes the changes that need to be done in your source code and build procedure to successfully build these samples.

Building Intel(R) IPP Samples With Intel(R) IPP 9.0 Legacy Libraries

The description below provides the "step-by-step" explanation of the changes that need to be made in build scripts and source code files to build the samples.

Build Audio/Video Sample

Let’s look what happens if we start the build process "as is", i.e. without inclusion of Legacy Libraries and any updates. Assume that the sample packages are located in the C:\Work directory.

  1. Start the command line window with Intel® IPP and Intel® Compiler environment. Let it be Intel® Parallel Studio XE 2016 Update 1 for 64-bit architecture for Microsoft* Visual Studio* 2015.
  2. Unzip w_ipp-audio_video_codecs_p_8.0.0.005.zip to current working directory. The following commands show what to do to try to build the audio/video samples. Note, it is assumed that CMake* (by Kitware) is installed on your computer.
  3. Update the ipp-samples.8.0.0.005\builder\build.cmd file to allow this command file to generate a workspace for Microsoft* Visual Studio* 2015.
    Line 46:    set possible_ws=nmake vs2008 vs2010 vs2012 vs2015
    +Line 107:  if /i !defined_ws! EQU vs2015 set cmake_ws=Visual Studio 14
  4. Create the workspace and try to build:
     unzip w_ipp-audio_video_codecs_p_8.0.0.005.zip > cd ipp-samples.8.0.0.005\builder > set IPPROOT # Check if IPPROOT is set properly IPPROOT=C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp > set PATH=C:\Program Files (x86)\CMake\bin;%PATH% > build.cmd --sample=audio-video-codecs --arch=intel64 --ws=vs2015 --ipp=static --conf=release clean build

Below are examples of possible issues, explanation of their origins and description of methods to avoid them.

Issue #1: 'Cannot open include file'

During the first try there will be a lot of error diagnostic messages like:

C:\Work\ipp-samples.8.0.0.005\sources\audio-video-codecs\codec\video\vc1\common\include\umc_vc1_common_defs.h(23): fatal error C1083: Cannot open include file: 'ippvc.h': No such file or directory [C:\Work\ipp-samples.8.0.0.005\__cmake\audio-video-codecs.intel64.vs2015.static-threaded\codec\video\vc1\common\vc1_common.vcxproj]

 

The origin of majority of these messages is the same: header files of deprecated domains (ippac.h and ippvc.h) are absent in standard Intel® IPP include directory $(IPPROOT)/include. So, we need to include Intel IPP 9.0 Legacy Libraries here. These libraries contain deprecated functionality.

To add Intel IPP 9.0 Legacy Libraries, do the following:

  1. Unarchive Intel IPP Legacy Libraries to some directory, for example C:\Work\IPPROOT_LEGACY. This directory will contain two top sub-directories include and lib. Assign an environment variable to that path
    > set IPPROOT_LEGACY=C:\Work\IPPROOT_LEGACY
  2. Modify the CMake script file C:\Work\ipp-samples.8.0.0.005\builder\ FindIPP.cmakeinclude and lib directories. The changes are the following:
    +Line 29: set(INTERNAL_IPP_INC_LEGACY $ENV{IPPROOT_LEGACY}/include)
    +Line 31: set(INTERNAL_IPP_LIB_LEGACY $ENV{IPPROOT_LEGACY}/lib/${INTERNAL_ARCH})
    +Line 47: string(REPLACE "$ENV{IPPROOT_LEGACY}/lib/${INTERNAL_ARCH}" "$ENV{IPPROOT_LEGACY}/lib/${INTERNAL_ARCH}/threaded/" INTERNAL_IPP_LIB ${INTERNAL_IPP_LIB})
    +Line 52: file(TO_CMAKE_PATH ${INTERNAL_IPP_INC_LEGACY} INTERNAL_IPP_INC_LEGACY)
    +Line 53: file(TO_CMAKE_PATH ${INTERNAL_IPP_LIB_LEGACY} INTERNAL_IPP_LIB_LEGACY)
    +Line 69: file(TO_NATIVE_PATH ${INTERNAL_IPP_INC_LEGACY} INTERNAL_IPP_INC_LEGACY)
    +Line 70: file(TO_NATIVE_PATH ${INTERNAL_IPP_LIB_LEGACY} INTERNAL_IPP_LIB_LEGACY)
    Line 73:  include_directories(${INTERNAL_IPP_INC} ${INTERNAL_IPP_INC_LEGACY})
    Line 74:  link_directories   (${INTERNAL_IPP_LIB} ${INTERNAL_IPP_LIB_LEGACY})

In our build script the projects' include and library directories will be extended with legacy include and library directories.

The next change you need to do is to make legacy include files acceptable by projects. The problem here is that legacy include files names are different from their pre-legacy naming. For example, former Intel IPP ippac.h file became ipp90legacy.h. Of course, you may change a lot of source code files with new names of legacy header files, but easier solution is to copy legacy header files with their original names. For example, copy the ippvc90legacy.h file as ippvc.h inside the C:\Work\IPPROOT_LEGACY\include directory.This operation is correct for the files that are removed totally from the active Intel IPP 9.0 package:

  • ippac90legacy.hippac.h (audio coding domain)
  • ippj90legacy.hippj.h (image compression domain)
  • ippsc90legacy.hippsc.h (speech coding domain)
  • ippvc90legacy.hippvc.h (video coding domain)

The other legacy files still have their analogues in the active Intel IPP library, so it is not recommended to rename them to avoid name mixing. 

You can also copy corresponding legacy libraries to their original names:

  • ippac90lgc.libippac.lib
  • ippac90lgcmt.libippacmt.lib
  • ippj90lgc.libippj.lib
  • ippj90lgcmt.libippjcmt.lib
  • ippsc90lgc.libippsc.lib
  • ippsc90lgcmt.libippsccmt.lib
  • ippvc90lgc.libippvc.lib 
  • ippvc90lgcmt.libippvcmt.lib

This will save you from extra-modification of application build scripts (some modification are still required).

There is no sense in copying dynamic library files with their original names, because the operating system will load the legacy dynamic libraries with their file names hard-coded in corresponding static libraries.

Now, you can start Microsoft* Visual Studio* IDE to do other source code modifications from this environment.

Issue #2: 'identifier not found'

The reason for that issue is that source code module refers to a Intel® IPP function, whose declaration is absent in active header file. For example,

10>C:\Work\audio-video-codecs-ipp-samples\ipp-samples.8.0.0.005\sources\audio-video-codecs\codec\video\common\me\src\umc_me.cpp(2318): error C3861: 'ippiGetResizeRect': identifier not found
10>C:\Work\audio-video-codecs-ipp-samples\ipp-samples.8.0.0.005\sources\audio-video-codecs\codec\video\common\me\src\umc_me.cpp(2319): error C3861: 'ippiResizeGetBufSize': identifier not found
10>C:\Work\audio-video-codecs-ipp-samples\ipp-samples.8.0.0.005\sources\audio-video-codecs\codec\video\common\me\src\umc_me.cpp(2325): error C3861: 'ippiResizeSqrPixel_8u_C1R': identifier not found

In fact, these are Intel IPP image processing functions, which were removed from the Intel IPP 9.0 library for different reasons, mainly because their API changed. Fortunately, the declarations of those functions still exist in legacy header files and functions themselves are included into legacy library files.

What we need to do here is to add inclusion of legacy header files along with active header files. For example, in the umc_me.cpp module from the example above we need to add the following at the top of the file:

#include "ippi90legacy.h"

Remember that we haven’t copied the ippi90legacy.h file as ippi.h to avoid confusion with active Intel IPP ippi.h.

In general, there are two or three places in source code files with the issue like that.

You can easily find out what additional header files you need to include by searching for a particular function name in all legacy header files.

For example,

> findstr ippiYCbCr411ToBGR555_8u16u_P3C3R c:\work\IPPROOT_LEGACY\include\*.h
c:\work\IPPROOT_LEGACY\include\ippcc90legacy.h://  Name:       ippiYCbCr411ToBGR565_8u16u_P3C3R / ippiYCbCr411ToBGR555_8u16u_P3C3R
c:\work\IPPROOT_LEGACY\include\ippcc90legacy.h:LEGACY90IPPAPI(IppStatus, legacy90ippiYCbCr411ToBGR555_8u16u_P3C3R,(const Ipp8u* pSrc[3],int srcStep[3],Ipp16u* pDst,int dstStep,IppiSize roiSize ))
c:\work\IPPROOT_LEGACY\include\ippcc90legacy_redef.h:#define ippiYCbCr411ToBGR555_8u16u_P3C3R legacy90ippiYCbCr411ToBGR555_8u16u_P3C3R

From the lines above, it is clear that you need to add ippcc90legacy.h to the corresponding source code module.

Issue #3: 'error 'ippInitCpu': identifier not found'

After we have tried to find the ippInitCpu function in legacy include files, we found that this function is absent in both active Intel IPP and legacy libraries.

In the audio-video-codecs sample this legacy function call is used to turn on the specific CPU optimization - other than default. This call comes from the InitPreferredCpu utility function (-ipp_cpu option of command line).

We may not need this option and can comment the corresponding statements in the InitPreferredCpu function like below

IppStatus InitPreferredCpu(DString sCpu)
{
    //if(sCpu.Size())
    //{
    //    if(!sCpu.Compare(VM_STRING("SSE"), false))
    //        return ippInitCpu(ippCpuSSE);
    //    else if(!sCpu.Compare(VM_STRING("SSE2"), false))
    //        return ippInitCpu(ippCpuSSE2);
    //    else if(!sCpu.Compare(VM_STRING("SSE3"), false))
    //        return ippInitCpu(ippCpuSSE3);
    //    else if(!sCpu.Compare(VM_STRING("SSSE3"), false))
    //        return ippInitCpu(ippCpuSSSE3);
    //    else if(!sCpu.Compare(VM_STRING("SSE41"), false))
    //        return ippInitCpu(ippCpuSSE41);
    //    else if(!sCpu.Compare(VM_STRING("SSE42"), false))
    //        return ippInitCpu(ippCpuSSE42);
    //    else if(!sCpu.Compare(VM_STRING("AVX"), false))
    //        return ippInitCpu(ippCpuAVX);
    //    else if(!sCpu.Compare(VM_STRING("AES"), false))
    //        return ippInitCpu(ippCpuAES);
    //    else if(!sCpu.Compare(VM_STRING("AVX2"), false))
    //        return ippInitCpu(ippCpuAVX2);
    //}
    return ippInit();
}

But, here is hidden another potential problem related to difference in CPU dispatching mechanisms for a legacy library and active Intel IPP library. They are simply different, controlled by different code and variables; ignoring this may lead to a situation when functions from active Intel IPP are set to latest CPU optimization, while the legacy library is not initialized and uses non-optimized functions code.

For that, every library in the legacy package has its own function for initialization. Since there is no common core library in the legacy package, you need to initialize all libraries from legacy package separately. The initialization functions are named as legacy90ipp<domain>Init, for example, legacy90ippacInit.

Since we know that the audio-video-codecs sample uses signal processing (SP), image processing (IP), image compression (J), audio coding (AC), video coding (VC), and some other legacy Intel IPP libraries, you need to call all their initialization functions sequentially.

The list of libraries used in the sample can be obtained from the audio-video-codecs\application\ <application>\CMakeLists.txt files at lines list( APPEND LIBS_IPP …. The list of used libraries is different for different applications, but we can add initializations for all legacy libraries (take the longest list of libraries from the simple_player application). With the static library linkage it will not significantly increase the resulting executable image file because in the worst case, when the initialization function is taken from unused library, this operation will enlarge the executable image size by size of the initialization function only.

So, finally our InitPreferredCpu function will look like

#include "ipps90legacy.h"
#include "ippi90legacy.h"
#include "ippj90legacy.h"
#include "ippvc90legacy.h"
#include "ippcc90legacy.h"
#include "ippac90legacy.h"
#include "ippdc90legacy.h"
#include "ippch90legacy.h"
IppStatus InitPreferredCpu(DString sCpu)
{
    legacy90ippsInit();  legacy90ippiInit(); legacy90ippjInit();
    legacy90ippvcInit(); legacy90ippjInit(); legacy90ippacInit();
    legacy90ippdcInit(); legacy90ippchInit();
    return ippInit();
}

Issue #4: 'error 'ippStaticInit': identifier not found'

This issue comes from the audio-video-codecs\codec\video\vc1\dec\src\ umc_vc1_dec_seq.cpp source code file (Line:810). We are not going to discover what this line is for and simply will comment this line.

After each modification, we build the audio-video-codecs solution again and see that the number of issues to be solved is getting smaller.

Issue #5: Syntax Error In +ipps.h+ File

In Visual Studio* environment, with this issue, we see

1>  functions_cc.c
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2143: syntax error: missing ')' before '*'
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2081: 'IppsRandUniState_64f': name in formal parameter list illegal
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2143: syntax error: missing '{' before '*'
1>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2059: syntax error: ')'

This issue may come from difference in declaration of previous IppsRandUniState_32f structure in ipptypes.h files in legacy and active Intel IPP libraries.

To avoid this, we need to reorder include files in the corresponding source code modules, like in the functions_cc.c file below

#include "ipps.h"
#include "functions_common.h"
/*#include "ipps.h"*/
#include "ippi.h"

Issue #6: 'error 'abs': ambiguous call to overloaded function'

This issue may be specific to the particular Visual Studio* SDK, for example, it is seen in VS2015. To avoid this, we simply use fabs instead of abs.

Issue #7: 'error 'ippacGetLibVersion': identifier not found'

For easy use of Intel IPP legacy functions, their names were changed from ipp<domain>* to legacy90ipp<domain>*. This enables co-existence of legacy functions and functions from active Intel IPP library in the same application, there will be no name conflicts.

To simplify usage of these functions, their new names were redefined back to their old names. This allows to avoid modification of source code files that use legacy functions.

#define ippsAnalysisFilterEncFree_SBR_32f legacy90ippsAnalysisFilterEncFree_SBR_32f

However, Intel IPP legacy library misses redefinitions for several functions, which is seen from the following output

7>------ Build started: Project: simple_player, Configuration: debug x64 ------
3>C:\Work\ipp-samples.8.0.0.005\sources\audio-video-codecs\application\umc_audio_dec_con\src\umc_audio_dec_con.cpp(76): error C3861: 'ippacGetLibVersion': identifier not found
4>C:\Work\ipp-samples.8.0.0.005\sources\audio-video-codecs\application\umc_audio_enc_con\src\umc_audio_enc_con.cpp(72): error C3861: 'ippacGetLibVersion': identifier not found
5>C:\Work\ipp-samples.8.0.0.005\sources\audio-video-codecs\application\umc_video_dec_con\src\umc_video_dec_con.cpp(104): error C3861: 'ippjGetLibVersion': identifier not found
5>C:\Work\ipp-samples.8.0.0.005\sources\audio-video-codecs\application\umc_video_dec_con\src\umc_video_dec_con.cpp(105): error C3861: 

You will have to either update function names to their legacy names, or to add missing redefinitions manually

// Update ippac90legacy_redef.h
#define ippacGetLibVersion legacy90ippacGetLibVersion
// Update ippj90legace_redef.h
#define ippjGetLibVersion legacy90ippjGetLibVersion
// Update ippvc90legacy_redef.h
#define ippvcGetLibVersion legacy90ippvcGetLibVersion

Issue #8: 'error : unresolved external symbol'

At this stage, there is no more compilation problems in the solution, only linking problems remain

1>application_common.lib(umc_app_utils.obj) : error LNK2019: unresolved external symbol legacy90ippvcInit referenced in function "enum IppStatus __cdecl InitPreferredCpu(class UMC::DString)" (?InitPreferredCpu@@YA?AW4IppStatus@@VDString@UMC@@@Z)

This is simple, we need to add legacy libraries - the libraries which were not renamed at step 1 - to our projects.

For that, we need to return back to modification of CMake build scripts for sample’s applications: simple_player, umc_audio_dec_con, umc_audio_enc_con, umc_video_dec_con and umc_video_enc_con. We need to modify list( APPEND LIBS_IPP ippcore ... ) lines in the corresponding CMakeLists.txt files. We can take the longest line from the audio-video-codecs\ application\simple_player\CMakeLists.txt file

list( APPEND LIBS_IPP ippcore ipps ippi ippj ippvc ippcc ippac ippdc ippch )

modify it to

list( APPEND LIBS_IPP ippcore ipps ipps90lgc ippi ippi90lgc ippj ippvc ippcc ippcc90lgc ippac ippdc ippdc90lgc ippch ippch90lgc )

(note that we added legacy library names without suffixes only to non-renamed - ipps, ippi, ippcc, ippdc and ippch - libraries).

Additional library from Intel IPP is required for umc_audio_enc_con and umc_audio_dec_con applications. It is ippvm - vector math functions. Some time ago, the mathematical functions like exp, sin and others were moved from ipps signal processing library to ippvm, so we need to include this library to linking process explicitly.

Intel IPP computer vision library will be required in the umc_video_enc_con application, so you’ll need to extend the list of libraries for that application with the ippcv library.

After modification of CMakeLists.txt files you will need to execute the build.cmd script again to regenerate project files with CMake. Don’t forget to use the -clean option to clean-up previously generated projects from the working directory.

Issue #9 (last): 'unresolved external symbol ippsIIRInitAlloc_32f'

These are kind of troublesome issues, non-visible at once. The ippsIIRInitAlloc_32f function is really absent in both active Intel IPP and legacy libraries. During the compilation the absence of this function is signaled with the compiler warning message

1>  aac_enc_psychoacoustic_fp.c
1>C:\Work\audio-video-codecs-ipp-samples\ipp-samples.8.0.0.005\sources\audio-video-codecs\codec\audio\aac\enc\src\aac_enc_psychoacoustic_fp.c(435): warning C4013: 'ippsIIRInitAlloc_32f' undefined; assuming extern returning int

which we missed because we tracked only error messages, but compiler doesn’t generate errors for an unknown function call in C language modules (in C++ it does).

In previous versions of the Intel IPP library this function was declared as

IPPAPI(IppStatus, ippsIIRInitAlloc_32f, (IppsIIRState_32f** ppState,
       const Ipp32f* pTaps, int order, const Ipp32f* pDlyLine))

In the current version of the Intel IPP library this function corresponds to two new Intel IPP functions

IPPAPI( IppStatus, ippsIIRGetStateSize_32f,( int order, int *pBufferSize ))
IPPAPI( IppStatus, ippsIIRInit_32f,( IppsIIRState_32f** ppState,
       const Ipp32f* pTaps, int order, const Ipp32f* pDlyLine, Ipp8u* pBuf ))

Instead of calling the ippsIIRInitAlloc_32f function, we need to introduce the following construction

#if 0
  ippsIIRInitAlloc_32f(&pBlock->IIRfilterState, iirTap, 1, NULL);
#else
  {
      int bufSize;
      Ipp8u* pBuf;

      ippsIIRGetStateSize_32f(1, &bufSize);
      pBuf = ippsMalloc_8u(bufSize);
      ippsIIRInit_32f(&pBlock->IIRfilterState, iirTap, 1, NULL, pBuf);
  }
#endif

Build Speech Codecs Sample

Now we are going to build the speech-codecs sample from the sample package w_ipp-speech_codecs_p_8.0.0.005.zip. To simplify build process, unzip the package to the same working directory. When "unzip" tool asks about rewriting existing filesbuild.cmd, FindIPP.cmake and others, say "no", because these files already contain helpful changes.

Start building process with the command:

> build --sample=speech-codecs --arch=intel64 --ipp=static --conf=debug --ws=vs2015

This command creates Microsoft* Visual Studio* project and solution files. Remember that on previous stages we have done many changes in the script and Intel IPP legacy files, which remove many of possible issues in the speech-codecs build.

Nevertheless, some issues still exist. Start Microsoft* Visual Studio* IDE on the __cmake\speech-codecs.intel64.vs2015. static\speech-codecs.sln solution file. Choose Solution/Build command to have all issues in the studio’s output window.

Issue #1: ipps.h: error C2143: syntax error: missing '{' before '*'

To avoid these issues, you need to reorder include files in the corresponding modules so that legacy include files, like ippsc.h, will come last.

For that you will have to open the source code file, which originally causes the issue. For example, in the diagnostics messages

2>  C:\Work\IPPROOT_LEGACY\include\ippsc.h(5221): note: see declaration of 'legacy90ippsShapeEnvelopTime_G7291_16s'
3>  decgsmfr.c
5>  Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64
5>  Copyright (C) Microsoft Corporation.  All rights reserved.
3>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2143: syntax error: missing ')' before '*'
3>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2081: 'IppsRandUniState_64f': name in formal parameter list illegal
3>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2143: syntax error: missing '{' before '*'
3>C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2016.1.146\windows\ipp\include\ipps.h(284): error C2059: syntax error: ')'

the problematic file is decgsmfr.c. Preprocessor #include directives in this file are

#include    <ippsc.h>
#include    "owngsmfr.h"

For successful compilation, you need to set them as:

#include    "owngsmfr.h"
#include    <ippsc.h>

In Microsoft* Visual Studio*, it is easy to find the required source code file. For that, write the file name in the search string of the Solution Explorer window. Solution Explorer window will update source code file tree with the only file in it.

There are less than ten files with these specifics.

Issue #2: warning C4013: '<fun>' undefined; assuming extern returning int

These are issues related to Intel IPP function declarations, which were moved from active header files, in particular from ipps.h, to its legacy counterpart. If we don’t fix these issues, we will come to unresolved references during application linking.

To fix these issue, we need to add

#include "ipps90legacy.h"

in the beginning of all these files. Better if this line will be the last of all includes.

Search for "assuming" substring in the Microsoft* Visual Studio* Output window and make the changes.

Issue #3: error 'ippStaticInit: identifier not found'

Refer to CPU initialization chapter above.

Include these files

#include "ipps90legacy.h"
#include <ippsc.h>

and use

   ippInit();
   legacy90ippsInit();
   legacy90ippscInit();

instead of ippStaticInit.

Do the same for files:

  • speech-codecs\application\usc_nr\src\nr_exmp.c
  • speech-codecs\application\usc_ec\src\usc_ec.c
  • speech-codecs\application\usc_tones\src\td.c
  • speech-codecs\application\usc_speech_codec\src\player.c

Issue #4: Hilbert Problem

There is a specific to speech-codecs sample problem in the speech-codecs\codec\speech\td\ src\usc_ansam.c file.

1>C:\Work\ipp-samples.8.0.0.005\sources\speech-codecs\codec\speech\td\src\usc_ansam.c(211): warning C4013: 'ippsHilbertInitAlloc_32f32fc' undefined; assuming extern returning int
1>C:\Work\ipp-samples.8.0.0.005\sources\speech-codecs\codec\speech\td\src\usc_ansam.c(213): warning C4133: 'function': incompatible types - from 'IppsHilbertSpec_32f32fc *' to 'IppsHilbertSpec *'
1>C:\Work\ipp-samples.8.0.0.005\sources\speech-codecs\codec\speech\td\src\usc_ansam.c(213): error C2198: 'ippsHilbert_32f32fc': too few arguments for call
1>C:\Work\ipp-samples.8.0.0.005\sources\speech-codecs\codec\speech\td\src\usc_ansam.c(227): warning C4013: 'ippsHilbertFree_32f32fc' undefined; assuming extern returning int

This problem is similar to the above. Hilbert transform functionality in the signal processing domain changed its API (refer to the https://software.intel.com/en-us/node/502356 documentation chapter).

      Ipp32f m;
#if 0
      IppsHilbertSpec_32f32fc *pHilbSpec;
      ippsHilbertInitAlloc_32f32fc(&pHilbSpec,ANS_header->toneLen, ippAlgHintAccurate);

      ippsHilbert_32f32fc(ANS_header->tmpVec, ANS_header->tmpVecH, pHilbSpec);
#else
      IppsHilbertSpec *pHilbSpec;
      Ipp8u* pBuffer;
      int sizeSpec, sizeBuf;
      ippsHilbertGetSize_32f32fc(ANS_header->toneLen, ippAlgHintAccurate, &sizeSpec, &sizeBuf);
      pHilbSpec = (IppsHilbertSpec*)ippsMalloc_8u(sizeSpec);
      pBuffer = (Ipp8u*)ippsMalloc_8u(sizeBuf);
      ippsHilbertInit_32f32fc(ANS_header->toneLen, ippAlgHintAccurate, pHilbSpec, pBuffer);

      ippsHilbert_32f32fc(ANS_header->tmpVec, ANS_header->tmpVecH, pHilbSpec, pBuffer);
#endif

#if 0
      ippsHilbertFree_32f32fc(pHilbSpec);
#else
      ippsFree(pHilbSpec);
      ippsFree(pBuffer);
#endif

Issue #5: unresolved external symbol

At this stage we should have no more compilation errors, only linker problems may remain. There are 5 application projects in the sources\speech-codecs\application directory, each of them has the corresponding CMakeLists.txt file for the CMake* tool.

We need to add the signal processing legacy library as we have done for audio/video codecs.

list( APPEND LIBS_IPP ippcore ipps ippsc ippvm ipps90lgc )

Add the ipps90lgc library to the end of list ( APPEND LIBS_IPP… line for all applications.

In the CMakeLists.txt file for the usc_tones application we need to add the ippvm library to the end of the list.

Regenerate workspaces and rebuild the sample.

> build --sample=speech-codecs --arch=intel64 --ipp=static --conf=debug --ws=vs2015 --clean --build

Issue #6: speech_msrtafp.lib(<obj>) : error LNK2019: unresolved external symbol

At this stage we should have no more compilation errors, only linker problems should remain. There are 5 application projects in the sources\speech-codecs\application directory, each of them has the corresponding CMakeLists.txt file for the CMake* tool.

We need to add the signal processing legacy library as we have done for audio/video codecs.

list( APPEND LIBS_IPP ippcore ipps ippsc ippvm ipps90lgc )

Add the ipps90lgc library to the end of the list ( APPEND LIBS_IPP… line for all applications.

In the CMakeLists.txt file for the usc_tones application we need to add the ippvm library to the end of the list.

Regenerate workspaces and rebuild the sample.

> build --sample=speech-codecs --arch=intel64 --ipp=static --conf=debug --ws=vs2015 --clean --build

Building UIC Sample

In the uic image compression sample we need to do the following modifications:

  • Find all files containing ippj.h. Move this inclusion statement to the end of all inclusions in the current file. We are getting rid of this issue.
  • Update the calls of the ippiReduceBits* functions to a new API with the working buffer argument. This new API will require preparation for the call with getting buffer size using the ippiReduceBitsGetBufferSize function, allocation of the working buffer, call of the processing function and release of the working buffer, like in the following example
      switch(m_nchannels)
      {
      case 1:
#if 0
        status = ippiReduceBits_16u8u_C1R(pTmpRow, m_step, dst, dstStep, sz, 0, ippDitherNone, 255); break;
#else
      {
          int sizeBuf;
          Ipp8u* pBuf;
          status = ippiReduceBitsGetBufferSize(ippC1, sz, 0, ippDitherNone, &sizeBuf);
          pBuf = (Ipp8u*)ippsMalloc_8u(sizeBuf);
          status = ippiReduceBits_16u8u_C1R(pTmpRow, m_step, dst, dstStep, sz, 0, ippDitherNone, 255, pBuf);
          ippsFree(pBuf);
      }
      break;
#endif
      case 3:

To simplify source code changes, we can allocate buffer for maximum size (4 channels), use it for subsequent calls within switch and then release this buffer.

      int sizeBuf;
      Ipp8u* pBuf;
      status = ippiReduceBitsGetBufferSize(ippC4, sz, 0, ippDitherNone, &sizeBuf);
      pBuf = (Ipp8u*)ippsMalloc_8u(sizeBuf);

      switch(m_nchannels)
      {
      case 1:
        status = ippiReduceBits_16u8u_C1R(pTmpRow,m_step,dst, dstStep, sz, 0, ippDitherNone, 255, pBuf); break;
      case 3:
        status = ippiReduceBits_16u8u_C3R(pTmpRow, m_step, dst, dstStep, sz, 0, ippDitherNone, 255, pBuf); break;
      case 4:
        status = ippiReduceBits_16u8u_C4R(pTmpRow, m_step, dst, dstStep, sz, 0, ippDitherNone, 255, pBuf); break;
      default:
        ippFree(pTmpRow);
        ippsFree(pBuf);
        return -1;
      }
      ippsFree(pBuf);
      if(ippStsNoErr != status)
      {

The last change to do is to comment buf and ippiResizeGetBufSize source code as not used in the CIppImage::Resize function.

Building Image Codecs Sample

During build process of this sample, the only problem was with the ippStaticInit and ippInitCpu functions. We need to properly initialize active and legacy Intel IPP libraries as described above.

Building Intel(R) IPP Samples On Linux*

In order to build the samples on Linux*, we need to do the same changes in the CMake build scripts and source code files as earlier with the following differences:

  • When we rename (copy) legacy libraries to their original names without the "lgc" suffix, we need to choose proper Linux* library names. For example, the libippac90lgc.a file must be copied to libippac.a, and so on;
  • We need to remove Intel® compiler run-time libraries from the list of required libraries for applications in the file builder/BuildFunctions.cmake
function( link_compiler_libraries )
  if( Windows )
    list(APPEND COMP_LIBS svml_dispmd libmmd libirc)
  else ()
#    list(APPEND COMP_LIBS svml imf irc)
  endif()
  • Add re-definition of __int64 type for the jitter_buffers sub-project in the file sources/ speech-codecs/io/jitter_buffers/CMakeLists.txt
 ${CMAKE_SOURCE_DIR}/core/vm/include
  ${CMAKE_SOURCE_DIR}/core/usc/include
)

if( Linux )
  add_definitions( -D__int64=int64_t )
endif( )
make_library( static )