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

ipp6.0 h264 encoder code review

sarading32
Beginner
725 Views
Hello,

Being a junior programmer, I have to dig into this most complicated codec...

2 programming questions at this point:

1. what does this mean:
#define H264ENC_UNREFERENCED_PARAMETER(X) X

2. Why every time I run the code, for function calls it automatically goes into PIXBITS==8, rather than 16, is it because the following header is onlycalled once?then how can I step into the 16 case?

#define PIXBITS 8
#include "umc_base_bitstream_tmpl.h"
#undef PIXBITS

#if defined (BITDEPTH_9_12)

#define PIXBITS 16
#include "umc_base_bitstream_tmpl.h"
#undef PIXBITS

#endif // BITDEPTH_9_12

Thanks for any help and hint!

Best
R
0 Kudos
2 Replies
transcoding
Beginner
725 Views
Hello,

I have the same problem like you. I want to review the h.264 code but its very complicated.

I tried to use Doxygen to generate some helpful HTML meta-data, but unfortunately, the IPP comments dont follow the Doxygen recommendation. Please, my question is what steps youre following to understand the code?

Thanks.
0 Kudos
Martin_B_4
Beginner
725 Views
1. This only serves to remove a common compiler warning such as "parameter foo is not referenced".
An exemple would be void function(int foo) { }, which could also be fixed by void function(int /*foo*/) { }

2. The H.264 encoder is implemented using C++ templates. The algorithms are implemented on a type, T, which is defined later. T could be 'unsigned char' or 'unsigned short', in the same way that you have std::vector or std::vector. Instead of implementing both function(char) and function(short), you implement template function(T), and then the proper version is called depending on the argument. For the H.264 encoder, this allows support for 8-bit images and 16-bit images without copy-pasting common code. With templates, code is lazilly compiled only if it's used, so you won't end up with function(int) if you don't need a 32-bit version. umc_base_bitstream_tmpl.h is included twice to tell it to force compilaton of both 8-bit and 16-bit versions (template instantiation).
0 Kudos
Reply