Community
cancel
Showing results for 
Search instead for 
Did you mean: 
vardar
Beginner
24 Views

H264 Encoder Thread Usage

Hello all,
I'm encoding streams into H264 with H264Enc and when I encode 3 streamseach in one thread CPU usage is around 5% (I am using i7 machine)
But when I encode 9 streams CPU usage is around 85%.
Sure I don't expect linear increase, it would beexponential because of increased number of threads,more context switches etc. But isn't this an insane increase?
I'm not using OPENMP and I set H264EncoderParams.numThreadsto 1. Also number of slicesin par file is set to 1.
It seems that each encoder uses 3 threads. I'm not sure if it is correct way to check but I am looking total thread numbers, for 9 streams 39 , 8 streams 36, 7 streams 33. Which seems that each encoder using 3 threads.What I'm doing is just start a new thread for each stream which has encoding loop and nothing else at all. Shouldn't each stream use just 1 thread? What can be these extra 2 threads for each encoder?
I also tried to set ippSetNumThreads(1); And since I am using static linking,it returnedippStsNoOperation (For static library internal threading is not supported)
Any help will be appreciated
Many thanks
-victor
0 Kudos
3 Replies
Chao_Y_Intel
Employee
24 Views

Hello victor,

>>I'm not using OPENMP and I set H264EncoderParams.numThreads to 1. Also number of slices in par file is set to 1.

Could you have a check on the following post? This post discussed OpenMP threading performance and the steps to disable the OpenMP threading:
http://software.intel.com/en-us/forums/showthread.php?t=75300

To disable the OMP threaded in the Codec, you can check at the \audio-video-codecs\Makefile file, and remove the following:

ifeq ("$(OPENMP_SUPPORT)","")

CFLAGS += -openmp

else

ifeq ($(OPENMP_SUPPORT),YES)

CFLAGS += -fopenmp

endif

No additional threadings are expected to be created if OpenMP runtime library is not linked with your application.

Thanks,
Chao

vardar
Beginner
24 Views

Hi dear Chao,
many thanks for your endless support.
Unfortunately I couldn't find mentioned text in makefile.
I'm using windows samples on win32 platform and I'm copying openmp related text in my makefile file.

!IF "$(COMP)" == "icl101" || "$(COMP)" == "icl110"
CFLAGS = $(CFLAGS) /Qopenmp /Qopenmp-lib:compat
ICL_OMPLIB_LINK = libiomp5md.lib
!ENDIF
!ENDIF
!IF "$(CC)" == "cl.exe" && "$(ARCH)" == "win32"
CFLAGS = $(CFLAGS) /openmp
!ENDIF
!IF "$(COMP)" == "icl101" || "$(COMP)" == "icl110"CFLAGS = $(CFLAGS) /Qopenmp /Qopenmp-lib:compatICL_OMPLIB_LINK = libiomp5md.lib!ENDIF!ENDIF
!IF "$(CC)" == "cl.exe" && "$(ARCH)" == "win32"CFLAGS = $(CFLAGS) /openmp
!ENDIF
Shoudl I simply remove all of them?
Chao_Y_Intel
Employee
24 Views

Hello,

The OpenMP compiling flag I suggested came from the old version of makefile. In the new version of IPP sample code, it is to remove the code you suggest.

Thank you!
Chao