diff options
author | Ivan Uskov <ivan.uskov@nablet.com> | 2015-07-28 18:30:56 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-28 20:37:38 +0200 |
commit | 947c2aa4567782be64411a953a5b294976463e19 (patch) | |
tree | ff97d553d407c5ba0d469f90710a6b641d8d0dfc | |
parent | fee7c42bf45f72d457fafaee536f054ce59e4ec5 (diff) | |
download | ffmpeg-947c2aa4567782be64411a953a5b294976463e19.tar.gz |
libavcodec/qsvenc.c delay in 1 microsecond replaced to more appropriate 500 microseconds
This commit replaces the 1 microsecond delay by 500 microsecond for the
case when the MFX library does return MFX_WRN_DEVICE_BUSY status.
In general this warning never appears for simple encoding or
transcoding session because the GPU is so fast so it almost always is not busy and
any delay value just does not executes.
But for heavy transcoding tasks for example, when several QSV sessions
are running simultaneously then using a 1-microsecond delay may
result in 1000 iterations per each frame.
So here possible a paradoxical case when GPU loading also loads CPU by dummy tasks.
Official MFX/QSV samples by Intel are using 1 millisecond (i.e. 1000
microseconds) everywhere where MFX_WRN_DEVICE_BUSY does appear.
So 500us is a much more optimal value than 1us.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/qsvenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c index c9dbe7ddb5..57f5fe4199 100644 --- a/libavcodec/qsvenc.c +++ b/libavcodec/qsvenc.c @@ -419,7 +419,7 @@ int ff_qsv_encode(AVCodecContext *avctx, QSVEncContext *q, do { ret = MFXVideoENCODE_EncodeFrameAsync(q->session, NULL, surf, bs, &sync); if (ret == MFX_WRN_DEVICE_BUSY) { - av_usleep(1); + av_usleep(500); continue; } break; |