1. Today is ready to look at the WMMX manual, and prepare to transplant code, but later IPP libraries will not expire make this idea can be achieved, so I download a library of IPP for PCA in the afternoon, but installed. The problem is that there is no static library file after installation, no way. After searching a large circle, I had to use a trouble method, which is to call the dynamic library. This is very different from Windows. Mainly The program contains DLFCN.H file, then call four functions. A, first is to declare three variables void * handle; // Return to the address of the function in the dynamic library CHAR * error; // Report Error message void handle; / / Handle B, then call the library open function dlopen () handle = DLOPEN ("./ IPPVC_WMMX50LNX_D.SO", RTLD_LAZY); RTLD_LAZY indicates that the actual load operation of each function can also be rtLD_NOW, indicating that all of the library As a memory, you can use it immediately. These two flags can be used with RTLD_GLOBAL, which allows all of the external references in the library to protest to the function found in other dynamic libraries, of course other dynamic libraries must be loaded. Dynamic library .C, then call function DLERROR () f (error = DLERROR ()) {Printf ("% s / n", error); exit (1);} Check the error message D, then find the corresponding in the library Function symbol, DLSYM () and assign it to function pointer IPPIINTERPOLATELUMA_H264_8U_C1R = DLSYM (Handle, "IppiInterPolateluma_H264_8U_C1R"); if (Error = DLERROR ()) {Printf ("% s / n", error); exit (1) Check the error message E, then call the function, and check the error information F. Turn off the dynamic library DLClose (Handle); the specific procedure is as follows: (this is the H264 interpolated program, the program results are incorrect, here is just the verification library can be called)
#include "ipp.h" #include "dlfcn.h" #include "stdio.h" #include "ippdefs.h" int main () {ipp8u psrc [169]; IPP8U PDST [64]; IPP8U i; IPP32S Srcstep = 13; Ipp32s dstStep = 8; Ipp32s dx = 1; Ipp32s dy = 1; IppStatus status; IppiSize roi = {4,4}; void * handle; char * error; IppStatus (* ippiInterpolateLuma_H264_8u_C1R) (const Ipp8u * pSrc, Ipp32s SRCSTEP, IPP8U * PDST, IPP32S DSTSTEP, IPP32S DX, IPP32S DY, IPPISize ROI); Handle = DLOPEN ("./ IPPVC_WMMX50LNX_D.SO", RTLD_LAZY); // To add the current path, it is best to write because PXA270 The file system of the operating system is read-only and cannot be copied to other directory IF (error = DLERROR ()) {Printf ("% s / n", error); exit (1);}} ippiinterpolateluma_h264_8u_c1r = dlsym (Handle, "IPPIINTERPOLATELUMA_H264_8U_C1R"); if (error = DLError ()) {Printf ("% s / n", error); exit (1);} for (i = 0; i <81; i ) PSRC [i] = i ; // IPPAPI (status, ippiInterpolateLuma_H264_8u_C1R, (const Ipp8u * pSrc, Ipp32s srcStep, Ipp8u * pDst, Ipp32s dstStep, Ipp32s dx, Ipp32s dy, IppiSize roi)) status = ippiInterpolateLuma_H264_8u_C1R (pSrc, srcStep, pDst, dstStep, dx, dy , ROI); if (status == ippstsnoerr) {Printf ("ok / n");} elseprintf ("ipp error / n"); f OR (i = 0; i <81; i ) {if (! (i & 0x07)) Printf ("/ n"); Printf ("% D");
} DLClose (Handle);
In addition, the functions for H.264 decoding have been implemented as follows: / *********** H.264 Decoder functions *********** // * interpolation * / ippapi (Ippstatus, ippiinterpolateluma_h264_8u_c1r, (const IPP8U * PSRC, IPP32S srcstep, IPP8U * PDST, IPP32S Dststep, IPP32S DX, IPP32S DY, IPPisize Roi))
IPPAPI (ippstatus, ippiinterpolatechroma_h264_8u_c1r, (Const IPP8U * PSRC, IPP32S srcstep, IPP8U * PDST, IPP32S Dststep, IPP32S DX, IPP32S DY, IPPISize ROI))
/ * Intra Prediction * / IPPAPI (IppStatus, ippiPredictIntra_4x4_H264_8u_C1R, (Ipp8u * pSrcLeft, Ipp8u * pSrcAbove, Ipp8u * pSrcAboveLeft, Ipp8u * pDst, int leftStep, int dstStep, IppIntra4x4PredMode_H264 predMode, Ipp32u availability)) IPPAPI (IppStatus, ippiPredictIntra_16x16_H264_8u_C1R, (Ipp8u * psrcleft, ipp8u * psrcabove, ipp8u * psrcaboveleft, IPP8U * PDST, INT LEFTSTEP, INT DSTSTEP, IPPINTRA16X16PREDMODE_H264 PREDMODE, IPP32U AVAILABILITY))
IPPAPI (IppStatus, ippiPredictIntraChroma8x8_H264_8u_C1R, (Ipp8u * pSrcLeft, Ipp8u * pSrcAbove, Ipp8u * pSrcAboveLeft, Ipp8u * pDst, int leftStep, int dstStep, IppIntraChromaPredMode_H264 predMode, Ipp32u availability))
/ * Dequant / Transform * / IPPAPI (ippstatus, ippitransformdequantlumadcfrompair_h264_8u16s_c1, (iPp8u ** PPSRC, IPP16S * PDST, INT QP))
IPPAPI (IppStatus, IppiTransformDequantchromadcfromPAIR_H264_8U16S_C1, (IPP8U * PPSRC, IPP16S * PDST, INT QP))
IPPAPI (IppStatus, ippiDequantTransformResidualFromPairAndAdd_H264_8u_C1, (Ipp8u ** ppSrc, const Ipp8u * pPred, Ipp16s * pDC, Ipp8u * pDst, int predStep, int dstStep, int QP, int AC))
/ * Deblock filter * / IPPAPI (IppStatus, ippiFilterDeblockingLuma_VerEdge_H264_8u_C1IR, (Ipp8u * pSrcDst, Ipp32s srcdstStep, Ipp8u * pAlpha, Ipp8u * pBeta, Ipp8u * pThresholds, Ipp8u * pBS))
IPPAPI (ippstatus, ippifilterdeblockingluma_horedge_h264_8u_c1ir, (IPP8U * Psrcdst, IPP32S Srcdststep, IPP8U * Palpha, IPP8U * Pbeta, IPP8U * Pthresholds, IPP8U * PBS))
IPPAPI (ippstatus, ippifilterdeblockingchroma_veredge_h264_8u_c1ir, (IPP8U * Psrcdst, IPP32S Srcdststep, IPP8U * Palpha, IPP8U * Pbeta, IPP8U * Pthresholds, IPP8U * PBS))