OSDN Git Service

Reduce the amount of buffering used and eliminate hb_snooze in the encoding pipeline
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 5 Dec 2009 17:15:57 +0000 (17:15 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Sat, 5 Dec 2009 17:15:57 +0000 (17:15 +0000)
commita7f8bd6842d316d2a19cf63355b1d343a244b42d
tree8831fdf29ffffe86c30fc008e20d848254a37046
parent3b239886a131be2cf368b8288c474295a141b0b3
Reduce the amount of buffering used and eliminate hb_snooze in the encoding pipeline

For HD sources on an 8 core system with hyperthreading, we were using 1.5GB
of ram.  Add to that the 600MB x264 uses for rc-lookahead, pushes it north of 2GB.

To reduce our memory usage, the fifo depths have been reduced are are no longer
a multiple of cpu count.  Use of hb_snooze has been eliminated in the encoding
pipeline so that performance doesn't fall as a result of the reduced fifo depths.

In sync, each audio and video were given separate threads so that each can wait on
it's respective input fifo without blocking the others.  In muxcommon, each stream
being muxed was given a separate thread so that each can wait on it's respective fifo.
This allows the removal of hb_snooze in the sync and muxer work loops. In both sync
and muxer, there is common data that is shared by all threads, so special init
routines allocate this shared data and initialize the threads.

git-svn-id: svn://localhost/HandBrake/trunk@3007 b64f7644-9d1e-0410-96f1-a4d463321fa5
libhb/common.h
libhb/fifo.c
libhb/hb.c
libhb/internal.h
libhb/muxcommon.c
libhb/ports.c
libhb/ports.h
libhb/reader.c
libhb/render.c
libhb/sync.c
libhb/work.c