├── .gitattributes ├── .github └── workflows │ └── c-cpp.yml ├── .gitignore ├── 7zr.exe ├── LICENSE ├── README.md ├── VSFilterMod.sln ├── include ├── IFilterVersion.h ├── Version.h ├── VersionMod.h ├── avisynth │ ├── avisynth1.h │ └── avisynth25.h ├── decss │ ├── VobDec.h │ └── VobFile.h ├── dx │ ├── d3d.h │ ├── d3d8.h │ ├── d3d8caps.h │ ├── d3d8types.h │ ├── d3dcaps.h │ ├── d3drm.h │ ├── d3drmdef.h │ ├── d3drmobj.h │ ├── d3drmwin.h │ ├── d3dtypes.h │ ├── d3dx7.h │ ├── d3dx9.h │ ├── d3dx9anim.h │ ├── d3dx9core.h │ ├── d3dx9effect.h │ ├── d3dx9math.h │ ├── d3dx9math.inl │ ├── d3dx9mesh.h │ ├── d3dx9shader.h │ ├── d3dx9shape.h │ ├── d3dx9tex.h │ ├── d3dx9xof.h │ └── dxtrans.h ├── moreuuids.h ├── stdint.h ├── unrar │ ├── UNRAR.H │ └── UNRARDLL.TXT ├── vd2 │ ├── Copying │ ├── OldFilterSDK │ │ ├── Filter.h │ │ ├── ScriptError.h │ │ ├── ScriptInterpreter.h │ │ ├── ScriptValue.h │ │ ├── VBitmap.h │ │ └── VirtualDub.h │ ├── PluginSDK.chm │ ├── VDXFrame │ │ ├── Unknown.h │ │ ├── VideoFilter.h │ │ ├── VideoFilterDialog.h │ │ └── VideoFilterEntry.h │ ├── extras │ │ └── FilterSDK │ │ │ ├── Filter.h │ │ │ ├── ScriptError.h │ │ │ ├── ScriptInterpreter.h │ │ │ ├── ScriptValue.h │ │ │ ├── VBitmap.h │ │ │ ├── VirtualDub.h │ │ │ └── readme.txt │ └── plugin │ │ ├── vdaudiofilt.h │ │ ├── vdinputdriver.h │ │ ├── vdplugin.h │ │ ├── vdvideofilt.h │ │ └── vdvideoutil.h └── winddk │ ├── devioctl.h │ ├── ntddcdrm.h │ ├── ntddcdvd.h │ ├── ntdddisk.h │ └── ntddstor.h ├── publish.bat ├── src ├── BaseClasses │ ├── LICENSE │ ├── Readme.md │ ├── amextra.cpp │ ├── amextra.h │ ├── amfilter.cpp │ ├── amfilter.h │ ├── amvideo.cpp │ ├── arithutil.cpp │ ├── baseclasses.vcxproj │ ├── baseclasses.vcxproj.filters │ ├── cache.h │ ├── checkbmi.h │ ├── combase.cpp │ ├── combase.h │ ├── cprop.cpp │ ├── cprop.h │ ├── ctlutil.cpp │ ├── ctlutil.h │ ├── ddmm.cpp │ ├── ddmm.h │ ├── dllentry.cpp │ ├── dllsetup.cpp │ ├── dllsetup.h │ ├── dxmperf.h │ ├── fourcc.h │ ├── measure.h │ ├── msgthrd.h │ ├── mtype.cpp │ ├── mtype.h │ ├── outputq.cpp │ ├── outputq.h │ ├── perflog.cpp │ ├── perflog.h │ ├── perfstruct.h │ ├── pstream.cpp │ ├── pstream.h │ ├── pullpin.cpp │ ├── pullpin.h │ ├── refclock.cpp │ ├── refclock.h │ ├── reftime.h │ ├── renbase.cpp │ ├── renbase.h │ ├── schedule.cpp │ ├── schedule.h │ ├── seekpt.cpp │ ├── seekpt.h │ ├── source.cpp │ ├── source.h │ ├── streams.h │ ├── strmctl.cpp │ ├── strmctl.h │ ├── sysclock.cpp │ ├── sysclock.h │ ├── transfrm.cpp │ ├── transfrm.h │ ├── transip.cpp │ ├── transip.h │ ├── videoctl.cpp │ ├── videoctl.h │ ├── vtrans.cpp │ ├── vtrans.h │ ├── winctrl.cpp │ ├── winctrl.h │ ├── winutil.cpp │ ├── winutil.h │ ├── wxdebug.cpp │ ├── wxdebug.h │ ├── wxlist.cpp │ ├── wxlist.h │ ├── wxutil.cpp │ └── wxutil.h ├── basevideofilter │ ├── BaseVideoFilter.cpp │ ├── BaseVideoFilter.h │ ├── basevideofilter.vcxproj │ ├── basevideofilter.vcxproj.filters │ ├── stdafx.cpp │ └── stdafx.h ├── common.props ├── dsutil │ ├── DSMPropertyBag.cpp │ ├── DSMPropertyBag.h │ ├── DSUtil.cpp │ ├── DSUtil.h │ ├── FontInstaller.cpp │ ├── FontInstaller.h │ ├── GolombBuffer.cpp │ ├── GolombBuffer.h │ ├── H264Nalu.cpp │ ├── H264Nalu.h │ ├── HdmvClipInfo.cpp │ ├── HdmvClipInfo.h │ ├── MediaTypeEx.cpp │ ├── MediaTypeEx.h │ ├── MediaTypes.cpp │ ├── MediaTypes.h │ ├── Mpeg2Def.h │ ├── NullRenderers.cpp │ ├── NullRenderers.h │ ├── SharedInclude.h │ ├── a_yuv2rgb.asm │ ├── a_yuvtable.asm │ ├── convert_a.asm │ ├── csimd.h │ ├── dsutil.vcxproj │ ├── dsutil.vcxproj.filters │ ├── mmintrin64.c │ ├── simd.h │ ├── simd_common.h │ ├── simd_instructions.h │ ├── stdafx.cpp │ ├── stdafx.h │ ├── text.cpp │ ├── text.h │ ├── vd.cpp │ ├── vd.h │ ├── vd_asm.cpp │ └── vd_asm.h ├── libpng │ ├── ANNOUNCE │ ├── CHANGES │ ├── LICENSE │ ├── README │ ├── libpng.vcxproj │ ├── libpng.vcxproj.filters │ ├── png.c │ ├── png.h │ ├── pngconf.h │ ├── pngerror.c │ ├── pngget.c │ ├── pngmem.c │ ├── pngpread.c │ ├── pngpriv.h │ ├── pngread.c │ ├── pngrio.c │ ├── pngrtran.c │ ├── pngrutil.c │ ├── pngset.c │ ├── pngtest.c │ ├── pngtrans.c │ ├── pngwio.c │ ├── pngwrite.c │ ├── pngwtran.c │ └── pngwutil.c ├── luajit │ ├── .gitignore │ ├── luajit-2.0 │ │ ├── COPYRIGHT │ │ ├── Makefile │ │ ├── README │ │ ├── dynasm │ │ │ ├── dasm_arm.h │ │ │ ├── dasm_arm.lua │ │ │ ├── dasm_mips.h │ │ │ ├── dasm_mips.lua │ │ │ ├── dasm_ppc.h │ │ │ ├── dasm_ppc.lua │ │ │ ├── dasm_proto.h │ │ │ ├── dasm_x64.lua │ │ │ ├── dasm_x86.h │ │ │ ├── dasm_x86.lua │ │ │ └── dynasm.lua │ │ ├── etc │ │ │ ├── luajit.1 │ │ │ └── luajit.pc │ │ └── src │ │ │ ├── Makefile │ │ │ ├── Makefile.dep │ │ │ ├── host │ │ │ ├── README │ │ │ ├── buildvm.c │ │ │ ├── buildvm.h │ │ │ ├── buildvm_asm.c │ │ │ ├── buildvm_fold.c │ │ │ ├── buildvm_lib.c │ │ │ ├── buildvm_peobj.c │ │ │ ├── genminilua.lua │ │ │ └── minilua.c │ │ │ ├── jit │ │ │ ├── bc.lua │ │ │ ├── bcsave.lua │ │ │ ├── dis_arm.lua │ │ │ ├── dis_mips.lua │ │ │ ├── dis_mipsel.lua │ │ │ ├── dis_ppc.lua │ │ │ ├── dis_x64.lua │ │ │ ├── dis_x86.lua │ │ │ ├── dump.lua │ │ │ ├── v.lua │ │ │ └── vmdef.lua │ │ │ ├── lauxlib.h │ │ │ ├── lib_aux.c │ │ │ ├── lib_base.c │ │ │ ├── lib_bit.c │ │ │ ├── lib_debug.c │ │ │ ├── lib_ffi.c │ │ │ ├── lib_init.c │ │ │ ├── lib_io.c │ │ │ ├── lib_jit.c │ │ │ ├── lib_math.c │ │ │ ├── lib_os.c │ │ │ ├── lib_package.c │ │ │ ├── lib_string.c │ │ │ ├── lib_table.c │ │ │ ├── lj.supp │ │ │ ├── lj_alloc.c │ │ │ ├── lj_alloc.h │ │ │ ├── lj_api.c │ │ │ ├── lj_arch.h │ │ │ ├── lj_asm.c │ │ │ ├── lj_asm.h │ │ │ ├── lj_asm_arm.h │ │ │ ├── lj_asm_mips.h │ │ │ ├── lj_asm_ppc.h │ │ │ ├── lj_asm_x86.h │ │ │ ├── lj_bc.c │ │ │ ├── lj_bc.h │ │ │ ├── lj_bcdump.h │ │ │ ├── lj_bcread.c │ │ │ ├── lj_bcwrite.c │ │ │ ├── lj_carith.c │ │ │ ├── lj_carith.h │ │ │ ├── lj_ccall.c │ │ │ ├── lj_ccall.h │ │ │ ├── lj_ccallback.c │ │ │ ├── lj_ccallback.h │ │ │ ├── lj_cconv.c │ │ │ ├── lj_cconv.h │ │ │ ├── lj_cdata.c │ │ │ ├── lj_cdata.h │ │ │ ├── lj_char.c │ │ │ ├── lj_char.h │ │ │ ├── lj_clib.c │ │ │ ├── lj_clib.h │ │ │ ├── lj_cparse.c │ │ │ ├── lj_cparse.h │ │ │ ├── lj_crecord.c │ │ │ ├── lj_crecord.h │ │ │ ├── lj_ctype.c │ │ │ ├── lj_ctype.h │ │ │ ├── lj_debug.c │ │ │ ├── lj_debug.h │ │ │ ├── lj_def.h │ │ │ ├── lj_dispatch.c │ │ │ ├── lj_dispatch.h │ │ │ ├── lj_emit_arm.h │ │ │ ├── lj_emit_mips.h │ │ │ ├── lj_emit_ppc.h │ │ │ ├── lj_emit_x86.h │ │ │ ├── lj_err.c │ │ │ ├── lj_err.h │ │ │ ├── lj_errmsg.h │ │ │ ├── lj_ff.h │ │ │ ├── lj_ffrecord.c │ │ │ ├── lj_ffrecord.h │ │ │ ├── lj_frame.h │ │ │ ├── lj_func.c │ │ │ ├── lj_func.h │ │ │ ├── lj_gc.c │ │ │ ├── lj_gc.h │ │ │ ├── lj_gdbjit.c │ │ │ ├── lj_gdbjit.h │ │ │ ├── lj_ir.c │ │ │ ├── lj_ir.h │ │ │ ├── lj_ircall.h │ │ │ ├── lj_iropt.h │ │ │ ├── lj_jit.h │ │ │ ├── lj_lex.c │ │ │ ├── lj_lex.h │ │ │ ├── lj_lib.c │ │ │ ├── lj_lib.h │ │ │ ├── lj_load.c │ │ │ ├── lj_mcode.c │ │ │ ├── lj_mcode.h │ │ │ ├── lj_meta.c │ │ │ ├── lj_meta.h │ │ │ ├── lj_obj.c │ │ │ ├── lj_obj.h │ │ │ ├── lj_opt_dce.c │ │ │ ├── lj_opt_fold.c │ │ │ ├── lj_opt_loop.c │ │ │ ├── lj_opt_mem.c │ │ │ ├── lj_opt_narrow.c │ │ │ ├── lj_opt_sink.c │ │ │ ├── lj_opt_split.c │ │ │ ├── lj_parse.c │ │ │ ├── lj_parse.h │ │ │ ├── lj_record.c │ │ │ ├── lj_record.h │ │ │ ├── lj_snap.c │ │ │ ├── lj_snap.h │ │ │ ├── lj_state.c │ │ │ ├── lj_state.h │ │ │ ├── lj_str.c │ │ │ ├── lj_str.h │ │ │ ├── lj_strscan.c │ │ │ ├── lj_strscan.h │ │ │ ├── lj_tab.c │ │ │ ├── lj_tab.h │ │ │ ├── lj_target.h │ │ │ ├── lj_target_arm.h │ │ │ ├── lj_target_mips.h │ │ │ ├── lj_target_ppc.h │ │ │ ├── lj_target_x86.h │ │ │ ├── lj_trace.c │ │ │ ├── lj_trace.h │ │ │ ├── lj_traceerr.h │ │ │ ├── lj_udata.c │ │ │ ├── lj_udata.h │ │ │ ├── lj_vm.h │ │ │ ├── lj_vmevent.c │ │ │ ├── lj_vmevent.h │ │ │ ├── lj_vmmath.c │ │ │ ├── ljamalg.c │ │ │ ├── lua.h │ │ │ ├── lua.hpp │ │ │ ├── luaconf.h │ │ │ ├── luajit.c │ │ │ ├── luajit.h │ │ │ ├── lualib.h │ │ │ ├── msvcbuild.bat │ │ │ ├── ps4build.bat │ │ │ ├── psvitabuild.bat │ │ │ ├── vm_arm.dasc │ │ │ ├── vm_mips.dasc │ │ │ ├── vm_ppc.dasc │ │ │ ├── vm_ppcspe.dasc │ │ │ ├── vm_x86.dasc │ │ │ └── xedkbuild.bat │ ├── luajit.vcxproj │ └── luajit.vcxproj.filters ├── subpic │ ├── CoordGeom.cpp │ ├── CoordGeom.h │ ├── DX7SubPic.cpp │ ├── DX7SubPic.h │ ├── DX9SubPic.cpp │ ├── DX9SubPic.h │ ├── ISubPic.cpp │ ├── ISubPic.h │ ├── MemSubPic.cpp │ ├── MemSubPic.h │ ├── stdafx.cpp │ ├── stdafx.h │ ├── subpic.vcxproj │ └── subpic.vcxproj.filters ├── subtitles │ ├── BaseSub.cpp │ ├── BaseSub.h │ ├── CCDecoder.cpp │ ├── CCDecoder.h │ ├── CompositionObject.cpp │ ├── CompositionObject.h │ ├── DVBSub.cpp │ ├── DVBSub.h │ ├── GFN.cpp │ ├── GFN.h │ ├── HdmvSub.cpp │ ├── HdmvSub.h │ ├── OverlayMix.cpp │ ├── OverlayMix.h │ ├── RTS.cpp │ ├── RTS.h │ ├── Rasterizer.cpp │ ├── Rasterizer.h │ ├── RealTextParser.cpp │ ├── RealTextParser.h │ ├── RenderedHdmvSubtitle.cpp │ ├── RenderedHdmvSubtitle.h │ ├── SSF.cpp │ ├── SSF.h │ ├── STS.cpp │ ├── STS.h │ ├── SeparableFilter.h │ ├── SubtitleInputPin.cpp │ ├── SubtitleInputPin.h │ ├── TextFile.cpp │ ├── TextFile.h │ ├── USFSubtitles.cpp │ ├── USFSubtitles.h │ ├── VobSubFile.cpp │ ├── VobSubFile.h │ ├── VobSubFileRipper.cpp │ ├── VobSubFileRipper.h │ ├── VobSubImage.cpp │ ├── VobSubImage.h │ ├── libssf │ │ ├── Arabic.cpp │ │ ├── Arabic.h │ │ ├── Array.cpp │ │ ├── Array.h │ │ ├── Exception.cpp │ │ ├── Exception.h │ │ ├── File.cpp │ │ ├── File.h │ │ ├── FontWrapper.cpp │ │ ├── FontWrapper.h │ │ ├── Glyph.cpp │ │ ├── Glyph.h │ │ ├── GlyphPath.cpp │ │ ├── GlyphPath.h │ │ ├── Node.cpp │ │ ├── Node.h │ │ ├── NodeFactory.cpp │ │ ├── NodeFactory.h │ │ ├── Rasterizer.cpp │ │ ├── Rasterizer.h │ │ ├── Renderer.cpp │ │ ├── Renderer.h │ │ ├── Split.cpp │ │ ├── Split.h │ │ ├── Stream.cpp │ │ ├── Stream.h │ │ ├── StringMap.cpp │ │ ├── StringMap.h │ │ ├── Subtitle.cpp │ │ ├── Subtitle.h │ │ ├── SubtitleFile.cpp │ │ ├── SubtitleFile.h │ │ ├── demo │ │ │ ├── demo.ssa │ │ │ └── demo.ssf │ │ ├── libssf.vcxproj │ │ ├── libssf.vcxproj.filters │ │ ├── stdafx.cpp │ │ └── stdafx.h │ ├── stdafx.cpp │ ├── stdafx.h │ ├── subtitles.vcxproj │ └── subtitles.vcxproj.filters ├── vsfilter │ ├── Copy.cpp │ ├── DirectVobSub.cpp │ ├── DirectVobSub.h │ ├── DirectVobSubFilter.cpp │ ├── DirectVobSubFilter.h │ ├── DirectVobSubPropPage.cpp │ ├── DirectVobSubPropPage.h │ ├── IDirectVobSub.h │ ├── StdAfx.cpp │ ├── StdAfx.h │ ├── StyleEditorDialog.cpp │ ├── StyleEditorDialog.h │ ├── Systray.h │ ├── TextInputPin.cpp │ ├── TextInputPin.h │ ├── VSFilter.cpp │ ├── VSFilter.def │ ├── VSFilter.h │ ├── VSFilter.rc │ ├── VSFilter.vcxproj │ ├── VSFilter.vcxproj.filters │ ├── VSFilter64.def │ ├── VSFilterMod.def │ ├── VSFilterMod.rc │ ├── VSFilterMod64.def │ ├── csri.h │ ├── csriapi.cpp │ ├── plugins.cpp │ ├── res │ │ ├── Icon_147.ico │ │ ├── Icon_147m.ico │ │ └── VSFilter.manifest │ ├── resource.h │ ├── systray.cpp │ ├── vfr.cpp │ └── vfr.h └── zlib │ ├── ChangeLog │ ├── FAQ │ ├── README │ ├── ZLIB.DEF │ ├── ZLIB.RC │ ├── adler32.c │ ├── compress.c │ ├── crc32.c │ ├── crc32.h │ ├── deflate.c │ ├── deflate.h │ ├── doc │ ├── algorithm.txt │ ├── rfc1950.txt │ ├── rfc1951.txt │ ├── rfc1952.txt │ └── txtvsbin.txt │ ├── gzclose.c │ ├── gzguts.h │ ├── gzlib.c │ ├── gzread.c │ ├── gzwrite.c │ ├── infback.c │ ├── inffast.c │ ├── inffast.h │ ├── inffixed.h │ ├── inflate.c │ ├── inflate.h │ ├── inftrees.c │ ├── inftrees.h │ ├── trees.c │ ├── trees.h │ ├── uncompr.c │ ├── zconf.h │ ├── zlib.h │ ├── zlib.vcxproj │ ├── zlib.vcxproj.filters │ ├── zutil.c │ └── zutil.h └── vapoursynth └── sdk ├── examples ├── filter_skeleton.c ├── invert_example.c └── vsscript_example.c ├── include └── vapoursynth │ ├── VSHelper.h │ ├── VSScript.h │ └── VapourSynth.h ├── lib32 ├── vapoursynth.lib └── vsscript.lib └── lib64 ├── vapoursynth.lib └── vsscript.lib /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.github/workflows/c-cpp.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: windows-2019 9 | 10 | steps: 11 | - uses: actions/checkout@v2 12 | - name: build 13 | shell: cmd 14 | run: ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild" /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v142 /m /p:"Configuration=Release (MOD)" /p:Platform=Win32) 15 | - name: build-x64 16 | shell: cmd 17 | run: ("C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\amd64\msbuild" /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v142 /m /p:"Configuration=Release (MOD)" /p:Platform=x64) 18 | - name: copy 19 | shell: cmd 20 | run: cmake -E copy "bin\Win32\VSFilter\Release (MOD)\VSFilterMod.dll" dist\x86\VSFilterMod.dll && cmake -E copy "bin\x64\VSFilter\Release (MOD)\VSFilterMod.dll" dist\x64\VSFilterMod.dll 21 | - name: upload 22 | uses: actions/upload-artifact@v2 23 | with: 24 | name: VSFilterMod_bin 25 | path: dist 26 | -------------------------------------------------------------------------------- /7zr.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/7zr.exe -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A modification of VSFilterMod by Vmoe Fansub 2 | 3 | New override tags: [wiki page](https://github.com/computerfan/VSFilterMod/wiki) 4 | 5 | Important note: **DO NOT use mod tags in a softsub (ASS file) distribution**, because most players just ignore them, and they may not efficient enough for real-time rendering. 6 | 7 | Base branches: 8 | * Masaiki/VSFilterMod: r5.2.7 9 | * sorayuki/VSFilterMod: r5.2.6 10 | * teplofizik/VSFilterMod: @3651264 (Aug 21, 2014) 11 | 12 | Usage 13 | ===== 14 | ## Aegisub 15 | Decompress VSFilterMod.dll to Aegisub\csri directory. Open Options dialoge in Aegisub, then enter Advanced -> Video option and change Subtitles provider to csri/vsfiltermod_textsub. 16 | 17 | ## Vapousynth 18 | vsfm.TextSubMod(clip clip, string file[, int charset=1, float fps=-1.0, string vfr='', int accurate=0]) 19 | vsfm.VobSub(clip clip, string file) 20 | 21 | * clip: Clip to process. Only YUV420P8, YUV420P10, YUV420P16 and RGB24 are supported. 22 | * accurate: 1: enable accurate render for 10/16bit (~2x slower). / 0: disable (default) 23 | 24 | ## MPC-BE 25 | 1. run `regsvr32.exe VSFilterMod.dll` with administrator privileges 26 | 2. Select "VSFilter/xy-VSFilter" on the select of Options/Subtitles/Subtitle renderer 27 | 28 | Knowing Issues 29 | ===== 30 | * Opentype font (such as Source Han Sans) has a much smaller size when displayed vertically (used like @Source Han Sans). (subtitle renders which origin from VSFilter use GDI to render fonts, but GDI performs badly on opentype fonts.) 31 | -------------------------------------------------------------------------------- /include/IFilterVersion.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | [uuid("A0DD28E1-61C0-4539-A7E6-14544AFF092E")] 25 | interface IFilterVersion : 26 | public IUnknown 27 | { 28 | STDMETHOD_(DWORD, GetFilterVersion)() = 0; 29 | }; -------------------------------------------------------------------------------- /include/Version.h: -------------------------------------------------------------------------------- 1 | //* VSFilterMod 1.1 *// 2 | 3 | #define DO_MAKE_STR(x) #x 4 | #define MAKE_STR(x) DO_MAKE_STR(x) 5 | 6 | #define VERSION_MAJOR 3 7 | #define VERSION_MINOR 4 8 | #define VERSION_REV 0 9 | #define VERSION_PATCH 0 10 | -------------------------------------------------------------------------------- /include/VersionMod.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define DO_MAKE_STR(x) #x 4 | #define MAKE_STR(x) DO_MAKE_STR(x) 5 | 6 | #define VERSION_MAJOR 1 7 | #define VERSION_MINOR 1 8 | #define VERSION_REV 90 9 | #define VERSION_PATCH 0 10 | -------------------------------------------------------------------------------- /include/decss/VobDec.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CVobDec 4 | { 5 | int m_lfsr0, m_lfsr1; 6 | 7 | void ClockLfsr0Forward(int& lfsr0); 8 | void ClockLfsr1Forward(int& lfsr1); 9 | void ClockBackward(int& lfsr0, int& lfsr1); 10 | void Salt(const BYTE salt[5], int& lfsr0, int& lfsr1); 11 | int FindLfsr(const BYTE* crypt, int offset, const BYTE* plain); 12 | 13 | public: 14 | CVobDec(); 15 | virtual ~CVobDec(); 16 | 17 | bool m_fFoundKey; 18 | 19 | bool FindKey(BYTE* buff); 20 | void Decrypt(BYTE* buff); 21 | }; 22 | -------------------------------------------------------------------------------- /include/decss/VobFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma warning(disable : 4200) 4 | 5 | #include 6 | #include 7 | //#include // platform sdk 8 | #include 9 | 10 | class CDVDSession 11 | { 12 | protected: 13 | HANDLE m_hDrive; 14 | 15 | DVD_SESSION_ID m_session; 16 | bool BeginSession(); 17 | void EndSession(); 18 | 19 | BYTE m_SessionKey[5]; 20 | bool Authenticate(); 21 | 22 | BYTE m_DiscKey[6], m_TitleKey[6]; 23 | bool GetDiscKey(); 24 | bool GetTitleKey(int lba, BYTE* pKey); 25 | 26 | public: 27 | CDVDSession(); 28 | virtual ~CDVDSession(); 29 | 30 | bool Open(LPCTSTR path); 31 | void Close(); 32 | 33 | operator HANDLE() const 34 | { 35 | return m_hDrive; 36 | } 37 | operator DVD_SESSION_ID() const 38 | { 39 | return m_session; 40 | } 41 | 42 | bool SendKey(DVD_KEY_TYPE KeyType, BYTE* pKeyData); 43 | bool ReadKey(DVD_KEY_TYPE KeyType, BYTE* pKeyData, int lba = 0); 44 | }; 45 | 46 | class CLBAFile : private CFile 47 | { 48 | public: 49 | CLBAFile(); 50 | virtual ~CLBAFile(); 51 | 52 | bool IsOpen(); 53 | 54 | bool Open(LPCTSTR path); 55 | void Close(); 56 | 57 | int GetLength(); 58 | int GetPosition(); 59 | int Seek(int lba); 60 | bool Read(BYTE* buff); 61 | }; 62 | 63 | class CVobFile : public CDVDSession 64 | { 65 | // all files 66 | typedef struct 67 | { 68 | CString fn; 69 | int size; 70 | } file_t; 71 | CAtlArray m_files; 72 | int m_iFile; 73 | int m_pos, m_size, m_offset; 74 | 75 | // currently opened file 76 | CLBAFile m_file; 77 | 78 | // attribs 79 | bool m_fDVD, m_fHasDiscKey, m_fHasTitleKey; 80 | 81 | public: 82 | CVobFile(); 83 | virtual ~CVobFile(); 84 | 85 | bool IsDVD(); 86 | bool HasDiscKey(BYTE* key); 87 | bool HasTitleKey(BYTE* key); 88 | 89 | bool Open(CString fn, CAtlList& files /* out */); // vts ifo 90 | bool Open(CAtlList& files, int offset = -1); // vts vobs, video vob offset in lba 91 | void Close(); 92 | 93 | int GetLength(); 94 | int GetPosition(); 95 | int Seek(int pos); 96 | bool Read(BYTE* buff); 97 | }; 98 | -------------------------------------------------------------------------------- /include/dx/d3drmwin.h: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (c) Microsoft Corporation. All rights reserved. 4 | * 5 | * File: d3drm.h 6 | * Content: Direct3DRM include file 7 | * 8 | ***************************************************************************/ 9 | 10 | #ifndef __D3DRMWIN_H__ 11 | #define __D3DRMWIN_H__ 12 | 13 | #ifndef WIN32 14 | #define WIN32 15 | #endif 16 | 17 | #include "d3drm.h" 18 | 19 | #include "ddraw.h" 20 | #include "d3d.h" 21 | 22 | /* 23 | * GUIDS used by Direct3DRM Windows interface 24 | */ 25 | DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); 26 | 27 | WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); 28 | 29 | #undef INTERFACE 30 | #define INTERFACE IDirect3DRMWinDevice 31 | 32 | DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) 33 | { 34 | IUNKNOWN_METHODS(PURE); 35 | IDIRECT3DRMOBJECT_METHODS(PURE); 36 | 37 | /* 38 | * IDirect3DRMWinDevice methods 39 | */ 40 | 41 | /* Repaint the window with the last frame which was rendered. */ 42 | STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; 43 | 44 | /* Respond to a WM_ACTIVATE message. */ 45 | STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; 46 | }; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /include/dx/d3dx9.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Copyright (C) Microsoft Corporation. All Rights Reserved. 4 | // 5 | // File: d3dx9.h 6 | // Content: D3DX utility library 7 | // 8 | ////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifdef __D3DX_INTERNAL__ 11 | #error Incorrect D3DX header used 12 | #endif 13 | 14 | #ifndef __D3DX9_H__ 15 | #define __D3DX9_H__ 16 | 17 | 18 | // Defines 19 | #include 20 | 21 | #define D3DX_DEFAULT ((UINT) -1) 22 | #define D3DX_DEFAULT_NONPOW2 ((UINT) -2) 23 | #define D3DX_DEFAULT_FLOAT FLT_MAX 24 | #define D3DX_FROM_FILE ((UINT) -3) 25 | #define D3DFMT_FROM_FILE ((D3DFORMAT) -3) 26 | 27 | #ifndef D3DXINLINE 28 | #ifdef _MSC_VER 29 | #if (_MSC_VER >= 1200) 30 | #define D3DXINLINE __forceinline 31 | #else 32 | #define D3DXINLINE __inline 33 | #endif 34 | #else 35 | #ifdef __cplusplus 36 | #define D3DXINLINE inline 37 | #else 38 | #define D3DXINLINE 39 | #endif 40 | #endif 41 | #endif 42 | 43 | 44 | 45 | // Includes 46 | #include "d3d9.h" 47 | #include "d3dx9math.h" 48 | #include "d3dx9core.h" 49 | #include "d3dx9xof.h" 50 | #include "d3dx9mesh.h" 51 | #include "d3dx9shader.h" 52 | #include "d3dx9effect.h" 53 | 54 | #include "d3dx9tex.h" 55 | #include "d3dx9shape.h" 56 | #include "d3dx9anim.h" 57 | 58 | 59 | 60 | // Errors 61 | #define _FACDD 0x876 62 | #define MAKE_DDHRESULT( code ) MAKE_HRESULT( 1, _FACDD, code ) 63 | 64 | enum _D3DXERR { 65 | D3DXERR_CANNOTMODIFYINDEXBUFFER = MAKE_DDHRESULT(2900), 66 | D3DXERR_INVALIDMESH = MAKE_DDHRESULT(2901), 67 | D3DXERR_CANNOTATTRSORT = MAKE_DDHRESULT(2902), 68 | D3DXERR_SKINNINGNOTSUPPORTED = MAKE_DDHRESULT(2903), 69 | D3DXERR_TOOMANYINFLUENCES = MAKE_DDHRESULT(2904), 70 | D3DXERR_INVALIDDATA = MAKE_DDHRESULT(2905), 71 | D3DXERR_LOADEDMESHASNODATA = MAKE_DDHRESULT(2906), 72 | D3DXERR_DUPLICATENAMEDFRAGMENT = MAKE_DDHRESULT(2907), 73 | D3DXERR_CANNOTREMOVELASTITEM = MAKE_DDHRESULT(2908), 74 | }; 75 | 76 | 77 | #endif //__D3DX9_H__ 78 | 79 | -------------------------------------------------------------------------------- /include/vd2/OldFilterSDK/Filter.h: -------------------------------------------------------------------------------- 1 | #ifndef f_FILTER_H 2 | #define f_FILTER_H 3 | 4 | #include 5 | #include 6 | 7 | // This is really dumb, but necessary to support VTbls in C++. 8 | 9 | typedef struct VDXFilterVTbls 10 | { 11 | void *pvtblVBitmap; 12 | } FilterVTbls; 13 | 14 | #ifdef VDEXT_MAIN 15 | VDXFilterVTbls g_vtbls; 16 | #elif defined(VDEXT_NOTMAIN) 17 | extern VDXFilterVTbls g_vtbls; 18 | #endif 19 | 20 | #define INITIALIZE_VTBLS ff->InitVTables(&g_vtbls) 21 | 22 | #include "VBitmap.h" 23 | 24 | typedef ::VDXFilterInitProc FilterInitProc; 25 | typedef ::VDXFilterDeinitProc FilterDeinitProc; 26 | typedef ::VDXFilterRunProc FilterRunProc; 27 | typedef ::VDXFilterParamProc FilterParamProc; 28 | typedef ::VDXFilterConfigProc FilterConfigProc; 29 | typedef ::VDXFilterStringProc FilterStringProc; 30 | typedef ::VDXFilterStartProc FilterStartProc; 31 | typedef ::VDXFilterEndProc FilterEndProc; 32 | typedef ::VDXFilterScriptStrProc FilterScriptStrProc; 33 | typedef ::VDXFilterStringProc2 FilterStringProc2; 34 | typedef ::VDXFilterSerialize FilterSerialize; 35 | typedef ::VDXFilterDeserialize FilterDeserialize; 36 | typedef ::VDXFilterCopy FilterCopy; 37 | 38 | typedef ::VDXFilterModuleInitProc FilterModuleInitProc; 39 | typedef ::VDXFilterModuleDeinitProc FilterModuleDeinitProc; 40 | 41 | ////////// 42 | 43 | typedef ::VDXFilterPreviewButtonCallback FilterPreviewButtonCallback; 44 | typedef ::VDXFilterPreviewSampleCallback FilterPreviewSampleCallback; 45 | 46 | typedef ::IVDXFilterPreview IFilterPreview; 47 | 48 | ////////// 49 | 50 | typedef ::VDXFilterModule FilterModule; 51 | typedef ::VDXFilterDefinition FilterDefinition; 52 | typedef ::VDXFilterStateInfo FilterStateInfo; 53 | typedef ::VDXFBitmap VFBitmap; 54 | 55 | typedef ::VDXFilterActivation FilterActivation; 56 | typedef ::VDXFilterFunctions FilterFunctions; 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /include/vd2/OldFilterSDK/ScriptError.h: -------------------------------------------------------------------------------- 1 | #ifndef f_SYLIA_SCRIPTERROR_H 2 | #define f_SYLIA_SCRIPTERROR_H 3 | 4 | #include 5 | 6 | typedef ::VDXScriptError CScriptError; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /include/vd2/OldFilterSDK/ScriptInterpreter.h: -------------------------------------------------------------------------------- 1 | #ifndef f_SYLIA_SCRIPTINTERPRETER_H 2 | #define f_SYLIA_SCRIPTINTERPRETER_H 3 | 4 | #include 5 | 6 | typedef ::VDXScriptValue CScriptValue; 7 | typedef ::VDXScriptError CScriptError; 8 | typedef ::VDXScriptObject CScriptObject; 9 | typedef ::IVDXScriptInterpreter IScriptInterpreter; 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /include/vd2/OldFilterSDK/ScriptValue.h: -------------------------------------------------------------------------------- 1 | #ifndef f_SYLIA_SCRIPTVALUE_H 2 | #define f_SYLIA_SCRIPTVALUE_H 3 | 4 | #include 5 | 6 | typedef ::VDXScriptObject CScriptObject; 7 | typedef ::VDXScriptValue CScriptValue; 8 | typedef ::IVDXScriptInterpreter IScriptInterpreter; 9 | 10 | typedef ::VDXScriptFunctionPtr ScriptFunctionPtr; 11 | typedef ::VDXVoidScriptFunctionPtr ScriptVoidFunctionPtr; 12 | typedef ::VDXIntScriptFunctionPtr ScriptIntFunctionPtr; 13 | 14 | typedef ::VDXScriptFunctionDef ScriptFunctionDef; 15 | typedef ::VDXScriptObject CScriptObject; 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /include/vd2/OldFilterSDK/VBitmap.h: -------------------------------------------------------------------------------- 1 | #ifndef f_VIRTUALDUB_VBITMAP_H 2 | #define f_VIRTUALDUB_VBITMAP_H 3 | 4 | #include 5 | #include 6 | 7 | typedef unsigned Pixel; 8 | typedef unsigned Pixel32; 9 | typedef unsigned char Pixel8; 10 | typedef int PixCoord; 11 | typedef int PixDim; 12 | typedef ptrdiff_t PixOffset; 13 | 14 | typedef ::VDXBitmap VBitmap; 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/vd2/OldFilterSDK/VirtualDub.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Filter.h" 4 | #include "ScriptInterpreter.h" 5 | #include "ScriptError.h" 6 | #include "ScriptValue.h" 7 | #include "VBitmap.h" 8 | -------------------------------------------------------------------------------- /include/vd2/PluginSDK.chm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/include/vd2/PluginSDK.chm -------------------------------------------------------------------------------- /include/vd2/VDXFrame/VideoFilterDialog.h: -------------------------------------------------------------------------------- 1 | // VDXFrame - Helper library for VirtualDub plugins 2 | // Copyright (C) 2008 Avery Lee 3 | // 4 | // The plugin headers in the VirtualDub plugin SDK are licensed differently 5 | // differently than VirtualDub and the Plugin SDK themselves. This 6 | // particular file is thus licensed as follows (the "zlib" license): 7 | // 8 | // This software is provided 'as-is', without any express or implied 9 | // warranty. In no event will the authors be held liable for any 10 | // damages arising from the use of this software. 11 | // 12 | // Permission is granted to anyone to use this software for any purpose, 13 | // including commercial applications, and to alter it and redistribute it 14 | // freely, subject to the following restrictions: 15 | // 16 | // 1. The origin of this software must not be misrepresented; you must 17 | // not claim that you wrote the original software. If you use this 18 | // software in a product, an acknowledgment in the product 19 | // documentation would be appreciated but is not required. 20 | // 2. Altered source versions must be plainly marked as such, and must 21 | // not be misrepresented as being the original software. 22 | // 3. This notice may not be removed or altered from any source 23 | // distribution. 24 | 25 | #ifndef f_VD2_VDXFRAME_VIDEOFILTERDIALOG_H 26 | #define f_VD2_VDXFRAME_VIDEOFILTERDIALOG_H 27 | 28 | #include 29 | 30 | class VDXVideoFilterDialog 31 | { 32 | public: 33 | VDXVideoFilterDialog(); 34 | 35 | protected: 36 | HWND mhdlg; 37 | 38 | LRESULT Show(HINSTANCE hInst, LPCSTR templName, HWND parent); 39 | LRESULT Show(HINSTANCE hInst, LPCWSTR templName, HWND parent); 40 | HWND ShowModeless(HINSTANCE hInst, LPCSTR templName, HWND parent); 41 | HWND ShowModeless(HINSTANCE hInst, LPCWSTR templName, HWND parent); 42 | 43 | static INT_PTR CALLBACK StaticDlgProc(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam); 44 | virtual INT_PTR DlgProc(UINT msg, WPARAM wParam, LPARAM lParam); 45 | }; 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/vd2/extras/FilterSDK/VirtualDub.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Filter.h" 4 | #include "ScriptInterpreter.h" 5 | #include "ScriptError.h" 6 | #include "ScriptValue.h" 7 | #include "VBitmap.h" 8 | -------------------------------------------------------------------------------- /include/vd2/extras/FilterSDK/readme.txt: -------------------------------------------------------------------------------- 1 | There are the header files that were included with the last version of the 2 | Filter SDK. You can use these if you need to rebuild a filter that doesn't 3 | compile with the new headers, or otherwise need to know the full API supported 4 | by that SDK (such as if you are building a new filter host). If possible, 5 | you should use the migration headers in include/vd2/OldFilterSDK instead, 6 | and new filters should use directly. 7 | -------------------------------------------------------------------------------- /publish.bat: -------------------------------------------------------------------------------- 1 | rem if "%VS160COMNTOOLS%"=="" goto end 2 | 3 | rem call "%VS160COMNTOOLS%vsdevcmd.bat" 4 | cd /d "%~dp0" 5 | 6 | echo y | rd /s tmp 7 | 8 | msbuild /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v141 /m /p:"Configuration=Release (MOD)" /p:Platform=Win32 9 | if errorlevel 1 goto end 10 | 11 | msbuild /t:Rebuild /p:WindowsTargetPlatformVersion=10.0.18362.0 /p:PlatformToolset=v141 /m /p:"Configuration=Release (MOD)" /p:Platform=x64 12 | if errorlevel 1 goto end 13 | 14 | mkdir tmp 15 | mkdir tmp\x86 16 | mkdir tmp\x64 17 | copy "bin\Win32\VSFilter\Release (MOD)\VSFilterMod.dll" "tmp\x86\VSFilterMod.dll" 18 | copy "bin\x64\VSFilter\Release (MOD)\VSFilterMod.dll" "tmp\x64\VSFilterMod.dll" 19 | 20 | del VSFilterMod_bin.7z 21 | 22 | cd tmp 23 | ..\7zr.exe a -r -mx=9 -myx=9 ..\VSFilterMod_bin.7z . 24 | cd .. 25 | 26 | :end 27 | -------------------------------------------------------------------------------- /src/BaseClasses/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Microsoft Corporation 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | Portions of this repo are provided under the SIL Open Font License. 24 | See the LICENSE file in individual samples for additional details. 25 | -------------------------------------------------------------------------------- /src/BaseClasses/Readme.md: -------------------------------------------------------------------------------- 1 | DirectShow Base Classes 2 | ======================= 3 | 4 | The DirectShow base classes are a set of C++ classes and utility functions designed for implementing DirectShow filters. 5 | 6 | The base class library is provided as a SDK sample in the Microsoft Windows Software Development Kit (SDK). 7 | 8 | + Docs: [DirectShow Base Classes - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/directshow/directshow-base-classes) 9 | + Source code: [Windows-classic-samples/Samples/Win7Samples/multimedia/directshow/baseclasses](https://github.com/microsoft/Windows-classic-samples/tree/master/Samples/Win7Samples/multimedia/directshow/baseclasses) 10 | + [LICENSE](LICENSE) Copy from: [Windows-classic-samples/LICENSE](https://github.com/microsoft/Windows-classic-samples/blob/master/LICENSE) 11 | -------------------------------------------------------------------------------- /src/BaseClasses/amextra.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: AMExtra.h 3 | // 4 | // Desc: DirectShow base classes. 5 | // 6 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __AMEXTRA__ 11 | #define __AMEXTRA__ 12 | 13 | // Simple rendered input pin 14 | // 15 | // NOTE if your filter queues stuff before rendering then it may not be 16 | // appropriate to use this class 17 | // 18 | // In that case queue the end of stream condition until the last sample 19 | // is actually rendered and flush the condition appropriately 20 | 21 | class CRenderedInputPin : public CBaseInputPin 22 | { 23 | public: 24 | 25 | CRenderedInputPin(__in_opt LPCTSTR pObjectName, 26 | __in CBaseFilter *pFilter, 27 | __in CCritSec *pLock, 28 | __inout HRESULT *phr, 29 | __in_opt LPCWSTR pName); 30 | #ifdef UNICODE 31 | CRenderedInputPin(__in_opt LPCSTR pObjectName, 32 | __in CBaseFilter *pFilter, 33 | __in CCritSec *pLock, 34 | __inout HRESULT *phr, 35 | __in_opt LPCWSTR pName); 36 | #endif 37 | 38 | // Override methods to track end of stream state 39 | STDMETHODIMP EndOfStream(); 40 | STDMETHODIMP EndFlush(); 41 | 42 | HRESULT Active(); 43 | HRESULT Run(REFERENCE_TIME tStart); 44 | 45 | protected: 46 | 47 | // Member variables to track state 48 | BOOL m_bAtEndOfStream; // Set by EndOfStream 49 | BOOL m_bCompleteNotified; // Set when we notify for EC_COMPLETE 50 | 51 | private: 52 | void DoCompleteHandling(); 53 | }; 54 | 55 | #endif // __AMEXTRA__ 56 | 57 | -------------------------------------------------------------------------------- /src/BaseClasses/ddmm.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DDMM.h 3 | // 4 | // Desc: DirectShow base classes - efines routines for using DirectDraw 5 | // on a multimonitor system. 6 | // 7 | // Copyright (c) 1995-2001 Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifdef __cplusplus 12 | extern "C" { /* Assume C declarations for C++ */ 13 | #endif /* __cplusplus */ 14 | 15 | // DDRAW.H might not include these 16 | #ifndef DDENUM_ATTACHEDSECONDARYDEVICES 17 | #define DDENUM_ATTACHEDSECONDARYDEVICES 0x00000001L 18 | #endif 19 | 20 | typedef HRESULT(*PDRAWCREATE)(IID *, LPDIRECTDRAW *, LPUNKNOWN); 21 | typedef HRESULT(*PDRAWENUM)(LPDDENUMCALLBACKA, LPVOID); 22 | 23 | IDirectDraw * DirectDrawCreateFromDevice(__in_opt LPSTR, PDRAWCREATE, PDRAWENUM); 24 | IDirectDraw * DirectDrawCreateFromDeviceEx(__in_opt LPSTR, PDRAWCREATE, LPDIRECTDRAWENUMERATEEXA); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif /* __cplusplus */ 29 | -------------------------------------------------------------------------------- /src/BaseClasses/dllsetup.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: DllSetup.h 3 | // 4 | // Desc: DirectShow base classes. 5 | // 6 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | // To be self registering, OLE servers must 11 | // export functions named DllRegisterServer 12 | // and DllUnregisterServer. To allow use of 13 | // custom and default implementations the 14 | // defaults are named AMovieDllRegisterServer 15 | // and AMovieDllUnregisterServer. 16 | // 17 | // To the use the default implementation you 18 | // must provide stub functions. 19 | // 20 | // i.e. STDAPI DllRegisterServer() 21 | // { 22 | // return AMovieDllRegisterServer(); 23 | // } 24 | // 25 | // STDAPI DllUnregisterServer() 26 | // { 27 | // return AMovieDllUnregisterServer(); 28 | // } 29 | // 30 | // 31 | // AMovieDllRegisterServer calls IAMovieSetup.Register(), and 32 | // AMovieDllUnregisterServer calls IAMovieSetup.Unregister(). 33 | 34 | STDAPI AMovieDllRegisterServer2(BOOL); 35 | STDAPI AMovieDllRegisterServer(); 36 | STDAPI AMovieDllUnregisterServer(); 37 | 38 | // helper functions 39 | STDAPI EliminateSubKey(HKEY, LPCTSTR); 40 | 41 | 42 | STDAPI 43 | AMovieSetupRegisterFilter2(const AMOVIESETUP_FILTER * const psetupdata 44 | , IFilterMapper2 * pIFM2 45 | , BOOL bRegister); 46 | 47 | -------------------------------------------------------------------------------- /src/BaseClasses/fourcc.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: FourCC.h 3 | // 4 | // Desc: DirectShow base classes. 5 | // 6 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | // FOURCCMap 11 | // 12 | // provides a mapping between old-style multimedia format DWORDs 13 | // and new-style GUIDs. 14 | // 15 | // A range of 4 billion GUIDs has been allocated to ensure that this 16 | // mapping can be done straightforwardly one-to-one in both directions. 17 | // 18 | // January 95 19 | 20 | 21 | #ifndef __FOURCC__ 22 | #define __FOURCC__ 23 | 24 | 25 | // Multimedia format types are marked with DWORDs built from four 8-bit 26 | // chars and known as FOURCCs. New multimedia AM_MEDIA_TYPE definitions include 27 | // a subtype GUID. In order to simplify the mapping, GUIDs in the range: 28 | // XXXXXXXX-0000-0010-8000-00AA00389B71 29 | // are reserved for FOURCCs. 30 | 31 | class FOURCCMap : public GUID 32 | { 33 | 34 | public: 35 | FOURCCMap(); 36 | FOURCCMap(DWORD Fourcc); 37 | FOURCCMap(const GUID *); 38 | 39 | 40 | DWORD GetFOURCC(void); 41 | void SetFOURCC(DWORD fourcc); 42 | void SetFOURCC(const GUID *); 43 | 44 | private: 45 | void InitGUID(); 46 | }; 47 | 48 | #define GUID_Data2 0 49 | #define GUID_Data3 0x10 50 | #define GUID_Data4_1 0xaa000080 51 | #define GUID_Data4_2 0x719b3800 52 | 53 | inline void 54 | FOURCCMap::InitGUID() 55 | { 56 | Data2 = GUID_Data2; 57 | Data3 = GUID_Data3; 58 | ((DWORD *)Data4)[0] = GUID_Data4_1; 59 | ((DWORD *)Data4)[1] = GUID_Data4_2; 60 | } 61 | 62 | inline 63 | FOURCCMap::FOURCCMap() 64 | { 65 | InitGUID(); 66 | SetFOURCC(DWORD(0)); 67 | } 68 | 69 | inline 70 | FOURCCMap::FOURCCMap(DWORD fourcc) 71 | { 72 | InitGUID(); 73 | SetFOURCC(fourcc); 74 | } 75 | 76 | inline 77 | FOURCCMap::FOURCCMap(const GUID * pGuid) 78 | { 79 | InitGUID(); 80 | SetFOURCC(pGuid); 81 | } 82 | 83 | inline void 84 | FOURCCMap::SetFOURCC(const GUID * pGuid) 85 | { 86 | FOURCCMap * p = (FOURCCMap*) pGuid; 87 | SetFOURCC(p->GetFOURCC()); 88 | } 89 | 90 | inline void 91 | FOURCCMap::SetFOURCC(DWORD fourcc) 92 | { 93 | Data1 = fourcc; 94 | } 95 | 96 | inline DWORD 97 | FOURCCMap::GetFOURCC(void) 98 | { 99 | return Data1; 100 | } 101 | 102 | #endif /* __FOURCC__ */ 103 | 104 | -------------------------------------------------------------------------------- /src/BaseClasses/perflog.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: perflog.h 3 | // 4 | // Desc: Performance logging framework. 5 | // 6 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | typedef struct _PERFLOG_LOGGING_PARAMS 10 | { 11 | GUID ControlGuid; 12 | void (*OnStateChanged)(void); 13 | ULONG NumberOfTraceGuids; 14 | TRACE_GUID_REGISTRATION TraceGuids[ANYSIZE_ARRAY]; 15 | } PERFLOG_LOGGING_PARAMS, *PPERFLOG_LOGGING_PARAMS; 16 | 17 | BOOL 18 | PerflogInitIfEnabled( 19 | IN HINSTANCE hInstance, 20 | __in PPERFLOG_LOGGING_PARAMS LogParams 21 | ); 22 | 23 | BOOL 24 | PerflogInitialize( 25 | __in PPERFLOG_LOGGING_PARAMS LogParams 26 | ); 27 | 28 | VOID 29 | PerflogShutdown( 30 | VOID 31 | ); 32 | 33 | VOID 34 | PerflogTraceEvent( 35 | __in PEVENT_TRACE_HEADER Event 36 | ); 37 | 38 | extern ULONG PerflogEnableFlags; 39 | extern UCHAR PerflogEnableLevel; 40 | extern ULONG PerflogModuleLevel; 41 | extern TRACEHANDLE PerflogTraceHandle; 42 | extern TRACEHANDLE PerflogRegHandle; 43 | 44 | #define PerflogTracingEnabled() (PerflogTraceHandle != 0) 45 | 46 | #define PerflogEvent( _x_ ) PerflogTraceEventLevel _x_ 47 | 48 | VOID 49 | PerflogTraceEventLevel( 50 | ULONG Level, 51 | __in PEVENT_TRACE_HEADER Event 52 | ); 53 | 54 | VOID 55 | PerflogTraceEvent( 56 | __in PEVENT_TRACE_HEADER Event 57 | ); 58 | -------------------------------------------------------------------------------- /src/BaseClasses/seekpt.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: SeekPT.h 3 | // 4 | // Desc: DirectShow base classes. 5 | // 6 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 7 | //------------------------------------------------------------------------------ 8 | 9 | 10 | #ifndef __seekpt_h__ 11 | #define __seekpt_h__ 12 | 13 | 14 | class CSeekingPassThru : public ISeekingPassThru, public CUnknown 15 | { 16 | public: 17 | static CUnknown *CreateInstance(__inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr); 18 | CSeekingPassThru(__in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr); 19 | ~CSeekingPassThru(); 20 | 21 | DECLARE_IUNKNOWN; 22 | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv); 23 | 24 | STDMETHODIMP Init(BOOL bSupportRendering, IPin *pPin); 25 | 26 | private: 27 | CPosPassThru *m_pPosPassThru; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/BaseClasses/sysclock.cpp: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: SysClock.cpp 3 | // 4 | // Desc: DirectShow base classes - implements a system clock based on 5 | // IReferenceClock. 6 | // 7 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #include 12 | #include 13 | 14 | 15 | #ifdef FILTER_DLL 16 | 17 | /* List of class IDs and creator functions for the class factory. This 18 | provides the link between the OLE entry point in the DLL and an object 19 | being created. The class factory will call the static CreateInstance 20 | function when it is asked to create a CLSID_SystemClock object */ 21 | 22 | CFactoryTemplate g_Templates[1] = 23 | { 24 | {&CLSID_SystemClock, CSystemClock::CreateInstance} 25 | }; 26 | 27 | int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]); 28 | #endif 29 | 30 | /* This goes in the factory template table to create new instances */ 31 | CUnknown * WINAPI CSystemClock::CreateInstance(__inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr) 32 | { 33 | return new CSystemClock(NAME("System reference clock"), pUnk, phr); 34 | } 35 | 36 | 37 | CSystemClock::CSystemClock(__in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr) : 38 | CBaseReferenceClock(pName, pUnk, phr) 39 | { 40 | } 41 | 42 | STDMETHODIMP CSystemClock::NonDelegatingQueryInterface( 43 | REFIID riid, 44 | __deref_out void ** ppv) 45 | { 46 | if(riid == IID_IPersist) 47 | { 48 | return GetInterface(static_cast(this), ppv); 49 | } 50 | else if(riid == IID_IAMClockAdjust) 51 | { 52 | return GetInterface(static_cast(this), ppv); 53 | } 54 | else 55 | { 56 | return CBaseReferenceClock::NonDelegatingQueryInterface(riid, ppv); 57 | } 58 | } 59 | 60 | /* Return the clock's clsid */ 61 | STDMETHODIMP 62 | CSystemClock::GetClassID(__out CLSID *pClsID) 63 | { 64 | CheckPointer(pClsID, E_POINTER); 65 | ValidateReadWritePtr(pClsID, sizeof(CLSID)); 66 | *pClsID = CLSID_SystemClock; 67 | return NOERROR; 68 | } 69 | 70 | 71 | STDMETHODIMP 72 | CSystemClock::SetClockDelta(REFERENCE_TIME rtDelta) 73 | { 74 | return SetTimeDelta(rtDelta); 75 | } 76 | -------------------------------------------------------------------------------- /src/BaseClasses/sysclock.h: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // File: SysClock.h 3 | // 4 | // Desc: DirectShow base classes - defines a system clock implementation of 5 | // IReferenceClock. 6 | // 7 | // Copyright (c) 1992-2001 Microsoft Corporation. All rights reserved. 8 | //------------------------------------------------------------------------------ 9 | 10 | 11 | #ifndef __SYSTEMCLOCK__ 12 | #define __SYSTEMCLOCK__ 13 | 14 | // 15 | // Base clock. Uses timeGetTime ONLY 16 | // Uses most of the code in the base reference clock. 17 | // Provides GetTime 18 | // 19 | 20 | class CSystemClock : public CBaseReferenceClock, public IAMClockAdjust, public IPersist 21 | { 22 | public: 23 | // We must be able to create an instance of ourselves 24 | static CUnknown * WINAPI CreateInstance(__inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr); 25 | CSystemClock(__in_opt LPCTSTR pName, __inout_opt LPUNKNOWN pUnk, __inout HRESULT *phr); 26 | 27 | DECLARE_IUNKNOWN 28 | 29 | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, __deref_out void ** ppv); 30 | 31 | // Yield up our class id so that we can be persisted 32 | // Implement required Ipersist method 33 | STDMETHODIMP GetClassID(__out CLSID *pClsID); 34 | 35 | // IAMClockAdjust methods 36 | STDMETHODIMP SetClockDelta(REFERENCE_TIME rtDelta); 37 | }; //CSystemClock 38 | 39 | #endif /* __SYSTEMCLOCK__ */ 40 | -------------------------------------------------------------------------------- /src/basevideofilter/basevideofilter.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4011d485-ff5c-4c01-b166-8a14a85504f3} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {e6d2ff5a-9c21-49be-a36f-45b466ddcc80} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | 22 | 23 | Header Files 24 | 25 | 26 | Header Files 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/basevideofilter/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.cpp : source file that includes just the standard includes 23 | // mpeg2decds.pch will be the pre-compiled header 24 | // stdafx.obj will contain the pre-compiled type information 25 | 26 | #include "stdafx.h" 27 | 28 | // TODO: reference any additional headers you need in STDAFX.H 29 | // and not in this file 30 | -------------------------------------------------------------------------------- /src/basevideofilter/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.h : include file for standard system include files, 23 | // or project specific include files that are used frequently, but 24 | // are changed infrequently 25 | // 26 | 27 | #pragma once 28 | #include "..\DSUtil\SharedInclude.h" 29 | 30 | #ifndef _WIN32_WINNT 31 | #define _WIN32_WINNT 0x0600 32 | #endif 33 | 34 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 35 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 36 | 37 | #ifndef VC_EXTRALEAN 38 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 39 | #endif 40 | 41 | #include 42 | #include // MFC core and standard components 43 | 44 | // TODO: reference additional headers your program requires here 45 | 46 | #include 47 | #include 48 | #include 49 | 50 | -------------------------------------------------------------------------------- /src/common.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | WINVER=0x0600;%(PreprocessorDefinitions) 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/dsutil/DSUtil.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/dsutil/DSUtil.cpp -------------------------------------------------------------------------------- /src/dsutil/FontInstaller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | class CFontInstaller 6 | { 7 | HANDLE(WINAPI *pAddFontMemResourceEx)(PVOID, DWORD, PVOID, DWORD*); 8 | BOOL (WINAPI *pRemoveFontMemResourceEx)(HANDLE); 9 | int (WINAPI *pAddFontResourceEx)(LPCTSTR, DWORD, PVOID); 10 | BOOL (WINAPI *pRemoveFontResourceEx)(LPCTSTR, DWORD, PVOID); 11 | BOOL (WINAPI *pMoveFileEx)(LPCTSTR, LPCTSTR, DWORD); 12 | 13 | CAtlList m_fonts; 14 | CAtlList m_files; 15 | bool InstallFontMemory(const void* pData, UINT len); 16 | bool InstallFontFile(const void* pData, UINT len); 17 | 18 | public: 19 | CFontInstaller(); 20 | virtual ~CFontInstaller(); 21 | 22 | bool InstallFont(const CAtlArray& data); 23 | bool InstallFont(const void* pData, UINT len); 24 | void UninstallFonts(); 25 | }; 26 | -------------------------------------------------------------------------------- /src/dsutil/GolombBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: GolombBuffer.h 1457 2010-01-01 03:13:59Z xhmikosr $ 3 | * 4 | * (C) 2006-2010 see AUTHORS 5 | * 6 | * This file is part of mplayerc. 7 | * 8 | * Mplayerc is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * Mplayerc is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | */ 22 | 23 | 24 | #pragma once 25 | 26 | 27 | class CGolombBuffer 28 | { 29 | public: 30 | CGolombBuffer(BYTE* pBuffer, int nSize); 31 | 32 | UINT64 BitRead(int nBits, bool fPeek = false); 33 | UINT64 UExpGolombRead(); 34 | INT64 SExpGolombRead(); 35 | void BitByteAlign(); 36 | 37 | inline BYTE ReadByte() 38 | { 39 | return (BYTE) BitRead(8); 40 | }; 41 | inline SHORT ReadShort() 42 | { 43 | return (SHORT)BitRead(16); 44 | }; 45 | inline DWORD ReadDword() 46 | { 47 | return (DWORD)BitRead(32); 48 | }; 49 | void ReadBuffer(BYTE* pDest, int nSize); 50 | 51 | void Reset(); 52 | void Reset(BYTE* pNewBuffer, int nNewSize); 53 | 54 | void SetSize(int nValue) 55 | { 56 | m_nSize = nValue; 57 | }; 58 | int GetSize() 59 | { 60 | return m_nSize; 61 | }; 62 | int RemainingSize() 63 | { 64 | return m_nSize - m_nBitPos; 65 | }; 66 | bool IsEOF() 67 | { 68 | return m_nBitPos >= m_nSize; 69 | }; 70 | INT64 GetPos(); 71 | BYTE* GetBufferPos() 72 | { 73 | return m_pBuffer + m_nBitPos; 74 | }; 75 | 76 | void SkipBytes(int nCount); 77 | 78 | private : 79 | BYTE* m_pBuffer; 80 | int m_nSize; 81 | int m_nBitPos; 82 | int m_bitlen; 83 | INT64 m_bitbuff; 84 | }; 85 | -------------------------------------------------------------------------------- /src/dsutil/MediaTypeEx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | class CMediaTypeEx : public CMediaType 4 | { 5 | public: 6 | CMediaTypeEx(); 7 | CMediaTypeEx(const CMediaType& mt) 8 | { 9 | CMediaType::operator = (mt); 10 | } 11 | 12 | CString ToString(IPin* pPin = NULL); 13 | 14 | static CString GetVideoCodecName(const GUID& subtype, DWORD biCompression); 15 | static CString GetAudioCodecName(const GUID& subtype, WORD wFormatTag); 16 | static CString GetSubtitleCodecName(const GUID& subtype); 17 | 18 | void Dump(CAtlList& sl); 19 | }; 20 | -------------------------------------------------------------------------------- /src/dsutil/MediaTypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #pragma pack(1) 25 | struct VIH 26 | { 27 | VIDEOINFOHEADER vih; 28 | UINT mask[3]; 29 | int size; 30 | const GUID* subtype; 31 | }; 32 | struct VIH2 33 | { 34 | VIDEOINFOHEADER2 vih; 35 | UINT mask[3]; 36 | int size; 37 | const GUID* subtype; 38 | }; 39 | #pragma pack() 40 | 41 | extern VIH vihs[]; 42 | extern VIH2 vih2s[]; 43 | 44 | extern int VIHSIZE; 45 | 46 | extern CString VIH2String(int i), Subtype2String(const GUID& subtype); 47 | extern void CorrectMediaType(AM_MEDIA_TYPE* pmt); 48 | -------------------------------------------------------------------------------- /src/dsutil/SharedInclude.h: -------------------------------------------------------------------------------- 1 | #ifndef IncDSUtil_SharedInclude_h 2 | #define IncDSUtil_SharedInclude_h 3 | 4 | #pragma warning(disable:4018) 5 | #pragma warning(disable:4800) 6 | #pragma warning(disable:4355) 7 | #pragma warning(disable:4244) 8 | #pragma warning(disable:4995) 9 | #pragma warning(disable:4996) 10 | #pragma warning(disable:4305) 11 | #pragma warning(disable:4200) 12 | #pragma warning(disable:4101) 13 | #pragma warning(disable:4101) 14 | #pragma warning(disable:4267) 15 | 16 | #ifdef _DEBUG 17 | #define _CRTDBG_MAP_ALLOC // include Microsoft memory leak detection procedures 18 | 19 | #if 0 20 | #include 21 | #define DNew new(_NORMAL_BLOCK, __FILE__, __LINE__) 22 | #else 23 | #define DNew new(__FILE__, __LINE__) 24 | #endif 25 | 26 | #else 27 | 28 | #define DNew new 29 | 30 | #endif 31 | #endif // IncDSUtil_SharedInclude_h 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/dsutil/simd_common.h: -------------------------------------------------------------------------------- 1 | #ifndef _SIMD_COMMON_H_ 2 | #define _SIMD_COMMON_H_ 3 | 4 | #if !defined(__GNUC__) 5 | #define __SSE2__ 6 | #endif 7 | 8 | #ifdef __GNUC__ 9 | #ifndef __forceinline 10 | #define __forceinline __attribute__((__always_inline__)) inline 11 | #endif 12 | #endif 13 | 14 | #ifdef __GNUC__ 15 | #define __inline __forceinline // GCC needs to force inlining of intrinsics functions 16 | #endif 17 | 18 | #include 19 | #include 20 | #ifdef __SSE2__ 21 | #include 22 | #endif 23 | 24 | #ifdef __GNUC__ 25 | #undef __inline 26 | #endif 27 | 28 | #ifdef __GNUC__ 29 | #define __align8(t,v) t v __attribute__ ((aligned (8))) 30 | #define __align16(t,v) t v __attribute__ ((aligned (16))) 31 | #else 32 | #define __align8(t,v) __declspec(align(8)) t v 33 | #define __align16(t,v) __declspec(align(16)) t v 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/dsutil/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.cpp : source file that includes just the standard includes 23 | // dsutil.pch will be the pre-compiled header 24 | // stdafx.obj will contain the pre-compiled type information 25 | 26 | #include "stdafx.h" 27 | 28 | // TODO: reference any additional headers you need in STDAFX.H 29 | // and not in this file 30 | -------------------------------------------------------------------------------- /src/dsutil/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.h : include file for standard system include files, 23 | // or project specific include files that are used frequently, but 24 | // are changed infrequently 25 | // 26 | 27 | #pragma once 28 | #include "SharedInclude.h" 29 | 30 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 31 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 32 | #define WINVER 0x0600 33 | 34 | #ifndef VC_EXTRALEAN 35 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 36 | #endif 37 | 38 | #include 39 | #include // MFC core and standard components 40 | 41 | // TODO: reference additional headers your program requires here 42 | 43 | #include 44 | 45 | #include 46 | #include 47 | 48 | #include 49 | #include 50 | 51 | -------------------------------------------------------------------------------- /src/dsutil/text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | // extern CString ExplodeMin(CString str, CAtlList& sl, TCHAR sep, int limit = 0); 6 | // extern CString Explode(CString str, CAtlList& sl, TCHAR sep, int limit = 0); 7 | // extern CString Implode(CAtlList& sl, TCHAR sep); 8 | 9 | template 10 | T Explode(T str, CAtlList& sl, SEP sep, size_t limit = 0) 11 | { 12 | sl.RemoveAll(); 13 | 14 | for(ptrdiff_t i = 0, j = 0; ; i = j + 1) 15 | { 16 | j = str.Find(sep, i); 17 | 18 | if(j < 0 || sl.GetCount() == limit - 1) 19 | { 20 | sl.AddTail(str.Mid(i).Trim()); 21 | break; 22 | } 23 | else 24 | { 25 | sl.AddTail(str.Mid(i, j - i).Trim()); 26 | } 27 | } 28 | 29 | return sl.GetHead(); 30 | } 31 | 32 | template 33 | T ExplodeMin(T str, CAtlList& sl, SEP sep, size_t limit = 0) 34 | { 35 | Explode(str, sl, sep, limit); 36 | POSITION pos = sl.GetHeadPosition(); 37 | while(pos) 38 | { 39 | POSITION tmp = pos; 40 | if(sl.GetNext(pos).IsEmpty()) 41 | sl.RemoveAt(tmp); 42 | } 43 | if(sl.IsEmpty()) sl.AddTail(T()); // eh 44 | 45 | return sl.GetHead(); 46 | } 47 | 48 | template 49 | T Implode(CAtlList& sl, SEP sep) 50 | { 51 | T ret; 52 | POSITION pos = sl.GetHeadPosition(); 53 | while(pos) 54 | { 55 | ret += sl.GetNext(pos); 56 | if(pos) ret += sep; 57 | } 58 | return(ret); 59 | } 60 | 61 | extern CString ExtractTag(CString tag, CMapStringToString& attribs, bool& fClosing); 62 | extern CStringA ConvertMBCS(CStringA str, DWORD SrcCharSet, DWORD DstCharSet); 63 | extern CStringA UrlEncode(CStringA str, bool fRaw = false); 64 | extern CStringA UrlDecode(CStringA str, bool fRaw = false); 65 | extern DWORD CharSetToCodePage(DWORD dwCharSet); 66 | extern CAtlList& MakeLower(CAtlList& sl); 67 | extern CAtlList& MakeUpper(CAtlList& sl); 68 | extern CAtlList& RemoveStrings(CAtlList& sl, int minlen, int maxlen); 69 | 70 | -------------------------------------------------------------------------------- /src/dsutil/vd.h: -------------------------------------------------------------------------------- 1 | // VirtualDub - Video processing and capture application 2 | // Copyright (C) 1998-2001 Avery Lee 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | // 18 | // Notes: 19 | // - BitBltFromI420ToRGB is from VirtualDub 20 | // - BitBltFromYUY2ToRGB is from AviSynth 2.52 21 | // (- vd.cpp/h should be renamed to something more sensible already :) 22 | 23 | #pragma once 24 | 25 | class CCpuID 26 | { 27 | public: 28 | CCpuID(); 29 | enum flag_t {mmx = 1, ssemmx = 2, ssefpu = 4, sse2 = 8, _3dnow = 16, sse3 = 32} m_flags; 30 | }; 31 | extern CCpuID g_cpuid; 32 | 33 | extern bool BitBltFromI420ToI420(int w, int h, BYTE* dsty, BYTE* dstu, BYTE* dstv, int dstpitch, BYTE* srcy, BYTE* srcu, BYTE* srcv, int srcpitch); 34 | extern bool BitBltFromI420ToYUY2(int w, int h, BYTE* dst, int dstpitch, BYTE* srcy, BYTE* srcu, BYTE* srcv, int srcpitch, bool fInterlaced = false); 35 | extern bool BitBltFromI420ToRGB(int w, int h, BYTE* dst, int dstpitch, int dbpp, BYTE* srcy, BYTE* srcu, BYTE* srcv, int srcpitch /* TODO: , bool fInterlaced = false */); 36 | extern bool BitBltFromYUY2ToYUY2(int w, int h, BYTE* dst, int dstpitch, BYTE* src, int srcpitch); 37 | extern bool BitBltFromYUY2ToRGB(int w, int h, BYTE* dst, int dstpitch, int dbpp, BYTE* src, int srcpitch); 38 | extern bool BitBltFromRGBToRGB(int w, int h, BYTE* dst, int dstpitch, int dbpp, BYTE* src, int srcpitch, int sbpp); 39 | 40 | extern void DeinterlaceBlend(BYTE* dst, BYTE* src, DWORD rowbytes, DWORD h, DWORD dstpitch, DWORD srcpitch); 41 | extern void DeinterlaceBob(BYTE* dst, BYTE* src, DWORD rowbytes, DWORD h, DWORD dstpitch, DWORD srcpitch, bool topfield); 42 | 43 | extern void AvgLines8(BYTE* dst, DWORD h, DWORD pitch); 44 | extern void AvgLines555(BYTE* dst, DWORD h, DWORD pitch); 45 | extern void AvgLines565(BYTE* dst, DWORD h, DWORD pitch); -------------------------------------------------------------------------------- /src/dsutil/vd_asm.h: -------------------------------------------------------------------------------- 1 | // VirtualDub - Video processing and capture application 2 | // Copyright (C) 1998-2001 Avery Lee 3 | // 4 | // This program is free software; you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation; either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program; if not, write to the Free Software 16 | // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | // 18 | // Notes: 19 | // - BitBltFromI420ToRGB is from VirtualDub 20 | // - BitBltFromYUY2ToRGB is from AviSynth 2.52 21 | // (- vd.cpp/h should be renamed to something more sensible already :) 22 | 23 | #pragma once 24 | 25 | #ifndef _WIN64 26 | void yuvtoyuy2row_MMX(BYTE* dst, BYTE* srcy, BYTE* srcu, BYTE* srcv, DWORD width); 27 | void yuvtoyuy2row_avg_MMX(BYTE* dst, BYTE* srcy, BYTE* srcu, BYTE* srcv, DWORD width, DWORD pitchuv); 28 | 29 | void yv12_yuy2_row_sse2(); 30 | void yv12_yuy2_row_sse2_linear(); 31 | void yv12_yuy2_row_sse2_linear_interlaced(); 32 | void yv12_yuy2_sse2(const BYTE *Y, const BYTE *U, const BYTE *V, int halfstride, unsigned halfwidth, unsigned height, BYTE *YUY2, int d_stride); 33 | void yv12_yuy2_sse2_interlaced(const BYTE *Y, const BYTE *U, const BYTE *V, int halfstride, unsigned halfwidth, unsigned height, BYTE *YUY2, int d_stride); 34 | 35 | void asm_blend_row_clipped_MMX(BYTE* dst, BYTE* src, DWORD w, DWORD srcpitch); 36 | void asm_blend_row_MMX(BYTE* dst, BYTE* src, DWORD w, DWORD srcpitch); 37 | void asm_blend_row_SSE2(BYTE* dst, BYTE* src, DWORD w, DWORD srcpitch); 38 | void asm_blend_row_clipped_SSE2(BYTE* dst, BYTE* src, DWORD w, DWORD srcpitch); 39 | #endif 40 | -------------------------------------------------------------------------------- /src/libpng/ANNOUNCE: -------------------------------------------------------------------------------- 1 | 2 | Libpng 1.4.2 - May 6, 2010 3 | 4 | This is a public release of libpng, intended for use in production codes. 5 | 6 | Files available for download: 7 | 8 | Source files with LF line endings (for Unix/Linux) and with a 9 | "configure" script 10 | 11 | libpng-1.4.2.tar.xz (LZMA-compressed, recommended) 12 | libpng-1.4.2.tar.gz 13 | libpng-1.4.2.tar.bz2 14 | 15 | Source files with CRLF line endings (for Windows), without the 16 | "configure" script 17 | 18 | lpng142.zip 19 | lpng142.7z 20 | 21 | Other information: 22 | 23 | libpng-1.4.2-README.txt 24 | libpng-1.4.2-LICENSE.txt 25 | 26 | Changes since the last public release (1.4.1): 27 | Restored the macro definition of png_check_sig(). 28 | Conditionally compile an "else" statement in png_decompress_chunk(). 29 | Documented the fact that png_set_dither() was disabled since libpng-1.4.0. 30 | Reenabled png_set_dither() but renamed it to png_set_quantize() to reflect 31 | more accurately what it actually does. At the same time, renamed 32 | the PNG_DITHER_[RED,GREEN_BLUE]_BITS macros to 33 | PNG_QUANTIZE_[RED,GREEN,BLUE]_BITS. 34 | Added some "(long)" typecasts to printf calls in png_handle_cHRM(). 35 | Relaxed the overly-restrictive permissions of some files. 36 | Added the "vstudio" project to replace "visualc6" and "visualc71" which 37 | will be removed from libpng-1.5.0. 38 | Demonstrate in example.c that lang_key should be initialized. 39 | Set PNG_NO_READ_BGR, PNG_NO_IO_STATE, and PNG_NO_TIME_RFC1123 in 40 | contrib/pngminim/decoder/pngusr.h to make a smaller decoder application. 41 | Include png_reset_zstream() in png.c only when PNG_READ_SUPPORTED is defined. 42 | Removed dummy_inflate.c and uncompr.c from contrib/pngminim/encoder 43 | Corrected PNG_UNKNOWN_CHUNKS_SUPPORTED to PNG_HANDLE_AS_UNKNOWN_SUPPORTED 44 | in gregbook/readpng2.c 45 | Corrected protection of png_get_user_transform_ptr. The API declaration in 46 | png.h is removed if both READ and WRITE USER_TRANSFORM are turned off 47 | but was left defined in pngtrans.c 48 | Moved declarations of umsg[] inside the proper #ifdef blocks in pngrutil.c 49 | 50 | Send comments/corrections/commendations to glennrp at users.sourceforge.net 51 | or to png-mng-implement at lists.sf.net (subscription required; visit 52 | https://lists.sourceforge.net/lists/listinfo/png-mng-implement). 53 | 54 | Glenn R-P 55 | -------------------------------------------------------------------------------- /src/libpng/libpng.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | Source Files 58 | 59 | 60 | Source Files 61 | 62 | 63 | 64 | 65 | Header Files 66 | 67 | 68 | Header Files 69 | 70 | 71 | Header Files 72 | 73 | 74 | -------------------------------------------------------------------------------- /src/luajit/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | ################# 3 | ## Visual Studio 4 | ################# 5 | 6 | ## Ignore Visual Studio temporary files, build results, and 7 | ## files generated by popular Visual Studio add-ons. 8 | 9 | [Dd]ebug/ 10 | [Rr]elease/ 11 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/README: -------------------------------------------------------------------------------- 1 | README for LuaJIT 2.0.5 2 | ----------------------- 3 | 4 | LuaJIT is a Just-In-Time (JIT) compiler for the Lua programming language. 5 | 6 | Project Homepage: http://luajit.org/ 7 | 8 | LuaJIT is Copyright (C) 2005-2017 Mike Pall. 9 | LuaJIT is free software, released under the MIT license. 10 | See full Copyright Notice in the COPYRIGHT file or in luajit.h. 11 | 12 | Documentation for LuaJIT is available in HTML format. 13 | Please point your favorite browser to: 14 | 15 | doc/luajit.html 16 | 17 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/dynasm/dasm_proto.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** DynASM encoding engine prototypes. 3 | ** Copyright (C) 2005-2017 Mike Pall. All rights reserved. 4 | ** Released under the MIT license. See dynasm.lua for full copyright notice. 5 | */ 6 | 7 | #ifndef _DASM_PROTO_H 8 | #define _DASM_PROTO_H 9 | 10 | #include 11 | #include 12 | 13 | #define DASM_IDENT "DynASM 1.3.0" 14 | #define DASM_VERSION 10300 /* 1.3.0 */ 15 | 16 | #ifndef Dst_DECL 17 | #define Dst_DECL dasm_State **Dst 18 | #endif 19 | 20 | #ifndef Dst_REF 21 | #define Dst_REF (*Dst) 22 | #endif 23 | 24 | #ifndef DASM_FDEF 25 | #define DASM_FDEF extern 26 | #endif 27 | 28 | #ifndef DASM_M_GROW 29 | #define DASM_M_GROW(ctx, t, p, sz, need) \ 30 | do { \ 31 | size_t _sz = (sz), _need = (need); \ 32 | if (_sz < _need) { \ 33 | if (_sz < 16) _sz = 16; \ 34 | while (_sz < _need) _sz += _sz; \ 35 | (p) = (t *)realloc((p), _sz); \ 36 | if ((p) == NULL) exit(1); \ 37 | (sz) = _sz; \ 38 | } \ 39 | } while(0) 40 | #endif 41 | 42 | #ifndef DASM_M_FREE 43 | #define DASM_M_FREE(ctx, p, sz) free(p) 44 | #endif 45 | 46 | /* Internal DynASM encoder state. */ 47 | typedef struct dasm_State dasm_State; 48 | 49 | 50 | /* Initialize and free DynASM state. */ 51 | DASM_FDEF void dasm_init(Dst_DECL, int maxsection); 52 | DASM_FDEF void dasm_free(Dst_DECL); 53 | 54 | /* Setup global array. Must be called before dasm_setup(). */ 55 | DASM_FDEF void dasm_setupglobal(Dst_DECL, void **gl, unsigned int maxgl); 56 | 57 | /* Grow PC label array. Can be called after dasm_setup(), too. */ 58 | DASM_FDEF void dasm_growpc(Dst_DECL, unsigned int maxpc); 59 | 60 | /* Setup encoder. */ 61 | DASM_FDEF void dasm_setup(Dst_DECL, const void *actionlist); 62 | 63 | /* Feed encoder with actions. Calls are generated by pre-processor. */ 64 | DASM_FDEF void dasm_put(Dst_DECL, int start, ...); 65 | 66 | /* Link sections and return the resulting size. */ 67 | DASM_FDEF int dasm_link(Dst_DECL, size_t *szp); 68 | 69 | /* Encode sections into buffer. */ 70 | DASM_FDEF int dasm_encode(Dst_DECL, void *buffer); 71 | 72 | /* Get PC label offset. */ 73 | DASM_FDEF int dasm_getpclabel(Dst_DECL, unsigned int pc); 74 | 75 | #ifdef DASM_CHECKS 76 | /* Optional sanity checker to call between isolated encoding steps. */ 77 | DASM_FDEF int dasm_checkstep(Dst_DECL, int secmatch); 78 | #else 79 | #define dasm_checkstep(a, b) 0 80 | #endif 81 | 82 | 83 | #endif /* _DASM_PROTO_H */ 84 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/dynasm/dasm_x64.lua: -------------------------------------------------------------------------------- 1 | ------------------------------------------------------------------------------ 2 | -- DynASM x64 module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- See dynasm.lua for full copyright notice. 6 | ------------------------------------------------------------------------------ 7 | -- This module just sets 64 bit mode for the combined x86/x64 module. 8 | -- All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | x64 = true -- Using a global is an ugly, but effective solution. 12 | return require("dasm_x86") 13 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/etc/luajit.1: -------------------------------------------------------------------------------- 1 | .TH luajit 1 "" "" "LuaJIT documentation" 2 | .SH NAME 3 | luajit \- Just-In-Time Compiler for the Lua Language 4 | \fB 5 | .SH SYNOPSIS 6 | .B luajit 7 | [\fIoptions\fR]... [\fIscript\fR [\fIargs\fR]...] 8 | .SH "WEB SITE" 9 | .IR http://luajit.org 10 | .SH DESCRIPTION 11 | .PP 12 | This is the command-line program to run Lua programs with \fBLuaJIT\fR. 13 | .PP 14 | \fBLuaJIT\fR is a just-in-time (JIT) compiler for the Lua language. 15 | The virtual machine (VM) is based on a fast interpreter combined with 16 | a trace compiler. It can significantly improve the performance of Lua programs. 17 | .PP 18 | \fBLuaJIT\fR is API\- and ABI-compatible with the VM of the standard 19 | Lua\ 5.1 interpreter. When embedding the VM into an application, 20 | the built library can be used as a drop-in replacement. 21 | .SH OPTIONS 22 | .TP 23 | .BI "\-e " chunk 24 | Run the given chunk of Lua code. 25 | .TP 26 | .BI "\-l " library 27 | Load the named library, just like \fBrequire("\fR\fIlibrary\fR\fB")\fR. 28 | .TP 29 | .BI "\-b " ... 30 | Save or list bytecode. Run without arguments to get help on options. 31 | .TP 32 | .BI "\-j " command 33 | Perform LuaJIT control command (optional space after \fB\-j\fR). 34 | .TP 35 | .BI "\-O" [opt] 36 | Control LuaJIT optimizations. 37 | .TP 38 | .B "\-i" 39 | Run in interactive mode. 40 | .TP 41 | .B "\-v" 42 | Show \fBLuaJIT\fR version. 43 | .TP 44 | .B "\-E" 45 | Ignore environment variables. 46 | .TP 47 | .B "\-\-" 48 | Stop processing options. 49 | .TP 50 | .B "\-" 51 | Read script from stdin instead. 52 | .PP 53 | After all options are processed, the given \fIscript\fR is run. 54 | The arguments are passed in the global \fIarg\fR table. 55 | .PP 56 | Interactive mode is only entered, if no \fIscript\fR and no \fB\-e\fR 57 | option is given. Interactive mode can be left with EOF (\fICtrl\-Z\fB). 58 | .SH EXAMPLES 59 | .TP 60 | luajit hello.lua world 61 | 62 | Prints "Hello world", assuming \fIhello.lua\fR contains: 63 | .br 64 | print("Hello", arg[1]) 65 | .TP 66 | luajit \-e "local x=0; for i=1,1e9 do x=x+i end; print(x)" 67 | 68 | Calculates the sum of the numbers from 1 to 1000000000. 69 | .br 70 | And finishes in a reasonable amount of time, too. 71 | .TP 72 | luajit \-jv \-e "for i=1,10 do for j=1,10 do for k=1,100 do end end end" 73 | 74 | Runs some nested loops and shows the resulting traces. 75 | .SH COPYRIGHT 76 | .PP 77 | \fBLuaJIT\fR is Copyright \(co 2005-2017 Mike Pall. 78 | .br 79 | \fBLuaJIT\fR is open source software, released under the MIT license. 80 | .SH SEE ALSO 81 | .PP 82 | More details in the provided HTML docs or at: 83 | .IR http://luajit.org 84 | .br 85 | More about the Lua language can be found at: 86 | .IR http://lua.org/docs.html 87 | .PP 88 | lua(1) 89 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/etc/luajit.pc: -------------------------------------------------------------------------------- 1 | # Package information for LuaJIT to be used by pkg-config. 2 | majver=2 3 | minver=0 4 | relver=5 5 | version=${majver}.${minver}.${relver} 6 | abiver=5.1 7 | 8 | prefix=/usr/local 9 | multilib=lib 10 | exec_prefix=${prefix} 11 | libdir=${exec_prefix}/${multilib} 12 | libname=luajit-${abiver} 13 | includedir=${prefix}/include/luajit-${majver}.${minver} 14 | 15 | INSTALL_LMOD=${prefix}/share/lua/${abiver} 16 | INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver} 17 | 18 | Name: LuaJIT 19 | Description: Just-in-time compiler for Lua 20 | URL: http://luajit.org 21 | Version: ${version} 22 | Requires: 23 | Libs: -L${libdir} -l${libname} 24 | Libs.private: -Wl,-E -lm -ldl 25 | Cflags: -I${includedir} 26 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/host/README: -------------------------------------------------------------------------------- 1 | The files in this directory are only used during the build process of LuaJIT. 2 | For cross-compilation, they must be executed on the host, not on the target. 3 | 4 | These files should NOT be installed! 5 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/jit/dis_mipsel.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT MIPSEL disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the little-endian functions from the 8 | -- MIPS disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local require = require 12 | 13 | module(...) 14 | 15 | local dis_mips = require(_PACKAGE.."dis_mips") 16 | 17 | create = dis_mips.create_el 18 | disass = dis_mips.disass_el 19 | regname = dis_mips.regname 20 | 21 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/jit/dis_x64.lua: -------------------------------------------------------------------------------- 1 | ---------------------------------------------------------------------------- 2 | -- LuaJIT x64 disassembler wrapper module. 3 | -- 4 | -- Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | -- Released under the MIT license. See Copyright Notice in luajit.h 6 | ---------------------------------------------------------------------------- 7 | -- This module just exports the 64 bit functions from the combined 8 | -- x86/x64 disassembler module. All the interesting stuff is there. 9 | ------------------------------------------------------------------------------ 10 | 11 | local require = require 12 | 13 | module(...) 14 | 15 | local dis_x86 = require(_PACKAGE.."dis_x86") 16 | 17 | create = dis_x86.create64 18 | disass = dis_x86.disass64 19 | regname = dis_x86.regname64 20 | 21 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lib_bit.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bit manipulation library. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lib_bit_c 7 | #define LUA_LIB 8 | 9 | #include "lua.h" 10 | #include "lauxlib.h" 11 | #include "lualib.h" 12 | 13 | #include "lj_obj.h" 14 | #include "lj_err.h" 15 | #include "lj_str.h" 16 | #include "lj_lib.h" 17 | 18 | /* ------------------------------------------------------------------------ */ 19 | 20 | #define LJLIB_MODULE_bit 21 | 22 | LJLIB_ASM(bit_tobit) LJLIB_REC(bit_unary IR_TOBIT) 23 | { 24 | lj_lib_checknumber(L, 1); 25 | return FFH_RETRY; 26 | } 27 | LJLIB_ASM_(bit_bnot) LJLIB_REC(bit_unary IR_BNOT) 28 | LJLIB_ASM_(bit_bswap) LJLIB_REC(bit_unary IR_BSWAP) 29 | 30 | LJLIB_ASM(bit_lshift) LJLIB_REC(bit_shift IR_BSHL) 31 | { 32 | lj_lib_checknumber(L, 1); 33 | lj_lib_checkbit(L, 2); 34 | return FFH_RETRY; 35 | } 36 | LJLIB_ASM_(bit_rshift) LJLIB_REC(bit_shift IR_BSHR) 37 | LJLIB_ASM_(bit_arshift) LJLIB_REC(bit_shift IR_BSAR) 38 | LJLIB_ASM_(bit_rol) LJLIB_REC(bit_shift IR_BROL) 39 | LJLIB_ASM_(bit_ror) LJLIB_REC(bit_shift IR_BROR) 40 | 41 | LJLIB_ASM(bit_band) LJLIB_REC(bit_nary IR_BAND) 42 | { 43 | int i = 0; 44 | do { lj_lib_checknumber(L, ++i); } while (L->base+i < L->top); 45 | return FFH_RETRY; 46 | } 47 | LJLIB_ASM_(bit_bor) LJLIB_REC(bit_nary IR_BOR) 48 | LJLIB_ASM_(bit_bxor) LJLIB_REC(bit_nary IR_BXOR) 49 | 50 | /* ------------------------------------------------------------------------ */ 51 | 52 | LJLIB_CF(bit_tohex) 53 | { 54 | uint32_t b = (uint32_t)lj_lib_checkbit(L, 1); 55 | int32_t i, n = L->base+1 >= L->top ? 8 : lj_lib_checkbit(L, 2); 56 | const char *hexdigits = "0123456789abcdef"; 57 | char buf[8]; 58 | if (n < 0) { n = -n; hexdigits = "0123456789ABCDEF"; } 59 | if (n > 8) n = 8; 60 | for (i = n; --i >= 0; ) { buf[i] = hexdigits[b & 15]; b >>= 4; } 61 | lua_pushlstring(L, buf, (size_t)n); 62 | return 1; 63 | } 64 | 65 | /* ------------------------------------------------------------------------ */ 66 | 67 | #include "lj_libdef.h" 68 | 69 | LUALIB_API int luaopen_bit(lua_State *L) 70 | { 71 | LJ_LIB_REG(L, LUA_BITLIBNAME, bit); 72 | return 1; 73 | } 74 | 75 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lib_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Library initialization. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | ** 5 | ** Major parts taken verbatim from the Lua interpreter. 6 | ** Copyright (C) 1994-2008 Lua.org, PUC-Rio. See Copyright Notice in lua.h 7 | */ 8 | 9 | #define lib_init_c 10 | #define LUA_LIB 11 | 12 | #include "lua.h" 13 | #include "lauxlib.h" 14 | #include "lualib.h" 15 | 16 | #include "lj_arch.h" 17 | 18 | static const luaL_Reg lj_lib_load[] = { 19 | { "", luaopen_base }, 20 | { LUA_LOADLIBNAME, luaopen_package }, 21 | { LUA_TABLIBNAME, luaopen_table }, 22 | { LUA_IOLIBNAME, luaopen_io }, 23 | { LUA_OSLIBNAME, luaopen_os }, 24 | { LUA_STRLIBNAME, luaopen_string }, 25 | { LUA_MATHLIBNAME, luaopen_math }, 26 | { LUA_DBLIBNAME, luaopen_debug }, 27 | { LUA_BITLIBNAME, luaopen_bit }, 28 | { LUA_JITLIBNAME, luaopen_jit }, 29 | { NULL, NULL } 30 | }; 31 | 32 | static const luaL_Reg lj_lib_preload[] = { 33 | #if LJ_HASFFI 34 | { LUA_FFILIBNAME, luaopen_ffi }, 35 | #endif 36 | { NULL, NULL } 37 | }; 38 | 39 | LUALIB_API void luaL_openlibs(lua_State *L) 40 | { 41 | const luaL_Reg *lib; 42 | for (lib = lj_lib_load; lib->func; lib++) { 43 | lua_pushcfunction(L, lib->func); 44 | lua_pushstring(L, lib->name); 45 | lua_call(L, 1, 0); 46 | } 47 | luaL_findtable(L, LUA_REGISTRYINDEX, "_PRELOAD", 48 | sizeof(lj_lib_preload)/sizeof(lj_lib_preload[0])-1); 49 | for (lib = lj_lib_preload; lib->func; lib++) { 50 | lua_pushcfunction(L, lib->func); 51 | lua_setfield(L, -2, lib->name); 52 | } 53 | lua_pop(L, 1); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj.supp: -------------------------------------------------------------------------------- 1 | # Valgrind suppression file for LuaJIT 2.0. 2 | { 3 | Optimized string compare 4 | Memcheck:Addr4 5 | fun:lj_str_cmp 6 | } 7 | { 8 | Optimized string compare 9 | Memcheck:Addr1 10 | fun:lj_str_cmp 11 | } 12 | { 13 | Optimized string compare 14 | Memcheck:Addr4 15 | fun:lj_str_new 16 | } 17 | { 18 | Optimized string compare 19 | Memcheck:Addr1 20 | fun:lj_str_new 21 | } 22 | { 23 | Optimized string compare 24 | Memcheck:Cond 25 | fun:lj_str_new 26 | } 27 | { 28 | Optimized string compare 29 | Memcheck:Addr4 30 | fun:str_fastcmp 31 | } 32 | { 33 | Optimized string compare 34 | Memcheck:Addr1 35 | fun:str_fastcmp 36 | } 37 | { 38 | Optimized string compare 39 | Memcheck:Cond 40 | fun:str_fastcmp 41 | } 42 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_alloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bundled memory allocator. 3 | ** Donated to the public domain. 4 | */ 5 | 6 | #ifndef _LJ_ALLOC_H 7 | #define _LJ_ALLOC_H 8 | 9 | #include "lj_def.h" 10 | 11 | #ifndef LUAJIT_USE_SYSMALLOC 12 | LJ_FUNC void *lj_alloc_create(void); 13 | LJ_FUNC void lj_alloc_destroy(void *msp); 14 | LJ_FUNC void *lj_alloc_f(void *msp, void *ptr, size_t osize, size_t nsize); 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_asm.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** IR assembler (SSA IR -> machine code). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_ASM_H 7 | #define _LJ_ASM_H 8 | 9 | #include "lj_jit.h" 10 | 11 | #if LJ_HASJIT 12 | LJ_FUNC void lj_asm_trace(jit_State *J, GCtrace *T); 13 | LJ_FUNC void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, 14 | MCode *target); 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_bc.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bytecode instruction modes. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_bc_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | #include "lj_bc.h" 11 | 12 | /* Bytecode offsets and bytecode instruction modes. */ 13 | #include "lj_bcdef.h" 14 | 15 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_bcdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Bytecode dump definitions. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_BCDUMP_H 7 | #define _LJ_BCDUMP_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_lex.h" 11 | 12 | /* -- Bytecode dump format ------------------------------------------------ */ 13 | 14 | /* 15 | ** dump = header proto+ 0U 16 | ** header = ESC 'L' 'J' versionB flagsU [namelenU nameB*] 17 | ** proto = lengthU pdata 18 | ** pdata = phead bcinsW* uvdataH* kgc* knum* [debugB*] 19 | ** phead = flagsB numparamsB framesizeB numuvB numkgcU numknU numbcU 20 | ** [debuglenU [firstlineU numlineU]] 21 | ** kgc = kgctypeU { ktab | (loU hiU) | (rloU rhiU iloU ihiU) | strB* } 22 | ** knum = intU0 | (loU1 hiU) 23 | ** ktab = narrayU nhashU karray* khash* 24 | ** karray = ktabk 25 | ** khash = ktabk ktabk 26 | ** ktabk = ktabtypeU { intU | (loU hiU) | strB* } 27 | ** 28 | ** B = 8 bit, H = 16 bit, W = 32 bit, U = ULEB128 of W, U0/U1 = ULEB128 of W+1 29 | */ 30 | 31 | /* Bytecode dump header. */ 32 | #define BCDUMP_HEAD1 0x1b 33 | #define BCDUMP_HEAD2 0x4c 34 | #define BCDUMP_HEAD3 0x4a 35 | 36 | /* If you perform *any* kind of private modifications to the bytecode itself 37 | ** or to the dump format, you *must* set BCDUMP_VERSION to 0x80 or higher. 38 | */ 39 | #define BCDUMP_VERSION 1 40 | 41 | /* Compatibility flags. */ 42 | #define BCDUMP_F_BE 0x01 43 | #define BCDUMP_F_STRIP 0x02 44 | #define BCDUMP_F_FFI 0x04 45 | 46 | #define BCDUMP_F_KNOWN (BCDUMP_F_FFI*2-1) 47 | 48 | /* Type codes for the GC constants of a prototype. Plus length for strings. */ 49 | enum { 50 | BCDUMP_KGC_CHILD, BCDUMP_KGC_TAB, BCDUMP_KGC_I64, BCDUMP_KGC_U64, 51 | BCDUMP_KGC_COMPLEX, BCDUMP_KGC_STR 52 | }; 53 | 54 | /* Type codes for the keys/values of a constant table. */ 55 | enum { 56 | BCDUMP_KTAB_NIL, BCDUMP_KTAB_FALSE, BCDUMP_KTAB_TRUE, 57 | BCDUMP_KTAB_INT, BCDUMP_KTAB_NUM, BCDUMP_KTAB_STR 58 | }; 59 | 60 | /* -- Bytecode reader/writer ---------------------------------------------- */ 61 | 62 | LJ_FUNC int lj_bcwrite(lua_State *L, GCproto *pt, lua_Writer writer, 63 | void *data, int strip); 64 | LJ_FUNC GCproto *lj_bcread(LexState *ls); 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_carith.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C data arithmetic. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CARITH_H 7 | #define _LJ_CARITH_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASFFI 12 | 13 | LJ_FUNC int lj_carith_op(lua_State *L, MMS mm); 14 | 15 | #if LJ_32 && LJ_HASJIT 16 | LJ_FUNC int64_t lj_carith_mul64(int64_t x, int64_t k); 17 | #endif 18 | LJ_FUNC uint64_t lj_carith_divu64(uint64_t a, uint64_t b); 19 | LJ_FUNC int64_t lj_carith_divi64(int64_t a, int64_t b); 20 | LJ_FUNC uint64_t lj_carith_modu64(uint64_t a, uint64_t b); 21 | LJ_FUNC int64_t lj_carith_modi64(int64_t a, int64_t b); 22 | LJ_FUNC uint64_t lj_carith_powu64(uint64_t x, uint64_t k); 23 | LJ_FUNC int64_t lj_carith_powi64(int64_t x, int64_t k); 24 | 25 | #endif 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_ccallback.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FFI C callback handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CCALLBACK_H 7 | #define _LJ_CCALLBACK_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_ctype.h" 11 | 12 | #if LJ_HASFFI 13 | 14 | /* Really belongs to lj_vm.h. */ 15 | LJ_ASMF void lj_vm_ffi_callback(void); 16 | 17 | LJ_FUNC MSize lj_ccallback_ptr2slot(CTState *cts, void *p); 18 | LJ_FUNCA lua_State * LJ_FASTCALL lj_ccallback_enter(CTState *cts, void *cf); 19 | LJ_FUNCA void LJ_FASTCALL lj_ccallback_leave(CTState *cts, TValue *o); 20 | LJ_FUNC void *lj_ccallback_new(CTState *cts, CType *ct, GCfunc *fn); 21 | LJ_FUNC void lj_ccallback_mcode_free(CTState *cts); 22 | 23 | #endif 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_cconv.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C type conversions. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CCONV_H 7 | #define _LJ_CCONV_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_ctype.h" 11 | 12 | #if LJ_HASFFI 13 | 14 | /* Compressed C type index. ORDER CCX. */ 15 | enum { 16 | CCX_B, /* Bool. */ 17 | CCX_I, /* Integer. */ 18 | CCX_F, /* Floating-point number. */ 19 | CCX_C, /* Complex. */ 20 | CCX_V, /* Vector. */ 21 | CCX_P, /* Pointer. */ 22 | CCX_A, /* Refarray. */ 23 | CCX_S /* Struct/union. */ 24 | }; 25 | 26 | /* Convert C type info to compressed C type index. ORDER CT. ORDER CCX. */ 27 | static LJ_AINLINE uint32_t cconv_idx(CTInfo info) 28 | { 29 | uint32_t idx = ((info >> 26) & 15u); /* Dispatch bits. */ 30 | lua_assert(ctype_type(info) <= CT_MAYCONVERT); 31 | #if LJ_64 32 | idx = ((uint32_t)(U64x(f436fff5,fff7f021) >> 4*idx) & 15u); 33 | #else 34 | idx = (((idx < 8 ? 0xfff7f021u : 0xf436fff5) >> 4*(idx & 7u)) & 15u); 35 | #endif 36 | lua_assert(idx < 8); 37 | return idx; 38 | } 39 | 40 | #define cconv_idx2(dinfo, sinfo) \ 41 | ((cconv_idx((dinfo)) << 3) + cconv_idx((sinfo))) 42 | 43 | #define CCX(dst, src) ((CCX_##dst << 3) + CCX_##src) 44 | 45 | /* Conversion flags. */ 46 | #define CCF_CAST 0x00000001u 47 | #define CCF_FROMTV 0x00000002u 48 | #define CCF_SAME 0x00000004u 49 | #define CCF_IGNQUAL 0x00000008u 50 | 51 | #define CCF_ARG_SHIFT 8 52 | #define CCF_ARG(n) ((n) << CCF_ARG_SHIFT) 53 | #define CCF_GETARG(f) ((f) >> CCF_ARG_SHIFT) 54 | 55 | LJ_FUNC int lj_cconv_compatptr(CTState *cts, CType *d, CType *s, CTInfo flags); 56 | LJ_FUNC void lj_cconv_ct_ct(CTState *cts, CType *d, CType *s, 57 | uint8_t *dp, uint8_t *sp, CTInfo flags); 58 | LJ_FUNC int lj_cconv_tv_ct(CTState *cts, CType *s, CTypeID sid, 59 | TValue *o, uint8_t *sp); 60 | LJ_FUNC int lj_cconv_tv_bf(CTState *cts, CType *s, TValue *o, uint8_t *sp); 61 | LJ_FUNC void lj_cconv_ct_tv(CTState *cts, CType *d, 62 | uint8_t *dp, TValue *o, CTInfo flags); 63 | LJ_FUNC void lj_cconv_bf_tv(CTState *cts, CType *d, uint8_t *dp, TValue *o); 64 | LJ_FUNC int lj_cconv_multi_init(CTState *cts, CType *d, TValue *o); 65 | LJ_FUNC void lj_cconv_ct_init(CTState *cts, CType *d, CTSize sz, 66 | uint8_t *dp, TValue *o, MSize len); 67 | 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_cdata.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C data management. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CDATA_H 7 | #define _LJ_CDATA_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_gc.h" 11 | #include "lj_ctype.h" 12 | 13 | #if LJ_HASFFI 14 | 15 | /* Get C data pointer. */ 16 | static LJ_AINLINE void *cdata_getptr(void *p, CTSize sz) 17 | { 18 | if (LJ_64 && sz == 4) { /* Support 32 bit pointers on 64 bit targets. */ 19 | return ((void *)(uintptr_t)*(uint32_t *)p); 20 | } else { 21 | lua_assert(sz == CTSIZE_PTR); 22 | return *(void **)p; 23 | } 24 | } 25 | 26 | /* Set C data pointer. */ 27 | static LJ_AINLINE void cdata_setptr(void *p, CTSize sz, const void *v) 28 | { 29 | if (LJ_64 && sz == 4) { /* Support 32 bit pointers on 64 bit targets. */ 30 | *(uint32_t *)p = (uint32_t)(uintptr_t)v; 31 | } else { 32 | lua_assert(sz == CTSIZE_PTR); 33 | *(void **)p = (void *)v; 34 | } 35 | } 36 | 37 | /* Allocate fixed-size C data object. */ 38 | static LJ_AINLINE GCcdata *lj_cdata_new(CTState *cts, CTypeID id, CTSize sz) 39 | { 40 | GCcdata *cd; 41 | #ifdef LUA_USE_ASSERT 42 | CType *ct = ctype_raw(cts, id); 43 | lua_assert((ctype_hassize(ct->info) ? ct->size : CTSIZE_PTR) == sz); 44 | #endif 45 | cd = (GCcdata *)lj_mem_newgco(cts->L, sizeof(GCcdata) + sz); 46 | cd->gct = ~LJ_TCDATA; 47 | cd->ctypeid = ctype_check(cts, id); 48 | return cd; 49 | } 50 | 51 | /* Variant which works without a valid CTState. */ 52 | static LJ_AINLINE GCcdata *lj_cdata_new_(lua_State *L, CTypeID id, CTSize sz) 53 | { 54 | GCcdata *cd = (GCcdata *)lj_mem_newgco(L, sizeof(GCcdata) + sz); 55 | cd->gct = ~LJ_TCDATA; 56 | cd->ctypeid = id; 57 | return cd; 58 | } 59 | 60 | LJ_FUNC GCcdata *lj_cdata_newref(CTState *cts, const void *pp, CTypeID id); 61 | LJ_FUNC GCcdata *lj_cdata_newv(CTState *cts, CTypeID id, CTSize sz, 62 | CTSize align); 63 | 64 | LJ_FUNC void LJ_FASTCALL lj_cdata_free(global_State *g, GCcdata *cd); 65 | LJ_FUNCA TValue * LJ_FASTCALL lj_cdata_setfin(lua_State *L, GCcdata *cd); 66 | 67 | LJ_FUNC CType *lj_cdata_index(CTState *cts, GCcdata *cd, cTValue *key, 68 | uint8_t **pp, CTInfo *qual); 69 | LJ_FUNC int lj_cdata_get(CTState *cts, CType *s, TValue *o, uint8_t *sp); 70 | LJ_FUNC void lj_cdata_set(CTState *cts, CType *d, uint8_t *dp, TValue *o, 71 | CTInfo qual); 72 | 73 | #endif 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_char.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Character types. 3 | ** Donated to the public domain. 4 | ** 5 | ** This is intended to replace the problematic libc single-byte NLS functions. 6 | ** These just don't make sense anymore with UTF-8 locales becoming the norm 7 | ** on POSIX systems. It never worked too well on Windows systems since hardly 8 | ** anyone bothered to call setlocale(). 9 | ** 10 | ** This table is hardcoded for ASCII. Identifiers include the characters 11 | ** 128-255, too. This allows for the use of all non-ASCII chars as identifiers 12 | ** in the lexer. This is a broad definition, but works well in practice 13 | ** for both UTF-8 locales and most single-byte locales (such as ISO-8859-*). 14 | ** 15 | ** If you really need proper character types for UTF-8 strings, please use 16 | ** an add-on library such as slnunicode: http://luaforge.net/projects/sln/ 17 | */ 18 | 19 | #define lj_char_c 20 | #define LUA_CORE 21 | 22 | #include "lj_char.h" 23 | 24 | LJ_DATADEF const uint8_t lj_char_bits[257] = { 25 | 0, 26 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, 3, 1, 1, 27 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 28 | 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 29 | 152,152,152,152,152,152,152,152,152,152, 4, 4, 4, 4, 4, 4, 30 | 4,176,176,176,176,176,176,160,160,160,160,160,160,160,160,160, 31 | 160,160,160,160,160,160,160,160,160,160,160, 4, 4, 4, 4,132, 32 | 4,208,208,208,208,208,208,192,192,192,192,192,192,192,192,192, 33 | 192,192,192,192,192,192,192,192,192,192,192, 4, 4, 4, 4, 1, 34 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 35 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 36 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 37 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 38 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 39 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 40 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, 41 | 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128 42 | }; 43 | 44 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_char.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Character types. 3 | ** Donated to the public domain. 4 | */ 5 | 6 | #ifndef _LJ_CHAR_H 7 | #define _LJ_CHAR_H 8 | 9 | #include "lj_def.h" 10 | 11 | #define LJ_CHAR_CNTRL 0x01 12 | #define LJ_CHAR_SPACE 0x02 13 | #define LJ_CHAR_PUNCT 0x04 14 | #define LJ_CHAR_DIGIT 0x08 15 | #define LJ_CHAR_XDIGIT 0x10 16 | #define LJ_CHAR_UPPER 0x20 17 | #define LJ_CHAR_LOWER 0x40 18 | #define LJ_CHAR_IDENT 0x80 19 | #define LJ_CHAR_ALPHA (LJ_CHAR_LOWER|LJ_CHAR_UPPER) 20 | #define LJ_CHAR_ALNUM (LJ_CHAR_ALPHA|LJ_CHAR_DIGIT) 21 | #define LJ_CHAR_GRAPH (LJ_CHAR_ALNUM|LJ_CHAR_PUNCT) 22 | 23 | /* Only pass -1 or 0..255 to these macros. Never pass a signed char! */ 24 | #define lj_char_isa(c, t) ((lj_char_bits+1)[(c)] & t) 25 | #define lj_char_iscntrl(c) lj_char_isa((c), LJ_CHAR_CNTRL) 26 | #define lj_char_isspace(c) lj_char_isa((c), LJ_CHAR_SPACE) 27 | #define lj_char_ispunct(c) lj_char_isa((c), LJ_CHAR_PUNCT) 28 | #define lj_char_isdigit(c) lj_char_isa((c), LJ_CHAR_DIGIT) 29 | #define lj_char_isxdigit(c) lj_char_isa((c), LJ_CHAR_XDIGIT) 30 | #define lj_char_isupper(c) lj_char_isa((c), LJ_CHAR_UPPER) 31 | #define lj_char_islower(c) lj_char_isa((c), LJ_CHAR_LOWER) 32 | #define lj_char_isident(c) lj_char_isa((c), LJ_CHAR_IDENT) 33 | #define lj_char_isalpha(c) lj_char_isa((c), LJ_CHAR_ALPHA) 34 | #define lj_char_isalnum(c) lj_char_isa((c), LJ_CHAR_ALNUM) 35 | #define lj_char_isgraph(c) lj_char_isa((c), LJ_CHAR_GRAPH) 36 | 37 | #define lj_char_toupper(c) ((c) - (lj_char_islower(c) >> 1)) 38 | #define lj_char_tolower(c) ((c) + lj_char_isupper(c)) 39 | 40 | LJ_DATA const uint8_t lj_char_bits[257]; 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_clib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** FFI C library loader. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CLIB_H 7 | #define _LJ_CLIB_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASFFI 12 | 13 | /* Namespace for C library indexing. */ 14 | #define CLNS_INDEX ((1u<env. */ 20 | } CLibrary; 21 | 22 | LJ_FUNC TValue *lj_clib_index(lua_State *L, CLibrary *cl, GCstr *name); 23 | LJ_FUNC void lj_clib_load(lua_State *L, GCtab *mt, GCstr *name, int global); 24 | LJ_FUNC void lj_clib_unload(CLibrary *cl); 25 | LJ_FUNC void lj_clib_default(lua_State *L, GCtab *mt); 26 | 27 | #endif 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_cparse.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** C declaration parser. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CPARSE_H 7 | #define _LJ_CPARSE_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_ctype.h" 11 | 12 | #if LJ_HASFFI 13 | 14 | /* C parser limits. */ 15 | #define CPARSE_MAX_BUF 32768 /* Max. token buffer size. */ 16 | #define CPARSE_MAX_DECLSTACK 100 /* Max. declaration stack depth. */ 17 | #define CPARSE_MAX_DECLDEPTH 20 /* Max. recursive declaration depth. */ 18 | #define CPARSE_MAX_PACKSTACK 7 /* Max. pack pragma stack depth. */ 19 | 20 | /* Flags for C parser mode. */ 21 | #define CPARSE_MODE_MULTI 1 /* Process multiple declarations. */ 22 | #define CPARSE_MODE_ABSTRACT 2 /* Accept abstract declarators. */ 23 | #define CPARSE_MODE_DIRECT 4 /* Accept direct declarators. */ 24 | #define CPARSE_MODE_FIELD 8 /* Accept field width in bits, too. */ 25 | #define CPARSE_MODE_NOIMPLICIT 16 /* Reject implicit declarations. */ 26 | #define CPARSE_MODE_SKIP 32 /* Skip definitions, ignore errors. */ 27 | 28 | typedef int CPChar; /* C parser character. Unsigned ext. from char. */ 29 | typedef int CPToken; /* C parser token. */ 30 | 31 | /* C parser internal value representation. */ 32 | typedef struct CPValue { 33 | union { 34 | int32_t i32; /* Value for CTID_INT32. */ 35 | uint32_t u32; /* Value for CTID_UINT32. */ 36 | }; 37 | CTypeID id; /* C Type ID of the value. */ 38 | } CPValue; 39 | 40 | /* C parser state. */ 41 | typedef struct CPState { 42 | CPChar c; /* Current character. */ 43 | CPToken tok; /* Current token. */ 44 | CPValue val; /* Token value. */ 45 | GCstr *str; /* Interned string of identifier/keyword. */ 46 | CType *ct; /* C type table entry. */ 47 | const char *p; /* Current position in input buffer. */ 48 | SBuf sb; /* String buffer for tokens. */ 49 | lua_State *L; /* Lua state. */ 50 | CTState *cts; /* C type state. */ 51 | TValue *param; /* C type parameters. */ 52 | const char *srcname; /* Current source name. */ 53 | BCLine linenumber; /* Input line counter. */ 54 | int depth; /* Recursive declaration depth. */ 55 | uint32_t tmask; /* Type mask for next identifier. */ 56 | uint32_t mode; /* C parser mode. */ 57 | uint8_t packstack[CPARSE_MAX_PACKSTACK]; /* Stack for pack pragmas. */ 58 | uint8_t curpack; /* Current position in pack pragma stack. */ 59 | } CPState; 60 | 61 | LJ_FUNC int lj_cparse(CPState *cp); 62 | 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_crecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace recorder for C data operations. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_CRECORD_H 7 | #define _LJ_CRECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | #include "lj_ffrecord.h" 12 | 13 | #if LJ_HASJIT && LJ_HASFFI 14 | LJ_FUNC void LJ_FASTCALL recff_cdata_index(jit_State *J, RecordFFData *rd); 15 | LJ_FUNC void LJ_FASTCALL recff_cdata_call(jit_State *J, RecordFFData *rd); 16 | LJ_FUNC void LJ_FASTCALL recff_cdata_arith(jit_State *J, RecordFFData *rd); 17 | LJ_FUNC void LJ_FASTCALL recff_clib_index(jit_State *J, RecordFFData *rd); 18 | LJ_FUNC void LJ_FASTCALL recff_ffi_new(jit_State *J, RecordFFData *rd); 19 | LJ_FUNC void LJ_FASTCALL recff_ffi_errno(jit_State *J, RecordFFData *rd); 20 | LJ_FUNC void LJ_FASTCALL recff_ffi_string(jit_State *J, RecordFFData *rd); 21 | LJ_FUNC void LJ_FASTCALL recff_ffi_copy(jit_State *J, RecordFFData *rd); 22 | LJ_FUNC void LJ_FASTCALL recff_ffi_fill(jit_State *J, RecordFFData *rd); 23 | LJ_FUNC void LJ_FASTCALL recff_ffi_typeof(jit_State *J, RecordFFData *rd); 24 | LJ_FUNC void LJ_FASTCALL recff_ffi_istype(jit_State *J, RecordFFData *rd); 25 | LJ_FUNC void LJ_FASTCALL recff_ffi_abi(jit_State *J, RecordFFData *rd); 26 | LJ_FUNC void LJ_FASTCALL recff_ffi_xof(jit_State *J, RecordFFData *rd); 27 | LJ_FUNC void LJ_FASTCALL recff_ffi_gc(jit_State *J, RecordFFData *rd); 28 | LJ_FUNC void LJ_FASTCALL lj_crecord_tonumber(jit_State *J, RecordFFData *rd); 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Debugging and introspection. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_DEBUG_H 7 | #define _LJ_DEBUG_H 8 | 9 | #include "lj_obj.h" 10 | 11 | typedef struct lj_Debug { 12 | /* Common fields. Must be in the same order as in lua.h. */ 13 | int event; 14 | const char *name; 15 | const char *namewhat; 16 | const char *what; 17 | const char *source; 18 | int currentline; 19 | int nups; 20 | int linedefined; 21 | int lastlinedefined; 22 | char short_src[LUA_IDSIZE]; 23 | int i_ci; 24 | /* Extended fields. Only valid if lj_debug_getinfo() is called with ext = 1.*/ 25 | int nparams; 26 | int isvararg; 27 | } lj_Debug; 28 | 29 | LJ_FUNC cTValue *lj_debug_frame(lua_State *L, int level, int *size); 30 | LJ_FUNC BCLine LJ_FASTCALL lj_debug_line(GCproto *pt, BCPos pc); 31 | LJ_FUNC const char *lj_debug_uvname(GCproto *pt, uint32_t idx); 32 | LJ_FUNC const char *lj_debug_uvnamev(cTValue *o, uint32_t idx, TValue **tvp); 33 | LJ_FUNC const char *lj_debug_slotname(GCproto *pt, const BCIns *pc, 34 | BCReg slot, const char **name); 35 | LJ_FUNC const char *lj_debug_funcname(lua_State *L, TValue *frame, 36 | const char **name); 37 | LJ_FUNC void lj_debug_shortname(char *out, GCstr *str); 38 | LJ_FUNC void lj_debug_addloc(lua_State *L, const char *msg, 39 | cTValue *frame, cTValue *nextframe); 40 | LJ_FUNC void lj_debug_pushloc(lua_State *L, GCproto *pt, BCPos pc); 41 | LJ_FUNC int lj_debug_getinfo(lua_State *L, const char *what, lj_Debug *ar, 42 | int ext); 43 | 44 | /* Fixed internal variable names. */ 45 | #define VARNAMEDEF(_) \ 46 | _(FOR_IDX, "(for index)") \ 47 | _(FOR_STOP, "(for limit)") \ 48 | _(FOR_STEP, "(for step)") \ 49 | _(FOR_GEN, "(for generator)") \ 50 | _(FOR_STATE, "(for state)") \ 51 | _(FOR_CTL, "(for control)") 52 | 53 | enum { 54 | VARNAME_END, 55 | #define VARNAMEENUM(name, str) VARNAME_##name, 56 | VARNAMEDEF(VARNAMEENUM) 57 | #undef VARNAMEENUM 58 | VARNAME__MAX 59 | }; 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_err.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Error handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_ERR_H 7 | #define _LJ_ERR_H 8 | 9 | #include 10 | 11 | #include "lj_obj.h" 12 | 13 | typedef enum { 14 | #define ERRDEF(name, msg) \ 15 | LJ_ERR_##name, LJ_ERR_##name##_ = LJ_ERR_##name + sizeof(msg)-1, 16 | #include "lj_errmsg.h" 17 | LJ_ERR__MAX 18 | } ErrMsg; 19 | 20 | LJ_DATA const char *lj_err_allmsg; 21 | #define err2msg(em) (lj_err_allmsg+(int)(em)) 22 | 23 | LJ_FUNC GCstr *lj_err_str(lua_State *L, ErrMsg em); 24 | LJ_FUNCA_NORET void LJ_FASTCALL lj_err_throw(lua_State *L, int errcode); 25 | LJ_FUNC_NORET void lj_err_mem(lua_State *L); 26 | LJ_FUNC_NORET void lj_err_run(lua_State *L); 27 | LJ_FUNC_NORET void lj_err_msg(lua_State *L, ErrMsg em); 28 | LJ_FUNC_NORET void lj_err_lex(lua_State *L, GCstr *src, const char *tok, 29 | BCLine line, ErrMsg em, va_list argp); 30 | LJ_FUNC_NORET void lj_err_optype(lua_State *L, cTValue *o, ErrMsg opm); 31 | LJ_FUNC_NORET void lj_err_comp(lua_State *L, cTValue *o1, cTValue *o2); 32 | LJ_FUNC_NORET void lj_err_optype_call(lua_State *L, TValue *o); 33 | LJ_FUNC_NORET void lj_err_callermsg(lua_State *L, const char *msg); 34 | LJ_FUNC_NORET void lj_err_callerv(lua_State *L, ErrMsg em, ...); 35 | LJ_FUNC_NORET void lj_err_caller(lua_State *L, ErrMsg em); 36 | LJ_FUNC_NORET void lj_err_arg(lua_State *L, int narg, ErrMsg em); 37 | LJ_FUNC_NORET void lj_err_argv(lua_State *L, int narg, ErrMsg em, ...); 38 | LJ_FUNC_NORET void lj_err_argtype(lua_State *L, int narg, const char *xname); 39 | LJ_FUNC_NORET void lj_err_argt(lua_State *L, int narg, int tt); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_ff.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Fast function IDs. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FF_H 7 | #define _LJ_FF_H 8 | 9 | /* Fast function ID. */ 10 | typedef enum { 11 | FF_LUA_ = FF_LUA, /* Lua function (must be 0). */ 12 | FF_C_ = FF_C, /* Regular C function (must be 1). */ 13 | #define FFDEF(name) FF_##name, 14 | #include "lj_ffdef.h" 15 | FF__MAX 16 | } FastFunc; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_ffrecord.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Fast function call recorder. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FFRECORD_H 7 | #define _LJ_FFRECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | /* Data used by handlers to record a fast function. */ 14 | typedef struct RecordFFData { 15 | TValue *argv; /* Runtime argument values. */ 16 | ptrdiff_t nres; /* Number of returned results (defaults to 1). */ 17 | uint32_t data; /* Per-ffid auxiliary data (opcode, literal etc.). */ 18 | } RecordFFData; 19 | 20 | LJ_FUNC int32_t lj_ffrecord_select_mode(jit_State *J, TRef tr, TValue *tv); 21 | LJ_FUNC void lj_ffrecord_func(jit_State *J); 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_func.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Function handling (prototypes, functions and upvalues). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_FUNC_H 7 | #define _LJ_FUNC_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Prototypes. */ 12 | LJ_FUNC void LJ_FASTCALL lj_func_freeproto(global_State *g, GCproto *pt); 13 | 14 | /* Upvalues. */ 15 | LJ_FUNCA void LJ_FASTCALL lj_func_closeuv(lua_State *L, TValue *level); 16 | LJ_FUNC void LJ_FASTCALL lj_func_freeuv(global_State *g, GCupval *uv); 17 | 18 | /* Functions (closures). */ 19 | LJ_FUNC GCfunc *lj_func_newC(lua_State *L, MSize nelems, GCtab *env); 20 | LJ_FUNC GCfunc *lj_func_newL_empty(lua_State *L, GCproto *pt, GCtab *env); 21 | LJ_FUNCA GCfunc *lj_func_newL_gc(lua_State *L, GCproto *pt, GCfuncL *parent); 22 | LJ_FUNC void LJ_FASTCALL lj_func_free(global_State *g, GCfunc *c); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_gdbjit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Client for the GDB JIT API. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_GDBJIT_H 7 | #define _LJ_GDBJIT_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT && defined(LUAJIT_USE_GDBJIT) 13 | 14 | LJ_FUNC void lj_gdbjit_addtrace(jit_State *J, GCtrace *T); 15 | LJ_FUNC void lj_gdbjit_deltrace(jit_State *J, GCtrace *T); 16 | 17 | #else 18 | #define lj_gdbjit_addtrace(J, T) UNUSED(T) 19 | #define lj_gdbjit_deltrace(J, T) UNUSED(T) 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_mcode.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Machine code management. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_MCODE_H 7 | #define _LJ_MCODE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT || LJ_HASFFI 12 | LJ_FUNC void lj_mcode_sync(void *start, void *end); 13 | #endif 14 | 15 | #if LJ_HASJIT 16 | 17 | #include "lj_jit.h" 18 | 19 | LJ_FUNC void lj_mcode_free(jit_State *J); 20 | LJ_FUNC MCode *lj_mcode_reserve(jit_State *J, MCode **lim); 21 | LJ_FUNC void lj_mcode_commit(jit_State *J, MCode *m); 22 | LJ_FUNC void lj_mcode_abort(jit_State *J); 23 | LJ_FUNC MCode *lj_mcode_patch(jit_State *J, MCode *ptr, int finish); 24 | LJ_FUNC_NORET void lj_mcode_limiterr(jit_State *J, size_t need); 25 | 26 | #define lj_mcode_commitbot(J, m) (J->mcbot = (m)) 27 | 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_meta.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Metamethod handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_META_H 7 | #define _LJ_META_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Metamethod handling */ 12 | LJ_FUNC void lj_meta_init(lua_State *L); 13 | LJ_FUNC cTValue *lj_meta_cache(GCtab *mt, MMS mm, GCstr *name); 14 | LJ_FUNC cTValue *lj_meta_lookup(lua_State *L, cTValue *o, MMS mm); 15 | #if LJ_HASFFI 16 | LJ_FUNC int lj_meta_tailcall(lua_State *L, cTValue *tv); 17 | #endif 18 | 19 | #define lj_meta_fastg(g, mt, mm) \ 20 | ((mt) == NULL ? NULL : ((mt)->nomm & (1u<<(mm))) ? NULL : \ 21 | lj_meta_cache(mt, mm, mmname_str(g, mm))) 22 | #define lj_meta_fast(L, mt, mm) lj_meta_fastg(G(L), mt, mm) 23 | 24 | /* C helpers for some instructions, called from assembler VM. */ 25 | LJ_FUNCA cTValue *lj_meta_tget(lua_State *L, cTValue *o, cTValue *k); 26 | LJ_FUNCA TValue *lj_meta_tset(lua_State *L, cTValue *o, cTValue *k); 27 | LJ_FUNCA TValue *lj_meta_arith(lua_State *L, TValue *ra, cTValue *rb, 28 | cTValue *rc, BCReg op); 29 | LJ_FUNCA TValue *lj_meta_cat(lua_State *L, TValue *top, int left); 30 | LJ_FUNCA TValue * LJ_FASTCALL lj_meta_len(lua_State *L, cTValue *o); 31 | LJ_FUNCA TValue *lj_meta_equal(lua_State *L, GCobj *o1, GCobj *o2, int ne); 32 | LJ_FUNCA TValue * LJ_FASTCALL lj_meta_equal_cd(lua_State *L, BCIns ins); 33 | LJ_FUNCA TValue *lj_meta_comp(lua_State *L, cTValue *o1, cTValue *o2, int op); 34 | LJ_FUNCA void lj_meta_call(lua_State *L, TValue *func, TValue *top); 35 | LJ_FUNCA void LJ_FASTCALL lj_meta_for(lua_State *L, TValue *o); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_obj.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Miscellaneous object handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_obj_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Object type names. */ 12 | LJ_DATADEF const char *const lj_obj_typename[] = { /* ORDER LUA_T */ 13 | "no value", "nil", "boolean", "userdata", "number", "string", 14 | "table", "function", "userdata", "thread", "proto", "cdata" 15 | }; 16 | 17 | LJ_DATADEF const char *const lj_obj_itypename[] = { /* ORDER LJ_T */ 18 | "nil", "boolean", "boolean", "userdata", "string", "upval", "thread", 19 | "proto", "function", "trace", "cdata", "table", "userdata", "number" 20 | }; 21 | 22 | /* Compare two objects without calling metamethods. */ 23 | int lj_obj_equal(cTValue *o1, cTValue *o2) 24 | { 25 | if (itype(o1) == itype(o2)) { 26 | if (tvispri(o1)) 27 | return 1; 28 | if (!tvisnum(o1)) 29 | return gcrefeq(o1->gcr, o2->gcr); 30 | } else if (!tvisnumber(o1) || !tvisnumber(o2)) { 31 | return 0; 32 | } 33 | return numberVnum(o1) == numberVnum(o2); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_opt_dce.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** DCE: Dead Code Elimination. Pre-LOOP only -- ASM already performs DCE. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_opt_dce_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT 12 | 13 | #include "lj_ir.h" 14 | #include "lj_jit.h" 15 | #include "lj_iropt.h" 16 | 17 | /* Some local macros to save typing. Undef'd at the end. */ 18 | #define IR(ref) (&J->cur.ir[(ref)]) 19 | 20 | /* Scan through all snapshots and mark all referenced instructions. */ 21 | static void dce_marksnap(jit_State *J) 22 | { 23 | SnapNo i, nsnap = J->cur.nsnap; 24 | for (i = 0; i < nsnap; i++) { 25 | SnapShot *snap = &J->cur.snap[i]; 26 | SnapEntry *map = &J->cur.snapmap[snap->mapofs]; 27 | MSize n, nent = snap->nent; 28 | for (n = 0; n < nent; n++) { 29 | IRRef ref = snap_ref(map[n]); 30 | if (ref >= REF_FIRST) 31 | irt_setmark(IR(ref)->t); 32 | } 33 | } 34 | } 35 | 36 | /* Backwards propagate marks. Replace unused instructions with NOPs. */ 37 | static void dce_propagate(jit_State *J) 38 | { 39 | IRRef1 *pchain[IR__MAX]; 40 | IRRef ins; 41 | uint32_t i; 42 | for (i = 0; i < IR__MAX; i++) pchain[i] = &J->chain[i]; 43 | for (ins = J->cur.nins-1; ins >= REF_FIRST; ins--) { 44 | IRIns *ir = IR(ins); 45 | if (irt_ismarked(ir->t)) { 46 | irt_clearmark(ir->t); 47 | pchain[ir->o] = &ir->prev; 48 | } else if (!ir_sideeff(ir)) { 49 | *pchain[ir->o] = ir->prev; /* Reroute original instruction chain. */ 50 | ir->t.irt = IRT_NIL; 51 | ir->o = IR_NOP; /* Replace instruction with NOP. */ 52 | ir->op1 = ir->op2 = 0; 53 | ir->prev = 0; 54 | continue; 55 | } 56 | if (ir->op1 >= REF_FIRST) irt_setmark(IR(ir->op1)->t); 57 | if (ir->op2 >= REF_FIRST) irt_setmark(IR(ir->op2)->t); 58 | } 59 | } 60 | 61 | /* Dead Code Elimination. 62 | ** 63 | ** First backpropagate marks for all used instructions. Then replace 64 | ** the unused ones with a NOP. Note that compressing the IR to eliminate 65 | ** the NOPs does not pay off. 66 | */ 67 | void lj_opt_dce(jit_State *J) 68 | { 69 | if ((J->flags & JIT_F_OPT_DCE)) { 70 | dce_marksnap(J); 71 | dce_propagate(J); 72 | memset(J->bpropcache, 0, sizeof(J->bpropcache)); /* Invalidate cache. */ 73 | } 74 | } 75 | 76 | #undef IR 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_parse.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Lua parser (source code -> bytecode). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_PARSE_H 7 | #define _LJ_PARSE_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_lex.h" 11 | 12 | LJ_FUNC GCproto *lj_parse(LexState *ls); 13 | LJ_FUNC GCstr *lj_parse_keepstr(LexState *ls, const char *str, size_t l); 14 | #if LJ_HASFFI 15 | LJ_FUNC void lj_parse_keepcdata(LexState *ls, TValue *tv, GCcdata *cd); 16 | #endif 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_record.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace recorder (bytecode -> SSA IR). 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_RECORD_H 7 | #define _LJ_RECORD_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | /* Context for recording an indexed load/store. */ 14 | typedef struct RecordIndex { 15 | TValue tabv; /* Runtime value of table (or indexed object). */ 16 | TValue keyv; /* Runtime value of key. */ 17 | TValue valv; /* Runtime value of stored value. */ 18 | TValue mobjv; /* Runtime value of metamethod object. */ 19 | GCtab *mtv; /* Runtime value of metatable object. */ 20 | cTValue *oldv; /* Runtime value of previously stored value. */ 21 | TRef tab; /* Table (or indexed object) reference. */ 22 | TRef key; /* Key reference. */ 23 | TRef val; /* Value reference for a store or 0 for a load. */ 24 | TRef mt; /* Metatable reference. */ 25 | TRef mobj; /* Metamethod object reference. */ 26 | int idxchain; /* Index indirections left or 0 for raw lookup. */ 27 | } RecordIndex; 28 | 29 | LJ_FUNC int lj_record_objcmp(jit_State *J, TRef a, TRef b, 30 | cTValue *av, cTValue *bv); 31 | LJ_FUNC TRef lj_record_constify(jit_State *J, cTValue *o); 32 | 33 | LJ_FUNC void lj_record_call(jit_State *J, BCReg func, ptrdiff_t nargs); 34 | LJ_FUNC void lj_record_tailcall(jit_State *J, BCReg func, ptrdiff_t nargs); 35 | LJ_FUNC void lj_record_ret(jit_State *J, BCReg rbase, ptrdiff_t gotresults); 36 | 37 | LJ_FUNC int lj_record_mm_lookup(jit_State *J, RecordIndex *ix, MMS mm); 38 | LJ_FUNC TRef lj_record_idx(jit_State *J, RecordIndex *ix); 39 | 40 | LJ_FUNC void lj_record_ins(jit_State *J); 41 | LJ_FUNC void lj_record_setup(jit_State *J); 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_snap.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Snapshot handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_SNAP_H 7 | #define _LJ_SNAP_H 8 | 9 | #include "lj_obj.h" 10 | #include "lj_jit.h" 11 | 12 | #if LJ_HASJIT 13 | LJ_FUNC void lj_snap_add(jit_State *J); 14 | LJ_FUNC void lj_snap_purge(jit_State *J); 15 | LJ_FUNC void lj_snap_shrink(jit_State *J); 16 | LJ_FUNC IRIns *lj_snap_regspmap(GCtrace *T, SnapNo snapno, IRIns *ir); 17 | LJ_FUNC void lj_snap_replay(jit_State *J, GCtrace *T); 18 | LJ_FUNC const BCIns *lj_snap_restore(jit_State *J, void *exptr); 19 | LJ_FUNC void lj_snap_grow_buf_(jit_State *J, MSize need); 20 | LJ_FUNC void lj_snap_grow_map_(jit_State *J, MSize need); 21 | 22 | static LJ_AINLINE void lj_snap_grow_buf(jit_State *J, MSize need) 23 | { 24 | if (LJ_UNLIKELY(need > J->sizesnap)) lj_snap_grow_buf_(J, need); 25 | } 26 | 27 | static LJ_AINLINE void lj_snap_grow_map(jit_State *J, MSize need) 28 | { 29 | if (LJ_UNLIKELY(need > J->sizesnapmap)) lj_snap_grow_map_(J, need); 30 | } 31 | 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_state.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** State and stack handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STATE_H 7 | #define _LJ_STATE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #define incr_top(L) \ 12 | (++L->top >= tvref(L->maxstack) && (lj_state_growstack1(L), 0)) 13 | 14 | #define savestack(L, p) ((char *)(p) - mref(L->stack, char)) 15 | #define restorestack(L, n) ((TValue *)(mref(L->stack, char) + (n))) 16 | 17 | LJ_FUNC void lj_state_relimitstack(lua_State *L); 18 | LJ_FUNC void lj_state_shrinkstack(lua_State *L, MSize used); 19 | LJ_FUNCA void LJ_FASTCALL lj_state_growstack(lua_State *L, MSize need); 20 | LJ_FUNC void LJ_FASTCALL lj_state_growstack1(lua_State *L); 21 | 22 | static LJ_AINLINE void lj_state_checkstack(lua_State *L, MSize need) 23 | { 24 | if ((mref(L->maxstack, char) - (char *)L->top) <= 25 | (ptrdiff_t)need*(ptrdiff_t)sizeof(TValue)) 26 | lj_state_growstack(L, need); 27 | } 28 | 29 | LJ_FUNC lua_State *lj_state_new(lua_State *L); 30 | LJ_FUNC void LJ_FASTCALL lj_state_free(global_State *g, lua_State *L); 31 | #if LJ_64 32 | LJ_FUNC lua_State *lj_state_newstate(lua_Alloc f, void *ud); 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_str.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** String handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STR_H 7 | #define _LJ_STR_H 8 | 9 | #include 10 | 11 | #include "lj_obj.h" 12 | 13 | /* String interning. */ 14 | LJ_FUNC int32_t LJ_FASTCALL lj_str_cmp(GCstr *a, GCstr *b); 15 | LJ_FUNC void lj_str_resize(lua_State *L, MSize newmask); 16 | LJ_FUNCA GCstr *lj_str_new(lua_State *L, const char *str, size_t len); 17 | LJ_FUNC void LJ_FASTCALL lj_str_free(global_State *g, GCstr *s); 18 | 19 | #define lj_str_newz(L, s) (lj_str_new(L, s, strlen(s))) 20 | #define lj_str_newlit(L, s) (lj_str_new(L, "" s, sizeof(s)-1)) 21 | 22 | /* Type conversions. */ 23 | LJ_FUNC size_t LJ_FASTCALL lj_str_bufnum(char *s, cTValue *o); 24 | LJ_FUNC char * LJ_FASTCALL lj_str_bufint(char *p, int32_t k); 25 | LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnum(lua_State *L, const lua_Number *np); 26 | LJ_FUNC GCstr * LJ_FASTCALL lj_str_fromint(lua_State *L, int32_t k); 27 | LJ_FUNCA GCstr * LJ_FASTCALL lj_str_fromnumber(lua_State *L, cTValue *o); 28 | 29 | #define LJ_STR_INTBUF (1+10) 30 | #define LJ_STR_NUMBUF LUAI_MAXNUMBER2STR 31 | 32 | /* String formatting. */ 33 | LJ_FUNC const char *lj_str_pushvf(lua_State *L, const char *fmt, va_list argp); 34 | LJ_FUNC const char *lj_str_pushf(lua_State *L, const char *fmt, ...) 35 | #if defined(__GNUC__) 36 | __attribute__ ((format (printf, 2, 3))) 37 | #endif 38 | ; 39 | 40 | /* Resizable string buffers. Struct definition in lj_obj.h. */ 41 | LJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz); 42 | 43 | #define lj_str_initbuf(sb) ((sb)->buf = NULL, (sb)->sz = 0) 44 | #define lj_str_resetbuf(sb) ((sb)->n = 0) 45 | #define lj_str_resizebuf(L, sb, size) \ 46 | ((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \ 47 | (sb)->sz = (size)) 48 | #define lj_str_freebuf(g, sb) lj_mem_free(g, (void *)(sb)->buf, (sb)->sz) 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_strscan.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** String scanning. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_STRSCAN_H 7 | #define _LJ_STRSCAN_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Options for accepted/returned formats. */ 12 | #define STRSCAN_OPT_TOINT 0x01 /* Convert to int32_t, if possible. */ 13 | #define STRSCAN_OPT_TONUM 0x02 /* Always convert to double. */ 14 | #define STRSCAN_OPT_IMAG 0x04 15 | #define STRSCAN_OPT_LL 0x08 16 | #define STRSCAN_OPT_C 0x10 17 | 18 | /* Returned format. */ 19 | typedef enum { 20 | STRSCAN_ERROR, 21 | STRSCAN_NUM, STRSCAN_IMAG, 22 | STRSCAN_INT, STRSCAN_U32, STRSCAN_I64, STRSCAN_U64, 23 | } StrScanFmt; 24 | 25 | LJ_FUNC StrScanFmt lj_strscan_scan(const uint8_t *p, TValue *o, uint32_t opt); 26 | LJ_FUNC int LJ_FASTCALL lj_strscan_num(GCstr *str, TValue *o); 27 | #if LJ_DUALNUM 28 | LJ_FUNC int LJ_FASTCALL lj_strscan_number(GCstr *str, TValue *o); 29 | #else 30 | #define lj_strscan_number(s, o) lj_strscan_num((s), (o)) 31 | #endif 32 | 33 | /* Check for number or convert string to number/int in-place (!). */ 34 | static LJ_AINLINE int lj_strscan_numberobj(TValue *o) 35 | { 36 | return tvisnumber(o) || (tvisstr(o) && lj_strscan_number(strV(o), o)); 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_tab.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Table handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_TAB_H 7 | #define _LJ_TAB_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Hash constants. Tuned using a brute force search. */ 12 | #define HASH_BIAS (-0x04c11db7) 13 | #define HASH_ROT1 14 14 | #define HASH_ROT2 5 15 | #define HASH_ROT3 13 16 | 17 | /* Scramble the bits of numbers and pointers. */ 18 | static LJ_AINLINE uint32_t hashrot(uint32_t lo, uint32_t hi) 19 | { 20 | #if LJ_TARGET_X86ORX64 21 | /* Prefer variant that compiles well for a 2-operand CPU. */ 22 | lo ^= hi; hi = lj_rol(hi, HASH_ROT1); 23 | lo -= hi; hi = lj_rol(hi, HASH_ROT2); 24 | hi ^= lo; hi -= lj_rol(lo, HASH_ROT3); 25 | #else 26 | lo ^= hi; 27 | lo = lo - lj_rol(hi, HASH_ROT1); 28 | hi = lo ^ lj_rol(hi, HASH_ROT1 + HASH_ROT2); 29 | hi = hi - lj_rol(lo, HASH_ROT3); 30 | #endif 31 | return hi; 32 | } 33 | 34 | #define hsize2hbits(s) ((s) ? ((s)==1 ? 1 : 1+lj_fls((uint32_t)((s)-1))) : 0) 35 | 36 | LJ_FUNCA GCtab *lj_tab_new(lua_State *L, uint32_t asize, uint32_t hbits); 37 | #if LJ_HASJIT 38 | LJ_FUNC GCtab * LJ_FASTCALL lj_tab_new1(lua_State *L, uint32_t ahsize); 39 | #endif 40 | LJ_FUNCA GCtab * LJ_FASTCALL lj_tab_dup(lua_State *L, const GCtab *kt); 41 | LJ_FUNC void LJ_FASTCALL lj_tab_free(global_State *g, GCtab *t); 42 | #if LJ_HASFFI 43 | LJ_FUNC void lj_tab_rehash(lua_State *L, GCtab *t); 44 | #endif 45 | LJ_FUNCA void lj_tab_reasize(lua_State *L, GCtab *t, uint32_t nasize); 46 | 47 | /* Caveat: all getters except lj_tab_get() can return NULL! */ 48 | 49 | LJ_FUNCA cTValue * LJ_FASTCALL lj_tab_getinth(GCtab *t, int32_t key); 50 | LJ_FUNC cTValue *lj_tab_getstr(GCtab *t, GCstr *key); 51 | LJ_FUNCA cTValue *lj_tab_get(lua_State *L, GCtab *t, cTValue *key); 52 | 53 | /* Caveat: all setters require a write barrier for the stored value. */ 54 | 55 | LJ_FUNCA TValue *lj_tab_newkey(lua_State *L, GCtab *t, cTValue *key); 56 | LJ_FUNC TValue *lj_tab_setinth(lua_State *L, GCtab *t, int32_t key); 57 | LJ_FUNC TValue *lj_tab_setstr(lua_State *L, GCtab *t, GCstr *key); 58 | LJ_FUNC TValue *lj_tab_set(lua_State *L, GCtab *t, cTValue *key); 59 | 60 | #define inarray(t, key) ((MSize)(key) < (MSize)(t)->asize) 61 | #define arrayslot(t, i) (&tvref((t)->array)[(i)]) 62 | #define lj_tab_getint(t, key) \ 63 | (inarray((t), (key)) ? arrayslot((t), (key)) : lj_tab_getinth((t), (key))) 64 | #define lj_tab_setint(L, t, key) \ 65 | (inarray((t), (key)) ? arrayslot((t), (key)) : lj_tab_setinth(L, (t), (key))) 66 | 67 | LJ_FUNCA int lj_tab_next(lua_State *L, GCtab *t, TValue *key); 68 | LJ_FUNCA MSize LJ_FASTCALL lj_tab_len(GCtab *t); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace management. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_TRACE_H 7 | #define _LJ_TRACE_H 8 | 9 | #include "lj_obj.h" 10 | 11 | #if LJ_HASJIT 12 | #include "lj_jit.h" 13 | #include "lj_dispatch.h" 14 | 15 | /* Trace errors. */ 16 | typedef enum { 17 | #define TREDEF(name, msg) LJ_TRERR_##name, 18 | #include "lj_traceerr.h" 19 | LJ_TRERR__MAX 20 | } TraceError; 21 | 22 | LJ_FUNC_NORET void lj_trace_err(jit_State *J, TraceError e); 23 | LJ_FUNC_NORET void lj_trace_err_info(jit_State *J, TraceError e); 24 | 25 | /* Trace management. */ 26 | LJ_FUNC void LJ_FASTCALL lj_trace_free(global_State *g, GCtrace *T); 27 | LJ_FUNC void lj_trace_reenableproto(GCproto *pt); 28 | LJ_FUNC void lj_trace_flushproto(global_State *g, GCproto *pt); 29 | LJ_FUNC void lj_trace_flush(jit_State *J, TraceNo traceno); 30 | LJ_FUNC int lj_trace_flushall(lua_State *L); 31 | LJ_FUNC void lj_trace_initstate(global_State *g); 32 | LJ_FUNC void lj_trace_freestate(global_State *g); 33 | 34 | /* Event handling. */ 35 | LJ_FUNC void lj_trace_ins(jit_State *J, const BCIns *pc); 36 | LJ_FUNCA void LJ_FASTCALL lj_trace_hot(jit_State *J, const BCIns *pc); 37 | LJ_FUNCA int LJ_FASTCALL lj_trace_exit(jit_State *J, void *exptr); 38 | 39 | /* Signal asynchronous abort of trace or end of trace. */ 40 | #define lj_trace_abort(g) (G2J(g)->state &= ~LJ_TRACE_ACTIVE) 41 | #define lj_trace_end(J) (J->state = LJ_TRACE_END) 42 | 43 | #else 44 | 45 | #define lj_trace_flushall(L) (UNUSED(L), 0) 46 | #define lj_trace_initstate(g) UNUSED(g) 47 | #define lj_trace_freestate(g) UNUSED(g) 48 | #define lj_trace_abort(g) UNUSED(g) 49 | #define lj_trace_end(J) UNUSED(J) 50 | 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_traceerr.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Trace compiler error messages. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | /* This file may be included multiple times with different TREDEF macros. */ 7 | 8 | /* Recording. */ 9 | TREDEF(RECERR, "error thrown or hook called during recording") 10 | TREDEF(TRACEOV, "trace too long") 11 | TREDEF(STACKOV, "trace too deep") 12 | TREDEF(SNAPOV, "too many snapshots") 13 | TREDEF(BLACKL, "blacklisted") 14 | TREDEF(NYIBC, "NYI: bytecode %d") 15 | 16 | /* Recording loop ops. */ 17 | TREDEF(LLEAVE, "leaving loop in root trace") 18 | TREDEF(LINNER, "inner loop in root trace") 19 | TREDEF(LUNROLL, "loop unroll limit reached") 20 | 21 | /* Recording calls/returns. */ 22 | TREDEF(BADTYPE, "bad argument type") 23 | TREDEF(CJITOFF, "JIT compilation disabled for function") 24 | TREDEF(CUNROLL, "call unroll limit reached") 25 | TREDEF(DOWNREC, "down-recursion, restarting") 26 | TREDEF(NYICF, "NYI: C function %s") 27 | TREDEF(NYIFF, "NYI: FastFunc %s") 28 | TREDEF(NYIFFU, "NYI: unsupported variant of FastFunc %s") 29 | TREDEF(NYIRETL, "NYI: return to lower frame") 30 | 31 | /* Recording indexed load/store. */ 32 | TREDEF(STORENN, "store with nil or NaN key") 33 | TREDEF(NOMM, "missing metamethod") 34 | TREDEF(IDXLOOP, "looping index lookup") 35 | TREDEF(NYITMIX, "NYI: mixed sparse/dense table") 36 | 37 | /* Recording C data operations. */ 38 | TREDEF(NOCACHE, "symbol not in cache") 39 | TREDEF(NYICONV, "NYI: unsupported C type conversion") 40 | TREDEF(NYICALL, "NYI: unsupported C function type") 41 | 42 | /* Optimizations. */ 43 | TREDEF(GFAIL, "guard would always fail") 44 | TREDEF(PHIOV, "too many PHIs") 45 | TREDEF(TYPEINS, "persistent type instability") 46 | 47 | /* Assembler. */ 48 | TREDEF(MCODEAL, "failed to allocate mcode memory") 49 | TREDEF(MCODEOV, "machine code too long") 50 | TREDEF(MCODELM, "hit mcode limit (retrying)") 51 | TREDEF(SPILLOV, "too many spill slots") 52 | TREDEF(BADRA, "inconsistent register allocation") 53 | TREDEF(NYIIR, "NYI: cannot assemble IR instruction %d") 54 | TREDEF(NYIPHI, "NYI: PHI shuffling too complex") 55 | TREDEF(NYICOAL, "NYI: register coalescing too complex") 56 | 57 | #undef TREDEF 58 | 59 | /* Detecting unused error messages: 60 | awk -F, '/^TREDEF/ { gsub(/TREDEF./, ""); printf "grep -q LJ_TRERR_%s *.[ch] || echo %s\n", $1, $1}' lj_traceerr.h | sh 61 | */ 62 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_udata.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** Userdata handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #define lj_udata_c 7 | #define LUA_CORE 8 | 9 | #include "lj_obj.h" 10 | #include "lj_gc.h" 11 | #include "lj_udata.h" 12 | 13 | GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env) 14 | { 15 | GCudata *ud = lj_mem_newt(L, sizeof(GCudata) + sz, GCudata); 16 | global_State *g = G(L); 17 | newwhite(g, ud); /* Not finalized. */ 18 | ud->gct = ~LJ_TUDATA; 19 | ud->udtype = UDTYPE_USERDATA; 20 | ud->len = sz; 21 | /* NOBARRIER: The GCudata is new (marked white). */ 22 | setgcrefnull(ud->metatable); 23 | setgcref(ud->env, obj2gco(env)); 24 | /* Chain to userdata list (after main thread). */ 25 | setgcrefr(ud->nextgc, mainthread(g)->nextgc); 26 | setgcref(mainthread(g)->nextgc, obj2gco(ud)); 27 | return ud; 28 | } 29 | 30 | void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud) 31 | { 32 | lj_mem_free(g, ud, sizeudata(ud)); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_udata.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Userdata handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_UDATA_H 7 | #define _LJ_UDATA_H 8 | 9 | #include "lj_obj.h" 10 | 11 | LJ_FUNC GCudata *lj_udata_new(lua_State *L, MSize sz, GCtab *env); 12 | LJ_FUNC void LJ_FASTCALL lj_udata_free(global_State *g, GCudata *ud); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_vmevent.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** VM event handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #include 7 | 8 | #define lj_vmevent_c 9 | #define LUA_CORE 10 | 11 | #include "lj_obj.h" 12 | #include "lj_str.h" 13 | #include "lj_tab.h" 14 | #include "lj_state.h" 15 | #include "lj_dispatch.h" 16 | #include "lj_vm.h" 17 | #include "lj_vmevent.h" 18 | 19 | ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev) 20 | { 21 | global_State *g = G(L); 22 | GCstr *s = lj_str_newlit(L, LJ_VMEVENTS_REGKEY); 23 | cTValue *tv = lj_tab_getstr(tabV(registry(L)), s); 24 | if (tvistab(tv)) { 25 | int hash = VMEVENT_HASH(ev); 26 | tv = lj_tab_getint(tabV(tv), hash); 27 | if (tv && tvisfunc(tv)) { 28 | lj_state_checkstack(L, LUA_MINSTACK); 29 | setfuncV(L, L->top++, funcV(tv)); 30 | return savestack(L, L->top); 31 | } 32 | } 33 | g->vmevmask &= ~VMEVENT_MASK(ev); /* No handler: cache this fact. */ 34 | return 0; 35 | } 36 | 37 | void lj_vmevent_call(lua_State *L, ptrdiff_t argbase) 38 | { 39 | global_State *g = G(L); 40 | uint8_t oldmask = g->vmevmask; 41 | uint8_t oldh = hook_save(g); 42 | int status; 43 | g->vmevmask = 0; /* Disable all events. */ 44 | hook_vmevent(g); 45 | status = lj_vm_pcall(L, restorestack(L, argbase), 0+1, 0); 46 | if (LJ_UNLIKELY(status)) { 47 | /* Really shouldn't use stderr here, but where else to complain? */ 48 | L->top--; 49 | fputs("VM handler failed: ", stderr); 50 | fputs(tvisstr(L->top) ? strVdata(L->top) : "?", stderr); 51 | fputc('\n', stderr); 52 | } 53 | hook_restore(g, oldh); 54 | if (g->vmevmask != VMEVENT_NOCACHE) 55 | g->vmevmask = oldmask; /* Restore event mask, but not if not modified. */ 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lj_vmevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** VM event handling. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LJ_VMEVENT_H 7 | #define _LJ_VMEVENT_H 8 | 9 | #include "lj_obj.h" 10 | 11 | /* Registry key for VM event handler table. */ 12 | #define LJ_VMEVENTS_REGKEY "_VMEVENTS" 13 | #define LJ_VMEVENTS_HSIZE 4 14 | 15 | #define VMEVENT_MASK(ev) ((uint8_t)1 << ((int)(ev) & 7)) 16 | #define VMEVENT_HASH(ev) ((int)(ev) & ~7) 17 | #define VMEVENT_HASHIDX(h) ((int)(h) << 3) 18 | #define VMEVENT_NOCACHE 255 19 | 20 | #define VMEVENT_DEF(name, hash) \ 21 | LJ_VMEVENT_##name##_, \ 22 | LJ_VMEVENT_##name = ((LJ_VMEVENT_##name##_) & 7)|((hash) << 3) 23 | 24 | /* VM event IDs. */ 25 | typedef enum { 26 | VMEVENT_DEF(BC, 0x00003883), 27 | VMEVENT_DEF(TRACE, 0xb2d91467), 28 | VMEVENT_DEF(RECORD, 0x9284bf4f), 29 | VMEVENT_DEF(TEXIT, 0xb29df2b0), 30 | LJ_VMEVENT__MAX 31 | } VMEvent; 32 | 33 | #ifdef LUAJIT_DISABLE_VMEVENT 34 | #define lj_vmevent_send(L, ev, args) UNUSED(L) 35 | #define lj_vmevent_send_(L, ev, args, post) UNUSED(L) 36 | #else 37 | #define lj_vmevent_send(L, ev, args) \ 38 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ 39 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ 40 | if (argbase) { \ 41 | args \ 42 | lj_vmevent_call(L, argbase); \ 43 | } \ 44 | } 45 | #define lj_vmevent_send_(L, ev, args, post) \ 46 | if (G(L)->vmevmask & VMEVENT_MASK(LJ_VMEVENT_##ev)) { \ 47 | ptrdiff_t argbase = lj_vmevent_prepare(L, LJ_VMEVENT_##ev); \ 48 | if (argbase) { \ 49 | args \ 50 | lj_vmevent_call(L, argbase); \ 51 | post \ 52 | } \ 53 | } 54 | 55 | LJ_FUNC ptrdiff_t lj_vmevent_prepare(lua_State *L, VMEvent ev); 56 | LJ_FUNC void lj_vmevent_call(lua_State *L, ptrdiff_t argbase); 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/ljamalg.c: -------------------------------------------------------------------------------- 1 | /* 2 | ** LuaJIT core and libraries amalgamation. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | /* 7 | +--------------------------------------------------------------------------+ 8 | | WARNING: Compiling the amalgamation needs a lot of virtual memory | 9 | | (around 300 MB with GCC 4.x)! If you don't have enough physical memory | 10 | | your machine will start swapping to disk and the compile will not finish | 11 | | within a reasonable amount of time. | 12 | | So either compile on a bigger machine or use the non-amalgamated build. | 13 | +--------------------------------------------------------------------------+ 14 | */ 15 | 16 | #define ljamalg_c 17 | #define LUA_CORE 18 | 19 | /* To get the mremap prototype. Must be defined before any system includes. */ 20 | #if defined(__linux__) && !defined(_GNU_SOURCE) 21 | #define _GNU_SOURCE 22 | #endif 23 | 24 | #ifndef WINVER 25 | #define WINVER 0x0501 26 | #endif 27 | 28 | #include "lua.h" 29 | #include "lauxlib.h" 30 | 31 | #include "lj_gc.c" 32 | #include "lj_err.c" 33 | #include "lj_char.c" 34 | #include "lj_bc.c" 35 | #include "lj_obj.c" 36 | #include "lj_str.c" 37 | #include "lj_tab.c" 38 | #include "lj_func.c" 39 | #include "lj_udata.c" 40 | #include "lj_meta.c" 41 | #include "lj_debug.c" 42 | #include "lj_state.c" 43 | #include "lj_dispatch.c" 44 | #include "lj_vmevent.c" 45 | #include "lj_vmmath.c" 46 | #include "lj_strscan.c" 47 | #include "lj_api.c" 48 | #include "lj_lex.c" 49 | #include "lj_parse.c" 50 | #include "lj_bcread.c" 51 | #include "lj_bcwrite.c" 52 | #include "lj_load.c" 53 | #include "lj_ctype.c" 54 | #include "lj_cdata.c" 55 | #include "lj_cconv.c" 56 | #include "lj_ccall.c" 57 | #include "lj_ccallback.c" 58 | #include "lj_carith.c" 59 | #include "lj_clib.c" 60 | #include "lj_cparse.c" 61 | #include "lj_lib.c" 62 | #include "lj_ir.c" 63 | #include "lj_opt_mem.c" 64 | #include "lj_opt_fold.c" 65 | #include "lj_opt_narrow.c" 66 | #include "lj_opt_dce.c" 67 | #include "lj_opt_loop.c" 68 | #include "lj_opt_split.c" 69 | #include "lj_opt_sink.c" 70 | #include "lj_mcode.c" 71 | #include "lj_snap.c" 72 | #include "lj_record.c" 73 | #include "lj_crecord.c" 74 | #include "lj_ffrecord.c" 75 | #include "lj_asm.c" 76 | #include "lj_trace.c" 77 | #include "lj_gdbjit.c" 78 | #include "lj_alloc.c" 79 | 80 | #include "lib_aux.c" 81 | #include "lib_base.c" 82 | #include "lib_math.c" 83 | #include "lib_string.c" 84 | #include "lib_table.c" 85 | #include "lib_io.c" 86 | #include "lib_os.c" 87 | #include "lib_package.c" 88 | #include "lib_debug.c" 89 | #include "lib_bit.c" 90 | #include "lib_jit.c" 91 | #include "lib_ffi.c" 92 | #include "lib_init.c" 93 | 94 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lua.hpp: -------------------------------------------------------------------------------- 1 | // C++ wrapper for LuaJIT header files. 2 | 3 | extern "C" { 4 | #include "lua.h" 5 | #include "lauxlib.h" 6 | #include "lualib.h" 7 | #include "luajit.h" 8 | } 9 | 10 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/luajit.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** LuaJIT -- a Just-In-Time Compiler for Lua. http://luajit.org/ 3 | ** 4 | ** Copyright (C) 2005-2017 Mike Pall. All rights reserved. 5 | ** 6 | ** Permission is hereby granted, free of charge, to any person obtaining 7 | ** a copy of this software and associated documentation files (the 8 | ** "Software"), to deal in the Software without restriction, including 9 | ** without limitation the rights to use, copy, modify, merge, publish, 10 | ** distribute, sublicense, and/or sell copies of the Software, and to 11 | ** permit persons to whom the Software is furnished to do so, subject to 12 | ** the following conditions: 13 | ** 14 | ** The above copyright notice and this permission notice shall be 15 | ** included in all copies or substantial portions of the Software. 16 | ** 17 | ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | ** 25 | ** [ MIT license: http://www.opensource.org/licenses/mit-license.php ] 26 | */ 27 | 28 | #ifndef _LUAJIT_H 29 | #define _LUAJIT_H 30 | 31 | #include "lua.h" 32 | 33 | #define LUAJIT_VERSION "LuaJIT 2.0.5" 34 | #define LUAJIT_VERSION_NUM 20005 /* Version 2.0.5 = 02.00.05. */ 35 | #define LUAJIT_VERSION_SYM luaJIT_version_2_0_5 36 | #define LUAJIT_COPYRIGHT "Copyright (C) 2005-2017 Mike Pall" 37 | #define LUAJIT_URL "http://luajit.org/" 38 | 39 | /* Modes for luaJIT_setmode. */ 40 | #define LUAJIT_MODE_MASK 0x00ff 41 | 42 | enum { 43 | LUAJIT_MODE_ENGINE, /* Set mode for whole JIT engine. */ 44 | LUAJIT_MODE_DEBUG, /* Set debug mode (idx = level). */ 45 | 46 | LUAJIT_MODE_FUNC, /* Change mode for a function. */ 47 | LUAJIT_MODE_ALLFUNC, /* Recurse into subroutine protos. */ 48 | LUAJIT_MODE_ALLSUBFUNC, /* Change only the subroutines. */ 49 | 50 | LUAJIT_MODE_TRACE, /* Flush a compiled trace. */ 51 | 52 | LUAJIT_MODE_WRAPCFUNC = 0x10, /* Set wrapper mode for C function calls. */ 53 | 54 | LUAJIT_MODE_MAX 55 | }; 56 | 57 | /* Flags or'ed in to the mode. */ 58 | #define LUAJIT_MODE_OFF 0x0000 /* Turn feature off. */ 59 | #define LUAJIT_MODE_ON 0x0100 /* Turn feature on. */ 60 | #define LUAJIT_MODE_FLUSH 0x0200 /* Flush JIT-compiled code. */ 61 | 62 | /* LuaJIT public C API. */ 63 | 64 | /* Control the JIT engine. */ 65 | LUA_API int luaJIT_setmode(lua_State *L, int idx, int mode); 66 | 67 | /* Enforce (dynamic) linker error for version mismatches. Call from main. */ 68 | LUA_API void LUAJIT_VERSION_SYM(void); 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/luajit/luajit-2.0/src/lualib.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Standard library header. 3 | ** Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h 4 | */ 5 | 6 | #ifndef _LUALIB_H 7 | #define _LUALIB_H 8 | 9 | #include "lua.h" 10 | 11 | #define LUA_FILEHANDLE "FILE*" 12 | 13 | #define LUA_COLIBNAME "coroutine" 14 | #define LUA_MATHLIBNAME "math" 15 | #define LUA_STRLIBNAME "string" 16 | #define LUA_TABLIBNAME "table" 17 | #define LUA_IOLIBNAME "io" 18 | #define LUA_OSLIBNAME "os" 19 | #define LUA_LOADLIBNAME "package" 20 | #define LUA_DBLIBNAME "debug" 21 | #define LUA_BITLIBNAME "bit" 22 | #define LUA_JITLIBNAME "jit" 23 | #define LUA_FFILIBNAME "ffi" 24 | 25 | LUALIB_API int luaopen_base(lua_State *L); 26 | LUALIB_API int luaopen_math(lua_State *L); 27 | LUALIB_API int luaopen_string(lua_State *L); 28 | LUALIB_API int luaopen_table(lua_State *L); 29 | LUALIB_API int luaopen_io(lua_State *L); 30 | LUALIB_API int luaopen_os(lua_State *L); 31 | LUALIB_API int luaopen_package(lua_State *L); 32 | LUALIB_API int luaopen_debug(lua_State *L); 33 | LUALIB_API int luaopen_bit(lua_State *L); 34 | LUALIB_API int luaopen_jit(lua_State *L); 35 | LUALIB_API int luaopen_ffi(lua_State *L); 36 | 37 | LUALIB_API void luaL_openlibs(lua_State *L); 38 | 39 | #ifndef lua_assert 40 | #define lua_assert(x) ((void)0) 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /src/luajit/luajit.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/subpic/DX7SubPic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "ISubPic.h" 25 | #include 26 | 27 | // CDX7SubPic 28 | 29 | class CDX7SubPic : public ISubPicImpl 30 | { 31 | CComPtr m_pD3DDev; 32 | CComPtr m_pSurface; 33 | 34 | protected: 35 | STDMETHODIMP_(void*) GetObject(); // returns IDirectDrawSurface7* 36 | 37 | public: 38 | CDX7SubPic(IDirect3DDevice7* pD3DDev, IDirectDrawSurface7* pSurface); 39 | 40 | // ISubPic 41 | STDMETHODIMP GetDesc(SubPicDesc& spd); 42 | STDMETHODIMP CopyTo(ISubPic* pSubPic); 43 | STDMETHODIMP ClearDirtyRect(DWORD color); 44 | STDMETHODIMP Lock(SubPicDesc& spd); 45 | STDMETHODIMP Unlock(RECT* pDirtyRect); 46 | STDMETHODIMP AlphaBlt(RECT* pSrc, RECT* pDst, SubPicDesc* pTarget); 47 | }; 48 | 49 | // CDX7SubPicAllocator 50 | 51 | class CDX7SubPicAllocator : public ISubPicAllocatorImpl, public CCritSec 52 | { 53 | CComPtr m_pD3DDev; 54 | CSize m_maxsize; 55 | 56 | bool Alloc(bool fStatic, ISubPic** ppSubPic); 57 | 58 | public: 59 | CDX7SubPicAllocator(IDirect3DDevice7* pD3DDev, SIZE maxsize, bool fPow2Textures); 60 | 61 | // ISubPicAllocator 62 | STDMETHODIMP ChangeDevice(IUnknown* pDev); 63 | }; 64 | -------------------------------------------------------------------------------- /src/subpic/MemSubPic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "ISubPic.h" 25 | 26 | enum {MSP_RGB32, MSP_RGB24, MSP_RGB16, MSP_RGB15, MSP_YUY2, MSP_YV12, MSP_IYUV, MSP_AYUV, MSP_RGBA}; 27 | enum YCbCrMatrix 28 | { 29 | YCbCrMatrix_BT601, 30 | YCbCrMatrix_BT709, 31 | YCbCrMatrix_BT2020, 32 | YCbCrMatrix_AUTO 33 | }; 34 | enum YCbCrRange 35 | { 36 | YCbCrRange_PC, 37 | YCbCrRange_TV, 38 | YCbCrRange_AUTO 39 | }; 40 | // CMemSubPic 41 | 42 | class CMemSubPic : public ISubPicImpl 43 | { 44 | #pragma warning(disable: 4799) 45 | SubPicDesc m_spd; 46 | int m_eYCbCrMatrix; 47 | int m_eYCbCrRange; 48 | 49 | protected: 50 | STDMETHODIMP_(void*) GetObject(); // returns SubPicDesc* 51 | 52 | public: 53 | CMemSubPic(SubPicDesc& spd, int inYCbCrMatrix, int inYCbCrRange); 54 | virtual ~CMemSubPic(); 55 | 56 | // ISubPic 57 | STDMETHODIMP GetDesc(SubPicDesc& spd); 58 | STDMETHODIMP CopyTo(ISubPic* pSubPic); 59 | STDMETHODIMP ClearDirtyRect(DWORD color); 60 | STDMETHODIMP Lock(SubPicDesc& spd); 61 | STDMETHODIMP Unlock(RECT* pDirtyRect); 62 | STDMETHODIMP AlphaBlt(RECT* pSrc, RECT* pDst, SubPicDesc* pTarget); 63 | }; 64 | 65 | // CMemSubPicAllocator 66 | 67 | class CMemSubPicAllocator : public ISubPicAllocatorImpl 68 | { 69 | int m_type; 70 | CSize m_maxsize; 71 | int m_eYCbCrMatrix; 72 | int m_eYCbCrRange; 73 | 74 | bool Alloc(bool fStatic, ISubPic** ppSubPic); 75 | 76 | public: 77 | CMemSubPicAllocator(int type, SIZE maxsize, int inYCbCrMatrix=YCbCrMatrix_BT601, int inYCbCrRange=YCbCrRange_TV); 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /src/subpic/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.cpp : source file that includes just the standard includes 23 | // subpic.pch will be the pre-compiled header 24 | // stdafx.obj will contain the pre-compiled type information 25 | 26 | #include "stdafx.h" 27 | 28 | // TODO: reference any additional headers you need in STDAFX.H 29 | // and not in this file 30 | -------------------------------------------------------------------------------- /src/subpic/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.h : include file for standard system include files, 23 | // or project specific include files that are used frequently, but 24 | // are changed infrequently 25 | // 26 | 27 | #pragma once 28 | #include "..\DSUtil\SharedInclude.h" 29 | 30 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 31 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 32 | #define WINVER 0x0600 33 | 34 | #ifndef VC_EXTRALEAN 35 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 36 | #endif 37 | 38 | #include 39 | #include // MFC core and standard components 40 | 41 | // TODO: reference additional headers your program requires here 42 | 43 | #include 44 | #include 45 | #include "..\DSUtil\DSUtil.h" 46 | -------------------------------------------------------------------------------- /src/subpic/subpic.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {29cec234-5359-489f-964a-a914a991917e} 6 | cpp;c;cxx;def;odl;idl;hpj;bat;asm 7 | 8 | 9 | {8d5c2ea8-38ce-4c88-bd96-8eb2bf1414de} 10 | h;hpp;hxx;hm;inl;inc 11 | 12 | 13 | 14 | 15 | Source Files 16 | 17 | 18 | Source Files 19 | 20 | 21 | Source Files 22 | 23 | 24 | Source Files 25 | 26 | 27 | Source Files 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Header Files 36 | 37 | 38 | Header Files 39 | 40 | 41 | Header Files 42 | 43 | 44 | Header Files 45 | 46 | 47 | Header Files 48 | 49 | 50 | Header Files 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/subtitles/BaseSub.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: BaseSub.cpp 1457 2010-01-01 03:13:59Z xhmikosr $ 3 | * 4 | * (C) 2006-2010 see AUTHORS 5 | * 6 | * This file is part of mplayerc. 7 | * 8 | * Mplayerc is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * Mplayerc is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | */ 22 | 23 | #include "stdafx.h" 24 | #include "BaseSub.h" 25 | 26 | CBaseSub::CBaseSub(SUBTITLE_TYPE nType) 27 | : m_nType(nType) 28 | { 29 | } 30 | 31 | CBaseSub::~CBaseSub() 32 | { 33 | } -------------------------------------------------------------------------------- /src/subtitles/BaseSub.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: BaseSub.h 1457 2010-01-01 03:13:59Z xhmikosr $ 3 | * 4 | * (C) 2006-2010 see AUTHORS 5 | * 6 | * This file is part of mplayerc. 7 | * 8 | * Mplayerc is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * Mplayerc is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | */ 22 | 23 | 24 | #pragma once 25 | 26 | #include "CompositionObject.h" 27 | 28 | enum SUBTITLE_TYPE 29 | { 30 | ST_DVB, 31 | ST_HDMV 32 | }; 33 | 34 | class CBaseSub 35 | { 36 | public: 37 | 38 | static const REFERENCE_TIME INVALID_TIME = _I64_MIN; 39 | 40 | CBaseSub(SUBTITLE_TYPE nType); 41 | virtual ~CBaseSub(); 42 | 43 | virtual HRESULT ParseSample(IMediaSample* pSample) = NULL; 44 | virtual void Reset() = NULL; 45 | virtual POSITION GetStartPosition(REFERENCE_TIME rt, double fps) = NULL; 46 | virtual POSITION GetNext(POSITION pos) = NULL; 47 | virtual REFERENCE_TIME GetStart(POSITION nPos) = NULL; 48 | virtual REFERENCE_TIME GetStop(POSITION nPos) = NULL; 49 | virtual void Render(SubPicDesc& spd, REFERENCE_TIME rt, RECT& bbox) = NULL; 50 | virtual HRESULT GetTextureSize(POSITION pos, SIZE& MaxTextureSize, SIZE& VideoSize, POINT& VideoTopLeft) = NULL; 51 | 52 | protected : 53 | SUBTITLE_TYPE m_nType; 54 | }; 55 | -------------------------------------------------------------------------------- /src/subtitles/CCDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "STS.h" 25 | 26 | class CCDecoder 27 | { 28 | CSimpleTextSubtitle m_sts; 29 | CString m_fn, m_rawfn; 30 | __int64 m_time; 31 | bool m_fEndOfCaption; 32 | WCHAR m_buff[16][33], m_disp[16][33]; 33 | CPoint m_cursor; 34 | 35 | void SaveDisp(__int64 time); 36 | void MoveCursor(int x, int y); 37 | void OffsetCursor(int x, int y); 38 | void PutChar(WCHAR c); 39 | 40 | public: 41 | CCDecoder(CString fn = _T(""), CString rawfn = _T("")); 42 | virtual ~CCDecoder(); 43 | void DecodeCC(BYTE* buff, int len, __int64 time); 44 | void ExtractCC(BYTE* buff, int len, __int64 time); 45 | CSimpleTextSubtitle& GetSTS() 46 | { 47 | return m_sts; 48 | } 49 | }; 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/subtitles/CompositionObject.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/subtitles/CompositionObject.cpp -------------------------------------------------------------------------------- /src/subtitles/DVBSub.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/subtitles/DVBSub.h -------------------------------------------------------------------------------- /src/subtitles/GFN.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | enum exttype {EXTSRT = 0, EXTSUB, EXTSMI, EXTPSB, EXTSSA, EXTASS, EXTIDX, EXTUSF, EXTXSS, EXTRT}; 27 | extern TCHAR* exttypestr[]; 28 | typedef struct 29 | { 30 | CString fn; /*exttype ext;*/ 31 | } SubFile; 32 | extern void GetSubFileNames(CString fn, CAtlArray& paths, CAtlArray& ret); 33 | -------------------------------------------------------------------------------- /src/subtitles/RenderedHdmvSubtitle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: RenderedHdmvSubtitle.h 1457 2010-01-01 03:13:59Z xhmikosr $ 3 | * 4 | * (C) 2006-2010 see AUTHORS 5 | * 6 | * This file is part of mplayerc. 7 | * 8 | * Mplayerc is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * Mplayerc is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program. If not, see . 20 | * 21 | */ 22 | 23 | 24 | #pragma once 25 | 26 | #include "Rasterizer.h" 27 | #include "..\SubPic\ISubPic.h" 28 | #include "HdmvSub.h" 29 | #include "BaseSub.h" 30 | 31 | 32 | [uuid("FCA68599-C83E-4ea5-94A3-C2E1B0E326B9")] 33 | class CRenderedHdmvSubtitle : public ISubPicProviderImpl, public ISubStream 34 | { 35 | public: 36 | CRenderedHdmvSubtitle(CCritSec* pLock, SUBTITLE_TYPE nType); 37 | ~CRenderedHdmvSubtitle(void); 38 | 39 | DECLARE_IUNKNOWN 40 | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); 41 | 42 | // ISubPicProvider 43 | STDMETHODIMP_(POSITION) GetStartPosition(REFERENCE_TIME rt, double fps); 44 | STDMETHODIMP_(POSITION) GetNext(POSITION pos); 45 | STDMETHODIMP_(REFERENCE_TIME) GetStart(POSITION pos, double fps); 46 | STDMETHODIMP_(REFERENCE_TIME) GetStop(POSITION pos, double fps); 47 | STDMETHODIMP_(bool) IsAnimated(POSITION pos); 48 | STDMETHODIMP Render(SubPicDesc& spd, REFERENCE_TIME rt, double fps, RECT& bbox); 49 | STDMETHODIMP GetTextureSize(POSITION pos, SIZE& MaxTextureSize, SIZE& VirtualSize, POINT& VirtualTopLeft); 50 | 51 | // IPersist 52 | STDMETHODIMP GetClassID(CLSID* pClassID); 53 | 54 | // ISubStream 55 | STDMETHODIMP_(int) GetStreamCount(); 56 | STDMETHODIMP GetStreamInfo(int i, WCHAR** ppName, LCID* pLCID); 57 | STDMETHODIMP_(int) GetStream(); 58 | STDMETHODIMP SetStream(int iStream); 59 | STDMETHODIMP Reload(); 60 | 61 | HRESULT ParseSample(IMediaSample* pSample); 62 | HRESULT NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); 63 | 64 | private : 65 | CString m_name; 66 | LCID m_lcid; 67 | REFERENCE_TIME m_rtStart; 68 | 69 | CBaseSub* m_pSub; 70 | CCritSec m_csCritSec; 71 | }; 72 | -------------------------------------------------------------------------------- /src/subtitles/SSF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "..\SubPic\ISubPic.h" 25 | #include ".\libssf\SubtitleFile.h" 26 | #include ".\libssf\Renderer.h" 27 | 28 | #pragma once 29 | 30 | namespace ssf 31 | { 32 | [uuid("E0593632-0AB7-47CA-8BE1-E9D2A6A4825E")] 33 | class CRenderer : public ISubPicProviderImpl, public ISubStream 34 | { 35 | CString m_fn, m_name; 36 | CAutoPtr m_file; 37 | CAutoPtr m_renderer; 38 | 39 | public: 40 | CRenderer(CCritSec* pLock); 41 | virtual ~CRenderer(); 42 | 43 | bool Open(CString fn, CString name = _T("")); 44 | bool Open(InputStream& s, CString name); 45 | 46 | void Append(REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, LPCWSTR str); 47 | 48 | DECLARE_IUNKNOWN 49 | STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv); 50 | 51 | // ISubPicProvider 52 | STDMETHODIMP_(POSITION) GetStartPosition(REFERENCE_TIME rt, double fps); 53 | STDMETHODIMP_(POSITION) GetNext(POSITION pos); 54 | STDMETHODIMP_(REFERENCE_TIME) GetStart(POSITION pos, double fps); 55 | STDMETHODIMP_(REFERENCE_TIME) GetStop(POSITION pos, double fps); 56 | STDMETHODIMP_(bool) IsAnimated(POSITION pos); 57 | STDMETHODIMP Render(SubPicDesc& spd, REFERENCE_TIME rt, double fps, RECT& bbox); 58 | 59 | // IPersist 60 | STDMETHODIMP GetClassID(CLSID* pClassID); 61 | 62 | // ISubStream 63 | STDMETHODIMP_(int) GetStreamCount(); 64 | STDMETHODIMP GetStreamInfo(int i, WCHAR** ppName, LCID* pLCID); 65 | STDMETHODIMP_(int) GetStream(); 66 | STDMETHODIMP SetStream(int iStream); 67 | STDMETHODIMP Reload(); 68 | }; 69 | 70 | } -------------------------------------------------------------------------------- /src/subtitles/SubtitleInputPin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "..\subpic\ISubPic.h" 25 | 26 | // 27 | // CSubtitleInputPin 28 | // 29 | 30 | class CSubtitleInputPin : public CBaseInputPin 31 | { 32 | CCritSec m_csReceive; 33 | 34 | CCritSec* m_pSubLock; 35 | CComPtr m_pSubStream; 36 | 37 | protected: 38 | virtual void AddSubStream(ISubStream* pSubStream) = 0; 39 | virtual void RemoveSubStream(ISubStream* pSubStream) = 0; 40 | virtual void InvalidateSubtitle(REFERENCE_TIME rtStart, ISubStream* pSubStream) = 0; 41 | 42 | public: 43 | CSubtitleInputPin(CBaseFilter* pFilter, CCritSec* pLock, CCritSec* pSubLock, HRESULT* phr); 44 | 45 | HRESULT CheckMediaType(const CMediaType* pmt); 46 | HRESULT CompleteConnect(IPin* pReceivePin); 47 | HRESULT BreakConnect(); 48 | STDMETHODIMP ReceiveConnection(IPin* pConnector, const AM_MEDIA_TYPE* pmt); 49 | STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate); 50 | STDMETHODIMP Receive(IMediaSample* pSample); 51 | 52 | ISubStream* GetSubStream() 53 | { 54 | return m_pSubStream; 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /src/subtitles/TextFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | class CTextFile : protected CStdioFile 27 | { 28 | public: 29 | typedef enum {ASCII, UTF8, LE16, BE16, ANSI} enc; 30 | 31 | private: 32 | enc m_encoding, m_defaultencoding; 33 | int m_offset; 34 | 35 | public: 36 | CTextFile(enc e = ASCII); 37 | 38 | virtual bool Open(LPCTSTR lpszFileName); 39 | virtual bool Save(LPCTSTR lpszFileName, enc e /*= ASCII*/); 40 | 41 | void SetEncoding(enc e); 42 | enc GetEncoding(); 43 | bool IsUnicode(); 44 | 45 | // CFile 46 | 47 | CString GetFilePath() const; 48 | 49 | // CStdioFile 50 | 51 | ULONGLONG GetPosition() const; 52 | ULONGLONG GetLength() const; 53 | ULONGLONG Seek(LONGLONG lOff, UINT nFrom); 54 | 55 | void WriteString(LPCSTR lpsz/*CStringA str*/); 56 | void WriteString(LPCWSTR lpsz/*CStringW str*/); 57 | BOOL ReadString(CStringA& str); 58 | BOOL ReadString(CStringW& str); 59 | }; 60 | 61 | class CWebTextFile : public CTextFile 62 | { 63 | LONGLONG m_llMaxSize; 64 | CString m_tempfn; 65 | 66 | public: 67 | CWebTextFile(LONGLONG llMaxSize = 1024 * 1024); 68 | 69 | bool Open(LPCTSTR lpszFileName); 70 | bool Save(LPCTSTR lpszFileName, enc e /*= ASCII*/); 71 | void Close(); 72 | }; 73 | 74 | extern CStringW AToW(CStringA str); 75 | extern CStringA WToA(CStringW str); 76 | extern CString AToT(CStringA str); 77 | extern CString WToT(CStringW str); 78 | extern CStringA TToA(CString str); 79 | extern CStringW TToW(CString str); 80 | -------------------------------------------------------------------------------- /src/subtitles/libssf/Arabic.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace ssf 25 | { 26 | class Arabic 27 | { 28 | public: 29 | enum pres_form_t {isol, init, medi, fina}; 30 | static bool IsArabic(WCHAR c); 31 | static bool Replace(WCHAR& c, pres_form_t pf); 32 | static bool Replace(WCHAR& c, WCHAR prev, WCHAR next); 33 | }; 34 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/Array.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #include "stdafx.h" 23 | #include "Array.h" 24 | 25 | namespace ssf 26 | { 27 | 28 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/Exception.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #include "stdafx.h" 23 | #include "Exception.h" 24 | 25 | namespace ssf 26 | { 27 | Exception::Exception(LPCTSTR fmt, ...) 28 | { 29 | va_list args; 30 | va_start(args, fmt); 31 | int len = _vsctprintf(fmt, args) + 1; 32 | if(len > 0) _vstprintf_s(m_msg.GetBufferSetLength(len), len, fmt, args); 33 | va_end(args); 34 | } 35 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/Exception.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace ssf 25 | { 26 | class Exception 27 | { 28 | CString m_msg; 29 | 30 | public: 31 | Exception(LPCTSTR fmt, ...); 32 | 33 | CString ToString() 34 | { 35 | return m_msg; 36 | } 37 | }; 38 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/File.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "Stream.h" 25 | #include "NodeFactory.h" 26 | 27 | namespace ssf 28 | { 29 | class File : public NodeFactory 30 | { 31 | public: 32 | File(); 33 | virtual ~File(); 34 | 35 | void Parse(InputStream& s, LPCWSTR predef = NULL); 36 | 37 | void ParseDefs(InputStream& s, Reference* pParentRef); 38 | void ParseTypes(InputStream& s, CAtlList& types); 39 | void ParseName(InputStream& s, CStringW& name); 40 | void ParseQuotedString(InputStream& s, Definition* pDef); 41 | void ParseNumber(InputStream& s, Definition* pDef); 42 | void ParseBlock(InputStream& s, Definition* pDef); 43 | void ParseRefs(InputStream& s, Definition* pParentDef, LPCWSTR term = L";}]"); 44 | }; 45 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/FontWrapper.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #include "stdafx.h" 23 | #include "FontWrapper.h" 24 | 25 | namespace ssf 26 | { 27 | FontWrapper::FontWrapper(HDC hDC, HFONT hFont, const CStringW& key) 28 | : m_hFont(hFont) 29 | , m_key(key) 30 | { 31 | HFONT hFontOld = SelectFont(hDC, hFont); 32 | 33 | GetTextMetrics(hDC, &m_tm); 34 | 35 | if(DWORD nNumPairs = GetKerningPairs(hDC, 0, NULL)) 36 | { 37 | KERNINGPAIR* kp = DNew KERNINGPAIR[nNumPairs]; 38 | GetKerningPairs(hDC, nNumPairs, kp); 39 | for(DWORD i = 0; i < nNumPairs; i++) 40 | m_kerning[(kp[i].wFirst << 16) | kp[i].wSecond] = kp[i].iKernAmount; 41 | delete [] kp; 42 | } 43 | 44 | SelectFont(hDC, hFontOld); 45 | } 46 | 47 | FontWrapper::~FontWrapper() 48 | { 49 | DeleteFont(m_hFont); 50 | } 51 | 52 | int FontWrapper::GetKernAmount(WCHAR c1, WCHAR c2) 53 | { 54 | int size = 0; 55 | return m_kerning.Lookup((c1 << 16) | c2, size) ? size : 0; 56 | } 57 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/FontWrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace ssf 25 | { 26 | class FontWrapper 27 | { 28 | HFONT m_hFont; 29 | CStringW m_key; 30 | TEXTMETRIC m_tm; 31 | CAtlMap m_kerning; 32 | 33 | public: 34 | FontWrapper(HDC hDC, HFONT hFont, const CStringW& key); 35 | virtual ~FontWrapper(); 36 | operator HFONT() const 37 | { 38 | return m_hFont; 39 | } 40 | operator LPCWSTR() const 41 | { 42 | return m_key; 43 | } 44 | const TEXTMETRIC& GetTextMetric() 45 | { 46 | return m_tm; 47 | } 48 | int GetKernAmount(WCHAR c1, WCHAR c2); 49 | }; 50 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/Glyph.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | #include "GlyphPath.h" 26 | #include "FontWrapper.h" 27 | #include "Rasterizer.h" 28 | 29 | namespace ssf 30 | { 31 | class Glyph 32 | { 33 | void Transform(GlyphPath& path, CPoint org, const CRect& subrect); 34 | 35 | struct SplineCoeffs 36 | { 37 | float cx[4], cy[4]; 38 | }; 39 | 40 | public: 41 | WCHAR c; 42 | Style style; 43 | CAtlArray spline; 44 | Size scale; 45 | bool vertical; 46 | FontWrapper* font; 47 | int ascent, descent, width, spacing, fill; 48 | int row_ascent, row_descent; 49 | GlyphPath path, path_bkg; 50 | CRect bbox; 51 | CPoint tl, tls; 52 | Rasterizer ras, ras_bkg, ras_shadow; 53 | 54 | public: 55 | Glyph(); 56 | 57 | void CreateBkg(); 58 | void CreateSplineCoeffs(const CRect& spdrc); 59 | void Transform(CPoint org, const CRect& subrect); 60 | void Rasterize(); 61 | 62 | float GetBackgroundSize() const; 63 | float GetShadowDepth() const; 64 | CRect GetClipRect() const; 65 | }; 66 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/GlyphPath.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include 25 | 26 | namespace ssf 27 | { 28 | class GlyphPath 29 | { 30 | public: 31 | GlyphPath() {} 32 | virtual ~GlyphPath() {} 33 | 34 | GlyphPath(const GlyphPath& path); 35 | void operator = (const GlyphPath& path); 36 | 37 | bool IsEmpty(); 38 | void RemoveAll(); 39 | void MovePoints(const CPoint& o); 40 | void Enlarge(const GlyphPath& src, float size); 41 | 42 | CAtlArray types; 43 | CAtlArray points; 44 | }; 45 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/NodeFactory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "Node.h" 25 | 26 | namespace ssf 27 | { 28 | class NodeFactory 29 | { 30 | Reference* m_root; 31 | StringMapW m_nodes; 32 | CAtlList m_newnodes; 33 | bool m_predefined; 34 | 35 | unsigned __int64 m_counter; 36 | CStringW GenName(); 37 | 38 | public: 39 | NodeFactory(); 40 | virtual ~NodeFactory(); 41 | 42 | virtual void RemoveAll(); 43 | 44 | void SetPredefined(bool predefined) 45 | { 46 | m_predefined = predefined; 47 | } 48 | 49 | void Commit(); 50 | void Rollback(); 51 | 52 | Reference* CreateRootRef(); 53 | Reference* GetRootRef() const; 54 | Reference* CreateRef(Definition* pParentDef); 55 | Definition* CreateDef(Reference* pParentRef = NULL, CStringW type = L"", CStringW name = L"", NodePriority priority = PNormal); 56 | Definition* GetDefByName(CStringW name) const; 57 | void GetNewDefs(CAtlList& defs); 58 | 59 | void Dump(OutputStream& s) const; 60 | }; 61 | } 62 | -------------------------------------------------------------------------------- /src/subtitles/libssf/Split.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #include "stdafx.h" 23 | #include "Split.h" 24 | #include "Exception.h" 25 | 26 | namespace ssf 27 | { 28 | Split::Split(LPCWSTR sep, CStringW str, size_t limit, SplitType type) 29 | { 30 | DoSplit(sep, str, limit, type); 31 | } 32 | 33 | Split::Split(WCHAR sep, CStringW str, size_t limit, SplitType type) 34 | { 35 | DoSplit(CStringW(sep), str, limit, type); 36 | } 37 | 38 | void Split::DoSplit(LPCWSTR sep, CStringW str, size_t limit, SplitType type) 39 | { 40 | RemoveAll(); 41 | 42 | if(size_t seplen = wcslen(sep)) 43 | { 44 | for(ptrdiff_t i = 0, j = 0, len = str.GetLength(); 45 | i <= len && (limit == 0 || GetCount() < limit); 46 | i = j + (int)seplen) 47 | { 48 | j = str.Find(sep, i); 49 | if(j < 0) j = len; 50 | 51 | CStringW s = i < j ? str.Mid(i, j - i) : L""; 52 | 53 | switch(type) 54 | { 55 | case Min: 56 | s.Trim(); // fall through 57 | case Def: 58 | if(s.IsEmpty()) break; // else fall through 59 | case Max: 60 | Add(s); 61 | break; 62 | } 63 | } 64 | } 65 | } 66 | 67 | int Split::GetAtInt(size_t i) 68 | { 69 | if(i >= GetCount()) throw Exception(_T("Index out of bounds")); 70 | return _wtoi(GetAt(i)); 71 | } 72 | 73 | float Split::GetAtFloat(size_t i) 74 | { 75 | if(i >= GetCount()) throw Exception(_T("Index out of bounds")); 76 | return (float)_wtof(GetAt(i)); 77 | } 78 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/Split.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace ssf 25 | { 26 | class Split : public CAtlArray 27 | { 28 | public: 29 | enum SplitType {Min, Def, Max}; 30 | Split(); 31 | Split(LPCWSTR sep, CStringW str, size_t limit = 0, SplitType type = Def); 32 | Split(WCHAR sep, CStringW str, size_t limit = 0, SplitType type = Def); 33 | operator size_t() 34 | { 35 | return GetCount(); 36 | } 37 | void DoSplit(LPCWSTR sep, CStringW str, size_t limit, SplitType type); 38 | int GetAtInt(size_t i); 39 | float GetAtFloat(size_t i); 40 | }; 41 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/StringMap.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #include "stdafx.h" 23 | #include "Exception.h" 24 | 25 | namespace ssf 26 | { 27 | 28 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/StringMap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | namespace ssf 25 | { 26 | template < class T = CString, class S = CString > 27 | class StringMap : public CAtlMap > 28 | { 29 | public: 30 | StringMap() {} 31 | StringMap(const StringMap& s2t) 32 | { 33 | *this = s2t; 34 | } 35 | StringMap& operator = (const StringMap& s2t) 36 | { 37 | RemoveAll(); 38 | POSITION pos = s2t.GetStartPosition(); 39 | while(pos) 40 | { 41 | const StringMap::CPair* p = s2t.GetNext(pos); 42 | SetAt(p->m_key, p->m_value); 43 | } 44 | return *this; 45 | } 46 | }; 47 | 48 | template < class T = CStringA, class S = CStringA > 49 | class StringMapA : public StringMap {}; 50 | 51 | template < class T = CStringW, class S = CStringW > 52 | class StringMapW : public StringMap {}; 53 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/SubtitleFile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "File.h" 25 | #include "Subtitle.h" 26 | 27 | namespace ssf 28 | { 29 | class SubtitleFile : public File 30 | { 31 | static LPCWSTR s_predef; 32 | 33 | public: 34 | struct SegmentItem 35 | { 36 | Definition* pDef; 37 | float start, stop; 38 | }; 39 | 40 | class Segment : public CAtlList 41 | { 42 | public: 43 | float m_start, m_stop; 44 | Segment() {} 45 | Segment(float start, float stop, const SegmentItem* si = NULL); 46 | Segment(const Segment& s); 47 | void operator = (const Segment& s); 48 | }; 49 | 50 | class SegmentList : public CAtlList 51 | { 52 | CAtlArray m_index; 53 | size_t Index(bool fForce = false); 54 | 55 | public: 56 | void RemoveAll(); 57 | void Insert(float start, float stop, Definition* pDef); 58 | void Lookup(float at, CAtlList& sis); 59 | bool Lookup(float at, size_t& k); 60 | const Segment* GetSegment(size_t k); 61 | }; 62 | 63 | SegmentList m_segments; 64 | 65 | public: 66 | SubtitleFile(); 67 | virtual ~SubtitleFile(); 68 | 69 | void Parse(InputStream& s); 70 | void Append(InputStream& s, float start, float stop, bool fSetTime = false); 71 | bool Lookup(float at, CAutoPtrList& subs); 72 | }; 73 | } -------------------------------------------------------------------------------- /src/subtitles/libssf/demo/demo.ssa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/subtitles/libssf/demo/demo.ssa -------------------------------------------------------------------------------- /src/subtitles/libssf/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.cpp : source file that includes just the standard includes 23 | // libssf.pch will be the pre-compiled header 24 | // stdafx.obj will contain the pre-compiled type information 25 | 26 | #include "stdafx.h" 27 | 28 | // TODO: reference any additional headers you need in STDAFX.H 29 | // and not in this file 30 | -------------------------------------------------------------------------------- /src/subtitles/libssf/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.h : include file for standard system include files, 23 | // or project specific include files that are used frequently, but 24 | // are changed infrequently 25 | // 26 | 27 | #pragma once 28 | #include "..\..\DSUtil\SharedInclude.h" 29 | 30 | // Modify the following defines if you have to target a platform prior to the ones specified below. 31 | // Refer to MSDN for the latest info on corresponding values for different platforms. 32 | #ifndef WINVER // Allow use of features specific to Windows XP or later. 33 | #define WINVER 0x0600 34 | #endif 35 | 36 | #ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later. 37 | #define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows. 38 | #endif 39 | 40 | #ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later. 41 | #define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later. 42 | #endif 43 | 44 | #ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later. 45 | #define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE. 46 | #endif 47 | 48 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 49 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 50 | 51 | #ifndef VC_EXTRALEAN 52 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 53 | #endif 54 | 55 | #include 56 | #include // MFC core and standard components 57 | #include // MFC core and standard components 58 | 59 | // TODO: reference additional headers your program requires here 60 | 61 | #include 62 | #include "..\..\DSUtil\DSUtil.h" 63 | #include "..\..\dsutil\vd.h" 64 | 65 | #include 66 | #include 67 | 68 | #define _USE_MATH_DEFINES 69 | #include 70 | -------------------------------------------------------------------------------- /src/subtitles/stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.cpp : source file that includes just the standard includes 23 | // subtitles.pch will be the pre-compiled header 24 | // stdafx.obj will contain the pre-compiled type information 25 | 26 | #include "stdafx.h" 27 | 28 | // TODO: reference any additional headers you need in STDAFX.H 29 | // and not in this file 30 | -------------------------------------------------------------------------------- /src/subtitles/stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.h : include file for standard system include files, 23 | // or project specific include files that are used frequently, but 24 | // are changed infrequently 25 | // 26 | 27 | #pragma once 28 | #include "..\DSUtil\SharedInclude.h" 29 | 30 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 31 | #define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit 32 | #define WINVER 0x0600 33 | 34 | #ifndef VC_EXTRALEAN 35 | #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 36 | #endif 37 | 38 | #include 39 | #include // MFC core and standard components 40 | 41 | // TODO: reference additional headers your program requires here 42 | 43 | #include 44 | #include "..\DSUtil\DSUtil.h" 45 | -------------------------------------------------------------------------------- /src/vsfilter/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.cpp : source file that includes just the standard includes 23 | // stdafx.pch will be the pre-compiled header 24 | // stdafx.obj will contain the pre-compiled type information 25 | 26 | #include "stdafx.h" 27 | -------------------------------------------------------------------------------- /src/vsfilter/StdAfx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | // stdafx.h : include file for standard system include files, 23 | // or project specific include files that are used frequently, 24 | // but are changed infrequently 25 | 26 | #if !defined(AFX_STDAFX_H__E8AD1C3F_323D_4812_A1DE_AA2419CE2AF3__INCLUDED_) 27 | #define AFX_STDAFX_H__E8AD1C3F_323D_4812_A1DE_AA2419CE2AF3__INCLUDED_ 28 | 29 | #if _MSC_VER > 1000 30 | #pragma once 31 | #endif // _MSC_VER > 1000 32 | 33 | #define STRICT 34 | #ifndef _WIN32_WINNT 35 | #define _WIN32_WINNT 0x0400 36 | #endif 37 | #define _ATL_APARTMENT_THREADED 38 | 39 | #include "..\DSUtil\SharedInclude.h" 40 | 41 | #include 42 | #include 43 | 44 | #include 45 | //You may derive a class from CComModule and use it if you want to override 46 | //something, but do not change the name of _Module 47 | extern CComModule _Module; 48 | #include 49 | 50 | #define AFX_CLASS AFX_CLASS_IMPORT 51 | 52 | #include 53 | #include 54 | #include "..\DSUtil\DSUtil.h" 55 | 56 | //{{AFX_INSERT_LOCATION}} 57 | // Microsoft Visual C++ will insert additional declarations immediately before the previous line. 58 | 59 | #endif // !defined(AFX_STDAFX_H__E8AD1C3F_323D_4812_A1DE_AA2419CE2AF3__INCLUDED) 60 | -------------------------------------------------------------------------------- /src/vsfilter/Systray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | extern DWORD CALLBACK SystrayThreadProc(void* pParam); 25 | -------------------------------------------------------------------------------- /src/vsfilter/TextInputPin.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #include "stdafx.h" 23 | #include "DirectVobSubFilter.h" 24 | #include "TextInputPin.h" 25 | #include "..\DSUtil\DSUtil.h" 26 | 27 | CTextInputPin::CTextInputPin(CDirectVobSubFilter* pFilter, CCritSec* pLock, CCritSec* pSubLock, HRESULT* phr) 28 | : CSubtitleInputPin(pFilter, pLock, pSubLock, phr) 29 | , m_pDVS(pFilter) 30 | { 31 | } 32 | 33 | void CTextInputPin::AddSubStream(ISubStream* pSubStream) 34 | { 35 | m_pDVS->AddSubStream(pSubStream); 36 | } 37 | 38 | void CTextInputPin::RemoveSubStream(ISubStream* pSubStream) 39 | { 40 | m_pDVS->RemoveSubStream(pSubStream); 41 | } 42 | 43 | void CTextInputPin::InvalidateSubtitle(REFERENCE_TIME rtStart, ISubStream* pSubStream) 44 | { 45 | m_pDVS->InvalidateSubtitle(rtStart, (DWORD_PTR)(ISubStream*)pSubStream); 46 | } 47 | -------------------------------------------------------------------------------- /src/vsfilter/TextInputPin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "..\subtitles\SubtitleInputPin.h" 25 | 26 | class CDirectVobSubFilter; 27 | 28 | class CTextInputPin : public CSubtitleInputPin 29 | { 30 | CDirectVobSubFilter* m_pDVS; 31 | 32 | protected: 33 | void AddSubStream(ISubStream* pSubStream); 34 | void RemoveSubStream(ISubStream* pSubStream); 35 | void InvalidateSubtitle(REFERENCE_TIME rtStart, ISubStream* pSubStream); 36 | 37 | public: 38 | CTextInputPin(CDirectVobSubFilter* pFilter, CCritSec* pLock, CCritSec* pSubLock, HRESULT* phr); 39 | }; 40 | 41 | -------------------------------------------------------------------------------- /src/vsfilter/VSFilter.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow PRIVATE 3 | DllGetClassObject PRIVATE 4 | DllRegisterServer PRIVATE 5 | DllUnregisterServer PRIVATE 6 | DirectVobSub 7 | -------------------------------------------------------------------------------- /src/vsfilter/VSFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2003-2006 Gabest 3 | * http://www.gabest.org 4 | * 5 | * This Program is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * This Program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with GNU Make; see the file COPYING. If not, write to 17 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 18 | * http://www.gnu.org/copyleft/gpl.html 19 | * 20 | */ 21 | 22 | #pragma once 23 | 24 | #include "resource.h" 25 | 26 | class CVSFilterApp : public CWinApp 27 | { 28 | public: 29 | CVSFilterApp(); 30 | 31 | CString m_AppName; 32 | 33 | protected: 34 | HINSTANCE LoadAppLangResourceDLL(); 35 | 36 | public: 37 | BOOL InitInstance(); 38 | BOOL ExitInstance(); 39 | 40 | DECLARE_MESSAGE_MAP() 41 | }; 42 | 43 | extern CVSFilterApp theApp; 44 | 45 | #define ResStr(id) CString(MAKEINTRESOURCE(id)) 46 | -------------------------------------------------------------------------------- /src/vsfilter/VSFilter.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/vsfilter/VSFilter.rc -------------------------------------------------------------------------------- /src/vsfilter/VSFilter64.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow PRIVATE 3 | DllGetClassObject PRIVATE 4 | DllRegisterServer PRIVATE 5 | DllUnregisterServer PRIVATE 6 | DirectVobSub 7 | -------------------------------------------------------------------------------- /src/vsfilter/VSFilterMod.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow PRIVATE 3 | DllGetClassObject PRIVATE 4 | DllRegisterServer PRIVATE 5 | DllUnregisterServer PRIVATE 6 | DirectVobSub 7 | -------------------------------------------------------------------------------- /src/vsfilter/VSFilterMod.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/vsfilter/VSFilterMod.rc -------------------------------------------------------------------------------- /src/vsfilter/VSFilterMod64.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow PRIVATE 3 | DllGetClassObject PRIVATE 4 | DllRegisterServer PRIVATE 5 | DllUnregisterServer PRIVATE 6 | DirectVobSub 7 | -------------------------------------------------------------------------------- /src/vsfilter/res/Icon_147.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/vsfilter/res/Icon_147.ico -------------------------------------------------------------------------------- /src/vsfilter/res/Icon_147m.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/vsfilter/res/Icon_147m.ico -------------------------------------------------------------------------------- /src/vsfilter/res/VSFilter.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | DirectVobSub 10 | 11 | 12 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/vsfilter/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/vsfilter/resource.h -------------------------------------------------------------------------------- /src/vsfilter/vfr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * VFR translation functions for OverLua 3 | * 4 | * (C) 2003-2006 Gabest 5 | * (C) 2006-2010 see AUTHORS 6 | * 7 | * This file is part of mplayerc. 8 | * 9 | * Mplayerc is free software; you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation; either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * Mplayerc is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | * 22 | */ 23 | 24 | #ifndef VFR_H 25 | #define VFR_H 26 | 27 | class VFRTranslator 28 | { 29 | public: 30 | virtual double TimeStampFromFrameNumber(int n) = 0; 31 | }; 32 | 33 | VFRTranslator *GetVFRTranslator(const char *vfrfile); 34 | 35 | #endif -------------------------------------------------------------------------------- /src/zlib/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/src/zlib/ChangeLog -------------------------------------------------------------------------------- /src/zlib/ZLIB.DEF: -------------------------------------------------------------------------------- 1 | LIBRARY 2 | ; zlib data compression library 3 | 4 | EXPORTS 5 | ; basic functions 6 | zlibVersion 7 | deflate 8 | deflateEnd 9 | inflate 10 | inflateEnd 11 | ; advanced functions 12 | deflateSetDictionary 13 | deflateCopy 14 | deflateReset 15 | deflateParams 16 | deflateTune 17 | deflateBound 18 | deflatePrime 19 | deflateSetHeader 20 | inflateSetDictionary 21 | inflateSync 22 | inflateCopy 23 | inflateReset 24 | inflateReset2 25 | inflatePrime 26 | inflateMark 27 | inflateGetHeader 28 | inflateBack 29 | inflateBackEnd 30 | zlibCompileFlags 31 | ; utility functions 32 | compress 33 | compress2 34 | compressBound 35 | uncompress 36 | gzopen 37 | gzdopen 38 | gzbuffer 39 | gzsetparams 40 | gzread 41 | gzwrite 42 | gzprintf 43 | gzputs 44 | gzgets 45 | gzputc 46 | gzgetc 47 | gzungetc 48 | gzflush 49 | gzseek 50 | gzrewind 51 | gztell 52 | gzoffset 53 | gzeof 54 | gzdirect 55 | gzclose 56 | gzclose_r 57 | gzclose_w 58 | gzerror 59 | gzclearerr 60 | ; checksum functions 61 | adler32 62 | crc32 63 | adler32_combine 64 | crc32_combine 65 | ; various hacks, don't look :) 66 | deflateInit_ 67 | deflateInit2_ 68 | inflateInit_ 69 | inflateInit2_ 70 | inflateBackInit_ 71 | zError 72 | inflateSyncPoint 73 | get_crc_table 74 | inflateUndermine 75 | -------------------------------------------------------------------------------- /src/zlib/ZLIB.RC: -------------------------------------------------------------------------------- 1 | #include 2 | #include "zlib.h" 3 | 4 | #ifdef GCC_WINDRES 5 | VS_VERSION_INFO VERSIONINFO 6 | #else 7 | VS_VERSION_INFO VERSIONINFO MOVEABLE IMPURE LOADONCALL DISCARDABLE 8 | #endif 9 | FILEVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 10 | PRODUCTVERSION ZLIB_VER_MAJOR,ZLIB_VER_MINOR,ZLIB_VER_REVISION,0 11 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 12 | #ifdef _DEBUG 13 | FILEFLAGS 1 14 | #else 15 | FILEFLAGS 0 16 | #endif 17 | FILEOS VOS__WINDOWS32 18 | FILETYPE VFT_DLL 19 | FILESUBTYPE 0 // not used 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904E4" 24 | //language ID = U.S. English, char set = Windows, Multilingual 25 | BEGIN 26 | VALUE "FileDescription", "zlib data compression library\0" 27 | VALUE "FileVersion", ZLIB_VERSION "\0" 28 | VALUE "InternalName", "zlib1.dll\0" 29 | VALUE "LegalCopyright", "(C) 1995-2006 Jean-loup Gailly & Mark Adler\0" 30 | VALUE "OriginalFilename", "zlib1.dll\0" 31 | VALUE "ProductName", "zlib\0" 32 | VALUE "ProductVersion", ZLIB_VERSION "\0" 33 | VALUE "Comments", "For more information visit http://www.zlib.net/\0" 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x0409, 1252 39 | END 40 | END 41 | -------------------------------------------------------------------------------- /src/zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2(dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (Bytef*)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt) * destLen; 40 | if((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if(err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if(err != Z_STREAM_END) 51 | { 52 | deflateEnd(&stream); 53 | return err == Z_OK ? Z_BUF_ERROR : err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = deflateEnd(&stream); 58 | return err; 59 | } 60 | 61 | /* =========================================================================== 62 | */ 63 | int ZEXPORT compress(dest, destLen, source, sourceLen) 64 | Bytef *dest; 65 | uLongf *destLen; 66 | const Bytef *source; 67 | uLong sourceLen; 68 | { 69 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 70 | } 71 | 72 | /* =========================================================================== 73 | If the default memLevel or windowBits for deflateInit() is changed, then 74 | this function needs to be updated. 75 | */ 76 | uLong ZEXPORT compressBound(sourceLen) 77 | uLong sourceLen; 78 | { 79 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 80 | (sourceLen >> 25) + 13; 81 | } 82 | -------------------------------------------------------------------------------- /src/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if(file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /src/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /src/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress(dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt) * destLen; 40 | if((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if(err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if(err != Z_STREAM_END) 50 | { 51 | inflateEnd(&stream); 52 | if(err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 53 | return Z_DATA_ERROR; 54 | return err; 55 | } 56 | *destLen = stream.total_out; 57 | 58 | err = inflateEnd(&stream); 59 | return err; 60 | } 61 | -------------------------------------------------------------------------------- /vapoursynth/sdk/examples/filter_skeleton.c: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////// 2 | // This file contains a simple filter 3 | // skeleton you can use to get started. 4 | // With no changes it simply passes 5 | // frames through. 6 | 7 | #include "VapourSynth.h" 8 | #include "VSHelper.h" 9 | 10 | typedef struct { 11 | VSNodeRef *node; 12 | const VSVideoInfo *vi; 13 | } FilterData; 14 | 15 | static void VS_CC filterInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core, const VSAPI *vsapi) { 16 | FilterData *d = (FilterData *) * instanceData; 17 | vsapi->setVideoInfo(d->vi, 1, node); 18 | } 19 | 20 | static const VSFrameRef *VS_CC filterGetFrame(int n, int activationReason, void **instanceData, void **frameData, VSFrameContext *frameCtx, VSCore *core, const VSAPI *vsapi) { 21 | FilterData *d = (FilterData *) * instanceData; 22 | 23 | if (activationReason == arInitial) { 24 | vsapi->requestFrameFilter(n, d->node, frameCtx); 25 | } else if (activationReason == arAllFramesReady) { 26 | const VSFrameRef *frame = vsapi->getFrameFilter(n, d->node, frameCtx); 27 | 28 | // your code here... 29 | 30 | return frame; 31 | } 32 | 33 | return 0; 34 | } 35 | 36 | static void VS_CC filterFree(void *instanceData, VSCore *core, const VSAPI *vsapi) { 37 | FilterData *d = (FilterData *)instanceData; 38 | vsapi->freeNode(d->node); 39 | free(d); 40 | } 41 | 42 | static void VS_CC filterCreate(const VSMap *in, VSMap *out, void *userData, VSCore *core, const VSAPI *vsapi) { 43 | FilterData d; 44 | FilterData *data; 45 | 46 | d.node = vsapi->propGetNode(in, "clip", 0, 0); 47 | d.vi = vsapi->getVideoInfo(d.node); 48 | 49 | data = malloc(sizeof(d)); 50 | *data = d; 51 | 52 | vsapi->createFilter(in, out, "Filter", filterInit, filterGetFrame, filterFree, fmParallel, 0, data, core); 53 | } 54 | 55 | ////////////////////////////////////////// 56 | // Init 57 | 58 | VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin *plugin) { 59 | configFunc("com.example.filter", "filter", "VapourSynth Filter Skeleton", VAPOURSYNTH_API_VERSION, 1, plugin); 60 | registerFunc("Filter", "clip:clip;", filterCreate, 0, plugin); 61 | } 62 | -------------------------------------------------------------------------------- /vapoursynth/sdk/lib32/vapoursynth.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/vapoursynth/sdk/lib32/vapoursynth.lib -------------------------------------------------------------------------------- /vapoursynth/sdk/lib32/vsscript.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/vapoursynth/sdk/lib32/vsscript.lib -------------------------------------------------------------------------------- /vapoursynth/sdk/lib64/vapoursynth.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/vapoursynth/sdk/lib64/vapoursynth.lib -------------------------------------------------------------------------------- /vapoursynth/sdk/lib64/vsscript.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/computerfan/VSFilterMod/b31674c1341487b706712ecc213482562687781a/vapoursynth/sdk/lib64/vsscript.lib --------------------------------------------------------------------------------