Japanese ANIME quality up on streming
Posted: Thu Jan 18, 2024 6:13 pm
Hello, This tips is Japanese ANIME quality up on streming.
I released open source super-low-jitter program for Japanese anime video streaming.
But many enginners said "Please post PureBasic forum tips."
Run this code, Debugger output Generated codes.
Copy and Paste in PB editor, and Run.
required CPU instruction
MMX(Integer) Intel CPU
RDRAND Intel 3th Generation IvyBridge
BLSR Intel 4th Generation Haswell
RDSEED Intel 6th Generation SkyLake
Thank you for review's many JPLAY users.
JPLAY forum English - Computer Audio - Pink HQ + Minorityclean
I released open source super-low-jitter program for Japanese anime video streaming.
But many enginners said "Please post PureBasic forum tips."
Run this code, Debugger output Generated codes.
Copy and Paste in PB editor, and Run.
required CPU instruction
MMX(Integer) Intel CPU
RDRAND Intel 3th Generation IvyBridge
BLSR Intel 4th Generation Haswell
RDSEED Intel 6th Generation SkyLake
Thank you for review's many JPLAY users.
JPLAY forum English - Computer Audio - Pink HQ + Minorityclean
Code: Select all
Debug "; RDSEED BLSR CPU reg. Stabilizer for network streaming anime video"
Debug "; from ExtremeStabilizer 105 (2023 01 05)"
Debug "; Copyright (c) 2020-2024 Hiroyuki Yokota (oryaaaaa)"
Debug "; Design based by Military LAB-AI designed (Customized Hiroyuki Yokota)"
Debug "; Executable Format Windows/Console/DLL and CPU with MMX"
Debug ";"
NewMap Reg64.s()
Reg64("AX")="Rax"
Reg64("BX")="Rbx"
Reg64("CX")="Rcx"
Reg64("DX")="Rdx"
Reg64("SP")="Rsp"
Reg64("SI")="Rsi"
Reg64("BP")="Rbp"
Reg64("DI")="Rdi"
Reg64("R8")="R8"
Reg64("R9")="R9"
Reg64("R10")="R10"
Reg64("R11")="R11"
Reg64("R12")="R12"
Reg64("R13")="R13"
Reg64("R14")="R14"
Reg64("R15")="R15"
NewMap Reg64A.s()
Reg64A("AX")="Rax"
Reg64A("DX")="Rdx"
Reg64A("SP")="Rsp"
Reg64A("SI")="Rsi"
Reg64A("R9")="R9"
Reg64A("R11")="R11"
Reg64A("R13")="R13"
Reg64A("R15")="R15"
NewMap Reg64B.s()
Reg64B("BX")="Rbx"
Reg64B("CX")="Rcx"
Reg64B("BP")="Rbp"
Reg64B("DI")="Rdi"
Reg64B("R8")="R8"
Reg64B("R10")="R10"
Reg64B("R12")="R12"
Reg64B("R14")="R14"
NewMap Reg16.s()
Reg16("Rax")="ax"
Reg16("Rbx")="bx"
Reg16("Rcx")="cx"
Reg16("Rdx")="dx"
Reg16("Rsp")="sp"
Reg16("Rsi")="si"
Reg16("Rbp")="bp"
Reg16("Rdi")="di"
Reg16("R8")="R8w"
Reg16("R9")="R9w"
Reg16("R10")="R10w"
Reg16("R11")="R11w"
Reg16("R12")="R12w"
Reg16("R13")="R13w"
Reg16("R14")="R14w"
Reg16("R15")="R15w"
NewMap Reg8.s()
Reg8("Rax")="al"
Reg8("Rbx")="bl"
Reg8("Rcx")="cl"
Reg8("Rdx")="dl"
Reg8("Rsp")="spl"
Reg8("Rsi")="sil"
Reg8("Rbp")="bpl"
Reg8("Rdi")="dil"
Reg8("R8")="R8b"
Reg8("R9")="R9b"
Reg8("R10")="R10b"
Reg8("R11")="R11b"
Reg8("R12")="R12b"
Reg8("R13")="R13b"
Reg8("R14")="R14b"
Reg8("R15")="R15b"
ForEach Reg64()
Debug "Macro BLSR_"+Reg64()+"_x64"
For Loop=1 To 64
Debug " !BLSR "+Reg64()+", "+Reg64()
Next
Debug "EndMacro"
Debug ""
Next
ForEach Reg64()
Debug "Macro MOV_"+Reg64()+"_Up_Down"
Debug " !MOV "+Reg8(Reg64())+", "+Reg8(Reg64())
If Len(Reg8(Reg64()))=2
Debug " !MOV "+ReplaceString(Reg8(Reg64()), "l", "h")+", "+ReplaceString(Reg8(Reg64()), "l", "h")
EndIf
Debug " !MOV "+Reg16(Reg64())+", "+Reg16(Reg64())
Debug " !MOV "+Reg64()+", "+Reg64()
Debug " !MOV "+Reg16(Reg64())+", "+Reg16(Reg64())
If Len(Reg8(Reg64()))=2
Debug " !MOV "+ReplaceString(Reg8(Reg64()), "l", "h")+", "+ReplaceString(Reg8(Reg64()), "l", "h")
EndIf
Debug " !MOV "+Reg8(Reg64())+", "+Reg8(Reg64())
Debug "EndMacro"
Debug ""
Next
Debug "Macro Set_CL1"
Debug " BLSR_Rcx_x64"
Debug " !INC cl"
Debug " ; cx = 1"
Debug "EndMacro"
Debug ""
Debug "Macro Set_CL8"
Debug " BLSR_Rcx_x64"
Debug " !INC cl"
Debug " !INC cl"
Debug " !SHL cl, cl"
Debug " ; cx = 8"
Debug "EndMacro"
Debug ""
Debug "Macro Set_CL64"
Debug " BLSR_Rcx_x64"
Debug " !INC cl"
Debug " !INC cl"
Debug " !INC cl"
Debug " !INC cl"
Debug " !SHL cl, cl"
Debug " ; cx = 64"
Debug "EndMacro"
Debug ""
Debug "Macro ALL_MMX_CLEAR_SHIFTWORD_INC_CL"
Debug " BLSR_Rcx_x64"
Debug " Set_CL1"
Debug " MOVZX_Rcx"
Debug " !MOVQ mm1, Rcx"
For Loop=1 To 16
Debug " !PSLLW mm0, mm1 ;"+Str(Loop)+" Left 1bit shift"
Next
Debug " !MOVQ mm0, mm1"
For Roop=1 To 7
For Loop=1 To 16
Debug " !PSLLW mm"+Str(Roop)+", mm0 ;"+Str(Loop)+" Left 1bit shift"
Next
Next
Debug "EndMacro"
Debug ""
Debug "Macro SIMPLE_MOVE_REGISTERS_Up_and_Down"
ForEach Reg64A()
Debug " MOV_"+Reg64A()+"_Up_Down"
Next
ForEach Reg64B()
Debug " MOV_"+Reg64B()+"_Up_Down"
Next
Debug "EndMacro"
Debug ""
Debug "Macro MOVZX_Rcx"
Debug " !MOVZX cx, cl"
Debug " !MOVZX Rcx, cl"
Debug " !MOVZX cx, cl"
Debug "EndMacro"
Debug ""
Dim Inst.s(3)
Inst(1) = "SMSW REG"
Inst(2) = "RDRAND REG"
Inst(3) = "RDSEED REG"
; Inst(4) = "HELL REG, REG"
; Inst(5) = "HALT REG, REG, REG"
For Roop=1 To 3
Debug "Macro BeforeProcedureRegisters_"+StringField(Inst(Roop),1," ")+"_BLSR"
Debug " ALL_MMX_CLEAR_SHIFTWORD_INC_CL"
ForEach Reg64A()
Debug " MOV_"+Reg64A()+"_Up_Down"
Next
Loop=0
ForEach Reg64A()
Debug " !MOVQ mm"+Str(Loop)+", "+Reg64A()
Loop + 1
Next
ForEach Reg64A()
Debug " !NOP QWORD [Rip+16]"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
Debug " !"+ReplaceString(Inst(Roop), "REG", Reg64A())
Debug " !NOP QWORD [Rip-36]"
Debug " BLSR_"+Reg64A()+"_x64"
Next
Loop=0
ForEach Reg64A()
Debug " !MOVQ "+Reg64A()+", mm"+Str(Loop)
Loop + 1
Next
ForEach Reg64A()
Debug " MOV_"+Reg64A()+"_Up_Down"
Next
Debug " ;"
ForEach Reg64B()
Debug " MOV_"+Reg64B()+"_Up_Down"
Next
Loop=0
ForEach Reg64B()
Debug " !MOVQ mm"+Str(Loop)+", "+Reg64B()
Loop + 1
Next
ForEach Reg64B()
Debug " !NOP QWORD [Rip+16]"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
Debug " !"+ReplaceString(Inst(Roop), "REG", Reg64B())
Debug " !NOP QWORD [Rip-36]"
Debug " BLSR_"+Reg64B()+"_x64"
Next
Loop=0
ForEach Reg64B()
Debug " !MOVQ "+Reg64B()+", mm"+Str(Loop)
Loop + 1
Next
ForEach Reg64B()
Debug " MOV_"+Reg64B()+"_Up_Down"
Next
Debug " !EMMS"
Debug "EndMacro"
Debug ""
Next
Debug ";- PureBasicStart"
; Debug "CompilerIf #PB_Compiler_ExecutableFormat=#PB_Compiler_Console"
Debug "If OpenConsole("+Chr(34)+"RDSEED BLSR setup To General-purpose 64-bit registers."+Chr(34)+")"
Debug " !StartStabilizer:"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
; Debug "CompilerElseIf #PB_Compiler_ExecutableFormat=#PB_Compiler_DLL"
; Debug "ProcedureDLL CPU64regStabilizer()"
; Debug "CompilerElse"
; Debug " !StartStabilizer:"
; Debug " !NOP QWORD [Rip]"
; Debug " !NOP QWORD [Rip]"
; Debug "CompilerEndIf"
; Debug "CompilerIf #PB_Compiler_ExecutableFormat=#PB_Compiler_Console"
Debug " PrintN("+Chr(34)+"Setup ... RDSEED BLSR CPU reg. Stabilizer"+Chr(34)+")"
; Debug "CompilerEndIf"
For Roop=1 To 64
Debug " ; "+Str(Roop)+" Setup"
Debug " BeforeProcedureRegisters_SMSW_BLSR"
Debug " BeforeProcedureRegisters_RDSEED_BLSR" ; or RDRAND or remove
Debug " SIMPLE_MOVE_REGISTERS_Up_and_Down"
Debug " BLSR_Rcx_x64"
Debug " Set_CL64"
Debug " MOVZX_Rcx"
; Debug "CompilerIf #PB_Compiler_OS=#PB_OS_Linux or #PB_Compiler_OS=#PB_OS_MacOS"
; Debug " !MOV_Rdi, Rcx"
; Debug "CompilerEndIf"
Debug " !NOP QWORD [Rip+16]"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
Debug " !CALL QWORD PB_Delay"
Debug " !NOP QWORD [Rip-32]"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
Next
Debug " BeforeProcedureRegisters_SMSW_BLSR"
Debug " BeforeProcedureRegisters_RDSEED_BLSR" ; or RDRAND or remove
Debug " SIMPLE_MOVE_REGISTERS_Up_and_Down"
; Debug "CompilerIf #PB_Compiler_ExecutableFormat=#PB_Compiler_Console"
Debug " PrintN("+Chr(34)+"Finished"+Chr(34)+")"
; Debug "CompilerEndIf"
Debug " BLSR_Rax_x64"
Debug " BLSR_Rcx_x64"
Debug " Set_CL64"
Debug " MOVZX_Rcx"
Debug " !MOV Rax, Rcx"
Debug " Set_CL8"
Debug " !SHL Rax, cl"
; Debug "CompilerIf #PB_Compiler_OS=#PB_OS_Linux or #PB_Compiler_OS=#PB_OS_MacOS"
; Debug " !MOV_Rdi, Rax"
; Debug "CompilerElse"
Debug " !MOV Rcx, Rax"
; Debug "CompilerEndIf"
Debug " !NOP QWORD [Rip+16]"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
Debug " !CALL QWORD PB_Delay"
Debug " !NOP QWORD [Rip-32]"
Debug " !NOP QWORD [Rip]"
Debug " !NOP QWORD [Rip]"
; Debug "CompilerIf #PB_Compiler_ExecutableFormat=#PB_Compiler_Console"
Debug " !JMP QWORD StartStabilizer"
Debug " CloseConsole()"
Debug "EndIf"
; Debug "CompilerElseIf #PB_Compiler_ExecutableFormat=#PB_Compiler_DLL"
; Debug "EndProcedure"
; Debug "CompilerElse"
; Debug " !JMP QWORD StartStabilizer"
; Debug "CompilerEndIf"
Debug "Delay(800)"
Debug "End"