Extremely high CPU usage on VP9.

1,005 views
Skip to first unread message

josh....@frozenmountain.com

unread,
Aug 10, 2016, 5:44:52 PM8/10/16
to WebM Discussion
Hey all,

I'm working on a RTC application and I'm attempting to implement VP9 in addition to our existing VP8 implementation.

I've rebuild libvpx with VP9 support  and changed the encoder and decoder to use vpx_codec_vp9_cx and vpx_codec_vp9_dx respectively.

However, using the same parameters as VP8, VP9 takes nearly a second to encode a single frame and has a extremely high CPU utilization (above 90%).

I've profiled the application and traced the CPU utilization to rd_pick_partition but I am unsure how to proceed.

I imagine one of the existing parameters from VP8 might be causing it but they look sane to me.

Below are the config values used. What am I doing wrong?

config->g_timebase.num = 1;

config->g_timebase.den = 30;

config->rc_target_bitrate = 256;

config->rc_end_usage = VPX_CBR;

config->g_w = 640;

config->g_h = 480;

config->kf_mode = VPX_KF_AUTO;

config->kf_min_dist = context->config->kf_max_dist = context->config->g_timebase.den * 60; // 1 per min @ 30fps

config->g_error_resilient = 1;

config->g_lag_in_frames = 0;

config->g_pass = VPX_RC_ONE_PASS;

config->rc_min_quantizer = 0;

config->rc_max_quantizer = 47;

config->g_profile = 0;



Thanks in advance.














James Zern

unread,
Aug 11, 2016, 3:06:56 AM8/11/16
to WebM Discussion
Hi,

On Wed, Aug 10, 2016 at 2:44 PM, <josh....@frozenmountain.com> wrote:
Hey all,

I'm working on a RTC application and I'm attempting to implement VP9 in addition to our existing VP8 implementation.

I've rebuild libvpx with VP9 support  and changed the encoder and decoder to use vpx_codec_vp9_cx and vpx_codec_vp9_dx respectively.

However, using the same parameters as VP8, VP9 takes nearly a second to encode a single frame and has a extremely high CPU utilization (above 90%).

I've profiled the application and traced the CPU utilization to rd_pick_partition but I am unsure how to proceed.

I imagine one of the existing parameters from VP8 might be causing it but they look sane to me.

Below are the config values used. What am I doing wrong?

The first thing to try would be to set VP8E_SET_CPUUSED to something between 5-8 (lower will improve quality at the cost of speed) and make sure you're setting VPX_DL_REALTIME when calling vpx_codec_encode().
 

config->g_timebase.num = 1;

config->g_timebase.den = 30;

config->rc_target_bitrate = 256;

config->rc_end_usage = VPX_CBR;

config->g_w = 640;

config->g_h = 480;

config->kf_mode = VPX_KF_AUTO;

config->kf_min_dist = context->config->kf_max_dist = context->config->g_timebase.den * 60; // 1 per min @ 30fps

config->g_error_resilient = 1;

config->g_lag_in_frames = 0;

config->g_pass = VPX_RC_ONE_PASS;

config->rc_min_quantizer = 0;

config->rc_max_quantizer = 47;

config->g_profile = 0;



Thanks in advance.














--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss+unsubscribe@webmproject.org.
To post to this group, send email to webm-d...@webmproject.org.
Visit this group at https://groups.google.com/a/webmproject.org/group/webm-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.

josh....@frozenmountain.com

unread,
Aug 12, 2016, 1:57:02 PM8/12/16
to WebM Discussion
We were already using 'VPX_DL_REALTIME' but it looks like 'VP8E_SET_CPUUSED' did the trick. CPU is still very high but at least its real time now.

Cheers,


Josh
Hi,

To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.

naveen...@gmail.com

unread,
Nov 30, 2016, 9:06:39 AM11/30/16
to WebM Discussion, josh....@frozenmountain.com
Same problem i'm getting.
Im using...
rc_target_bitrate = 1000
VPX_DL_REALTIME for vpx_codec_encode
and --cpu-used = 8
cpu usage is <40%

Help me to solve this problem.
Thanks in advance

James Zern

unread,
Dec 2, 2016, 3:38:41 PM12/2/16
to WebM Discussion, josh....@frozenmountain.com
Hi,

On Wed, Nov 30, 2016 at 6:06 AM, <naveen...@gmail.com> wrote:
Same problem i'm getting.
Im using...
rc_target_bitrate = 1000
VPX_DL_REALTIME for vpx_codec_encode
and --cpu-used = 8
cpu usage is <40%


VP8 and VP9 support threads which should speed things up and increase the utilization, try setting --threads/g_thread to 2 or 4 depending on your hardware.
 

--
You received this message because you are subscribed to the Google Groups "WebM Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss+unsubscribe@webmproject.org.

naveen...@gmail.com

unread,
Dec 7, 2016, 1:13:34 AM12/7/16
to WebM Discussion, josh....@frozenmountain.com
Thanks for ur reply.....


I'm already using g_thread = 4. But the cpu utilization does not decreases.

I'm having one more doubt....

When we use rc_target_bitrate=2000 and  running through vp9 hardware, android crashes.
For the value rc_target_bitrate=256, it does not crashes and it gives low quality.

Is there any way to get high quality and without android crash??


thanks
Hi,

To unsubscribe from this group and stop receiving emails from it, send an email to webm-discuss...@webmproject.org.
Reply all
Reply to author
Forward
0 new messages