Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.

MPEG-4 Decoder Postprocessing

dario_marchese
Beginner
264 Views
Hi all,

I read in the readme.htm in the folder of the mpeg-4 decoder example that its support postprocessing filters (deblocking and deringing), but I haven't found any kind of documentation on using it.

Any idea?

Thanks
0 Kudos
1 Reply
Vladimir_Dudnik
Employee
264 Views

Hi,

These words were left by mistake from IPP MPEG4 decoder sample from IPP v4.0. There were many changes in API for MPEG4 between 4.0 and 5.0 versions. The reason for those changes was of course improvement, but as we see now, some functionality was lost, unfortunately. Actually, the difference between IPP v4.0 MPEG4 decodersample and IPP v5.0 MPEG4 decoder sample is that the latest version considered as a component which can and should be used in customer application while in IPP v4.0 it was more-less solid application. We still have in IPP optimized functions to do deblocking/deringing,so youcan add post-processing after MPEG4 decoder GetFrame. If you think this should be solved on codec interface level, please submit this functionality request to Intel Premier Support. You can refer to sample code for deblocking and deringing

Code:

// deblocking (inplace)
                QP = VisualObject.VideoObject.VideoObjectPlane.quant;
                THR1 = 2;
                THR2 = 6;
                {
                    // deblocking Y
                    for (i = 1; i < MacroBlockPerCol * 2; i ++) {
                        for (j = 0; j < MacroBlockPerRow * 2; j ++) {
                            ippiFilterDeblocking8x8HorEdge_MPEG4_8u_C1IR(pY+8*i*sY+8*j, sY, QP, THR1, THR2);
                        }
                    }
                    for (i = 0; i < MacroBlockPerCol * 2; i ++) {
                        for (j = 1; j < MacroBlockPerRow * 2; j ++) {
                            ippiFilterDeblocking8x8VerEdge_MPEG4_8u_C1IR(pY+8*i*sY+8*j, sY, QP, THR1, THR2);
                        }
                    }
                    // deblocking CbCr
                    for (i = 1; i < MacroBlockPerCol; i ++) {
                        for (j = 0; j < MacroBlockPerRow; j ++) {
                            ippiFilterDeblocking8x8HorEdge_MPEG4_8u_C1IR(pCb+8*i*sCb+8*j, sCb, QP, THR1, THR2);
                            ippiFilterDeblocking8x8HorEdge_MPEG4_8u_C1IR(pCr+8*i*sCr+8*j, sCr, QP, THR1, THR2);
                        }
                    }
                    for (i = 0; i < MacroBlockPerCol; i ++) {
                        for (j = 1; j < MacroBlockPerRow; j ++) {
                            ippiFilterDeblocking8x8VerEdge_MPEG4_8u_C1IR(pCb+8*i*sCb+8*j, sCb, QP, THR1, THR2);
                            ippiFilterDeblocking8x8VerEdge_MPEG4_8u_C1IR(pCr+8*i*sCr+8*j, sCr, QP, THR1, THR2);
                        }
                    }
                }

// deringing (not inplace)
                    int  threshold[6];
                    for (i = 0; i < MacroBlockPerCol; i ++) {
                        for (j = 0; j < MacroBlockPerRow; j ++) {
                            if (i == 0 || i == MacroBlockPerCol - 1 || j == 0 || j == MacroBlockPerRow - 1) {
                                // not applicable to boundary blocks
                                ippiCopy16x16_8u_C1R(pY+16*i*sY+16*j, sY, pdrY+16*i*sY+16*j, sY);
                                ippiCopy8x8_8u_C1R(pCb+8*i*sCb+8*j, sCb, pdrCb+8*i*sdrCb+8*j, sCb);
                                ippiCopy8x8_8u_C1R(pCr+8*i*sCr+8*j, sCr, pdrCr+8*i*sdrCr+8*j, sCr);
                            }
                            ippiFilterDeringingThreshold_MPEG4_8u_P3R(pY+16*i*sY+16*j, sY, pCb+8*i*sCb+8*j, s
Cb, pCr+8*i*sCr+8*j, sCr, threshold);
                            if (i != 0 && j != 0) {
                                ippiFilterDeringingSmooth8x8_MPEG4_8u_C1R(pY+16*i*sY+16*j, sY, pdrY+16*i*sdrY+16*j, sdrY, QP, threshold[0]);
                            }
                            if (i != 0 && j != MacroBlockPerRow-1) {
                                ippiFilterDeringingSmooth8x8_MPEG4_8u_C1R(pY+16*i*sY+16*j+8, sY, pdrY+16*i*sdrY+16*j+8, sdrY, QP, threshold[1]);
                            }
                            if (i != MacroBlockPerCol-1 && j != 0) {
                                ippiFilterDeringingSmooth8x8_MPEG4_8u_C1R(pY+16*i*sY+8*sY+16*j, sY, pdrY+16*i*sdrY+8*sdrY+16*j, sdrY, QP, threshold[2]);
                            }
                            if (i != MacroBlockPerCol-1 && j != MacroBlockPerRow-1) {
                                ippiFilterDeringingSmooth8x8_MPEG4_8u_C1R(pY+16*i*sY+8*sY+16*j+8, sY, pdrY+16*i*sdrY+8*sdrY+16*j+8, sdrY, QP, threshold[3]);
                            }
                            if (i != 0 && j != 0 && i != MacroBlockPerCol-1 && j != MacroBlockPerRow-1) {
                                ippiFilterDeringingSmooth8x8_MPEG4_8u_C1R(pCb+8*i*sCb+8*j, sCb, pdrCb+8*i*sdrCb+8*j, sdrCb, QP, threshold[4]);
                                ippiFilterDeringingSmooth8x8_MPEG4_8u_C1R(pCr+8*i*sCr+8*j, sCr, pdrCr+8*i*sdrCr+8*j, sdrCb, QP, threshold[5]);
                            }
                        }
                    }



Regards,
Vladimir

0 Kudos
Reply