diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4636998b7..e36f06e46 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,15 +16,15 @@ on: jobs: release: name: build release - runs-on: windows-2022 + runs-on: windows-2025-vs2026 timeout-minutes: 30 steps: #checkout project - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # setup msbuild - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 # missionchooser.dll - name: Build missionchooser.dll @@ -54,15 +54,15 @@ jobs: debug: name: build debug - runs-on: windows-2022 + runs-on: windows-2025-vs2026 timeout-minutes: 30 steps: #checkout project - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 # setup msbuild - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 # missionchooser.dll - name: Build missionchooser.dll diff --git a/src/game/client/swarm/rd_tooltip_fix.cpp b/src/game/client/swarm/rd_tooltip_fix.cpp index 3e1cfccbf..e6e2ce098 100644 --- a/src/game/client/swarm/rd_tooltip_fix.cpp +++ b/src/game/client/swarm/rd_tooltip_fix.cpp @@ -26,7 +26,15 @@ static class CRD_Tooltip_Fix final : public CAutoGameSystem // There's only one method in the vtable, so let's just grab it. auto pApplySchemeSettings = **reinterpret_cast< void( vgui::Tooltip:: *const *const * )( vgui::IScheme * ) >( pTooltip ); - byte *pRealFunc = *reinterpret_cast< byte *const * >( &pApplySchemeSettings ); + #ifdef _DEBUG + // This is a thunk, so we need to grab the real one. + byte *pThunk = *reinterpret_cast( &pApplySchemeSettings ); + Assert( *pThunk == 0xE9 ); + byte *pRealFunc = pThunk + 5 + *reinterpret_cast( pThunk + 1 ); + #else + // ...except in release builds, where it's not a thunk. + byte *pRealFunc = *reinterpret_cast( &pApplySchemeSettings ); + #endif Assert( *pRealFunc == 0xB9 ); // Grab the TextEntry handle that is read at the start of the method. diff --git a/src/game/client/swarm/vgui/rd_vgui_settings_video.cpp b/src/game/client/swarm/vgui/rd_vgui_settings_video.cpp index f6246c883..5ec7b677c 100644 --- a/src/game/client/swarm/vgui/rd_vgui_settings_video.cpp +++ b/src/game/client/swarm/vgui/rd_vgui_settings_video.cpp @@ -92,6 +92,12 @@ static class CRD_VideoConfigVariableListHack : public CAutoGameSystem // Instead, we have to do this garbage: const byte *pUpdateCurrentVideoConfig = reinterpret_cast< const byte * >( &UpdateCurrentVideoConfig ); + #ifdef _DEBUG + // Gotta deal with thunks on debug builds. + Assert( *pUpdateCurrentVideoConfig == 0xE9 ); + pUpdateCurrentVideoConfig += 5 + *reinterpret_cast( pUpdateCurrentVideoConfig + 1 ); + #endif + struct VideoConfigSetting_t { const char *m_szName; diff --git a/src/game/client/swarm_sdk_client.vcxproj b/src/game/client/swarm_sdk_client.vcxproj index 66ef94e4f..c4a809487 100644 --- a/src/game/client/swarm_sdk_client.vcxproj +++ b/src/game/client/swarm_sdk_client.vcxproj @@ -17,24 +17,25 @@ Client (Swarm) {A26C0361-6B09-9E3D-5194-C9CB89243710} + 10.0 DynamicLibrary - v143 + v145 MultiByte true DynamicLibrary - v143 + v145 MultiByte true Release DynamicLibrary - v143 + v145 MultiByte @@ -54,8 +55,8 @@ <_ProjectFileVersion>12.0.30501.0 - .\Debug_swarm\ - .\Debug_swarm\ + Debug_swarm\ + Debug_swarm\ true false true @@ -66,8 +67,8 @@ ..\..\devtools\CodeAnalysisRules.ruleset - .\Release_swarm\ - .\Release_swarm\ + Release_swarm\ + Release_swarm\ true true true @@ -78,8 +79,8 @@ ..\..\devtools\CodeAnalysisRules.ruleset - .\Release_swarm\ - .\Release_swarm\ + Release_swarm\ + Release_swarm\ true true true @@ -91,20 +92,15 @@ - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + - /MP %(AdditionalOptions) Disabled .\hl2;.\swarm;.\swarm\vgui;..\statemachine;..\..\game\shared\multiplayer;..\..\game\shared\swarm;.\;..\..\common;..\..\public;..\..\public\tier0;..\..\public\tier1;..\..\game\shared;.\game_controls;$(IntDir);..\..\game\client\swarm\gameui;..\..\public\video;.\videoservices;.\videoservices\includes;%(AdditionalIncludeDirectories) WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;DLLNAME=client;VPCGAME=swarm;VPCGAMECAPS=SWARM;_DLL_EXT=.dll;COMPILER_MSVC32;COMPILER_MSVC;MEMOVERRIDE_MODULE=client;NO_STRING_T;CLIENT_DLL;VECTOR;VERSION_SAFE_STEAM_API_INTERFACES;PROTECTED_THINGS_ENABLE;ENABLE_HTMLWINDOW;fopen=dont_use_fopen;INFESTED_DLL;SWARM_DLL;HL2_EPISODIC;INFESTED_PARTICLES;GAMEUI_EMBEDDED;GAMEUI_EXPORTS;%(PreprocessorDefinitions) true - + Sync EnableFastChecks MultiThreadedDebug true @@ -114,12 +110,12 @@ if ERRORLEVEL 1 exit 1 true Use cbase.h - $(IntDir)client.pch + $(IntDir)$(TargetName).pch $(IntDir) $(IntDir) $(IntDir) false - + false $(IntDir) Level4 EditAndContinue @@ -128,17 +124,20 @@ if ERRORLEVEL 1 exit 1 26495;26812 true true + true + Default + true _DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) 0x0409 - winmm.lib;ws2_32.lib;discord-rpc.lib;legacy_stdio_definitions.lib;webmmtd.lib;%(AdditionalDependencies) + winmm.lib;ws2_32.lib;discord-rpc.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)client.dll + $(OutDir)$(TargetName)$(TargetExt) true - ..\..\lib\common\.;..\..\lib\public\.;.\videoservices\lib\win32\.;.\videoservices\lib\win32\debug\.;%(AdditionalLibraryDirectories) + ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) true $(IntDir)$(TargetName).pdb @@ -152,6 +151,7 @@ if ERRORLEVEL 1 exit 1 false /Brepro %(AdditionalOptions) true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -161,39 +161,41 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)client.bsc + $(OutDir)$(TargetName).bsc - Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd client + Publishing to ..\..\..\reactivedrop\bin\. Calling ..\..\devtools\bin\postbuild.cmd. + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b %errorlevel% +REM normalize robocopy success range (0–7) to MSBuild success (0) +cmd /c exit /b 0 + +if exist ..\..\devtools\bin\postbuild.cmd ( +  call ..\..\devtools\bin\postbuild.cmd $(TargetName) +  if %errorlevel% NEQ 0 exit /b %errorlevel% +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd ( + call ..\..\devtools\bin\sourcelink.cmd + if %errorlevel% GEQ 1 exit /b 1 +) + +exit /b 0 + + Calling ..\..\devtools\bin\sourcelink.cmd. - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + MaxSpeed @@ -205,7 +207,7 @@ if ERRORLEVEL 1 exit 1 true MultiThreaded - false + true true StreamingSIMDExtensions2 Fast @@ -213,12 +215,12 @@ if ERRORLEVEL 1 exit 1 true Use cbase.h - $(IntDir)client.pch + $(IntDir)$(TargetName).pch $(IntDir) $(IntDir) $(IntDir) false - + false $(IntDir) Level4 ProgramDatabase @@ -227,7 +229,7 @@ if ERRORLEVEL 1 exit 1 26495;26812 true true - true + false true @@ -235,11 +237,11 @@ if ERRORLEVEL 1 exit 1 0x0409 - winmm.lib;ws2_32.lib;discord-rpc.lib;legacy_stdio_definitions.lib;webm.lib;%(AdditionalDependencies) + winmm.lib;ws2_32.lib;discord-rpc.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)client.dll + $(OutDir)$(TargetName)$(TargetExt) true - ..\..\lib\common\.;..\..\lib\public\.;.\videoservices\lib\win32\.;%(AdditionalLibraryDirectories) + ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) true $(IntDir)$(TargetName).pdb @@ -259,6 +261,7 @@ if ERRORLEVEL 1 exit 1 true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -268,42 +271,43 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)client.bsc + $(OutDir)$(TargetName).bsc - Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -if exist "$(TargetDir)"$(TargetName).pdb copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd client + Publishing to ..\..\..\reactivedrop\bin\. Calling ..\..\devtools\bin\postbuild.cmd. + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b %errorlevel% +REM normalize robocopy success range (0–7) to MSBuild success (0) +cmd /c exit /b 0 + +if exist ..\..\devtools\bin\postbuild.cmd ( +  call ..\..\devtools\bin\postbuild.cmd $(TargetName) +  if %errorlevel% NEQ 0 exit /b %errorlevel% +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd ( + call ..\..\devtools\bin\sourcelink.cmd + if %errorlevel% GEQ 1 exit /b 1 +) + +exit /b 0 + + Calling ..\..\devtools\bin\sourcelink.cmd. - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + - /MP %(AdditionalOptions) MaxSpeed AnySuitable true @@ -314,7 +318,7 @@ if ERRORLEVEL 1 exit 1 MultiThreaded - false + true true StreamingSIMDExtensions2 Fast @@ -322,13 +326,12 @@ if ERRORLEVEL 1 exit 1 true Use cbase.h - $(IntDir)client.pch + $(IntDir)$(TargetName).pch $(IntDir) $(IntDir) $(IntDir) false - - + false $(IntDir) Level4 ProgramDatabase @@ -336,17 +339,18 @@ if ERRORLEVEL 1 exit 1 Prompt 26495;26812 true + true NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) 0x0409 - winmm.lib;ws2_32.lib;discord-rpc.lib;legacy_stdio_definitions.lib;webm.lib;%(AdditionalDependencies) + winmm.lib;ws2_32.lib;discord-rpc.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)client.dll + $(OutDir)$(TargetName)$(TargetExt) true - ..\..\lib\common\.;..\..\lib\public\.;.\videoservices\lib\win32\.;%(AdditionalLibraryDirectories) + ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) true $(IntDir)$(TargetName).pdb @@ -365,6 +369,7 @@ if ERRORLEVEL 1 exit 1 true true true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -374,29 +379,35 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)client.bsc + $(OutDir)$(TargetName).bsc - Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd client + Publishing to ..\..\..\reactivedrop\bin\. Calling ..\..\devtools\bin\postbuild.cmd. + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b %errorlevel% +REM normalize robocopy success range (0–7) to MSBuild success (0) +cmd /c exit /b 0 + +if exist ..\..\devtools\bin\postbuild.cmd ( +  call ..\..\devtools\bin\postbuild.cmd $(TargetName) +  if %errorlevel% NEQ 0 exit /b %errorlevel% +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd ( + call ..\..\devtools\bin\sourcelink.cmd + if %errorlevel% GEQ 1 exit /b 1 +) + +exit /b 0 + + Calling ..\..\devtools\bin\sourcelink.cmd. @@ -3599,7 +3610,18 @@ if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd clien - + + + + + + + + + + + + diff --git a/src/game/client/swarm_sdk_client.vcxproj.filters b/src/game/client/swarm_sdk_client.vcxproj.filters index 422c1b446..2b7bd4238 100644 --- a/src/game/client/swarm_sdk_client.vcxproj.filters +++ b/src/game/client/swarm_sdk_client.vcxproj.filters @@ -2262,7 +2262,16 @@ videoservices\lib - + + videoservices\lib + + + videoservices\lib + + + videoservices\lib + + videoservices\lib diff --git a/src/game/client/videoservices/includes/vpx/vp8cx.h b/src/game/client/videoservices/includes/vpx/vp8cx.h index e0b679fbb..d04095ba8 100644 --- a/src/game/client/videoservices/includes/vpx/vp8cx.h +++ b/src/game/client/videoservices/includes/vpx/vp8cx.h @@ -166,6 +166,7 @@ enum vp8e_enc_control_id { * * \note Valid range for VP8: -16..16 * \note Valid range for VP9: -9..9 + * \note A negative value (-n) is treated as its absolute value (n) in VP9. * * Supported in codecs: VP8, VP9 */ @@ -302,7 +303,7 @@ enum vp8e_enc_control_id { * the feature is off, i.e., no golden frame boost in CBR mode and * average bitrate target is used. * - * For example, to allow 100% more bits, i.e, 2X, in a golden frame + * For example, to allow 100% more bits, i.e., 2X, in a golden frame * than average frame, set this to 100. * * Supported in codecs: VP9 @@ -598,7 +599,7 @@ enum vp8e_enc_control_id { * the feature is off, i.e., no golden frame boost in CBR mode and * average bitrate target is used. * - * For example, to allow 100% more bits, i.e, 2X, in a golden frame + * For example, to allow 100% more bits, i.e., 2X, in a golden frame * than average frame, set this to 100. * * Supported in codecs: VP8 @@ -672,7 +673,7 @@ enum vp8e_enc_control_id { */ VP9E_SET_TPL, - /*!\brief Codec control function to enable postencode frame drop. + /*!\brief Codec control function to enable post encode frame drop. * * This will allow encoder to drop frame after it's encoded. * @@ -767,6 +768,24 @@ enum vp8e_enc_control_id { * */ VP9E_SET_QUANTIZER_ONE_PASS, + + /*!\brief Codec control function to enable key frame temporal filtering. + * + * Vp9 allows the encoder to run key frame temporal filtering and use it to + * improve the compression performance. To enable, set this parameter to be + * 1. The default value is set to be 0. + */ + VP9E_SET_KEY_FRAME_FILTERING, + + /*!\brief Codec control function to validate HBD input. + * + * VP9 allows the encoder to validate the high bitdepth (HBD) input and + * ensure that every pixel is within the valid range. To disable/enable, + * set this parameter to 0/1. The default value is set to be 1. + * + * Supported in codecs: VP9 + */ + VP9E_SET_VALIDATE_HBD_INPUT, }; /*!\brief vpx 1-D scaling mode @@ -793,8 +812,7 @@ typedef enum vp9e_temporal_layering_mode { VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING = 0, /*!\brief Bypass mode. - * Used when application needs to control temporal layering. - * This will only work when the number of spatial layers equals 1. + * Used when application needs to control spatial and temporal layering. */ VP9E_TEMPORAL_LAYERING_MODE_BYPASS = 1, @@ -868,7 +886,7 @@ typedef enum { VP8_EIGHT_TOKENPARTITION = 3 } vp8e_token_partitions; -/*!brief VP9 encoder content type */ +/*!\brief VP9 encoder content type */ typedef enum { VP9E_CONTENT_DEFAULT, VP9E_CONTENT_SCREEN, @@ -1097,6 +1115,10 @@ VPX_CTRL_USE_TYPE(VP8E_SET_RTC_EXTERNAL_RATECTRL, int) #define VPX_CTRL_VP8E_SET_RTC_EXTERNAL_RATECTRL VPX_CTRL_USE_TYPE(VP9E_SET_QUANTIZER_ONE_PASS, int) #define VPX_CTRL_VP9E_SET_QUANTIZER_ONE_PASS +VPX_CTRL_USE_TYPE(VP9E_SET_KEY_FRAME_FILTERING, int) +#define VPX_CTRL_VP9E_SET_KEY_FRAME_FILTERING +VPX_CTRL_USE_TYPE(VP9E_SET_VALIDATE_HBD_INPUT, int) +#define VPX_CTRL_VP9E_SET_VALIDATE_HBD_INPUT /*!\endcond */ /*! @} - end defgroup vp8_encoder */ diff --git a/src/game/client/videoservices/includes/vpx/vpx_codec.h b/src/game/client/videoservices/includes/vpx/vpx_codec.h index b0a931e01..602889773 100644 --- a/src/game/client/videoservices/includes/vpx/vpx_codec.h +++ b/src/game/client/videoservices/includes/vpx/vpx_codec.h @@ -50,7 +50,7 @@ extern "C" { /*!\brief Decorator indicating a function is deprecated */ #ifndef VPX_DEPRECATED -#if defined(__GNUC__) && __GNUC__ +#if defined(__GNUC__) #define VPX_DEPRECATED __attribute__((deprecated)) #elif defined(_MSC_VER) #define VPX_DEPRECATED @@ -60,7 +60,7 @@ extern "C" { #endif /* VPX_DEPRECATED */ #ifndef VPX_DECLSPEC_DEPRECATED -#if defined(__GNUC__) && __GNUC__ +#if defined(__GNUC__) #define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */ #elif defined(_MSC_VER) /*!\brief \copydoc #VPX_DEPRECATED */ @@ -318,19 +318,21 @@ const char *vpx_codec_err_to_string(vpx_codec_err_t err); * \param[in] ctx Pointer to this instance's context. * */ -const char *vpx_codec_error(vpx_codec_ctx_t *ctx); +const char *vpx_codec_error(const vpx_codec_ctx_t *ctx); /*!\brief Retrieve detailed error information for codec context * * Returns a human readable string providing detailed information about - * the last error. + * the last error. The returned string is only valid until the next + * vpx_codec_* function call (except vpx_codec_error and + * vpx_codec_error_detail) on the codec context. * * \param[in] ctx Pointer to this instance's context. * * \retval NULL * No detailed information is available. */ -const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx); +const char *vpx_codec_error_detail(const vpx_codec_ctx_t *ctx); /* REQUIRED FUNCTIONS * @@ -345,9 +347,11 @@ const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx); * \param[in] ctx Pointer to this instance's context * * \retval #VPX_CODEC_OK - * The codec algorithm initialized. - * \retval #VPX_CODEC_MEM_ERROR - * Memory allocation failed. + * The codec instance has been destroyed. + * \retval #VPX_CODEC_INVALID_PARAM + * ctx is a null pointer. + * \retval #VPX_CODEC_ERROR + * Codec context not initialized. */ vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx); diff --git a/src/game/client/videoservices/includes/vpx/vpx_decoder.h b/src/game/client/videoservices/includes/vpx/vpx_decoder.h index 39e5f585f..911ffaa52 100644 --- a/src/game/client/videoservices/includes/vpx/vpx_decoder.h +++ b/src/game/client/videoservices/includes/vpx/vpx_decoder.h @@ -29,7 +29,7 @@ extern "C" { #endif -#include "./vpx_codec.h" +#include "./vpx_codec.h" // IWYU pragma: export #include "./vpx_frame_buffer.h" /*!\brief Current ABI version number @@ -60,7 +60,7 @@ extern "C" { #define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000 /*!\brief Can support frame-based multi-threading */ #define VPX_CODEC_CAP_FRAME_THREADING 0x200000 -/*!brief Can support external frame buffers */ +/*!\brief Can support external frame buffers */ #define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000 /*! \brief Initialization-time Feature Enabling @@ -120,6 +120,10 @@ typedef struct vpx_codec_dec_cfg { * is not thread safe and should be guarded with a lock if being used * in a multithreaded context. * + * On success, vpx_codec_destroy() must be used to free resources allocated for + * the decoder context. If vpx_codec_dec_init_ver() fails, it is not necessary + * to call vpx_codec_destroy() on the decoder context. + * * \param[in] ctx Pointer to this instance's context. * \param[in] iface Pointer to the algorithm interface to use. * \param[in] cfg Configuration to use, if known. May be NULL. @@ -127,7 +131,7 @@ typedef struct vpx_codec_dec_cfg { * \param[in] ver ABI version number. Must be set to * VPX_DECODER_ABI_VERSION * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. + * The decoder algorithm has been initialized. * \retval #VPX_CODEC_MEM_ERROR * Memory allocation failed. */ @@ -152,7 +156,7 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx, * \param[in] iface Pointer to the algorithm interface * \param[in] data Pointer to a block of data to parse * \param[in] data_sz Size of the data buffer - * \param[in,out] si Pointer to stream info to update. The size member + * \param[in,out] si Pointer to stream info to update. The sz member * \ref MUST be properly initialized, but \ref MAY be * clobbered by the algorithm. This parameter \ref MAY * be NULL. @@ -170,7 +174,7 @@ vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface, * Returns information about the stream that has been parsed during decoding. * * \param[in] ctx Pointer to this instance's context - * \param[in,out] si Pointer to stream info to update. The size member + * \param[in,out] si Pointer to stream info to update. The sz member * \ref MUST be properly initialized, but \ref MAY be * clobbered by the algorithm. This parameter \ref MAY * be NULL. @@ -205,6 +209,8 @@ vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx, * this frame. * \param[in] deadline Soft deadline the decoder should attempt to meet, * in us. Set to zero for unlimited. + * NOTE: The deadline parameter is ignored. Always + * pass 0. * * \return Returns #VPX_CODEC_OK if the coded data was processed completely * and future pictures can be decoded without error. Otherwise, diff --git a/src/game/client/videoservices/includes/vpx/vpx_encoder.h b/src/game/client/videoservices/includes/vpx/vpx_encoder.h index efaf5ef36..2671fb3b7 100644 --- a/src/game/client/videoservices/includes/vpx/vpx_encoder.h +++ b/src/game/client/videoservices/includes/vpx/vpx_encoder.h @@ -29,7 +29,7 @@ extern "C" { #endif -#include "./vpx_codec.h" +#include "./vpx_codec.h" // IWYU pragma: export #include "./vpx_ext_ratectrl.h" /*! Temporal Scalability: Maximum length of the sequence defining frame @@ -56,9 +56,14 @@ extern "C" { * must be bumped. Examples include, but are not limited to, changing * types, removing or reassigning enums, adding/removing/rearranging * fields to structures + * + * \note + * VPX_ENCODER_ABI_VERSION has a VPX_EXT_RATECTRL_ABI_VERSION component + * because the VP9E_SET_EXTERNAL_RATE_CONTROL codec control uses + * vpx_rc_funcs_t. */ #define VPX_ENCODER_ABI_VERSION \ - (15 + VPX_CODEC_ABI_VERSION + \ + (18 + VPX_CODEC_ABI_VERSION + \ VPX_EXT_RATECTRL_ABI_VERSION) /**<\hideinitializer*/ /*! \brief Encoder capabilities bitfield @@ -188,6 +193,7 @@ typedef struct vpx_codec_cx_pkt { unsigned int samples[4]; /**< Number of samples, total/y/u/v */ uint64_t sse[4]; /**< sum squared error, total/y/u/v */ double psnr[4]; /**< PSNR, total/y/u/v */ + int spatial_layer_id; /**< Spatial layer id */ } psnr; /**< data for PSNR packet */ vpx_fixed_buf_t raw; /**< data for arbitrary packets */ @@ -261,6 +267,8 @@ enum vpx_kf_mode { */ typedef long vpx_enc_frame_flags_t; #define VPX_EFLAG_FORCE_KF (1 << 0) /**< Force this frame to be a keyframe */ +/** Calculate PSNR on this frame, requires g_lag_in_frames to be 0 */ +#define VPX_EFLAG_CALCULATE_PSNR (1 << 1) /*!\brief Encoder configuration structure * @@ -323,11 +331,15 @@ typedef struct vpx_codec_enc_cfg { */ vpx_bit_depth_t g_bit_depth; - /*!\brief Bit-depth of the input frames + /*!\brief Bit-depth of the input source * - * This value identifies the bit_depth of the input frames in bits. - * Note that the frames passed as input to the encoder must have - * this bit-depth. + * This value identifies the actual bit-depth of the input source in bits. It + * must not exceed codec bit-depth. Note that the frames passed as input to + * the encoder must match codec bit-depth. So, if there is a mismatch between + * source bit-depth and codec bit-depth, the application is required to + * upshift the frame to the codec bit-depth before passing it for encoding. + * This is only used for computing quality metrics relative to the actual + * input source and has no effect on the encoder's output. */ unsigned int g_input_bit_depth; @@ -459,6 +471,8 @@ typedef struct vpx_codec_enc_cfg { /*!\brief Target data rate * * Target bitrate to use for this stream, in kilobits per second. + * Internally capped to the smaller of the uncompressed bitrate and + * 1000000 kilobits per second. */ unsigned int rc_target_bitrate; @@ -858,7 +872,7 @@ typedef struct vpx_svc_parameters { /*!\brief Initialize an encoder instance * - * Initializes a encoder context using the given interface. Applications + * Initializes an encoder context using the given interface. Applications * should call the vpx_codec_enc_init convenience macro instead of this * function directly, to ensure that the ABI version number parameter * is properly initialized. @@ -867,9 +881,13 @@ typedef struct vpx_svc_parameters { * is not thread safe and should be guarded with a lock if being used * in a multithreaded context. * + * On success, vpx_codec_destroy() must be used to free resources allocated for + * the encoder context. If vpx_codec_enc_init_ver() fails, it is not necessary + * to call vpx_codec_destroy() on the encoder context. + * * \param[in] ctx Pointer to this instance's context. * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. + * \param[in] cfg Configuration to use. * \param[in] flags Bitfield of VPX_CODEC_USE_* flags * \param[in] ver ABI version number. Must be set to * VPX_ENCODER_ABI_VERSION @@ -892,27 +910,32 @@ vpx_codec_err_t vpx_codec_enc_init_ver(vpx_codec_ctx_t *ctx, /*!\brief Initialize multi-encoder instance * - * Initializes multi-encoder context using the given interface. + * Initializes multiple encoder contexts using the given interface. * Applications should call the vpx_codec_enc_init_multi convenience macro * instead of this function directly, to ensure that the ABI version number * parameter is properly initialized. * - * \param[in] ctx Pointer to this instance's context. + * \param[in] ctx Pointer to an array of num_enc instances' contexts. * \param[in] iface Pointer to the algorithm interface to use. - * \param[in] cfg Configuration to use, if known. May be NULL. + * \param[in] cfg An array of num_enc configurations to use. * \param[in] num_enc Total number of encoders. * \param[in] flags Bitfield of VPX_CODEC_USE_* flags - * \param[in] dsf Pointer to down-sampling factors. + * \param[in] dsf Pointer to an array of num_enc down-sampling factors. * \param[in] ver ABI version number. Must be set to * VPX_ENCODER_ABI_VERSION * \retval #VPX_CODEC_OK - * The decoder algorithm initialized. + * The encoder algorithm has been initialized. * \retval #VPX_CODEC_MEM_ERROR * Memory allocation failed. + * + * \note + * This is only supported by VP8. iface must point to the interface to the VP8 + * encoder. */ vpx_codec_err_t vpx_codec_enc_init_multi_ver( - vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface, vpx_codec_enc_cfg_t *cfg, - int num_enc, vpx_codec_flags_t flags, vpx_rational_t *dsf, int ver); + vpx_codec_ctx_t *ctx, vpx_codec_iface_t *iface, + const vpx_codec_enc_cfg_t *cfg, int num_enc, vpx_codec_flags_t flags, + const vpx_rational_t *dsf, int ver); /*!\brief Convenience macro for vpx_codec_enc_init_multi_ver() * @@ -966,21 +989,36 @@ vpx_codec_err_t vpx_codec_enc_config_set(vpx_codec_ctx_t *ctx, * * Retrieves a stream level global header packet, if supported by the codec. * + * \li VP8: Unsupported + * \li VP9: Returns a buffer of ID (1 byte)|Length (1 byte)|Length + * bytes values. The function should be called after encoding to retrieve + * the most accurate information. + * * \param[in] ctx Pointer to this instance's context * * \retval NULL * Encoder does not support global header * \retval Non-NULL - * Pointer to buffer containing global header packet + * Pointer to buffer containing global header packet. The buffer pointer + * and its contents are only valid for the lifetime of \a ctx. The contents + * may change in subsequent calls to the function. + * \sa + * https://www.webmproject.org/docs/container/#vp9-codec-feature-metadata-codecprivate */ vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); +/*!\brief Encode Deadline + * + * This type indicates a deadline, in microseconds, to be passed to + * vpx_codec_encode(). + */ +typedef unsigned long vpx_enc_deadline_t; /*!\brief deadline parameter analogous to VPx REALTIME mode. */ -#define VPX_DL_REALTIME (1) +#define VPX_DL_REALTIME 1ul /*!\brief deadline parameter analogous to VPx GOOD QUALITY mode. */ -#define VPX_DL_GOOD_QUALITY (1000000) +#define VPX_DL_GOOD_QUALITY 1000000ul /*!\brief deadline parameter analogous to VPx BEST QUALITY mode. */ -#define VPX_DL_BEST_QUALITY (0) +#define VPX_DL_BEST_QUALITY 0ul /*!\brief Encode a frame * * Encodes a video frame at the given "presentation time." The presentation @@ -1005,6 +1043,8 @@ vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); * * \param[in] ctx Pointer to this instance's context * \param[in] img Image data to encode, NULL to flush. + * Encoding sample values outside the range + * [0..(1<bit_depth)-1] is undefined behavior. * \param[in] pts Presentation time stamp, in timebase units. * \param[in] duration Duration to show frame, in timebase units. * \param[in] flags Flags to use for encoding this frame. @@ -1020,7 +1060,7 @@ vpx_fixed_buf_t *vpx_codec_get_global_headers(vpx_codec_ctx_t *ctx); vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, const vpx_image_t *img, vpx_codec_pts_t pts, unsigned long duration, vpx_enc_frame_flags_t flags, - unsigned long deadline); + vpx_enc_deadline_t deadline); /*!\brief Set compressed data output buffer * @@ -1064,6 +1104,12 @@ vpx_codec_err_t vpx_codec_encode(vpx_codec_ctx_t *ctx, const vpx_image_t *img, * The buffer was set successfully. * \retval #VPX_CODEC_INVALID_PARAM * A parameter was NULL, the image format is unsupported, etc. + * + * \note + * `duration` and `deadline` are of the unsigned long type, which can be 32 + * or 64 bits. `duration` and `deadline` must be less than or equal to + * UINT32_MAX so that their ranges are independent of the size of unsigned + * long. */ vpx_codec_err_t vpx_codec_set_cx_data_buf(vpx_codec_ctx_t *ctx, const vpx_fixed_buf_t *buf, diff --git a/src/game/client/videoservices/includes/vpx/vpx_ext_ratectrl.h b/src/game/client/videoservices/includes/vpx/vpx_ext_ratectrl.h index 3c5fc8cfc..1c502f810 100644 --- a/src/game/client/videoservices/includes/vpx/vpx_ext_ratectrl.h +++ b/src/game/client/videoservices/includes/vpx/vpx_ext_ratectrl.h @@ -8,6 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ +/*!\file + * \brief Defines structs and callbacks needed for external rate control. + * + */ #ifndef VPX_VPX_VPX_EXT_RATECTRL_H_ #define VPX_VPX_VPX_EXT_RATECTRL_H_ @@ -16,6 +20,7 @@ extern "C" { #endif #include "./vpx_integer.h" +#include "./vpx_tpl.h" /*!\brief Current ABI version number * @@ -25,32 +30,91 @@ extern "C" { * types, removing or reassigning enums, adding/removing/rearranging * fields to structures. */ -#define VPX_EXT_RATECTRL_ABI_VERSION (6) +#define VPX_EXT_RATECTRL_ABI_VERSION (7 + VPX_TPL_ABI_VERSION) + +/*!\brief Corresponds to MAX_STATIC_GF_GROUP_LENGTH defined in vp9_ratectrl.h + */ +#define VPX_RC_MAX_STATIC_GF_GROUP_LENGTH 250 -/*!\brief The control type of the inference API. - * In VPX_RC_QP mode, the external rate control model determines the - * quantization parameter (QP) for each frame. - * In VPX_RC_GOP mode, the external rate control model determines the - * group of picture (GOP) of the video sequence. - * In VPX_RC_RDMULT mode, the external rate control model determines the - * rate-distortion multiplier (rdmult) for the current frame. - * In VPX_RC_GOP_QP mode, the external rate control model determines - * both the QP and the GOP. - * In VPX_RC_GOP_QP_RDMULT mode, the external rate control model determines - * the QP, GOP and the rdmult. +/*!\brief Max number of ref frames returned by the external RC. + * + * Corresponds to MAX_REF_FRAMES defined in vp9_blockd.h. + */ +#define VPX_RC_MAX_REF_FRAMES 4 + +/*!\brief The type of the external rate control. + * + * This controls what encoder parameters are determined by the external rate + * control. */ typedef enum vpx_rc_type { + /*! + * The external rate control doesn't determine anything. + * This mode is used as baseline. + */ + VPX_RC_NONE = 0, + /*! + * The external rate control model determines the quantization parameter (QP) + * for each frame. + */ VPX_RC_QP = 1 << 0, + /*! + * The external rate control model determines the group of picture (GOP) of + * the video sequence. + */ VPX_RC_GOP = 1 << 1, + /*! + * The external rate control model determines the rate-distortion multiplier + * (rdmult) for the current frame. + */ VPX_RC_RDMULT = 1 << 2, + /*! + * The external rate control model determines both QP and GOP. + */ VPX_RC_GOP_QP = VPX_RC_QP | VPX_RC_GOP, + /*! + * The external rate control model determines the QP, GOP and the rdmult. + */ VPX_RC_GOP_QP_RDMULT = VPX_RC_QP | VPX_RC_GOP | VPX_RC_RDMULT } vpx_rc_type_t; +/*!\brief The rate control mode for the external rate control model. + */ +typedef enum vpx_ext_rc_mode { + VPX_RC_QMODE = 0, + VPX_RC_VBR = 1, + VPX_RC_CQ = 2, +} vpx_ext_rc_mode_t; + +/*!\brief Corresponds to FRAME_UPDATE_TYPE defined in vp9_firstpass.h. + */ +typedef enum vpx_rc_frame_update_type { + VPX_RC_INVALID_UPDATE_TYPE = -1, + VPX_RC_KF_UPDATE = 0, + VPX_RC_LF_UPDATE = 1, + VPX_RC_GF_UPDATE = 2, + VPX_RC_ARF_UPDATE = 3, + VPX_RC_OVERLAY_UPDATE = 4, + VPX_RC_MID_OVERLAY_UPDATE = 5, + VPX_RC_USE_BUF_FRAME = 6, +} vpx_rc_frame_update_type_t; + +/*!\brief Name for the ref frames returned by the external RC. + * + * Corresponds to the ref frames defined in vp9_blockd.h. + */ +typedef enum vpx_rc_ref_name { + VPX_RC_INVALID_REF_FRAME = -1, + VPX_RC_INTRA_FRAME = 0, + VPX_RC_LAST_FRAME = 1, + VPX_RC_GOLDEN_FRAME = 2, + VPX_RC_ALTREF_FRAME = 3, +} vpx_rc_ref_name_t; + /*!\brief Abstract rate control model handler * - * The encoder will receive the model handler from create_model() defined in - * vpx_rc_funcs_t. + * The encoder will receive the model handler from + * vpx_rc_funcs_t::create_model(). */ typedef void *vpx_rc_model_t; @@ -68,27 +132,35 @@ typedef void *vpx_rc_model_t; */ #define VPX_DEFAULT_RDMULT -1 +/*!\brief Superblock quantization parameters + * Store the superblock quantization parameters + */ +typedef struct sb_parameters { + int q_index; /**< Quantizer step index [0..255]*/ + int rdmult; /**< Superblock level Lagrangian multiplier*/ +} sb_params; + /*!\brief Encode frame decision made by the external rate control model * * The encoder will receive the decision from the external rate control model - * through get_encodeframe_decision() defined in vpx_rc_funcs_t. - * - * If q_index = VPX_DEFAULT_Q, the encoder will use libvpx's default q. - * - * If max_frame_size = 0, the encoding ignores max frame size limit. - * If max_frame_size = -1, the encoding uses VP9's max frame size as the limit. - * If the encoded frame size is larger than max_frame_size, the frame is - * recoded to meet the size limit, following VP9's recoding principles. + * through vpx_rc_funcs_t::get_encodeframe_decision(). */ typedef struct vpx_rc_encodeframe_decision { - int q_index; /**< Quantizer step index [0..255]*/ - int max_frame_size; /**< Maximal frame size allowed to encode a frame*/ + int q_index; /**< Required: Quantizer step index [0..255]*/ + int rdmult; /**< Required: Frame level Lagrangian multiplier*/ + int delta_q_uv; /**< Required: Delta QP for UV */ + /*! + * Optional: Superblock quantization parameters + * It is zero initialized by default. It will be set for key and ARF frames + * but not leaf frames. + */ + sb_params *sb_params_list; } vpx_rc_encodeframe_decision_t; /*!\brief Information for the frame to be encoded. * * The encoder will send the information to external rate control model through - * get_encodeframe_decision() defined in vpx_rc_funcs_t. + * vpx_rc_funcs_t::get_encodeframe_decision(). * */ typedef struct vpx_rc_encodeframe_info { @@ -126,12 +198,10 @@ typedef struct vpx_rc_encodeframe_info { /*!\brief Frame coding result * * The encoder will send the result to the external rate control model through - * update_encodeframe_result() defined in vpx_rc_funcs_t. + * vpx_rc_funcs_t::update_encodeframe_result(). */ typedef struct vpx_rc_encodeframe_result { - int64_t sse; /**< sum of squared error of the reconstructed frame */ - int64_t bit_count; /**< number of bits spent on coding the frame*/ - int64_t pixel_count; /**< number of pixels in YUV planes of the frame*/ + int64_t bit_count; /**< number of bits spent on coding the frame*/ int actual_encoding_qindex; /**< the actual qindex used to encode the frame*/ } vpx_rc_encodeframe_result_t; @@ -271,6 +341,10 @@ typedef struct vpx_rc_frame_stats { * number of frames whose stats are accumulated. */ double count; + /*! + * Number of new mv in a frame. + */ + double new_mv_count; } vpx_rc_frame_stats_t; /*!\brief Collection of first pass frame stats @@ -294,83 +368,41 @@ typedef struct vpx_rc_config { int frame_width; /**< frame width */ int frame_height; /**< frame height */ int show_frame_count; /**< number of visible frames in the video */ + int max_gf_interval; /**< max GOP size in number of show frames */ + int min_gf_interval; /**< min GOP size in number of show frames */ /*! * Target bitrate in kilobytes per second */ int target_bitrate_kbps; int frame_rate_num; /**< numerator of frame rate */ int frame_rate_den; /**< denominator of frame rate */ + /*! + * The following fields are only for external rate control models that support + * different rate control modes. + */ + vpx_ext_rc_mode_t rc_mode; /**< Q mode or VBR mode */ + int overshoot_percent; /**< for VBR mode only */ + int undershoot_percent; /**< for VBR mode only */ + int min_base_q_index; /**< for VBR mode only */ + int max_base_q_index; /**< for VBR mode only */ + int base_qp; /**< base QP for leaf frames, 0-255 */ } vpx_rc_config_t; -/*!\brief Information passed to the external rate control model to - * help make GOP decisions. +/*!\brief Control what ref frame to use and its index. */ -typedef struct vpx_rc_gop_info { - /*! - * Minimum allowed gf interval, fixed for the whole clip. - * Note that it will be modified to match vp9's level constraints - * in the encoder. - * The level constraint is defined in vp9_encoder.c: - * const Vp9LevelSpec vp9_level_defs[VP9_LEVELS]. - */ - int min_gf_interval; - /*! - * Maximum allowed gf interval, fixed for the whole clip. - */ - int max_gf_interval; - /*! - * Minimum allowed gf interval for the current GOP, determined - * by the encoder. - */ - int active_min_gf_interval; +typedef struct vpx_rc_ref_frame { /*! - * Maximum allowed gf interval for the current GOP, determined - * by the encoder. + * Ref frame index. Corresponding to |lst_fb_idx|, |gld_fb_idx| or + * |alt_fb_idx| in VP9_COMP depending on the ref frame #name. */ - int active_max_gf_interval; + int index[VPX_RC_MAX_REF_FRAMES]; /*! - * Whether to allow the use of alt ref, determined by the encoder. - * It is fixed for the entire encode. - * See function "is_altref_enabled" in vp9_encoder.h. + * Ref frame name. This decides whether the #index is used as + * |lst_fb_idx|, |gld_fb_idx| or |alt_fb_idx| in VP9_COMP. + * */ - int allow_alt_ref; - /*! - * Is the current frame a key frame. - */ - int is_key_frame; - /*! - * Does the previous gop use alt ref or not. - */ - int last_gop_use_alt_ref; - /*! - * Current frame distance to the last keyframe, e.g., if Nth frame is a key, - * then the value of the N+1 th frame is 1. - */ - int frames_since_key; - /*! - * Current frame distance to the next keyframe, e.g. if Nth frame is a key, - * then the value of frame N - 1 is 1. - */ - int frames_to_key; - /*! - * Number of lookahead source frames. - */ - int lag_in_frames; - /*! - * Display index (temporal stamp) of this frame in the whole clip, - * starts from zero. - */ - int show_index; - /*! - * Coding index of this frame in the whole clip, starts from zero. - */ - int coding_index; - /*! - * The index of the current gop, starts from zero, resets to zero - * when a keyframe is set. - */ - int gop_global_index; -} vpx_rc_gop_info_t; + vpx_rc_ref_name_t name[VPX_RC_MAX_REF_FRAMES]; +} vpx_rc_ref_frame_t; /*!\brief The decision made by the external rate control model to set the * group of picture. @@ -378,20 +410,39 @@ typedef struct vpx_rc_gop_info { typedef struct vpx_rc_gop_decision { int gop_coding_frames; /**< The number of frames of this GOP */ int use_alt_ref; /**< Whether to use alt ref for this GOP */ + int use_key_frame; /**< Whether to set key frame for this GOP */ + /*! + * Frame type for each frame in this GOP. + * This will be populated to |update_type| in GF_GROUP defined in + * vp9_firstpass.h + */ + vpx_rc_frame_update_type_t update_type[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2]; + /*! Ref frame buffer index to be updated for each frame in this GOP. */ + int update_ref_index[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2]; + /*! Ref frame list to be used for each frame in this GOP. */ + vpx_rc_ref_frame_t ref_frame_list[VPX_RC_MAX_STATIC_GF_GROUP_LENGTH + 2]; } vpx_rc_gop_decision_t; +/*!\brief The decision made by the external rate control model to set the + * key frame location and the show frame count in the key frame group + */ +typedef struct vpx_rc_key_frame_decision { + int key_frame_show_index; /**< This key frame's show index in the video */ + int key_frame_group_size; /**< Show frame count of this key frame group */ +} vpx_rc_key_frame_decision_t; + /*!\brief Create an external rate control model callback prototype * * This callback is invoked by the encoder to create an external rate control * model. * - * \param[in] priv Callback's private data - * \param[in] ratectrl_config Pointer to vpx_rc_config_t - * \param[out] rate_ctrl_model_pt Pointer to vpx_rc_model_t + * \param[in] priv Callback's private data + * \param[in] ratectrl_config Pointer to vpx_rc_config_t + * \param[out] rate_ctrl_model_ptr Pointer to vpx_rc_model_t */ typedef vpx_rc_status_t (*vpx_rc_create_model_cb_fn_t)( void *priv, const vpx_rc_config_t *ratectrl_config, - vpx_rc_model_t *rate_ctrl_model_pt); + vpx_rc_model_t *rate_ctrl_model_ptr); /*!\brief Send first pass stats to the external rate control model callback * prototype @@ -406,18 +457,29 @@ typedef vpx_rc_status_t (*vpx_rc_send_firstpass_stats_cb_fn_t)( vpx_rc_model_t rate_ctrl_model, const vpx_rc_firstpass_stats_t *first_pass_stats); +/*!\brief Send TPL stats for the current GOP to the external rate control model + * callback prototype + * + * This callback is invoked by the encoder to send TPL stats for the GOP to the + * external rate control model. + * + * \param[in] rate_ctrl_model rate control model + * \param[in] tpl_gop_stats TPL stats for current GOP + */ +typedef vpx_rc_status_t (*vpx_rc_send_tpl_gop_stats_cb_fn_t)( + vpx_rc_model_t rate_ctrl_model, const VpxTplGopStats *tpl_gop_stats); + /*!\brief Receive encode frame decision callback prototype * * This callback is invoked by the encoder to receive encode frame decision from * the external rate control model. * * \param[in] rate_ctrl_model rate control model - * \param[in] encode_frame_info information of the coding frame + * \param[in] frame_gop_index index of the frame in current gop * \param[out] frame_decision encode decision of the coding frame */ typedef vpx_rc_status_t (*vpx_rc_get_encodeframe_decision_cb_fn_t)( - vpx_rc_model_t rate_ctrl_model, - const vpx_rc_encodeframe_info_t *encode_frame_info, + vpx_rc_model_t rate_ctrl_model, const int frame_gop_index, vpx_rc_encodeframe_decision_t *frame_decision); /*!\brief Update encode frame result callback prototype @@ -432,18 +494,28 @@ typedef vpx_rc_status_t (*vpx_rc_update_encodeframe_result_cb_fn_t)( vpx_rc_model_t rate_ctrl_model, const vpx_rc_encodeframe_result_t *encode_frame_result); +/*!\brief Get the key frame decision from the external rate control model. + * + * This callback is invoked by the encoder to get key frame decision from + * the external rate control model. + * + * \param[in] rate_ctrl_model rate control model + * \param[out] key_frame_decision key frame decision from the model + */ +typedef vpx_rc_status_t (*vpx_rc_get_key_frame_decision_cb_fn_t)( + vpx_rc_model_t rate_ctrl_model, + vpx_rc_key_frame_decision_t *key_frame_decision); + /*!\brief Get the GOP structure from the external rate control model. * * This callback is invoked by the encoder to get GOP decisions from * the external rate control model. * * \param[in] rate_ctrl_model rate control model - * \param[in] gop_info information collected from the encoder * \param[out] gop_decision GOP decision from the model */ typedef vpx_rc_status_t (*vpx_rc_get_gop_decision_cb_fn_t)( - vpx_rc_model_t rate_ctrl_model, const vpx_rc_gop_info_t *gop_info, - vpx_rc_gop_decision_t *gop_decision); + vpx_rc_model_t rate_ctrl_model, vpx_rc_gop_decision_t *gop_decision); /*!\brief Get the frame rdmult from the external rate control model. * @@ -472,7 +544,7 @@ typedef vpx_rc_status_t (*vpx_rc_delete_model_cb_fn_t)( * * The user can enable external rate control by registering * a set of callback functions with the codec control flag - * VP9E_SET_EXTERNAL_RATE_CONTROL. + * #VP9E_SET_EXTERNAL_RATE_CONTROL. */ typedef struct vpx_rc_funcs { /*! @@ -487,6 +559,10 @@ typedef struct vpx_rc_funcs { * Send first pass stats to the external rate control model. */ vpx_rc_send_firstpass_stats_cb_fn_t send_firstpass_stats; + /*! + * Send TPL stats for current GOP to the external rate control model. + */ + vpx_rc_send_tpl_gop_stats_cb_fn_t send_tpl_gop_stats; /*! * Get encodeframe decision from the external rate control model. */ @@ -495,6 +571,10 @@ typedef struct vpx_rc_funcs { * Update encodeframe result to the external rate control model. */ vpx_rc_update_encodeframe_result_cb_fn_t update_encodeframe_result; + /*! + * Get key frame decision from the external rate control model. + */ + vpx_rc_get_key_frame_decision_cb_fn_t get_key_frame_decision; /*! * Get GOP decisions from the external rate control model. */ @@ -507,6 +587,11 @@ typedef struct vpx_rc_funcs { * Delete the external rate control model. */ vpx_rc_delete_model_cb_fn_t delete_model; + + /*! + * Rate control log path. + */ + const char *rate_ctrl_log_path; /*! * Private data for the external rate control model. */ diff --git a/src/game/client/videoservices/includes/vpx/vpx_image.h b/src/game/client/videoservices/includes/vpx/vpx_image.h index 1adc9b9d9..c95d3a777 100644 --- a/src/game/client/videoservices/includes/vpx/vpx_image.h +++ b/src/game/client/videoservices/includes/vpx/vpx_image.h @@ -64,8 +64,12 @@ typedef enum vpx_color_space { /*!\brief List of supported color range */ typedef enum vpx_color_range { - VPX_CR_STUDIO_RANGE = 0, /**< Y [16..235], UV [16..240] */ - VPX_CR_FULL_RANGE = 1 /**< YUV/RGB [0..255] */ + VPX_CR_STUDIO_RANGE = 0, /**<- Y [16..235], UV [16..240] (bit depth 8) */ + /**<- Y [64..940], UV [64..960] (bit depth 10) */ + /**<- Y [256..3760], UV [256..3840] (bit depth 12) */ + VPX_CR_FULL_RANGE = 1 /**<- YUV/RGB [0..255] (bit depth 8) */ + /**<- YUV/RGB [0..1023] (bit depth 10) */ + /**<- YUV/RGB [0..4095] (bit depth 12) */ } vpx_color_range_t; /**< alias for enum vpx_color_range */ /**\brief Image Descriptor */ @@ -98,7 +102,12 @@ typedef struct vpx_image { #define VPX_PLANE_V 2 /**< V (Chroma) plane */ #define VPX_PLANE_ALPHA 3 /**< A (Transparency) plane */ unsigned char *planes[4]; /**< pointer to the top left pixel for each plane */ - int stride[4]; /**< stride between rows for each plane */ + /*!Stride between rows for each plane + * + * \note With planar formats, \c stride[VPX_PLANE_U] must be the same as \c + * stride[VPX_PLANE_V]. + */ + int stride[4]; int bps; /**< bits per sample (for packed formats) */ @@ -126,16 +135,19 @@ typedef struct vpx_image_rect { /*!\brief Open a descriptor, allocating storage for the underlying image * * Returns a descriptor for storing an image of the given format. The - * storage for the descriptor is allocated on the heap. + * storage for the image is allocated on the heap. * * \param[in] img Pointer to storage for descriptor. If this parameter * is NULL, the storage for the descriptor will be * allocated on the heap. * \param[in] fmt Format for the image - * \param[in] d_w Width of the image - * \param[in] d_h Height of the image + * \param[in] d_w Width of the image. Must not exceed 0x08000000 + * (2^27). + * \param[in] d_h Height of the image. Must not exceed 0x08000000 + * (2^27). * \param[in] align Alignment, in bytes, of the image buffer and - * each row in the image(stride). + * each row in the image (stride). Must not exceed + * 65536. * * \return Returns a pointer to the initialized image descriptor. If the img * parameter is non-null, the value of the img parameter will be @@ -148,21 +160,55 @@ vpx_image_t *vpx_img_alloc(vpx_image_t *img, vpx_img_fmt_t fmt, /*!\brief Open a descriptor, using existing storage for the underlying image * * Returns a descriptor for storing an image of the given format. The - * storage for descriptor has been allocated elsewhere, and a descriptor is + * storage for the image has been allocated elsewhere, and a descriptor is * desired to "wrap" that storage. * * \param[in] img Pointer to storage for descriptor. If this * parameter is NULL, the storage for the descriptor * will be allocated on the heap. * \param[in] fmt Format for the image - * \param[in] d_w Width of the image - * \param[in] d_h Height of the image - * \param[in] stride_align Alignment, in bytes, of each row in the image. - * \param[in] img_data Storage to use for the image + * \param[in] d_w Width of the image. Must not exceed 0x08000000 + * (2^27). + * \param[in] d_h Height of the image. Must not exceed 0x08000000 + * (2^27). + * \param[in] stride_align Alignment, in bytes, of each row in the image + * (stride). Must not exceed 65536. + * \param[in] img_data Storage to use for the image. The storage must + * outlive the returned image descriptor; it can be + * disposed of after calling vpx_img_free(). * * \return Returns a pointer to the initialized image descriptor. If the img * parameter is non-null, the value of the img parameter will be * returned. + * + * \note \a img_data is required to have a minimum allocation size that + * satisfies the requirements of the \a fmt, \a d_w, \a d_h and \a + * stride_align parameters. This size can be calculated as follows (see + * \c img_alloc_helper in the vpx_image.c file in the libvpx source tree + * for more detail): + * \code + * align = (1 << x_chroma_shift) - 1; + * w = (d_w + align) & ~align; + * align = (1 << y_chroma_shift) - 1; + * h = (d_h + align) & ~align; + * + * s = (fmt & VPX_IMG_FMT_PLANAR) ? w : (uint64_t)bps * w / 8; + * s = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s * 2 : s; + * s = (s + stride_align - 1) & ~((uint64_t)stride_align - 1); + * s = (fmt & VPX_IMG_FMT_HIGHBITDEPTH) ? s / 2 : s; + * alloc_size = (fmt & VPX_IMG_FMT_PLANAR) ? (uint64_t)h * s * bps / 8 + * : (uint64_t)h * s; + * \endcode + * \a x_chroma_shift, \a y_chroma_shift and \a bps can be obtained by calling + * \ref vpx_img_wrap with a non-\c NULL \a img_data parameter. The \c + * vpx_image_t pointer should \em not be used in other API calls until \em after + * a successful call to \ref vpx_img_wrap with a valid image buffer. For + * example: + * \code + * vpx_img_wrap(img, fmt, d_w, d_h, stride_align, (unsigned char *)1); + * ... calculate buffer size and allocate buffer as described earlier + * vpx_img_wrap(img, fmt, d_w, d_h, stride_align, img_data); + * \endcode */ vpx_image_t *vpx_img_wrap(vpx_image_t *img, vpx_img_fmt_t fmt, unsigned int d_w, unsigned int d_h, unsigned int stride_align, diff --git a/src/game/client/videoservices/includes/vpx/vpx_integer.h b/src/game/client/videoservices/includes/vpx/vpx_integer.h index 4129d156f..34e379641 100644 --- a/src/game/client/videoservices/includes/vpx/vpx_integer.h +++ b/src/game/client/videoservices/includes/vpx/vpx_integer.h @@ -12,7 +12,7 @@ #define VPX_VPX_VPX_INTEGER_H_ /* get ptrdiff_t, size_t, wchar_t, NULL */ -#include +#include // IWYU pragma: export #if defined(_MSC_VER) #define VPX_FORCE_INLINE __forceinline @@ -34,7 +34,7 @@ #endif #endif // __cplusplus -#include -#include +#include // IWYU pragma: export +#include // IWYU pragma: export #endif // VPX_VPX_VPX_INTEGER_H_ diff --git a/src/game/client/videoservices/includes/vpx/vpx_tpl.h b/src/game/client/videoservices/includes/vpx/vpx_tpl.h new file mode 100644 index 000000000..ecee5d1ef --- /dev/null +++ b/src/game/client/videoservices/includes/vpx/vpx_tpl.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2023 The WebM project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +/*!\file + * \brief Describes the TPL stats descriptor and associated operations + * + */ +#ifndef VPX_VPX_VPX_TPL_H_ +#define VPX_VPX_VPX_TPL_H_ + +#include "./vpx_integer.h" +#include "./vpx_codec.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*!\brief Current ABI version number + * + * \internal + * If this file is altered in any way that changes the ABI, this value + * must be bumped. Examples include, but are not limited to, changing + * types, removing or reassigning enums, adding/removing/rearranging + * fields to structures + */ +#define VPX_TPL_ABI_VERSION 5 /**<\hideinitializer*/ + +/*!\brief Temporal dependency model stats for each block before propagation */ +typedef struct VpxTplBlockStats { + int16_t row; /**< Pixel row of the top left corner */ + int16_t col; /**< Pixel col of the top left corner */ + int64_t intra_cost; /**< Intra cost */ + int64_t inter_cost; /**< Inter cost */ + int16_t mv_r; /**< Motion vector row in pixel */ + int16_t mv_c; /**< Motion vector col in pixel */ + int64_t srcrf_rate; /**< Rate from source ref frame */ + int64_t srcrf_dist; /**< Distortion from source ref frame */ + int64_t pred_error; /**< Prediction error */ + int64_t inter_pred_err; /**< Inter prediction error */ + int64_t intra_pred_err; /**< Intra prediction error */ + int ref_frame_index; /**< Ref frame index in the ref frame buffer */ +} VpxTplBlockStats; + +/*!\brief Temporal dependency model stats for each frame before propagation */ +typedef struct VpxTplFrameStats { + int frame_width; /**< Frame width */ + int frame_height; /**< Frame height */ + int num_blocks; /**< Number of blocks. Size of block_stats_list */ + VpxTplBlockStats *block_stats_list; /**< List of tpl stats for each block */ +} VpxTplFrameStats; + +/*!\brief Temporal dependency model stats for each GOP before propagation */ +typedef struct VpxTplGopStats { + int size; /**< GOP size, also the size of frame_stats_list. */ + VpxTplFrameStats *frame_stats_list; /**< List of tpl stats for each frame */ +} VpxTplGopStats; + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // VPX_VPX_VPX_TPL_H_ diff --git a/src/game/client/videoservices/lib/win32/debug/vpx_mtd.lib b/src/game/client/videoservices/lib/win32/debug/vpx_mtd.lib new file mode 100644 index 000000000..5f208b55a Binary files /dev/null and b/src/game/client/videoservices/lib/win32/debug/vpx_mtd.lib differ diff --git a/src/game/client/videoservices/lib/win32/debug/webm_mtd.lib b/src/game/client/videoservices/lib/win32/debug/webm_mtd.lib new file mode 100644 index 000000000..f60937592 Binary files /dev/null and b/src/game/client/videoservices/lib/win32/debug/webm_mtd.lib differ diff --git a/src/game/client/videoservices/lib/win32/debug/webmmtd.lib b/src/game/client/videoservices/lib/win32/debug/webmmtd.lib deleted file mode 100644 index 34e1deec8..000000000 Binary files a/src/game/client/videoservices/lib/win32/debug/webmmtd.lib and /dev/null differ diff --git a/src/game/client/videoservices/lib/win32/vpx_mt.lib b/src/game/client/videoservices/lib/win32/vpx_mt.lib new file mode 100644 index 000000000..9b6a628d5 Binary files /dev/null and b/src/game/client/videoservices/lib/win32/vpx_mt.lib differ diff --git a/src/game/client/videoservices/lib/win32/vpxmt.lib b/src/game/client/videoservices/lib/win32/vpxmt.lib deleted file mode 100644 index 662a865c4..000000000 Binary files a/src/game/client/videoservices/lib/win32/vpxmt.lib and /dev/null differ diff --git a/src/game/client/videoservices/lib/win32/webm.lib b/src/game/client/videoservices/lib/win32/webm.lib deleted file mode 100644 index 632f808af..000000000 Binary files a/src/game/client/videoservices/lib/win32/webm.lib and /dev/null differ diff --git a/src/game/client/videoservices/lib/win32/webm_mt.lib b/src/game/client/videoservices/lib/win32/webm_mt.lib new file mode 100644 index 000000000..a9e376a00 Binary files /dev/null and b/src/game/client/videoservices/lib/win32/webm_mt.lib differ diff --git a/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj b/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj index 909e28e5e..97fcbc182 100644 --- a/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj +++ b/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj @@ -17,24 +17,25 @@ missionchooser {38AA6D4C-4ACE-4518-BC6C-BC42482C0E65} + 10.0 DynamicLibrary - v143 + v145 MultiByte true DynamicLibrary - v143 + v145 MultiByte true Release DynamicLibrary - v143 + v145 MultiByte @@ -54,43 +55,42 @@ <_ProjectFileVersion>12.0.30501.0 - .\Debug\.\ - .\Debug\.\ + Debug\ + Debug\ true false true false true ..\..\devtools\CodeAnalysisRules.ruleset + missionchooser - .\Release\.\ - .\Release\.\ + Release\ + Release\ true true false false true ..\..\devtools\CodeAnalysisRules.ruleset + missionchooser - .\Release\.\ - .\Release\.\ + Release\ + Release\ true true false false true ..\..\devtools\CodeAnalysisRules.ruleset + missionchooser - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + /MP %(AdditionalOptions) @@ -120,6 +120,8 @@ if ERRORLEVEL 1 exit 1 26495;26812 true true + true + true _DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) @@ -127,7 +129,7 @@ if ERRORLEVEL 1 exit 1 NotSet - $(OutDir)missionchooser.dll + $(OutDir)$(TargetName)$(TargetExt) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -144,6 +146,7 @@ if ERRORLEVEL 1 exit 1 /Brepro %(AdditionalOptions) kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -153,39 +156,38 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)missionchooser.bsc + $(OutDir)$(TargetName).bsc Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd missionchooser + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b 1 + +if exist ..\..\devtools\bin\postbuild.cmd ( + + call ..\..\devtools\bin\postbuild.cmd $(TargetName) + if %errorlevel% GEQ 1 exit /b 1 + +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd call ..\..\devtools\bin\sourcelink.cmd +if %errorlevel% GEQ 1 exit /b 1 + +exit /b 0 + - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + MaxSpeed @@ -197,7 +199,7 @@ if ERRORLEVEL 1 exit 1 true MultiThreaded - false + true true StreamingSIMDExtensions2 Fast @@ -218,7 +220,7 @@ if ERRORLEVEL 1 exit 1 true true true - true + false NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) @@ -226,7 +228,7 @@ if ERRORLEVEL 1 exit 1 NotSet - $(OutDir)missionchooser.dll + $(OutDir)$(TargetName)$(TargetExt) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -247,6 +249,7 @@ if ERRORLEVEL 1 exit 1 UseLinkTimeCodeGeneration true true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -256,39 +259,38 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)missionchooser.bsc + $(OutDir)$(TargetName).bsc Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -if exist "$(TargetDir)"$(TargetName).pdb copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd missionchooser + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b 1 + +if exist ..\..\devtools\bin\postbuild.cmd ( + + call ..\..\devtools\bin\postbuild.cmd $(TargetName) + if %errorlevel% GEQ 1 exit /b 1 + +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd call ..\..\devtools\bin\sourcelink.cmd +if %errorlevel% GEQ 1 exit /b 1 + +exit /b 0 + - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + /MP %(AdditionalOptions) @@ -302,7 +304,7 @@ if ERRORLEVEL 1 exit 1 MultiThreaded - false + true true StreamingSIMDExtensions2 Fast @@ -330,7 +332,7 @@ if ERRORLEVEL 1 exit 1 NotSet - $(OutDir)missionchooser.dll + $(OutDir)$(TargetName)$(TargetExt) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -352,6 +354,7 @@ if ERRORLEVEL 1 exit 1 true true true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -361,29 +364,32 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)missionchooser.bsc + $(OutDir)$(TargetName).bsc Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd missionchooser + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b 1 + +if exist ..\..\devtools\bin\postbuild.cmd ( + + call ..\..\devtools\bin\postbuild.cmd $(TargetName) + if %errorlevel% GEQ 1 exit /b 1 + +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd call ..\..\devtools\bin\sourcelink.cmd +if %errorlevel% GEQ 1 exit /b 1 + +exit /b 0 + diff --git a/src/game/server/swarm_sdk_server.vcxproj b/src/game/server/swarm_sdk_server.vcxproj index bf1b77c22..39925063e 100644 --- a/src/game/server/swarm_sdk_server.vcxproj +++ b/src/game/server/swarm_sdk_server.vcxproj @@ -17,24 +17,25 @@ Server (Swarm) {EE8FAD9C-DFAF-414B-A11D-7697E1A28A27} + 10.0 DynamicLibrary - v143 + v145 MultiByte true DynamicLibrary - v143 + v145 MultiByte true Release DynamicLibrary - v143 + v145 MultiByte @@ -54,8 +55,8 @@ <_ProjectFileVersion>12.0.30501.0 - .\Debug_swarm\ - .\Debug_swarm\ + Debug_swarm\ + Debug_swarm\ true false true @@ -65,8 +66,8 @@ ..\..\devtools\CodeAnalysisRules.ruleset - .\Release_swarm\ - .\Release_swarm\ + Release_swarm\ + Release_swarm\ true true false @@ -76,8 +77,8 @@ ..\..\devtools\CodeAnalysisRules.ruleset - .\Release_swarm\ - .\Release_swarm\ + Release_swarm\ + Release_swarm\ true true false @@ -88,12 +89,8 @@ - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + /MP %(AdditionalOptions) @@ -124,6 +121,8 @@ if ERRORLEVEL 1 exit 1 26495;26812 true true + true + true _DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) @@ -132,7 +131,7 @@ if ERRORLEVEL 1 exit 1 winmm.lib;ws2_32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)server.dll + $(OutDir)$(TargetName)$(TargetExt) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -148,6 +147,7 @@ if ERRORLEVEL 1 exit 1 false /Brepro %(AdditionalOptions) true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -157,39 +157,38 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)server.bsc + $(OutDir)$(TargetName).bsc Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd server + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b 1 + +if exist ..\..\devtools\bin\postbuild.cmd ( + + call ..\..\devtools\bin\postbuild.cmd $(TargetName) + if %errorlevel% GEQ 1 exit /b 1 + +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd call ..\..\devtools\bin\sourcelink.cmd +if %errorlevel% GEQ 1 exit /b 1 + +exit /b 0 + - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + MaxSpeed @@ -201,7 +200,7 @@ if ERRORLEVEL 1 exit 1 true MultiThreaded - false + true true StreamingSIMDExtensions2 Fast @@ -232,7 +231,7 @@ if ERRORLEVEL 1 exit 1 winmm.lib;ws2_32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)server.dll + $(OutDir)$(TargetName)$(TargetExt) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -252,6 +251,7 @@ if ERRORLEVEL 1 exit 1 UseLinkTimeCodeGeneration true true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -261,39 +261,38 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)server.bsc + $(OutDir)$(TargetName).bsc Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -if exist "$(TargetDir)"$(TargetName).pdb copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd server + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b 1 + +if exist ..\..\devtools\bin\postbuild.cmd ( + + call ..\..\devtools\bin\postbuild.cmd $(TargetName) + if %errorlevel% GEQ 1 exit /b 1 + +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd call ..\..\devtools\bin\sourcelink.cmd +if %errorlevel% GEQ 1 exit /b 1 + +exit /b 0 + - if EXIST "..\..\..\reactivedrop\bin\.\$(TargetFileName)" for /f "delims=" %25%25A in (%27attrib "..\..\..\reactivedrop\bin\.\$(TargetFileName)"%27) do set valveTmpIsReadOnly="%25%25A" -set valveTmpIsReadOnlyLetter=%25valveTmpIsReadOnly:~6,1%25 -if "%25valveTmpIsReadOnlyLetter%25"=="R" del /q "$(TargetDir)"$(TargetFileName) -if exist ..\..\devtools\bin\vpccrccheck.exe ..\..\devtools\bin\vpccrccheck.exe -crc2 test_swarm.vcproj -if ERRORLEVEL 1 exit 1 - + + /MP %(AdditionalOptions) @@ -307,7 +306,7 @@ if ERRORLEVEL 1 exit 1 MultiThreaded - false + true true StreamingSIMDExtensions2 Fast @@ -336,7 +335,7 @@ if ERRORLEVEL 1 exit 1 winmm.lib;ws2_32.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)server.dll + $(OutDir)$(TargetName)$(TargetExt) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -357,6 +356,7 @@ if ERRORLEVEL 1 exit 1 true true true + $(IntDir)$(TargetName)$(TargetExt).intermediate.manifest true @@ -366,29 +366,32 @@ if ERRORLEVEL 1 exit 1 true - $(OutDir)server.bsc + $(OutDir)$(TargetName).bsc Publishing to ..\..\..\reactivedrop\bin\. - if exist "..\..\..\reactivedrop\bin\." goto ValveStart -mkdir "..\..\..\reactivedrop\bin\." -:ValveStart -copy "$(TargetDir)"$(TargetFileName) "..\..\..\reactivedrop\bin\.\$(TargetFileName)" -if ERRORLEVEL 1 goto BuildEventFailed -if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map "..\..\..\reactivedrop\bin\.\$(TargetName).map" -copy "$(TargetDir)"$(TargetName).pdb "..\..\..\reactivedrop\bin\.\$(TargetName).pdb" -if ERRORLEVEL 1 goto BuildEventFailed -goto BuildEventOK -:BuildEventFailed -echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. *** -del /q "$(TargetDir)"$(TargetFileName) -exit 1 -:BuildEventOK -if exist ..\..\devtools\bin\postbuild.cmd ..\..\devtools\bin\postbuild.cmd server + set "DEST_DIR=..\..\..\reactivedrop\bin" +mkdir "%25DEST_DIR%25" 2>nul + +robocopy "$(TargetDir)\" "%25DEST_DIR%25" "$(TargetFileName)" "$(TargetName).map" "$(TargetName).pdb" /IS /IT /COPY:DAT /R:1 /W:0 +if %errorlevel% GEQ 8 exit /b 1 + +if exist ..\..\devtools\bin\postbuild.cmd ( + + call ..\..\devtools\bin\postbuild.cmd $(TargetName) + if %errorlevel% GEQ 1 exit /b 1 + +) + +exit /b 0 - ..\..\devtools\bin\sourcelink.cmd + if exist ..\..\devtools\bin\sourcelink.cmd call ..\..\devtools\bin\sourcelink.cmd +if %errorlevel% GEQ 1 exit /b 1 + +exit /b 0 + diff --git a/src/reactivedrop_vs13.sln b/src/reactivedrop_vs13.sln index 5ce3d276f..9c11c760a 100644 --- a/src/reactivedrop_vs13.sln +++ b/src/reactivedrop_vs13.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.3.32505.426 +# Visual Studio Version 18 +VisualStudioVersion = 18.5.11801.241 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Client (Swarm)", "game\client\swarm_sdk_client.vcxproj", "{A26C0361-6B09-9E3D-5194-C9CB89243710}" ProjectSection(ProjectDependencies) = postProject