Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocl: implement alpha blending #3

Open
wants to merge 23 commits into
base: ocl_blend
Choose a base branch
from

Conversation

dspmeng
Copy link

@dspmeng dspmeng commented Dec 16, 2015

  • import drm prime fd from VASurfaceID to create cl image
  • add opencl kernel for alpha blending
  • add profiling macro to blend example

There is hard code in vpp/Makefile.am for Beignet libcl.so include path, because Beignet doesn't provide pkg-config .pc file. Any suggestion?

@@ -57,7 +57,11 @@ libyami_vpp_cppflags = \
$(NULL)

if BUILD_OCL_BLENDER
libyami_vpp_ldflags += -lOpenCL
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is any possible to find a portable way, since it maybe not a x64 platform

@xuguangxin
Copy link
Owner

is it possible use this one instead hard code path.
https://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clGetExtensionFunctionAddress.html

ret = YAMI_FAIL;
goto err_cl;
}
clFlush(cmd_q);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we really need this?

@dspmeng dspmeng force-pushed the ocl_blend branch 4 times, most recently from 533759d to 103e5fe Compare January 6, 2016 01:31
@dspmeng
Copy link
Author

dspmeng commented Jan 6, 2016

Update according to review comments. Please review.

}
bufferInfo.mem_type = VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME;
if (VA_STATUS_SUCCESS != vaAcquireBufferHandle(m_display, clImage.image.buf, &bufferInfo)) {
ERROR("vaAcquireBufferHandle failed");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we failed here. the image will leaked.

@dspmeng
Copy link
Author

dspmeng commented Jan 11, 2016

Address review comments and rebase to latest ocl_blend.

@@ -56,6 +58,124 @@ YamiStatus OclPostProcessBase::ensureContext(const char* kernalName)
return YAMI_SUCCESS;
}

YamiStatus OclPostProcessBase::createCLImage(const SharedPtr<VideoFrame>& frame,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can return SharedPtr directly.

@xuguangxin
Copy link
Owner

ok to me, please send pull request to 01.org/libyami

xuguangxin and others added 20 commits January 12, 2016 16:41
we did not clear reflist0/1 for I frame, android driver will crash on this
else valgrind will complain use uninit value at L922
android's libva require this for csc
android's libva require use set the color standard.
Set sequence params to driver for every frame,
else driver may crash when encoding some small size videos.

Signed-off-by: Zhong Li <[email protected]>
Because only short term reference supported right now,
set all reference pictures to be short term.

Signed-off-by: Zhong Li <[email protected]>
This patch is to fix android encoding driver crash when encoding
1920x1080 videos.

Signed-off-by: Zhong Li <[email protected]>
1. Add multi-reference frames interface and test cases
2. Add multi-reference frames support for h264 and hevc.
   Because of current reoder mechanism, multi-reference is only used
   for forward reference. The max value of back referece frames is still
   one.

Signed-off-by: Zhong Li <[email protected]>
it make sure we can get width height after vppinputdecode configed
we do not need clean back ground for scaler, and it will make whole screen
black when we use NV12 as dest, RGBX have no this problem, because there
are some issue in opensource libva driver.
OclPostProcessBlender do not inhert from VaapiPostProcessBase
more over, not all sub class deriver from VaapiDecoderBase or VaapiEncoderBase
so make sure factory return IVideoXXX is better
libva's alpha blending have limited support,
it only supports src&dest have same size.
It's inconvenience for real word application.
We'd better enable opencl based vpp functions.
It also a step stone for other vpp operation.
such as rotation,flips...etc
it's just a bare-bone application to test all base class works.
it waiting for opencl kernels.
an alpha blending application to render random color blocks on a video.
 * import cl image from VASurfaceID in ocl vpp base class
 * add opencl kernel for alpha blending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants