Increased fps during conversion

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
Post Reply
johnallen
Regular User
Posts: 95
Joined: Sat Sep 30, 2006 8:52 pm

Increased fps during conversion

Post by johnallen »

I was reading another post here where someone said they were running HB on a fairly fast Mac and complaining that HB was only using 75% of the available CPU usage. I never saw this issue because I have a iBook G3, a MacMini G3, and a MacMini Intel Core Solo. (I'll probably get a faster one at some point).

Anyway I started looking into how libhb actually works. I'm sure that many of you know that it uses an arrary of work objects and fifos. Each work object is launched on it's own thread and goes off to do its work. (The whole thing is somewhat similar to how DirectShow works)

Each of these threads has a while loop which calls the work objects "work" method. It also checks to see if its output fifo is full. If it's full, it sleep for 50ms. This seems like a short interval, but on a faster Mac it may be too long. Hence the 75% usage issue.

On a slower Mac, like mine, 50ms is not long enough. Each of the work objects takes a different amount of time to perform its work method. Therefore, some of the work objects will needlessly spin around checking its output fifo and sleeping 50ms, when it should be sleeping longer.

So, having some experience on managing and throttling several threads, I took a wack at it. The result, my Core Solo Mini went from 9 fps for a x264 encode to 15-18. I also tried this on my other 2 Macs with noticeable improvement as well.

With that said, I have commited rev 98 with these enhancements. I would certainly be interested in hearing if someone with a faster Mac got improved results as well.
Aaron
Posts: 7
Joined: Thu Jan 04, 2007 5:12 am

Post by Aaron »

no noticeable x264 improvement in FPS on my macbook coreduo 2.0 with revision 98 vs revision 92
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Post by jbrjake »

I saw a speed boost with my 2x2.3ghz g5.

ffmpeg + 8.68 fps
r96: avg 65.49 fps
r98: avg 73.17 fps

xvid + 0.78 fps
r96: avg 36.75 fps
r98: avg 37.53 fps

x264 + 1.27 fps
r96: avg 26.74 fps
r98: avg 28.01 fps
dynaflash
Veteran User
Posts: 3820
Joined: Thu Nov 02, 2006 8:19 pm

Post by dynaflash »

Nice 1.5 -2 fps boost on a 1ghz g4 pb using x264 baseline level 3 ! Sweet!
prigaux
Regular User
Posts: 94
Joined: Mon Jan 01, 2007 3:25 pm

Post by prigaux »

Well it seems to be great on ffmpeg :)

On my Mac Pro 2x2.66

ffmpeg + 26.64 fps
r98: avg 125.51 fps
r96: avg 98.60 fps

xVid - 0.27 fps
r98: avg 74.46 fps
r96: avg 74.73 fps

x264 + 0.02 fps
r98: avg 43.70 fps
r96: avg 43.68 fps

Nice job on ffmpeg :)

Philippe
johnallen
Regular User
Posts: 95
Joined: Sat Sep 30, 2006 8:52 pm

Post by johnallen »

prigaux,

I figured you guys with the faster Macs would see the most improvement. Unfortunately, for the rest of us, our Macs are already working as hard as they can.
Aaron
Posts: 7
Joined: Thu Jan 04, 2007 5:12 am

Post by Aaron »

it looks like those of us with the faster macs didn't see as large as an improvement as your core solo machine with x264. ffmpeg improvements look nice
Last edited by Aaron on Tue Jan 09, 2007 1:55 am, edited 1 time in total.
johnallen
Regular User
Posts: 95
Joined: Sat Sep 30, 2006 8:52 pm

Post by johnallen »

According to all the previous posts, I believe they did see improvements.
Aaron
Posts: 7
Joined: Thu Jan 04, 2007 5:12 am

Post by Aaron »

revision 101 seems to really have problems with FPS with x264. Revision 98 was hitting 27 FPS average and 101 has trouble getting about 9 or 10 FPS. Anyone else seeing this?
Post Reply