Coder Social home page Coder Social logo

hdrsample's Introduction

HDRSample

这个库用MediaCode和OpenGL实现了HDR和SDR转换,如果你觉得有所收获,给这个库点个赞吧,你的鼓励是我前进最大的动力。 image

现有功能实现如下,供大家一起学习一起上进

  1. 输出模式(直接输出到Surface、经过OpenGL中转)
  2. 视图模式(无缝切换SurfaceView和TextureView)
  3. 多种纹理来源配置(Auto、YUV420Buffer、外部纹理OES、Y2Y)、纹理位深配置(8位、10位、16位)
  4. HDR转SDR CubeLut配置,PQ转SDR12种、HLG转SDR4种
  5. HDR转SDR Shader配置,该Shader支持对PQ视频和HLG视频进行色度矫正、色调参考、色调映射、色域转换、Gamma压缩
  6. 色调映射已支持Android8的Tonemap、Android13的Tonemap、BT2446A、BT2446C、Hable
  7. 色域转换已支持BT2020转BT709Clip、Compress、adpative_l0_cusp
  8. 10个测试视频无缝切换

待开发功能

  • SDR转HDR逆色调映射
  • 对接Exoplayer
  • 识别HDR10+的动态元信息

效果预览

安装包地址

HDR转SDR

关键代码

代码已经都加上注释了,如果有疑惑,欢迎加入HDR视频开发讨论群

  1. Shader目录下实现了色度矫正、色调参考、色调映射、色域转换、Gamma压缩
  2. YUV420FragmentShaderGLYUV420Renderer 纯Shader实现四种YUV420的Buffer转换成纹理
  3. Java代码读取CubeLut文件,从3s左右优化成70ms
  4. 直接使用3D纹理加载CubeLut数据
  5. 2D纹理、OES纹理、Y2Y纹理渲染
  6. 判断MediaCodec是否支持10位解码
  7. 不同位深的纹理创建
  8. GLVideoOutputImpl
  9. MediaCodec异步解码
  10. OpenGL运行环境封装

实践总结

hdrsample's People

Contributors

jonanorman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.