Is it possible to implement a video codec using GLSL shaders?

Is it possible to implement a video codec using GLSL shaders, and if practical, would it be more efficient than a cpu codec?

+3


source to share


2 answers


Since GPUs are parallel processors, codecs must be designed to use a pipeline. Codecs are either encoders or decoders, shaders are vertices or fragments.

The pipeline architecture (stack diagram) will look like this:

GPU CODEC pipeline architecture

The design should make it as easy as possible to work in vertex shaders for effective parallelism. The quadtree algorithm can be a good choice for fragment extraction.



The implementation will depend on the goals of the GPU. Chronos Vulkan (GL5 +) chips are particularly well suited to this problem, allowing multi-threaded pipelines.

A high-end GPU implementation of a codec can easily outperform some hardware codecs and of course blow the door against any similar CPU codecs (software codecs).

Dedicated hardware will always win in the long run. Any good GPU codec can serve as a model for a much faster hardware codec, just as a good software codec can become a faster GPU codec.

GPU codecs in the wild

+3


source


Well, all touring complete systems are capable of doing the same things, the only difference is speed and efficiency. So if you read this question as "are GLSL dumbbells completed?" the answer can be found here:

GPU Graphics Shaders Completed



TL; DR; Shader Model 3.0 Yes Others Possible (but probably not)

As for the more efficient one, perhaps not. Other GPGPU / CUDA / SIMDs are likely to perform better.

0


source







All Articles