• Miguel Casas's avatar
    media/gpu/vaapi: manage VP9 VABufferIDs lifetime in the decoder · d12004dc
    Miguel Casas authored
    Decoding a bitstream in VA has two steps: one, submitting the parsed
    parameters and encoded chunk as VABufferIDs, and two, executing the
    decode. This CL transfers managing the lifetime of the VABufferIDs to
    VP9VaapiVideoDecoderDelegate, avoiding vaCreateBuffer() calls.
    
    To do that this CL reshuffles a bit the VaapiWrapper calls to be able
    to call vaCreateBuffer(), MapAndCopy and Execute, in a piecemeal,
    configurable fashion.
    
    This is verified via chrome:tracing and codepen.io/full/RwarYvG that
    plays 4 1280x572 VP9 videos at the same time. Tracing is captured for
    a few seconds, and basically we avoid calling the vaCreateBuffer(),
    which takes ~50us every time, reducing the overall decode time from
    ~3.740ms to ~3.425ms on my BSW (reks), ~10% reduction. (Also tried on
    kohaku and numbers are similar albeit smaller bc the SoC is faster).
    Improvements are of course extremely small, the advantages of this CL
    are in reducing lock/unlock churn and associated contention. This
    benefit grows with the amount of decodes (e.g. Meet grid scenarios).
    
    This CL also removes the unused VaapiWrapper::Execute() method.
    
    Bug: b/166646505
    Change-Id: Id44dbb21825328dfb4fc47e1c7807bd725efd196
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2404740
    Commit-Queue: Miguel Casas <mcasas@chromium.org>
    Reviewed-by: default avatarAndres Calderon Jaramillo <andrescj@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#808040}
    d12004dc
vp9_vaapi_video_decoder_delegate.cc 7.96 KB