The advantage of binding between Surface and Context.
by Hirokazu Honda
Hi,
According to libva document
(http://01org.github.io/libva_staging_doxygen/group__api__core.html#ga4af3...),
Surfaces are bound to a context if passing them as an argument when
creating the context.
Seeing intel-vaapi-driver code, the surfaces are just stored in
object_context.render_targets.
A surface processed by
vaBeginPicture()-vaRenderPicture()-vaEndPicture() are specified in
vaBeginPicture(). (object_context.current_render_target)
It looks like a surface can be processed using a context by being
specified in vaBeginPicture(), even if it is not bound to the context.
Here, my questions are below.
What is the advantage of binding?
In what circumstances do we need to associate the context with surfaces?
In which scenarios passing surfaces to vaCreateContext is required,
and in which it is not?
Best Regards,
Hirokazu Honda
3 years
VP8 hardware accelaration using i965 intel driver via Chromium WebRTC
by tsoumplekas_giorgos
Dear all,
We are working on a Beebox board that runs a Debian 9 OS. We try to encode
a VP8 stream in Chromium during a webrtc video call.
But the quality is not as good as the stream that is created by software
encoder.
Specifically for a SD video stream and bit rate at 300 Kbs and frame rate
at 30 fps ,you can see waves in a frame. The problem is increased when the
motion between frames is increazed.
We increase the bitrate at 2Mbs , it seems that the quality has a rapidly
improvment. Problem appears again when the motion is high in the video
frame. Increasing the bitrate at 4Mbs the image is perfect but there is a
little lag when the motion is high.
We have tried different combination of settings but we cannot find a
perfect one.
Could you please give us a set of ideal of settings or some advice to have
real time encoding like software encoding?
Find below our settings
What is wrong or not optimal?
//Sequence Parameters
VAEncSequenceParameterBufferVP8 seq_param; memset(&seq_param, 0,
sizeof(seq_param)); seq_param.frame_width = 640 seq_param.frame_height =
480 seq_param.frame_width_scale = 1; seq_param.frame_height_scale = 1;
seq_param.intra_period = 256; seq_param.bits_per_second = 2Mb;
seq_param.error_resilient = 0; seq_param.kf_auto = 0; seq_param.kf_min_dist
= 0; seq_param.kf_max_dist = seq_param.intra_period; //in reference frame
save the 4 latest decoded frames seq_param.reference_frames[i] =
(*iter)->id();
//Picture Parameters
VAEncPictureParameterBufferVP8 pic_param;
//Intra frame
pic_param.pic_flags.bits.refresh_entropy_probs = 0;
pic_param.pic_flags.bits.frame_type = 0; pic_param.ref_flags.bits.force_kf
= 1; pic_param.pic_flags.bits.refresh_last = 1;
pic_param.pic_flags.bits.refresh_golden_frame = 1;
pic_param.pic_flags.bits.refresh_alternate_frame = 1;
pic_param.pic_flags.bits.copy_buffer_to_alternate = 0;
pic_param.pic_flags.bits.copy_buffer_to_golden = 0;
pic_param.ref_last_frame = pic_param.ref_gf_frame = pic_param.ref_arf_frame
= VA_INVALID_SURFACE; //P frame pic_param.pic_flags.bits.frame_type = 1;
pic_param.ref_flags.bits.force_kf = 0;
pic_param.pic_flags.bits.refresh_last = 1;
pic_param.pic_flags.bits.refresh_golden_frame = 0;
pic_param.pic_flags.bits.refresh_alternate_frame = 0;
pic_param.pic_flags.bits.copy_buffer_to_alternate = 2;
pic_param.pic_flags.bits.copy_buffer_to_golden = 1;
pic_param.ref_last_frame = pic_param.ref_gf_frame = pic_param.ref_arf_frame
= //Latest decoded frame //Common setting
pic_param.pic_flags.bits.show_frame = 1; pic_param.clamp_qindex_low = 0;
pic_param.clamp_qindex_high = 127; pic_param.pic_flags.bits.version = 1;
pic_param.pic_flags.bits.loop_filter_type = 1; pic_param.sharpness_level =
0; for (int i = 0; i < 4; i++) { pic_param.loop_filter_level[i] = 16; }
//quantization parameters
For I frame
quant.quantization_index[i] = 4;
For B frame
quant.quantization_index[i] = 26;
Misc Parameters
rate_control_param.bits_per_second = 2Mbs;
rate_control_param.target_percentage = 90;
rate_control_param.window_size = 1500;
rate_control_param.initial_qp = 26;
rate_control_param.rc_flags.bits.disable_frame_skip = true;
framerate_param.framerate = 30;
hrd_param.buffer_size = cpb_size_ = bitrate_ * kCPBWindowSizeMs / 1000;
hrd_param.initial_buffer_fullness = cpb_size_ / 2;
Georgios (George) Tsoumplekas
Software Engineer @ Unify S.A
M.Sc. Degree in Computer Systems Technology, Kapodistrian University of
Athens
5-year Diploma in Computer Engineering, University of Thessaly
email: getsoubl(a)gmail.com
4 years, 9 months