An Optimization Scheme for Demosaicing Algorithm on GPU Using OpenCL

  • Tongli Wang
  • Wei Guo
  • Jizeng WeiEmail author
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 994)


With the popularity of GPU which has the high performance computing feature, more and more algorithms have been successfully transplanted to the GPU platform and achieved high efficiency. But existing videos or images processing methods, such as demosaicing algorithm, have not fully exploited the parallel computing capacity of heterogeneous processing platform and the video frame rates can’t meet real-time requirements. In order to take full advantage of the computing power of GPU under the heterogeneous processing platform, an optimization scheme is proposed in this paper. We use the demosiacing algorithm as a case and modify the algorithm. By exploiting the GPU’s memory hierarchy, the optimization scheme improves the parallelism of the algorithm while reducing the memory access latency, and greatly reduces the execution time. Then we achieve the zero-copy at the same time. The experimental results show that optimization version has a significant performance improvement, the optimized OpenCL version is up to 6x comparing with the basic OpenCL version about kernel execution.


Parallel processing Image demosaicing Heterogeneous platform OpenCL 



The work is supported by the Science and Technology Key Project of Tianjin under Grant No. 17YFZCGX01180 and Tianjin Key Laboratory of Advanced Networking (TANK).


  1. 1.
    Wang, J., Wu, J., Wu, Z., Jeon, G.: Filter-based bayer pattern CFA demosaicking. Circ. Syst. Sig. Process. 36(7), 2917–2940 (2017)CrossRefGoogle Scholar
  2. 2.
    Chen, R., Jia, H., Wen, X., Xie, X.: Bayer demosaicking using optimised mean curvature over RGB channels. Electr. Lett. 53(17), 1190–1192 (2017)CrossRefGoogle Scholar
  3. 3.
    Lien, C.Y., Yang, F.J., Chen, P.Y.: An efficient edge-based technique for colour filter array demosaicking. IEEE Sens. J. PP(99), 1 (2017)Google Scholar
  4. 4.
    Andrade, D.C.D., Trabasso, L.G.: An opencl framework for high performance extraction of image features. J. Parallel Distrib. Comput. 109, 75–88 (2017)CrossRefGoogle Scholar
  5. 5.
    Tan, H., He, X., Wang, Z., Liu, G.: Parallel implementation and optimization of high definition video real-time dehazing. Multimedia Tools Appl. 76, 1–22 (2016)Google Scholar
  6. 6.
    Wang, D., Yu, G., Zhou, X., Wang, C.: Image demosaicking for Bayer-patterned CFA images using improved linear interpolation. In: Seventh International Conference on Information Science and Technology, pp. 464–469 (2017)Google Scholar
  7. 7.
    McGuire, M.: Efficient, high-quality bayer demosaic filtering on GPUs. J. Graph. GPU Game Tools 13(4), 1–16 (2008)MathSciNetCrossRefGoogle Scholar
  8. 8.
    Malvar, H.S., He, L.W., Cutler, R.: High-quality linear interpolation for demosaicing of Bayer-patterned color images. In: IEEE International Conference on Acoustics, Speech, and Signal Processing, vol. 3, pp. iii–485–8 (2004)Google Scholar
  9. 9.
    Al-Hashimi, B.M.: Energy-efficient run-time mapping and thread partitioning of concurrent openCL applications on CPU-GPU MPSoCs. ACM Trans. Embed. Comput. Syst. 16(5s), 147 (2017)Google Scholar
  10. 10.
    Dashti, M., Fedorova, A.: Analyzing memory management methods on integrated CPU-GPU systems. ACM SIGPLAN Notices 52(9), 59–69 (2017)CrossRefGoogle Scholar
  11. 11.
    Jang, B., Schaa, D., Mistry, P., Kaeli, D.: Exploiting memory access patterns to improve memory performance in data-parallel architectures. IEEE Trans. Parallel Distrib. Syst. 22(1), 105–118 (2011)CrossRefGoogle Scholar
  12. 12.
    Holewinski, J., Sadayappan, P.: High-performance code generation for stencil computations on GPU architectures. In: ACM International Conference on Supercomputing, pp. 311–320 (2012)Google Scholar
  13. 13.
    Pereira, P.M.M., Domingues, P., Rodrigues, N.M.M., Falcao, G., Faria, S.M.M.D.: Optimizing GPU Code for CPU Execution Using OpenCL and Vectorization: A Case Study on Image Coding. Springer (2016)Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2019

Authors and Affiliations

  1. 1.School of Computer Science and TechnologyTianjin UniversityTianjinChina

Personalised recommendations