]> git.sesse.net Git - nageru/commit
When uploading MJPEG data to VA-API, do it directly into the buffer.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 17 Mar 2019 21:53:36 +0000 (22:53 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 17 Mar 2019 21:53:36 +0000 (22:53 +0100)
commita839022c035b3d9387feabc02843c166ac78b469
treede4a7037e8de9d4d87d87680994b4c3db44d7fae
parentf08eaef2d7c9f6815f7010a221302daccb57fda1
When uploading MJPEG data to VA-API, do it directly into the buffer.

Besides the obvious of spending less time copying, this has two positive effects:

 - The VA-API thread is no longer a choke point; uploading can happen from
   multiple cores.
 - With one copy less, we seem to be reducing L3 cache pressure a bit;
   at some point between five and six 1080p sources, we “fall off a cliff”
   wrt. the L3 and start thrashing. This doesn't fix the issue, but alleviates
   it somewhat.

All in all, we seem to go down from ~2.6 to ~2.1–2.2 cores used with one
720p channel and five 1080p channels. I haven't tried saturating channels
yet to see how many we can actually encode.
nageru/bmusb
nageru/decklink_capture.cpp
nageru/mixer.cpp
nageru/mjpeg_encoder.cpp
nageru/mjpeg_encoder.h
nageru/pbo_frame_allocator.cpp
nageru/pbo_frame_allocator.h