[FFmpeg-devel] [PATCH v8] avcodec/v210dec: add support for frame and slice threading

Michael Niedermayer michael at niedermayer.cc
Mon Nov 25 10:55:22 EET 2019


On Mon, Nov 25, 2019 at 11:45:10AM +0800, lance.lmwang at gmail.com wrote:
> From: Limin Wang <lance.lmwang at gmail.com>
> 
> 1, Test server configure:
> [root at localhost ~]# cat /proc/cpuinfo  |grep "model name"
>  model name      : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
>  model name      : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
>  ...
> 
> [root at localhost ~]# free -h
>               total        used        free      shared  buff/cache   available
>               Mem:           102G        1.1G        100G         16M        657M        100G
>               Swap:          4.0G          0B        4.0G
> 
> 2, Test result:
> encode the v210 input data for testing:
> ./ffmpeg -y -i 4k_422.ts  -c:v v210 -vframes 10 test.avi
> 
> master:
> ./ffmpeg -y -threads 1 -stream_loop 1000 -i ./test.avi -benchmark -f null -
> frame=10010 fps= 60 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=13.7x
> video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
> bench: utime=101.869s stime=66.181s rtime=167.996s
> bench: maxrss=186552kB
> 
> patch applied:
> ./ffmpeg -y -threads 2 -thread_type slice -stream_loop 1000 -i ./test.avi -benchmark -f null -
> frame=10010 fps= 72 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=16.5x
> video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
> bench: utime=103.562s stime=74.858s rtime=139.599s
> bench: maxrss=188616kB
> 
> ./ffmpeg -y -threads 2 -thread_type frame -stream_loop 1000 -i ./test.avi -benchmark -f null -
> frame=10010 fps= 85 q=-0.0 Lsize=N/A time=00:38:26.30 bitrate=N/A speed=19.6x
> video:5240kB audio:432432kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
> bench: utime=114.310s stime=92.685s rtime=117.693s
> bench: maxrss=231896kB
> 
> Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
> ---
>  libavcodec/v210dec.c | 126 +++++++++++++++++++++++++++++++--------------------
>  libavcodec/v210dec.h |   1 +
>  2 files changed, 79 insertions(+), 48 deletions(-)

will apply

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191125/3be99080/attachment.sig>


More information about the ffmpeg-devel mailing list