mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-13 08:11:01 +03:00
improve yuv
This commit is contained in:
@@ -239,7 +239,7 @@ export default class Connection {
|
||||
|
||||
draw(frame: any) {
|
||||
this._draw?.(frame);
|
||||
// globals.I420ToABGR(frame);
|
||||
// globals.I420ToARGB(frame);
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
@@ -41,7 +41,7 @@ export function pushEvent(name, payload) {
|
||||
}
|
||||
|
||||
export function draw(frame) {
|
||||
currentFrame = I420ToABGR(frame);
|
||||
currentFrame = I420ToARGB(frame);
|
||||
}
|
||||
|
||||
export function setConn(conn) {
|
||||
@@ -282,7 +282,7 @@ window.init = async () => {
|
||||
|
||||
let yPtr, yPtrLen, uPtr, uPtrLen, vPtr, vPtrLen, outPtr, outPtrLen;
|
||||
// let testSpeed = [0, 0];
|
||||
export function I420ToABGR(yb) {
|
||||
export function I420ToARGB(yb) {
|
||||
if (!wasmExports) return;
|
||||
// testSpeed[0] += 1;
|
||||
const tm0 = new Date().getTime();
|
||||
@@ -318,8 +318,8 @@ export function I420ToABGR(yb) {
|
||||
outPtr = malloc(n);
|
||||
}
|
||||
// const res = wasmExports.I420ToARGB(yPtr, yb.y.stride, uPtr, yb.u.stride, vPtr, yb.v.stride, outPtr, w * 4, w, h);
|
||||
// const res = wasmExports.AVX_YUV_to_RGB(outPtr, yPtr, uPtr, vPtr, w, h);
|
||||
const res = wasmExports.yuv420_rgb24_std(w, h, yPtr, uPtr, vPtr, yb.y.stride, yb.v.stride, outPtr, w * 4, 0);
|
||||
const res = wasmExports.AVX_YUV_to_RGBA(outPtr, yPtr, uPtr, vPtr, w, h);
|
||||
// const res = wasmExports.yuv420_rgb24_std(w, h, yPtr, uPtr, vPtr, yb.y.stride, yb.v.stride, outPtr, w * 4, 0);
|
||||
const out = HEAPU8.slice(outPtr, outPtr + n);
|
||||
/*
|
||||
testSpeed[1] += new Date().getTime() - tm0;
|
||||
|
||||
Reference in New Issue
Block a user