basis_universal | Basis Universal GPU Texture Codec | Compression library

 by   BinomialLLC C++ Version: 1.16.4 License: Apache-2.0

kandi X-RAY | basis_universal Summary

kandi X-RAY | basis_universal Summary

basis_universal is a C++ library typically used in Utilities, Compression applications. basis_universal has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

Probably the most important concept to understand about Basis Universal before using it: The system supports two very different universal texture modes: The original "ETC1S" mode is low/medium quality, but the resulting file sizes are very small because the system has built-in compression for ETC1S texture format files. This is the command line encoding tool's default mode. ETC1S textures work best on images, photos, map data, or albedo/specular/etc. textures, but don't work as well on normal maps. There's the second "UASTC" mode, which is significantly higher quality (comparable to BC7 and highest quality LDR ASTC 4x4), and is usable on all texture types including complex normal maps. UASTC mode purposely does not have built-in file compression like ETC1S mode does, so the resulting files are quite large (8-bits/texel - same as BC7) compared to ETC1S mode. The UASTC encoder has an optional Rate Distortion Optimization (RDO) encoding mode (implemented as a post-process over the encoded UASTC texture data), which conditions the output texture data in a way that results in better lossless compression when UASTC .basis files are compressed with Deflate/Zstd, etc. In UASTC mode, you must losslessly compress .basis files yourself. .KTX2 files have built-in lossless compression support using Zstandard, which is used by default on UASTC textures. Basis Universal is not an image compression codec, but a GPU texture compression codec. It can be used just like an image compression codec, but that's not the only use case. Here's a good intro to GPU texture compression. If you're looking to primarily use the system as an image compression codec on sRGB photographic content, use the default ETC1S mode, because it has built-in compression. The "-q X" option controls the output quality in ETC1S mode. The default is quality level 128. "-q 255" will increase quality quite a bit. If you want even higher quality, try "-max_selectors 16128 -max_endpoints 16128" instead of -q. -q internally tries to set the codebook sizes (or the # of quantization intervals for endpoints/selectors) for you. You need to experiment with the quality level on your content. For tangent space normal maps, you should separate X into RGB and Y into Alpha, and provide the compressor with 32-bit/pixel input images. Or use the "-separate_rg_to_color_alpha" command line option which does this for you. The internal texture format that Basis Universal uses (ETC1S) doesn't handle tangent space normal maps encoded into RGB well. You need to separate the channels and recover Z in the pixel shader using z=sqrt(1-x^2-y^2).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              basis_universal has a medium active ecosystem.
              It has 2370 star(s) with 232 fork(s). There are 51 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 76 open issues and 147 have been closed. On average issues are closed in 195 days. There are 26 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of basis_universal is 1.16.4

            kandi-Quality Quality

              basis_universal has 0 bugs and 0 code smells.

            kandi-Security Security

              basis_universal has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              basis_universal code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              basis_universal is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              basis_universal releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.
              It has 2148 lines of code, 0 functions and 21 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of basis_universal
            Get all kandi verified functions for this library.

            basis_universal Key Features

            No Key Features are available at this moment for basis_universal.

            basis_universal Examples and Code Snippets

            No Code Snippets are available at this moment for basis_universal.

            Community Discussions

            Trending Discussions on basis_universal

            QUESTION

            Android 1080p Video Call / Chat SDK?
            Asked 2020-Jun-19 at 07:56

            I'm trying to embed a 1080p video chat stream into a Unity app on Android.

            I've tried using Agora.io for this purpose, but the current version of Agora for Unity runs entirely on the CPU, and copying a 1080p texture from CPU to GPU takes 20ms on my Android device - too slow to maintain a consistent 60fps framerate in my app. Ideally, I either need the copy operation to not block the render thread, or I need the copy to happen in under 10ms, or I need the decoding to happen entirely in hardware.

            I've done some digging into how other video player apps achieve this, and in general they use Android MediaCodec or ExoPlayer to decode video directly to a texture in hardware. However, this doesn't seem feasible for a video chat app because the process of encoding a video stream to one of the Android-supported formats would introduce too much latency.

            I'm curious as to how apps like Skype and Hangouts achieve this - but I suspect they either run at 30fps, or they limit their video resolution to 720p or lower.

            I've also considered creating my own video-chat protocol using something like Basis texture compression to decompress textures on GPU rather than CPU, but there is very little information on how to compile and integrate Basis into an Android application.

            So my question is, does anybody know of a video chat SDK that offers this kind of performance & fidelity without an excessive amount of development work?

            ...

            ANSWER

            Answered 2020-Jun-19 at 07:56

            So as it turns out, my profiling was totally wrong. The texture copy was not the hold-up at all - in fact the texture decode and copy-to-GPU were taking about 3ms, my profiler was just reporting incorrect timings.

            The real bottleneck was the fact that I was trying to render the image onto a 250K triangle surface. It turns out under normal circumstances, my Android device was only able to render a surface of 100K triangles using GLES. However, after switching to Vulkan, ensuring triangles had connected edges (drastically shrinking the mesh index buffer), and performing some minor mesh optimization, I was able to increase my triangle budget to 400K and achieve a steady 60fps frame rate with a 1080p 30fps Agora video chat stream.

            Source https://stackoverflow.com/questions/62403395

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install basis_universal

            You can download and install Basis Universal using the vcpkg dependency manager:. The Basis Universal port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please create an issue or pull request on the vcpkg repository.

            Support

            Both the transcoder and now the compressor (as of 12/17/2020) may be compiled using emscripten to WebAssembly and used on the web. Currently, multithreading is not supported by the compressor when compiled with emscripten. A simple Web compression demo is in webgl/encode_test. All compressor features, including texture video, are supported and fully exposed. To enable compression support compile the JavaScript wrappers in webgl/transcoding/basis_wrappers.cpp with BASISU_SUPPORT_ENCODING set to 1. See the webgl/encoding directory.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/BinomialLLC/basis_universal.git

          • CLI

            gh repo clone BinomialLLC/basis_universal

          • sshUrl

            git@github.com:BinomialLLC/basis_universal.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Compression Libraries

            zstd

            by facebook

            Luban

            by Curzibn

            brotli

            by google

            upx

            by upx

            jszip

            by Stuk

            Try Top Libraries by BinomialLLC

            crunch

            by BinomialLLCC++

            bc7e

            by BinomialLLCC++