vp9enc too slow on Nexus 5 (Arm)

165 views
Skip to first unread message

Anil

unread,
Oct 15, 2014, 4:42:40 PM10/15/14
to codec...@webmproject.org
Hi,

I am trying to encode a stream on my Nexus 5 using the vpxenc binary

I compiled the binary using the configuration below. 
Is this a good configuration for real time?

../libvpx/configure --target=armv7-android-gcc --sdk-path=/local/mnt/workspace/android/android-ndk-r9 --disable-webm-io --disable-vp8-decoder --disable-vp9-decoder --disable-runtime-cpu-detect --extra-cflags="-mfloat-abi=softfp -mfpu=neon"

I am running with the command line. Are there any special settings I need to use for real time?
adb shell /data/vp9/vpxenc /data/yuv/test_832x480_30.yuv --ivf -o /data/vp9/out.ivf --codec=vp9 --i420 -w 832 -h 480 --limit=150 -p 1 --end-usage=cq --cq-level=32

Currently I am getting 1 Frame in ~15minutes!!!
Also does the encoder using multi-thread encoding?

Thanks
Anil

Yaowu Xu

unread,
Oct 15, 2014, 5:04:54 PM10/15/14
to Codec Developers
./vpxenc --target-bitrate=1000 --codec=vp8 --profile=0
--kf-max-dist=90000 --static-thresh=0 --cpu-used=-5 --min-q=2
--max-q=56 --undershoot-pct=50 --overshoot-pct=50 --buf-sz=1000
--buf-initial-sz=500 --buf-optimal-sz=600 --max-intra-rate=300
--resize-allowed=0 --passes=1 --rt --lag-in-frames=0
--noise-sensitivity=0 --error-resilient=1 -o darkvp8_1000.webm
dark720.y4m

For testing VP9, use --codec=vp9

On Wed, Oct 15, 2014 at 1:42 PM, Anil <asunil....@gmail.com> wrote:
> Hi,
>
> I am trying to encode a stream on my Nexus 5 using the vpxenc binary
>
> I compiled the binary using the configuration below.
> Is this a good configuration for real time?
>
> ../libvpx/configure --target=armv7-android-gcc
> --sdk-path=/local/mnt/workspace/android/android-ndk-r9 --disable-webm-io
> --disable-vp8-decoder --disable-vp9-decoder --disable-runtime-cpu-detect
> --extra-cflags="-mfloat-abi=softfp -mfpu=neon"
>
> I am running with the command line. Are there any special settings I need to
> use for real time?
> adb shell /data/vp9/vpxenc /data/yuv/test_832x480_30.yuv --ivf -o
> /data/vp9/out.ivf --codec=vp9 --i420 -w 832 -h 480 --limit=150 -p 1
> --end-usage=cq --cq-level=32
>

For real time encoding, you can try add the following parameters to
your vpxenc command line:
--rt --cpu-used=-6

Here is what I have been using for testing real time encoding for
other platform:
vpxenc --codec=vp9 --profile=0 --kf-max-dist=90000 --static-thresh=0
--rt --cpu-used=-6 --min-q=2 --max-q=56 --undershoot-pct=50
--overshoot-pct=50 --buf-sz=1000 --buf-initial-sz=500
--buf-optimal-sz=600 --max-intra-rate=300 --resize-allowed=0
--passes=1 --lag-in-frames=0 --noise-sensitivity=0 --error-resilient=1


> Currently I am getting 1 Frame in ~15minutes!!!
> Also does the encoder using multi-thread encoding?
>
libvpx does not use multithread for VP9 encoding yet, but it is being worked on.


> Thanks
> Anil
>
> --
> You received this message because you are subscribed to the Google Groups
> "Codec Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to codec-devel...@webmproject.org.
> To post to this group, send email to codec...@webmproject.org.
> Visit this group at
> http://groups.google.com/a/webmproject.org/group/codec-devel/.
> For more options, visit
> https://groups.google.com/a/webmproject.org/d/optout.

