MCPcopy Create free account
hub / github.com/Vanilagy/webcodecs-polyfill / reverseBitsU32

Function reverseBitsU32

src/misc.ts:515–522  ·  view source on GitHub ↗
(x: number)

Source from the content-addressed store, hash-verified

513};
514
515export const reverseBitsU32 = (x: number): number => {
516 x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1);
517 x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2);
518 x = ((x >> 4) & 0x0f0f0f0f) | ((x & 0x0f0f0f0f) << 4);
519 x = ((x >> 8) & 0x00ff00ff) | ((x & 0x00ff00ff) << 8);
520 x = ((x >> 16) & 0x0000ffff) | ((x & 0x0000ffff) << 16);
521 return x >>> 0; // Ensure it's treated as an unsigned 32-bit integer
522};
523
524let cachedHardwareContext: HardwareContext | null | undefined = undefined;
525export const getHardwareContext = (): HardwareContext | null => {

Callers 1

generateHevcCodecStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected