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

MPEG-2 Decoding Sample Memory Usage

jere_jones1
Beginner
1,151 Views

Hi all,
I compiled the MPEG-2 Decoding sample using MSVS.NET 2003 and IPP 4.1 on a Pentium-4M machine.It is really fast at the beginning but it uses a lot of memory. On my 512M system, the decoder's memory usage steadily climbs until it reaches 420-430M.
I tracked the memory allocation to this macro:
Code:
#define BSWAP(x)    
    (Ipp32u)(((x) << 24) + (((x)&0xff00) << 8) + 
     (((x) >> 8)&0xff00) + ((x) >> 24))

Every 6th time that macro is called, the memory usage increases by 4k. Themacro is called via:

Code:
return BSWAP(*code);

I have isolated the macro from the return and the allocation follows the macro.

I don't understand why this allocates memory or how to fix it.

I appreciate any help.

Jere

0 Kudos
4 Replies
jere_jones1
Beginner
1,151 Views
For those that are curios, the problem was in the bitstream routines. Apparently they try to map the ENTIRE mpeg into memory at once.
Memory was being allocated as soon as the byte was needed (i.e. read).
A rewrite of those routines fixed it.
Jere
0 Kudos
Vladimir_Dudnik
Employee
1,151 Views
Hi Jere,
we are trying to keep sample code as simple as possible, it was the reason for using such approach. If you feel it is not appropriate you can submit this issue to premier.intel.com
Regards,
Vladimir
0 Kudos
jere_jones1
Beginner
1,151 Views
It is an appropriate example of mpeg-2 decoding routines. It is not an appropriate example of a bitstream. But that's ok. It's not advertised as a bitstream example.
I learned quite a bit fromthe sample(much more than I expected) and appreciate it.
BTW, thanks for all your effort responding to all the questions!
Jere
0 Kudos
Vladimir_Dudnik
Employee
1,151 Views
Hi Jere,
yes, you are right, this particular sample can be better. Actually we are trying to keep continuously improve our samples, so I hope in the next versions it will became more clean.
Thanks you for your interest to IPP.
Regards,
Vladimir
0 Kudos
Reply