Ralph Giles

unread,
Oct 15, 2014, 5:08:59 PM10/15/14
to codec...@webmproject.org
On 2014-10-15 1:42 PM, Anil wrote:

> ../libvpx/configure --target=armv7-android-gcc
> --sdk-path=/local/mnt/workspace/android/android-ndk-r9 --disable-webm-io
> --disable-vp8-decoder --disable-vp9-decoder --disable-runtime-cpu-detect
> --extra-cflags="-mfloat-abi=softfp -mfpu=neon"

Why do you need to disable runtime cpu detection? I would expect that to
hurt performance.

> Currently I am getting 1 Frame in ~15minutes!!!

vp9 encoding isn't fast, but that does seem excessive. Have you tried
the --cpu-used --rt and --deadline options?

-r

Johann Koenig

unread,
Oct 15, 2014, 5:22:00 PM10/15/14
to codec...@webmproject.org
On Wed, Oct 15, 2014 at 2:07 PM, Ralph Giles <gi...@thaumas.net> wrote:
>> ../libvpx/configure --target=armv7-android-gcc
>> --sdk-path=/local/mnt/workspace/android/android-ndk-r9 --disable-webm-io
>> --disable-vp8-decoder --disable-vp9-decoder --disable-runtime-cpu-detect
>> --extra-cflags="-mfloat-abi=softfp -mfpu=neon"
>
> Why do you need to disable runtime cpu detection? I would expect that to
> hurt performance.

Disabling RTCD for this target just means that it won't run on devices
without neon. It will help a little with binary size since it won't
keep around fallback versions of the code.

Frank Galligan

unread,
Oct 15, 2014, 5:38:34 PM10/15/14
to Codec Developers
With the command line from Yaowu, I would expect to see about 8fps for your material with TOT libvpx on the Nexus 5. You could speed it up a little by changing --cpu-used.

Anil

unread,
Oct 15, 2014, 7:00:33 PM10/15/14
to codec...@webmproject.org
Thanks for the quick reply!!!
The command line works great

vpxenc --codec=vp9 --profile=0 --kf-max-dist=90000 --static-thresh=0 
--rt --cpu-used=-6 --min-q=2 --max-q=56 --undershoot-pct=50 
--overshoot-pct=50 --buf-sz=1000 --buf-initial-sz=500 
--buf-optimal-sz=600 --max-intra-rate=300 --resize-allowed=0 
--passes=1 --lag-in-frames=0 --noise-sensitivity=0 --error-resilient=1 

I got ~36fps for a WVGA sequence. Will play around with this as a starting point.

Regards
Anil

Anil

unread,
Oct 15, 2014, 7:03:51 PM10/15/14
to codec...@webmproject.org, gi...@thaumas.net
I was facing some compile time issues without using RTCD.
I thought this might be mainly to detect mmx, sse, sse2 etc
On arm, I guess we just need to enable neon for speed up. 
I'll try again with the latest code version to see if that works with RTCD.

Thanks
Anil

Ralph Giles

unread,
Oct 15, 2014, 7:36:44 PM10/15/14
to codec...@webmproject.org
On 2014-10-15 2:21 PM, 'Johann Koenig' via Codec Developers wrote:

> Disabling RTCD for this target just means that it won't run on devices
> without neon. It will help a little with binary size since it won't
> keep around fallback versions of the code.

I see, it defaults to enable, not disable. Thanks for clarifying.

From build/make/Android.mk

# Configuring with --disable-runtime-cpu-detect will assume presence of
NEON.
# Configuring with --disable-runtime-cpu-detect --disable-neon \
# --disable-neon-asm
# will remove any NEON dependency.

-r

Frank Galligan

unread,
Oct 15, 2014, 7:42:50 PM10/15/14
to Codec Developers, Ralph Giles
36 fps. Nice, I'm guessing the material is on the easier side.

Reply all
Reply to author
Forward
0 new messages