From c6d57bc398bc3e6ce90a05775973512110fab2b3 Mon Sep 17 00:00:00 2001 From: Peter Vicman Date: Tue, 12 Jul 2016 19:17:43 +0200 Subject: [PATCH] projects/imx6: update kodi patch (beautified for next kodi updates) --- .../kodi/kodi-100-krypton-from-mk01.patch | 80211 +--------------- 1 file changed, 296 insertions(+), 79915 deletions(-) diff --git a/projects/imx6/patches/kodi/kodi-100-krypton-from-mk01.patch b/projects/imx6/patches/kodi/kodi-100-krypton-from-mk01.patch index fd9958ade6..2bf0655c7b 100644 --- a/projects/imx6/patches/kodi/kodi-100-krypton-from-mk01.patch +++ b/projects/imx6/patches/kodi/kodi-100-krypton-from-mk01.patch @@ -1,872 +1,138 @@ -From fe368163f2279b1dfe40c603d852a2eb7763c38c Mon Sep 17 00:00:00 2001 +From 37a1a171c6a6bf1a42e8c0b02882f5213c878485 Mon Sep 17 00:00:00 2001 From: Peter Vicman -Date: Sun, 10 Jul 2016 13:46:33 +0200 +Date: Tue, 12 Jul 2016 19:03:46 +0200 Subject: [PATCH] patch for kodi krypton from mk01 -kodi base: kodi-17.0-alpha2-f3ca4ea +kodi base: f3ca4eaf9a803f0ae195854f088341b84f9253c9 kodi mk01: https://github.com/mk01/xbmc/tree/treeKrypton 0b3954d54c41c494e30143794ccfba0b690f926d --- - Makefile.in | 26 + - Makefile.python-interfaces | 15 + - README.md | 2 +- - addons/repository.xbmc.org/addon.xml | 8 +- - .../resource.language.en_gb/resources/strings.po | 241 +- - addons/screensaver.gles.ball/addon.xml | 121 + - addons/screensaver.gles.ball/icon.png | Bin 0 -> 5657 bytes - addons/screensaver.gles.noise/addon.xml | 121 + - addons/screensaver.gles.noise/icon.png | Bin 0 -> 5657 bytes - addons/screensaver.gles.plasma/addon.xml | 121 + - addons/screensaver.gles.plasma/icon.png | Bin 0 -> 5657 bytes - addons/screensaver.gles.plasma2/addon.xml | 121 + - addons/screensaver.gles.plasma2/icon.png | Bin 0 -> 5657 bytes - addons/screensaver.gles.solarwinds/addon.xml | 119 + - addons/screensaver.gles.solarwinds/icon.png | Bin 0 -> 14774 bytes - addons/screensaver.gles.spiral/addon.xml | 121 + - addons/screensaver.gles.spiral/icon.png | Bin 0 -> 5657 bytes - addons/screensaver.gles.stellar/addon.xml | 121 + - addons/screensaver.gles.stellar/icon.png | Bin 0 -> 5657 bytes - addons/screensaver.gles.warp/addon.xml | 119 + - addons/screensaver.gles.warp/icon.png | Bin 0 -> 9424 bytes - addons/webinterface.default/addon.xml | 10 +- - addons/webinterface.default/js/MediaLibrary.js | 8 +- - appveyor.yml | 12 +- - codegenerator.mk | 5 - - configure.ac | 209 +- - lib/libUPnP/CMakeLists.txt | 2 +- - lib/libdvd/Makefile.in | 14 +- - project/BuildDependencies/scripts/0_package.list | 16 +- - project/VS2010Express/XBMC for Windows.sln | 20 +- - project/VS2010Express/XBMC.vcxproj | 114 +- - project/VS2010Express/XBMC.vcxproj.filters | 309 +- - project/cmake/CMakeLists.txt | 40 +- - project/cmake/KodiConfig.cmake.in | 40 +- - project/cmake/README.md | 10 - - project/cmake/addons/CMakeLists.txt | 13 +- - project/cmake/installdata/cmake-files.txt | 2 + - project/cmake/installdata/darwin/packaging.txt | 3 + - project/cmake/installdata/darwin/runtime.txt | 2 + - project/cmake/modules/FindCCache.cmake | 2 +- - project/cmake/modules/FindCXX11.cmake | 4 +- - project/cmake/modules/FindCrossGUID.cmake | 6 +- - project/cmake/modules/FindD3DX11Effects.cmake | 7 +- - project/cmake/modules/FindEMBEDDED.cmake | 2 +- - project/cmake/modules/FindFFMPEG.cmake | 3 +- - project/cmake/modules/FindLibDvd.cmake | 53 +- - project/cmake/modules/FindLibSmbClient.cmake | 32 +- - project/cmake/modules/FindLzo2.cmake | 6 +- - project/cmake/modules/FindMicroHttpd.cmake | 82 +- - project/cmake/modules/FindOpenGl.cmake | 2 +- - project/cmake/modules/FindPulseAudio.cmake | 36 +- - project/cmake/modules/FindRTMP.cmake | 21 + - project/cmake/modules/FindSSE.cmake | 118 +- - project/cmake/modules/FindTagLib.cmake | 2 +- - project/cmake/modules/FindXslt.cmake | 4 - - project/cmake/modules/FindYajl.cmake | 2 +- - project/cmake/scripts/android/ArchSetup.cmake | 7 +- - project/cmake/scripts/android/Install.cmake | 118 - - project/cmake/scripts/android/PathSetup.cmake | 34 +- - project/cmake/scripts/common/AddOptions.cmake | 84 +- - project/cmake/scripts/common/AddonHelpers.cmake | 197 +- - .../cmake/scripts/common/CheckTargetPlatform.cmake | 4 +- - .../scripts/common/GenerateVersionedFiles.cmake | 19 +- - project/cmake/scripts/common/GeneratorSetup.cmake | 5 - - project/cmake/scripts/common/HandleDepends.cmake | 14 +- - project/cmake/scripts/common/Macros.cmake | 50 +- - project/cmake/scripts/common/ManageString.cmake | 235 + - project/cmake/scripts/common/PathSetup.cmake | 3 + - project/cmake/scripts/common/PrepareEnv.cmake | 27 +- - project/cmake/scripts/darwin/ArchSetup.cmake | 33 + - project/cmake/scripts/darwin/Install.cmake | 38 + - project/cmake/scripts/darwin/Macros.cmake | 110 + - project/cmake/scripts/darwin/PathSetup.cmake | 32 + - project/cmake/scripts/ios/Macros.cmake | 2 +- - project/cmake/scripts/ios/PathSetup.cmake | 2 +- - project/cmake/scripts/linux/Install.cmake | 181 +- - project/cmake/scripts/windows/CFlagOverrides.cmake | 2 +- - .../cmake/scripts/windows/CXXFlagOverrides.cmake | 2 +- - project/cmake/treedata/darwin/subdirs.txt | 12 + - system/keymaps/appcommand.xml | 6 +- - system/keymaps/customcontroller.AppleRemote.xml | 15 +- - system/keymaps/customcontroller.Harmony.xml | 66 +- - system/keymaps/gamepad.xml | 43 +- - system/keymaps/joystick.xml | 36 +- - system/keymaps/keyboard.xml | 67 +- - system/keymaps/mouse.xml | 10 +- - system/keymaps/remote.xml | 66 +- - system/keymaps/touchscreen.xml | 6 +- - system/peripherals.xml | 13 +- - system/settings/imx6.xml | 28 +- - system/settings/rbp.xml | 2 +- - system/settings/settings.xml | 274 +- - tools/EventClients/Clients/WiiRemote/Makefile | 2 +- - tools/android/packaging/Makefile.in | 1 + - tools/buildsteps/android/make-binary-addons | 9 +- - tools/buildsteps/android/package | 17 +- - tools/buildsteps/androidx86/make-binary-addons | 9 +- - tools/buildsteps/androidx86/package | 19 +- - tools/depends/configure.ac | 4 +- - tools/depends/native/Makefile | 2 +- - tools/depends/native/gettext-native/Makefile | 2 +- - tools/depends/native/giflib-native/Makefile | 2 +- - tools/depends/native/liblzo2-native/Makefile | 2 +- - tools/depends/native/swig-native/Makefile | 2 +- - tools/depends/target/Makefile | 5 +- - tools/depends/target/Toolchain.cmake.in | 105 +- - tools/depends/target/config-binaddons.site.in | 2 +- - tools/depends/target/config.site.in | 2 +- - tools/depends/target/crossguid/CMakeLists.txt | 2 +- - tools/depends/target/crossguid/FindCXX11.cmake | 4 +- - tools/depends/target/crossguid/Makefile | 4 +- - tools/depends/target/curl/Makefile | 2 +- - ...-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch | 69 + - .../0001-Squashed-commit-of-the-following.patch | 2180 ++ - ...vcodec-add-h264_mvc-codec-id-and-profiles.patch | 67 + - ...er-add-support-for-parsing-h264-mvc-NALUs.patch | 113 + - ...Signal-unsupported-GMC-with-more-than-one.patch | 48 + - .../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch | 24 + - tools/depends/target/ffmpeg/CMakeLists.txt | 2 +- - tools/depends/target/ffmpeg/Makefile | 47 +- - .../added_ARM_NEON_optimized_SAO_patches.patch | 3328 ++ - tools/depends/target/ffmpeg/autobuild.sh | 10 +- - ...arsing_of_mvc_slices_in_some_corner_cases.patch | 66 + - ...hevcdsp_ARM_NEON_optimized_epel_functions.patch | 409 + - .../target/ffmpeg/pfcd_hevc_optimisations.patch | 38136 +++++++++++++++++++ - tools/depends/target/gettext/Makefile | 2 +- - tools/depends/target/jpeg/Makefile | 39 + - tools/depends/target/liblzo2/Makefile | 2 +- - tools/depends/target/libmicrohttpd/Makefile | 2 +- - tools/depends/target/libmodplug/Makefile | 42 + - tools/depends/target/libpng/Makefile | 2 +- - tools/depends/target/librtmp/Makefile | 2 +- - tools/depends/target/python27/Makefile | 3 +- - .../python27/Python-2.7.10-crosscompile.patch | 10 +- - .../target/python27/Python-no-export-path.patch | 2 +- - tools/depends/target/python27/Python-setup.patch | 4 +- - tools/depends/target/python27/fix-ffi.patch | 4 +- - .../target/python27/urllib-ssl-no-cert_check.patch | 14 + - xbmc/Application.cpp | 161 +- - xbmc/Application.h | 28 +- - xbmc/ApplicationPlayer.cpp | 2 - - xbmc/ApplicationPlayer.h | 5 +- - xbmc/AutoSwitch.cpp | 14 + - xbmc/Autorun.cpp | 12 +- - xbmc/ContextMenuItem.h | 2 +- - xbmc/ContextMenuManager.cpp | 2 +- - xbmc/CueDocument.h | 3 - - xbmc/DatabaseManager.cpp | 2 +- - xbmc/DllPaths_generated.h.in | 2 + - xbmc/DllPaths_generated_android.h.in | 2 + - xbmc/DllPaths_win32.h | 1 + - xbmc/FileItem.cpp | 28 +- - xbmc/FileItem.h | 1 + - xbmc/GUIInfoManager.cpp | 71 +- - xbmc/GUIInfoManager.h | 1 - - xbmc/GUILargeTextureManager.h | 1 - - xbmc/GUIPassword.cpp | 16 +- - xbmc/LangInfo.cpp | 17 +- - xbmc/PartyModeManager.cpp | 5 +- - xbmc/PlayListPlayer.cpp | 9 +- - xbmc/ServiceManager.cpp | 5 +- - xbmc/ServiceManager.h | 6 +- - xbmc/TextureCache.cpp | 2 +- - xbmc/TextureCache.h | 2 +- - xbmc/TextureDatabase.cpp | 2 +- - xbmc/TextureDatabase.h | 3 - - xbmc/ThumbnailCache.cpp | 1 + - xbmc/URL.cpp | 7 +- - xbmc/Util.cpp | 16 +- - xbmc/XBDateTime.cpp | 2 +- - xbmc/addons/Addon.cpp | 2 +- - xbmc/addons/Addon.h | 14 +- - xbmc/addons/AddonBuilder.cpp | 5 +- - xbmc/addons/AddonBuilder.h | 2 - - xbmc/addons/AddonDatabase.cpp | 435 +- - xbmc/addons/AddonDatabase.h | 36 +- - xbmc/addons/AddonDll.h | 1 - - xbmc/addons/AddonInstaller.cpp | 19 +- - xbmc/addons/AddonInstaller.h | 2 - - xbmc/addons/AddonManager.cpp | 12 +- - xbmc/addons/AddonStatusHandler.cpp | 6 +- - xbmc/addons/ContextMenuAddon.h | 3 - - xbmc/addons/GUIDialogAddonInfo.cpp | 82 +- - xbmc/addons/GUIDialogAddonInfo.h | 15 +- - xbmc/addons/GUIDialogAddonSettings.cpp | 2 +- - xbmc/addons/GUIDialogAddonSettings.h | 4 - - xbmc/addons/GUIWindowAddonBrowser.h | 3 - - xbmc/addons/IAddon.h | 2 - - xbmc/addons/InputStream.cpp | 30 +- - xbmc/addons/InputStream.h | 7 +- - xbmc/addons/LanguageResource.cpp | 2 +- - xbmc/addons/PVRClient.cpp | 16 +- - xbmc/addons/PVRClient.h | 5 +- - xbmc/addons/Repository.cpp | 7 +- - xbmc/addons/Repository.h | 4 - - xbmc/addons/Scraper.cpp | 6 +- - xbmc/addons/Scraper.h | 5 - - xbmc/addons/Skin.cpp | 4 +- - xbmc/addons/Visualisation.h | 1 - - xbmc/addons/binary/interfaces/AddonInterfaces.cpp | 2 +- - .../api1/AudioDSP/AddonCallbacksAudioDSP.cpp | 4 +- - .../binary/interfaces/api1/GUI/AddonGUIWindow.cpp | 7 +- - .../include/kodi/dlfcn-win32.cpp | 2 +- - .../include/kodi/kodi_peripheral_dll.h | 2 +- - .../include/kodi/kodi_peripheral_types.h | 2 +- - .../kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | 2 +- - xbmc/commons/ilog.h | 2 + - xbmc/cores/AudioEngine/AESinkFactory.cpp | 7 +- - xbmc/cores/AudioEngine/CMakeLists.txt | 22 +- - xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp | 935 + - xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h | 413 + - .../AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp | 871 + - .../cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.h | 424 + - .../AudioEngine/DSPAddons/ActiveAEDSPDatabase.cpp | 545 + - .../AudioEngine/DSPAddons/ActiveAEDSPDatabase.h | 216 + - .../AudioEngine/DSPAddons/ActiveAEDSPMode.cpp | 430 + - xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h | 325 + - .../AudioEngine/DSPAddons/ActiveAEDSPProcess.cpp | 1801 + - .../AudioEngine/DSPAddons/ActiveAEDSPProcess.h | 353 + - .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 37 +- - xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h | 8 +- - .../Engines/ActiveAE/ActiveAEBuffer.cpp | 2 +- - .../AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h | 2 +- - .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 31 +- - .../AudioEngine/Engines/ActiveAE/ActiveAESound.cpp | 2 +- - .../Engines/ActiveAE/ActiveAEStream.cpp | 15 +- - xbmc/cores/AudioEngine/Makefile.in | 10 +- - xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 49 +- - xbmc/cores/AudioEngine/Sinks/AESinkALSA.h | 2 +- - xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp | 18 +- - xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp | 2 +- - xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp | 8 +- - xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp | 11 +- - .../AudioEngine/Sinks/osx/AEDeviceEnumerationOSX.h | 4 - - xbmc/cores/AudioEngine/Sinks/osx/CoreAudioDevice.h | 2 - - .../AudioEngine/Sinks/osx/CoreAudioStream.cpp | 4 +- - xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.h | 1 - - xbmc/cores/AudioEngine/Utils/AEELDParser.cpp | 2 +- - xbmc/cores/DllLoader/DllLoader.cpp | 4 +- - xbmc/cores/DllLoader/Win32DllLoader.cpp | 4 +- - xbmc/cores/DllLoader/exports/CMakeLists.txt | 6 +- - xbmc/cores/DllLoader/exports/emu_msvcrt.cpp | 11 + - xbmc/cores/IPlayer.h | 5 +- - xbmc/cores/VideoPlayer/DVDClock.cpp | 40 +- - xbmc/cores/VideoPlayer/DVDClock.h | 5 +- - .../DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp | 5 - - .../DVDCodecs/Overlay/contrib/cc_decoder708.cpp | 36 +- - .../cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp | 233 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h | 17 +- - .../VideoPlayer/DVDCodecs/Video/CMakeLists.txt | 2 +- - .../VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h | 2 + - .../DVDCodecs/Video/DVDVideoCodecAmlogic.cpp | 43 +- - .../DVDCodecs/Video/DVDVideoCodecAmlogic.h | 4 +- - .../DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp | 10 +- - .../DVDCodecs/Video/DVDVideoCodecIMX.cpp | 1947 +- - .../VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h | 376 +- - .../DVDCodecs/Video/DVDVideoCodecOpenMax.cpp | 2 +- - .../VideoPlayer/DVDCodecs/Video/MMALCodec.cpp | 55 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h | 3 - - .../VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp | 56 +- - .../cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h | 3 - - xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMax.h | 2 - - .../VideoPlayer/DVDCodecs/Video/OpenMaxVideo.cpp | 26 +- - .../VideoPlayer/DVDCodecs/Video/OpenMaxVideo.h | 4 +- - xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h | 1 - - xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h | 2 - - xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h | 4 + - .../VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp | 7 +- - .../cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.h | 1 - - .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 20 +- - .../VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp | 3 +- - .../VideoPlayer/DVDInputStreams/CMakeLists.txt | 3 + - .../DVDInputStreams/DVDFactoryInputStream.cpp | 13 +- - .../DVDInputStreams/DVDFactoryInputStream.h | 2 - - .../VideoPlayer/DVDInputStreams/DVDInputStream.h | 1 + - .../DVDInputStreams/DVDInputStreamBluray.cpp | 2 +- - .../DVDInputStreams/DVDInputStreamPVRManager.cpp | 5 +- - .../DVDInputStreams/DVDInputStreamPVRManager.h | 2 +- - .../DVDInputStreams/DVDInputStreamRTMP.cpp | 265 + - .../DVDInputStreams/DVDInputStreamRTMP.h | 61 + - .../DVDInputStreams/DVDInputStreamStack.h | 1 - - .../cores/VideoPlayer/DVDInputStreams/DllLibRTMP.h | 79 + - .../VideoPlayer/DVDInputStreams/InputStreamAddon.h | 3 - - xbmc/cores/VideoPlayer/DVDInputStreams/Makefile | 1 + - xbmc/cores/VideoPlayer/DVDMessage.h | 2 +- - xbmc/cores/VideoPlayer/DVDStreamInfo.cpp | 8 + - xbmc/cores/VideoPlayer/DVDStreamInfo.h | 2 + - xbmc/cores/VideoPlayer/Edl.cpp | 7 +- - xbmc/cores/VideoPlayer/IVideoPlayer.h | 5 - - xbmc/cores/VideoPlayer/VideoPlayer.cpp | 42 +- - xbmc/cores/VideoPlayer/VideoPlayer.h | 4 +- - xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 18 +- - xbmc/cores/VideoPlayer/VideoPlayerAudio.h | 1 - - xbmc/cores/VideoPlayer/VideoPlayerTeletext.cpp | 2 +- - xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 25 +- - xbmc/cores/VideoPlayer/VideoPlayerVideo.h | 1 - - .../VideoPlayer/VideoRenderers/BaseRenderer.cpp | 10 + - .../VideoRenderers/HwDecRender/CMakeLists.txt | 2 +- - .../VideoRenderers/HwDecRender/MMALRenderer.cpp | 109 +- - .../VideoRenderers/HwDecRender/MMALRenderer.h | 20 +- - .../VideoRenderers/HwDecRender/RendererAML.cpp | 14 +- - .../VideoRenderers/HwDecRender/RendererAML.h | 3 - - .../VideoRenderers/HwDecRender/RendererIMX.cpp | 63 +- - .../VideoRenderers/HwDecRender/RendererIMX.h | 2 + - .../VideoPlayer/VideoRenderers/LinuxRendererGL.cpp | 7 +- - .../VideoPlayer/VideoRenderers/LinuxRendererGL.h | 2 - - .../VideoRenderers/LinuxRendererGLES.cpp | 16 +- - .../VideoPlayer/VideoRenderers/LinuxRendererGLES.h | 1 - - .../VideoRenderers/OverlayRendererGUI.cpp | 5 - - .../VideoPlayer/VideoRenderers/RenderFlags.cpp | 5 + - .../cores/VideoPlayer/VideoRenderers/RenderFlags.h | 5 +- - .../VideoPlayer/VideoRenderers/RenderManager.cpp | 62 +- - .../VideoPlayer/VideoRenderers/RenderManager.h | 1 + - .../VideoRenderers/VideoShaders/GLSLOutput.cpp | 2 +- - .../VideoRenderers/VideoShaders/WinVideoFilter.h | 2 - - .../cores/VideoPlayer/VideoRenderers/WinRenderer.h | 1 - - xbmc/cores/omxplayer/OMXImage.cpp | 4 +- - xbmc/cores/omxplayer/OMXPlayerVideo.cpp | 4 +- - xbmc/cores/paplayer/AudioDecoder.cpp | 2 +- - xbmc/cores/paplayer/ICodec.h | 5 +- - xbmc/cores/paplayer/PAPlayer.h | 1 - - xbmc/cores/paplayer/VideoPlayerCodec.cpp | 4 +- - xbmc/cores/playercorefactory/PlayerSelectionRule.h | 3 - - xbmc/dbwrappers/Database.cpp | 3 + - xbmc/dbwrappers/dataset.h | 5 +- - xbmc/dbwrappers/mysqldataset.cpp | 2 +- - xbmc/dialogs/GUIDialogContextMenu.cpp | 10 +- - xbmc/dialogs/GUIDialogContextMenu.h | 2 - - xbmc/dialogs/GUIDialogExtendedProgressBar.h | 3 - - xbmc/dialogs/GUIDialogFileBrowser.cpp | 2 +- - xbmc/dialogs/GUIDialogFileBrowser.h | 3 - - xbmc/dialogs/GUIDialogGamepad.cpp | 4 +- - xbmc/dialogs/GUIDialogKeyboardGeneric.h | 3 - - xbmc/dialogs/GUIDialogMediaFilter.h | 1 - - xbmc/dialogs/GUIDialogMediaSource.h | 3 - - xbmc/dialogs/GUIDialogSelect.h | 3 - - xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp | 2 +- - xbmc/epg/Epg.cpp | 120 +- - xbmc/epg/Epg.h | 43 +- - xbmc/epg/EpgContainer.cpp | 78 +- - xbmc/epg/EpgContainer.h | 64 +- - xbmc/epg/EpgDatabase.cpp | 20 +- - xbmc/epg/EpgDatabase.h | 5 +- - xbmc/epg/EpgInfoTag.cpp | 9 +- - xbmc/epg/EpgInfoTag.h | 20 +- - xbmc/epg/EpgSearchFilter.cpp | 72 + - xbmc/epg/EpgSearchFilter.h | 3 + - xbmc/epg/GUIEPGGridContainer.cpp | 16 +- - xbmc/epg/GUIEPGGridContainer.h | 17 +- - xbmc/epg/GUIEPGGridContainerModel.cpp | 2 +- - xbmc/epg/GUIEPGGridContainerModel.h | 8 +- - xbmc/events/MediaLibraryEvent.cpp | 14 +- - xbmc/events/windows/GUIWindowEventLog.h | 2 +- - xbmc/filesystem/AFPDirectory.cpp | 326 + - xbmc/filesystem/AFPDirectory.h | 47 + - xbmc/filesystem/AFPFile.cpp | 728 + - xbmc/filesystem/AFPFile.h | 134 + - xbmc/filesystem/APKDirectory.cpp | 2 +- - xbmc/filesystem/AddonsDirectory.cpp | 3 +- - xbmc/filesystem/CMakeLists.txt | 2 + - xbmc/filesystem/CurlFile.cpp | 21 +- - xbmc/filesystem/Directory.cpp | 2 +- - xbmc/filesystem/DirectoryFactory.cpp | 13 +- - xbmc/filesystem/DllLibAfp.h | 214 + - xbmc/filesystem/FavouritesDirectory.cpp | 2 +- - xbmc/filesystem/FileFactory.cpp | 10 +- - xbmc/filesystem/FileReaderFile.cpp | 105 + - xbmc/filesystem/FileReaderFile.h | 51 + - xbmc/filesystem/Makefile.in | 6 + - xbmc/filesystem/MultiPathDirectory.h | 2 - - xbmc/filesystem/NFSFile.cpp | 6 +- - xbmc/filesystem/PipeFile.h | 2 - - xbmc/filesystem/PluginDirectory.cpp | 2 +- - xbmc/filesystem/RSSDirectory.cpp | 4 +- - xbmc/filesystem/RarManager.cpp | 19 +- - xbmc/filesystem/RarManager.h | 2 +- - xbmc/filesystem/SMBFile.cpp | 14 +- - xbmc/filesystem/SourcesDirectory.h | 2 - - xbmc/filesystem/StackDirectory.h | 1 - - .../VideoDatabaseDirectory/DirectoryNode.cpp | 1 + - xbmc/filesystem/VirtualDirectory.cpp | 2 +- - xbmc/filesystem/XbtFile.cpp | 6 +- - xbmc/filesystem/XbtFile.h | 2 - - xbmc/filesystem/XbtManager.h | 1 - - xbmc/filesystem/ZeroconfDirectory.cpp | 6 +- - xbmc/filesystem/posix/PosixFile.cpp | 4 +- - xbmc/filesystem/test/TestRarFile.cpp | 21 +- - xbmc/filesystem/test/TestZipFile.cpp | 3 +- - xbmc/filesystem/udf25.cpp | 6 +- - xbmc/filesystem/win32/Win32Directory.cpp | 2 +- - xbmc/filesystem/win32/Win32File.cpp | 2 +- - xbmc/filesystem/win32/Win32SMBDirectory.cpp | 4 +- - xbmc/games/controllers/ControllerLayout.cpp | 2 +- - .../controllers/guicontrols/GUIGameController.cpp | 4 +- - .../controllers/windows/GUIControllerList.cpp | 153 +- - xbmc/games/controllers/windows/GUIControllerList.h | 12 +- - .../controllers/windows/GUIControllerWindow.cpp | 27 +- - .../controllers/windows/IConfigurationWindow.h | 4 +- - xbmc/guiinfo/GUIInfoLabels.h | 3 - - xbmc/guilib/D3DResource.cpp | 2 +- - xbmc/guilib/DirtyRegionSolvers.cpp | 2 +- - xbmc/guilib/GUIBaseContainer.h | 1 - - xbmc/guilib/GUIControl.cpp | 4 +- - xbmc/guilib/GUIControl.h | 2 - - xbmc/guilib/GUIControlFactory.cpp | 4 +- - xbmc/guilib/GUIControlFactory.h | 3 - - xbmc/guilib/GUIControlGroup.h | 2 - - xbmc/guilib/GUIControlProfiler.h | 2 - - xbmc/guilib/GUIEditControl.cpp | 4 +- - xbmc/guilib/GUIFadeLabelControl.cpp | 3 +- - xbmc/guilib/GUIFadeLabelControl.h | 2 - - xbmc/guilib/GUIFontManager.cpp | 2 +- - xbmc/guilib/GUIFontManager.h | 1 - - xbmc/guilib/GUIFontTTFDX.h | 1 - - xbmc/guilib/GUIFontTTFGL.h | 3 - - xbmc/guilib/GUIImage.h | 2 - - xbmc/guilib/GUIKeyboardFactory.cpp | 3 +- - xbmc/guilib/GUILabel.cpp | 2 +- - xbmc/guilib/GUIMoverControl.cpp | 6 +- - xbmc/guilib/GUIMultiImage.cpp | 3 +- - xbmc/guilib/GUIMultiImage.h | 2 - - xbmc/guilib/GUIRSSControl.h | 2 - - xbmc/guilib/GUIRenderingControl.cpp | 4 +- - xbmc/guilib/GUIRenderingControl.h | 2 +- - xbmc/guilib/GUIResizeControl.cpp | 6 +- - xbmc/guilib/GUISpinControl.h | 2 - - xbmc/guilib/GUIStaticItem.h | 1 - - xbmc/guilib/GUITextLayout.cpp | 8 +- - xbmc/guilib/GUITexture.cpp | 6 +- - xbmc/guilib/GUIVideoControl.cpp | 6 +- - xbmc/guilib/GUIVisualisationControl.h | 2 +- - xbmc/guilib/GUIWindowManager.cpp | 24 +- - xbmc/guilib/GUIWindowManager.h | 1 - - xbmc/guilib/GraphicContext.cpp | 4 +- - xbmc/guilib/GraphicContext.h | 2 +- - xbmc/guilib/LocalizeStrings.cpp | 16 +- - xbmc/guilib/Resolution.cpp | 113 +- - xbmc/guilib/Resolution.h | 9 +- - xbmc/guilib/TextureBundle.cpp | 34 +- - xbmc/guilib/TextureBundle.h | 6 +- - xbmc/guilib/TextureBundleXBT.cpp | 32 +- - xbmc/guilib/TextureBundleXBT.h | 12 +- - xbmc/guilib/TextureManager.cpp | 2 +- - xbmc/guilib/WindowIDs.h | 7 +- - xbmc/input/ButtonTranslator.cpp | 15 +- - xbmc/input/InputCodingTableBaiduPY.h | 3 - - xbmc/input/InputCodingTableBasePY.h | 1 - - xbmc/input/InputCodingTableKorean.h | 1 - - xbmc/input/InputManager.cpp | 2 +- - xbmc/input/KeyboardLayoutManager.h | 1 - - xbmc/input/joysticks/DefaultJoystick.cpp | 4 +- - xbmc/input/linux/LinuxInputDevices.cpp | 15 + - xbmc/input/linux/LinuxInputDevices.h | 1 + - xbmc/interfaces/AnnouncementManager.cpp | 12 +- - xbmc/interfaces/IActionListener.h | 2 +- - xbmc/interfaces/IAnnouncer.h | 7 +- - xbmc/interfaces/builtins/AddonBuiltins.cpp | 4 +- - xbmc/interfaces/builtins/ApplicationBuiltins.cpp | 3 - - xbmc/interfaces/builtins/GUIBuiltins.cpp | 1 - - xbmc/interfaces/builtins/GUIControlBuiltins.cpp | 4 +- - xbmc/interfaces/builtins/PlayerBuiltins.cpp | 2 +- - xbmc/interfaces/builtins/SystemBuiltins.cpp | 9 +- - xbmc/interfaces/generic/LanguageInvokerThread.h | 3 - - xbmc/interfaces/generic/ScriptInvocationManager.h | 3 +- - xbmc/interfaces/json-rpc/ApplicationOperations.cpp | 1 - - xbmc/interfaces/json-rpc/AudioLibrary.h | 2 - - xbmc/interfaces/json-rpc/FileItemHandler.cpp | 2 +- - xbmc/interfaces/json-rpc/InputOperations.cpp | 7 +- - .../interfaces/json-rpc/JSONServiceDescription.cpp | 1 - - xbmc/interfaces/json-rpc/JSONUtils.h | 1 - - xbmc/interfaces/json-rpc/SettingsOperations.h | 2 - - xbmc/interfaces/json-rpc/VideoLibrary.cpp | 83 +- - xbmc/interfaces/json-rpc/VideoLibrary.h | 5 - - xbmc/interfaces/json-rpc/schema/methods.json | 37 +- - xbmc/interfaces/json-rpc/schema/types.json | 49 +- - xbmc/interfaces/json-rpc/schema/version.txt | 2 +- - xbmc/interfaces/legacy/CallbackHandler.h | 4 +- - xbmc/interfaces/legacy/Control.h | 2 - - xbmc/interfaces/legacy/InfoTagMusic.cpp | 10 - - xbmc/interfaces/legacy/InfoTagMusic.h | 36 - - xbmc/interfaces/legacy/InfoTagVideo.cpp | 9 +- - xbmc/interfaces/legacy/InfoTagVideo.h | 18 - - xbmc/interfaces/legacy/ListItem.cpp | 10 +- - xbmc/interfaces/legacy/ModuleXbmc.cpp | 7 +- - xbmc/interfaces/legacy/ModuleXbmcplugin.h | 2 - - xbmc/interfaces/legacy/PlayList.cpp | 4 +- - xbmc/interfaces/legacy/Player.h | 2 - - xbmc/interfaces/legacy/Window.cpp | 23 +- - xbmc/interfaces/legacy/Window.h | 1 - - xbmc/interfaces/legacy/WindowDialogMixin.cpp | 2 +- - xbmc/interfaces/legacy/WindowXML.cpp | 42 +- - xbmc/interfaces/legacy/WindowXML.h | 26 - - xbmc/interfaces/legacy/wsgi/WsgiResponse.h | 2 - - xbmc/interfaces/python/CallbackHandler.cpp | 2 +- - xbmc/interfaces/python/PythonInvoker.h | 1 - - xbmc/interfaces/python/swig.cpp | 6 +- - xbmc/linux/LinuxTimezone.cpp | 2 +- - xbmc/linux/OMXCore.h | 3 +- - xbmc/linux/PosixMountProvider.h | 3 - - xbmc/linux/RBP.cpp | 16 + - xbmc/linux/RBP.h | 3 + - xbmc/linux/imx/IMX.h | 135 +- - xbmc/listproviders/DirectoryProvider.cpp | 2 +- - xbmc/listproviders/DirectoryProvider.h | 16 +- - xbmc/listproviders/StaticProvider.cpp | 2 +- - xbmc/listproviders/StaticProvider.h | 14 +- - xbmc/messaging/ApplicationMessenger.h | 3 + - xbmc/music/Album.cpp | 6 +- - xbmc/music/GUIViewStateMusic.cpp | 53 +- - xbmc/music/GUIViewStateMusic.h | 10 + - xbmc/music/MusicDatabase.cpp | 74 +- - xbmc/music/MusicDatabase.h | 1 - - xbmc/music/dialogs/GUIDialogMusicInfo.cpp | 21 +- - xbmc/music/dialogs/GUIDialogSongInfo.cpp | 6 +- - xbmc/music/infoscanner/MusicInfoScanner.cpp | 2 +- - xbmc/music/infoscanner/MusicInfoScanner.h | 4 +- - xbmc/music/infoscanner/MusicInfoScraper.cpp | 4 +- - xbmc/music/infoscanner/MusicInfoScraper.h | 2 - - xbmc/music/tags/MusicInfoTagLoaderFactory.cpp | 3 +- - xbmc/music/tags/MusicInfoTagLoaderShn.cpp | 2 +- - xbmc/music/tags/TagLoaderTagLib.cpp | 34 +- - xbmc/music/windows/GUIWindowMusicBase.cpp | 77 +- - xbmc/music/windows/GUIWindowMusicBase.h | 2 - - xbmc/music/windows/GUIWindowMusicNav.h | 24 +- - xbmc/music/windows/GUIWindowMusicPlaylist.cpp | 1 - - xbmc/music/windows/GUIWindowVisualisation.cpp | 4 +- - xbmc/network/AirPlayServer.cpp | 1 - - xbmc/network/AirPlayServer.h | 1 - - xbmc/network/AirTunesServer.cpp | 1 - - xbmc/network/DNSNameCache.cpp | 86 +- - xbmc/network/DNSNameCache.h | 6 + - xbmc/network/EventClient.cpp | 6 +- - xbmc/network/EventPacket.h | 1 - - xbmc/network/GUIDialogNetworkSetup.cpp | 10 +- - xbmc/network/GUIDialogNetworkSetup.h | 25 +- - xbmc/network/Makefile.in | 1 + - xbmc/network/Network.cpp | 365 +- - xbmc/network/Network.h | 271 +- - xbmc/network/NetworkServices.cpp | 9 +- - xbmc/network/Socket.h | 2 +- - xbmc/network/TCPServer.cpp | 22 +- - xbmc/network/UdpClient.h | 1 - - xbmc/network/WakeOnAccess.cpp | 34 +- - xbmc/network/WakeOnAccess.h | 1 - - xbmc/network/WebServer.cpp | 30 +- - xbmc/network/Zeroconf.h | 4 +- - xbmc/network/ZeroconfBrowser.cpp | 3 + - xbmc/network/cddb.cpp | 2 +- - .../HTTPImageTransformationHandler.cpp | 2 +- - .../httprequesthandler/IHTTPRequestHandler.cpp | 3 - - xbmc/network/linux/Makefile | 1 + - xbmc/network/linux/NetworkLinux.cpp | 466 +- - xbmc/network/linux/NetworkLinux.h | 59 +- - xbmc/network/linux/ZeroconfAvahi.cpp | 6 +- - xbmc/network/linux/ZeroconfBrowserAvahi.cpp | 4 +- - xbmc/network/linux/ZeroconfBrowserAvahi.h | 1 - - xbmc/network/linux/android-ifaddrs/Makefile | 6 + - xbmc/network/linux/android-ifaddrs/README.md | 6 + - xbmc/network/linux/android-ifaddrs/ifaddrs.c | 663 + - xbmc/network/linux/android-ifaddrs/ifaddrs.h | 54 + - xbmc/network/mdns/ZeroconfBrowserMDNS.h | 1 - - xbmc/network/mdns/ZeroconfMDNS.cpp | 1 - - xbmc/network/mdns/ZeroconfMDNS.h | 2 - - xbmc/network/osx/ZeroconfBrowserOSX.h | 4 +- - xbmc/network/osx/priv_netlink.h | 120 + - xbmc/network/upnp/UPnP.cpp | 5 +- - xbmc/network/upnp/UPnPInternal.cpp | 29 +- - xbmc/network/upnp/UPnPRenderer.cpp | 8 +- - xbmc/network/upnp/UPnPServer.cpp | 4 +- - xbmc/network/windows/NetworkWin32.cpp | 33 +- - xbmc/network/windows/NetworkWin32.h | 10 +- - xbmc/peripherals/EventScanner.h | 4 +- - xbmc/peripherals/PeripheralTypes.h | 24 + - xbmc/peripherals/Peripherals.cpp | 38 +- - xbmc/peripherals/Peripherals.h | 8 +- - xbmc/peripherals/addons/AddonButtonMap.cpp | 2 +- - xbmc/peripherals/bus/Makefile.in | 1 + - xbmc/peripherals/bus/PeripheralBus.cpp | 17 + - xbmc/peripherals/bus/PeripheralBus.h | 3 + - .../bus/android/PeripheralBusAndroid.cpp | 4 +- - .../bus/linux/PeripheralBusPLATFORMLibUdev.cpp | 142 + - .../bus/linux/PeripheralBusPLATFORMLibUdev.h | 47 + - .../bus/linux/PeripheralBusUSBLibUdev.cpp | 16 +- - .../bus/linux/PeripheralBusUSBLibUdev.h | 2 +- - xbmc/peripherals/bus/virtual/PeripheralBusAddon.h | 1 - - xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp | 4 + - xbmc/peripherals/devices/Makefile.in | 1 + - xbmc/peripherals/devices/Peripheral.cpp | 2 +- - xbmc/peripherals/devices/Peripheral.h | 13 +- - xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 123 +- - xbmc/peripherals/devices/PeripheralCecAdapter.h | 8 +- - xbmc/peripherals/devices/PeripheralJoystick.h | 2 +- - xbmc/peripherals/devices/PeripheralVideo.cpp | 121 + - xbmc/peripherals/devices/PeripheralVideo.h | 62 + - .../dialogs/GUIDialogPeripheralSettings.cpp | 2 +- - xbmc/pictures/GUIWindowPictures.cpp | 1 - - xbmc/pictures/GUIWindowSlideShow.cpp | 1 - - xbmc/pictures/SlideShowPicture.cpp | 2 +- - .../platform/darwin/ios-common/AnnounceReceiver.mm | 1 - - xbmc/platform/darwin/ios/Info.plist.in | 23 +- - xbmc/platform/darwin/ios/XBMCController.mm | 18 +- - xbmc/platform/xbmc.cpp | 16 +- - xbmc/playlists/PlayList.cpp | 3 +- - xbmc/playlists/PlayList.h | 1 - - xbmc/playlists/PlayListPLS.h | 4 - - xbmc/playlists/SmartPlayList.cpp | 13 +- - xbmc/powermanagement/linux/LogindUPowerSyscall.cpp | 10 +- - xbmc/powermanagement/linux/UPowerSyscall.cpp | 15 +- - xbmc/powermanagement/osx/CocoaPowerSyscall.cpp | 4 +- - xbmc/profiles/ProfilesManager.cpp | 8 +- - xbmc/programs/GUIWindowPrograms.h | 12 +- - xbmc/pvr/PVRActionListener.cpp | 2 +- - xbmc/pvr/PVRDatabase.cpp | 52 +- - xbmc/pvr/PVRDatabase.h | 10 +- - xbmc/pvr/PVRGUIInfo.h | 2 - - xbmc/pvr/PVRManager.cpp | 287 +- - xbmc/pvr/PVRManager.h | 49 +- - xbmc/pvr/addons/PVRClients.cpp | 43 +- - xbmc/pvr/addons/PVRClients.h | 26 + - xbmc/pvr/channels/PVRChannel.cpp | 7 +- - xbmc/pvr/channels/PVRChannel.h | 6 + - xbmc/pvr/channels/PVRChannelGroup.cpp | 119 +- - xbmc/pvr/channels/PVRChannelGroup.h | 24 +- - xbmc/pvr/channels/PVRChannelGroups.cpp | 52 +- - xbmc/pvr/channels/PVRChannelGroups.h | 1 + - xbmc/pvr/channels/PVRChannelGroupsContainer.cpp | 7 +- - xbmc/pvr/channels/PVRChannelGroupsContainer.h | 6 + - xbmc/pvr/channels/PVRRadioRDSInfoTag.cpp | 105 + - xbmc/pvr/channels/PVRRadioRDSInfoTag.h | 21 + - xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp | 4 +- - xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h | 2 - - xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp | 2 +- - xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h | 8 +- - xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.cpp | 5 + - xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.h | 2 + - xbmc/pvr/dialogs/GUIDialogPVRRecordingInfo.h | 6 +- - xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp | 4 +- - xbmc/pvr/recordings/PVRRecording.cpp | 35 +- - xbmc/pvr/recordings/PVRRecording.h | 19 +- - xbmc/pvr/recordings/PVRRecordings.cpp | 15 +- - xbmc/pvr/recordings/PVRRecordings.h | 2 + - xbmc/pvr/timers/PVRTimerInfoTag.cpp | 170 +- - xbmc/pvr/timers/PVRTimerInfoTag.h | 33 +- - xbmc/pvr/timers/PVRTimers.cpp | 80 +- - xbmc/pvr/timers/PVRTimers.h | 10 +- - xbmc/pvr/windows/GUIWindowPVRBase.cpp | 26 +- - xbmc/pvr/windows/GUIWindowPVRBase.h | 6 +- - xbmc/pvr/windows/GUIWindowPVRChannels.cpp | 11 +- - xbmc/pvr/windows/GUIWindowPVRGuide.cpp | 42 +- - xbmc/pvr/windows/GUIWindowPVRGuide.h | 8 - - xbmc/pvr/windows/GUIWindowPVRRecordings.cpp | 16 +- - xbmc/pvr/windows/GUIWindowPVRSearch.cpp | 2 +- - xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp | 7 +- - xbmc/rendering/RenderSystem.h | 2 +- - xbmc/rendering/dx/RenderSystemDX.cpp | 119 +- - xbmc/rendering/dx/RenderSystemDX.h | 155 +- - xbmc/rendering/gl/RenderSystemGL.cpp | 4 +- - xbmc/rendering/gl/RenderSystemGL.h | 2 +- - xbmc/rendering/gles/RenderSystemGLES.cpp | 9 +- - xbmc/rendering/gles/RenderSystemGLES.h | 2 +- - xbmc/screensavers/gles/Makefile.in | 6 + - xbmc/screensavers/gles/ball/Makefile.in | 36 + - xbmc/screensavers/gles/ball/wrapper.cc | 102 + - xbmc/screensavers/gles/noise/Makefile.in | 36 + - xbmc/screensavers/gles/noise/wrapper.cc | 102 + - xbmc/screensavers/gles/plasma/Makefile.in | 36 + - xbmc/screensavers/gles/plasma/wrapper.cc | 102 + - xbmc/screensavers/gles/plasma2/Makefile.in | 36 + - xbmc/screensavers/gles/plasma2/wrapper.cc | 102 + - xbmc/screensavers/gles/solarwinds/Makefile.in | 36 + - xbmc/screensavers/gles/solarwinds/solarwinds.c | 530 + - xbmc/screensavers/gles/solarwinds/solarwinds.h | 60 + - xbmc/screensavers/gles/solarwinds/wrapper.cc | 96 + - xbmc/screensavers/gles/spiral/Makefile.in | 36 + - xbmc/screensavers/gles/spiral/wrapper.cc | 102 + - xbmc/screensavers/gles/stellar/Makefile.in | 36 + - xbmc/screensavers/gles/stellar/wrapper.cc | 102 + - xbmc/screensavers/gles/triangle2.c | 988 + - xbmc/screensavers/gles/triangle2.h | 64 + - xbmc/screensavers/gles/warp/Makefile.in | 36 + - xbmc/screensavers/gles/warp/wrapper.cc | 102 + - xbmc/settings/AdvancedSettings.cpp | 16 +- - xbmc/settings/AdvancedSettings.h | 1 + - xbmc/settings/AudioDSPSettings.cpp | 2 +- - xbmc/settings/DisplaySettings.cpp | 18 +- - xbmc/settings/MediaSettings.cpp | 2 +- - xbmc/settings/MediaSourceSettings.cpp | 2 +- - xbmc/settings/Settings.cpp | 10 +- - xbmc/settings/Settings.h | 9 +- - xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp | 11 +- - xbmc/settings/dialogs/GUIDialogAudioDSPManager.h | 2 +- - .../settings/dialogs/GUIDialogAudioDSPSettings.cpp | 4 +- - xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h | 3 +- - .../settings/dialogs/GUIDialogSettingsManualBase.h | 2 - - .../windows/GUIWindowSettingsScreenCalibration.h | 2 - - xbmc/storage/AutorunMediaJob.cpp | 4 +- - xbmc/storage/DetectDVDType.cpp | 2 +- - xbmc/storage/IStorageProvider.h | 4 - - xbmc/storage/MediaManager.cpp | 11 +- - xbmc/storage/MediaManager.h | 4 +- - xbmc/storage/android/AndroidStorageProvider.cpp | 2 +- - xbmc/storage/android/AndroidStorageProvider.h | 3 - - xbmc/storage/cdioSupport.cpp | 2 +- - xbmc/storage/linux/DeviceKitDisksProvider.cpp | 4 +- - xbmc/storage/linux/DeviceKitDisksProvider.h | 4 - - xbmc/storage/linux/LinuxStorageProvider.h | 3 - - xbmc/storage/linux/UDevProvider.h | 3 - - xbmc/storage/linux/UDisksProvider.cpp | 4 +- - xbmc/storage/linux/UDisksProvider.h | 4 - - xbmc/storage/osx/DarwinStorageProvider.h | 4 - - xbmc/storage/windows/Win32StorageProvider.h | 4 - - xbmc/system.h | 5 + - xbmc/test/TestBasicEnvironment.cpp | 10 +- - xbmc/test/TestURL.cpp | 10 +- - xbmc/threads/Atomics.h | 2 +- - xbmc/threads/platform/pthreads/ThreadImpl.cpp | 4 + - xbmc/utils/AMLUtils.cpp | 15 - - xbmc/utils/AliasShortcutUtils.cpp | 2 +- - xbmc/utils/BitstreamConverter.cpp | 17 +- - xbmc/utils/BitstreamConverter.h | 4 +- - xbmc/utils/CPUInfo.cpp | 32 +- - xbmc/utils/CPUInfo.h | 1 + - xbmc/utils/CryptThreading.cpp | 2 - - xbmc/utils/DatabaseUtils.cpp | 8 +- - xbmc/utils/GroupUtils.cpp | 4 +- - xbmc/utils/HTMLUtil.cpp | 2 +- - xbmc/utils/IRssObserver.h | 2 - - xbmc/utils/JSONVariantParser.cpp | 5 - - xbmc/utils/JSONVariantParser.h | 5 - - xbmc/utils/LabelFormatter.cpp | 6 +- - xbmc/utils/Makefile.in | 3 +- - xbmc/utils/Mime.cpp | 4 +- - xbmc/utils/RecentlyAddedJob.cpp | 4 +- - xbmc/utils/RssManager.cpp | 4 +- - xbmc/utils/RssReader.cpp | 2 +- - xbmc/utils/SaveFileStateJob.cpp | 2 +- - xbmc/utils/ScraperParser.cpp | 18 +- - xbmc/utils/Screen.cpp | 147 + - xbmc/utils/Screen.h | 52 + - xbmc/utils/SortUtils.cpp | 2 +- - xbmc/utils/SortUtils.h | 3 +- - xbmc/utils/Splash.cpp | 2 +- - xbmc/utils/StringUtils.cpp | 28 +- - xbmc/utils/StringUtils.h | 11 - - xbmc/utils/URIUtils.cpp | 72 +- - xbmc/utils/URIUtils.h | 5 + - xbmc/utils/Weather.cpp | 4 +- - xbmc/utils/log.cpp | 30 +- - xbmc/utils/test/TestCPUInfo.cpp | 2 +- - xbmc/utils/test/TestCharsetConverter.cpp | 9 +- - xbmc/utils/test/TestDatabaseUtils.cpp | 30 +- - xbmc/utils/test/TestJobManager.cpp | 3 +- - xbmc/utils/test/TestLabelFormatter.cpp | 1 - - xbmc/utils/test/TestRegExp.cpp | 2 +- - xbmc/utils/test/TestStringUtils.cpp | 23 - - xbmc/utils/test/TestURIUtils.cpp | 6 + - xbmc/video/ContextMenus.cpp | 3 +- - xbmc/video/ContextMenus.h | 1 + - xbmc/video/Episode.h | 4 - - xbmc/video/GUIViewStateVideo.cpp | 40 + - xbmc/video/GUIViewStateVideo.h | 10 + - xbmc/video/VideoDatabase.cpp | 178 +- - xbmc/video/VideoDatabase.h | 64 +- - xbmc/video/VideoInfoDownloader.h | 1 - - xbmc/video/VideoInfoScanner.cpp | 16 +- - xbmc/video/VideoInfoScanner.h | 9 +- - xbmc/video/VideoInfoTag.cpp | 118 +- - xbmc/video/VideoInfoTag.h | 28 +- - xbmc/video/VideoLibraryQueue.cpp | 1 + - xbmc/video/VideoReferenceClock.cpp | 3 +- - xbmc/video/VideoThumbLoader.cpp | 2 +- - xbmc/video/VideoThumbLoader.h | 1 - - .../dialogs/GUIDialogAudioSubtitleSettings.cpp | 8 +- - .../video/dialogs/GUIDialogAudioSubtitleSettings.h | 2 - - xbmc/video/dialogs/GUIDialogSubtitles.cpp | 6 +- - xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp | 3 + - xbmc/video/dialogs/GUIDialogVideoInfo.cpp | 22 +- - xbmc/video/dialogs/GUIDialogVideoOSD.cpp | 2 +- - xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 6 +- - xbmc/video/dialogs/GUIDialogVideoSettings.h | 4 - - xbmc/video/videosync/CMakeLists.txt | 2 +- - xbmc/video/windows/GUIWindowFullScreen.cpp | 4 +- - xbmc/video/windows/GUIWindowVideoBase.cpp | 12 +- - xbmc/video/windows/GUIWindowVideoNav.cpp | 6 +- - xbmc/video/windows/GUIWindowVideoPlaylist.cpp | 1 - - xbmc/view/GUIViewState.cpp | 12 +- - xbmc/view/GUIViewState.h | 2 - - xbmc/win32/WIN32Util.cpp | 5 +- - xbmc/win32/WIN32Util.h | 2 - - xbmc/win32/Win32DelayedDllLoad.cpp | 13 - - xbmc/windowing/WinEvents.cpp | 19 + - xbmc/windowing/WinEvents.h | 1 + - xbmc/windowing/WinEventsLinux.cpp | 5 + - xbmc/windowing/WinEventsLinux.h | 1 + - xbmc/windowing/WinSystem.cpp | 4 +- - xbmc/windowing/X11/WinSystemX11.h | 3 - - xbmc/windowing/X11/WinSystemX11GLContext.cpp | 2 +- - xbmc/windowing/X11/WinSystemX11GLESContext.cpp | 2 +- - xbmc/windowing/X11/XRandR.cpp | 4 +- - xbmc/windowing/android/CMakeLists.txt | 1 - - xbmc/windowing/egl/EGLEdid.cpp | 94 + - xbmc/windowing/egl/EGLEdid.h | 71 + - xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h | 3 - - xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp | 3 +- - xbmc/windowing/egl/EGLNativeTypeAmlogic.h | 3 - - xbmc/windowing/egl/EGLNativeTypeAndroid.h | 3 - - xbmc/windowing/egl/EGLNativeTypeIMX.cpp | 247 +- - xbmc/windowing/egl/EGLNativeTypeIMX.h | 24 +- - xbmc/windowing/egl/EGLNativeTypeRKAndroid.h | 3 - - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp | 228 +- - xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h | 11 +- - xbmc/windowing/egl/EGLWrapper.cpp | 1 + - xbmc/windowing/egl/EGLWrapper.h | 3 - - xbmc/windowing/egl/Makefile.in | 1 + - xbmc/windowing/egl/WinSystemEGL.cpp | 87 +- - xbmc/windowing/egl/WinSystemEGL.h | 6 - - xbmc/windowing/egl/vc_hdmi.h | 565 + - xbmc/windowing/osx/CMakeLists.txt | 2 +- - xbmc/windowing/osx/WinSystemIOS.h | 3 - - xbmc/windowing/osx/WinSystemOSX.h | 3 - - xbmc/windowing/windows/WinSystemWin32.cpp | 4 +- - xbmc/windowing/windows/WinSystemWin32.h | 1 - - xbmc/windowing/windows/WinSystemWin32DX.cpp | 2 +- - xbmc/windowing/windows/WinSystemWin32DX.h | 2 +- - xbmc/windows/GUIMediaWindow.cpp | 26 +- - xbmc/windows/GUIMediaWindow.h | 26 +- - xbmc/windows/GUIWindowFileManager.cpp | 16 +- - xbmc/windows/GUIWindowFileManager.h | 3 - - xbmc/windows/GUIWindowLoginScreen.cpp | 3 +- - xbmc/windows/GUIWindowSystemInfo.cpp | 2 + - xbmc/windows/GUIWindowSystemInfo.h | 3 - - 831 files changed, 67874 insertions(+), 7106 deletions(-) - create mode 100644 Makefile.python-interfaces - create mode 100644 addons/screensaver.gles.ball/addon.xml - create mode 100644 addons/screensaver.gles.ball/icon.png - create mode 100644 addons/screensaver.gles.noise/addon.xml - create mode 100644 addons/screensaver.gles.noise/icon.png - create mode 100644 addons/screensaver.gles.plasma/addon.xml - create mode 100644 addons/screensaver.gles.plasma/icon.png - create mode 100644 addons/screensaver.gles.plasma2/addon.xml - create mode 100644 addons/screensaver.gles.plasma2/icon.png - create mode 100644 addons/screensaver.gles.solarwinds/addon.xml - create mode 100644 addons/screensaver.gles.solarwinds/icon.png - create mode 100644 addons/screensaver.gles.spiral/addon.xml - create mode 100644 addons/screensaver.gles.spiral/icon.png - create mode 100644 addons/screensaver.gles.stellar/addon.xml - create mode 100644 addons/screensaver.gles.stellar/icon.png - create mode 100644 addons/screensaver.gles.warp/addon.xml - create mode 100644 addons/screensaver.gles.warp/icon.png - create mode 100644 project/cmake/installdata/darwin/packaging.txt - create mode 100644 project/cmake/installdata/darwin/runtime.txt - create mode 100644 project/cmake/modules/FindRTMP.cmake - mode change 100644 => 120000 project/cmake/scripts/android/PathSetup.cmake - create mode 100644 project/cmake/scripts/common/ManageString.cmake - create mode 100644 project/cmake/scripts/common/PathSetup.cmake - create mode 100644 project/cmake/scripts/darwin/ArchSetup.cmake - create mode 100644 project/cmake/scripts/darwin/Install.cmake - create mode 100644 project/cmake/scripts/darwin/Macros.cmake - create mode 100644 project/cmake/scripts/darwin/PathSetup.cmake - create mode 100644 project/cmake/treedata/darwin/subdirs.txt + Makefile.in | 1 + + .../resource.language.en_gb/resources/strings.po | 154 +- + configure.ac | 94 +- + project/cmake/addons/CMakeLists.txt | 3 +- + system/peripherals.xml | 13 +- + system/settings/imx6.xml | 28 +- + system/settings/settings.xml | 84 + + tools/EventClients/Clients/WiiRemote/Makefile | 2 +- + ...-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch | 69 + + .../0001-Squashed-commit-of-the-following.patch | 2180 +++++++++++++ + ...vcodec-add-h264_mvc-codec-id-and-profiles.patch | 67 + + ...er-add-support-for-parsing-h264-mvc-NALUs.patch | 113 + + ...Signal-unsupported-GMC-with-more-than-one.patch | 48 + + .../73fde6f9f3d01f7fc0f3ae4b66f6c725f9fb1105.patch | 24 + + tools/depends/target/ffmpeg/Makefile | 45 +- + .../added_ARM_NEON_optimized_SAO_patches.patch | 3328 ++++++++++++++++++++ + tools/depends/target/ffmpeg/autobuild.sh | 9 +- + ...arsing_of_mvc_slices_in_some_corner_cases.patch | 66 + + ...hevcdsp_ARM_NEON_optimized_epel_functions.patch | 409 +++ + xbmc/Application.cpp | 119 +- + xbmc/Application.h | 11 +- + xbmc/PlayListPlayer.cpp | 3 - + xbmc/URL.cpp | 2 + + xbmc/Util.cpp | 14 +- + .../AudioEngine/Engines/ActiveAE/ActiveAE.cpp | 16 +- + .../AudioEngine/Engines/ActiveAE/ActiveAESink.cpp | 21 +- + .../Engines/ActiveAE/ActiveAEStream.cpp | 15 +- + xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp | 45 +- + xbmc/cores/AudioEngine/Sinks/AESinkALSA.h | 2 +- + xbmc/cores/IPlayer.h | 4 + + .../VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h | 2 + + .../DVDCodecs/Video/DVDVideoCodecIMX.cpp | 1947 ++++++------ + .../VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.h | 376 ++- + .../VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp | 2 +- + xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp | 2 + + xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp | 7 + + .../VideoPlayer/VideoRenderers/BaseRenderer.cpp | 10 + + .../VideoRenderers/HwDecRender/RendererIMX.cpp | 63 +- + .../VideoRenderers/HwDecRender/RendererIMX.h | 2 + + .../VideoPlayer/VideoRenderers/RenderFlags.cpp | 5 + + .../cores/VideoPlayer/VideoRenderers/RenderFlags.h | 5 +- + .../VideoPlayer/VideoRenderers/RenderManager.cpp | 42 +- + xbmc/dbwrappers/Database.cpp | 3 + + xbmc/filesystem/CurlFile.cpp | 6 +- + xbmc/filesystem/DirectoryFactory.cpp | 8 +- + xbmc/filesystem/FileFactory.cpp | 8 +- + xbmc/guilib/Resolution.cpp | 113 +- + xbmc/guilib/Resolution.h | 9 +- + xbmc/input/linux/LinuxInputDevices.cpp | 11 + + xbmc/input/linux/LinuxInputDevices.h | 1 + + xbmc/interfaces/IAnnouncer.h | 7 +- + xbmc/interfaces/builtins/SystemBuiltins.cpp | 9 +- + xbmc/linux/RBP.cpp | 14 + + xbmc/linux/RBP.h | 3 + + xbmc/linux/imx/IMX.h | 135 +- + xbmc/messaging/ApplicationMessenger.h | 3 + + xbmc/music/MusicDatabase.cpp | 2 +- + xbmc/network/DNSNameCache.cpp | 86 +- + xbmc/network/DNSNameCache.h | 6 + + xbmc/network/Makefile.in | 1 + + xbmc/network/Network.cpp | 365 ++- + xbmc/network/Network.h | 271 +- + xbmc/network/NetworkServices.cpp | 7 +- + xbmc/network/TCPServer.cpp | 7 +- + xbmc/network/WakeOnAccess.cpp | 34 +- + xbmc/network/linux/Makefile | 1 + + xbmc/network/linux/NetworkLinux.cpp | 447 +-- + xbmc/network/linux/NetworkLinux.h | 59 +- + xbmc/network/linux/android-ifaddrs/Makefile | 6 + + xbmc/network/linux/android-ifaddrs/README.md | 6 + + xbmc/network/linux/android-ifaddrs/ifaddrs.c | 663 ++++ + xbmc/network/linux/android-ifaddrs/ifaddrs.h | 54 + + xbmc/network/osx/priv_netlink.h | 120 + + xbmc/peripherals/PeripheralTypes.h | 24 + + xbmc/peripherals/Peripherals.cpp | 12 + + xbmc/peripherals/Peripherals.h | 2 + + xbmc/peripherals/bus/Makefile.in | 1 + + xbmc/peripherals/bus/PeripheralBus.cpp | 16 + + xbmc/peripherals/bus/PeripheralBus.h | 3 + + .../bus/linux/PeripheralBusPLATFORMLibUdev.cpp | 142 + + .../bus/linux/PeripheralBusPLATFORMLibUdev.h | 47 + + .../bus/linux/PeripheralBusUSBLibUdev.cpp | 12 +- + .../bus/linux/PeripheralBusUSBLibUdev.h | 2 +- + xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp | 4 + + xbmc/peripherals/devices/Makefile.in | 1 + + xbmc/peripherals/devices/Peripheral.h | 12 + + xbmc/peripherals/devices/PeripheralCecAdapter.cpp | 121 +- + xbmc/peripherals/devices/PeripheralCecAdapter.h | 7 +- + xbmc/peripherals/devices/PeripheralVideo.cpp | 121 + + xbmc/peripherals/devices/PeripheralVideo.h | 62 + + xbmc/platform/xbmc.cpp | 16 +- + xbmc/powermanagement/linux/LogindUPowerSyscall.cpp | 10 +- + xbmc/powermanagement/linux/UPowerSyscall.cpp | 11 +- + xbmc/settings/DisplaySettings.cpp | 16 +- + xbmc/settings/Settings.cpp | 8 + + xbmc/settings/Settings.h | 7 + + xbmc/threads/platform/pthreads/ThreadImpl.cpp | 4 + + xbmc/utils/CPUInfo.cpp | 32 +- + xbmc/utils/CPUInfo.h | 1 + + xbmc/utils/Makefile.in | 1 + + xbmc/utils/RssReader.cpp | 2 +- + xbmc/utils/Screen.cpp | 147 + + xbmc/utils/Screen.h | 52 + + xbmc/utils/URIUtils.cpp | 72 +- + xbmc/utils/URIUtils.h | 5 + + xbmc/utils/Weather.cpp | 2 +- + xbmc/utils/log.cpp | 30 +- + xbmc/video/VideoReferenceClock.cpp | 3 +- + xbmc/video/dialogs/GUIDialogVideoOSD.cpp | 2 +- + xbmc/video/dialogs/GUIDialogVideoSettings.cpp | 4 + + xbmc/windowing/WinEvents.cpp | 19 + + xbmc/windowing/WinEvents.h | 1 + + xbmc/windowing/WinEventsLinux.cpp | 5 + + xbmc/windowing/WinEventsLinux.h | 1 + + xbmc/windowing/WinSystem.cpp | 4 +- + xbmc/windowing/egl/EGLEdid.cpp | 94 + + xbmc/windowing/egl/EGLEdid.h | 71 + + xbmc/windowing/egl/EGLNativeTypeIMX.cpp | 247 +- + xbmc/windowing/egl/EGLNativeTypeIMX.h | 20 +- + xbmc/windowing/egl/EGLWrapper.cpp | 1 + + xbmc/windowing/egl/Makefile.in | 1 + + xbmc/windowing/egl/WinSystemEGL.cpp | 64 +- + xbmc/windowing/egl/vc_hdmi.h | 565 ++++ + xbmc/windows/GUIMediaWindow.cpp | 4 +- + xbmc/windows/GUIWindowSystemInfo.cpp | 2 + + 125 files changed, 12150 insertions(+), 1880 deletions(-) create mode 100644 tools/depends/target/ffmpeg/0001-Discard-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch create mode 100644 tools/depends/target/ffmpeg/0001-Squashed-commit-of-the-following.patch create mode 100644 tools/depends/target/ffmpeg/0001-avcodec-add-h264_mvc-codec-id-and-profiles.patch @@ -876,30 +142,6 @@ kodi mk01: create mode 100644 tools/depends/target/ffmpeg/added_ARM_NEON_optimized_SAO_patches.patch create mode 100644 tools/depends/target/ffmpeg/h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch create mode 100644 tools/depends/target/ffmpeg/hevcdsp_ARM_NEON_optimized_epel_functions.patch - create mode 100644 tools/depends/target/ffmpeg/pfcd_hevc_optimisations.patch - create mode 100644 tools/depends/target/jpeg/Makefile - create mode 100644 tools/depends/target/libmodplug/Makefile - create mode 100644 tools/depends/target/python27/urllib-ssl-no-cert_check.patch - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.h - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.cpp - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.h - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.cpp - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.cpp - create mode 100644 xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h - create mode 100644 xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp - create mode 100644 xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h - create mode 100644 xbmc/cores/VideoPlayer/DVDInputStreams/DllLibRTMP.h - create mode 100644 xbmc/filesystem/AFPDirectory.cpp - create mode 100644 xbmc/filesystem/AFPDirectory.h - create mode 100644 xbmc/filesystem/AFPFile.cpp - create mode 100644 xbmc/filesystem/AFPFile.h - create mode 100644 xbmc/filesystem/DllLibAfp.h - create mode 100644 xbmc/filesystem/FileReaderFile.cpp - create mode 100644 xbmc/filesystem/FileReaderFile.h create mode 100644 xbmc/network/linux/android-ifaddrs/Makefile create mode 100644 xbmc/network/linux/android-ifaddrs/README.md create mode 100644 xbmc/network/linux/android-ifaddrs/ifaddrs.c @@ -909,27 +151,6 @@ kodi mk01: create mode 100644 xbmc/peripherals/bus/linux/PeripheralBusPLATFORMLibUdev.h create mode 100644 xbmc/peripherals/devices/PeripheralVideo.cpp create mode 100644 xbmc/peripherals/devices/PeripheralVideo.h - create mode 100644 xbmc/screensavers/gles/Makefile.in - create mode 100644 xbmc/screensavers/gles/ball/Makefile.in - create mode 100644 xbmc/screensavers/gles/ball/wrapper.cc - create mode 100644 xbmc/screensavers/gles/noise/Makefile.in - create mode 100644 xbmc/screensavers/gles/noise/wrapper.cc - create mode 100644 xbmc/screensavers/gles/plasma/Makefile.in - create mode 100644 xbmc/screensavers/gles/plasma/wrapper.cc - create mode 100644 xbmc/screensavers/gles/plasma2/Makefile.in - create mode 100644 xbmc/screensavers/gles/plasma2/wrapper.cc - create mode 100644 xbmc/screensavers/gles/solarwinds/Makefile.in - create mode 100644 xbmc/screensavers/gles/solarwinds/solarwinds.c - create mode 100644 xbmc/screensavers/gles/solarwinds/solarwinds.h - create mode 100644 xbmc/screensavers/gles/solarwinds/wrapper.cc - create mode 100644 xbmc/screensavers/gles/spiral/Makefile.in - create mode 100644 xbmc/screensavers/gles/spiral/wrapper.cc - create mode 100644 xbmc/screensavers/gles/stellar/Makefile.in - create mode 100644 xbmc/screensavers/gles/stellar/wrapper.cc - create mode 100644 xbmc/screensavers/gles/triangle2.c - create mode 100644 xbmc/screensavers/gles/triangle2.h - create mode 100644 xbmc/screensavers/gles/warp/Makefile.in - create mode 100644 xbmc/screensavers/gles/warp/wrapper.cc create mode 100644 xbmc/utils/Screen.cpp create mode 100644 xbmc/utils/Screen.h create mode 100644 xbmc/windowing/egl/EGLEdid.cpp @@ -937,7 +158,7 @@ kodi mk01: create mode 100644 xbmc/windowing/egl/vc_hdmi.h diff --git a/Makefile.in b/Makefile.in -index 957fb92..f7d19db 100644 +index 957fb92..6f4ce9f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -171,6 +171,7 @@ DIRECTORY_ARCHIVES += xbmc/network/linux/network_linux.a @@ -948,136 +169,11 @@ index 957fb92..f7d19db 100644 else DIRECTORY_ARCHIVES += xbmc/input/joysticks/input_joysticks.a DIRECTORY_ARCHIVES += xbmc/input/joysticks/generic/input_joysticks_generic.a -@@ -209,6 +210,20 @@ LIB_DIRS=\ - lib/cpluff \ - lib/xbmc-dll-symbols - -+SS_DIRS= -+ifneq (@DISABLE_GLESSCREENSAVERS@,1) -+ SS_DIRS+= xbmc/screensavers/gles/solarwinds -+ SS_DIRS+= xbmc/screensavers/gles/plasma -+ SS_DIRS+= xbmc/screensavers/gles/plasma2 -+ SS_DIRS+= xbmc/screensavers/gles/noise -+ SS_DIRS+= xbmc/screensavers/gles/warp -+ SS_DIRS+= xbmc/screensavers/gles/stellar -+ SS_DIRS+= xbmc/screensavers/gles/spiral -+ SS_DIRS+= xbmc/screensavers/gles/ball -+else -+ INSTALL_FILTER+= .*screensaver\.gles.* -+endif -+ - LIBADDON_DIRS=\ - lib/addons/library.xbmc.addon \ - lib/addons/library.kodi.adsp \ -@@ -333,6 +348,17 @@ exports: xbmc/cores/DllLoader/exports/exports.a xbmc/cores/DllLoader/exports/uti - $(MAKE) -C xbmc/cores/DllLoader/exports wrapper.def - dllloader: exports xbmc/cores/DllLoader/dllloader.a - -+ifeq (@USE_OPENGLES@,1) -+GLESHELPERS=xbmc/screensavers/gles/gleshelpers.a -+$(GLESHELPERS): force exports -+ $(MAKE) -C xbmc/screensavers/gles -+endif -+ -+$(SS_DIRS): force exports $(GLESHELPERS) -+ $(MAKE) -C $@ -+ -+screensavers: $(SS_DIRS) -+ - libaddon: exports - $(MAKE) -C lib/addons/library.xbmc.addon - $(MAKE) -C lib/addons/library.kodi.adsp -diff --git a/Makefile.python-interfaces b/Makefile.python-interfaces -new file mode 100644 -index 0000000..22b0059 ---- /dev/null -+++ b/Makefile.python-interfaces -@@ -0,0 +1,15 @@ -+include bootstrap.mk -+ -+null := -+space := ${null} ${null} -+${space} := ${space} -+ -+AUTOGENERATED_MAKEFILE = xbmc/interfaces/python/Makefile -+ -+# hack targets to keep build system up to date -+Makefile : config.status $(addsuffix .in, $(AUTOGENERATED_MAKEFILES)) -+ @echo "Regenerating Makefiles..." -+ @./config.status &> /dev/null -+ @echo "done" -+ -+config.status: configure -diff --git a/README.md b/README.md -index 2b147d5..78ee0db 100644 ---- a/README.md -+++ b/README.md -@@ -25,7 +25,7 @@ around. It was designed for network playback, so you can stream your multimedia - from anywhere in the house or directly from the internet using practically any - protocol available. - --Use your media as-is: Kodi can play CDs and DVDs directly -+Use your media as-is: Kodi can play CD's and DVD's directly - from the disk or image file, almost all popular archive formats from your hard - drive, and even files inside ZIP and RAR archives. It will even scan all of - your media and automatically create a personalized library complete with box -diff --git a/addons/repository.xbmc.org/addon.xml b/addons/repository.xbmc.org/addon.xml -index 96010aa..e106ce1 100644 ---- a/addons/repository.xbmc.org/addon.xml -+++ b/addons/repository.xbmc.org/addon.xml -@@ -1,7 +1,7 @@ - - - - -@@ -59,7 +59,7 @@ - Add-ons van Kodi.tv installeren - Instaluj dodatki z Kodi.tv - Instale Add-ons do Kodi.tv -- Instalar Add-ons a partir de Kodi.tv -+ Instalar add-ons a partir de Kodi.tv - Instalați suplimente de la Kodi.tv - Установить дополнения с сайта Kodi.tv - Inštalovať rozšírenia z Kodi.tv -@@ -115,7 +115,7 @@ - Download en installeer add-ons uit de officiële Kodi.tv add-on depot.[CR] Wanneer u de officiële depot gebruikt beschikt u over onze uitgebreide mirrorservice, waardoor u snel kan downloaden van locaties in uw buurt.[CR] Alle add-ons in dit depot ondergingen standaardtests; indien u een defecte of niet-werkende add-on vindt, meld dit dan aan Team Kodi zodat zij actie kunnen ondernemen. - Pobieraj i instaluj dodatki z oficjalnego repozytorium Kodi.tv.[CR] Używając oficjalnego repozytorium korzystasz z serwerów lustrzanych, rozsianych po całym świecie. Wybierany jest ten, który znajduje się najbliżej ciebie, zapewniając dużą prędkość połączenia.[CR]Wszystkie dodatki znajdujące się w tym repozytorium są testowane, ale mogą okazać się niesprawne. Zgłoś wówczas błąd, aby zespół Kodi mógł podjąć odpowiednie działanie. - Transfira e instale add-ons a partir do repositório oficial do Kodi.tv.[CR]|Ao utilizar o repositório oficial, você será capaz de tirar proveito do nosso serviço de espelhamento de arquivos, auxiliando em downloads mais rápidos a partir de uma região perto de você.[CR]|Todos os add-ons neste repositório passam por testes básicos, se você encontrar algum quebrado ou que não esteja funcionando, por favor reporte para a equipe do Kodi, para que possamos tomar as ações necessárias. -- Transferir e instalar add-ons a partir do repositório de add-ons oficiais de Kodi.tv.[CR]Ao utilizar o Repositório oficial, irá beneficiar do nosso serviço de servidores de ficheiros para o ajudar a ter transferências mais rápidas da região mais perto de si.[CR]Todos os Add-ons neste repositório foram alvo de testes básicos. Se encontrar um danificado ou que não funciona, por favor, informe Tema Kodi, para que a situação seja resolvida. -+ Transferir e instalar os add-ons do repositório de add-ons Oficiais de Kodi.tv.[CR]Ao utilizar o Repositório oficial, irá beneficiar do nosso serviço de servidores de ficheiro para o ajudar a ter transferências mais rápidas a partir da região mais perto de si.[CR]Todos os Add-ons neste repositório foram alvo de testes básicos. Se encontrar um danificado ou que não funciona, por favor, informe a Equipa do Kodi, para que a situação seja resolva. - Descărcați și instalați suplimente din depozitul de suplimente Kodi.tv oficial.[CR] Folosind depozitul (repository) oficial puteți beneficia de serviciul nostru de găzduire distribuită pentru a vă ajuta să descărcați mai repede dintr-o regiune mai apropiată de dumneavoastră.[CR] Toate suplimentele din acest depozit au trecut testele de bază, în caz că găsiți un supliment defect vă rugăm să îl raportați echipei Kodi pentru a lua măsurile necesare. - Загружайте и устанавливайте обновления из официального репозитория Kodi.tv[CR]Используя официальный репозиторий, вы сможете воспользоваться преимуществами распределенного хранилища для быстрой загрузки файлов с ближайшего к вам сервера.[CR]Все дополнения в данном репозитории прошли тестирование. Если вы обнаружили нерабочее дополнение, сообщите об этом разработчикам Kodi. - Stiahnuť a nainštalovať rozšírenia z oficiálneho zdroja rozšírení Kodi.tv.[CR] Použitím oficiálneho zdroja získavate možnosť využiť rozsiahly systém zrkadiel, ktorý Vám umožní rýchlejšie sťahovanie z Vám blízkeho regiónu.[CR] Všetky rozšírenia v tomto zdroji boli podrobené základnému testovaniu. Ak nájdete poškodené alebo nefunkčné rozšírenie, oznámte to prosím týmu Kodi aby mohol podľa potreby zakročiť. -@@ -172,7 +172,7 @@ - Team Kodi heeft niet alle add-ons in deze depot geschreven en is niet verantwoordelijk voor hun inhoud. - Zespół Kodi nie tworzy wszystkich dodatków i nie bierze odpowiedzialności za ich zawartość - O Time do Kodi não produziu todos os add-ons deste repositório, e portanto não é responsável ​​por seu conteúdo -- A Team Kodi não desenvolveu todos os add-ons neste repositório, e não é responsável pelo seu conteúdo. -+ A equipa Kodi não desenvolveu todos os add-ons neste repositório e não é responsável pelo seu conteúdo. - Echipa Kodi nu a creat toate aceste suplimente din acest depozit și nu este responsabilă pentru conținutul lor. - Разработчики Kodi не являются авторами всех дополнений в данном репозитории и не несут ответственность за их содержимое. - Team Kodi nevytvoril všetky rozšírenia v tomto zdroji nie je zodpovedný za ich obsah diff --git a/addons/resource.language.en_gb/resources/strings.po b/addons/resource.language.en_gb/resources/strings.po -index 3cb5426..d4ee85e 100644 +index 028aa8f..d4ee85e 100644 --- a/addons/resource.language.en_gb/resources/strings.po +++ b/addons/resource.language.en_gb/resources/strings.po -@@ -3029,7 +3029,10 @@ msgctxt "#672" - msgid "Verbose logging for the [B]FFmpeg[/B] libraries" - msgstr "" - --#empty string with id 673 -+#: xbmc/settings/AdvancedSettings.cpp -+msgctxt "#673" -+msgid "Verbose logging for the [B]RTMP[/B] library" -+msgstr "" - - #: xbmc/settings/AdvancedSettings.cpp - msgctxt "#674" -@@ -5085,7 +5088,12 @@ msgctxt "#10524" +@@ -5088,7 +5088,12 @@ msgctxt "#10524" msgid "Movie information" msgstr "" @@ -1091,7 +187,7 @@ index 3cb5426..d4ee85e 100644 #: xbmc/guilib/WindowIDs.h msgctxt "#12000" -@@ -5576,7 +5584,12 @@ msgctxt "#13005" +@@ -5579,7 +5584,12 @@ msgctxt "#13005" msgid "Shutdown" msgstr "" @@ -1105,7 +201,7 @@ index 3cb5426..d4ee85e 100644 #: system/settings/settings.xml msgctxt "#13008" -@@ -6080,7 +6093,12 @@ msgctxt "#13287" +@@ -6083,7 +6093,12 @@ msgctxt "#13287" msgid "Screen resolution:" msgstr "" @@ -1119,16 +215,7 @@ index 3cb5426..d4ee85e 100644 msgctxt "#13292" msgid "A/V cable:" -@@ -6544,7 +6562,7 @@ msgstr "" - - #: system/settings/settings.xml - msgctxt "#13414" --msgid "Show song and album artists" -+msgid "Include artists who appear only on compilations" - msgstr "" - - #: system/settings/settings.xml -@@ -6857,7 +6875,17 @@ msgctxt "#13557" +@@ -6860,7 +6875,17 @@ msgctxt "#13557" msgid "Skip delay" msgstr "" @@ -1147,15 +234,7 @@ index 3cb5426..d4ee85e 100644 #: system/settings/darwin.xml msgctxt "#13600" -@@ -6998,6 +7026,7 @@ msgid "Change area code 3" - msgstr "" - - #: system/settings/settings.xml -+#: xbmc/music/windows/GUIWindowMusicBase.cpp - #: xbmc/music/windows/GUIWindowMusicPlaylistEditor.cpp - #: xbmc/vide/windows/GUIWindowVideoBase.cpp - msgctxt "#14022" -@@ -8741,16 +8770,40 @@ msgstr "" +@@ -8745,16 +8770,40 @@ msgstr "" #. Description of OSD video settings for deinterlace method with label #16334 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp msgctxt "#16334" @@ -1199,65 +278,7 @@ index 3cb5426..d4ee85e 100644 #: xbmc/video/dialogs/GUIDialogVideoSettings.cpp msgctxt "#16400" -@@ -9251,56 +9304,7 @@ msgctxt "#19085" - msgid "Unknown channel %u" - msgstr "" - --#. Label for "Instant recording action" setting --#: system/settings/settings.xml --#: xbmc/pvr/PVRMananger.cpp --msgctxt "#19086" --msgid "Instant recording action" --msgstr "" -- --#. Label for "Instant recording action" settings value --#: system/settings/settings.xml --msgctxt "#19087" --msgid "Record current show (if guide data available)" --msgstr "" -- --#. Label for "Instant recording action" settings value --#: system/settings/settings.xml --msgctxt "#19088" --msgid "Record for a fixed period of time (Instant recording duration)" --msgstr "" -- --#. Label for "Instant recording action" settings value --#: system/settings/settings.xml --msgctxt "#19089" --msgid "Ask what to do" --msgstr "" -- --#. Label for "Instant recording action" dialog settings value --#: xbmc/pvr/PVRMananger.cpp --msgctxt "#19090" --msgid "Record the next %d minutes" --msgstr "" -- --#. Label for "Instant recording action" dialog settings value --#: xbmc/pvr/PVRMananger.cpp --msgctxt "#19091" --msgid "Record current show (%s)" --msgstr "" -- --#. Label for "Instant recording action" dialog settings value --#: xbmc/pvr/PVRMananger.cpp --msgctxt "#19092" --msgid "Record next show (%s)" --msgstr "" -- --#. Instant recording summary. Expands to "Instant recording: ", for example "Instant recording: 31/05/2016 from 9:00 to 11:00" --#: xbmc/pvr/PVRTimerInfoTag.cpp --msgctxt "#19093" --msgid "Instant recording: %s" --msgstr "" -- --#empty strings from id 19094 to 19096 -+#empty strings from id 19086 to 19096 - - msgctxt "#19097" - msgid "Enter the name for the recording" -@@ -11724,7 +11728,10 @@ msgctxt "#20260" +@@ -11679,7 +11728,10 @@ msgctxt "#20260" msgid "Secure Shell (SSH / SFTP)" msgstr "" @@ -1269,37 +290,7 @@ index 3cb5426..d4ee85e 100644 #: xbmc/storage/MediaManager.cpp msgctxt "#20262" -@@ -14046,9 +14053,9 @@ msgctxt "#24053" - msgid "License:" - msgstr "" - --#: addons/skin.estuary/1080i/DialogAddonInfo.xml -+#: xbmc/addons/GUIDialogAddonInfo.cpp - msgctxt "#24054" --msgid "What's new" -+msgid "Changelog" - msgstr "" - - #. Used in the Add-on Manager -@@ -15909,7 +15916,7 @@ msgstr "" - #. Help text for controller window - #: xbmc/games/controllers/windows/GUIControllerWindow.cpp - msgctxt "#35055" --msgid "Use the keyboard or remote to select a controller profile. When prompted, press the button on your game controller that best matches what you see on the screen. If you make a mistake you can repeat the process." -+msgid "Use the keyboard or remote to select a controller profile. Move to the buttons and select the first one. When prompted, press the button on your game controller that best matches what you see on the screen. If you make a mistake you can repeat the process." - msgstr "" - - #. Title of error dialog shown when no joystick add-ons provide button mapping -@@ -16643,7 +16650,7 @@ msgstr "" - #. Description of setting with label #13435 "Enable HQ Scalers for scaling above" - #: system/settings/settings.xml - msgctxt "#36154" --msgid "Use high quality scalers when upscaling a video by at least this percentage. A value below 5% makes little sense as video is processed with high GPU load without any visible picture quality improvements." -+msgid "Use high quality scalers when upscaling a video by at least this percentage." - msgstr "" - - #. Description of setting with label #13425 "Allow hardware acceleration (VDPAU)" -@@ -16748,7 +16755,11 @@ msgctxt "#36171" +@@ -16703,7 +16755,11 @@ msgctxt "#36171" msgid "Select the zoom level that 4:3 videos are shown on widescreen displays." msgstr "" @@ -1312,7 +303,7 @@ index 3cb5426..d4ee85e 100644 #. Description of setting with label #14109 "Short date format" #: system/settings/settings.xml -@@ -17004,7 +17015,11 @@ msgctxt "#36218" +@@ -16959,7 +17015,11 @@ msgctxt "#36218" msgid "This category contains the electronic programming guide (EPG) settings." msgstr "" @@ -1325,58 +316,7 @@ index 3cb5426..d4ee85e 100644 #: system/settings/settings.xml msgctxt "#36220" -@@ -17078,7 +17093,7 @@ msgstr "" - - #: system/settings/settings.xml - msgctxt "#36234" --msgid "Duration of instant recordings when pressing the record button. This value will be taken into account if \"Instant recording action\" is set to \"Record for a fixed period of time\"" -+msgid "Duration of instant recordings when pressing the record button." - msgstr "" - - #: system/settings/settings.xml -@@ -17177,15 +17192,12 @@ msgctxt "#36253" - msgid "Section that contains settings related to music files and how they are handled." - msgstr "" - --#: system/settings/settings.xml --msgctxt "#36254" --msgid "Action to perform when pressing the record button. [Record current show] will record the current show from \"now\" to the end of the show. If no TV guide data is currently available a fixed length recording starting \"now\", with the value set for \"Instant recording duration\" will be scheduled. [Record for a fixed period of time] will schedule a fixed length recording starting \"now\", with the value set for \"Instant recording duration\". [Ask what to do] will open a dialogue containing different recording actions to choose from, like \"Record current show\", \"Record next show\" and some fixed duration recordings." --msgstr "" -+#empty string with id 36254 - --#. Description of setting with label #13414 "Show song and album artists" -+#. Description of setting with label #13414 "Include artists who appear only on compilations" - #: system/settings/settings.xml - msgctxt "#36255" --msgid "When enabled, both song and album artists are shown. When disabled, only album artists are shown and artists that appear only on individual songs from an album are excluded." -+msgid "Determine if artists that appear only on compilations are shown in the library artist view." - msgstr "" - - #. Description of setting with label #20192 "Fetch additional information during updates" -@@ -17403,7 +17415,12 @@ msgctxt "#36291" - msgid "Auto eject disc after rip is complete." - msgstr "" - --#empty strings from id 36292 to 36301 -+#empty strings from id 36292 to 36300 -+ -+#: system/settings/settings.xml -+msgctxt "#36301" -+msgid "No info available yet." -+msgstr "" - - #: system/settings/settings.xml - msgctxt "#36302" -@@ -19187,8 +19204,6 @@ msgctxt "#38111" - msgid "This category contains other settings for the GUI interface" - msgstr "" - --#empty strings from id 38112 to 38999 -- - #: system/settings/settings.xml - msgctxt "#39000" - msgid "HD and up" -@@ -19208,3 +19223,77 @@ msgstr "" +@@ -19163,3 +19223,77 @@ msgstr "" msgctxt "#39003" msgid "Accelerate h264" msgstr "" @@ -1454,2301 +394,12 @@ index 3cb5426..d4ee85e 100644 +msgctxt "#40013" +msgid "Allow changing to non-CEA modes" +msgstr "" -diff --git a/addons/screensaver.gles.ball/addon.xml b/addons/screensaver.gles.ball/addon.xml -new file mode 100644 -index 0000000..523e339 ---- /dev/null -+++ b/addons/screensaver.gles.ball/addon.xml -@@ -0,0 +1,121 @@ -+ -+ -+ -+ -+ -+ -+ -+ Seker die tweede mees psigedeliese sluimerskerm ooit -+ ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق -+ Напэўна, другі найбольш псіхадэлічны ахоўнік экрану -+ Вероятно вторият най-халюциногенен скрийнсейвър -+ Probablement el segon estalvi de pantalla més psicodèlic mai creat -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig -+ Formodentlig den anden mest psykedeliske pauseskærm nogensinde -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ -+ Rotating ball screensaver -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probablemente el segundo salvapantallas más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico -+ Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud -+ Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena -+ Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan -+ Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé -+ Probablement le deuxième économiseur d'écran le plus psychédélique -+ Probabelmente o segundo protector de pantalla máis psicodélico. -+ כנראה שומר המסך השני בדירוג הפסיכדליות -+ Vjerojatno drugi najveći psihodelični čuvar zaslona ikad -+ A második legpszihedelikusabb képernyővédő -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna -+ Probabilmente il secondo salvaschermo più psichedelico di sempre -+ 世界で2番目にサイケなスクリーンセーバー -+ 아마도 지금까지 두번째로 가장 환상적인 화면보호기 -+ Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē -+ Можеби втора нај психоделична заштита на екран -+ Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit -+ Helt sikkert den nest mest psykedeliske skjermspareren som finnes -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie -+ Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre -+ Provavelmente a segunda mais psicodélica proteção de tela já vista -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată -+ Наверное, вторая из самых психоделических заставок в мире -+ Förmodligen den näst psykedeliska skärmsläckaren -+ පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu -+ Troligen den näst mest psykedeliska skärmsläckaren någonsin. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu -+ Напевно, друга серед найбільш психоделічних заставок -+ Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai -+ 或许是排名第二的迷幻效果屏幕保护程序 -+ 可能是有史以來第二最夢幻的螢幕保護程式保護程式 -+ Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg. -+ ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة . -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове. -+ Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se. -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy. -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas. -+ Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring. -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten. -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor. -+ Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad. -+ Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen. -+ Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor. -+ כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום. -+ Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo. -+ Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni. -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari. -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu. -+ Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ 아마도 존재하는 두번째로 가장 환상적인 화면보호기. 모든 색깔들이 움직이는 것을 상상해보세요. -+ Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt. -+ Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат. -+ Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen. -+ Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt. -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw. -+ Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se. -+ Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela. -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se. -+ Просто попробуйте представить себе все цвета в движении. -+ Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt. -+ පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo. -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog. -+ Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд. -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın. -+ Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів. -+ Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi -+ 或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。 -+ 可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.ball/icon.png b/addons/screensaver.gles.ball/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..a6784afc53d95a655742f9b7db247471fc52a105 -GIT binary patch -literal 5657 -zcmd5=%_yf)hI}rNdW+$&`^i!0RZ0Z5f2~+-G*^$ -zdC}XzSS?I;T#Z?V*$oLUxq6 -zE9lIcr+wgK*+sd{`L^(P-8a3lYQ&E}UA|67z<}ug9WVyQrWc4}FGAmYqBl>1bONzv -zC+?Ez!vf2~`U3PpH94L~S5!~e3>{ftnwqYDHkO#%!3Eds-f-vU<#x3ok^P!#c&&Mj -zzqU{)hEWAAwchi(#n$&f83OU#4u794xU3pF;=hiq3z=Iyzy>gw6Z9jc|#L>RDEfDP^{ -zw1VZPJzaiK3d}>fS&jI4kUS-TdMLJX#O%vmQUu7;ka*&oPz;Dus2GWytedNb0VVFo -z=kC>iea=I}ER0DJ)^vpcb6$-b?rJ8LX9^5>nJ}Xg6!55(@FZlJA9&Z2c -z!+;}TZ4V{di+qq?Xf=8;-O}LTGYj|nvT$g|IzXn0C-KCg_?NN3#>vI=#XWhw?Wi^+ -z^5c(n?^!b~o5{zi??H}^N`*^@ANh^k1$*V8eb%ysgxv^$Gs<9_i2oVtX{VnGo`hq+ -zylhDS*9eiVK!Mjpe5VF{IPTn9Mgq4AI)Ep>o|344+WxA@`KN8z(B22(wE%zr&1Wb(!JYd`bl)I`2oCbOeV)*7eJt@Rok8|jq%ZHWu5Ak2x( -z`UFt5tE>DaycfyOpHB3v>FWnYB4&^~-QE=wrbh62 -zn@A$`0LoZf#ctGs9~hCsirP#OM22xhr~DjQh$2s$IAh95$xVO& -zcI->QTatShXtbcLfgS3SfEPF^93rtz6YI-*0?-UuSjH{Z8 -z>at!RLM1%!4T?6mr+tW3;$0ZF^9h1MSU+qSkfN+qVan0pj3C9$(Z -zjg$p*`xnG=-UpXTg`QTr$bZ+KkmkjM7f<<(oJvf&LnN6o5O;~iCm}~b@LEPWSb~QN -zJvrf{&fR@?rCsTVW+tuPtR{j_|4_OdieB5wpOErln*d&^`xYqJB}54VP*d3 -z&)HR_0%}>q-`}5IKKOF?%tuz&P=uHyk2`%>v1o6vPOEdVi%Kw@Nh -zsjWuVK={$ASC{xw0)zYuzvdKk^U%<6W5MG3WD#Ejd`MLp9;CT{9CUmC2jO!ymsF@> -zEJt^3H~ZaVHI7i*i^D?A^p=+9^>{;x7xfK)b&!IRtzcI_RMEO>f}0;4fI<;(ly1&N$3` -z-lic`n(t!wdUcV5JB2Ggdf&nj!kCklV<1M7J})(5`kK99*4W%!E?~c>2~v?P3~@C^ -zlX#f*?4#Xl7f;*0*W9*Ap;Hk+8EhNdv&>DKEVtG>FH{2TPBet|=osjln*M%-LGu2z -zL6!@uFSC7y!qJ0oM~konMa2pq-U#1Mp!gd_SWhtcc~8c~oTsDdcMQ?2n~~swL^X!1 -zU11*XYJom55TMsw%_BXl>M{}2WD-1$=>I;lpg%S*dMmaX&mWYf)OX8wAK-SRl0BBP -zzA@l068Eb=Je9%tc+6~qLwaHz#^ta7gMzMGf#fH4fLLsE5pRxwC2(Mzkx5C -zw7vTiDbg1x93}BMYY{lp9EWlJymk`-D?Ba)BQ@35Zb40#md}y7xw&?h46NCd_GU-K -zGI~0z+h?G82a$RIW$drvbmGF!xHz=yk>lgp$C4bf5naT>bUzfw1ow%)-r>PKoE9&}$SiH|ip)kt -z;9-&()<{0ja4c^nGqS!$e$9FYSWnjAN}suVph5bo_MONsLq)<;i7%VV7Q}SCuAH%d -zLMNI{m@*=+WwbE;v7kzShVaF25xR7xjPwUtI0G~gn -z)vub}A?$;;u$@>@qWUID4EfMbSJ~S<9##^~>E0UgzwDtmQB>KgKoZAQcw_K(e7vcq -zAA7nD>s5sh!>rjK9pa~8^1;Z=yzbSpAbkkHfEcxOJG3z+EaTK?Zugxnoo=pt88IRB -zXqvOYzUEJJ`affS{VZyCta=bM;-fvk!OecIa2$I<`9PXsUL-1va -znVb_V!RY8z_|?}$RmTLdcr4+t_)jMmam~}=)=*0G5i;mb3z(sIDqT#g^%Ni&E%1^D -zxmd*BDX1hwOAMqQ53VV{l$S%))EB}$4@SA~I-!oT#l{MVq=`x0^J*IAm&Bj#lmoks -zsV3eYGvXiAJ>LhsR?z0xok{K}D)7F!cKRJEn;w2ma^s(W&8C&fUJ#wIu}K~9{;iJ` -zH7V+;&Y07SBe>e*SRwOfDaLdW{3^W~N-9ey+i^AYPtSZ%MR5$%^s!g*9}f92+4qdU -zez3N;p8D=)dq_%2<#NPf2#I<+J+C|eXf$>91vam*um4Wbhle2)I7PA;|LpHiEyS2+ -z=j4oqCV!Td)_@;X4_U4Oj#b?X%r!MNt5P24S5Hr-&PB2^I~EDQrzJ+LQ&5`Il-XqA -zuPV&m*P{AVpREo2^EpZEM`;L!95dy8$Mhr>ZR`JAw+l%=9y=oc`d5Sq#zg$6@4gW{ -z2J=(+Iw<&DyGE3XZv*u-;i2_K*ra6KfXziFGQ=tdW*-Hc?S!T -z(NpC~VI@4sDC&1sExFsz464|E@h0e$ua0-Dt!X(IIl9ep#S#4 -ziX_7C_Rwm6c+sOxLET(7w&Mi~12b1084)Wtt!@OS^rGpGU|KAwfC_4UJLiEX- -zP`(_BpzXDZiIo+7*@&FrpGQMaqM;1=LM!ADmdGOXw>T%bmFXZD(eQ@JJ|fnb5VLu5 -zb`{27Qz|WDnf1K0Rd@c|MnmaMfcVQ*h%NeMy||&xOt^)Gq&t%=ToEASU8UE@Lw({m -z4XkPQtA}WH?{uD -zu}%YCK0+eEf^RhsA38sOxh^Q36O9&O_Cq5^pCX91hLi|sfAi6d|0(@-?p7Gol(9%!s -zvY~TS4YaVaeOvM}tuHPtaoMo1d>ro9JuIGDBm`C*K@G{@^;9WeMbmm--&IwXc%;Q$ -zCfQs-`80gFaeusrHtBSLqpqfoERlkOa_VBcQcsNF&|l$_YZ`k9)Q7EWFEuUO?>RO8 -zZc#P#_4PHvz~AcWb!587$e10A4Am*-kP}$Z20e7PzEV4`&8RkGm)84!64;uwgc!_h$W6()k -z+XeP?;6rc!)b!Lki}m?P#=3eRH;9~%wr0n7NdmW7>EG|!)PRA-6JV?TPd&Z!P+q~_nc0`O(Gln;7?+~vWa -z9EAJ&$1D-bYbAvTRQDr-{^X$gl!lh&9{p#HlQ&zi> -z%d#}SnT(Bm+UwCf5|9O2kMo-~vY0D>&1azzOQK4JoWg7bqhL_-6O>^_qJ-&7T_GMj -z&{d}|SV4R#g$6OCj9Guk9IafN*Omq1tb70J6fDI@qR+Q5DJ(XTrAhV<9 -zS$!p$kqdI#O=pMB`T#}l9RoIvVqD6&1d2=@kM+LQ715}8Bn(JQkX0{`V9(zx1fvQ; -zLG|V1HwOHSWI;D)2(NeGt2)&jro$XR0{L1zP= -z(Vzk#3)E)mYu99*qIUeQ{2mxFoJ<6K!`!b51|E~bO{oc%jQ*Z=cD0+mi(C`MMT0y& -zDC-@3JN>5bmJk&HW~BF-+Jur!@-Eek-Yssfek=jz-{kztOH>tKV9wm-0h^W%l+UX#F1wq)~lB}t= -z?q*_bk5um3PfOJ!l*tAZcCqlvt&{XP5Vt*Dr5W_LD%_^7-s -zYA0b$eB?hfI~#Po8zht-#UVXAX*l`+i-JObQMW$o3SDZ)@RXJgyF8tlnI4wEi5^(n`yI&J!$OQ-?PPl&1onO?v7%w5DiNX?gHkZcFcyYdis#Jjc`uhBPF|)X_QRaG8pMk^SK6`ZccI4)=xw!1i -zgz-@$tZ{jd87k=-{S*C-SaKmZ^VjTRn9Nd6`EXgh;Hf}{FzM?g -zQ=$AGrF&jWLqkLJmzUVp0jp1^ai;^}eU!p4jI0J`f~*5HOc;F&IvYRsG4^m0jOL)A -zRzwL2I@pk)gCw~u#t2+~&tc|m;!H{Xgt0<{7d8$V3HA3}_jk8s!>{#C0KRMe=h{zV#)M?A0%Nm -zm&YzUE+WEh_9|U*&NO~Ke{@A2%}T>8i@f`pnt(gyG%PBKrhY_T+BHC6WcqEx{7A;z -z!JzAw{%qkFuVfj$UR0DNoQpDo@6guWeIeL7$5@_ViJ7L@QfuK_9?h7|m7Sum|1xw| -zSCZ@QKgM4sg>jwMZc%F86Au{a1L|LVn>HC*+q0CCx?6qOepVeaq2!F04`EgE@DOH= -ztoPuL5&g(SFdDs-{<=h^^5jAm+JafPKiMVei8_xQmkNmgH48Lsw>#-wc@0Jer -zmJP=mO)18Ia~P(_NLrvl{q-J=*5!rwdg<}h<>eh$R%X@^HdC(F{oR=Z*%>B3L3VE= -z*f^ymXhlBDyly0ag~=I<7}SRt|^E{(nylbLBVkn|D0 -zj%fwa9nNK)bt=O*@!_fHIRECsLEasi83=a>2*d&wwy@At#D6?cQct0p1dtrO6D)D& -ztMQTMk9MI>yywmJyhdg#D~fN|%#VmACR!=EVLDieC+0uZ5(H5CpM>|;SqpFnC>g0) -V_ay9mdAsWcG*q;qwMtfz{|8C@VfFw3 - -literal 0 -HcmV?d00001 - -diff --git a/addons/screensaver.gles.noise/addon.xml b/addons/screensaver.gles.noise/addon.xml -new file mode 100644 -index 0000000..ed29862 ---- /dev/null -+++ b/addons/screensaver.gles.noise/addon.xml -@@ -0,0 +1,121 @@ -+ -+ -+ -+ -+ -+ -+ -+ Seker die tweede mees psigedeliese sluimerskerm ooit -+ ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق -+ Напэўна, другі найбольш псіхадэлічны ахоўнік экрану -+ Вероятно вторият най-халюциногенен скрийнсейвър -+ Probablement el segon estalvi de pantalla més psicodèlic mai creat -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig -+ Formodentlig den anden mest psykedeliske pauseskærm nogensinde -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ -+ Random noise. Useful for fixing image retention on a plasma TV -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probablemente el segundo salvapantallas más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico -+ Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud -+ Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena -+ Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan -+ Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé -+ Probablement le deuxième économiseur d'écran le plus psychédélique -+ Probabelmente o segundo protector de pantalla máis psicodélico. -+ כנראה שומר המסך השני בדירוג הפסיכדליות -+ Vjerojatno drugi najveći psihodelični čuvar zaslona ikad -+ A második legpszihedelikusabb képernyővédő -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna -+ Probabilmente il secondo salvaschermo più psichedelico di sempre -+ 世界で2番目にサイケなスクリーンセーバー -+ 아마도 지금까지 두번째로 가장 환상적인 화면보호기 -+ Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē -+ Можеби втора нај психоделична заштита на екран -+ Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit -+ Helt sikkert den nest mest psykedeliske skjermspareren som finnes -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie -+ Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre -+ Provavelmente a segunda mais psicodélica proteção de tela já vista -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată -+ Наверное, вторая из самых психоделических заставок в мире -+ Förmodligen den näst psykedeliska skärmsläckaren -+ පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu -+ Troligen den näst mest psykedeliska skärmsläckaren någonsin. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu -+ Напевно, друга серед найбільш психоделічних заставок -+ Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai -+ 或许是排名第二的迷幻效果屏幕保护程序 -+ 可能是有史以來第二最夢幻的螢幕保護程式保護程式 -+ Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg. -+ ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة . -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове. -+ Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se. -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy. -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas. -+ Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring. -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten. -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor. -+ Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad. -+ Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen. -+ Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor. -+ כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום. -+ Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo. -+ Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni. -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari. -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu. -+ Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ 아마도 존재하는 두번째로 가장 환상적인 화면보호기. 모든 색깔들이 움직이는 것을 상상해보세요. -+ Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt. -+ Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат. -+ Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen. -+ Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt. -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw. -+ Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se. -+ Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela. -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se. -+ Просто попробуйте представить себе все цвета в движении. -+ Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt. -+ පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo. -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog. -+ Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд. -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın. -+ Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів. -+ Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi -+ 或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。 -+ 可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.noise/icon.png b/addons/screensaver.gles.noise/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..a6784afc53d95a655742f9b7db247471fc52a105 -GIT binary patch -literal 5657 -zcmd5=%_yf)hI}rNdW+$&`^i!0RZ0Z5f2~+-G*^$ -zdC}XzSS?I;T#Z?V*$oLUxq6 -zE9lIcr+wgK*+sd{`L^(P-8a3lYQ&E}UA|67z<}ug9WVyQrWc4}FGAmYqBl>1bONzv -zC+?Ez!vf2~`U3PpH94L~S5!~e3>{ftnwqYDHkO#%!3Eds-f-vU<#x3ok^P!#c&&Mj -zzqU{)hEWAAwchi(#n$&f83OU#4u794xU3pF;=hiq3z=Iyzy>gw6Z9jc|#L>RDEfDP^{ -zw1VZPJzaiK3d}>fS&jI4kUS-TdMLJX#O%vmQUu7;ka*&oPz;Dus2GWytedNb0VVFo -z=kC>iea=I}ER0DJ)^vpcb6$-b?rJ8LX9^5>nJ}Xg6!55(@FZlJA9&Z2c -z!+;}TZ4V{di+qq?Xf=8;-O}LTGYj|nvT$g|IzXn0C-KCg_?NN3#>vI=#XWhw?Wi^+ -z^5c(n?^!b~o5{zi??H}^N`*^@ANh^k1$*V8eb%ysgxv^$Gs<9_i2oVtX{VnGo`hq+ -zylhDS*9eiVK!Mjpe5VF{IPTn9Mgq4AI)Ep>o|344+WxA@`KN8z(B22(wE%zr&1Wb(!JYd`bl)I`2oCbOeV)*7eJt@Rok8|jq%ZHWu5Ak2x( -z`UFt5tE>DaycfyOpHB3v>FWnYB4&^~-QE=wrbh62 -zn@A$`0LoZf#ctGs9~hCsirP#OM22xhr~DjQh$2s$IAh95$xVO& -zcI->QTatShXtbcLfgS3SfEPF^93rtz6YI-*0?-UuSjH{Z8 -z>at!RLM1%!4T?6mr+tW3;$0ZF^9h1MSU+qSkfN+qVan0pj3C9$(Z -zjg$p*`xnG=-UpXTg`QTr$bZ+KkmkjM7f<<(oJvf&LnN6o5O;~iCm}~b@LEPWSb~QN -zJvrf{&fR@?rCsTVW+tuPtR{j_|4_OdieB5wpOErln*d&^`xYqJB}54VP*d3 -z&)HR_0%}>q-`}5IKKOF?%tuz&P=uHyk2`%>v1o6vPOEdVi%Kw@Nh -zsjWuVK={$ASC{xw0)zYuzvdKk^U%<6W5MG3WD#Ejd`MLp9;CT{9CUmC2jO!ymsF@> -zEJt^3H~ZaVHI7i*i^D?A^p=+9^>{;x7xfK)b&!IRtzcI_RMEO>f}0;4fI<;(ly1&N$3` -z-lic`n(t!wdUcV5JB2Ggdf&nj!kCklV<1M7J})(5`kK99*4W%!E?~c>2~v?P3~@C^ -zlX#f*?4#Xl7f;*0*W9*Ap;Hk+8EhNdv&>DKEVtG>FH{2TPBet|=osjln*M%-LGu2z -zL6!@uFSC7y!qJ0oM~konMa2pq-U#1Mp!gd_SWhtcc~8c~oTsDdcMQ?2n~~swL^X!1 -zU11*XYJom55TMsw%_BXl>M{}2WD-1$=>I;lpg%S*dMmaX&mWYf)OX8wAK-SRl0BBP -zzA@l068Eb=Je9%tc+6~qLwaHz#^ta7gMzMGf#fH4fLLsE5pRxwC2(Mzkx5C -zw7vTiDbg1x93}BMYY{lp9EWlJymk`-D?Ba)BQ@35Zb40#md}y7xw&?h46NCd_GU-K -zGI~0z+h?G82a$RIW$drvbmGF!xHz=yk>lgp$C4bf5naT>bUzfw1ow%)-r>PKoE9&}$SiH|ip)kt -z;9-&()<{0ja4c^nGqS!$e$9FYSWnjAN}suVph5bo_MONsLq)<;i7%VV7Q}SCuAH%d -zLMNI{m@*=+WwbE;v7kzShVaF25xR7xjPwUtI0G~gn -z)vub}A?$;;u$@>@qWUID4EfMbSJ~S<9##^~>E0UgzwDtmQB>KgKoZAQcw_K(e7vcq -zAA7nD>s5sh!>rjK9pa~8^1;Z=yzbSpAbkkHfEcxOJG3z+EaTK?Zugxnoo=pt88IRB -zXqvOYzUEJJ`affS{VZyCta=bM;-fvk!OecIa2$I<`9PXsUL-1va -znVb_V!RY8z_|?}$RmTLdcr4+t_)jMmam~}=)=*0G5i;mb3z(sIDqT#g^%Ni&E%1^D -zxmd*BDX1hwOAMqQ53VV{l$S%))EB}$4@SA~I-!oT#l{MVq=`x0^J*IAm&Bj#lmoks -zsV3eYGvXiAJ>LhsR?z0xok{K}D)7F!cKRJEn;w2ma^s(W&8C&fUJ#wIu}K~9{;iJ` -zH7V+;&Y07SBe>e*SRwOfDaLdW{3^W~N-9ey+i^AYPtSZ%MR5$%^s!g*9}f92+4qdU -zez3N;p8D=)dq_%2<#NPf2#I<+J+C|eXf$>91vam*um4Wbhle2)I7PA;|LpHiEyS2+ -z=j4oqCV!Td)_@;X4_U4Oj#b?X%r!MNt5P24S5Hr-&PB2^I~EDQrzJ+LQ&5`Il-XqA -zuPV&m*P{AVpREo2^EpZEM`;L!95dy8$Mhr>ZR`JAw+l%=9y=oc`d5Sq#zg$6@4gW{ -z2J=(+Iw<&DyGE3XZv*u-;i2_K*ra6KfXziFGQ=tdW*-Hc?S!T -z(NpC~VI@4sDC&1sExFsz464|E@h0e$ua0-Dt!X(IIl9ep#S#4 -ziX_7C_Rwm6c+sOxLET(7w&Mi~12b1084)Wtt!@OS^rGpGU|KAwfC_4UJLiEX- -zP`(_BpzXDZiIo+7*@&FrpGQMaqM;1=LM!ADmdGOXw>T%bmFXZD(eQ@JJ|fnb5VLu5 -zb`{27Qz|WDnf1K0Rd@c|MnmaMfcVQ*h%NeMy||&xOt^)Gq&t%=ToEASU8UE@Lw({m -z4XkPQtA}WH?{uD -zu}%YCK0+eEf^RhsA38sOxh^Q36O9&O_Cq5^pCX91hLi|sfAi6d|0(@-?p7Gol(9%!s -zvY~TS4YaVaeOvM}tuHPtaoMo1d>ro9JuIGDBm`C*K@G{@^;9WeMbmm--&IwXc%;Q$ -zCfQs-`80gFaeusrHtBSLqpqfoERlkOa_VBcQcsNF&|l$_YZ`k9)Q7EWFEuUO?>RO8 -zZc#P#_4PHvz~AcWb!587$e10A4Am*-kP}$Z20e7PzEV4`&8RkGm)84!64;uwgc!_h$W6()k -z+XeP?;6rc!)b!Lki}m?P#=3eRH;9~%wr0n7NdmW7>EG|!)PRA-6JV?TPd&Z!P+q~_nc0`O(Gln;7?+~vWa -z9EAJ&$1D-bYbAvTRQDr-{^X$gl!lh&9{p#HlQ&zi> -z%d#}SnT(Bm+UwCf5|9O2kMo-~vY0D>&1azzOQK4JoWg7bqhL_-6O>^_qJ-&7T_GMj -z&{d}|SV4R#g$6OCj9Guk9IafN*Omq1tb70J6fDI@qR+Q5DJ(XTrAhV<9 -zS$!p$kqdI#O=pMB`T#}l9RoIvVqD6&1d2=@kM+LQ715}8Bn(JQkX0{`V9(zx1fvQ; -zLG|V1HwOHSWI;D)2(NeGt2)&jro$XR0{L1zP= -z(Vzk#3)E)mYu99*qIUeQ{2mxFoJ<6K!`!b51|E~bO{oc%jQ*Z=cD0+mi(C`MMT0y& -zDC-@3JN>5bmJk&HW~BF-+Jur!@-Eek-Yssfek=jz-{kztOH>tKV9wm-0h^W%l+UX#F1wq)~lB}t= -z?q*_bk5um3PfOJ!l*tAZcCqlvt&{XP5Vt*Dr5W_LD%_^7-s -zYA0b$eB?hfI~#Po8zht-#UVXAX*l`+i-JObQMW$o3SDZ)@RXJgyF8tlnI4wEi5^(n`yI&J!$OQ-?PPl&1onO?v7%w5DiNX?gHkZcFcyYdis#Jjc`uhBPF|)X_QRaG8pMk^SK6`ZccI4)=xw!1i -zgz-@$tZ{jd87k=-{S*C-SaKmZ^VjTRn9Nd6`EXgh;Hf}{FzM?g -zQ=$AGrF&jWLqkLJmzUVp0jp1^ai;^}eU!p4jI0J`f~*5HOc;F&IvYRsG4^m0jOL)A -zRzwL2I@pk)gCw~u#t2+~&tc|m;!H{Xgt0<{7d8$V3HA3}_jk8s!>{#C0KRMe=h{zV#)M?A0%Nm -zm&YzUE+WEh_9|U*&NO~Ke{@A2%}T>8i@f`pnt(gyG%PBKrhY_T+BHC6WcqEx{7A;z -z!JzAw{%qkFuVfj$UR0DNoQpDo@6guWeIeL7$5@_ViJ7L@QfuK_9?h7|m7Sum|1xw| -zSCZ@QKgM4sg>jwMZc%F86Au{a1L|LVn>HC*+q0CCx?6qOepVeaq2!F04`EgE@DOH= -ztoPuL5&g(SFdDs-{<=h^^5jAm+JafPKiMVei8_xQmkNmgH48Lsw>#-wc@0Jer -zmJP=mO)18Ia~P(_NLrvl{q-J=*5!rwdg<}h<>eh$R%X@^HdC(F{oR=Z*%>B3L3VE= -z*f^ymXhlBDyly0ag~=I<7}SRt|^E{(nylbLBVkn|D0 -zj%fwa9nNK)bt=O*@!_fHIRECsLEasi83=a>2*d&wwy@At#D6?cQct0p1dtrO6D)D& -ztMQTMk9MI>yywmJyhdg#D~fN|%#VmACR!=EVLDieC+0uZ5(H5CpM>|;SqpFnC>g0) -V_ay9mdAsWcG*q;qwMtfz{|8C@VfFw3 - -literal 0 -HcmV?d00001 - -diff --git a/addons/screensaver.gles.plasma/addon.xml b/addons/screensaver.gles.plasma/addon.xml -new file mode 100644 -index 0000000..3f334f1 ---- /dev/null -+++ b/addons/screensaver.gles.plasma/addon.xml -@@ -0,0 +1,121 @@ -+ -+ -+ -+ -+ -+ -+ -+ Seker die tweede mees psigedeliese sluimerskerm ooit -+ ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق -+ Напэўна, другі найбольш псіхадэлічны ахоўнік экрану -+ Вероятно вторият най-халюциногенен скрийнсейвър -+ Probablement el segon estalvi de pantalla més psicodèlic mai creat -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig -+ Formodentlig den anden mest psykedeliske pauseskærm nogensinde -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probablemente el segundo salvapantallas más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico -+ Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud -+ Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena -+ Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan -+ Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé -+ Probablement le deuxième économiseur d'écran le plus psychédélique -+ Probabelmente o segundo protector de pantalla máis psicodélico. -+ כנראה שומר המסך השני בדירוג הפסיכדליות -+ Vjerojatno drugi najveći psihodelični čuvar zaslona ikad -+ A második legpszihedelikusabb képernyővédő -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna -+ Probabilmente il secondo salvaschermo più psichedelico di sempre -+ 世界で2番目にサイケなスクリーンセーバー -+ 아마도 지금까지 두번째로 가장 환상적인 화면보호기 -+ Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē -+ Можеби втора нај психоделична заштита на екран -+ Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit -+ Helt sikkert den nest mest psykedeliske skjermspareren som finnes -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie -+ Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre -+ Provavelmente a segunda mais psicodélica proteção de tela já vista -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată -+ Наверное, вторая из самых психоделических заставок в мире -+ Förmodligen den näst psykedeliska skärmsläckaren -+ පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu -+ Troligen den näst mest psykedeliska skärmsläckaren någonsin. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu -+ Напевно, друга серед найбільш психоделічних заставок -+ Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai -+ 或许是排名第二的迷幻效果屏幕保护程序 -+ 可能是有史以來第二最夢幻的螢幕保護程式保護程式 -+ Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg. -+ ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة . -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове. -+ Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se. -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy. -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas. -+ Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring. -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten. -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor. -+ Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad. -+ Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen. -+ Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor. -+ כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום. -+ Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo. -+ Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni. -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari. -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu. -+ Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ 아마도 존재하는 두번째로 가장 환상적인 화면보호기. 모든 색깔들이 움직이는 것을 상상해보세요. -+ Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt. -+ Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат. -+ Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen. -+ Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt. -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw. -+ Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se. -+ Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela. -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se. -+ Просто попробуйте представить себе все цвета в движении. -+ Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt. -+ පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo. -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog. -+ Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд. -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın. -+ Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів. -+ Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi -+ 或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。 -+ 可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.plasma/icon.png b/addons/screensaver.gles.plasma/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..a6784afc53d95a655742f9b7db247471fc52a105 -GIT binary patch -literal 5657 -zcmd5=%_yf)hI}rNdW+$&`^i!0RZ0Z5f2~+-G*^$ -zdC}XzSS?I;T#Z?V*$oLUxq6 -zE9lIcr+wgK*+sd{`L^(P-8a3lYQ&E}UA|67z<}ug9WVyQrWc4}FGAmYqBl>1bONzv -zC+?Ez!vf2~`U3PpH94L~S5!~e3>{ftnwqYDHkO#%!3Eds-f-vU<#x3ok^P!#c&&Mj -zzqU{)hEWAAwchi(#n$&f83OU#4u794xU3pF;=hiq3z=Iyzy>gw6Z9jc|#L>RDEfDP^{ -zw1VZPJzaiK3d}>fS&jI4kUS-TdMLJX#O%vmQUu7;ka*&oPz;Dus2GWytedNb0VVFo -z=kC>iea=I}ER0DJ)^vpcb6$-b?rJ8LX9^5>nJ}Xg6!55(@FZlJA9&Z2c -z!+;}TZ4V{di+qq?Xf=8;-O}LTGYj|nvT$g|IzXn0C-KCg_?NN3#>vI=#XWhw?Wi^+ -z^5c(n?^!b~o5{zi??H}^N`*^@ANh^k1$*V8eb%ysgxv^$Gs<9_i2oVtX{VnGo`hq+ -zylhDS*9eiVK!Mjpe5VF{IPTn9Mgq4AI)Ep>o|344+WxA@`KN8z(B22(wE%zr&1Wb(!JYd`bl)I`2oCbOeV)*7eJt@Rok8|jq%ZHWu5Ak2x( -z`UFt5tE>DaycfyOpHB3v>FWnYB4&^~-QE=wrbh62 -zn@A$`0LoZf#ctGs9~hCsirP#OM22xhr~DjQh$2s$IAh95$xVO& -zcI->QTatShXtbcLfgS3SfEPF^93rtz6YI-*0?-UuSjH{Z8 -z>at!RLM1%!4T?6mr+tW3;$0ZF^9h1MSU+qSkfN+qVan0pj3C9$(Z -zjg$p*`xnG=-UpXTg`QTr$bZ+KkmkjM7f<<(oJvf&LnN6o5O;~iCm}~b@LEPWSb~QN -zJvrf{&fR@?rCsTVW+tuPtR{j_|4_OdieB5wpOErln*d&^`xYqJB}54VP*d3 -z&)HR_0%}>q-`}5IKKOF?%tuz&P=uHyk2`%>v1o6vPOEdVi%Kw@Nh -zsjWuVK={$ASC{xw0)zYuzvdKk^U%<6W5MG3WD#Ejd`MLp9;CT{9CUmC2jO!ymsF@> -zEJt^3H~ZaVHI7i*i^D?A^p=+9^>{;x7xfK)b&!IRtzcI_RMEO>f}0;4fI<;(ly1&N$3` -z-lic`n(t!wdUcV5JB2Ggdf&nj!kCklV<1M7J})(5`kK99*4W%!E?~c>2~v?P3~@C^ -zlX#f*?4#Xl7f;*0*W9*Ap;Hk+8EhNdv&>DKEVtG>FH{2TPBet|=osjln*M%-LGu2z -zL6!@uFSC7y!qJ0oM~konMa2pq-U#1Mp!gd_SWhtcc~8c~oTsDdcMQ?2n~~swL^X!1 -zU11*XYJom55TMsw%_BXl>M{}2WD-1$=>I;lpg%S*dMmaX&mWYf)OX8wAK-SRl0BBP -zzA@l068Eb=Je9%tc+6~qLwaHz#^ta7gMzMGf#fH4fLLsE5pRxwC2(Mzkx5C -zw7vTiDbg1x93}BMYY{lp9EWlJymk`-D?Ba)BQ@35Zb40#md}y7xw&?h46NCd_GU-K -zGI~0z+h?G82a$RIW$drvbmGF!xHz=yk>lgp$C4bf5naT>bUzfw1ow%)-r>PKoE9&}$SiH|ip)kt -z;9-&()<{0ja4c^nGqS!$e$9FYSWnjAN}suVph5bo_MONsLq)<;i7%VV7Q}SCuAH%d -zLMNI{m@*=+WwbE;v7kzShVaF25xR7xjPwUtI0G~gn -z)vub}A?$;;u$@>@qWUID4EfMbSJ~S<9##^~>E0UgzwDtmQB>KgKoZAQcw_K(e7vcq -zAA7nD>s5sh!>rjK9pa~8^1;Z=yzbSpAbkkHfEcxOJG3z+EaTK?Zugxnoo=pt88IRB -zXqvOYzUEJJ`affS{VZyCta=bM;-fvk!OecIa2$I<`9PXsUL-1va -znVb_V!RY8z_|?}$RmTLdcr4+t_)jMmam~}=)=*0G5i;mb3z(sIDqT#g^%Ni&E%1^D -zxmd*BDX1hwOAMqQ53VV{l$S%))EB}$4@SA~I-!oT#l{MVq=`x0^J*IAm&Bj#lmoks -zsV3eYGvXiAJ>LhsR?z0xok{K}D)7F!cKRJEn;w2ma^s(W&8C&fUJ#wIu}K~9{;iJ` -zH7V+;&Y07SBe>e*SRwOfDaLdW{3^W~N-9ey+i^AYPtSZ%MR5$%^s!g*9}f92+4qdU -zez3N;p8D=)dq_%2<#NPf2#I<+J+C|eXf$>91vam*um4Wbhle2)I7PA;|LpHiEyS2+ -z=j4oqCV!Td)_@;X4_U4Oj#b?X%r!MNt5P24S5Hr-&PB2^I~EDQrzJ+LQ&5`Il-XqA -zuPV&m*P{AVpREo2^EpZEM`;L!95dy8$Mhr>ZR`JAw+l%=9y=oc`d5Sq#zg$6@4gW{ -z2J=(+Iw<&DyGE3XZv*u-;i2_K*ra6KfXziFGQ=tdW*-Hc?S!T -z(NpC~VI@4sDC&1sExFsz464|E@h0e$ua0-Dt!X(IIl9ep#S#4 -ziX_7C_Rwm6c+sOxLET(7w&Mi~12b1084)Wtt!@OS^rGpGU|KAwfC_4UJLiEX- -zP`(_BpzXDZiIo+7*@&FrpGQMaqM;1=LM!ADmdGOXw>T%bmFXZD(eQ@JJ|fnb5VLu5 -zb`{27Qz|WDnf1K0Rd@c|MnmaMfcVQ*h%NeMy||&xOt^)Gq&t%=ToEASU8UE@Lw({m -z4XkPQtA}WH?{uD -zu}%YCK0+eEf^RhsA38sOxh^Q36O9&O_Cq5^pCX91hLi|sfAi6d|0(@-?p7Gol(9%!s -zvY~TS4YaVaeOvM}tuHPtaoMo1d>ro9JuIGDBm`C*K@G{@^;9WeMbmm--&IwXc%;Q$ -zCfQs-`80gFaeusrHtBSLqpqfoERlkOa_VBcQcsNF&|l$_YZ`k9)Q7EWFEuUO?>RO8 -zZc#P#_4PHvz~AcWb!587$e10A4Am*-kP}$Z20e7PzEV4`&8RkGm)84!64;uwgc!_h$W6()k -z+XeP?;6rc!)b!Lki}m?P#=3eRH;9~%wr0n7NdmW7>EG|!)PRA-6JV?TPd&Z!P+q~_nc0`O(Gln;7?+~vWa -z9EAJ&$1D-bYbAvTRQDr-{^X$gl!lh&9{p#HlQ&zi> -z%d#}SnT(Bm+UwCf5|9O2kMo-~vY0D>&1azzOQK4JoWg7bqhL_-6O>^_qJ-&7T_GMj -z&{d}|SV4R#g$6OCj9Guk9IafN*Omq1tb70J6fDI@qR+Q5DJ(XTrAhV<9 -zS$!p$kqdI#O=pMB`T#}l9RoIvVqD6&1d2=@kM+LQ715}8Bn(JQkX0{`V9(zx1fvQ; -zLG|V1HwOHSWI;D)2(NeGt2)&jro$XR0{L1zP= -z(Vzk#3)E)mYu99*qIUeQ{2mxFoJ<6K!`!b51|E~bO{oc%jQ*Z=cD0+mi(C`MMT0y& -zDC-@3JN>5bmJk&HW~BF-+Jur!@-Eek-Yssfek=jz-{kztOH>tKV9wm-0h^W%l+UX#F1wq)~lB}t= -z?q*_bk5um3PfOJ!l*tAZcCqlvt&{XP5Vt*Dr5W_LD%_^7-s -zYA0b$eB?hfI~#Po8zht-#UVXAX*l`+i-JObQMW$o3SDZ)@RXJgyF8tlnI4wEi5^(n`yI&J!$OQ-?PPl&1onO?v7%w5DiNX?gHkZcFcyYdis#Jjc`uhBPF|)X_QRaG8pMk^SK6`ZccI4)=xw!1i -zgz-@$tZ{jd87k=-{S*C-SaKmZ^VjTRn9Nd6`EXgh;Hf}{FzM?g -zQ=$AGrF&jWLqkLJmzUVp0jp1^ai;^}eU!p4jI0J`f~*5HOc;F&IvYRsG4^m0jOL)A -zRzwL2I@pk)gCw~u#t2+~&tc|m;!H{Xgt0<{7d8$V3HA3}_jk8s!>{#C0KRMe=h{zV#)M?A0%Nm -zm&YzUE+WEh_9|U*&NO~Ke{@A2%}T>8i@f`pnt(gyG%PBKrhY_T+BHC6WcqEx{7A;z -z!JzAw{%qkFuVfj$UR0DNoQpDo@6guWeIeL7$5@_ViJ7L@QfuK_9?h7|m7Sum|1xw| -zSCZ@QKgM4sg>jwMZc%F86Au{a1L|LVn>HC*+q0CCx?6qOepVeaq2!F04`EgE@DOH= -ztoPuL5&g(SFdDs-{<=h^^5jAm+JafPKiMVei8_xQmkNmgH48Lsw>#-wc@0Jer -zmJP=mO)18Ia~P(_NLrvl{q-J=*5!rwdg<}h<>eh$R%X@^HdC(F{oR=Z*%>B3L3VE= -z*f^ymXhlBDyly0ag~=I<7}SRt|^E{(nylbLBVkn|D0 -zj%fwa9nNK)bt=O*@!_fHIRECsLEasi83=a>2*d&wwy@At#D6?cQct0p1dtrO6D)D& -ztMQTMk9MI>yywmJyhdg#D~fN|%#VmACR!=EVLDieC+0uZ5(H5CpM>|;SqpFnC>g0) -V_ay9mdAsWcG*q;qwMtfz{|8C@VfFw3 - -literal 0 -HcmV?d00001 - -diff --git a/addons/screensaver.gles.plasma2/addon.xml b/addons/screensaver.gles.plasma2/addon.xml -new file mode 100644 -index 0000000..e772cc4 ---- /dev/null -+++ b/addons/screensaver.gles.plasma2/addon.xml -@@ -0,0 +1,121 @@ -+ -+ -+ -+ -+ -+ -+ -+ Seker die tweede mees psigedeliese sluimerskerm ooit -+ ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق -+ Напэўна, другі найбольш псіхадэлічны ахоўнік экрану -+ Вероятно вторият най-халюциногенен скрийнсейвър -+ Probablement el segon estalvi de pantalla més psicodèlic mai creat -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig -+ Formodentlig den anden mest psykedeliske pauseskærm nogensinde -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probablemente el segundo salvapantallas más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico -+ Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud -+ Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena -+ Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan -+ Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé -+ Probablement le deuxième économiseur d'écran le plus psychédélique -+ Probabelmente o segundo protector de pantalla máis psicodélico. -+ כנראה שומר המסך השני בדירוג הפסיכדליות -+ Vjerojatno drugi najveći psihodelični čuvar zaslona ikad -+ A második legpszihedelikusabb képernyővédő -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna -+ Probabilmente il secondo salvaschermo più psichedelico di sempre -+ 世界で2番目にサイケなスクリーンセーバー -+ 아마도 지금까지 두번째로 가장 환상적인 화면보호기 -+ Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē -+ Можеби втора нај психоделична заштита на екран -+ Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit -+ Helt sikkert den nest mest psykedeliske skjermspareren som finnes -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie -+ Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre -+ Provavelmente a segunda mais psicodélica proteção de tela já vista -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată -+ Наверное, вторая из самых психоделических заставок в мире -+ Förmodligen den näst psykedeliska skärmsläckaren -+ පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu -+ Troligen den näst mest psykedeliska skärmsläckaren någonsin. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu -+ Напевно, друга серед найбільш психоделічних заставок -+ Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai -+ 或许是排名第二的迷幻效果屏幕保护程序 -+ 可能是有史以來第二最夢幻的螢幕保護程式保護程式 -+ Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg. -+ ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة . -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове. -+ Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se. -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy. -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas. -+ Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring. -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten. -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor. -+ Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad. -+ Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen. -+ Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor. -+ כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום. -+ Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo. -+ Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni. -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari. -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu. -+ Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ 아마도 존재하는 두번째로 가장 환상적인 화면보호기. 모든 색깔들이 움직이는 것을 상상해보세요. -+ Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt. -+ Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат. -+ Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen. -+ Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt. -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw. -+ Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se. -+ Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela. -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se. -+ Просто попробуйте представить себе все цвета в движении. -+ Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt. -+ පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo. -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog. -+ Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд. -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın. -+ Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів. -+ Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi -+ 或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。 -+ 可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.plasma2/icon.png b/addons/screensaver.gles.plasma2/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..a6784afc53d95a655742f9b7db247471fc52a105 -GIT binary patch -literal 5657 -zcmd5=%_yf)hI}rNdW+$&`^i!0RZ0Z5f2~+-G*^$ -zdC}XzSS?I;T#Z?V*$oLUxq6 -zE9lIcr+wgK*+sd{`L^(P-8a3lYQ&E}UA|67z<}ug9WVyQrWc4}FGAmYqBl>1bONzv -zC+?Ez!vf2~`U3PpH94L~S5!~e3>{ftnwqYDHkO#%!3Eds-f-vU<#x3ok^P!#c&&Mj -zzqU{)hEWAAwchi(#n$&f83OU#4u794xU3pF;=hiq3z=Iyzy>gw6Z9jc|#L>RDEfDP^{ -zw1VZPJzaiK3d}>fS&jI4kUS-TdMLJX#O%vmQUu7;ka*&oPz;Dus2GWytedNb0VVFo -z=kC>iea=I}ER0DJ)^vpcb6$-b?rJ8LX9^5>nJ}Xg6!55(@FZlJA9&Z2c -z!+;}TZ4V{di+qq?Xf=8;-O}LTGYj|nvT$g|IzXn0C-KCg_?NN3#>vI=#XWhw?Wi^+ -z^5c(n?^!b~o5{zi??H}^N`*^@ANh^k1$*V8eb%ysgxv^$Gs<9_i2oVtX{VnGo`hq+ -zylhDS*9eiVK!Mjpe5VF{IPTn9Mgq4AI)Ep>o|344+WxA@`KN8z(B22(wE%zr&1Wb(!JYd`bl)I`2oCbOeV)*7eJt@Rok8|jq%ZHWu5Ak2x( -z`UFt5tE>DaycfyOpHB3v>FWnYB4&^~-QE=wrbh62 -zn@A$`0LoZf#ctGs9~hCsirP#OM22xhr~DjQh$2s$IAh95$xVO& -zcI->QTatShXtbcLfgS3SfEPF^93rtz6YI-*0?-UuSjH{Z8 -z>at!RLM1%!4T?6mr+tW3;$0ZF^9h1MSU+qSkfN+qVan0pj3C9$(Z -zjg$p*`xnG=-UpXTg`QTr$bZ+KkmkjM7f<<(oJvf&LnN6o5O;~iCm}~b@LEPWSb~QN -zJvrf{&fR@?rCsTVW+tuPtR{j_|4_OdieB5wpOErln*d&^`xYqJB}54VP*d3 -z&)HR_0%}>q-`}5IKKOF?%tuz&P=uHyk2`%>v1o6vPOEdVi%Kw@Nh -zsjWuVK={$ASC{xw0)zYuzvdKk^U%<6W5MG3WD#Ejd`MLp9;CT{9CUmC2jO!ymsF@> -zEJt^3H~ZaVHI7i*i^D?A^p=+9^>{;x7xfK)b&!IRtzcI_RMEO>f}0;4fI<;(ly1&N$3` -z-lic`n(t!wdUcV5JB2Ggdf&nj!kCklV<1M7J})(5`kK99*4W%!E?~c>2~v?P3~@C^ -zlX#f*?4#Xl7f;*0*W9*Ap;Hk+8EhNdv&>DKEVtG>FH{2TPBet|=osjln*M%-LGu2z -zL6!@uFSC7y!qJ0oM~konMa2pq-U#1Mp!gd_SWhtcc~8c~oTsDdcMQ?2n~~swL^X!1 -zU11*XYJom55TMsw%_BXl>M{}2WD-1$=>I;lpg%S*dMmaX&mWYf)OX8wAK-SRl0BBP -zzA@l068Eb=Je9%tc+6~qLwaHz#^ta7gMzMGf#fH4fLLsE5pRxwC2(Mzkx5C -zw7vTiDbg1x93}BMYY{lp9EWlJymk`-D?Ba)BQ@35Zb40#md}y7xw&?h46NCd_GU-K -zGI~0z+h?G82a$RIW$drvbmGF!xHz=yk>lgp$C4bf5naT>bUzfw1ow%)-r>PKoE9&}$SiH|ip)kt -z;9-&()<{0ja4c^nGqS!$e$9FYSWnjAN}suVph5bo_MONsLq)<;i7%VV7Q}SCuAH%d -zLMNI{m@*=+WwbE;v7kzShVaF25xR7xjPwUtI0G~gn -z)vub}A?$;;u$@>@qWUID4EfMbSJ~S<9##^~>E0UgzwDtmQB>KgKoZAQcw_K(e7vcq -zAA7nD>s5sh!>rjK9pa~8^1;Z=yzbSpAbkkHfEcxOJG3z+EaTK?Zugxnoo=pt88IRB -zXqvOYzUEJJ`affS{VZyCta=bM;-fvk!OecIa2$I<`9PXsUL-1va -znVb_V!RY8z_|?}$RmTLdcr4+t_)jMmam~}=)=*0G5i;mb3z(sIDqT#g^%Ni&E%1^D -zxmd*BDX1hwOAMqQ53VV{l$S%))EB}$4@SA~I-!oT#l{MVq=`x0^J*IAm&Bj#lmoks -zsV3eYGvXiAJ>LhsR?z0xok{K}D)7F!cKRJEn;w2ma^s(W&8C&fUJ#wIu}K~9{;iJ` -zH7V+;&Y07SBe>e*SRwOfDaLdW{3^W~N-9ey+i^AYPtSZ%MR5$%^s!g*9}f92+4qdU -zez3N;p8D=)dq_%2<#NPf2#I<+J+C|eXf$>91vam*um4Wbhle2)I7PA;|LpHiEyS2+ -z=j4oqCV!Td)_@;X4_U4Oj#b?X%r!MNt5P24S5Hr-&PB2^I~EDQrzJ+LQ&5`Il-XqA -zuPV&m*P{AVpREo2^EpZEM`;L!95dy8$Mhr>ZR`JAw+l%=9y=oc`d5Sq#zg$6@4gW{ -z2J=(+Iw<&DyGE3XZv*u-;i2_K*ra6KfXziFGQ=tdW*-Hc?S!T -z(NpC~VI@4sDC&1sExFsz464|E@h0e$ua0-Dt!X(IIl9ep#S#4 -ziX_7C_Rwm6c+sOxLET(7w&Mi~12b1084)Wtt!@OS^rGpGU|KAwfC_4UJLiEX- -zP`(_BpzXDZiIo+7*@&FrpGQMaqM;1=LM!ADmdGOXw>T%bmFXZD(eQ@JJ|fnb5VLu5 -zb`{27Qz|WDnf1K0Rd@c|MnmaMfcVQ*h%NeMy||&xOt^)Gq&t%=ToEASU8UE@Lw({m -z4XkPQtA}WH?{uD -zu}%YCK0+eEf^RhsA38sOxh^Q36O9&O_Cq5^pCX91hLi|sfAi6d|0(@-?p7Gol(9%!s -zvY~TS4YaVaeOvM}tuHPtaoMo1d>ro9JuIGDBm`C*K@G{@^;9WeMbmm--&IwXc%;Q$ -zCfQs-`80gFaeusrHtBSLqpqfoERlkOa_VBcQcsNF&|l$_YZ`k9)Q7EWFEuUO?>RO8 -zZc#P#_4PHvz~AcWb!587$e10A4Am*-kP}$Z20e7PzEV4`&8RkGm)84!64;uwgc!_h$W6()k -z+XeP?;6rc!)b!Lki}m?P#=3eRH;9~%wr0n7NdmW7>EG|!)PRA-6JV?TPd&Z!P+q~_nc0`O(Gln;7?+~vWa -z9EAJ&$1D-bYbAvTRQDr-{^X$gl!lh&9{p#HlQ&zi> -z%d#}SnT(Bm+UwCf5|9O2kMo-~vY0D>&1azzOQK4JoWg7bqhL_-6O>^_qJ-&7T_GMj -z&{d}|SV4R#g$6OCj9Guk9IafN*Omq1tb70J6fDI@qR+Q5DJ(XTrAhV<9 -zS$!p$kqdI#O=pMB`T#}l9RoIvVqD6&1d2=@kM+LQ715}8Bn(JQkX0{`V9(zx1fvQ; -zLG|V1HwOHSWI;D)2(NeGt2)&jro$XR0{L1zP= -z(Vzk#3)E)mYu99*qIUeQ{2mxFoJ<6K!`!b51|E~bO{oc%jQ*Z=cD0+mi(C`MMT0y& -zDC-@3JN>5bmJk&HW~BF-+Jur!@-Eek-Yssfek=jz-{kztOH>tKV9wm-0h^W%l+UX#F1wq)~lB}t= -z?q*_bk5um3PfOJ!l*tAZcCqlvt&{XP5Vt*Dr5W_LD%_^7-s -zYA0b$eB?hfI~#Po8zht-#UVXAX*l`+i-JObQMW$o3SDZ)@RXJgyF8tlnI4wEi5^(n`yI&J!$OQ-?PPl&1onO?v7%w5DiNX?gHkZcFcyYdis#Jjc`uhBPF|)X_QRaG8pMk^SK6`ZccI4)=xw!1i -zgz-@$tZ{jd87k=-{S*C-SaKmZ^VjTRn9Nd6`EXgh;Hf}{FzM?g -zQ=$AGrF&jWLqkLJmzUVp0jp1^ai;^}eU!p4jI0J`f~*5HOc;F&IvYRsG4^m0jOL)A -zRzwL2I@pk)gCw~u#t2+~&tc|m;!H{Xgt0<{7d8$V3HA3}_jk8s!>{#C0KRMe=h{zV#)M?A0%Nm -zm&YzUE+WEh_9|U*&NO~Ke{@A2%}T>8i@f`pnt(gyG%PBKrhY_T+BHC6WcqEx{7A;z -z!JzAw{%qkFuVfj$UR0DNoQpDo@6guWeIeL7$5@_ViJ7L@QfuK_9?h7|m7Sum|1xw| -zSCZ@QKgM4sg>jwMZc%F86Au{a1L|LVn>HC*+q0CCx?6qOepVeaq2!F04`EgE@DOH= -ztoPuL5&g(SFdDs-{<=h^^5jAm+JafPKiMVei8_xQmkNmgH48Lsw>#-wc@0Jer -zmJP=mO)18Ia~P(_NLrvl{q-J=*5!rwdg<}h<>eh$R%X@^HdC(F{oR=Z*%>B3L3VE= -z*f^ymXhlBDyly0ag~=I<7}SRt|^E{(nylbLBVkn|D0 -zj%fwa9nNK)bt=O*@!_fHIRECsLEasi83=a>2*d&wwy@At#D6?cQct0p1dtrO6D)D& -ztMQTMk9MI>yywmJyhdg#D~fN|%#VmACR!=EVLDieC+0uZ5(H5CpM>|;SqpFnC>g0) -V_ay9mdAsWcG*q;qwMtfz{|8C@VfFw3 - -literal 0 -HcmV?d00001 - -diff --git a/addons/screensaver.gles.solarwinds/addon.xml b/addons/screensaver.gles.solarwinds/addon.xml -new file mode 100644 -index 0000000..820fa9c ---- /dev/null -+++ b/addons/screensaver.gles.solarwinds/addon.xml -@@ -0,0 +1,119 @@ -+ -+ -+ -+ -+ -+ -+ -+ 'n Betoverende deeltjie effek sluimerskerm -+ أداة ساحرة تؤثر بشاشة التوقف -+ Ахоўнік экрану з зачаравальнымі эфэктамі часьціцаў -+ Скрийнсейвър от частици, които очароват -+ Un estalvi de pantalla amb uns efectes de partícula fascinants -+ Spořič obrazovky s fascinujícími částicovými efekty -+ Arbedwr sgrin effeithiau gronynnau llesmeiriol -+ En tryllebindende pauseskærm med partikeleffekter -+ Ein faszinierender Bildschirmschoner mit Partikeleffekten -+ Μία μαγευτική σωματιδιακή προφύλαξη οθόνης -+ A mesmerising particle effects screensaver -+ A mesmerising particle effects screensaver -+ A mesmerising particle effects screensaver -+ A mesmerizing particle effects screensaver -+ Un salvapantallas con unos efectos de partículas hipnotizantes -+ Un protector de pantalla con unos efectos de partículas hipnotizantes -+ Un sorprendente protector de pantalla de partículas -+ Hüpnotiseeriv osakeste efektiga ekraanisäästja -+ Lumoava partikkelitehostenäytönsäästäjä -+ Un économiseur envoûtant à effets de particules -+ Un économiseur d'écran hypnotisant à effets de particules -+ Un hipnotizante protector de pantalla con efectos de partículas -+ שומר מסך עם אפקט חלקיקים מהפנט -+ Čuvar zaslona - Očaravajuće kretanje čestica. -+ Egy igéző részecske-effektus képernyővédő -+ Penyelamat layar dengan efek partikel yang mencuri perhatian -+ Dáleiðandi skjáhvíla með brellum með agnir -+ Un salvaschermo con effetti particellari ipnotizzanti -+ 幻想的な粒子エフェクトのスクリーンセーバー -+ 매혹적인 파티클 이펙트 화면보호기 -+ Įtaigaus dalelių poveikio ekrano užsklanda -+ Hipnotizējošs daļiņu efekta ekrānsaudzētājs -+ Заштита на екран со смирувачки честички -+ Een hypnotiserende schermbeveiliging met partikeleffecten -+ En hypnotiserende skjermsparer med partikkeleffekter -+ Wygaszacz hipnotyzujący efektami cząsteczek -+ Protector de ecrã com um impressionante efeito de partículas -+ Um protetor de tela hipnotizante com efeitos de partículas -+ Un srceensaver cu efecte de particule fascinant -+ Завораживающая заставка с эффектами частиц -+ En fascinerande skärmsläckare av partikeleffekter -+ මෝහනය කිරීම් තිරමෙහෙයුම් වෙත ප්‍රයෝගිකව බලපෑම -+ Fascinujúci šetrič s efektom častíc -+ Ohranjevalnik zaslona z dih jemajočimi delčki -+ En hypnotiserande partikeleffektskärmsläckare -+ Пардаи экрани аҷоиб бо таъсири зарраҳо -+ Büyüleyici bir parçacık efektli ekran koruyucu -+ Заставка із частинок, що має гіпнотизуючий ефект -+ Một trình bảo vệ màn hình với hiệu ứng thôi miên tạo từ các hạt -+ 一个迷人的粒子效果屏幕保护程序 -+ 一個令人著迷的粒子效果的螢幕保護程式 -+ Hierdie is 'n uiters betoverende deeltjie effek sluimerskerm. Jy sal vind dat jy 'n ongelooflike aantal verskillende patrone kan bewerkstellig. -+ أداة ساحرة جدا تؤثر بشاشة التوقف. ستجد أنك تستطيع أن تحقق عدد مذهل من الأنماط المختلفة. -+ This is a very mesmerizing particle effects screensaver. You'll find that you can achieve an amazing number of different patterns. -+ Това е скрийнсейвър, който очарова с частиците си. Ще откриете, че можете да създадете изключително голям брой различни модели. -+ Aquest és un estalvi de pantalla amb uns efectes de partícules fascinants. Veuràs que pot obtenir un nombre increïble de patrons diferents. -+ Spořič obrazovky s velmi fascinujícími částicovými efekty. Zjistíte, že můžete dosáhnout úžasného množství různých vzorů. -+ Mae hwn yn arbedwr sgrin effeithiau gronynnau hynod lesmeiriol. Mae modd cynhyrchu nifer anferthol o batrymau gwahanol. -+ Dette er en meget tryllebindende pauseskærm med partikeleffekter. Du vil opdage, at man kan opnå et forbløffende antal af forskellige mønstre. -+ Dies ist ein faszinierender Bildschirmschoner mit Partikeleffekten. Du kannst eine verblüffend große Anzahl an verschiedenen Animationen einstellen. -+ Αυτή είναι μία μαγευτική σωματιδιακή προφύλαξη οθόνης. Θα διαπιστώσετε ότι μπορείτε να επιτύχετε έναν απίστευτο αριθμό διαφορετικών σχεδίων. -+ This is a very mesmerising particle effects screensaver. You'll find that you can achieve an amazing number of different patterns. -+ This is a very mesmerising particle effects screensaver. You'll find that you can achieve an amazing number of different patterns. -+ This is a very mesmerising particle effects screensaver. You'll find that you can achieve an amazing number of different patterns. -+ This is a very mesmerizing particle effects screensaver. You'll find that you can achieve an amazing number of different patterns. -+ Este es un salvapantallas con unos efectos de partículas hipnotizantes. Descubrirás que puedes obtener un número increíble de patrones diferentes. -+ Este es un protector de pantalla con unos efectos de partículas hipnotizantes. Descubrirás que puedes obtener un número increíble de patrones diferentes. -+ Éste es un sorprendente protector de pantalla de partículas. Encontrará que puede obtener un gran número de patrones diferentes. -+ See on väga hüpnotiseeriv osakeste efektiga ekraanisäästja. Võimalik on koostada tohutul hulgal erinevaid mustreid. -+ Erittäin lumoava partikkelitehostenäytönsäästäjä. Tulet huomaamaan uskomattoman määrän erilaisia kuvioita. -+ Voici un économiseur d'écran à effets de particules particulièrement envoûtant. Vous trouverez qu'il permet d'obtenir un nombre incroyable de modèles et d'effets différents. -+ C'est un économiseur d'écran à effets de particules particulièrement hypnotisant. Il vous permettra d'obtenir un nombre incroyable de modèles différents. -+ Este é un protector de pantalla con efectos de partículas moi hipnotizante. Atopará que pode acadar un incrible número de patróns diferentes. -+ זהו שומר מסך עם אפקט חלקיקים מהפנט ביותר. מספר מפתיע של צורות שונות ומרהיבות יתקבלו. -+ Ovo je zaista očaravajuči čuvar zaslona. Moguće je ostvariti zapanjujući broj različitih uzoraka. -+ Ez egy lebilincselő hatású részecske-effektus képernyővédő. Hihetetlen mennyiségű különböző minta képes benne kialakulni. -+ Ini adalah penyelamat layar dengan efek partikel yang sangat mencuri perhatian. Anda akan lihat bahwa Anda bisa mendapat sejumlah yang mengagumkan dari pola yang berbeda. -+ Þetta er mjög dáleiðandi skjáhvíla með brellum með ögnum. Þú munt komast að því að þú getur fengið ótrúlegan fjölda af mismunandi mynstri. -+ Questo è un salvaschermo con effetti particellari è veramente ipnotizzante. E' inoltre possibile ottenere un incredibile numero di differenti schemi. -+ 非常に幻想的な粒子エフェクトのスクリーンセーバーです。驚くほどの様々なパターンを知ることになるでしょう。 -+ 매혹적인 파티클 이펙트 화면보호기입니다. 아주 다양한 패턴의 보여줍니다. -+ Tai labai įtaigaus dalelių poveikio ekrano užsklanda. Atrasite, kad galite sukurti neįtikėtina skaičių skirtingų šablonų. -+ Šis ir ļoti valdzinošs daļiņu efekta ekrānsaudzētājs. Jūs redzēsit, ka tas spēj izveidot neticamu skaitu dažādu musturu. -+ Ова е заштита на екран со смирувачки честички. Ќе откриете дека можете да постигнете зачудувачки шеми. -+ Dit is een erg hypnotiserende screensaver. Je kunt ongelooflijk veel verschillende patronen maken. -+ Dette er en veldig hypnotiserende skjermsparer med partikkeleffekter. Du vil finne ut av at du kan oppnå en utrolig mengde forskjellige mønstre. -+ Bardzo hipnotyzujący wygaszacz. Przekonaj się, ile niespotykanch wzorów da się osiągnąć. -+ Um fantástico protector de ecrã com um impressionante efeito de partículas. Experimente e verá que pode obter um número quase infinito de padrões. -+ Este é um protetor de tela com efeitos de partícula bem hipnotizante. Você verá que pode alcançar um incrível número de diferentes padrões. -+ Acesta este un screensaver cu efecte de particule foarte fascinant. O să vedeți că veți putea obține un număr uimitor de modele diferite. -+ Завораживающая заставка с эффектами частиц. Для этой заставки на выбор доступно огромное количество вариаций эффектов. -+ Detta är en mycket fascinerande partikeleffektsskärmsläckare. Du kommer att upptäcka att du kan uppnå ett otroligt antal olika mönster. -+ මෙම මෝහනය කිරීම් තිරමෙහෙයුම් වෙත ප්‍රයෝගිකව මහත් බලපෑම සහිතයි. පුදුම සහගත විවිධ මෝස්‌තර ප්‍රමාණයක් ඔබට ලබා ගැනීමට හැකි බව ඔබ සොයගනිවී -+ Toto je veľmi fascinujúci šetrič s efektom častíc. Zistíte, že môžete dosiahnuť neskutočné číslo rôznych vzorov. -+ To je ohranjevalnik zaslona z dih jemajočimi delčki. Odkrili boste, da lahko dosežejo neverjetno število različnih vzorcev. -+ Detta är en väldigt hypnotiserande partikeleffektskärmsläckare. Du kommer att upptäcka att du kan åstadkomma ett häpnadsväckande antal olika mönster. -+ Ин пардаи экран бо таъсири зарраҳо аҷоиб мебошад. Барои ин парда шумо бисёр таъсирҳои аҷиби нотакрорро пайдо мекунед. -+ Son derece büyüleyici bir parçacık efektli ekran koruyucu. Birçok değişik şekle ulaşabildiğinizi farkedeceksiniz. -+ Це дуже гіпнотизуюча заставка із різноманітних ефектів частинок. Ви побачите надзвичайно велику кількість різноманітних візерунків. -+ Đây là trình bảo vệ có hiệu ứng thôi miên cục kỳ lợi hại. Bạn sẽ thấy sự sáng tạo từ những kiểu kết hợp có thể là không giới hạn -+ 这是一个非常迷人的粒子效果屏幕保护程序。你会发现你能看到惊人数量的不同图案。 -+ 這是一個非常令人著迷的粒子效果螢幕保護程式。您會發現可以達到一個另人驚豔的圖形數。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.solarwinds/icon.png b/addons/screensaver.gles.solarwinds/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..1f5800360734c51b7d628f644d65625f9c6d39df -GIT binary patch -literal 14774 -zcmd6OQ*fkhv~J9aZB6WnZA@$@9oxyob~5qAwr$(CZQDHk-=8{F=W6eZuCJ@Rs`1sk -z)_SzU733rk;BetUKtK?FONuIifPey@f`Y(+0Wb5&0?fb*jjP{`>^RmpClsY?lH%D-#JAsQ~{;Ld6*mVY|GF^oRAeGgaHjSyzk?l^r%VpZgNs&-Q8*59{Z15&ncz84h -zQX&>q9qD9VOrmTMCrJYX1Jk9VwKd!t6joFDe-HoQ9$Zm8a{uHg#izE;vb$C5wnP2I -zkfYUkE8npF-s;e^^A-tYj%69=+>yO)A^8+>x!j1$$oMgb1iin%U*Bwv!}SZ5jU>2% -z82Gakt`Nj@SQ?PMh=}m;>~G}cq*&20{#Z?^#S9x+#ik}6>iZ~M{ZJ(k8yr+sbwTWj -z%gZz5{5xIiJc^1pKa(U_DA~SeEkX>Y)BfP(G*8)|0i8f-B6m24#La!eMO|82SXkHw -zKXR_yZoAp!+EnY*1~(02gGj_r7lgf5Tu_AlMdX5K$_`OSZcLQWa3xNRx09~?KrgN0 -zl^Q`y5wUD%j)fZ?5Xkc}U7AtB*ZPu66dDrJ=d7rEY5L2KlcTnC{?yveE|eXmiUdU@ -zl%0w7mlkKH%$xTZ#-%pBU#(Cax~QL>_**N0h22HROGn4q+1bKEQ_qJ`k`gYdy$v_S -za((3ooV=}GR_@jbGXkR6`N;{V`(432PJo=ZG4uvlIx$gNT6%g~+OCdd*j6N8m -zJsA^-_4Fturs^%;3w3I&BLjr64P;M72<7bYU)KcwvE}+pr`9@)5)}; -zAU6?*>ah_GMP+R(27PK_q2-sB3UDz%y>M7XtPcqP=uU5->(vIc;4ko(e+5fROJ#_g -za{B)g*y8(^F#KU=c);vCi3*4YY`-OlR;L0EWHVTQyF5v>=;XBdi9-z7!(bbA7$O-c -z%rqpb&@p@tQLDOM(FTCPY1`jN;p2>M=G@w6wF}i-Vk6bk0=~aK|NV>CPXmLjs3|Gw -z=;$k@RU7~wQnuADK|cv1_n-7OrM~H6)YKRliBt!|eX2$$7`SqR{VLG`L$lr^JH6iT -zPp20js4B#ij>E)$8jeR5teJde7Ev{5pKp)jQ(LHLXk=IM>FMo`i!7Wdqfbz)AVJkV -z!L(82WdQTC177b#k%$nX@$m4rz0NPklNlT?!z`YJ-$0+YcnS{`U`sTX -zDu2n;LzmrZiU9b1$LlgU@k5%udB67 -zNlObYBf&bX{jmxcMg?t16?j9D66iT}oXmL5-`L=ND2R^0G4V|C2Zz?{uvb)G6}~$d -z{bx3r1`DmNrPb8g{<+cWgs95WC+JBz+3-^zl0FDB-iLZA9@+)BTsLBFZ7D6ONruh{ -z^y!*WM*E3#xr}^pO#`o~I{Ee)_?e@w_z(iPDqM9G{%iP$e}6MS4obA$w5 -zZ$-RqJ5}kJ;L{x7%CZD$Q3ZA3Q1Wncu;v(HZBrDvz~{8@*>#4|OvWk;l6-A>2n`MG -z#r`qJ$lzdn6;%!eXUsg)6l3eikGe@_qd4KW#A1&}T*|>#zmEW-%C;Wv#EQtI@ -zZp-8SlKLN|{}5Qd<6&Gr=TE%;j=TpNt5_Tv|I6KfT#FAC&Fe+DUQN(MUQ9baAE7=U -zMn%S@y)E405HNIn+D=VF!^7kFC1sA)y3Kk>XUtI6{Aw)uuUG9?5r1R;+PBJOazB1S -zd#2Wor+>ZLml|G#2yq<+SV6JDfUB&jtrFnjr6;6>Ap(1C$Hyk5sW|a(VRyg!eBk*W -zOQ7E4qK(04CeW&bD=@#kb@&2cKF>g0!r`C@Dt;vS2o0>QtsPBfCZ{C8u)-i2X-_%b -z-?g?~s2~)IF{`;i2Zai}?0~VlOGM!wI<~TReBf=iJm4u5p7!zgqmmVS*<8BGURJjg(uNdp44-6$7Z1=NP=VbA-TqpUiD7_v%Bsq-q{BU30QQ -z!RbExH*Zl?9Rs1NAMo%9hKHjiuoQgsx=`4!YustbPnWqAG&NxZ{-iU*vI0RW8^>-6 -z%^{QVb9f{^wX}fYY@V2QUHvXip_wi(9i5B}C+3@jVO}w`YB_)NR-1k=*aQD*Zc#Gh -z?s7?G>2F!t$%zefIy+CtCfm&pcNR~T++`HdfGF@3?VI4^?0?NG0SZM$1x>Eb*y&mm -zi^{9|J;*_f-5n1{zFn{s6jZ|WSPWh_y?Pr2rqQ2oZ)vDRSVT9>J4@+x?2iS7RBxt$ -zIId;N5X;xz8}I)r@)>Svq@#6oz4<$u)>fvpoX_2H2_#Ecx$tZK*B3DZcVh2R$5&u -zEkFw^a`pZBT3%8zc6zVLLqy!W?@xiGw4+Y8_#t$fVjD@Tq_>3cV -zX?pW|8J+-*mq)+!th+y8l-l9sXvxN_`^w>R&xtvZ%;SNX8z__%44!hBK^=6qh9-%!U;V2B2h -zxIk}`L|BKQ`lFvVSI_>TZRcUq>pfA=%K@;%G})}XoZgwJwoqe;AsWXnhu`1bVbSZD -zuUCvHbzxwE+i6Hf7x`~B8XlHa$flE$l6DYQx3{e^xi`-E5Sbjd5n42$FS4WASQKV8R28zDp?fSx05Jiu(3D_E3!F5ge{9cLR2 -z??1|=@($vl8q%L|F*^BAn3$SI(ErWZD5m$s -z4_X-|TPXko4-puvz?tu~I<87dF;BOtak~|fBeOzYyWiafABx67Fgrgxlgs9!wF~07 -zZ+HGPnaTov@-suOx7CW@%?!kOD#tQ5Is01Puab+)Yjybn2~Lra(>!M*zI;0XduPX=LzZREx-;bTDnPo!@yx|4BwdwYA*)q6Z|l>3S)J9yS~XF!PY#iifzoG148 -zA(B?;pEk#e4G3RU;L*soE{LVf#mlXEd{bj1m*)(`4hYp!zeFT*^mkq#se7ehf=!%m -zIg?5;y{_d!tkVe3$dB1)i#avy(8bYtykOCkO{J8wAr8s9Fc@kx6wl*AC@^9g?l&M0 -z{S^=x3CUzmgNU3l76JEzDOTFy6*hZqVo2dAFiN`*c$=EgI@G0r -z!4MKcbHPQgasT~}oi{CmE%%k{>rP;2G9%#bwdHoKZ!4khuFg*$prI00kB%y44#=0- -zW=WEeBJ!8ubxGJBGnn$?0~ta3hl)b15vi|v+H>R1f|m;*4#dCly4@Sx+XIiddR#UN -zI*>I0)h!1y%BbjwGCp^uS~^r(Y{ln)*&i!m)VPGZjwU8Hjv<_pBR?eE-MLmu*_Hgu -z)Rg;CV`vQL`MTc^e*Y7N3rFb>MZ#sh>FE^^rd>>-y}P^naDw*#O<)ag5KWxyqpLkD -zy=viD&}9yc}U=w{DoInK|3kFJ0^H -z^%v?&(XGSn?yf;$p$T1bC8^GCUCP-V(mv~miG-P%uI^@`bTU3^-fGiH`Q1-mz7uRI -zJ8~H`nO~ecD;@6lMY8FSogj4RtfFd*9(6h?&R7%6=F!^1RmAEmh^B`uwm -z1og-9aL)HmAeReVPNv0-9NxP*;5}3;TU!R}#pC0S7CHIw^guRySlPVw|5VqZvd8SB1G&4+P?Jc -z)KYOvFukm#V!$7>oMconPl@XX5yJ)z;$M_8e9_IGJRfbJ_ogu7G$sRKML+cnr4}flwnweiW;_@{BtHi%RL^k) -z*>IT+A=W^MKZTX=hhlp>rYS=C4a-Skz_zk|-Ym2~@IP8y -zCeN}zKaNS$154L(izBvGRAsgk&YB;;fI~i+Qg9}L@OyO{s79#rll^=-$bx5m>jMu4 -z@y{%idZZX&BgUAVJkIjn4c_e!>8)*>HxnJqEtg^Sz-9LapOK0<84&)UrKz`w(Df;JG3;n -zZgW13pGW3di~$#C$`Bis3yTSbHTzFI#NjJzYG{C2F1wL}Qc9I~s~=vWqhk -zwYm=gLA(+&Jd2_yvy)fOS-*Tb_QR6IFy`40bR-azOhe{WMT$(qOvXo5Wo4zKludh> -z&;BsJSgBPm{+h=Ec+D;>{G6lJw(P$dX>!;fDl9Huw}rz8!OL%KR5hMBGrz_r52o+< -z?u73?vK~Er$MMD -z?^%O|1*V8X$8<2Nhc9S*WR|0(gamXV&XHoae{zz`A0L}DcvPQtkKO-`_bP@Ir2+_7 -z))GbN$i&9zFu&BCj*5+5a->GG1MsyVaA?GuM-T}=5No}p3Kj4z;p&5 -znd7OiW-%q;m3!cHL%MZx=bl=}&Au -z4Hb>RC;8Y!WW+Q57F#_9kIAz|SlG5-3IITMQd31!(j|=IE58__QN^7#JYemOIcDUq -zgt)=q5JFVJgruZ!0)`3XWj=Hv2!$?hxN -zTQ^kGkDC1az~oLRsy8{OqlMJ(o^H5eSursaTRjFSqc>S@;yBzhDDG*TYSyU -zWt>$kG+QNcDXUP^v2RC!B-2`MLI@lh`}J6bdI&l@jKJkLB2kc4*!jlmec#&RLm`LF -zMvFt<1;EWs!_o1V`8OoU~vlOnmyHa7>FjvesrzM(2^hde3U -z?YRJ!kiF!jh2!i$1QQM}3h-xpwbM@GTGU+qx{?eWHHEd47aH;*y%^cs&1R -z#0&88<=56S>krxM&|veKK78IE?Z$atcXF_>{H=s4Nh2rAL&u^wWI{k|#cOzi-5>5( -zH8C-XijtM%s|c$l=isQWx^kA0Va2cJRSGXm+9`9`r%SvM-17%P%(`XbVC-&r>FE&y -zmtW2ts_{8Dvg+jip$LW+>^$`->}{>YW4sEbl`s_Nq1|5E&_v`n{`Ht?%NO885B-& -zM*UT|om-7e+t+_Cu-q%udI3NtZ4n`9NdRocq19Q6bm_QETb-{PTXz>Pfkmx?)AK1( -z*)^4WA*TWvtz$LUqlBeam#S21k;X< -zuD-^Lvmw0Vuf3iN$NL{S5+fx%67O^k-4kh=AC -zi7A5l=p07pA)!P92Kz5!tnK>>vx`N!KKLQ5G9|=f@|p1ln?!63>?cNmS=B84s`f#n -znL=|0xLIUJa)iYA{{Y>HVm&+M-R1lKI&GtEC#2cE|Fr&mwN9%poj8c2 -zycU4buHX9s#5(^C(1lWE;udx>$)#DOWWujrBp-X|VEnRbz~UwpkkvVrPEjg60E{RK3spb-0BUS2*=w+k>k$U(?IUAxrpNxns6X0uZ= -zJ7lUf1SDE(wn{NO$_4HWN8_~{k18qLcIq)|)LJc9+U-BG9sG>=y7A!qiXifbxoLFI -zr!p!K{ypLkv?EeAzCeWqg8~Bhgtdf{4HvIj0XiEGfBdDIDtvFnCV2R~-ySApyp4?A -z+&D8J=ZXr7nwlGp4A1N8dS2(H$H#uiWBnFb1>wW)2X%tzr7B8i80B24W&x!radwbgr^V4+p#BXb{P_K!ho_%W&V3w#`(EAy=N{y25ls(@*>MOc7_!gMCbpST^1 -z(L)eyP%1z+X6}6#3yN+PjCVk_?5^%tO56t}C{z9?9C}I7x{B60#VJx)j!Phol1vZ{ -zhJ+(_YAVL}o}?i$$FI_n^X{1f`D|?>&xcvh>r7M}94?cwgrSg-X@PGd6a#~Q!d!mP -zE2z7Uqg;ZTqe&()08^fkmHv$H4=>>ko97}9o7H{Y%}vBbgCRpnq(frBu_`2SiU^6Z -zYt&0NeXW7D^#z0;cU^8Szkn|XK&Wn*E^H72;QBo98}0Cdnx3A%`}Ns(xMK#?>11te -zabPIA-;2h+owp^kYoq8{!27M?;c%R}1Z^|Nt8&c({%97=4k>;)}E4q`GzF1$D|W -zE<#yq=}{Qe0c2YlcY$<49y!HS?V)^hc(h)dad>4*L4j!P^q)V)hth5cpv<|>+KvZf -zV&^}g<0eJQpe@hr=uV<->V7!fAtaG_;Q5|%un-!E2FuF_3loDq_^`uh9J5k$tpegB -zJFH~jkUn3hDdjSd-=?E8+nLCaMhx6ER&-rAaWFBLHW$ey5MXg(9Fj8&A}$0vwU}ZG -z`DI;QvAg%_Nk}$PPfuc`^>VhDh=Djpn}~A>As@BL?t62GL&NG8OH#eHEO}k^;jcr$*P&h(bz6PC)A5upaERe*_OpUN -zY;m1EdVC_)^96-e&?u>rN>`XmjsWM$RMuy?Ee(}rHotf911;SEmF>+=uct -zS##_PiE=wp$Y(_cZ^|z(`ddOI>~e`j(Pa(!+5EIwj%0P*Y~J!XPnk7(+gfTaD=TY# -z%{a(VO|O9b;Ku24ep3f2?q+Wl`kVxmPEms|DY>?nYiny48V5#5s#;-U-mv@*_H>>b -z2(LFi^_-)np>@4n3!dYB%bF$4!BtREao*_>QoZ|(!Qu1R$?^a5=a1P`21=s#>(qqy -zToMDyAe-R0fXhb;%!VHi1tnz^i_(wV`r*tJs!gGJ{z(w^3=mcogs6)jdB$ZO6p0BX -z%lu&F#AfF_jcjag;r(`(uspB#y8_FZRp;x)NRb1wld{4}Vz_hzHM{-ZgV1gfE-uN1 -z(n&Cn;m2d2Gmp-4wj9hH>~>X8b32-qmOb{sMNS4YD{xFbfOzu`y -ztpY{+(l%~4X4%gZMb&BL!T<}}?LJAb^7+$~*?e*+cfmJ-mG))2b((+b3E{<@FiQSi -zC_#@kPQg5XS=R{-Rn#XG6jp^nw39R&rT)m$&j>bSiUzBNE_qeqP=OY)oZJ$Bu5WEJ -z9FZn&_O)L33tVhI=jK5pYN|z>pw4GU!rUOpK;}IuYHFtXdb`Jjnza4-g;dH%pKJLd -z!N%p#U|?C_Fjsa2Fz}Nnh=>E8Wz-X4TbPbR@m|gCV3-@%A@ -z#YltU1>?*=jup-vT+Iax6gYzkB;4)19LTXk2F_B=f7P)M{}66CiUqYjwJj~nR(z(; -z&giwDrkY$+0NIp`r>@%F0RG1VBL0o%WO)Ji_sZs>XaX|BUx|XNV`4Aq;&qr1)i -zD+0AhQJ>3S9EHI(TOwOjWMZJH)PEfOU5=+Rn_fxiZC3pQp+D<=)5NYl2)pS=QDIrZ -zKdR-y`f_pldf~*<;w#B1DBg}KW#j=20e2>t;n*!%hKax5!aA8 -zDk>@~38J~(YSL;m=qOo+VN??7bV++2CBez0;XEOo;{$Rx6t;W%C0ALIakv~O&)Arm -z+lmfu-ISF6qZbbUs;?vyopz*XEecTLP`onNhK1`_Tlb%5eZ=i={SAM7Km2)5NyIm@ -z=oz1{kMER&UMeyha_;s4CS6d6hHL=Z+81!wZ_Mbv?Wf2e2+9V6gI)XKb+ow%Pp#^tN%4Oi}k5c2MS?fDJdy0FE233 -zOW9iWWREWI)!l@_jd+-ItfUwZr@$O1aA5fKqT -z;Ni`73l9$svvxEaQsB+c7A#Wn0Kw%&vSz`jNa$GZyj!jJM{FD%`%8L-uI>Vd#i#@P -zE(tbw9cB;MizBcb=>THju_@eujvzwLWlPhMtO_+vD?r6I(-?x5?TqNkJ-&fW$dtO; -ze(Uk-&KnAOU0eGXab)!FIysSRYHsG>;Gnfu_waCNco7PWui-J*2d2jLUDG~4jH9S5 -zPb_HJyN1duE@b)oi~5~wycK?`E9J2+t}q&o6_V%6rT-j78INd? -z7er+{MbzqvORRS3MepI~#wgv29OaZf7F2XlG&k3iW->Tlkr!Y0|ZNYYC^1o6Gc|3dg>6(<(HA`-G!i^`d728zw& -z2hEiP)Q*Ve!k#UUz+{tkoR@oZ>p%*zUBK0G9C=Tc?W9<-`e7e}O= -zW9`1Uh8o|=5V`+ddVp+ -z9;urn$+W$#jmY~U4oQGD{nKaoI#&~`;rwdJi$9$@42n4;2x|N5sTuGZ^UcKY@qk2h -zrCp=%qprSOoQ?ktp*I{O^n4S5WPdO(FMz{!w{B0y8yub^@O3TV{|B_0Wsl$6?Qf~_ -z_vuNTl$&h&o4ljjNkge}jEY)9aw2IZ|JU_*2%&-1Oa7_{vm` -zbp7cDs(+AK%7|lr(rU&9$H#|hF~|3~q9CJlfmkCaV5BVOC+%D>>{FnLNwFAfrC9 -z79qxCQ=`56`$L0u)X+Hdm(pP|5{r=hCt~0)r9lub9VI0&jl3Iw`~umkDCwl70~uSq -zUhjhOf#!Ya7clo{nCshVr>2bI4sVvsAgkSCj?!Tytr!gJ8+z+7?=OtUVM;+k!5}X$ -zFDHjdsBs6Td#!>@B%i^_44nDC9rsfRjGZcg?Ha>DxQ8Y>tri6cbbNjScJ} -z>xG4ca5PFsi!eDUnThdfW!Cg|acOC7nus~?hgk_=c;a=)g`SPv1n3T8CWj|_o}S_W -zv!yNgP?wumXK!yF#DZ&c?AcqSl3tRC!-EU- -z(__+0IjFZgouCEbD4cQB{?alG16m&E%TL -zd89l)7w9*-X>dB;ypH{-V+GggzQLvy%@>dII4w-x>HmO)*EeU?!P9bdjF0^ahR4Fd -zz)Dn4=;!eYA#?v -zMWg7c=#x0HrE`78f%XEq9lRCbk0z)tE3-5&N&b{|tV?9GT2fP2ugAsVodL6r>wgdB -zcTgDC=fS=fdOOTxxnX8xBsvCdINpUSoLEu#_3IY}E*p(lBc52@9dH)IPjrWtRq3{? -z;dg(3y?;Lp3v{*k@I~g3W(ZOJWO}-niqOy=gv~aXTgD(!fMpdx)1DoG=`{ekXg=PRKiUvZEWgfcr?Ck+#&|0u(u&t$rmef -zE5i^w31dDygP?V49ZfvMp>*J#ROIBI?uxUQ==Gyu>@!(}6s3`pr?U8t6V>%@v3=EJ -zNm6EHIk<*{!qEx>x__91zx+)W=<5@b&ATQoL1YClsoRL)7~cYsQ8f4b(W;qF}hZEu7oxbJKFazj+zaToY~@9T20;y;|qJ+5Bx5;g*oR6gXr^%5`*3^%z& -z6z-^eh830^HI|k(St&F~A<~S|O~K|g>xTj}iC-jG51;P>eYbf0Juw2TF#0lT -z(LH<9E{H!=O^(Wx>gd0Srr0-{P^K1b73D_jjFj1kaK8K*(6NZ1@n`m{8mlo}Wg%YD -z-+Wi#hfHU*;o;yYWYZv6-m}Rop-c>x8N4?jSAoKGWK`7U)fpi$-A+quHS}Y1Xp -zcD(RRBBU0^337uRi0oDzW`yV-$UOZEn3rpaO`HZL9UvJK#_bVb6tuKLAgB%zi5xm= -zY9yz>si#4dx`6?iK6Z>p^8;8a9!fl$tAc@_+Mk651p}>4{|X-w#bl6QtR8h9V2+@{ -zZAZ)%oFn=H56{<~SOg=(NWOhRK{&+BIpashX7JO^0%c_zqfW=%ZrH+$;oaD#%;nAm -zxR_ckzTHg0p2E(~KQ=~ej2*wOp1T-P^-INrLA!n~vjH_*;Xsv~8rc+16pq&Z)w%xA -zTXB1@y@JsdaI?1SfBVC&>E}Ef>*HBBp4;6L8Y_m3ca+01y`|S)$L$(J`ao0u#GHnn -zesXH+){Sr1V3&zfhDnESg_6nU5xzV>KR>Cc(EDk5I;Z)dbrd*p?masH6>re`qNIUV -zG16k2`OGAOX93z>2qGl4t+ch)erabpD8Fr9B`ly9XOC-ZB;`=R&I=C#3wy$BR@(KI -ztF(dw)OlrP_pSQGhm|N -zTlqR_vzC0EyfI4E4%AxCt&pN>Z6B}*jv#Pz6QV~CL)>cmn6&2aY4P`4Ik|b8&d?Kq}jVfB@ -zh_bJ3O -ztmBrczPTy86i+h=TurQ3MFXuOLp(usTIB2XvFYjqaLhCUDxtrjuV(AIhqO!7PwF`U -z8*7nI5Zfs-FKaemn9Ezp-T35T|Du$%(1jHOfg48uU%N)T*8w#(HD=kLs$%Xq9eP_e -zplBy>qT=Fxz2Jjl_DwnZ&kYvJyE|y|ABImC?>msgMD8yJvu;3xZGC$air!|}a~|Y9 -z=&KfV1K#IiQbai09zwpi@utVk>kAyIpvZw*Nc6L)w)S=v@QphqF4}^Ni@WQlV*C?k2?!nGpDw7YOJWDlqd2~t -z`p3KdljJ}4u0rChr(;5tE_7GQ)d+Nw~Mi64r2_(-QnbnHR*%kBCgCidLY2w{xdvGHV0FANm>n -z!u@48yHBVELIad&%iGoSn&{|UQUGNqq!&$||M4y)S#bE~tMC2J&WCJB8VieT!Tkd$ -z`7U$_tr4pESh6sAtnRE4Dm5$VZOxoL22{nkiW@|zYgrDK&dsS5#i%z}L>^yK+E`SCpVzPevj0GdCu?0>R -zhKUjzwCET48J;`#9oS|Nh^CN@*;|7}o$#;suGP+ke1*xDBdF!4*f^a_6tsYEFR%#y -z22kw)w)OgBJTGk09$7GSL{`?_&bA?$h&J!{>zy4kB!Pu(;jK36az#;T`F^KiiEPv%j5}}!y1b+YtP$J=_Ik6Dx_!`2?HOQ4w -zXMcdh_QS({g1CUg69DBNL+eKF?EJX1^Vr_OB}6@fP_W*)HQgTO^plb+DQNPa2@HTR -z%LWD`60@Gp_d_NSa5DtW!Y+bd%Mh%ua%fq*ECa3FB=uoZE&z@F)%Q%Izy&{R;N$ -+ -+ -+ -+ -+ -+ -+ Seker die tweede mees psigedeliese sluimerskerm ooit -+ ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق -+ Напэўна, другі найбольш псіхадэлічны ахоўнік экрану -+ Вероятно вторият най-халюциногенен скрийнсейвър -+ Probablement el segon estalvi de pantalla més psicodèlic mai creat -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig -+ Formodentlig den anden mest psykedeliske pauseskærm nogensinde -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ -+ Spiralling screensaver -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probablemente el segundo salvapantallas más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico -+ Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud -+ Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena -+ Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan -+ Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé -+ Probablement le deuxième économiseur d'écran le plus psychédélique -+ Probabelmente o segundo protector de pantalla máis psicodélico. -+ כנראה שומר המסך השני בדירוג הפסיכדליות -+ Vjerojatno drugi najveći psihodelični čuvar zaslona ikad -+ A második legpszihedelikusabb képernyővédő -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna -+ Probabilmente il secondo salvaschermo più psichedelico di sempre -+ 世界で2番目にサイケなスクリーンセーバー -+ 아마도 지금까지 두번째로 가장 환상적인 화면보호기 -+ Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē -+ Можеби втора нај психоделична заштита на екран -+ Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit -+ Helt sikkert den nest mest psykedeliske skjermspareren som finnes -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie -+ Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre -+ Provavelmente a segunda mais psicodélica proteção de tela já vista -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată -+ Наверное, вторая из самых психоделических заставок в мире -+ Förmodligen den näst psykedeliska skärmsläckaren -+ පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu -+ Troligen den näst mest psykedeliska skärmsläckaren någonsin. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu -+ Напевно, друга серед найбільш психоделічних заставок -+ Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai -+ 或许是排名第二的迷幻效果屏幕保护程序 -+ 可能是有史以來第二最夢幻的螢幕保護程式保護程式 -+ Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg. -+ ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة . -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове. -+ Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se. -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy. -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas. -+ Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring. -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten. -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor. -+ Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad. -+ Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen. -+ Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor. -+ כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום. -+ Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo. -+ Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni. -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari. -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu. -+ Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ 아마도 존재하는 두번째로 가장 환상적인 화면보호기. 모든 색깔들이 움직이는 것을 상상해보세요. -+ Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt. -+ Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат. -+ Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen. -+ Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt. -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw. -+ Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se. -+ Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela. -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se. -+ Просто попробуйте представить себе все цвета в движении. -+ Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt. -+ පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo. -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog. -+ Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд. -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın. -+ Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів. -+ Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi -+ 或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。 -+ 可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.spiral/icon.png b/addons/screensaver.gles.spiral/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..a6784afc53d95a655742f9b7db247471fc52a105 -GIT binary patch -literal 5657 -zcmd5=%_yf)hI}rNdW+$&`^i!0RZ0Z5f2~+-G*^$ -zdC}XzSS?I;T#Z?V*$oLUxq6 -zE9lIcr+wgK*+sd{`L^(P-8a3lYQ&E}UA|67z<}ug9WVyQrWc4}FGAmYqBl>1bONzv -zC+?Ez!vf2~`U3PpH94L~S5!~e3>{ftnwqYDHkO#%!3Eds-f-vU<#x3ok^P!#c&&Mj -zzqU{)hEWAAwchi(#n$&f83OU#4u794xU3pF;=hiq3z=Iyzy>gw6Z9jc|#L>RDEfDP^{ -zw1VZPJzaiK3d}>fS&jI4kUS-TdMLJX#O%vmQUu7;ka*&oPz;Dus2GWytedNb0VVFo -z=kC>iea=I}ER0DJ)^vpcb6$-b?rJ8LX9^5>nJ}Xg6!55(@FZlJA9&Z2c -z!+;}TZ4V{di+qq?Xf=8;-O}LTGYj|nvT$g|IzXn0C-KCg_?NN3#>vI=#XWhw?Wi^+ -z^5c(n?^!b~o5{zi??H}^N`*^@ANh^k1$*V8eb%ysgxv^$Gs<9_i2oVtX{VnGo`hq+ -zylhDS*9eiVK!Mjpe5VF{IPTn9Mgq4AI)Ep>o|344+WxA@`KN8z(B22(wE%zr&1Wb(!JYd`bl)I`2oCbOeV)*7eJt@Rok8|jq%ZHWu5Ak2x( -z`UFt5tE>DaycfyOpHB3v>FWnYB4&^~-QE=wrbh62 -zn@A$`0LoZf#ctGs9~hCsirP#OM22xhr~DjQh$2s$IAh95$xVO& -zcI->QTatShXtbcLfgS3SfEPF^93rtz6YI-*0?-UuSjH{Z8 -z>at!RLM1%!4T?6mr+tW3;$0ZF^9h1MSU+qSkfN+qVan0pj3C9$(Z -zjg$p*`xnG=-UpXTg`QTr$bZ+KkmkjM7f<<(oJvf&LnN6o5O;~iCm}~b@LEPWSb~QN -zJvrf{&fR@?rCsTVW+tuPtR{j_|4_OdieB5wpOErln*d&^`xYqJB}54VP*d3 -z&)HR_0%}>q-`}5IKKOF?%tuz&P=uHyk2`%>v1o6vPOEdVi%Kw@Nh -zsjWuVK={$ASC{xw0)zYuzvdKk^U%<6W5MG3WD#Ejd`MLp9;CT{9CUmC2jO!ymsF@> -zEJt^3H~ZaVHI7i*i^D?A^p=+9^>{;x7xfK)b&!IRtzcI_RMEO>f}0;4fI<;(ly1&N$3` -z-lic`n(t!wdUcV5JB2Ggdf&nj!kCklV<1M7J})(5`kK99*4W%!E?~c>2~v?P3~@C^ -zlX#f*?4#Xl7f;*0*W9*Ap;Hk+8EhNdv&>DKEVtG>FH{2TPBet|=osjln*M%-LGu2z -zL6!@uFSC7y!qJ0oM~konMa2pq-U#1Mp!gd_SWhtcc~8c~oTsDdcMQ?2n~~swL^X!1 -zU11*XYJom55TMsw%_BXl>M{}2WD-1$=>I;lpg%S*dMmaX&mWYf)OX8wAK-SRl0BBP -zzA@l068Eb=Je9%tc+6~qLwaHz#^ta7gMzMGf#fH4fLLsE5pRxwC2(Mzkx5C -zw7vTiDbg1x93}BMYY{lp9EWlJymk`-D?Ba)BQ@35Zb40#md}y7xw&?h46NCd_GU-K -zGI~0z+h?G82a$RIW$drvbmGF!xHz=yk>lgp$C4bf5naT>bUzfw1ow%)-r>PKoE9&}$SiH|ip)kt -z;9-&()<{0ja4c^nGqS!$e$9FYSWnjAN}suVph5bo_MONsLq)<;i7%VV7Q}SCuAH%d -zLMNI{m@*=+WwbE;v7kzShVaF25xR7xjPwUtI0G~gn -z)vub}A?$;;u$@>@qWUID4EfMbSJ~S<9##^~>E0UgzwDtmQB>KgKoZAQcw_K(e7vcq -zAA7nD>s5sh!>rjK9pa~8^1;Z=yzbSpAbkkHfEcxOJG3z+EaTK?Zugxnoo=pt88IRB -zXqvOYzUEJJ`affS{VZyCta=bM;-fvk!OecIa2$I<`9PXsUL-1va -znVb_V!RY8z_|?}$RmTLdcr4+t_)jMmam~}=)=*0G5i;mb3z(sIDqT#g^%Ni&E%1^D -zxmd*BDX1hwOAMqQ53VV{l$S%))EB}$4@SA~I-!oT#l{MVq=`x0^J*IAm&Bj#lmoks -zsV3eYGvXiAJ>LhsR?z0xok{K}D)7F!cKRJEn;w2ma^s(W&8C&fUJ#wIu}K~9{;iJ` -zH7V+;&Y07SBe>e*SRwOfDaLdW{3^W~N-9ey+i^AYPtSZ%MR5$%^s!g*9}f92+4qdU -zez3N;p8D=)dq_%2<#NPf2#I<+J+C|eXf$>91vam*um4Wbhle2)I7PA;|LpHiEyS2+ -z=j4oqCV!Td)_@;X4_U4Oj#b?X%r!MNt5P24S5Hr-&PB2^I~EDQrzJ+LQ&5`Il-XqA -zuPV&m*P{AVpREo2^EpZEM`;L!95dy8$Mhr>ZR`JAw+l%=9y=oc`d5Sq#zg$6@4gW{ -z2J=(+Iw<&DyGE3XZv*u-;i2_K*ra6KfXziFGQ=tdW*-Hc?S!T -z(NpC~VI@4sDC&1sExFsz464|E@h0e$ua0-Dt!X(IIl9ep#S#4 -ziX_7C_Rwm6c+sOxLET(7w&Mi~12b1084)Wtt!@OS^rGpGU|KAwfC_4UJLiEX- -zP`(_BpzXDZiIo+7*@&FrpGQMaqM;1=LM!ADmdGOXw>T%bmFXZD(eQ@JJ|fnb5VLu5 -zb`{27Qz|WDnf1K0Rd@c|MnmaMfcVQ*h%NeMy||&xOt^)Gq&t%=ToEASU8UE@Lw({m -z4XkPQtA}WH?{uD -zu}%YCK0+eEf^RhsA38sOxh^Q36O9&O_Cq5^pCX91hLi|sfAi6d|0(@-?p7Gol(9%!s -zvY~TS4YaVaeOvM}tuHPtaoMo1d>ro9JuIGDBm`C*K@G{@^;9WeMbmm--&IwXc%;Q$ -zCfQs-`80gFaeusrHtBSLqpqfoERlkOa_VBcQcsNF&|l$_YZ`k9)Q7EWFEuUO?>RO8 -zZc#P#_4PHvz~AcWb!587$e10A4Am*-kP}$Z20e7PzEV4`&8RkGm)84!64;uwgc!_h$W6()k -z+XeP?;6rc!)b!Lki}m?P#=3eRH;9~%wr0n7NdmW7>EG|!)PRA-6JV?TPd&Z!P+q~_nc0`O(Gln;7?+~vWa -z9EAJ&$1D-bYbAvTRQDr-{^X$gl!lh&9{p#HlQ&zi> -z%d#}SnT(Bm+UwCf5|9O2kMo-~vY0D>&1azzOQK4JoWg7bqhL_-6O>^_qJ-&7T_GMj -z&{d}|SV4R#g$6OCj9Guk9IafN*Omq1tb70J6fDI@qR+Q5DJ(XTrAhV<9 -zS$!p$kqdI#O=pMB`T#}l9RoIvVqD6&1d2=@kM+LQ715}8Bn(JQkX0{`V9(zx1fvQ; -zLG|V1HwOHSWI;D)2(NeGt2)&jro$XR0{L1zP= -z(Vzk#3)E)mYu99*qIUeQ{2mxFoJ<6K!`!b51|E~bO{oc%jQ*Z=cD0+mi(C`MMT0y& -zDC-@3JN>5bmJk&HW~BF-+Jur!@-Eek-Yssfek=jz-{kztOH>tKV9wm-0h^W%l+UX#F1wq)~lB}t= -z?q*_bk5um3PfOJ!l*tAZcCqlvt&{XP5Vt*Dr5W_LD%_^7-s -zYA0b$eB?hfI~#Po8zht-#UVXAX*l`+i-JObQMW$o3SDZ)@RXJgyF8tlnI4wEi5^(n`yI&J!$OQ-?PPl&1onO?v7%w5DiNX?gHkZcFcyYdis#Jjc`uhBPF|)X_QRaG8pMk^SK6`ZccI4)=xw!1i -zgz-@$tZ{jd87k=-{S*C-SaKmZ^VjTRn9Nd6`EXgh;Hf}{FzM?g -zQ=$AGrF&jWLqkLJmzUVp0jp1^ai;^}eU!p4jI0J`f~*5HOc;F&IvYRsG4^m0jOL)A -zRzwL2I@pk)gCw~u#t2+~&tc|m;!H{Xgt0<{7d8$V3HA3}_jk8s!>{#C0KRMe=h{zV#)M?A0%Nm -zm&YzUE+WEh_9|U*&NO~Ke{@A2%}T>8i@f`pnt(gyG%PBKrhY_T+BHC6WcqEx{7A;z -z!JzAw{%qkFuVfj$UR0DNoQpDo@6guWeIeL7$5@_ViJ7L@QfuK_9?h7|m7Sum|1xw| -zSCZ@QKgM4sg>jwMZc%F86Au{a1L|LVn>HC*+q0CCx?6qOepVeaq2!F04`EgE@DOH= -ztoPuL5&g(SFdDs-{<=h^^5jAm+JafPKiMVei8_xQmkNmgH48Lsw>#-wc@0Jer -zmJP=mO)18Ia~P(_NLrvl{q-J=*5!rwdg<}h<>eh$R%X@^HdC(F{oR=Z*%>B3L3VE= -z*f^ymXhlBDyly0ag~=I<7}SRt|^E{(nylbLBVkn|D0 -zj%fwa9nNK)bt=O*@!_fHIRECsLEasi83=a>2*d&wwy@At#D6?cQct0p1dtrO6D)D& -ztMQTMk9MI>yywmJyhdg#D~fN|%#VmACR!=EVLDieC+0uZ5(H5CpM>|;SqpFnC>g0) -V_ay9mdAsWcG*q;qwMtfz{|8C@VfFw3 - -literal 0 -HcmV?d00001 - -diff --git a/addons/screensaver.gles.stellar/addon.xml b/addons/screensaver.gles.stellar/addon.xml -new file mode 100644 -index 0000000..c345d87 ---- /dev/null -+++ b/addons/screensaver.gles.stellar/addon.xml -@@ -0,0 +1,121 @@ -+ -+ -+ -+ -+ -+ -+ -+ Seker die tweede mees psigedeliese sluimerskerm ooit -+ ربما شاشة التوقف الثانية الأكثر هدوء على الإطلاق -+ Напэўна, другі найбольш псіхадэлічны ахоўнік экрану -+ Вероятно вторият най-халюциногенен скрийнсейвър -+ Probablement el segon estalvi de pantalla més psicodèlic mai creat -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig -+ Formodentlig den anden mest psykedeliske pauseskærm nogensinde -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner überhaupt -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που έγινε ποτέ -+ An interstellar journey -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probably the second most psychedelic screensaver ever -+ Probablemente el segundo salvapantallas más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico jamás creado -+ Probablemente el segundo protector de pantalla más psicodélico -+ Arvatavasti teine kõige psühhedeelsem ekraanisäästja, mis iial tehtud -+ Ziurrenik inoizko bigarren pantaila-babesle psikodelikoena -+ Todennäköisesti toiseksi psykedeelisin näytönsäästäjä koskaan -+ Probablement le deuxième économiseur d'écran le plus psychédélique jamais créé -+ Probablement le deuxième économiseur d'écran le plus psychédélique -+ Probabelmente o segundo protector de pantalla máis psicodélico. -+ כנראה שומר המסך השני בדירוג הפסיכדליות -+ Vjerojatno drugi najveći psihodelični čuvar zaslona ikad -+ A második legpszihedelikusabb képernyővédő -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna -+ Probabilmente il secondo salvaschermo più psichedelico di sempre -+ 世界で2番目にサイケなスクリーンセーバー -+ 아마도 지금까지 두번째로 가장 환상적인 화면보호기 -+ Tikriausiai antra labiausiai psichodelinė ekrano užsklanda pasaulyje. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē -+ Можеби втора нај психоделична заштита на екран -+ Waarschijnlijk de op één na meest psychedelische schermbeveiliging ooit -+ Helt sikkert den nest mest psykedeliske skjermspareren som finnes -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie -+ Este é provavelmente o segundo melhor protector de ecrã psicadélico de sempre -+ Provavelmente a segunda mais psicodélica proteção de tela já vista -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată -+ Наверное, вторая из самых психоделических заставок в мире -+ Förmodligen den näst psykedeliska skärmsläckaren -+ පෙනෙන විදියට සදා දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky vôbec -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu -+ Troligen den näst mest psykedeliska skärmsläckaren någonsin. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu -+ Напевно, друга серед найбільш психоделічних заставок -+ Xứng đáng làm trình bảo vệ màn hình gây ảo giác mạnh thứ hai -+ 或许是排名第二的迷幻效果屏幕保护程序 -+ 可能是有史以來第二最夢幻的螢幕保護程式保護程式 -+ Seker die tweede mees psigedeliese sluimerskerm wat bestaan. Verbeel jou net al daai kleure wat rond beweeg. -+ ربما شاشة التوقف الثانية الأكثر هدوء في الوجود. فقط حاول تصوير هذه الألوان المتحركة . -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Вероятно вторият по сила халюциногенен скрийнсейвър създаван някога. Просто се опитайте да съзрете всички тези цветове. -+ Probablement el segon estalvi de pantalla més psicodèlic que existeix. Intenta imaginar tots aquests colors movent-se. -+ Pravděpodobně druhý nejdivočejší šetřič obrazovky všech dob. Zkuste si představit všechny ty poletující barvy. -+ Mwy na thebyg yr ail arbedwr sgrin mwyaf seicadelig sy'n bod. Ceisiwch ddychmygu'r holl liwiau na'n symud o gwmpas. -+ Formodentlig den anden mest psykedeliske pauseskærm, der eksisterer. Forestil dig alle de farver, der bevæger sig omkring. -+ Wahrscheinlich der zweit-psychodelischste Bildschirmschoner, den es gibt. Versuche doch alle diese Farben, die sich umher bewegen, festzuhalten. -+ Πιθανότατα η δεύτερη πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Απλά προσπαθήστε να φανταστείτε όλα αυτά τα χρώματα σε κίνηση. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colours moving around. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ Probablemente el segundo salvapantallas más psicodélico que existe. Intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantalla más psicodélico que existe. Solo intente imaginarse todos esos colores moviéndose. -+ Probablemente el segundo protector de pantallas más psicodélico. Solo trate de captar todos los colores moviéndose alrededor. -+ Arvatavasti ajaloo teine kõige psühhedeelsem ekraanisäästja. Püüa lihtsalt kujutleda kõiki neid värve, mis ringi liiguvad. -+ Ziurrenik existitzen den bigarren pantaila-babesle psikodelikoena. Saiatu kolore guzti horiek mugitzen irudikatzen. -+ Todennäköisesti toiseksi psykedeelisin olemassa oleva näytönsäästäjä. Kuvittelepa vain kaikki nuo värit lentelemässä ympäriinsä. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probablement le deuxième économiseur d'écran le plus psychédélique de l'histoire. Essayez seulement d'imaginer toutes ces couleurs en mouvement. -+ Probabelmente o segundo protector de pantalla máis psicodélico do mundo. Tan só probe a imaxinarse todas esas cores movéndose ó redor. -+ כנראה שומר המסך השני בדירוג הפסיכדליות שקיים כיום. פשוט נסו לדמיין את כל הצבעים האלו נעים ממקום למקום. -+ Vjerojatno drugi najveći psihodelični čuvar zaslona koji postoji. Samo pokušajte zamisliti sve te boje koje se gibaju okolo. -+ Valószínüleg a második legpszihedelikusabb képernyővédő ami létezik. Csak képzeld el mindezt a színkavalkádot mozogni. -+ Mungkin screensaver paling psikedelik nomor dua yang pernah ada. Coba bayangkan warna-warni itu bergerak ke sana kemari. -+ Líklega í öðru sæti yfir klikkuðustu skjáhvíluna sem til er. Reyndi bara að ímynda þér alla þessa liti á hreyfingu. -+ Probabilmente il secondo salvaschermo più psichedelico di sempre. Prova semplicemente a guardare tutti quei colori che si muovono. -+ Probably the second most psychedelic screensaver in existence. Just try to picture all those colors moving around. -+ 아마도 존재하는 두번째로 가장 환상적인 화면보호기. 모든 색깔들이 움직이는 것을 상상해보세요. -+ Turbūt antra labiausiai psichodelinė ekrano užsklanda pasaulyje. Išbandykite ją ir pamatysite judančių spalvų šventę. -+ Iespējams viens no vispsihodēliskākajiem ekrānsaudzētājiem pasaulē. Pamēģiniet, lai gūtu priekšstatu par krāsu kustību un plūsmu visapkārt. -+ Можеби втора нај психоделична заштита на екран. Само обидете се да ги согледате сите тие бои кои се движат. -+ Waarschlijnlijk de op één na meest psychedelische schermbeveliging ooit. Probeer u het voor te stellen: al die kleuren die door elkaar lopen. -+ Helt sikkert den nest mest psykadeliske skjermsparern i verden. Bare prøv å se for deg alle de fargene som beveger seg rundt. -+ Prawdopodobnie drugi, najbardziej psychodeliczny wygaszacz na świecie. Spróbuj i zobacz ferie poruszających się barw. -+ Provavelmente, o segundo melhor protector de ecrã psicadélico de sempre. Experimente visualizar todas as cores a moverem-se. -+ Provavelmente a segundo mais psicodélica proteção de tela existente. Experimente ver todas essas cores se movimentando ao redor da tela. -+ Probabil al doilea cel mai năucitor screensaver care a existat vreodată. Doar încercați să vă imaginați toate acele culori mișcându-se. -+ Просто попробуйте представить себе все цвета в движении. -+ Förmodligen den näst psykedeliska skärmsläckaren som finns. Försök bara att uppfatta alla färger som rör sig runt och runt. -+ පෙනෙන විදියට සදා පවතින දෙවන මහත් අධිචිත්ත වේගී තිරමෙහෙකරු.වටේ තිබෙන එම සියළු වර්ණ ඡායාරූප කිරීමට උත්සාහ කිරීම පමණයි. -+ Pravdepodobne druhý najviac hypnotizujúci šetrič obrazovky aký vôbec existuje. Iba si skúste predstaviť všetky tie farby pohybujúc sa okolo. -+ Gotovo drugi najbolj psihadelični ohranjevalnik zaslona na svetu. Samo predstavljajte si vse te barve, ki letijo naokrog. -+ Troligen den näst mest psykedeliska skärmsläckaren som existerar. Bara tänk dig alla färgerna som rör på sig. -+ Эҳтимол аст, ки имрӯз дар тамоми ҷаҳон ин пардаи экран ҷои дуюмро мегирад. Танҳо тасаввур кунед, ки чӣ қадар зебо ҳамаи рангҳояш бозӣ мекунанд. -+ Muhtemelen insanı hayallere sürükleyen en iyi ikinci ekran koruyucu. Ekranda dolaşan tüm renkleri seyretmeye çalışın. -+ Напевно, друга серед найбільш психоделічних заставок. Лише уявіть усі ці переливи кольорів. -+ Đây có thể là trình bảo vệ màn hình gây ảo giác mạnh thứ hai tại thời điểm này. Hãy thử xem các hình ảnh tạo nên từ các màu sắc di chuyển khắp nơi -+ 或许是排名第二的迷幻效果屏幕保护程序。你将看到所有颜色满处乱飞。 -+ 可能是現存第二最夢幻的螢幕保護程式。快來嘗試想像一下所有移動中的色彩變化。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.stellar/icon.png b/addons/screensaver.gles.stellar/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..a6784afc53d95a655742f9b7db247471fc52a105 -GIT binary patch -literal 5657 -zcmd5=%_yf)hI}rNdW+$&`^i!0RZ0Z5f2~+-G*^$ -zdC}XzSS?I;T#Z?V*$oLUxq6 -zE9lIcr+wgK*+sd{`L^(P-8a3lYQ&E}UA|67z<}ug9WVyQrWc4}FGAmYqBl>1bONzv -zC+?Ez!vf2~`U3PpH94L~S5!~e3>{ftnwqYDHkO#%!3Eds-f-vU<#x3ok^P!#c&&Mj -zzqU{)hEWAAwchi(#n$&f83OU#4u794xU3pF;=hiq3z=Iyzy>gw6Z9jc|#L>RDEfDP^{ -zw1VZPJzaiK3d}>fS&jI4kUS-TdMLJX#O%vmQUu7;ka*&oPz;Dus2GWytedNb0VVFo -z=kC>iea=I}ER0DJ)^vpcb6$-b?rJ8LX9^5>nJ}Xg6!55(@FZlJA9&Z2c -z!+;}TZ4V{di+qq?Xf=8;-O}LTGYj|nvT$g|IzXn0C-KCg_?NN3#>vI=#XWhw?Wi^+ -z^5c(n?^!b~o5{zi??H}^N`*^@ANh^k1$*V8eb%ysgxv^$Gs<9_i2oVtX{VnGo`hq+ -zylhDS*9eiVK!Mjpe5VF{IPTn9Mgq4AI)Ep>o|344+WxA@`KN8z(B22(wE%zr&1Wb(!JYd`bl)I`2oCbOeV)*7eJt@Rok8|jq%ZHWu5Ak2x( -z`UFt5tE>DaycfyOpHB3v>FWnYB4&^~-QE=wrbh62 -zn@A$`0LoZf#ctGs9~hCsirP#OM22xhr~DjQh$2s$IAh95$xVO& -zcI->QTatShXtbcLfgS3SfEPF^93rtz6YI-*0?-UuSjH{Z8 -z>at!RLM1%!4T?6mr+tW3;$0ZF^9h1MSU+qSkfN+qVan0pj3C9$(Z -zjg$p*`xnG=-UpXTg`QTr$bZ+KkmkjM7f<<(oJvf&LnN6o5O;~iCm}~b@LEPWSb~QN -zJvrf{&fR@?rCsTVW+tuPtR{j_|4_OdieB5wpOErln*d&^`xYqJB}54VP*d3 -z&)HR_0%}>q-`}5IKKOF?%tuz&P=uHyk2`%>v1o6vPOEdVi%Kw@Nh -zsjWuVK={$ASC{xw0)zYuzvdKk^U%<6W5MG3WD#Ejd`MLp9;CT{9CUmC2jO!ymsF@> -zEJt^3H~ZaVHI7i*i^D?A^p=+9^>{;x7xfK)b&!IRtzcI_RMEO>f}0;4fI<;(ly1&N$3` -z-lic`n(t!wdUcV5JB2Ggdf&nj!kCklV<1M7J})(5`kK99*4W%!E?~c>2~v?P3~@C^ -zlX#f*?4#Xl7f;*0*W9*Ap;Hk+8EhNdv&>DKEVtG>FH{2TPBet|=osjln*M%-LGu2z -zL6!@uFSC7y!qJ0oM~konMa2pq-U#1Mp!gd_SWhtcc~8c~oTsDdcMQ?2n~~swL^X!1 -zU11*XYJom55TMsw%_BXl>M{}2WD-1$=>I;lpg%S*dMmaX&mWYf)OX8wAK-SRl0BBP -zzA@l068Eb=Je9%tc+6~qLwaHz#^ta7gMzMGf#fH4fLLsE5pRxwC2(Mzkx5C -zw7vTiDbg1x93}BMYY{lp9EWlJymk`-D?Ba)BQ@35Zb40#md}y7xw&?h46NCd_GU-K -zGI~0z+h?G82a$RIW$drvbmGF!xHz=yk>lgp$C4bf5naT>bUzfw1ow%)-r>PKoE9&}$SiH|ip)kt -z;9-&()<{0ja4c^nGqS!$e$9FYSWnjAN}suVph5bo_MONsLq)<;i7%VV7Q}SCuAH%d -zLMNI{m@*=+WwbE;v7kzShVaF25xR7xjPwUtI0G~gn -z)vub}A?$;;u$@>@qWUID4EfMbSJ~S<9##^~>E0UgzwDtmQB>KgKoZAQcw_K(e7vcq -zAA7nD>s5sh!>rjK9pa~8^1;Z=yzbSpAbkkHfEcxOJG3z+EaTK?Zugxnoo=pt88IRB -zXqvOYzUEJJ`affS{VZyCta=bM;-fvk!OecIa2$I<`9PXsUL-1va -znVb_V!RY8z_|?}$RmTLdcr4+t_)jMmam~}=)=*0G5i;mb3z(sIDqT#g^%Ni&E%1^D -zxmd*BDX1hwOAMqQ53VV{l$S%))EB}$4@SA~I-!oT#l{MVq=`x0^J*IAm&Bj#lmoks -zsV3eYGvXiAJ>LhsR?z0xok{K}D)7F!cKRJEn;w2ma^s(W&8C&fUJ#wIu}K~9{;iJ` -zH7V+;&Y07SBe>e*SRwOfDaLdW{3^W~N-9ey+i^AYPtSZ%MR5$%^s!g*9}f92+4qdU -zez3N;p8D=)dq_%2<#NPf2#I<+J+C|eXf$>91vam*um4Wbhle2)I7PA;|LpHiEyS2+ -z=j4oqCV!Td)_@;X4_U4Oj#b?X%r!MNt5P24S5Hr-&PB2^I~EDQrzJ+LQ&5`Il-XqA -zuPV&m*P{AVpREo2^EpZEM`;L!95dy8$Mhr>ZR`JAw+l%=9y=oc`d5Sq#zg$6@4gW{ -z2J=(+Iw<&DyGE3XZv*u-;i2_K*ra6KfXziFGQ=tdW*-Hc?S!T -z(NpC~VI@4sDC&1sExFsz464|E@h0e$ua0-Dt!X(IIl9ep#S#4 -ziX_7C_Rwm6c+sOxLET(7w&Mi~12b1084)Wtt!@OS^rGpGU|KAwfC_4UJLiEX- -zP`(_BpzXDZiIo+7*@&FrpGQMaqM;1=LM!ADmdGOXw>T%bmFXZD(eQ@JJ|fnb5VLu5 -zb`{27Qz|WDnf1K0Rd@c|MnmaMfcVQ*h%NeMy||&xOt^)Gq&t%=ToEASU8UE@Lw({m -z4XkPQtA}WH?{uD -zu}%YCK0+eEf^RhsA38sOxh^Q36O9&O_Cq5^pCX91hLi|sfAi6d|0(@-?p7Gol(9%!s -zvY~TS4YaVaeOvM}tuHPtaoMo1d>ro9JuIGDBm`C*K@G{@^;9WeMbmm--&IwXc%;Q$ -zCfQs-`80gFaeusrHtBSLqpqfoERlkOa_VBcQcsNF&|l$_YZ`k9)Q7EWFEuUO?>RO8 -zZc#P#_4PHvz~AcWb!587$e10A4Am*-kP}$Z20e7PzEV4`&8RkGm)84!64;uwgc!_h$W6()k -z+XeP?;6rc!)b!Lki}m?P#=3eRH;9~%wr0n7NdmW7>EG|!)PRA-6JV?TPd&Z!P+q~_nc0`O(Gln;7?+~vWa -z9EAJ&$1D-bYbAvTRQDr-{^X$gl!lh&9{p#HlQ&zi> -z%d#}SnT(Bm+UwCf5|9O2kMo-~vY0D>&1azzOQK4JoWg7bqhL_-6O>^_qJ-&7T_GMj -z&{d}|SV4R#g$6OCj9Guk9IafN*Omq1tb70J6fDI@qR+Q5DJ(XTrAhV<9 -zS$!p$kqdI#O=pMB`T#}l9RoIvVqD6&1d2=@kM+LQ715}8Bn(JQkX0{`V9(zx1fvQ; -zLG|V1HwOHSWI;D)2(NeGt2)&jro$XR0{L1zP= -z(Vzk#3)E)mYu99*qIUeQ{2mxFoJ<6K!`!b51|E~bO{oc%jQ*Z=cD0+mi(C`MMT0y& -zDC-@3JN>5bmJk&HW~BF-+Jur!@-Eek-Yssfek=jz-{kztOH>tKV9wm-0h^W%l+UX#F1wq)~lB}t= -z?q*_bk5um3PfOJ!l*tAZcCqlvt&{XP5Vt*Dr5W_LD%_^7-s -zYA0b$eB?hfI~#Po8zht-#UVXAX*l`+i-JObQMW$o3SDZ)@RXJgyF8tlnI4wEi5^(n`yI&J!$OQ-?PPl&1onO?v7%w5DiNX?gHkZcFcyYdis#Jjc`uhBPF|)X_QRaG8pMk^SK6`ZccI4)=xw!1i -zgz-@$tZ{jd87k=-{S*C-SaKmZ^VjTRn9Nd6`EXgh;Hf}{FzM?g -zQ=$AGrF&jWLqkLJmzUVp0jp1^ai;^}eU!p4jI0J`f~*5HOc;F&IvYRsG4^m0jOL)A -zRzwL2I@pk)gCw~u#t2+~&tc|m;!H{Xgt0<{7d8$V3HA3}_jk8s!>{#C0KRMe=h{zV#)M?A0%Nm -zm&YzUE+WEh_9|U*&NO~Ke{@A2%}T>8i@f`pnt(gyG%PBKrhY_T+BHC6WcqEx{7A;z -z!JzAw{%qkFuVfj$UR0DNoQpDo@6guWeIeL7$5@_ViJ7L@QfuK_9?h7|m7Sum|1xw| -zSCZ@QKgM4sg>jwMZc%F86Au{a1L|LVn>HC*+q0CCx?6qOepVeaq2!F04`EgE@DOH= -ztoPuL5&g(SFdDs-{<=h^^5jAm+JafPKiMVei8_xQmkNmgH48Lsw>#-wc@0Jer -zmJP=mO)18Ia~P(_NLrvl{q-J=*5!rwdg<}h<>eh$R%X@^HdC(F{oR=Z*%>B3L3VE= -z*f^ymXhlBDyly0ag~=I<7}SRt|^E{(nylbLBVkn|D0 -zj%fwa9nNK)bt=O*@!_fHIRECsLEasi83=a>2*d&wwy@At#D6?cQct0p1dtrO6D)D& -ztMQTMk9MI>yywmJyhdg#D~fN|%#VmACR!=EVLDieC+0uZ5(H5CpM>|;SqpFnC>g0) -V_ay9mdAsWcG*q;qwMtfz{|8C@VfFw3 - -literal 0 -HcmV?d00001 - -diff --git a/addons/screensaver.gles.warp/addon.xml b/addons/screensaver.gles.warp/addon.xml -new file mode 100644 -index 0000000..b39c5f6 ---- /dev/null -+++ b/addons/screensaver.gles.warp/addon.xml -@@ -0,0 +1,119 @@ -+ -+ -+ -+ -+ -+ -+ -+ Omtrent so psigedelies soos sluimerskerm kan kom -+ حول الحصول على مهدء كشاشة التوقف -+ Падобны на псіхадэлічны ахоўнік экрану -+ Колкото халюциногенен може да бъде един скрийнсейвър -+ Quant al més psicodèlic dels estalvis de pantalla -+ Nejdivočejší šetřič obrazovky všech dob -+ Mor seicadelig ag y mae modd bod -+ Omtrent så psykedelisk som en pauseskærm kan blive. -+ So psychedelisch wie ein Bildschirmschoner nur sein kann -+ Όσο πιο ψυχεδελική μπορεί να είναι μία προφύλαξη οθόνης -+ Screenbending screensaver -+ About as psychedelic as screensavers get -+ About as psychedelic as screensavers get -+ About as psychedelic as screensavers get -+ El más psicodélico de los salvapantallas -+ Tan psicodélico como un protector de pantalla pueda serlo -+ Tan psicodélico como cualquier protector de pantalla debería -+ Nii psühhedeelne kui üks ekraanisäästja olla saab -+ Pantaila-babesleetatik psikodelikoena -+ Mahdollisesti kaikkein psykedeelisin näytönsäästäjä -+ Difficilement plus psychédélique comme économiseur d'écran -+ Il y a pas d'économiseur d'écran plus psychédélique -+ Máis ou menos tan psicodélico como o pode ser un protector de pantalla -+ זהו שומר המסך הפסיכדלי ביותר שיכול להיות -+ Psihodeličan koliko čuvar zaslona može biti -+ A legpszihedelikusabb képernyővédő -+ Sepsikedelik mungkin dari sebuah screensaver -+ Eins geggjuð og skjáhvíla getur orðið -+ Quanto di più psichedelico possa essere un salvaschermo -+ スクリーンセーバーはここまでサイケになれる -+ 싸이키델릭 화면보호기 -+ Psihodelinė užsklanda nunešanti stoga -+ Cik nu vien psihodēlisks ekrānsaudzētājs var būt -+ Најпсиходелична заштита на екран -+ Een meer psychedelische schermbeveiliging vindt u niet -+ Så psykadelisk som en skjermsparer kan bli -+ Tak psychodeliczny jak tylko się da -+ Um protector de ecrã mais psicadélico do que este? Impossível. -+ Protetor de Tela Psicodélico -+ Un protector ecran cât se poate de năucitor -+ Самая психоделическая в мире заставка -+ Ungefär så psykedelisk som en skärmsläckare kan bli -+ Tak psychodelický ako to len ide -+ Najbolj psihadelični ohranjevalnik zaslona -+ Ungefär så psykedelisk som en skärmsläckare kan bli -+ Дар тамоми ҷаҳон ин пардаи экран аз ҳама беҳтарин аст -+ İnsanı hayallere sürükleyen bir ekran koruyucu -+ Настільки психоделічна наскільки можливо для заставки -+ Tạo ra ảo giác mạnh nhất mà trình bảo vệ màn hình có thể có được -+ 最具迷幻效果的屏幕保护程序 -+ 最具夢幻效果的螢幕保護程式 -+ Die is omtrent so psigedelies soos sluimerskerm kan kom. mogumbo het gedink sy Plasma beskermer was heel voor in die koor, maar die een sal jou maag selfs meer laat draai. Jy beter een van daardie vlug siekte sakke kry voor jy te lank na hierdie een staar. -+ هذا حول الحصول على مهدء كشاشة التوقف. اعتقد موغمبو أن شاشة توقف البلازمة خاصته في قمة الجدول, لكن هذا مقرف أكثر. الأفضل أن تجد أحد أكياس الغثيان قبل أن تنظر لهذا لوقت طويل. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ Точно колкото може един скрийнсейвър. mogumbo смяташе, че неговият "Plasma saver" е върхът, но този е по-смущаващ. Препоръчвам Ви да вземете една торбичка/леген, преди да зазяпате в скрийнсейвъра по-дълго отколкото трябва. -+ Aquest és probablement el més psicodèlic dels estalvis de pantalla. mogumbo va pensar que el seu estalvi Plasma estava al capdamunt, però aquest és més nauseabund. Serà millor que agafis una bossa per als marejos si has d'estar molta estona mirant-lo. -+ Asi nejdivočejší šetřič obrazovky všech dob. Použití plazmového šetřiče bývalo vrcholem, ale tento spořič je ještě více zneklidňující. Připravte si pytlíky na zvracení pokud se jej rozhodnete sledovat příliš dlouho. -+ Mor seicadelig ag y mae modd bod. Roedd mogumbo'n meddwl fod ei arbedwr Plasma ar frig y rhestr, ond mae hwn hyd yn oed yn fwy troëdig. Gwell dod o hyd i fag salwch cyn edrych ar hwn yn rhy hir. -+ Dette er omtrent så psykedelisk som en pauseskærm kan blive. Mogumbo troede hans Plasma-pauseskærm var i toppen af skalaen, men denne er endnu mere kvalmende. Du må hellere finde en papirpose, inden du kigger alt for længe på denne. -+ In etwa so ​​psychedelisch wie ein Bildschirmschoner nur sein kann. mogumbo dachte, sein Plasma-Bildschirmschoner wäre bereits abstoßend, aber dieser hier ist noch verabscheuenswürdiger. Kram' besser schon mal eine Kotztüte hervor, bevor Du diesen Bildschirmschoner zu lange anstarrst. -+ Αυτή είναι η πιο ψυχεδελική προφύλαξη οθόνης που υπάρχει. Ο mogumbo νόμιζε ότι η Plasma προφ. οθόνης του ήταν η κορυφαία, αλλά αυτή είναι ακόμα πιο μπερδεμένη. Καλύτερα να βρείτε μία από εκείνες τις σακούλες για τη ναυτία προτού την κοιτάξετε για πολλή ώρα. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ Este es probablemente el más psicodélico de los salvapantallas. Mogumbo -el autor- pensó que su protector 'Plasma' estaba en lo más alto, pero éste es más repugnante. Será mejor que cojas una bolsa para los mareos si vas a estar mucho tiempo viéndolo. -+ Este es probablemente el más psicodélico de los protectores de pantalla. mogumbo pensó que su protector de Plasma estaba en lo mas alto, pero éste es más repugnante. Será mejor que busques una bolsa para los mareos si vas a estar mucho tiempo viéndolo. -+ Esto es tan psicodélico como un protector de pantalla debe ser, mogumbo pensó que su protector Plasma estaba en la cima del mundo, pero éste es aún más nauseabundo. Deberías conseguir una bolsa para mareos antes de quedarte observando por mucho tiempo. -+ See on nii psühhedeelne kui üks ekraanisäästja olla saab. mogumbo arvas, et tema Plasma säästja oli tippude tipp, aga see on isegi rohkem iiveldama ajav. Parem otsi endale üks neist lennuki oksekottidest enne kui liiga kauaks seda siin vaatama jääd. -+ Hau ziurrenik inoiz sortu den pantaila-babesle psikodelikoena da. Mogunbo sortzaileak bere Plasma babeslea garaiena zuela uste zuen baina hau oraindik nazkagarriago da. Ikusten denbora asko egon behar bazara hobe zorabiorako poltsa bat edukitzea. -+ Tämä on mahdollisesti niin psykedeelinen kuin vain näytönsäästäjä voi olla. mogumbo luuli, että hänen Plasma-näytönäästäjänsä oli asteikon huipulla, mutta tämä ohittaa senkin. Oksennuspussin hakeminen on suositeltavaa ennen pitkäaikaista tuijottamista. -+ En terme d'économiseur, on fait difficilement plus psychédélique. Mogumbo pensait son économiseur Plasma tout en haut de l'échelle mais, celui-ci donne encore plus la nausée. Mieux vaut se munir d'un de ces sachets pour le mal de l'air avant de le regarder trop longtemps. -+ On fait difficilement plus psychédélique comme économiseur d'écran. mogumbo pensait que son économiseur Plasma était tout en haut de l'échelle mais, celui-ci donne encore plus la nausée. Vous devriez trouver un de ces sacs pour le mal de l'air avant de le fixer trop longtemps. -+ Este é máis ou menos tan psicodélico como pode selo un protector de pantalla. mogumbo pensou que o seu protector de pantalla Plasma era do mello, pero este é aínda máis mareante. Será mellor que colla unha bolsa contra o mareo antes de quedar pampo mirando para el. -+ זהו שומר מסך הכי פסיכדלי שניתן להיות. mogumbo חשב ששומר מסך הפלזמה שלו הגיע לראש הטבלה, אך שומר זה יגרום לתחושת סחרחורת גדולה יותר. מוטב להצטייד במספר שקיות הקאה בטרם בהיה ממושכת. -+ Psihodeličan koliko čuvar zaslona može biti. Mogumbo kroz svoj plazma čuvar zaslona je bio vrh, ali od ovog vam je još više loše. Bilo bi vam bolje da pronađete jednu od onih vrećica za mučninu što dijele u avionima prije nego počnete zuriti u ovaj. -+ Ez a legpszihedelikusabb képernyővédő. mogumbo úgy gondolta, hogy a Plasma képernyővédő van a lista tetején,de ez még inkább kábító. Jobb ha keresel egy légibetegség zacskót mielőtt túl sokáig néznéd a képernyőt. -+ Ini adalah sepsikedelik mungkin dari sebuah screensaver. mogumbo mengira Plasma savernya berada di puncak, Tapi ini bahkan lebih memabukkan. Anda sebaiknya mencari kantung mabuk terlebih dahulu sebelum menatapnya terlalu lama. -+ Þetta er líklega eins geggjað og skjáhvílur geta orðið. mogumbo hélt að Plasma skjáhvílan væri á toppnum, en þessi gerir þig meira flökurt. Best fyrir þig að redda þér ælupoka áður en þú starir á þetta í einhvern tíma. -+ Questo è quanto di più psichedelico possa essere un salvaschermo. mogumbo pensava che il suo salvaschermo 'Plasma' fosse al massimo della psichedelicità, ma questo è anche più nauseante. Faresti meglio a cercare uno di quei sacchetti per il mal d'aria prima di fissarlo troppo a lungo. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ 싸이키델릭한 화면보호기입니다. 거의 토나올 정도의 화면보호기로 오래 쳐다보려면 봉투를 준비하는것이 좋을겁니다. -+ Tai stogą nunešanti psichodelinė užsklanda. Mogumbo galvojo, kad jo Plasma užsklandos niekas neperšoks, tačiau ši užsklanda tai kažkas tokio. Geriau susiraskite vieną iš tų lėktuvo maišelių, jei supykintų, prieš spoksant į tai per ilgai.. -+ Ekrānsaudzētājs nevarētu būt vēl vairāk psihodēlisks. mogumbo domāja, ka viņa "Plasma saver" bija saraksta augšgalā, bet šis ir vēl šķebinošāks. Labāk apsēdies un sameklē kādu maisņu nelabai dūšai pirms skaties šo pārāk ilgi. -+ This is about as psychedelic as screensavers get. mogumbo thought his Plasma saver was at the top of the scale, but this one is even more nauseating. You'd better find one of those air sickness bags before you stare at this one for too long. -+ Ongetwijfeld de meest psychedelische screensaver. mogumbo dacht dat zijn Plasmascreensaver al bovenaan deze lijst stond, maar deze is nóg meer misselijkmakend. Houd uw braakzakje bij de hand, mocht u hier te lang naar staren. -+ Dette er så psykadelisk som en skjermsparer kan bli. Mogumbo trodde hans Plasma skjermsparer var på toppen av skalaen, men denne er enda mer kvalmende. Du bør skaffe deg en sånn spypose som de deler ut på fly før du stirrer på denne for lenge. -+ Tak psychodeliczny wygaszacz jak tylko się da. Lepiej zaopatrz się w worki na chorobę lokomocyjną. -+ Provavelmente o protector de ecrã mais psicadélico de sempre. O autor, mogumbo, julgava que a sua proteção 'Plasma' estava no topo da escala, mas este é ainda mais repugnante. É melhor encontrar um desses sacos de enjoo antes de ficar pregado nele durante muito tempo. -+ Esta é provavelmente a proteção de tela mais psicodélica de todos os tempos. O mogumbo, pensou que a sua proteção de tela 'Plasma' estava no topo da escala de proteções nauseantes mas esta parece ainda pior. Procure um saco de enjoo e sente-se, se vai ficar muito tempo a olhar para a tela. -+ Acesta este un screensaver cât se poate de năucitor. mogumbo credea că screensaverul creat de el, Plasma este pe primul loc, dar acest screensaver este și mai amețitor. Ar trebui să căutați o pungă să nu vi se facă rău înainte de a vă uita la acesta prea mult. -+ Самая психоделическая в мире заставка. mogumbo считал, что никто не сможет достичь эффекта его заставки Plasma, но от этой заставки укачивает ещё сильнее. Если будете смотреть на эту заставку слишком долго, вам очень скоро понадобится гигиенический пакет. -+ Det här är ungefär så psykedelisk skärmsläckare kan bli. mogumbo trodde hans plasma-skärmsläckare var toppen på skalan, men denna är till och med ännu mer kväljande. Du gör bäst i att leta upp en åksjukepåse innan du stirrar på denna för länge. -+ Tento šetrič je tak psychodelický ako to len ide. Mogumbo myslel, že Plasma šetrič je na vrchole rebríčka, ale tento je ešte viac zvrátený. Radšej si nájdite hygienické vrecko skôr než naň budete civieť pridlho. -+ Težko bi si zamislili bolj psihadeličen ohranjevalnik zaslona. mogumbo je menil, da je njegov ohranjevalnik Plasma na vrhu, to da ta še bolj vzbuja slabost. Bolje, da najdete eno izmed tistih vrečk za bruhanje, preden predolgo strmite vanj. -+ Detta är ungefär så psykedelisk som en skärmsläckare kan bli. mogumbo trodde att hans Plasma Saver var toppen på skalan, men denna gör dig ännu mer illamående. Det är nog bäst att du letar upp en påse för flygsjuka innan du sätter dig ned och stirrar på denna för länge. -+ Дар тамоми ҷаҳон ин пардаи экран аз ҳама беҳтарин буда дар рейтинги пардаҳои экран ҷои якумро бо пардаи плазмаи худ гирифт. Вақте ки истифодаи ин пардаи экранро сар мекунед, аз истифодаи он ҳеҷ гоҳ рад намекунед. -+ Bu, insanı hayallere sürükleyen bir ekran koruyucudur. mogumbo kendisine ait bu Plazma ekran koruyucunun skalanın en üstünde olduğunu düşünüyor, ancak daha ziyade insanın içini kaldırıyor. Bu ekran koruyucuyu uzun süre seyretmeden önce mide bulantınız için gerekli önlemleri almanız iyi olur. -+ Сама психоделічна в світі заставка. mogumbo вважав, що ніхто не зможе досягти ефекту його заставки плазми, але від цієї заставки заколисує ще сильніше. Якщо будете дивитися на цю заставку занадто довго, вам дуже скоро знадобиться гігієнічний пакет. -+ Chú trọng để tạo ra ảo giác mạnh nhất mà trình bảo vệ màn hình có thể có được. Mogumbo từng nghĩ trình bảo vệ Plasma của mình đã đỉnh, nhưng trình này còn kinh khủng hơn. Tốt hơn hết là bạn nên chuẩn bị một túi chống nôn cho mình trước khi bắt đầu nhìn vào nó quá lâu -+ 这大概是最具迷幻效果的屏幕保护程序了。mogumbo 以为他的 Plasma 屏保已经是数一数二了,但这个更令人犯晕。如果你要长时间盯视它最好先准备一个晕机袋。 -+ 這大概是最具夢幻效果的屏幕保護程序了。 mogumbo以為他的電漿螢幕保護程式已經是數一數二了,但這個更令人頭昏腦脹。如果你要長時間盯視它最好先準備一個夠用的暈機嘔吐袋。 -+ all -+ -+ -diff --git a/addons/screensaver.gles.warp/icon.png b/addons/screensaver.gles.warp/icon.png -new file mode 100644 -index 0000000000000000000000000000000000000000..cc2beea958a46bf3d9ecec1a3205be641b1b4555 -GIT binary patch -literal 9424 -zcmdUVRajg>v+ZCL1`qBG5+EeN;6Voq9$bSvK?4MLCj@tw5Znd{gy8NLY;bpXhco|q -zyASui+?R8ndVhO&clB4jt7_G%`mU@fjg3K$0RRB7Wo0B)0RSY#BN6}|88J-aK{*fu -z*|(3{-_#r|zPTAYnFGYk98Ao?vUbLn=Bnn#W*&|M=0X4fgOjYJn7aG?p*~1keWx+o -z_$yNAn@?RVR-&Jhkd9k=Dag*%qvRy>ne7NwRlFwsuQd~DQW>rFem1b=axg|&C1)5- -z)s?J9AjQw`fbwOnope4$<_6N)m}#gOAA5~Loj;6XK~S)`+HVS}!knKka{MfoZyuIU -zpczvOmUY3Rq@}RDDt}RAFrEwm6&d6&3P!?1X8<4vpo)TH0qCgsfPnwWAOBzHhR7Jp -z8+HIfK37;c{8D}EL&4xLHhRvMyx~Ja4)%xz09iJ!=Gfm)=)8gH@zv -zQO^fKtc@hqXzMzx(@YJpPVkj176ZU0uQhe%{^X6&G!OgZd3!s6N0*_;FaGfnIeH{= -zhYEGJRN@z2kO}Fa92iME@&0qok8!rggZ=&e?QLRG!rkNEj-{-Jh69m|j0|}>xl=}V -z_O`}?#=2jGR$sov&CB%cDqu+{gH#=ICb~b$tG2bY=(}q)G>NQ}qoc01i9%YHT(xv` -zKpLW$Xm@vdmAiOBQNDqs*8dR}d5?U7G%HOF(gZ@O$oF@4ERQ)hx3;!Q)zR+I3R2|r -zkQ7mQLz5tcW}?V2@YTZUN#a{2$@hAsgoINs5~bzkswGYr=NDsHf<;xR)#NgOU=e0# -zmtv^%cI57^)y=W34-}9jK^&Xqb9Zho2BPvDPo4=<1u+0>YYmI-#XK$C%fs&P`PXFb -z<1!C3lXV+xZMo^jl@JpGL5G&z4jUyeyZNU01o-zIyEphbj(6au++2UHfT(C5as^H> -zQtIqAEOupP#=^m}!EC^Rj*iZAt~NhE|G87Q!QPm}=lQLioLn@e?AXA-Ys$DNgGL2p -zFlnXRoVQ5dQ++*0Oth?w45^LD>Z{qK!^6X)qcB{WXstAbnIpzepFRywHq_TIxB5_Y -z?h+U#CSR+#y5i(uaT_gL;U)Gn0G!i&X|KmJIZU?(iJTf2Q%5>nNJvPOX{t;ED0Gq{`VxwZ2$4Nb{)+dI<$>zZH^cypFiLW>*^5m#jxjr%gxL`RdIYoZn-g;J6 -z#T*MF!xCV7A0J`nAI!_9>vUg4U803@F=SrrPhad-8zMBWATK{OaHsb!07s2mlTgLYDJib2qGDosBcg0rG5{Y&K*!}m6lK~J)q}BoZzLHCacA=4AIJO@V2dR`(tHpp -zxNSLdt+u>;s-=V~B;b0yLsS-x)6$aUr-LDJtDRj{^LY`Qq8(t(+sCJ+xf$=O%Af^f -z`|3U52LI-GNuo2LsBbw>%FWG9(>He?Qj$~c>+8HT+A=xsnRgqw{dlOzHbaYqWpQm2 -z2sOM?%n@n%@#g_<8WTmyUsGOwIRD#*IIk6_{dRtSetUcSHN8}OJS|gQeSJDNWV3o8 -zf$3dR$H$%?=+k9F>a%LuEC7@n10TD93VHjQnVFGX2yOI61x@~OKQob+|DoZ72gy$A -zDPC%6X^F#zcbA|FdFJOoh1YPtmX^scUHLTLRuCB7t(XtaiHm -zbiJBdvX+jQ9Q^r!8F|Y|Lt6y}1yNB^DB|!{pHH8#dn4mEP|_2tVAGR%dGCqZ<*Pm6 -z)<<}tTy~6=>w2x{%c5%2KG$B~TMRh0&DTdpAJKlIZ0hCS>1m>P$d?G>5~F_`F(f2J -zE024HJPWk=qE*bDaHwiF4hK!OVDY)3AsaZ%n6Us^lL#!k{bZOu -zJ&#zx-q|+u_&D}r%VXuMd=*W~v3|Zaq-k>>)!pKCW53)CLi*Fxl<}De6%7py2;AJ> -z{#-=$(<|s&52+jwuK(KRRFY3xTKYrSJFQBrblfO)Wdj2?5#s@OZ12m7Fbuz!`iDgY -z$EIx@fVE9HW+IZOq;Fzd^PLJaVVhy&zxG*{guB~Yy}#eSxN -zg~ifJNJwDM(++JT;fpGDLHRD`vhipvPq*K+wzis^o8O$Q&?FiHC?~Q6-HgsY3EM`h -zuO2+?@~wDxEzp+mSRt;k?6i$r;B#A4QIVyoY5s4j{r!uR4)tp;Fo#pEL{AT&!!tu` -zetrSBD39pazM&bw1g@#?Jp%cCAWOwq23B!AMvX8N&Zq+c@SA -z2dC -z5FMn#%fqAp=d|Va@1XCsI0Hbf1=nq0h#vZK_k+E)cm?QU9K&8qo}Mb?QBzh{CRb3C -z2;4m$XS4y#d9HP$-P_Rk-mcBhf4)yvKx?w_+!@s;SF<;r%pnIOU5cU{0jr#)kL0(D -z8pva>8-V@DX@`E*wlWZg^U?+F7+uo8DIq3&9tkLzn7DSmeu_nv0WkK1waLm){C0;p -z5?+6<+2pf6`i5r?z^u)Y6@9S}JB-)4j~EUJ4@dX%^7@_j9|5~q@|g>1IA3J8EHfOLzf|!T#HLf-ZWQlFwGpvzG9#= -zyqJQ($LLdhVL%yx6a&(;pO_c}0JA+R!>y3Ky@q_(3?qCTH&*b2%&-S@BeotaD-&Gs#KL!Hbo#3EuqGb(Zk0ESmuS{i&{Dgz)M1bjmucIqD+<2%4E -zkOeG}04ggh5wGa_hla{ZD&wrh$l5tMbLj!e;`0G0sz>>|1IRi*0m^DfMjV^lrEs-B -zjeX-8N5~%dqAB>R>?pkML_!_qf7Dgu?MG3<&l-E=pI?~fIdc~gf}u^Ou-0a%qNCI3I9Z6W-a#`?;+K)Xf(uBJ -zZnfFOKSo1N{%$bh?O(^@;fub|va>r(7LMp0S{^oVINUZ!A(0APDP1H#nc|S`E`}+% -zKbEw#2xlQrIn?ju*VW}q$IQd~ZOu7Lj9$WIfOr=M3g0HmEHp!*{1py+>=TQre>Uzy -z4#^;=&<@EF-*!tKomc;Grlw~4&FXpS_HVi>UfWd!-iX~ -zCZo!?;{Q!^MfuV}aBwu|!dxjj9^eZ%CVz8`9; -zzlxRQdZoxD41e1p)0I%Bir95}YAW!ezP?`QOi)OvZHZcc|A=c|_0TW&BJ%b~txy4J -zBOJ(N*MD_M@PqUEZe5hMgFTGZ*p$y8?JVg -zW{1hd3`}A+^eiH4VKJ=&)w4F-n}tMuR*8BR7Pf!H;9&;GBGB2FP=e4L8n+Suj#pu? -zot$5vjcxDjXw9nED!+(MrO4cmTxc5rkRRr{>Jj*dIG8;=T-(a7FQcZWw$bB5ngY7w -zI*3^_ed_5_%}!rG3{rO!Biakr0K-!f6SIZO2FKXPsYj7d!eo13lvk{#0g{KW?iLVG -zpw_Vq_)ciHrl!Vv?%cedc}Nl&^1-s;W(TEK1E|rVpgx8{VI%dO7@-}Le>QER`ZMzH -zpHgq1M*(zWV-tS8YFzjP1mzbE>LpH%bLbTk)7TV0>48$E>xwouDvpkpjDsB=%VQ4Z -z!AsvNFwOjNcAQ^Y -z+d85AZwIXXR(E#`TwGi@brm6*&t}GEV{{}N7sZ%cT?&03 -zh&vf-AdZn}8XD8AtgKXeDMDWfLte&2{Ym`1G&{X8%>ZYaFR);( -zqbCf1yg{D8-j1jYp-t|auHn1}Hg=shu&81>>+DlgGEYIYI`4?H`|*Q{46W1b1cx=f -z(@YwWmgi+0I_R|X{n0QxEA9y8D<6OFO~>_DYD|PcA``>JenV2;?8O1FIGbw6rdfw7 -z($11AkQfdLYsYo+W)AJ0Yn-_gzWLnik{`-RllJ!Kr&x0&%}EV<`4b-#!$g^H%RR0) -zWIX>SLUC10Mh_s7W-($Omr|_4)C1tvzi-gS&la?wgk3rRaoOGv@EiiEN51!~z>`SmZVCA0_X3%@AwZx`jFZWK|7?f7DUdsr3H>F%kwOsW -z;VFX1NQBp0@Sg7y2u8dp0!7LT!&^~g0iVgfcH@usH~hIcJ3TEfF2)P-tGL(;ep*-4 -zrfIg%^J?ACxvgj$W?ueb;1XT#f@unr;_=ss!jrCQZuUNF?B3{$q2Vx*^ziV2LcfkK -zEHqVCMz>h5t;{615&lj%U2%kKdPNngWJf!Uke6H)qAGk1`KfPHX+*5w_nw0ro29is -zDoU(^k1KC7`!|^Y4(x>s;O6wn)wTWumY{$D4vh$9y!-81*n=GdoWzw?Mv>y#P5|?T -zYIdNZ!OO#=ljnEC?}06+<6rh8lR^t<;kaH6m=xAy$Wz%E{a545Y|Hxrc7l~S_($n> -zC1n0qZu7>l5IX|K$H1shlU4Pv99OJcxp?uFl$5ga5&***D1a1pLt;I=mnWNS9$|}N -zQWBDs=j!L%fjDP)jvv%1*zF}N)Q^LH%PH)zyqwSVC>>(lIcw;1by(#$lFDV=+5Me> -zado6OilVu>8P!!W?Y#TSW~(#jq~*pyZ;^&-^PHx&4Q4Z2SzrHPcXP5q@ikFUkC`pI -z{ieN`nq1&uQ71{87JTr4n15K?*6L9!!XzjU=UMm_b>cl+nML5sLCYlgaFXL2kylf3 -z`ZBIl%SK2dMx=laN0y(seY#oc62A<^-Rf_kQ8nmCCiBlS@?a3w*Vfk8XKfAxwkta8 -zzD(pxYiVdKwRmZD(%e7Yw)asbK(m_sVmJ22#~oUq|H5F(CF;IsJv&=l=1p#G)dx}f -z+8VJr&^PXbQ4t5&*x2Te{6gBPSy^awqp2JOCsb5hXO51>wU$hb3}(M*99>-}|1m#2R!IF9c|4P7)DS%-;i54Xwf!S4$Ulo2G<=WhdWpM_S^B`t -zdNgyStG^f`6&|h_eI6X_j;B>|b&>ntAS)~L!@7U~n?W7A-@Vf1?7!j`ST3GCF{{C5 -z@JAds5IGF9-JEicL -zzR#ybW#bkP(Nyp+fHwa7j(P&7ds8jA*XDYUoH;r$XzOBo4Ek*s5_-S(;_ENWZgBbD -z0GCRD+w1zUC6dHREWfN -zL_-EdyGeSd1AH%?ji>Zgw*2w^hiffuT^2t@@?+CJ6IA% -ziHcze1HZSuUjO(*g`K{&QnvxeJ1XjX$HRF|P03_ol}>GM-vUKerjU#Ea`Rn35qsNX -zO@6{;z1>1JhU5L_0734~_0dAL)~T1Y>OVvxH$e-hp=!C@;<15H+df|}I0Q5oDQ1at -zitX$&2?;Is^-(zZ-VK%XQ&%%K9{so8R>sRgWm -z%0D{Xf=Ta6)Y5EbD}o}3&o~RQjCvW`cK|wKVzlv`x&|sLjt4WW)zYujMml__TKk2> -zJ3TBNO52~0ah^(ND|BO4JrCg=5PVcSE2~WIy|c-*B7MC~vB{~aDRyV)7z;Chz*qF* -z8}HV;H-saogmf;>$=x%c<)4$v1Rlbm<;Y7!5&px&!@Z%QusP!u-v?IGm|_2A1c-~K -z5d?k?x?gCpb8~X-q^>4@)VzI2NlG!cm5#9hcZu>wVMocQuu5!H=+;w;c;6-{;izF7 -zJ*R=6<;oHh3AMl0-|kPB3Dk1Gm%d?rIP2o$;Q?*$3?>cn&SwyO;{&}7D7#(@Bg6yX -z{%oi73qkH^%4R5bO!8D!5rs -zgf{wi_n9f_FNk|M?2yIUUk{6-lBPvmt5Xk>!921>6bQudLo)|lWPr0>AS<%61GfB} -z{t(u#)&2c>ErR^WCq&E-oE4|Oz1@fr9FBQi1Z|gx0O@UMpuV<1`r6+gL$-bQox5Foh^ce8MfRgj`<~rGgTq2S_UNl1|k9lDlWtz06w-@x8(41NYmAJUWTPZf&NG^BgC7fl>8#Mev!n?QQ -z4~~wGN@1Z9X)N|wZETd4`*WGNft2@>t8MOQbh_bnwN6_nHV6CgPufka0J!oN4o(W& -z6SKi@Q)&EN^yL^TKAe%&+O>^@+`UagUtU?CvoM-JonUVyEl_u_?b2Tjcyfqc>aE-I -z+>cbB(~X!Aja4>oM(&^u1o!BA2v>m-T7QLnf;|AQV+3tQ;EA7$Tru -zp!&wqTPg1Rj2abrLWPXJTh6_!*7NFz)!mG)7oJTTrey{_g+h*qPe)(~99H}XeVtGf -z$q&I~_Xq|~zkZr4=KuR{nsQ@nvak*YlUYQuti!;-+qhfr4ILN-gNvfuqYIAM*dD|I6V(1N831HE3Ib9X&{cIVzu$4EF-$!^F!mdZK -z&W(@R2^}0<&j;ntK@|~K9%mm@g7CP_x&3ae-Gd$`OiWEbclfX|1?#jZ9 -zGQ{-Uw&n3jg(QdiK$7PGyFaDXU?Hcv-5-~CEwyCNJ>(l;g -z%P-aQ5BGsiSwEN2eJ9HeR@LNoLM`BJ)fI|;dd8%by(#2ltYU4=viKMQ*VYDCTF1+Y -zysXm<$jXj)MgRJR3w?y}^75Lji5s^Y`rd6FFEyPkH@(}!wF^3?mx^q62Q&1a819S- -z3JQLdloUm=`abBjP=A!$nvt;}=ymhcZ!Ou~EMV9^m=qT;rtNaz~O;(NJto#B$iQ_an{ZKnUJZU -z#^Gnx92`bM>qR%kDt_9((?5M+xdlKuwv7npysYfqp@?R6AX0|m8m;Y*WnR1G_l2$B*FFtq))fj(FW2dl -zQ3`oo+m8M)+z2PiRrWtKH`iKNmKRCxUdRpNf6xz}0R$gOF>IW~G3 -zA7{~J35keIg|Cy+JTN>Qju#u<5h0uKmo)#6r{3;f|KF>^W*|S8ie^f6V36O-%F9SJ -zWHgJ*a!l9DogyE&*Wo@zTb$})*zJQ1=d!<6OVZU-kF>oWmtfn{W5QPWr@E#C3L;N# -zV~CFvb-v+AGegi^w|we?Z`D;)0)!x*msV#W@z{Pb6 -zT_GD%rCmHQ@HV^&OliW3Yy(pT`JFw#I>~4MkRU! -z0)ZcL6oazz59n_?N)n2U>SkL1*4Ndc{uFI61#a -z<6A}L;t+)JA#j;kRJFs32o`Bjhw{t)fMJI(7Q=qy4h-{f_i}GiFZ!s;3mI#IT+|R{ -z-cvm=0uL)&$b(bY>twkF!TrI=$ak+PX}M9ZstnuM*oa~^lwa5X{*4)91eti0(c#}6 -z$#Db_1X}%t&>@RaY&ZS>eWmrft+b@#W6;IUn3q>f=R6sgMdr)wU4?Fgzw^ONm7n9) -zK7y?wCMJrZ5G2;tY^BO6c6&j!RQ%JA#zH>r-xH>TG!kE^XPVesKckTp-`aGzZ -z$(PxbO1S4%hUNL7!B++S*}@LK -zXE9vL=--;W?`npJCm(Lwe$WUzIWo+IhJ-}b)e5>DQv%iW)VWPI!>7wMiAYG2PH%iE -zFnIhm&{vVLPuWRYU!JAR&6SOEjhyhB5e(^B#9@r5;*M|DsxW>J4=lI&aWqS?^L%^T -zg0TD*F7+ms=GaJ#D@ILqb@L;6#8OeVC&nm+WY_`VHT2<-D^Kf>hccOzRc~a`pojn0 -zzG!M^7iUD4(S7I8_OV4*O}ERr(v-pNv+i1AcDjhq%k$HU&kYsva?8U0;pQ)O7DMm7 -zg3pSqs@?*m)C|O_!o@f)=$V5B`Pr$dx@9{mekZfu2~*3_ -z%#NEN4yAPNy)9^qo}S+OEmT)x^WlPc{70S7o@Dal2+p&-q(tONhj?K_8PC6mI(Fg; -ziPLp;FD~arh?cgs?}j*RFYHUB_ZG&Ow+?$w3%y=8r}-d3qv7_kud^Hc5SCVJ5s)&E -zB6T>?sh1IadrM+sa62}Tur`W7uNszPUnrNZY+{~FkZ)NEN#>O@KdjyDp;)A>`#x=xh -zBlQ;*)te+I`B;1%92`Cn4+L>fe_5HEv;Fy0158J;vF-w;p&HR*7k^A4onKfO$>irU -zF_vs-NR*g@#%GTfvkUnbRjsFuUOY0aXMlfvDC!cT`YHdhW}KEy>&q@yd<8yn1RExA -zyUNo@)9&DIKKFkgm(V`MGW_?0$UX%rDIO^ygWFf5nee6J*3wdps?*=FPE}_Sk3l2t -zqr)>q1_j<*k9bi0yT862rtemHae0y_b&T{LAZs}mJ0&8haRZLp)xnxM-F(|A8gR8t -zuHs#^{wn9qga&DSJd@IEL?!M$%F(xGl?FM+eFETjfWQDyqU9Ss7Aq3o5Xd4B+XwCc -zs~VqIwYIza$8jU{;^iLrA}_1ho3s8K!M^l$a=qLl+r-d7dF|%a-$%y8WbmDkJ>m|9 -zNUzKO5xi0q_;zYqH>G2*fHK2$Z;1_KfBZ5Go?uFbX}~qzv5uWpR321s_UpRwo5}e} -zpKz`4ZNKZHAXD(!lD@!iZ-avi3oTBS+{fRTLP?zw#ki;pUgL_QBI%E4Zc2B3y)mz< -z3qNIfK6Zci%Yw2O&bInIB&fOmH22n{BzD4e@rm`z;t|b>xtQw4Kg7K3X@@mkc)#dl -z;ZqniyPvJ*Nkm6G#S%58@7LwZ7=u?6vgD>4%t2u%uUi=ySJ3z{)LLZ#B -zbMT+3r`9zp3hOTf$GEyE%u-$bmo{LD_w@ACXff#& -zw^l%8kC}PMb)pB1dmhtgwpuUX8W~4D!eYOe%IlI22H@QfLth5&Ph27QG_k0V4*@Hr -zZ9Y9w7~}GkI7&&WY>OA2yCZr-rHN7xB~a= -zg@oAIZ&GL5u6^HNGBGh|7q>;$SRLsI3X7ysaDXczlS0CkWE5l-1N*EZY~$HOnIz0&Lf&SkY+6&g(1uSt}M;13QQCQt(-G5?Qg@ -z_Q;_p5@Z4jofu1%fD*N$L3pbe&VrLgp9m=8J;sK){z-FWOl$y!DK_1guhBtb(46+& -zd~9n_<=l4ypAV$??O-JOSMRvb?z?(uf;GZ$sCql$siaX2p^evm#UG4e?`A$wQ@;^W++}@ZUUY`oNoEt3lmg3PnJW{RIuQ56mO=(MDEK!;Ob+Br -zT}#;2GIdriG~_22$kZAoYcH3L+-)KERZy_Fa!tm(u>(*7(OOar{J*rt{O@Uy`9Irv -fB&c85+X3$}Uc> - - -@@ -47,7 +47,6 @@ - Komandos Kodi Web sąsaja.(Kodi numatytoji žiniatinklio sąsaja) - Team Kodi tīmekļa saskarne. (Kodi noklusētā tīmekļa saskarne) - Веб интерфејс на Kodi тимот. (Kodi's подразбирачки веб интерфејс) -- Kodi багийн вэб интерфэйс. (Kodi-ийн үндсэн вэб интерфэйс) - Antaramuka Sesawang Pasukan-Kodi (antaramuka sesawang lalai Kodi) - Web interface ta' Team Kodi. (Il-Web interface normali ta' Kodi) - Team Kodi ဝက်ဘ် အသွင်အပြင် (Kodi ၏ မူရင် ဝက်ဘ် အသွင်အပြင်) -@@ -55,7 +54,7 @@ - Team Kodi Webinterface. (Kodi's standaard webinterface) - Interfejs webowy Kodi. (Domyślny) - Interface Web da Equipe Kodi. (interface web padrão do Kodi) -- Interface da Web da Team Kodi. (Interface da Web predefinida do Kodi) -+ Interface web da Team Kodi. (Interface web padrão do Kodi) - Interfață web Kodi. (interfață web implicită pentru Kodi) - Веб-интерфейс от разработчиков Kodi (веб-интерфейс Kodi по умолчанию). - Webové rozhranie tímu Kodi. (predvolené webové rozhranie pre Kodi) -@@ -98,7 +97,7 @@ - رابط استاندارد وب برای Kodi. قابل استفاده برای همه دستگاه ها و همه رزولوشن ها - Oletus WWW-käyttöliittymä Kodi:lle. Suunniteltu käytettäväksi kaiken kokoisilla laitteilla. - Interface Web par défaut de Kodi - Conçue pour les appareils de toutes résolutions -- Interface Web d'origine de Kodi ; adaptée aux appareils de toutes résolutions -+ Interface Web par défaut de Kodi ; adaptée aux appareils de toutes résolutions - Interface web predefinida para Kodi, deseñada para dispositivos de todas as resolucións - ממשק דפדפן ברירת המחדל עבור Kodi; מותאם למכשירים בעלי אבחנות שונות - Uobičajeno web sučelje za Kodi; Dizajnirano za uređaje svih razlučivosti -@@ -112,7 +111,6 @@ - Numatytoji Kodi Web sąsaja skirta visų rezoliucijų prietaisams - Noklusētā Kodi tīmekļa sakarne; Piemērota visu izšķirtspēju iekārtām - Подразбирачки веб интерфејс за Kodi; Дизајниран за уреди со сите резолуции -- Kod-ийн үндсэн вэб интерфэйс; Бүх төрлийн нарийвчлалтай төхөөрөмжид зориулагдсан. - Antaramuka sesawang lalai untuk Kodi; Direka untuk peranti pelbagai resolusi - Il-Web interface in-normali ta' Kodi; Iddiżinjata għal apparat ta' kull reżoluzzjoni - Kodi အတွက် မူရင်း ဝက်ဘ် အသွင်ပြင် ၊ စက်များ အားလုံး၏ resolutions အတွက် ရေးဆွဲထားသည်။ -@@ -120,7 +118,7 @@ - Standaard Kodi-webinterface; geschikt voor alle resoluties - Domyślny interfejs webowy Kodi; Zaprojektowany dla urządzeń o ekranach w dowolnej rozdzielczości - Interface web padrão para Kodi; Concebida para dispositivos de todas as resoluções -- Interface da Web ppredefinida do Kodi; Criada para dispositivos de todas as resoluções. -+ Interface web padrão do Kodi. Criada para dispositivos de todas as resoluções. - Interfață web implicită pentru Kodi, realizată de echipa Kodi pentru dispozitive cu orice rezoluție. - Веб-интерфейс Kodi по умолчанию. Разработан для устройств с любыми разрешениями. - Kodi' සඳහා නියත වෙබ් අතුරුමුහුණත; සෑම විභේදනයකම උපකරණ සඳහා නිර්මාණය කර ඇත -diff --git a/addons/webinterface.default/js/MediaLibrary.js b/addons/webinterface.default/js/MediaLibrary.js -index a5bbe72..211460b 100755 ---- a/addons/webinterface.default/js/MediaLibrary.js -+++ b/addons/webinterface.default/js/MediaLibrary.js -@@ -228,12 +228,12 @@ MediaLibrary.prototype = { - {'playerid': player, 'to': 'previous'} - ); - case 'forward': -- return this.rpcCall('Player.SetSpeed', -- {'playerid': player, 'speed': 'increment'} -+ return this.rpcCall('Player.Seek', -+ {'playerid': player, 'speed': 'smallforward'} - ); - case 'rewind': -- return this.rpcCall('Player.SetSpeed', -- {'playerid': player, 'speed': 'decrement'} -+ return this.rpcCall('Player.Seek', -+ {'playerid': player, 'speed': 'smallbackward'} - ); - } - } -diff --git a/appveyor.yml b/appveyor.yml -index 82d69fd..af6b01d 100644 ---- a/appveyor.yml -+++ b/appveyor.yml -@@ -6,12 +6,12 @@ environment: - CONFIG: Release - matrix: - - BUILD: Kodi -- # - ADDONS: adsp -- # - ADDONS: audiodecoder -- # - ADDONS: audioencoder -- # - ADDONS: pvr -- # - ADDONS: screensaver -- # - ADDONS: visualization -+ - ADDONS: adsp -+ - ADDONS: audiodecoder -+ - ADDONS: audioencoder -+ - ADDONS: pvr -+ - ADDONS: screensaver -+ - ADDONS: visualization - - install: - - SET PATH=C:\Program Files (x86)\CMake\bin;C:\msys64\bin;C:\msys64\usr\bin;%PATH% -diff --git a/codegenerator.mk b/codegenerator.mk -index 5f8bdd9..c020794 100644 ---- a/codegenerator.mk -+++ b/codegenerator.mk -@@ -47,11 +47,6 @@ $(GENDIR)/%.xml: %.i $(SWIG) $(JAVA) $(GENERATE_DEPS) - - codegenerated: $(SWIG) $(JAVA) $(GENERATED) $(GENERATED_JSON) $(GENERATED_ADDON_JSON) - --$(JAVA): -- @echo Java not found, it will be used if found after configure. -- @echo This is not necessarily an error. -- @false -- - $(SWIG): - @echo Swig not found, it will be used if found after configure. - @echo This is not necessarily an error. diff --git a/configure.ac b/configure.ac -index 45145b3..33dede8 100644 +index 8b330b0..f70ebb8 100644 --- a/configure.ac +++ b/configure.ac -@@ -172,6 +172,8 @@ missing_headers="Could not find some required headers. Please see the README for - missing_program="Could not find a required program. Please see the README for your platform." - alsa_disabled="== ALSA support disabled. ==" - dbus_disabled="== DBUS support disabled. ==" -+glesscreensavers_enabled="== GLES screensavers enabled. ==" -+glesscreensavers_disabled="== GLES screensavers disabled. ==" - x11_enabled="== X11 enabled. ==" - x11_disabled="== X11 disabled. ==" - pulse_not_found="== Could not find libpulse. PulseAudio support disabled. ==" -@@ -186,8 +188,12 @@ vaapi_not_found="== Could not find libva. VAAPI support disabled. ==" - vaapi_disabled="== VAAPI support manually disabled. ==" - openmax_disabled="== OpenMax support manually disabled. ==" - openmax_not_found="== Could not find OpenMax headers. OpenMax support disabled. ==" -+librtmp_not_found="== Could not find libRTMP. RTMP support disabled. ==" -+librtmp_disabled="== RTMP support disabled. ==" +@@ -190,6 +190,8 @@ librtmp_not_found="== Could not find libRTMP. RTMP support disabled. ==" + librtmp_disabled="== RTMP support disabled. ==" libnfs_not_found="== Could not find libnfs. NFS client support disabled. ==" libnfs_disabled="== NFS support disabled. ==" +libafpclient_not_found="== Could not find libafpclient. AFP client support disabled. ==" @@ -3756,7 +407,7 @@ index 45145b3..33dede8 100644 libshairplay_not_found="== Could not find libshairplay. ==" samba_disabled="== SAMBA support disabled. ==" libplist_not_found="== Could not find libplist. AirPlay support disabled. ==" -@@ -239,9 +245,9 @@ AC_ARG_WITH([platform], +@@ -241,9 +243,9 @@ AC_ARG_WITH([platform], AC_ARG_ENABLE([optimizations], [AS_HELP_STRING([--enable-optimizations], @@ -3768,33 +419,7 @@ index 45145b3..33dede8 100644 AC_ARG_ENABLE([gl], [AS_HELP_STRING([--enable-gl], -@@ -285,6 +291,12 @@ AC_ARG_ENABLE([profiling], - [use_profiling=$enableval], - [use_profiling=no]) - -+AC_ARG_ENABLE([glesscreensavers], -+ [AS_HELP_STRING([--enable-glesscreensavers], -+ [enable GLES screensavers (default is yes)])], -+ [use_glesscreensavers=$enableval], -+ [use_glesscreensavers=yes]) -+ - AC_ARG_ENABLE([x11], - [AS_HELP_STRING([--enable-x11], - [enable x11 (default is yes) 'Linux Only'])], -@@ -321,6 +333,12 @@ AC_ARG_ENABLE([ssh], - [use_ssh=$enableval], - [use_ssh=yes]) - -+AC_ARG_ENABLE([rtmp], -+ [AS_HELP_STRING([--enable-rtmp], -+ [enable RTMP support via librtmp (default is auto)])], -+ [use_librtmp=$enableval], -+ [use_librtmp=auto]) -+ - AC_ARG_ENABLE([samba], - [AS_HELP_STRING([--disable-samba], - [disable SAMBA support (default is enabled)])], -@@ -333,6 +351,12 @@ AC_ARG_ENABLE([nfs], +@@ -341,6 +343,12 @@ AC_ARG_ENABLE([nfs], [use_libnfs=$enableval], [use_libnfs=auto]) @@ -3807,29 +432,7 @@ index 45145b3..33dede8 100644 AC_ARG_ENABLE([airplay], [AS_HELP_STRING([--enable-airplay], [enable AirPlay support(default is auto)])], -@@ -371,7 +395,7 @@ AC_ARG_ENABLE([avahi], - - AC_ARG_ENABLE([non-free], - [AS_HELP_STRING([--disable-non-free], -- [disable components with non-compliant licenses])], -+ [disable componentents with non-compliant licenses])], - [use_nonfree=$enableval], - [use_nonfree=yes]) - -@@ -399,12 +423,6 @@ AC_ARG_ENABLE([libbluray], - [use_libbluray=$enableval], - [use_libbluray=auto]) - --AC_ARG_ENABLE([libxslt], -- [AS_HELP_STRING([--disable-libxslt], -- [enable libxslt (XSLT scrapers) support (default is enabled)])], -- [use_libxslt=$enableval], -- [use_libxslt=yes]) -- - AC_ARG_ENABLE([texturepacker], - [AS_HELP_STRING([--enable-texturepacker], - [enable texturepacker support (default is auto)])], -@@ -670,16 +688,38 @@ case $use_platform in +@@ -672,16 +680,38 @@ case $use_platform in target_platform=target_raspberry_pi use_neon=no use_cpu=arm1176jzf-s @@ -3869,7 +472,7 @@ index 45145b3..33dede8 100644 use_hardcoded_tables="yes" use_openmax=no CORE_SYSTEM_NAME=rbpi -@@ -783,10 +823,7 @@ if test "$host_vendor" = "apple" ; then +@@ -785,10 +815,7 @@ if test "$host_vendor" = "apple" ; then #arm/ios LIBS="$LIBS -framework CoreFoundation" fi @@ -3881,7 +484,7 @@ index 45145b3..33dede8 100644 CFLAGS="$CFLAGS -mno-apcs-stack-check" CXXFLAGS="$CXXFLAGS -mno-apcs-stack-check" if test "$use_tegra" = "yes"; then -@@ -907,6 +944,17 @@ else +@@ -909,6 +936,17 @@ else AC_MSG_NOTICE([Using Python $PYTHON_VERSION]) fi @@ -3899,7 +502,7 @@ index 45145b3..33dede8 100644 # Checks for platforms libraries. if test "$use_gles" = "yes"; then use_gl="no" -@@ -920,7 +968,12 @@ if test "$use_gles" = "yes"; then +@@ -922,7 +960,12 @@ if test "$use_gles" = "yes"; then AC_DEFINE([HAVE_LIBEGL],[1],["Define to 1 if you have the `EGL' library (-lEGL)."]) AC_DEFINE([HAVE_LIBGLESV2],[1],["Define to 1 if you have the `GLESv2' library (-lGLESv2)."]) AC_MSG_RESULT(== WARNING: OpenGLES support is assumed.) @@ -3913,7 +516,7 @@ index 45145b3..33dede8 100644 else AC_CHECK_LIB([EGL], [main],, AC_MSG_ERROR($missing_library)) AC_CHECK_LIB([GLESv2],[main],, AC_MSG_ERROR($missing_library)) -@@ -1027,7 +1080,8 @@ int main() { +@@ -1029,7 +1072,8 @@ int main() { )]) AC_LANG_POP([C++]) @@ -3923,97 +526,7 @@ index 45145b3..33dede8 100644 PKG_CHECK_MODULES([UUID], [uuid],, AC_MSG_ERROR(libuuid not found)) fi -@@ -1065,28 +1119,21 @@ if test "$target_platform" = "target_android" ; then - AC_CHECK_LIB([log], [__android_log_vprint],, AC_MSG_ERROR($missing_library)) - AC_CHECK_LIB([jnigraphics], [main],, AC_MSG_ERROR($missing_library)) - fi -- --# check for libbxslt --AS_CASE([x$use_libxslt], -- [xyes],[ -- PKG_CHECK_MODULES([LIBXML], [libxml-2.0], -- [INCLUDES="$INCLUDES $LIBXML_CFLAGS"; LIBS="$LIBS $LIBXML_LIBS"], -- AC_MSG_ERROR($missing_library)) -- PKG_CHECK_MODULES([LIBXSLT], [libxslt], -- [INCLUDES="$INCLUDES $LIBXSLT_CFLAGS"; LIBS="$LIBS $LIBXSLT_LIBS"], -- AC_MSG_ERROR($missing_library)) -- AC_DEFINE([HAVE_LIBXSLT], 1, [System has libxslt library]) -- AC_SUBST([HAVE_LIBXSLT], 1) -- ],[ -- AC_SUBST([HAVE_LIBXSLT], 0) -- ] --) -+PKG_CHECK_MODULES([LIBXML], [libxml-2.0], -+ [INCLUDES="$INCLUDES $LIBXML_CFLAGS"; LIBS="$LIBS $LIBXML_LIBS"], -+ AC_MSG_ERROR($missing_library)) -+PKG_CHECK_MODULES([LIBXSLT], [libxslt], -+ [INCLUDES="$INCLUDES $LIBXSLT_CFLAGS"; LIBS="$LIBS $LIBXSLT_LIBS"], -+ AC_MSG_ERROR($missing_library)) - PKG_CHECK_MODULES([FRIBIDI], [fribidi], - [INCLUDES="$INCLUDES $FRIBIDI_CFLAGS"; LIBS="$LIBS $FRIBIDI_LIBS"], - AC_MSG_ERROR($missing_library)) - PKG_CHECK_MODULES([SQLITE3], [sqlite3], - [INCLUDES="$INCLUDES $SQLITE3_CFLAGS"; LIBS="$LIBS $SQLITE3_LIBS"], - AC_MSG_ERROR($missing_library)) -+PKG_CHECK_MODULES([PNG], [libpng], -+ [INCLUDES="$INCLUDES $PNG_CFLAGS"; LIBS="$LIBS $PNG_LIBS"], -+ AC_MSG_ERROR($missing_library)) - PKG_CHECK_MODULES([PCRECPP], [libpcrecpp], - [INCLUDES="$INCLUDES $PCRECPP_CFLAGS"; LIBS="$LIBS $PCRECPP_LIBS"]; \ - AC_DEFINE([HAVE_LIBPCRECPP],[1],["Define to 1 if libpcrecpp is installed"]), -@@ -1098,7 +1145,7 @@ PKG_CHECK_MODULES([PCRE], [libpcre], - PKG_CHECK_MODULES([FREETYPE2], [freetype2], - [INCLUDES="$INCLUDES $FREETYPE2_CFLAGS"; LIBS="$LIBS $FREETYPE2_LIBS"], - AC_MSG_ERROR($missing_library)) --PKG_CHECK_MODULES([TAGLIB], [taglib >= 1.9], -+PKG_CHECK_MODULES([TAGLIB], [taglib >= 1.8], - [INCLUDES="$INCLUDES $TAGLIB_CFLAGS"; LIBS="$LIBS $TAGLIB_LIBS"], - AC_MSG_ERROR($missing_library)) - -@@ -1283,6 +1330,15 @@ else - AC_MSG_RESULT($x11_disabled) - fi - -+# GLES Screensavers -+if test "$use_glesscreensavers" = "no" || test "$use_gles" = "no"; then -+ AC_MSG_NOTICE($glesscreensavers_disabled) -+ DISABLE_GLESSCREENSAVERS=1 -+else -+ AC_MSG_NOTICE($glesscreensavers_enabled) -+ DISABLE_GLESSCREENSAVERS=0 -+fi -+ - # libssh - if test "x$use_ssh" = "xno"; then - AC_MSG_NOTICE(ssh support disabled by user) -@@ -1293,6 +1349,26 @@ else - AC_MSG_ERROR(libssh not found)) - fi - -+# libRTMP -+if test "$use_librtmp" != "no"; then -+ AC_CHECK_HEADERS([librtmp/log.h librtmp/amf.h librtmp/rtmp.h],, -+ [if test "$use_librtmp" = "yes"; then -+ AC_MSG_ERROR($librtmp_not_found) -+ elif test "$use_librtmp" != "no"; then -+ AC_MSG_NOTICE($librtmp_not_found) -+ use_librtmp="no" -+ fi -+ ]) -+ if test "$use_librtmp" != "no"; then -+ XB_FIND_SONAME([RTMP], [rtmp], [use_librtmp]) -+ fi -+ if test "$use_librtmp" != "no"; then -+ AC_DEFINE([HAS_LIBRTMP], [1], [Whether to use libRTMP library.]) -+ fi -+else -+ AC_MSG_NOTICE($librtmp_disabled) -+fi -+ - # samba - if test "x$use_samba" != "xno"; then - PKG_CHECK_MODULES([SAMBA], [smbclient], -@@ -1335,6 +1411,26 @@ else +@@ -1350,6 +1394,26 @@ else AC_MSG_NOTICE($libnfs_disabled) fi @@ -4040,7 +553,7 @@ index 45145b3..33dede8 100644 # libplist for airplay feature USE_AIRPLAY=0 if test "$use_airplay" != "no"; then -@@ -1520,6 +1616,8 @@ if test "${USE_STATIC_FFMPEG}" = "1"; then +@@ -1535,6 +1599,8 @@ if test "${USE_STATIC_FFMPEG}" = "1"; then FFMPEG_OPTS="${FFMPEG_OPTS} --disable-optimizations" fi @@ -4049,7 +562,7 @@ index 45145b3..33dede8 100644 if test "$with_ffmpeg" = "auto" || test "$with_ffmpeg" = "yes"; then SAVE_INCLUDES="$INCLUDES" SAVE_LIBS="$LIBS" -@@ -1601,9 +1699,6 @@ final_message="$final_message\n SWIG Available:\tYes" +@@ -1616,9 +1682,6 @@ final_message="$final_message\n SWIG Available:\tYes" echo "Checking for a jre installation" AC_PATH_PROG(JAVA_EXE, java, "none") @@ -4059,55 +572,7 @@ index 45145b3..33dede8 100644 final_message="$final_message\n JRE Available:\tYes" echo "Checking for doxygen installation" -@@ -1860,6 +1955,12 @@ else - final_message="$final_message\n OpenMax:\tNo" - fi - -+if test "$use_glesscreensavers" = "yes"; then -+ final_message="$final_message\n GLES Screensavers:\t\tYes" -+else -+ final_message="$final_message\n GLES Screensavers:\t\tNo" -+fi -+ - if test "$use_x11" = "yes"; then - USE_X11=1 - final_message="$final_message\n X11:\t\tYes" -@@ -1874,18 +1975,11 @@ else - final_message="$final_message\n Bluray:\tNo" - fi - --if test "$use_libxslt" = "yes"; then -- final_message="$final_message\n XSLT scrapers:\tYes" --else -- final_message="$final_message\n XSLT scrapers:\tNo" --fi -- - if test "x$use_texturepacker" != "xno"; then -- AC_PATH_PROG([TEXTUREPACKER], [TexturePacker], ["none"], -- [$PATH$PATH_SEPARATOR${abs_top_srcdir}/tools/depends/native/TexturePacker/bin]) -- if test "$TEXTUREPACKER" = "none"; then -+ AC_CHECK_PROG(TEXTUREPACKER, ${abs_top_srcdir}/tools/depends/native/TexturePacker/bin/TexturePacker, "yes", "no",) -+ if test "$TEXTUREPACKER" = "no"; then - make -C ${abs_top_srcdir}/tools/depends/native/TexturePacker -- TEXTUREPACKER="${abs_top_srcdir}/tools/depends/native/TexturePacker/bin/TexturePacker" -+ TEXTUREPACKER="${abs_top_srcdir}/tools/depends/native/TexturePacker/bin/TexturePacker" - fi - if test -x "$TEXTUREPACKER"; then - final_message="$final_message\n TexturePacker:Yes" -@@ -2016,6 +2110,12 @@ else - final_message="$final_message\n libssh support:\tNo" - fi - -+if test "$use_librtmp" != "no"; then -+ final_message="$final_message\n libRTMP support:\tYes" -+else -+ final_message="$final_message\n libRTMP support:\tNo" -+fi -+ - if test "x$use_samba" != "xno"; then - final_message="$final_message\n libsmbclient support:\tYes" - else -@@ -2028,6 +2128,12 @@ else +@@ -2043,6 +2106,12 @@ else final_message="$final_message\n libnfs client support:No" fi @@ -4120,31 +585,7 @@ index 45145b3..33dede8 100644 if test "$use_airplay" != "no"; then final_message="$final_message\n AirPlay support:\tYes" else -@@ -2153,6 +2259,15 @@ OUTPUT_FILES="Makefile \ - xbmc/freebsd/Makefile \ - xbmc/linux/Makefile \ - xbmc/filesystem/Makefile \ -+ xbmc/screensavers/gles/Makefile \ -+ xbmc/screensavers/gles/solarwinds/Makefile \ -+ xbmc/screensavers/gles/plasma/Makefile \ -+ xbmc/screensavers/gles/plasma2/Makefile \ -+ xbmc/screensavers/gles/noise/Makefile \ -+ xbmc/screensavers/gles/warp/Makefile \ -+ xbmc/screensavers/gles/stellar/Makefile \ -+ xbmc/screensavers/gles/spiral/Makefile \ -+ xbmc/screensavers/gles/ball/Makefile \ - xbmc/windowing/Makefile \ - xbmc/windowing/egl/Makefile \ - lib/addons/library.xbmc.addon/Makefile \ -@@ -2248,6 +2363,7 @@ AC_SUBST(CFLAGS_FOR_BUILD) - AC_SUBST(CXXFLAGS_FOR_BUILD) - AC_SUBST(LDFLAGS_FOR_BUILD) - AC_SUBST(SDL_DEFINES) -+AC_SUBST(DISABLE_GLESSCREENSAVERS) - AC_SUBST(FFMPEG_LIBDIR) - AC_SUBST(USE_STATIC_FFMPEG) - AC_SUBST(GNUTLS_ALL_LIBS) -@@ -2265,6 +2381,7 @@ AC_SUBST(USE_VDPAU) +@@ -2280,6 +2349,7 @@ AC_SUBST(USE_VDPAU) AC_SUBST(USE_VAAPI) AC_SUBST(USE_LIBSMBCLIENT) AC_SUBST(USE_LIBNFS) @@ -4152,1375 +593,10 @@ index 45145b3..33dede8 100644 AC_SUBST(USE_AIRPLAY) AC_SUBST(USE_OPENMAX) AC_SUBST(USE_PULSE) -diff --git a/lib/libUPnP/CMakeLists.txt b/lib/libUPnP/CMakeLists.txt -index b565720..29476f5 100644 ---- a/lib/libUPnP/CMakeLists.txt -+++ b/lib/libUPnP/CMakeLists.txt -@@ -101,7 +101,7 @@ else() - include_directories(Neptune/Source/System/Win32) - endif() - --if(APPLE) -+if(CORE_SYSTEM_NAME STREQUAL darwin OR CORE_SYSTEM_NAME STREQUAL ios) - list(APPEND SOURCES Neptune/Source/System/Apple/NptAppleAutoreleasePool.mm - Neptune/Source/System/Apple/NptAppleLogConfig.mm) - endif() -diff --git a/lib/libdvd/Makefile.in b/lib/libdvd/Makefile.in -index 00827cf..90cdf63 100644 ---- a/lib/libdvd/Makefile.in -+++ b/lib/libdvd/Makefile.in -@@ -3,16 +3,10 @@ ARCH=@ARCH@ - CC=@CC@ - CXX=@CXX@ - --ifeq (@CROSS_COMPILING@,yes) -- DEPENDS_DIR = $(shell grep "^PREFIX=/" @abs_top_srcdir@/tools/depends/Makefile.include | sed 's/PREFIX=//g') -- DVDNAV_A = $(DEPENDS_DIR)/lib/libdvdnav.a -- DVDREAD_A = $(DEPENDS_DIR)/lib/libdvdread.a -- DVDCSS_A = $(DEPENDS_DIR)/lib/libdvdcss.a --else -- DVDNAV_A = @abs_top_srcdir@/tools/depends/target/libdvdnav/dvdnav-install/lib/libdvdnav.a -- DVDREAD_A = @abs_top_srcdir@/tools/depends/target/libdvdread/dvdread-install/lib/libdvdread.a -- DVDCSS_A = @abs_top_srcdir@/tools/depends/target/libdvdcss/dvdcss-install/lib/libdvdcss.a --endif -+DEPENDS_DIR = $(shell grep "^PREFIX=/" @abs_top_srcdir@/tools/depends/Makefile.include | sed 's/PREFIX=//g') -+DVDNAV_A = $(DEPENDS_DIR)/lib/libdvdnav.a -+DVDREAD_A = $(DEPENDS_DIR)/lib/libdvdread.a -+DVDCSS_A = $(DEPENDS_DIR)/lib/libdvdcss.a - - SYSDIR = @abs_top_srcdir@/system/players/VideoPlayer - SOS = libdvdnav-$(ARCH).so -diff --git a/project/BuildDependencies/scripts/0_package.list b/project/BuildDependencies/scripts/0_package.list -index 71024bf..f7bc7b9 100644 ---- a/project/BuildDependencies/scripts/0_package.list -+++ b/project/BuildDependencies/scripts/0_package.list -@@ -13,7 +13,7 @@ dnssd-541-win32.zip - doxygen-1.8.2-win32.7z - fontconfig-2.8.0-win32.7z - freetype-2.4.6-win32-3.7z --giflib-5.1.4-win32-vc140.7z -+giflib-5.1.1-win32.7z - jsonschemabuilder-1.0.0-win32-3.7z - libass-0.12.1-win32.7z - libbluray-0.8.1-win32-vc120.7z -@@ -22,11 +22,12 @@ libcec-3.0.0-win32-2.7z - libexpat_2.0.1-win32.7z - libfribidi-0.19.2-win32.7z - libiconv-1.14-win32-vc140-v2.7z --libjpeg-turbo-1.4.90-win32-vc140.7z --libmicrohttpd-0.9.50-win32-vc140.7z -+libjpeg-turbo-1.2.0-win32.7z -+liblzo-2.04-win32.7z -+libmicrohttpd-0.9.48-win32-vc140-v2.7z - libnfs-1.10.0-win32.7z - libplist-1.7-win32-3.7z --libpng-1.6.21-win32-vc140.7z -+libpng-1.5.13-win32.7z - librtmp-20150114-git-a107ce-win32.7z - libshairplay-52fd9db-win32.7z - libssh-0.5.0-1-win32.zip -@@ -34,15 +35,14 @@ libxml2-2.7.8_1-win32.7z - libxslt-1.1.26_1-win32.7z - libyajl-2.0.1-win32.7z - libzlib-vc100-1.2.5-win32.7z --lzo-2.09-win32-vc140-v3.7z - mysql-connector-c-6.1.6-win32-vc140.7z - openssl-1.0.2g-win32-vc140-v2.7z - pcre-8.37-win32-vc140-v3.7z - pillow-3.1.0-win32-vc140.7z - python-2.7.11-win32-vc140-v2.7z - sqlite-3.10.2-win32-vc140.7z --swig-3.0.10-win32.7z -+swig-2.0.7-win32-1.7z - taglib-1.11-win32-vc140-v2.7z --texturepacker-1.1.1-win32.7z -+texturepacker-1.1.0-win32.7z - tinyxmlstl-2.6.2-win32-vc140-v2.7z --zlib-1.2.8-win32-vc140-v3.7z -+zlib-1.2.8-win32-vc140-v2.7z -diff --git a/project/VS2010Express/XBMC for Windows.sln b/project/VS2010Express/XBMC for Windows.sln -index a833f85..e2c0c65 100644 ---- a/project/VS2010Express/XBMC for Windows.sln -+++ b/project/VS2010Express/XBMC for Windows.sln -@@ -1,21 +1,11 @@ - Microsoft Visual Studio Solution File, Format Version 12.00 --# Visual Studio 14 --VisualStudioVersion = 14.0.25402.0 -+# Visual Studio 2013 -+VisualStudioVersion = 12.0.40629.0 - MinimumVisualStudioVersion = 10.0.40219.1 - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Kodi", "XBMC.vcxproj", "{3A68081D-E8F9-4523-9436-530DE9E5530A}" - ProjectSection(ProjectDependencies) = postProject -- {F8F1290B-1188-4810-86C9-88178A31D2AF} = {F8F1290B-1188-4810-86C9-88178A31D2AF} -- {2DCEA60B-4EBC-4DB7-9FBD-297C1EFD95D7} = {2DCEA60B-4EBC-4DB7-9FBD-297C1EFD95D7} -- {FEA71D39-CB68-486B-A978-246E661A3F89} = {FEA71D39-CB68-486B-A978-246E661A3F89} -- {44F93C4D-85DD-4452-99BB-F1D196174024} = {44F93C4D-85DD-4452-99BB-F1D196174024} -- {88968763-3D6B-48A8-B495-CC8C187FAC02} = {88968763-3D6B-48A8-B495-CC8C187FAC02} - {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} = {C8F6C172-56F2-4E76-B5FA-C3B423B31BE7} -- {6B96FD7D-26EE-415B-8858-27757A0B1273} = {6B96FD7D-26EE-415B-8858-27757A0B1273} - {DF460EAB-570D-4B50-9089-2E2FC801BF38} = {DF460EAB-570D-4B50-9089-2E2FC801BF38} -- {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942} -- {8BC9CEB8-8B4A-11D0-8D11-00A0CFEBC942} = {8BC9CEB8-8B4A-11D0-8D11-00A0CFEBC942} -- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE} = {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE} -- {6D8C91F8-992F-4C83-9DE3-485D64EF8420} = {6D8C91F8-992F-4C83-9DE3-485D64EF8420} - EndProjectSection - EndProject - Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libPlatinum", "libPlatinum.vcxproj", "{B2975495-FBE4-4F94-AAC5-B21A9842BF50}" -@@ -84,6 +74,12 @@ Global - {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Debug|Win32.Build.0 = Debug (DLL)|Win32 - {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Release|Win32.ActiveCfg = Release (DLL)|Win32 - {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Release|Win32.Build.0 = Release (DLL)|Win32 -+ {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Debug Testsuite|Win32.ActiveCfg = Debug|Win32 -+ {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Debug Testsuite|Win32.Build.0 = Debug|Win32 -+ {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Debug|Win32.ActiveCfg = Debug|Win32 -+ {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Debug|Win32.Build.0 = Debug|Win32 -+ {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Release|Win32.ActiveCfg = Release|Win32 -+ {6A8518C3-D81A-4428-BD7F-C37933088AC1}.Release|Win32.Build.0 = Release|Win32 - {88968763-3D6B-48A8-B495-CC8C187FAC02}.Debug Testsuite|Win32.ActiveCfg = Debug|Win32 - {88968763-3D6B-48A8-B495-CC8C187FAC02}.Debug Testsuite|Win32.Build.0 = Debug|Win32 - {88968763-3D6B-48A8-B495-CC8C187FAC02}.Debug|Win32.ActiveCfg = Debug|Win32 -diff --git a/project/VS2010Express/XBMC.vcxproj b/project/VS2010Express/XBMC.vcxproj -index 164b608..bb6a5e4 100644 ---- a/project/VS2010Express/XBMC.vcxproj -+++ b/project/VS2010Express/XBMC.vcxproj -@@ -245,19 +245,14 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- -- CompileAsCpp -- CompileAsCpp -- CompileAsCpp -- -- -- CompileAsCpp -- CompileAsCpp -- CompileAsCpp -- - - - -+ -+ -+ -+ -+ - - - -@@ -265,11 +260,6 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- -- -- -- -- - - - -@@ -371,6 +361,9 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ - - - -@@ -378,6 +371,8 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ - - - -@@ -391,6 +386,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - - -@@ -413,9 +409,14 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ - - - -+ -+ - - - -@@ -596,7 +597,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- -+ - - - -@@ -740,12 +741,14 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - - - - -- -+ -+ - - - -@@ -932,6 +935,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - true - true -@@ -1011,7 +1015,6 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- - - - -@@ -1021,11 +1024,11 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- -- -- -- -- -+ -+ -+ -+ -+ - - - -@@ -1353,12 +1356,8 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- -- - -- - -- - - - -@@ -1398,20 +1397,28 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ - - - - - -+ -+ - - - - -+ -+ - - - - - -+ - - - -@@ -1428,7 +1435,13 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ -+ - -+ -+ - - - -@@ -1454,6 +1467,9 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ - - - -@@ -1486,11 +1502,8 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- - -- - -- - - true - true -@@ -1499,10 +1512,6 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - true - true - -- -- true -- true -- - - true - true -@@ -1541,8 +1550,10 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - -+ - - - -@@ -1551,6 +1562,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - CompileAsCpp - - -+ - - - -@@ -1599,6 +1611,10 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - true - true - -+ -+ true -+ true -+ - - true - true -@@ -1846,6 +1862,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - - -@@ -1863,6 +1880,11 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ -+ -+ - - - -@@ -1955,7 +1977,6 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- - - - -@@ -2119,6 +2140,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - - -@@ -2174,10 +2196,15 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - - -+ -+ - -+ -+ - - - -@@ -2289,6 +2316,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - true - true -@@ -2329,13 +2357,16 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - -+ - - - - - -+ - - - -@@ -2419,7 +2450,6 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- - - - -@@ -2476,6 +2506,7 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ - - - -@@ -2504,7 +2535,16 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -+ -+ -+ -+ - -+ -+ -+ -+ -+ - - - -@@ -3141,4 +3181,4 @@ copy "..\Win32BuildSetup\dependencies\python27.dll" "$(TargetDir)" - - - -- -\ No newline at end of file -+ -diff --git a/project/VS2010Express/XBMC.vcxproj.filters b/project/VS2010Express/XBMC.vcxproj.filters -index b3c5378..1385742 100644 ---- a/project/VS2010Express/XBMC.vcxproj.filters -+++ b/project/VS2010Express/XBMC.vcxproj.filters -@@ -1,4 +1,4 @@ -- -+ - - - -@@ -319,6 +319,9 @@ - - {43526341-7b96-462d-9f71-685e426251ec} - -+ -+ {2afb92ce-e9ac-4458-80e7-3384ccfffa3c} -+ - - {1bdb0045-3341-49b7-8d6f-30a53f812350} - -@@ -445,9 +448,6 @@ - - {9e3dd585-08e1-4dae-bc21-05e49697ef94} - -- -- {c6256fb3-a4b8-4114-95c1-eb601756759a} -- - - - -@@ -576,6 +576,9 @@ - - cores\VideoPlayer\DVDInputStreams - -+ -+ cores\VideoPlayer\DVDInputStreams -+ - - cores\VideoPlayer\DVDInputStreams - -@@ -609,6 +612,9 @@ - - cores\VideoPlayer\DVDSubtitles - -+ -+ cores\paplayer -+ - - cores\paplayer - -@@ -618,9 +624,36 @@ - - cores\paplayer - -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ - - cores\paplayer - -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ - - cores\DllLoader - -@@ -1134,6 +1167,9 @@ - - input - -+ -+ input -+ - - input - -@@ -1218,6 +1254,9 @@ - - music\tags - -+ -+ music\tags -+ - - music\tags - -@@ -1227,9 +1266,21 @@ - - music\tags - -+ -+ music\tags -+ -+ -+ music\tags -+ - - music\tags - -+ -+ music\tags -+ -+ -+ music\tags -+ - - network - -@@ -1398,6 +1449,9 @@ - - utils - -+ -+ utils -+ - - utils - -@@ -1407,6 +1461,9 @@ - - utils - -+ -+ utils -+ - - utils - -@@ -1845,6 +1902,9 @@ - - filesystem - -+ -+ filesystem -+ - - network\httprequesthandler - -@@ -1887,6 +1947,12 @@ - - network\httprequesthandler - -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -1902,6 +1968,12 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -1926,6 +1998,9 @@ - - filesystem - -+ -+ filesystem -+ - - filesystem - -@@ -1971,12 +2046,30 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -2052,6 +2145,15 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -2192,6 +2294,7 @@ - - - -+ - - - -@@ -2317,6 +2420,12 @@ - - utils\test - -+ -+ utils\test -+ -+ -+ utils\test -+ - - utils\test - -@@ -2329,6 +2438,9 @@ - - utils\test - -+ -+ utils\test -+ - - utils\test - -@@ -2830,21 +2942,6 @@ - - network\httprequesthandler - -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- - - - -@@ -2917,6 +3014,21 @@ - - settings - -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ - - utils - -@@ -2965,9 +3077,6 @@ - - input - -- -- music\tags -- - - network\httprequesthandler\python - -@@ -3004,9 +3113,6 @@ - - addons - -- -- addons -- - - filesystem - -@@ -3613,6 +3719,9 @@ - - cores\VideoPlayer\DVDInputStreams - -+ -+ cores\VideoPlayer\DVDInputStreams -+ - - cores\VideoPlayer\DVDInputStreams - -@@ -3679,6 +3788,9 @@ - - cores\VideoPlayer\DVDSubtitles - -+ -+ cores\paplayer -+ - - cores\paplayer - -@@ -3691,9 +3803,36 @@ - - cores\paplayer - -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ - - cores\paplayer - -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ -+ -+ cores\paplayer -+ - - cores\DllLoader - -@@ -4245,6 +4384,9 @@ - - input - -+ -+ input -+ - - input - -@@ -4356,6 +4498,9 @@ - - music\tags - -+ -+ music\tags -+ - - music\tags - -@@ -4365,9 +4510,21 @@ - - music\tags - -+ -+ music\tags -+ -+ -+ music\tags -+ - - music\tags - -+ -+ music\tags -+ -+ -+ music\tags -+ - - network - -@@ -4542,12 +4699,18 @@ - - utils - -+ -+ utils -+ - - utils - - - utils - -+ -+ utils -+ - - utils - -@@ -4557,6 +4720,9 @@ - - utils - -+ -+ utils -+ - - utils - -@@ -5037,6 +5203,15 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -5049,6 +5224,12 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -5061,6 +5242,12 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -5076,6 +5263,9 @@ - - filesystem - -+ -+ filesystem -+ - - filesystem - -@@ -5124,9 +5314,27 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -5202,6 +5410,15 @@ - - filesystem - -+ -+ filesystem -+ -+ -+ filesystem -+ -+ -+ filesystem -+ - - filesystem - -@@ -5406,6 +5623,7 @@ - - - -+ - - - -@@ -6041,6 +6259,21 @@ - - settings - -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ -+ -+ cores\AudioEngine\DSPAddons -+ - - addons - -@@ -6071,15 +6304,9 @@ - - video\jobs - -- -- music\tags -- - - video\jobs - -- -- music -- - - utils - -@@ -6329,9 +6556,6 @@ - - input - -- -- utils -- - - music\tags - -@@ -6689,21 +6913,6 @@ - - network\httprequesthandler - -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- -- -- cores\AudioEngine\Engines\ActiveAE\AudioDSPAddons -- - - - -@@ -6790,4 +6999,4 @@ - shaders - - -- -\ No newline at end of file -+ -diff --git a/project/cmake/CMakeLists.txt b/project/cmake/CMakeLists.txt -index a5368ae..7800c0d 100644 ---- a/project/cmake/CMakeLists.txt -+++ b/project/cmake/CMakeLists.txt -@@ -18,8 +18,8 @@ option(ENABLE_NONFREE "Enable non-free components?" ON) - option(ENABLE_MICROHTTPD "Enable MicroHttpd webserver?" ON) - option(ENABLE_MYSQLCLIENT "Enable MySql support?" ON) - option(ENABLE_AVAHI "Enable Avahi support?" ON) -+option(ENABLE_RTMP "Enable RTMP support?" ON) - option(ENABLE_BLURAY "Enable BluRay support?" ON) --option(ENABLE_XSLT "Enable XSLT scrapers support?" ON) - option(ENABLE_PLIST "Enable AirPlay support?" ON) - option(ENABLE_NFS "Enable NFS support?" ON) - option(ENABLE_AIRTUNES "Enable AirTunes support?" ON) -@@ -61,13 +61,13 @@ set(CORE_BUILD_DIR build) - message(STATUS "Source directory: ${CORE_SOURCE_DIR}") - message(STATUS "Build directory: ${CMAKE_BINARY_DIR}") - --include(modules/extra/ECMEnableSanitizers.cmake) - include(scripts/common/GeneratorSetup.cmake) - include(scripts/common/AddOptions.cmake) - include(scripts/common/ArchSetup.cmake) - include(scripts/common/Macros.cmake) -+include(scripts/common/ManageString.cmake) - include(scripts/common/ProjectMacros.cmake) --include(scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake) -+include(scripts/common/PathSetup.cmake) - include(ExternalProject) - - core_find_git_rev() -@@ -95,7 +95,7 @@ list(APPEND DEPLIBS ${CMAKE_THREAD_LIBS_INIT}) - - # Required dependencies - set(required_deps Sqlite3 FreeType PCRE Cpluff LibDvd -- TinyXML Python Yajl -+ TinyXML Python Yajl Xslt - Lzo2 Fribidi TagLib FFMPEG CrossGUID) - if(NOT WIN32) - list(APPEND required_deps LibSmbClient ZLIB) -@@ -107,7 +107,7 @@ if(CORE_SYSTEM_NAME STREQUAL android) - endif() - - # Optional dependencies --set(optional_deps MicroHttpd MySqlClient SSH Xslt -+set(optional_deps MicroHttpd MySqlClient SSH - Alsa UDev Dbus Avahi - PulseAudio VDPAU VAAPI) - -@@ -115,10 +115,10 @@ set(optional_deps MicroHttpd MySqlClient SSH Xslt - set(required_dyload Curl ASS) - - # Optional, dyloaded deps --set(dyload_optional CEC Bluray Plist NFS) -+set(dyload_optional RTMP CEC Bluray Plist NFS) - - # Required by shared objects we link --set(required_dep_libs EXPAT) -+set(required_dep_libs PNG EXPAT) - - # Required tools - find_package(TexturePacker REQUIRED) -@@ -203,10 +203,6 @@ if(ENABLE_CCACHE) - core_optional_dep(CCache) - endif() - --if(CORE_SYSTEM_NAME STREQUAL android) -- core_optional_dep(Breakpad) --endif() -- - # Compile Info - add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp - ${CMAKE_BINARY_DIR}/addons/xbmc.addon/addon.xml -@@ -316,23 +312,16 @@ add_subdirectory(${CORE_SOURCE_DIR}/xbmc/interfaces/swig build/swig) - set(OTHER_FILES README.md) - - # main binary --if(NOT CORE_SYSTEM_NAME STREQUAL android) -- add_executable(${APP_NAME_LC} ${CORE_MAIN_SOURCE} $ "${RESOURCES}" ${OTHER_FILES}) --else() -- add_library(${APP_NAME_LC} SHARED ${CORE_MAIN_SOURCE} $ "${RESOURCES}" ${OTHER_FILES}) --endif() -+add_executable(${APP_NAME_LC} ${CORE_MAIN_SOURCE} $ "${RESOURCES}" ${OTHER_FILES}) - whole_archive(_MAIN_LIBRARIES ${core_DEPENDS}) - target_link_libraries(${APP_NAME_LC} ${SYSTEM_LDFLAGS} ${_MAIN_LIBRARIES} ${DEPLIBS} ${CMAKE_DL_LIBS}) - unset(_MAIN_LIBRARIES) - add_dependencies(${APP_NAME_LC} export-files) -- --if(WIN32) -+if(NOT WIN32) -+ set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") -+else() - set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) - copy_main_dlls_to_buildtree() --elseif(CORE_SYSTEM_NAME STREQUAL android) -- # Nothing --else() -- set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") - endif() - - # testing -@@ -359,9 +348,6 @@ endif() - if(FFMPEG_LINK_EXECUTABLE) - set(CMAKE_CXX_LINK_EXECUTABLE "${FFMPEG_LINK_EXECUTABLE}") - endif() --if(FFMPEG_CREATE_SHARED_LIBRARY) -- set(CMAKE_CXX_CREATE_SHARED_LIBRARY "${FFMPEG_CREATE_SHARED_LIBRARY}") --endif() - - # randr - if(ENABLE_X11 AND XRANDR_FOUND) -@@ -370,7 +356,7 @@ if(ENABLE_X11 AND XRANDR_FOUND) - endif() - - # XBMCHelper --if(CORE_SYSTEM_NAME STREQUAL osx) -+if(CORE_SYSTEM_NAME STREQUAL darwin) - add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper) - endif() - -@@ -387,7 +373,7 @@ set(APP_LIB_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${APP_NAME_LC}) - set(APP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include/${APP_NAME_LC}) - set(CXX11_SWITCH "-std=c++11") - configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in -- ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/${APP_NAME}Config.cmake @ONLY) -+ ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/${APP_NAME_LC}Config.cmake @ONLY) - configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddonHelpers.cmake - ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddonHelpers.cmake COPYONLY) - configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddOptions.cmake -diff --git a/project/cmake/KodiConfig.cmake.in b/project/cmake/KodiConfig.cmake.in -index 839cba9..d6b60c2 100644 ---- a/project/cmake/KodiConfig.cmake.in -+++ b/project/cmake/KodiConfig.cmake.in -@@ -1,24 +1,24 @@ --set(APP_NAME @APP_NAME@) --set(APP_NAME_LC @APP_NAME_LC@) --set(APP_NAME_UC @APP_NAME_UC@) --set(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) --set(APP_VERSION_MINOR @APP_VERSION_MINOR@) --if(NOT @APP_NAME_UC@_PREFIX) -- set(@APP_NAME_UC@_PREFIX @APP_PREFIX@) --endif() --if(NOT @APP_NAME_UC@_INCLUDE_DIR) -- set(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@) --endif() --if(NOT @APP_NAME_UC@_LIB_DIR) -- set(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@) --endif() --if(NOT WIN32) -- set(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") --endif() --list(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@) -+SET(APP_NAME @APP_NAME@) -+SET(APP_NAME_LC @APP_NAME_LC@) -+SET(APP_NAME_UC @APP_NAME_UC@) -+SET(APP_VERSION_MAJOR @APP_VERSION_MAJOR@) -+SET(APP_VERSION_MINOR @APP_VERSION_MINOR@) -+IF(NOT @APP_NAME_UC@_PREFIX) -+ SET(@APP_NAME_UC@_PREFIX @APP_PREFIX@) -+ENDIF() -+IF(NOT @APP_NAME_UC@_INCLUDE_DIR) -+ SET(@APP_NAME_UC@_INCLUDE_DIR @APP_INCLUDE_DIR@) -+ENDIF() -+IF(NOT @APP_NAME_UC@_LIB_DIR) -+ SET(@APP_NAME_UC@_LIB_DIR @APP_LIB_DIR@) -+ENDIF() -+IF(NOT WIN32) -+ SET(CMAKE_CXX_FLAGS "$ENV{CXXFLAGS} @CXX11_SWITCH@") -+ENDIF() -+LIST(APPEND CMAKE_MODULE_PATH @APP_LIB_DIR@) - --string(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@") --add_definitions(${ARCH_DEFINES} -DBUILD_KODI_ADDON) -+STRING(REPLACE ";" " " ARCH_DEFINES "@ARCH_DEFINES@") -+ADD_DEFINITIONS(${ARCH_DEFINES} -DBUILD_KODI_ADDON) - - if(NOT CORE_SYSTEM_NAME) - if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") -diff --git a/project/cmake/README.md b/project/cmake/README.md -index fafd078..5eccc25 100644 ---- a/project/cmake/README.md -+++ b/project/cmake/README.md -@@ -152,16 +152,6 @@ When using the makefile builds a few extra targets are defined: - - - `make check` builds and executes the test suite. - --## Sanitizers -- --Clang and GCC support different kinds of Sanitizers. To enable a Sanitizer call CMake with the --option `-DECM_ENABLE_SANITIZERS=’san1;san2;...'`. For more information about enabling the --Sanitizers read the documentation in --[modules/extra/ECMEnableSanitizers.cmake](https://github.com/xbmc/xbmc/tree/master/project/cmake/modules/extra/ECMEnableSanitizers.cmake). -- --It is also recommended to read the sections about the Sanitizers in the [Clang --documentation](http://clang.llvm.org/docs/). -- - ## Debugging the build - - This section covers some tips that can be useful for debugging a CMake diff --git a/project/cmake/addons/CMakeLists.txt b/project/cmake/addons/CMakeLists.txt -index f35003f..f7c781a 100644 +index d0f166f..f7c781a 100644 --- a/project/cmake/addons/CMakeLists.txt +++ b/project/cmake/addons/CMakeLists.txt -@@ -113,13 +113,13 @@ if(PACKAGE_ZIP) - endif() - list(APPEND BUILD_ARGS -DPACKAGE_DIR=${PACKAGE_DIR}) - -- message(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") -+ MESSAGE(STATUS "ZIP packaging enabled (destination: ${PACKAGE_DIR})") - endif() - - if(CMAKE_TOOLCHAIN_FILE) - list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) -- message(STATUS "Toolchain specified") -- message(STATUS ${BUILD_ARGS}) -+ MESSAGE(STATUS "Toolchain specified") -+ MESSAGE(STATUS ${BUILD_ARGS}) - endif() - - if(NOT ADDONS_TO_BUILD) @@ -127,7 +127,6 @@ if(NOT ADDONS_TO_BUILD) else() string(STRIP "${ADDONS_TO_BUILD}" ADDONS_TO_BUILD) @@ -5529,15 +605,6 @@ index f35003f..f7c781a 100644 endif() if(NOT ADDONS_DEFINITION_DIR) -@@ -206,7 +205,7 @@ if(NOT addons) - file(MAKE_DIRECTORY ${BOOTSTRAP_BUILD_DIR}) - endif() - -- string(REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") -+ string (REPLACE ";" " " ADDONS_TO_BUILD_STR "${ADDONS_TO_BUILD}") - # generate the bootstrap buildsystem - execute_process(COMMAND ${CMAKE_COMMAND} ${PROJECT_SOURCE_DIR}/bootstrap - -DCMAKE_INSTALL_PREFIX:PATH=${ADDONS_DEFINITION_DIR} @@ -230,6 +229,8 @@ endif() # error either in ADDONS_TO_BUILD or in the directory configuration. set(SUPPORTED_ADDON_FOUND FALSE) @@ -5547,3352 +614,6 @@ index f35003f..f7c781a 100644 foreach(addon ${addons}) if(NOT (addon MATCHES platforms.txt)) file(STRINGS ${addon} def) -@@ -257,7 +258,7 @@ foreach(addon ${addons}) - set(platform_found FALSE) - check_target_platform(${dir} ${CORE_SYSTEM_NAME} platform_found) - -- if(${platform_found}) -+ if (${platform_found}) - # make sure the output directory is clean - if(EXISTS "${CMAKE_INSTALL_PREFIX}/${id}") - file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/${id}/") -diff --git a/project/cmake/installdata/cmake-files.txt b/project/cmake/installdata/cmake-files.txt -index 7ae9a8d..5536056 100644 ---- a/project/cmake/installdata/cmake-files.txt -+++ b/project/cmake/installdata/cmake-files.txt -@@ -7,5 +7,7 @@ project/cmake/scripts/common/GenerateVersionedFiles.cmake - project/cmake/scripts/common/GeneratorSetup.cmake - project/cmake/scripts/common/HandleDepends.cmake - project/cmake/scripts/common/Macros.cmake -+project/cmake/scripts/common/ManageString.cmake -+project/cmake/scripts/common/PathSetup.cmake - project/cmake/scripts/common/PrepareEnv.cmake - project/cmake/scripts/common/ProjectMacros.cmake -diff --git a/project/cmake/installdata/darwin/packaging.txt b/project/cmake/installdata/darwin/packaging.txt -new file mode 100644 -index 0000000..8cb2245 ---- /dev/null -+++ b/project/cmake/installdata/darwin/packaging.txt -@@ -0,0 +1,3 @@ -+LICENSE.gpl -+xbmc/platform/darwin/Credits.html -+tools/darwin/packaging/media/osx/icon.iconset/* -diff --git a/project/cmake/installdata/darwin/runtime.txt b/project/cmake/installdata/darwin/runtime.txt -new file mode 100644 -index 0000000..3bb5467 ---- /dev/null -+++ b/project/cmake/installdata/darwin/runtime.txt -@@ -0,0 +1,2 @@ -+tools/darwin/runtime/preflight -+tools/darwin/runtime/org.xbmc.helper.plist -diff --git a/project/cmake/modules/FindCCache.cmake b/project/cmake/modules/FindCCache.cmake -index b872772..4ad7d07 100644 ---- a/project/cmake/modules/FindCCache.cmake -+++ b/project/cmake/modules/FindCCache.cmake -@@ -2,5 +2,5 @@ find_program(CCACHE_FOUND ccache) - if(CCACHE_FOUND) - set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) --endif() -+endif(CCACHE_FOUND) - -diff --git a/project/cmake/modules/FindCXX11.cmake b/project/cmake/modules/FindCXX11.cmake -index c0b9a52..f1b7346 100644 ---- a/project/cmake/modules/FindCXX11.cmake -+++ b/project/cmake/modules/FindCXX11.cmake -@@ -11,8 +11,8 @@ else() - if(CXX_FLAG_CXX0X) - add_options (CXX ALL_BUILDS "-std=c++0x") - set(CXX_STD11_FLAGS "-std=c++0x") -- endif() --endif() -+ endif(CXX_FLAG_CXX0X) -+endif(CXX_FLAG_CXX11) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS) -diff --git a/project/cmake/modules/FindCrossGUID.cmake b/project/cmake/modules/FindCrossGUID.cmake -index 05f2abc..df40c9e 100644 ---- a/project/cmake/modules/FindCrossGUID.cmake -+++ b/project/cmake/modules/FindCrossGUID.cmake -@@ -5,7 +5,6 @@ if(ENABLE_INTERNAL_CROSSGUID) - list(GET CGUID_VER 0 CGUID_VER) - string(SUBSTRING "${CGUID_VER}" 8 -1 CGUID_VER) - -- set(CROSSGUID_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a) - externalproject_add(crossguid - URL http://mirrors.kodi.tv/build-deps/sources/crossguid-${CGUID_VER}.tar.gz - PREFIX ${CORE_BUILD_DIR}/crossguid -@@ -19,11 +18,10 @@ if(ENABLE_INTERNAL_CROSSGUID) - && - ${CMAKE_COMMAND} -E copy - ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake -- -- BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) -+ ) - - set(CROSSGUID_FOUND 1) -- set(CROSSGUID_LIBRARIES ${CROSSGUID_LIBRARY}) -+ set(CROSSGUID_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/libcrossguid.a) - set(CROSSGUID_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) - - include(FindPackageHandleStandardArgs) -diff --git a/project/cmake/modules/FindD3DX11Effects.cmake b/project/cmake/modules/FindD3DX11Effects.cmake -index 5a58993..9de8c2b 100644 ---- a/project/cmake/modules/FindD3DX11Effects.cmake -+++ b/project/cmake/modules/FindD3DX11Effects.cmake -@@ -6,20 +6,19 @@ - # D3DCOMPILER_DLL - Path to the Direct3D Compiler - - include(ExternalProject) --set(D3DX11EFFECTS_LIBRARY_RELEASE ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Release/Effects11.lib) --set(D3DX11EFFECTS_LIBRARY_DEBUG ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Debug/Effects11.lib) - ExternalProject_Add(d3dx11effects - SOURCE_DIR ${CORE_SOURCE_DIR}/lib/win32/Effects11 - PREFIX ${CORE_BUILD_DIR}/Effects11 - CONFIGURE_COMMAND "" - BUILD_COMMAND msbuild ${CORE_SOURCE_DIR}/lib/win32/Effects11/Effects11_2013.sln - /t:Effects11 /p:Configuration=${CORE_BUILD_CONFIG} -- INSTALL_COMMAND "" -- BUILD_BYPRODUCTS ${D3DX11EFFECTS_LIBRARY_RELEASE} ${D3DX11EFFECTS_LIBRARY_DEBUG}) -+ INSTALL_COMMAND "") - - set(D3DX11EFFECTS_FOUND 1) - set(D3DX11EFFECTS_INCLUDE_DIRS ${CORE_SOURCE_DIR}/lib/win32/Effects11/inc) - -+set(D3DX11EFFECTS_LIBRARY_RELEASE ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Release/Effects11.lib) -+set(D3DX11EFFECTS_LIBRARY_DEBUG ${CORE_SOURCE_DIR}/lib/win32/Effects11/libs/Effects11/Debug/Effects11.lib) - include(SelectLibraryConfigurations) - select_library_configurations(D3DX11EFFECTS) - -diff --git a/project/cmake/modules/FindEMBEDDED.cmake b/project/cmake/modules/FindEMBEDDED.cmake -index 856d601..bc1b456 100644 ---- a/project/cmake/modules/FindEMBEDDED.cmake -+++ b/project/cmake/modules/FindEMBEDDED.cmake -@@ -11,7 +11,7 @@ endif() - string(REGEX MATCH "^arm" TARGET_ARCH_ARM "${CMAKE_SYSTEM_PROCESSOR}") - if(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) - return() --endif() -+endif(NOT CMAKE_CROSSCOMPILING AND NOT TARGET_ARCH_ARM) - - find_path(EMBEDDED_FOUND NAMES include/linux/imxfb.h include/bcm_host.h PATHS /opt/vc) - -diff --git a/project/cmake/modules/FindFFMPEG.cmake b/project/cmake/modules/FindFFMPEG.cmake -index 1c600cd..caa7053 100644 ---- a/project/cmake/modules/FindFFMPEG.cmake -+++ b/project/cmake/modules/FindFFMPEG.cmake -@@ -44,7 +44,7 @@ if(ENABLE_INTERNAL_FFMPEG) - - file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper - "#!/bin/bash --if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}.so* || $@ == *${APP_NAME_LC}-test* ]] -+if [[ $@ == *${APP_NAME_LC}.bin* || $@ == *${APP_NAME_LC}-test* ]] - then - avformat=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavcodec` - avcodec=`PKG_CONFIG_PATH=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/pkgconfig ${PKG_CONFIG_EXECUTABLE} --libs --static libavformat` -@@ -61,7 +61,6 @@ fi") - DESTINATION ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE) - set(FFMPEG_LINK_EXECUTABLE "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper -o " PARENT_SCOPE) -- set(FFMPEG_CREATE_SHARED_LIBRARY "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg-link-wrapper -o " PARENT_SCOPE) - set(FFMPEG_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include) - list(APPEND FFMPEG_DEFINITIONS -DFFMPEG_VER_SHA=\"${FFMPEG_VER}\" - -DUSE_STATIC_FFMPEG=1) -diff --git a/project/cmake/modules/FindLibDvd.cmake b/project/cmake/modules/FindLibDvd.cmake -index 834d436..5588e78 100644 ---- a/project/cmake/modules/FindLibDvd.cmake -+++ b/project/cmake/modules/FindLibDvd.cmake -@@ -21,25 +21,15 @@ if(NOT WIN32) - endif() - - if(APPLE) -- set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") -- endif() -- -- set(HOST_ARCH ${ARCH}) -- if(CORE_SYSTEM_NAME STREQUAL android) -- if(ARCH STREQUAL arm) -- set(HOST_ARCH arm-linux-androideabi) -- elseif(ARCH STREQUAL i486-linux) -- set(HOST_ARCH i686-linux-android) -- endif() -+ set(CMAKE_LD_FLAGS "-framework IOKit -framework CoreFoundation") - endif() - - if(ENABLE_DVDCSS) -- set(DVDCSS_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a) - ExternalProject_Add(dvdcss URL ${libdvdcss_BASE_URL}/archive/${libdvdcss_VER}.tar.gz - PREFIX ${CORE_BUILD_DIR}/libdvd - CONFIGURE_COMMAND ac_cv_path_GIT= /configure -- --target=${HOST_ARCH} -- --host=${HOST_ARCH} -+ --target=${ARCH} -+ --host=${ARCH} - --disable-doc - --enable-static - --disable-shared -@@ -47,36 +37,34 @@ if(NOT WIN32) - --prefix= - "${EXTRA_FLAGS}" - "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" -- "LDFLAGS=${CMAKE_LD_FLAGS}" -- BUILD_BYPRODUCTS ${DVDCSS_LIBRARY}) -+ "LDFLAGS=${CMAKE_LD_FLAGS}") - ExternalProject_Add_Step(dvdcss autoreconf - DEPENDEES download update patch - DEPENDERS configure - COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif - WORKING_DIRECTORY ) - -- core_link_library(${DVDCSS_LIBRARY} system/players/VideoPlayer/libdvdcss dvdcss) -+ core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a -+ system/players/VideoPlayer/libdvdcss dvdcss) - endif() - - set(DVDREAD_CFLAGS "-D_XBMC") - if(ENABLE_DVDCSS) - set(DVDREAD_CFLAGS "${DVDREAD_CFLAGS} -DHAVE_DVDCSS_DVDCSS_H -I${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include") -- endif() -+ endif(ENABLE_DVDCSS) - -- set(DVDREAD_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a) - ExternalProject_Add(dvdread URL ${libdvdread_BASE_URL}/archive/${libdvdread_VER}.tar.gz - PREFIX ${CORE_BUILD_DIR}/libdvd - CONFIGURE_COMMAND ac_cv_path_GIT= /configure -- --target=${HOST_ARCH} -- --host=${HOST_ARCH} -+ --target=${ARCH} -+ --host=${ARCH} - --enable-static - --disable-shared - --with-pic - --prefix= - "${EXTRA_FLAGS}" - "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" -- "LDFLAGS=${CMAKE_LD_FLAGS}" -- BUILD_BYPRODUCTS ${DVDREAD_LIBRARY}) -+ "LDFLAGS=${CMAKE_LD_FLAGS}") - ExternalProject_Add_Step(dvdread autoreconf - DEPENDEES download update patch - DEPENDERS configure -@@ -86,18 +74,18 @@ if(NOT WIN32) - add_dependencies(dvdread dvdcss) - endif() - -- core_link_library(${DVDREAD_LIBRARY} system/players/VideoPlayer/libdvdread dvdread) -+ core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a -+ system/players/VideoPlayer/libdvdread dvdread) - - if(ENABLE_DVDCSS) - set(DVDNAV_LIBS -ldvdcss) -- endif() -+ endif(ENABLE_DVDCSS) - -- set(DVDNAV_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a) - ExternalProject_Add(dvdnav URL ${libdvdnav_BASE_URL}/archive/${libdvdnav_VER}.tar.gz - PREFIX ${CORE_BUILD_DIR}/libdvd - CONFIGURE_COMMAND ac_cv_path_GIT= /configure -- --target=${HOST_ARCH} -- --host=${HOST_ARCH} -+ --target=${ARCH} -+ --host=${ARCH} - --enable-static - --disable-shared - --with-pic -@@ -107,22 +95,23 @@ if(NOT WIN32) - "CFLAGS=${CMAKE_C_FLAGS} ${DVDREAD_CFLAGS}" - "DVDREAD_CFLAGS=${DVDREAD_CFLAGS}" - "DVDREAD_LIBS=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.la" -- "LIBS=${DVDNAV_LIBS}" -- BUILD_BYPRODUCTS ${DVDNAV_LIBRARY}) -+ "LIBS=${DVDNAV_LIBS}") - ExternalProject_Add_Step(dvdnav autoreconf - DEPENDEES download update patch - DEPENDERS configure - COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} autoreconf -vif - WORKING_DIRECTORY ) - add_dependencies(dvdnav dvdread) -- core_link_library(${DVDNAV_LIBRARY} system/players/VideoPlayer/libdvdnav dvdnav) -+ core_link_library(${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a -+ system/players/VideoPlayer/libdvdnav dvdnav) - - set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) - - set(LIBDVD_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/include) -- set(LIBDVD_LIBRARIES ${DVDNAV_LIBRARY} ${DVDREAD_LIBRARY}) -+ set(LIBDVD_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdnav.a -+ ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdread.a) - if(ENABLE_DVDCSS) -- list(APPEND LIBDVD_LIBRARIES ${DVDCSS_LIBRARY}) -+ list(APPEND LIBDVD_LIBRARIES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/libdvd/lib/libdvdcss.a) - endif() - set(LIBDVD_LIBRARIES ${LIBDVD_LIBRARIES} CACHE STRING "libdvd libraries" FORCE) - set(LIBDVD_FOUND 1 CACHE BOOL "libdvd found" FORCE) -diff --git a/project/cmake/modules/FindLibSmbClient.cmake b/project/cmake/modules/FindLibSmbClient.cmake -index e61e4a9..897fa7b 100644 ---- a/project/cmake/modules/FindLibSmbClient.cmake -+++ b/project/cmake/modules/FindLibSmbClient.cmake -@@ -5,10 +5,10 @@ if(PKGCONFIG_FOUND) - set(LIBSMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) - endif() - --if(LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS) -+if (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS) - # in cache already - set(LIBSMBCLIENT_FOUND TRUE) --else() -+else (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS) - find_path(LIBSMBCLIENT_INCLUDE_DIR - NAMES - libsmbclient.h -@@ -29,37 +29,37 @@ else() - /sw/lib - ) - -- if(SMBCLIENT_LIBRARY) -+ if (SMBCLIENT_LIBRARY) - set(SMBCLIENT_FOUND TRUE) -- endif() -+ endif (SMBCLIENT_LIBRARY) - - set(LIBSMBCLIENT_INCLUDE_DIRS - ${LIBSMBCLIENT_INCLUDE_DIR} - ) - -- if(SMBCLIENT_FOUND) -+ if (SMBCLIENT_FOUND) - set(LIBSMBCLIENT_LIBRARIES - ${LIBSMBCLIENT_LIBRARIES} - ${SMBCLIENT_LIBRARY} - ) -- endif() -+ endif (SMBCLIENT_FOUND) - -- if(LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES) -+ if (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES) - set(LIBSMBCLIENT_FOUND TRUE) -- endif() -+ endif (LIBSMBCLIENT_INCLUDE_DIRS AND LIBSMBCLIENT_LIBRARIES) - -- if(LIBSMBCLIENT_FOUND) -- if(NOT Libsmbclient_FIND_QUIETLY) -+ if (LIBSMBCLIENT_FOUND) -+ if (NOT Libsmbclient_FIND_QUIETLY) - message(STATUS "Found Libsmbclient: ${LIBSMBCLIENT_LIBRARIES}") -- endif() -- else() -- if(Libsmbclient_FIND_REQUIRED) -+ endif (NOT Libsmbclient_FIND_QUIETLY) -+ else (LIBSMBCLIENT_FOUND) -+ if (Libsmbclient_FIND_REQUIRED) - message(FATAL_ERROR "Could not find Libsmbclient") -- endif() -- endif() -+ endif (Libsmbclient_FIND_REQUIRED) -+ endif (LIBSMBCLIENT_FOUND) - set(LIBSMBCLIENT_DEFINITIONS -DHAVE_LIBSMBCLIENT=1) - - # show the LIBSMBCLIENT_INCLUDE_DIRS and LIBSMBCLIENT_LIBRARIES variables only in the advanced view - mark_as_advanced(LIBSMBCLIENT_INCLUDE_DIRS LIBSMBCLIENT_LIBRARIES LIBSMBCLIENT_DEFINITIONS) - --endif() -+endif (LIBSMBCLIENT_LIBRARIES AND LIBSMBCLIENT_INCLUDE_DIRS) -diff --git a/project/cmake/modules/FindLzo2.cmake b/project/cmake/modules/FindLzo2.cmake -index 2dbd308..33eee10 100644 ---- a/project/cmake/modules/FindLzo2.cmake -+++ b/project/cmake/modules/FindLzo2.cmake -@@ -12,11 +12,11 @@ - # For details see the accompanying COPYING-CMAKE-SCRIPTS file. - - --find_path(LZO2_INCLUDE_DIRS lzo1x.h PATH_SUFFIXES lzo) -+FIND_PATH(LZO2_INCLUDE_DIRS lzo1x.h PATH_SUFFIXES lzo) - --find_library(LZO2_LIBRARIES NAMES lzo2 liblzo2) -+FIND_LIBRARY(LZO2_LIBRARIES NAMES lzo2 liblzo2) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Lzo2 DEFAULT_MSG LZO2_INCLUDE_DIRS LZO2_LIBRARIES) - --mark_as_advanced(LZO2_INCLUDE_DIRS LZO2_LIBRARIES) -+MARK_AS_ADVANCED(LZO2_INCLUDE_DIRS LZO2_LIBRARIES) -diff --git a/project/cmake/modules/FindMicroHttpd.cmake b/project/cmake/modules/FindMicroHttpd.cmake -index 0cab031..f73dc77 100644 ---- a/project/cmake/modules/FindMicroHttpd.cmake -+++ b/project/cmake/modules/FindMicroHttpd.cmake -@@ -1,24 +1,24 @@ --if(NOT WIN32) -+IF (NOT WIN32) - include(FindPkgConfig) -- if( PKG_CONFIG_FOUND ) -+ if ( PKG_CONFIG_FOUND ) - - pkg_check_modules (MICROHTTPD libmicrohttpd>=0.4) - - set(MICROHTTPD_DEFINITIONS ${MICROHTTPD_CFLAGS_OTHER}) -- endif() --endif() -+ endif(PKG_CONFIG_FOUND) -+endif (NOT WIN32) - - # - # set defaults - if(NOT MICROHTTPD_FOUND) -- set(_microhttpd_HOME "/usr/local") -- set(_microhttpd_INCLUDE_SEARCH_DIRS -+ SET(_microhttpd_HOME "/usr/local") -+ SET(_microhttpd_INCLUDE_SEARCH_DIRS - ${CMAKE_INCLUDE_PATH} - /usr/local/include - /usr/include - ) - -- set(_microhttpd_LIBRARIES_SEARCH_DIRS -+ SET(_microhttpd_LIBRARIES_SEARCH_DIRS - ${CMAKE_LIBRARY_PATH} - /usr/local/lib - /usr/lib -@@ -28,39 +28,39 @@ if(NOT MICROHTTPD_FOUND) - if( "${MICROHTTPD_HOME}" STREQUAL "") - if("" MATCHES "$ENV{MICROHTTPD_HOME}") - message(STATUS "MICROHTTPD_HOME env is not set, setting it to /usr/local") -- set(MICROHTTPD_HOME ${_microhttpd_HOME}) -- else() -- set(MICROHTTPD_HOME "$ENV{MICROHTTPD_HOME}") -- endif() -- else() -+ set (MICROHTTPD_HOME ${_microhttpd_HOME}) -+ else("" MATCHES "$ENV{MICROHTTPD_HOME}") -+ set (MICROHTTPD_HOME "$ENV{MICROHTTPD_HOME}") -+ endif("" MATCHES "$ENV{MICROHTTPD_HOME}") -+ else( "${MICROHTTPD_HOME}" STREQUAL "") - message(STATUS "MICROHTTPD_HOME is not empty: \"${MICROHTTPD_HOME}\"") -- endif() -+ endif( "${MICROHTTPD_HOME}" STREQUAL "") - ## - - message(STATUS "Looking for microhttpd in ${MICROHTTPD_HOME}") - -- if( NOT ${MICROHTTPD_HOME} STREQUAL "" ) -- set(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) -- set(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) -- set(_microhttpd_HOME ${MICROHTTPD_HOME}) -- endif() -+ IF( NOT ${MICROHTTPD_HOME} STREQUAL "" ) -+ SET(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) -+ SET(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) -+ SET(_microhttpd_HOME ${MICROHTTPD_HOME}) -+ ENDIF( NOT ${MICROHTTPD_HOME} STREQUAL "" ) - -- if( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" ) -- set(_microhttpd_INCLUDE_SEARCH_DIRS $ENV{MICROHTTPD_INCLUDEDIR} ${_microhttpd_INCLUDE_SEARCH_DIRS}) -- endif() -+ IF( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" ) -+ SET(_microhttpd_INCLUDE_SEARCH_DIRS $ENV{MICROHTTPD_INCLUDEDIR} ${_microhttpd_INCLUDE_SEARCH_DIRS}) -+ ENDIF( NOT $ENV{MICROHTTPD_INCLUDEDIR} STREQUAL "" ) - -- if( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) -- set(_microhttpd_LIBRARIES_SEARCH_DIRS $ENV{MICROHTTPD_LIBRARYDIR} ${_microhttpd_LIBRARIES_SEARCH_DIRS}) -- endif() -+ IF( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) -+ SET(_microhttpd_LIBRARIES_SEARCH_DIRS $ENV{MICROHTTPD_LIBRARYDIR} ${_microhttpd_LIBRARIES_SEARCH_DIRS}) -+ ENDIF( NOT $ENV{MICROHTTPD_LIBRARYDIR} STREQUAL "" ) - -- if( MICROHTTPD_HOME ) -- set(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) -- set(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) -- set(_microhttpd_HOME ${MICROHTTPD_HOME}) -- endif() -+ IF( MICROHTTPD_HOME ) -+ SET(_microhttpd_INCLUDE_SEARCH_DIRS ${MICROHTTPD_HOME}/include ${_microhttpd_INCLUDE_SEARCH_DIRS}) -+ SET(_microhttpd_LIBRARIES_SEARCH_DIRS ${MICROHTTPD_HOME}/lib ${_microhttpd_LIBRARIES_SEARCH_DIRS}) -+ SET(_microhttpd_HOME ${MICROHTTPD_HOME}) -+ ENDIF( MICROHTTPD_HOME ) - - # find the include files -- find_path(MICROHTTPD_INCLUDE_DIRS microhttpd.h -+ FIND_PATH(MICROHTTPD_INCLUDE_DIRS microhttpd.h - HINTS - ${_microhttpd_INCLUDE_SEARCH_DIRS} - ${PC_MICROHTTPD_INCLUDEDIR} -@@ -69,12 +69,12 @@ if(NOT MICROHTTPD_FOUND) - ) - - # locate the library -- if(WIN32) -- set(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.lib) -- else() -- set(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.a) -- endif() -- find_library(MICROHTTPD_LIBRARIES NAMES ${MICROHTTPD_LIBRARY_NAMES} -+ IF(WIN32) -+ SET(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.lib) -+ ELSE(WIN32) -+ SET(MICROHTTPD_LIBRARY_NAMES ${MICROHTTPD_LIBRARY_NAMES} libmicrohttpd.a) -+ ENDIF(WIN32) -+ FIND_LIBRARY(MICROHTTPD_LIBRARIES NAMES ${MICROHTTPD_LIBRARY_NAMES} - HINTS - ${_microhttpd_LIBRARIES_SEARCH_DIRS} - ${PC_MICROHTTPD_LIBDIR} -@@ -82,9 +82,9 @@ if(NOT MICROHTTPD_FOUND) - ) - - # if the include and the program are found then we have it -- if(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) -- set(MICROHTTPD_FOUND "YES") -- endif() -+ IF(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) -+ SET(MICROHTTPD_FOUND "YES") -+ ENDIF(MICROHTTPD_INCLUDE_DIRS AND MICROHTTPD_LIBRARIES) - - if( NOT WIN32) - find_library(GCRYPT_LIBRARY gcrypt) -@@ -93,12 +93,12 @@ if(NOT MICROHTTPD_FOUND) - if(NOT APPLE AND NOT CORE_SYSTEM_NAME STREQUAL android) - list(APPEND MICROHTTPD_LIBRARIES "-lrt") - endif() -- endif() -+ endif( NOT WIN32) - endif() - - list(APPEND MICROHTTPD_DEFINITIONS -DHAVE_LIBMICROHTTPD=1) - --mark_as_advanced( -+MARK_AS_ADVANCED( - MICROHTTPD_FOUND - MICROHTTPD_LIBRARIES - MICROHTTPD_DEFINITIONS -diff --git a/project/cmake/modules/FindOpenGl.cmake b/project/cmake/modules/FindOpenGl.cmake -index 139a821..9d6ec01 100644 ---- a/project/cmake/modules/FindOpenGl.cmake -+++ b/project/cmake/modules/FindOpenGl.cmake -@@ -14,7 +14,7 @@ if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_OPENGL gl glu) - endif() - --if(NOT CORE_SYSTEM_NAME STREQUAL osx) -+if(NOT CORE_SYSTEM_NAME STREQUAL darwin) - find_path(OPENGL_INCLUDE_DIR GL/gl.h - PATHS ${PC_OPENGL_gl_INCLUDEDIR}) - find_library(OPENGL_gl_LIBRARY NAMES GL -diff --git a/project/cmake/modules/FindPulseAudio.cmake b/project/cmake/modules/FindPulseAudio.cmake -index f471f78..5b57364 100644 ---- a/project/cmake/modules/FindPulseAudio.cmake -+++ b/project/cmake/modules/FindPulseAudio.cmake -@@ -13,57 +13,57 @@ - # Redistribution and use is allowed according to the terms of the BSD license. - # For details see the accompanying COPYING-CMAKE-SCRIPTS file. - --if(NOT PULSEAUDIO_MINIMUM_VERSION) -+if (NOT PULSEAUDIO_MINIMUM_VERSION) - set(PULSEAUDIO_MINIMUM_VERSION "1.0.0") --endif() -+endif (NOT PULSEAUDIO_MINIMUM_VERSION) - --if(PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) -+if (PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) - # Already in cache, be silent - set(PULSEAUDIO_FIND_QUIETLY TRUE) --endif() -+endif (PULSEAUDIO_INCLUDE_DIRS AND PULSEAUDIO_LIBRARY AND PULSEAUDIO_MAINLOOP_LIBRARY) - --if(NOT WIN32) -+if (NOT WIN32) - include(FindPkgConfig) - pkg_check_modules(PC_PULSEAUDIO libpulse>=${PULSEAUDIO_MINIMUM_VERSION}) - pkg_check_modules(PC_PULSEAUDIO_MAINLOOP libpulse-mainloop-glib) --endif() -+endif (NOT WIN32) - --find_path(PULSEAUDIO_INCLUDE_DIRS pulse/pulseaudio.h -+FIND_PATH(PULSEAUDIO_INCLUDE_DIRS pulse/pulseaudio.h - HINTS - ${PC_PULSEAUDIO_INCLUDEDIR} - ${PC_PULSEAUDIO_INCLUDE_DIRS} - ) - --find_library(PULSEAUDIO_LIBRARY NAMES pulse libpulse -+FIND_LIBRARY(PULSEAUDIO_LIBRARY NAMES pulse libpulse - HINTS - ${PC_PULSEAUDIO_LIBDIR} - ${PC_PULSEAUDIO_LIBRARY_DIRS} - ) - --find_library(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib -+FIND_LIBRARY(PULSEAUDIO_MAINLOOP_LIBRARY NAMES pulse-mainloop pulse-mainloop-glib libpulse-mainloop-glib - HINTS - ${PC_PULSEAUDIO_LIBDIR} - ${PC_PULSEAUDIO_LIBRARY_DIRS} - ) - --if(NOT PULSEAUDIO_INCLUDE_DIRS OR NOT PULSEAUDIO_LIBRARY) -+if (NOT PULSEAUDIO_INCLUDE_DIRS OR NOT PULSEAUDIO_LIBRARY) - set(PULSEAUDIO_FOUND FALSE) - else() - set(PULSEAUDIO_FOUND TRUE) - endif() - --if(PULSEAUDIO_FOUND) -- if(NOT PULSEAUDIO_FIND_QUIETLY) -+if (PULSEAUDIO_FOUND) -+ if (NOT PULSEAUDIO_FIND_QUIETLY) - message(STATUS "Found PulseAudio: ${PULSEAUDIO_LIBRARY}") -- if(PULSEAUDIO_MAINLOOP_LIBRARY) -+ if (PULSEAUDIO_MAINLOOP_LIBRARY) - message(STATUS "Found PulseAudio Mainloop: ${PULSEAUDIO_MAINLOOP_LIBRARY}") -- else() -+ else (PULSAUDIO_MAINLOOP_LIBRARY) - message(STATUS "Could NOT find PulseAudio Mainloop Library") -- endif() -- endif() --else() -+ endif (PULSEAUDIO_MAINLOOP_LIBRARY) -+ endif (NOT PULSEAUDIO_FIND_QUIETLY) -+else (PULSEAUDIO_FOUND) - message(STATUS "Could NOT find PulseAudio") --endif() -+endif (PULSEAUDIO_FOUND) - - set(PULSEAUDIO_LIBRARIES ${PULSEAUDIO_LIBRARY}) - -diff --git a/project/cmake/modules/FindRTMP.cmake b/project/cmake/modules/FindRTMP.cmake -new file mode 100644 -index 0000000..432b77d ---- /dev/null -+++ b/project/cmake/modules/FindRTMP.cmake -@@ -0,0 +1,21 @@ -+# - Try to find rtmp -+# Once done this will define -+# -+# RTMP_FOUND - system has librtmp -+# RTMP_INCLUDE_DIRS - the librtmp include directory -+# RTMP_LIBRARIES - The librtmp libraries -+ -+if(PKG_CONFIG_FOUND) -+ pkg_check_modules (RTMP librtmp) -+ list(APPEND RTMP_INCLUDE_DIRS ${RTMP_INCLUDEDIR}) -+else() -+ find_path(RTMP_INCLUDE_DIRS librtmp/rtmp.h) -+ find_library(RTMP_LIBRARIES rtmp) -+endif() -+ -+include(FindPackageHandleStandardArgs) -+find_package_handle_standard_args(RTMP DEFAULT_MSG RTMP_INCLUDE_DIRS RTMP_LIBRARIES) -+ -+list(APPEND RTMP_DEFINITIONS -DHAS_LIBRTMP=1) -+ -+mark_as_advanced(RTMP_INCLUDE_DIRS RTMP_LIBRARIES RTMP_DEFINITIONS) -diff --git a/project/cmake/modules/FindSSE.cmake b/project/cmake/modules/FindSSE.cmake -index 14009be..c76b811 100644 ---- a/project/cmake/modules/FindSSE.cmake -+++ b/project/cmake/modules/FindSSE.cmake -@@ -1,105 +1,105 @@ - # Check if SSE instructions are available on the machine where - # the project is compiled. - --if(CMAKE_SYSTEM_NAME MATCHES "Linux") -- exec_program(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) -+IF(CMAKE_SYSTEM_NAME MATCHES "Linux") -+ EXEC_PROGRAM(cat ARGS "/proc/cpuinfo" OUTPUT_VARIABLE CPUINFO) - -- string(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE) -- if(SSE2_TRUE) -+ STRING(REGEX REPLACE "^.*(sse2).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "sse2" "${SSE_THERE}" SSE2_TRUE) -+ IF (SSE2_TRUE) - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") -- else() -+ ELSE (SSE2_TRUE) - set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") -- endif() -+ ENDIF (SSE2_TRUE) - - # /proc/cpuinfo apparently omits sse3 :( -- string(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "sse3" "${SSE_THERE}" SSE3_TRUE) -- if(NOT SSE3_TRUE) -- string(REGEX REPLACE "^.*(T2300).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "T2300" "${SSE_THERE}" SSE3_TRUE) -- endif() -+ STRING(REGEX REPLACE "^.*[^s](sse3).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "sse3" "${SSE_THERE}" SSE3_TRUE) -+ IF (NOT SSE3_TRUE) -+ STRING(REGEX REPLACE "^.*(T2300).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "T2300" "${SSE_THERE}" SSE3_TRUE) -+ ENDIF (NOT SSE3_TRUE) - -- string(REGEX REPLACE "^.*(ssse3).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE) -- if(SSE3_TRUE OR SSSE3_TRUE) -+ STRING(REGEX REPLACE "^.*(ssse3).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "ssse3" "${SSE_THERE}" SSSE3_TRUE) -+ IF (SSE3_TRUE OR SSSE3_TRUE) - set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") -- else() -+ ELSE (SSE3_TRUE OR SSSE3_TRUE) - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") -- endif() -- if(SSSE3_TRUE) -+ ENDIF (SSE3_TRUE OR SSSE3_TRUE) -+ IF (SSSE3_TRUE) - set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") -- else() -+ ELSE (SSSE3_TRUE) - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") -- endif() -+ ENDIF (SSSE3_TRUE) - -- string(REGEX REPLACE "^.*(sse4_1).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "sse4_1" "${SSE_THERE}" SSE41_TRUE) -- if(SSE41_TRUE) -+ STRING(REGEX REPLACE "^.*(sse4_1).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "sse4_1" "${SSE_THERE}" SSE41_TRUE) -+ IF (SSE41_TRUE) - set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") -- else() -+ ELSE (SSE41_TRUE) - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") -- endif() --elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin") -- exec_program("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE -+ ENDIF (SSE41_TRUE) -+ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") -+ EXEC_PROGRAM("/usr/sbin/sysctl -n machdep.cpu.features" OUTPUT_VARIABLE - CPUINFO) - -- string(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE) -- if(SSE2_TRUE) -+ STRING(REGEX REPLACE "^.*[^S](SSE2).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "SSE2" "${SSE_THERE}" SSE2_TRUE) -+ IF (SSE2_TRUE) - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") -- else() -+ ELSE (SSE2_TRUE) - set(SSE2_FOUND false CACHE BOOL "SSE2 available on host") -- endif() -+ ENDIF (SSE2_TRUE) - -- string(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "SSE3" "${SSE_THERE}" SSE3_TRUE) -- if(SSE3_TRUE) -+ STRING(REGEX REPLACE "^.*[^S](SSE3).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "SSE3" "${SSE_THERE}" SSE3_TRUE) -+ IF (SSE3_TRUE) - set(SSE3_FOUND true CACHE BOOL "SSE3 available on host") -- else() -+ ELSE (SSE3_TRUE) - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") -- endif() -+ ENDIF (SSE3_TRUE) - -- string(REGEX REPLACE "^.*(SSSE3).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "SSSE3" "${SSE_THERE}" SSSE3_TRUE) -- if(SSSE3_TRUE) -+ STRING(REGEX REPLACE "^.*(SSSE3).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "SSSE3" "${SSE_THERE}" SSSE3_TRUE) -+ IF (SSSE3_TRUE) - set(SSSE3_FOUND true CACHE BOOL "SSSE3 available on host") -- else() -+ ELSE (SSSE3_TRUE) - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") -- endif() -+ ENDIF (SSSE3_TRUE) - -- string(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" SSE_THERE ${CPUINFO}) -- string(COMPARE EQUAL "SSE4.1" "${SSE_THERE}" SSE41_TRUE) -- if(SSE41_TRUE) -+ STRING(REGEX REPLACE "^.*(SSE4.1).*$" "\\1" SSE_THERE ${CPUINFO}) -+ STRING(COMPARE EQUAL "SSE4.1" "${SSE_THERE}" SSE41_TRUE) -+ IF (SSE41_TRUE) - set(SSE4_1_FOUND true CACHE BOOL "SSE4.1 available on host") -- else() -+ ELSE (SSE41_TRUE) - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") -- endif() --elseif(CMAKE_SYSTEM_NAME MATCHES "Windows") -+ ENDIF (SSE41_TRUE) -+ELSEIF(CMAKE_SYSTEM_NAME MATCHES "Windows") - # TODO - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") --else() -+ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux") - set(SSE2_FOUND true CACHE BOOL "SSE2 available on host") - set(SSE3_FOUND false CACHE BOOL "SSE3 available on host") - set(SSSE3_FOUND false CACHE BOOL "SSSE3 available on host") - set(SSE4_1_FOUND false CACHE BOOL "SSE4.1 available on host") --endif() -+ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux") - - if(NOT SSE2_FOUND) -- message(STATUS "Could not find hardware support for SSE2 on this machine.") --endif() -+ MESSAGE(STATUS "Could not find hardware support for SSE2 on this machine.") -+endif(NOT SSE2_FOUND) - if(NOT SSE3_FOUND) -- message(STATUS "Could not find hardware support for SSE3 on this machine.") --endif() -+ MESSAGE(STATUS "Could not find hardware support for SSE3 on this machine.") -+endif(NOT SSE3_FOUND) - if(NOT SSSE3_FOUND) -- message(STATUS "Could not find hardware support for SSSE3 on this machine.") --endif() -+ MESSAGE(STATUS "Could not find hardware support for SSSE3 on this machine.") -+endif(NOT SSSE3_FOUND) - if(NOT SSE4_1_FOUND) -- message(STATUS "Could not find hardware support for SSE4.1 on this machine.") --endif() -+ MESSAGE(STATUS "Could not find hardware support for SSE4.1 on this machine.") -+endif(NOT SSE4_1_FOUND) - - mark_as_advanced(SSE2_FOUND SSE3_FOUND SSSE3_FOUND SSE4_1_FOUND) - -diff --git a/project/cmake/modules/FindTagLib.cmake b/project/cmake/modules/FindTagLib.cmake -index 0a9c353..06b615d 100644 ---- a/project/cmake/modules/FindTagLib.cmake -+++ b/project/cmake/modules/FindTagLib.cmake -@@ -14,7 +14,7 @@ - # TagLib::TagLib - The TagLib library - - if(PKG_CONFIG_FOUND) -- pkg_check_modules(PC_TAGLIB taglib>=1.9.0 QUIET) -+ pkg_check_modules(PC_TAGLIB taglib>=1.8.0 QUIET) - endif() - - find_path(TAGLIB_INCLUDE_DIR taglib/tag.h -diff --git a/project/cmake/modules/FindXslt.cmake b/project/cmake/modules/FindXslt.cmake -index f03124d..442ba43 100644 ---- a/project/cmake/modules/FindXslt.cmake -+++ b/project/cmake/modules/FindXslt.cmake -@@ -15,8 +15,4 @@ endif() - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Xslt DEFAULT_MSG XSLT_INCLUDE_DIRS XSLT_LIBRARIES) - --if(XSLT_FOUND) -- set(XSLT_DEFINITIONS -DHAVE_LIBXSLT=1) --endif() -- - mark_as_advanced(XSLT_INCLUDE_DIRS XSLT_LIBRARIES) -diff --git a/project/cmake/modules/FindYajl.cmake b/project/cmake/modules/FindYajl.cmake -index ef5f3d9..c27b03a 100644 ---- a/project/cmake/modules/FindYajl.cmake -+++ b/project/cmake/modules/FindYajl.cmake -@@ -14,7 +14,7 @@ if(NOT YAJL_FOUND) - file(STRINGS ${YAJL_INCLUDE_DIRS}/yajl/yajl_version.h version_header) - string(REGEX MATCH "YAJL_MAJOR ([0-9]+)" YAJL_VERSION_MAJOR ${version_header}) - string(REGEX REPLACE "YAJL_MAJOR ([0-9]+)" "\\1" YAJL_VERSION_MAJOR "${YAJL_VERSION_MAJOR}") -- if(YAJL_VERSION_MINOR LESS 2) -+ if (YAJL_VERSION_MINOR LESS 2) - set(YAJL_INCLUDE_DIRS) - set(YALJ_LIBRARIES) - endif() -diff --git a/project/cmake/scripts/android/ArchSetup.cmake b/project/cmake/scripts/android/ArchSetup.cmake -index c2a4489..86c0f6a 100644 ---- a/project/cmake/scripts/android/ArchSetup.cmake -+++ b/project/cmake/scripts/android/ArchSetup.cmake -@@ -1,7 +1,5 @@ - if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${PROJECT_SOURCE_DIR}/README.md") --elseif(NOT SDK_PLATFORM) -- message(FATAL_ERROR "Toolchain did not define SDK_PLATFORM. Possibly outdated depends.") - endif() - - set(ARCH_DEFINES -DTARGET_POSIX -DTARGET_LINUX -D_LINUX -DTARGET_ANDROID) -@@ -12,9 +10,9 @@ if(WITH_ARCH) - set(ARCH ${WITH_ARCH}) - else() - if(CPU STREQUAL armeabi-v7a) -- set(ARCH arm) -+ set(ARCH arm-linux-androideabi) - elseif(CPU STREQUAL i686) -- set(ARCH i486-linux) -+ set(ARCH i686-linux-android) - else() - message(SEND_ERROR "Unknown CPU: ${CPU}") - endif() -@@ -28,6 +26,5 @@ set(ENABLE_X11 OFF) - set(ENABLE_EGL ON) - set(ENABLE_AML ON) - set(ENABLE_OPTICAL OFF) --set(ENABLE_BREAKPAD ON) - - list(APPEND DEPLIBS android log jnigraphics) -diff --git a/project/cmake/scripts/android/Install.cmake b/project/cmake/scripts/android/Install.cmake -index f0fd566..e69de29 100644 ---- a/project/cmake/scripts/android/Install.cmake -+++ b/project/cmake/scripts/android/Install.cmake -@@ -1,118 +0,0 @@ --# Android packaging -- --find_program(AAPT_EXECUTABLE aapt PATHS ${SDK_BUILDTOOLS_PATH}) --if(NOT AAPT_EXECUTABLE) -- message(FATAL_ERROR "Could NOT find aapt executable") --endif() --find_program(DX_EXECUTABLE dx PATHS ${SDK_BUILDTOOLS_PATH}) --if(NOT DX_EXECUTABLE) -- message(FATAL_ERROR "Could NOT find dx executable") --endif() --find_program(ZIPALIGN_EXECUTABLE zipalign PATHS ${SDK_BUILDTOOLS_PATH}) --if(NOT ZIPALIGN_EXECUTABLE) -- message(FATAL_ERROR "Could NOT find zipalign executable") --endif() -- --# Configure files into packaging environment. --if(BREAKPAD_FOUND) -- set(USE_BREAKPAD 1) --endif() --configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/Makefile.in -- ${CMAKE_BINARY_DIR}/tools/android/packaging/Makefile @ONLY) --configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/apksign -- ${CMAKE_BINARY_DIR}/tools/android/packaging/apksign COPYONLY) --configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh -- ${CMAKE_BINARY_DIR}/tools/android/packaging/make_symbols.sh COPYONLY) --file(WRITE ${CMAKE_BINARY_DIR}/tools/depends/Makefile.include -- "$(PREFIX)/lib/${APP_NAME_LC}/lib${APP_NAME_LC}.so: ;\n") -- --set(package_files strings.xml -- activity_main.xml -- AndroidManifest.xml -- src/org/xbmc/kodi/XBMCOnAudioFocusChangeListener.java -- src/org/xbmc/kodi/XBMCInputDeviceListener.java -- src/org/xbmc/kodi/Main.java -- src/org/xbmc/kodi/XBMCSettingsContentObserver.java -- src/org/xbmc/kodi/XBMCOnFrameAvailableListener.java -- src/org/xbmc/kodi/XBMCVideoView.java -- src/org/xbmc/kodi/Splash.java -- src/org/xbmc/kodi/XBMCBroadcastReceiver.java) --foreach(file IN LISTS package_files) -- configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in -- ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/${file} @ONLY) --endforeach() -- --# Copy files to the location expected by the Android packaging scripts. --add_custom_target(bundle -- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/media -- ${CMAKE_BINARY_DIR}/tools/android/packaging/media -- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/res -- ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res -- COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python2.7 ${libdir}/python2.7 -- COMMAND ${CMAKE_COMMAND} -E copy $ -- ${libdir}/${APP_NAME_LC}/$) --add_dependencies(bundle ${APP_NAME_LC}) -- --# This function is used to prepare a prefix expected by the Android packaging --# scripts. It creates a bundle_files command that is added to the bundle target. --function(add_bundle_file file destination relative) -- if(NOT TARGET bundle_files) -- file(REMOVE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake) -- add_custom_target(bundle_files COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake) -- add_dependencies(bundle bundle_files) -- add_dependencies(bundle_files export-files pack-skins wrap-libraries generate_json_header) -- endif() -- -- string(REPLACE "${relative}/" "" outfile ${file}) -- get_filename_component(outdir ${outfile} DIRECTORY) -- file(APPEND ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/BundleFiles.cmake -- "file(COPY \"${file}\" DESTINATION \"${destination}/${outdir}\")\n") --endfunction() -- --# Copy files into prefix --foreach(file IN LISTS XBT_FILES install_data) -- string(REPLACE "${CMAKE_BINARY_DIR}/" "" file ${file}) -- add_bundle_file(${CMAKE_BINARY_DIR}/${file} ${datarootdir}/${APP_NAME_LC} ${CMAKE_BINARY_DIR}) --endforeach() -- --foreach(file IN LISTS WRAP_FILES) -- add_bundle_file(${CMAKE_BINARY_DIR}/${file} ${libdir}/${APP_NAME_LC} ${CMAKE_BINARY_DIR}) --endforeach() -- --foreach(lib IN LISTS required_dyload dyload_optional ITEMS Shairplay) -- string(TOUPPER ${lib} lib_up) -- set(lib_so ${${lib_up}_SONAME}) -- if(lib_so AND EXISTS ${DEPENDS_PATH}/lib/${lib_so}) -- add_bundle_file(${DEPENDS_PATH}/lib/${lib_so} ${libdir} "") -- endif() --endforeach() --add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "") -- --# Main targets from Makefile.in --if(CPU MATCHES i686) -- set(CPU x86) -- set(ARCH x86) --endif() --foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean apk-sign) -- add_custom_target(${target} -- COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} ${CMAKE_MAKE_PROGRAM} -- -C ${CMAKE_BINARY_DIR}/tools/android/packaging -- XBMCROOT=${CORE_SOURCE_DIR} -- CC=${CMAKE_C_COMPILER} -- CPU=${CPU} -- ARCH=${ARCH} -- PREFIX=${prefix} -- NDKROOT=${NDKROOT} -- SDKROOT=${SDKROOT} -- SDK_PLATFORM=${SDK_PLATFORM} -- STRIP=${CMAKE_STRIP} -- AAPT=${AAPT_EXECUTABLE} -- DX=${DX_EXECUTABLE} -- ZIPALIGN=${ZIPALIGN_EXECUTABLE} -- ${target} -- WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/android/packaging -- ) -- if(NOT target STREQUAL apk-clean) -- add_dependencies(${target} bundle) -- endif() --endforeach() -diff --git a/project/cmake/scripts/android/PathSetup.cmake b/project/cmake/scripts/android/PathSetup.cmake -deleted file mode 100644 -index 69de883..0000000 ---- a/project/cmake/scripts/android/PathSetup.cmake -+++ /dev/null -@@ -1,33 +0,0 @@ --if(NOT prefix) -- set(prefix ${CMAKE_BINARY_DIR}/install) --endif() --set(CMAKE_INSTALL_PREFIX ${prefix}) --if(NOT exec_prefix) -- set(exec_prefix ${prefix}) --endif() --if(NOT libdir) -- set(libdir ${prefix}/lib) --endif() --if(NOT bindir) -- set(bindir ${prefix}/bin) --endif() --if(NOT includedir) -- set(includedir ${prefix}/include) --endif() --if(NOT datarootdir) -- set(datarootdir ${prefix}/share) --endif() --if(NOT datadir) -- set(datadir ${datarootdir}) --endif() -- --list(APPEND final_message "-- PATH config --") --list(APPEND final_message "Prefix: ${prefix}") --list(APPEND final_message "Libdir: ${libdir}") --list(APPEND final_message "Bindir: ${bindir}") --list(APPEND final_message "Includedir: ${includedir}") --list(APPEND final_message "Datarootdir: ${datarootdir}") --list(APPEND final_message "Datadir: ${datadir}") -- --set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" -- -DINSTALL_PATH=\"${datarootdir}/kodi\") -diff --git a/project/cmake/scripts/android/PathSetup.cmake b/project/cmake/scripts/android/PathSetup.cmake -new file mode 120000 -index 0000000..6786c1c ---- /dev/null -+++ b/project/cmake/scripts/android/PathSetup.cmake -@@ -0,0 +1 @@ -+../linux/PathSetup.cmake -\ No newline at end of file -diff --git a/project/cmake/scripts/common/AddOptions.cmake b/project/cmake/scripts/common/AddOptions.cmake -index 96837c1..0ebb823 100644 ---- a/project/cmake/scripts/common/AddOptions.cmake -+++ b/project/cmake/scripts/common/AddOptions.cmake -@@ -23,56 +23,60 @@ - # - # add_options (CXX RELEASE "-O3" "-DNDEBUG" "-Wall") - --function(add_options langs builds) -+function (add_options langs builds) - # special handling of empty language specification -- if("${langs}" STREQUAL "ALL_LANGUAGES") -- set(langs CXX C Fortran) -- endif() -- foreach(lang IN LISTS langs) -+ if ("${langs}" STREQUAL "ALL_LANGUAGES") -+ set (langs CXX C Fortran) -+ endif ("${langs}" STREQUAL "ALL_LANGUAGES") -+ foreach (lang IN LISTS langs) - # prepend underscore if necessary -- foreach(build IN LISTS builds) -- if(NOT ("${build}" STREQUAL "ALL_BUILDS")) -- set(_bld "_${build}") -- string(TOUPPER "${_bld}" _bld) -- else() -- set(_bld "") -- endif() -- foreach(_opt IN LISTS ARGN) -- set(_var "CMAKE_${lang}_FLAGS${_bld}") -- #message(STATUS "Adding \"${_opt}\" to \${${_var}}") -+ foreach (build IN LISTS builds) -+ if (NOT ("${build}" STREQUAL "ALL_BUILDS")) -+ set (_bld "_${build}") -+ string (TOUPPER "${_bld}" _bld) -+ else (NOT ("${build}" STREQUAL "ALL_BUILDS")) -+ set (_bld "") -+ endif (NOT ("${build}" STREQUAL "ALL_BUILDS")) -+ foreach (_opt IN LISTS ARGN) -+ set (_var "CMAKE_${lang}_FLAGS${_bld}") -+ #message (STATUS "Adding \"${_opt}\" to \${${_var}}") - # remove it first -- string(REPLACE "${_opt}" "" _without "${${_var}}") -- string(STRIP "${_without}" _without) -+ string (REPLACE "${_opt}" "" _without "${${_var}}") -+ string (STRIP "${_without}" _without) - # we need to strip this one as well, so they are comparable -- string(STRIP "${${_var}}" _stripped) -+ string (STRIP "${${_var}}" _stripped) - # if it wasn't there, then add it at the end -- if("${_without}" STREQUAL "${_stripped}") -+ if ("${_without}" STREQUAL "${_stripped}") - # don't add any extra spaces if no options yet are set -- if(NOT ${_stripped} STREQUAL "") -- set(${_var} "${_stripped} ${_opt}") -- else() -- set(${_var} "${_opt}") -- endif() -- set(${_var} "${${_var}}" PARENT_SCOPE) -- endif() -- endforeach() -- endforeach() -- endforeach() --endfunction() -+ if (NOT ${_stripped} STREQUAL "") -+ set (${_var} "${_stripped} ${_opt}") -+ else (NOT ${_stripped} STREQUAL "") -+ set (${_var} "${_opt}") -+ endif (NOT ${_stripped} STREQUAL "") -+ set (${_var} "${${_var}}" PARENT_SCOPE) -+ endif ("${_without}" STREQUAL "${_stripped}") -+ endforeach (_opt) -+ endforeach (build) -+ endforeach (lang) -+endfunction (add_options lang build) - - # set varname to flag unless user has specified something that matches regex --function(set_default_option varname flag regex) -- if(NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" -+function (set_default_option varname flag regex) -+ if (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" - AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") -- set(${varname} ${flag} PARENT_SCOPE) -- else() -- set(${varname} PARENT_SCOPE) -- endif() --endfunction() -+ set (${varname} ${flag} PARENT_SCOPE) -+ else (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" -+ AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" -+ AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") -+ set (${varname} PARENT_SCOPE) -+ endif (NOT "$ENV{CXXFLAGS}" MATCHES "${regex}" -+ AND NOT "${CMAKE_CXX_FLAGS}" MATCHES "${regex}" -+ AND NOT "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}}" MATCHES "${regex}") -+endfunction (set_default_option) - - # note: this must be called before project() --macro(no_default_options) -+macro (no_default_options) - # prevent the platform probe to set options -- set(CMAKE_NOT_USING_CONFIG_FLAGS TRUE) --endmacro() -+ set (CMAKE_NOT_USING_CONFIG_FLAGS TRUE) -+endmacro (no_default_options) -diff --git a/project/cmake/scripts/common/AddonHelpers.cmake b/project/cmake/scripts/common/AddonHelpers.cmake -index b0709e7..e429716 100644 ---- a/project/cmake/scripts/common/AddonHelpers.cmake -+++ b/project/cmake/scripts/common/AddonHelpers.cmake -@@ -21,82 +21,70 @@ endmacro() - - # Grab the version from a given add-on's addon.xml - macro (addon_version dir prefix) -- if(EXISTS ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in) -- file(READ ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in ADDONXML) -- else() -- file(READ ${dir}/addon.xml ADDONXML) -- endif() -- -- string(REGEX MATCH "]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML}) -- string(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING}) -+ IF(EXISTS ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in) -+ FILE(READ ${PROJECT_SOURCE_DIR}/${dir}/addon.xml.in ADDONXML) -+ ELSE() -+ FILE(READ ${dir}/addon.xml ADDONXML) -+ ENDIF() -+ -+ STRING(REGEX MATCH "]*version.?=.?.[0-9\\.]+" VERSION_STRING ${ADDONXML}) -+ STRING(REGEX REPLACE ".*version=.([0-9\\.]+).*" "\\1" ${prefix}_VERSION ${VERSION_STRING}) - message(STATUS ${prefix}_VERSION=${${prefix}_VERSION}) - endmacro() - - # Build, link and optionally package an add-on - macro (build_addon target prefix libs) -+ ADD_LIBRARY(${target} ${${prefix}_SOURCES}) -+ TARGET_LINK_LIBRARIES(${target} ${${libs}}) - addon_version(${target} ${prefix}) -- if(${prefix}_SOURCES) -- add_library(${target} ${${prefix}_SOURCES}) -- TARGET_link_libraries(${target} ${${libs}}) -- set_target_properties(${target} PROPERTIES VERSION ${${prefix}_VERSION} -- SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR} -- PREFIX "") -- if(OS STREQUAL "android") -- set_target_properties(${target} PROPERTIES PREFIX "lib") -- endif() -- elseif(${prefix}_CUSTOM_BINARY) -- add_custom_target(${target} ALL) -- list(GET ${prefix}_CUSTOM_BINARY 2 dependency) -- add_dependencies(${target} ${dependency}) -- endif() -+ SET_TARGET_PROPERTIES(${target} PROPERTIES VERSION ${${prefix}_VERSION} -+ SOVERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR} -+ PREFIX "") -+ IF(OS STREQUAL "android") -+ SET_TARGET_PROPERTIES(${target} PROPERTIES PREFIX "lib") -+ ENDIF(OS STREQUAL "android") - - # get the library's location -- if(${prefix}_CUSTOM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 0 LIBRARY_LOCATION) -- list(GET ${prefix}_CUSTOM_BINARY 1 LIBRARY_FILENAME) -+ SET(LIBRARY_LOCATION $) -+ # get the library's filename -+ if("${CORE_SYSTEM_NAME}" STREQUAL "android") -+ # for android we need the filename without any version numbers -+ set(LIBRARY_FILENAME $) - else() -- set(LIBRARY_LOCATION $) -- # get the library's filename -- if("${CORE_SYSTEM_NAME}" STREQUAL "android") -- # for android we need the filename without any version numbers -- set(LIBRARY_FILENAME $) -- else() -- set(LIBRARY_FILENAME $) -- endif() -+ SET(LIBRARY_FILENAME $) - endif() - - # if there's an addon.xml.in we need to generate the addon.xml -- if(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in) -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in) -- set(PLATFORM ${CORE_SYSTEM_NAME}) -+ IF(EXISTS ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in) -+ SET(PLATFORM ${CORE_SYSTEM_NAME}) - -- file(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file) -- string(CONFIGURE "${addon_file}" addon_file_conf @ONLY) -- file(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") -+ FILE(READ ${PROJECT_SOURCE_DIR}/${target}/addon.xml.in addon_file) -+ STRING(CONFIGURE "${addon_file}" addon_file_conf @ONLY) -+ FILE(GENERATE OUTPUT ${PROJECT_SOURCE_DIR}/${target}/addon.xml CONTENT "${addon_file_conf}") - if(${APP_NAME_UC}_BUILD_DIR) -- file(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/addon.xml CONTENT "${addon_file_conf}") -+ FILE(GENERATE OUTPUT ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/addon.xml CONTENT "${addon_file_conf}") - endif() -- endif() -+ ENDIF() - - # set zip as default if addon-package is called without PACKAGE_XXX -- set(CPACK_GENERATOR "ZIP") -- set(ext "zip") -- if(PACKAGE_ZIP OR PACKAGE_TGZ) -- if(PACKAGE_TGZ) -- set(CPACK_GENERATOR "TGZ") -- set(ext "tar.gz") -- endif() -- set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) -+ SET(CPACK_GENERATOR "ZIP") -+ SET(ext "zip") -+ IF(PACKAGE_ZIP OR PACKAGE_TGZ) -+ IF(PACKAGE_TGZ) -+ SET(CPACK_GENERATOR "TGZ") -+ SET(ext "tar.gz") -+ ENDIF(PACKAGE_TGZ) -+ SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF) - set(CPACK_PACKAGE_FILE_NAME addon) -- if(CMAKE_BUILD_TYPE STREQUAL "Release") -- set(CPACK_STRIP_FILES TRUE) -- endif() -+ IF(CMAKE_BUILD_TYPE STREQUAL "Release") -+ SET(CPACK_STRIP_FILES TRUE) -+ ENDIF(CMAKE_BUILD_TYPE STREQUAL "Release") - set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) - set(CPACK_COMPONENTS_IGNORE_GROUPS 1) - list(APPEND CPACK_COMPONENTS_ALL ${target}-${${prefix}_VERSION}) - # Pack files together to create an archive -- install(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "addon.xml.in" EXCLUDE) -- if(WIN32) -+ INSTALL(DIRECTORY ${target} DESTINATION ./ COMPONENT ${target}-${${prefix}_VERSION} PATTERN "addon.xml.in" EXCLUDE) -+ IF(WIN32) - if(NOT CPACK_PACKAGE_DIRECTORY) - # determine the temporary path - file(TO_CMAKE_PATH "$ENV{TEMP}" WIN32_TEMP_PATH) -@@ -115,49 +103,25 @@ macro (build_addon target prefix libs) - # is changed within Visual Studio) - string(REPLACE "$(Configuration)" "${CMAKE_BUILD_TYPE}" LIBRARY_LOCATION "${LIBRARY_LOCATION}") - -- if(${prefix}_SOURCES) -- # install the generated DLL file -- install(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} -- COMPONENT ${target}-${${prefix}_VERSION}) -+ # install the generated DLL file -+ INSTALL(PROGRAMS ${LIBRARY_LOCATION} DESTINATION ${target} -+ COMPONENT ${target}-${${prefix}_VERSION}) - -- if(CMAKE_BUILD_TYPE MATCHES Debug) -- # for debug builds also install the PDB file -- get_filename_component(LIBRARY_DIR ${LIBRARY_LOCATION} DIRECTORY) -- install(FILES ${LIBRARY_DIR}/${target}.pdb DESTINATION ${target} -- COMPONENT ${target}-${${prefix}_VERSION}) -- endif() -- endif() -- if (${prefix}_CUSTOM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY) -- install(FILES ${FROM_BINARY} DESTINATION ${target} RENAME ${TO_BINARY}) -- endif() -- if(${prefix}_CUSTOM_DATA) -- install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) -- endif() -- else() -+ IF(CMAKE_BUILD_TYPE MATCHES Debug) -+ # for debug builds also install the PDB file -+ get_filename_component(LIBRARY_DIR ${LIBRARY_LOCATION} DIRECTORY) -+ INSTALL(FILES ${LIBRARY_DIR}/${target}.pdb DESTINATION ${target} -+ COMPONENT ${target}-${${prefix}_VERSION}) -+ ENDIF() -+ ELSE(WIN32) - if(NOT CPACK_PACKAGE_DIRECTORY) - set(CPACK_PACKAGE_DIRECTORY ${CMAKE_BINARY_DIR}) - endif() -- if(${prefix}_SOURCES) -- install(TARGETS ${target} DESTINATION ${target} -- COMPONENT ${target}-${${prefix}_VERSION}) -- endif() -- if (${prefix}_CUSTOM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY) -- if(OS STREQUAL "android") -- set(TO_BINARY "lib${TO_BINARY}") -- endif() -- install(FILES ${FROM_BINARY} DESTINATION ${target} RENAME ${TO_BINARY} -- COMPONENT ${target}-${${prefix}_VERSION}) -- endif() -- if(${prefix}_CUSTOM_DATA) -- install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION ${target}/resources) -- endif() -- endif() -+ INSTALL(TARGETS ${target} DESTINATION ${target} -+ COMPONENT ${target}-${${prefix}_VERSION}) -+ ENDIF(WIN32) - add_cpack_workaround(${target} ${${prefix}_VERSION} ${ext}) -- else() -+ ELSE(PACKAGE_ZIP OR PACKAGE_TGZ) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR NOT CMAKE_INSTALL_PREFIX) - message(STATUS "setting install paths to match ${APP_NAME}: CMAKE_INSTALL_PREFIX: ${${APP_NAME_UC}_PREFIX}") -@@ -173,30 +137,11 @@ macro (build_addon target prefix libs) - else() - set(CMAKE_INSTALL_LIBDIR "lib/${APP_NAME_LC}") - endif() -- if(${prefix}_SOURCES) -- install(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) -- endif() -- if (${prefix}_CUSTOM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 0 FROM_BINARY) -- list(GET ${prefix}_CUSTOM_BINARY 1 TO_BINARY) -- if(OS STREQUAL "android") -- set(TO_BINARY "lib${TO_BINARY}") -- endif() -- install(FILES ${FROM_BINARY} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target} RENAME ${TO_BINARY}) -- endif() -- install(DIRECTORY ${target} DESTINATION share/${APP_NAME_LC}/addons PATTERN "addon.xml.in" EXCLUDE) -- if(${prefix}_CUSTOM_DATA) -- install(DIRECTORY ${${prefix}_CUSTOM_DATA} DESTINATION share/${APP_NAME_LC}/addons/${target}/resources) -- endif() -- endif() -+ INSTALL(TARGETS ${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}/addons/${target}) -+ INSTALL(DIRECTORY ${target} DESTINATION share/${APP_NAME_LC}/addons PATTERN "addon.xml.in" EXCLUDE) -+ ENDIF(PACKAGE_ZIP OR PACKAGE_TGZ) - if(${APP_NAME_UC}_BUILD_DIR) - file(GLOB_RECURSE files ${CMAKE_CURRENT_SOURCE_DIR}/${target}/*) -- if(${prefix}_CUSTOM_DATA) -- add_custom_command(TARGET ${target} POST_BUILD -- COMMAND ${CMAKE_COMMAND} -E copy_directory -- ${${prefix}_CUSTOM_DATA} -- ${${APP_NAME_UC}_BUILD_DIR}/addons/${target}/resources) -- endif() - foreach(file ${files}) - string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/${target}/" "" name "${file}") - # A good way to deal with () in filenames -@@ -216,30 +161,30 @@ function (kodi_find_path var_name filename search_path strip_file) - file(GLOB_RECURSE PATH_TO_FILE ${search_path} ${filename}) - if(strip_file) - string(REPLACE ${filename} "" PATH_TO_FILE ${PATH_TO_FILE}) -- endif() -+ endif(strip_file) - set (${var_name} ${PATH_TO_FILE} PARENT_SCOPE) - endfunction() - - # Cmake build options - include(AddOptions) - include(TestCXXAcceptsFlag) --option(PACKAGE_ZIP "Package Zip file?" OFF) --option(PACKAGE_TGZ "Package TGZ file?" OFF) --option(BUILD_SHARED_LIBS "Build shared libs?" ON) -+OPTION(PACKAGE_ZIP "Package Zip file?" OFF) -+OPTION(PACKAGE_TGZ "Package TGZ file?" OFF) -+OPTION(BUILD_SHARED_LIBS "Build shared libs?" ON) - - # LTO support? - CHECK_CXX_ACCEPTS_FLAG("-flto" HAVE_LTO) --if(HAVE_LTO) -- option(USE_LTO "use link time optimization" OFF) -- if(USE_LTO) -+IF(HAVE_LTO) -+ OPTION(USE_LTO "use link time optimization" OFF) -+ IF(USE_LTO) - add_options(ALL_LANGUAGES ALL_BUILDS "-flto") -- endif() --endif() -+ ENDIF(USE_LTO) -+ENDIF(HAVE_LTO) - - # set this to try linking dependencies as static as possible --if(ADDONS_PREFER_STATIC_LIBS) -- set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) --endif() -+IF(ADDONS_PREFER_STATIC_LIBS) -+ SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -+ENDIF(ADDONS_PREFER_STATIC_LIBS) - - if(${APP_NAME_UC}_BUILD_DIR) - list(APPEND CMAKE_PREFIX_PATH ${${APP_NAME_UC}_BUILD_DIR}/build) -diff --git a/project/cmake/scripts/common/CheckTargetPlatform.cmake b/project/cmake/scripts/common/CheckTargetPlatform.cmake -index 199071d..fc8b403 100644 ---- a/project/cmake/scripts/common/CheckTargetPlatform.cmake -+++ b/project/cmake/scripts/common/CheckTargetPlatform.cmake -@@ -21,11 +21,11 @@ function(check_target_platform dir target_platform build) - if(${platform_first} STREQUAL "!") - # extract the platform - string(LENGTH ${platform} platform_length) -- math(EXPR platform_length "${platform_length} - 1") -+ MATH(EXPR platform_length "${platform_length} - 1") - string(SUBSTRING ${platform} 1 ${platform_length} platform) - - # check if the current platform does not match the extracted platform -- if(NOT ${platform} STREQUAL ${target_platform}) -+ if (NOT ${platform} STREQUAL ${target_platform}) - set(${build} TRUE) - endif() - endif() -diff --git a/project/cmake/scripts/common/GenerateVersionedFiles.cmake b/project/cmake/scripts/common/GenerateVersionedFiles.cmake -index e105b27..c4ac549 100644 ---- a/project/cmake/scripts/common/GenerateVersionedFiles.cmake -+++ b/project/cmake/scripts/common/GenerateVersionedFiles.cmake -@@ -3,16 +3,9 @@ include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake) - core_find_versions() - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/xbmc.addon) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/kodi.guilib) -- --# configure_file without dependency tracking --# configure_file would register additional file dependencies that interfere --# with the ones from add_custom_command (and the generation would happen twice) --function(generate_versioned_file _SRC _DEST) -- file(READ ${CORE_SOURCE_DIR}/${_SRC} file_content) -- string(CONFIGURE "${file_content}" file_content @ONLY) -- file(WRITE ${CMAKE_BINARY_DIR}/${_DEST} "${file_content}") --endfunction() -- --generate_versioned_file(addons/xbmc.addon/addon.xml.in addons/xbmc.addon/addon.xml) --generate_versioned_file(addons/kodi.guilib/addon.xml.in addons/kodi.guilib/addon.xml) --generate_versioned_file(xbmc/CompileInfo.cpp.in ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp) -+configure_file(${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in -+ ${CMAKE_BINARY_DIR}/addons/xbmc.addon/addon.xml @ONLY) -+configure_file(${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in -+ ${CMAKE_BINARY_DIR}/addons/kodi.guilib/addon.xml @ONLY) -+configure_file(${CORE_SOURCE_DIR}/xbmc/CompileInfo.cpp.in -+ ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp @ONLY) -diff --git a/project/cmake/scripts/common/GeneratorSetup.cmake b/project/cmake/scripts/common/GeneratorSetup.cmake -index a19730a..75083ca 100644 ---- a/project/cmake/scripts/common/GeneratorSetup.cmake -+++ b/project/cmake/scripts/common/GeneratorSetup.cmake -@@ -22,8 +22,3 @@ else() - set(CORE_BUILD_CONFIG ${CMAKE_BUILD_TYPE}) - message(STATUS "Generator: Single-configuration: ${CMAKE_BUILD_TYPE} (${CMAKE_GENERATOR})") - endif() -- --# Ninja needs CMake 3.2 due to ExternalProject BUILD_BYPRODUCTS usage --if(CMAKE_GENERATOR STREQUAL Ninja AND CMAKE_VERSION VERSION_LESS 3.2) -- message(FATAL_ERROR "Generator: Ninja requires CMake 3.2 or later") --endif() -diff --git a/project/cmake/scripts/common/HandleDepends.cmake b/project/cmake/scripts/common/HandleDepends.cmake -index 4aca6ba..f44c87a 100644 ---- a/project/cmake/scripts/common/HandleDepends.cmake -+++ b/project/cmake/scripts/common/HandleDepends.cmake -@@ -10,7 +10,6 @@ function(add_addon_depends addon searchpath) - list(APPEND cmake_input_files ${cmake_input_files2}) - - foreach(file ${cmake_input_files}) -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${file}) - if(NOT (file MATCHES CMakeLists.txt OR - file MATCHES install.txt OR - file MATCHES noinstall.txt OR -@@ -46,7 +45,6 @@ function(add_addon_depends addon searchpath) - - # check if there are any library specific flags that need to be passed on - if(EXISTS ${dir}/flags.txt) -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/flags.txt) - file(STRINGS ${dir}/flags.txt extraflags) - separate_arguments(extraflags) - message(STATUS "${id} extraflags: ${extraflags}") -@@ -72,17 +70,16 @@ function(add_addon_depends addon searchpath) - - if(CMAKE_TOOLCHAIN_FILE) - list(APPEND BUILD_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}) -- message("toolchain specified") -- message(${BUILD_ARGS}) -+ MESSAGE("toolchain specified") -+ MESSAGE(${BUILD_ARGS}) - endif() - - # if there's a CMakeLists.txt use it to prepare the build - set(PATCH_FILE ${BUILD_DIR}/${id}/tmp/patch.cmake) - if(EXISTS ${dir}/CMakeLists.txt) -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/CMakeLists.txt) - file(APPEND ${PATCH_FILE} - "file(COPY ${dir}/CMakeLists.txt -- DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") -+ DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") - endif() - - # check if we have patches to apply -@@ -107,7 +104,6 @@ function(add_addon_depends addon searchpath) - endif() - endif() - -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${patch}) - file(APPEND ${PATCH_FILE} - "execute_process(COMMAND ${PATCH_PROGRAM} -p1 -i \"${patch}\")\n") - endforeach() -@@ -129,7 +125,6 @@ function(add_addon_depends addon searchpath) - - # check if there's a deps.txt containing dependencies on other libraries - if(EXISTS ${dir}/deps.txt) -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/deps.txt) - file(STRINGS ${dir}/deps.txt deps) - message(STATUS "${id} depends: ${deps}") - else() -@@ -138,7 +133,6 @@ function(add_addon_depends addon searchpath) - - if(CROSS_AUTOCONF AND AUTOCONF_FILES) - foreach(afile ${AUTOCONF_FILES}) -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${afile}) - file(APPEND ${PATCH_FILE} - "message(STATUS \"AUTOCONF: copying ${afile} to ${BUILD_DIR}/${id}/src/${id}\")\n - file(COPY ${afile} DESTINATION ${BUILD_DIR}/${id}/src/${id})\n") -@@ -147,7 +141,7 @@ function(add_addon_depends addon searchpath) - - # if the patch file exists we need to set the PATCH_COMMAND - set(PATCH_COMMAND "") -- if(EXISTS ${PATCH_FILE}) -+ if (EXISTS ${PATCH_FILE}) - set(PATCH_COMMAND ${CMAKE_COMMAND} -P ${PATCH_FILE}) - endif() - -diff --git a/project/cmake/scripts/common/Macros.cmake b/project/cmake/scripts/common/Macros.cmake -index b8dd860..de2a77c 100644 ---- a/project/cmake/scripts/common/Macros.cmake -+++ b/project/cmake/scripts/common/Macros.cmake -@@ -176,7 +176,7 @@ endfunction() - # helper macro for optional deps - macro(setup_enable_switch) - string(TOUPPER ${dep} depup) -- if(ARGV1) -+ if (ARGV1) - set(enable_switch ${ARGV1}) - else() - set(enable_switch ENABLE_${depup}) -@@ -235,11 +235,10 @@ function(core_file_read_filtered result filepattern) - if(VERBOSE) - message(STATUS "core_file_read_filtered - filename: ${filename}") - endif() -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename}) - file(STRINGS ${filename} fstrings REGEX "^[^#//]") - foreach(fstring ${fstrings}) - string(REGEX REPLACE "^(.*)#(.*)" "\\1" fstring ${fstring}) -- string(REGEX REPLACE "[ \n\r\t]//.*" "" fstring ${fstring}) -+ string(REGEX REPLACE "//.*" "" fstring ${fstring}) - string(STRIP ${fstring} fstring) - list(APPEND filename_strings ${fstring}) - endforeach() -@@ -261,7 +260,7 @@ function(core_add_subdirs_from_filelist files) - string(STRIP ${filename} filename) - core_file_read_filtered(fstrings ${filename}) - foreach(subdir ${fstrings}) -- string(REPLACE " " ";" subdir ${subdir}) -+ STRING_SPLIT(subdir " " ${subdir}) - list(GET subdir 0 subdir_src) - list(GET subdir -1 subdir_dest) - if(VERBOSE) -@@ -294,7 +293,6 @@ macro(core_add_optional_subdirs_from_filelist pattern) - if(VERBOSE) - message(STATUS "core_add_optional_subdirs_from_filelist - reading file: ${filename}") - endif() -- set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${filename}) - file(STRINGS ${filename} fstrings REGEX "^[^#//]") - foreach(line ${fstrings}) - string(REPLACE " " ";" line "${line}") -@@ -318,7 +316,7 @@ macro(core_add_optional_subdirs_from_filelist pattern) - endmacro() - - macro(today RESULT) -- if(WIN32) -+ if (WIN32) - execute_process(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE ${RESULT}) - string(REGEX REPLACE "(..)/(..)/..(..).*" "\\1/\\2/\\3" ${RESULT} ${${RESULT}}) - elseif(UNIX) -@@ -338,12 +336,12 @@ function(core_find_git_rev) - execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- - RESULT_VARIABLE status_code - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) -- if(NOT status_code) -+ if (NOT status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD -- - RESULT_VARIABLE status_code - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) - endif() -- if(status_code) -+ if (status_code) - execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD - OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) -@@ -369,32 +367,13 @@ function(core_find_git_rev) - endif() - endfunction() - --# Parses version.txt and libKODI_guilib.h and sets variables --# used to construct dirs structure, file naming, API version, etc. --# --# The following variables are set from version.txt: --# APP_NAME - app name --# APP_NAME_LC - lowercased app name --# APP_NAME_UC - uppercased app name --# COMPANY_NAME - company name --# APP_VERSION_MAJOR - the app version major --# APP_VERSION_MINOR - the app version minor --# APP_VERSION_TAG - the app version tag --# APP_VERSION_TAG_LC - lowercased app version tag --# APP_VERSION - the app version (${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}-${APP_VERSION_TAG}) --# APP_ADDON_API - the addon API version in the form of 16.9.702 --# FILE_VERSION - file version in the form of 16,9,702,0 - Windows only --# --# The following variables are set from libKODI_guilib.h: --# guilib_version - current ADDONGUI API version --# guilib_version_min - minimal ADDONGUI API version - macro(core_find_versions) - include(CMakeParseArguments) - core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) - string(REPLACE " " ";" version_list "${version_list}") -- cmake_parse_arguments(APP "" "APP_NAME;COMPANY_NAME;WEBSITE;VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API" "" ${version_list}) -+ cmake_parse_arguments(APP "" "VERSION_MAJOR;VERSION_MINOR;VERSION_TAG;VERSION_CODE;ADDON_API;APP_NAME;COMPANY_NAME" "" ${version_list}) - -- set(APP_NAME ${APP_APP_NAME}) # inconsistency but APP_APP_NAME looks weird -+ set(APP_NAME ${APP_APP_NAME}) # inconsistency in upstream - string(TOLOWER ${APP_APP_NAME} APP_NAME_LC) - string(TOUPPER ${APP_APP_NAME} APP_NAME_UC) - set(COMPANY_NAME ${APP_COMPANY_NAME}) -@@ -408,17 +387,4 @@ macro(core_find_versions) - string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version ${guilib_version}) - file(STRINGS ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h guilib_version_min REGEX "^.*GUILIB_MIN_API_VERSION (.*)$") - string(REGEX REPLACE ".*\"(.*)\"" "\\1" guilib_version_min ${guilib_version_min}) -- # unset variables not used anywhere else -- unset(version_list) -- unset(APP_APP_NAME) -- -- # bail if we can't parse version.txt -- if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) -- message(FATAL_ERROR "Could not determine app version! Make sure that ${CORE_SOURCE_DIR}/version.txt exists") -- endif() -- -- # bail if we can't parse libKODI_guilib.h -- if(NOT DEFINED guilib_version OR NOT DEFINED guilib_version_min) -- message(FATAL_ERROR "Could not determine add-on API version! Make sure that ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h exists") -- endif() - endmacro() -diff --git a/project/cmake/scripts/common/ManageString.cmake b/project/cmake/scripts/common/ManageString.cmake -new file mode 100644 -index 0000000..7321f4c ---- /dev/null -+++ b/project/cmake/scripts/common/ManageString.cmake -@@ -0,0 +1,235 @@ -+# - Collection of String utility macros. -+# Defines the following macros: -+# STRING_TRIM(var str [NOUNQUOTE]) -+# - Trim a string by removing the leading and trailing spaces, -+# just like STRING(STRIP ...) in CMake 2.6 and later. -+# This macro is needed as CMake 2.4 does not support STRING(STRIP ..) -+# This macro also remove quote and double quote marks around the string, -+# unless NOUNQUOTE is defined. -+# * Parameters: -+# + var: A variable that stores the result. -+# + str: A string. -+# + NOUNQUOTE: (Optional) do not remove the double quote mark around the string. -+# -+# STRING_UNQUOTE(var str) -+# - Remove double quote marks and quote marks around a string. -+# If the string is not quoted, then it returns an empty string. -+# * Parameters: -+# + var: A variable that stores the result. -+# + str: A string. -+# -+# STRING_JOIN(var delimiter str_list [str...]) -+# - Concatenate strings, with delimiter inserted between strings. -+# * Parameters: -+# + var: A variable that stores the result. -+# + str_list: A list of string. -+# + str: (Optional) more string to be join. -+# -+# STRING_SPLIT(var delimiter str [NOESCAPE_SEMICOLON]) -+# - Split a string into a list using a delimiter, which can be in 1 or more -+# characters long. -+# * Parameters: -+# + var: A variable that stores the result. -+# + delimiter: To separate a string. -+# + str: A string. -+# + NOESCAPE_SEMICOLON: (Optional) Do not escape semicolons. -+# -+ -+IF(NOT DEFINED _MANAGE_STRING_CMAKE_) -+ SET(_MANAGE_STRING_CMAKE_ "DEFINED") -+ -+ MACRO(STRING_TRIM var str) -+ SET(${var} "") -+ IF (NOT "${ARGN}" STREQUAL "NOUNQUOTE") -+ # Need not trim a quoted string. -+ STRING_UNQUOTE(_var "${str}") -+ IF(NOT _var STREQUAL "") -+ # String is quoted -+ SET(${var} "${_var}") -+ ENDIF(NOT _var STREQUAL "") -+ ENDIF(NOT "${ARGN}" STREQUAL "NOUNQUOTE") -+ -+ IF(${var} STREQUAL "") -+ SET(_var_1 "${str}") -+ STRING(REGEX REPLACE "^[ \t\r\n]+" "" _var_2 "${str}" ) -+ STRING(REGEX REPLACE "[ \t\r\n]+$" "" _var_3 "${_var_2}" ) -+ SET(${var} "${_var_3}") -+ ENDIF(${var} STREQUAL "") -+ ENDMACRO(STRING_TRIM var str) -+ -+ # Internal macro -+ # Variable cannot be escaped here, as variable is already substituted -+ # at the time it passes to this macro. -+ MACRO(STRING_ESCAPE var str) -+ # ';' and '\' are tricky, need to be encoded. -+ # '#' => '#H' -+ # '\' => '#B' -+ # ';' => '#S' -+ SET(_NOESCAPE_SEMICOLON "") -+ SET(_NOESCAPE_HASH "") -+ -+ FOREACH(_arg ${ARGN}) -+ IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON") -+ ELSEIF(${_arg} STREQUAL "NOESCAPE_HASH") -+ SET(_NOESCAPE_HASH "NOESCAPE_HASH") -+ ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ ENDFOREACH(_arg) -+ -+ IF(_NOESCAPE_HASH STREQUAL "") -+ STRING(REGEX REPLACE "#" "#H" _ret "${str}") -+ ELSE(_NOESCAPE_HASH STREQUAL "") -+ SET(_ret "${str}") -+ ENDIF(_NOESCAPE_HASH STREQUAL "") -+ -+ STRING(REGEX REPLACE "\\\\" "#B" _ret "${_ret}") -+ IF(_NOESCAPE_SEMICOLON STREQUAL "") -+ STRING(REGEX REPLACE ";" "#S" _ret "${_ret}") -+ ENDIF(_NOESCAPE_SEMICOLON STREQUAL "") -+ SET(${var} "${_ret}") -+ ENDMACRO(STRING_ESCAPE var str) -+ -+ MACRO(STRING_UNESCAPE var str) -+ # '#B' => '\' -+ # '#H' => '#' -+ # '#D' => '$' -+ # '#S' => ';' -+ SET(_ESCAPE_VARIABLE "") -+ SET(_NOESCAPE_SEMICOLON "") -+ SET(_ret "${str}") -+ FOREACH(_arg ${ARGN}) -+ IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON") -+ ELSEIF(${_arg} STREQUAL "ESCAPE_VARIABLE") -+ SET(_ESCAPE_VARIABLE "ESCAPE_VARIABLE") -+ STRING(REGEX REPLACE "#D" "$" _ret "${_ret}") -+ ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ ENDFOREACH(_arg) -+ -+ STRING(REGEX REPLACE "#B" "\\\\" _ret "${_ret}") -+ IF(_NOESCAPE_SEMICOLON STREQUAL "") -+ # ';' => '#S' -+ STRING(REGEX REPLACE "#S" "\\\\;" _ret "${_ret}") -+ ELSE(_NOESCAPE_SEMICOLON STREQUAL "") -+ STRING(REGEX REPLACE "#S" ";" _ret "${_ret}") -+ ENDIF(_NOESCAPE_SEMICOLON STREQUAL "") -+ -+ IF(NOT _ESCAPE_VARIABLE STREQUAL "") -+ # '#D' => '$' -+ STRING(REGEX REPLACE "#D" "$" _ret "${_ret}") -+ ENDIF(NOT _ESCAPE_VARIABLE STREQUAL "") -+ STRING(REGEX REPLACE "#H" "#" _ret "${_ret}") -+ SET(${var} "${_ret}") -+ ENDMACRO(STRING_UNESCAPE var str) -+ -+ -+ MACRO(STRING_UNQUOTE var str) -+ STRING_ESCAPE(_ret "${str}" ${ARGN}) -+ IF(_ret MATCHES "^[ \t\r\n]+") -+ STRING(REGEX REPLACE "^[ \t\r\n]+" "" _ret "${_ret}") -+ ENDIF(_ret MATCHES "^[ \t\r\n]+") -+ IF(_ret MATCHES "^\"") -+ # Double quote -+ STRING(REGEX REPLACE "\"\(.*\)\"[ \t\r\n]*$" "\\1" _ret "${_ret}") -+ ELSEIF(_ret MATCHES "^'") -+ # Single quote -+ STRING(REGEX REPLACE "'\(.*\)'[ \t\r\n]*$" "\\1" _ret "${_ret}") -+ ELSE(_ret MATCHES "^\"") -+ SET(_ret "") -+ ENDIF(_ret MATCHES "^\"") -+ -+ # Unencoding -+ STRING_UNESCAPE(${var} "${_ret}" ${ARGN}) -+ ENDMACRO(STRING_UNQUOTE var str) -+ -+ MACRO(STRING_JOIN var delimiter str_list) -+ SET(_ret "") -+ FOREACH(_str ${str_list}) -+ IF(_ret STREQUAL "") -+ SET(_ret "${_str}") -+ ELSE(_ret STREQUAL "") -+ SET(_ret "${_ret}${delimiter}${_str}") -+ ENDIF(_ret STREQUAL "") -+ ENDFOREACH(_str ${str_list}) -+ -+ FOREACH(_str ${ARGN}) -+ IF(_ret STREQUAL "") -+ SET(_ret "${_str}") -+ ELSE(_ret STREQUAL "") -+ SET(_ret "${_ret}${delimiter}${_str}") -+ ENDIF(_ret STREQUAL "") -+ ENDFOREACH(_str ${str_list}) -+ SET(${var} "${_ret}") -+ ENDMACRO(STRING_JOIN var delimiter str_list) -+ -+ MACRO(STRING_SPLIT var delimiter str) -+ SET(_max_tokens "") -+ SET(_NOESCAPE_SEMICOLON "") -+ SET(_ESCAPE_VARIABLE "") -+ FOREACH(_arg ${ARGN}) -+ IF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ SET(_NOESCAPE_SEMICOLON "NOESCAPE_SEMICOLON") -+ ELSEIF(${_arg} STREQUAL "ESCAPE_VARIABLE") -+ SET(_ESCAPE_VARIABLE "ESCAPE_VARIABLE") -+ ELSE(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ SET(_max_tokens ${_arg}) -+ ENDIF(${_arg} STREQUAL "NOESCAPE_SEMICOLON") -+ ENDFOREACH(_arg) -+ -+ IF(NOT _max_tokens) -+ SET(_max_tokens -1) -+ ENDIF(NOT _max_tokens) -+ -+ STRING_ESCAPE(_str "${str}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE}) -+ STRING_ESCAPE(_delimiter "${delimiter}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE}) -+ -+ SET(_str_list "") -+ SET(_token_count 0) -+ STRING(LENGTH "${_delimiter}" _de_len) -+ -+ WHILE(NOT _token_count EQUAL _max_tokens) -+ MATH(EXPR _token_count ${_token_count}+1) -+ IF(_token_count EQUAL _max_tokens) -+ # Last token, no need splitting -+ SET(_str_list ${_str_list} "${_str}") -+ ELSE(_token_count EQUAL _max_tokens) -+ # in case encoded characters are delimiters -+ STRING(LENGTH "${_str}" _str_len) -+ SET(_index 0) -+ SET(_token "") -+ SET(_str_remain "") -+ MATH(EXPR _str_end ${_str_len}-${_de_len}+1) -+ SET(_bound "k") -+ WHILE(_index LESS _str_end) -+ STRING(SUBSTRING "${_str}" ${_index} ${_de_len} _str_cursor) -+ IF(_str_cursor STREQUAL _delimiter) -+ # Get the token -+ STRING(SUBSTRING "${_str}" 0 ${_index} _token) -+ # Get the rest -+ MATH(EXPR _rest_index ${_index}+${_de_len}) -+ MATH(EXPR _rest_len ${_str_len}-${_index}-${_de_len}) -+ STRING(SUBSTRING "${_str}" ${_rest_index} ${_rest_len} _str_remain) -+ SET(_index ${_str_end}) -+ ELSE(_str_cursor STREQUAL _delimiter) -+ MATH(EXPR _index ${_index}+1) -+ ENDIF(_str_cursor STREQUAL _delimiter) -+ ENDWHILE(_index LESS _str_end) -+ -+ IF(_str_remain STREQUAL "") -+ # Meaning: end of string -+ LIST(APPEND _str_list "${_str}") -+ SET(_max_tokens ${_token_count}) -+ ELSE(_str_remain STREQUAL "") -+ LIST(APPEND _str_list "${_token}") -+ SET(_str "${_str_remain}") -+ ENDIF(_str_remain STREQUAL "") -+ ENDIF(_token_count EQUAL _max_tokens) -+ ENDWHILE(NOT _token_count EQUAL _max_tokens) -+ -+ -+ # Unencoding -+ STRING_UNESCAPE(${var} "${_str_list}" ${_NOESCAPE_SEMICOLON} ${_ESCAPE_VARIABLE}) -+ ENDMACRO(STRING_SPLIT var delimiter str) -+ -+ENDIF(NOT DEFINED _MANAGE_STRING_CMAKE_) -+ -diff --git a/project/cmake/scripts/common/PathSetup.cmake b/project/cmake/scripts/common/PathSetup.cmake -new file mode 100644 -index 0000000..47b1a96 ---- /dev/null -+++ b/project/cmake/scripts/common/PathSetup.cmake -@@ -0,0 +1,3 @@ -+# This script configures installation paths -+ -+include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake) -diff --git a/project/cmake/scripts/common/PrepareEnv.cmake b/project/cmake/scripts/common/PrepareEnv.cmake -index bf258d5..fadca48 100644 ---- a/project/cmake/scripts/common/PrepareEnv.cmake -+++ b/project/cmake/scripts/common/PrepareEnv.cmake -@@ -1,6 +1,25 @@ --# parse version.txt and libKODI_guilib.h to get the version and API info --include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake) --core_find_versions() -+# parse version.txt to get the version info -+if(EXISTS "${CORE_SOURCE_DIR}/version.txt") -+ file(STRINGS "${CORE_SOURCE_DIR}/version.txt" versions) -+ foreach (version ${versions}) -+ if(version MATCHES "^VERSION_.*") -+ string(REGEX MATCH "^[^ ]+" version_name ${version}) -+ string(REPLACE "${version_name} " "" version_value ${version}) -+ set(APP_${version_name} "${version_value}") -+ else() -+ string(REGEX MATCH "^[^ ]+" name ${version}) -+ string(REPLACE "${name} " "" value ${version}) -+ set(${name} "${value}") -+ endif() -+ endforeach() -+ string(TOLOWER ${APP_NAME} APP_NAME_LC) -+ string(TOUPPER ${APP_NAME} APP_NAME_UC) -+endif() -+ -+# bail if we can't parse versions -+if(NOT DEFINED APP_VERSION_MAJOR OR NOT DEFINED APP_VERSION_MINOR) -+ message(FATAL_ERROR "Could not determine app version! make sure that ${CORE_SOURCE_DIR}/version.txt exists") -+endif() - - # in case we need to download something, set KODI_MIRROR to the default if not alread set - if(NOT DEFINED KODI_MIRROR) -@@ -62,7 +81,7 @@ foreach(binding ${bindings}) - # auto-generate header files for backwards compatibility to xbmc with deprecation warning - # but only do it if the file doesn't already exist - get_filename_component(headerfile ${header} NAME) -- if(NOT EXISTS "${XBMC_INCLUDE_DIR}/${headerfile}") -+ if (NOT EXISTS "${XBMC_INCLUDE_DIR}/${headerfile}") - file(WRITE ${XBMC_INCLUDE_DIR}/${headerfile} - "#pragma once - #define DEPRECATION_WARNING \"Including xbmc/${headerfile} has been deprecated, please use kodi/${headerfile}\" -diff --git a/project/cmake/scripts/darwin/ArchSetup.cmake b/project/cmake/scripts/darwin/ArchSetup.cmake -new file mode 100644 -index 0000000..d4d7f35 ---- /dev/null -+++ b/project/cmake/scripts/darwin/ArchSetup.cmake -@@ -0,0 +1,33 @@ -+if(NOT CMAKE_TOOLCHAIN_FILE) -+ message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for darwin. See ${PROJECT_SOURCE_DIR}/README.md") -+endif() -+ -+set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp -+ ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm -+ ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) -+ -+set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) -+set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -+ -D__STDC_CONSTANT_MACROS) -+set(PLATFORM_DIR linux) -+set(CMAKE_SYSTEM_NAME Darwin) -+if(WITH_ARCH) -+ set(ARCH ${WITH_ARCH}) -+else() -+ if(CPU STREQUAL x86_64 OR CPU STREQUAL i386) -+ set(ARCH x86-osx) -+ else() -+ message(SEND_ERROR "Unknown CPU: ${CPU}") -+ endif() -+endif() -+ -+find_package(CXX11 REQUIRED) -+ -+list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${NATIVEPREFIX}) -+ -+list(APPEND DEPLIBS "-framework DiskArbitration" "-framework IOKit" -+ "-framework IOSurface" "-framework SystemConfiguration" -+ "-framework ApplicationServices" "-framework AppKit" -+ "-framework CoreAudio" "-framework AudioToolbox" -+ "-framework CoreGraphics" "-framework CoreMedia" -+ "-framework VideoToolbox") -diff --git a/project/cmake/scripts/darwin/Install.cmake b/project/cmake/scripts/darwin/Install.cmake -new file mode 100644 -index 0000000..1f130d7 ---- /dev/null -+++ b/project/cmake/scripts/darwin/Install.cmake -@@ -0,0 +1,38 @@ -+# OSX packaging -+ -+set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}) -+ -+configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/Info.plist.in -+ ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist @ONLY) -+execute_process(COMMAND perl -p -i -e "s/r####/${APP_SCMID}/" ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist) -+ -+add_custom_target(bundle -+ COMMAND ${CMAKE_COMMAND} -E copy $ ${PACKAGE_OUTPUT_DIR}/${APP_NAME} -+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/DllPaths_generated.h -+ ${CMAKE_BINARY_DIR}/xbmc/DllPaths_generated.h -+ COMMAND "ACTION=build" -+ "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" -+ "TARGET_NAME=${APP_NAME}.app" -+ "APP_NAME=${APP_NAME}" -+ "SRCROOT=${CMAKE_BINARY_DIR}" -+ ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-osx.command -+ COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" -+ "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" -+ "TARGET_NAME=${APP_NAME}.app" -+ "APP_NAME=${APP_NAME}" -+ "FULL_PRODUCT_NAME=${APP_NAME}.app" -+ "SRCROOT=${CMAKE_BINARY_DIR}" -+ ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command) -+add_dependencies(bundle ${APP_NAME_LC} export-files pack-skins wrap-libraries generate_json_header XBMCHelper) -+ -+configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh.in -+ ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh @ONLY) -+ -+add_custom_target(dmg -+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/ -+ ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/ -+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/osx/ -+ ${CMAKE_BINARY_DIR}/tools/darwin/packaging/media/osx/ -+ COMMAND ./mkdmg-osx.sh ${CORE_BUILD_CONFIG} -+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) -+add_dependencies(dmg bundle) -diff --git a/project/cmake/scripts/darwin/Macros.cmake b/project/cmake/scripts/darwin/Macros.cmake -new file mode 100644 -index 0000000..f4e1ce8 ---- /dev/null -+++ b/project/cmake/scripts/darwin/Macros.cmake -@@ -0,0 +1,110 @@ -+function(core_link_library lib wraplib) -+ if(CMAKE_GENERATOR MATCHES "Unix Makefiles") -+ set(wrapper_obj cores/dll-loader/exports/CMakeFiles/wrapper.dir/wrapper.c.o) -+ elseif(CMAKE_GENERATOR MATCHES "Xcode") -+ set(wrapper_obj cores/dll-loader/exports/kodi.build/$(CONFIGURATION)/wrapper.build/Objects-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/wrapper.o) -+ else() -+ message(FATAL_ERROR "Unsupported generator in core_link_library") -+ endif() -+ -+ set(export -bundle -undefined dynamic_lookup -read_only_relocs suppress -+ -Wl,-alias_list,${CORE_BUILD_DIR}/cores/dll-loader/exports/wrapper.def -+ ${CORE_BUILD_DIR}/${wrapper_obj}) -+ set(extension ${CMAKE_SHARED_MODULE_SUFFIX}) -+ set(check_arg "") -+ if(TARGET ${lib}) -+ set(target ${lib}) -+ set(link_lib $) -+ set(check_arg ${ARGV2}) -+ set(data_arg ${ARGV3}) -+ else() -+ set(target ${ARGV2}) -+ set(link_lib ${lib}) -+ set(check_arg ${ARGV3}) -+ set(data_arg ${ARGV4}) -+ endif() -+ if(check_arg STREQUAL export) -+ set(export ${export} -+ -Wl,--version-script=${ARGV3}) -+ elseif(check_arg STREQUAL nowrap) -+ set(export -undefined dynamic_lookup -dynamiclib ${data_arg}) -+ set(extension ${CMAKE_SHARED_LIBRARY_SUFFIX}) -+ elseif(check_arg STREQUAL extras) -+ foreach(arg ${data_arg}) -+ list(APPEND export ${arg}) -+ endforeach() -+ endif() -+ get_filename_component(dir ${wraplib} PATH) -+ -+ # We can't simply pass the linker flags to the args section of the custom command -+ # because cmake will add quotes around it (and the linker will fail due to those). -+ # We need to do this handstand first ... -+ separate_arguments(CUSTOM_COMMAND_ARGS_LDFLAGS UNIX_COMMAND "${CMAKE_SHARED_LINKER_FLAGS}") -+ -+ add_custom_command(OUTPUT ${wraplib}-${ARCH}${extension} -+ COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} -+ COMMAND ${CMAKE_C_COMPILER} -+ ARGS ${CUSTOM_COMMAND_ARGS_LDFLAGS} ${export} -Wl,-force_load ${link_lib} -+ -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${extension} -+ DEPENDS ${target} wrapper.def wrapper -+ VERBATIM) -+ -+ # Uncomment to create wrap_ targets for debugging -+ #get_filename_component(libname ${wraplib} NAME_WE) -+ #add_custom_target(wrap_${libname} ALL DEPENDS ${wraplib}-${ARCH}${extension}) -+ -+ list(APPEND WRAP_FILES ${wraplib}-${ARCH}${extension}) -+ set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) -+endfunction() -+ -+function(find_soname lib) -+ cmake_parse_arguments(arg "REQUIRED" "" "" ${ARGN}) -+ -+ string(TOLOWER ${lib} liblow) -+ if(${lib}_LDFLAGS) -+ set(link_lib "${${lib}_LDFLAGS}") -+ else() -+ set(link_lib "${${lib}_LIBRARIES}") -+ endif() -+ -+ execute_process(COMMAND ${CMAKE_C_COMPILER} -print-search-dirs -+ COMMAND fgrep libraries: -+ COMMAND sed "s/[^=]*=\\(.*\\)/\\1/" -+ COMMAND sed "s/:/ /g" -+ ERROR_QUIET -+ OUTPUT_VARIABLE cc_lib_path -+ OUTPUT_STRIP_TRAILING_WHITESPACE) -+ execute_process(COMMAND echo ${link_lib} -+ COMMAND sed "s/-L[ ]*//g" -+ COMMAND sed "s/-l[^ ]*//g" -+ ERROR_QUIET -+ OUTPUT_VARIABLE env_lib_path -+ OUTPUT_STRIP_TRAILING_WHITESPACE) -+ -+ foreach(path ${cc_lib_path} ${env_lib_path}) -+ if(IS_DIRECTORY ${path}) -+ execute_process(COMMAND ls -- ${path}/lib${liblow}.dylib -+ ERROR_QUIET -+ OUTPUT_VARIABLE lib_file -+ OUTPUT_STRIP_TRAILING_WHITESPACE) -+ else() -+ set(lib_file ${path}) -+ endif() -+ if(lib_file) -+ # we want the path/name that is embedded in the dylib -+ execute_process(COMMAND otool -L ${lib_file} -+ COMMAND grep -v lib${liblow}.dylib -+ COMMAND grep ${liblow} -+ COMMAND awk "{V=1; print $V}" -+ ERROR_QUIET -+ OUTPUT_VARIABLE filename -+ OUTPUT_STRIP_TRAILING_WHITESPACE) -+ get_filename_component(${lib}_SONAME "${filename}" NAME) -+ message(STATUS "${lib} soname: ${${lib}_SONAME}") -+ endif() -+ endforeach() -+ if(arg_REQUIRED AND NOT ${lib}_SONAME) -+ message(FATAL_ERROR "Could not find dynamically loadable library ${lib}") -+ endif() -+ set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) -+endfunction() -diff --git a/project/cmake/scripts/darwin/PathSetup.cmake b/project/cmake/scripts/darwin/PathSetup.cmake -new file mode 100644 -index 0000000..071dfd4 ---- /dev/null -+++ b/project/cmake/scripts/darwin/PathSetup.cmake -@@ -0,0 +1,32 @@ -+if(NOT prefix) -+ set(prefix ${DEPENDS_PATH}) -+endif() -+if(NOT exec_prefix) -+ set(exec_prefix ${prefix}) -+endif() -+if(NOT libdir) -+ set(libdir ${prefix}/lib) -+endif() -+if(NOT bindir) -+ set(bindir ${prefix}/bin) -+endif() -+if(NOT includedir) -+ set(includedir ${prefix}/include) -+endif() -+if(NOT datarootdir) -+ set(datarootdir ${prefix}/share) -+endif() -+if(NOT datadir) -+ set(datadir ${datarootdir}) -+endif() -+ -+list(APPEND final_message "-- PATH config --") -+list(APPEND final_message "Prefix: ${prefix}") -+list(APPEND final_message "Libdir: ${libdir}") -+list(APPEND final_message "Bindir: ${bindir}") -+list(APPEND final_message "Includedir: ${includedir}") -+list(APPEND final_message "Datarootdir: ${datarootdir}") -+list(APPEND final_message "Datadir: ${datadir}") -+ -+set(PATH_DEFINES -DBIN_INSTALL_PATH=\"${libdir}/kodi\" -+ -DINSTALL_PATH=\"${datarootdir}/kodi\") -diff --git a/project/cmake/scripts/ios/Macros.cmake b/project/cmake/scripts/ios/Macros.cmake -index 54c1b28..cc397fd 120000 ---- a/project/cmake/scripts/ios/Macros.cmake -+++ b/project/cmake/scripts/ios/Macros.cmake -@@ -1 +1 @@ --../osx/Macros.cmake -\ No newline at end of file -+../darwin/Macros.cmake -\ No newline at end of file -diff --git a/project/cmake/scripts/ios/PathSetup.cmake b/project/cmake/scripts/ios/PathSetup.cmake -index d7f25b2..8303b28 120000 ---- a/project/cmake/scripts/ios/PathSetup.cmake -+++ b/project/cmake/scripts/ios/PathSetup.cmake -@@ -1 +1 @@ --../osx/PathSetup.cmake -\ No newline at end of file -+../darwin/PathSetup.cmake -\ No newline at end of file -diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake -index 67cb2ee..a326791 100644 ---- a/project/cmake/scripts/linux/Install.cmake -+++ b/project/cmake/scripts/linux/Install.cmake -@@ -14,11 +14,8 @@ else() - set(USE_OPENGLES 0) - endif() - --# CMake config --set(APP_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/${APP_NAME_LC}) --set(APP_PREFIX ${CMAKE_INSTALL_PREFIX}) --set(APP_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/${APP_NAME_LC}) --set(CXX11_SWITCH "-std=c++11") -+configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in -+ ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) - - # Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone - if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) -@@ -28,118 +25,86 @@ if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) - endif() - endif() - --# Configure startup scripts --configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in -- ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) - configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in - ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY) - -- --# Configure cmake files -+# cmake config -+set(APP_LIB_DIR ${CMAKE_INSTALL_PREFIX}/lib/${APP_NAME_LC}) -+set(APP_PREFIX ${CMAKE_INSTALL_PREFIX}) -+set(APP_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/include/${APP_NAME_LC}) -+set(CXX11_SWITCH "-std=c++11") - configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in -- ${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY) -- --# Configure xsession entry --configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in -- ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY) -- --# Install cmake files --# TODO: revisit, refactor and nuke txt file globbing --install(FILES ${cmake_files} DESTINATION lib/${APP_NAME_LC}) --install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake -+ ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}Config.cmake @ONLY) -+install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}Config.cmake - ${PROJECT_SOURCE_DIR}/scripts/common/AddOptions.cmake - ${PROJECT_SOURCE_DIR}/scripts/common/AddonHelpers.cmake -- ${PROJECT_SOURCE_DIR}/scripts/linux/PathSetup.cmake - DESTINATION lib/${APP_NAME_LC}) -+install(FILES ${cmake_files} DESTINATION ${libdir}/${APP_NAME_LC}) - --# Install app --install(TARGETS ${APP_NAME_LC} DESTINATION lib/${APP_NAME_LC}) -+install(TARGETS ${APP_NAME_LC} DESTINATION ${libdir}/${APP_NAME_LC}) - if(ENABLE_X11 AND XRANDR_FOUND) -- install(TARGETS ${APP_NAME_LC}-xrandr DESTINATION lib/${APP_NAME_LC}) -+ install(TARGETS ${APP_NAME_LC}-xrandr DESTINATION ${libdir}/${APP_NAME_LC}) -+endif() -+ -+if(NOT EXISTS ${libdir}/xbmc) -+install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${libdir})") -+endif() -+install(FILES ${addon_bindings} DESTINATION ${includedir}/${APP_NAME_LC}) -+if(NOT EXISTS ${includedir}/xbmc) -+install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${includedir})") - endif() - --# Install scripts - install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} - ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone -- DESTINATION bin) -+ DESTINATION ${bindir}) -+install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC} xbmc WORKING_DIRECTORY ${bindir})") -+install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}-standalone xbmc-standalone WORKING_DIRECTORY ${bindir})") - --# Install libraries --foreach(wraplib ${WRAP_FILES}) -- get_filename_component(dir ${wraplib} PATH) -- install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib} -- DESTINATION lib/${APP_NAME_LC}/${dir}) --endforeach() -- --# Install add-ons, fonts, icons, keyboard maps, keymaps, etc --# (addons, media, system, userdata folders in share/kodi/) --foreach(file ${install_data}) -- get_filename_component(dir ${file} PATH) -- install(FILES ${CMAKE_BINARY_DIR}/${file} -- DESTINATION share/${APP_NAME_LC}/${dir}) --endforeach() -- --# Install add-on bindings --install(FILES ${addon_bindings} DESTINATION include/${APP_NAME_LC}) -- --# Install xsession entry -+configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in -+ ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop) - install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop -- DESTINATION share/xsessions) -- --# Install desktop entry --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop -- DESTINATION share/applications/${APP_NAME_LC}.desktop) -+ DESTINATION ${datarootdir}/xsessions) -+install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}.desktop xbmc.desktop WORKING_DIRECTORY ${datarootdir}/xsessions/)") - --# Install icons --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/16x16/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/22x22/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/24x24/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/32x32/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/48x48/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/64x64/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/128x128/apps) --install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png -- RENAME ${APP_NAME_LC}.png -- DESTINATION share/icons/hicolor/256x256/apps) --install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t -- $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)") -+if(NOT EXISTS ${datarootdir}/xbmc) -+install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${datarootdir})") -+endif() - --# Install docs - install(FILES ${CORE_SOURCE_DIR}/copying.txt - ${CORE_SOURCE_DIR}/LICENSE.GPL - ${CORE_SOURCE_DIR}/version.txt - ${CORE_SOURCE_DIR}/docs/README.linux -- DESTINATION share/doc/${APP_NAME_LC}) -+ DESTINATION ${datarootdir}/doc/${APP_NAME_LC}) -+ -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop -+ DESTINATION ${datarootdir}/applications/${APP_NAME_LC}.desktop) - --# Install XBT skin files - foreach(texture ${XBT_FILES}) - string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) - get_filename_component(dir ${dir} PATH) - install(FILES ${texture} -- DESTINATION share/${APP_NAME_LC}/${dir}) -+ DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}) -+endforeach() -+ -+foreach(wraplib ${WRAP_FILES}) -+ get_filename_component(dir ${wraplib} PATH) -+ install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib} -+ DESTINATION ${libdir}/${APP_NAME_LC}/${dir}) -+endforeach() -+ -+foreach(file ${install_data}) -+ get_filename_component(dir ${file} PATH) -+ install(FILES ${CMAKE_BINARY_DIR}/${file} -+ DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir}) - endforeach() - --# Install extra stuff if it exists - if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs) - install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs) - foreach(dir \${dirs}) - file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*) - foreach(file \${FILES}) - get_filename_component(dir \${file} PATH) -- file(INSTALL \${file} DESTINATION share/${APP_NAME_LC}/\${dir}) -+ file(INSTALL \${file} DESTINATION ${datarootdir}/${APP_NAME_LC}/\${dir}) - endforeach() - endforeach()") - endif() -@@ -155,29 +120,29 @@ foreach(subdir ${build_dirs}) - endif() - endforeach() - --# Create xbmc -> kodi symlinks --if(NOT EXISTS ${libdir}/xbmc) -- install(CODE "execute_process(COMMAND ln -sf ${APP_NAME_LC}/ xbmc -- WORKING_DIRECTORY ${libdir})") --endif() --if(NOT EXISTS ${includedir}/xbmc) -- install(CODE "execute_process(COMMAND ln -sf ${APP_NAME_LC}/ xbmc -- WORKING_DIRECTORY ${includedir})") --endif() --if(NOT EXISTS ${bindir}/xbmc) -- install(CODE "execute_process(COMMAND ln -sf ${APP_NAME_LC} xbmc -- WORKING_DIRECTORY ${bindir})") --endif() --if(NOT EXISTS ${bindir}/xbmc-standalone) -- install(CODE "execute_process(COMMAND ln -sf ${APP_NAME_LC}-standalone xbmc-standalone -- WORKING_DIRECTORY ${bindir})") --endif() --if(NOT EXISTS ${datarootdir}/xsessions/xbmc.desktop) -- install(CODE "execute_process(COMMAND ln -sf ${APP_NAME_LC}.desktop xbmc.desktop -- WORKING_DIRECTORY ${datarootdir}/xsessions/)") --endif() --if(NOT EXISTS ${datarootdir}/xbmc) -- install(CODE "execute_process(COMMAND ln -sf ${APP_NAME_LC}/ xbmc -- WORKING_DIRECTORY ${datarootdir})") --endif() -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/16x16/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/22x22/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/24x24/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/32x32/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/48x48/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/64x64/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/128x128/apps) -+install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png -+ RENAME ${APP_NAME_LC}.png -+ DESTINATION ${datarootdir}/icons/hicolor/256x256/apps) - -+install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)") -diff --git a/project/cmake/scripts/windows/CFlagOverrides.cmake b/project/cmake/scripts/windows/CFlagOverrides.cmake -index 00f4e22..1d3c13b 100644 ---- a/project/cmake/scripts/windows/CFlagOverrides.cmake -+++ b/project/cmake/scripts/windows/CFlagOverrides.cmake -@@ -2,4 +2,4 @@ if(MSVC) - set(CMAKE_C_FLAGS "/MP /DWIN32 /D_WINDOWS /W3 /Zi /arch:SSE2") - set(CMAKE_C_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") - set(CMAKE_C_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") --endif() -+endif(MSVC) -diff --git a/project/cmake/scripts/windows/CXXFlagOverrides.cmake b/project/cmake/scripts/windows/CXXFlagOverrides.cmake -index 3c4d6c4..31295a7 100644 ---- a/project/cmake/scripts/windows/CXXFlagOverrides.cmake -+++ b/project/cmake/scripts/windows/CXXFlagOverrides.cmake -@@ -2,4 +2,4 @@ if(MSVC) - set(CMAKE_CXX_FLAGS "/MP /DWIN32 /D_WINDOWS /W3 /GR /Zi /EHsc /arch:SSE2") - set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MDd /Ob0 /Od /RTC1 /D_ITERATOR_DEBUG_LEVEL=0") - set(CMAKE_CXX_FLAGS_RELEASE "/MD /Ox /Ob2 /Oi /Ot /Oy /GL /DNDEBUG") --endif() -+endif(MSVC) -diff --git a/project/cmake/treedata/darwin/subdirs.txt b/project/cmake/treedata/darwin/subdirs.txt -new file mode 100644 -index 0000000..f0fc5c5 ---- /dev/null -+++ b/project/cmake/treedata/darwin/subdirs.txt -@@ -0,0 +1,12 @@ -+xbmc/linux linuxsupport -+xbmc/network/linux network/linux -+xbmc/network/osx network/osx -+xbmc/peripherals/bus/osx peripherals/bus/osx -+xbmc/powermanagement/osx powermanagement/osx -+xbmc/storage/osx storage/osx -+xbmc/platform/posix posix -+xbmc/platform/darwin platform_darwin -+xbmc/platform/darwin/osx platform_osx -+xbmc/filesystem/posix filesystem/posix -+xbmc/utils/posix utils_posix -+xbmc/windowing/osx windowing/osx -diff --git a/system/keymaps/appcommand.xml b/system/keymaps/appcommand.xml -index c51ec72..2cbee66 100644 ---- a/system/keymaps/appcommand.xml -+++ b/system/keymaps/appcommand.xml -@@ -17,9 +17,9 @@ - Stop - PlayPause - -- ActivateWindow(Music) -- ActivateWindow(Programs) -- ActivateWindow(Programs) -+ ActivateWindow(MyMusic) -+ ActivateWindow(MyPrograms) -+ ActivateWindow(MyPrograms) - Play - Pause - FastForward -diff --git a/system/keymaps/customcontroller.AppleRemote.xml b/system/keymaps/customcontroller.AppleRemote.xml -index 4a47364..c20bb98 100644 ---- a/system/keymaps/customcontroller.AppleRemote.xml -+++ b/system/keymaps/customcontroller.AppleRemote.xml -@@ -8,18 +8,18 @@ - - - -- -+ - - - - - -- -+ - - -- -+ - - -@@ -177,11 +177,16 @@ - - -- -+ -+ -+ -+ -+ -+ - - - -diff --git a/system/keymaps/customcontroller.Harmony.xml b/system/keymaps/customcontroller.Harmony.xml -index 6666f11..728cb73 100644 ---- a/system/keymaps/customcontroller.Harmony.xml -+++ b/system/keymaps/customcontroller.Harmony.xml -@@ -15,11 +15,11 @@ - - - -- -+ - - -- -+ - - - -@@ -85,17 +85,17 @@ - - - -- -- -+ -+ - - - -- -+ - - - - -- -+ - - - -@@ -118,14 +118,14 @@ - - - -- -+ - - - - - - -- -+ - - - -@@ -133,8 +133,9 @@ - - - -- -+ - -+ - - - -@@ -145,7 +146,20 @@ - - - -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -195,7 +209,7 @@ - - - -- -+ - - - -@@ -204,11 +218,11 @@ - - - -- -+ - - - -- -+ - - - -@@ -240,13 +254,13 @@ - - - -- -+ - - - - - -- -+ - - - -@@ -274,7 +288,7 @@ - - - -- -+ - - - -@@ -288,7 +302,21 @@ - - - -- -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ - - - -@@ -315,11 +343,11 @@ - - - -- -+ - - - -- -+ - - - -diff --git a/system/keymaps/gamepad.xml b/system/keymaps/gamepad.xml -index ab298f0..1e839ca 100644 ---- a/system/keymaps/gamepad.xml -+++ b/system/keymaps/gamepad.xml -@@ -19,7 +19,7 @@ - - - -- -+ - - - -@@ -61,11 +61,16 @@ - VolumeDown - - -- -+ -+ -+ Skin.ToggleSetting(HomeViewToggle) -+ -+ -+ - - Highlight - -- -+ - - - Delete -@@ -77,12 +82,18 @@ - Queue - - -- -+ -+ -+ Queue -+ Playlist -+ -+ -+ - - Queue - Playlist - -- -+ - - - Pause -@@ -156,13 +167,13 @@ - AnalogFastForward - - -- -+ - - Back - AnalogRewind - AnalogFastForward - -- -+ - - - Back -@@ -197,13 +208,13 @@ - NextResolution - - -- -+ - - AnalogMove - NextCalibration - ResetCalibration - -- -+ - - - Back -@@ -255,11 +266,17 @@ - AnalogFastForward - - -- -+ - - Delete - -- -+ -+ -+ -+ Queue -+ Playlist -+ -+ - - - Delete -@@ -281,11 +298,11 @@ - Back - - -- -+ - - info - -- -+ - - - BackSpace -diff --git a/system/keymaps/joystick.xml b/system/keymaps/joystick.xml -index 516726d..976223e 100644 ---- a/system/keymaps/joystick.xml -+++ b/system/keymaps/joystick.xml -@@ -29,18 +29,25 @@ - VolumeDown - - -- -+ -+ -+ Skin.ToggleSetting(HomeViewToggle) -+ -+ -+ - - Highlight - -- -+ - - - Delete - - -- -- -+ -+ -+ -+ - - - Pause -@@ -108,7 +115,7 @@ - - Pause - Stop -- ActivateWindow(AddonSettings) -+ ActivateWindow(VisualisationSettings) - ActivateWindow(VisualisationPresetList) - Info - ActivateWindow(MusicOSD) -@@ -130,6 +137,11 @@ - Info - - -+ -+ -+ Close -+ -+ - - - Close -@@ -161,13 +173,13 @@ - NextCalibration - - -- -+ - - ResetCalibration - NextResolution - NextCalibration - -- -+ - - - Close -@@ -198,8 +210,10 @@ - Delete - - -- -- -+ -+ -+ -+ - - - Delete -@@ -220,11 +234,11 @@ - Close - - -- -+ - - ContextMenu - -- -+ - - - PreviousMenu -diff --git a/system/keymaps/keyboard.xml b/system/keymaps/keyboard.xml -index b898242..004bc16 100644 ---- a/system/keymaps/keyboard.xml -+++ b/system/keymaps/keyboard.xml -@@ -12,7 +12,7 @@ - - - -- -+ - - - -@@ -88,7 +88,7 @@ - Number7 - Number8 - Number9 -- ToggleFullScreen -+ - FirstPage - LastPage - ActivateWindow(shutdownmenu) -@@ -102,9 +102,9 @@ - ActivateWindow(TVTimers) - - ActivateWindow(TVChannels) -- ActivateWindow(Videos) -- ActivateWindow(Music) -- ActivateWindow(Pictures) -+ ActivateWindow(MyVideos) -+ ActivateWindow(MyMusic) -+ ActivateWindow(MyPictures) - - Back - -@@ -127,9 +127,9 @@ - Rewind - - -- ActivateWindow(Music) -- ActivateWindow(Programs) -- ActivateWindow(Programs) -+ ActivateWindow(MyMusic) -+ ActivateWindow(MyPrograms) -+ ActivateWindow(MyPrograms) - - - -@@ -257,7 +257,7 @@ - ShowTimerRule - - -- -+ - - Highlight - Delete -@@ -266,7 +266,7 @@ - Highlight - ActivateWindow(Home) - -- -+ - - - Back -@@ -284,13 +284,21 @@ - ActivateWindow(Home) - - -- -+ - - Playlist - Queue -+ Delete - ActivateWindow(Home) - -- -+ -+ -+ -+ Playlist -+ Queue -+ ActivateWindow(Home) -+ -+ - - - FastForward -@@ -403,6 +411,21 @@ - ActivateWindow(MusicPlaylist) - - -+ -+ -+ FastForward -+ Rewind -+ SkipNext -+ SkipPrevious -+ Back -+ Info -+ CodecInfo -+

ActivateWindow(VisualisationPresetList)

-+ Back -+ Back -+ ActivateWindow(MusicPlaylist) -+
-+
- - - FastForward -@@ -450,13 +473,13 @@ - NextResolution - - -- -+ - - NextCalibration - NextCalibration - ResetCalibration - -- -+ - - - Back -@@ -503,14 +526,22 @@ - Delete - - -- -+ - - Delete - Playlist - ToggleWatched - ActivateWindow(Home) - -- -+ -+ -+ -+ Playlist -+ Queue -+ ToggleWatched -+ ActivateWindow(Home) -+ -+ - - - Back -@@ -624,12 +655,12 @@ - Close - - -- -+ - - PreviousMenu - PreviousMenu - -- -+ - - - Highlight -diff --git a/system/keymaps/mouse.xml b/system/keymaps/mouse.xml -index c2b39f8..488de69 100644 ---- a/system/keymaps/mouse.xml -+++ b/system/keymaps/mouse.xml -@@ -7,6 +7,12 @@ - - - -+ -+ -+ wheeldown -+ wheelup -+ -+ - - - leftclick -@@ -15,8 +21,8 @@ - doubleclick - contextmenu - -- wheeldown -- wheelup -+ down -+ up - mousedrag - mousemove - -diff --git a/system/keymaps/remote.xml b/system/keymaps/remote.xml -index 2220ae4..a0c8edf 100644 ---- a/system/keymaps/remote.xml -+++ b/system/keymaps/remote.xml -@@ -19,7 +19,7 @@ - - - -- -+ - - - -@@ -73,9 +73,9 @@ - VolumeDown - Mute - ShutDown() -- ActivateWindow(Videos) -- ActivateWindow(Music) -- ActivateWindow(Pictures) -+ ActivateWindow(MyVideos) -+ ActivateWindow(MyMusic) -+ ActivateWindow(MyPictures) - ActivateWindow(Videos,TvShows) - ActivateWindow(TVGuide) - ActivateWindow(TVChannels) -@@ -83,9 +83,9 @@ - ActivateWindow(TVRecordings) - ActivateWindow(TVSearch) - ActivateWindow(TVChannels) -- ActivateWindow(Videos) -- ActivateWindow(Music) -- ActivateWindow(Pictures) -+ ActivateWindow(MyVideos) -+ ActivateWindow(MyMusic) -+ ActivateWindow(MyPictures) - Number0 - Number1 - JumpSMS2 -@@ -142,14 +142,14 @@ - Blue - - -- -+ - - Delete - Highlight - Move - Rename - -- -+ - - - Delete -@@ -161,12 +161,18 @@ - Queue - - -- -+ - - Queue - Queue - -- -+ -+ -+ -+ Queue -+ Queue -+ -+ - - - Delete -@@ -258,6 +264,13 @@ - CodecInfo - - -+ -+ -+ Back -+ Back -+ Back -+ -+ - - - Back -@@ -292,12 +305,12 @@ - NextResolution - - -- -+ - - - ResetCalibration - -- -+ - - - Back -@@ -353,12 +366,18 @@ - Delete - - -- -+ - - Queue - Delete - -- -+ -+ -+ -+ Queue -+ Queue -+ -+ - - - Delete -@@ -390,11 +409,11 @@ - Back - - -- -+ - - info - -- -+ - - - Number0 -@@ -455,11 +474,11 @@ - PreviousMenu - - -- -+ - - PreviousMenu - -- -+ - - - PreviousMenu -@@ -661,11 +680,16 @@ - number9 - - -- -+ - - PreviousMenu - -- -+ -+ -+ -+ Delete -+ -+ - - - Red -diff --git a/system/keymaps/touchscreen.xml b/system/keymaps/touchscreen.xml -index 5124cdf..4d16457 100644 ---- a/system/keymaps/touchscreen.xml -+++ b/system/keymaps/touchscreen.xml -@@ -15,13 +15,13 @@ - ActivateWindow(PlayerControls) - - -- -+ - - Select - Highlight - Highlight - -- -+ - - - StepBack -@@ -100,4 +100,4 @@ - ChannelDown - - -- -+ -\ No newline at end of file diff --git a/system/peripherals.xml b/system/peripherals.xml index 67f6b7a..ea2b245 100644 --- a/system/peripherals.xml @@ -8964,21 +685,8 @@ index b8c90a5..52e60e3 100644 0 5 -diff --git a/system/settings/rbp.xml b/system/settings/rbp.xml -index 806eadf..eb5f26c 100644 ---- a/system/settings/rbp.xml -+++ b/system/settings/rbp.xml -@@ -39,7 +39,7 @@ - -
- -- -+ - - false - diff --git a/system/settings/settings.xml b/system/settings/settings.xml -index 53a4fe3..8ef5874 100644 +index 5ba7bdb..8ef5874 100644 --- a/system/settings/settings.xml +++ b/system/settings/settings.xml @@ -46,6 +46,67 @@ @@ -9049,312 +757,7 @@ index 53a4fe3..8ef5874 100644 1 false -@@ -100,7 +161,7 @@ - - - 2 -- 20 -+ 0 - - 0 - 10 -@@ -848,20 +909,18 @@ -
-
- -- -+ - - 1 - true - - -- -+ - 1 - true - -- -- -- -- -+ -+ - 1 - true - -@@ -879,11 +938,6 @@ - - - -- -- 2 -- false -- -- - - 2 - false -@@ -897,10 +951,15 @@ - - - -+ -+ 2 -+ false -+ -+ - - - -- -+ - - 0 - 1 -@@ -914,23 +973,46 @@ - - - -- -+ - 2 -- true -- -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ - -- -- 4 -+ -+ 2 -+ 0 -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ 0 -+ -+ -+ -+ -+ -+ -+ 2 - true - - -- -+ - 2 -- true -+ false - - -- -- - - 1 - false -@@ -941,16 +1023,14 @@ - true - - -- -- -- -- 2 -- true -+ -+ 1 -+ false - - -- -- 0 -- true -+ -+ 1 -+ false - - - -@@ -970,47 +1050,26 @@ - - - -- -- 2 -- false -+ -+ -+ -+ 0 -+ true - - -- -- 2 -- 0 -- -- -- -- -- -- -- -- -- -- -+ - 2 -- 0 -- -- -- -- -- -- -- -- -- -- 0 -- -- -+ true -+ - -- -- 1 -- false -+ -+ 4 -+ true - - -- -- 1 -- false -+ -+ 2 -+ true - - - -@@ -1021,7 +1080,17 @@ - - - -- -+ -+ -+ 2 -+ true -+ -+ -+ -+ 0 -+ true -+ -+ - - 3 - [%N. ]%A - %T -@@ -1049,35 +1118,23 @@ - 16016 - - -- -- 2 -- true -- -- -- -- -+ -+ - - 1 - true - -- -- -- -- -- 2 -- true -- -- -- -- 0 -- true -- - - - 1 - false - - -+ -+ 2 -+ true -+ -+ - - 2 - false -@@ -1107,6 +1164,10 @@ - - - -+ -+ 4 -+ 10501 -+ - - 4 - false -@@ -1121,7 +1182,7 @@ - - - -- -+ - - 0 - true -@@ -1478,18 +1539,6 @@ - - - -- -- 1 -- 0 -- -- -- -- -- -- -- -- -- - - 1 - 120 -@@ -1965,6 +2014,15 @@ +@@ -1953,6 +2014,15 @@ @@ -9370,7 +773,7 @@ index 53a4fe3..8ef5874 100644 -@@ -2047,6 +2105,13 @@ +@@ -2035,6 +2105,13 @@ @@ -9384,29 +787,7 @@ index 53a4fe3..8ef5874 100644 -@@ -2464,7 +2529,7 @@ - - - 0 -- true -+ false - - - 0 -@@ -2977,10 +3042,10 @@ - - - -- -+ - HAS_EVENT_SERVER - HAS_JSONRPC -- -+ - - - 1 -@@ -3066,6 +3131,13 @@ +@@ -3054,6 +3131,13 @@ @@ -9433,460 +814,6 @@ index eba0f1e..8bb41a5 100644 wiiuse: @$(MAKE) -C wiiuse_$(VERSION)/src clean: -diff --git a/tools/android/packaging/Makefile.in b/tools/android/packaging/Makefile.in -index 7dc1183..e934db1 100644 ---- a/tools/android/packaging/Makefile.in -+++ b/tools/android/packaging/Makefile.in -@@ -2,6 +2,7 @@ include ../../depends/Makefile.include - - OBJS = libcurl.so \ - librtmp.so \ -+ libafpclient.so \ - libplist.so libshairplay.so \ - libnfs.so libass.so \ - libbluray.so libsmbclient.so -diff --git a/tools/buildsteps/android/make-binary-addons b/tools/buildsteps/android/make-binary-addons -index 1c07b4c..a82e021 100644 ---- a/tools/buildsteps/android/make-binary-addons -+++ b/tools/buildsteps/android/make-binary-addons -@@ -15,14 +15,7 @@ then - do - echo "building $addon" - git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon -- -- if [ "$CMAKE_BUILD" = true ]; then -- # Must match prefix in android/PathSetup.cmake -- INSTALL_PREFIX="../../../../../build/install" -- else -- INSTALL_PREFIX="\$(PREFIX)" -- fi -- cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS V=99 VERBOSE=1 INSTALL_PREFIX="$INSTALL_PREFIX" || ALL_BINARY_ADDONS_BUILT="0" -+ cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS V=99 VERBOSE=1 || ALL_BINARY_ADDONS_BUILT="0" - done - fi - -diff --git a/tools/buildsteps/android/package b/tools/buildsteps/android/package -index ec32294..7721b9e 100644 ---- a/tools/buildsteps/android/package -+++ b/tools/buildsteps/android/package -@@ -2,20 +2,18 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} - XBMC_PLATFORM_DIR=android - . $WORKSPACE/tools/buildsteps/defaultenv - --if [ "x$BUILD_OBB" == "xtrue" ]; then -- TARGET=apk-obb-unsigned --else -- TARGET=apk-unsigned -+# Temporarily disabled because packaging not implement for CMake -+if [ "$CMAKE_BUILD" = true ]; then -+ exit 0 - fi - --if [ "$CMAKE_BUILD" = true ]; then -- cd $WORKSPACE/build;make -j$BUILDTHREADS $TARGET -+if [ "x$BUILD_OBB" == "xtrue" ] -+then -+ cd $WORKSPACE;make apk-obb-unsigned - else -- cd $WORKSPACE;make -j$BUILDTHREADS $TARGET -+ cd $WORKSPACE;make apk-unsigned - fi - $RUN_SIGNSTEP --mv tools/android/packaging/Kodi.symbols*.tar.bz2 $WORKSPACE/ --cd $WORKSPACE - - #rename for upload - #e.x. xbmc-20130314-8c2fb31-Frodo-armeabi-v7a.apk -@@ -25,3 +23,4 @@ if [ -f *.obb ] - then - mv *.obb $UPLOAD_FILENAME.obb - fi -+mv tools/android/packaging/Kodi.symbols*.tar.bz2 $WORKSPACE/ -diff --git a/tools/buildsteps/androidx86/make-binary-addons b/tools/buildsteps/androidx86/make-binary-addons -index 0ef6c3d..e3e1899 100644 ---- a/tools/buildsteps/androidx86/make-binary-addons -+++ b/tools/buildsteps/androidx86/make-binary-addons -@@ -15,14 +15,7 @@ then - do - echo "building $addon" - git clean -xffd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon -- -- if [ "$CMAKE_BUILD" = true ]; then -- # Must match prefix in android/PathSetup.cmake -- INSTALL_PREFIX="../../../../../build/install" -- else -- INSTALL_PREFIX="\$(PREFIX)" -- fi -- cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS V=99 VERBOSE=1 INSTALL_PREFIX="$INSTALL_PREFIX" || ALL_BINARY_ADDONS_BUILT="0" -+ cd $WORKSPACE/$BINARY_ADDONS_ROOT/$addon;make -j $BUILDTHREADS V=99 VERBOSE=1 || ALL_BINARY_ADDONS_BUILT="0" - done - fi - -diff --git a/tools/buildsteps/androidx86/package b/tools/buildsteps/androidx86/package -index 19249c6..b7d4000 100644 ---- a/tools/buildsteps/androidx86/package -+++ b/tools/buildsteps/androidx86/package -@@ -2,26 +2,25 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} - XBMC_PLATFORM_DIR=android - . $WORKSPACE/tools/buildsteps/defaultenv - --if [ "x$BUILD_OBB" == "xtrue" ]; then -- TARGET=apk-obb-unsigned --else -- TARGET=apk-unsigned -+# Temporarily disabled because packaging not implement for CMake -+if [ "$CMAKE_BUILD" = true ]; then -+ exit 0 - fi - --if [ "$CMAKE_BUILD" = true ]; then -- cd $WORKSPACE/build;make -j$BUILDTHREADS $TARGET -+if [ "x$BUILD_OBB" == "xtrue" ] -+then -+ cd $WORKSPACE;make apk-obb-unsigned - else -- cd $WORKSPACE;make -j$BUILDTHREADS $TARGET -+ cd $WORKSPACE;make apk-unsigned - fi - $RUN_SIGNSTEP --mv tools/android/packaging/Kodi.symbols*.tar.bz2 $WORKSPACE/ --cd $WORKSPACE - - #rename for upload - #e.x. xbmc-20130314-8c2fb31-Frodo-x86.apk - UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-x86" - mv kodiapp-x86-*.apk $UPLOAD_FILENAME.apk --if [ -f *.obb ] -+if [ -f *.obb ] - then - mv *.obb $UPLOAD_FILENAME.obb - fi -+mv tools/android/packaging/Kodi.symbols*.tar.bz2 $WORKSPACE/ -diff --git a/tools/depends/configure.ac b/tools/depends/configure.ac -index 11b60e2..7b25715 100644 ---- a/tools/depends/configure.ac -+++ b/tools/depends/configure.ac -@@ -456,7 +456,7 @@ if test "$platform_os" == "android"; then - AC_MSG_ERROR("NDK path is required for android") - fi - -- if ([! test -f "$use_ndk/source.properties"] && [! test -f "$use_ndk/RELEASE.TXT"]) ; then -+ if ! test -f "$use_ndk/RELEASE.TXT" ; then - AC_MSG_ERROR("$use_ndk is not an NDK directory") - fi - -@@ -543,7 +543,6 @@ echo -e - AC_SUBST(use_sdk_path) - AC_SUBST(use_ndk) - AC_SUBST(use_sdk) -- AC_SUBST(build_tools_path) - fi - - AC_SUBST(use_host) -@@ -575,7 +574,6 @@ echo -e "cpu:\t\t $use_cpu" - echo -e "host:\t\t $use_host" - if test "$platform_os" == "android"; then - echo -e "sdk-platform:\t $use_sdk" -- echo -e "build-tools:\t $build_tools_path" - fi - - if test "$platform_os" == "ios"; then -diff --git a/tools/depends/native/Makefile b/tools/depends/native/Makefile -index 1a179e2..b76dfcc 100644 ---- a/tools/depends/native/Makefile -+++ b/tools/depends/native/Makefile -@@ -34,7 +34,7 @@ libpng-native: zlib-native - swig-native: pcre-native - distribute-native: python27-native - distutilscross-native: python27-native distribute-native --tar-native: xz-native automake-native -+tar-native: xz-native - python27-native: zlib-native - - #liblzo2 has stale packaged automake files that cause borked host/build detection -diff --git a/tools/depends/native/gettext-native/Makefile b/tools/depends/native/gettext-native/Makefile -index 8c75a28..cbde5f5 100644 ---- a/tools/depends/native/gettext-native/Makefile -+++ b/tools/depends/native/gettext-native/Makefile -@@ -5,7 +5,7 @@ DEPS= ../../Makefile.include.in Makefile - - # lib name, version - LIBNAME=gettext --VERSION=0.19.8 -+VERSION=0.18.2 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - -diff --git a/tools/depends/native/giflib-native/Makefile b/tools/depends/native/giflib-native/Makefile -index b556e67..0885272 100644 ---- a/tools/depends/native/giflib-native/Makefile -+++ b/tools/depends/native/giflib-native/Makefile -@@ -5,7 +5,7 @@ PLATFORM=$(NATIVEPLATFORM) - - # lib name, version - LIBNAME=giflib --VERSION=5.1.4 -+VERSION=5.1.0 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.bz2 - -diff --git a/tools/depends/native/liblzo2-native/Makefile b/tools/depends/native/liblzo2-native/Makefile -index 927ffb5..41809ea 100644 ---- a/tools/depends/native/liblzo2-native/Makefile -+++ b/tools/depends/native/liblzo2-native/Makefile -@@ -5,7 +5,7 @@ DEPS= ../../Makefile.include.in Makefile - - # lib name, version - LIBNAME=lzo --VERSION=2.09 -+VERSION=2.03 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - -diff --git a/tools/depends/native/swig-native/Makefile b/tools/depends/native/swig-native/Makefile -index 6b255b2..9067b2a 100644 ---- a/tools/depends/native/swig-native/Makefile -+++ b/tools/depends/native/swig-native/Makefile -@@ -6,7 +6,7 @@ DEPS= ../../Makefile.include.in Makefile - - # lib name, version - LIBNAME=swig --VERSION=3.0.10 -+VERSION=2.0.8 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - -diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile -index 2f0c831..4c69844 100644 ---- a/tools/depends/target/Makefile -+++ b/tools/depends/target/Makefile -@@ -9,8 +9,8 @@ DEPENDS = \ - libgcrypt bzip2 liblzo2 libzip freetype2 fontconfig \ - openssl gmp nettle gnutls curl \ - libjpeg-turbo libpng fribidi libass \ -- librtmp libxml2 yajl libmicrohttpd mysql libffi \ -- python27 libshairplay \ -+ libmodplug librtmp libxml2 yajl libmicrohttpd mysql libffi \ -+ python27 afpfs-ng libshairplay \ - libplist libcec libbluray tinyxml dummy-libxbmc \ - libamplayer libssh taglib libusb libnfs \ - pythonmodule-pil pythonmodule-setuptools \ -@@ -86,6 +86,7 @@ librtmp: openssl - libmicrohttpd: gnutls libgcrypt libgpg-error - python27: expat gettext libxml2 sqlite3 openssl libffi - libcdio: $(ICONV) -+afpfs-ng: libgcrypt $(ICONV) - libplist: libxml2 $(ZLIB) - libbluray: $(ICONV) libxml2 - libssh: libgcrypt openssl $(ZLIB) -diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in -index 7b32712..b5c96fa 100644 ---- a/tools/depends/target/Toolchain.cmake.in -+++ b/tools/depends/target/Toolchain.cmake.in -@@ -1,71 +1,66 @@ --set(DEPENDS_PATH "@prefix@/@deps_dir@") --set(NATIVEPREFIX "@prefix@/@tool_dir@") -+SET(DEPENDS_PATH "@prefix@/@deps_dir@") -+SET(NATIVEPREFIX "@prefix@/@tool_dir@") - --set(OS "@platform_os@") --set(CPU "@use_cpu@") --set(PLATFORM "@target_platform@") --if("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") -- set(CMAKE_SYSTEM_NAME Linux) --endif() -+SET(OS "@platform_os@") -+SET(CPU "@use_cpu@") -+SET(PLATFORM "@target_platform@") -+IF("${OS}" STREQUAL "linux" OR "${OS}" STREQUAL "android") -+SET(CMAKE_SYSTEM_NAME Linux) -+ENDIF() - - # set special CORE_SYSTEM_NAME --if("${OS}" STREQUAL "android") -- set(CORE_SYSTEM_NAME android) --elseif("${OS}" STREQUAL "osx") -- set(CORE_SYSTEM_NAME osx) --elseif("${OS}" STREQUAL "ios") -- set(CORE_SYSTEM_NAME ios) -- set(CMAKE_SYSTEM_NAME Darwin) --elseif("${PLATFORM}" STREQUAL "raspberry-pi") -- set(CORE_SYSTEM_NAME rbpi) --endif() -+IF("${OS}" STREQUAL "android") -+SET(CORE_SYSTEM_NAME android) -+ELSEIF("${OS}" STREQUAL "ios") -+SET(CORE_SYSTEM_NAME ios) -+SET(CMAKE_SYSTEM_NAME Darwin) -+ELSEIF("${PLATFORM}" STREQUAL "raspberry-pi") -+SET(CORE_SYSTEM_NAME rbpi) -+ENDIF() - --if("${OS}" STREQUAL "ios" OR "${OS}" STREQUAL "osx") -- set(CMAKE_OSX_SYSROOT @use_sdk_path@) --endif() --set(CMAKE_SYSTEM_VERSION 1) -+IF("${OS}" STREQUAL "ios" OR "${OS}" STREQUAL "osx") -+SET(CMAKE_OSX_SYSROOT @use_sdk_path@) -+ENDIF() -+SET(CMAKE_SYSTEM_VERSION 1) - - # specify the cross compiler --set(CMAKE_C_COMPILER @CC@) --set(CMAKE_CXX_COMPILER @CXX@) --set(CMAKE_AR @AR@ CACHE FILEPATH "Archiver") --set(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") -+SET(CMAKE_C_COMPILER @CC@) -+SET(CMAKE_CXX_COMPILER @CXX@) -+SET(CMAKE_AR @AR@ CACHE FILEPATH "Archiver") -+SET(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") - - # where is the target environment --set(CMAKE_FIND_ROOT_PATH @prefix@/@deps_dir@ @use_toolchain@ @use_toolchain@/usr @use_sdk_path@ @use_sdk_path@/usr @use_toolchain@/sysroot/usr) --set(CMAKE_LIBRARY_PATH @prefix@/@deps_dir@/lib:@use_toolchain@/usr/lib/@use_host@:@use_toolchain@/lib/@use_host@) -+SET(CMAKE_FIND_ROOT_PATH @prefix@/@deps_dir@ @use_toolchain@ @use_toolchain@/usr @use_sdk_path@ @use_sdk_path@/usr @use_toolchain@/sysroot/usr) -+SET(CMAKE_LIBRARY_PATH @prefix@/@deps_dir@/lib:@use_toolchain@/usr/lib/@use_host@:@use_toolchain@/lib/@use_host@) - - # add RBPI's firmware directories --if("${CORE_SYSTEM_NAME}" STREQUAL "rbpi") -- list(APPEND CMAKE_FIND_ROOT_PATH @use_firmware@/opt/vc) -- list(APPEND CMAKE_LIBRARY_PATH @use_firmware@/opt/vc/lib) -- list(APPEND CMAKE_INCLUDE_PATH @use_firmware@/opt/vc/include) --endif() -+IF("${CORE_SYSTEM_NAME}" STREQUAL "rbpi") -+ LIST(APPEND CMAKE_FIND_ROOT_PATH @use_firmware@/opt/vc) -+ LIST(APPEND CMAKE_LIBRARY_PATH @use_firmware@/opt/vc/lib) -+ LIST(APPEND CMAKE_INCLUDE_PATH @use_firmware@/opt/vc/include) -+ENDIF() - --# add Android directories and tools --if("${CORE_SYSTEM_NAME}" STREQUAL "android") -- set(NDKROOT @use_ndk@) -- set(SDKROOT @use_sdk_path@) -- set(SDK_PLATFORM @use_sdk@) -- string(REPLACE ":" ";" SDK_BUILDTOOLS_PATH "@build_tools_path@") --endif() -+# add Android directories -+IF("${CORE_SYSTEM_NAME}" STREQUAL "android") -+ LIST(APPEND NDKROOT @use_ndk@) -+ENDIF() - --set(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") --set(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") --set(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") --set(CMAKE_EXE_LINKER_FLAGS "-L@prefix@/@deps_dir@/lib @platform_ldflags@") --set(ENV{CFLAGS} ${CMAKE_C_FLAGS}) --set(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS}) --set(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS}) --set(ENV{LDFLAGS} ${CMAKE_EXE_LINKER_FLAGS}) -+SET(CMAKE_C_FLAGS "@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") -+SET(CMAKE_CXX_FLAGS "@platform_cxxflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") -+SET(CMAKE_CPP_FLAGS "@platform_cflags@ @platform_includes@ -isystem @prefix@/@deps_dir@/include") -+SET(CMAKE_EXE_LINKER_FLAGS "-L@prefix@/@deps_dir@/lib @platform_ldflags@") -+SET(ENV{CFLAGS} ${CMAKE_C_FLAGS}) -+SET(ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS}) -+SET(ENV{CPPFLAGS} ${CMAKE_CPP_FLAGS}) -+SET(ENV{LDFLAGS} ${CMAKE_EXE_LINKER_FLAGS}) - # search for programs in the build host directories --set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -+SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) - # for libraries and headers in the target directories --set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) --set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) --set(ENV{PKG_CONFIG_LIBDIR} @prefix@/@deps_dir@/lib/pkgconfig) -+SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -+SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -+SET(ENV{PKG_CONFIG_LIBDIR} @prefix@/@deps_dir@/lib/pkgconfig) - - # Binary Addons --if(NOT OS STREQUAL "linux") -- set(ADDONS_PREFER_STATIC_LIBS ON) --endif() -+IF(NOT OS STREQUAL "linux") -+SET(ADDONS_PREFER_STATIC_LIBS ON) -+ENDIF() -diff --git a/tools/depends/target/config-binaddons.site.in b/tools/depends/target/config-binaddons.site.in -index 0753a4c..44d5959 100644 ---- a/tools/depends/target/config-binaddons.site.in -+++ b/tools/depends/target/config-binaddons.site.in -@@ -34,7 +34,7 @@ LD_LIBRARY_PATH=@prefix@/@tool_dir@/lib:$LD_LIBRARY_PATH - - NATIVE_ROOT=@prefix@/@tool_dir@ - --#libomxil-bellagio -+#afps-ng and libomxil-bellagio - ac_cv_func_malloc_0_nonnull=yes - - #curl -diff --git a/tools/depends/target/config.site.in b/tools/depends/target/config.site.in -index a3a3bc2..15fa70d 100644 ---- a/tools/depends/target/config.site.in -+++ b/tools/depends/target/config.site.in -@@ -42,7 +42,7 @@ PYTHON_SITE_PKG=@prefix@/@deps_dir@/lib/python${PYTHON_VERSION}/site-packages - PYTHON_NOVERSIONCHECK=no-check - NATIVE_ROOT=@prefix@/@tool_dir@ - --#libomxil-bellagio -+#afps-ng and libomxil-bellagio - ac_cv_func_malloc_0_nonnull=yes - - #curl -diff --git a/tools/depends/target/crossguid/CMakeLists.txt b/tools/depends/target/crossguid/CMakeLists.txt -index 73ad8f9..1c2b831 100644 ---- a/tools/depends/target/crossguid/CMakeLists.txt -+++ b/tools/depends/target/crossguid/CMakeLists.txt -@@ -16,7 +16,7 @@ elseif(APPLE) - target_compile_definitions(${PROJECT_NAME} PRIVATE GUID_CFUUID) - elseif(WIN32) - target_compile_definitions(${PROJECT_NAME} PRIVATE GUID_WINDOWS) --endif() -+endif () - - install(TARGETS ${PROJECT_NAME} DESTINATION lib) - install(FILES guid.h DESTINATION include) -diff --git a/tools/depends/target/crossguid/FindCXX11.cmake b/tools/depends/target/crossguid/FindCXX11.cmake -index fb2a582..001dc8a 100644 ---- a/tools/depends/target/crossguid/FindCXX11.cmake -+++ b/tools/depends/target/crossguid/FindCXX11.cmake -@@ -11,8 +11,8 @@ else() - if(CXX_FLAG_CXX0X) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - set(CXX_STD11_FLAGS "-std=c++0x") -- endif() --endif() -+ endif(CXX_FLAG_CXX0X) -+endif(CXX_FLAG_CXX11) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(CXX11 DEFAULT_MSG CXX_STD11_FLAGS) -diff --git a/tools/depends/target/crossguid/Makefile b/tools/depends/target/crossguid/Makefile -index 487ab2a..fe072c0 100644 ---- a/tools/depends/target/crossguid/Makefile -+++ b/tools/depends/target/crossguid/Makefile -@@ -37,9 +37,7 @@ LIBDYLIB=$(PLATFORM)/lib$(LIBNAME).a - - .PHONY: .installed-$(PLATFORM) - --all: .installed-$(PLATFORM) $(PREFIX)/lib/lib$(LIBNAME).a --$(PREFIX)/lib/lib$(LIBNAME).a: -- @make .installed-$(PLATFORM) -+all: .installed-$(PLATFORM) $(LIBDYLIB) - - $(TARBALLS_LOCATION)/$(ARCHIVE): - cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) -diff --git a/tools/depends/target/curl/Makefile b/tools/depends/target/curl/Makefile -index e641a9d..f82de26 100644 ---- a/tools/depends/target/curl/Makefile -+++ b/tools/depends/target/curl/Makefile -@@ -13,7 +13,7 @@ ARCHIVE=$(SOURCE).tar.bz2 - # configuration settings - CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ - ./configure --prefix=$(PREFIX) \ -- --without-libssh2 --disable-ntlm-wb --enable-ipv6 -+ --without-libssh2 --disable-ntlm-wb - - LIBDYLIB=$(PLATFORM)/lib/.libs/lib$(LIBNAME).a - diff --git a/tools/depends/target/ffmpeg/0001-Discard-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch b/tools/depends/target/ffmpeg/0001-Discard-data-before-VO-VOL-in-mpeg-4-over-mpegts.patch new file mode 100644 index 0000000..eef7385 @@ -12424,21 +3351,8 @@ index 0000000..5240cf5 + if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { + *poutbuf = NULL; + *poutbuf_size = 0; -diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt -index 41b0362..b42cd89 100644 ---- a/tools/depends/target/ffmpeg/CMakeLists.txt -+++ b/tools/depends/target/ffmpeg/CMakeLists.txt -@@ -16,7 +16,7 @@ if(CROSSCOMPILING) - endif() - - if(CORE_SYSTEM_NAME STREQUAL linux) -- list(APPEND ffmpeg_conf --enable-vdpau --enable-vaapi --enable-pic) -+ list(APPEND ffmpeg_conf --enable-vdpau --enable-vaapi) - elseif(CORE_SYSTEM_NAME STREQUAL android) - if(CPU MATCHES arm) - list(APPEND ffmpeg_conf --cpu=cortex-a9) diff --git a/tools/depends/target/ffmpeg/Makefile b/tools/depends/target/ffmpeg/Makefile -index c3998be..5b2f19c 100644 +index 09e4193..5b2f19c 100644 --- a/tools/depends/target/ffmpeg/Makefile +++ b/tools/depends/target/ffmpeg/Makefile @@ -1,10 +1,24 @@ @@ -12485,15 +3399,6 @@ index c3998be..5b2f19c 100644 ffmpg_config += --enable-gnutls ffmpg_config += --enable-encoder=png --enable-encoder=mjpeg -@@ -26,7 +42,7 @@ ifeq ($(CROSS_COMPILING), yes) - endif - ifeq ($(OS), linux) - ffmpg_config += --target-os=$(OS) --cpu=$(CPU) -- ffmpg_config += --enable-vdpau --enable-vaapi --enable-pic -+ ffmpg_config += --enable-vdpau --enable-vaapi - endif - ifeq ($(OS), android) - ifeq ($(findstring arm, $(CPU)), arm) @@ -48,7 +64,6 @@ ifeq ($(OS), osx) ffmpg_config += --disable-outdev=sdl ffmpg_config += --disable-decoder=mpeg_xvmc --disable-vda --disable-crystalhd --enable-videotoolbox @@ -15885,7 +6790,7 @@ index 0000000..792b5fe +2.5.0 + diff --git a/tools/depends/target/ffmpeg/autobuild.sh b/tools/depends/target/ffmpeg/autobuild.sh -index 6bbebfc..7ef281d 100755 +index 1add222..7ef281d 100755 --- a/tools/depends/target/ffmpeg/autobuild.sh +++ b/tools/depends/target/ffmpeg/autobuild.sh @@ -72,6 +72,7 @@ do @@ -15920,14 +6825,6 @@ index 6bbebfc..7ef281d 100755 [ -f ${ARCHIVE} ] || curl -Ls --create-dirs -f -o ${ARCHIVE} ${BASE_URL}/${VERSION}.tar.gz || { echo "error fetching ${BASE_URL}/${VERSION}.tar.gz" ; exit 3; } -@@ -156,7 +163,6 @@ CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ - --enable-encoder=mjpeg \ - --enable-nonfree \ - --enable-pthreads \ -- --enable-pic \ - --enable-zlib \ - --disable-mipsdsp \ - --disable-mipsdspr2 \ diff --git a/tools/depends/target/ffmpeg/h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch b/tools/depends/target/ffmpeg/h264_parser_fix_parsing_of_mvc_slices_in_some_corner_cases.patch new file mode 100644 index 0000000..648f64f @@ -16415,38455 +7312,11 @@ index 0000000..5e8e07d +-- +2.5.0 + -diff --git a/tools/depends/target/ffmpeg/pfcd_hevc_optimisations.patch b/tools/depends/target/ffmpeg/pfcd_hevc_optimisations.patch -new file mode 100644 -index 0000000..bb3be3f ---- /dev/null -+++ b/tools/depends/target/ffmpeg/pfcd_hevc_optimisations.patch -@@ -0,0 +1,38136 @@ -+From 4c05fa1631b5e8839a7763417c5220291308c707 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 28 Apr 2015 16:18:40 +0100 -+Subject: [PATCH 01/68] Added display output -+ -+--- -+ ffmpeg.c | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -+ 1 file changed, 159 insertions(+) -+ -+diff --git a/ffmpeg.c b/ffmpeg.c -+index a5ec3c3..8828f48 100644 -+--- a/ffmpeg.c -++++ b/ffmpeg.c -+@@ -23,6 +23,11 @@ -+ * multimedia converter based on the FFmpeg libraries -+ */ -+ -++#ifdef RPI -++#define RPI_DISPLAY -++//#define RPI_ZERO_COPY -++#endif -++ -+ #include "config.h" -+ #include -+ #include -+@@ -66,6 +71,20 @@ -+ # include "libavfilter/buffersrc.h" -+ # include "libavfilter/buffersink.h" -+ -++#ifdef RPI_DISPLAY -++#include -++#include -++#include -++#include -++#include -++#include -++#include -++#include -++#ifdef RPI_ZERO_COPY -++#include "libavcodec/rpi_qpu.h" -++#endif -++#endif -++ -+ #if HAVE_SYS_RESOURCE_H -+ #include -+ #include -+@@ -158,6 +177,134 @@ static int restore_tty; -+ static void free_input_threads(void); -+ #endif -+ -++#ifdef RPI_DISPLAY -++ -++#define NUM_BUFFERS 4 -++ -++static MMAL_COMPONENT_T* rpi_display = NULL; -++static MMAL_POOL_T *rpi_pool = NULL; -++ -++#ifdef RPI_ZERO_COPY -++static uint8_t *get_vc_handle(AVBufferRef *bref) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -++ return (uint8_t *)p->vc_handle; -++} -++#endif -++ -++static MMAL_POOL_T* display_alloc_pool(MMAL_PORT_T* port, size_t w, size_t h) -++{ -++ MMAL_POOL_T* pool; -++ size_t i; -++ size_t size = (w*h*3)/2; -++#ifdef RPI_ZERO_COPY -++ mmal_port_parameter_set_boolean(port, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); // Does this mark that the buffer contains a vc_handle? Would have expected a vc_image? -++ pool = mmal_port_pool_create(port, NUM_BUFFERS, 0); -++ assert(pool); -++#else -++ pool = mmal_port_pool_create(port, NUM_BUFFERS, size); -++ -++ for (i = 0; i < NUM_BUFFERS; ++i) -++ { -++ MMAL_BUFFER_HEADER_T* buffer = pool->header[i]; -++ void* bufPtr = buffer->data; -++ memset(bufPtr, i*30, w*h); -++ memset(bufPtr+w*h, 128, (w*h)/2); -++ } -++#endif -++ -++ return pool; -++} -++ -++static void display_cb_input(MMAL_PORT_T *port,MMAL_BUFFER_HEADER_T *buffer) { -++ mmal_buffer_header_release(buffer); -++} -++ -++static MMAL_COMPONENT_T* display_init(size_t x, size_t y, size_t w, size_t h) -++{ -++ MMAL_COMPONENT_T* display; -++ int w2 = (w+31)&~31; -++ int h2 = (h+15)&~15; -++ MMAL_DISPLAYREGION_T region = -++ { -++ {MMAL_PARAMETER_DISPLAYREGION, sizeof(region)}, -++ .set = MMAL_DISPLAY_SET_LAYER | MMAL_DISPLAY_SET_FULLSCREEN | MMAL_DISPLAY_SET_DEST_RECT, -++ .layer = 2, -++ .fullscreen = 0, -++ .dest_rect = {x, y, w, h} -++ }; -++ bcm_host_init(); // TODO is this needed? -++ mmal_component_create(MMAL_COMPONENT_DEFAULT_VIDEO_RENDERER, &display); -++ assert(display); -++ -++ mmal_port_parameter_set(display->input[0], ®ion.hdr); -++ -++ MMAL_ES_FORMAT_T* format = display->input[0]->format; -++ format->encoding = MMAL_ENCODING_I420; -++ format->es->video.width = w2; -++ format->es->video.height = h2; -++ format->es->video.crop.x = 0; -++ format->es->video.crop.y = 0; -++ format->es->video.crop.width = w; -++ format->es->video.crop.height = h; -++ mmal_port_format_commit(display->input[0]); -++ -++ mmal_component_enable(display); -++ -++ rpi_pool = display_alloc_pool(display->input[0], w2, h2); -++ -++ mmal_port_enable(display->input[0],display_cb_input); -++ mmal_port_enable(display->control,display_cb_input); -++ -++ printf("Allocated display %d %d\n",w,h); -++ -++ return display; -++} -++ -++static void display_frame(MMAL_COMPONENT_T* display,AVFrame* fr) -++{ -++ int w = fr->width; -++ int h = fr->height; -++ int w2 = (w+31)&~31; -++ int h2 = (h+15)&~15; -++ if (!display || !rpi_pool) -++ return; -++ MMAL_BUFFER_HEADER_T* buf = mmal_queue_get(rpi_pool->queue); -++ if (!buf) { -++ // Running too fast so drop the frame -++ return; -++ } -++ assert(buf); -++ buf->cmd = 0; -++ buf->length = (w2 * h2 * 3)/2; -++ buf->offset = 0; // Offset to valid data -++ buf->flags = 0; -++#ifdef RPI_ZERO_COPY -++ buf->data = get_vc_handle(fr->buf[0]); -++ buf->alloc_size = (w2*h2*3)/2; -++#else -++ //mmal_buffer_header_mem_lock(buf); -++ memcpy(buf->data, fr->data[0], w2 * h); -++ memcpy(buf->data+w2*h2, fr->data[1], w2 * h / 4); -++ memcpy(buf->data+w2*h2*5/4, fr->data[2], w2 * h / 4); -++ //mmal_buffer_header_mem_unlock(buf); -++#endif -++ -++ mmal_port_send_buffer(display->input[0], buf); // I assume this will automatically get released -++} -++ -++static void display_exit(MMAL_COMPONENT_T* display) -++{ -++ if (display) { -++ mmal_component_destroy(display); -++ } -++ if (rpi_pool) { -++ mmal_port_pool_destroy(display->input[0], rpi_pool); -++ } -++} -++ -++#endif -++ -++ -+ /* sub2video hack: -+ Convert subtitles to video with alpha to insert them in filter graphs. -+ This is a temporary solution until libavfilter gets real subtitles support. -+@@ -581,6 +728,10 @@ static void ffmpeg_cleanup(int ret) -+ } -+ term_exit(); -+ ffmpeg_exited = 1; -++ -++#ifdef RPI_DISPLAY -++ display_exit(rpi_display); -++#endif -+ } -+ -+ void remove_avoptions(AVDictionary **a, AVDictionary *b) -+@@ -928,6 +1079,14 @@ static void do_video_out(AVFormatContext *s, -+ int frame_size = 0; -+ InputStream *ist = NULL; -+ AVFilterContext *filter = ost->filter->filter; -++#ifdef RPI_DISPLAY -++ if (next_picture) -++ { -++ if (!rpi_display) -++ rpi_display = display_init(0,0,next_picture->width,next_picture->height); -++ display_frame(rpi_display,next_picture); -++ } -++#endif -+ -+ if (ost->source_index >= 0) -+ ist = input_streams[ost->source_index]; -+-- -+2.5.0 -+ -+ -+From 90f7867ad638d03e8d1a9902990dfd7edd13fe0d Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 29 Apr 2015 16:49:43 +0100 -+Subject: [PATCH 02/68] Split transform and intra prediction into commands -+ -+--- -+ libavcodec/hevc.c | 119 +++++++++++++++++++++++++++++++++++++++++++++++- -+ libavcodec/hevc.h | 58 +++++++++++++++++++++++ -+ libavcodec/hevc_cabac.c | 15 ++++++ -+ 3 files changed, 191 insertions(+), 1 deletion(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 203f90a..2eebd31 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -920,6 +920,25 @@ static int hls_cross_component_pred(HEVCContext *s, int idx) { -+ return 0; -+ } -+ -++#ifdef RPI -++static void rpi_intra_pred(HEVCContext *s, int log2_trafo_size, int x0, int y0, int c_idx) -++{ -++ if (s->enable_rpi) { -++ HEVCLocalContext *lc = s->HEVClc; -++ HEVCPredCmd *cmd = s->univ_pred_cmds + s->num_pred_cmds++; -++ cmd->type = RPI_PRED_INTRA; -++ cmd->size = log2_trafo_size; -++ cmd->c_idx = c_idx; -++ cmd->x = x0; -++ cmd->y = y0; -++ cmd->na = (lc->na.cand_bottom_left<<4) + (lc->na.cand_left<<3) + (lc->na.cand_up_left<<2) + (lc->na.cand_up<<1) + lc->na.cand_up_right; -++ cmd->mode = c_idx ? lc->tu.intra_pred_mode_c : lc->tu.intra_pred_mode; -++ } else { -++ s->hpc.intra_pred[log2_trafo_size - 2](s, x0, y0, c_idx); -++ } -++} -++#endif -++ -+ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ int xBase, int yBase, int cb_xBase, int cb_yBase, -+ int log2_cb_size, int log2_trafo_size, -+@@ -932,8 +951,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ if (lc->cu.pred_mode == MODE_INTRA) { -+ int trafo_size = 1 << log2_trafo_size; -+ ff_hevc_set_neighbour_available(s, x0, y0, trafo_size, trafo_size); -+- -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size, x0, y0, 0); -++#else -+ s->hpc.intra_pred[log2_trafo_size - 2](s, x0, y0, 0); -++#endif -+ } -+ -+ if (cbf_luma || cbf_cb[0] || cbf_cr[0] || -+@@ -1019,7 +1041,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { -+ if (lc->cu.pred_mode == MODE_INTRA) { -+ ff_hevc_set_neighbour_available(s, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size_c, x0, y0 + (i << log2_trafo_size_c), 1); -++#else -+ s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (i << log2_trafo_size_c), 1); -++#endif -+ } -+ if (cbf_cb[i]) -+ ff_hevc_hls_residual_coding(s, x0, y0 + (i << log2_trafo_size_c), -+@@ -1048,7 +1074,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { -+ if (lc->cu.pred_mode == MODE_INTRA) { -+ ff_hevc_set_neighbour_available(s, x0, y0 + (i << log2_trafo_size_c), trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size_c, x0, y0 + (i << log2_trafo_size_c), 2); -++#else -+ s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (i << log2_trafo_size_c), 2); -++#endif -+ } -+ if (cbf_cr[i]) -+ ff_hevc_hls_residual_coding(s, x0, y0 + (i << log2_trafo_size_c), -+@@ -1077,7 +1107,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ if (lc->cu.pred_mode == MODE_INTRA) { -+ ff_hevc_set_neighbour_available(s, xBase, yBase + (i << log2_trafo_size), -+ trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size, xBase, yBase + (i << log2_trafo_size), 1); -++#else -+ s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (i << log2_trafo_size), 1); -++#endif -+ } -+ if (cbf_cb[i]) -+ ff_hevc_hls_residual_coding(s, xBase, yBase + (i << log2_trafo_size), -+@@ -1087,7 +1121,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ if (lc->cu.pred_mode == MODE_INTRA) { -+ ff_hevc_set_neighbour_available(s, xBase, yBase + (i << log2_trafo_size), -+ trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size, xBase, yBase + (i << log2_trafo_size), 2); -++#else -+ s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (i << log2_trafo_size), 2); -++#endif -+ } -+ if (cbf_cr[i]) -+ ff_hevc_hls_residual_coding(s, xBase, yBase + (i << log2_trafo_size), -+@@ -1099,26 +1137,46 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ int trafo_size_h = 1 << (log2_trafo_size_c + s->ps.sps->hshift[1]); -+ int trafo_size_v = 1 << (log2_trafo_size_c + s->ps.sps->vshift[1]); -+ ff_hevc_set_neighbour_available(s, x0, y0, trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size_c, x0, y0, 1); -++ rpi_intra_pred(s, log2_trafo_size_c, x0, y0, 2); -++#else -+ s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0, 1); -+ s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0, 2); -++#endif -+ if (s->ps.sps->chroma_format_idc == 2) { -+ ff_hevc_set_neighbour_available(s, x0, y0 + (1 << log2_trafo_size_c), -+ trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size_c, x0, y0 + (1 << log2_trafo_size_c), 1); -++ rpi_intra_pred(s, log2_trafo_size_c, x0, y0 + (1 << log2_trafo_size_c), 2); -++#else -+ s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (1 << log2_trafo_size_c), 1); -+ s->hpc.intra_pred[log2_trafo_size_c - 2](s, x0, y0 + (1 << log2_trafo_size_c), 2); -++#endif -+ } -+ } else if (blk_idx == 3) { -+ int trafo_size_h = 1 << (log2_trafo_size + 1); -+ int trafo_size_v = 1 << (log2_trafo_size + s->ps.sps->vshift[1]); -+ ff_hevc_set_neighbour_available(s, xBase, yBase, -+ trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size, xBase, yBase, 1); -++ rpi_intra_pred(s, log2_trafo_size, xBase, yBase, 2); -++#else -+ s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase, 1); -+ s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase, 2); -++#endif -+ if (s->ps.sps->chroma_format_idc == 2) { -+ ff_hevc_set_neighbour_available(s, xBase, yBase + (1 << (log2_trafo_size)), -+ trafo_size_h, trafo_size_v); -++#ifdef RPI -++ rpi_intra_pred(s, log2_trafo_size, xBase, yBase + (1 << (log2_trafo_size)), 1); -++ rpi_intra_pred(s, log2_trafo_size, xBase, yBase + (1 << (log2_trafo_size)), 2); -++#else -+ s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (1 << (log2_trafo_size)), 1); -+ s->hpc.intra_pred[log2_trafo_size - 2](s, xBase, yBase + (1 << (log2_trafo_size)), 2); -++#endif -+ } -+ } -+ } -+@@ -2293,6 +2351,31 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, -+ lc->ctb_up_left_flag = ((x_ctb > 0) && (y_ctb > 0) && (ctb_addr_in_slice-1 >= s->ps.sps->ctb_width) && (s->ps.pps->tile_id[ctb_addr_ts] == s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1 - s->ps.sps->ctb_width]])); -+ } -+ -++#ifdef RPI -++static void rpi_execute_pred_cmds(HEVCContext *s) -++{ -++ int i; -++ HEVCPredCmd *cmd = s->univ_pred_cmds; -++ HEVCLocalContext *lc = s->HEVClc; -++ -++ for(i = s->num_pred_cmds; i > 0; i--, cmd++) { -++ if (cmd->type == RPI_PRED_INTRA) { -++ lc->tu.intra_pred_mode_c = lc->tu.intra_pred_mode = cmd->mode; -++ lc->na.cand_bottom_left = (cmd->na >> 4) & 1; -++ lc->na.cand_left = (cmd->na >> 3) & 1; -++ lc->na.cand_up_left = (cmd->na >> 2) & 1; -++ lc->na.cand_up = (cmd->na >> 1) & 1; -++ lc->na.cand_up_right = (cmd->na >> 0) & 1; -++ s->hpc.intra_pred[cmd->size - 2](s, cmd->x, cmd->y, cmd->c_idx); -++ } else { -++ s->hevcdsp.transform_add[cmd->size-2](cmd->dst, cmd->buf, cmd->stride); -++ } -++ } -++ s->num_pred_cmds = 0; -++ s->num_coeffs = 0; -++} -++#endif -++ -+ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ { -+ HEVCContext *s = avctxt->priv_data; -+@@ -2302,6 +2385,10 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ int y_ctb = 0; -+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; -+ -++#ifdef RPI -++ s->enable_rpi = 1; // TODO this should depend on cross component and frame width etc. -++#endif -++ -+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { -+ av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n"); -+ return AVERROR_INVALIDDATA; -+@@ -2331,6 +2418,9 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag; -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -++#ifdef RPI -++ rpi_execute_pred_cmds(s); -++#endif -+ if (more_data < 0) { -+ s->tab_slice_address[ctb_addr_rs] = -1; -+ return more_data; -+@@ -2376,6 +2466,10 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int -+ s = s1->sList[self_id]; -+ lc = s->HEVClc; -+ -++#ifdef RPI -++ s->enable_rpi = 0; -++#endif -++ -+ if(ctb_row) { -+ ret = init_get_bits8(&lc->gb, s->data + s->sh.offset[ctb_row - 1], s->sh.size[ctb_row - 1]); -+ -+@@ -3064,6 +3158,13 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ -+ av_freep(&s->cabac_state); -+ -++#ifdef RPI -++ av_freep(&s->unif_mv_cmds); -++ av_freep(&s->unif_xfm_cmds); -++ av_freep(&s->univ_pred_cmds); -++ av_freep(&s->coeffs_buf); -++#endif -++ -+ for (i = 0; i < 3; i++) { -+ av_freep(&s->sao_pixel_buffer_h[i]); -+ av_freep(&s->sao_pixel_buffer_v[i]); -+@@ -3123,6 +3224,22 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ s->HEVClcList[0] = s->HEVClc; -+ s->sList[0] = s; -+ -++#ifdef RPI -++ s->unif_mv_cmds = av_mallocz(sizeof(HEVCMvCmd)*RPI_MAX_MV_CMDS); -++ if (!s->unif_mv_cmds) -++ goto fail; -++ s->unif_xfm_cmds = av_mallocz(sizeof(HEVCXfmCmd)*RPI_MAX_XFM_CMDS); -++ if (!s->unif_xfm_cmds) -++ goto fail; -++ s->univ_pred_cmds = av_mallocz(sizeof(HEVCPredCmd)*RPI_MAX_PRED_CMDS); -++ if (!s->univ_pred_cmds) -++ goto fail; -++ s->coeffs_buf = av_mallocz(sizeof(int16_t)*RPI_MAX_XFM_CMDS*16); -++ if (!s->coeffs_buf) -++ goto fail; -++ s->enable_rpi = 0; -++#endif -++ -+ s->cabac_state = av_malloc(HEVC_CONTEXTS); -+ if (!s->cabac_state) -+ goto fail; -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index c91f815..71174af 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -23,6 +23,9 @@ -+ #ifndef AVCODEC_HEVC_H -+ #define AVCODEC_HEVC_H -+ -++// define RPI to split the CABAC/prediction/transform into separate stages -++#include "config.h" -++ -+ #include "libavutil/buffer.h" -+ #include "libavutil/md5.h" -+ -+@@ -816,6 +819,49 @@ typedef struct HEVCLocalContext { -+ int boundary_flags; -+ } HEVCLocalContext; -+ -++#ifdef RPI -++ -++// RPI_MAX_WIDTH is maximum width in pixels supported by the accelerated code -++#define RPI_MAX_WIDTH 2048 -++ -++// Worst case is for 4:4:4 4x4 blocks with 64 high coding tree blocks, so 16 MV cmds per 4 pixels across for each colour plane -++#define RPI_MAX_MV_CMDS (16*3*(RPI_MAX_WIDTH/4)) -++#define RPI_MAX_XFM_CMDS (16*3*(RPI_MAX_WIDTH/4)) -++// Each block can have an intra prediction and a transform_add command -++#define RPI_MAX_PRED_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -++ -++// Command for inter prediction -++typedef struct HEVCMvCmd { -++} HEVCMvCmd; -++ -++// Command for transform to process a block of coefficients -++typedef struct HEVCXfmCmd { -++} HEVCXfmCmd; -++ -++// Command for intra prediction and transform_add of predictions to coefficients -++#define RPI_PRED_TRANSFORM_ADD 0 -++#define RPI_PRED_INTRA 1 -++typedef struct HEVCPredCmd { -++ uint8_t size; -++ uint8_t type; -++ uint8_t na; -++ uint8_t c_idx; -++ union { -++ uint8_t *dst; // RPI_PRED_TRANSFORM_ADD -++ uint32_t x; // RPI_PRED_INTRA -++ }; -++ union { -++ int16_t *buf; // RPI_PRED_TRANSFORM_ADD -++ uint32_t y; // RPI_PRED_INTRA -++ }; -++ union { -++ enum IntraPredMode mode; // RPI_PRED_TRANSFORM_ADD -++ uint32_t stride; // RPI_PRED_INTRA -++ }; -++} HEVCPredCmd; -++ -++#endif -++ -+ typedef struct HEVCContext { -+ const AVClass *c; // needed by private avoptions -+ AVCodecContext *avctx; -+@@ -831,6 +877,18 @@ typedef struct HEVCContext { -+ int width; -+ int height; -+ -++#ifdef RPI -++ int enable_rpi; -++ HEVCMvCmd *unif_mv_cmds; -++ HEVCXfmCmd *unif_xfm_cmds; -++ HEVCPredCmd *univ_pred_cmds; -++ int16_t *coeffs_buf; -++ int num_mv_cmds; -++ int num_xfm_cmds; -++ int num_pred_cmds; -++ int num_coeffs; -++#endif -++ -+ uint8_t *cabac_state; -+ -+ /** 1 if the independent slice segment header was successfully parsed */ -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index d1bef83..c0fdfad 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1510,6 +1510,21 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ coeffs[i] = coeffs[i] + ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); -+ } -+ } -++#ifdef RPI -++ if (s->enable_rpi) { -++ int16_t *c = s->coeffs_buf + s->num_coeffs; -++ int n = trafo_size * trafo_size; -++ HEVCPredCmd *cmd = s->univ_pred_cmds + s->num_pred_cmds++; -++ memcpy(c, coeffs, n * sizeof(int16_t)); // TODO change pointer earlier and we can avoid this copy -++ s->num_coeffs += n; -++ cmd->type = RPI_PRED_TRANSFORM_ADD; -++ cmd->size = log2_trafo_size; -++ cmd->buf = c; -++ cmd->dst = dst; -++ cmd->stride = stride; -++ return; -++ } -++#endif -+ s->hevcdsp.transform_add[log2_trafo_size-2](dst, coeffs, stride); -+ } -+ -+-- -+2.5.0 -+ -+ -+From 18fe64824d85a2ac9832bd5b600db8e52b5581fe Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 30 Apr 2015 15:23:22 +0100 -+Subject: [PATCH 03/68] Added simple VPU test code -+ -+--- -+ libavcodec/Makefile | 7 + -+ libavcodec/hevc.c | 33 +- -+ libavcodec/rpi_hevc_transform.h | 212 ++++++ -+ libavcodec/rpi_hevc_transform.s | 147 ++++ -+ libavcodec/rpi_mailbox.c | 293 ++++++++ -+ libavcodec/rpi_mailbox.h | 20 + -+ libavcodec/rpi_qpu.c | 652 ++++++++++++++++++ -+ libavcodec/rpi_qpu.h | 45 ++ -+ libavcodec/rpi_shader.c | 818 ++++++++++++++++++++++ -+ libavcodec/rpi_shader.h | 20 + -+ libavcodec/rpi_shader.qasm | 1413 +++++++++++++++++++++++++++++++++++++++ -+ libavcodec/rpi_user_vcsm.h | 425 ++++++++++++ -+ 12 files changed, 4084 insertions(+), 1 deletion(-) -+ create mode 100644 libavcodec/rpi_hevc_transform.h -+ create mode 100644 libavcodec/rpi_hevc_transform.s -+ create mode 100644 libavcodec/rpi_mailbox.c -+ create mode 100644 libavcodec/rpi_mailbox.h -+ create mode 100644 libavcodec/rpi_qpu.c -+ create mode 100644 libavcodec/rpi_qpu.h -+ create mode 100644 libavcodec/rpi_shader.c -+ create mode 100644 libavcodec/rpi_shader.h -+ create mode 100644 libavcodec/rpi_shader.qasm -+ create mode 100644 libavcodec/rpi_user_vcsm.h -+ -+diff --git a/libavcodec/Makefile b/libavcodec/Makefile -+index f6a4fbb..0fd6767 100644 -+--- a/libavcodec/Makefile -++++ b/libavcodec/Makefile -+@@ -5,6 +5,10 @@ NAME = avcodec -+ HEADERS = avcodec.h \ -+ avdct.h \ -+ avfft.h \ -++ rpi_qpu.h \ -++ rpi_shader.h \ -++ rpi_mailbox.h \ -++ rpi_hevc_transform.h \ -+ dv_profile.h \ -+ d3d11va.h \ -+ dirac.h \ -+@@ -39,6 +43,9 @@ OBJS = allcodecs.o \ -+ resample.o \ -+ resample2.o \ -+ utils.o \ -++ rpi_qpu.o \ -++ rpi_shader.o \ -++ rpi_mailbox.o \ -+ vorbis_parser.o \ -+ xiph.o \ -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 2eebd31..681e9fd 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -41,6 +41,10 @@ -+ #include "hevc.h" -+ #include "profiles.h" -+ -++#ifdef RPI -++#include "rpi_qpu.h" -++#endif -++ -+ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 }; -+ -+ /** -+@@ -2419,7 +2423,9 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -+ #ifdef RPI -+- rpi_execute_pred_cmds(s); -++ if (x_ctb + ctb_size >= s->ps.sps->width) { -++ rpi_execute_pred_cmds(s); -++ } -+ #endif -+ if (more_data < 0) { -+ s->tab_slice_address[ctb_addr_rs] = -1; -+@@ -3238,6 +3244,31 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ if (!s->coeffs_buf) -+ goto fail; -+ s->enable_rpi = 0; -++ -++ // A little test program -++ { -++ GPU_MEM_PTR_T p; -++ int err = gpu_malloc_cached(16, &p); -++ short *q = (short *)p.arm; -++ int i; -++ int r; -++ printf("Allocated memory %d ARM 0x%x, VC 0x%x, Code 0x%x\n",err,(int)p.arm,p.vc,(int)vpu_get_fn()); -++ printf("Allocated memory %d ARM 0x%x, VC 0x%x\n",err,(int)p.arm,p.vc); -++ printf("Preparing data %p\n",q); -++ for(i=0;i<16;i++) -++ q[i] = i; -++ printf("Flush cache\n"); -++ gpu_cache_flush(&p); -++ printf("Executing code\n"); -++ r = vpu_execute_code( vpu_get_fn(), p.vc, 0, 0, 0, 0, 0); -++ printf("Return value %d (",r); -++ for(i=0;i<16;i++) -++ printf("%d ",q[i]); -++ printf(")\n"); -++ gpu_free(&p); -++ goto fail; // Early out -++ } -++ -+ #endif -+ -+ s->cabac_state = av_malloc(HEVC_CONTEXTS); -+diff --git a/libavcodec/rpi_hevc_transform.h b/libavcodec/rpi_hevc_transform.h -+new file mode 100644 -+index 0000000..85a9102 -+--- /dev/null -++++ b/libavcodec/rpi_hevc_transform.h -+@@ -0,0 +1,212 @@ -++unsigned char rpi_hevc_transform [] = { -++169, -++3, -++3, -++232, -++128, -++0, -++0, -++0, -++20, -++248, -++0, -++136, -++0, -++0, -++192, -++248, -++0, -++0, -++0, -++96, -++3, -++232, -++32, -++0, -++0, -++0, -++7, -++232, -++0, -++2, -++0, -++0, -++8, -++232, -++0, -++4, -++0, -++0, -++12, -++248, -++0, -++128, -++0, -++0, -++192, -++8, -++4, -++0, -++4, -++232, -++64, -++0, -++0, -++0, -++5, -++232, -++0, -++0, -++8, -++0, -++128, -++69, -++113, -++66, -++12, -++248, -++0, -++128, -++0, -++0, -++192, -++8, -++4, -++0, -++128, -++69, -++113, -++70, -++128, -++144, -++39, -++0, -++4, -++255, -++48, -++192, -++128, -++3, -++32, -++8, -++16, -++0, -++76, -++254, -++48, -++192, -++9, -++4, -++32, -++8, -++0, -++0, -++4, -++254, -++0, -++144, -++128, -++2, -++0, -++248, -++62, -++0, -++128, -++144, -++22, -++0, -++4, -++255, -++48, -++192, -++128, -++3, -++32, -++8, -++16, -++0, -++76, -++254, -++48, -++192, -++9, -++4, -++32, -++8, -++0, -++0, -++140, -++248, -++44, -++0, -++0, -++0, -++32, -++48, -++4, -++0, -++128, -++69, -++113, -++66, -++242, -++140, -++211, -++192, -++41, -++3, -++68, -++192, -++80, -++7, -++164, -++255, -++36, -++220, -++96, -++2, -++0, -++248, -++62, -++0, -++3, -++255, -++55, -++208, -++120, -++3, -++224, -++3, -++190, -++11, -++16, -++139, -++246, -++83, -++0, -++103, -++90, -++0, -++8, -++240, -++0, -++128, -++128, -++3, -++0, -++247, -++32, -++128, -++10, -++4, -++136, -++240, -++32, -++0, -++128, -++3, -++112, -++96, -++90, -++0, -++}; -+diff --git a/libavcodec/rpi_hevc_transform.s b/libavcodec/rpi_hevc_transform.s -+new file mode 100644 -+index 0000000..5e2728d -+--- /dev/null -++++ b/libavcodec/rpi_hevc_transform.s -+@@ -0,0 +1,147 @@ -++# ****************************************************************************** -++# Argon Design Ltd. -++# (c) Copyright 2015 Argon Design Ltd. All rights reserved. -++# -++# Module : HEVC -++# Author : Peter de Rivaz -++# ****************************************************************************** -++ -++# HEVC VPU Transform -++# -++# Transform matrix can be thought of as -++# output row vector = input row vector * transMatrix2 -++# -++# The even rows of the matrix are symmetric -++# The odd rows of the matrix are antisymmetric -++# -++# So only need to compute the first half of the results, then can compute the remainder with a butterfly -++# -++# EXAMPLE -++# (a b c d) (1 2 2 1) -++# (3 4 -4 -3) -++# (5 6 6 5) -++# (7 8 -8 -7) -++# -++# x=(a c)(1 2) = 1a+5c 2a+6c -++# (5 6) -++# -++# y=(b d)(3 4) = 3b+7d 4b+8d -++# (7 8) -++# -++# u=x+y = 1a+5c+3b+7d 2a+4b+6c+8d -++# v=x-y = 1a+5c-3b-7d 2a+6c-4b-8d -++# -++# Final results are (u , v[::-1]) -++# -++# -++# For 32x1 input, load even rows into HX(0++,0), odd rows into HX(16++,0) -++# Apply the even matrix first and stop before rounding -++# Then apply the odd matrix in a full manner: -++# -++# First step is to compute partial products with the first input (16 cycles) -++# 1a 3b 5c 7d 16x1 input coefficients produce 16x16 output -++# 2a 4b 6c 8d -++# 2a -4b 6c -8d -++# 1a -3b 5c -7d -++# -++# Second step is to sum partial products into final position (8 cycles) -++# 1a+3b+5c+7d -++# 2a+4b+6c+8d -++# 2a-4b+6c-8d -++# 1a-3b+5c-7d -++# -++# Then can apply butterfly to combine even results and odd results + rounding to produce 16 rows of output at a time (need to save in transposed format) -++# -++# For 16x16 no butterfly is required and can store final results in original location (Could do 2 16x16s in parallel to make use of the trick - saves on the adds) -++# -++# For 8x8 we could compute two in parallel. -++# -++# -++ -++test_add: -++ vldh HX(0,0),(r0) -++ vadd HX(0,0),HX(0,0),10 -++ vsth HX(0,0),(r0) -++ mov r0,7 # return value -++ b lr -++ -++# Columns are transformed first -++# -++# Store top left half of transMatrix2 in -++# Store bottom left half of transMatrix2 in HX(32,32) -++# -++# For 16x16 -++# HX(0:15,0) contains input data before transform -++# HY(0:15,0) contains 32bit output data after transform -++# HX(32,0) contains even rows of left half of transMatrix2 -++# HX(32,32) contains odd rows of left half of transMatrix2 -++# HY(48,0) contains partial products ready for summing -++# -++ -++ -++# hevc_trans_16x16(short *transMatrix2, short *coeffs, int num) -++# transMatrix2: address of the constant matrix (must be at 32 byte aligned address in Videocore memory) -++# coeffs: address of the transform coefficients (must be at 32 byte aligned address in Videocore memory) -++# num: number of 16x16 transforms to be done -++# -++hevc_trans_16x16: -++ push r6-r15, lr # TODO cut down number of used registers -++ -++ mov r3, 2*32*2 # Twice Stride of transMatrix2 in bytes -++ vld HX(32++,0),(r0 += r3) REP 16 # This is the 16x16 matrix, a transform is equivalent to multiplying input row vector * matrix -++ # Now use r0 to describe which matrix we are working on. -++ # Allows us to prefetch the next block of coefficients for efficiency. -++ mov r0,0 # This describes the location where we read our coefficients from -++ mov r3,16*2 # Stride of coefficients in bytes -++ mov r7,16*16*2 # Total block size -++ mov r8,64*16 # Value used to swap from current to next VRF location -++ vldh HX(0++,0)+r0,(r1 += r3) REP 16 -++ mov r4,64 # Constant used for rounding first pass -++ mov r5,1<<19 # Constant used for rounding second pass -++ -++ # At start of block r0,r1 point to the current block (that has already been loaded) -++block_loop: -++ eor r0,r8 -++ add r1,r7 -++ # Prefetch the next block -++ vldh HX(0++,0)+r0,(r1 += r3) REP 16 -++ eor r0,r8 -++ sub r1,r7 -++ -++ # Transform the current block -++ bl col_trans_16 -++ vadd HY(0++,0)+r0,HY(0++,0)+r0,r4 REP 16 # Now add on rounding, shift down by 7, and saturate -++ #vsasls HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # 9+7=16 so this ends up with the output saturated and in the top half of the word. -++ vasl HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # This should be saturating, but the instruction above does not assemble? -++ vmov VX(0,0++), HX(0++,32) REP 16 # For simplicity transpose this back to the original position -++ -++ bl col_trans_16 -++ vadd HY(0++,0)+r0,HY(0++,0)+r0,r4 REP 16 # Now add on rounding, shift down by 7, and saturate -++ #vsasls HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # 9+7=16 so this ends up with the output saturated and in the top half of the word. -++ vasl HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # This should be saturating, but the instruction above does not assemble? -++ -++ # Save results - note there has been a transposition during the processing so we save columns -++ vsth VX(0,32++)+r0, (r1 += r3) REP 16 -++ -++ # Move onto next block -++ eor r0,r8 -++ add r1,r7 -++ -++ addcmpbgt r2,-1,0,block_loop -++ pop r6-r15, pc -++ -++# r1,r2,r3 r7,r8 should be preserved -++# HX(0++,0)+r0 is the block to be transformed -++# HX(32++,0) is the 16x16 matrix of transform coefficients -++# Use HY(48,0) for intermediate results -++# r0 can be used, but should be returned to its original value at the end -++col_trans_16: -++ add r4,r0,16 # Final value for this loop -++col_trans_16_loop: -++ # First compute partial products for a single column -++ vmul32s VY(48,0++), VX(0,0)+r0, VX(32,0++) REP 16 -++ # Then sum up the results and place back -++ vadd VY(0,0)+r0, VY(48,0++), VY(48,8++) REP 8 CLRA SACC -++ addcmpblt r0,1,r4,col_trans_16_loop -++ sub r0,16 # but r0 back to its original value -++ b lr -+diff --git a/libavcodec/rpi_mailbox.c b/libavcodec/rpi_mailbox.c -+new file mode 100644 -+index 0000000..536896f -+--- /dev/null -++++ b/libavcodec/rpi_mailbox.c -+@@ -0,0 +1,293 @@ -++/* -++Copyright (c) 2012, Broadcom Europe Ltd. -++All rights reserved. -++ -++Redistribution and use in source and binary forms, with or without -++modification, are permitted provided that the following conditions are met: -++ * Redistributions of source code must retain the above copyright -++ notice, this list of conditions and the following disclaimer. -++ * Redistributions in binary form must reproduce the above copyright -++ notice, this list of conditions and the following disclaimer in the -++ documentation and/or other materials provided with the distribution. -++ * Neither the name of the copyright holder nor the -++ names of its contributors may be used to endorse or promote products -++ derived from this software without specific prior written permission. -++ -++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -++ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -++WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -++DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -++DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -++LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -++ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -++(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -++SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -++*/ -++ -++#include -++#include -++#include -++#include -++#include -++#include -++#include -++#include -++#include -++ -++#include -++ -++#define MAJOR_NUM 100 -++#define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) -++#define DEVICE_FILE_NAME "/dev/char_dev" -++ -++#include "rpi_mailbox.h" -++ -++#define PAGE_SIZE (4*1024) -++ -++// Shared memory will not be cached in ARM cache -++void *mapmem_shared(unsigned base, unsigned size) -++{ -++ int mem_fd; -++ unsigned offset = base % PAGE_SIZE; -++ base = base - offset; -++ /* open /dev/mem */ -++ if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) { -++ printf("can't open /dev/mem\nThis program should be run as root. Try prefixing command with: sudo\n"); -++ return NULL; -++ } -++ void *mem = mmap( -++ 0, -++ size, -++ PROT_READ|PROT_WRITE, -++ MAP_SHARED/*|MAP_FIXED*/, -++ mem_fd, -++ base); -++#ifdef DEBUG -++ printf("base=0x%x, mem=%p\n", base, mem); -++#endif -++ if (mem == MAP_FAILED) { -++ printf("mmap error %d\n", (int)mem); -++ return NULL; -++ } -++ close(mem_fd); -++ return (char *)mem + offset; -++} -++ -++// Unshared memory will be faster as lives in ARM cache, but requires cache flushing -++void *mapmem_private(unsigned base, unsigned size) -++{ -++ int mem_fd; -++ unsigned offset = base % PAGE_SIZE; -++ base = base - offset; -++ /* open /dev/mem */ -++ if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) { -++ printf("can't open /dev/mem\nThis program should be run as root. Try prefixing command with: sudo\n"); -++ return NULL; -++ } -++ void *mem = mmap( -++ 0, -++ size, -++ PROT_READ|PROT_WRITE, -++ MAP_PRIVATE/*|MAP_FIXED*/, -++ mem_fd, -++ base); -++#ifdef DEBUG -++ printf("base=0x%x, mem=%p\n", base, mem); -++#endif -++ if (mem == MAP_FAILED) { -++ printf("mmap error %d\n", (int)mem); -++ return NULL; -++ } -++ close(mem_fd); -++ return (char *)mem + offset; -++} -++ -++void unmapmem(void *addr, unsigned size) -++{ -++ int s = munmap(addr, size); -++ if (s != 0) { -++ printf("munmap error %d\n", s); -++ exit (-1); -++ } -++} -++ -++/* -++ * use ioctl to send mbox property message -++ */ -++ -++static int mbox_property(int file_desc, void *buf) -++{ -++ int ret_val = ioctl(file_desc, IOCTL_MBOX_PROPERTY, buf); -++ -++ if (ret_val < 0) { -++ printf("ioctl_set_msg failed:%d\n", ret_val); -++ } -++ -++#ifdef DEBUG -++ unsigned *p = buf; int i; unsigned size = *(unsigned *)buf; -++ for (i=0; i -++#include -++#include -++#include -++#include -++ -++#include "config.h" -++ -++#include -++#include -++ -++#include "rpi_mailbox.h" -++#include "rpi_qpu.h" -++#include "rpi_shader.h" -++#include "rpi_hevc_transform.h" -++ -++#ifdef RPI_USE_VCSM -++#include "rpi_user_vcsm.h" -++#endif -++ -++// On Pi2 there is no way to access the VPU L2 cache -++// GPU_MEM_FLG should be 4 for uncached memory. -++// However, if using VCSM allocated buffers, need to use C at the moment because VCSM does not allocate uncached memory correctly -++// The QPU crashes if we mix L2 cached and L2 uncached accesses due to a HW bug. -++#define GPU_MEM_FLG 0xC -++#define GPU_MEM_MAP 0x0 -++ -++#define vcos_verify(x) ((x)>=0) -++ -++typedef unsigned char uint8_t; -++typedef signed char int8_t; -++typedef unsigned short uint16_t; -++typedef unsigned int uint32_t; -++typedef int int32_t; -++ -++/*static const unsigned code[] = -++{ -++ #include "rpi_shader.hex" -++};*/ -++ -++// Size in 32bit words -++#define QPU_CODE_SIZE 2048 -++#define VPU_CODE_SIZE 2048 -++ -++struct GPU -++{ -++ unsigned int qpu_code[QPU_CODE_SIZE]; -++ unsigned int vpu_code[VPU_CODE_SIZE]; -++ int open_count; // Number of allocated video buffers -++ unsigned int vc_handle; // Handle of this memory -++ int mb; // Mailbox handle -++ int vc; // Address in GPU memory -++ int mail[12]; // These are used to pass pairs of code/unifs to the QPUs -++}; -++ -++// Stop more than one thread trying to allocate memory or use the processing resources at once -++static pthread_mutex_t gpu_mutex = PTHREAD_MUTEX_INITIALIZER; -++static volatile struct GPU* gpu = NULL; -++ -++#ifdef RPI_TIME_TOTAL_QPU -++static unsigned int Microseconds(void) { -++ struct timespec ts; -++ unsigned int x; -++ static unsigned int base = 0; -++ clock_gettime(CLOCK_REALTIME, &ts); -++ x = ts.tv_sec*1000000 + ts.tv_nsec/1000; -++ if (base==0) base=x; -++ return x-base; -++} -++#endif -++ -++// Connect to QPU, returns 0 on success. -++static int gpu_init(volatile struct GPU **gpu) { -++ int mb = mbox_open(); -++ int vc; -++ int handle; -++ volatile struct GPU* ptr; -++ if (mb < 0) -++ return -1; -++ -++ if (qpu_enable(mb, 1)) return -2; -++ -++#ifdef RPI_USE_VCSM -++ vcsm_init(); -++#endif -++ -++ handle = mem_alloc(mb, sizeof(struct GPU), 4096, GPU_MEM_FLG); -++ if (!handle) -++ { -++ qpu_enable(mb, 0); -++ return -3; -++ } -++ vc = mem_lock(mb, handle); -++ ptr = mapmem_shared((vc+GPU_MEM_MAP)&~0xc0000000, sizeof(struct GPU)); -++ if (ptr == NULL) -++ { mem_free(mb, handle); -++ mem_unlock(mb, handle); -++ qpu_enable(mb, 0); -++ return -4; -++ } -++ -++ ptr->mb = mb; -++ ptr->vc_handle = handle; -++ ptr->vc = vc; -++ -++ *gpu = ptr; -++ -++ // Now copy over the QPU code into GPU memory -++ { -++ int num_bytes = qpu_get_fn(QPU_MC_END) - qpu_get_fn(QPU_MC_SETUP); -++ assert(num_bytes<=QPU_CODE_SIZE*sizeof(unsigned int)); -++ memcpy((void*)ptr->qpu_code, rpi_shader, num_bytes); -++ } -++ // And the VPU code -++ { -++ int num_bytes = sizeof(rpi_hevc_transform); -++ assert(num_bytes<=VPU_CODE_SIZE*sizeof(unsigned int)); -++ memcpy((void*)ptr->vpu_code, rpi_hevc_transform, num_bytes); -++ } -++ -++ return 0; -++} -++ -++// Make sure we have exclusive access to the mailbox, and enable qpu if necessary. -++static void gpu_lock(void) { -++ pthread_mutex_lock(&gpu_mutex); -++ if (gpu==NULL) { -++ gpu_init(&gpu); -++ } -++} -++ -++static void gpu_unlock(void) { -++ pthread_mutex_unlock(&gpu_mutex); -++} -++ -++// Allocate memory on GPU -++// Fills in structure

containing ARM pointer, videocore handle, videocore memory address, numbytes -++// Returns 0 on success. -++// This allocates memory that will not be cached in ARM's data cache. -++// Therefore safe to use without data cache flushing. -++int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p) { -++ gpu_lock(); -++ p->vc_handle = mem_alloc(gpu->mb, numbytes, 4096, GPU_MEM_FLG); -++ p->vcsm_handle = 0; -++ if (!p->vc_handle) -++ { -++ qpu_enable(gpu->mb, 0); -++ return -3; -++ } -++ p->vc = mem_lock(gpu->mb, p->vc_handle); -++ p->arm = mapmem_shared((p->vc+GPU_MEM_MAP)&~0xc0000000,numbytes); -++ p->numbytes = numbytes; -++ if (p->arm == NULL) -++ { -++ mem_free(gpu->mb, p->vc_handle); -++ mem_unlock(gpu->mb, p->vc_handle); -++ gpu_unlock(); -++ qpu_enable(gpu->mb, 0); -++ return -4; -++ } -++ gpu->open_count++; -++ gpu_unlock(); -++ return 0; -++} -++ -++void gpu_cache_flush(GPU_MEM_PTR_T *p) -++{ -++ // This only works when using RPI_USE_VCSM -++ void *tmp = vcsm_lock(p->vcsm_handle); -++ vcsm_unlock_ptr(tmp); -++} -++ -++// This allocates data that will be -++// Cached in ARM L2 -++// Uncached in VPU L2 -++int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p) { -++ gpu_lock(); -++#ifdef RPI_USE_VCSM -++ { -++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST, (char *)"Video Frame" ); // f....... locks up for VP9 - retest this? -++ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_VC, (char *)"Video Frame" ); // 3b...... works -++ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); //fb...... locks up -++ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST_AND_VC, (char *)"Video Frame" ); // 3b works (but corrupted due to caching) -++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -++ p->arm = vcsm_lock(p->vcsm_handle); -++ p->vc = mem_lock(gpu->mb, p->vc_handle); -++ } -++#else -++ p->vc_handle = mem_alloc(gpu->mb, numbytes, 4096, GPU_MEM_FLG); -++ p->vcsm_handle = 0; -++ if (!p->handle) -++ { -++ qpu_enable(gpu->mb, 0); -++ return -3; -++ } -++ p->vc = mem_lock(gpu->mb, p->vc_handle); -++ printf("This mapmem_private does not seem to work\n"); -++ exit(-1); -++ p->arm = mapmem_private((p->vc+GPU_MEM_MAP)&~0xc0000000,numbytes); -++ p->numbytes = numbytes; -++ if (p->arm == NULL) -++ { -++ mem_free(gpu->mb, p->handle); -++ mem_unlock(gpu->mb, p->handle); -++ gpu_unlock(); -++ qpu_enable(gpu->mb, 0); -++ return -4; -++ } -++#endif -++ gpu->open_count++; -++ gpu_unlock(); -++ return 0; -++} -++ -++static void gpu_term(void) -++{ -++ int mb = gpu->mb; -++ unsigned handle = gpu->vc_handle; -++ if (gpu==NULL) -++ return; -++ unmapmem((void*)gpu, sizeof(struct GPU)); -++ mem_unlock(mb, handle); -++ mem_free(mb, handle); -++ qpu_enable(mb, 0); -++#ifdef RPI_USE_VCSM -++ vcsm_exit(); -++#endif -++ mbox_close(mb); -++ gpu = NULL; -++} -++ -++void gpu_free(GPU_MEM_PTR_T *p) { -++ int mb = gpu->mb; -++ unsigned handle = p->vc_handle; -++ gpu_lock(); -++#ifdef RPI_USE_VCSM -++ if (p->vcsm_handle) { -++ mem_unlock(mb,p->vc_handle); -++ vcsm_unlock_ptr(p->arm); -++ vcsm_free(p->vcsm_handle); -++ } else { -++ unmapmem((void*)p->arm, sizeof(struct GPU)); -++ mem_unlock(mb, handle); -++ mem_free(mb, handle); -++ } -++#else -++ unmapmem((void*)p->arm, sizeof(struct GPU)); -++ mem_unlock(mb, handle); -++ mem_free(mb, handle); -++#endif -++ -++ gpu->open_count--; -++ if (gpu->open_count==0) { -++ printf("Closing GPU\n"); -++ gpu_term(); -++ gpu = NULL; -++ } -++ gpu_unlock(); -++} -++ -++unsigned int vpu_get_fn(void) { -++ // Make sure that the gpu is initialized -++ if (gpu==NULL) { -++ printf("Preparing gpu\n"); -++ gpu_lock(); -++ gpu_unlock(); -++ } -++ return gpu->vc + offsetof(struct GPU,vpu_code); -++} -++ -++unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5) -++{ -++ unsigned r; -++ gpu_lock(); -++ r = execute_code(gpu->mb, code, r0, r1, r2, r3, r4, r5); -++ gpu_unlock(); -++ return r; -++} -++ -++// Run a program on a QPU with the given code and uniform stream (given in GPU addresses) -++// The first num QPUs will start at code, the next num2 QPUs will start at code2 -++void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, int unifs9, int unifs10, int unifs11, int unifs12) -++{ -++ int i; -++#ifdef RPI_TIME_TOTAL_QPU -++ static int last_time=0; -++ static long long on_time=0; -++ static long long off_time=0; -++ int start_time; -++ int end_time; -++ static int count=0; -++#endif -++ -++ gpu_lock(); -++#ifdef RPI_TIME_TOTAL_QPU -++ start_time = Microseconds(); -++ if (last_time==0) -++ last_time = start_time; -++ off_time += start_time-last_time; -++#endif -++ for(i=0;imail[i*2 + 1] = code; -++ } -++ for(;imail[i*2 + 1] = code2; -++ } -++ gpu->mail[0 ] = unifs1; -++ gpu->mail[2 ] = unifs2; -++ gpu->mail[4 ] = unifs3; -++ gpu->mail[6 ] = unifs4; -++ gpu->mail[8 ] = unifs5; -++ gpu->mail[10] = unifs6; -++ gpu->mail[12] = unifs7; -++ gpu->mail[14] = unifs8; -++ gpu->mail[16] = unifs9; -++ gpu->mail[18] = unifs10; -++ gpu->mail[20] = unifs11; -++ gpu->mail[22] = unifs12; -++ execute_qpu( -++ gpu->mb, -++ 12 /* Number of QPUs */, -++ gpu->vc + offsetof(struct GPU, mail), -++ 1 /* no flush */, // Don't flush VPU L1 cache -++ 5000 /* timeout ms */); -++#ifdef RPI_TIME_TOTAL_QPU -++ end_time = Microseconds(); -++ last_time = end_time; -++ on_time += end_time - start_time; -++ count++; -++ if ((count&0x7f)==0) -++ printf("On=%dms, Off=%dms\n",(int)(on_time/1000),(int)(off_time/1000)); -++#endif -++ gpu_unlock(); -++} -++ -++unsigned int qpu_get_fn(int num) { -++ // Make sure that the gpu is initialized -++ unsigned int *fn; -++ if (gpu==NULL) { -++ printf("Preparing gpu\n"); -++ gpu_lock(); -++ gpu_unlock(); -++ } -++ switch(num) { -++ case QPU_MC_SETUP: -++ fn = mc_setup; -++ break; -++ case QPU_MC_FILTER: -++ fn = mc_filter; -++ break; -++ case QPU_MC_EXIT: -++ fn = mc_exit; -++ break; -++ case QPU_MC_INTERRUPT_EXIT: -++ fn = mc_interrupt_exit; -++ break; -++ case QPU_MC_FILTER_B: -++ fn = mc_filter_b; -++ break; -++ case QPU_MC_FILTER_HONLY: -++ fn = mc_filter_honly; -++ break; -++ case QPU_MC_SETUP_UV: -++ fn = mc_setup_uv; -++ break; -++ case QPU_MC_FILTER_UV: -++ fn = mc_filter_uv; -++ break; -++ case QPU_MC_FILTER_UV_B: -++ fn = mc_filter_uv_b; -++ break; -++ case QPU_MC_END: -++ fn = mc_end; -++ break; -++ default: -++ printf("Unknown function\n"); -++ exit(-1); -++ } -++ return gpu->vc + 4*(int)(fn-rpi_shader); -++ //return code[num] + gpu->vc; -++} -++ -++#if 0 -++ -++int32_t hcoeffs[] = {-4, 10, -21, 70, 90, -24, 11, -4}; -++//int32_t hcoeffs[] = {1, 1, 1, 1, 1, 1, 1, 1}; -++int32_t vcoeffs[] = {-2, 6, -13, 37, 115, -20, 9, -4}; -++//int32_t vcoeffs[] = {1, 1, 1, 1, 1, 1, 1, 1}; -++ -++#define ENCODE_COEFFS(c0, c1, c2, c3) (((c0-1) & 0xff) | ((c1-1) & 0xff) << 8 | ((c2-1) & 0xff) << 16 | ((c3-1) & 0xff) << 24); -++ -++static uint8_t av_clip_uint8(int32_t a) -++{ -++ if (a&(~255)) return (-a)>>31; -++ else return a; -++} -++ -++static int32_t filter8(const uint8_t *data, int pitch) -++{ -++ int32_t vsum = 0; -++ int x, y; -++ -++ for (y = 0; y < 8; y++) { -++ int32_t hsum = 0; -++ -++ for (x = 0; x < 8; x++) -++ hsum += hcoeffs[x]*data[x + y * pitch]; -++ -++ vsum += vcoeffs[y]*av_clip_uint8( (hsum + 64) >> 7); // Added brackets to stop compiler warning -++ } -++ -++ return av_clip_uint8( (vsum + 64) >> 7); -++} -++ -++// Note regression changes coefficients so is not thread safe -++//#define REGRESSION -++#ifdef REGRESSION -++#define CMAX 100 -++#else -++#define CMAX 2 -++#endif -++#define YMAX 16 -++ -++int rpi_test_shader(void) -++{ -++ int i, c; -++ -++ uint32_t *unifs; -++ -++ uint8_t *in_buffer; -++ uint8_t *out_buffer[2]; -++ -++ GPU_MEM_PTR_T unifs_ptr; -++ GPU_MEM_PTR_T in_buffer_ptr; -++ GPU_MEM_PTR_T out_buffer_ptr[2]; -++ -++ // Addresses in GPU memory of filter programs -++ uint32_t mc_setup = 0; -++ uint32_t mc_filter = 0; -++ uint32_t mc_exit = 0; -++ -++ int pitch = 0x500; -++ -++ if (gpu==NULL) { -++ gpu_lock(); -++ gpu_unlock(); -++ } -++ -++ printf("This needs to change to reflect new assembler\n"); -++ // Use table to compute locations of program start points -++ mc_setup = code[0] + gpu->vc; -++ mc_filter = code[1] + gpu->vc; -++ mc_exit = code[2] + gpu->vc; -++ -++ if (!vcos_verify(gpu_malloc_uncached(4*64,&unifs_ptr))) { -++ return -2; -++ } -++ unifs = (uint32_t*)unifs_ptr.arm; -++ -++ if (!vcos_verify(gpu_malloc_uncached(64*23,&in_buffer_ptr))) { -++ return -3; -++ } -++ in_buffer = (uint8_t*)in_buffer_ptr.arm; -++ -++ if (!vcos_verify(gpu_malloc_uncached(16*pitch,&out_buffer_ptr[0])) || !vcos_verify(gpu_malloc_uncached(16*pitch,&out_buffer_ptr[1]))) { -++ return -4; -++ } -++ out_buffer[0] = (uint8_t*)out_buffer_ptr[0].arm; -++ out_buffer[1] = (uint8_t*)out_buffer_ptr[1].arm; -++ -++ for (c = 0; c < CMAX; c++) { -++ int xo[] = {rand()&31, rand()&31}; -++ -++#ifdef REGRESSION -++ for (i = 0; i < 8; i++) { -++ hcoeffs[i] = (int8_t)rand(); -++ vcoeffs[i] = (int8_t)rand(); -++ if (hcoeffs[i]==-128) -++ hcoeffs[i]++; -++ if (vcoeffs[i]==-128) -++ vcoeffs[i]++; -++ } -++#endif -++ -++ for (i = 0; i < 64*23; i++) { -++ //printf("%d %d %p\n",i,gpu->mb,&in_buffer[i]); -++ in_buffer[i] = rand(); -++ } -++ -++ // Clear output array -++ { -++ int b; -++ for(b=0;b<2;b++) { -++ for(i=0;i<16*16;i++) { -++ out_buffer[b][i] = 3; -++ } -++ } -++ } -++ -++ unifs[0] = mc_filter; -++ unifs[1] = in_buffer_ptr.vc+xo[0]+16; -++ unifs[2] = 64; // src pitch -++ unifs[3] = pitch; // dst pitch -++ unifs[4] = 0; // Padding -++ unifs[5] = 0; -++ unifs[6] = 0; -++ unifs[7 ] = mc_filter; -++ unifs[8 ] = in_buffer_ptr.vc+xo[1]+16; -++ unifs[9 ] = ENCODE_COEFFS(hcoeffs[0], hcoeffs[1], hcoeffs[2], hcoeffs[3]); -++ unifs[10] = ENCODE_COEFFS(hcoeffs[4], hcoeffs[5], hcoeffs[6], hcoeffs[7]); -++ unifs[11] = ENCODE_COEFFS(vcoeffs[0], vcoeffs[1], vcoeffs[2], vcoeffs[3]); -++ unifs[12] = ENCODE_COEFFS(vcoeffs[4], vcoeffs[5], vcoeffs[6], vcoeffs[7]); -++ unifs[13] = out_buffer_ptr[0].vc; -++ unifs[14] = mc_exit; -++ unifs[15] = in_buffer_ptr.vc+xo[1]+16; // dummy -++ unifs[16] = ENCODE_COEFFS(hcoeffs[0], hcoeffs[1], hcoeffs[2], hcoeffs[3]); -++ unifs[17] = ENCODE_COEFFS(hcoeffs[4], hcoeffs[5], hcoeffs[6], hcoeffs[7]); -++ unifs[18] = ENCODE_COEFFS(vcoeffs[0], vcoeffs[1], vcoeffs[2], vcoeffs[3]); -++ unifs[19] = ENCODE_COEFFS(vcoeffs[4], vcoeffs[5], vcoeffs[6], vcoeffs[7]); -++ unifs[20] = out_buffer_ptr[1].vc; -++ -++ printf("Gpu->vc=%x Code=%x dst=%x\n",gpu->vc, mc_filter,out_buffer_ptr[1].vc); -++ -++ // flush_dcache(); TODO is this needed on ARM side? - tried to use the direct alias to avoid this problem -++ -++ //qpu_run_shader(mc_setup, unifs_ptr.vc); -++ //qpu_run_shader(gpu, gpu->vc, unifs_ptr.vc); -++ rpi_do_block(in_buffer_ptr.vc+xo[0]+16, 64, out_buffer_ptr[0].vc, pitch,out_buffer[0]); -++ rpi_do_block(in_buffer_ptr.vc+xo[1]+16, 64, out_buffer_ptr[1].vc, pitch,out_buffer[1]); -++ -++ if (1) -++ { -++ int x, y, b; -++ int bad = 0; -++ -++ for (b=0; b<2; ++b) -++ for (y=0; yvc; -++ mc_filter = code[1] + gpu->vc; -++ mc_exit = code[2] + gpu->vc; -++ -++ if (!vcos_verify(gpu_malloc_uncached(4*64,&unifs_ptr))) { -++ return; -++ } -++ //gpu_malloc_uncached(16*dst_pitch,&out_buffer_ptr); -++ //out_buffer = (uint8_t*)out_buffer_ptr.arm; -++ -++ /*for (y=0; y<16; ++y) { -++ for (x=0; x<16; ++x) { -++ out_buffer[x+y*dst_pitch] = 7; -++ } -++ }*/ -++ -++ unifs = (uint32_t*)unifs_ptr.arm; -++ -++ unifs[0] = mc_filter; -++ unifs[1] = (int)in_buffer_vc; -++ unifs[2] = src_pitch; // src pitch -++ unifs[3] = dst_pitch; // dst pitch -++ unifs[4] = 0; // Padding -++ unifs[5] = 0; -++ unifs[6] = 0; -++ unifs[7 ] = mc_exit; -++ unifs[8 ] = (int)in_buffer_vc; -++ unifs[9 ] = ENCODE_COEFFS(hcoeffs[0], hcoeffs[1], hcoeffs[2], hcoeffs[3]); -++ unifs[10] = ENCODE_COEFFS(hcoeffs[4], hcoeffs[5], hcoeffs[6], hcoeffs[7]); -++ unifs[11] = ENCODE_COEFFS(vcoeffs[0], vcoeffs[1], vcoeffs[2], vcoeffs[3]); -++ unifs[12] = ENCODE_COEFFS(vcoeffs[4], vcoeffs[5], vcoeffs[6], vcoeffs[7]); -++ unifs[13] = (int)dst_vc; -++ //unifs[13] = (int)out_buffer_ptr.vc; -++ -++ //printf("Gpu->vc=%x Code=%x dst=%x\n",gpu->vc, mc_filter,out_buffer_ptr[1].vc); -++ -++ qpu_run_shader(mc_setup, unifs_ptr.vc); -++ -++ /*for (y=0; y<16; ++y) { -++ for (x=0; x<16; ++x) { -++ dst[x+y*dst_pitch] = out_buffer[x+y*dst_pitch]; -++ } -++ }*/ -++ -++ gpu_free(&unifs_ptr); -++ //gpu_free(&out_buffer_ptr); -++} -++ -++ -++#endif -++ -++#endif // RPI -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+new file mode 100644 -+index 0000000..4e3c35c -+--- /dev/null -++++ b/libavcodec/rpi_qpu.h -+@@ -0,0 +1,45 @@ -++#ifndef RPI_QPU_H -++#define RPI_QPU_H -++ -++typedef struct gpu_mem_ptr_s { -++ unsigned char *arm; // Pointer to memory mapped on ARM side -++ int vc_handle; // Videocore handle of relocatable memory -++ int vcsm_handle; // Handle for use by VCSM -++ int vc; // Address for use in GPU code -++ int numbytes; // Size of memory block -++} GPU_MEM_PTR_T; -++ -++// General GPU functions -++extern int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p); -++extern int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p); -++extern void gpu_free(GPU_MEM_PTR_T *p); -++extern void gpu_cache_flush(GPU_MEM_PTR_T *p); -++ -++// QPU specific functions -++extern void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, int unifs9, int unifs10, int unifs11, int unifs12); -++ -++enum { -++ QPU_MC_SETUP, -++ QPU_MC_FILTER, -++ QPU_MC_EXIT, -++ QPU_MC_INTERRUPT_EXIT, -++ QPU_MC_FILTER_B, -++ QPU_MC_FILTER_HONLY, -++ QPU_MC_SETUP_UV, -++ QPU_MC_FILTER_UV, -++ QPU_MC_FILTER_UV_B, -++ QPU_MC_END -++ }; -++extern unsigned int qpu_get_fn(int num); -++ -++// VPU specific functions -++extern unsigned int vpu_get_fn(void); -++extern unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5); -++ -++// Simple test of shader code -++extern int rpi_test_shader(void); -++ -++extern void rpi_do_block(const unsigned char *in_buffer_vc, int src_pitch, unsigned char *dst_vc, int dst_pitch, unsigned char *dst); -++extern void rpi_do_block_arm(const unsigned char *in_buffer, int src_pitch, unsigned char *dst, int dst_pitch); -++ -++#endif -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+new file mode 100644 -+index 0000000..41cc2e1 -+--- /dev/null -++++ b/libavcodec/rpi_shader.c -+@@ -0,0 +1,818 @@ -++#include "rpi_shader.h" -++ -++#ifdef _MSC_VER -++ #include -++ /* cast through uintptr_t to avoid warnings */ -++ #define POINTER_TO_UINT(X) ((unsigned int)(uintptr_t)(X)) -++#else -++ #define POINTER_TO_UINT(X) ((unsigned int)(X)) -++#endif -++ -++#ifdef __cplusplus -++extern "C" { /* the types are probably wrong... */ -++#endif -++#ifdef __cplusplus -++} -++#endif -++ -++#ifdef _MSC_VER -++__declspec(align(8)) -++#elif defined(__GNUC__) -++__attribute__((aligned(8))) -++#endif -++unsigned int rpi_shader[] = { -++// ::mc_setup -++/* [0x00000000] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000008] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -++/* [0x00000010] */ 0x15827d80, 0x10020767, // mov ra_y, unif -++/* [0x00000018] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -++/* [0x00000020] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -++/* [0x00000028] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -++/* [0x00000030] */ 0x15827d80, 0x10021427, // mov rb16, unif -++/* [0x00000038] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000040] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x00000048] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x00000050] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x00000058] */ 0x00000040, 0xe0020567, // mov ra21, 64 -++/* [0x00000060] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x00000068] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -++/* [0x00000070] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000078] */ 0x00000040, 0xe0021567, // mov rb21, 64 -++/* [0x00000080] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000088] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00000090] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x00000098] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x000000a0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x000000a8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x000000b0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x000000b8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x000000c0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x000000c8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x000000d0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x000000d8] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x000000e0] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x000000e8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x000000f0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x000000f8] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000100] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000108] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000110] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000118] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000120] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000128] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000130] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000138] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000140] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000148] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000150] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000158] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000160] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000168] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000170] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000178] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -++/* [0x00000180] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x00000188] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x00000190] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -++/* [0x00000198] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000001a0] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x000001a8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x000001b0] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x000001b8] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x000001c0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x000001c8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x000001d0] */ 0x4c9d00cf, 0x10024821, // add r0, r0, r3; mul24 r1, r1, rb_pitch -++/* [0x000001d8] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x000001e0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000001e8] */ 0x949dc5c0, 0xd0025890, // and r2, r2, ~3; mov ra_x_base, r0 -++/* [0x000001f0] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -++/* [0x000001f8] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -++/* [0x00000200] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000208] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000210] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000218] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000220] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000228] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000230] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000238] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00000240] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++// ::mc_filter_uv -++/* [0x00000248] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000250] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000258] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000260] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000268] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000270] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000278] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000280] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000288] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000290] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000298] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000002a0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002a8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002b0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002b8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002c0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002c8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002d0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000002d8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000002e0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002e8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000002f0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000002f8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000300] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000308] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000310] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000318] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000320] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000330] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000340] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000348] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000350] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000360] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000368] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000370] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000378] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000380] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000388] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000390] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000398] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003a0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :uvloop -++/* [0x000003a8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003b0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000003b8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000003c0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003c8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003d0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003d8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003e0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003e8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000003f0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000003f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000400] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000408] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -++/* [0x00000410] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000418] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000420] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000428] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000430] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000438] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000440] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000448] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000450] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000458] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000460] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000468] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000470] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000478] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000480] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000488] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000490] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000498] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x000004a0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x000004a8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x000004b0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000004b8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000004c0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x000004c8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004d0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x000004d8] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x000004e0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x000004e8] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x000004f0] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x000004f8] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000500] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000508] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000510] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000518] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000520] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000528] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000530] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000538] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000540] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x00000548] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000550] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000558] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000560] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000568] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000570] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000578] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000580] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000588] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000590] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000598] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_filter -++/* [0x000005a0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000005a8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000005b0] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -++/* [0x000005b8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000005c0] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x000005c8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000005d0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -++/* [0x000005d8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000005e0] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x000005e8] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x000005f0] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x000005f8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000600] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x00000608] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000610] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -++/* [0x00000618] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000620] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000628] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000630] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000638] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000640] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000648] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000650] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000658] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000660] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000668] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000670] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000678] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000680] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000688] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000690] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000698] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006a0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006a8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000006b0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006b8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006c8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000006d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000006f0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006f8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000700] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000708] */ 0x000001d0, 0xf07809e7, // brr.anynn -, r:fast_path -++/* [0x00000710] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000718] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000720] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000728] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :loop -++/* [0x00000730] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000738] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000740] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000748] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000750] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -++/* [0x00000758] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000760] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000768] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000770] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000778] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000780] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000788] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000790] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000798] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000007a0] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000007a8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000007b0] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000007b8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000007c0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000007c8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000007d0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000007d8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000007e0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000007e8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x000007f0] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000007f8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000800] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000808] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000810] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000818] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000820] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000828] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000830] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000838] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000840] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000848] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:loop -++/* [0x00000850] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00000858] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00000860] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00000868] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00000870] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00000878] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000880] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000888] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000890] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000898] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x000008a0] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x000008a8] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x000008b0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000008b8] */ 0xfffffe58, 0xf06809e7, // brr.anyn -, r:loop -++/* [0x000008c0] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x000008c8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000008d0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000008d8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000008e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000008e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000008f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// :fast_path -++/* [0x000008f8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :fast_loop -++/* [0x00000900] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000908] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000910] */ 0x95727d9b, 0x1004475f, // mov.ifz ra_y, ra_y_next ; mov rb31, r3 -++/* [0x00000918] */ 0x95690dbf, 0x10044623, // mov.ifz ra_x2_base, ra_x2_base_next ; mov r3, rb_pitch -++/* [0x00000920] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000928] */ 0x929de5e4, 0x100248a1, // min r2, r2, rb_frame_height_minus_1 ; mov r1, r4 -++/* [0x00000930] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000938] */ 0xec414c87, 0x10024e20, // add t0s, ra_x_base, r2 ; v8subs r0, r0, rb20 -++/* [0x00000940] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000948] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000950] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000958] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000960] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000968] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000970] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000978] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000980] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000988] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -++/* [0x00000990] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000998] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x000009a0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x000009a8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x000009b0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000009b8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000009c0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x000009c8] */ 0xffffff18, 0xf06809e7, // brr.anyn -, r:fast_loop -++/* [0x000009d0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x000009d8] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x000009e0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x000009e8] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x000009f0] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x000009f8] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000a00] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000a08] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000a10] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000a18] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000a20] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000a28] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000a30] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000a38] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:fast_loop -++/* [0x00000a40] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x00000a48] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a50] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a58] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a60] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a68] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a70] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_filter_b -++/* [0x00000a78] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000a80] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000a88] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -++/* [0x00000a90] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000a98] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x00000aa0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000aa8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -++/* [0x00000ab0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000ab8] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x00000ac0] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x00000ac8] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x00000ad0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000ad8] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x00000ae0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000ae8] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -++/* [0x00000af0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000af8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000b00] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000b08] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000b10] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000b18] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000b20] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000b28] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000b30] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000b38] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000b40] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000b48] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000b50] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000b58] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000b60] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000b68] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000b70] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x00000b78] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000b80] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000b88] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000b90] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000b98] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000ba0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ba8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bb0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bb8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000bc0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bc8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bd0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bd8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000be0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000be8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bf0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bf8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000c00] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000c08] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000c10] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :bloop -++/* [0x00000c18] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000c20] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000c28] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000c30] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000c38] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -++/* [0x00000c40] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000c48] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000c50] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000c58] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000c60] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000c68] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000c70] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000c78] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000c80] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000c88] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000c90] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000c98] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000ca0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000ca8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000cb0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000cb8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000cc0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000cc8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000cd0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000cd8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000ce0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000ce8] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000cf0] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000cf8] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000d00] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000d08] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000d10] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000d18] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000d20] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000d28] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000d30] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:bloop -++/* [0x00000d38] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00000d40] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00000d48] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00000d50] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00000d58] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00000d60] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000d68] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000d70] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000d78] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000d80] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000d88] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000d90] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000d98] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000da0] */ 0x8fc8f3f6, 0xd0020867, // asr r1, r1, 15 ; mov -, vr_wait -++/* [0x00000da8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000db0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x00000db8] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:bloop -++/* [0x00000dc0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000dc8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x00000dd0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x00000dd8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000de0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000de8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000df0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_filter_honly -++/* [0x00000df8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000e00] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000e08] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -++/* [0x00000e10] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000e18] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x00000e20] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000e28] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -++/* [0x00000e30] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000e38] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x00000e40] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x00000e48] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x00000e50] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000e58] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x00000e60] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000e68] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -++/* [0x00000e70] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000e78] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000e80] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000e88] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000e90] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000e98] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000ea0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000ea8] */ 0x0c9de1c0, 0xd0021467, // add rb17, r0, -2 -++/* [0x00000eb0] */ 0x919c71c0, 0xd0024812, // shl r0, r0, 7 ; mov rb18,r0 -++/* [0x00000eb8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000ec0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000ec8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000ed0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000ed8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ee0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ee8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ef0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000ef8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f00] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f08] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f10] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000f18] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000f20] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000f28] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000f30] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :loop_honly -++/* [0x00000f38] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000f40] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000f48] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000f50] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000f58] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -++/* [0x00000f60] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000f68] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000f70] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000f78] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000f80] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000f88] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000f90] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000f98] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000fa0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000fa8] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000fb0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000fb8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000fc0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000fc8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000fd0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000fd8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000fe0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000fe8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000ff0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000ff8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001000] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001008] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -++/* [0x00001010] */ 0x8d5927f6, 0x100269e1, // sub.setf -, r3, rb18 ; mov r1, ra22 -++/* [0x00001018] */ 0x559f2fc1, 0x100049e0, // mov -, vw_wait ; mul24 r0, r0, r1 -++/* [0x00001020] */ 0xfffffef8, 0xf06809e7, // brr.anyn -, r:loop_honly -++/* [0x00001028] */ 0x0f9cf1c0, 0xd0020827, // asr r0, r0, 15 -++/* [0x00001030] */ 0x129d61c0, 0x10020827, // min r0, r0, rb22 -++/* [0x00001038] */ 0x139c01c0, 0xd0020c27, // max vpm, r0, 0 -++/* [0x00001040] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001048] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001050] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001058] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_exit -++/* [0x00001060] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001068] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00001070] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001078] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001080] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001088] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001090] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00001098] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000010a0] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_exit1 -++/* [0x000010a8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000010b0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010b8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010c0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010c8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010d0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000010d8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000010e0] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_interrupt_exit -++/* [0x000010e8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000010f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001100] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001108] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001110] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001118] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001120] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001128] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001130] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001138] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001140] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001148] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001150] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001158] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001160] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001168] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00001170] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00001178] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_interrupt_exit4 -++/* [0x00001180] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001188] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001190] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001198] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011a0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000011b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000011b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000011c0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000011c8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000011d0] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_interrupt_exit8 -++/* [0x000011d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000011e0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011e8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001200] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001208] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001210] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001218] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001220] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001228] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001230] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001238] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00001240] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00001248] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_setup_uv -++/* [0x00001250] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00001258] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -++/* [0x00001260] */ 0x15827d80, 0x10020767, // mov ra_y, unif -++/* [0x00001268] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -++/* [0x00001270] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00001278] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_x2_base -++/* [0x00001280] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -++/* [0x00001288] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -++/* [0x00001290] */ 0x15827d80, 0x10021427, // mov rb16, unif -++/* [0x00001298] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000012a0] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x000012a8] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x000012b0] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x000012b8] */ 0x00000040, 0xe0020567, // mov ra21, 64 -++/* [0x000012c0] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x000012c8] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -++/* [0x000012d0] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x000012d8] */ 0x00000040, 0xe0021567, // mov rb21, 64 -++/* [0x000012e0] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x000012e8] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x000012f0] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x000012f8] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x00001300] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x00001308] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x00001310] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x00001318] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x00001320] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x00001328] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x00001330] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00001338] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00001340] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00001348] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00001350] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00001358] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00001360] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00001368] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00001370] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00001378] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00001380] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00001388] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00001390] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00001398] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x000013a0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x000013a8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x000013b0] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x000013b8] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x000013c0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000013c8] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x000013d0] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x000013d8] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -++/* [0x000013e0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000013e8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -++/* [0x000013f0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x000013f8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x00001400] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00001408] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00001410] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -++/* [0x00001418] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00001420] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x00001428] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -++/* [0x00001430] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -++/* [0x00001438] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001440] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001448] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001450] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00001458] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00001460] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00001468] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001470] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00001478] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00001480] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++// ::mc_filter_uv_b -++/* [0x00001488] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00001490] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00001498] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000014a0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000014a8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000014b0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000014b8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000014c0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000014c8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000014d0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000014d8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000014e0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000014e8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000014f0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000014f8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00001500] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00001508] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00001510] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00001518] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00001520] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00001528] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00001530] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00001538] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00001540] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00001548] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00001550] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00001558] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x00001560] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00001568] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001570] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001578] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001580] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001588] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00001590] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001598] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015a0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015a8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000015b0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015b8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015c0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015c8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000015d0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015d8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015e0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015e8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x000015f0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000015f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00001600] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :uvloop_b -++/* [0x00001608] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00001610] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00001618] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00001620] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00001628] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00001630] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00001638] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00001640] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00001648] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00001650] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00001658] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00001660] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00001668] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -++/* [0x00001670] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00001678] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00001680] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00001688] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00001690] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00001698] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000016a0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000016a8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000016b0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000016b8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000016c0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000016c8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x000016d0] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000016d8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x000016e0] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x000016e8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x000016f0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x000016f8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001700] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001708] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001710] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001718] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001720] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00001728] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00001730] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00001738] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00001740] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00001748] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00001750] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00001758] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00001760] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00001768] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00001770] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00001778] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00001780] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00001788] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00001790] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00001798] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x000017a0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000017a8] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x000017b0] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000017b8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x000017c0] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x000017c8] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x000017d0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000017d8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000017e0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000017e8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000017f0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000017f8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001800] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00001808] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001810] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_end -++}; -++#ifdef __HIGHC__ -++#pragma Align_to(8, rpi_shader) -++#endif -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+new file mode 100644 -+index 0000000..db971f4 -+--- /dev/null -++++ b/libavcodec/rpi_shader.h -+@@ -0,0 +1,20 @@ -++#ifndef rpi_shader_H -++#define rpi_shader_H -++ -++extern unsigned int rpi_shader[]; -++ -++#define mc_setup (rpi_shader + 0) -++#define mc_filter_uv (rpi_shader + 146) -++#define mc_filter (rpi_shader + 360) -++#define mc_filter_b (rpi_shader + 670) -++#define mc_filter_honly (rpi_shader + 894) -++#define mc_exit (rpi_shader + 1048) -++#define mc_exit1 (rpi_shader + 1066) -++#define mc_interrupt_exit (rpi_shader + 1082) -++#define mc_interrupt_exit4 (rpi_shader + 1120) -++#define mc_interrupt_exit8 (rpi_shader + 1142) -++#define mc_setup_uv (rpi_shader + 1172) -++#define mc_filter_uv_b (rpi_shader + 1314) -++#define mc_end (rpi_shader + 1542) -++ -++#endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+new file mode 100644 -+index 0000000..6851e83 -+--- /dev/null -++++ b/libavcodec/rpi_shader.qasm -+@@ -0,0 +1,1413 @@ -++# register allocation -++# -++# ra0...ra7 eight horizontal filter coefficients -++# -++# rb1...rb7 seven shifted copies of the current unfiltered row -++# -++# ra8...ra15 eight filtered rows of context (rb15 == most recent) -++# -++# (ra15 isn't clamped to zero - this happens during the -++# copy to ra14, and during its use in the vertical filter) -++# -++# rb8...rb15 eight vertical filter coefficients -++# -++# ra16 clipped(row start address+elem_num)&~3 -++# ra17 per-channel shifts -++# ra19 next ra17 -++# -++# rb16 pitch -++# rb17 height + 5 -++# rb18 height + 7 -++# rb19 next ra16 -++# -++# ra20 1 -++# ra21 64 -++# ra22 256 -++# ra23 8 -++# -++# rb20 0xffffff00 -++# rb21 64 -++# rb22 255 -++# rb23 24 -++# -++# rb24 vdw_setup_1(dst_pitch) -++# rb25 frame width-1 -++# rb26 height<<23 + width<<16 + vdw_setup_0 -++# rb27 vdw_setup_0 (depends on QPU number) -++# rb28 vpm_setup (depends on QPU number) -++# rb29 vdw_setup_1(dst_pitch-width) -++# rb30 frame height-1 -++# rb31 used as temp to count loop iterations -++# -++# ra24...ra30 15, 14, 13, 12, 11, 10, 9 -++# ra24 clipped(row start address+8+elem_num)&~3 -++# ra25 per-channel shifts 2 -++# ra26 next ra24 -++# ra27 next ra25 -++# ra28 next y -++# ra29 y for next texture access -++# -++# ra31 next kernel address -++ -++.set rb_frame_width_minus_1, rb25 -++.set rb_frame_height_minus_1, rb30 -++.set rb_pitch, rb16 -++.set ra_x_base, ra16 -++.set rb_x_base_next, rb19 -++.set ra_x2_base, ra24 -++.set ra_x2_base_next, ra26 -++.set ra_xshift, ra17 -++ -++.set ra_x2shift, ra25 -++.set ra_u2v_ref_offset, ra25 -++ -++.set ra_xshift_next, ra19 -++ -++.set ra_x2shift_next, ra27 -++.set ra_u2v_dst_offset, ra27 -++ -++.set ra_y_next, ra28 -++.set ra_y, ra29 -++ -++.set rb_const_64, rb21 -++ -++# mc_setup(next_kernel, x, y, ref_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1) -++::mc_setup -++ -++# Read starting kernel -++mov ra31, unif -++ -++# Load first request location -++add ra_x_base, unif, elem_num # Store x -++mov ra_y, unif # Store y -++mov ra_x2_base, unif # Store frame base -++ -++# Read image dimensions -++sub rb25,unif,1 -++sub rb30,unif,1 -++ -++# get source pitch -++mov rb16, unif -++ -++# get destination pitch -++mov r0, unif -++mov r1, vdw_setup_1(0) -++add rb24, r1, r0 -++ -++# load constants -++ -++mov ra20, 1 -++mov ra21, 64 -++mov ra22, 256 -++mov ra23, 8 -++ -++mov rb20, 0xffffff00 -++mov rb21, 64 -++mov rb22, 255 -++mov rb23, 24 -++ -++# touch vertical context to keep simulator happy -++ -++mov ra8, 0 -++mov ra9, 0 -++mov ra10, 0 -++mov ra11, 0 -++mov ra12, 0 -++mov ra13, 0 -++mov ra14, 0 -++mov ra15, 0 -++ -++# Compute part of VPM to use for DMA output -++mov r2, qpu_num -++and r2, r2, 15 -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -++mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -++shl r0, r0, 5 -++add rb27, r0, r1 -++ -++# Compute part of VPM to save data into -++mov r2, qpu_num -++and r2, r2, 15 -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -++mov r1, vpm_setup(0, 4, h8p(0, 0)) -++add rb28, r0, r1 -++ -++# Compute base address for first and second access -++#add r0, unif, elem_num # x -++mov r0, ra_x_base # Load x -++add r2, r0, 8 # x+8 -++max r0, r0, 0; mov r1, ra_y # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base # Load the frame base -++shl ra_xshift_next, r0, 3 -++max r2, r2, 0 -++add ra_y, r1, 1 -++min r2, r2, rb_frame_width_minus_1 -++shl ra_x2shift_next, r2, 3 -++max r1, r1, 0 # y -++min r1, r1, rb_frame_height_minus_1 -++add r0, r0, r3; mul24 r1, r1, rb_pitch -++add r2, r2, r3 -++and r0, r0, ~3 -++and r2, r2, ~3; mov ra_x_base, r0 -++# submit texture requests for first line -++add t0s, r0, r1 ; mov ra_x2_base, r2 -++add t0s, r2, r1 -++ -++# Dump padding words -++mov r0, unif -++mov r0, unif -++ -++# submit texture requests for second line -++max r1, ra_y, 0 -++min r1, r1, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 -++bra -, ra31 -++nop ; mul24 r1, r1, rb_pitch -++add t0s, r1, ra_x_base -++add t0s, r1, ra_x2_base -++ -++################################################################################ -++ -++# mc_filter_uv(next_kernel, x, y, frame_u_base, frame_v_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_u_dst, this_v_dst) -++ -++# At this point we have already issued two pairs of texture requests for the current block -++# ra_x_base, ra_x16_base point to the current coordinates for this block -++::mc_filter_uv -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # x -++max r0, r0, 0; mov r1, unif # y -++min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -++shl ra_xshift_next, r0, 3 -++sub r2, unif, r3 # compute offset from frame base u to frame base v -++add r0, r0, r3 -++and rb_x_base_next, r0, ~3 -++mov ra_y_next, r1 -++add ra_x2_base_next, rb_x_base_next, r2 -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -++ -++# get filter coefficients -++ -++mov r0, unif -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++asr rb15, r0, rb23; mul24 r0, r0, ra22 -++asr rb14, r0, rb23; mul24 r0, r0, ra22 -++asr rb13, r0, rb23; mul24 r0, r0, ra22 -++asr rb12, r0, rb23 -++ -++# r2 is elem_num -++# r3 is loop counter -++ -++mov r5rep, -8 -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++mov r3, 0 -++ -++:uvloop -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++mov r2, rb21 ; mul24 r3, r0, ra0 -++nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -++sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++sub r0, r2, r3 -++ -++mov r3, rb31 -++ -++mov ra8, ra9 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++mov ra13, ra14 -++ -++sub.setf -, r3, 8 ; mov r1, ra22 -++ -++# apply horizontal filter -++brr.anyn -, r:uvloop -++max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -++asr r0, r0, 15 ; mov r1, ra21 -++min.setf ra15, r0, rb22 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r0, ra14, rb14 -++sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++sub.ifnn r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++brr.anyn -, r:uvloop -++asr r1, r1, 15 -++min r1, r1, rb22 -++max vpm, r1, 0 -++ -++# DMA out for U -++ -++mov vw_setup, rb26 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++# DMA out for V -++# We need to wait for the U to complete first, but have nothing useful to compute while we wait. -++# Could potentially push this write into the start of the next pipeline stage. -++mov r0, 16 -++mov -, vw_wait -++ -++bra -, ra31 -++add vw_setup, rb26, r0 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++################################################################################ -++ -++ -++# mc_filter(next_kernel, x, y, frame_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_dst) -++ -++# At this point we have already issued two pairs of texture requests for the current block -++# ra_x_base, ra_x16_base point to the current coordinates for this block -++::mc_filter -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++mov ra_x2shift, ra_x2shift_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # x -++add r2, r0, 8 # x+8 -++max r0, r0, 0; mov r1, unif # y -++min r0, r0, rb_frame_width_minus_1 ; mov r3,unif # frame_base -++shl ra_xshift_next, r0, 3 -++max r2, r2, 0 -++min r2, r2, rb_frame_width_minus_1 -++shl ra_x2shift_next, r2, 3 -++add r0, r0, r3 -++add r2, r2, r3 -++and rb_x_base_next, r0, ~3 -++and ra_x2_base_next, r2, ~3 -++mov ra_y_next, r1 -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -++ -++# get filter coefficients -++ -++mov r0, unif -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++asr rb15, r0, rb23; mul24 r0, r0, ra22 -++asr rb14, r0, rb23; mul24 r0, r0, ra22 -++asr rb13, r0, rb23; mul24 r0, r0, ra22 -++brr.anynn -, r:fast_path -++asr rb12, r0, rb23 # delay slot 1 -++ -++# r2 is elem_num -++# r3 is loop counter -++ -++mov r5rep, -8 # delay slot 2 -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] # delay slot 3 -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++## nop ; ldtmu0 # loop counter increment -++## shr r0, r4, ra17 ; ldtmu0 -++## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -++## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -++## add ra16, ra16, rb16 ; mov t0s, ra16 -++## -++## # generate seven shifted versions -++## # interleave with scroll of vertical context -++## -++## mov r2, rb21 ; mul24 r3, r0, ra0 -++## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++## nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++## nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++## nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++## nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++## nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++## nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++## nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++## sub r2, r2, r3 ; ldtmu0 -++## -++## mov r0, ra22 -++## shr r0, r4, ra17 ; mul24 r2, r2, r0 ; ldtmu0 -++## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -++## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -++## add ra16, ra16, rb16 ; mov t0s, ra16 -++## -++## # apply horizontal filter -++## -++## asr r2, r2, 15 ; mul24 r3, r0, ra0 -++## min r2, r2, rb22 -++## max ra13, r2, 0 -++## -++## # generate seven shifted versions -++## # interleave with scroll of vertical context -++## -++## mov r2, rb21 -++## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++## nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++## nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++## nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++## nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++## nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++## nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++## nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++## sub r0, r2, r3 -++## -++## # apply horizontal filter -++## -++## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -++## asr r0, r0, 15 -++## min r0, r0, rb22 -++## max ra14, r0, 0 -++## -++## -++## -++## -++## nop ; ldtmu0 # loop counter increment -++## shr r0, r4, ra17 ; ldtmu0 -++## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -++## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -++## add ra16, ra16, rb16 ; mov t0s, ra16 -++## -++## # generate seven shifted versions -++## # interleave with scroll of vertical context -++## -++## mov r2, rb21 ; mul24 r3, r0, ra0 -++## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++## nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++## nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++## nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++## nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++## nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++## nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++## nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++## sub r0, r2, r3 -++## -++## # apply horizontal filter -++## -++## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -++## asr r0, r0, 15 -++## min r0, r0, rb22 -++## max ra15, r0, 0 -++ -++ -++ -++ -++mov r3, 0 -++ -++:loop -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++mov r2, rb21 ; mul24 r3, r0, ra0 -++sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++sub r0, r2, r3 -++ -++mov r3, rb31 -++ -++mov ra8, ra9 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++mov ra13, ra14 -++ -++sub.setf -, r3, 8 ; mov r1, ra22 -++ -++# apply horizontal filter -++brr.anyn -, r:loop -++max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -++asr r0, r0, 15 ; mov r1, ra21 -++min.setf ra15, r0, rb22 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r0, ra14, rb14 -++sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++sub.ifnn r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++brr.anyn -, r:loop -++asr r1, r1, 15 -++min r1, r1, rb22 -++max vpm, r1, 0 -++ -++# DMA out -++ -++bra -, ra31 -++mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -++mov vw_setup, rb29 -++mov vw_addr, unif # start the VDW -++ -++#################################################### -++ -++:fast_path -++## nop ; ldtmu0 # loop counter increment -++## shr r0, r4, ra17 ; ldtmu0 -++## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -++## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -++## add ra16, ra16, rb16 ; mov t0s, ra16 -++## -++## # generate seven shifted versions -++## # interleave with scroll of vertical context -++## -++## mov r2, rb21 ; mul24 r3, r0, ra0 -++## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++## sub r2, r2, r3 ; ldtmu0 -++## -++## mov r0, ra22 -++## shr r0, r4, ra17 ; mul24 r2, r2, r0 ; ldtmu0 -++## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -++## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -++## add ra16, ra16, rb16 ; mov t0s, ra16 -++## -++## # apply horizontal filter -++## -++## asr r2, r2, 15 ; mul24 r3, r0, ra0 -++## min r2, r2, rb22 -++## max ra13, r2, 0 -++## -++## # generate seven shifted versions -++## # interleave with scroll of vertical context -++## -++## mov r2, rb21 -++## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++## sub r0, r2, r3 -++## -++## # apply horizontal filter -++## -++## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -++## asr r0, r0, 15 -++## min r0, r0, rb22 -++## max ra14, r0, 0 -++## -++## -++## -++## -++## nop ; ldtmu0 # loop counter increment -++## shr r0, r4, ra17 ; ldtmu0 -++## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -++## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -++## add ra16, ra16, rb16 ; mov t0s, ra16 -++## -++## # generate seven shifted versions -++## # interleave with scroll of vertical context -++## -++## mov r2, rb21 ; mul24 r3, r0, ra0 -++## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++## sub r0, r2, r3 -++## -++## # apply horizontal filter -++## -++## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -++## asr r0, r0, 15 -++## min r0, r0, rb22 -++## max ra15, r0, 0 -++ -++ -++mov r3, 0 # This signifies the amount of unrolling -++ -++:fast_loop -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++# Due to pipelining we can only skip second pipeline instructions related to the fetched pixels -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_y, ra_y_next ; mov rb31, r3 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov r3, rb_pitch -++ -++max r2, ra_y, 0 -++min r2, r2, rb_frame_height_minus_1 ; mov r1, r4 # discard texture read -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r0, r0, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov r2, rb21 ; mul24 r3, r0, ra0 -++sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++sub r0, r2, r3 ; mov r3, rb31 -++ -++mov ra8, ra9 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++mov ra13, ra14 -++ -++sub.setf -, r3, 8 ; mov r1, ra22 -++ -++# apply horizontal filter -++ -++brr.anyn -, r:fast_loop -++max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -++asr r0, r0, 15 ; mov r1, ra21 -++min.setf ra15, r0, rb22 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r0, ra14, rb14 -++sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++sub.ifnn r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++brr.anyn -, r:fast_loop -++asr r1, r1, 15 -++min r1, r1, rb22 -++max vpm, r1, 0 -++ -++# DMA out -++ -++bra -, ra31 -++mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -++mov vw_setup, rb29 -++mov vw_addr, unif # start the VDW -++ -++################################################################################ -++ -++# mc_filter_b(next_kernel, x, y, frame_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_dst) -++ -++# At this point we have already issued two pairs of texture requests for the current block -++# ra_x_base, ra_x16_base point to the current coordinates for this block -++::mc_filter_b -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++mov ra_x2shift, ra_x2shift_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # x -++add r2, r0, 8 # x+8 -++max r0, r0, 0; mov r1, unif # y -++min r0, r0, rb_frame_width_minus_1 ; mov r3,unif # frame_base -++shl ra_xshift_next, r0, 3 -++max r2, r2, 0 -++min r2, r2, rb_frame_width_minus_1 -++shl ra_x2shift_next, r2, 3 -++add r0, r0, r3 -++add r2, r2, r3 -++and rb_x_base_next, r0, ~3 -++and ra_x2_base_next, r2, ~3 -++mov ra_y_next, r1 -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++# r0 is currently height<<7 -++# For vr_setup we want height<<20 (so 20-7=13 additional bits) -++shl r3, r0, 13 -++shl r3, r3, 8 # Mask off top 8 bits -++shr r3, r3, 8 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++# In a B frame, so also set up VPM read -++add vr_setup, r3, rb28 -++ -++# get filter coefficients -++ -++mov r0, unif -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++asr rb15, r0, rb23; mul24 r0, r0, ra22 -++asr rb14, r0, rb23; mul24 r0, r0, ra22 -++asr rb13, r0, rb23; mul24 r0, r0, ra22 -++asr rb12, r0, rb23 -++ -++# r2 is elem_num -++# r3 is loop counter -++ -++mov r5rep, -8 -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++mov r3, 0 -++ -++:bloop -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++mov r2, rb21 ; mul24 r3, r0, ra0 -++sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++sub r0, r2, r3 -++ -++mov r3, rb31 -++ -++mov ra8, ra9 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++mov ra13, ra14 -++ -++sub.setf -, r3, 8 ; mov r1, ra22 -++ -++# apply horizontal filter -++brr.anyn -, r:bloop -++max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -++asr r0, r0, 15 ; mov r1, ra21 -++min.setf ra15, r0, rb22 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r0, ra14, rb14 -++sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++sub.ifnn r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++asr r1, r1, 15 ; mov -, vr_wait -++min r1, r1, rb22 -++add r0, vpm, 1 # Blend in previous VPM contents at this location -++brr.anyn -, r:bloop -++max r1, r1, 0 -++add r1, r1, r0 -++shr vpm, r1, 1 -++ -++# DMA out -++ -++bra -, ra31 -++mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -++mov vw_setup, rb29 -++mov vw_addr, unif # start the VDW -++ -++################################################################################ -++ -++# mc_filter_honly(next_kernel, x, y, frame_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_dst) -++# This filter only does horizontal filtering. -++# It is assumed that the region to fetch does not include extra rows above. -++ -++# At this point we have already issued two pairs of texture requests for the current block -++# ra_x_base, ra_x16_base point to the current coordinates for this block -++::mc_filter_honly -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++mov ra_x2shift, ra_x2shift_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # x -++add r2, r0, 8 # x+8 -++max r0, r0, 0; mov r1, unif # y -++min r0, r0, rb_frame_width_minus_1 ; mov r3,unif # frame_base -++shl ra_xshift_next, r0, 3 -++max r2, r2, 0 -++min r2, r2, rb_frame_width_minus_1 -++shl ra_x2shift_next, r2, 3 -++add r0, r0, r3 -++add r2, r2, r3 -++and rb_x_base_next, r0, ~3 -++and ra_x2_base_next, r2, ~3 -++mov ra_y_next, r1 -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, -2 # Pipelining means we move data across 2 iterations early -++shl r0, r0, 7 ; mov rb18,r0 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++# get filter coefficients -++ -++mov r0, unif -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++mov r0, unif -++ -++# r2 is elem_num -++# r3 is loop counter -++mov r5rep, -8 -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] # delay slot 3 -++mov r3, 0 -++ -++:loop_honly -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++mov r2, rb21 ; mul24 r3, r0, ra0 -++sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++sub r0, r2, r3 ; mov r3, rb31 -++ -++sub.setf -, r3, rb18 ; mov r1, ra22 -++ -++mov -, vw_wait ; mul24 r0, r0, r1 -++brr.anyn -, r:loop_honly -++asr r0, r0, 15 # delay 1 -++min r0, r0, rb22 # delay 2 -++max vpm, r0, 0 # delay 3 -++ -++# DMA out -++bra -, ra31 -++mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -++mov vw_setup, rb29 -++mov vw_addr, unif # start the VDW -++ -++ -++################################################################################ -++ -++# mc_exit() -++ -++::mc_exit -++mov -, vw_wait # wait on the VDW -++ -++mov -,srel(0) -++ -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ -++nop ; nop ; thrend -++nop ; nop # delay slot 1 -++nop ; nop # delay slot 2 -++ -++::mc_exit1 -++mov -, vw_wait # wait on the VDW -++ -++#mov -,srel(1) -++ -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ -++nop ; nop ; thrend -++mov interrupt, 1; nop # delay slot 1 -++nop ; nop # delay slot 2 -++ -++# mc_interrupt_exit() -++::mc_interrupt_exit -++mov -, vw_wait # wait on the VDW -++ -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ -++mov -,sacq(0) # 1 -++mov -,sacq(0) # 2 -++mov -,sacq(0) # 3 -++mov -,sacq(0) # 4 -++mov -,sacq(0) # 5 -++mov -,sacq(0) # 6 -++mov -,sacq(0) # 7 -++mov -,sacq(0) # 8 -++mov -,sacq(0) # 9 -++mov -,sacq(0) # 10 -++mov -,sacq(0) # 11 -++ -++nop ; nop ; thrend -++mov interrupt, 1; nop # delay slot 1 -++nop ; nop # delay slot 2 -++ -++# mc_interrupt_exit4() -++::mc_interrupt_exit4 -++mov -, vw_wait # wait on the VDW -++ -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ -++mov -,sacq(0) # 1 -++mov -,sacq(0) # 2 -++mov -,sacq(0) # 3 -++ -++nop ; nop ; thrend -++mov interrupt, 1; nop # delay slot 1 -++nop ; nop # delay slot 2 -++ -++# mc_interrupt_exit8() -++::mc_interrupt_exit8 -++mov -, vw_wait # wait on the VDW -++ -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ -++mov -,sacq(0) # 1 -++mov -,sacq(0) # 2 -++mov -,sacq(0) # 3 -++mov -,sacq(0) # 4 -++mov -,sacq(0) # 5 -++mov -,sacq(0) # 6 -++mov -,sacq(0) # 7 -++ -++nop ; nop ; thrend -++mov interrupt, 1; nop # delay slot 1 -++nop ; nop # delay slot 2 -++ -++################################################################################ -++# mc_setup_uv(next_kernel, x, y, ref_u_base, ref_v_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1, pad2) -++::mc_setup_uv -++ -++# Read starting kernel -++mov ra31, unif -++ -++# Load first request location -++add ra_x_base, unif, elem_num # Store x -++mov ra_y, unif # Store y -++mov ra_x2_base, unif # Store frame u base -++nop -++sub ra_u2v_ref_offset, unif, ra_x2_base # Store offset to add to move from u to v in reference frame -++ -++# Read image dimensions -++sub rb25,unif,1 -++sub rb30,unif,1 -++ -++# get source pitch -++mov rb16, unif -++ -++# get destination pitch -++mov r0, unif -++mov r1, vdw_setup_1(0) -++add rb24, r1, r0 -++ -++# load constants -++ -++mov ra20, 1 -++mov ra21, 64 -++mov ra22, 256 -++mov ra23, 8 -++ -++mov rb20, 0xffffff00 -++mov rb21, 64 -++mov rb22, 255 -++mov rb23, 24 -++ -++# touch vertical context to keep simulator happy -++ -++mov ra8, 0 -++mov ra9, 0 -++mov ra10, 0 -++mov ra11, 0 -++mov ra12, 0 -++mov ra13, 0 -++mov ra14, 0 -++mov ra15, 0 -++ -++# Compute part of VPM to use for DMA output -++mov r2, qpu_num -++and r2, r2, 15 -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -++mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -++shl r0, r0, 5 -++add rb27, r0, r1 -++ -++# Compute part of VPM to save data into -++mov r2, qpu_num -++and r2, r2, 15 -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -++mov r1, vpm_setup(0, 4, h8p(0, 0)) -++add rb28, r0, r1 -++ -++# Compute base address for first and second access -++mov r0, ra_x_base # Load x -++max r0, r0, 0; mov r1, ra_y # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base # Load the frame base -++shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++add ra_y, r1, 1 -++add r0, r0, r3 -++and r0, r0, ~3 -++max r1, r1, 0 ; mov ra_x_base, r0 # y -++min r1, r1, rb_frame_height_minus_1 -++# submit texture requests for first line -++add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++add t0s, r0, r1 ; mov ra_x2_base, r2 -++add t0s, r2, r1 -++ -++# Dump padding words -++mov r0, unif -++mov r0, unif -++mov r0, unif -++ -++# submit texture requests for second line -++max r1, ra_y, 0 -++min r1, r1, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 -++bra -, ra31 -++nop ; mul24 r1, r1, rb_pitch -++add t0s, r1, ra_x_base -++add t0s, r1, ra_x2_base -++ -++ -++ -++################################################################################ -++ -++::mc_filter_uv_b -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # x -++max r0, r0, 0; mov r1, unif # y -++min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -++shl ra_xshift_next, r0, 3 -++sub r2, unif, r3 # compute offset from frame base u to frame base v -++add r0, r0, r3 -++and rb_x_base_next, r0, ~3 -++mov ra_y_next, r1 -++add ra_x2_base_next, rb_x_base_next, r2 -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++ -++# r0 is currently height<<7 -++# For vr_setup we want height<<20 (so 20-7=13 additional bits) -++shl r3, r0, 13 -++shl r3, r3, 8 # Mask off top 8 bits -++shr r3, r3, 8 -++ -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++# In a B frame, so also set up VPM read -++add vr_setup, r3, rb28 -++ -++sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -++ -++# get filter coefficients -++ -++mov r0, unif -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++asr rb15, r0, rb23; mul24 r0, r0, ra22 -++asr rb14, r0, rb23; mul24 r0, r0, ra22 -++asr rb13, r0, rb23; mul24 r0, r0, ra22 -++asr rb12, r0, rb23 -++ -++# r2 is elem_num -++# r3 is loop counter -++ -++mov r5rep, -8 -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++mov r3, 0 -++ -++:uvloop_b -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++mov r2, rb21 ; mul24 r3, r0, ra0 -++nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -++sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++sub r0, r2, r3 -++ -++mov r3, rb31 -++ -++mov ra8, ra9 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++mov ra13, ra14 -++ -++sub.setf -, r3, 8 ; mov r1, ra22 -++ -++# apply horizontal filter -++brr.anyn -, r:uvloop_b -++max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -++asr r0, r0, 15 ; mov r1, ra21 -++min.setf ra15, r0, rb22 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r0, ra14, rb14 -++sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++sub.ifnn r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++asr r1, r1, 15 -++min r1, r1, rb22 -++add r0, vpm, 1 # Blend in previous VPM contents at this location -++brr.anyn -, r:uvloop_b -++max r1, r1, 0 -++add r1, r1, r0 -++shr vpm, r1, 1 -++ -++ -++# DMA out for U -++ -++mov vw_setup, rb26 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++# DMA out for V -++# We need to wait for the U to complete first, but have nothing useful to compute while we wait. -++# Could potentially push this write into the start of the next pipeline stage. -++mov r0, 16 -++mov -, vw_wait -++ -++bra -, ra31 -++add vw_setup, rb26, r0 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++::mc_end -+diff --git a/libavcodec/rpi_user_vcsm.h b/libavcodec/rpi_user_vcsm.h -+new file mode 100644 -+index 0000000..fbebbbe -+--- /dev/null -++++ b/libavcodec/rpi_user_vcsm.h -+@@ -0,0 +1,425 @@ -++/* -++Copyright (c) 2012, Broadcom Europe Ltd -++All rights reserved. -++ -++Redistribution and use in source and binary forms, with or without -++modification, are permitted provided that the following conditions are met: -++ * Redistributions of source code must retain the above copyright -++ notice, this list of conditions and the following disclaimer. -++ * Redistributions in binary form must reproduce the above copyright -++ notice, this list of conditions and the following disclaimer in the -++ documentation and/or other materials provided with the distribution. -++ * Neither the name of the copyright holder nor the -++ names of its contributors may be used to endorse or promote products -++ derived from this software without specific prior written permission. -++ -++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -++ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -++WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -++DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -++DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -++(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -++LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -++ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -++(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -++SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -++*/ -++ -++#ifndef __USER_VCSM__H__INCLUDED__ -++#define __USER_VCSM__H__INCLUDED__ -++ -++/* VideoCore Shared Memory - user interface library. -++** -++** This library provides all the necessary abstraction for any application to -++** make use of the shared memory service which is distributed accross a kernel -++** driver and a videocore service. -++** -++** It is an application design decision to choose or not to use this service. -++** -++** The logical flow of operations that a user application needs to follow when -++** using this service is: -++** -++** 1) Initialize the service. -++** 2) Allocate shared memory blocks. -++** 3) Start using the allocated blocks. -++** - In order to gain ownership on a block, lock the allocated block, -++** locking a block returns a valid address that the user application -++** can access. -++** - When finished with using the block for the current execution cycle -++** or function, and so when giving up the ownership, unlock the block. -++** 4) A block can be locked/unlocked as many times required - within or outside -++** of - a specific execution context. -++** 5) To completely release an allocated block, free it. -++** 6) If the service is no longer required, terminate it. -++** -++** -++** Some generic considerations: -++ -++** Allocating memory blocks. -++** -++** Memory blocks can be allocated in different manners depending on the cache -++** behavior desired. A given block can either be: -++ -++** - Allocated in a non cached fashion all the way through host and videocore. -++** - Allocated in a cached fashion on host OR videocore. -++** - Allocated in a cached fashion on host AND videocore. -++** -++** It is an application decision to determine how to allocate a block. Evidently -++** if the application will be doing substantial read/write accesses to a given block, -++** it is recommended to allocate the block at least in a 'host cached' fashion for -++** better results. -++** -++** -++** Locking memory blocks. -++** -++** When the memory block has been allocated in a host cached fashion, locking the -++** memory block (and so taking ownership of it) will trigger a cache invalidation. -++** -++** For the above reason and when using host cached allocation, it is important that -++** an application properly implements the lock/unlock mechanism to ensure cache will -++** stay coherent, otherwise there is no guarantee it will at all be. -++** -++** It is possible to dynamically change the host cache behavior (ie cached or non -++** cached) of a given allocation without needing to free and re-allocate the block. -++** This feature can be useful for such application which requires access to the block -++** only at certain times and not otherwise. By changing the cache behavior dynamically -++** the application can optimize performances for a given duration of use. -++** Such dynamic cache behavior remapping only applies to host cache and not videocore -++** cache. If one requires to change the videocore cache behavior, then a new block -++** must be created to replace the old one. -++** -++** On successful locking, a valid pointer is returned that the application can use -++** to access to data inside the block. There is no guarantee that the pointer will -++** stay valid following the unlock action corresponding to this lock. -++** -++** -++** Unocking memory blocks. -++** -++** When the memory block has been allocated in a host cached fashion, unlocking the -++** memory block (and so forgiving its ownership) will trigger a cache flush unless -++** explicitely asked not to flush the cache for performances reasons. -++** -++** For the above reason and when using host cached allocation, it is important that -++** an application properly implements the lock/unlock mechanism to ensure cache will -++** stay coherent, otherwise there is no guarantee it will at all be. -++** -++** -++** A complete API is defined below. -++*/ -++ -++#ifdef __cplusplus -++extern "C" -++{ -++#endif -++ -++/* Different status that can be dumped. -++*/ -++typedef enum -++{ -++ VCSM_STATUS_VC_WALK_ALLOC = 0, // Walks *all* the allocation on videocore. -++ // Result of the walk is seen in the videocore -++ // log. -++ VCSM_STATUS_HOST_WALK_MAP, // Walks the *full* mapping allocation on host -++ // driver (ie for all processes). Result of -++ // the walk is seen in the kernel log. -++ VCSM_STATUS_HOST_WALK_PID_MAP, // Walks the per process mapping allocation on host -++ // driver (for current process). Result of -++ // the walk is seen in the kernel log. -++ VCSM_STATUS_HOST_WALK_PID_ALLOC, // Walks the per process host allocation on host -++ // driver (for current process). Result of -++ // the walk is seen in the kernel log. -++ VCSM_STATUS_VC_MAP_ALL, // Equivalent to both VCSM_STATUS_VC_WALK_ALLOC and -++ // VCSM_STATUS_HOST_WALK_MAP. -++ // -++ VCSM_STATUS_NONE, // Must be last - invalid. -++ -++} VCSM_STATUS_T; -++ -++/* Different kind of cache behavior. -++*/ -++typedef enum -++{ -++ VCSM_CACHE_TYPE_NONE = 0, // No caching applies. -++ VCSM_CACHE_TYPE_HOST, // Allocation is cached on host (user space). -++ VCSM_CACHE_TYPE_VC, // Allocation is cached on videocore. -++ VCSM_CACHE_TYPE_HOST_AND_VC, // Allocation is cached on both host and videocore. -++ -++} VCSM_CACHE_TYPE_T; -++ -++/* Initialize the vcsm processing. -++** -++** Must be called once before attempting to do anything else. -++** -++** Returns 0 on success, -1 on error. -++*/ -++int vcsm_init( void ); -++ -++ -++/* Terminates the vcsm processing. -++** -++** Must be called vcsm services are no longer needed, it will -++** take care of removing any allocation under the current process -++** control if deemed necessary. -++*/ -++void vcsm_exit( void ); -++ -++ -++/* Queries the status of the the vcsm. -++** -++** Triggers dump of various kind of information, see the -++** different variants specified in VCSM_STATUS_T. -++** -++** Pid is optional. -++*/ -++void vcsm_status( VCSM_STATUS_T status, int pid ); -++ -++ -++/* Allocates a non-cached block of memory of size 'size' via the vcsm memory -++** allocator. -++** -++** Returns: 0 on error -++** a non-zero opaque handle on success. -++** -++** On success, the user must invoke vcsm_lock with the returned opaque -++** handle to gain access to the memory associated with the opaque handle. -++** When finished using the memory, the user calls vcsm_unlock_xx (see those -++** function definition for more details on the one that can be used). -++** -++** A well behaved application should make every attempt to lock/unlock -++** only for the duration it needs to access the memory data associated with -++** the opaque handle. -++*/ -++unsigned int vcsm_malloc( unsigned int size, char *name ); -++ -++ -++/* Allocates a cached block of memory of size 'size' via the vcsm memory -++** allocator, the type of caching requested is passed as argument of the -++** function call. -++** -++** Returns: 0 on error -++** a non-zero opaque handle on success. -++** -++** On success, the user must invoke vcsm_lock with the returned opaque -++** handle to gain access to the memory associated with the opaque handle. -++** When finished using the memory, the user calls vcsm_unlock_xx (see those -++** function definition for more details on the one that can be used). -++** -++** A well behaved application should make every attempt to lock/unlock -++** only for the duration it needs to access the memory data associated with -++** the opaque handle. -++*/ -++unsigned int vcsm_malloc_cache( unsigned int size, VCSM_CACHE_TYPE_T cache, char *name ); -++ -++ -++/* Shares an allocated block of memory via the vcsm memory allocator. -++** -++** Returns: 0 on error -++** a non-zero opaque handle on success. -++** -++** On success, the user must invoke vcsm_lock with the returned opaque -++** handle to gain access to the memory associated with the opaque handle. -++** When finished using the memory, the user calls vcsm_unlock_xx (see those -++** function definition for more details on the one that can be used). -++** -++** A well behaved application should make every attempt to lock/unlock -++** only for the duration it needs to access the memory data associated with -++** the opaque handle. -++*/ -++unsigned int vcsm_malloc_share( unsigned int handle ); -++ -++ -++/* Resizes a block of memory allocated previously by vcsm_alloc. -++** -++** Returns: 0 on success -++** -errno on error. -++** -++** The handle must be unlocked by user prior to attempting any -++** resize action. -++** -++** On error, the original size allocated against the handle -++** remains available the same way it would be following a -++** successful vcsm_malloc. -++*/ -++int vcsm_resize( unsigned int handle, unsigned int new_size ); -++ -++ -++/* Frees a block of memory that was successfully allocated by -++** a prior call the vcms_alloc. -++** -++** The handle should be considered invalid upon return from this -++** call. -++** -++** Whether any memory is actually freed up or not as the result of -++** this call will depends on many factors, if all goes well it will -++** be freed. If something goes wrong, the memory will likely end up -++** being freed up as part of the vcsm_exit process. In the end the -++** memory is guaranteed to be freed one way or another. -++*/ -++void vcsm_free( unsigned int handle ); -++ -++ -++/* Retrieves a videocore opaque handle from a mapped user address -++** pointer. The videocore handle will correspond to the actual -++** memory mapped in videocore. -++** -++** Returns: 0 on error -++** a non-zero opaque handle on success. -++** -++** Note: the videocore opaque handle is distinct from the user -++** opaque handle (allocated via vcsm_malloc) and it is only -++** significant for such application which knows what to do -++** with it, for the others it is just a number with little -++** use since nothing can be done with it (in particular -++** for safety reason it cannot be used to map anything). -++*/ -++unsigned int vcsm_vc_hdl_from_ptr( void *usr_ptr ); -++ -++ -++/* Retrieves a videocore opaque handle from a opaque handle -++** pointer. The videocore handle will correspond to the actual -++** memory mapped in videocore. -++** -++** Returns: 0 on error -++** a non-zero opaque handle on success. -++** -++** Note: the videocore opaque handle is distinct from the user -++** opaque handle (allocated via vcsm_malloc) and it is only -++** significant for such application which knows what to do -++** with it, for the others it is just a number with little -++** use since nothing can be done with it (in particular -++** for safety reason it cannot be used to map anything). -++*/ -++unsigned int vcsm_vc_hdl_from_hdl( unsigned int handle ); -++ -++ -++/* Retrieves a user opaque handle from a mapped user address -++** pointer. -++** -++** Returns: 0 on error -++** a non-zero opaque handle on success. -++*/ -++unsigned int vcsm_usr_handle( void *usr_ptr ); -++ -++ -++/* Retrieves a mapped user address from an opaque user -++** handle. -++** -++** Returns: 0 on error -++** a non-zero address on success. -++** -++** On success, the address corresponds to the pointer -++** which can access the data allocated via the vcsm_malloc -++** call. -++*/ -++void *vcsm_usr_address( unsigned int handle ); -++ -++ -++/* Locks the memory associated with this opaque handle. -++** -++** Returns: NULL on error -++** a valid pointer on success. -++** -++** A user MUST lock the handle received from vcsm_malloc -++** in order to be able to use the memory associated with it. -++** -++** On success, the pointer returned is only valid within -++** the lock content (ie until a corresponding vcsm_unlock_xx -++** is invoked). -++*/ -++void *vcsm_lock( unsigned int handle ); -++ -++ -++/* Locks the memory associated with this opaque handle. The lock -++** also gives a chance to update the *host* cache behavior of the -++** allocated buffer if so desired. The *videocore* cache behavior -++** of the allocated buffer cannot be changed by this call and such -++** attempt will be ignored. -++** -++** The system will attempt to honour the cache_update mode request, -++** the cache_result mode will provide the final answer on which cache -++** mode is really in use. Failing to change the cache mode will not -++** result in a failure to lock the buffer as it is an application -++** decision to choose what to do if (cache_result != cache_update) -++** -++** The value returned in cache_result can only be considered valid if -++** the returned pointer is non NULL. The cache_result pointer may be -++** NULL if the application does not care about the actual outcome of -++** its action with regards to the cache behavior change. -++** -++** Returns: NULL on error -++** a valid pointer on success. -++** -++** A user MUST lock the handle received from vcsm_malloc -++** in order to be able to use the memory associated with it. -++** -++** On success, the pointer returned is only valid within -++** the lock content (ie until a corresponding vcsm_unlock_xx -++** is invoked). -++*/ -++void *vcsm_lock_cache( unsigned int handle, -++ VCSM_CACHE_TYPE_T cache_update, -++ VCSM_CACHE_TYPE_T *cache_result ); -++ -++ -++/* Unlocks the memory associated with this user mapped address. -++** -++** Returns: 0 on success -++** -errno on error. -++** -++** After unlocking a mapped address, the user should no longer -++** attempt to reference it. -++*/ -++int vcsm_unlock_ptr( void *usr_ptr ); -++ -++ -++/* Unlocks the memory associated with this user mapped address. -++** Apply special processing that would override the otherwise -++** default behavior. -++** -++** If 'cache_no_flush' is specified: -++** Do not flush cache as the result of the unlock (if cache -++** flush was otherwise applicable in this case). -++** -++** Returns: 0 on success -++** -errno on error. -++** -++** After unlocking a mapped address, the user should no longer -++** attempt to reference it. -++*/ -++int vcsm_unlock_ptr_sp( void *usr_ptr, int cache_no_flush ); -++ -++ -++/* Unlocks the memory associated with this user opaque handle. -++** -++** Returns: 0 on success -++** -errno on error. -++** -++** After unlocking an opaque handle, the user should no longer -++** attempt to reference the mapped addressed once associated -++** with it. -++*/ -++int vcsm_unlock_hdl( unsigned int handle ); -++ -++ -++/* Unlocks the memory associated with this user opaque handle. -++** Apply special processing that would override the otherwise -++** default behavior. -++** -++** If 'cache_no_flush' is specified: -++** Do not flush cache as the result of the unlock (if cache -++** flush was otherwise applicable in this case). -++** -++** Returns: 0 on success -++** -errno on error. -++** -++** After unlocking an opaque handle, the user should no longer -++** attempt to reference the mapped addressed once associated -++** with it. -++*/ -++int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); -++ -++#ifdef __cplusplus -++} -++#endif -++ -++#endif /* __USER_VCSM__H__INCLUDED__ */ -+-- -+2.5.0 -+ -+ -+From 9018000735949ecb6640187dd2571753881edcfa Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Sat, 2 May 2015 21:15:37 +0100 -+Subject: [PATCH 04/68] First working version with uncached memory -+ -+--- -+ libavcodec/hevc.c | 61 +++++- -+ libavcodec/hevc.h | 12 +- -+ libavcodec/hevc_cabac.c | 39 +++- -+ libavcodec/hevc_filter.c | 16 ++ -+ libavcodec/hevcpred_template.c | 6 + -+ libavcodec/rpi_hevc_transform.h | 422 +++++++++++++++++++++++++++++++++++++++- -+ libavcodec/rpi_hevc_transform.s | 153 +++++++++++++-- -+ libavcodec/rpi_qpu.c | 72 +++++++ -+ libavcodec/rpi_qpu.h | 1 + -+ 9 files changed, 736 insertions(+), 46 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 681e9fd..79678ea 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -45,6 +45,8 @@ -+ #include "rpi_qpu.h" -+ #endif -+ -++// #define DISABLE_MC -++ -+ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 }; -+ -+ /** -+@@ -1068,11 +1070,15 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < (size * size); i++) { -+ coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); -+ } -++ printf("Cross component not supported\n"); // TODO -++ exit(-1); -+ s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride); -+ } -+ } -+ -+ if (lc->tu.cross_pf) { -++ printf("Cross component not supported\n"); // TODO -++ exit(-1); -+ hls_cross_component_pred(s, 1); -+ } -+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { -+@@ -1101,6 +1107,8 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < (size * size); i++) { -+ coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); -+ } -++ printf("Cross component not supported\n"); // TODO -++ exit(-1); -+ s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride); -+ } -+ } -+@@ -1398,6 +1406,10 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ int idx = ff_hevc_pel_weight[block_w]; -+ -++#ifdef DISABLE_MC -++ return; -++#endif -++ -+ x_off += mv->x >> 2; -+ y_off += mv->y >> 2; -+ src += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift)); -+@@ -1468,6 +1480,10 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ uint8_t *src0 = ref0->data[0] + y_off0 * src0stride + (int)((unsigned)x_off0 << s->ps.sps->pixel_shift); -+ uint8_t *src1 = ref1->data[0] + y_off1 * src1stride + (int)((unsigned)x_off1 << s->ps.sps->pixel_shift); -+ -++#ifdef DISABLE_MC -++ return; -++#endif -++ -+ if (x_off0 < QPEL_EXTRA_BEFORE || y_off0 < QPEL_EXTRA_AFTER || -+ x_off0 >= pic_width - block_w - QPEL_EXTRA_AFTER || -+ y_off0 >= pic_height - block_h - QPEL_EXTRA_AFTER) { -+@@ -1553,6 +1569,10 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -+ intptr_t _mx = mx << (1 - hshift); -+ intptr_t _my = my << (1 - vshift); -+ -++#ifdef DISABLE_MC -++ return; -++#endif -++ -+ x_off += mv->x >> (2 + hshift); -+ y_off += mv->y >> (2 + vshift); -+ src0 += y_off * srcstride + (x_off * (1 << s->ps.sps->pixel_shift)); -+@@ -1617,6 +1637,10 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF -+ int hshift = s->ps.sps->hshift[1]; -+ int vshift = s->ps.sps->vshift[1]; -+ -++#ifdef DISABLE_MC -++ return; -++#endif -++ -+ intptr_t mx0 = av_mod_uintp2(mv0->x, 2 + hshift); -+ intptr_t my0 = av_mod_uintp2(mv0->y, 2 + vshift); -+ intptr_t mx1 = av_mod_uintp2(mv1->x, 2 + hshift); -+@@ -2356,6 +2380,22 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, -+ } -+ -+ #ifdef RPI -++static void rpi_execute_transform(HEVCContext *s) -++{ -++ int i=2; -++ //int j; -++ //int16_t *coeffs = s->coeffs_buf_arm[i]; -++ //for(j=s->num_coeffs[i]; j > 0; j-= 16*16, coeffs+=16*16) { -++ // s->hevcdsp.idct[4-2](coeffs, 16); -++ //} -++ -++ //gpu_cache_flush(&s->coeffs_buf[i]); -++ vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf[i].vc, s->num_coeffs[i] >> 8, 0, 0, 0); -++ -++ for(i=0;i<4;i++) -++ s->num_coeffs[i] = 0; -++} -++ -+ static void rpi_execute_pred_cmds(HEVCContext *s) -+ { -+ int i; -+@@ -2376,7 +2416,6 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ } -+ } -+ s->num_pred_cmds = 0; -+- s->num_coeffs = 0; -+ } -+ #endif -+ -+@@ -2423,7 +2462,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -+ #ifdef RPI -+- if (x_ctb + ctb_size >= s->ps.sps->width) { -++ if (1 || x_ctb + ctb_size >= s->ps.sps->width) { // TODO watch out for deblocking! -++ rpi_execute_transform(s); -+ rpi_execute_pred_cmds(s); -+ } -+ #endif -+@@ -3168,7 +3208,9 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ av_freep(&s->unif_mv_cmds); -+ av_freep(&s->unif_xfm_cmds); -+ av_freep(&s->univ_pred_cmds); -+- av_freep(&s->coeffs_buf); -++ for(i = 0; i < 4; i++) { -++ gpu_free(&s->coeffs_buf[i]); -++ } -+ #endif -+ -+ for (i = 0; i < 3; i++) { -+@@ -3240,13 +3282,16 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ s->univ_pred_cmds = av_mallocz(sizeof(HEVCPredCmd)*RPI_MAX_PRED_CMDS); -+ if (!s->univ_pred_cmds) -+ goto fail; -+- s->coeffs_buf = av_mallocz(sizeof(int16_t)*RPI_MAX_XFM_CMDS*16); -+- if (!s->coeffs_buf) -+- goto fail; -++ for(i = 0; i < 4; i++) { -++ gpu_malloc_uncached(sizeof(int16_t)*RPI_MAX_XFM_CMDS*16, &s->coeffs_buf[i]); // TODO slim this down and share across sizes -++ s->coeffs_buf_arm[i] = (int16_t*) s->coeffs_buf[i].arm; -++ if (!s->coeffs_buf_arm[i]) -++ goto fail; -++ } -+ s->enable_rpi = 0; -+ -+ // A little test program -+- { -++ /*{ -+ GPU_MEM_PTR_T p; -+ int err = gpu_malloc_cached(16, &p); -+ short *q = (short *)p.arm; -+@@ -3267,7 +3312,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ printf(")\n"); -+ gpu_free(&p); -+ goto fail; // Early out -+- } -++ }*/ -+ -+ #endif -+ -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 71174af..1e4c34c 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -39,6 +39,11 @@ -+ #include "thread.h" -+ #include "videodsp.h" -+ -++// define RPI to split the CABAC/prediction/transform into separate stages -++#ifdef RPI -++#include "rpi_qpu.h" -++#endif -++ -+ #define MAX_DPB_SIZE 16 // A.4.1 -+ #define MAX_REFS 16 -+ -+@@ -882,11 +887,12 @@ typedef struct HEVCContext { -+ HEVCMvCmd *unif_mv_cmds; -+ HEVCXfmCmd *unif_xfm_cmds; -+ HEVCPredCmd *univ_pred_cmds; -+- int16_t *coeffs_buf; -+- int num_mv_cmds; -++ GPU_MEM_PTR_T coeffs_buf[4]; -++ int16_t *coeffs_buf_arm[4]; -++ int num_coeffs[4]; -+ int num_xfm_cmds; -++ int num_mv_cmds; -+ int num_pred_cmds; -+- int num_coeffs; -+ #endif -+ -+ uint8_t *cabac_state; -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index c0fdfad..a7561bd 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1031,6 +1031,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ int vshift = s->ps.sps->vshift[c_idx]; -+ uint8_t *dst = &s->frame->data[c_idx][(y0 >> vshift) * stride + -+ ((x0 >> hshift) << s->ps.sps->pixel_shift)]; -++ int use_vpu = s->enable_rpi && !lc->cu.cu_transquant_bypass_flag && !transform_skip_flag && !lc->tu.cross_pf && log2_trafo_size==4; -+ int16_t *coeffs = (int16_t*)(c_idx ? lc->edge_emu_buffer2 : lc->edge_emu_buffer); -+ uint8_t significant_coeff_group_flag[8][8] = {{0}}; -+ int explicit_rdpcm_flag = 0; -+@@ -1044,6 +1045,18 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ uint8_t dc_scale; -+ int pred_mode_intra = (c_idx == 0) ? lc->tu.intra_pred_mode : -+ lc->tu.intra_pred_mode_c; -++#ifdef RPI -++ if (s->enable_rpi) { -++ int n = trafo_size * trafo_size; -++ if (use_vpu) { -++ coeffs = s->coeffs_buf_arm[log2_trafo_size - 2] + s->num_coeffs[log2_trafo_size - 2]; -++ s->num_coeffs[log2_trafo_size - 2] += n; -++ } else { -++ coeffs = s->coeffs_buf_arm[0] + s->num_coeffs[0]; -++ s->num_coeffs[0] += n; -++ } -++ } -++#endif -+ -+ memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -+ -+@@ -1488,6 +1501,24 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ } else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 && log2_trafo_size == 2) { -+ s->hevcdsp.idct_4x4_luma(coeffs); -+ } else { -++#ifdef RPI -++ if (!use_vpu) { -++ int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y); -++ if (max_xy == 0) -++ s->hevcdsp.idct_dc[log2_trafo_size-2](coeffs); -++ else { -++ int col_limit = last_significant_coeff_x + last_significant_coeff_y + 4; -++ if (max_xy < 4) -++ col_limit = FFMIN(4, col_limit); -++ else if (max_xy < 8) -++ col_limit = FFMIN(8, col_limit); -++ else if (max_xy < 12) -++ col_limit = FFMIN(24, col_limit); -++ -++ s->hevcdsp.idct[log2_trafo_size-2](coeffs, col_limit); -++ } -++ } -++#else -+ int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y); -+ if (max_xy == 0) -+ s->hevcdsp.idct_dc[log2_trafo_size-2](coeffs); -+@@ -1501,6 +1532,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ col_limit = FFMIN(24, col_limit); -+ s->hevcdsp.idct[log2_trafo_size-2](coeffs, col_limit); -+ } -++#endif -+ } -+ } -+ if (lc->tu.cross_pf) { -+@@ -1512,14 +1544,11 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ } -+ #ifdef RPI -+ if (s->enable_rpi) { -+- int16_t *c = s->coeffs_buf + s->num_coeffs; -+- int n = trafo_size * trafo_size; -+ HEVCPredCmd *cmd = s->univ_pred_cmds + s->num_pred_cmds++; -+- memcpy(c, coeffs, n * sizeof(int16_t)); // TODO change pointer earlier and we can avoid this copy -+- s->num_coeffs += n; -++ //memcpy(coeffs2, coeffs, sizeof(int16_t) * trafo_size * trafo_size); // TODO -+ cmd->type = RPI_PRED_TRANSFORM_ADD; -+ cmd->size = log2_trafo_size; -+- cmd->buf = c; -++ cmd->buf = coeffs; -+ cmd->dst = dst; -+ cmd->stride = stride; -+ return; -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 1f33b0c..e4c3da7 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -22,6 +22,10 @@ -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -++//#define DISABLE_SAO -++//#define DISABLE_DEBLOCK -++//#define DISABLE_STRENGTHS -++ -+ #include "libavutil/common.h" -+ #include "libavutil/internal.h" -+ -+@@ -273,6 +277,10 @@ static void sao_filter_CTB(HEVCContext *s, int x, int y) -+ edges[2] = x_ctb == s->ps.sps->ctb_width - 1; -+ edges[3] = y_ctb == s->ps.sps->ctb_height - 1; -+ -++#ifdef DISABLE_SAO -++ return; -++#endif -++ -+ if (restore) { -+ if (!edges[0]) { -+ left_tile_edge = no_tile_filter && s->ps.pps->tile_id[ctb_addr_ts] != s->ps.pps->tile_id[s->ps.pps->ctb_addr_rs_to_ts[ctb_addr_rs-1]]; -+@@ -496,6 +504,10 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->ps.sps->pcm.loop_filter_disable_flag) || -+ s->ps.pps->transquant_bypass_enable_flag; -+ -++#ifdef DISABLE_DEBLOCK -++ return; -++#endif -++ -+ if (x0) { -+ left_tc_offset = s->deblock[ctb - 1].tc_offset; -+ left_beta_offset = s->deblock[ctb - 1].beta_offset; -+@@ -726,6 +738,10 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ int boundary_upper, boundary_left; -+ int i, j, bs; -+ -++#ifdef DISABLE_STRENGTHS -++ return; -++#endif -++ -+ boundary_upper = y0 > 0 && !(y0 & 7); -+ if (boundary_upper && -+ ((!s->sh.slice_loop_filter_across_slices_enabled_flag && -+diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c -+index 6ae87cc..71c6d52 100644 -+--- a/libavcodec/hevcpred_template.c -++++ b/libavcodec/hevcpred_template.c -+@@ -20,6 +20,8 @@ -+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ */ -+ -++//#define DISABLE_INTRA -++ -+ #include "libavutil/pixdesc.h" -+ -+ #include "bit_depth_template.c" -+@@ -114,6 +116,10 @@ do { \ -+ int top_right_size = (FFMIN(x0 + 2 * size_in_luma_h, s->ps.sps->width) - -+ (x0 + size_in_luma_h)) >> hshift; -+ -++#ifdef DISABLE_INTRA -++ return; -++#endif -++ -+ if (s->ps.pps->constrained_intra_pred_flag == 1) { -+ int size_in_luma_pu_v = PU(size_in_luma_v); -+ int size_in_luma_pu_h = PU(size_in_luma_h); -+diff --git a/libavcodec/rpi_hevc_transform.h b/libavcodec/rpi_hevc_transform.h -+index 85a9102..c0c279f 100644 -+--- a/libavcodec/rpi_hevc_transform.h -++++ b/libavcodec/rpi_hevc_transform.h -+@@ -3,11 +3,11 @@ unsigned char rpi_hevc_transform [] = { -+ 3, -+ 3, -+ 232, -+-128, -++32, -+ 0, -+ 0, -+ 0, -+-20, -++12, -+ 248, -+ 0, -+ 136, -+@@ -56,9 +56,9 @@ unsigned char rpi_hevc_transform [] = { -+ 5, -+ 232, -+ 0, -+-0, -+ 8, -+ 0, -++0, -+ 128, -+ 69, -+ 113, -+@@ -108,8 +108,8 @@ unsigned char rpi_hevc_transform [] = { -+ 128, -+ 2, -+ 0, -+-248, -+-62, -++8, -++2, -+ 0, -+ 128, -+ 144, -+@@ -123,13 +123,13 @@ unsigned char rpi_hevc_transform [] = { -+ 3, -+ 32, -+ 8, -+-16, -++20, -+ 0, -+ 76, -+ 254, -+ 48, -+ 192, -+-9, -++4, -+ 4, -+ 32, -+ 8, -+@@ -155,14 +155,46 @@ unsigned char rpi_hevc_transform [] = { -+ 192, -+ 41, -+ 3, -+-68, -++70, -++192, -++80, -++7, -++164, -++255, -++36, -++204, -++96, -++2, -++0, -++248, -++62, -++0, -++3, -++255, -++55, -++208, -++120, -++3, -++224, -++3, -++190, -++11, -++16, -++139, -++246, -++91, -++0, -++103, -++90, -++0, -++70, -+ 192, -+ 80, -+ 7, -+ 164, -+ 255, -+ 36, -+-220, -++204, -+ 96, -+ 2, -+ 0, -+@@ -182,7 +214,7 @@ unsigned char rpi_hevc_transform [] = { -+ 16, -+ 139, -+ 246, -+-83, -++91, -+ 0, -+ 103, -+ 90, -+@@ -209,4 +241,374 @@ unsigned char rpi_hevc_transform [] = { -+ 96, -+ 90, -+ 0, -++169, -++3, -++3, -++232, -++32, -++0, -++0, -++0, -++12, -++248, -++0, -++136, -++0, -++0, -++192, -++248, -++0, -++0, -++64, -++232, -++0, -++2, -++0, -++0, -++12, -++248, -++0, -++168, -++0, -++0, -++192, -++248, -++0, -++0, -++3, -++232, -++128, -++0, -++0, -++0, -++7, -++232, -++0, -++2, -++0, -++0, -++4, -++232, -++64, -++0, -++0, -++0, -++5, -++232, -++0, -++8, -++0, -++0, -++57, -++239, -++224, -++247, -++255, -++255, -++72, -++192, -++95, -++207, -++88, -++122, -++88, -++124, -++137, -++64, -++26, -++64, -++161, -++64, -++152, -++64, -++128, -++144, -++31, -++0, -++72, -++232, -++32, -++0, -++0, -++0, -++65, -++232, -++32, -++0, -++0, -++0, -++128, -++144, -++23, -++0, -++145, -++64, -++168, -++64, -++128, -++144, -++19, -++0, -++72, -++232, -++32, -++0, -++0, -++0, -++65, -++232, -++32, -++0, -++0, -++0, -++128, -++144, -++11, -++0, -++74, -++232, -++0, -++8, -++0, -++0, -++242, -++140, -++229, -++192, -++57, -++239, -++32, -++8, -++0, -++0, -++41, -++3, -++12, -++248, -++0, -++128, -++0, -++0, -++192, -++8, -++4, -++0, -++12, -++248, -++0, -++132, -++64, -++0, -++192, -++8, -++4, -++0, -++0, -++96, -++255, -++159, -++131, -++255, -++0, -++232, -++0, -++4, -++0, -++0, -++255, -++159, -++142, -++255, -++4, -++255, -++48, -++204, -++16, -++3, -++224, -++251, -++62, -++0, -++5, -++255, -++51, -++204, -++128, -++3, -++224, -++251, -++16, -++0, -++77, -++254, -++51, -++204, -++9, -++4, -++224, -++251, -++0, -++0, -++128, -++64, -++6, -++232, -++64, -++0, -++0, -++0, -++140, -++248, -++47, -++0, -++0, -++0, -++224, -++99, -++0, -++0, -++4, -++254, -++0, -++144, -++128, -++2, -++0, -++8, -++2, -++0, -++32, -++247, -++240, -++207, -++16, -++3, -++32, -++247, -++176, -++207, -++17, -++3, -++32, -++247, -++112, -++207, -++18, -++3, -++32, -++247, -++48, -++207, -++19, -++3, -++32, -++247, -++240, -++206, -++20, -++3, -++32, -++247, -++176, -++206, -++21, -++3, -++32, -++247, -++112, -++206, -++22, -++3, -++32, -++247, -++48, -++206, -++23, -++3, -++32, -++247, -++240, -++205, -++24, -++3, -++32, -++247, -++176, -++205, -++25, -++3, -++32, -++247, -++112, -++205, -++26, -++3, -++32, -++247, -++48, -++205, -++27, -++3, -++32, -++247, -++240, -++204, -++28, -++3, -++32, -++247, -++176, -++204, -++29, -++3, -++32, -++247, -++112, -++204, -++30, -++3, -++32, -++247, -++48, -++204, -++31, -++3, -++5, -++255, -++51, -++204, -++128, -++3, -++224, -++251, -++16, -++0, -++77, -++254, -++51, -++204, -++9, -++4, -++224, -++251, -++0, -++0, -++0, -++237, -++0, -++4, -++0, -++0, -++140, -++248, -++47, -++0, -++0, -++0, -++224, -++99, -++0, -++0, -++90, -++0, -+ }; -+diff --git a/libavcodec/rpi_hevc_transform.s b/libavcodec/rpi_hevc_transform.s -+index 5e2728d..1e389c7 100644 -+--- a/libavcodec/rpi_hevc_transform.s -++++ b/libavcodec/rpi_hevc_transform.s -+@@ -58,13 +58,6 @@ -+ # -+ # -+ -+-test_add: -+- vldh HX(0,0),(r0) -+- vadd HX(0,0),HX(0,0),10 -+- vsth HX(0,0),(r0) -+- mov r0,7 # return value -+- b lr -+- -+ # Columns are transformed first -+ # -+ # Store top left half of transMatrix2 in -+@@ -79,7 +72,7 @@ test_add: -+ # -+ -+ -+-# hevc_trans_16x16(short *transMatrix2, short *coeffs, int num) -++# hevc_trans_16x16(short *transMatrix2, short *coeffs, int num) # TODO add size so we can branch to correct implementation (or perhaps have coeffs32 and num32 as secondary inputs!) -+ # transMatrix2: address of the constant matrix (must be at 32 byte aligned address in Videocore memory) -+ # coeffs: address of the transform coefficients (must be at 32 byte aligned address in Videocore memory) -+ # num: number of 16x16 transforms to be done -+@@ -87,17 +80,17 @@ test_add: -+ hevc_trans_16x16: -+ push r6-r15, lr # TODO cut down number of used registers -+ -+- mov r3, 2*32*2 # Twice Stride of transMatrix2 in bytes -+- vld HX(32++,0),(r0 += r3) REP 16 # This is the 16x16 matrix, a transform is equivalent to multiplying input row vector * matrix -++ mov r3, 16*2 # Stride of transMatrix2 in bytes -++ vldh HX(32++,0),(r0 += r3) REP 16 # This is the 16x16 matrix, a transform is equivalent to multiplying input row vector * matrix -+ # Now use r0 to describe which matrix we are working on. -+ # Allows us to prefetch the next block of coefficients for efficiency. -+ mov r0,0 # This describes the location where we read our coefficients from -+- mov r3,16*2 # Stride of coefficients in bytes -++ mov r3,16*2 # Stride of coefficients in bytes (TODO remove) -+ mov r7,16*16*2 # Total block size -+ mov r8,64*16 # Value used to swap from current to next VRF location -+ vldh HX(0++,0)+r0,(r1 += r3) REP 16 -+ mov r4,64 # Constant used for rounding first pass -+- mov r5,1<<19 # Constant used for rounding second pass -++ mov r5,1<<11 # Constant used for rounding second pass -+ -+ # At start of block r0,r1 point to the current block (that has already been loaded) -+ block_loop: -+@@ -113,12 +106,12 @@ block_loop: -+ vadd HY(0++,0)+r0,HY(0++,0)+r0,r4 REP 16 # Now add on rounding, shift down by 7, and saturate -+ #vsasls HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # 9+7=16 so this ends up with the output saturated and in the top half of the word. -+ vasl HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # This should be saturating, but the instruction above does not assemble? -+- vmov VX(0,0++), HX(0++,32) REP 16 # For simplicity transpose this back to the original position -++ vmov VX(0,0++)+r0, HX(0++,32)+r0 REP 16 # For simplicity transpose this back to the original position -+ -+ bl col_trans_16 -+- vadd HY(0++,0)+r0,HY(0++,0)+r0,r4 REP 16 # Now add on rounding, shift down by 7, and saturate -+- #vsasls HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # 9+7=16 so this ends up with the output saturated and in the top half of the word. -+- vasl HY(0++,0)+r0,HY(0++,0)+r0,9 REP 16 # This should be saturating, but the instruction above does not assemble? -++ vadd HY(0++,0)+r0,HY(0++,0)+r0,r5 REP 16 # Now add on rounding, shift down by 7, and saturate -++ #vsasls HY(0++,0)+r0,HY(0++,0)+r0,4 REP 16 # 4+12=16 so this ends up with the output saturated and in the top half of the word. -++ vasl HY(0++,0)+r0,HY(0++,0)+r0,4 REP 16 # This should be saturating, but the instruction above does not assemble? (Probably because it ends with ls which is interpreted as a condition flag) -+ -+ # Save results - note there has been a transposition during the processing so we save columns -+ vsth VX(0,32++)+r0, (r1 += r3) REP 16 -+@@ -132,16 +125,136 @@ block_loop: -+ -+ # r1,r2,r3 r7,r8 should be preserved -+ # HX(0++,0)+r0 is the block to be transformed -+-# HX(32++,0) is the 16x16 matrix of transform coefficients -++# HX(32++,0)+r6 is the 16x16 matrix of transform coefficients -+ # Use HY(48,0) for intermediate results -+ # r0 can be used, but should be returned to its original value at the end -+ col_trans_16: -+- add r4,r0,16 # Final value for this loop -++ add r6,r0,16 # Final value for this loop -+ col_trans_16_loop: -+ # First compute partial products for a single column -+- vmul32s VY(48,0++), VX(0,0)+r0, VX(32,0++) REP 16 -++ vmul32s HY(48++,0), VX(0,0)+r0, VX(32,0++) REP 16 -+ # Then sum up the results and place back -+ vadd VY(0,0)+r0, VY(48,0++), VY(48,8++) REP 8 CLRA SACC -+- addcmpblt r0,1,r4,col_trans_16_loop -++ addcmpblt r0,1,r6,col_trans_16_loop -+ sub r0,16 # but r0 back to its original value -+ b lr -++ -++col_trans_odd_16: -++ add r6,r0,16 # Final value for this loop -++col_trans_odd_16_loop: -++ # First compute partial products for a single column -++ vmul32s HY(48++,0), VX(0,0)+r0, VX(32,0++) REP 16 -++ # Then sum up the results and place back -++ vadd VY(0,0)+r0, VY(48,0++), VY(48,8++) REP 8 CLRA SACC -++ addcmpblt r0,1,r6,col_trans_odd_16_loop -++ sub r0,16 # but r0 back to its original value -++ b lr -++ -++ -++test_add: -++ vldh HX(0,0),(r0) -++ vadd HX(0,0),HX(0,0),10 -++ vsth HX(0,0),(r0) -++ mov r0,7 # return value -++ b lr -++ -++# hevc_trans_32x32(short *transMatrix2, short *coeffs, int num) -++# transMatrix2: address of the constant matrix (must be at 32 byte aligned address in Videocore memory) Even followed by odd -++# coeffs: address of the transform coefficients (must be at 32 byte aligned address in Videocore memory) -++# num: number of 16x16 transforms to be done -++# -++hevc_trans_32x32: -++ push r6-r15, lr # TODO cut down number of used registers -++ -++ # Fetch transform matrices -++ mov r3, 16*2 # Stride of transMatrix2 in bytes (and of coefficients) -++ vldh HX(32++,0),(r0 += r3) REP 16 # This is the even 16x16 matrix -++ add r0, 16*16*2 -++ vldh HX(32++,32),(r0 += r3) REP 16 # This is the odd 16x16 matrix -++ -++ mov r3, 32*2*2 # Stride used to fetch alternate rows of our input coefficient buffer -++ mov r7, 16*16*2 # Total block size -++ mov r4, 64 # Constant used for rounding first pass -++ mov r5, 1<<11 # Constant used for rounding second pass -++ sub sp,sp,32*32*2+32 # Allocate some space on the stack for us to store 32*32 shorts as temporary results (needs to be aligned) -++ # set r8 to 32byte aligned stack pointer -++ add r8,sp,31 -++ lsr r8,5 -++ lsl r8,5 -++ mov r9,r8 # Backup of the temporary storage -++ mov r10,r1 # Backup of the coefficient buffer -++block_loop32: -++ -++ # COLUMN TRANSFORM -++ # Transform the first 16 columns -++ mov r1,r10 # Input Coefficient buffer -++ mov r8,r9 # Output temporary storage -++ bl trans32 -++ # Transform the second 16 columns -++ add r8,32 -++ add r1,32 -++ bl trans32 -++ -++ # ROW TRANSFORM -++ mov r1,r9 # Input temporary storage -++ mov r8,r10 # Output Coefficient buffer -++ bl trans32 -++ # Transform the second 16 columns -++ add r8,32 -++ add r1,32 -++ bl trans32 -++ -++ add r10, 32*32*2 # move onto next block of coefficients -++ addcmpbgt r2,-1,0,block_loop32 -++ -++ add sp,sp,32*32*2+32 # Restore stack -++ -++ pop r6-r15, pc -++ -++trans32: -++ # We can no longer afford the VRF space to do prefetching when doing 32x32 -++ # Fetch the even rows -++ vldh HX(0++,0)+r0,(r1 += r3) REP 16 -++ # Fetch the odd rows -++ vldh HX(16++,0)+r0,64(r1 += r3) REP 16 # First odd row is 32 shorts ahead of r1 -++ -++ # Transform the even rows using even matrix -++ mov r0, 0 # Even rows -++ bl col_trans_16 -++ -++ # Now transform the odd rows using odd matrix -++ mov r0, 64*16 # Odd rows -++ bl col_trans_odd_16 -++ -++ # Now apply butterfly to compute the first 16 results -++ vadd HY(48++,0),HY(0++,0),HY(16++,0) REP 16 -++ vadd HY(48++,0),HY(48++,0),r4 REP 32 # add on rounding, -++ vasl HY(48++,0),HY(48++,0),9 REP 32 # shift down by 7, and saturate -++ # 16bit results now in HX(48,32) -++ mov r0,r8 -++ mov r6,32*2 -++ vsth VX(48,32++),(r0+=r6) REP 16 -++ vmov VX(0,0++)+r0, HX(0++,32)+r0 REP 16 # Store transposed -++ -++ # Now apply butterfly to compute the second 16 results (in reverse order) -++ vsub HY(63,0),HY(0,0),HY(16,0) -++ vsub HY(62,0),HY(0,0),HY(17,0) -++ vsub HY(61,0),HY(0,0),HY(18,0) -++ vsub HY(60,0),HY(0,0),HY(19,0) -++ vsub HY(59,0),HY(0,0),HY(20,0) -++ vsub HY(58,0),HY(0,0),HY(21,0) -++ vsub HY(57,0),HY(0,0),HY(22,0) -++ vsub HY(56,0),HY(0,0),HY(23,0) -++ vsub HY(55,0),HY(0,0),HY(24,0) -++ vsub HY(54,0),HY(0,0),HY(25,0) -++ vsub HY(53,0),HY(0,0),HY(26,0) -++ vsub HY(52,0),HY(0,0),HY(27,0) -++ vsub HY(51,0),HY(0,0),HY(28,0) -++ vsub HY(50,0),HY(0,0),HY(29,0) -++ vsub HY(49,0),HY(0,0),HY(30,0) -++ vsub HY(48,0),HY(0,0),HY(31,0) -++ vadd HY(48++,0),HY(48++,0),r4 REP 32 # add on rounding, -++ vasl HY(48++,0),HY(48++,0),9 REP 32 # shift down by 7, and saturate -++ add r0,r8,16*32*2 # Move to 16th row -++ vsth VX(48,32++),(r0+=r6) REP 16 -++ b lr -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index b1f50ee..d720546 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -3,6 +3,7 @@ -+ // This works better than the mmap in that the memory can be cached, but requires a kernel modification to enable the device. -+ #define RPI_USE_VCSM -+ #define RPI_TIME_TOTAL_QPU -++#define RPI_TIME_TOTAL_VPU -+ -+ #include -+ #include -+@@ -48,10 +49,47 @@ typedef int int32_t; -+ #define QPU_CODE_SIZE 2048 -+ #define VPU_CODE_SIZE 2048 -+ -++const short rpi_transMatrix2even[32][16] = { // Even rows first -++{64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64}, -++{90, 87, 80, 70, 57, 43, 25, 9, -9, -25, -43, -57, -70, -80, -87, -90}, -++{89, 75, 50, 18, -18, -50, -75, -89, -89, -75, -50, -18, 18, 50, 75, 89}, -++{87, 57, 9, -43, -80, -90, -70, -25, 25, 70, 90, 80, 43, -9, -57, -87}, -++{83, 36, -36, -83, -83, -36, 36, 83, 83, 36, -36, -83, -83, -36, 36, 83}, -++{80, 9, -70, -87, -25, 57, 90, 43, -43, -90, -57, 25, 87, 70, -9, -80}, -++{75, -18, -89, -50, 50, 89, 18, -75, -75, 18, 89, 50, -50, -89, -18, 75}, -++{70, -43, -87, 9, 90, 25, -80, -57, 57, 80, -25, -90, -9, 87, 43, -70}, -++{64, -64, -64, 64, 64, -64, -64, 64, 64, -64, -64, 64, 64, -64, -64, 64}, -++{57, -80, -25, 90, -9, -87, 43, 70, -70, -43, 87, 9, -90, 25, 80, -57}, -++{50, -89, 18, 75, -75, -18, 89, -50, -50, 89, -18, -75, 75, 18, -89, 50}, -++{43, -90, 57, 25, -87, 70, 9, -80, 80, -9, -70, 87, -25, -57, 90, -43}, -++{36, -83, 83, -36, -36, 83, -83, 36, 36, -83, 83, -36, -36, 83, -83, 36}, -++{25, -70, 90, -80, 43, 9, -57, 87, -87, 57, -9, -43, 80, -90, 70, -25}, -++{18, -50, 75, -89, 89, -75, 50, -18, -18, 50, -75, 89, -89, 75, -50, 18}, -++{ 9, -25, 43, -57, 70, -80, 87, -90, 90, -87, 80, -70, 57, -43, 25, -9}, -++// Odd rows -++{90, 90, 88, 85, 82, 78, 73, 67, 61, 54, 46, 38, 31, 22, 13, 4}, -++{90, 82, 67, 46, 22, -4, -31, -54, -73, -85, -90, -88, -78, -61, -38, -13}, -++{88, 67, 31, -13, -54, -82, -90, -78, -46, -4, 38, 73, 90, 85, 61, 22}, -++{85, 46, -13, -67, -90, -73, -22, 38, 82, 88, 54, -4, -61, -90, -78, -31}, -++{82, 22, -54, -90, -61, 13, 78, 85, 31, -46, -90, -67, 4, 73, 88, 38}, -++{78, -4, -82, -73, 13, 85, 67, -22, -88, -61, 31, 90, 54, -38, -90, -46}, -++{73, -31, -90, -22, 78, 67, -38, -90, -13, 82, 61, -46, -88, -4, 85, 54}, -++{67, -54, -78, 38, 85, -22, -90, 4, 90, 13, -88, -31, 82, 46, -73, -61}, -++{61, -73, -46, 82, 31, -88, -13, 90, -4, -90, 22, 85, -38, -78, 54, 67}, -++{54, -85, -4, 88, -46, -61, 82, 13, -90, 38, 67, -78, -22, 90, -31, -73}, -++{46, -90, 38, 54, -90, 31, 61, -88, 22, 67, -85, 13, 73, -82, 4, 78}, -++{38, -88, 73, -4, -67, 90, -46, -31, 85, -78, 13, 61, -90, 54, 22, -82}, -++{31, -78, 90, -61, 4, 54, -88, 82, -38, -22, 73, -90, 67, -13, -46, 85}, -++{22, -61, 85, -90, 73, -38, -4, 46, -78, 90, -82, 54, -13, -31, 67, -88}, -++{13, -38, 61, -78, 88, -90, 85, -73, 54, -31, 4, 22, -46, 67, -82, 90}, -++{ 4, -13, 22, -31, 38, -46, 54, -61, 67, -73, 78, -82, 85, -88, 90, -90} -++}; -++ -+ struct GPU -+ { -+ unsigned int qpu_code[QPU_CODE_SIZE]; -+ unsigned int vpu_code[VPU_CODE_SIZE]; -++ short transMatrix2even[16*16]; -+ int open_count; // Number of allocated video buffers -+ unsigned int vc_handle; // Handle of this memory -+ int mb; // Mailbox handle -+@@ -123,6 +161,8 @@ static int gpu_init(volatile struct GPU **gpu) { -+ assert(num_bytes<=VPU_CODE_SIZE*sizeof(unsigned int)); -+ memcpy((void*)ptr->vpu_code, rpi_hevc_transform, num_bytes); -+ } -++ // And the transform coefficients -++ memcpy((void*)ptr->transMatrix2even, rpi_transMatrix2even, 16*16*sizeof(short)); -+ -+ return 0; -+ } -+@@ -274,11 +314,43 @@ unsigned int vpu_get_fn(void) { -+ return gpu->vc + offsetof(struct GPU,vpu_code); -+ } -+ -++unsigned int vpu_get_constants(void) { -++ if (gpu==NULL) { -++ gpu_lock(); -++ gpu_unlock(); -++ } -++ return gpu->vc + offsetof(struct GPU,transMatrix2even); -++} -++ -+ unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5) -+ { -+ unsigned r; -++#ifdef RPI_TIME_TOTAL_VPU -++ static int last_time=0; -++ static long long on_time=0; -++ static long long off_time=0; -++ int start_time; -++ int end_time; -++ static int count=0; -++ static long long countr2=0; -++#endif -+ gpu_lock(); -++#ifdef RPI_TIME_TOTAL_VPU -++ start_time = Microseconds(); -++ if (last_time==0) -++ last_time = start_time; -++ off_time += start_time-last_time; -++#endif -+ r = execute_code(gpu->mb, code, r0, r1, r2, r3, r4, r5); -++#ifdef RPI_TIME_TOTAL_VPU -++ end_time = Microseconds(); -++ last_time = end_time; -++ on_time += end_time - start_time; -++ count++; -++ countr2 += r2; -++ if ((count&0x7f)==0) -++ printf("VPU %d %lld On=%dms, Off=%dms\n",count,countr2,(int)(on_time/1000),(int)(off_time/1000)); -++#endif -+ gpu_unlock(); -+ return r; -+ } -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 4e3c35c..814fc3c 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -34,6 +34,7 @@ extern unsigned int qpu_get_fn(int num); -+ -+ // VPU specific functions -+ extern unsigned int vpu_get_fn(void); -++extern unsigned int vpu_get_constants(void); -+ extern unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5); -+ -+ // Simple test of shader code -+-- -+2.5.0 -+ -+ -+From 4732d45788d56c44bda51c0cb12be912df89dab7 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 5 May 2015 09:41:23 +0100 -+Subject: [PATCH 05/68] Fixed deblocking -+ -+--- -+ libavcodec/hevc.c | 20 +++++++++++++++++--- -+ 1 file changed, 17 insertions(+), 3 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 79678ea..862f915 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2389,8 +2389,9 @@ static void rpi_execute_transform(HEVCContext *s) -+ // s->hevcdsp.idct[4-2](coeffs, 16); -+ //} -+ -+- //gpu_cache_flush(&s->coeffs_buf[i]); -++ gpu_cache_flush(&s->coeffs_buf[i]); -+ vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf[i].vc, s->num_coeffs[i] >> 8, 0, 0, 0); -++ gpu_cache_flush(&s->coeffs_buf[i]); -+ -+ for(i=0;i<4;i++) -+ s->num_coeffs[i] = 0; -+@@ -2429,6 +2430,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; -+ -+ #ifdef RPI -++ int start_ctb_x = (s->sh.slice_ctb_addr_rs % ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size; -+ s->enable_rpi = 1; // TODO this should depend on cross component and frame width etc. -+ #endif -+ -+@@ -2462,9 +2464,17 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -+ #ifdef RPI -+- if (1 || x_ctb + ctb_size >= s->ps.sps->width) { // TODO watch out for deblocking! -++ if (s->enable_rpi && x_ctb + ctb_size >= s->ps.sps->width) { -++ int x; -++ // Transform all blocks -+ rpi_execute_transform(s); -++ // Perform intra prediction and residual reconstruction -+ rpi_execute_pred_cmds(s); -++ // Perform deblocking for CTBs in this row -++ for(x = start_ctb_x; x <= x_ctb; x += ctb_size) { // TODO this will fail for tiles -++ ff_hevc_hls_filters(s, x, y_ctb, ctb_size); -++ } -++ start_ctb_x = 0; -+ } -+ #endif -+ if (more_data < 0) { -+@@ -2475,6 +2485,10 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ -+ ctb_addr_ts++; -+ ff_hevc_save_states(s, ctb_addr_ts); -++#ifdef RPI -++ if (s->enable_rpi) -++ continue; -++#endif -+ ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size); -+ } -+ -+@@ -3283,7 +3297,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ if (!s->univ_pred_cmds) -+ goto fail; -+ for(i = 0; i < 4; i++) { -+- gpu_malloc_uncached(sizeof(int16_t)*RPI_MAX_XFM_CMDS*16, &s->coeffs_buf[i]); // TODO slim this down and share across sizes -++ gpu_malloc_cached(sizeof(int16_t)*RPI_MAX_XFM_CMDS*16, &s->coeffs_buf[i]); // TODO slim this down and share across sizes -+ s->coeffs_buf_arm[i] = (int16_t*) s->coeffs_buf[i].arm; -+ if (!s->coeffs_buf_arm[i]) -+ goto fail; -+-- -+2.5.0 -+ -+ -+From ddb4cf90d99f2e213de85244cd8e751570d794a8 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 5 May 2015 11:32:30 +0100 -+Subject: [PATCH 06/68] Added 32x32 transform -+ -+--- -+ libavcodec/hevc.c | 8 +- -+ libavcodec/hevc_cabac.c | 4 +- -+ libavcodec/rpi_hevc_transform.h | 200 +++++++++++++++++----------------------- -+ libavcodec/rpi_hevc_transform.s | 102 ++++++++++---------- -+ libavcodec/rpi_qpu.c | 4 +- -+ 5 files changed, 148 insertions(+), 170 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 862f915..fe71e03 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2389,9 +2389,11 @@ static void rpi_execute_transform(HEVCContext *s) -+ // s->hevcdsp.idct[4-2](coeffs, 16); -+ //} -+ -+- gpu_cache_flush(&s->coeffs_buf[i]); -+- vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf[i].vc, s->num_coeffs[i] >> 8, 0, 0, 0); -+- gpu_cache_flush(&s->coeffs_buf[i]); -++ gpu_cache_flush(&s->coeffs_buf[2]); -++ gpu_cache_flush(&s->coeffs_buf[3]); -++ vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf[2].vc, s->num_coeffs[2] >> 8, s->coeffs_buf[3].vc, s->num_coeffs[3] >> 10, 0); -++ gpu_cache_flush(&s->coeffs_buf[2]); -++ gpu_cache_flush(&s->coeffs_buf[3]); -+ -+ for(i=0;i<4;i++) -+ s->num_coeffs[i] = 0; -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index a7561bd..3e6dabf 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1031,7 +1031,9 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ int vshift = s->ps.sps->vshift[c_idx]; -+ uint8_t *dst = &s->frame->data[c_idx][(y0 >> vshift) * stride + -+ ((x0 >> hshift) << s->ps.sps->pixel_shift)]; -+- int use_vpu = s->enable_rpi && !lc->cu.cu_transquant_bypass_flag && !transform_skip_flag && !lc->tu.cross_pf && log2_trafo_size==4; -++#ifdef RPI -++ int use_vpu = s->enable_rpi && !lc->cu.cu_transquant_bypass_flag && !transform_skip_flag && !lc->tu.cross_pf && log2_trafo_size>=4; -++#endif -+ int16_t *coeffs = (int16_t*)(c_idx ? lc->edge_emu_buffer2 : lc->edge_emu_buffer); -+ uint8_t significant_coeff_group_flag[8][8] = {{0}}; -+ int explicit_rdpcm_flag = 0; -+diff --git a/libavcodec/rpi_hevc_transform.h b/libavcodec/rpi_hevc_transform.h -+index c0c279f..6d772d7 100644 -+--- a/libavcodec/rpi_hevc_transform.h -++++ b/libavcodec/rpi_hevc_transform.h -+@@ -1,6 +1,10 @@ -+ unsigned char rpi_hevc_transform [] = { -+ 169, -+ 3, -++62, -++64, -++79, -++64, -+ 3, -+ 232, -+ 32, -+@@ -17,6 +21,22 @@ unsigned char rpi_hevc_transform [] = { -+ 248, -+ 0, -+ 0, -++64, -++232, -++0, -++2, -++0, -++0, -++12, -++248, -++0, -++168, -++0, -++0, -++192, -++248, -++0, -++0, -+ 0, -+ 96, -+ 3, -+@@ -79,7 +99,7 @@ unsigned char rpi_hevc_transform [] = { -+ 70, -+ 128, -+ 144, -+-39, -++40, -+ 0, -+ 4, -+ 255, -+@@ -113,7 +133,7 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 128, -+ 144, -+-22, -++23, -+ 0, -+ 4, -+ 255, -+@@ -153,6 +173,8 @@ unsigned char rpi_hevc_transform [] = { -+ 140, -+ 211, -+ 192, -++34, -++31, -+ 41, -+ 3, -+ 70, -+@@ -195,7 +217,7 @@ unsigned char rpi_hevc_transform [] = { -+ 255, -+ 36, -+ 204, -+-96, -++224, -+ 2, -+ 0, -+ 248, -+@@ -219,62 +241,10 @@ unsigned char rpi_hevc_transform [] = { -+ 103, -+ 90, -+ 0, -+-8, -+-240, -+-0, -+-128, -+-128, -+-3, -+-0, -+-247, -+-32, -+-128, -+-10, -+-4, -+-136, -+-240, -+-32, -+-0, -+-128, -+-3, -+-112, -+-96, -+-90, -+-0, -+-169, -+-3, -+-3, -+-232, -+-32, -+-0, -+-0, -+-0, -+-12, -+-248, -+-0, -+-136, -+-0, -+-0, -+-192, -+-248, -+-0, -+-0, -++225, -++64, -++242, -+ 64, -+-232, -+-0, -+-2, -+-0, -+-0, -+-12, -+-248, -+-0, -+-168, -+-0, -+-0, -+-192, -+-248, -+-0, -+-0, -+ 3, -+ 232, -+ 128, -+@@ -287,18 +257,6 @@ unsigned char rpi_hevc_transform [] = { -+ 2, -+ 0, -+ 0, -+-4, -+-232, -+-64, -+-0, -+-0, -+-0, -+-5, -+-232, -+-0, -+-8, -+-0, -+-0, -+ 57, -+ 239, -+ 224, -+@@ -317,18 +275,26 @@ unsigned char rpi_hevc_transform [] = { -+ 64, -+ 26, -+ 64, -++4, -++232, -++64, -++0, -++0, -++0, -++149, -++96, -+ 161, -+ 64, -+ 152, -+ 64, -+ 128, -+ 144, -+-31, -++35, -+ 0, -+ 72, -+ 232, -+-32, -+ 0, -++4, -+ 0, -+ 0, -+ 65, -+@@ -339,8 +305,16 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 128, -+ 144, -+-23, -++27, -++0, -++4, -++232, -++0, -++8, -+ 0, -++0, -++69, -++96, -+ 145, -+ 64, -+ 168, -+@@ -351,8 +325,8 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 72, -+ 232, -+-32, -+ 0, -++4, -+ 0, -+ 0, -+ 65, -+@@ -373,7 +347,7 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 242, -+ 140, -+-229, -++221, -+ 192, -+ 57, -+ 239, -+@@ -383,6 +357,8 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 41, -+ 3, -++239, -++3, -+ 12, -+ 248, -+ 0, -+@@ -390,7 +366,7 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 0, -+ 192, -+-8, -++248, -+ 4, -+ 0, -+ 12, -+@@ -400,14 +376,14 @@ unsigned char rpi_hevc_transform [] = { -+ 64, -+ 0, -+ 192, -+-8, -++248, -+ 4, -+ 0, -+ 0, -+ 96, -+ 255, -+ 159, -+-131, -++154, -+ 255, -+ 0, -+ 232, -+@@ -417,7 +393,7 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 255, -+ 159, -+-142, -++165, -+ 255, -+ 4, -+ 255, -+@@ -429,7 +405,7 @@ unsigned char rpi_hevc_transform [] = { -+ 251, -+ 62, -+ 0, -+-5, -++4, -+ 255, -+ 51, -+ 204, -+@@ -439,15 +415,15 @@ unsigned char rpi_hevc_transform [] = { -+ 251, -+ 16, -+ 0, -+-77, -++76, -+ 254, -+ 51, -+ 204, -+-9, -+-4, -++128, -++3, -+ 224, -+ 251, -+-0, -++20, -+ 0, -+ 128, -+ 64, -+@@ -467,16 +443,6 @@ unsigned char rpi_hevc_transform [] = { -+ 99, -+ 0, -+ 0, -+-4, -+-254, -+-0, -+-144, -+-128, -+-2, -+-0, -+-8, -+-2, -+-0, -+ 32, -+ 247, -+ 240, -+@@ -488,92 +454,92 @@ unsigned char rpi_hevc_transform [] = { -+ 176, -+ 207, -+ 17, -+-3, -++19, -+ 32, -+ 247, -+ 112, -+ 207, -+ 18, -+-3, -++35, -+ 32, -+ 247, -+ 48, -+ 207, -+ 19, -+-3, -++51, -+ 32, -+ 247, -+ 240, -+ 206, -+ 20, -+-3, -++67, -+ 32, -+ 247, -+ 176, -+ 206, -+ 21, -+-3, -++83, -+ 32, -+ 247, -+ 112, -+ 206, -+ 22, -+-3, -++99, -+ 32, -+ 247, -+ 48, -+ 206, -+ 23, -+-3, -++115, -+ 32, -+ 247, -+ 240, -+ 205, -+ 24, -+-3, -++131, -+ 32, -+ 247, -+ 176, -+ 205, -+ 25, -+-3, -++147, -+ 32, -+ 247, -+ 112, -+ 205, -+ 26, -+-3, -++163, -+ 32, -+ 247, -+ 48, -+ 205, -+ 27, -+-3, -++179, -+ 32, -+ 247, -+ 240, -+ 204, -+ 28, -+-3, -++195, -+ 32, -+ 247, -+ 176, -+ 204, -+ 29, -+-3, -++211, -+ 32, -+ 247, -+ 112, -+ 204, -+ 30, -+-3, -++227, -+ 32, -+ 247, -+ 48, -+ 204, -+ 31, -+-3, -+-5, -++243, -++4, -+ 255, -+ 51, -+ 204, -+@@ -583,20 +549,20 @@ unsigned char rpi_hevc_transform [] = { -+ 251, -+ 16, -+ 0, -+-77, -++76, -+ 254, -+ 51, -+ 204, -+-9, -+-4, -++128, -++3, -+ 224, -+ 251, -+-0, -++20, -+ 0, -+ 0, -+ 237, -++32, -+ 0, -+-4, -+ 0, -+ 0, -+ 140, -+@@ -609,6 +575,6 @@ unsigned char rpi_hevc_transform [] = { -+ 99, -+ 0, -+ 0, -+-90, -+-0, -++111, -++3, -+ }; -+diff --git a/libavcodec/rpi_hevc_transform.s b/libavcodec/rpi_hevc_transform.s -+index 1e389c7..afdb32a 100644 -+--- a/libavcodec/rpi_hevc_transform.s -++++ b/libavcodec/rpi_hevc_transform.s -+@@ -76,12 +76,19 @@ -+ # transMatrix2: address of the constant matrix (must be at 32 byte aligned address in Videocore memory) -+ # coeffs: address of the transform coefficients (must be at 32 byte aligned address in Videocore memory) -+ # num: number of 16x16 transforms to be done -++# coeffs32 -++# num32: number of 32x32 transforms -+ # -+ hevc_trans_16x16: -+ push r6-r15, lr # TODO cut down number of used registers -+- -++ mov r14,r3 # coeffs32 -++ mov r15,r4 # num32 -+ mov r3, 16*2 # Stride of transMatrix2 in bytes -+ vldh HX(32++,0),(r0 += r3) REP 16 # This is the 16x16 matrix, a transform is equivalent to multiplying input row vector * matrix -++ -++ add r0, 16*16*2 # For 32x32 transforms we also need this matrix -++ vldh HX(32++,32),(r0 += r3) REP 16 # This is the odd 16x16 matrix -++ -+ # Now use r0 to describe which matrix we are working on. -+ # Allows us to prefetch the next block of coefficients for efficiency. -+ mov r0,0 # This describes the location where we read our coefficients from -+@@ -121,6 +128,10 @@ block_loop: -+ add r1,r7 -+ -+ addcmpbgt r2,-1,0,block_loop -++ -++ # Now go and do any 32x32 transforms -++ b hevc_trans_32x32 -++ -+ pop r6-r15, pc -+ -+ # r1,r2,r3 r7,r8 should be preserved -+@@ -136,26 +147,18 @@ col_trans_16_loop: -+ # Then sum up the results and place back -+ vadd VY(0,0)+r0, VY(48,0++), VY(48,8++) REP 8 CLRA SACC -+ addcmpblt r0,1,r6,col_trans_16_loop -+- sub r0,16 # but r0 back to its original value -++ sub r0,16 # put r0 back to its original value -+ b lr -+ -+ col_trans_odd_16: -+ add r6,r0,16 # Final value for this loop -+ col_trans_odd_16_loop: -+ # First compute partial products for a single column -+- vmul32s HY(48++,0), VX(0,0)+r0, VX(32,0++) REP 16 -++ vmul32s HY(48++,0), VX(0,0)+r0, VX(32,32++) REP 16 -+ # Then sum up the results and place back -+ vadd VY(0,0)+r0, VY(48,0++), VY(48,8++) REP 8 CLRA SACC -+ addcmpblt r0,1,r6,col_trans_odd_16_loop -+- sub r0,16 # but r0 back to its original value -+- b lr -+- -+- -+-test_add: -+- vldh HX(0,0),(r0) -+- vadd HX(0,0),HX(0,0),10 -+- vsth HX(0,0),(r0) -+- mov r0,7 # return value -++ sub r0,16 # put r0 back to its original value -+ b lr -+ -+ # hevc_trans_32x32(short *transMatrix2, short *coeffs, int num) -+@@ -164,18 +167,17 @@ test_add: -+ # num: number of 16x16 transforms to be done -+ # -+ hevc_trans_32x32: -+- push r6-r15, lr # TODO cut down number of used registers -++ mov r1,r14 # coeffs -++ mov r2,r15 # num -+ -+- # Fetch transform matrices -+- mov r3, 16*2 # Stride of transMatrix2 in bytes (and of coefficients) -+- vldh HX(32++,0),(r0 += r3) REP 16 # This is the even 16x16 matrix -+- add r0, 16*16*2 -+- vldh HX(32++,32),(r0 += r3) REP 16 # This is the odd 16x16 matrix -++ # Fetch odd transform matrix -++ #mov r3, 16*2 # Stride of transMatrix2 in bytes (and of coefficients) -++ #vldh HX(32++,0),(r0 += r3) REP 16 # This is the even 16x16 matrix -++ #add r0, 16*16*2 -++ #vldh HX(32++,32),(r0 += r3) REP 16 # This is the odd 16x16 matrix -+ -+ mov r3, 32*2*2 # Stride used to fetch alternate rows of our input coefficient buffer -+ mov r7, 16*16*2 # Total block size -+- mov r4, 64 # Constant used for rounding first pass -+- mov r5, 1<<11 # Constant used for rounding second pass -+ sub sp,sp,32*32*2+32 # Allocate some space on the stack for us to store 32*32 shorts as temporary results (needs to be aligned) -+ # set r8 to 32byte aligned stack pointer -+ add r8,sp,31 -+@@ -186,21 +188,27 @@ hevc_trans_32x32: -+ block_loop32: -+ -+ # COLUMN TRANSFORM -++ mov r4, 64 # Constant used for rounding first pass -++ mov r5, 9 # left shift used for rounding first pass -++ -+ # Transform the first 16 columns -+ mov r1,r10 # Input Coefficient buffer -+ mov r8,r9 # Output temporary storage -+ bl trans32 -+ # Transform the second 16 columns -+- add r8,32 -++ add r8,32*16*2 -+ add r1,32 -+ bl trans32 -+ -+ # ROW TRANSFORM -++ mov r4, 1<<11 # Constant used for rounding second pass -++ mov r5, 4 # left shift used for rounding second pass -++ -+ mov r1,r9 # Input temporary storage -+ mov r8,r10 # Output Coefficient buffer -+ bl trans32 -+ # Transform the second 16 columns -+- add r8,32 -++ add r8,32*16*2 -+ add r1,32 -+ bl trans32 -+ -+@@ -212,11 +220,12 @@ block_loop32: -+ pop r6-r15, pc -+ -+ trans32: -++ push lr -+ # We can no longer afford the VRF space to do prefetching when doing 32x32 -+ # Fetch the even rows -+- vldh HX(0++,0)+r0,(r1 += r3) REP 16 -++ vldh HX(0++,0),(r1 += r3) REP 16 -+ # Fetch the odd rows -+- vldh HX(16++,0)+r0,64(r1 += r3) REP 16 # First odd row is 32 shorts ahead of r1 -++ vldh HX(16++,0),64(r1 += r3) REP 16 # First odd row is 32 shorts ahead of r1 -+ -+ # Transform the even rows using even matrix -+ mov r0, 0 # Even rows -+@@ -228,33 +237,32 @@ trans32: -+ -+ # Now apply butterfly to compute the first 16 results -+ vadd HY(48++,0),HY(0++,0),HY(16++,0) REP 16 -+- vadd HY(48++,0),HY(48++,0),r4 REP 32 # add on rounding, -+- vasl HY(48++,0),HY(48++,0),9 REP 32 # shift down by 7, and saturate -++ vadd HY(48++,0),HY(48++,0),r4 REP 16 # add on rounding, -++ vasl HY(48++,0),HY(48++,0),r5 REP 16 # shift down by 7, and saturate -+ # 16bit results now in HX(48,32) -+ mov r0,r8 -+ mov r6,32*2 -+ vsth VX(48,32++),(r0+=r6) REP 16 -+- vmov VX(0,0++)+r0, HX(0++,32)+r0 REP 16 # Store transposed -+ -+ # Now apply butterfly to compute the second 16 results (in reverse order) -+- vsub HY(63,0),HY(0,0),HY(16,0) -+- vsub HY(62,0),HY(0,0),HY(17,0) -+- vsub HY(61,0),HY(0,0),HY(18,0) -+- vsub HY(60,0),HY(0,0),HY(19,0) -+- vsub HY(59,0),HY(0,0),HY(20,0) -+- vsub HY(58,0),HY(0,0),HY(21,0) -+- vsub HY(57,0),HY(0,0),HY(22,0) -+- vsub HY(56,0),HY(0,0),HY(23,0) -+- vsub HY(55,0),HY(0,0),HY(24,0) -+- vsub HY(54,0),HY(0,0),HY(25,0) -+- vsub HY(53,0),HY(0,0),HY(26,0) -+- vsub HY(52,0),HY(0,0),HY(27,0) -+- vsub HY(51,0),HY(0,0),HY(28,0) -+- vsub HY(50,0),HY(0,0),HY(29,0) -+- vsub HY(49,0),HY(0,0),HY(30,0) -+- vsub HY(48,0),HY(0,0),HY(31,0) -+- vadd HY(48++,0),HY(48++,0),r4 REP 32 # add on rounding, -+- vasl HY(48++,0),HY(48++,0),9 REP 32 # shift down by 7, and saturate -+- add r0,r8,16*32*2 # Move to 16th row -++ vsub HY(63,0),HY(0 ,0),HY(16,0) -++ vsub HY(62,0),HY(1 ,0),HY(17,0) -++ vsub HY(61,0),HY(2 ,0),HY(18,0) -++ vsub HY(60,0),HY(3 ,0),HY(19,0) -++ vsub HY(59,0),HY(4 ,0),HY(20,0) -++ vsub HY(58,0),HY(5 ,0),HY(21,0) -++ vsub HY(57,0),HY(6 ,0),HY(22,0) -++ vsub HY(56,0),HY(7 ,0),HY(23,0) -++ vsub HY(55,0),HY(8 ,0),HY(24,0) -++ vsub HY(54,0),HY(9 ,0),HY(25,0) -++ vsub HY(53,0),HY(10,0),HY(26,0) -++ vsub HY(52,0),HY(11,0),HY(27,0) -++ vsub HY(51,0),HY(12,0),HY(28,0) -++ vsub HY(50,0),HY(13,0),HY(29,0) -++ vsub HY(49,0),HY(14,0),HY(30,0) -++ vsub HY(48,0),HY(15,0),HY(31,0) -++ vadd HY(48++,0),HY(48++,0),r4 REP 16 # add on rounding, -++ vasl HY(48++,0),HY(48++,0),r5 REP 16 # shift down by 7, and saturate -++ add r0,r8,32 -+ vsth VX(48,32++),(r0+=r6) REP 16 -+- b lr -++ pop pc -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index d720546..12ad5fb 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -89,7 +89,7 @@ struct GPU -+ { -+ unsigned int qpu_code[QPU_CODE_SIZE]; -+ unsigned int vpu_code[VPU_CODE_SIZE]; -+- short transMatrix2even[16*16]; -++ short transMatrix2even[16*16*2]; -+ int open_count; // Number of allocated video buffers -+ unsigned int vc_handle; // Handle of this memory -+ int mb; // Mailbox handle -+@@ -162,7 +162,7 @@ static int gpu_init(volatile struct GPU **gpu) { -+ memcpy((void*)ptr->vpu_code, rpi_hevc_transform, num_bytes); -+ } -+ // And the transform coefficients -+- memcpy((void*)ptr->transMatrix2even, rpi_transMatrix2even, 16*16*sizeof(short)); -++ memcpy((void*)ptr->transMatrix2even, rpi_transMatrix2even, sizeof(rpi_transMatrix2even)); -+ -+ return 0; -+ } -+-- -+2.5.0 -+ -+ -+From cb4444b27d7e1d38d42375f52cd3741c2ebbe4ec Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 5 May 2015 16:57:03 +0100 -+Subject: [PATCH 07/68] Clear coefficients in advance -+ -+--- -+ libavcodec/hevc.c | 129 ++++++++++++++++++++++++++++------------ -+ libavcodec/hevc.h | 6 +- -+ libavcodec/hevc_cabac.c | 7 ++- -+ libavcodec/rpi_hevc_transform.h | 50 ++++++++++++++++ -+ libavcodec/rpi_hevc_transform.s | 16 +++++ -+ 5 files changed, 168 insertions(+), 40 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index fe71e03..8b93ca2 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -43,6 +43,8 @@ -+ -+ #ifdef RPI -+ #include "rpi_qpu.h" -++// For some unknown reason, the code seems to crash if I do a late malloc -++#define EARLY_MALLOC -+ #endif -+ -+ // #define DISABLE_MC -+@@ -61,6 +63,20 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ /* free everything allocated by pic_arrays_init() */ -+ static void pic_arrays_free(HEVCContext *s) -+ { -++#ifdef RPI -++#ifdef EARLY_MALLOC -++#else -++ printf("pic_arrays_free\n"); -++ if (s->coeffs_buf_arm[0]) { -++ gpu_free(&s->coeffs_buf_default); -++ s->coeffs_buf_arm[0] = 0; -++ } -++ if (s->coeffs_buf_arm[2]) { -++ gpu_free(&s->coeffs_buf_accelerated); -++ s->coeffs_buf_arm[2] = 0; -++ } -++#endif -++#endif -+ av_freep(&s->sao); -+ av_freep(&s->deblock); -+ -+@@ -97,6 +113,28 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ int ctb_count = sps->ctb_width * sps->ctb_height; -+ int min_pu_size = sps->min_pu_width * sps->min_pu_height; -+ -++#ifdef RPI -++#ifdef EARLY_MALLOC -++#else -++ int coeffs_in_ctb = (1 << s->ps.sps->log2_ctb_size) * (1 << s->ps.sps->log2_ctb_size); -++ int coefs_per_row = sps->ctb_width * coeffs_in_ctb * 3; // Allow space for chroma -++ printf("pic_arrays_init\n"); -++ printf("Allocated %d\n",coefs_per_row); -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -++ s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -++ if (!s->coeffs_buf_arm[0]) -++ goto fail; -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated); -++ s->coeffs_buf_arm[2] = (int16_t*) s->coeffs_buf_accelerated.arm; -++ s->coeffs_buf_vc[2] = s->coeffs_buf_accelerated.vc; -++ if (!s->coeffs_buf_arm[2]) -++ goto fail; -++ s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -++ s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -++ printf("Done\n"); -++#endif -++#endif -++ -+ s->bs_width = (width >> 2) + 1; -+ s->bs_height = (height >> 2) + 1; -+ -+@@ -2389,11 +2427,10 @@ static void rpi_execute_transform(HEVCContext *s) -+ // s->hevcdsp.idct[4-2](coeffs, 16); -+ //} -+ -+- gpu_cache_flush(&s->coeffs_buf[2]); -+- gpu_cache_flush(&s->coeffs_buf[3]); -+- vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf[2].vc, s->num_coeffs[2] >> 8, s->coeffs_buf[3].vc, s->num_coeffs[3] >> 10, 0); -+- gpu_cache_flush(&s->coeffs_buf[2]); -+- gpu_cache_flush(&s->coeffs_buf[3]); -++ -++ gpu_cache_flush(&s->coeffs_buf_accelerated); -++ vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0); -++ //gpu_cache_flush(&s->coeffs_buf_accelerated); -+ -+ for(i=0;i<4;i++) -+ s->num_coeffs[i] = 0; -+@@ -2415,7 +2452,9 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ lc->na.cand_up_right = (cmd->na >> 0) & 1; -+ s->hpc.intra_pred[cmd->size - 2](s, cmd->x, cmd->y, cmd->c_idx); -+ } else { -++ int trafo_size = 1 << cmd->size; -+ s->hevcdsp.transform_add[cmd->size-2](cmd->dst, cmd->buf, cmd->stride); -++ memset(cmd->buf, 0, trafo_size * trafo_size * sizeof(int16_t)); // Clear coefficients here while they are in the cache -+ } -+ } -+ s->num_pred_cmds = 0; -+@@ -3224,10 +3263,18 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ av_freep(&s->unif_mv_cmds); -+ av_freep(&s->unif_xfm_cmds); -+ av_freep(&s->univ_pred_cmds); -+- for(i = 0; i < 4; i++) { -+- gpu_free(&s->coeffs_buf[i]); -++ -++#ifdef EARLY_MALLOC -++ if (s->coeffs_buf_arm[0]) { -++ gpu_free(&s->coeffs_buf_default); -++ s->coeffs_buf_arm[0] = 0; -++ } -++ if (s->coeffs_buf_arm[2]) { -++ gpu_free(&s->coeffs_buf_accelerated); -++ s->coeffs_buf_arm[2] = 0; -+ } -+ #endif -++#endif -+ -+ for (i = 0; i < 3; i++) { -+ av_freep(&s->sao_pixel_buffer_h[i]); -+@@ -3275,6 +3322,16 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ return 0; -+ } -+ -++#ifdef RPI -++static av_cold void memclear16(int16_t *p, int n) -++{ -++ vpu_execute_code( vpu_get_fn(), p, n, 0, 0, 0, 1); -++ //int i; -++ //for(i=0;ipriv_data; -+@@ -3298,37 +3355,35 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ s->univ_pred_cmds = av_mallocz(sizeof(HEVCPredCmd)*RPI_MAX_PRED_CMDS); -+ if (!s->univ_pred_cmds) -+ goto fail; -+- for(i = 0; i < 4; i++) { -+- gpu_malloc_cached(sizeof(int16_t)*RPI_MAX_XFM_CMDS*16, &s->coeffs_buf[i]); // TODO slim this down and share across sizes -+- s->coeffs_buf_arm[i] = (int16_t*) s->coeffs_buf[i].arm; -+- if (!s->coeffs_buf_arm[i]) -+- goto fail; -+- } -+- s->enable_rpi = 0; -+ -+- // A little test program -+- /*{ -+- GPU_MEM_PTR_T p; -+- int err = gpu_malloc_cached(16, &p); -+- short *q = (short *)p.arm; -+- int i; -+- int r; -+- printf("Allocated memory %d ARM 0x%x, VC 0x%x, Code 0x%x\n",err,(int)p.arm,p.vc,(int)vpu_get_fn()); -+- printf("Allocated memory %d ARM 0x%x, VC 0x%x\n",err,(int)p.arm,p.vc); -+- printf("Preparing data %p\n",q); -+- for(i=0;i<16;i++) -+- q[i] = i; -+- printf("Flush cache\n"); -+- gpu_cache_flush(&p); -+- printf("Executing code\n"); -+- r = vpu_execute_code( vpu_get_fn(), p.vc, 0, 0, 0, 0, 0); -+- printf("Return value %d (",r); -+- for(i=0;i<16;i++) -+- printf("%d ",q[i]); -+- printf(")\n"); -+- gpu_free(&p); -+- goto fail; // Early out -+- }*/ -++ s->coeffs_buf_arm[0] = 0; -++ s->coeffs_buf_arm[2] = 0; -++ -++#ifdef EARLY_MALLOC -++ int coeffs_in_ctb = 64*64; -++ int coefs_per_row = (2048/64) * coeffs_in_ctb * 3; // Allow space for chroma -++ printf("Allocated %d\n",coefs_per_row); -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -++ s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -++ if (!s->coeffs_buf_arm[0]) -++ goto fail; -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated); -++ s->coeffs_buf_arm[2] = (int16_t*) s->coeffs_buf_accelerated.arm; -++ s->coeffs_buf_vc[2] = s->coeffs_buf_accelerated.vc; -++ if (!s->coeffs_buf_arm[2]) -++ goto fail; -++ s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -++ s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -++ printf("Done\n"); -++ //memset(s->coeffs_buf_arm[0],0, sizeof(int16_t) * coefs_per_row); -++ memclear16(s->coeffs_buf_arm[0], coefs_per_row); -++ //memset(s->coeffs_buf_arm[2],0, sizeof(int16_t) * coefs_per_row); -++ memclear16(s->coeffs_buf_arm[2], coefs_per_row); -++ //memset(s->coeffs_buf_arm[3],0, sizeof(int16_t) * coefs_per_row); -++ memclear16(s->coeffs_buf_arm[3], coefs_per_row); -++#endif -++ -++ s->enable_rpi = 0; -+ -+ #endif -+ -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 1e4c34c..e240b5c 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -887,8 +887,12 @@ typedef struct HEVCContext { -+ HEVCMvCmd *unif_mv_cmds; -+ HEVCXfmCmd *unif_xfm_cmds; -+ HEVCPredCmd *univ_pred_cmds; -+- GPU_MEM_PTR_T coeffs_buf[4]; -++ int buf_width; -++ GPU_MEM_PTR_T coeffs_buf_default; -++ GPU_MEM_PTR_T coeffs_buf_accelerated; -+ int16_t *coeffs_buf_arm[4]; -++ unsigned int coeffs_buf_vc[4]; -++ -+ int num_coeffs[4]; -+ int num_xfm_cmds; -+ int num_mv_cmds; -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index 3e6dabf..a295d3e 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1058,9 +1058,13 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ s->num_coeffs[0] += n; -+ } -+ } -++ // We now do the memset after transform_add while we know the data is cached. -++ //memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -++#else -++ memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -+ #endif -+ -+- memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -++ -+ -+ // Derive QP for dequant -+ if (!lc->cu.cu_transquant_bypass_flag) { -+@@ -1547,7 +1551,6 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ #ifdef RPI -+ if (s->enable_rpi) { -+ HEVCPredCmd *cmd = s->univ_pred_cmds + s->num_pred_cmds++; -+- //memcpy(coeffs2, coeffs, sizeof(int16_t) * trafo_size * trafo_size); // TODO -+ cmd->type = RPI_PRED_TRANSFORM_ADD; -+ cmd->size = log2_trafo_size; -+ cmd->buf = coeffs; -+diff --git a/libavcodec/rpi_hevc_transform.h b/libavcodec/rpi_hevc_transform.h -+index 6d772d7..4f13622 100644 -+--- a/libavcodec/rpi_hevc_transform.h -++++ b/libavcodec/rpi_hevc_transform.h -+@@ -1,4 +1,10 @@ -+ unsigned char rpi_hevc_transform [] = { -++21, -++106, -++0, -++144, -++35, -++1, -+ 169, -+ 3, -+ 62, -+@@ -577,4 +583,48 @@ unsigned char rpi_hevc_transform [] = { -+ 0, -+ 111, -+ 3, -++4, -++254, -++0, -++128, -++0, -++4, -++0, -++248, -++0, -++0, -++2, -++232, -++32, -++0, -++0, -++0, -++140, -++248, -++32, -++0, -++0, -++0, -++224, -++35, -++0, -++0, -++64, -++232, -++0, -++2, -++0, -++0, -++193, -++232, -++0, -++1, -++0, -++0, -++1, -++106, -++116, -++30, -++90, -++0, -+ }; -+diff --git a/libavcodec/rpi_hevc_transform.s b/libavcodec/rpi_hevc_transform.s -+index afdb32a..fd159bc 100644 -+--- a/libavcodec/rpi_hevc_transform.s -++++ b/libavcodec/rpi_hevc_transform.s -+@@ -78,8 +78,11 @@ -+ # num: number of 16x16 transforms to be done -+ # coeffs32 -+ # num32: number of 32x32 transforms -++# command 0 for transform, 1 for memclear16(int16_t *dst,num16) -+ # -+ hevc_trans_16x16: -++ cmp r5,1 -++ beq memclear16 -+ push r6-r15, lr # TODO cut down number of used registers -+ mov r14,r3 # coeffs32 -+ mov r15,r4 # num32 -+@@ -266,3 +269,16 @@ trans32: -+ add r0,r8,32 -+ vsth VX(48,32++),(r0+=r6) REP 16 -+ pop pc -++ -++memclear16: -++ # r0 is address -++ # r1 is number of 16bits values to set to 0 (may overrun past end and clear more than specified) -++ vmov HX(0++,0),0 REP 16 -++ mov r2,32 -++loop: -++ vsth HX(0++,0),(r0+=r2) REP 16 -++ add r0,16*16*2 -++ sub r1,16*16 -++ cmp r1,0 -++ bgt loop -++ b lr -+-- -+2.5.0 -+ -+ -+From 3328a46c648542e5281088576dffac413de7a19d Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 6 May 2015 09:56:43 +0100 -+Subject: [PATCH 08/68] Prepared inter offload -+ -+--- -+ libavcodec/hevc.c | 116 +++++++++++++++++++++++++++++++++++++++++++----- -+ libavcodec/hevc.h | 29 +++++++++++- -+ libavcodec/hevc_cabac.c | 5 ++- -+ 3 files changed, 137 insertions(+), 13 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 8b93ca2..59f5d15 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -45,6 +45,8 @@ -+ #include "rpi_qpu.h" -+ // For some unknown reason, the code seems to crash if I do a late malloc -+ #define EARLY_MALLOC -++// Move Inter prediction into separate pass -++//#define RPI_INTER -+ #endif -+ -+ // #define DISABLE_MC -+@@ -1429,6 +1431,95 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size) -+ * @param luma_offset additive offset applied to the luma prediction value -+ */ -+ -++#ifdef RPI_INTER -++#define RPI_REDIRECT(fn) rpi_ ## fn -++static void rpi_luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -++ AVFrame *ref, const Mv *mv, int x_off, int y_off, -++ int block_w, int block_h, int luma_weight, int luma_offset) -++{ -++ HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ cmd->cmd = RPI_CMD_LUMA_UNI; -++ cmd->dst = dst; -++ cmd->dststride = dststride; -++ cmd->src = ref->data[0]; -++ cmd->srcstride = ref->linesize[0]; -++ cmd->mv = *mv; -++ cmd->x_off = x_off; -++ cmd->y_off = y_off; -++ cmd->block_w = block_w; -++ cmd->block_h = block_h; -++ cmd->weight = luma_weight; -++ cmd->offset = luma_offset; -++} -++ -++static void rpi_luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -++ AVFrame *ref0, const Mv *mv0, int x_off, int y_off, -++ int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) -++{ -++ HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ cmd->cmd = RPI_CMD_LUMA_BI; -++ cmd->dst = dst; -++ cmd->dststride = dststride; -++ cmd->src = ref->data[0]; -++ cmd->srcstride = ref->linesize[0]; -++ cmd->mv = *mv; -++ cmd->x_off = x_off; -++ cmd->y_off = y_off; -++ cmd->block_w = block_w; -++ cmd->block_h = block_h; -++ cmd->weight = luma_weight; -++ cmd->offset = luma_offset; -++ cmd->src1 = ref1->data[]; -++ cmd->srcstride1 = ref1->linesize[0]; -++ cmd->mv1 = *mv1; -++ cmd->ref_idx[0] = current_mv->ref_idx[0]; -++ cmd->ref_idx[1] = current_mv->ref_idx[1]; -++} -++ -++static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -++ ptrdiff_t dststride, uint8_t *src0, ptrdiff_t srcstride, int reflist, -++ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int chroma_weight, int chroma_offset) -++{ -++ HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ cmd->cmd = RPI_CMD_CHROMA_UNI; -++ cmd->dst = dst0; -++ cmd->dststride = dststride; -++ cmd->src = src0; -++ cmd->srcstride = srcstride; -++ cmd->mv = current_mv->mv[reflist]; -++ cmd->x_off = x_off; -++ cmd->y_off = y_off; -++ cmd->block_w = block_w; -++ cmd->block_h = block_h; -++ cmd->weight = chroma_weight; -++ cmd->offset = chroma_offset; -++} -++ -++static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1, -++ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx) -++{ -++ HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ cmd->cmd = RPI_CMD_CHROMA_BI+cidx; -++ cmd->dst = dst0; -++ cmd->dststride = dststride; -++ cmd->src = ref0->data[cidx+1]; -++ cmd->srcstride = ref0->linesize[cidx+1]; -++ cmd->mv = current_mv->mv[reflist]; -++ cmd->x_off = x_off; -++ cmd->y_off = y_off; -++ cmd->block_w = block_w; -++ cmd->block_h = block_h; -++ cmd->weight = chroma_weight; -++ cmd->offset = chroma_offset; -++ cmd->src = ref1->data[cidx+1]; -++ cmd->srcstride1 = ref1->linesize[cidx+1]; -++ cmd->ref_idx[0] = current_mv->ref_idx[0]; -++ cmd->ref_idx[1] = current_mv->ref_idx[1]; -++} -++#else -++#define RPI_REDIRECT(fn) fn -++#endif -++ -+ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref, const Mv *mv, int x_off, int y_off, -+ int block_w, int block_h, int luma_weight, int luma_offset) -+@@ -1494,7 +1585,7 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ * @param mv1 motion vector1 (relative to block position) to get pixel data from -+ * @param current_mv current motion vector structure -+ */ -+- static void luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -++static void luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref0, const Mv *mv0, int x_off, int y_off, -+ int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) -+ { -+@@ -1876,16 +1967,16 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; -+ int nPbH_c = nPbH >> s->ps.sps->vshift[1]; -+ -+- luma_mc_uni(s, dst0, s->frame->linesize[0], ref0->frame, -++ RPI_REDIRECT(luma_mc_uni)(s, dst0, s->frame->linesize[0], ref0->frame, -+ ¤t_mv.mv[0], x0, y0, nPbW, nPbH, -+ s->sh.luma_weight_l0[current_mv.ref_idx[0]], -+ s->sh.luma_offset_l0[current_mv.ref_idx[0]]); -+ -+ if (s->ps.sps->chroma_format_idc) { -+- chroma_mc_uni(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1], -++ RPI_REDIRECT(chroma_mc_uni)(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1], -+ 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, -+ s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]); -+- chroma_mc_uni(s, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2], -++ RPI_REDIRECT(chroma_mc_uni)(s, dst2, s->frame->linesize[2], ref0->frame->data[2], ref0->frame->linesize[2], -+ 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, -+ s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1]); -+ } -+@@ -1895,17 +1986,17 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; -+ int nPbH_c = nPbH >> s->ps.sps->vshift[1]; -+ -+- luma_mc_uni(s, dst0, s->frame->linesize[0], ref1->frame, -++ RPI_REDIRECT(luma_mc_uni)(s, dst0, s->frame->linesize[0], ref1->frame, -+ ¤t_mv.mv[1], x0, y0, nPbW, nPbH, -+ s->sh.luma_weight_l1[current_mv.ref_idx[1]], -+ s->sh.luma_offset_l1[current_mv.ref_idx[1]]); -+ -+ if (s->ps.sps->chroma_format_idc) { -+- chroma_mc_uni(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1], -++ RPI_REDIRECT(chroma_mc_uni)(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1], -+ 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, -+ s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]); -+ -+- chroma_mc_uni(s, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2], -++ RPI_REDIRECT(chroma_mc_uni)(s, dst2, s->frame->linesize[2], ref1->frame->data[2], ref1->frame->linesize[2], -+ 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, -+ s->sh.chroma_weight_l1[current_mv.ref_idx[1]][1], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][1]); -+ } -+@@ -1915,15 +2006,15 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; -+ int nPbH_c = nPbH >> s->ps.sps->vshift[1]; -+ -+- luma_mc_bi(s, dst0, s->frame->linesize[0], ref0->frame, -++ RPI_REDIRECT(luma_mc_bi)(s, dst0, s->frame->linesize[0], ref0->frame, -+ ¤t_mv.mv[0], x0, y0, nPbW, nPbH, -+ ref1->frame, ¤t_mv.mv[1], ¤t_mv); -+ -+ if (s->ps.sps->chroma_format_idc) { -+- chroma_mc_bi(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame, -++ RPI_REDIRECT(chroma_mc_bi)(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame, -+ x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0); -+ -+- chroma_mc_bi(s, dst2, s->frame->linesize[2], ref0->frame, ref1->frame, -++ RPI_REDIRECT(chroma_mc_bi)(s, dst2, s->frame->linesize[2], ref0->frame, ref1->frame, -+ x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 1); -+ } -+ } -+@@ -2454,7 +2545,9 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ } else { -+ int trafo_size = 1 << cmd->size; -+ s->hevcdsp.transform_add[cmd->size-2](cmd->dst, cmd->buf, cmd->stride); -++#ifdef RPI_PRECLEAR -+ memset(cmd->buf, 0, trafo_size * trafo_size * sizeof(int16_t)); // Clear coefficients here while they are in the cache -++#endif -+ } -+ } -+ s->num_pred_cmds = 0; -+@@ -3375,6 +3468,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -+ s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -+ printf("Done\n"); -++#ifdef RPI_PRECLEAR -+ //memset(s->coeffs_buf_arm[0],0, sizeof(int16_t) * coefs_per_row); -+ memclear16(s->coeffs_buf_arm[0], coefs_per_row); -+ //memset(s->coeffs_buf_arm[2],0, sizeof(int16_t) * coefs_per_row); -+@@ -3383,6 +3477,8 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ memclear16(s->coeffs_buf_arm[3], coefs_per_row); -+ #endif -+ -++#endif -++ -+ s->enable_rpi = 0; -+ -+ #endif -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index e240b5c..a35ee4a 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -829,14 +829,39 @@ typedef struct HEVCLocalContext { -+ // RPI_MAX_WIDTH is maximum width in pixels supported by the accelerated code -+ #define RPI_MAX_WIDTH 2048 -+ -+-// Worst case is for 4:4:4 4x4 blocks with 64 high coding tree blocks, so 16 MV cmds per 4 pixels across for each colour plane -+-#define RPI_MAX_MV_CMDS (16*3*(RPI_MAX_WIDTH/4)) -++// Worst case is for 4:4:4 4x4 blocks with 64 high coding tree blocks, so 16 MV cmds per 4 pixels across for each colour plane, * 2 for bi -++#define RPI_MAX_MV_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -+ #define RPI_MAX_XFM_CMDS (16*3*(RPI_MAX_WIDTH/4)) -+ // Each block can have an intra prediction and a transform_add command -+ #define RPI_MAX_PRED_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -+ -++#define RPI_CMD_LUMA_UNI 0 -++#define RPI_CMD_CHROMA_UNI 1 -++#define RPI_CMD_LUMA_BI 2 -++#define RPI_CMD_U_BI 3 -++#define RPI_CMD_V_BI 4 -++ -++// RPI_PRECLEAR is not working yet - perhaps clearing on VPUs is flawed? -++// #define RPI_PRECLEAR -++ -+ // Command for inter prediction -+ typedef struct HEVCMvCmd { -++ int cmd; -++ uint8_t *dst; -++ ptrdiff_t dststride; -++ uint8_t *src; -++ ptrdiff_t srcstride; -++ Mv mv; -++ int x_off; -++ int y_off; -++ int block_w; -++ int block_h; -++ int weight; -++ int offset; -++ uint8_t *src1; -++ ptrdiff_t srcstride1; -++ Mv mv1; -++ int8_t ref_idx[2]; -+ } HEVCMvCmd; -+ -+ // Command for transform to process a block of coefficients -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index a295d3e..f28759b 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1059,7 +1059,10 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ } -+ } -+ // We now do the memset after transform_add while we know the data is cached. -+- //memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -++ #ifdef RPI_PRECLEAR -++ #else -++ memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -++ #endif -+ #else -+ memset(coeffs, 0, trafo_size * trafo_size * sizeof(int16_t)); -+ #endif -+-- -+2.5.0 -+ -+ -+From 191028358f7153c8598981673e6bd165acaa699d Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 6 May 2015 11:08:50 +0100 -+Subject: [PATCH 09/68] Inter prediction in separate pass -+ -+--- -+ libavcodec/hevc.c | 93 +++++++++++++++++++++++++++++++++++++++++++++---------- -+ libavcodec/hevc.h | 2 +- -+ 2 files changed, 77 insertions(+), 18 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 59f5d15..f60709e 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -46,7 +46,7 @@ -+ // For some unknown reason, the code seems to crash if I do a late malloc -+ #define EARLY_MALLOC -+ // Move Inter prediction into separate pass -+-//#define RPI_INTER -++#define RPI_INTER -+ #endif -+ -+ // #define DISABLE_MC -+@@ -1437,7 +1437,7 @@ static void rpi_luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref, const Mv *mv, int x_off, int y_off, -+ int block_w, int block_h, int luma_weight, int luma_offset) -+ { -+- HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -+ cmd->cmd = RPI_CMD_LUMA_UNI; -+ cmd->dst = dst; -+ cmd->dststride = dststride; -+@@ -1456,31 +1456,29 @@ static void rpi_luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref0, const Mv *mv0, int x_off, int y_off, -+ int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) -+ { -+- HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -+ cmd->cmd = RPI_CMD_LUMA_BI; -+ cmd->dst = dst; -+ cmd->dststride = dststride; -+- cmd->src = ref->data[0]; -+- cmd->srcstride = ref->linesize[0]; -+- cmd->mv = *mv; -++ cmd->src = ref0->data[0]; -++ cmd->srcstride = ref0->linesize[0]; -++ cmd->mv = *mv0; -+ cmd->x_off = x_off; -+ cmd->y_off = y_off; -+ cmd->block_w = block_w; -+ cmd->block_h = block_h; -+- cmd->weight = luma_weight; -+- cmd->offset = luma_offset; -+- cmd->src1 = ref1->data[]; -++ cmd->src1 = ref1->data[0]; -+ cmd->srcstride1 = ref1->linesize[0]; -+ cmd->mv1 = *mv1; -+ cmd->ref_idx[0] = current_mv->ref_idx[0]; -+ cmd->ref_idx[1] = current_mv->ref_idx[1]; -+ } -+ -+-static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -++static void rpi_chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -+ ptrdiff_t dststride, uint8_t *src0, ptrdiff_t srcstride, int reflist, -+ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int chroma_weight, int chroma_offset) -+ { -+- HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -+ cmd->cmd = RPI_CMD_CHROMA_UNI; -+ cmd->dst = dst0; -+ cmd->dststride = dststride; -+@@ -1495,27 +1493,27 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -+ cmd->offset = chroma_offset; -+ } -+ -+-static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1, -++static void rpi_chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1, -+ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx) -+ { -+- HEVCMvCmd *cmd = unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -+ cmd->cmd = RPI_CMD_CHROMA_BI+cidx; -+ cmd->dst = dst0; -+ cmd->dststride = dststride; -+ cmd->src = ref0->data[cidx+1]; -+ cmd->srcstride = ref0->linesize[cidx+1]; -+- cmd->mv = current_mv->mv[reflist]; -++ cmd->mv = current_mv->mv[0]; -++ cmd->mv1 = current_mv->mv[1]; -+ cmd->x_off = x_off; -+ cmd->y_off = y_off; -+ cmd->block_w = block_w; -+ cmd->block_h = block_h; -+- cmd->weight = chroma_weight; -+- cmd->offset = chroma_offset; -+- cmd->src = ref1->data[cidx+1]; -++ cmd->src1 = ref1->data[cidx+1]; -+ cmd->srcstride1 = ref1->linesize[cidx+1]; -+ cmd->ref_idx[0] = current_mv->ref_idx[0]; -+ cmd->ref_idx[1] = current_mv->ref_idx[1]; -+ } -++ -+ #else -+ #define RPI_REDIRECT(fn) fn -+ #endif -+@@ -2543,7 +2541,9 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ lc->na.cand_up_right = (cmd->na >> 0) & 1; -+ s->hpc.intra_pred[cmd->size - 2](s, cmd->x, cmd->y, cmd->c_idx); -+ } else { -++#ifdef RPI_PRECLEAR -+ int trafo_size = 1 << cmd->size; -++#endif -+ s->hevcdsp.transform_add[cmd->size-2](cmd->dst, cmd->buf, cmd->stride); -+ #ifdef RPI_PRECLEAR -+ memset(cmd->buf, 0, trafo_size * trafo_size * sizeof(int16_t)); // Clear coefficients here while they are in the cache -+@@ -2552,6 +2552,61 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ } -+ s->num_pred_cmds = 0; -+ } -++ -++static void rpi_execute_inter_cmds(HEVCContext *s) -++{ -++ HEVCMvCmd *cmd = s->unif_mv_cmds; -++ int n,cidx; -++ AVFrame myref; -++ AVFrame myref1; -++ struct MvField mymv; -++ if (s->num_mv_cmds > RPI_MAX_MV_CMDS) { -++ printf("Overflow inter_cmds\n"); -++ exit(-1); -++ } -++ for(n = s->num_mv_cmds; n>0 ; n--, cmd++) { -++ switch(cmd->cmd) { -++ case RPI_CMD_LUMA_UNI: -++ myref.data[0] = cmd->src; -++ myref.linesize[0] = cmd->srcstride; -++ luma_mc_uni(s, cmd->dst, cmd->dststride, &myref, &cmd->mv, cmd->x_off, cmd->y_off, cmd->block_w, cmd->block_h, cmd->weight, cmd->offset); -++ break; -++ case RPI_CMD_LUMA_BI: -++ myref.data[0] = cmd->src; -++ myref.linesize[0] = cmd->srcstride; -++ myref1.data[0] = cmd->src1; -++ myref1.linesize[0] = cmd->srcstride1; -++ mymv.ref_idx[0] = cmd->ref_idx[0]; -++ mymv.ref_idx[1] = cmd->ref_idx[1]; -++ luma_mc_bi(s, cmd->dst, cmd->dststride, -++ &myref, &cmd->mv, cmd->x_off, cmd->y_off, cmd->block_w, cmd->block_h, -++ &myref1, &cmd->mv1, &mymv); -++ break; -++ case RPI_CMD_CHROMA_UNI: -++ mymv.mv[0] = cmd->mv; -++ chroma_mc_uni(s, cmd->dst, -++ cmd->dststride, cmd->src, cmd->srcstride, 0, -++ cmd->x_off, cmd->y_off, cmd->block_w, cmd->block_h, &mymv, cmd->weight, cmd->offset); -++ break; -++ case RPI_CMD_CHROMA_BI: -++ case RPI_CMD_CHROMA_BI+1: -++ cidx = cmd->cmd - RPI_CMD_CHROMA_BI; -++ myref.data[cidx+1] = cmd->src; -++ myref.linesize[cidx+1] = cmd->srcstride; -++ myref1.data[cidx+1] = cmd->src1; -++ myref1.linesize[cidx+1] = cmd->srcstride1; -++ mymv.ref_idx[0] = cmd->ref_idx[0]; -++ mymv.ref_idx[1] = cmd->ref_idx[1]; -++ mymv.mv[0] = cmd->mv; -++ mymv.mv[1] = cmd->mv1; -++ chroma_mc_bi(s, cmd->dst, cmd->dststride, &myref, &myref1, -++ cmd->x_off, cmd->y_off, cmd->block_w, cmd->block_h, &mymv, cidx); -++ break; -++ } -++ } -++ s->num_mv_cmds = 0; -++} -++ -+ #endif -+ -+ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+@@ -2600,6 +2655,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #ifdef RPI -+ if (s->enable_rpi && x_ctb + ctb_size >= s->ps.sps->width) { -+ int x; -++ // Perform inter prediction -++ rpi_execute_inter_cmds(s); -+ // Transform all blocks -+ rpi_execute_transform(s); -+ // Perform intra prediction and residual reconstruction -+@@ -3416,6 +3473,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ } -+ -+ #ifdef RPI -++#ifdef RPI_PRECLEAR -+ static av_cold void memclear16(int16_t *p, int n) -+ { -+ vpu_execute_code( vpu_get_fn(), p, n, 0, 0, 0, 1); -+@@ -3424,6 +3482,7 @@ static av_cold void memclear16(int16_t *p, int n) -+ // p[i] = 0; -+ } -+ #endif -++#endif -+ -+ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ { -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index a35ee4a..e3046a2 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -838,7 +838,7 @@ typedef struct HEVCLocalContext { -+ #define RPI_CMD_LUMA_UNI 0 -+ #define RPI_CMD_CHROMA_UNI 1 -+ #define RPI_CMD_LUMA_BI 2 -+-#define RPI_CMD_U_BI 3 -++#define RPI_CMD_CHROMA_BI 3 -+ #define RPI_CMD_V_BI 4 -+ -+ // RPI_PRECLEAR is not working yet - perhaps clearing on VPUs is flawed? -+-- -+2.5.0 -+ -+ -+From cf8758aad96c2c71abd5f2feb8ff85b5ac191b60 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 6 May 2015 13:03:50 +0100 -+Subject: [PATCH 10/68] Added VPU thread -+ -+--- -+ libavcodec/hevc.c | 11 +++-- -+ libavcodec/hevc.h | 1 + -+ libavcodec/rpi_qpu.c | 125 +++++++++++++++++++++++++++++++++++++++++++++++++-- -+ libavcodec/rpi_qpu.h | 2 + -+ 4 files changed, 133 insertions(+), 6 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index f60709e..7b0d951 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2518,8 +2518,10 @@ static void rpi_execute_transform(HEVCContext *s) -+ -+ -+ gpu_cache_flush(&s->coeffs_buf_accelerated); -+- vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0); -++ s->vpu_id = vpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0, &s->coeffs_buf_accelerated); -++ //vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0); -+ //gpu_cache_flush(&s->coeffs_buf_accelerated); -++ //vpu_wait(s->vpu_id); -+ -+ for(i=0;i<4;i++) -+ s->num_coeffs[i] = 0; -+@@ -2655,10 +2657,12 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #ifdef RPI -+ if (s->enable_rpi && x_ctb + ctb_size >= s->ps.sps->width) { -+ int x; -+- // Perform inter prediction -+- rpi_execute_inter_cmds(s); -+ // Transform all blocks -+ rpi_execute_transform(s); -++ // Perform inter prediction -++ rpi_execute_inter_cmds(s); -++ // Wait for transform completion -++ vpu_wait(s->vpu_id); -+ // Perform intra prediction and residual reconstruction -+ rpi_execute_pred_cmds(s); -+ // Perform deblocking for CTBs in this row -+@@ -3415,6 +3419,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ av_freep(&s->univ_pred_cmds); -+ -+ #ifdef EARLY_MALLOC -++ printf("hevc_decode_free\n"); -+ if (s->coeffs_buf_arm[0]) { -+ gpu_free(&s->coeffs_buf_default); -+ s->coeffs_buf_arm[0] = 0; -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index e3046a2..89636e4 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -922,6 +922,7 @@ typedef struct HEVCContext { -+ int num_xfm_cmds; -+ int num_mv_cmds; -+ int num_pred_cmds; -++ int vpu_id; -+ #endif -+ -+ uint8_t *cabac_state; -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 12ad5fb..378dd74 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -1,9 +1,13 @@ -+ #ifdef RPI -+-// Use the vcsm device for shared memory -++// define RPI_USE_VCSM to use the vcsm device for shared memory -+ // This works better than the mmap in that the memory can be cached, but requires a kernel modification to enable the device. -+ #define RPI_USE_VCSM -+-#define RPI_TIME_TOTAL_QPU -+-#define RPI_TIME_TOTAL_VPU -++// define RPI_TIME_TOTAL_QPU to print out how much time is spent in the QPU code -++//#define RPI_TIME_TOTAL_QPU -++// define RPI_TIME_TOTAL_VPU to print out how much time is spent in the VPI code -++//#define RPI_TIME_TOTAL_VPU -++// define RPI_ASYNC to run the VPU in a separate thread, need to make a separate call to check for completion -++#define RPI_ASYNC -+ -+ #include -+ #include -+@@ -113,6 +117,19 @@ static unsigned int Microseconds(void) { -+ } -+ #endif -+ -++#ifdef RPI_ASYNC -++pthread_t vpu_thread; -++static void *vpu_start(void *arg); -++ -++#define MAXCMDS 128 -++static pthread_cond_t post_cond = PTHREAD_COND_INITIALIZER; -++static pthread_mutex_t post_mutex = PTHREAD_MUTEX_INITIALIZER; -++ -++static int vpu_cmds[MAXCMDS][8]; -++static volatile int vpu_async_tail=0; // Contains the number of posted jobs -++static volatile int vpu_async_head=0; -++#endif -++ -+ // Connect to QPU, returns 0 on success. -+ static int gpu_init(volatile struct GPU **gpu) { -+ int mb = mbox_open(); -+@@ -164,12 +181,27 @@ static int gpu_init(volatile struct GPU **gpu) { -+ // And the transform coefficients -+ memcpy((void*)ptr->transMatrix2even, rpi_transMatrix2even, sizeof(rpi_transMatrix2even)); -+ -++#ifdef RPI_ASYNC -++ { -++ int err; -++ vpu_async_tail = 0; -++ vpu_async_head = 0; -++ err = pthread_create(&vpu_thread, NULL, vpu_start, NULL); -++ //printf("Created thread\n"); -++ if (err) { -++ printf("Failed to create vpu thread\n"); -++ return -4; -++ } -++ } -++#endif -++ -+ return 0; -+ } -+ -+ // Make sure we have exclusive access to the mailbox, and enable qpu if necessary. -+ static void gpu_lock(void) { -+ pthread_mutex_lock(&gpu_mutex); -++ -+ if (gpu==NULL) { -+ gpu_init(&gpu); -+ } -+@@ -264,6 +296,16 @@ static void gpu_term(void) -+ unsigned handle = gpu->vc_handle; -+ if (gpu==NULL) -+ return; -++ -++#ifdef RPI_ASYNC -++ { -++ void *res; -++ vpu_post_code(0, 0, 0, 0, 0, 0, -1, NULL); -++ pthread_join(vpu_thread, &res); -++ } -++#endif -++ -++ -+ unmapmem((void*)gpu, sizeof(struct GPU)); -+ mem_unlock(mb, handle); -+ mem_free(mb, handle); -+@@ -322,6 +364,79 @@ unsigned int vpu_get_constants(void) { -+ return gpu->vc + offsetof(struct GPU,transMatrix2even); -+ } -+ -++#ifdef RPI_ASYNC -++ -++static void *vpu_start(void *arg) { -++ while(1) { -++ pthread_mutex_lock(&post_mutex); -++ while( vpu_async_tail - vpu_async_head <= 0) -++ { -++ //printf("Checking number %d %d\n",vpu_async_head,vpu_async_tail); -++ pthread_cond_wait(&post_cond, &post_mutex); -++ } -++ int *p = vpu_cmds[vpu_async_head%MAXCMDS]; -++ pthread_mutex_unlock(&post_mutex); -++ -++ if (p[6] == -1) { -++ break; // Last job -++ } -++ if (p[7]) { -++ GPU_MEM_PTR_T *buf = (GPU_MEM_PTR_T *)p[7]; -++ //gpu_cache_flush(buf); -++ } -++ vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -++ -++ pthread_mutex_lock(&post_mutex); -++ vpu_async_head++; -++ pthread_cond_broadcast(&post_cond); -++ pthread_mutex_unlock(&post_mutex); -++ } -++ -++ return NULL; -++} -++ -++// Post a command to the queue -++// Returns an id which we can use to wait for completion -++int vpu_post_code(unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, GPU_MEM_PTR_T *buf) -++{ -++ pthread_mutex_lock(&post_mutex); -++ { -++ int id = vpu_async_tail++; -++ int *p = vpu_cmds[id%MAXCMDS]; -++ int num = vpu_async_tail - vpu_async_head; -++ if (num>MAXCMDS) { -++ printf("Too many commands submitted\n"); -++ exit(-1); -++ } -++ p[0] = code; -++ p[1] = r0; -++ p[2] = r1; -++ p[3] = r2; -++ p[4] = r3; -++ p[5] = r4; -++ p[6] = r5; -++ p[7] = (int) buf; -++ if (num<=1) -++ pthread_cond_broadcast(&post_cond); // Otherwise the vpu thread must already be awake -++ pthread_mutex_unlock(&post_mutex); -++ return id; -++ } -++} -++ -++// Wait for completion of the given command -++void vpu_wait(int id) -++{ -++ pthread_mutex_lock(&post_mutex); -++ while( id + 1 - vpu_async_head > 0) -++ { -++ pthread_cond_wait(&post_cond, &post_mutex); -++ } -++ pthread_mutex_unlock(&post_mutex); -++} -++ -++#endif -++ -++ -+ unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5) -+ { -+ unsigned r; -+@@ -334,7 +449,9 @@ unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, -+ static int count=0; -+ static long long countr2=0; -+ #endif -++#ifndef RPI_ASYNC -+ gpu_lock(); -++#endif -+ #ifdef RPI_TIME_TOTAL_VPU -+ start_time = Microseconds(); -+ if (last_time==0) -+@@ -351,7 +468,9 @@ unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, -+ if ((count&0x7f)==0) -+ printf("VPU %d %lld On=%dms, Off=%dms\n",count,countr2,(int)(on_time/1000),(int)(off_time/1000)); -+ #endif -++#ifndef RPI_ASYNC -+ gpu_unlock(); -++#endif -+ return r; -+ } -+ -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 814fc3c..3526fce 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -36,6 +36,8 @@ extern unsigned int qpu_get_fn(int num); -+ extern unsigned int vpu_get_fn(void); -+ extern unsigned int vpu_get_constants(void); -+ extern unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5); -++extern int vpu_post_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, GPU_MEM_PTR_T *buf); -++extern void vpu_wait( int id); -+ -+ // Simple test of shader code -+ extern int rpi_test_shader(void); -+-- -+2.5.0 -+ -+ -+From 6914dc93330c6d8494712589cdaeb0927ce9118d Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 6 May 2015 15:03:37 +0100 -+Subject: [PATCH 11/68] Added different signal when tail moves -+ -+--- -+ libavcodec/rpi_qpu.c | 11 ++++++----- -+ 1 file changed, 6 insertions(+), 5 deletions(-) -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 378dd74..d1c3e20 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -122,7 +122,8 @@ pthread_t vpu_thread; -+ static void *vpu_start(void *arg); -+ -+ #define MAXCMDS 128 -+-static pthread_cond_t post_cond = PTHREAD_COND_INITIALIZER; -++static pthread_cond_t post_cond_head = PTHREAD_COND_INITIALIZER; -++static pthread_cond_t post_cond_tail = PTHREAD_COND_INITIALIZER; -+ static pthread_mutex_t post_mutex = PTHREAD_MUTEX_INITIALIZER; -+ -+ static int vpu_cmds[MAXCMDS][8]; -+@@ -372,7 +373,7 @@ static void *vpu_start(void *arg) { -+ while( vpu_async_tail - vpu_async_head <= 0) -+ { -+ //printf("Checking number %d %d\n",vpu_async_head,vpu_async_tail); -+- pthread_cond_wait(&post_cond, &post_mutex); -++ pthread_cond_wait(&post_cond_tail, &post_mutex); -+ } -+ int *p = vpu_cmds[vpu_async_head%MAXCMDS]; -+ pthread_mutex_unlock(&post_mutex); -+@@ -388,7 +389,7 @@ static void *vpu_start(void *arg) { -+ -+ pthread_mutex_lock(&post_mutex); -+ vpu_async_head++; -+- pthread_cond_broadcast(&post_cond); -++ pthread_cond_broadcast(&post_cond_head); -+ pthread_mutex_unlock(&post_mutex); -+ } -+ -+@@ -417,7 +418,7 @@ int vpu_post_code(unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned -+ p[6] = r5; -+ p[7] = (int) buf; -+ if (num<=1) -+- pthread_cond_broadcast(&post_cond); // Otherwise the vpu thread must already be awake -++ pthread_cond_broadcast(&post_cond_tail); // Otherwise the vpu thread must already be awake -+ pthread_mutex_unlock(&post_mutex); -+ return id; -+ } -+@@ -429,7 +430,7 @@ void vpu_wait(int id) -+ pthread_mutex_lock(&post_mutex); -+ while( id + 1 - vpu_async_head > 0) -+ { -+- pthread_cond_wait(&post_cond, &post_mutex); -++ pthread_cond_wait(&post_cond_head, &post_mutex); -+ } -+ pthread_mutex_unlock(&post_mutex); -+ } -+-- -+2.5.0 -+ -+ -+From 0f997c095dc4aa3ddc5818c8188803ade60c8c72 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 7 May 2015 08:57:11 +0100 -+Subject: [PATCH 12/68] Add option to test for gpu_idle -+ -+--- -+ libavcodec/hevc.c | 3 ++- -+ libavcodec/rpi_qpu.c | 18 ++++++++++++++++++ -+ 2 files changed, 20 insertions(+), 1 deletion(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 7b0d951..b703200 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2516,7 +2516,6 @@ static void rpi_execute_transform(HEVCContext *s) -+ // s->hevcdsp.idct[4-2](coeffs, 16); -+ //} -+ -+- -+ gpu_cache_flush(&s->coeffs_buf_accelerated); -+ s->vpu_id = vpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0, &s->coeffs_buf_accelerated); -+ //vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0); -+@@ -2658,6 +2657,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ if (s->enable_rpi && x_ctb + ctb_size >= s->ps.sps->width) { -+ int x; -+ // Transform all blocks -++ //printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -++ -+ rpi_execute_transform(s); -+ // Perform inter prediction -+ rpi_execute_inter_cmds(s); -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index d1c3e20..85f49db 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -199,6 +199,17 @@ static int gpu_init(volatile struct GPU **gpu) { -+ return 0; -+ } -+ -++// Returns 1 if the gpu is currently idle -++static int gpu_idle(void) -++{ -++ int ret = pthread_mutex_trylock(&gpu_mutex); -++ if (ret==0) { -++ pthread_mutex_unlock(&gpu_mutex); -++ return 1; -++ } -++ return 0; -++} -++ -+ // Make sure we have exclusive access to the mailbox, and enable qpu if necessary. -+ static void gpu_lock(void) { -+ pthread_mutex_lock(&gpu_mutex); -+@@ -400,6 +411,13 @@ static void *vpu_start(void *arg) { -+ // Returns an id which we can use to wait for completion -+ int vpu_post_code(unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, GPU_MEM_PTR_T *buf) -+ { -++ // If the gpu is idle then just run the command immediately -++ // This works, but doesn't seem to give any benefit -++ // if (gpu_idle()) { -++ // vpu_execute_code( code, r0, r1, r2, r3, r4, r5); -++ // return -1; // TODO perhaps a wraparound bug here? -++ // } -++ -+ pthread_mutex_lock(&post_mutex); -+ { -+ int id = vpu_async_tail++; -+-- -+2.5.0 -+ -+ -+From 3b7183a57c0936f10db7ae806db01ff6c977e095 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 7 May 2015 11:01:35 +0100 -+Subject: [PATCH 13/68] Added deblocking pass -+ -+--- -+ libavcodec/hevc.c | 33 +++++++++++++++++++++++++++------ -+ libavcodec/hevc.h | 7 ++++++- -+ libavcodec/hevc_filter.c | 6 +++++- -+ libavcodec/rpi_qpu.c | 2 +- -+ 4 files changed, 39 insertions(+), 9 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index b703200..c12693b 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2507,6 +2507,17 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, -+ } -+ -+ #ifdef RPI -++static void rpi_execute_dblk_cmds(HEVCContext *s) -++{ -++ int n; -++ int ctb_size = 1 << s->ps.sps->log2_ctb_size; -++ int (*p)[2] = s->dblk_cmds; -++ for(n = s->num_dblk_cmds; n>0 ;n--,p++) { -++ ff_hevc_hls_filters(s, (*p)[0], (*p)[1], ctb_size); -++ } -++ s->num_dblk_cmds = 0; -++} -++ -+ static void rpi_execute_transform(HEVCContext *s) -+ { -+ int i=2; -+@@ -2620,7 +2631,6 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; -+ -+ #ifdef RPI -+- int start_ctb_x = (s->sh.slice_ctb_addr_rs % ((s->ps.sps->width + ctb_size - 1) >> s->ps.sps->log2_ctb_size)) << s->ps.sps->log2_ctb_size; -+ s->enable_rpi = 1; // TODO this should depend on cross component and frame width etc. -+ #endif -+ -+@@ -2654,7 +2664,10 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -+ #ifdef RPI -+- if (s->enable_rpi && x_ctb + ctb_size >= s->ps.sps->width) { -++ if (s->enable_rpi) { -++ s->dblk_cmds[s->num_dblk_cmds][0] = x_ctb; -++ s->dblk_cmds[s->num_dblk_cmds++][1] = y_ctb; -++ if ( (((y_ctb + ctb_size)&63) == 0) && x_ctb + ctb_size >= s->ps.sps->width) { -+ int x; -+ // Transform all blocks -+ //printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+@@ -2667,10 +2680,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ // Perform intra prediction and residual reconstruction -+ rpi_execute_pred_cmds(s); -+ // Perform deblocking for CTBs in this row -+- for(x = start_ctb_x; x <= x_ctb; x += ctb_size) { // TODO this will fail for tiles -+- ff_hevc_hls_filters(s, x, y_ctb, ctb_size); -+- } -+- start_ctb_x = 0; -++ rpi_execute_dblk_cmds(s); -++ } -+ } -+ #endif -+ if (more_data < 0) { -+@@ -2688,6 +2699,16 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ ff_hevc_hls_filters(s, x_ctb, y_ctb, ctb_size); -+ } -+ -++#ifdef RPI -++ if (s->enable_rpi && s->num_dblk_cmds) { -++ rpi_execute_transform(s); -++ rpi_execute_inter_cmds(s); -++ vpu_wait(s->vpu_id); -++ rpi_execute_pred_cmds(s); -++ rpi_execute_dblk_cmds(s); -++ } -++#endif -++ -+ if (x_ctb + ctb_size >= s->ps.sps->width && -+ y_ctb + ctb_size >= s->ps.sps->height) -+ ff_hevc_hls_filter(s, x_ctb, y_ctb, ctb_size); -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 89636e4..1fcf8b9 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -834,6 +834,8 @@ typedef struct HEVCLocalContext { -+ #define RPI_MAX_XFM_CMDS (16*3*(RPI_MAX_WIDTH/4)) -+ // Each block can have an intra prediction and a transform_add command -+ #define RPI_MAX_PRED_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -++// Worst case is 16x16 CTUs -++#define RPI_MAX_DEBLOCK_CMDS (RPI_MAX_WIDTH*4/16) -+ -+ #define RPI_CMD_LUMA_UNI 0 -+ #define RPI_CMD_CHROMA_UNI 1 -+@@ -893,6 +895,9 @@ typedef struct HEVCPredCmd { -+ #endif -+ -+ typedef struct HEVCContext { -++#ifdef RPI -++ int dblk_cmds[RPI_MAX_DEBLOCK_CMDS][2]; -++#endif -+ const AVClass *c; // needed by private avoptions -+ AVCodecContext *avctx; -+ -+@@ -917,11 +922,11 @@ typedef struct HEVCContext { -+ GPU_MEM_PTR_T coeffs_buf_accelerated; -+ int16_t *coeffs_buf_arm[4]; -+ unsigned int coeffs_buf_vc[4]; -+- -+ int num_coeffs[4]; -+ int num_xfm_cmds; -+ int num_mv_cmds; -+ int num_pred_cmds; -++ int num_dblk_cmds; -+ int vpu_id; -+ #endif -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index e4c3da7..ea0af91 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -877,8 +877,12 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ if (s->threads_type & FF_THREAD_FRAME ) -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); -+ } -+- } else if (s->threads_type & FF_THREAD_FRAME && x_end) -++ } else if (s->threads_type & FF_THREAD_FRAME && x_end) { -++ int newh = y + ctb_size - 4; -++ //int currh = s->ref->tf.progress->data[0]; -++ //if (((y + ctb_size)&63)==0) -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -++ } -+ } -+ -+ void ff_hevc_hls_filters(HEVCContext *s, int x_ctb, int y_ctb, int ctb_size) -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 85f49db..3b6dae7 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -105,7 +105,7 @@ struct GPU -+ static pthread_mutex_t gpu_mutex = PTHREAD_MUTEX_INITIALIZER; -+ static volatile struct GPU* gpu = NULL; -+ -+-#ifdef RPI_TIME_TOTAL_QPU -++#if defined(RPI_TIME_TOTAL_QPU) || defined(RPI_TIME_TOTAL_VPU) -+ static unsigned int Microseconds(void) { -+ struct timespec ts; -+ unsigned int x; -+-- -+2.5.0 -+ -+ -+From 2e30016cc84d7b30f26bdeb1fbed69c3f495cded Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 7 May 2015 16:47:47 +0100 -+Subject: [PATCH 14/68] Added option to disable deblocking for non-ref frames -+ -+--- -+ libavcodec/hevc_filter.c | 10 ++++++++++ -+ 1 file changed, 10 insertions(+) -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index ea0af91..2cdd621 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -25,6 +25,8 @@ -+ //#define DISABLE_SAO -+ //#define DISABLE_DEBLOCK -+ //#define DISABLE_STRENGTHS -++// define DISABLE_DEBLOCK_NONREF for a 6% speed boost (by skipping deblocking on unimportant frames) -++//#define DISABLE_DEBLOCK_NONREF -+ -+ #include "libavutil/common.h" -+ #include "libavutil/internal.h" -+@@ -504,6 +506,14 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->ps.sps->pcm.loop_filter_disable_flag) || -+ s->ps.pps->transquant_bypass_enable_flag; -+ -++#ifdef DISABLE_DEBLOCK_NONREF -++ if ( s->nal_unit_type == NAL_TRAIL_N || -++ s->nal_unit_type == NAL_TSA_N || -++ s->nal_unit_type == NAL_STSA_N || -++ s->nal_unit_type == NAL_RADL_N || -++ s->nal_unit_type == NAL_RASL_N ) -++ return; // Don't deblock non-reference frames -++#endif -+ #ifdef DISABLE_DEBLOCK -+ return; -+ #endif -+-- -+2.5.0 -+ -+ -+From f5895e368e97fbd1ec04501b4be89a20f5cc5f29 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Mon, 11 May 2015 10:00:27 +0100 -+Subject: [PATCH 15/68] Moved buffers to VPU memory -+ -+--- -+ libavcodec/hevc_filter.c | 17 +++++++++++++- -+ libavcodec/utils.c | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ -+ libavutil/buffer.c | 6 +++++ -+ libavutil/buffer.h | 3 +++ -+ 4 files changed, 84 insertions(+), 1 deletion(-) -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 2cdd621..e1b32d4 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -866,6 +866,13 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ #undef CB -+ #undef CR -+ -++#ifdef RPI_INTER_QPU -++static void flush_buffer(AVBufferRef *bref) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -++ gpu_cache_flush(p); -++} -++#endif -++ -+ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ { -+ int x_end = x >= s->ps.sps->width - ctb_size; -+@@ -888,9 +895,17 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); -+ } -+ } else if (s->threads_type & FF_THREAD_FRAME && x_end) { -+- int newh = y + ctb_size - 4; -++ //int newh = y + ctb_size - 4; -+ //int currh = s->ref->tf.progress->data[0]; -+ //if (((y + ctb_size)&63)==0) -++ if (!( s->nal_unit_type == NAL_TRAIL_N || -++ s->nal_unit_type == NAL_TSA_N || -++ s->nal_unit_type == NAL_STSA_N || -++ s->nal_unit_type == NAL_RADL_N || -++ s->nal_unit_type == NAL_RASL_N )) { -++ flush_buffer(s->frame->buf[1]); -++ flush_buffer(s->frame->buf[2]); -++ } -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -+ } -+ } -+diff --git a/libavcodec/utils.c b/libavcodec/utils.c -+index f532824..b32047a 100644 -+--- a/libavcodec/utils.c -++++ b/libavcodec/utils.c -+@@ -26,6 +26,12 @@ -+ */ -+ -+ #include "config.h" -++ -++#ifdef RPI -++// Move video buffers to GPU memory -++#define RPI_GPU_BUFFERS -++#endif -++ -+ #include "libavutil/atomic.h" -+ #include "libavutil/attributes.h" -+ #include "libavutil/avassert.h" -+@@ -63,6 +69,10 @@ -+ #include "libavutil/ffversion.h" -+ const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION; -+ -++#ifdef RPI_GPU_BUFFERS -++#include "rpi_qpu.h" -++#endif -++ -+ #if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS -+ static int default_lockmgr_cb(void **arg, enum AVLockOp op) -+ { -+@@ -500,6 +510,47 @@ int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels, -+ return ret; -+ } -+ -++#ifdef RPI_GPU_BUFFERS -++static void rpi_buffer_default_free(void *opaque, uint8_t *data) -++{ -++ GPU_MEM_PTR_T *p = opaque; -++ gpu_free(p); -++ av_free(p); -++} -++ -++static AVBufferRef *rpi_buffer_alloc(int size) -++{ -++ AVBufferRef *ret = NULL; -++ uint8_t *data = NULL; -++ GPU_MEM_PTR_T *p; -++ -++ static int total=0; -++ total+=size; -++ -++ p = av_malloc(sizeof *p); -++ if (!p) -++ return NULL; -++ -++ if (gpu_malloc_cached(size,p)<0) // Change this line to choose cached or uncached memory. The caching here refers to the ARM data cache. -++ return NULL; -++ -++ data = p->arm; -++ printf("Rpi alloc %d/%d ARM=%p VC=%x->%x\n",size,total,p->arm,p->vc,p->vc+size); -++ //memset(data, 64, size); -++ -++ if (!data) -++ return NULL; -++ -++ ret = av_buffer_create(data, size, rpi_buffer_default_free, p, 0); -++ if (!ret) { -++ gpu_free(p); -++ av_freep(&p); -++ } -++ -++ return ret; -++} -++#endif -++ -+ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) -+ { -+ FramePool *pool = avctx->internal->pool; -+@@ -547,6 +598,14 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame) -+ av_buffer_pool_uninit(&pool->pools[i]); -+ pool->linesize[i] = linesize[i]; -+ if (size[i]) { -++#ifdef RPI_GPU_BUFFERS -++ if (avctx->codec_id == AV_CODEC_ID_HEVC) -++ pool->pools[i] = av_buffer_pool_init(size[i] + 16 + STRIDE_ALIGN - 1, -++ CONFIG_MEMORY_POISONING ? -++ NULL : -++ rpi_buffer_alloc); -++ else -++#endif -+ pool->pools[i] = av_buffer_pool_init(size[i] + 16 + STRIDE_ALIGN - 1, -+ CONFIG_MEMORY_POISONING ? -+ NULL : -+diff --git a/libavutil/buffer.c b/libavutil/buffer.c -+index bb112c2..7f8bfab 100644 -+--- a/libavutil/buffer.c -++++ b/libavutil/buffer.c -+@@ -400,3 +400,9 @@ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool) -+ -+ return ret; -+ } -++ -++// Return the opaque for the underlying frame (gives us a GPU_MEM_PTR_T) -++void *av_buffer_pool_opaque(AVBufferRef *ref) { -++ BufferPoolEntry *buf = av_buffer_get_opaque(ref); -++ return buf->opaque; -++} -+diff --git a/libavutil/buffer.h b/libavutil/buffer.h -+index b4399fd..0489002 100644 -+--- a/libavutil/buffer.h -++++ b/libavutil/buffer.h -+@@ -267,6 +267,9 @@ void av_buffer_pool_uninit(AVBufferPool **pool); -+ */ -+ AVBufferRef *av_buffer_pool_get(AVBufferPool *pool); -+ -++// Return the opaque for the underlying frame -++void *av_buffer_pool_opaque(AVBufferRef *ref); -++ -+ /** -+ * @} -+ */ -+-- -+2.5.0 -+ -+ -+From 969972796afe03290f6c2dd3251bce367b4c6847 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Mon, 11 May 2015 14:04:37 +0100 -+Subject: [PATCH 16/68] Prepared QPU execute code -+ -+--- -+ libavcodec/hevc.c | 227 ++++++++++++++++++++++++++++++++++++++++------- -+ libavcodec/hevc.h | 22 ++++- -+ libavcodec/hevc_filter.c | 7 +- -+ libavcodec/rpi_qpu.c | 55 +++++++++++- -+ libavcodec/rpi_qpu.h | 2 + -+ 5 files changed, 276 insertions(+), 37 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index c12693b..3b10ea0 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -42,17 +42,45 @@ -+ #include "profiles.h" -+ -+ #ifdef RPI -+-#include "rpi_qpu.h" -+-// For some unknown reason, the code seems to crash if I do a late malloc -+-#define EARLY_MALLOC -+-// Move Inter prediction into separate pass -+-#define RPI_INTER -++ #include "rpi_qpu.h" -++ // For some unknown reason, the code seems to crash if I do a late malloc -++ #define EARLY_MALLOC -++ // Move Inter prediction into separate pass -++ #define RPI_INTER -+ #endif -+ -+ // #define DISABLE_MC -+ -+ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 }; -+ -++ -++#ifdef RPI_INTER_QPU -++ -++#define RPI_CHROMA_COMMAND_WORDS 12 -++// The QPU code for UV blocks only works up to a block width of 8 -++#define RPI_CHROMA_BLOCK_WIDTH 8 -++ -++#define ENCODE_COEFFS(c0, c1, c2, c3) (((-c0) & 0xff) | ((-c1) & 0xff) << 8 | ((-c2) & 0xff) << 16 | ((-c3) & 0xff) << 24) -++ -++// TODO Chroma only needs 4 taps -++static uint32_t rpi_filter_coefs[8][2] = { -++ { ENCODE_COEFFS( 0, 0, 0, 128), ENCODE_COEFFS( 0, 0, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -2, 58), ENCODE_COEFFS( 10, -2, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -4, 54), ENCODE_COEFFS( 16, -2, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -6, 46), ENCODE_COEFFS( 28, -4, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -4, 36), ENCODE_COEFFS( 36, -4, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -4, 28), ENCODE_COEFFS( 46, -6, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -2, 16), ENCODE_COEFFS( 54, -4, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, -2, 10), ENCODE_COEFFS( 58, -2, 0, 0 ) } -++}; -++ -++static uint32_t get_vc_address(AVBufferRef *bref) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -++ return p->vc; -++} -++ -++#endif -++ -+ /** -+ * NOTE: Each function hls_foo correspond to the function foo in the -+ * specification (HLS stands for High Level Syntax). -+@@ -66,6 +94,7 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ static void pic_arrays_free(HEVCContext *s) -+ { -+ #ifdef RPI -++ -+ #ifdef EARLY_MALLOC -+ #else -+ printf("pic_arrays_free\n"); -+@@ -1971,6 +2000,43 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ s->sh.luma_offset_l0[current_mv.ref_idx[0]]); -+ -+ if (s->ps.sps->chroma_format_idc) { -++#ifdef RPI_INTER_QPU -++ if (s->enable_rpi) { -++ int reflist = 0; -++ int hshift = s->ps.sps->hshift[1]; -++ int vshift = s->ps.sps->vshift[1]; -++ const Mv *mv = ¤t_mv.mv[reflist]; -++ intptr_t mx = av_mod_uintp2(mv->x, 2 + hshift); -++ intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); -++ intptr_t _mx = mx << (1 - hshift); -++ intptr_t _my = my << (1 - vshift); // Fractional part of motion vector -++ -++ int x1_c = x0_c + (mv->x >> (2 + hshift)); -++ int y1_c = y0_c + (mv->y >> (2 + hshift)); -++ int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -++ -++ uint32_t *u = s->u_mvs[chan & 7]; -++ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -++ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -++ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -++ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -++ *u++ = rpi_filter_coefs[_mx][0]; -++ *u++ = rpi_filter_coefs[_mx][1]; -++ *u++ = rpi_filter_coefs[_my][0]; -++ *u++ = rpi_filter_coefs[_my][1]; -++ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -++ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ } -++ } -++ s->u_mvs[chan & 7] = u; -++ return; -++ } -++#endif -+ RPI_REDIRECT(chroma_mc_uni)(s, dst1, s->frame->linesize[1], ref0->frame->data[1], ref0->frame->linesize[1], -+ 0, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, -+ s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0]); -+@@ -2621,6 +2687,54 @@ static void rpi_execute_inter_cmds(HEVCContext *s) -+ -+ #endif -+ -++#ifdef RPI_INTER_QPU -++static void rpi_inter_clear(HEVCContext *s) -++{ -++ int i; -++ int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; -++ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; -++ for(i=0;i<8;i++) { -++ s->u_mvs[i] = s->mvs_base[i]; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = pic_width; -++ *s->u_mvs[i]++ = pic_height; -++ *s->u_mvs[i]++ = s->frame->linesize[1]; -++ *s->u_mvs[i]++ = s->frame->linesize[2]; -++ s->u_mvs[i] += 3; // Padding words -++ } -++} -++ -++static void rpi_execute_inter_qpu(HEVCContext *s) -++{ -++ int k; -++ uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr.vc; -++ -++ if (s->sh.slice_type == I_SLICE) -++ return; -++ for(k=0;k<8;k++) { -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ } -++ -++ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -++ -++ qpu_run_shader8(qpu_get_fn(QPU_MC_SETUP_UV), -++ (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[1 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[2 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[3 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[4 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[5 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -++ ); -++} -++#endif -++ -+ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ { -+ HEVCContext *s = avctxt->priv_data; -+@@ -2647,6 +2761,10 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ } -+ } -+ -++#ifdef RPI_INTER_QPU -++ rpi_inter_clear(s); -++#endif -++ -+ while (more_data && ctb_addr_ts < s->ps.sps->ctb_size) { -+ int ctb_addr_rs = s->ps.pps->ctb_addr_ts_to_rs[ctb_addr_ts]; -+ -+@@ -2668,19 +2786,30 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->dblk_cmds[s->num_dblk_cmds][0] = x_ctb; -+ s->dblk_cmds[s->num_dblk_cmds++][1] = y_ctb; -+ if ( (((y_ctb + ctb_size)&63) == 0) && x_ctb + ctb_size >= s->ps.sps->width) { -+- int x; -++#ifdef RPI_INTER_QPU -++ // Kick off inter prediction on QPUs -++ rpi_execute_inter_qpu(s); -++#endif -+ // Transform all blocks -+ //printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+- -+ rpi_execute_transform(s); -+ // Perform inter prediction -+ rpi_execute_inter_cmds(s); -+ // Wait for transform completion -+ vpu_wait(s->vpu_id); -++ -++ // Copy back reconstructed data -++ //memcpy(s->frame->data[0],s->dummy.arm,2048*64); -++ //memcpy(s->frame->data[1],s->dummy.arm,1024*32); -++ //memcpy(s->frame->data[2],s->dummy.arm,1024*32); -++ -+ // Perform intra prediction and residual reconstruction -+ rpi_execute_pred_cmds(s); -+ // Perform deblocking for CTBs in this row -+ rpi_execute_dblk_cmds(s); -++#ifdef RPI_INTER_QPU -++ rpi_inter_clear(s); -++#endif -+ } -+ } -+ #endif -+@@ -2701,6 +2830,9 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ -+ #ifdef RPI -+ if (s->enable_rpi && s->num_dblk_cmds) { -++#ifdef RPI_INTER_QPU -++ rpi_execute_inter_qpu(s); -++#endif -+ rpi_execute_transform(s); -+ rpi_execute_inter_cmds(s); -+ vpu_wait(s->vpu_id); -+@@ -3440,6 +3572,14 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ av_freep(&s->unif_xfm_cmds); -+ av_freep(&s->univ_pred_cmds); -+ -++#ifdef RPI_INTER_QPU -++ if (s->unif_mvs) { -++ gpu_free( &s->unif_mvs_ptr ); -++ s->unif_mvs = 0; -++ } -++#endif -++ //gpu_free(&s->dummy); -++ -+ #ifdef EARLY_MALLOC -+ printf("hevc_decode_free\n"); -+ if (s->coeffs_buf_arm[0]) { -+@@ -3535,34 +3675,59 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ if (!s->univ_pred_cmds) -+ goto fail; -+ -+- s->coeffs_buf_arm[0] = 0; -+- s->coeffs_buf_arm[2] = 0; -++#ifdef RPI_INTER_QPU -++ // We divide the image into blocks 256 wide and 64 high -++ // We support up to 2048 widths -++ // We compute the number of chroma motion vector commands for 4:4:4 format and 4x4 chroma blocks - assuming all blocks are B predicted -++ // Also add space for the startup command for each stream. -++ -++ { -++ int uv_commands_per_qpu = (1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS; -++ uint32_t *p; -++ gpu_malloc_uncached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr ); -++ s->unif_mvs = (uint32_t *) s->unif_mvs_ptr.arm; // TODO support this allocation in non EARLY_MALLOC -++ -++ // Set up initial locations for uniform streams -++ p = s->unif_mvs; -++ for(i = 0; i < 8; i++) { -++ s->mvs_base[i] = p; -++ p += uv_commands_per_qpu; -++ } -++ s->mc_filter_uv = qpu_get_fn(QPU_MC_FILTER_UV); -++ s->mc_filter_uv_b = qpu_get_fn(QPU_MC_FILTER_UV_B); -++ -++ } -++#endif -++ //gpu_malloc_uncached(2048*64,&s->dummy); -+ -+ #ifdef EARLY_MALLOC -+- int coeffs_in_ctb = 64*64; -+- int coefs_per_row = (2048/64) * coeffs_in_ctb * 3; // Allow space for chroma -+- printf("Allocated %d\n",coefs_per_row); -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -+- s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -+- if (!s->coeffs_buf_arm[0]) -+- goto fail; -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated); -+- s->coeffs_buf_arm[2] = (int16_t*) s->coeffs_buf_accelerated.arm; -+- s->coeffs_buf_vc[2] = s->coeffs_buf_accelerated.vc; -+- if (!s->coeffs_buf_arm[2]) -+- goto fail; -+- s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -+- s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -+- printf("Done\n"); -++ { -++ int coeffs_in_ctb = 64*64; -++ int coefs_per_row = (2048/64) * coeffs_in_ctb * 3; // Allow space for chroma -++ s->coeffs_buf_arm[0] = 0; -++ s->coeffs_buf_arm[2] = 0; -++ printf("Allocated %d\n",coefs_per_row); -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -++ s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -++ if (!s->coeffs_buf_arm[0]) -++ goto fail; -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated); -++ s->coeffs_buf_arm[2] = (int16_t*) s->coeffs_buf_accelerated.arm; -++ s->coeffs_buf_vc[2] = s->coeffs_buf_accelerated.vc; -++ if (!s->coeffs_buf_arm[2]) -++ goto fail; -++ s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -++ s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -++ printf("Done\n"); -+ #ifdef RPI_PRECLEAR -+- //memset(s->coeffs_buf_arm[0],0, sizeof(int16_t) * coefs_per_row); -+- memclear16(s->coeffs_buf_arm[0], coefs_per_row); -+- //memset(s->coeffs_buf_arm[2],0, sizeof(int16_t) * coefs_per_row); -+- memclear16(s->coeffs_buf_arm[2], coefs_per_row); -+- //memset(s->coeffs_buf_arm[3],0, sizeof(int16_t) * coefs_per_row); -+- memclear16(s->coeffs_buf_arm[3], coefs_per_row); -++ //memset(s->coeffs_buf_arm[0],0, sizeof(int16_t) * coefs_per_row); -++ memclear16(s->coeffs_buf_arm[0], coefs_per_row); -++ //memset(s->coeffs_buf_arm[2],0, sizeof(int16_t) * coefs_per_row); -++ memclear16(s->coeffs_buf_arm[2], coefs_per_row); -++ //memset(s->coeffs_buf_arm[3],0, sizeof(int16_t) * coefs_per_row); -++ memclear16(s->coeffs_buf_arm[3], coefs_per_row); -+ #endif -+- -++ } -+ #endif -+ -+ s->enable_rpi = 0; -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 1fcf8b9..a19d3ab 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -41,7 +41,11 @@ -+ -+ // define RPI to split the CABAC/prediction/transform into separate stages -+ #ifdef RPI -+-#include "rpi_qpu.h" -++ -++ #include "rpi_qpu.h" -++ // Use QPU for inter prediction -++ //#define RPI_INTER_QPU -++ -+ #endif -+ -+ #define MAX_DPB_SIZE 16 // A.4.1 -+@@ -914,7 +918,7 @@ typedef struct HEVCContext { -+ -+ #ifdef RPI -+ int enable_rpi; -+- HEVCMvCmd *unif_mv_cmds; -++ HEVCMvCmd *unif_mv_cmds; // TODO rename -+ HEVCXfmCmd *unif_xfm_cmds; -+ HEVCPredCmd *univ_pred_cmds; -+ int buf_width; -+@@ -928,6 +932,20 @@ typedef struct HEVCContext { -+ int num_pred_cmds; -+ int num_dblk_cmds; -+ int vpu_id; -++ //GPU_MEM_PTR_T dummy; -++#ifdef RPI_INTER_QPU -++ GPU_MEM_PTR_T unif_mvs_ptr; -++ uint32_t *unif_mvs; // Base of memory for motion vector commands -++ -++ // _base pointers are to the start of the row -++ uint32_t *mvs_base[8]; -++ // these pointers are to the next free space -++ uint32_t *u_mvs[8]; -++ // Function pointers -++ uint32_t mc_filter_uv; -++ uint32_t mc_filter_uv_b; -++#endif -++ -+ #endif -+ -+ uint8_t *cabac_state; -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index e1b32d4..5b3d759 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -903,8 +903,11 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ s->nal_unit_type == NAL_STSA_N || -+ s->nal_unit_type == NAL_RADL_N || -+ s->nal_unit_type == NAL_RASL_N )) { -+- flush_buffer(s->frame->buf[1]); -+- flush_buffer(s->frame->buf[2]); -++ //flush_buffer(s->frame->buf[1]); -++ //flush_buffer(s->frame->buf[2]); -++ //memcpy(s->dummy.arm,s->frame->data[0],2048*64); -++ //memcpy(s->dummy.arm,s->frame->data[1],1024*32); -++ //memcpy(s->dummy.arm,s->frame->data[2],1024*32); -+ } -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -+ } -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 3b6dae7..e4dd58a 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -3,7 +3,7 @@ -+ // This works better than the mmap in that the memory can be cached, but requires a kernel modification to enable the device. -+ #define RPI_USE_VCSM -+ // define RPI_TIME_TOTAL_QPU to print out how much time is spent in the QPU code -+-//#define RPI_TIME_TOTAL_QPU -++#define RPI_TIME_TOTAL_QPU -+ // define RPI_TIME_TOTAL_VPU to print out how much time is spent in the VPI code -+ //#define RPI_TIME_TOTAL_VPU -+ // define RPI_ASYNC to run the VPU in a separate thread, need to make a separate call to check for completion -+@@ -30,7 +30,7 @@ -+ #endif -+ -+ // On Pi2 there is no way to access the VPU L2 cache -+-// GPU_MEM_FLG should be 4 for uncached memory. -++// GPU_MEM_FLG should be 4 for uncached memory. (Or C for alias to allocate in the VPU L2 cache) -+ // However, if using VCSM allocated buffers, need to use C at the moment because VCSM does not allocate uncached memory correctly -+ // The QPU crashes if we mix L2 cached and L2 uncached accesses due to a HW bug. -+ #define GPU_MEM_FLG 0xC -+@@ -549,6 +549,54 @@ void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int un -+ gpu_unlock(); -+ } -+ -++// Run a program on 8 QPUs with the given code and uniform stream (given in GPU addresses) -++void qpu_run_shader8(int code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8) -++{ -++ int i; -++#ifdef RPI_TIME_TOTAL_QPU -++ static int last_time=0; -++ static long long on_time=0; -++ static long long off_time=0; -++ int start_time; -++ int end_time; -++ static int count=0; -++#endif -++ -++ gpu_lock(); -++#ifdef RPI_TIME_TOTAL_QPU -++ start_time = Microseconds(); -++ if (last_time==0) -++ last_time = start_time; -++ off_time += start_time-last_time; -++#endif -++ for(i=0;i<8;i++) { -++ gpu->mail[i*2 + 1] = code; -++ } -++ gpu->mail[0 ] = unifs1; -++ gpu->mail[2 ] = unifs2; -++ gpu->mail[4 ] = unifs3; -++ gpu->mail[6 ] = unifs4; -++ gpu->mail[8 ] = unifs5; -++ gpu->mail[10] = unifs6; -++ gpu->mail[12] = unifs7; -++ gpu->mail[14] = unifs8; -++ execute_qpu( -++ gpu->mb, -++ 8 /* Number of QPUs */, -++ gpu->vc + offsetof(struct GPU, mail), -++ 1 /* no flush */, // Don't flush VPU L1 cache -++ 5000 /* timeout ms */); -++#ifdef RPI_TIME_TOTAL_QPU -++ end_time = Microseconds(); -++ last_time = end_time; -++ on_time += end_time - start_time; -++ count++; -++ if ((count&0x7f)==0) -++ printf("On=%dms, Off=%dms\n",(int)(on_time/1000),(int)(off_time/1000)); -++#endif -++ gpu_unlock(); -++} -++ -+ unsigned int qpu_get_fn(int num) { -+ // Make sure that the gpu is initialized -+ unsigned int *fn; -+@@ -585,6 +633,9 @@ unsigned int qpu_get_fn(int num) { -+ case QPU_MC_FILTER_UV_B: -+ fn = mc_filter_uv_b; -+ break; -++ case QPU_MC_INTERRUPT_EXIT8: -++ fn = mc_interrupt_exit8; -++ break; -+ case QPU_MC_END: -+ fn = mc_end; -+ break; -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 3526fce..2b22d98 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -16,6 +16,7 @@ extern void gpu_free(GPU_MEM_PTR_T *p); -+ extern void gpu_cache_flush(GPU_MEM_PTR_T *p); -+ -+ // QPU specific functions -++extern void qpu_run_shader8(int code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8); -+ extern void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, int unifs9, int unifs10, int unifs11, int unifs12); -+ -+ enum { -+@@ -28,6 +29,7 @@ enum { -+ QPU_MC_SETUP_UV, -+ QPU_MC_FILTER_UV, -+ QPU_MC_FILTER_UV_B, -++ QPU_MC_INTERRUPT_EXIT8, -+ QPU_MC_END -+ }; -+ extern unsigned int qpu_get_fn(int num); -+-- -+2.5.0 -+ -+ -+From 90df0cacf3bed37328d465a925e446c7d3e9583b Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 13 May 2015 11:47:23 +0100 -+Subject: [PATCH 17/68] Drafted chroma interpolation on QPUs -+ -+--- -+ libavcodec/hevc.c | 5 ++- -+ libavcodec/hevc.h | 2 +- -+ libavcodec/hevc_filter.c | 6 ++- -+ libavcodec/rpi_qpu.c | 101 +++++++++++++++++++++++++++++++++++++++++++-- -+ libavcodec/rpi_qpu.h | 1 + -+ libavcodec/rpi_shader.c | 42 +++++++++---------- -+ libavcodec/rpi_shader.qasm | 42 +++++++++---------- -+ 7 files changed, 149 insertions(+), 50 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 3b10ea0..a5e1524 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -60,11 +60,11 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ // The QPU code for UV blocks only works up to a block width of 8 -+ #define RPI_CHROMA_BLOCK_WIDTH 8 -+ -+-#define ENCODE_COEFFS(c0, c1, c2, c3) (((-c0) & 0xff) | ((-c1) & 0xff) << 8 | ((-c2) & 0xff) << 16 | ((-c3) & 0xff) << 24) -++#define ENCODE_COEFFS(c0, c1, c2, c3) (((c0) & 0xff) | ((c1) & 0xff) << 8 | ((c2) & 0xff) << 16 | ((c3) & 0xff) << 24) -+ -+ // TODO Chroma only needs 4 taps -+ static uint32_t rpi_filter_coefs[8][2] = { -+- { ENCODE_COEFFS( 0, 0, 0, 128), ENCODE_COEFFS( 0, 0, 0, 0 ) }, -++ { ENCODE_COEFFS( 0, 0, 0, 64), ENCODE_COEFFS( 0, 0, 0, 0 ) }, -+ { ENCODE_COEFFS( 0, 0, -2, 58), ENCODE_COEFFS( 10, -2, 0, 0 ) }, -+ { ENCODE_COEFFS( 0, 0, -4, 54), ENCODE_COEFFS( 16, -2, 0, 0 ) }, -+ { ENCODE_COEFFS( 0, 0, -6, 46), ENCODE_COEFFS( 28, -4, 0, 0 ) }, -+@@ -2718,6 +2718,7 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ for(k=0;k<8;k++) { -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP); // Also need a dummy for V -+ } -+ -+ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index a19d3ab..40470f5 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -44,7 +44,7 @@ -+ -+ #include "rpi_qpu.h" -+ // Use QPU for inter prediction -+- //#define RPI_INTER_QPU -++ // #define RPI_INTER_QPU -+ -+ #endif -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 5b3d759..9b6e26d 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -903,8 +903,10 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ s->nal_unit_type == NAL_STSA_N || -+ s->nal_unit_type == NAL_RADL_N || -+ s->nal_unit_type == NAL_RASL_N )) { -+- //flush_buffer(s->frame->buf[1]); -+- //flush_buffer(s->frame->buf[2]); -++#ifdef RPI_INTER_QPU -++ flush_buffer(s->frame->buf[1]); -++ flush_buffer(s->frame->buf[2]); -++#endif -+ //memcpy(s->dummy.arm,s->frame->data[0],2048*64); -+ //memcpy(s->dummy.arm,s->frame->data[1],1024*32); -+ //memcpy(s->dummy.arm,s->frame->data[2],1024*32); -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index e4dd58a..4d9eda8 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -33,7 +33,8 @@ -+ // GPU_MEM_FLG should be 4 for uncached memory. (Or C for alias to allocate in the VPU L2 cache) -+ // However, if using VCSM allocated buffers, need to use C at the moment because VCSM does not allocate uncached memory correctly -+ // The QPU crashes if we mix L2 cached and L2 uncached accesses due to a HW bug. -+-#define GPU_MEM_FLG 0xC -++#define GPU_MEM_FLG 0x4 -++// GPU_MEM_MAP is meaningless on the Pi2 and should be left at 0 (On Pi1 it allows ARM to access VPU L2 cache) -+ #define GPU_MEM_MAP 0x0 -+ -+ #define vcos_verify(x) ((x)>=0) -+@@ -165,6 +166,8 @@ static int gpu_init(volatile struct GPU **gpu) { -+ ptr->vc_handle = handle; -+ ptr->vc = vc; -+ -++ printf("GPU allocated at 0x%x\n",vc); -++ -+ *gpu = ptr; -+ -+ // Now copy over the QPU code into GPU memory -+@@ -304,10 +307,13 @@ int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p) { -+ -+ static void gpu_term(void) -+ { -+- int mb = gpu->mb; -+- unsigned handle = gpu->vc_handle; -++ int mb; -++ unsigned handle; -++ -+ if (gpu==NULL) -+ return; -++ mb = gpu->mb; -++ handle = gpu->vc_handle; -+ -+ #ifdef RPI_ASYNC -+ { -+@@ -648,6 +654,95 @@ unsigned int qpu_get_fn(int num) { -+ } -+ -+ #if 0 -++typedef unsigned int uint32_t; -++ -++typedef struct mvs_s { -++ GPU_MEM_PTR_T unif_mvs_ptr; -++ uint32_t *unif_mvs; // Base of memory for motion vector commands -++ -++ // _base pointers are to the start of the row -++ uint32_t *mvs_base[8]; -++ // these pointers are to the next free space -++ uint32_t *u_mvs[8]; -++ -++} HEVCContext; -++ -++#define RPI_CHROMA_COMMAND_WORDS 12 -++ -++static void rpi_inter_clear(HEVCContext *s) -++{ -++ int i; -++ for(i=0;i<8;i++) { -++ s->u_mvs[i] = s->mvs_base[i]; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 0; -++ *s->u_mvs[i]++ = 128; // w -++ *s->u_mvs[i]++ = 128; // h -++ *s->u_mvs[i]++ = 128; // stride u -++ *s->u_mvs[i]++ = 128; // stride v -++ s->u_mvs[i] += 3; // Padding words -++ } -++} -++ -++static void rpi_execute_inter_qpu(HEVCContext *s) -++{ -++ int k; -++ uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr.vc; -++ -++ for(k=0;k<8;k++) { -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP); // dummy location for V -++ } -++ -++ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -++ -++ qpu_run_shader8(qpu_get_fn(QPU_MC_SETUP_UV), -++ (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[1 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[2 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[3 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[4 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[5 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -++ ); -++} -++ -++void rpi_test_qpu(void) -++{ -++ HEVCContext mvs; -++ HEVCContext *s = &mvs; -++ int i; -++ int uv_commands_per_qpu = (1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS; -++ uint32_t *p; -++ printf("Allocate memory\n"); -++ gpu_malloc_uncached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr ); -++ s->unif_mvs = (uint32_t *) s->unif_mvs_ptr.arm; -++ -++ // Set up initial locations for uniform streams -++ p = s->unif_mvs; -++ for(i = 0; i < 8; i++) { -++ s->mvs_base[i] = p; -++ p += uv_commands_per_qpu; -++ } -++ // Now run a simple program that should just quit immediately after a single texture fetch -++ rpi_inter_clear(s); -++ for(i=0;i<4;i++) { -++ printf("Launch QPUs\n"); -++ rpi_execute_inter_qpu(s); -++ printf("Done\n"); -++ } -++ printf("Free memory\n"); -++ gpu_free(&s->unif_mvs_ptr); -++ return; -++} -++#endif -++ -++#if 0 -+ -+ int32_t hcoeffs[] = {-4, 10, -21, 70, 90, -24, 11, -4}; -+ //int32_t hcoeffs[] = {1, 1, 1, 1, 1, 1, 1, 1}; -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 2b22d98..f9ad333 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -18,6 +18,7 @@ extern void gpu_cache_flush(GPU_MEM_PTR_T *p); -+ // QPU specific functions -+ extern void qpu_run_shader8(int code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8); -+ extern void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, int unifs9, int unifs10, int unifs11, int unifs12); -++extern void rpi_test_qpu(void); -+ -+ enum { -+ QPU_MC_SETUP, -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 41cc2e1..d7ed297 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -152,23 +152,23 @@ unsigned int rpi_shader[] = { -+ /* [0x000003e8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+ /* [0x000003f0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+ /* [0x000003f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000400] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000408] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-/* [0x00000410] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000400] */ 0x55015fc6, 0x100248a2, // mov r2, rb21 ; mul24 r2, r0, ra0 -++/* [0x00000408] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000410] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+ /* [0x00000418] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000420] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000420] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ /* [0x00000428] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000430] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000430] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ /* [0x00000438] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000440] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000440] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+ /* [0x00000448] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000450] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000450] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+ /* [0x00000458] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000460] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000460] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+ /* [0x00000468] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000470] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000470] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+ /* [0x00000478] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000480] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000480] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+ /* [0x00000488] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+ /* [0x00000490] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+ /* [0x00000498] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+@@ -179,20 +179,20 @@ unsigned int rpi_shader[] = { -+ /* [0x000004c0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+ /* [0x000004c8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+ /* [0x000004d0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x000004d8] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x000004d8] */ 0x8f54e1f6, 0xd0024821, // asr r0, r0, 14 ; mov r1, ra21 -+ /* [0x000004e0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x000004e8] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x000004f0] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x000004f8] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000500] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000508] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000510] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000518] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000520] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000528] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x000004e8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x000004f0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x000004f8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000500] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000508] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000510] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000518] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000520] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000528] */ 0x8c9f223f, 0x100a0867, // add.ifnn r1, r1, r0 ; mov -, vw_wait -+ /* [0x00000530] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+ /* [0x00000538] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000540] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x00000540] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+ /* [0x00000548] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+ /* [0x00000550] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+ /* [0x00000558] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 6851e83..02fdcb2 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -270,23 +270,23 @@ add t0s, ra_x2_base, r2 -+ -+ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+-mov r2, rb21 ; mul24 r3, r0, ra0 -+-nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++mov r2, rb21 ; mul24 r2, r0, ra0 -++nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++nop ; mul24 r3, ra1 << 1, r0 << 1 -+ nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+ nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+ nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+ nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+ nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-sub r0, r2, r3 -++add r0, r2, r3 -+ -+ mov r3, rb31 -+ -+@@ -302,23 +302,23 @@ sub.setf -, r3, 8 ; mov r1, ra22 -+ # apply horizontal filter -+ brr.anyn -, r:uvloop -+ max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr r0, r0, 15 ; mov r1, ra21 -++asr r0, r0, 14 ; mov r1, ra21 -+ min.setf ra15, r0, rb22 -+ -+ # apply vertical filter and write to VPM -+ -+-nop ; mul24 r0, ra14, rb14 -+-sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-sub.ifnn r1, r1, r0 ; mov -, vw_wait -++nop ; mul24 r1, ra14, rb14 -++nop ; mul24 r0, ra13, rb13 -++add r1, r1, r0 ; mul24 r0, ra12, rb12 -++add r1, r1, r0 ; mul24 r0, ra11, rb11 -++add r1, r1, r0 ; mul24 r0, ra10, rb10 -++add r1, r1, r0 ; mul24 r0, ra9, rb9 -++add r1, r1, r0 ; mul24 r0, ra8, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb15 -++add.ifnn r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+ brr.anyn -, r:uvloop -+-asr r1, r1, 15 -++asr r1, r1, 14 -+ min r1, r1, rb22 -+ max vpm, r1, 0 -+ -+-- -+2.5.0 -+ -+ -+From 552770488305e7574028fe760aa16d00c1020afa Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 13 May 2015 13:54:11 +0100 -+Subject: [PATCH 18/68] Fixed chroma inter prediction -+ -+--- -+ libavcodec/hevc.c | 8 +- -+ libavcodec/hevc.h | 2 +- -+ libavcodec/rpi_shader.c | 1170 ++++++++++++++++++++++---------------------- -+ libavcodec/rpi_shader.h | 22 +- -+ libavcodec/rpi_shader.qasm | 24 +- -+ 5 files changed, 617 insertions(+), 609 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index a5e1524..d4d272a 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -57,9 +57,11 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ #ifdef RPI_INTER_QPU -+ -+ #define RPI_CHROMA_COMMAND_WORDS 12 -++#define UV_COMMANDS_PER_QPU ((1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS) -+ // The QPU code for UV blocks only works up to a block width of 8 -+ #define RPI_CHROMA_BLOCK_WIDTH 8 -+ -++ -+ #define ENCODE_COEFFS(c0, c1, c2, c3) (((c0) & 0xff) | ((c1) & 0xff) << 8 | ((c2) & 0xff) << 16 | ((c3) & 0xff) << 24) -+ -+ // TODO Chroma only needs 4 taps -+@@ -2013,7 +2015,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ -+ int x1_c = x0_c + (mv->x >> (2 + hshift)); -+ int y1_c = y0_c + (mv->y >> (2 + hshift)); -+- int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -++ //int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -++ int chan = x0>>8; -+ -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+@@ -2719,6 +2722,7 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP); // Also need a dummy for V -++ assert(s->u_mvs[k] - s->mvs_base[k] < UV_COMMANDS_PER_QPU); -+ } -+ -+ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+@@ -3683,7 +3687,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ // Also add space for the startup command for each stream. -+ -+ { -+- int uv_commands_per_qpu = (1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS; -++ int uv_commands_per_qpu = UV_COMMANDS_PER_QPU; -+ uint32_t *p; -+ gpu_malloc_uncached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr ); -+ s->unif_mvs = (uint32_t *) s->unif_mvs_ptr.arm; // TODO support this allocation in non EARLY_MALLOC -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 40470f5..442516d 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -44,7 +44,7 @@ -+ -+ #include "rpi_qpu.h" -+ // Use QPU for inter prediction -+- // #define RPI_INTER_QPU -++ #define RPI_INTER_QPU -+ -+ #endif -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index d7ed297..831633b 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -33,7 +33,7 @@ unsigned int rpi_shader[] = { -+ /* [0x00000040] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+ /* [0x00000048] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+ /* [0x00000050] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x00000058] */ 0x00000040, 0xe0020567, // mov ra21, 64 -++/* [0x00000058] */ 0x00000020, 0xe0020567, // mov ra21, 32 -+ /* [0x00000060] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+ /* [0x00000068] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+ /* [0x00000070] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+@@ -152,7 +152,7 @@ unsigned int rpi_shader[] = { -+ /* [0x000003e8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+ /* [0x000003f0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+ /* [0x000003f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000400] */ 0x55015fc6, 0x100248a2, // mov r2, rb21 ; mul24 r2, r0, ra0 -++/* [0x00000400] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+ /* [0x00000408] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+ /* [0x00000410] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+ /* [0x00000418] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+@@ -178,9 +178,9 @@ unsigned int rpi_shader[] = { -+ /* [0x000004b8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+ /* [0x000004c0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+ /* [0x000004c8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004d0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x000004d8] */ 0x8f54e1f6, 0xd0024821, // asr r0, r0, 14 ; mov r1, ra21 -+-/* [0x000004e0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x000004d0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000004d8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000004e0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ /* [0x000004e8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+ /* [0x000004f0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+ /* [0x000004f8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+@@ -189,400 +189,400 @@ unsigned int rpi_shader[] = { -+ /* [0x00000510] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+ /* [0x00000518] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+ /* [0x00000520] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000528] */ 0x8c9f223f, 0x100a0867, // add.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000528] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+ /* [0x00000530] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000538] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000540] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000548] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000550] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000558] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000560] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000568] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000570] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000578] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000580] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000588] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000590] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000598] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000538] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000540] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000548] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000550] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000558] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000560] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000568] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000570] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000578] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000580] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000588] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000590] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000598] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000005a0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000005a8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter -+-/* [0x000005a0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000005a8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000005b0] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -+-/* [0x000005b8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000005c0] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x000005c8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000005d0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -+-/* [0x000005d8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000005e0] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -+-/* [0x000005e8] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x000005f0] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x000005f8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000600] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x00000608] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000610] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -+-/* [0x00000618] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000620] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000628] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000630] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000638] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000640] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000648] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000650] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000658] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000660] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000668] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000670] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000678] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000680] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000688] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000690] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000698] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006a0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006a8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000006b0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006b8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006c8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000006d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000006f0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006f8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000700] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000708] */ 0x000001d0, 0xf07809e7, // brr.anynn -, r:fast_path -+-/* [0x00000710] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000718] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000720] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000728] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000005b0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000005b8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000005c0] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -++/* [0x000005c8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000005d0] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x000005d8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000005e0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -++/* [0x000005e8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000005f0] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x000005f8] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x00000600] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x00000608] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000610] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x00000618] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000620] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -++/* [0x00000628] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000630] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000638] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000640] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000648] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000650] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000658] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000660] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000668] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000670] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000678] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000680] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000688] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000690] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000698] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000006a0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006a8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006b0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006b8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000006c0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006c8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006d0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006d8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000006e0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006e8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006f0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006f8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000700] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000708] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000710] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000718] */ 0x000001d0, 0xf07809e7, // brr.anynn -, r:fast_path -++/* [0x00000720] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000728] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000730] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000738] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :loop -+-/* [0x00000730] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000738] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000740] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000748] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000750] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -+-/* [0x00000758] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000760] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000768] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000770] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000778] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000780] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000788] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000790] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000798] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000007a0] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000007a8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000007b0] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000007b8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000007c0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000007c8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000007d0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000007d8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000007e0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000007e8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000007f0] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x000007f8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000800] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -+-/* [0x00000808] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000810] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000818] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000820] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000828] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000830] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000838] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000840] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000848] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:loop -+-/* [0x00000850] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00000858] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00000860] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00000868] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00000870] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00000878] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000880] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000888] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000890] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000898] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x000008a0] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x000008a8] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x000008b0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000008b8] */ 0xfffffe58, 0xf06809e7, // brr.anyn -, r:loop -+-/* [0x000008c0] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x000008c8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000008d0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000008d8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000008e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000008e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000008f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000740] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000748] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000750] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000758] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000760] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -++/* [0x00000768] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000770] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000778] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000780] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000788] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000790] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000798] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x000007a0] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000007a8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000007b0] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000007b8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000007c0] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000007c8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000007d0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000007d8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000007e0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000007e8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000007f0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000007f8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000800] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000808] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000810] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000818] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000820] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000828] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000830] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000838] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000840] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000848] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000850] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000858] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:loop -++/* [0x00000860] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00000868] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00000870] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00000878] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00000880] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00000888] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000890] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000898] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x000008a0] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x000008a8] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x000008b0] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x000008b8] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x000008c0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000008c8] */ 0xfffffe58, 0xf06809e7, // brr.anyn -, r:loop -++/* [0x000008d0] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x000008d8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000008e0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000008e8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000008f0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000008f8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000900] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // :fast_path -+-/* [0x000008f8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000908] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :fast_loop -+-/* [0x00000900] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000908] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000910] */ 0x95727d9b, 0x1004475f, // mov.ifz ra_y, ra_y_next ; mov rb31, r3 -+-/* [0x00000918] */ 0x95690dbf, 0x10044623, // mov.ifz ra_x2_base, ra_x2_base_next ; mov r3, rb_pitch -+-/* [0x00000920] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000928] */ 0x929de5e4, 0x100248a1, // min r2, r2, rb_frame_height_minus_1 ; mov r1, r4 -+-/* [0x00000930] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000938] */ 0xec414c87, 0x10024e20, // add t0s, ra_x_base, r2 ; v8subs r0, r0, rb20 -+-/* [0x00000940] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000948] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000950] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000958] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000960] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000968] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000970] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000978] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000980] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000988] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000990] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000998] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x000009a0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x000009a8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x000009b0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000009b8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000009c0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x000009c8] */ 0xffffff18, 0xf06809e7, // brr.anyn -, r:fast_loop -+-/* [0x000009d0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x000009d8] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x000009e0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x000009e8] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x000009f0] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x000009f8] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000a00] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000a08] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000a10] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000a18] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000a20] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000a28] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000a30] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000a38] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:fast_loop -+-/* [0x00000a40] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x00000a48] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a50] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a58] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a60] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a68] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a70] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000910] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000918] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000920] */ 0x95727d9b, 0x1004475f, // mov.ifz ra_y, ra_y_next ; mov rb31, r3 -++/* [0x00000928] */ 0x95690dbf, 0x10044623, // mov.ifz ra_x2_base, ra_x2_base_next ; mov r3, rb_pitch -++/* [0x00000930] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000938] */ 0x929de5e4, 0x100248a1, // min r2, r2, rb_frame_height_minus_1 ; mov r1, r4 -++/* [0x00000940] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000948] */ 0xec414c87, 0x10024e20, // add t0s, ra_x_base, r2 ; v8subs r0, r0, rb20 -++/* [0x00000950] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000958] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000960] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000968] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000970] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000978] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000980] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000988] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000990] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000998] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -++/* [0x000009a0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x000009a8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x000009b0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x000009b8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x000009c0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000009c8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000009d0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x000009d8] */ 0xffffff18, 0xf06809e7, // brr.anyn -, r:fast_loop -++/* [0x000009e0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x000009e8] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x000009f0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x000009f8] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00000a00] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00000a08] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000a10] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000a18] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000a20] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000a28] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000a30] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000a38] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000a40] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000a48] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:fast_loop -++/* [0x00000a50] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x00000a58] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a60] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a68] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a70] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a78] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a80] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_b -+-/* [0x00000a78] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000a80] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000a88] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -+-/* [0x00000a90] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000a98] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x00000aa0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000aa8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -+-/* [0x00000ab0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000ab8] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -+-/* [0x00000ac0] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x00000ac8] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x00000ad0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000ad8] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x00000ae0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000ae8] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -+-/* [0x00000af0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000af8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000b00] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000b08] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000b10] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000b18] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000b20] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000b28] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000b30] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000b38] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000b40] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000b48] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000b50] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000b58] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000b60] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000b68] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000b70] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -+-/* [0x00000b78] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000b80] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000b88] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000b90] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000b98] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000ba0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ba8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bb0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bb8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000bc0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bc8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bd0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bd8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000be0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000be8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bf0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bf8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000c00] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000c08] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000c10] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000a88] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000a90] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000a98] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -++/* [0x00000aa0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000aa8] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x00000ab0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000ab8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -++/* [0x00000ac0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000ac8] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x00000ad0] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x00000ad8] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x00000ae0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000ae8] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x00000af0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000af8] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -++/* [0x00000b00] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000b08] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000b10] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000b18] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000b20] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000b28] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000b30] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000b38] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000b40] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000b48] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000b50] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000b58] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000b60] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000b68] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000b70] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000b78] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000b80] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x00000b88] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000b90] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000b98] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ba0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ba8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000bb0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bb8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bc0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bc8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000bd0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bd8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000be0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000be8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000bf0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000bf8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000c00] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000c08] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000c10] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000c18] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000c20] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :bloop -+-/* [0x00000c18] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000c20] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000c28] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000c30] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000c38] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -+-/* [0x00000c40] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000c48] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000c50] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000c58] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000c60] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000c68] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000c70] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000c78] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000c80] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000c88] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000c90] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000c98] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000ca0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000ca8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000cb0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000cb8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000cc0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000cc8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000cd0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000cd8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000ce0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000ce8] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -+-/* [0x00000cf0] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000cf8] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000d00] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000d08] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000d10] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000d18] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000d20] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000d28] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000d30] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:bloop -+-/* [0x00000d38] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00000d40] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00000d48] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00000d50] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00000d58] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00000d60] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000d68] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000d70] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000d78] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000d80] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000d88] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000d90] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000d98] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000da0] */ 0x8fc8f3f6, 0xd0020867, // asr r1, r1, 15 ; mov -, vr_wait -+-/* [0x00000da8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000db0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x00000db8] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:bloop -+-/* [0x00000dc0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000dc8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x00000dd0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x00000dd8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000de0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000de8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000df0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000c28] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000c30] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000c38] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000c40] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000c48] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -++/* [0x00000c50] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000c58] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000c60] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000c68] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000c70] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000c78] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000c80] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000c88] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000c90] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000c98] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000ca0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000ca8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000cb0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000cb8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000cc0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000cc8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000cd0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000cd8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000ce0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000ce8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000cf0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000cf8] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000d00] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000d08] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000d10] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000d18] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000d20] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000d28] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000d30] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000d38] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000d40] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:bloop -++/* [0x00000d48] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00000d50] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00000d58] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00000d60] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00000d68] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00000d70] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000d78] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000d80] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000d88] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000d90] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000d98] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000da0] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000da8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000db0] */ 0x8fc8f3f6, 0xd0020867, // asr r1, r1, 15 ; mov -, vr_wait -++/* [0x00000db8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000dc0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x00000dc8] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:bloop -++/* [0x00000dd0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000dd8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x00000de0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x00000de8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000df0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000df8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000e00] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_honly -+-/* [0x00000df8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000e00] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000e08] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -+-/* [0x00000e10] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000e18] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x00000e20] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000e28] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -+-/* [0x00000e30] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000e38] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -+-/* [0x00000e40] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x00000e48] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x00000e50] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000e58] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x00000e60] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000e68] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -+-/* [0x00000e70] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000e78] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000e80] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000e88] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000e90] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000e98] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000ea0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000ea8] */ 0x0c9de1c0, 0xd0021467, // add rb17, r0, -2 -+-/* [0x00000eb0] */ 0x919c71c0, 0xd0024812, // shl r0, r0, 7 ; mov rb18,r0 -+-/* [0x00000eb8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000ec0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000ec8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000ed0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000ed8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ee0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ee8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ef0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000ef8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f00] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f08] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f10] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000f18] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000f20] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000f28] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000f30] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000e08] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000e10] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000e18] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -++/* [0x00000e20] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000e28] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -++/* [0x00000e30] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000e38] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -++/* [0x00000e40] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000e48] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x00000e50] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -++/* [0x00000e58] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -++/* [0x00000e60] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000e68] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -++/* [0x00000e70] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000e78] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -++/* [0x00000e80] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000e88] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000e90] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000e98] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000ea0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000ea8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000eb0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000eb8] */ 0x0c9de1c0, 0xd0021467, // add rb17, r0, -2 -++/* [0x00000ec0] */ 0x919c71c0, 0xd0024812, // shl r0, r0, 7 ; mov rb18,r0 -++/* [0x00000ec8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000ed0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000ed8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000ee0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000ee8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ef0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ef8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f00] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000f08] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f10] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f18] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f20] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000f28] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000f30] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000f38] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000f40] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :loop_honly -+-/* [0x00000f38] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000f40] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000f48] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000f50] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000f58] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -+-/* [0x00000f60] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000f68] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000f70] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000f78] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000f80] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000f88] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000f90] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000f98] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000fa0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000fa8] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000fb0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000fb8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000fc0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000fc8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000fd0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000fd8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000fe0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000fe8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000ff0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000ff8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00001000] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00001008] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -+-/* [0x00001010] */ 0x8d5927f6, 0x100269e1, // sub.setf -, r3, rb18 ; mov r1, ra22 -+-/* [0x00001018] */ 0x559f2fc1, 0x100049e0, // mov -, vw_wait ; mul24 r0, r0, r1 -+-/* [0x00001020] */ 0xfffffef8, 0xf06809e7, // brr.anyn -, r:loop_honly -+-/* [0x00001028] */ 0x0f9cf1c0, 0xd0020827, // asr r0, r0, 15 -+-/* [0x00001030] */ 0x129d61c0, 0x10020827, // min r0, r0, rb22 -+-/* [0x00001038] */ 0x139c01c0, 0xd0020c27, // max vpm, r0, 0 -+-/* [0x00001040] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001048] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00001050] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001058] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000f48] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000f50] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000f58] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000f60] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000f68] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -++/* [0x00000f70] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000f78] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000f80] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000f88] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000f90] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000f98] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000fa0] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000fa8] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000fb0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000fb8] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000fc0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000fc8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000fd0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000fd8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000fe0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000fe8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000ff0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000ff8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001000] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001008] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001010] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001018] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -++/* [0x00001020] */ 0x8d5927f6, 0x100269e1, // sub.setf -, r3, rb18 ; mov r1, ra22 -++/* [0x00001028] */ 0x559f2fc1, 0x100049e0, // mov -, vw_wait ; mul24 r0, r0, r1 -++/* [0x00001030] */ 0xfffffef8, 0xf06809e7, // brr.anyn -, r:loop_honly -++/* [0x00001038] */ 0x0f9cf1c0, 0xd0020827, // asr r0, r0, 15 -++/* [0x00001040] */ 0x129d61c0, 0x10020827, // min r0, r0, rb22 -++/* [0x00001048] */ 0x139c01c0, 0xd0020c27, // max vpm, r0, 0 -++/* [0x00001050] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001058] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001060] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001068] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00001060] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001068] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00001070] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001078] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001070] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001078] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+ /* [0x00001080] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00001088] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001090] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00001098] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000010a0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00001090] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001098] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010a0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000010a8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000010b0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_exit1 -+-/* [0x000010a8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000010b0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010b8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010b8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+ /* [0x000010c0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x000010c8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010d0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000010d8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000010e0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000010d0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010d8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010e0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000010e8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000010f0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit -+-/* [0x000010e8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000010f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000010f8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+ /* [0x00001100] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00001108] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001110] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001118] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001110] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001118] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00001120] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001128] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001130] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+@@ -592,225 +592,227 @@ unsigned int rpi_shader[] = { -+ /* [0x00001150] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001158] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001160] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001168] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00001170] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00001178] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00001168] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001170] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001178] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00001180] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00001188] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit4 -+-/* [0x00001180] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001188] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001190] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001190] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+ /* [0x00001198] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x000011a0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000011b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000011a8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011b0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x000011b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000011c0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000011c8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000011d0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000011c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000011c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000011d0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000011d8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000011e0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x000011d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000011e0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011e8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000011e8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+ /* [0x000011f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x000011f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001200] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001208] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001200] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001208] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00001210] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001218] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001220] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001228] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001230] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001238] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00001240] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00001248] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00001238] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001240] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001248] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00001250] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00001258] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_setup_uv -+-/* [0x00001250] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00001258] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -+-/* [0x00001260] */ 0x15827d80, 0x10020767, // mov ra_y, unif -+-/* [0x00001268] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -+-/* [0x00001270] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00001278] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_x2_base -+-/* [0x00001280] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -+-/* [0x00001288] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -+-/* [0x00001290] */ 0x15827d80, 0x10021427, // mov rb16, unif -+-/* [0x00001298] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000012a0] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+-/* [0x000012a8] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+-/* [0x000012b0] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x000012b8] */ 0x00000040, 0xe0020567, // mov ra21, 64 -+-/* [0x000012c0] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+-/* [0x000012c8] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+-/* [0x000012d0] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x000012d8] */ 0x00000040, 0xe0021567, // mov rb21, 64 -+-/* [0x000012e0] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x000012e8] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x000012f0] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x000012f8] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x00001300] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x00001308] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x00001310] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x00001318] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x00001320] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x00001328] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x00001330] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00001338] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00001340] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00001348] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00001350] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00001358] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00001360] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00001368] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00001370] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00001378] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00001380] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00001388] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00001390] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00001398] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x000013a0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x000013a8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x000013b0] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x000013b8] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x000013c0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000013c8] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x000013d0] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x000013d8] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -+-/* [0x000013e0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x000013e8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -+-/* [0x000013f0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x000013f8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x00001400] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00001408] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00001410] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -+-/* [0x00001418] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00001420] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x00001428] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+-/* [0x00001430] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00001438] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001440] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001260] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00001268] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -++/* [0x00001270] */ 0x15827d80, 0x10020767, // mov ra_y, unif -++/* [0x00001278] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -++/* [0x00001280] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00001288] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_x2_base -++/* [0x00001290] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -++/* [0x00001298] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -++/* [0x000012a0] */ 0x15827d80, 0x10021427, // mov rb16, unif -++/* [0x000012a8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000012b0] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x000012b8] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x000012c0] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x000012c8] */ 0x00000020, 0xe0020567, // mov ra21, 32 -++/* [0x000012d0] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x000012d8] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -++/* [0x000012e0] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x000012e8] */ 0x00000040, 0xe0021567, // mov rb21, 64 -++/* [0x000012f0] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x000012f8] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00001300] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x00001308] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x00001310] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x00001318] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x00001320] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x00001328] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x00001330] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x00001338] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x00001340] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00001348] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00001350] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00001358] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00001360] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00001368] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00001370] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00001378] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00001380] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00001388] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00001390] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00001398] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x000013a0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x000013a8] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x000013b0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x000013b8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x000013c0] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x000013c8] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x000013d0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000013d8] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x000013e0] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x000013e8] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -++/* [0x000013f0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000013f8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -++/* [0x00001400] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x00001408] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x00001410] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00001418] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00001420] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -++/* [0x00001428] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00001430] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x00001438] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -++/* [0x00001440] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+ /* [0x00001448] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001450] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00001458] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00001460] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00001468] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001470] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00001478] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00001480] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00001450] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001458] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001460] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00001468] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00001470] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00001478] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001480] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00001488] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00001490] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -+ // ::mc_filter_uv_b -+-/* [0x00001488] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00001490] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00001498] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000014a0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000014a8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000014b0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000014b8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000014c0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000014c8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000014d0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000014d8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000014e0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000014e8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000014f0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000014f8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00001500] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00001508] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00001510] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00001518] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00001520] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00001528] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00001530] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00001538] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00001540] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00001548] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00001550] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00001558] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -+-/* [0x00001560] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00001568] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001570] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001578] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001580] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001588] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00001590] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001598] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015a0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015a8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000015b0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015b8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015c0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015c8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000015d0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015d8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015e0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015e8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x000015f0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000015f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00001600] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00001498] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000014a0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000014a8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000014b0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000014b8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000014c0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000014c8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000014d0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000014d8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000014e0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000014e8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000014f0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000014f8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00001500] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001508] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00001510] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00001518] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00001520] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00001528] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00001530] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00001538] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00001540] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00001548] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00001550] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00001558] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00001560] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00001568] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x00001570] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00001578] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001580] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001588] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001590] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001598] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000015a0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015a8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015b0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015b8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000015c0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015c8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015d0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015d8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000015e0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015e8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015f0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000015f8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00001600] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00001608] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00001610] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00001608] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00001610] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00001618] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00001620] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00001628] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00001630] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00001638] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00001640] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00001648] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00001650] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00001658] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00001660] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00001668] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-/* [0x00001670] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00001678] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00001680] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00001688] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00001690] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00001698] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000016a0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000016a8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000016b0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000016b8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000016c0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000016c8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000016d0] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x000016d8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x000016e0] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -+-/* [0x000016e8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x000016f0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x000016f8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00001700] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00001708] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00001710] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00001718] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00001720] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00001728] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00001730] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00001738] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00001740] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00001748] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00001750] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00001758] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00001760] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00001768] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00001770] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00001778] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00001780] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00001788] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x00001790] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00001798] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x000017a0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000017a8] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x000017b0] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000017b8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x000017c0] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x000017c8] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x000017d0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000017d8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000017e0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000017e8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000017f0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000017f8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001800] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00001808] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001810] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00001618] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00001620] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00001628] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00001630] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00001638] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00001640] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00001648] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00001650] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00001658] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00001660] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00001668] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00001670] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00001678] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -++/* [0x00001680] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00001688] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00001690] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00001698] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000016a0] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000016a8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000016b0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000016b8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000016c0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000016c8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000016d0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000016d8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x000016e0] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000016e8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x000016f0] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x000016f8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00001700] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00001708] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001710] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001718] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001720] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001728] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001730] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00001738] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00001740] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00001748] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00001750] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00001758] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00001760] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00001768] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00001770] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00001778] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00001780] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00001788] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00001790] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00001798] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x000017a0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000017a8] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x000017b0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000017b8] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x000017c0] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000017c8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x000017d0] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x000017d8] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x000017e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000017e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000017f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000017f8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00001800] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001808] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001810] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00001818] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001820] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index db971f4..3464cdb 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -5,16 +5,16 @@ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 146) -+-#define mc_filter (rpi_shader + 360) -+-#define mc_filter_b (rpi_shader + 670) -+-#define mc_filter_honly (rpi_shader + 894) -+-#define mc_exit (rpi_shader + 1048) -+-#define mc_exit1 (rpi_shader + 1066) -+-#define mc_interrupt_exit (rpi_shader + 1082) -+-#define mc_interrupt_exit4 (rpi_shader + 1120) -+-#define mc_interrupt_exit8 (rpi_shader + 1142) -+-#define mc_setup_uv (rpi_shader + 1172) -+-#define mc_filter_uv_b (rpi_shader + 1314) -+-#define mc_end (rpi_shader + 1542) -++#define mc_filter (rpi_shader + 364) -++#define mc_filter_b (rpi_shader + 674) -++#define mc_filter_honly (rpi_shader + 898) -++#define mc_exit (rpi_shader + 1052) -++#define mc_exit1 (rpi_shader + 1070) -++#define mc_interrupt_exit (rpi_shader + 1086) -++#define mc_interrupt_exit4 (rpi_shader + 1124) -++#define mc_interrupt_exit8 (rpi_shader + 1146) -++#define mc_setup_uv (rpi_shader + 1176) -++#define mc_filter_uv_b (rpi_shader + 1318) -++#define mc_end (rpi_shader + 1546) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 02fdcb2..4809e1d 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -21,7 +21,7 @@ -+ # rb19 next ra16 -+ # -+ # ra20 1 -+-# ra21 64 -++# ra21 32 -+ # ra22 256 -+ # ra23 8 -+ # -+@@ -97,7 +97,7 @@ add rb24, r1, r0 -+ # load constants -+ -+ mov ra20, 1 -+-mov ra21, 64 -++mov ra21, 32 -+ mov ra22, 256 -+ mov ra23, 8 -+ -+@@ -270,7 +270,7 @@ add t0s, ra_x2_base, r2 -+ -+ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+-mov r2, rb21 ; mul24 r2, r0, ra0 -++nop ; mul24 r2, r0, ra0 -+ nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+ nop ; mul24 r3, ra1 << 1, r0 << 1 -+ nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+@@ -301,9 +301,9 @@ sub.setf -, r3, 8 ; mov r1, ra22 -+ -+ # apply horizontal filter -+ brr.anyn -, r:uvloop -+-max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr r0, r0, 14 ; mov r1, ra21 -+-min.setf ra15, r0, rb22 -++mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll -++asr ra15, r0, 8 ; nop -++nop ; nop # Delay slot 3 (TODO move more of the context scroll into here) -+ -+ # apply vertical filter and write to VPM -+ -+@@ -315,12 +315,14 @@ add r1, r1, r0 ; mul24 r0, ra10, rb10 -+ add r1, r1, r0 ; mul24 r0, ra9, rb9 -+ add r1, r1, r0 ; mul24 r0, ra8, rb8 -+ add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-add.ifnn r1, r1, r0 ; mov -, vw_wait -++add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-brr.anyn -, r:uvloop -+ asr r1, r1, 14 -+-min r1, r1, rb22 -+-max vpm, r1, 0 -++add r1, r1, ra21 -++brr.anyn -, r:uvloop -++asr r1, r1, 6 # Delay 1 -++min r1, r1, rb22 # Delay 2 -++max vpm, r1, 0 # Delay 3 -+ -+ # DMA out for U -+ -+@@ -1161,7 +1163,7 @@ add rb24, r1, r0 -+ # load constants -+ -+ mov ra20, 1 -+-mov ra21, 64 -++mov ra21, 32 -+ mov ra22, 256 -+ mov ra23, 8 -+ -+-- -+2.5.0 -+ -+ -+From 436c31805d8a53ace0fea63976a464c0e2d2a93c Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 13 May 2015 14:37:32 +0100 -+Subject: [PATCH 19/68] Removed unused luma functions -+ -+--- -+ libavcodec/hevc.c | 4 +- -+ libavcodec/rpi_qpu.c | 32 +- -+ libavcodec/rpi_shader.c | 1097 +++++++++++++------------------------------- -+ libavcodec/rpi_shader.h | 19 +- -+ libavcodec/rpi_shader.qasm | 970 +++------------------------------------ -+ 5 files changed, 396 insertions(+), 1726 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index d4d272a..b4a3707 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2720,8 +2720,8 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ return; -+ for(k=0;k<8;k++) { -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+- s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+- s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP); // Also need a dummy for V -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for V -+ assert(s->u_mvs[k] - s->mvs_base[k] < UV_COMMANDS_PER_QPU); -+ } -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 4d9eda8..4e90cc1 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -172,7 +172,7 @@ static int gpu_init(volatile struct GPU **gpu) { -+ -+ // Now copy over the QPU code into GPU memory -+ { -+- int num_bytes = qpu_get_fn(QPU_MC_END) - qpu_get_fn(QPU_MC_SETUP); -++ int num_bytes = qpu_get_fn(QPU_MC_END) - qpu_get_fn(QPU_MC_SETUP_UV); -+ assert(num_bytes<=QPU_CODE_SIZE*sizeof(unsigned int)); -+ memcpy((void*)ptr->qpu_code, rpi_shader, num_bytes); -+ } -+@@ -612,24 +612,24 @@ unsigned int qpu_get_fn(int num) { -+ gpu_unlock(); -+ } -+ switch(num) { -+- case QPU_MC_SETUP: -+- fn = mc_setup; -+- break; -+- case QPU_MC_FILTER: -+- fn = mc_filter; -+- break; -++ //case QPU_MC_SETUP: -++ // fn = mc_setup; -++ // break; -++ //case QPU_MC_FILTER: -++ // fn = mc_filter; -++ // break; -+ case QPU_MC_EXIT: -+ fn = mc_exit; -+ break; -+- case QPU_MC_INTERRUPT_EXIT: -+- fn = mc_interrupt_exit; -+- break; -+- case QPU_MC_FILTER_B: -+- fn = mc_filter_b; -+- break; -+- case QPU_MC_FILTER_HONLY: -+- fn = mc_filter_honly; -+- break; -++ //case QPU_MC_INTERRUPT_EXIT: -++ // fn = mc_interrupt_exit; -++ // break; -++ //case QPU_MC_FILTER_B: -++ // fn = mc_filter_b; -++ // break; -++ //case QPU_MC_FILTER_HONLY: -++ // fn = mc_filter_honly; -++ // break; -+ case QPU_MC_SETUP_UV: -+ fn = mc_setup_uv; -+ break; -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 831633b..170e8ac 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -21,798 +21,331 @@ __declspec(align(8)) -+ __attribute__((aligned(8))) -+ #endif -+ unsigned int rpi_shader[] = { -+-// ::mc_setup -++// ::mc_setup_uv -+ /* [0x00000000] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+ /* [0x00000008] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -+ /* [0x00000010] */ 0x15827d80, 0x10020767, // mov ra_y, unif -+ /* [0x00000018] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -+-/* [0x00000020] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -+-/* [0x00000028] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -+-/* [0x00000030] */ 0x15827d80, 0x10021427, // mov rb16, unif -+-/* [0x00000038] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000040] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+-/* [0x00000048] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+-/* [0x00000050] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x00000058] */ 0x00000020, 0xe0020567, // mov ra21, 32 -+-/* [0x00000060] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+-/* [0x00000068] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+-/* [0x00000070] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x00000078] */ 0x00000040, 0xe0021567, // mov rb21, 64 -+-/* [0x00000080] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x00000088] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x00000090] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x00000098] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x000000a0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x000000a8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x000000b0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x000000b8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x000000c0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x000000c8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x000000d0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x000000d8] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x000000e0] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x000000e8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x000000f0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x000000f8] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000100] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000108] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000110] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00000118] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00000120] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000128] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000130] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00000138] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000140] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000148] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000150] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000158] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000160] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000168] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000170] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000178] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -+-/* [0x00000180] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x00000188] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x00000190] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -+-/* [0x00000198] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000001a0] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -++/* [0x00000020] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000028] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_x2_base -++/* [0x00000030] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -++/* [0x00000038] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -++/* [0x00000040] */ 0x15827d80, 0x10021427, // mov rb16, unif -++/* [0x00000048] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000050] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x00000058] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x00000060] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x00000068] */ 0x00000020, 0xe0020567, // mov ra21, 32 -++/* [0x00000070] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x00000078] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -++/* [0x00000080] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000088] */ 0x00000040, 0xe0021567, // mov rb21, 64 -++/* [0x00000090] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000098] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x000000a0] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x000000a8] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x000000b0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x000000b8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x000000c0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x000000c8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x000000d0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x000000d8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x000000e0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x000000e8] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x000000f0] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x000000f8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000100] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000108] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000110] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000118] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000120] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000128] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000130] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000138] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000140] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000148] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000150] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000158] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000160] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000168] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000170] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000178] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000180] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000188] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -++/* [0x00000190] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x00000198] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -++/* [0x000001a0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+ /* [0x000001a8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x000001b0] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x000001b8] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x000001c0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x000001b0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000001b8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000001c0] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -+ /* [0x000001c8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x000001d0] */ 0x4c9d00cf, 0x10024821, // add r0, r0, r3; mul24 r1, r1, rb_pitch -+-/* [0x000001d8] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x000001e0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000001e8] */ 0x949dc5c0, 0xd0025890, // and r2, r2, ~3; mov ra_x_base, r0 -+-/* [0x000001f0] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+-/* [0x000001f8] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00000200] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000208] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000210] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000218] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000220] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000228] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000230] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000238] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00000240] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x000001d0] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x000001d8] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -++/* [0x000001e0] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -++/* [0x000001e8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000001f0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000001f8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000200] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000208] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000210] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000218] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000220] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000228] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00000230] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -+ // ::mc_filter_uv -+-/* [0x00000248] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000250] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000258] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000260] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000268] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000270] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000278] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000280] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000288] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000290] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000298] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000002a0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002a8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002b0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002b8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002c0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002c8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002d0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000002d8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x000002e0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000002e8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000002f0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000002f8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000300] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000308] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000310] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000318] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000320] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000330] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000340] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000348] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000350] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000360] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000368] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000370] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000378] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000380] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000388] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000390] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000398] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003a0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000238] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000240] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000248] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000250] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000258] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000260] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000268] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000270] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000278] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000280] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000288] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000290] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000298] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002a0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002a8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002b0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002b8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002c0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000002c8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000002d0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002d8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000002e0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000002e8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000002f0] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x000002f8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000300] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000308] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000310] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000318] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000320] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000330] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000340] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000348] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000350] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000360] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000368] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000370] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000378] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000380] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000388] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000390] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x000003a8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003b0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000003b8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000003c0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003c8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003d0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003d8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003e0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003e8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003f0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000003f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000400] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000408] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000410] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000418] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000420] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000428] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000430] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000438] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000440] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000448] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000450] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000458] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000460] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000468] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000470] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000478] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000480] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000488] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000490] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000498] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x000004a0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x000004a8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x000004b0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000004b8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000004c0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x000004c8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004d0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000004d8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000004e0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000004e8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x000004f0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x000004f8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000500] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000508] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000510] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000518] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000520] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000528] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000530] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000538] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000540] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000548] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000550] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000558] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000560] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000568] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000570] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000578] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000580] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000588] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000590] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000598] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000005a0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000005a8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-// ::mc_filter -+-/* [0x000005b0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000005b8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000005c0] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -+-/* [0x000005c8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000005d0] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x000005d8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000005e0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -+-/* [0x000005e8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000005f0] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -+-/* [0x000005f8] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x00000600] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x00000608] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000610] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x00000618] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000620] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -+-/* [0x00000628] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000630] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000638] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000640] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000648] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000650] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000658] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000660] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000668] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000670] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000678] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000680] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000688] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000690] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000698] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000006a0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006a8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006b0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006b8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000006c0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006c8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006d0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006d8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000006e0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006e8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006f0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006f8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000700] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000708] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000710] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000718] */ 0x000001d0, 0xf07809e7, // brr.anynn -, r:fast_path -+-/* [0x00000720] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000728] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000730] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000738] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+-// :loop -+-/* [0x00000740] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000748] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000750] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000758] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000760] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -+-/* [0x00000768] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000770] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000778] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000780] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000788] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000790] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000798] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x000007a0] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000007a8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000007b0] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000007b8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000007c0] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000007c8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000007d0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000007d8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000007e0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000007e8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000007f0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000007f8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000800] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000808] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000810] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -+-/* [0x00000818] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000820] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000828] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000830] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000838] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000840] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000848] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000850] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000858] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:loop -+-/* [0x00000860] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00000868] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00000870] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00000878] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00000880] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00000888] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000890] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000898] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x000008a0] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x000008a8] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x000008b0] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x000008b8] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x000008c0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000008c8] */ 0xfffffe58, 0xf06809e7, // brr.anyn -, r:loop -+-/* [0x000008d0] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x000008d8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000008e0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000008e8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000008f0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000008f8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000900] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-// :fast_path -+-/* [0x00000908] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+-// :fast_loop -+-/* [0x00000910] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000918] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000920] */ 0x95727d9b, 0x1004475f, // mov.ifz ra_y, ra_y_next ; mov rb31, r3 -+-/* [0x00000928] */ 0x95690dbf, 0x10044623, // mov.ifz ra_x2_base, ra_x2_base_next ; mov r3, rb_pitch -+-/* [0x00000930] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000938] */ 0x929de5e4, 0x100248a1, // min r2, r2, rb_frame_height_minus_1 ; mov r1, r4 -+-/* [0x00000940] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000948] */ 0xec414c87, 0x10024e20, // add t0s, ra_x_base, r2 ; v8subs r0, r0, rb20 -+-/* [0x00000950] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000958] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000960] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000968] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000970] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000978] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000980] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000988] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000990] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000998] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -+-/* [0x000009a0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x000009a8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x000009b0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x000009b8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x000009c0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000009c8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000009d0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x000009d8] */ 0xffffff18, 0xf06809e7, // brr.anyn -, r:fast_loop -+-/* [0x000009e0] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x000009e8] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x000009f0] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x000009f8] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00000a00] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00000a08] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000a10] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000a18] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000a20] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000a28] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000a30] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000a38] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000a40] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000a48] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:fast_loop -+-/* [0x00000a50] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x00000a58] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a60] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a68] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a70] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a78] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a80] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-// ::mc_filter_b -+-/* [0x00000a88] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000a90] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000a98] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -+-/* [0x00000aa0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000aa8] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x00000ab0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000ab8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -+-/* [0x00000ac0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000ac8] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -+-/* [0x00000ad0] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x00000ad8] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x00000ae0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000ae8] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x00000af0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000af8] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -+-/* [0x00000b00] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000b08] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000b10] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000b18] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000b20] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000b28] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000b30] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000b38] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000b40] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000b48] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000b50] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000b58] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000b60] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000b68] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000b70] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000b78] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000b80] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -+-/* [0x00000b88] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000b90] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000b98] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ba0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ba8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000bb0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bb8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bc0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bc8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000bd0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bd8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000be0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000be8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000bf0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000bf8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000c00] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000c08] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000c10] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000c18] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000c20] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+-// :bloop -+-/* [0x00000c28] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000c30] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000c38] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000c40] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000c48] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -+-/* [0x00000c50] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000c58] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000c60] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000c68] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000c70] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000c78] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000c80] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000c88] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000c90] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000c98] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000ca0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000ca8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000cb0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000cb8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000cc0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000cc8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000cd0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000cd8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000ce0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000ce8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000cf0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000cf8] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -+-/* [0x00000d00] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000d08] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000d10] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000d18] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000d20] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000d28] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000d30] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000d38] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000d40] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:bloop -+-/* [0x00000d48] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00000d50] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00000d58] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00000d60] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00000d68] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00000d70] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000d78] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000d80] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000d88] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000d90] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000d98] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000da0] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000da8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000db0] */ 0x8fc8f3f6, 0xd0020867, // asr r1, r1, 15 ; mov -, vr_wait -+-/* [0x00000db8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000dc0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x00000dc8] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:bloop -+-/* [0x00000dd0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000dd8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x00000de0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x00000de8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000df0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000df8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000e00] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-// ::mc_filter_honly -+-/* [0x00000e08] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000e10] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000e18] */ 0x156e7d80, 0x10020667, // mov ra_x2shift, ra_x2shift_next -+-/* [0x00000e20] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000e28] */ 0x0c9c81c0, 0xd00208a7, // add r2, r0, 8 -+-/* [0x00000e30] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000e38] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3,unif -+-/* [0x00000e40] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000e48] */ 0x139c05c0, 0xd00208a7, // max r2, r2, 0 -+-/* [0x00000e50] */ 0x129d95c0, 0x100208a7, // min r2, r2, rb_frame_width_minus_1 -+-/* [0x00000e58] */ 0x119c35c0, 0xd00206e7, // shl ra_x2shift_next, r2, 3 -+-/* [0x00000e60] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000e68] */ 0x0c9e74c0, 0x100208a7, // add r2, r2, r3 -+-/* [0x00000e70] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000e78] */ 0x149dc5c0, 0xd00206a7, // and ra_x2_base_next, r2, ~3 -+-/* [0x00000e80] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000e88] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000e90] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000e98] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000ea0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000ea8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000eb0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000eb8] */ 0x0c9de1c0, 0xd0021467, // add rb17, r0, -2 -+-/* [0x00000ec0] */ 0x919c71c0, 0xd0024812, // shl r0, r0, 7 ; mov rb18,r0 -+-/* [0x00000ec8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000ed0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000ed8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000ee0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000ee8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ef0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ef8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f00] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000f08] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f10] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f18] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f20] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000f28] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000f30] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000f38] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000f40] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+-// :loop_honly -+-/* [0x00000f48] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000f50] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000f58] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000f60] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000f68] */ 0xee654987, 0x10024860, // shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 -+-/* [0x00000f70] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000f78] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000f80] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000f88] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000f90] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000f98] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000fa0] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000fa8] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000fb0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000fb8] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000fc0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000fc8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000fd0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000fd8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000fe0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000fe8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000ff0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000ff8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00001000] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00001008] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00001010] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00001018] */ 0x8d9df4ff, 0x10024823, // sub r0, r2, r3 ; mov r3, rb31 -+-/* [0x00001020] */ 0x8d5927f6, 0x100269e1, // sub.setf -, r3, rb18 ; mov r1, ra22 -+-/* [0x00001028] */ 0x559f2fc1, 0x100049e0, // mov -, vw_wait ; mul24 r0, r0, r1 -+-/* [0x00001030] */ 0xfffffef8, 0xf06809e7, // brr.anyn -, r:loop_honly -+-/* [0x00001038] */ 0x0f9cf1c0, 0xd0020827, // asr r0, r0, 15 -+-/* [0x00001040] */ 0x129d61c0, 0x10020827, // min r0, r0, rb22 -+-/* [0x00001048] */ 0x139c01c0, 0xd0020c27, // max vpm, r0, 0 -+-/* [0x00001050] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001058] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00001060] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001068] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-// ::mc_exit -+-/* [0x00001070] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001078] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00001080] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001088] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001090] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001098] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010a0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000010a8] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000010b0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-// ::mc_exit1 -+-/* [0x000010b8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000010c0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010c8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010d0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010d8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000010e0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000010e8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000010f0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-// ::mc_interrupt_exit -+-/* [0x000010f8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001100] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001108] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001110] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001118] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001120] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001128] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001130] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001138] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001140] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001148] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001150] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001158] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001160] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001168] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001170] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001178] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00001180] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00001188] */ 0x009e7000, 0x100009e7, // nop ; nop -+-// ::mc_interrupt_exit4 -+-/* [0x00001190] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001198] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011a0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011a8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011b0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000011c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000011c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000011d0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000011d8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000011e0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-// ::mc_interrupt_exit8 -+-/* [0x000011e8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000011f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000011f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001200] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001208] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001210] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001218] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001220] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001228] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001230] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001238] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001240] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001248] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00001250] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00001258] */ 0x009e7000, 0x100009e7, // nop ; nop -+-// ::mc_setup_uv -+-/* [0x00001260] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00001268] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -+-/* [0x00001270] */ 0x15827d80, 0x10020767, // mov ra_y, unif -+-/* [0x00001278] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -+-/* [0x00001280] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00001288] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_x2_base -+-/* [0x00001290] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -+-/* [0x00001298] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -+-/* [0x000012a0] */ 0x15827d80, 0x10021427, // mov rb16, unif -+-/* [0x000012a8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000012b0] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+-/* [0x000012b8] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+-/* [0x000012c0] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x000012c8] */ 0x00000020, 0xe0020567, // mov ra21, 32 -+-/* [0x000012d0] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+-/* [0x000012d8] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+-/* [0x000012e0] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x000012e8] */ 0x00000040, 0xe0021567, // mov rb21, 64 -+-/* [0x000012f0] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x000012f8] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x00001300] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x00001308] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x00001310] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x00001318] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x00001320] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x00001328] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x00001330] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x00001338] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x00001340] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00001348] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00001350] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00001358] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00001360] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00001368] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00001370] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00001378] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00001380] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00001388] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00001390] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00001398] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x000013a0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x000013a8] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x000013b0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x000013b8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x000013c0] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x000013c8] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x000013d0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000013d8] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x000013e0] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x000013e8] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -+-/* [0x000013f0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x000013f8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -+-/* [0x00001400] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x00001408] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x00001410] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00001418] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00001420] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -+-/* [0x00001428] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00001430] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x00001438] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+-/* [0x00001440] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00001448] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001450] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001458] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001460] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00001468] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00001470] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00001478] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001480] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00001488] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00001490] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00000398] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003a0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000003a8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000003b0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003b8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003c0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003c8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003d0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003d8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000003e0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000003e8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003f0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000003f8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000400] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000408] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000410] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000418] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000420] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000428] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000430] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000438] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000440] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000448] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000450] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000458] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000460] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000468] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000470] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000478] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000480] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000488] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000490] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000498] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x000004a0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000004a8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000004b0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x000004b8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004c0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000004c8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000004d0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000004d8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x000004e0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x000004e8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x000004f0] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x000004f8] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000500] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000508] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000510] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000518] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000520] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000528] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000530] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000538] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000540] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000548] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000550] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000558] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000560] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000568] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000570] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000578] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000580] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000588] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000590] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000598] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b -+-/* [0x00001498] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000014a0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000014a8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000014b0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000014b8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000014c0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000014c8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000014d0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000014d8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000014e0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000014e8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000014f0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000014f8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00001500] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001508] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00001510] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00001518] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00001520] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00001528] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00001530] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00001538] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00001540] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00001548] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00001550] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00001558] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00001560] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00001568] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -+-/* [0x00001570] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00001578] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001580] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001588] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001590] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001598] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000015a0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015a8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015b0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015b8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000015c0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015c8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015d0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015d8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000015e0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015e8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015f0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000015f8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00001600] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00001608] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00001610] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000005a0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000005a8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000005b0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000005b8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000005c0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000005c8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000005d0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000005d8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000005e0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000005e8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000005f0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000005f8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000600] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000608] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000610] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000618] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000620] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000628] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000630] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000638] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000640] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000648] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000650] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000658] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000660] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000668] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000670] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x00000678] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000680] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000688] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000690] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000698] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006a0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000006a8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006b0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006b8] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006c0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000006c8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006d0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006d8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006e0] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000006e8] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006f0] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006f8] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000700] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000708] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000710] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000718] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00001618] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00001620] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00001628] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00001630] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00001638] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00001640] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00001648] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00001650] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00001658] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00001660] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00001668] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00001670] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00001678] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-/* [0x00001680] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00001688] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00001690] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00001698] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000016a0] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000016a8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000016b0] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000016b8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000016c0] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000016c8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000016d0] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000016d8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000016e0] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x000016e8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x000016f0] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -+-/* [0x000016f8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00001700] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00001708] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00001710] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00001718] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00001720] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00001728] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00001730] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00001738] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00001740] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00001748] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00001750] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00001758] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00001760] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00001768] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00001770] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00001778] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00001780] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00001788] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00001790] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00001798] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-/* [0x000017a0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000017a8] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x000017b0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000017b8] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x000017c0] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000017c8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x000017d0] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x000017d8] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x000017e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000017e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000017f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000017f8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00001800] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001808] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001810] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00001818] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001820] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000720] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000728] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000730] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000738] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000740] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000748] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000750] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000758] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000760] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000768] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000770] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000778] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -++/* [0x00000780] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -++/* [0x00000788] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000790] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000798] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000007a0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000007a8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000007b0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000007b8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000007c0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000007c8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000007d0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000007d8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000007e0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x000007e8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000007f0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x000007f8] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x00000800] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000808] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000810] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000818] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000820] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000828] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000830] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000838] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000840] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000848] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -++/* [0x00000850] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -++/* [0x00000858] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -++/* [0x00000860] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -++/* [0x00000868] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -++/* [0x00000870] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000878] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000880] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000888] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000890] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000898] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x000008a0] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x000008a8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000008b0] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x000008b8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000008c0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x000008c8] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000008d0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x000008d8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x000008e0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x000008e8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000008f0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000008f8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000900] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000908] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000910] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000918] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000920] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000928] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_exit -++/* [0x00000930] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000938] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000940] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000948] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000950] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000958] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000960] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000968] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000970] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_interrupt_exit8 -++/* [0x00000978] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000980] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000988] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000990] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000998] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000009a0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009d0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009d8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000009e0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000009e8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 3464cdb..9de4535 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -3,18 +3,11 @@ -+ -+ extern unsigned int rpi_shader[]; -+ -+-#define mc_setup (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 146) -+-#define mc_filter (rpi_shader + 364) -+-#define mc_filter_b (rpi_shader + 674) -+-#define mc_filter_honly (rpi_shader + 898) -+-#define mc_exit (rpi_shader + 1052) -+-#define mc_exit1 (rpi_shader + 1070) -+-#define mc_interrupt_exit (rpi_shader + 1086) -+-#define mc_interrupt_exit4 (rpi_shader + 1124) -+-#define mc_interrupt_exit8 (rpi_shader + 1146) -+-#define mc_setup_uv (rpi_shader + 1176) -+-#define mc_filter_uv_b (rpi_shader + 1318) -+-#define mc_end (rpi_shader + 1546) -++#define mc_setup_uv (rpi_shader + 0) -++#define mc_filter_uv (rpi_shader + 142) -++#define mc_filter_uv_b (rpi_shader + 360) -++#define mc_exit (rpi_shader + 588) -++#define mc_interrupt_exit8 (rpi_shader + 606) -++#define mc_end (rpi_shader + 636) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 4809e1d..cd7346d 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -71,8 +71,10 @@ -+ -+ .set rb_const_64, rb21 -+ -+-# mc_setup(next_kernel, x, y, ref_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1) -+-::mc_setup -++ -++################################################################################ -++# mc_setup_uv(next_kernel, x, y, ref_u_base, ref_v_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1, pad2) -++::mc_setup_uv -+ -+ # Read starting kernel -+ mov ra31, unif -+@@ -80,7 +82,9 @@ mov ra31, unif -+ # Load first request location -+ add ra_x_base, unif, elem_num # Store x -+ mov ra_y, unif # Store y -+-mov ra_x2_base, unif # Store frame base -++mov ra_x2_base, unif # Store frame u base -++nop -++sub ra_u2v_ref_offset, unif, ra_x2_base # Store offset to add to move from u to v in reference frame -+ -+ # Read image dimensions -+ sub rb25,unif,1 -+@@ -143,29 +147,24 @@ mov r1, vpm_setup(0, 4, h8p(0, 0)) -+ add rb28, r0, r1 -+ -+ # Compute base address for first and second access -+-#add r0, unif, elem_num # x -+ mov r0, ra_x_base # Load x -+-add r2, r0, 8 # x+8 -+ max r0, r0, 0; mov r1, ra_y # Load y -+ min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base # Load the frame base -+-shl ra_xshift_next, r0, 3 -+-max r2, r2, 0 -++shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+ add ra_y, r1, 1 -+-min r2, r2, rb_frame_width_minus_1 -+-shl ra_x2shift_next, r2, 3 -+-max r1, r1, 0 # y -+-min r1, r1, rb_frame_height_minus_1 -+-add r0, r0, r3; mul24 r1, r1, rb_pitch -+-add r2, r2, r3 -++add r0, r0, r3 -+ and r0, r0, ~3 -+-and r2, r2, ~3; mov ra_x_base, r0 -++max r1, r1, 0 ; mov ra_x_base, r0 # y -++min r1, r1, rb_frame_height_minus_1 -+ # submit texture requests for first line -++add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+ add t0s, r0, r1 ; mov ra_x2_base, r2 -+ add t0s, r2, r1 -+ -+ # Dump padding words -+ mov r0, unif -+ mov r0, unif -++mov r0, unif -+ -+ # submit texture requests for second line -+ max r1, ra_y, 0 -+@@ -176,6 +175,8 @@ nop ; mul24 r1, r1, rb_pitch -+ add t0s, r1, ra_x_base -+ add t0s, r1, ra_x2_base -+ -++ -++ -+ ################################################################################ -+ -+ # mc_filter_uv(next_kernel, x, y, frame_u_base, frame_v_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_u_dst, this_v_dst) -+@@ -341,453 +342,26 @@ add vw_setup, rb26, r0 # VDW setup 0 -+ mov vw_setup, rb29 # Stride -+ mov vw_addr, unif # start the VDW -+ -+-################################################################################ -+- -+- -+-# mc_filter(next_kernel, x, y, frame_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_dst) -+- -+-# At this point we have already issued two pairs of texture requests for the current block -+-# ra_x_base, ra_x16_base point to the current coordinates for this block -+-::mc_filter -+-mov ra31, unif -+- -+-# per-channel shifts were calculated on the *previous* invocation -+- -+-mov ra_xshift, ra_xshift_next -+-mov ra_x2shift, ra_x2shift_next -+- -+-# get base addresses and per-channel shifts for *next* invocation -+-add r0, unif, elem_num # x -+-add r2, r0, 8 # x+8 -+-max r0, r0, 0; mov r1, unif # y -+-min r0, r0, rb_frame_width_minus_1 ; mov r3,unif # frame_base -+-shl ra_xshift_next, r0, 3 -+-max r2, r2, 0 -+-min r2, r2, rb_frame_width_minus_1 -+-shl ra_x2shift_next, r2, 3 -+-add r0, r0, r3 -+-add r2, r2, r3 -+-and rb_x_base_next, r0, ~3 -+-and ra_x2_base_next, r2, ~3 -+-mov ra_y_next, r1 -+- -+-# set up VPM write -+-mov vw_setup, rb28 -+- -+-# get width,height of block -+-mov r2, 16 -+-mov r0, unif -+-shr r1, r0, r2 # Extract width -+-sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+-and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -+-shl r0, r0, 7 -+-add r0, r0, r1 # Combine width and height of destination area -+-shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+-add rb26, r0, rb27 -+- -+-sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -+- -+-# get filter coefficients -+- -+-mov r0, unif -+-asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-asr ra0, r0, rb23; mov r0, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -+-asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -+-asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-brr.anynn -, r:fast_path -+-asr rb12, r0, rb23 # delay slot 1 -+- -+-# r2 is elem_num -+-# r3 is loop counter -+- -+-mov r5rep, -8 # delay slot 2 -+- -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] # delay slot 3 -+- -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-## nop ; ldtmu0 # loop counter increment -+-## shr r0, r4, ra17 ; ldtmu0 -+-## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -+-## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -+-## add ra16, ra16, rb16 ; mov t0s, ra16 -+-## -+-## # generate seven shifted versions -+-## # interleave with scroll of vertical context -+-## -+-## mov r2, rb21 ; mul24 r3, r0, ra0 -+-## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-## nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-## nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-## nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-## nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-## nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-## nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-## nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-## sub r2, r2, r3 ; ldtmu0 -+-## -+-## mov r0, ra22 -+-## shr r0, r4, ra17 ; mul24 r2, r2, r0 ; ldtmu0 -+-## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -+-## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -+-## add ra16, ra16, rb16 ; mov t0s, ra16 -+-## -+-## # apply horizontal filter -+-## -+-## asr r2, r2, 15 ; mul24 r3, r0, ra0 -+-## min r2, r2, rb22 -+-## max ra13, r2, 0 -+-## -+-## # generate seven shifted versions -+-## # interleave with scroll of vertical context -+-## -+-## mov r2, rb21 -+-## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-## nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-## nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-## nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-## nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-## nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-## nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-## nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-## sub r0, r2, r3 -+-## -+-## # apply horizontal filter -+-## -+-## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -+-## asr r0, r0, 15 -+-## min r0, r0, rb22 -+-## max ra14, r0, 0 -+-## -+-## -+-## -+-## -+-## nop ; ldtmu0 # loop counter increment -+-## shr r0, r4, ra17 ; ldtmu0 -+-## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -+-## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -+-## add ra16, ra16, rb16 ; mov t0s, ra16 -+-## -+-## # generate seven shifted versions -+-## # interleave with scroll of vertical context -+-## -+-## mov r2, rb21 ; mul24 r3, r0, ra0 -+-## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-## nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-## nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-## nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-## nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-## nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-## nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-## nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-## sub r0, r2, r3 -+-## -+-## # apply horizontal filter -+-## -+-## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -+-## asr r0, r0, 15 -+-## min r0, r0, rb22 -+-## max ra15, r0, 0 -+- -+- -+- -+- -+-mov r3, 0 -+- -+-:loop -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+- -+-max r2, ra_y, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_x2_base, r2 -+- -+-# generate seven shifted versions -+-# interleave with scroll of vertical context -+- -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+- -+-mov r2, rb21 ; mul24 r3, r0, ra0 -+-sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-sub r0, r2, r3 -+- -+-mov r3, rb31 -+- -+-mov ra8, ra9 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+-mov ra12, ra13 -+-mov ra13, ra14 -+- -+-sub.setf -, r3, 8 ; mov r1, ra22 -+- -+-# apply horizontal filter -+-brr.anyn -, r:loop -+-max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr r0, r0, 15 ; mov r1, ra21 -+-min.setf ra15, r0, rb22 -+- -+-# apply vertical filter and write to VPM -+- -+-nop ; mul24 r0, ra14, rb14 -+-sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-brr.anyn -, r:loop -+-asr r1, r1, 15 -+-min r1, r1, rb22 -+-max vpm, r1, 0 -+- -+-# DMA out -+- -+-bra -, ra31 -+-mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -+-mov vw_setup, rb29 -+-mov vw_addr, unif # start the VDW -+- -+-#################################################### -+- -+-:fast_path -+-## nop ; ldtmu0 # loop counter increment -+-## shr r0, r4, ra17 ; ldtmu0 -+-## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -+-## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -+-## add ra16, ra16, rb16 ; mov t0s, ra16 -+-## -+-## # generate seven shifted versions -+-## # interleave with scroll of vertical context -+-## -+-## mov r2, rb21 ; mul24 r3, r0, ra0 -+-## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-## sub r2, r2, r3 ; ldtmu0 -+-## -+-## mov r0, ra22 -+-## shr r0, r4, ra17 ; mul24 r2, r2, r0 ; ldtmu0 -+-## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -+-## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -+-## add ra16, ra16, rb16 ; mov t0s, ra16 -+-## -+-## # apply horizontal filter -+-## -+-## asr r2, r2, 15 ; mul24 r3, r0, ra0 -+-## min r2, r2, rb22 -+-## max ra13, r2, 0 -+-## -+-## # generate seven shifted versions -+-## # interleave with scroll of vertical context -+-## -+-## mov r2, rb21 -+-## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-## sub r0, r2, r3 -+-## -+-## # apply horizontal filter -+-## -+-## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -+-## asr r0, r0, 15 -+-## min r0, r0, rb22 -+-## max ra14, r0, 0 -+-## -+-## -+-## -+-## -+-## nop ; ldtmu0 # loop counter increment -+-## shr r0, r4, ra17 ; ldtmu0 -+-## shr r1, r4, ra17 ; v8subs r0, r0, rb20 -+-## add t0s, ra16, r5 ; v8subs r1, r1, rb20 -+-## add ra16, ra16, rb16 ; mov t0s, ra16 -+-## -+-## # generate seven shifted versions -+-## # interleave with scroll of vertical context -+-## -+-## mov r2, rb21 ; mul24 r3, r0, ra0 -+-## sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-## sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-## sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-## sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-## sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-## sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-## sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-## sub r0, r2, r3 -+-## -+-## # apply horizontal filter -+-## -+-## nop ; mul24 r0, r0, ra22 # last bit of context scroll, including clamp to zero -+-## asr r0, r0, 15 -+-## min r0, r0, rb22 -+-## max ra15, r0, 0 -+- -+- -+-mov r3, 0 # This signifies the amount of unrolling -+- -+-:fast_loop -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-# Due to pipelining we can only skip second pipeline instructions related to the fetched pixels -+-sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_y, ra_y_next ; mov rb31, r3 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov r3, rb_pitch -+- -+-max r2, ra_y, 0 -+-min r2, r2, rb_frame_height_minus_1 ; mov r1, r4 # discard texture read -+-add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r0, r0, rb20 -+-add t0s, ra_x2_base, r2 -+- -+-# generate seven shifted versions -+-# interleave with scroll of vertical context -+- -+-mov r2, rb21 ; mul24 r3, r0, ra0 -+-sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-sub r0, r2, r3 ; mov r3, rb31 -+- -+-mov ra8, ra9 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+-mov ra12, ra13 -+-mov ra13, ra14 -+- -+-sub.setf -, r3, 8 ; mov r1, ra22 -+- -+-# apply horizontal filter -+- -+-brr.anyn -, r:fast_loop -+-max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr r0, r0, 15 ; mov r1, ra21 -+-min.setf ra15, r0, rb22 -+- -+-# apply vertical filter and write to VPM -+- -+-nop ; mul24 r0, ra14, rb14 -+-sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-brr.anyn -, r:fast_loop -+-asr r1, r1, 15 -+-min r1, r1, rb22 -+-max vpm, r1, 0 -+- -+-# DMA out -+- -+-bra -, ra31 -+-mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -+-mov vw_setup, rb29 -+-mov vw_addr, unif # start the VDW -+ -+ ################################################################################ -+ -+-# mc_filter_b(next_kernel, x, y, frame_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_dst) -+- -+-# At this point we have already issued two pairs of texture requests for the current block -+-# ra_x_base, ra_x16_base point to the current coordinates for this block -+-::mc_filter_b -++::mc_filter_uv_b -+ mov ra31, unif -+ -+ # per-channel shifts were calculated on the *previous* invocation -+ -+ mov ra_xshift, ra_xshift_next -+-mov ra_x2shift, ra_x2shift_next -+ -+ # get base addresses and per-channel shifts for *next* invocation -+ add r0, unif, elem_num # x -+-add r2, r0, 8 # x+8 -+ max r0, r0, 0; mov r1, unif # y -+-min r0, r0, rb_frame_width_minus_1 ; mov r3,unif # frame_base -++min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -+ shl ra_xshift_next, r0, 3 -+-max r2, r2, 0 -+-min r2, r2, rb_frame_width_minus_1 -+-shl ra_x2shift_next, r2, 3 -++sub r2, unif, r3 # compute offset from frame base u to frame base v -+ add r0, r0, r3 -+-add r2, r2, r3 -+ and rb_x_base_next, r0, ~3 -+-and ra_x2_base_next, r2, ~3 -+ mov ra_y_next, r1 -++add ra_x2_base_next, rb_x_base_next, r2 -+ -+ # set up VPM write -+ mov vw_setup, rb28 -+@@ -801,17 +375,22 @@ and r0, r0, rb22 # Extract height -+ add rb17, r0, 5 -+ add rb18, r0, 7 -+ shl r0, r0, 7 -++ -+ # r0 is currently height<<7 -+ # For vr_setup we want height<<20 (so 20-7=13 additional bits) -+ shl r3, r0, 13 -+ shl r3, r3, 8 # Mask off top 8 bits -+ shr r3, r3, 8 -++ -+ add r0, r0, r1 # Combine width and height of destination area -+ shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+ add rb26, r0, rb27 -++ -+ # In a B frame, so also set up VPM read -+ add vr_setup, r3, rb28 -+ -++sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -++ -+ # get filter coefficients -+ -+ mov r0, unif -+@@ -837,9 +416,13 @@ asr rb12, r0, rb23 -+ -+ mov r5rep, -8 -+ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -+ mov r3, 0 -+ -+-:bloop -++:uvloop_b -+ # retrieve texture results and pick out bytes -+ # then submit two more texture requests -+ -+@@ -847,7 +430,7 @@ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+ shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+ mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+ -+ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+@@ -861,6 +444,7 @@ add t0s, ra_x2_base, r2 -+ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+ mov r2, rb21 ; mul24 r3, r0, ra0 -++nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+ sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+ nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+ sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+@@ -889,7 +473,7 @@ mov ra13, ra14 -+ sub.setf -, r3, 8 ; mov r1, ra22 -+ -+ # apply horizontal filter -+-brr.anyn -, r:bloop -++brr.anyn -, r:uvloop_b -+ max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+ asr r0, r0, 15 ; mov r1, ra21 -+ min.setf ra15, r0, rb22 -+@@ -906,213 +490,50 @@ sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+ sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+ sub.ifnn r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 15 ; mov -, vr_wait -++asr r1, r1, 15 -+ min r1, r1, rb22 -+ add r0, vpm, 1 # Blend in previous VPM contents at this location -+-brr.anyn -, r:bloop -++brr.anyn -, r:uvloop_b -+ max r1, r1, 0 -+ add r1, r1, r0 -+ shr vpm, r1, 1 -+ -+-# DMA out -++ -++# DMA out for U -++ -++mov vw_setup, rb26 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++# DMA out for V -++# We need to wait for the U to complete first, but have nothing useful to compute while we wait. -++# Could potentially push this write into the start of the next pipeline stage. -++mov r0, 16 -++mov -, vw_wait -+ -+ bra -, ra31 -+-mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -+-mov vw_setup, rb29 -++add vw_setup, rb26, r0 # VDW setup 0 -++mov vw_setup, rb29 # Stride -+ mov vw_addr, unif # start the VDW -+ -+ ################################################################################ -+ -+-# mc_filter_honly(next_kernel, x, y, frame_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_dst) -+-# This filter only does horizontal filtering. -+-# It is assumed that the region to fetch does not include extra rows above. -++# mc_exit() -+ -+-# At this point we have already issued two pairs of texture requests for the current block -+-# ra_x_base, ra_x16_base point to the current coordinates for this block -+-::mc_filter_honly -+-mov ra31, unif -++::mc_exit -++mov -, vw_wait # wait on the VDW -+ -+-# per-channel shifts were calculated on the *previous* invocation -++mov -,srel(0) -+ -+-mov ra_xshift, ra_xshift_next -+-mov ra_x2shift, ra_x2shift_next -+- -+-# get base addresses and per-channel shifts for *next* invocation -+-add r0, unif, elem_num # x -+-add r2, r0, 8 # x+8 -+-max r0, r0, 0; mov r1, unif # y -+-min r0, r0, rb_frame_width_minus_1 ; mov r3,unif # frame_base -+-shl ra_xshift_next, r0, 3 -+-max r2, r2, 0 -+-min r2, r2, rb_frame_width_minus_1 -+-shl ra_x2shift_next, r2, 3 -+-add r0, r0, r3 -+-add r2, r2, r3 -+-and rb_x_base_next, r0, ~3 -+-and ra_x2_base_next, r2, ~3 -+-mov ra_y_next, r1 -+- -+-# set up VPM write -+-mov vw_setup, rb28 -+- -+-# get width,height of block -+-mov r2, 16 -+-mov r0, unif -+-shr r1, r0, r2 # Extract width -+-sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+-and r0, r0, rb22 # Extract height -+-add rb17, r0, -2 # Pipelining means we move data across 2 iterations early -+-shl r0, r0, 7 ; mov rb18,r0 -+-add r0, r0, r1 # Combine width and height of destination area -+-shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+-add rb26, r0, rb27 -+- -+-# get filter coefficients -+- -+-mov r0, unif -+-asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-asr ra0, r0, rb23; mov r0, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -+-mov r0, unif -+- -+-# r2 is elem_num -+-# r3 is loop counter -+-mov r5rep, -8 -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] # delay slot 3 -+-mov r3, 0 -+- -+-:loop_honly -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-shr r1, r4, ra_x2shift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+- -+-max r2, ra_y, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_x2_base, r2 -+- -+-# generate seven shifted versions -+-# interleave with scroll of vertical context -+- -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+- -+-mov r2, rb21 ; mul24 r3, r0, ra0 -+-sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-sub r0, r2, r3 ; mov r3, rb31 -+- -+-sub.setf -, r3, rb18 ; mov r1, ra22 -+- -+-mov -, vw_wait ; mul24 r0, r0, r1 -+-brr.anyn -, r:loop_honly -+-asr r0, r0, 15 # delay 1 -+-min r0, r0, rb22 # delay 2 -+-max vpm, r0, 0 # delay 3 -+- -+-# DMA out -+-bra -, ra31 -+-mov vw_setup, rb26 # VDW: height rows, 16 8-bit units long -+-mov vw_setup, rb29 -+-mov vw_addr, unif # start the VDW -+- -+- -+-################################################################################ -+- -+-# mc_exit() -+- -+-::mc_exit -+-mov -, vw_wait # wait on the VDW -+- -+-mov -,srel(0) -+- -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -+ -+ nop ; nop ; thrend -+ nop ; nop # delay slot 1 -+ nop ; nop # delay slot 2 -+ -+-::mc_exit1 -+-mov -, vw_wait # wait on the VDW -+- -+-#mov -,srel(1) -+- -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+- -+-nop ; nop ; thrend -+-mov interrupt, 1; nop # delay slot 1 -+-nop ; nop # delay slot 2 -+- -+-# mc_interrupt_exit() -+-::mc_interrupt_exit -+-mov -, vw_wait # wait on the VDW -+- -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+- -+-mov -,sacq(0) # 1 -+-mov -,sacq(0) # 2 -+-mov -,sacq(0) # 3 -+-mov -,sacq(0) # 4 -+-mov -,sacq(0) # 5 -+-mov -,sacq(0) # 6 -+-mov -,sacq(0) # 7 -+-mov -,sacq(0) # 8 -+-mov -,sacq(0) # 9 -+-mov -,sacq(0) # 10 -+-mov -,sacq(0) # 11 -+- -+-nop ; nop ; thrend -+-mov interrupt, 1; nop # delay slot 1 -+-nop ; nop # delay slot 2 -+- -+-# mc_interrupt_exit4() -+-::mc_interrupt_exit4 -+-mov -, vw_wait # wait on the VDW -+- -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+- -+-mov -,sacq(0) # 1 -+-mov -,sacq(0) # 2 -+-mov -,sacq(0) # 3 -+- -+-nop ; nop ; thrend -+-mov interrupt, 1; nop # delay slot 1 -+-nop ; nop # delay slot 2 -+- -+ # mc_interrupt_exit8() -+ ::mc_interrupt_exit8 -+ mov -, vw_wait # wait on the VDW -+@@ -1134,282 +555,5 @@ nop ; nop ; thrend -+ mov interrupt, 1; nop # delay slot 1 -+ nop ; nop # delay slot 2 -+ -+-################################################################################ -+-# mc_setup_uv(next_kernel, x, y, ref_u_base, ref_v_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1, pad2) -+-::mc_setup_uv -+- -+-# Read starting kernel -+-mov ra31, unif -+- -+-# Load first request location -+-add ra_x_base, unif, elem_num # Store x -+-mov ra_y, unif # Store y -+-mov ra_x2_base, unif # Store frame u base -+-nop -+-sub ra_u2v_ref_offset, unif, ra_x2_base # Store offset to add to move from u to v in reference frame -+- -+-# Read image dimensions -+-sub rb25,unif,1 -+-sub rb30,unif,1 -+- -+-# get source pitch -+-mov rb16, unif -+- -+-# get destination pitch -+-mov r0, unif -+-mov r1, vdw_setup_1(0) -+-add rb24, r1, r0 -+- -+-# load constants -+- -+-mov ra20, 1 -+-mov ra21, 32 -+-mov ra22, 256 -+-mov ra23, 8 -+- -+-mov rb20, 0xffffff00 -+-mov rb21, 64 -+-mov rb22, 255 -+-mov rb23, 24 -+- -+-# touch vertical context to keep simulator happy -+- -+-mov ra8, 0 -+-mov ra9, 0 -+-mov ra10, 0 -+-mov ra11, 0 -+-mov ra12, 0 -+-mov ra13, 0 -+-mov ra14, 0 -+-mov ra15, 0 -+- -+-# Compute part of VPM to use for DMA output -+-mov r2, qpu_num -+-and r2, r2, 15 -+-mov r1, r2 -+-asr r1, r1, 2 -+-shl r1, r1, 6 -+-mov r0, r2 -+-and r0, r0, 3 -+-add r0, r0, r1 -+-mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -+-shl r0, r0, 5 -+-add rb27, r0, r1 -+- -+-# Compute part of VPM to save data into -+-mov r2, qpu_num -+-and r2, r2, 15 -+-mov r1, r2 -+-asr r1, r1, 2 -+-shl r1, r1, 6 -+-mov r0, r2 -+-and r0, r0, 3 -+-add r0, r0, r1 -+-mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-add rb28, r0, r1 -+- -+-# Compute base address for first and second access -+-mov r0, ra_x_base # Load x -+-max r0, r0, 0; mov r1, ra_y # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base # Load the frame base -+-shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-add ra_y, r1, 1 -+-add r0, r0, r3 -+-and r0, r0, ~3 -+-max r1, r1, 0 ; mov ra_x_base, r0 # y -+-min r1, r1, rb_frame_height_minus_1 -+-# submit texture requests for first line -+-add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-add t0s, r0, r1 ; mov ra_x2_base, r2 -+-add t0s, r2, r1 -+- -+-# Dump padding words -+-mov r0, unif -+-mov r0, unif -+-mov r0, unif -+- -+-# submit texture requests for second line -+-max r1, ra_y, 0 -+-min r1, r1, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 -+-bra -, ra31 -+-nop ; mul24 r1, r1, rb_pitch -+-add t0s, r1, ra_x_base -+-add t0s, r1, ra_x2_base -+- -+- -+- -+-################################################################################ -+- -+-::mc_filter_uv_b -+-mov ra31, unif -+- -+-# per-channel shifts were calculated on the *previous* invocation -+- -+-mov ra_xshift, ra_xshift_next -+- -+-# get base addresses and per-channel shifts for *next* invocation -+-add r0, unif, elem_num # x -+-max r0, r0, 0; mov r1, unif # y -+-min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -+-shl ra_xshift_next, r0, 3 -+-sub r2, unif, r3 # compute offset from frame base u to frame base v -+-add r0, r0, r3 -+-and rb_x_base_next, r0, ~3 -+-mov ra_y_next, r1 -+-add ra_x2_base_next, rb_x_base_next, r2 -+- -+-# set up VPM write -+-mov vw_setup, rb28 -+- -+-# get width,height of block -+-mov r2, 16 -+-mov r0, unif -+-shr r1, r0, r2 # Extract width -+-sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+-and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -+-shl r0, r0, 7 -+- -+-# r0 is currently height<<7 -+-# For vr_setup we want height<<20 (so 20-7=13 additional bits) -+-shl r3, r0, 13 -+-shl r3, r3, 8 # Mask off top 8 bits -+-shr r3, r3, 8 -+- -+-add r0, r0, r1 # Combine width and height of destination area -+-shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+-add rb26, r0, rb27 -+- -+-# In a B frame, so also set up VPM read -+-add vr_setup, r3, rb28 -+- -+-sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -+- -+-# get filter coefficients -+- -+-mov r0, unif -+-asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-asr ra0, r0, rb23; mov r0, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -+-asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -+-asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-asr rb12, r0, rb23 -+- -+-# r2 is elem_num -+-# r3 is loop counter -+- -+-mov r5rep, -8 -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+- -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-mov r3, 0 -+- -+-:uvloop_b -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+- -+-max r2, ra_y, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_x2_base, r2 -+- -+-# generate seven shifted versions -+-# interleave with scroll of vertical context -+- -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+- -+-mov r2, rb21 ; mul24 r3, r0, ra0 -+-nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -+-nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-sub r0, r2, r3 -+- -+-mov r3, rb31 -+- -+-mov ra8, ra9 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+-mov ra12, ra13 -+-mov ra13, ra14 -+- -+-sub.setf -, r3, 8 ; mov r1, ra22 -+- -+-# apply horizontal filter -+-brr.anyn -, r:uvloop_b -+-max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr r0, r0, 15 ; mov r1, ra21 -+-min.setf ra15, r0, rb22 -+- -+-# apply vertical filter and write to VPM -+- -+-nop ; mul24 r0, ra14, rb14 -+-sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-sub.ifnn r1, r1, r0 ; mov -, vw_wait -+-sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 15 -+-min r1, r1, rb22 -+-add r0, vpm, 1 # Blend in previous VPM contents at this location -+-brr.anyn -, r:uvloop_b -+-max r1, r1, 0 -+-add r1, r1, r0 -+-shr vpm, r1, 1 -+- -+- -+-# DMA out for U -+- -+-mov vw_setup, rb26 # VDW setup 0 -+-mov vw_setup, rb29 # Stride -+-mov vw_addr, unif # start the VDW -+- -+-# DMA out for V -+-# We need to wait for the U to complete first, but have nothing useful to compute while we wait. -+-# Could potentially push this write into the start of the next pipeline stage. -+-mov r0, 16 -+-mov -, vw_wait -+- -+-bra -, ra31 -+-add vw_setup, rb26, r0 # VDW setup 0 -+-mov vw_setup, rb29 # Stride -+-mov vw_addr, unif # start the VDW -+- -+ ::mc_end -++# Do not add code here because mc_end must appear after all other code. -+-- -+2.5.0 -+ -+ -+From b0d344c931394c7f734b12ab63b7067857f1a2b3 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 13 May 2015 14:54:25 +0100 -+Subject: [PATCH 20/68] Moved chroma P1 to QPUs -+ -+--- -+ libavcodec/hevc.c | 38 ++++++++++++++++++++++++++++++++++++++ -+ 1 file changed, 38 insertions(+) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index b4a3707..4e9ac54 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2059,6 +2059,44 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ s->sh.luma_offset_l1[current_mv.ref_idx[1]]); -+ -+ if (s->ps.sps->chroma_format_idc) { -++#ifdef RPI_INTER_QPU -++ if (s->enable_rpi) { -++ int reflist = 1; -++ int hshift = s->ps.sps->hshift[1]; -++ int vshift = s->ps.sps->vshift[1]; -++ const Mv *mv = ¤t_mv.mv[reflist]; -++ intptr_t mx = av_mod_uintp2(mv->x, 2 + hshift); -++ intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); -++ intptr_t _mx = mx << (1 - hshift); -++ intptr_t _my = my << (1 - vshift); // Fractional part of motion vector -++ -++ int x1_c = x0_c + (mv->x >> (2 + hshift)); -++ int y1_c = y0_c + (mv->y >> (2 + hshift)); -++ //int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -++ int chan = x0>>8; -++ -++ uint32_t *u = s->u_mvs[chan & 7]; -++ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -++ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -++ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -++ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -++ *u++ = rpi_filter_coefs[_mx][0]; -++ *u++ = rpi_filter_coefs[_mx][1]; -++ *u++ = rpi_filter_coefs[_my][0]; -++ *u++ = rpi_filter_coefs[_my][1]; -++ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -++ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ } -++ } -++ s->u_mvs[chan & 7] = u; -++ return; -++ } -++#endif -+ RPI_REDIRECT(chroma_mc_uni)(s, dst1, s->frame->linesize[1], ref1->frame->data[1], ref1->frame->linesize[1], -+ 1, x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, -+ s->sh.chroma_weight_l1[current_mv.ref_idx[1]][0], s->sh.chroma_offset_l1[current_mv.ref_idx[1]][0]); -+-- -+2.5.0 -+ -+ -+From 9e0a56b87c843033556835e00b562a76fa806f6e Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 13 May 2015 15:13:47 +0100 -+Subject: [PATCH 21/68] Added B prediction - not quite right -+ -+--- -+ libavcodec/hevc.c | 58 ++++++++++++++++++++++++ -+ libavcodec/rpi_shader.c | 108 +++++++++++++++++++++++---------------------- -+ libavcodec/rpi_shader.h | 6 +-- -+ libavcodec/rpi_shader.qasm | 48 ++++++++++---------- -+ 4 files changed, 141 insertions(+), 79 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 4e9ac54..9a13fd4 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2116,6 +2116,64 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ ref1->frame, ¤t_mv.mv[1], ¤t_mv); -+ -+ if (s->ps.sps->chroma_format_idc) { -++#ifdef RPI_INTER_QPU -++ if (s->enable_rpi) { -++ int hshift = s->ps.sps->hshift[1]; -++ int vshift = s->ps.sps->vshift[1]; -++ const Mv *mv = ¤t_mv.mv[0]; -++ intptr_t mx = av_mod_uintp2(mv->x, 2 + hshift); -++ intptr_t my = av_mod_uintp2(mv->y, 2 + vshift); -++ intptr_t _mx = mx << (1 - hshift); -++ intptr_t _my = my << (1 - vshift); // Fractional part of motion vector -++ int x1_c = x0_c + (mv->x >> (2 + hshift)); -++ int y1_c = y0_c + (mv->y >> (2 + hshift)); -++ -++ const Mv *mv2 = ¤t_mv.mv[1]; -++ intptr_t mx2 = av_mod_uintp2(mv2->x, 2 + hshift); -++ intptr_t my2 = av_mod_uintp2(mv2->y, 2 + vshift); -++ intptr_t _mx2 = mx2 << (1 - hshift); -++ intptr_t _my2 = my2 << (1 - vshift); // Fractional part of motion vector -++ -++ int x2_c = x0_c + (mv2->x >> (2 + hshift)); -++ int y2_c = y0_c + (mv2->y >> (2 + hshift)); -++ -++ int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -++ -++ uint32_t *u = s->u_mvs[chan & 7]; -++ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -++ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -++ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -++ *u++ = ( (nPbW_cframe->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); // TODO this will become unused once we have a dedicated pass0 filter -++ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ -++ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x2_c - 3 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y2_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -++ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -++ *u++ = rpi_filter_coefs[_mx2][0]; -++ *u++ = rpi_filter_coefs[_mx2][1]; -++ *u++ = rpi_filter_coefs[_my2][0]; -++ *u++ = rpi_filter_coefs[_my2][1]; -++ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -++ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ } -++ } -++ s->u_mvs[chan & 7] = u; -++ return; -++ } -++#endif -+ RPI_REDIRECT(chroma_mc_bi)(s, dst1, s->frame->linesize[1], ref0->frame, ref1->frame, -+ x0_c, y0_c, nPbW_c, nPbH_c, ¤t_mv, 0); -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 170e8ac..5d00cb2 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -265,23 +265,23 @@ unsigned int rpi_shader[] = { -+ /* [0x00000760] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+ /* [0x00000768] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+ /* [0x00000770] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000778] */ 0x55015fc6, 0x100248a3, // mov r2, rb21 ; mul24 r3, r0, ra0 -+-/* [0x00000780] */ 0x40038031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-/* [0x00000788] */ 0x4d07f4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000778] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000780] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000788] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+ /* [0x00000790] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000798] */ 0x4d0be4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000798] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ /* [0x000007a0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000007a8] */ 0x4d0fd4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000007a8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ /* [0x000007b0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000007b8] */ 0x4d13c4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000007b8] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+ /* [0x000007c0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000007c8] */ 0x4d17b4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000007c8] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+ /* [0x000007d0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000007d8] */ 0x4d1ba4f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000007d8] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+ /* [0x000007e0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000007e8] */ 0x4d1f94f0, 0xd00248a3, // sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000007e8] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+ /* [0x000007f0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x000007f8] */ 0x0d9e74c0, 0x10020827, // sub r0, r2, r3 -++/* [0x000007f8] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+ /* [0x00000800] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+ /* [0x00000808] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+ /* [0x00000810] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+@@ -291,61 +291,63 @@ unsigned int rpi_shader[] = { -+ /* [0x00000830] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+ /* [0x00000838] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+ /* [0x00000840] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000848] */ 0x533c0dc1, 0xd00243a0, // max ra14, ra15, 0 ; mul24 r0, r0, r1 -+-/* [0x00000850] */ 0x8f54f1f6, 0xd0024821, // asr r0, r0, 15 ; mov r1, ra21 -+-/* [0x00000858] */ 0x129d61c0, 0x100223e7, // min.setf ra15, r0, rb22 -+-/* [0x00000860] */ 0x4038e037, 0x100049e0, // nop ; mul24 r0, ra14, rb14 -+-/* [0x00000868] */ 0x4d34d237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-/* [0x00000870] */ 0x4d30c237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000878] */ 0x4d2cb237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000880] */ 0x4d28a237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000888] */ 0x4d249237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000890] */ 0x4d208237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000898] */ 0x4d3cf237, 0x10024860, // sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x000008a0] */ 0x8d9f223f, 0x100a0867, // sub.ifnn r1, r1, r0 ; mov -, vw_wait -++/* [0x00000848] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000850] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000858] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000860] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000868] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000870] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000878] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000880] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000888] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000890] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000898] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x000008a0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+ /* [0x000008a8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000008b0] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -+-/* [0x000008b8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000008c0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x000008c8] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000008d0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x000008d8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x000008e0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x000008e8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000008f0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000008f8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000900] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000908] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000910] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000918] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000920] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000928] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008b0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000008b8] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x000008c0] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x000008c8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000008d0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x000008d8] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000008e0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x000008e8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x000008f0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x000008f8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000900] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000908] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000910] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000918] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000920] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000928] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000930] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000938] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000930] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000938] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000940] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000948] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000940] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000948] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+ /* [0x00000950] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000958] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000960] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000968] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000970] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000960] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000968] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000970] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000978] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000980] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000978] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000980] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000988] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000988] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+ /* [0x00000990] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000998] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000009a0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009a0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000009a8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x000009b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x000009b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x000009c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x000009c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x000009d0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009d8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000009e0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000009e8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000009d8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009e0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000009e8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000009f0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000009f8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 9de4535..e36c4ae 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -6,8 +6,8 @@ extern unsigned int rpi_shader[]; -+ #define mc_setup_uv (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 142) -+ #define mc_filter_uv_b (rpi_shader + 360) -+-#define mc_exit (rpi_shader + 588) -+-#define mc_interrupt_exit8 (rpi_shader + 606) -+-#define mc_end (rpi_shader + 636) -++#define mc_exit (rpi_shader + 592) -++#define mc_interrupt_exit8 (rpi_shader + 610) -++#define mc_end (rpi_shader + 640) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index cd7346d..870437d2 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -443,23 +443,23 @@ add t0s, ra_x2_base, r2 -+ -+ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+-mov r2, rb21 ; mul24 r3, r0, ra0 -+-nop ; mul24.ifnz r3, ra0 << 8, r1 << 8 -+-sub r2, r2, r3 ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24 r2, r0, ra0 -++nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++nop ; mul24 r3, ra1 << 1, r0 << 1 -+ nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-sub r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-sub r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-sub r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+ nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-sub r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+ nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-sub r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+ nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-sub r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+ nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-sub r0, r2, r3 -++add r0, r2, r3 -+ -+ mov r3, rb31 -+ -+@@ -474,23 +474,25 @@ sub.setf -, r3, 8 ; mov r1, ra22 -+ -+ # apply horizontal filter -+ brr.anyn -, r:uvloop_b -+-max ra14, ra15, 0 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr r0, r0, 15 ; mov r1, ra21 -+-min.setf ra15, r0, rb22 -++mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -++asr ra15, r0, 8 ; nop -++nop ; nop -+ -+ # apply vertical filter and write to VPM -+ -+-nop ; mul24 r0, ra14, rb14 -+-sub r1, r1, r0 ; mul24 r0, ra13, rb13 -+-sub r1, r1, r0 ; mul24 r0, ra12, rb12 -+-sub r1, r1, r0 ; mul24 r0, ra11, rb11 -+-sub r1, r1, r0 ; mul24 r0, ra10, rb10 -+-sub r1, r1, r0 ; mul24 r0, ra9, rb9 -+-sub r1, r1, r0 ; mul24 r0, ra8, rb8 -+-sub r1, r1, r0 ; mul24 r0, ra15, rb15 -+-sub.ifnn r1, r1, r0 ; mov -, vw_wait -++nop ; mul24 r1, ra14, rb14 -++nop ; mul24 r0, ra13, rb13 -++add r1, r1, r0 ; mul24 r0, ra12, rb12 -++add r1, r1, r0 ; mul24 r0, ra11, rb11 -++add r1, r1, r0 ; mul24 r0, ra10, rb10 -++add r1, r1, r0 ; mul24 r0, ra9, rb9 -++add r1, r1, r0 ; mul24 r0, ra8, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb15 -++add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 15 -++asr r1, r1, 14 -++add r1, r1, ra21 -++asr r1, r1, 6 -+ min r1, r1, rb22 -+ add r0, vpm, 1 # Blend in previous VPM contents at this location -+ brr.anyn -, r:uvloop_b -+-- -+2.5.0 -+ -+ -+From 9bd4040dfa0e8146dd0a9d7ca191f98078e0d400 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 08:15:55 +0100 -+Subject: [PATCH 22/68] Added flush for SAO -+ -+--- -+ libavcodec/hevc.c | 2 +- -+ libavcodec/hevc_filter.c | 39 ++++++++++++++++++++++++++------------- -+ 2 files changed, 27 insertions(+), 14 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 9a13fd4..96b3568 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2892,7 +2892,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ rpi_execute_inter_qpu(s); -+ #endif -+ // Transform all blocks -+- //printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -++ // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+ rpi_execute_transform(s); -+ // Perform inter prediction -+ rpi_execute_inter_cmds(s); -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 9b6e26d..92a8271 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -871,6 +871,21 @@ static void flush_buffer(AVBufferRef *bref) { -+ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+ gpu_cache_flush(p); -+ } -++ -++static void ff_hevc_flush_chroma(HEVCContext *s) -++{ -++ if (s->enable_rpi && !( s->nal_unit_type == NAL_TRAIL_N || -++ s->nal_unit_type == NAL_TSA_N || -++ s->nal_unit_type == NAL_STSA_N || -++ s->nal_unit_type == NAL_RADL_N || -++ s->nal_unit_type == NAL_RASL_N )) { -++ flush_buffer(s->frame->buf[1]); -++ flush_buffer(s->frame->buf[2]); -++ //memcpy(s->dummy.arm,s->frame->data[0],2048*64); -++ //memcpy(s->dummy.arm,s->frame->data[1],1024*32); -++ //memcpy(s->dummy.arm,s->frame->data[2],1024*32); -++ } -++} -+ #endif -+ -+ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+@@ -886,31 +901,29 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ sao_filter_CTB(s, x - ctb_size, y); -+ if (y && x_end) { -+ sao_filter_CTB(s, x, y - ctb_size); -+- if (s->threads_type & FF_THREAD_FRAME ) -++ if (s->threads_type & FF_THREAD_FRAME ) { -++#ifdef RPI_INTER_QPU -++ ff_hevc_flush_chroma(s); -++#endif -+ ff_thread_report_progress(&s->ref->tf, y, 0); -++ } -+ } -+ if (x_end && y_end) { -+ sao_filter_CTB(s, x , y); -+- if (s->threads_type & FF_THREAD_FRAME ) -++ if (s->threads_type & FF_THREAD_FRAME ) { -++#ifdef RPI_INTER_QPU -++ ff_hevc_flush_chroma(s); -++#endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); -++ } -+ } -+ } else if (s->threads_type & FF_THREAD_FRAME && x_end) { -+ //int newh = y + ctb_size - 4; -+ //int currh = s->ref->tf.progress->data[0]; -+ //if (((y + ctb_size)&63)==0) -+- if (!( s->nal_unit_type == NAL_TRAIL_N || -+- s->nal_unit_type == NAL_TSA_N || -+- s->nal_unit_type == NAL_STSA_N || -+- s->nal_unit_type == NAL_RADL_N || -+- s->nal_unit_type == NAL_RASL_N )) { -+ #ifdef RPI_INTER_QPU -+- flush_buffer(s->frame->buf[1]); -+- flush_buffer(s->frame->buf[2]); -++ ff_hevc_flush_chroma(s); -+ #endif -+- //memcpy(s->dummy.arm,s->frame->data[0],2048*64); -+- //memcpy(s->dummy.arm,s->frame->data[1],1024*32); -+- //memcpy(s->dummy.arm,s->frame->data[2],1024*32); -+- } -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -+ } -+ } -+-- -+2.5.0 -+ -+ -+From d9e8153a94d637578cd0cdb6a0b737957abb8b8f Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 09:17:28 +0100 -+Subject: [PATCH 23/68] Stopped using acceleration in unsupported cases -+ -+--- -+ libavcodec/hevc.c | 14 +++++++------- -+ libavcodec/hevc_cabac.c | 4 ++-- -+ 2 files changed, 9 insertions(+), 9 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 96b3568..b9ae06a 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -1141,15 +1141,11 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < (size * size); i++) { -+ coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); -+ } -+- printf("Cross component not supported\n"); // TODO -+- exit(-1); -+ s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride); -+ } -+ } -+ -+ if (lc->tu.cross_pf) { -+- printf("Cross component not supported\n"); // TODO -+- exit(-1); -+ hls_cross_component_pred(s, 1); -+ } -+ for (i = 0; i < (s->ps.sps->chroma_format_idc == 2 ? 2 : 1); i++) { -+@@ -1178,8 +1174,6 @@ static int hls_transform_unit(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < (size * size); i++) { -+ coeffs[i] = ((lc->tu.res_scale_val * coeffs_y[i]) >> 3); -+ } -+- printf("Cross component not supported\n"); // TODO -+- exit(-1); -+ s->hevcdsp.transform_add[log2_trafo_size_c-2](dst, coeffs, stride); -+ } -+ } -+@@ -2846,7 +2840,13 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; -+ -+ #ifdef RPI -+- s->enable_rpi = 1; // TODO this should depend on cross component and frame width etc. -++ s->enable_rpi = s->ps.sps->bit_depth == 8 -++ && s->ps.sps->width <= RPI_MAX_WIDTH -++ && !s->ps.pps->cross_component_prediction_enabled_flag -++ && s->ps.pps->num_tile_rows <= 1 && s->ps.pps->num_tile_columns <= 1 -++ && !(s->ps.pps->weighted_pred_flag && s->sh.slice_type == P_SLICE) -++ && !(s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE); -++ -+ #endif -+ -+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index f28759b..ca76cb0 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1513,9 +1513,9 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ #ifdef RPI -+ if (!use_vpu) { -+ int max_xy = FFMAX(last_significant_coeff_x, last_significant_coeff_y); -+- if (max_xy == 0) -++ if (max_xy == 0) { -+ s->hevcdsp.idct_dc[log2_trafo_size-2](coeffs); -+- else { -++ } else { -+ int col_limit = last_significant_coeff_x + last_significant_coeff_y + 4; -+ if (max_xy < 4) -+ col_limit = FFMIN(4, col_limit); -+-- -+2.5.0 -+ -+ -+From 0e326aaea2fd684025bfbd676bb7fa6f08acca22 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 09:42:16 +0100 -+Subject: [PATCH 24/68] Split B prediction into two passes -+ -+--- -+ libavcodec/hevc.c | 1 + -+ libavcodec/hevc.h | 1 + -+ libavcodec/rpi_qpu.c | 3 + -+ libavcodec/rpi_qpu.h | 1 + -+ libavcodec/rpi_shader.c | 559 +++++++++++++++++++++++++++------------------ -+ libavcodec/rpi_shader.h | 11 +- -+ libavcodec/rpi_shader.qasm | 196 ++++++++++++++-- -+ 7 files changed, 531 insertions(+), 241 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index b9ae06a..3994f2e 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3795,6 +3795,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ p += uv_commands_per_qpu; -+ } -+ s->mc_filter_uv = qpu_get_fn(QPU_MC_FILTER_UV); -++ s->mc_filter_uv_b0 = qpu_get_fn(QPU_MC_FILTER_UV_B0); -+ s->mc_filter_uv_b = qpu_get_fn(QPU_MC_FILTER_UV_B); -+ -+ } -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 442516d..d33ab74 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -943,6 +943,7 @@ typedef struct HEVCContext { -+ uint32_t *u_mvs[8]; -+ // Function pointers -+ uint32_t mc_filter_uv; -++ uint32_t mc_filter_uv_b0; -+ uint32_t mc_filter_uv_b; -+ #endif -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 4e90cc1..60bf079 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -636,6 +636,9 @@ unsigned int qpu_get_fn(int num) { -+ case QPU_MC_FILTER_UV: -+ fn = mc_filter_uv; -+ break; -++ case QPU_MC_FILTER_UV_B0: -++ fn = mc_filter_uv_b0; -++ break; -+ case QPU_MC_FILTER_UV_B: -+ fn = mc_filter_uv_b; -+ break; -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index f9ad333..543c84b 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -29,6 +29,7 @@ enum { -+ QPU_MC_FILTER_HONLY, -+ QPU_MC_SETUP_UV, -+ QPU_MC_FILTER_UV, -++ QPU_MC_FILTER_UV_B0, -+ QPU_MC_FILTER_UV_B, -+ QPU_MC_INTERRUPT_EXIT8, -+ QPU_MC_END -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 5d00cb2..88ad20b 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -39,18 +39,18 @@ unsigned int rpi_shader[] = { -+ /* [0x00000070] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+ /* [0x00000078] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+ /* [0x00000080] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x00000088] */ 0x00000040, 0xe0021567, // mov rb21, 64 -+-/* [0x00000090] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x00000098] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x000000a0] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x000000a8] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x000000b0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x000000b8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x000000c0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x000000c8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x000000d0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x000000d8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x000000e0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000088] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000090] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00000098] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x000000a0] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x000000a8] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x000000b0] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x000000b8] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x000000c0] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x000000c8] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x000000d0] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x000000d8] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x000000e0] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+ /* [0x000000e8] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+ /* [0x000000f0] */ 0x159e7480, 0x10020867, // mov r1, r2 -+ /* [0x000000f8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+@@ -62,176 +62,176 @@ unsigned int rpi_shader[] = { -+ /* [0x00000128] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+ /* [0x00000130] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+ /* [0x00000138] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000140] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00000148] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000150] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000158] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000160] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000168] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000170] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000178] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000180] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000188] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -+-/* [0x00000190] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x00000198] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -+-/* [0x000001a0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x000001a8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x000001b0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000001b8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000001c0] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -+-/* [0x000001c8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x000001d0] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x000001d8] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+-/* [0x000001e0] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x000001e8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000001f0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000001f8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000200] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000208] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000210] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000218] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000220] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000228] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00000230] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00000140] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x00000148] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000150] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000158] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000160] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000168] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000170] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000178] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000180] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000188] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000190] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -++/* [0x00000198] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -++/* [0x000001a0] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -++/* [0x000001a8] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -++/* [0x000001b0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000001b8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -++/* [0x000001c0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x000001c8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x000001d0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000001d8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000001e0] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -++/* [0x000001e8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x000001f0] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x000001f8] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -++/* [0x00000200] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -++/* [0x00000208] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000210] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000218] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000220] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000228] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000230] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000238] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000240] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000248] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00000250] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -+ // ::mc_filter_uv -+-/* [0x00000238] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000240] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000248] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000250] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000258] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000260] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000268] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000270] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000278] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000280] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000288] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000290] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000298] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002a0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002a8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002b0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002b8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002c0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000002c8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x000002d0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000002d8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000002e0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000002e8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000002f0] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x000002f8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000300] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000308] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000310] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000318] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000320] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000330] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000340] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000348] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000350] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000360] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000368] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000370] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000378] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000380] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000388] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000390] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000258] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000260] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000268] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000270] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000278] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000280] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000288] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000290] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000298] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000002a0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000002a8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000002b0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002b8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002c0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002c8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002d0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002d8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002e0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000002e8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000002f0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002f8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000300] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000308] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000310] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000318] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000320] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000330] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000340] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000348] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000350] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000360] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000368] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000370] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000378] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000380] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000388] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000390] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000398] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x000003a0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000003a8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003b0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x00000398] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003a0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000003a8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000003b0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003b8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003c0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003c8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003d0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003d8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003e0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000003e8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003f0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000003f8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000400] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000408] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000410] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000418] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000420] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000428] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000430] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000438] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000440] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000448] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000450] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000458] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000460] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000468] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000470] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000478] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000480] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000488] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000490] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000498] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x000004a0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000004a8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000004b0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x000004b8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004c0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000004c8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000004d0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000004d8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x000004e0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x000004e8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x000004f0] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x000004f8] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000500] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000508] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000510] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000518] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000520] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000528] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000530] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000538] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000540] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000548] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000550] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000558] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000560] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000568] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000570] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000578] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000580] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000588] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000590] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000598] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-// ::mc_filter_uv_b -+-/* [0x000005a0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000005a8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000005b0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000005b8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000005c0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000005c8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000005d0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000005d8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000005e0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000005e8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000005f0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000005f8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000600] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000608] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000610] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000618] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000620] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000628] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000630] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000638] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000640] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000648] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000650] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000658] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000660] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000668] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000670] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x000003b8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003c0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000003c8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000003d0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003d8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003e0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003e8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003f0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003f8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000400] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000408] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000410] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000418] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000420] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000428] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000430] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000438] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000440] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000448] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000450] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000458] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000460] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000468] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000470] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000478] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000480] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000488] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000490] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000498] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x000004a0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x000004a8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x000004b0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x000004b8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x000004c0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000004c8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000004d0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x000004d8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004e0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000004e8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000004f0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000004f8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000500] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000508] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000510] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000518] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000520] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000528] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000530] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000538] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000540] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000548] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000550] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000558] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000560] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000568] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000570] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000578] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000580] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000588] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000590] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000598] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000005a0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000005a8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000005b0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000005b8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_filter_uv_b0 -++/* [0x000005c0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000005c8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000005d0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000005d8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000005e0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000005e8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000005f0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000005f8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000600] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000608] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000610] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000618] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000620] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000628] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000630] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000638] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000640] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000648] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000650] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000658] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000660] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000668] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000670] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+ /* [0x00000678] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+ /* [0x00000680] */ 0x15827d80, 0x10020827, // mov r0, unif -+ /* [0x00000688] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+@@ -253,7 +253,7 @@ unsigned int rpi_shader[] = { -+ /* [0x00000708] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+ /* [0x00000710] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ /* [0x00000718] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+-// :uvloop_b -++// :uvloop_b0 -+ /* [0x00000720] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+ /* [0x00000728] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+ /* [0x00000730] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+@@ -290,7 +290,7 @@ unsigned int rpi_shader[] = { -+ /* [0x00000828] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+ /* [0x00000830] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+ /* [0x00000838] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000840] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000840] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+ /* [0x00000848] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+ /* [0x00000850] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+ /* [0x00000858] */ 0x009e7000, 0x100009e7, // nop ; nop -+@@ -306,48 +306,163 @@ unsigned int rpi_shader[] = { -+ /* [0x000008a8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+ /* [0x000008b0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+ /* [0x000008b8] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x000008c0] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x000008c8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000008d0] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x000008d8] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000008e0] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x000008e8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x000008f0] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x000008f8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000900] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000908] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000910] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000918] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000920] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000928] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000930] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000938] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008c0] */ 0xfffffad8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000008c8] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x000008d0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000008d8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000008e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000008e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000008f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008f8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000900] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000908] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000910] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000918] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000920] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_filter_uv_b -++/* [0x00000928] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000930] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000938] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000940] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000948] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000950] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000958] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000960] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000968] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000970] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000978] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000980] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000988] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000990] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000998] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000009a0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000009a8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000009b0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000009b8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000009c0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000009c8] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x000009d0] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x000009d8] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x000009e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000009e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000009f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000009f8] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x00000a00] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000a08] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000a10] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a18] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a20] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a28] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000a30] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a38] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a40] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a48] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000a50] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a58] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a60] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a68] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000a70] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a78] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a80] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a88] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000a90] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000a98] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000aa0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :uvloop_b -++/* [0x00000aa8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000ab0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000ab8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000ac0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000ac8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000ad0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000ad8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000ae0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000ae8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000af0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000af8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000b00] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000b08] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000b10] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000b18] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000b20] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000b28] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000b30] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000b38] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000b40] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000b48] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000b50] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000b58] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000b60] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000b68] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000b70] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000b78] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000b80] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000b88] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000b90] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000b98] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000ba0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000ba8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000bb0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000bb8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000bc0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000bc8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000bd0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000bd8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000be0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000be8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000bf0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000bf8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000c00] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000c08] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000c10] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000c18] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000c20] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000c28] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000c30] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000c38] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000c40] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000c48] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000c50] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000c58] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -++/* [0x00000c60] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000c68] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000c70] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x00000c78] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -++/* [0x00000c80] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000c88] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000c90] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000c98] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000ca0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000ca8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000cb0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000cb8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000cc0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000940] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000948] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000950] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000958] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000960] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000968] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000970] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000978] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000980] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000cc8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000cd0] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000cd8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ce0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ce8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000cf0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000cf8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000d00] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000d08] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000988] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000990] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000998] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000009a0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000009a8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000009b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009d0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009d8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009e0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000009e8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000009f0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000009f8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000d10] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000d18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d28] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d30] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d38] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d40] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d48] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d50] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d58] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d60] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d68] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d70] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000d78] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000d80] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index e36c4ae..809e582 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,10 +4,11 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 142) -+-#define mc_filter_uv_b (rpi_shader + 360) -+-#define mc_exit (rpi_shader + 592) -+-#define mc_interrupt_exit8 (rpi_shader + 610) -+-#define mc_end (rpi_shader + 640) -++#define mc_filter_uv (rpi_shader + 150) -++#define mc_filter_uv_b0 (rpi_shader + 368) -++#define mc_filter_uv_b (rpi_shader + 586) -++#define mc_exit (rpi_shader + 818) -++#define mc_interrupt_exit8 (rpi_shader + 836) -++#define mc_end (rpi_shader + 866) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 870437d2..635b894 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -26,7 +26,7 @@ -+ # ra23 8 -+ # -+ # rb20 0xffffff00 -+-# rb21 64 -++# rb21 vpm_setup for writing 16bit results into VPM -+ # rb22 255 -+ # rb23 24 -+ # -+@@ -34,7 +34,7 @@ -+ # rb25 frame width-1 -+ # rb26 height<<23 + width<<16 + vdw_setup_0 -+ # rb27 vdw_setup_0 (depends on QPU number) -+-# rb28 vpm_setup (depends on QPU number) -++# rb28 vpm_setup (depends on QPU number) for writing 8bit results into VPM -+ # rb29 vdw_setup_1(dst_pitch-width) -+ # rb30 frame height-1 -+ # rb31 used as temp to count loop iterations -+@@ -69,8 +69,6 @@ -+ .set ra_y_next, ra28 -+ .set ra_y, ra29 -+ -+-.set rb_const_64, rb21 -+- -+ -+ ################################################################################ -+ # mc_setup_uv(next_kernel, x, y, ref_u_base, ref_v_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1, pad2) -+@@ -106,7 +104,6 @@ mov ra22, 256 -+ mov ra23, 8 -+ -+ mov rb20, 0xffffff00 -+-mov rb21, 64 -+ mov rb22, 255 -+ mov rb23, 24 -+ -+@@ -123,6 +120,7 @@ mov ra15, 0 -+ -+ # Compute part of VPM to use for DMA output -+ mov r2, qpu_num -++shl r2, r2, 1 # Convert QPU numbers to be even (this means we can only use 8 QPUs, but is necessary as we need to save 16bit intermediate results) -+ and r2, r2, 15 -+ mov r1, r2 -+ asr r1, r1, 2 -+@@ -135,16 +133,21 @@ shl r0, r0, 5 -+ add rb27, r0, r1 -+ -+ # Compute part of VPM to save data into -+-mov r2, qpu_num -+-and r2, r2, 15 -+-mov r1, r2 -+-asr r1, r1, 2 -+-shl r1, r1, 6 -+-mov r0, r2 -+-and r0, r0, 3 -+-add r0, r0, r1 -+-mov r1, vpm_setup(0, 4, h8p(0, 0)) -++mov r2, qpu_num # qpu_num = abcd -++shl r2, r2, 1 -++and r2, r2, 15 # r2 = bcd0 -++mov r1, r2 # r1 = bcd0 -++asr r1, r1, 2 # r1 = bc -++shl r1, r1, 6 # r1 = bc000000 -++mov r0, r2 # r0 = bcd0 -++and r0, r0, 3 # r0 = d0 -++add r0, r0, r1 # r0 = bc0000d0 -++mov r1, vpm_setup(0, 4, h8p(0, 0)) # 4 is stride - stride acts on ADDR which is Y[5:0],B[1:0] for 8 bit -+ add rb28, r0, r1 -++asr r0, r0, 1 # r0 = bc0000d -++# Prepare VPM command for 16bit intermediates -++mov r1, vpm_setup(0, 2, h16p(0, 0)) # 2 is stride - stride acts on ADDR which is Y[5:0],H[0] for 16 bit -++add rb21, r0, r1 -+ -+ # Compute base address for first and second access -+ mov r0, ra_x_base # Load x -+@@ -345,6 +348,171 @@ mov vw_addr, unif # start the VDW -+ -+ ################################################################################ -+ -++# mc_filter_uv_b0(next_kernel, x, y, frame_u_base, frame_v_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_u_dst, this_v_dst) -++ -++# At this point we have already issued two pairs of texture requests for the current block -++# ra_x_base, ra_x16_base point to the current coordinates for this block -++::mc_filter_uv_b0 -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # x -++max r0, r0, 0; mov r1, unif # y -++min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -++shl ra_xshift_next, r0, 3 -++sub r2, unif, r3 # compute offset from frame base u to frame base v -++add r0, r0, r3 -++and rb_x_base_next, r0, ~3 -++mov ra_y_next, r1 -++add ra_x2_base_next, rb_x_base_next, r2 -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -++ -++# get filter coefficients -++ -++mov r0, unif -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++asr rb15, r0, rb23; mul24 r0, r0, ra22 -++asr rb14, r0, rb23; mul24 r0, r0, ra22 -++asr rb13, r0, rb23; mul24 r0, r0, ra22 -++asr rb12, r0, rb23 -++ -++# r2 is elem_num -++# r3 is loop counter -++ -++mov r5rep, -8 -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++mov r3, 0 -++ -++:uvloop_b0 -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -++shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_x2_base, r2 -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++nop ; mul24 r2, r0, ra0 -++nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++nop ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++add r0, r2, r3 -++ -++mov r3, rb31 -++ -++mov ra8, ra9 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++mov ra13, ra14 -++ -++sub.setf -, r3, 8 ; mov r1, ra22 -++ -++# apply horizontal filter -++brr.anyn -, r:uvloop_b0 -++mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll -++asr ra15, r0, 8 ; nop -++nop ; nop # Delay slot 3 (TODO move more of the context scroll into here) -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r1, ra14, rb14 -++nop ; mul24 r0, ra13, rb13 -++add r1, r1, r0 ; mul24 r0, ra12, rb12 -++add r1, r1, r0 ; mul24 r0, ra11, rb11 -++add r1, r1, r0 ; mul24 r0, ra10, rb10 -++add r1, r1, r0 ; mul24 r0, ra9, rb9 -++add r1, r1, r0 ; mul24 r0, ra8, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb15 -++add r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++asr r1, r1, 14 -++add r1, r1, ra21 -++brr.anyn -, r:uvloop -++asr r1, r1, 6 # Delay 1 -++min r1, r1, rb22 # Delay 2 -++max vpm, r1, 0 # Delay 3 -++ -++# DMA out for U -++ -++mov vw_setup, rb26 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++# DMA out for V -++# We need to wait for the U to complete first, but have nothing useful to compute while we wait. -++# Could potentially push this write into the start of the next pipeline stage. -++mov r0, 16 -++mov -, vw_wait -++ -++bra -, ra31 -++add vw_setup, rb26, r0 # VDW setup 0 -++mov vw_setup, rb29 # Stride -++mov vw_addr, unif # start the VDW -++ -++################################################################################ -++ -+ ::mc_filter_uv_b -+ mov ra31, unif -+ -+-- -+2.5.0 -+ -+ -+From 2949df95e5f5008ac156336d9089e7b3e9e67841 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 10:04:55 +0100 -+Subject: [PATCH 25/68] Switch to using 16bit temp buffers -+ -+--- -+ libavcodec/hevc.c | 2 +- -+ libavcodec/rpi_shader.c | 4 ++-- -+ libavcodec/rpi_shader.qasm | 10 +++++----- -+ 3 files changed, 8 insertions(+), 8 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 3994f2e..68cd237 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2136,7 +2136,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+- u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b0; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 88ad20b..ffd3a07 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -220,7 +220,7 @@ unsigned int rpi_shader[] = { -+ /* [0x00000600] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+ /* [0x00000608] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+ /* [0x00000610] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000618] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000618] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+ /* [0x00000620] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+ /* [0x00000628] */ 0x15827d80, 0x10020827, // mov r0, unif -+ /* [0x00000630] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+@@ -346,7 +346,7 @@ unsigned int rpi_shader[] = { -+ /* [0x000009e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+ /* [0x000009e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+ /* [0x000009f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000009f8] */ 0x0c9dc7c0, 0x10020c67, // add vr_setup, r3, rb28 -++/* [0x000009f8] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+ /* [0x00000a00] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+ /* [0x00000a08] */ 0x15827d80, 0x10020827, // mov r0, unif -+ /* [0x00000a10] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 635b894..9577121 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -26,7 +26,7 @@ -+ # ra23 8 -+ # -+ # rb20 0xffffff00 -+-# rb21 vpm_setup for writing 16bit results into VPM -++# rb21 vpm_setup for reading/writing 16bit results into VPM -+ # rb22 255 -+ # rb23 24 -+ # -+@@ -370,8 +370,8 @@ and rb_x_base_next, r0, ~3 -+ mov ra_y_next, r1 -+ add ra_x2_base_next, rb_x_base_next, r2 -+ -+-# set up VPM write -+-mov vw_setup, rb28 -++# set up VPM write, we need to save 16bit precision -++mov vw_setup, rb21 -+ -+ # get width,height of block -+ mov r2, 16 -+@@ -554,8 +554,8 @@ add r0, r0, r1 # Combine width and height of destination area -+ shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+ add rb26, r0, rb27 -+ -+-# In a B frame, so also set up VPM read -+-add vr_setup, r3, rb28 -++# In a B frame, so also set up VPM read (reading back 16bit precision) -++add vr_setup, r3, rb21 -+ -+ sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -+ -+-- -+2.5.0 -+ -+ -+From 7a3732950264ea60ac26aeca55d3ac269798d0c3 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 10:30:44 +0100 -+Subject: [PATCH 26/68] Corrected B prediction: matching md5 sum for hobbit50 -+ -+--- -+ libavcodec/rpi_shader.c | 815 ++++++++++++++++++++++----------------------- -+ libavcodec/rpi_shader.h | 12 +- -+ libavcodec/rpi_shader.qasm | 36 +- -+ 3 files changed, 429 insertions(+), 434 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index ffd3a07..77cca46 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -38,431 +38,428 @@ unsigned int rpi_shader[] = { -+ /* [0x00000068] */ 0x00000020, 0xe0020567, // mov ra21, 32 -+ /* [0x00000070] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+ /* [0x00000078] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+-/* [0x00000080] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x00000088] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x00000090] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x00000098] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x000000a0] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x000000a8] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x000000b0] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x000000b8] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x000000c0] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x000000c8] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x000000d0] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x000000d8] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x000000e0] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+-/* [0x000000e8] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x000000f0] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x000000f8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000100] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000108] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000110] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000118] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000120] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00000128] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00000130] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000138] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000140] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+-/* [0x00000148] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00000150] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000158] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000160] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000168] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000170] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000178] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000180] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000188] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000190] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -+-/* [0x00000198] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -+-/* [0x000001a0] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -+-/* [0x000001a8] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -+-/* [0x000001b0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x000001b8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -+-/* [0x000001c0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x000001c8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x000001d0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000001d8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000001e0] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -+-/* [0x000001e8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x000001f0] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x000001f8] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+-/* [0x00000200] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00000208] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000080] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -++/* [0x00000088] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000090] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000098] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x000000a0] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x000000a8] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x000000b0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x000000b8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x000000c0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x000000c8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x000000d0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x000000d8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x000000e0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x000000e8] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x000000f0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x000000f8] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000100] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000108] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000110] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000118] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000120] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000128] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000130] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000138] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000140] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000148] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x00000150] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000158] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000160] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000168] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000170] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000178] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000180] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000188] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000190] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000198] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -++/* [0x000001a0] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -++/* [0x000001a8] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -++/* [0x000001b0] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -++/* [0x000001b8] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000001c0] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -++/* [0x000001c8] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x000001d0] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x000001d8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000001e0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000001e8] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -++/* [0x000001f0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x000001f8] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x00000200] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -++/* [0x00000208] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+ /* [0x00000210] */ 0x15827d80, 0x10020827, // mov r0, unif -+ /* [0x00000218] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000220] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000228] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000230] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000238] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000240] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000248] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00000250] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00000220] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000228] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000230] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000238] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000240] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000248] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000250] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00000258] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -+ // ::mc_filter_uv -+-/* [0x00000258] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000260] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000268] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000270] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000278] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000280] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000288] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000290] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000298] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000002a0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000002a8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000002b0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002b8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002c0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002c8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002d0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002d8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002e0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000002e8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x000002f0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000002f8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000300] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000308] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000310] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000318] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000320] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000330] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000340] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000348] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000350] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000360] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000368] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000370] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000378] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000380] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000388] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000390] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000398] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x000003a0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000003a8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003b0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000260] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000268] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000270] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000278] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000280] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000288] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000290] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000298] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000002a0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000002a8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000002b0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000002b8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002c0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002c8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002d0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002d8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002e0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002e8] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000002f0] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000002f8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000300] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000308] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000310] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000318] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000320] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000328] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000330] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000340] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000348] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000350] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000360] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000368] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000370] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000378] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000380] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000388] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000390] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000398] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000003a0] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x000003a8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000003b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003b8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x000003b8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003c0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000003c8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000003d0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003d8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003e0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003e8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003f0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003f8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000400] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000408] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000410] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000418] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000420] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000428] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000430] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000438] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000440] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000448] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000450] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000458] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000460] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000468] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000470] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000478] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000480] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000488] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000490] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000498] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x000004a0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x000004a8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x000004b0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x000004b8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x000004c0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000004c8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000004d0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x000004d8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004e0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000004e8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000004f0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000004f8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000500] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000508] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000510] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000518] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000520] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000528] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000530] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000538] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000540] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000548] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000550] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000558] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000560] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000568] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000570] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000578] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000580] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000588] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000590] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000598] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000005a0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000005a8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000005b0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000005b8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000003c0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003c8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000003d0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000003d8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003e0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003e8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003f0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003f8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000400] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000408] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000410] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000418] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000420] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000428] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000430] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000438] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000440] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000448] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000450] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000458] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000460] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000468] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000470] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000478] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000480] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000488] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000490] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000498] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x000004a0] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x000004a8] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x000004b0] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x000004b8] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x000004c0] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x000004c8] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000004d0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000004d8] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x000004e0] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004e8] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000004f0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000004f8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000500] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000508] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000510] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000518] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000520] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000528] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000530] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000538] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000540] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000548] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000550] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000558] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000560] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000568] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000570] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000578] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000580] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000588] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000590] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000598] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000005a0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000005a8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000005b0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000005b8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000005c0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x000005c0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000005c8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000005d0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000005d8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000005e0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000005e8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000005f0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000005f8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000600] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000608] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000610] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000618] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000620] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000628] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000630] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000638] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000640] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000648] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000650] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000658] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000660] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000668] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000670] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000678] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000680] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000688] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000690] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000698] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006a0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000006a8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006b0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006b8] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006c0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000006c8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006d0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006d8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006e0] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000006e8] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006f0] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006f8] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000700] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000708] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000710] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000718] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000005c8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000005d0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000005d8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000005e0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000005e8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000005f0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000005f8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000600] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000608] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000610] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000618] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000620] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000628] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000630] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000638] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000640] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000648] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000650] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000658] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000660] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000668] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000670] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000678] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000680] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000688] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000690] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000698] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006a0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006a8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000006b0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006b8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006c8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000006d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000006f0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000006f8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000700] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000708] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000710] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000718] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000720] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000720] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000728] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000730] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000738] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000740] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000748] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000750] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000758] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000760] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000768] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000770] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000778] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000780] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000788] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000790] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000798] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000007a0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000007a8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000007b0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000007b8] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000007c0] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000007c8] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000007d0] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000007d8] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000007e0] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000007e8] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x000007f0] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x000007f8] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000800] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000808] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000810] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000818] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000820] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000828] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000830] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000838] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000840] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000848] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000850] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000858] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000860] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000868] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000870] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000878] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000880] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000888] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000890] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000898] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x000008a0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000008a8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000008b0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000008b8] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x000008c0] */ 0xfffffad8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000008c8] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x000008d0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000008d8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000008e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000008e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000008f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000008f8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000900] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000908] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000910] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000918] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000920] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000728] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000730] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000738] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000740] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000748] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000750] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000758] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000760] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000768] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000770] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000778] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000780] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000788] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000790] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000798] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000007a0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000007a8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000007b0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000007b8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000007c0] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000007c8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000007d0] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000007d8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000007e0] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000007e8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x000007f0] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000007f8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000800] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000808] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000810] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000818] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000820] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000828] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000830] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000838] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000840] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000848] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000850] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000858] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000860] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000868] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000870] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000878] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000880] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000888] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000890] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000898] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x000008a0] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x000008a8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000008b0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000008b8] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000008c0] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -++/* [0x000008c8] */ 0x009e7000, 0x100009e7, // nop -++/* [0x000008d0] */ 0x009e7000, 0x100009e7, // nop -++/* [0x000008d8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000008e0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000008e8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008f0] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000008f8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000900] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000908] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000910] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000918] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b -+-/* [0x00000928] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000930] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000938] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000940] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000948] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000950] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000958] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000960] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000968] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000970] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000978] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000980] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000988] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000990] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000998] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000009a0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000009a8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000009b0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000009b8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x000009c0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000009c8] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x000009d0] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x000009d8] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x000009e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000009e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000009f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000009f8] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000a00] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000a08] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000a10] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a18] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a20] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a28] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000a30] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a38] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a40] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a48] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000a50] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a58] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a60] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a68] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000a70] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a78] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a80] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a88] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000a90] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000a98] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000aa0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000920] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000928] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000930] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000938] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000940] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000948] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000950] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000958] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000960] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000968] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000970] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000978] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000980] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000988] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000990] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000998] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000009a0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000009a8] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000009b0] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000009b8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000009c0] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x000009c8] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x000009d0] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x000009d8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000009e0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000009e8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000009f0] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x000009f8] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000a00] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000a08] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a10] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a18] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a20] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000a28] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a30] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a38] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a40] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000a48] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a50] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a58] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a60] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000a68] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a70] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a78] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000a80] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000a88] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000a90] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000a98] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00000aa8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000ab0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000ab8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000ac0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000ac8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000ad0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000ad8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000ae0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000ae8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000af0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000af8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000b00] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000b08] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000b10] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000b18] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000b20] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000b28] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000b30] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000b38] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000b40] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000b48] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000b50] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000b58] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000b60] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000b68] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000b70] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000b78] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000b80] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000b88] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000b90] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000b98] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000ba0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000ba8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000bb0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000bb8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000bc0] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000bc8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000bd0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000bd8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000be0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000be8] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000bf0] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000bf8] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000c00] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000c08] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000c10] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000c18] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000c20] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000c28] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000c30] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000c38] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000c40] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000c48] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000c50] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000c58] */ 0x0cc01dc0, 0xd0020827, // add r0, vpm, 1 -+-/* [0x00000c60] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000c68] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000c70] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x00000c78] */ 0x0e9c13c0, 0xd0020c27, // shr vpm, r1, 1 -+-/* [0x00000c80] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000c88] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000c90] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000c98] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000ca0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000ca8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000cb0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000cb8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000cc0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000aa0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000aa8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000ab0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000ab8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000ac0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000ac8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000ad0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000ad8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000ae0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000ae8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000af0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000af8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000b00] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000b08] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000b10] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000b18] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000b20] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000b28] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000b30] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000b38] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000b40] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000b48] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000b50] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000b58] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000b60] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000b68] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000b70] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000b78] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000b80] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000b88] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000b90] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000b98] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000ba0] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000ba8] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000bb0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000bb8] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000bc0] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000bc8] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000bd0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000bd8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000be0] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000be8] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000bf0] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000bf8] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000c00] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000c08] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000c10] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000c18] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000c20] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000c28] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000c30] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000c38] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000c40] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000c48] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000c50] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000c58] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000c60] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000c68] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000c70] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000c78] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000c80] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000c88] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000c90] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000c98] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000ca0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000ca8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000cc8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000cd0] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000cb0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000cb8] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000cc0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000cc8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000cd0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000cd8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ce0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ce8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000cf0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000cf8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000d00] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000d08] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000ce0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ce8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000cf0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000d10] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000cf8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000d00] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d08] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000d18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d28] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d30] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000d20] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d28] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000d30] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000d38] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000d40] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000d48] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000d50] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d58] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d60] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d68] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d70] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000d78] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000d80] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000d58] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000d60] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000d68] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 809e582..6562fa9 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,11 +4,11 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 150) -+-#define mc_filter_uv_b0 (rpi_shader + 368) -+-#define mc_filter_uv_b (rpi_shader + 586) -+-#define mc_exit (rpi_shader + 818) -+-#define mc_interrupt_exit8 (rpi_shader + 836) -+-#define mc_end (rpi_shader + 866) -++#define mc_filter_uv (rpi_shader + 152) -++#define mc_filter_uv_b0 (rpi_shader + 370) -++#define mc_filter_uv_b (rpi_shader + 584) -++#define mc_exit (rpi_shader + 812) -++#define mc_interrupt_exit8 (rpi_shader + 830) -++#define mc_end (rpi_shader + 860) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 9577121..562dc35 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -39,13 +39,13 @@ -+ # rb30 frame height-1 -+ # rb31 used as temp to count loop iterations -+ # -+-# ra24...ra30 15, 14, 13, 12, 11, 10, 9 -+ # ra24 clipped(row start address+8+elem_num)&~3 -+ # ra25 per-channel shifts 2 -+ # ra26 next ra24 -+ # ra27 next ra25 -+ # ra28 next y -+ # ra29 y for next texture access -++# ra30 64 -+ # -+ # ra31 next kernel address -+ -+@@ -102,6 +102,7 @@ mov ra20, 1 -+ mov ra21, 32 -+ mov ra22, 256 -+ mov ra23, 8 -++mov ra30, 64 -+ -+ mov rb20, 0xffffff00 -+ mov rb22, 255 -+@@ -472,7 +473,7 @@ sub.setf -, r3, 8 ; mov r1, ra22 -+ # apply horizontal filter -+ brr.anyn -, r:uvloop_b0 -+ mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll -+-asr ra15, r0, 8 ; nop -++asr ra15, r0, 8 ; nop # TODO isn't ra15 already in 24bit precision, may not need the sign extension here? -+ nop ; nop # Delay slot 3 (TODO move more of the context scroll into here) -+ -+ # apply vertical filter and write to VPM -+@@ -487,18 +488,18 @@ add r1, r1, r0 ; mul24 r0, ra8, rb8 -+ add r1, r1, r0 ; mul24 r0, ra15, rb15 -+ add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 14 -+-add r1, r1, ra21 -+-brr.anyn -, r:uvloop -+-asr r1, r1, 6 # Delay 1 -+-min r1, r1, rb22 # Delay 2 -+-max vpm, r1, 0 # Delay 3 -++#asr r1, r1, 14 -++#add r1, r1, ra21 -++brr.anyn -, r:uvloop_b0 -++asr vpm, r1, 14 # Delay 1 shifts down by shift2=6, but results are still in 16bit precision TODO may be able to avoid the mul24 and use more delay slots -++nop # Delay 2 -++nop # Delay 3 -+ -+ # DMA out for U -+ -+ mov vw_setup, rb26 # VDW setup 0 -+ mov vw_setup, rb29 # Stride -+-mov vw_addr, unif # start the VDW -++mov vw_addr, unif # start the VDW # TODO in pass0 we don't need to save any results -+ -+ # DMA out for V -+ # We need to wait for the U to complete first, but have nothing useful to compute while we wait. -+@@ -639,12 +640,11 @@ mov ra12, ra13 -+ mov ra13, ra14 -+ -+ sub.setf -, r3, 8 ; mov r1, ra22 -+- -+ # apply horizontal filter -+ brr.anyn -, r:uvloop_b -+ mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+ asr ra15, r0, 8 ; nop -+-nop ; nop -++nop ; nop # TODO improve use of delay slots -+ -+ # apply vertical filter and write to VPM -+ -+@@ -658,15 +658,13 @@ add r1, r1, r0 ; mul24 r0, ra8, rb8 -+ add r1, r1, r0 ; mul24 r0, ra15, rb15 -+ add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 14 -+-add r1, r1, ra21 -+-asr r1, r1, 6 -+-min r1, r1, rb22 -+-add r0, vpm, 1 # Blend in previous VPM contents at this location -++asr r1, r1, 14 # shift2=6 -++add r1, r1, vpm # Blend in previous VPM contents at this location -++add r1, r1, ra30 -+ brr.anyn -, r:uvloop_b -+-max r1, r1, 0 -+-add r1, r1, r0 -+-shr vpm, r1, 1 -++asr r1, r1, 7 # Delay 1 -++min r1, r1, rb22 # Delay 2 -++max vpm, r1, 0 # Delay 3 -+ -+ -+ # DMA out for U -+-- -+2.5.0 -+ -+ -+From 7f612d9e21849e339ef0ad0e2e5d8a2acaad2552 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 10:55:07 +0100 -+Subject: [PATCH 27/68] P prediction uses 4 tap filters -+ -+--- -+ libavcodec/hevc.c | 50 ++-- -+ libavcodec/rpi_shader.c | 631 ++++++++++++++++++++++----------------------- -+ libavcodec/rpi_shader.h | 10 +- -+ libavcodec/rpi_shader.qasm | 43 +-- -+ 4 files changed, 344 insertions(+), 390 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 68cd237..8984585 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -65,15 +65,15 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ #define ENCODE_COEFFS(c0, c1, c2, c3) (((c0) & 0xff) | ((c1) & 0xff) << 8 | ((c2) & 0xff) << 16 | ((c3) & 0xff) << 24) -+ -+ // TODO Chroma only needs 4 taps -+-static uint32_t rpi_filter_coefs[8][2] = { -+- { ENCODE_COEFFS( 0, 0, 0, 64), ENCODE_COEFFS( 0, 0, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -2, 58), ENCODE_COEFFS( 10, -2, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -4, 54), ENCODE_COEFFS( 16, -2, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -6, 46), ENCODE_COEFFS( 28, -4, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -4, 36), ENCODE_COEFFS( 36, -4, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -4, 28), ENCODE_COEFFS( 46, -6, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -2, 16), ENCODE_COEFFS( 54, -4, 0, 0 ) }, -+- { ENCODE_COEFFS( 0, 0, -2, 10), ENCODE_COEFFS( 58, -2, 0, 0 ) } -++static uint32_t rpi_filter_coefs[8][1] = { -++ { ENCODE_COEFFS( 0, 64, 0, 0) }, -++ { ENCODE_COEFFS( -2, 58, 10, -2) }, -++ { ENCODE_COEFFS( -4, 54, 16, -2) }, -++ { ENCODE_COEFFS( -6, 46, 28, -4) }, -++ { ENCODE_COEFFS( -4, 36, 36, -4) }, -++ { ENCODE_COEFFS( -4, 28, 46, -6) }, -++ { ENCODE_COEFFS( -2, 16, 54, -4) }, -++ { ENCODE_COEFFS( -2, 10, 58, -2) } -+ }; -+ -+ static uint32_t get_vc_address(AVBufferRef *bref) { -+@@ -2016,16 +2016,16 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -+ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+- *u++ = rpi_filter_coefs[_mx][1]; -++ u++; -+ *u++ = rpi_filter_coefs[_my][0]; -+- *u++ = rpi_filter_coefs[_my][1]; -++ u++; -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2073,16 +2073,16 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -+ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+- *u++ = rpi_filter_coefs[_mx][1]; -++ u++; -+ *u++ = rpi_filter_coefs[_my][0]; -+- *u++ = rpi_filter_coefs[_my][1]; -++ u++; -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2137,29 +2137,29 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b0; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 3 + start_x; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -+ *u++ = ( (nPbW_cframe->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); // TODO this will become unused once we have a dedicated pass0 filter -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = x2_c - 3 + start_x; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = y2_c - 3 + start_y; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = x2_c - 1 + start_x; -++ u++[-RPI_CHROMA_COMMAND_WORDS] = y2_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -+ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx2][0]; -+- *u++ = rpi_filter_coefs[_mx2][1]; -++ u++; -+ *u++ = rpi_filter_coefs[_my2][0]; -+- *u++ = rpi_filter_coefs[_my2][1]; -++ u++; -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 77cca46..c8d0728 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -116,8 +116,8 @@ unsigned int rpi_shader[] = { -+ /* [0x000002d0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+ /* [0x000002d8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+ /* [0x000002e0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002e8] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000002f0] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000002e8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000002f0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+ /* [0x000002f8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+ /* [0x00000300] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+ /* [0x00000308] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+@@ -128,338 +128,315 @@ unsigned int rpi_shader[] = { -+ /* [0x00000330] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ /* [0x00000338] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ /* [0x00000340] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000348] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000350] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000360] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000368] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000370] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000378] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000380] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000388] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000390] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000398] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000003a0] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x000003a8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000003b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003b8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000348] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000350] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000360] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000368] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000370] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000378] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000380] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x000003c0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003c8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000003d0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000003d8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003e0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003e8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003f0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003f8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000400] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000408] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000410] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000418] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000420] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000428] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000430] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000438] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000440] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000448] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000450] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000458] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000460] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000468] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000470] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000478] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000480] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000488] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000490] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000498] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x000004a0] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x000004a8] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x000004b0] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x000004b8] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x000004c0] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x000004c8] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000004d0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000004d8] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x000004e0] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004e8] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000004f0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000004f8] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000500] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000508] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000510] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000518] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000520] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000528] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000530] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000538] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000540] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000548] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000550] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000558] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000560] */ 0xfffffe40, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000568] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000570] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000578] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000580] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000588] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000590] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000598] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000005a0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000005a8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000005b0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000005b8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000005c0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000388] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000390] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000398] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000003a0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003a8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003b0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003b8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003c0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003c8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000003d0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000003d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003e0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000003e8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000003f0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000003f8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000400] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000408] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000410] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000418] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000420] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000428] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000430] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000438] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000440] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -++/* [0x00000448] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000450] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000458] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000460] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000468] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000470] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000478] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000480] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000488] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000490] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000498] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000004a0] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x000004a8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004b0] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x000004b8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000004c0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000004c8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000004d0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004d8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000004e0] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000004e8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000004f0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000004f8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000500] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000508] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x000005c8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000005d0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000005d8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000005e0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000005e8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000005f0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000005f8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000600] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000608] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000610] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000618] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000620] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000628] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000630] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000638] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000640] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000648] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000650] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000658] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000660] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000668] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000670] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000678] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000680] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000688] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000690] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000698] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006a0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006a8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000006b0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006b8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006c8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000006d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000006f0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000006f8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000700] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000708] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000710] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000718] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000720] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000510] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000518] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000520] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000528] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000530] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000538] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000540] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000548] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000550] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000558] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000560] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000568] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000570] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000578] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000580] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000588] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000590] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000598] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000005a0] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x000005a8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000005b0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000005b8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000005c0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000005c8] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x000005d0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005d8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005f0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000005f8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000600] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000608] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000610] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000618] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000620] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000628] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000630] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000638] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000640] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000648] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000650] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000658] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000660] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000668] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000728] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000730] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000738] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000740] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000748] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000750] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000758] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000760] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000768] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000770] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000778] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000780] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000788] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000790] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000798] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000007a0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000007a8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000007b0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000007b8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000007c0] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000007c8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000007d0] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000007d8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000007e0] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000007e8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000007f0] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x000007f8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000800] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000808] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000810] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000818] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000820] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000828] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000830] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000838] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000840] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000848] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000850] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000858] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000860] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000868] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000870] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000878] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000880] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000888] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000890] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000898] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x000008a0] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x000008a8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000008b0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000008b8] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x000008c0] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -+-/* [0x000008c8] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x000008d0] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x000008d8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000008e0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000008e8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000008f0] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000008f8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000900] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000908] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000910] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000918] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000670] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000678] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000680] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000688] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000690] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000698] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000006a0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000006a8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000006b0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000006b8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000006c0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000006c8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000006d0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000006d8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000006e0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000006e8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000006f0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000006f8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000700] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000708] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000710] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000718] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000720] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000728] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000730] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000738] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000740] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000748] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000750] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000758] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000760] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000768] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000770] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000778] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000780] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000788] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000790] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000798] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000007a0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000007a8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000007b0] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x000007b8] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x000007c0] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x000007c8] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x000007d0] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x000007d8] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x000007e0] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x000007e8] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x000007f0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000007f8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000800] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000808] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -++/* [0x00000810] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000818] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000820] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000828] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000830] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000838] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000840] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000848] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000850] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000858] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000860] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b -+-/* [0x00000920] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000928] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000930] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000938] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000940] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000948] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000950] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000958] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000960] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000968] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000970] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000978] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000980] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000988] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000990] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000998] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000009a0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000009a8] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000009b0] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x000009b8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000009c0] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x000009c8] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x000009d0] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x000009d8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000009e0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000009e8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000009f0] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x000009f8] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000a00] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000a08] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a10] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a18] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a20] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000a28] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a30] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a38] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a40] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000a48] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a50] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a58] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a60] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000a68] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a70] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a78] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000a80] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000a88] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000a90] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000a98] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000868] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000870] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000878] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000880] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000888] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000890] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000898] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000008a0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000008a8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000008b0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000008b8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000008c0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000008c8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000008d0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008d8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000008e0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000008e8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000008f0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x000008f8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000900] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000908] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000910] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000918] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000920] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000928] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000930] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000938] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000940] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000948] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000950] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000958] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000960] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000968] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000970] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000978] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000980] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000988] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000990] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000998] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000009a0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000009a8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000009b0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000009b8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000009c0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000009c8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x000009d0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000009d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000009e0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00000aa0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000aa8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000ab0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000ab8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000ac0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000ac8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000ad0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000ad8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000ae0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000ae8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000af0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000af8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000b00] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000b08] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000b10] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000b18] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000b20] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000b28] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000b30] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000b38] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000b40] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000b48] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000b50] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000b58] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000b60] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000b68] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000b70] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000b78] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000b80] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000b88] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000b90] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000b98] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000ba0] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000ba8] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000bb0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000bb8] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000bc0] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000bc8] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000bd0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000bd8] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000be0] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000be8] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000bf0] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000bf8] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000c00] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000c08] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000c10] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000c18] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000c20] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000c28] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000c30] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000c38] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000c40] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000c48] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000c50] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000c58] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000c60] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000c68] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000c70] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000c78] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000c80] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000c88] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000c90] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000c98] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000ca0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000ca8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000009e8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000009f0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000009f8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000a00] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000a08] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000a10] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000a18] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000a20] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000a28] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000a30] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000a38] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000a40] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000a48] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000a50] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000a58] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000a60] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000a68] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000a70] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000a78] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000a80] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00000a88] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00000a90] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00000a98] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00000aa0] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00000aa8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00000ab0] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00000ab8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000ac0] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000ac8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000ad0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000ad8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000ae0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000ae8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000af0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000af8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000b00] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000b08] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000b10] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000b18] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000b20] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b28] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000b30] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000b38] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000b40] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000b48] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000b50] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000b58] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000b60] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000b68] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000b70] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000b78] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000b80] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000b88] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000b90] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000b98] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000ba0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000ba8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000bb0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000bb8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000bc0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000bc8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000bd0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000bd8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000be0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000be8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000bf0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000cb0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000cb8] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000cc0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000cc8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000cd0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000cd8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ce0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000ce8] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000cf0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000bf8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000c00] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000c08] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c28] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000c30] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000c38] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000cf8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000d00] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d08] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000d20] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d28] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d30] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d38] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d40] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d48] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d50] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000d58] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000d60] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000d68] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000c40] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000c48] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c58] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000c68] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000c70] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000c78] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000c80] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000c88] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000c90] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000c98] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ca0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ca8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000cb0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 6562fa9..1bf7a68 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -5,10 +5,10 @@ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 152) -+-#define mc_filter_uv_b0 (rpi_shader + 370) -+-#define mc_filter_uv_b (rpi_shader + 584) -+-#define mc_exit (rpi_shader + 812) -+-#define mc_interrupt_exit8 (rpi_shader + 830) -+-#define mc_end (rpi_shader + 860) -++#define mc_filter_uv_b0 (rpi_shader + 324) -++#define mc_filter_uv_b (rpi_shader + 538) -++#define mc_exit (rpi_shader + 766) -++#define mc_interrupt_exit8 (rpi_shader + 784) -++#define mc_end (rpi_shader + 814) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 562dc35..8e4f18f 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -16,8 +16,8 @@ -+ # ra19 next ra17 -+ # -+ # rb16 pitch -+-# rb17 height + 5 -+-# rb18 height + 7 -++# rb17 height + 1 -++# rb18 height + 3 -+ # rb19 next ra16 -+ # -+ # ra20 1 -+@@ -214,8 +214,8 @@ mov r0, unif -+ shr r1, r0, r2 # Extract width -+ sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+ and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -++add rb17, r0, 1 -++add rb18, r0, 3 -+ shl r0, r0, 7 -+ add r0, r0, r1 # Combine width and height of destination area -+ shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+@@ -230,18 +230,11 @@ asr ra3, r0, rb23; mul24 r0, r0, ra22 -+ asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ asr ra0, r0, rb23; mov r0, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -++ mov r0, unif -+ asr rb11, r0, rb23; mul24 r0, r0, ra22 -+ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+ asr rb8, r0, rb23; mov r0, unif -+-asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-asr rb12, r0, rb23 -+ -+ # r2 is elem_num -+ # r3 is loop counter -+@@ -283,26 +276,14 @@ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+ add r0, r2, r3 -+ -+ mov r3, rb31 -+ -+-mov ra8, ra9 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+ mov ra12, ra13 -+ mov ra13, ra14 -+ -+-sub.setf -, r3, 8 ; mov r1, ra22 -++sub.setf -, r3, 4 ; mov r1, ra22 -+ -+ # apply horizontal filter -+ brr.anyn -, r:uvloop -+@@ -312,14 +293,10 @@ nop ; nop # Delay slot 3 (TODO move more of the context scr -+ -+ # apply vertical filter and write to VPM -+ -+-nop ; mul24 r1, ra14, rb14 -+-nop ; mul24 r0, ra13, rb13 -+-add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-add r1, r1, r0 ; mul24 r0, ra15, rb15 -++nop ; mul24 r1, ra14, rb10 -++nop ; mul24 r0, ra13, rb9 -++add r1, r1, r0 ; mul24 r0, ra12, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb11 -+ add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+ asr r1, r1, 14 -+-- -+2.5.0 -+ -+ -+From b7f5bb6522a31aeb9e69f18f3b5cc9c73636685c Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 11:03:51 +0100 -+Subject: [PATCH 28/68] Optimised B0 pass -+ -+--- -+ libavcodec/rpi_shader.c | 424 +++++++++++++++++++++------------------------ -+ libavcodec/rpi_shader.h | 8 +- -+ libavcodec/rpi_shader.qasm | 43 +---- -+ 3 files changed, 212 insertions(+), 263 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index c8d0728..1f63ee0 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -204,239 +204,215 @@ unsigned int rpi_shader[] = { -+ /* [0x00000580] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+ /* [0x00000588] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+ /* [0x00000590] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000598] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000005a0] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000598] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000005a0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+ /* [0x000005a8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+ /* [0x000005b0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+ /* [0x000005b8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+ /* [0x000005c0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000005c8] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x000005d0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005d8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005f0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000005f8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000600] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000608] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000610] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000618] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000620] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000628] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000630] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000638] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000640] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000648] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000650] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000658] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000660] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000668] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000005c8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005d0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005d8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000005f0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005f8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000600] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000608] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000610] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000618] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000620] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000628] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000670] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000678] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000680] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000688] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000690] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000698] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000006a0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000006a8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000006b0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000006b8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000006c0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000006c8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000006d0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000006d8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000006e0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000006e8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000006f0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000006f8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000700] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000708] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000710] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000718] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000720] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000728] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000730] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000738] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000740] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000748] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000750] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000758] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000760] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000768] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000770] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000778] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000780] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000788] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000790] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000798] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000007a0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000007a8] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000007b0] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x000007b8] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x000007c0] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x000007c8] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x000007d0] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x000007d8] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x000007e0] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x000007e8] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x000007f0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000007f8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000800] */ 0xfffffe50, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000808] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -+-/* [0x00000810] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000818] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000820] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000828] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000830] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000838] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000840] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000848] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000850] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000858] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000860] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000630] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000638] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000640] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000648] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000650] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000658] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000660] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000668] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000670] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000678] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000680] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000688] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000690] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000698] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000006a0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000006a8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000006b0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000006b8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000006c0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000006c8] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x000006d0] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x000006d8] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000006e0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000006e8] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -++/* [0x000006f0] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000006f8] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000700] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000708] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000710] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000718] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000720] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000728] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000730] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000738] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000740] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000748] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -++/* [0x00000750] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000758] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000760] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000768] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000770] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000778] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000780] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000788] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000790] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000798] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000007a0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b -+-/* [0x00000868] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000870] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000878] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000880] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000888] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000890] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000898] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000008a0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000008a8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000008b0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000008b8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000008c0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000008c8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000008d0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008d8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000008e0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000008e8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000008f0] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x000008f8] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000900] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000908] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000910] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000918] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000920] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000928] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000930] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000938] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000940] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000948] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000950] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000958] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000960] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000968] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000970] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000978] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000980] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000988] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000990] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000998] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000009a0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000009a8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000009b0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000009b8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000009c0] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000009c8] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x000009d0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000009d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000009e0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000007a8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000007b0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000007b8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000007c0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000007c8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000007d0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000007d8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000007e0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000007e8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000007f0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000007f8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000800] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000808] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000810] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000818] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000820] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000828] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000830] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000838] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000840] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000848] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000850] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000858] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000860] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000868] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000870] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000878] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000880] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -++/* [0x00000888] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000890] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000898] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000008b0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000008d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000008f0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008f8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000900] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000908] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -++/* [0x00000910] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000918] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000920] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x000009e8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000009f0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000009f8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000a00] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000a08] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000a10] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000a18] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000a20] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000a28] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000a30] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000a38] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000a40] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000a48] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000a50] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000a58] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000a60] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000a68] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000a70] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000a78] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000a80] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00000a88] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00000a90] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00000a98] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00000aa0] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00000aa8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00000ab0] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00000ab8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000ac0] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000ac8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000ad0] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000ad8] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000ae0] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000ae8] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000af0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000af8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000b00] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000b08] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000b10] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000b18] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000b20] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000b28] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000b30] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000b38] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000b40] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000b48] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000b50] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000b58] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000b60] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000b68] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000b70] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000b78] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000b80] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000b88] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000b90] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000b98] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000ba0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000ba8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000bb0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000bb8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000bc0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000bc8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000bd0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000bd8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000be0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000be8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000bf0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000928] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000930] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000938] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000940] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000948] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000950] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000958] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000960] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000968] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000970] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000978] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000980] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000988] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000990] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000998] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000009a0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000009a8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000009b0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000009b8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000009c0] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x000009c8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x000009d0] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x000009d8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x000009e0] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x000009e8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x000009f0] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x000009f8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00000a00] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000a08] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000a10] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -++/* [0x00000a18] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00000a20] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00000a28] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00000a30] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000a38] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000a40] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -++/* [0x00000a48] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000a50] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x00000a58] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x00000a60] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a68] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -++/* [0x00000a70] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -++/* [0x00000a78] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -++/* [0x00000a80] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -++/* [0x00000a88] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -++/* [0x00000a90] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -++/* [0x00000a98] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -++/* [0x00000aa0] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -++/* [0x00000aa8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000ab0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000ab8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000ac0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000ac8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000ad0] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000ad8] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000ae0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000ae8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000af0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000af8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000b00] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000b08] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000b10] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000b18] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000b20] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000b28] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000b30] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000bf8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000c00] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000c08] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c28] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000c30] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000c38] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b38] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000b40] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000b48] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000b50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000b58] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000b60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000b68] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000b70] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b78] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000c40] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000c48] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c58] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000c68] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000c70] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000c78] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000c80] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000c88] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000c90] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000c98] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ca0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000ca8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000cb0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b80] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000b88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000b90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000b98] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ba0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ba8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000bb0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000bb8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000bc0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000bc8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000bd0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000bd8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000be0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000be8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000bf0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 1bf7a68..cb74887 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -6,9 +6,9 @@ extern unsigned int rpi_shader[]; -+ #define mc_setup_uv (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 152) -+ #define mc_filter_uv_b0 (rpi_shader + 324) -+-#define mc_filter_uv_b (rpi_shader + 538) -+-#define mc_exit (rpi_shader + 766) -+-#define mc_interrupt_exit8 (rpi_shader + 784) -+-#define mc_end (rpi_shader + 814) -++#define mc_filter_uv_b (rpi_shader + 490) -++#define mc_exit (rpi_shader + 718) -++#define mc_interrupt_exit8 (rpi_shader + 736) -++#define mc_end (rpi_shader + 766) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 8e4f18f..faa5755 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -357,15 +357,13 @@ mov r0, unif -+ shr r1, r0, r2 # Extract width -+ sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+ and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -++add rb17, r0, 1 -++add rb18, r0, 3 -+ shl r0, r0, 7 -+ add r0, r0, r1 # Combine width and height of destination area -+ shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+ add rb26, r0, rb27 -+ -+-sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -+- -+ # get filter coefficients -+ -+ mov r0, unif -+@@ -373,18 +371,11 @@ asr ra3, r0, rb23; mul24 r0, r0, ra22 -+ asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ asr ra0, r0, rb23; mov r0, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -++ mov r0, unif -+ asr rb11, r0, rb23; mul24 r0, r0, ra22 -+ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+ asr rb8, r0, rb23; mov r0, unif -+-asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-asr rb12, r0, rb23 -+ -+ # r2 is elem_num -+ # r3 is loop counter -+@@ -426,26 +417,14 @@ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+ add r0, r2, r3 -+ -+ mov r3, rb31 -+ -+-mov ra8, ra9 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+ mov ra12, ra13 -+ mov ra13, ra14 -+ -+-sub.setf -, r3, 8 ; mov r1, ra22 -++sub.setf -, r3, 4 ; mov r1, ra22 -+ -+ # apply horizontal filter -+ brr.anyn -, r:uvloop_b0 -+@@ -455,18 +434,12 @@ nop ; nop # Delay slot 3 (TODO move more of the context scr -+ -+ # apply vertical filter and write to VPM -+ -+-nop ; mul24 r1, ra14, rb14 -+-nop ; mul24 r0, ra13, rb13 -+-add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-add r1, r1, r0 ; mul24 r0, ra15, rb15 -++nop ; mul24 r1, ra14, rb10 -++nop ; mul24 r0, ra13, rb9 -++add r1, r1, r0 ; mul24 r0, ra12, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb11 -+ add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-#asr r1, r1, 14 -+-#add r1, r1, ra21 -+ brr.anyn -, r:uvloop_b0 -+ asr vpm, r1, 14 # Delay 1 shifts down by shift2=6, but results are still in 16bit precision TODO may be able to avoid the mul24 and use more delay slots -+ nop # Delay 2 -+-- -+2.5.0 -+ -+ -+From 6e69afcdf13d39d3f108824ae4496df799f7a6bd Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 11:12:43 +0100 -+Subject: [PATCH 29/68] Optimised B pass -+ -+--- -+ libavcodec/rpi_shader.c | 202 ++++++++++++++++++++------------------------- -+ libavcodec/rpi_shader.h | 6 +- -+ libavcodec/rpi_shader.qasm | 41 ++------- -+ 3 files changed, 100 insertions(+), 149 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 1f63ee0..4e6c5ea 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -289,8 +289,8 @@ unsigned int rpi_shader[] = { -+ /* [0x00000818] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+ /* [0x00000820] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+ /* [0x00000828] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000830] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000838] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000830] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000838] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+ /* [0x00000840] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+ /* [0x00000848] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+ /* [0x00000850] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+@@ -299,120 +299,96 @@ unsigned int rpi_shader[] = { -+ /* [0x00000868] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+ /* [0x00000870] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+ /* [0x00000878] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000880] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000888] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000890] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000898] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000008b0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b8] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c8] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000008d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000008f0] */ 0x4f5971c6, 0x100253e0, // asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008f8] */ 0x4f5971c6, 0x100253a0, // asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000900] */ 0x4f5971c6, 0x10025360, // asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000908] */ 0x0f9d71c0, 0x10021327, // asr rb12, r0, rb23 -+-/* [0x00000910] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000918] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000920] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000880] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000888] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000890] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000898] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000008a8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008b0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000008d0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000008d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008e0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00000928] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000930] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000938] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000940] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000948] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000950] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000958] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000960] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000968] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000970] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000978] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000980] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000988] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000990] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000998] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000009a0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000009a8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000009b0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000009b8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000009c0] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x000009c8] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x000009d0] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x000009d8] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x000009e0] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x000009e8] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x000009f0] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x000009f8] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00000a00] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000a08] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000a10] */ 0x15267d80, 0x10020227, // mov ra8, ra9 -+-/* [0x00000a18] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00000a20] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00000a28] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00000a30] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000a38] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000a40] */ 0x8d5887f6, 0xd00269e1, // sub.setf -, r3, 8 ; mov r1, ra22 -+-/* [0x00000a48] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000a50] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000a58] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000a60] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000a68] */ 0x4038e037, 0x100049e1, // nop ; mul24 r1, ra14, rb14 -+-/* [0x00000a70] */ 0x4034d037, 0x100049e0, // nop ; mul24 r0, ra13, rb13 -+-/* [0x00000a78] */ 0x4c30c237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-/* [0x00000a80] */ 0x4c2cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-/* [0x00000a88] */ 0x4c28a237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-/* [0x00000a90] */ 0x4c249237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-/* [0x00000a98] */ 0x4c208237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-/* [0x00000aa0] */ 0x4c3cf237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb15 -+-/* [0x00000aa8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000ab0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000ab8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000ac0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000ac8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000ad0] */ 0xfffffe38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000ad8] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000ae0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000ae8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000af0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000af8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000b00] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000b08] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000b10] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000b18] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000b20] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000b28] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000b30] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008e8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000008f0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000008f8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000900] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000908] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000910] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000918] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000920] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000928] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000930] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000938] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000940] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000948] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000950] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000958] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000960] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000968] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000970] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000978] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000980] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000988] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000990] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000998] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000009a0] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -++/* [0x000009a8] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009b0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000009b8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000009c0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000009c8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000009d0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000009d8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000009e0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000009e8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000009f0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000009f8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000a00] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000a08] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000a10] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000a18] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000a20] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a28] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a30] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a38] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a40] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000a48] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000a50] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a58] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a60] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000a68] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a70] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000b38] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000b40] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000b48] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000b50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000b58] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000b60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000b68] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000b70] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000b78] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a78] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a80] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a98] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000aa0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ab0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000b80] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000b88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000b90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000b98] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ba0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ba8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000bb0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000bb8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000bc0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000bc8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000bd0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000bd8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000be0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000be8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000bf0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000ac0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000ac8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ad0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ad8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ae0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b00] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b08] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b10] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b18] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b20] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000b28] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000b30] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index cb74887..53da629 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -7,8 +7,8 @@ extern unsigned int rpi_shader[]; -+ #define mc_filter_uv (rpi_shader + 152) -+ #define mc_filter_uv_b0 (rpi_shader + 324) -+ #define mc_filter_uv_b (rpi_shader + 490) -+-#define mc_exit (rpi_shader + 718) -+-#define mc_interrupt_exit8 (rpi_shader + 736) -+-#define mc_end (rpi_shader + 766) -++#define mc_exit (rpi_shader + 670) -++#define mc_interrupt_exit8 (rpi_shader + 688) -++#define mc_end (rpi_shader + 718) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index faa5755..f38c926 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -491,8 +491,8 @@ mov r0, unif -+ shr r1, r0, r2 # Extract width -+ sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+ and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -++add rb17, r0, 1 -++add rb18, r0, 3 -+ shl r0, r0, 7 -+ -+ # r0 is currently height<<7 -+@@ -508,8 +508,6 @@ add rb26, r0, rb27 -+ # In a B frame, so also set up VPM read (reading back 16bit precision) -+ add vr_setup, r3, rb21 -+ -+-sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -+- -+ # get filter coefficients -+ -+ mov r0, unif -+@@ -517,18 +515,11 @@ asr ra3, r0, rb23; mul24 r0, r0, ra22 -+ asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ asr ra0, r0, rb23; mov r0, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -++ mov r0, unif -+ asr rb11, r0, rb23; mul24 r0, r0, ra22 -+ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+ asr rb8, r0, rb23; mov r0, unif -+-asr rb15, r0, rb23; mul24 r0, r0, ra22 -+-asr rb14, r0, rb23; mul24 r0, r0, ra22 -+-asr rb13, r0, rb23; mul24 r0, r0, ra22 -+-asr rb12, r0, rb23 -+ -+ # r2 is elem_num -+ # r3 is loop counter -+@@ -570,26 +561,14 @@ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+ add r0, r2, r3 -+ -+ mov r3, rb31 -+ -+-mov ra8, ra9 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+ mov ra12, ra13 -+ mov ra13, ra14 -+ -+-sub.setf -, r3, 8 ; mov r1, ra22 -++sub.setf -, r3, 4 ; mov r1, ra22 -+ # apply horizontal filter -+ brr.anyn -, r:uvloop_b -+ mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+@@ -598,14 +577,10 @@ nop ; nop # TODO improve use of delay slots -+ -+ # apply vertical filter and write to VPM -+ -+-nop ; mul24 r1, ra14, rb14 -+-nop ; mul24 r0, ra13, rb13 -+-add r1, r1, r0 ; mul24 r0, ra12, rb12 -+-add r1, r1, r0 ; mul24 r0, ra11, rb11 -+-add r1, r1, r0 ; mul24 r0, ra10, rb10 -+-add r1, r1, r0 ; mul24 r0, ra9, rb9 -+-add r1, r1, r0 ; mul24 r0, ra8, rb8 -+-add r1, r1, r0 ; mul24 r0, ra15, rb15 -++nop ; mul24 r1, ra14, rb10 -++nop ; mul24 r0, ra13, rb9 -++add r1, r1, r0 ; mul24 r0, ra12, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb11 -+ add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+ asr r1, r1, 14 # shift2=6 -+-- -+2.5.0 -+ -+ -+From 75ce019e80ff7f2234d56949c191413ab1d9ad7e Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 11:17:09 +0100 -+Subject: [PATCH 30/68] Used P delay slots more efficiently -+ -+--- -+ libavcodec/rpi_shader.c | 437 ++++++++++++++++++++++----------------------- -+ libavcodec/rpi_shader.h | 10 +- -+ libavcodec/rpi_shader.qasm | 19 +- -+ 3 files changed, 228 insertions(+), 238 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 4e6c5ea..a1af4e3 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -156,239 +156,236 @@ unsigned int rpi_shader[] = { -+ /* [0x00000408] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ /* [0x00000410] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ /* [0x00000418] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000420] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000428] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000430] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000420] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000428] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000430] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+ /* [0x00000438] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000440] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -+-/* [0x00000448] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000450] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000458] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000460] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000468] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000470] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000478] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000480] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000488] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000490] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000498] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000004a0] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x000004a8] */ 0xfffffec0, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004b0] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x000004b8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000004c0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000004c8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000004d0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004d8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000004e0] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000004e8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000004f0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000004f8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000500] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000508] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000440] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000448] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000450] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000458] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000460] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000468] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000470] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000478] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000480] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000488] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000490] */ 0xfffffed8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000498] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x000004a0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000004a8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000004b0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000004b8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004c0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000004c8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000004d0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000004d8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000004e0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000004e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x00000510] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000518] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000520] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000528] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000530] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000538] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000540] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000548] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000550] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000558] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000560] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000568] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000570] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000578] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000580] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000588] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000590] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000598] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000005a0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000005a8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000005b0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000005b8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000005c0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000005c8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005d0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005d8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000005f0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005f8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000600] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000608] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000610] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000618] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000620] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000628] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000004f8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000500] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000508] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000510] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000518] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000520] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000528] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000530] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000538] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000540] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000548] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000550] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000558] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000560] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000568] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000570] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000578] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000580] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000588] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000590] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000598] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000005a0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000005a8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000005b0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005b8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005d0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000005d8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005e0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005f0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005f8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000600] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000608] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000610] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000630] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000638] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000640] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000648] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000650] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000658] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000660] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000668] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000670] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000678] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000680] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000688] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000690] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000698] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000006a0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000006a8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000006b0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000006b8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000006c0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000006c8] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x000006d0] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x000006d8] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000006e0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000006e8] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -+-/* [0x000006f0] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x000006f8] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x00000700] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x00000708] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000710] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000718] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000720] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000728] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000730] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000738] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000740] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000748] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -+-/* [0x00000750] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000758] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000760] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000768] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000770] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000778] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000780] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000788] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000790] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000798] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000007a0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000618] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000620] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000628] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000630] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000638] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000640] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000648] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000650] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000658] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000660] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000668] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000670] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000678] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000680] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000688] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000690] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000698] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000006a0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000006a8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000006b0] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x000006b8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x000006c0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x000006c8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000006d0] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -++/* [0x000006d8] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000006e0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000006e8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000006f0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000006f8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000700] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000708] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000710] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000718] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000720] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000728] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000730] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -++/* [0x00000738] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000740] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000748] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000750] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000758] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000760] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000768] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000770] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000778] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000780] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000788] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b -+-/* [0x000007a8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000007b0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000007b8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000007c0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000007c8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000007d0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000007d8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000007e0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000007e8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000007f0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000007f8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000800] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000808] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000810] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000818] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000820] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000828] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000830] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000838] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000840] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000848] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000850] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000858] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000860] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000868] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000870] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000878] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000880] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000888] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000890] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000898] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000008a8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008b0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000008d0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000008d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008e0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000790] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000798] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000007a0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000007a8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000007b0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000007b8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000007c0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000007c8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000007d0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000007d8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000007e0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000007e8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000007f0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000007f8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000800] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000808] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000810] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000818] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000820] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000828] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000830] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000838] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000840] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000848] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000850] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000858] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000860] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000868] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000870] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000878] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000880] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000888] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000890] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000898] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b0] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000008b8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000008c0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008c8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x000008e8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000008f0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000008f8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000900] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000908] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000910] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000918] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000920] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000928] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000930] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000938] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000940] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000948] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000950] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000958] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000960] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000968] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000970] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000978] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000980] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000988] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000990] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000998] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000009a0] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -+-/* [0x000009a8] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000009b0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000009b8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000009c0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000009c8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000009d0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000009d8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000009e0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000009e8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000009f0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000009f8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000a00] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000a08] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000a10] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000a18] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000a20] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a28] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a30] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a38] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a40] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000a48] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000a50] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a58] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a60] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000a68] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a70] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008d0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000008d8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000008e0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000008e8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000008f0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000008f8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000900] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000908] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000910] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000918] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000920] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000928] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000930] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000938] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000940] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000948] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000950] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000958] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000960] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000968] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -++/* [0x00000970] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -++/* [0x00000978] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00000980] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000988] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -++/* [0x00000990] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000998] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -++/* [0x000009a0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -++/* [0x000009a8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000009b0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000009b8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000009c0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000009c8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000009d0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000009d8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000009e0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000009e8] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x000009f0] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x000009f8] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000a00] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000a08] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a10] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a18] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a20] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a28] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000a30] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000a38] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a40] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a48] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000a50] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a58] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a78] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a80] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a60] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a68] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a70] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a78] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a80] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a98] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000aa0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000ab0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a90] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a98] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000aa0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000ac0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000aa8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000ab0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ab8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ac0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000ac8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ad0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ad8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ae0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ad0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ad8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ae0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000b00] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b08] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b10] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b18] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b20] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000b28] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000b30] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b08] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000b10] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000b18] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 53da629..1fb3e37 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -5,10 +5,10 @@ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 152) -+-#define mc_filter_uv_b0 (rpi_shader + 324) -+-#define mc_filter_uv_b (rpi_shader + 490) -+-#define mc_exit (rpi_shader + 670) -+-#define mc_interrupt_exit8 (rpi_shader + 688) -+-#define mc_end (rpi_shader + 718) -++#define mc_filter_uv_b0 (rpi_shader + 318) -++#define mc_filter_uv_b (rpi_shader + 484) -++#define mc_exit (rpi_shader + 664) -++#define mc_interrupt_exit8 (rpi_shader + 682) -++#define mc_end (rpi_shader + 712) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index f38c926..02e95dd 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -268,6 +268,7 @@ add t0s, ra_x2_base, r2 -+ -+ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -++# apply horizontal filter -+ nop ; mul24 r2, r0, ra0 -+ nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+ nop ; mul24 r3, ra1 << 1, r0 << 1 -+@@ -276,20 +277,12 @@ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r0, r2, r3 -+- -+-mov r3, rb31 -+- -+-mov ra12, ra13 -+-mov ra13, ra14 -+- -+-sub.setf -, r3, 4 ; mov r1, ra22 -+- -+-# apply horizontal filter -++add r0, r2, r3 ; mov r3, rb31 -++sub.setf -, r3, 4 ; mov ra12, ra13 -+ brr.anyn -, r:uvloop -+-mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll -+-asr ra15, r0, 8 ; nop -+-nop ; nop # Delay slot 3 (TODO move more of the context scroll into here) -++mov ra13, ra14 # Delay slot 1 -++mov ra14, ra15 # Delay slot 2 -++mov ra15, r0 # Delay slot 3 -+ -+ # apply vertical filter and write to VPM -+ -+-- -+2.5.0 -+ -+ -+From a92dda80bf8043b39fa85752d9a9592e90370d77 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 11:22:25 +0100 -+Subject: [PATCH 31/68] Improved use of delay slots -+ -+--- -+ libavcodec/rpi_shader.c | 503 ++++++++++++++++++++++----------------------- -+ libavcodec/rpi_shader.h | 10 +- -+ libavcodec/rpi_shader.qasm | 41 ++-- -+ 3 files changed, 265 insertions(+), 289 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index a1af4e3..c498f28 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -122,270 +122,263 @@ unsigned int rpi_shader[] = { -+ /* [0x00000300] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+ /* [0x00000308] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+ /* [0x00000310] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000318] */ 0x0d9c8e40, 0xd00229e7, // sub.setf -,8,r1 -+-/* [0x00000320] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000328] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000330] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000340] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000348] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000350] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000360] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000368] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000370] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000378] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000380] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000318] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000320] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000330] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000340] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000348] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000350] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000360] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000368] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000370] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000378] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x00000388] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000390] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000398] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000003a0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003a8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003b0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003b8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003c0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003c8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003d0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000003d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003e0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000003e8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000003f0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000003f8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000400] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000408] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000410] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000418] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000420] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000428] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000430] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000438] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000440] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000448] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000450] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000458] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000460] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000468] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000470] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000478] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000480] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000488] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000490] */ 0xfffffed8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000498] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x000004a0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000004a8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000004b0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000004b8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004c0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000004c8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000004d0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000004d8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000004e0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000004e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000380] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000388] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000390] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000398] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003a0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003a8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003b8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003c0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000003c8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000003d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003d8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000003e0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000003e8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000003f0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000003f8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000400] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000408] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000410] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000418] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000420] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000428] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000430] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000438] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000440] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000448] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000450] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000458] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000460] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000468] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000470] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000478] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000480] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000488] */ 0xfffffed8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000490] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000498] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000004a0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000004a8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000004b0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004b8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000004c0] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000004c8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000004d0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000004d8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000004e0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004e8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x000004f8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000500] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000508] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000510] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000518] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000520] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000528] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000530] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000538] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000540] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000548] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000550] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000558] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000560] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000568] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000570] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000578] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000580] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000588] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000590] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000598] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000005a0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000005a8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000005b0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005b8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005c0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005c8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005d0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000005d8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005e0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005f0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005f8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000600] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000608] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000610] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000004f0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000004f8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000500] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000508] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000510] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000518] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000520] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000528] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000530] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000538] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000540] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000548] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000550] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000558] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000560] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000568] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000570] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000578] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000580] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000588] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000590] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000598] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000005a0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000005a8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005b0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005b8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000005d0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005d8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005e8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005f0] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000005f8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000600] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000608] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000618] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000620] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000628] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000630] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000638] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000640] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000648] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000650] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000658] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000660] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000668] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000670] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000678] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000680] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000688] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000690] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000698] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000006a0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000006a8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000006b0] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x000006b8] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x000006c0] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x000006c8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000006d0] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -+-/* [0x000006d8] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x000006e0] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000006e8] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000006f0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000006f8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000700] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000708] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000710] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000718] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000720] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000728] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000730] */ 0x0f9ce3c0, 0xd0020c27, // asr vpm, r1, 14 -+-/* [0x00000738] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000740] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000748] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000750] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000758] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000760] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000768] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000770] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000778] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000780] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000788] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000610] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000618] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000620] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000628] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000630] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000638] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000640] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000648] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000650] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000658] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000660] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000668] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000670] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000678] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000680] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000688] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000690] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000698] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000006a0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000006a8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x000006b0] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x000006b8] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000006c0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000006c8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000006d0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000006d8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000006e0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000006e8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000006f0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000006f8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000700] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -++/* [0x00000708] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000710] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -++/* [0x00000718] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000720] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000728] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000730] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000738] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000740] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000748] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000750] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000758] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000760] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000768] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b -+-/* [0x00000790] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000798] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000007a0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000007a8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000007b0] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000007b8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000007c0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000007c8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000007d0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000007d8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000007e0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000007e8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000007f0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000007f8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000800] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000808] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000810] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000818] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000820] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000828] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000830] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000838] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000840] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000848] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000850] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000858] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000860] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000868] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000870] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000878] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000880] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000888] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000890] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000898] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b0] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000008b8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000008c0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008c8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000770] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000778] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000780] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000788] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000790] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000798] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000007a0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000007a8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000007b0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000007b8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000007c0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000007c8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000007d0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000007d8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000007e0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000007e8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000007f0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000007f8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000800] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000808] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000810] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000818] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000820] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000828] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000830] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000838] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000840] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000848] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000850] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000858] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000860] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000868] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000870] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000878] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000880] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000888] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000890] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000898] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000008a0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008a8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x000008d0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000008d8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000008e0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000008e8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000008f0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000008f8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000900] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000908] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000910] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000918] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000920] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000928] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000930] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000938] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000940] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000948] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000950] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000958] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000960] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000968] */ 0x0c9e74c0, 0x10020827, // add r0, r2, r3 -+-/* [0x00000970] */ 0x159dffc0, 0x100208e7, // mov r3, rb31 -+-/* [0x00000978] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00000980] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000988] */ 0x8d5847f6, 0xd00269e1, // sub.setf -, r3, 4 ; mov r1, ra22 -+-/* [0x00000990] */ 0xffffff20, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000998] */ 0x553e7d81, 0x100243a0, // mov ra14, ra15 ; mul24 r0, r0, r1 -+-/* [0x000009a0] */ 0x0f9c81c0, 0xd00203e7, // asr ra15, r0, 8 ; nop -+-/* [0x000009a8] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x000009b0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000009b8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000009c0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000009c8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000009d0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000009d8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000009e0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000009e8] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x000009f0] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x000009f8] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000a00] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000a08] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a10] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a18] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a20] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a28] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000a30] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000a38] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a40] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a48] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000a50] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a58] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008b0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000008b8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000008c0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000008c8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000008d0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000008d8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000008e0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000008e8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000008f0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000008f8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000900] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000908] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000910] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000918] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000920] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000928] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000930] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000938] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000940] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000948] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000950] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000958] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000960] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000968] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000970] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000978] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000980] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000988] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000990] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000998] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000009a0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000009a8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000009b0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x000009b8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x000009c0] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009c8] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x000009d0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000009d8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000009e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000009e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000009f8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000a00] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a08] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a10] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000a18] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a20] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a60] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a68] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000a70] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a28] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a30] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a38] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a40] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a48] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a58] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a60] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a68] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_interrupt_exit8 -++/* [0x00000a70] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+ /* [0x00000a78] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a80] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a90] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000a98] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000aa0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-// ::mc_interrupt_exit8 -+-/* [0x00000aa8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000ab0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ab8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ac0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ac8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ad0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ad8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ae0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b00] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b08] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000b10] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000b18] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a98] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000aa0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000aa8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ab0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ab8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ac0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ac8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ad0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ad8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000ae0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 1fb3e37..3fac45f 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -5,10 +5,10 @@ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 152) -+-#define mc_filter_uv_b0 (rpi_shader + 318) -+-#define mc_filter_uv_b (rpi_shader + 484) -+-#define mc_exit (rpi_shader + 664) -+-#define mc_interrupt_exit8 (rpi_shader + 682) -+-#define mc_end (rpi_shader + 712) -++#define mc_filter_uv_b0 (rpi_shader + 316) -++#define mc_filter_uv_b (rpi_shader + 476) -++#define mc_exit (rpi_shader + 650) -++#define mc_interrupt_exit8 (rpi_shader + 668) -++#define mc_end (rpi_shader + 698) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 02e95dd..10f5113 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -221,8 +221,6 @@ add r0, r0, r1 # Combine width and height of destination area -+ shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+ add rb26, r0, rb27 -+ -+-sub.setf -,8,r1 # 8-r1, so if <0 (negative) we need to use the full code -+- -+ # get filter coefficients -+ -+ mov r0, unif -+@@ -410,20 +408,12 @@ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r0, r2, r3 -+- -+-mov r3, rb31 -+- -+-mov ra12, ra13 -+-mov ra13, ra14 -+- -+-sub.setf -, r3, 4 ; mov r1, ra22 -+- -+-# apply horizontal filter -++add r0, r2, r3 ; mov r3, rb31 -++sub.setf -, r3, 4 ; mov ra12, ra13 -+ brr.anyn -, r:uvloop_b0 -+-mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll -+-asr ra15, r0, 8 ; nop # TODO isn't ra15 already in 24bit precision, may not need the sign extension here? -+-nop ; nop # Delay slot 3 (TODO move more of the context scroll into here) -++mov ra13, ra14 # Delay slot 1 -++mov ra14, ra15 # Delay slot 2 -++mov ra15, r0 # Delay slot 3 -+ -+ # apply vertical filter and write to VPM -+ -+@@ -432,9 +422,9 @@ nop ; mul24 r0, ra13, rb9 -+ add r1, r1, r0 ; mul24 r0, ra12, rb8 -+ add r1, r1, r0 ; mul24 r0, ra15, rb11 -+ add r1, r1, r0 ; mov -, vw_wait -+-sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++sub.setf -, r3, rb18 -+ brr.anyn -, r:uvloop_b0 -+-asr vpm, r1, 14 # Delay 1 shifts down by shift2=6, but results are still in 16bit precision TODO may be able to avoid the mul24 and use more delay slots -++asr vpm, r1, 6 # Delay 1 shifts down by shift2=6, but results are still in 16bit precision -+ nop # Delay 2 -+ nop # Delay 3 -+ -+@@ -554,19 +544,12 @@ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r0, r2, r3 -+- -+-mov r3, rb31 -+- -+-mov ra12, ra13 -+-mov ra13, ra14 -+- -+-sub.setf -, r3, 4 ; mov r1, ra22 -+-# apply horizontal filter -++add r0, r2, r3 ; mov r3, rb31 -++sub.setf -, r3, 4 ; mov ra12, ra13 -+ brr.anyn -, r:uvloop_b -+-mov ra14, ra15 ; mul24 r0, r0, r1 # last bit of context scroll, including clamp to zero -+-asr ra15, r0, 8 ; nop -+-nop ; nop # TODO improve use of delay slots -++mov ra13, ra14 # Delay slot 1 -++mov ra14, ra15 # Delay slot 2 -++mov ra15, r0 # Delay slot 3 -+ -+ # apply vertical filter and write to VPM -+ -+-- -+2.5.0 -+ -+ -+From 70bf426922557224722d0b6c3ca5d688b4e91f00 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 11:31:23 +0100 -+Subject: [PATCH 32/68] Avoid writeback of first B results -+ -+--- -+ libavcodec/rpi_shader.c | 229 ++++++++++++++++++++++----------------------- -+ libavcodec/rpi_shader.h | 8 +- -+ libavcodec/rpi_shader.qasm | 18 +--- -+ 3 files changed, 121 insertions(+), 134 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index c498f28..ba453a2 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -255,130 +255,125 @@ unsigned int rpi_shader[] = { -+ /* [0x00000710] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -+ /* [0x00000718] */ 0x009e7000, 0x100009e7, // nop -+ /* [0x00000720] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000728] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000730] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000738] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000740] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000748] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000750] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000758] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000760] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000768] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000728] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000730] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000738] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000740] */ 0x009e7000, 0x100009e7, // nop -+ // ::mc_filter_uv_b -+-/* [0x00000770] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000778] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000780] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000788] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000790] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000798] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000007a0] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000007a8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000007b0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000007b8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000007c0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000007c8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000007d0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000007d8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000007e0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000007e8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000007f0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000007f8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000800] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000808] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000810] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000818] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000820] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000828] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000830] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000838] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000840] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000748] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000750] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000758] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000760] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000768] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000770] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000778] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000780] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000788] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000790] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000798] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000007a0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000007a8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000007b0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000007b8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000007c0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000007c8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000007d0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000007d8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000007e0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000007e8] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x000007f0] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x000007f8] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000800] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000808] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000810] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000818] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000820] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000828] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000830] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000838] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000840] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+ /* [0x00000848] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000850] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000858] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000860] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000868] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000870] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000878] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000880] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000888] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000890] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000898] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000008a0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008a8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000850] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000858] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000860] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000868] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000870] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000878] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000880] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x000008b0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000008b8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000008c0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000008c8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000008d0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000008d8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000008e0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000008e8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000008f0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000008f8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000900] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000908] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000910] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000918] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000920] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000928] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000930] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000938] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000940] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000948] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000950] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000958] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000960] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000968] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000970] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000978] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000980] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000988] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000990] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000998] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000009a0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000009a8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000009b0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x000009b8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x000009c0] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000009c8] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x000009d0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000009d8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000009e0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000009e8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000009f0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000009f8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000a00] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a08] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a10] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000a18] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a20] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000888] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000890] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000898] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000008a0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000008a8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000008b0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000008b8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000008c0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000008c8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000008d0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000008d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008e0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000008e8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000008f0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000008f8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000900] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000908] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000910] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000918] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000920] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000928] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000930] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000938] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000940] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000948] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000950] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000958] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000960] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000968] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000970] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000978] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000980] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000988] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000990] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000998] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009a0] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x000009a8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000009b0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000009b8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000009c0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009c8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000009d0] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000009d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000009e0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000009e8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000009f0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009f8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a28] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a30] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000a38] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a40] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a48] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a58] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000a60] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000a68] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a00] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a08] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a28] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a30] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a38] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a40] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000a70] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a78] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a80] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a48] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a58] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a68] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a70] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a78] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a80] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a88] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a90] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000a98] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000aa0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000aa8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ab0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ab8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ac0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ac8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ad0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000ad8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000ae0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ab0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 3fac45f..45dbe0e 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -6,9 +6,9 @@ extern unsigned int rpi_shader[]; -+ #define mc_setup_uv (rpi_shader + 0) -+ #define mc_filter_uv (rpi_shader + 152) -+ #define mc_filter_uv_b0 (rpi_shader + 316) -+-#define mc_filter_uv_b (rpi_shader + 476) -+-#define mc_exit (rpi_shader + 650) -+-#define mc_interrupt_exit8 (rpi_shader + 668) -+-#define mc_end (rpi_shader + 698) -++#define mc_filter_uv_b (rpi_shader + 466) -++#define mc_exit (rpi_shader + 640) -++#define mc_interrupt_exit8 (rpi_shader + 658) -++#define mc_end (rpi_shader + 688) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 10f5113..e138c95 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -428,22 +428,14 @@ asr vpm, r1, 6 # Delay 1 shifts down by shift2=6, but results are still -+ nop # Delay 2 -+ nop # Delay 3 -+ -++# in pass0 we don't really need to save any results, but need to discard the uniforms -+ # DMA out for U -+ -+-mov vw_setup, rb26 # VDW setup 0 -+-mov vw_setup, rb29 # Stride -+-mov vw_addr, unif # start the VDW # TODO in pass0 we don't need to save any results -+- -+-# DMA out for V -+-# We need to wait for the U to complete first, but have nothing useful to compute while we wait. -+-# Could potentially push this write into the start of the next pipeline stage. -+-mov r0, 16 -+-mov -, vw_wait -+- -+ bra -, ra31 -+-add vw_setup, rb26, r0 # VDW setup 0 -+-mov vw_setup, rb29 # Stride -+-mov vw_addr, unif # start the VDW -++mov r0, unif # Delay 1 -++mov r0, unif # Delay 2 -++nop # Delay 3 -++ -+ -+ ################################################################################ -+ -+-- -+2.5.0 -+ -+ -+From fb7061693c79444c178f700799776ffd736f3561 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 14 May 2015 11:36:24 +0100 -+Subject: [PATCH 33/68] Cutdown size of chroma prediction commands -+ -+--- -+ libavcodec/hevc.c | 17 +- -+ libavcodec/rpi_shader.c | 543 ++++++++++++++++++++++----------------------- -+ libavcodec/rpi_shader.h | 12 +- -+ libavcodec/rpi_shader.qasm | 11 +- -+ 4 files changed, 281 insertions(+), 302 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 8984585..c65af74 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -56,7 +56,7 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ -+ #ifdef RPI_INTER_QPU -+ -+-#define RPI_CHROMA_COMMAND_WORDS 12 -++#define RPI_CHROMA_COMMAND_WORDS 10 -+ #define UV_COMMANDS_PER_QPU ((1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS) -+ // The QPU code for UV blocks only works up to a block width of 8 -+ #define RPI_CHROMA_BLOCK_WIDTH 8 -+@@ -2021,11 +2021,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -+ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+- u++; -+ *u++ = rpi_filter_coefs[_my][0]; -+- u++; -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2080,9 +2077,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+- u++; -+ *u++ = rpi_filter_coefs[_my][0]; -+- u++; -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2143,11 +2138,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -+ *u++ = ( (nPbW_cframe->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); // TODO this will become unused once we have a dedicated pass0 filter -+- *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ u+=2; // Intermediate results are not written back in first pass of B filtering -+ -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x2_c - 1 + start_x; -+@@ -2155,11 +2147,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -+ *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx2][0]; -+- u++; -+ *u++ = rpi_filter_coefs[_my2][0]; -+- u++; -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2797,7 +2786,7 @@ static void rpi_inter_clear(HEVCContext *s) -+ *s->u_mvs[i]++ = pic_height; -+ *s->u_mvs[i]++ = s->frame->linesize[1]; -+ *s->u_mvs[i]++ = s->frame->linesize[2]; -+- s->u_mvs[i] += 3; // Padding words -++ s->u_mvs[i] += 1; // Padding words -+ } -+ } -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index ba453a2..b0b93b5 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -89,291 +89,286 @@ unsigned int rpi_shader[] = { -+ /* [0x00000200] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+ /* [0x00000208] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+ /* [0x00000210] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000218] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000220] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000228] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000230] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000238] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000240] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000248] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000250] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00000258] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00000218] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000220] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000228] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000230] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000238] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000240] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00000248] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -+ // ::mc_filter_uv -+-/* [0x00000260] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000268] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000270] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000278] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000280] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000288] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000290] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000298] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000002a0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000002a8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000002b0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000002b8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002c0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002c8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002d0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002d8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002e0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002e8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000002f0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000002f8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000300] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000308] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000310] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000318] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000320] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000330] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000340] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000348] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000350] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000360] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000368] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000370] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000378] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000250] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000258] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000260] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000268] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000270] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000278] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000280] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000288] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000290] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000298] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000002a0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000002a8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002b0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002b8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002c0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002c8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002d0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002d8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000002e0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000002e8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002f0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000002f8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000300] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000308] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000310] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000318] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000320] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000330] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000340] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000348] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000350] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000358] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000360] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x00000380] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000388] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000390] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000398] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003a0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003a8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003b8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003c0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003c8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000003d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003d8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000003e0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000003e8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000003f0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000003f8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000400] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000408] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000410] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000418] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000420] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000428] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000430] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000438] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000440] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000448] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000450] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000458] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000460] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000468] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000470] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000478] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000480] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000488] */ 0xfffffed8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000490] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000498] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000004a0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000004a8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000004b0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004b8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000004c0] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000004c8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000004d0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000004d8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000004e0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004e8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000368] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000370] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000378] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000380] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000388] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000390] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000398] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003a0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003a8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000003b0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000003b8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003c0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000003c8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000003d0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000003d8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000003e0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000003e8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000003f0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000003f8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000400] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000408] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000410] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000418] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000420] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000428] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000430] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000438] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000440] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000448] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000450] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000458] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000460] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000468] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -++/* [0x00000470] */ 0xfffffed8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000478] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00000480] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000488] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000490] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000498] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004a0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000004a8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000004b0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000004b8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000004c0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000004c8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004d0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x000004f0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000004f8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000500] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000508] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000510] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000518] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000520] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000528] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000530] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000538] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000540] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000548] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000550] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000558] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000560] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000568] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000570] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000578] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000580] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000588] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000590] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000598] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000005a0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000005a8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005b0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005b8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005c0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005c8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000005d0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005d8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005e8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005f0] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000005f8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000600] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000608] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000004d8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000004e0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000004e8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000004f0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000004f8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000500] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000508] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000510] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000518] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000520] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000528] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000530] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000538] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000540] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000548] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000550] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000558] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000560] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000568] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000570] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000578] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000580] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000588] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000590] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000598] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005a0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005a8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005b0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000005b8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005d0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x000005d8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000005e0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000005e8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000610] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000618] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000620] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000628] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000630] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000638] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000640] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000648] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000650] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000658] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000660] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000668] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000670] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000678] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000680] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000688] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000690] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000698] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000006a0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000006a8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x000006b0] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x000006b8] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x000006c0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000006c8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x000006d0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000006d8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000006e0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000006e8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000006f0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000006f8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000700] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -+-/* [0x00000708] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000710] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -+-/* [0x00000718] */ 0x009e7000, 0x100009e7, // nop -++/* [0x000005f0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000005f8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000600] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000608] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000610] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000618] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000620] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000628] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000630] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000638] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000640] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000648] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000650] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000658] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000660] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000668] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000670] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000678] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000680] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000688] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000690] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000698] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000006a0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000006a8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000006b0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000006b8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000006c0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000006c8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000006d0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000006d8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000006e0] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -++/* [0x000006e8] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000006f0] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -++/* [0x000006f8] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000700] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000708] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000710] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000718] */ 0x15827d80, 0x10020827, // mov r0, unif -+ /* [0x00000720] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000728] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000730] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000738] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000740] */ 0x009e7000, 0x100009e7, // nop -+ // ::mc_filter_uv_b -+-/* [0x00000748] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000750] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000758] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000760] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000768] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000770] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000778] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000780] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000788] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000790] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000798] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000007a0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000007a8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000007b0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000007b8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000007c0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000007c8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000007d0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000007d8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000007e0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000007e8] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x000007f0] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x000007f8] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000800] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000808] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000810] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000818] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000820] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000828] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000830] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000838] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000840] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000848] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000850] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000858] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000860] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000868] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000870] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000878] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000880] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000728] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000730] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000738] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000740] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000748] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000750] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000758] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000760] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000768] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000770] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000778] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000780] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000788] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000790] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000798] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000007a0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000007a8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000007b0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000007b8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000007c0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000007c8] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x000007d0] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x000007d8] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x000007e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000007e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000007f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000007f8] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000800] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000808] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000810] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000818] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000820] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000828] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000830] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000838] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000840] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000848] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000850] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000858] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00000888] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000890] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000898] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000008a0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000008a8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000008b0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000008b8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000008c0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000008c8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000008d0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000008d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008e0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000008e8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000008f0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000008f8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000900] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000908] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000910] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000918] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000920] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000928] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000930] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000938] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000940] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000948] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000950] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000958] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000960] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000968] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000970] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000978] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000980] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000988] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000990] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000998] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000009a0] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x000009a8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000009b0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000009b8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000009c0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000009c8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000009d0] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000009d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000009e0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000009e8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000009f0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000009f8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000860] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000868] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000870] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000878] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000880] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000888] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000890] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000898] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000008a0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000008a8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000008b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008b8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000008c0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000008c8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000008d0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000008d8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000008e0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000008e8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000008f0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000008f8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000900] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000908] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000910] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000918] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000920] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000928] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000930] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000938] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000940] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000948] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000950] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000958] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000960] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000968] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000970] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000978] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000980] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000988] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000990] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000998] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009a0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000009a8] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000009b0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000009b8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000009c0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000009c8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009d0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a00] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a08] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000a10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a18] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a28] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a30] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000a38] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000a40] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000009d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000009e0] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x000009e8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000009f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x000009f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a00] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a08] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a10] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a18] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000a48] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a58] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a68] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a20] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a28] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a30] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a38] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a40] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a48] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a50] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a58] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a60] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a68] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000a70] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000a78] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a80] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a88] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a90] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a98] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000aa0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000ab0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a80] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a88] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000a90] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 45dbe0e..99927c4 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,11 +4,11 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 152) -+-#define mc_filter_uv_b0 (rpi_shader + 316) -+-#define mc_filter_uv_b (rpi_shader + 466) -+-#define mc_exit (rpi_shader + 640) -+-#define mc_interrupt_exit8 (rpi_shader + 658) -+-#define mc_end (rpi_shader + 688) -++#define mc_filter_uv (rpi_shader + 148) -++#define mc_filter_uv_b0 (rpi_shader + 310) -++#define mc_filter_uv_b (rpi_shader + 458) -++#define mc_exit (rpi_shader + 630) -++#define mc_interrupt_exit8 (rpi_shader + 648) -++#define mc_end (rpi_shader + 678) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index e138c95..d9ffcda 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -167,8 +167,6 @@ add t0s, r2, r1 -+ -+ # Dump padding words -+ mov r0, unif -+-mov r0, unif -+-mov r0, unif -+ -+ # submit texture requests for second line -+ max r1, ra_y, 0 -+@@ -228,11 +226,10 @@ asr ra3, r0, rb23; mul24 r0, r0, ra22 -+ asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ asr ra0, r0, rb23; mov r0, unif -+- mov r0, unif -+ asr rb11, r0, rb23; mul24 r0, r0, ra22 -+ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -++asr rb8, r0, rb23 -+ -+ # r2 is elem_num -+ # r3 is loop counter -+@@ -362,11 +359,10 @@ asr ra3, r0, rb23; mul24 r0, r0, ra22 -+ asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ asr ra0, r0, rb23; mov r0, unif -+- mov r0, unif -+ asr rb11, r0, rb23; mul24 r0, r0, ra22 -+ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -++asr rb8, r0, rb23 -+ -+ # r2 is elem_num -+ # r3 is loop counter -+@@ -490,11 +486,10 @@ asr ra3, r0, rb23; mul24 r0, r0, ra22 -+ asr ra2, r0, rb23; mul24 r0, r0, ra22 -+ asr ra1, r0, rb23; mul24 r0, r0, ra22 -+ asr ra0, r0, rb23; mov r0, unif -+- mov r0, unif -+ asr rb11, r0, rb23; mul24 r0, r0, ra22 -+ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -++asr rb8, r0, rb23 -+ -+ # r2 is elem_num -+ # r3 is loop counter -+-- -+2.5.0 -+ -+ -+From 87ea97549920ec537d6bb03b6848be12b7b4e252 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 14 May 2015 15:21:49 +0100 -+Subject: [PATCH 34/68] hevc: don't redirect when not rpi_enabled -+ -+--- -+ libavcodec/hevc.c | 2 +- -+ 1 file changed, 1 insertion(+), 1 deletion(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index c65af74..e2f8a87 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -1457,7 +1457,7 @@ static int hls_pcm_sample(HEVCContext *s, int x0, int y0, int log2_cb_size) -+ */ -+ -+ #ifdef RPI_INTER -+-#define RPI_REDIRECT(fn) rpi_ ## fn -++#define RPI_REDIRECT(fn) (s->enable_rpi ? rpi_ ## fn : fn) -+ static void rpi_luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref, const Mv *mv, int x_off, int y_off, -+ int block_w, int block_h, int luma_weight, int luma_offset) -+-- -+2.5.0 -+ -+ -+From d922347fd57c0320b6c6983a6c0b7c3200dae393 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 14 May 2015 15:22:02 +0100 -+Subject: [PATCH 35/68] Use /dev/vcio for mailbox access -+ -+--- -+ libavcodec/rpi_mailbox.c | 2 +- -+ 1 file changed, 1 insertion(+), 1 deletion(-) -+ -+diff --git a/libavcodec/rpi_mailbox.c b/libavcodec/rpi_mailbox.c -+index 536896f..77a56dd 100644 -+--- a/libavcodec/rpi_mailbox.c -++++ b/libavcodec/rpi_mailbox.c -+@@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+ -+ #define MAJOR_NUM 100 -+ #define IOCTL_MBOX_PROPERTY _IOWR(MAJOR_NUM, 0, char *) -+-#define DEVICE_FILE_NAME "/dev/char_dev" -++#define DEVICE_FILE_NAME "/dev/vcio" -+ -+ #include "rpi_mailbox.h" -+ -+-- -+2.5.0 -+ -+ -+From 70688cd4e7a3bb073fe32a1dbdded4c4dfee3a42 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 14 May 2015 15:25:25 +0100 -+Subject: [PATCH 36/68] Use vcsm for all memory allocations -+ -+--- -+ libavcodec/rpi_qpu.c | 174 +++++++++++++++++++-------------------------------- -+ 1 file changed, 64 insertions(+), 110 deletions(-) -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 60bf079..f62051f 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -1,7 +1,5 @@ -+ #ifdef RPI -+-// define RPI_USE_VCSM to use the vcsm device for shared memory -+ // This works better than the mmap in that the memory can be cached, but requires a kernel modification to enable the device. -+-#define RPI_USE_VCSM -+ // define RPI_TIME_TOTAL_QPU to print out how much time is spent in the QPU code -+ #define RPI_TIME_TOTAL_QPU -+ // define RPI_TIME_TOTAL_VPU to print out how much time is spent in the VPI code -+@@ -25,9 +23,7 @@ -+ #include "rpi_shader.h" -+ #include "rpi_hevc_transform.h" -+ -+-#ifdef RPI_USE_VCSM -+ #include "rpi_user_vcsm.h" -+-#endif -+ -+ // On Pi2 there is no way to access the VPU L2 cache -+ // GPU_MEM_FLG should be 4 for uncached memory. (Or C for alias to allocate in the VPU L2 cache) -+@@ -96,7 +92,6 @@ struct GPU -+ unsigned int vpu_code[VPU_CODE_SIZE]; -+ short transMatrix2even[16*16*2]; -+ int open_count; // Number of allocated video buffers -+- unsigned int vc_handle; // Handle of this memory -+ int mb; // Mailbox handle -+ int vc; // Address in GPU memory -+ int mail[12]; // These are used to pass pairs of code/unifs to the QPUs -+@@ -105,6 +100,7 @@ struct GPU -+ // Stop more than one thread trying to allocate memory or use the processing resources at once -+ static pthread_mutex_t gpu_mutex = PTHREAD_MUTEX_INITIALIZER; -+ static volatile struct GPU* gpu = NULL; -++static GPU_MEM_PTR_T gpu_mem_ptr; -+ -+ #if defined(RPI_TIME_TOTAL_QPU) || defined(RPI_TIME_TOTAL_VPU) -+ static unsigned int Microseconds(void) { -+@@ -132,39 +128,27 @@ static volatile int vpu_async_tail=0; // Contains the number of posted jobs -+ static volatile int vpu_async_head=0; -+ #endif -+ -++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb); -++static void gpu_free_internal(GPU_MEM_PTR_T *p); -++ -+ // Connect to QPU, returns 0 on success. -+ static int gpu_init(volatile struct GPU **gpu) { -+ int mb = mbox_open(); -+ int vc; -+- int handle; -+ volatile struct GPU* ptr; -+ if (mb < 0) -+ return -1; -+ -+ if (qpu_enable(mb, 1)) return -2; -+ -+-#ifdef RPI_USE_VCSM -+ vcsm_init(); -+-#endif -++ gpu_malloc_uncached_internal(sizeof(struct GPU), &gpu_mem_ptr, mb); -++ ptr = (volatile struct GPU*)gpu_mem_ptr.arm; -++ memset(ptr, 0, sizeof *ptr); -++ vc = gpu_mem_ptr.vc; -+ -+- handle = mem_alloc(mb, sizeof(struct GPU), 4096, GPU_MEM_FLG); -+- if (!handle) -+- { -+- qpu_enable(mb, 0); -+- return -3; -+- } -+- vc = mem_lock(mb, handle); -+- ptr = mapmem_shared((vc+GPU_MEM_MAP)&~0xc0000000, sizeof(struct GPU)); -+- if (ptr == NULL) -+- { mem_free(mb, handle); -+- mem_unlock(mb, handle); -+- qpu_enable(mb, 0); -+- return -4; -+- } -+- -+- ptr->mb = mb; -+- ptr->vc_handle = handle; -+- ptr->vc = vc; -++ ptr->mb = mb; -++ ptr->vc = vc; -+ -+ printf("GPU allocated at 0x%x\n",vc); -+ -+@@ -226,94 +210,74 @@ static void gpu_unlock(void) { -+ pthread_mutex_unlock(&gpu_mutex); -+ } -+ -++static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) { -++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); -++ assert(p->vcsm_handle); -++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -++ assert(p->vc_handle); -++ p->arm = vcsm_lock(p->vcsm_handle); -++ assert(p->arm); -++ p->vc = mem_lock(mb, p->vc_handle); -++ assert(p->vc); -++ return 0; -++} -++ -+ // Allocate memory on GPU -+ // Fills in structure

containing ARM pointer, videocore handle, videocore memory address, numbytes -+ // Returns 0 on success. -+ // This allocates memory that will not be cached in ARM's data cache. -+ // Therefore safe to use without data cache flushing. -+-int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p) { -++int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p) -++{ -++ int r; -+ gpu_lock(); -+- p->vc_handle = mem_alloc(gpu->mb, numbytes, 4096, GPU_MEM_FLG); -+- p->vcsm_handle = 0; -+- if (!p->vc_handle) -+- { -+- qpu_enable(gpu->mb, 0); -+- return -3; -+- } -+- p->vc = mem_lock(gpu->mb, p->vc_handle); -+- p->arm = mapmem_shared((p->vc+GPU_MEM_MAP)&~0xc0000000,numbytes); -+- p->numbytes = numbytes; -+- if (p->arm == NULL) -+- { -+- mem_free(gpu->mb, p->vc_handle); -+- mem_unlock(gpu->mb, p->vc_handle); -+- gpu_unlock(); -+- qpu_enable(gpu->mb, 0); -+- return -4; -+- } -++ r = gpu_malloc_uncached_internal(numbytes, p, gpu->mb); -+ gpu->open_count++; -+ gpu_unlock(); -+- return 0; -++ return r; -+ } -+ -+ void gpu_cache_flush(GPU_MEM_PTR_T *p) -+ { -+- // This only works when using RPI_USE_VCSM -+ void *tmp = vcsm_lock(p->vcsm_handle); -+ vcsm_unlock_ptr(tmp); -+ } -+ -++static int gpu_malloc_cached_internal(int numbytes, GPU_MEM_PTR_T *p) { -++ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST, (char *)"Video Frame" ); -++ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_VC, (char *)"Video Frame" ); -++ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); -++ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST_AND_VC, (char *)"Video Frame" ); -++ assert(p->vcsm_handle); -++ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -++ assert(p->vc_handle); -++ p->arm = vcsm_lock(p->vcsm_handle); -++ assert(p->arm); -++ p->vc = mem_lock(gpu->mb, p->vc_handle); -++ assert(p->vc); -++ return 0; -++} -++ -+ // This allocates data that will be -+ // Cached in ARM L2 -+ // Uncached in VPU L2 -+-int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p) { -++int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p) -++{ -++ int r; -+ gpu_lock(); -+-#ifdef RPI_USE_VCSM -+- { -+- p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST, (char *)"Video Frame" ); // f....... locks up for VP9 - retest this? -+- //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_VC, (char *)"Video Frame" ); // 3b...... works -+- //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); //fb...... locks up -+- //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST_AND_VC, (char *)"Video Frame" ); // 3b works (but corrupted due to caching) -+- p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -+- p->arm = vcsm_lock(p->vcsm_handle); -+- p->vc = mem_lock(gpu->mb, p->vc_handle); -+- } -+-#else -+- p->vc_handle = mem_alloc(gpu->mb, numbytes, 4096, GPU_MEM_FLG); -+- p->vcsm_handle = 0; -+- if (!p->handle) -+- { -+- qpu_enable(gpu->mb, 0); -+- return -3; -+- } -+- p->vc = mem_lock(gpu->mb, p->vc_handle); -+- printf("This mapmem_private does not seem to work\n"); -+- exit(-1); -+- p->arm = mapmem_private((p->vc+GPU_MEM_MAP)&~0xc0000000,numbytes); -+- p->numbytes = numbytes; -+- if (p->arm == NULL) -+- { -+- mem_free(gpu->mb, p->handle); -+- mem_unlock(gpu->mb, p->handle); -+- gpu_unlock(); -+- qpu_enable(gpu->mb, 0); -+- return -4; -+- } -+-#endif -++ r = gpu_malloc_cached_internal(numbytes, p); -+ gpu->open_count++; -+ gpu_unlock(); -+- return 0; -++ return r; -+ } -+ -+ static void gpu_term(void) -+ { -+- int mb; -+- unsigned handle; -++ int mb; -+ -+ if (gpu==NULL) -+ return; -+ mb = gpu->mb; -+- handle = gpu->vc_handle; -+ -+ #ifdef RPI_ASYNC -+ { -+@@ -323,37 +287,26 @@ static void gpu_term(void) -+ } -+ #endif -+ -++ qpu_enable(mb, 0); -++ gpu_free_internal(&gpu_mem_ptr); -+ -+- unmapmem((void*)gpu, sizeof(struct GPU)); -+- mem_unlock(mb, handle); -+- mem_free(mb, handle); -+- qpu_enable(mb, 0); -+-#ifdef RPI_USE_VCSM -+ vcsm_exit(); -+-#endif -+- mbox_close(mb); -++ -++ mbox_close(mb); -+ gpu = NULL; -+ } -+ -+-void gpu_free(GPU_MEM_PTR_T *p) { -++void gpu_free_internal(GPU_MEM_PTR_T *p) { -+ int mb = gpu->mb; -+- unsigned handle = p->vc_handle; -++ mem_unlock(mb,p->vc_handle); -++ vcsm_unlock_ptr(p->arm); -++ vcsm_free(p->vcsm_handle); -++} -++ -++void gpu_free(GPU_MEM_PTR_T *p) { -+ gpu_lock(); -+-#ifdef RPI_USE_VCSM -+- if (p->vcsm_handle) { -+- mem_unlock(mb,p->vc_handle); -+- vcsm_unlock_ptr(p->arm); -+- vcsm_free(p->vcsm_handle); -+- } else { -+- unmapmem((void*)p->arm, sizeof(struct GPU)); -+- mem_unlock(mb, handle); -+- mem_free(mb, handle); -+- } -+-#else -+- unmapmem((void*)p->arm, sizeof(struct GPU)); -+- mem_unlock(mb, handle); -+- mem_free(mb, handle); -+-#endif -++ -++ gpu_free_internal(p); -+ -+ gpu->open_count--; -+ if (gpu->open_count==0) { -+@@ -386,20 +339,21 @@ unsigned int vpu_get_constants(void) { -+ -+ static void *vpu_start(void *arg) { -+ while(1) { -++ int *p; -+ pthread_mutex_lock(&post_mutex); -+ while( vpu_async_tail - vpu_async_head <= 0) -+ { -+ //printf("Checking number %d %d\n",vpu_async_head,vpu_async_tail); -+ pthread_cond_wait(&post_cond_tail, &post_mutex); -+ } -+- int *p = vpu_cmds[vpu_async_head%MAXCMDS]; -++ p = vpu_cmds[vpu_async_head%MAXCMDS]; -+ pthread_mutex_unlock(&post_mutex); -+ -+ if (p[6] == -1) { -+ break; // Last job -+ } -+ if (p[7]) { -+- GPU_MEM_PTR_T *buf = (GPU_MEM_PTR_T *)p[7]; -++ //GPU_MEM_PTR_T *buf = (GPU_MEM_PTR_T *)p[7]; -+ //gpu_cache_flush(buf); -+ } -+ vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -+-- -+2.5.0 -+ -+ -+From a98ba0c30ea93bdf25308e679ed5a38f09b63f9d Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 14 May 2015 15:43:17 +0100 -+Subject: [PATCH 37/68] Enable EARLY_MALLOC and fix sps access bug -+ -+--- -+ libavcodec/hevc.c | 5 +++-- -+ 1 file changed, 3 insertions(+), 2 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index e2f8a87..61f6dfb 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -44,7 +44,7 @@ -+ #ifdef RPI -+ #include "rpi_qpu.h" -+ // For some unknown reason, the code seems to crash if I do a late malloc -+- #define EARLY_MALLOC -++ //#define EARLY_MALLOC -+ // Move Inter prediction into separate pass -+ #define RPI_INTER -+ #endif -+@@ -149,7 +149,8 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ #ifdef RPI -+ #ifdef EARLY_MALLOC -+ #else -+- int coeffs_in_ctb = (1 << s->ps.sps->log2_ctb_size) * (1 << s->ps.sps->log2_ctb_size); -++ assert(sps); -++ int coeffs_in_ctb = (1 << sps->log2_ctb_size) * (1 << sps->log2_ctb_size); -+ int coefs_per_row = sps->ctb_width * coeffs_in_ctb * 3; // Allow space for chroma -+ printf("pic_arrays_init\n"); -+ printf("Allocated %d\n",coefs_per_row); -+-- -+2.5.0 -+ -+ -+From 3e7256195852455e030586a1945cccc3fc7eb44a Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 14 May 2015 16:40:51 +0100 -+Subject: [PATCH 38/68] Add copy of av_mod_uintp2 for use with stable ffmpeg -+ -+--- -+ libavcodec/hevc.c | 8 ++++++++ -+ 1 file changed, 8 insertions(+) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 61f6dfb..d27c7f3 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -51,6 +51,14 @@ -+ -+ // #define DISABLE_MC -+ -++#ifndef av_mod_uintp2 -++static av_always_inline av_const unsigned av_mod_uintp2_c(unsigned a, unsigned p) -++{ -++ return a & ((1 << p) - 1); -++} -++# define av_mod_uintp2 av_mod_uintp2_c -++#endif -++ -+ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12] = 4, [16] = 5, [24] = 6, [32] = 7, [48] = 8, [64] = 9 }; -+ -+ -+-- -+2.5.0 -+ -+ -+From ba9624fdc6073af3392753925bcb712dba984be8 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Mon, 18 May 2015 11:11:02 +0100 -+Subject: [PATCH 39/68] Added support for weighted prediction in P frames -+ -+--- -+ libavcodec/hevc.c | 52 ++++- -+ libavcodec/rpi_shader.c | 566 +++++++++++++++++++++++---------------------- -+ libavcodec/rpi_shader.h | 12 +- -+ libavcodec/rpi_shader.qasm | 39 +++- -+ 4 files changed, 384 insertions(+), 285 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index d27c7f3..98f8461 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -64,7 +64,7 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ -+ #ifdef RPI_INTER_QPU -+ -+-#define RPI_CHROMA_COMMAND_WORDS 10 -++#define RPI_CHROMA_COMMAND_WORDS 12 -+ #define UV_COMMANDS_PER_QPU ((1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS) -+ // The QPU code for UV blocks only works up to a block width of 8 -+ #define RPI_CHROMA_BLOCK_WIDTH 8 -+@@ -2020,6 +2020,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int y1_c = y0_c + (mv->y >> (2 + hshift)); -+ //int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -+ int chan = x0>>8; -++ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -++ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+@@ -2032,6 +2034,13 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = ( (nPbW_csh.chroma_offset_l0[current_mv.ref_idx[0]][0] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0] & 0xffff); -++ *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[0]][1] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[0]][1] & 0xffff); -++ } else { -++ *u++ = 1; // Weight of 1 and offset of 0 -++ *u++ = 1; -++ } -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2074,6 +2083,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int y1_c = y0_c + (mv->y >> (2 + hshift)); -+ //int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -+ int chan = x0>>8; -++ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -++ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+@@ -2087,6 +2098,13 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ // TODO chroma weight and offset... s->sh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+ *u++ = rpi_filter_coefs[_my][0]; -++ if (weight_flag) { -++ *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[1]][0] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[1]][0] & 0xffff); -++ *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[1]][1] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[1]][1] & 0xffff); -++ } else { -++ *u++ = 1; // Weight of 1 and offset of 0 -++ *u++ = 1; -++ } -+ *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2148,6 +2166,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = ( (nPbW_cmc_filter_uv_b; -+@@ -2158,6 +2177,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = ( (nPbW_cframe->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+@@ -2784,6 +2804,9 @@ static void rpi_inter_clear(HEVCContext *s) -+ int i; -+ int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; -+ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; -++ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -++ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -++ -+ for(i=0;i<8;i++) { -+ s->u_mvs[i] = s->mvs_base[i]; -+ *s->u_mvs[i]++ = 0; -+@@ -2795,6 +2818,13 @@ static void rpi_inter_clear(HEVCContext *s) -+ *s->u_mvs[i]++ = pic_height; -+ *s->u_mvs[i]++ = s->frame->linesize[1]; -+ *s->u_mvs[i]++ = s->frame->linesize[2]; -++ if (weight_flag) { -++ *s->u_mvs[i]++ = 1 << (s->sh.chroma_log2_weight_denom + 6 - 1); -++ *s->u_mvs[i]++ = s->sh.chroma_log2_weight_denom + 6; -++ } else { -++ *s->u_mvs[i]++ = 1 << 5; -++ *s->u_mvs[i]++ = 6; -++ } -+ s->u_mvs[i] += 1; // Padding words -+ } -+ } -+@@ -2838,12 +2868,29 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ int ctb_addr_ts = s->ps.pps->ctb_addr_rs_to_ts[s->sh.slice_ctb_addr_rs]; -+ -+ #ifdef RPI -++#ifdef RPI_INTER_QPU -+ s->enable_rpi = s->ps.sps->bit_depth == 8 -+ && s->ps.sps->width <= RPI_MAX_WIDTH -+ && !s->ps.pps->cross_component_prediction_enabled_flag -+ && s->ps.pps->num_tile_rows <= 1 && s->ps.pps->num_tile_columns <= 1 -+- && !(s->ps.pps->weighted_pred_flag && s->sh.slice_type == P_SLICE) -+ && !(s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE); -++#else -++ s->enable_rpi = s->ps.sps->bit_depth == 8 -++ && s->ps.sps->width <= RPI_MAX_WIDTH -++ && !s->ps.pps->cross_component_prediction_enabled_flag -++ && s->ps.pps->num_tile_rows <= 1 && s->ps.pps->num_tile_columns <= 1; -++#endif -++ -++ /*if (!s->enable_rpi) { -++ if (s->ps.pps->cross_component_prediction_enabled_flag) -++ printf("Cross component\n"); -++ if (s->ps.pps->num_tile_rows > 1 || s->ps.pps->num_tile_columns > 1) -++ printf("Tiles\n"); -++ if (s->ps.pps->weighted_pred_flag && s->sh.slice_type == P_SLICE) -++ printf("Weighted P slice\n"); -++ if (s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE) -++ printf("Weighted B slice\n"); -++ }*/ -+ -+ #endif -+ -+@@ -2976,6 +3023,7 @@ static int hls_decode_entry_wpp(AVCodecContext *avctxt, void *input_ctb_row, int -+ -+ #ifdef RPI -+ s->enable_rpi = 0; -++ //printf("Wavefront\n"); -+ #endif -+ -+ if(ctb_row) { -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index b0b93b5..3f04d80 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -88,287 +88,307 @@ unsigned int rpi_shader[] = { -+ /* [0x000001f8] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+ /* [0x00000200] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+ /* [0x00000208] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00000210] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000218] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000220] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000228] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000230] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000238] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000240] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00000248] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00000210] */ 0x15827d80, 0x10021327, // mov rb12,unif -++/* [0x00000218] */ 0x15827d80, 0x10021367, // mov rb13,unif -++/* [0x00000220] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000228] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000230] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000238] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000240] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000248] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000250] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -++/* [0x00000258] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -+ // ::mc_filter_uv -+-/* [0x00000250] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000258] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000260] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000268] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000270] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000278] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000280] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000288] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000290] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000298] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000002a0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000002a8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002b0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002b8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002c0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002c8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002d0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002d8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000002e0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000002e8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000002f0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000002f8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000300] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000308] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000310] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000318] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000320] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000330] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000340] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000348] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000350] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000358] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000360] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000260] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000268] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000270] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000278] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000280] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000288] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000290] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000298] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000002a0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000002a8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000002b0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000002b8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002c0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002c8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002d0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002d8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002e0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002e8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000002f0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000002f8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000300] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000308] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000310] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000318] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000320] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000330] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000340] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000348] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000350] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000358] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000360] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000368] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000370] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00000378] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000380] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00000388] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000390] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -++/* [0x00000398] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000003a0] */ 0x0f9e7080, 0x100613a7, // asr.ifnz rb14, r0, r2 -++/* [0x000003a8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000003b0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x00000368] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000370] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000378] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000380] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000388] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000390] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000398] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003a0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003a8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003b0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000003b8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003c0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000003c8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000003d0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000003d8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000003e0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000003e8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000003f0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000003f8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000400] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000408] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000410] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000418] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000420] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000428] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000430] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000438] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000440] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000448] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000450] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000458] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000460] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000468] */ 0x0c567380, 0x10020867, // add r1, r1, ra21 -+-/* [0x00000470] */ 0xfffffed8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000478] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -+-/* [0x00000480] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000488] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000490] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000498] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004a0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000004a8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000004b0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000004b8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000004c0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000004c8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000004d0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000003b8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003c0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x000003c8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x000003d0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003d8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003e0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003e8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003f0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003f8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000400] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000408] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000410] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000418] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000420] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000428] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000430] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000438] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000440] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000448] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000450] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000458] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000460] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000468] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000470] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000478] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000480] */ 0x00000020, 0xe0021327, // mov rb12,32 -++/* [0x00000488] */ 0x00000006, 0xe0021367, // mov rb13,6 -++/* [0x00000490] */ 0x00000001, 0xe00213a7, // mov rb14,1 -++/* [0x00000498] */ 0x00000000, 0xe00213e7, // mov rb15,0 -++/* [0x000004a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000004a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000004b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000004b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000004c0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000004c8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000004d0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000004d8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x000004e0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x000004e8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x000004f0] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004f8] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x00000500] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000508] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000510] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000518] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000520] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000528] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000530] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000538] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000540] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000548] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000550] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x000004d8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000004e0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000004e8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000004f0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000004f8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000500] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000508] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000510] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000518] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000520] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000528] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000530] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000538] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000540] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000548] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000550] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000558] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000560] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000568] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000570] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000578] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000580] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000588] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000590] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000598] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005a0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005a8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005b0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000005b8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005c0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005c8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000005d0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x000005d8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000005e0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000005e8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000558] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000560] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000568] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000570] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000578] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000580] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000588] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000590] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000598] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x000005a0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000005a8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x000005b0] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x000005b8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000005c0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005c8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000005d0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000005d8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000005e0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000005e8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000005f0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000005f8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000600] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000608] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000610] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000618] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000620] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000628] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000630] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000638] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000640] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000648] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000650] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000658] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000660] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000668] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000670] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000678] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x000005f0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000005f8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000600] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000608] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000610] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000618] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000620] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000628] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000630] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000638] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000640] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000648] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000650] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000658] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000660] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000668] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000670] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000678] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000680] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000688] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000690] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000698] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x000006a0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000006a8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x000006b0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000006b8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000006c0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000006c8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000006d0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000006d8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000006e0] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -+-/* [0x000006e8] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x000006f0] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -+-/* [0x000006f8] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000700] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000708] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000710] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000718] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000720] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000680] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000688] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000690] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000698] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000006a0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000006a8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000006b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000006b8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000006c0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x000006c8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x000006d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000006d8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000006e0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000006e8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000006f0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000006f8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000700] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000708] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000710] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000718] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000720] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000728] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000730] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000738] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000740] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000748] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000750] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000758] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000760] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000768] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000770] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -++/* [0x00000778] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000780] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -++/* [0x00000788] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000790] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000798] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000007a0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000007a8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000007b0] */ 0x009e7000, 0x100009e7, // nop -+ // ::mc_filter_uv_b -+-/* [0x00000728] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000730] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000738] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000740] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000748] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000750] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000758] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000760] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000768] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000770] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000778] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000780] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000788] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000790] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000798] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000007a0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000007a8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000007b0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000007b8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000007c0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000007c8] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x000007d0] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x000007d8] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x000007e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000007e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000007f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000007f8] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000800] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000808] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000810] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000818] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000820] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000828] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000830] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000838] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000840] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000848] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000850] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000858] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000007b8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000007c0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000007c8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000007d0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000007d8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000007e0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000007e8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000007f0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000007f8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -++/* [0x00000800] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000808] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -++/* [0x00000810] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000818] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000820] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000828] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000830] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000838] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000840] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000848] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000850] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000858] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000860] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000868] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000870] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000878] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000880] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000888] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000890] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000898] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000008b8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008d0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x000008d8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008e0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008e8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000008f0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008f8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00000860] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000868] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000870] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000878] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000880] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000888] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000890] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000898] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000008a0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000008a8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000008b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008b8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000008c0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000008c8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000008d0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000008d8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000008e0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000008e8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000008f0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000008f8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000900] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000908] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000910] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000918] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000920] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000928] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000930] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000938] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000940] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000948] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000950] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x00000958] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000960] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000968] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000970] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000978] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000980] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000988] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000990] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000998] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000009a0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x000009a8] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x000009b0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000009b8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000009c0] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x000009c8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x000009d0] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000900] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000908] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -++/* [0x00000910] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++/* [0x00000918] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000920] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000928] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000930] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000938] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000940] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -++/* [0x00000948] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -++/* [0x00000950] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000958] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000960] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000968] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000970] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000978] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000980] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000988] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000990] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000998] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x000009a0] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x000009a8] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009b0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000009b8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000009c0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000009c8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000009d0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000009d8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000009e0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000009e8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000009f0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000009f8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000a00] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000a08] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000a10] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000a18] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000a20] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a28] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a30] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a38] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a40] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000a48] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000a50] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a58] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a60] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000a68] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a70] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x000009d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x000009e0] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x000009e8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000009f0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x000009f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a00] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a08] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000a10] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000a18] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a78] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a80] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a98] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000aa0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ab0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000a20] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a28] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a30] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a38] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a40] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a48] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a50] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a58] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a60] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a68] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a70] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a78] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000a80] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000a88] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000a90] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000ac0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000ac8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ad0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ad8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ae0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b00] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b08] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b10] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b18] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000b20] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000b28] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000b30] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 99927c4..cec9901 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,11 +4,11 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 148) -+-#define mc_filter_uv_b0 (rpi_shader + 310) -+-#define mc_filter_uv_b (rpi_shader + 458) -+-#define mc_exit (rpi_shader + 630) -+-#define mc_interrupt_exit8 (rpi_shader + 648) -+-#define mc_end (rpi_shader + 678) -++#define mc_filter_uv (rpi_shader + 152) -++#define mc_filter_uv_b0 (rpi_shader + 342) -++#define mc_filter_uv_b (rpi_shader + 494) -++#define mc_exit (rpi_shader + 670) -++#define mc_interrupt_exit8 (rpi_shader + 688) -++#define mc_end (rpi_shader + 718) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index d9ffcda..97c4c02 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -9,7 +9,12 @@ -+ # (ra15 isn't clamped to zero - this happens during the -+ # copy to ra14, and during its use in the vertical filter) -+ # -+-# rb8...rb15 eight vertical filter coefficients -++# rb8...rb11 eight vertical filter coefficients -++ -++# rb12 offset to add before shift -++# rb13 shift -++# rb14 weight (U on left, V on right) -++# rb15 offset (U on left, V on right) -+ # -+ # ra16 clipped(row start address+elem_num)&~3 -+ # ra17 per-channel shifts -+@@ -165,6 +170,9 @@ add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+ add t0s, r0, r1 ; mov ra_x2_base, r2 -+ add t0s, r2, r1 -+ -++mov rb12,unif # offset before shift -++mov rb13,unif # offset after shift -++ -+ # Dump padding words -+ mov r0, unif -+ -+@@ -231,11 +239,21 @@ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+ asr rb8, r0, rb23 -+ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++mov r0, unif # U offset/weight -++asr rb15, r0, r2 # Compute offset from MSBs -++shl r0, r0, r2 -++asr rb14, r0, r2 # Compute weight from LSBs -++mov r0, unif # V offset/weight -++asr.ifnz rb15, r0, r2 -++shl r0, r0, r2 -++asr.ifnz rb14, r0, r2 -++ -+ # r2 is elem_num -+ # r3 is loop counter -+ -+ mov r5rep, -8 -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+ # retrieve texture results and pick out bytes -+ # then submit two more texture requests -+@@ -279,6 +297,11 @@ mov ra13, ra14 # Delay slot 1 -+ mov ra14, ra15 # Delay slot 2 -+ mov ra15, r0 # Delay slot 3 -+ -++mov rb12,32 -++mov rb13,6 -++mov rb14,1 -++mov rb15,0 -++ -+ # apply vertical filter and write to VPM -+ -+ nop ; mul24 r1, ra14, rb10 -+@@ -288,9 +311,11 @@ add r1, r1, r0 ; mul24 r0, ra15, rb11 -+ add r1, r1, r0 ; mov -, vw_wait -+ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+ asr r1, r1, 14 -+-add r1, r1, ra21 -++nop ; mul24 r1, r1, rb14 -++add r1, r1, rb12 -++asr r1, r1, rb13 -+ brr.anyn -, r:uvloop -+-asr r1, r1, 6 # Delay 1 -++add r1, r1, rb15 # Delay 1 -+ min r1, r1, rb22 # Delay 2 -+ max vpm, r1, 0 # Delay 3 -+ -+@@ -364,6 +389,9 @@ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+ asr rb8, r0, rb23 -+ -++mov r0, unif # U offset/weight -++mov r0, unif # V offset/weight -++ -+ # r2 is elem_num -+ # r3 is loop counter -+ -+@@ -491,6 +519,9 @@ asr rb10, r0, rb23; mul24 r0, r0, ra22 -+ asr rb9, r0, rb23; mul24 r0, r0, ra22 -+ asr rb8, r0, rb23 -+ -++mov r0, unif # U offset/weight -++mov r0, unif # V offset/weight -++ -+ # r2 is elem_num -+ # r3 is loop counter -+ -+-- -+2.5.0 -+ -+ -+From b789dfe8032e13b13384315c6e40d59891c1d248 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 19 May 2015 08:43:30 +0100 -+Subject: [PATCH 40/68] Improved ordering of tasks -+ -+--- -+ libavcodec/hevc.c | 8 ++++---- -+ 1 file changed, 4 insertions(+), 4 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 98f8461..01898fd 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2932,15 +2932,15 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->dblk_cmds[s->num_dblk_cmds][0] = x_ctb; -+ s->dblk_cmds[s->num_dblk_cmds++][1] = y_ctb; -+ if ( (((y_ctb + ctb_size)&63) == 0) && x_ctb + ctb_size >= s->ps.sps->width) { -+-#ifdef RPI_INTER_QPU -+- // Kick off inter prediction on QPUs -+- rpi_execute_inter_qpu(s); -+-#endif -+ // Transform all blocks -+ // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+ rpi_execute_transform(s); -+ // Perform inter prediction -+ rpi_execute_inter_cmds(s); -++#ifdef RPI_INTER_QPU -++ // Kick off inter prediction on QPUs -++ rpi_execute_inter_qpu(s); -++#endif -+ // Wait for transform completion -+ vpu_wait(s->vpu_id); -+ -+-- -+2.5.0 -+ -+ -+From 005310ce2e038c9d9d8d6761b11718d218983975 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 20 May 2015 19:58:19 +0100 -+Subject: [PATCH 41/68] Drafted Luma inter prediction -+ -+--- -+ libavcodec/rpi_shader.qasm | 594 ++++++++++++++++++++++++++++++++++++++++++--- -+ 1 file changed, 554 insertions(+), 40 deletions(-) -+ -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 97c4c02..9cfc0d9 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -2,7 +2,10 @@ -+ # -+ # ra0...ra7 eight horizontal filter coefficients -+ # -+-# rb1...rb7 seven shifted copies of the current unfiltered row -++# rb0 rx_shift2 -++# rb1 ra_y2_next -++# -++# rb4...rb7 -+ # -+ # ra8...ra15 eight filtered rows of context (rb15 == most recent) -+ # -+@@ -26,9 +29,9 @@ -+ # rb19 next ra16 -+ # -+ # ra20 1 -+-# ra21 32 -++# ra21 ra_21 -+ # ra22 256 -+-# ra23 8 -++# ra23 rx_shift2_next -+ # -+ # rb20 0xffffff00 -+ # rb21 vpm_setup for reading/writing 16bit results into VPM -+@@ -57,16 +60,23 @@ -+ .set rb_frame_width_minus_1, rb25 -+ .set rb_frame_height_minus_1, rb30 -+ .set rb_pitch, rb16 -+-.set ra_x_base, ra16 -+-.set rb_x_base_next, rb19 -+-.set ra_x2_base, ra24 -+-.set ra_x2_base_next, ra26 -++.set ra_x, ra16 -++.set ra_y2, ra21 -++.set ra_y2_next, rb1 -++ -++.set rb_x_next, rb19 -++.set rx_frame_base2_next, rb19 -++ -++.set ra_frame_base, ra24 -++.set ra_frame_base_next, ra26 -+ .set ra_xshift, ra17 -+ -+-.set ra_x2shift, ra25 -+ .set ra_u2v_ref_offset, ra25 -++.set ra_frame_base2, ra25 -+ -+ .set ra_xshift_next, ra19 -++.set rx_xshift2, rb0 -++.set rx_xshift2_next, ra23 -+ -+ .set ra_x2shift_next, ra27 -+ .set ra_u2v_dst_offset, ra27 -+@@ -83,11 +93,11 @@ -+ mov ra31, unif -+ -+ # Load first request location -+-add ra_x_base, unif, elem_num # Store x -++add ra_x, unif, elem_num # Store x -+ mov ra_y, unif # Store y -+-mov ra_x2_base, unif # Store frame u base -++mov ra_frame_base, unif # Store frame u base -+ nop -+-sub ra_u2v_ref_offset, unif, ra_x2_base # Store offset to add to move from u to v in reference frame -++sub ra_u2v_ref_offset, unif, ra_frame_base # Store offset to add to move from u to v in reference frame -+ -+ # Read image dimensions -+ sub rb25,unif,1 -+@@ -104,9 +114,7 @@ add rb24, r1, r0 -+ # load constants -+ -+ mov ra20, 1 -+-mov ra21, 32 -+ mov ra22, 256 -+-mov ra23, 8 -+ mov ra30, 64 -+ -+ mov rb20, 0xffffff00 -+@@ -156,18 +164,18 @@ mov r1, vpm_setup(0, 2, h16p(0, 0)) # 2 is stride - stride acts on ADDR which i -+ add rb21, r0, r1 -+ -+ # Compute base address for first and second access -+-mov r0, ra_x_base # Load x -++mov r0, ra_x # Load x -+ max r0, r0, 0; mov r1, ra_y # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base # Load the frame base -++min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_frame_base # Load the frame base -+ shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+ add ra_y, r1, 1 -+ add r0, r0, r3 -+ and r0, r0, ~3 -+-max r1, r1, 0 ; mov ra_x_base, r0 # y -++max r1, r1, 0 ; mov ra_x, r0 # y -+ min r1, r1, rb_frame_height_minus_1 -+ # submit texture requests for first line -+ add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-add t0s, r0, r1 ; mov ra_x2_base, r2 -++add t0s, r0, r1 ; mov ra_frame_base, r2 -+ add t0s, r2, r1 -+ -+ mov rb12,unif # offset before shift -+@@ -182,8 +190,8 @@ min r1, r1, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 -+ bra -, ra31 -+ nop ; mul24 r1, r1, rb_pitch -+-add t0s, r1, ra_x_base -+-add t0s, r1, ra_x2_base -++add t0s, r1, ra_x -++add t0s, r1, ra_frame_base -+ -+ -+ -+@@ -192,7 +200,7 @@ add t0s, r1, ra_x2_base -+ # mc_filter_uv(next_kernel, x, y, frame_u_base, frame_v_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_u_dst, this_v_dst) -+ -+ # At this point we have already issued two pairs of texture requests for the current block -+-# ra_x_base, ra_x16_base point to the current coordinates for this block -++# ra_x, ra_x16_base point to the current coordinates for this block -+ ::mc_filter_uv -+ mov ra31, unif -+ -+@@ -207,9 +215,9 @@ min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -+ shl ra_xshift_next, r0, 3 -+ sub r2, unif, r3 # compute offset from frame base u to frame base v -+ add r0, r0, r3 -+-and rb_x_base_next, r0, ~3 -++and rb_x_next, r0, ~3 -+ mov ra_y_next, r1 -+-add ra_x2_base_next, rb_x_base_next, r2 -++add ra_frame_base_next, rb_x_next, r2 -+ -+ # set up VPM write -+ mov vw_setup, rb28 -+@@ -265,16 +273,16 @@ mov r3, 0 -+ # then submit two more texture requests -+ -+ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+ shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+ -+ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_x2_base, r2 -++add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_frame_base, r2 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+@@ -297,7 +305,7 @@ mov ra13, ra14 # Delay slot 1 -+ mov ra14, ra15 # Delay slot 2 -+ mov ra15, r0 # Delay slot 3 -+ -+-mov rb12,32 -++mov rb12,32 # TODO remove these to make P weighted prediction work properly -+ mov rb13,6 -+ mov rb14,1 -+ mov rb15,0 -+@@ -342,7 +350,7 @@ mov vw_addr, unif # start the VDW -+ # mc_filter_uv_b0(next_kernel, x, y, frame_u_base, frame_v_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_u_dst, this_v_dst) -+ -+ # At this point we have already issued two pairs of texture requests for the current block -+-# ra_x_base, ra_x16_base point to the current coordinates for this block -++# ra_x, ra_x16_base point to the current coordinates for this block -+ ::mc_filter_uv_b0 -+ mov ra31, unif -+ -+@@ -357,9 +365,9 @@ min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -+ shl ra_xshift_next, r0, 3 -+ sub r2, unif, r3 # compute offset from frame base u to frame base v -+ add r0, r0, r3 -+-and rb_x_base_next, r0, ~3 -++and rb_x_next, r0, ~3 -+ mov ra_y_next, r1 -+-add ra_x2_base_next, rb_x_base_next, r2 -++add ra_frame_base_next, rb_x_next, r2 -+ -+ # set up VPM write, we need to save 16bit precision -+ mov vw_setup, rb21 -+@@ -408,16 +416,16 @@ mov r3, 0 -+ # then submit two more texture requests -+ -+ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+ shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+ -+ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_x2_base, r2 -++add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_frame_base, r2 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+@@ -477,9 +485,9 @@ min r0, r0, rb_frame_width_minus_1 ; mov r3, unif # frame_base -+ shl ra_xshift_next, r0, 3 -+ sub r2, unif, r3 # compute offset from frame base u to frame base v -+ add r0, r0, r3 -+-and rb_x_base_next, r0, ~3 -++and rb_x_next, r0, ~3 -+ mov ra_y_next, r1 -+-add ra_x2_base_next, rb_x_base_next, r2 -++add ra_frame_base_next, rb_x_next, r2 -+ -+ # set up VPM write -+ mov vw_setup, rb28 -+@@ -538,16 +546,16 @@ mov r3, 0 -+ # then submit two more texture requests -+ -+ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -++shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+ shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+ -+ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_x2_base, r2 -++add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++add t0s, ra_frame_base, r2 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+@@ -642,5 +650,511 @@ nop ; nop ; thrend -+ mov interrupt, 1; nop # delay slot 1 -+ nop ; nop # delay slot 2 -+ -++ -++ -++ -++ -++# LUMA CODE -++ -++# The idea is to form B predictions by doing 8 pixels from ref0 in parallel with 8 pixels from ref1. -++# For P frames we make the second x,y coordinates offset by +8 -++ -++################################################################################ -++# mc_setup(next_kernel, x, y, ref_y_base, x2, y2, ref_y2_base, frame_width, frame_height, pitch, dst_pitch, offset, shift, pad2) -++::mc_setup -++ -++# Read starting kernel -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++mov ra31, unif -++ -++# Compute base address for first and second access -++add r0, unif, elem_num # Load x -++max r0, r0, 0; mov r1, unif # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++shl ra_xshift_next, r0, 3 # Compute shifts -++add ra_y, r1, 1 -++and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++add r2, r2, r0 # r2 is address for frame0 (not including y offset) -++max r1, r1, 0 -++min r1, r1, rb_frame_height_minus_1 -++nop ; mul24 r1, r1, rb_pitch # r2 contains the addresses (not including y offset) for frame0 -++add t0s, r2, r1 ; mov ra_frame_base, r2 -++ -++add r0, unif, elem_num # Load x -++max r0, r0, 0; mov r1, unif # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++shl rx_xshift2_next, r0, 3 # Compute shifts -++add ra_y2, r1, 1 -++and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++add r2, r2, r0 # r2 is address for frame1 (not including y offset) -++max r1, r1, 0 -++min r1, r1, rb_frame_height_minus_1 -++nop ; mul24 r1, r1, rb_pitch # r2 contains the addresses (not including y offset) for frame0 -++add t0s, r2, r1 ; mov ra_frame_base2, r2 -++ -++ -++# Read image dimensions -++sub rb25,unif,1 -++sub rb30,unif,1 -++ -++# get source pitch -++mov rb16, unif -++ -++# get destination pitch -++mov r0, unif -++mov r1, vdw_setup_1(0) -++add rb24, r1, r0 -++ -++# load constants -++ -++mov ra20, 1 -++mov ra22, 256 -++mov ra30, 64 -++ -++mov rb20, 0xffffff00 -++mov rb22, 255 -++mov rb23, 24 -++ -++# touch vertical context to keep simulator happy -++ -++mov ra8, 0 -++mov ra9, 0 -++mov ra10, 0 -++mov ra11, 0 -++mov ra12, 0 -++mov ra13, 0 -++mov ra14, 0 -++mov ra15, 0 -++ -++# Compute part of VPM to use for DMA output -++mov r2, qpu_num -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -++mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -++shl r0, r0, 5 -++add rb27, r0, r1 -++ -++# Compute part of VPM to save data into -++mov r2, qpu_num # qpu_num = abcd -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -++mov r1, vpm_setup(0, 4, h8p(0, 0)) # 4 is stride - stride acts on ADDR which is Y[5:0],B[1:0] for 8 bit -++add rb28, r0, r1 -++ -++mov rb12,unif # offset before shift -++mov rb13,unif # shift -++ -++# Dump padding words -++mov r0, unif -++ -++# submit texture requests for second line -++max r1, ra_y, 0 -++min r1, r1, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 -++nop ; mul24 r1, r1, rb_pitch -++add t0s, r1, ra_frame_base -++ -++max r1, ra_y2, 0 -++min r1, r1, rb_frame_height_minus_1 -++bra -, ra31 -++add ra_y2, ra_y2, 1 # Delay 1 -++nop ; mul24 r1, r1, rb_pitch # Delay 2 -++add t0s, r1, ra_frame_base2 # Delay 3 -++ -++ -++################################################################################ -++ -++# mc_filter(next_kernel, x, y, frame_base, x2, y2, frame_base2, height, hcoeffs[0], hcoeffs2[0], hcoeffs[1], hcoeffs2[1], vcoeffs[0], vcoeffs2[0], vcoeffs[1], vcoeffs2[1], offsetweight0, offsetweight1, this_dst) -++# In a P block, only the first half of coefficients contain used information. -++# At this point we have already issued two pairs of texture requests for the current block -++# ra_x, ra_x16_base point to the current coordinates for this block -++::mc_filter -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++mov rx_xshift2, rx_xshift2_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # Load x -++max r0, r0, 0; mov r1, unif # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++shl ra_xshift_next, r0, 3 # Compute shifts -++mov ra_y_next, r1 -++and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++add ra_frame_base_next, r2, r0 # r2 is address for frame0 (not including y offset) -++ -++add r0, unif, elem_num # Load x -++max r0, r0, 0 ; mov r1, unif # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++shl rx_xshift2_next, r0, 3 # Compute shifts -++add ra_y2_next, r1, 1 -++and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++add rx_frame_base2_next, r2, r0 # r2 is address for frame1 (not including y offset) -++ -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++# get filter coefficients and discard unused B frame values -++mov r0, unif -++mov.ifnz -, unif # Alternate coefficients are unused for P frames -++asr ra3, r0, rb23; mul24 r0, r0, ra22 # These may need some pre-rotation to be used in B frames correctly -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++mov.ifnz -, unif -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++asr ra4, r0, rb23; mov r0, unif -++mov.ifnz -, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++mov.ifnz -, unif -++asr rb7, r0, rb23; mul24 r0, r0, ra22 -++asr rb6, r0, rb23; mul24 r0, r0, ra22 -++asr rb5, r0, rb23; mul24 r0, r0, ra22 -++asr rb4, r0, rb23 -++ -++mov r0, unif # Frame0 offset/weight -++mov.ifnz -, unif # Frame1 offset/weight unused -++asr rb15, r0, r2 # Compute offset from MSBs -++shl r0, r0, r2 -++asr rb14, r0, r2 # Compute weight from LSBs -++ -++# r3 is loop counter -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++mov r3, 0 -++ -++:yloop -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++# If we knew there was no clipping then this code would get simpler. -++# Perhaps we could add on the pitch and clip using larger values? -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -++mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, rx_xshift2 -++mov.ifz ra_y2, ra_y2_next -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y2, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++ -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++# apply horizontal filter -++nop ; mul24 r2, r0, ra0 -++nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++nop ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++add r0, r2, r3 ; mov r3, rb31 -++sub.setf -, r3, 8 ; mov ra12, ra13 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++brr.anyn -, r:yloop -++mov ra13, ra14 # Delay slot 1 -++mov ra14, ra15 # Delay slot 2 -++mov ra15, r0 # Delay slot 3 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r1, ra14, rb10 -++nop ; mul24 r0, ra13, rb9 -++add r1, r1, r0 ; mul24 r0, ra12, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb11 -++add r1, r1, r0 ; mul24 r0, ra8, rb4 -++add r1, r1, r0 ; mul24 r0, ra9, rb5 -++add r1, r1, r0 ; mul24 r0, ra10, rb6 -++add r1, r1, r0 ; mul24 r0, ra11, rb7 -++ -++add r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++asr r1, r1, 14 -++nop ; mul24 r1, r1, rb14 -++add r1, r1, rb12 -++asr r1, r1, rb13 -++brr.anyn -, r:yloop -++add r1, r1, rb15 # Delay 1 -++min r1, r1, rb22 # Delay 2 -++max vpm, r1, 0 # Delay 3 -++ -++# DMA out -++ -++bra -, ra31 -++mov vw_setup, rb26 # VDW setup 0 Delay 1 -++mov vw_setup, rb29 # Stride Delay 2 -++mov vw_addr, unif # start the VDW Delay 3 -++ -++ -++ -++################################################################################ -++ -++# mc_filter_b(next_kernel, x, y, frame_base, x2, y2, frame_base2, width_height, hcoeffs[0], hcoeffs2[0], hcoeffs[1], hcoeffs2[1], vcoeffs[0], vcoeffs2[0], vcoeffs[1], vcoeffs2[1], offsetweight0, offsetweight1, this_dst) -++# In a P block, only the first half of coefficients contain used information. -++# At this point we have already issued two pairs of texture requests for the current block -++# May be better to just send 16.16 motion vector and figure out the coefficients inside this block (only 4 cases so can compute hcoeffs in around 24 cycles?) -++# Can fill in the coefficients so only -++# Can also assume default weighted prediction for B frames. -++# Perhaps can unpack coefficients in a more efficient manner by doing H/V for a and b at the same time? -++# Or possibly by taking advantage of symmetry? -++# From 19->7 32bits per command. -++::mc_filter_b -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++mov ra31, unif -++ -++# per-channel shifts were calculated on the *previous* invocation -++ -++mov ra_xshift, ra_xshift_next -++mov rx_xshift2, rx_xshift2_next -++ -++# get base addresses and per-channel shifts for *next* invocation -++add r0, unif, elem_num # Load x -++max r0, r0, 0; mov r1, unif # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++shl ra_xshift_next, r0, 3 # Compute shifts -++mov ra_y_next, r1 -++and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++add ra_frame_base_next, r2, r0 # r2 is address for frame0 (not including y offset) -++ -++add r0, unif, elem_num # Load x -++max r0, r0, 0 ; mov r1, unif # Load y -++min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++shl rx_xshift2_next, r0, 3 # Compute shifts -++add ra_y2_next, r1, 1 -++and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++add rx_frame_base2_next, r2, r0 # r2 is address for frame1 (not including y offset) -++ -++ -++# set up VPM write -++mov vw_setup, rb28 -++ -++# get width,height of block -++mov r2, 16 -++mov r0, unif -++shr r1, r0, r2 # Extract width -++sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++and r0, r0, rb22 # Extract height -++add rb17, r0, 5 -++add rb18, r0, 7 -++shl r0, r0, 7 -++add r0, r0, r1 # Combine width and height of destination area -++shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -++add rb26, r0, rb27 -++ -++# get filter coefficients and discard unused B frame values -++mov r0, unif -++mov r1, 1 -++mov.ifnz r0, unif # Alternate coefficients are unused for P frames -++nop ; mul24 r0, r0 << 13, r1 << 13 -++asr ra3, r0, rb23; mul24 r0, r0, ra22 -++nop ; mul24 r0, r0 << 14, r1 << 14 -++asr ra2, r0, rb23; mul24 r0, r0, ra22 -++nop ; mul24 r0, r0 << 15, r1 << 15 # Adjust such that a rotate of 1 will produce the values with first 8 on left, second 8 on right -++asr ra1, r0, rb23; mul24 r0, r0, ra22 -++asr ra0, r0, rb23; mov r0, unif -++mov.ifnz r0, unif -++nop ; mul24 r0, r0 << 9, r1 << 9 -++asr ra7, r0, rb23; mul24 r0, r0, ra22 -++nop ; mul24 r0, r0 << 10, r1 << 10 -++asr ra6, r0, rb23; mul24 r0, r0, ra22 -++nop ; mul24 r0, r0 << 11, r1 << 11 -++asr ra5, r0, rb23; mul24 r0, r0, ra22 -++nop ; mul24 r0, r0 << 12, r1 << 12 -++asr ra4, r0, rb23; mov r0, unif -++mov.ifnz r0, unif -++asr rb11, r0, rb23; mul24 r0, r0, ra22 -++asr rb10, r0, rb23; mul24 r0, r0, ra22 -++asr rb9, r0, rb23; mul24 r0, r0, ra22 -++asr rb8, r0, rb23; mov r0, unif -++mov.ifnz r0, unif -++asr rb7, r0, rb23; mul24 r0, r0, ra22 -++asr rb6, r0, rb23; mul24 r0, r0, ra22 -++asr rb5, r0, rb23; mul24 r0, r0, ra22 -++asr rb4, r0, rb23 -++ -++mov r0, unif # Frame0 offset/weight -++mov.ifnz r0, unif # Frame1 offset/weight unused -++asr rb15, r0, r2 # Compute offset from MSBs -++shl r0, r0, r2 -++asr rb14, r0, r2 # Compute weight from LSBs -++ -++# r3 is loop counter -++ -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++mov r3, 0 -++ -++:yloopb -++# retrieve texture results and pick out bytes -++# then submit two more texture requests -++ -++# If we knew there was no clipping then this code would get simpler. -++# Perhaps we could add on the pitch and clip using larger values? -++ -++sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -++mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++shr r1, r4, rx_xshift2 -++mov.ifz ra_y2, ra_y2_next -++ -++max r2, ra_y, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -++ -++max r2, ra_y2, 0 # y -++min r2, r2, rb_frame_height_minus_1 -++add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++ -++ -++# generate seven shifted versions -++# interleave with scroll of vertical context -++ -++mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ -++# apply horizontal filter -++nop ; mul24 r2, r0, ra0 -++nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++nop ; mul24 r3, ra1 << 1, r0 << 1 -++nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++add r0, r2, r3 ; mov r3, rb31 -++sub.setf -, r3, 8 ; mov ra12, ra13 -++mov ra9, ra10 -++mov ra10, ra11 -++mov ra11, ra12 -++mov ra12, ra13 -++brr.anyn -, r:yloopb -++mov ra13, ra14 # Delay slot 1 -++mov ra14, ra15 # Delay slot 2 -++mov ra15, r0 # Delay slot 3 -++ -++# apply vertical filter and write to VPM -++ -++nop ; mul24 r1, ra14, rb10 -++nop ; mul24 r0, ra13, rb9 -++add r1, r1, r0 ; mul24 r0, ra12, rb8 -++add r1, r1, r0 ; mul24 r0, ra15, rb11 -++add r1, r1, r0 ; mul24 r0, ra8, rb4 -++add r1, r1, r0 ; mul24 r0, ra9, rb5 -++add r1, r1, r0 ; mul24 r0, ra10, rb6 -++add r1, r1, r0 ; mul24 r0, ra11, rb7 -++ -++add r1, r1, r0 ; mov -, vw_wait -++sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++asr r1, r1, 14 -++nop ; mul24 r1, r1 << 8, ra20 << 8 # Rotate to align left and right halves -++add r1, r1, ra30 ; mul24 r0, r1, rb14 -++add r1, r1, r0 -++brr.anyn -, r:yloopb -++asr r1, r1, 7 # Delay 1 -++min r1, r1, rb22 # Delay 2 -++max vpm, r1, 0 # Delay 3 -++ -++# DMA out -++bra -, ra31 -++mov vw_setup, rb26 # VDW setup 0 Delay 1 -++mov vw_setup, rb29 # Stride Delay 2 -++mov vw_addr, unif # start the VDW Delay 3 -++ -++################################################################################ -++ -++# mc_interrupt_exit12() -++::mc_interrupt_exit12 -++mov -, vw_wait # wait on the VDW -++ -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ldtmu0 -++ -++mov -,sacq(0) # 1 -++mov -,sacq(0) # 2 -++mov -,sacq(0) # 3 -++mov -,sacq(0) # 4 -++mov -,sacq(0) # 5 -++mov -,sacq(0) # 6 -++mov -,sacq(0) # 7 -++mov -,sacq(0) # 8 -++mov -,sacq(0) # 9 -++mov -,sacq(0) # 10 -++mov -,sacq(0) # 11 -++ -++nop ; nop ; thrend -++mov interrupt, 1; nop # delay slot 1 -++nop ; nop # delay slot 2 -++ -++ -+ ::mc_end -+ # Do not add code here because mc_end must appear after all other code. -+-- -+2.5.0 -+ -+ -+From e6e832826a1f27e07c1c9ff48e0690fe4a732dd3 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 20 May 2015 19:58:30 +0100 -+Subject: [PATCH 42/68] Added support for fast cache flush in deblocker -+ -+--- -+ libavcodec/hevc_filter.c | 44 +- -+ libavcodec/rpi_qpu.c | 6 + -+ libavcodec/rpi_qpu.h | 2 + -+ libavcodec/rpi_shader.c | 1028 +++++++++++++++++++++++++++++--------------- -+ libavcodec/rpi_shader.h | 16 +- -+ libavcodec/rpi_user_vcsm.h | 22 + -+ 6 files changed, 768 insertions(+), 350 deletions(-) -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 92a8271..186317a 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -37,6 +37,11 @@ -+ -+ #include "bit_depth_template.c" -+ -++#ifdef RPI -++#include "rpi_user_vcsm.h" -++#include "rpi_qpu.h" -++#endif -++ -+ #define LUMA 0 -+ #define CB 1 -+ #define CR 2 -+@@ -872,15 +877,46 @@ static void flush_buffer(AVBufferRef *bref) { -+ gpu_cache_flush(p); -+ } -+ -+-static void ff_hevc_flush_chroma(HEVCContext *s) -++// Return Physical address for this image -++static int ff_hevc_buf_base(AVBufferRef *bref) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -++ return p->vc & 0x3fffffff; -++} -++ -++static void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n) -+ { -+ if (s->enable_rpi && !( s->nal_unit_type == NAL_TRAIL_N || -+ s->nal_unit_type == NAL_TSA_N || -+ s->nal_unit_type == NAL_STSA_N || -+ s->nal_unit_type == NAL_RADL_N || -+ s->nal_unit_type == NAL_RASL_N )) { -++#define RPI_FAST_CACHEFLUSH -++#ifdef RPI_FAST_CACHEFLUSH -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ int curr_y = f->progress->data[0]; -++ int sz,base; -++ if (curr_y < 0) curr_y = 0; -++ if (n<=curr_y) return; // Should not happen -++ sz = s->frame->linesize[1] * (n-curr_y); -++ base = s->frame->linesize[1] * curr_y; -++ iocache.s[0].cmd = 3; // Flush L1 cache -++ iocache.s[0].addr = 0; -++ iocache.s[0].size = 0; -++ -++ iocache.s[1].cmd = 2; -++ iocache.s[1].addr = ff_hevc_buf_base(s->frame->buf[1]) + base; -++ iocache.s[1].size = sz; -++ -++ iocache.s[2].cmd = 2; -++ iocache.s[2].addr = ff_hevc_buf_base(s->frame->buf[2]) + base; -++ iocache.s[2].size = sz; -++ -++ vcsm_clean_invalid( gpu_get_mailbox(), &iocache ); -++ -++#else -+ flush_buffer(s->frame->buf[1]); -+ flush_buffer(s->frame->buf[2]); -++#endif -+ //memcpy(s->dummy.arm,s->frame->data[0],2048*64); -+ //memcpy(s->dummy.arm,s->frame->data[1],1024*32); -+ //memcpy(s->dummy.arm,s->frame->data[2],1024*32); -+@@ -903,7 +939,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ sao_filter_CTB(s, x, y - ctb_size); -+ if (s->threads_type & FF_THREAD_FRAME ) { -+ #ifdef RPI_INTER_QPU -+- ff_hevc_flush_chroma(s); -++ ff_hevc_flush_chroma(s,&s->ref->tf, y); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y, 0); -+ } -+@@ -912,7 +948,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ sao_filter_CTB(s, x , y); -+ if (s->threads_type & FF_THREAD_FRAME ) { -+ #ifdef RPI_INTER_QPU -+- ff_hevc_flush_chroma(s); -++ ff_hevc_flush_chroma(s, &s->ref->tf, y + ctb_size); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); -+ } -+@@ -922,7 +958,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ //int currh = s->ref->tf.progress->data[0]; -+ //if (((y + ctb_size)&63)==0) -+ #ifdef RPI_INTER_QPU -+- ff_hevc_flush_chroma(s); -++ ff_hevc_flush_chroma(s, &s->ref->tf, y + ctb_size - 4); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -+ } -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index f62051f..fd8a276 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -237,6 +237,12 @@ int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p) -+ return r; -+ } -+ -++int gpu_get_mailbox(void) -++{ -++ assert(gpu); -++ return gpu->mb; -++} -++ -+ void gpu_cache_flush(GPU_MEM_PTR_T *p) -+ { -+ void *tmp = vcsm_lock(p->vcsm_handle); -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 543c84b..88965e5 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -49,4 +49,6 @@ extern int rpi_test_shader(void); -+ extern void rpi_do_block(const unsigned char *in_buffer_vc, int src_pitch, unsigned char *dst_vc, int dst_pitch, unsigned char *dst); -+ extern void rpi_do_block_arm(const unsigned char *in_buffer, int src_pitch, unsigned char *dst, int dst_pitch); -+ -++extern int gpu_get_mailbox(void); -++ -+ #endif -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 3f04d80..9c30e32 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -23,11 +23,11 @@ __attribute__((aligned(8))) -+ unsigned int rpi_shader[] = { -+ // ::mc_setup_uv -+ /* [0x00000000] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000008] */ 0x0c9a0f80, 0x10020427, // add ra_x_base, unif, elem_num -++/* [0x00000008] */ 0x0c9a0f80, 0x10020427, // add ra_x, unif, elem_num -+ /* [0x00000010] */ 0x15827d80, 0x10020767, // mov ra_y, unif -+-/* [0x00000018] */ 0x15827d80, 0x10020627, // mov ra_x2_base, unif -++/* [0x00000018] */ 0x15827d80, 0x10020627, // mov ra_frame_base, unif -+ /* [0x00000020] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000028] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_x2_base -++/* [0x00000028] */ 0x0d620f80, 0x10020667, // sub ra_u2v_ref_offset, unif, ra_frame_base -+ /* [0x00000030] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -+ /* [0x00000038] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -+ /* [0x00000040] */ 0x15827d80, 0x10021427, // mov rb16, unif -+@@ -35,360 +35,708 @@ unsigned int rpi_shader[] = { -+ /* [0x00000050] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+ /* [0x00000058] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+ /* [0x00000060] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x00000068] */ 0x00000020, 0xe0020567, // mov ra21, 32 -+-/* [0x00000070] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+-/* [0x00000078] */ 0x00000008, 0xe00205e7, // mov ra23, 8 -+-/* [0x00000080] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -+-/* [0x00000088] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x00000090] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x00000098] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x000000a0] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x000000a8] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x000000b0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x000000b8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x000000c0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x000000c8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x000000d0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x000000d8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x000000e0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x000000e8] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+-/* [0x000000f0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x000000f8] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000100] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000108] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000110] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000118] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000120] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000128] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00000130] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00000138] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000140] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000148] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+-/* [0x00000150] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00000158] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000160] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000168] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000170] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000178] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000180] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000188] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000190] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000198] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -+-/* [0x000001a0] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -+-/* [0x000001a8] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -+-/* [0x000001b0] */ 0x15427d80, 0x10020827, // mov r0, ra_x_base -+-/* [0x000001b8] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x000001c0] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_x2_base -+-/* [0x000001c8] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x000001d0] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x000001d8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000001e0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000001e8] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x_base, r0 -+-/* [0x000001f0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x000001f8] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x00000200] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_x2_base, r2 -+-/* [0x00000208] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00000210] */ 0x15827d80, 0x10021327, // mov rb12,unif -+-/* [0x00000218] */ 0x15827d80, 0x10021367, // mov rb13,unif -+-/* [0x00000220] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000228] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000230] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000238] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000240] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000248] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000250] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x_base -+-/* [0x00000258] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_x2_base -++/* [0x00000068] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x00000070] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -++/* [0x00000078] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000080] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000088] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00000090] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x00000098] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x000000a0] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x000000a8] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x000000b0] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x000000b8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x000000c0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x000000c8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x000000d0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x000000d8] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x000000e0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x000000e8] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x000000f0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x000000f8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000100] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000108] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000110] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000118] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000120] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000128] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000130] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000138] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x00000140] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000148] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000150] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000158] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000160] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000168] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000170] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000178] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000180] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000188] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -++/* [0x00000190] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -++/* [0x00000198] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -++/* [0x000001a0] */ 0x15427d80, 0x10020827, // mov r0, ra_x -++/* [0x000001a8] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000001b0] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_frame_base -++/* [0x000001b8] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x000001c0] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x000001c8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000001d0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000001d8] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x, r0 -++/* [0x000001e0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x000001e8] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x000001f0] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_frame_base, r2 -++/* [0x000001f8] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -++/* [0x00000200] */ 0x15827d80, 0x10021327, // mov rb12,unif -++/* [0x00000208] */ 0x15827d80, 0x10021367, // mov rb13,unif -++/* [0x00000210] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000218] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000220] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000228] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000230] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000238] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000240] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x -++/* [0x00000248] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -+ // ::mc_filter_uv -+-/* [0x00000260] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000268] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000270] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000278] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000280] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000288] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000290] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000298] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000002a0] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000002a8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000002b0] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000002b8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002c0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002c8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002d0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002d8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002e0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002e8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000002f0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000002f8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000300] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000308] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000310] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000318] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000320] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000330] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000340] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000348] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000350] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000358] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000360] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000368] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000370] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00000378] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000380] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00000388] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000390] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -+-/* [0x00000398] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000003a0] */ 0x0f9e7080, 0x100613a7, // asr.ifnz rb14, r0, r2 -+-/* [0x000003a8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000003b0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000250] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000258] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000260] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000268] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000270] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000278] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000280] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000288] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000290] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000298] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000002a0] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x000002a8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002b0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002b8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002c0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002c8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002d0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002d8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000002e0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000002e8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002f0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000002f8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000300] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000308] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000310] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000318] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000320] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000330] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000340] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000348] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000350] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000358] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000360] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00000368] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000370] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00000378] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000380] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -++/* [0x00000388] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000390] */ 0x0f9e7080, 0x100613a7, // asr.ifnz rb14, r0, r2 -++/* [0x00000398] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000003a0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x000003b8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003c0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x000003c8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x000003d0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003d8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003e0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003e8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003f0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003f8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000400] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000408] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000410] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000418] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000420] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000428] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000430] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000438] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000440] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000448] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000450] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000458] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000460] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000468] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000470] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000478] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000480] */ 0x00000020, 0xe0021327, // mov rb12,32 -+-/* [0x00000488] */ 0x00000006, 0xe0021367, // mov rb13,6 -+-/* [0x00000490] */ 0x00000001, 0xe00213a7, // mov rb14,1 -+-/* [0x00000498] */ 0x00000000, 0xe00213e7, // mov rb15,0 -+-/* [0x000004a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000004a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000004b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000004b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000004c0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000004c8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000004d0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000004d8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -+-/* [0x000004e0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -+-/* [0x000004e8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -+-/* [0x000004f0] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004f8] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -+-/* [0x00000500] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000508] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000510] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000518] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000520] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000528] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000530] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000538] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000540] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000548] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000550] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000003a8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003b0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++/* [0x000003b8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x000003c0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003c8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003d0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003d8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003e0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003e8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x000003f0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -++/* [0x000003f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000400] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000408] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000410] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000418] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000420] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000428] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000430] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000438] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000440] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000448] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000450] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000458] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000460] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000468] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000470] */ 0x00000020, 0xe0021327, // mov rb12,32 -++/* [0x00000478] */ 0x00000006, 0xe0021367, // mov rb13,6 -++/* [0x00000480] */ 0x00000001, 0xe00213a7, // mov rb14,1 -++/* [0x00000488] */ 0x00000000, 0xe00213e7, // mov rb15,0 -++/* [0x00000490] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000498] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000004a0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000004a8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000004b0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000004b8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000004c0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000004c8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x000004d0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x000004d8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x000004e0] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004e8] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x000004f0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000004f8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000500] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000508] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000510] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000518] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000520] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000528] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000530] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000538] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000540] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x00000558] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000560] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000568] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000570] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000578] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000580] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000588] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000590] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000598] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x000005a0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000005a8] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x000005b0] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x000005b8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000005c0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005c8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000005d0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000005d8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000005e0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000005e8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000005f0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000005f8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000600] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000608] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000610] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000618] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000620] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000628] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000630] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000638] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000640] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000648] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000650] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000658] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000660] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000668] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000670] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000678] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000548] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000550] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000558] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000560] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000568] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000570] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000578] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000580] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000588] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000590] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000598] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x000005a0] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x000005a8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000005b0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005b8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000005c0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000005c8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000005d0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000005d8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000005e0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000005e8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000005f0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000005f8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000600] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000608] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000610] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000618] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000620] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000628] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000630] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000638] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000640] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000648] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000650] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000658] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000660] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000668] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000680] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000688] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000690] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000698] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000006a0] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000006a8] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000006b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000006b8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000006c0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x000006c8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x000006d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000006d8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000006e0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000006e8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000006f0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000006f8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000700] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000708] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000710] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000718] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000720] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000728] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000730] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000738] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000740] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000748] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000750] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000758] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000760] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000768] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000770] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -+-/* [0x00000778] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000780] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -+-/* [0x00000788] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000790] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000798] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x000007a0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000007a8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000007b0] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000670] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000678] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++/* [0x00000680] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000688] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000690] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000698] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000006a0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000006a8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000006b0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x000006b8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -++/* [0x000006c0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000006c8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000006d0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000006d8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000006e0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000006e8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000006f0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000006f8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000700] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000708] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000710] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000718] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000720] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000728] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000730] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000738] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000740] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000748] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000750] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000758] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000760] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -++/* [0x00000768] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000770] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -++/* [0x00000778] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000780] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000788] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000790] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000798] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000007a0] */ 0x009e7000, 0x100009e7, // nop -+ // ::mc_filter_uv_b -+-/* [0x000007b8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000007c0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000007c8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000007d0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000007d8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000007e0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000007e8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000007f0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000007f8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_base_next, r0, ~3 -+-/* [0x00000800] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000808] */ 0x0c9d3e80, 0x100206a7, // add ra_x2_base_next, rb_x_base_next, r2 -+-/* [0x00000810] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000818] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000820] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000828] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000830] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000838] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000840] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000848] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000850] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000858] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000860] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000868] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000870] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000878] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000880] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000888] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000890] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000898] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000008b8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008d0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x000008d8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008e0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008e8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000008f0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008f8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000007a8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000007b0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000007b8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000007c0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000007c8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000007d0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000007d8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000007e0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000007e8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x000007f0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000007f8] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x00000800] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000808] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000810] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000818] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000820] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000828] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000830] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000838] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000840] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000848] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000850] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000858] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000860] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000868] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000870] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000878] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000880] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000888] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000890] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000898] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000008a8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008c0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x000008c8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008d0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008d8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000008e0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008e8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x00000900] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000908] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x_base, rb_x_base_next ; ldtmu0 -+-/* [0x00000910] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_x2_base, ra_x2_base_next ; mov rb31, r3 -+-/* [0x00000918] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000920] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000928] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000930] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000938] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000940] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x_base, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000948] */ 0x0c627c80, 0x10020e27, // add t0s, ra_x2_base, r2 -+-/* [0x00000950] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000958] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000960] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000968] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000970] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000978] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000980] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000988] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000990] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000998] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x000009a0] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x000009a8] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000009b0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000009b8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x000009c0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000009c8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000009d0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000009d8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000009e0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000009e8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000009f0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000009f8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x00000a00] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x00000a08] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000a10] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000a18] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000a20] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a28] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a30] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a38] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a40] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000a48] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000a50] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a58] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a60] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000a68] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a70] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008f0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000008f8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++/* [0x00000900] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000908] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000910] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000918] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000920] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000928] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000930] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x00000938] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -++/* [0x00000940] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000948] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000950] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000958] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000960] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000968] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000970] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000978] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000980] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000988] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000990] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000998] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009a0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000009a8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000009b0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000009b8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000009c0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000009c8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000009d0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000009d8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000009e0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000009e8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000009f0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x000009f8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000a00] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000a08] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000a10] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a18] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a20] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a28] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a30] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000a38] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000a40] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a48] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a50] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000a58] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a60] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a78] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a80] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a68] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a70] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a78] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a80] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a98] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000aa0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000ab0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a98] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000aa0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000aa8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000ac0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000ab0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000ab8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ac0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000ac8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000ad0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ad8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ae0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ad8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ae0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000b00] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000b08] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b10] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b18] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b20] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000b28] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000b30] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b10] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000b18] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000b20] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_setup -++/* [0x00000b28] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000b30] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000b38] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000b40] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000b48] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000b50] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000b58] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x00000b60] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000b68] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -++/* [0x00000b70] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000b78] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000b80] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000b88] */ 0x8c9e7452, 0x10025e18, // add t0s, r2, r1 ; mov ra_frame_base, r2 -++/* [0x00000b90] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000b98] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000ba0] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000ba8] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x00000bb0] */ 0x0c9c13c0, 0xd0020567, // add ra_y2, r1, 1 -++/* [0x00000bb8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000bc0] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -++/* [0x00000bc8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000bd0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000bd8] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000be0] */ 0x8c9e7452, 0x10025e19, // add t0s, r2, r1 ; mov ra_frame_base2, r2 -++/* [0x00000be8] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -++/* [0x00000bf0] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -++/* [0x00000bf8] */ 0x15827d80, 0x10021427, // mov rb16, unif -++/* [0x00000c00] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000c08] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x00000c10] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x00000c18] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x00000c20] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x00000c28] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -++/* [0x00000c30] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000c38] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000c40] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00000c48] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x00000c50] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x00000c58] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x00000c60] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x00000c68] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x00000c70] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x00000c78] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x00000c80] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x00000c88] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000c90] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000c98] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000ca0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000ca8] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000cb0] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000cb8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000cc0] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000cc8] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000cd0] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000cd8] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000ce0] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000ce8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000cf0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000cf8] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000d00] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000d08] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000d10] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000d18] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000d20] */ 0x15827d80, 0x10021327, // mov rb12,unif -++/* [0x00000d28] */ 0x15827d80, 0x10021367, // mov rb13,unif -++/* [0x00000d30] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000d38] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000d40] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000d48] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000d50] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000d58] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -++/* [0x00000d60] */ 0x13540dc0, 0xd0020867, // max r1, ra_y2, 0 -++/* [0x00000d68] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000d70] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000d78] */ 0x0c541dc0, 0xd0020567, // add ra_y2, ra_y2, 1 -++/* [0x00000d80] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000d88] */ 0x0c667380, 0x10020e27, // add t0s, r1, ra_frame_base2 -++// ::mc_filter -++/* [0x00000d90] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000d98] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000da0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000da8] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -++/* [0x00000db0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000db8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000dc0] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000dc8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000dd0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000dd8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000de0] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -++/* [0x00000de8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000df0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -++/* [0x00000df8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000e00] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x00000e08] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -++/* [0x00000e10] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000e18] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -++/* [0x00000e20] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000e28] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000e30] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000e38] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000e40] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000e48] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000e50] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000e58] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000e60] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000e68] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000e70] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000e78] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000e80] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000e88] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000e90] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000e98] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ea0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ea8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000eb0] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000eb8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ec0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ec8] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ed0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000ed8] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000ee0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ee8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ef0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ef8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000f00] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000f08] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f10] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f18] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f20] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -++/* [0x00000f28] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000f30] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000f38] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00000f40] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000f48] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00000f50] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :yloop -++/* [0x00000f58] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000f60] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -++/* [0x00000f68] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000f70] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000f78] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -++/* [0x00000f80] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -++/* [0x00000f88] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000f90] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000f98] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000fa0] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -++/* [0x00000fa8] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -++/* [0x00000fb0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000fb8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++/* [0x00000fc0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++/* [0x00000fc8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000fd0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000fd8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000fe0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000fe8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000ff0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000ff8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00001000] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00001008] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00001010] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00001018] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00001020] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00001028] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00001030] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001038] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001040] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001048] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001050] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00001058] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -++/* [0x00001060] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001068] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001070] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001078] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001080] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloop -++/* [0x00001088] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001090] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00001098] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000010a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000010a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000010b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000010b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000010c0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -++/* [0x000010c8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -++/* [0x000010d0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -++/* [0x000010d8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -++/* [0x000010e0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000010e8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000010f0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000010f8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x00001100] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x00001108] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x00001110] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloop -++/* [0x00001118] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x00001120] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00001128] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00001130] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001138] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001140] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001148] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_filter_b -++/* [0x00001150] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00001158] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00001160] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00001168] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -++/* [0x00001170] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00001178] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00001180] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00001188] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00001190] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00001198] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000011a0] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -++/* [0x000011a8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000011b0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -++/* [0x000011b8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x000011c0] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x000011c8] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -++/* [0x000011d0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000011d8] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -++/* [0x000011e0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000011e8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000011f0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000011f8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00001200] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00001208] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00001210] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00001218] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00001220] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00001228] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00001230] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00001238] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00001240] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001248] */ 0x00000001, 0xe0020867, // mov r1, 1 -++/* [0x00001250] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001258] */ 0x409f3001, 0xd00049e0, // nop ; mul24 r0, r0 << 13, r1 << 13 -++/* [0x00001260] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001268] */ 0x409f2001, 0xd00049e0, // nop ; mul24 r0, r0 << 14, r1 << 14 -++/* [0x00001270] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001278] */ 0x409f1001, 0xd00049e0, // nop ; mul24 r0, r0 << 15, r1 << 15 -++/* [0x00001280] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001288] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00001290] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001298] */ 0x409f7001, 0xd00049e0, // nop ; mul24 r0, r0 << 9, r1 << 9 -++/* [0x000012a0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012a8] */ 0x409f6001, 0xd00049e0, // nop ; mul24 r0, r0 << 10, r1 << 10 -++/* [0x000012b0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012b8] */ 0x409f5001, 0xd00049e0, // nop ; mul24 r0, r0 << 11, r1 << 11 -++/* [0x000012c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012c8] */ 0x409f4001, 0xd00049e0, // nop ; mul24 r0, r0 << 12, r1 << 12 -++/* [0x000012d0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000012d8] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x000012e0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012e8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012f0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012f8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00001300] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001308] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001310] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001318] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001320] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -++/* [0x00001328] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001330] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001338] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00001340] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00001348] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00001350] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++// :yloopb -++/* [0x00001358] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00001360] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -++/* [0x00001368] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00001370] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00001378] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -++/* [0x00001380] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -++/* [0x00001388] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00001390] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00001398] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000013a0] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -++/* [0x000013a8] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -++/* [0x000013b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000013b8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++/* [0x000013c0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++/* [0x000013c8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000013d0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000013d8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000013e0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000013e8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000013f0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000013f8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00001400] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00001408] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00001410] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00001418] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00001420] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00001428] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00001430] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001438] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001440] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001448] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001450] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00001458] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -++/* [0x00001460] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001468] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001470] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001478] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001480] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloopb -++/* [0x00001488] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001490] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00001498] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000014a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000014a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000014b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000014b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000014c0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -++/* [0x000014c8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -++/* [0x000014d0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -++/* [0x000014d8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -++/* [0x000014e0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000014e8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000014f0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000014f8] */ 0x4053800e, 0xd00049e1, // nop ; mul24 r1, r1 << 8, ra20 << 8 -++/* [0x00001500] */ 0x4c78e38f, 0x10024860, // add r1, r1, ra30 ; mul24 r0, r1, rb14 -++/* [0x00001508] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x00001510] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloopb -++/* [0x00001518] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00001520] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00001528] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00001530] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001538] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001540] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001548] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++// ::mc_interrupt_exit12 -++/* [0x00001550] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001558] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001560] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001568] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001570] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001578] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001580] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001588] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001590] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001598] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015a0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000015d0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000015d8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000015e0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index cec9901..3fa8531 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,11 +4,15 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 152) -+-#define mc_filter_uv_b0 (rpi_shader + 342) -+-#define mc_filter_uv_b (rpi_shader + 494) -+-#define mc_exit (rpi_shader + 670) -+-#define mc_interrupt_exit8 (rpi_shader + 688) -+-#define mc_end (rpi_shader + 718) -++#define mc_filter_uv (rpi_shader + 148) -++#define mc_filter_uv_b0 (rpi_shader + 338) -++#define mc_filter_uv_b (rpi_shader + 490) -++#define mc_exit (rpi_shader + 666) -++#define mc_interrupt_exit8 (rpi_shader + 684) -++#define mc_setup (rpi_shader + 714) -++#define mc_filter (rpi_shader + 868) -++#define mc_filter_b (rpi_shader + 1108) -++#define mc_interrupt_exit12 (rpi_shader + 1364) -++#define mc_end (rpi_shader + 1402) -+ -+ #endif -+diff --git a/libavcodec/rpi_user_vcsm.h b/libavcodec/rpi_user_vcsm.h -+index fbebbbe..95e6de1 100644 -+--- a/libavcodec/rpi_user_vcsm.h -++++ b/libavcodec/rpi_user_vcsm.h -+@@ -418,6 +418,28 @@ int vcsm_unlock_hdl( unsigned int handle ); -+ */ -+ int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); -+ -++/* Clean and/or invalidate the memory associated with this user opaque handle -++** -++** Returns: non-zero on error -++** -++** structure contains a list of flush/invalidate commands. Commands are: -++** 0: nop -++** 1: invalidate given physical range in L2 -++** 2: clean given physical range in L2 -++** 3: clean+invalidate all of L1 -++** 4: flush all of L2 and all of L1 -++*/ -++struct vcsm_user_clean_invalid_s { -++ struct { -++ unsigned int cmd; -++ unsigned int addr; -++ unsigned int size; -++ } s[8]; -++}; -++ -++int vcsm_clean_invalid( unsigned int handle, struct vcsm_user_clean_invalid_s *s ); -++ -++ -+ #ifdef __cplusplus -+ } -+ #endif -+-- -+2.5.0 -+ -+ -+From b3e42f057641ce7855d21f7c45f533df8c6c462d Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 20 May 2015 21:12:55 +0100 -+Subject: [PATCH 43/68] Added multi mailbox - not working -+ -+--- -+ libavcodec/hevc.c | 40 ++++++++++++++++++++++++++++--- -+ libavcodec/rpi_mailbox.c | 47 +++++++++++++++++++++++++++++++++++++ -+ libavcodec/rpi_mailbox.h | 5 ++++ -+ libavcodec/rpi_qpu.c | 61 ++++++++++++++++++++++++++++++++++++++++++++---- -+ libavcodec/rpi_qpu.h | 2 ++ -+ 5 files changed, 147 insertions(+), 8 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 01898fd..2ca783a 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -47,6 +47,11 @@ -+ //#define EARLY_MALLOC -+ // Move Inter prediction into separate pass -+ #define RPI_INTER -++ -++ #ifdef RPI_INTER_QPU -++ // Define RPI_MULTI_MAILBOX to use the updated mailbox that can launch both QPU and VPU -++ #define RPI_MULTI_MAILBOX -++ #endif -+ #endif -+ -+ // #define DISABLE_MC -+@@ -2832,10 +2837,14 @@ static void rpi_inter_clear(HEVCContext *s) -+ static void rpi_execute_inter_qpu(HEVCContext *s) -+ { -+ int k; -++ int i; -+ uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr.vc; -+- -+- if (s->sh.slice_type == I_SLICE) -+- return; -++ if (s->sh.slice_type == I_SLICE) { -++#ifdef RPI_MULTI_MAILBOX -++ rpi_execute_transform(s); -++ return; -++#endif -++ } -+ for(k=0;k<8;k++) { -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+@@ -2845,6 +2854,22 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ -+ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+ -++#ifdef RPI_MULTI_MAILBOX -++ gpu_cache_flush(&s->coeffs_buf_accelerated); -++ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0, -++ qpu_get_fn(QPU_MC_SETUP_UV), -++ (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[1 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[2 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[3 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[4 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[5 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -++ ); -++ for(i=0;i<4;i++) -++ s->num_coeffs[i] = 0; -++#else -+ qpu_run_shader8(qpu_get_fn(QPU_MC_SETUP_UV), -+ (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+ (uint32_t)(unif_vc+(s->mvs_base[1 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+@@ -2855,6 +2880,7 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+ (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -+ ); -++#endif -+ } -+ #endif -+ -+@@ -2934,6 +2960,12 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ if ( (((y_ctb + ctb_size)&63) == 0) && x_ctb + ctb_size >= s->ps.sps->width) { -+ // Transform all blocks -+ // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -++#ifdef RPI_MULTI_MAILBOX -++ // Kick off inter prediction on QPUs -++ rpi_execute_inter_qpu(s); -++ // Perform luma inter prediction -++ rpi_execute_inter_cmds(s); -++#else -+ rpi_execute_transform(s); -+ // Perform inter prediction -+ rpi_execute_inter_cmds(s); -+@@ -2941,6 +2973,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ // Kick off inter prediction on QPUs -+ rpi_execute_inter_qpu(s); -+ #endif -++#endif -++ -+ // Wait for transform completion -+ vpu_wait(s->vpu_id); -+ -+diff --git a/libavcodec/rpi_mailbox.c b/libavcodec/rpi_mailbox.c -+index 77a56dd..3904efc 100644 -+--- a/libavcodec/rpi_mailbox.c -++++ b/libavcodec/rpi_mailbox.c -+@@ -276,6 +276,53 @@ unsigned execute_qpu(int file_desc, unsigned num_qpus, unsigned control, unsigne -+ return p[5]; -+ } -+ -++void execute_multi(int file_desc, -++ unsigned num_qpus, unsigned control, unsigned noflush, unsigned timeout, -++ unsigned num_qpus_2, unsigned control_2, unsigned noflush_2, unsigned timeout_2, -++ unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, -++ unsigned code_2, unsigned r0_2, unsigned r1_2, unsigned r2_2, unsigned r3_2, unsigned r4_2, unsigned r5_2) { -++ int i=0; -++ unsigned p[32]; -++ -++ p[i++] = 0; // size -++ p[i++] = 0x00000000; // process request -++ p[i++] = 0x30018; // (the tag id) -++ p[i++] = 88; // (size of the buffer) -++ p[i++] = 88; // (size of the data) -++ -++ p[i++] = num_qpus; -++ p[i++] = control; -++ p[i++] = noflush; -++ p[i++] = timeout; // ms -++ -++ p[i++] = num_qpus_2; -++ p[i++] = control_2; -++ p[i++] = noflush_2; -++ p[i++] = timeout_2; // ms -++ -++ p[i++] = code; -++ p[i++] = r0; -++ p[i++] = r1; -++ p[i++] = r2; -++ p[i++] = r3; -++ p[i++] = r4; -++ p[i++] = r5; -++ -++ p[i++] = code_2; -++ p[i++] = r0_2; -++ p[i++] = r1_2; -++ p[i++] = r2_2; -++ p[i++] = r3_2; -++ p[i++] = r4_2; -++ p[i++] = r5_2; -++ -++ p[i++] = 0x00000000; // end tag -++ p[0] = i*sizeof *p; // actual size -++ -++ mbox_property(file_desc, p); -++ return; -++} -++ -+ int mbox_open() { -+ int file_desc; -+ -+diff --git a/libavcodec/rpi_mailbox.h b/libavcodec/rpi_mailbox.h -+index c264d2e..5898102 100644 -+--- a/libavcodec/rpi_mailbox.h -++++ b/libavcodec/rpi_mailbox.h -+@@ -15,6 +15,11 @@ extern void unmapmem(void *addr, unsigned size); -+ -+ extern unsigned execute_code(int file_desc, unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5); -+ extern unsigned execute_qpu(int file_desc, unsigned num_qpus, unsigned control, unsigned noflush, unsigned timeout); -++extern void execute_multi(int file_desc, -++ unsigned num_qpus, unsigned control, unsigned noflush, unsigned timeout, -++ unsigned num_qpus_2, unsigned control_2, unsigned noflush_2, unsigned timeout_2, -++ unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, -++ unsigned code_2, unsigned r0_2, unsigned r1_2, unsigned r2_2, unsigned r3_2, unsigned r4_2, unsigned r5_2); -+ extern unsigned qpu_enable(int file_desc, unsigned enable); -+ -+ #endif -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index fd8a276..feb3284 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -123,7 +123,7 @@ static pthread_cond_t post_cond_head = PTHREAD_COND_INITIALIZER; -+ static pthread_cond_t post_cond_tail = PTHREAD_COND_INITIALIZER; -+ static pthread_mutex_t post_mutex = PTHREAD_MUTEX_INITIALIZER; -+ -+-static int vpu_cmds[MAXCMDS][8]; -++static int vpu_cmds[MAXCMDS][16]; -+ static volatile int vpu_async_tail=0; // Contains the number of posted jobs -+ static volatile int vpu_async_head=0; -+ #endif -+@@ -346,6 +346,7 @@ unsigned int vpu_get_constants(void) { -+ static void *vpu_start(void *arg) { -+ while(1) { -+ int *p; -++ int qpu_code; -+ pthread_mutex_lock(&post_mutex); -+ while( vpu_async_tail - vpu_async_head <= 0) -+ { -+@@ -358,12 +359,25 @@ static void *vpu_start(void *arg) { -+ if (p[6] == -1) { -+ break; // Last job -+ } -+- if (p[7]) { -++ qpu_code = p[7]; -++ //if (p[7]) { -+ //GPU_MEM_PTR_T *buf = (GPU_MEM_PTR_T *)p[7]; -+ //gpu_cache_flush(buf); -+- } -+- vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -++ //} -++ if (!qpu_code) { -++ vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -++ } else { -++ int i; -++ for(i=0;i<8;i++) { -++ gpu->mail[i*2] = p[8+i]; -++ gpu->mail[i*2 + 1] = qpu_code; -++ } -+ -++ execute_multi(gpu->mb,8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -++ 0, 0, 0, 0, -++ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -++ 0, 0 , 0 , 0 , 0 , 0 , 0); // VPU1 -++ } -+ pthread_mutex_lock(&post_mutex); -+ vpu_async_head++; -+ pthread_cond_broadcast(&post_cond_head); -+@@ -400,7 +414,43 @@ int vpu_post_code(unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned -+ p[4] = r3; -+ p[5] = r4; -+ p[6] = r5; -+- p[7] = (int) buf; -++ p[7] = 0; -++ if (num<=1) -++ pthread_cond_broadcast(&post_cond_tail); // Otherwise the vpu thread must already be awake -++ pthread_mutex_unlock(&post_mutex); -++ return id; -++ } -++} -++ -++int vpu_qpu_post_code(unsigned vpu_code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, -++ int qpu_code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8) -++{ -++ -++ pthread_mutex_lock(&post_mutex); -++ { -++ int id = vpu_async_tail++; -++ int *p = vpu_cmds[id%MAXCMDS]; -++ int num = vpu_async_tail - vpu_async_head; -++ if (num>MAXCMDS) { -++ printf("Too many commands submitted\n"); -++ exit(-1); -++ } -++ p[0] = vpu_code; -++ p[1] = r0; -++ p[2] = r1; -++ p[3] = r2; -++ p[4] = r3; -++ p[5] = r4; -++ p[6] = r5; -++ p[7] = qpu_code; -++ p[8 ] = unifs1; -++ p[9 ] = unifs2; -++ p[10] = unifs3; -++ p[11] = unifs4; -++ p[12] = unifs5; -++ p[13] = unifs6; -++ p[14] = unifs7; -++ p[15] = unifs8; -+ if (num<=1) -+ pthread_cond_broadcast(&post_cond_tail); // Otherwise the vpu thread must already be awake -+ pthread_mutex_unlock(&post_mutex); -+@@ -966,6 +1016,7 @@ void rpi_do_block(const uint8_t *in_buffer_vc, int src_pitch, uint8_t *dst_vc, i -+ } -+ -+ -++ -+ #endif -+ -+ #endif // RPI -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 88965e5..2f08f03 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -41,6 +41,8 @@ extern unsigned int vpu_get_fn(void); -+ extern unsigned int vpu_get_constants(void); -+ extern unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5); -+ extern int vpu_post_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, GPU_MEM_PTR_T *buf); -++int vpu_qpu_post_code(unsigned vpu_code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, -++ int qpu_code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8); -+ extern void vpu_wait( int id); -+ -+ // Simple test of shader code -+-- -+2.5.0 -+ -+ -+From 71b8a1d77652d1cc298df2a1441ef3c913c2926b Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 21 May 2015 16:50:02 +0100 -+Subject: [PATCH 44/68] Pass qpu number in as uniform -+ -+--- -+ libavcodec/hevc.c | 2 +- -+ libavcodec/rpi_shader.c | 1288 ++++++++++++++++++++++---------------------- -+ libavcodec/rpi_shader.h | 20 +- -+ libavcodec/rpi_shader.qasm | 10 +- -+ 4 files changed, 657 insertions(+), 663 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 2ca783a..9605459 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -2823,6 +2823,7 @@ static void rpi_inter_clear(HEVCContext *s) -+ *s->u_mvs[i]++ = pic_height; -+ *s->u_mvs[i]++ = s->frame->linesize[1]; -+ *s->u_mvs[i]++ = s->frame->linesize[2]; -++ *s->u_mvs[i]++ = i; -+ if (weight_flag) { -+ *s->u_mvs[i]++ = 1 << (s->sh.chroma_log2_weight_denom + 6 - 1); -+ *s->u_mvs[i]++ = s->sh.chroma_log2_weight_denom + 6; -+@@ -2830,7 +2831,6 @@ static void rpi_inter_clear(HEVCContext *s) -+ *s->u_mvs[i]++ = 1 << 5; -+ *s->u_mvs[i]++ = 6; -+ } -+- s->u_mvs[i] += 1; // Padding words -+ } -+ } -+ -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index 9c30e32..a0f0282 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -48,8 +48,8 @@ unsigned int rpi_shader[] = { -+ /* [0x000000b8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+ /* [0x000000c0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+ /* [0x000000c8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x000000d0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x000000d8] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x000000d0] */ 0x15827d80, 0x100208e7, // mov r3, unif -++/* [0x000000d8] */ 0x119c17c0, 0xd00208a7, // shl r2, r3, 1 -+ /* [0x000000e0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+ /* [0x000000e8] */ 0x159e7480, 0x10020867, // mov r1, r2 -+ /* [0x000000f0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+@@ -60,669 +60,669 @@ unsigned int rpi_shader[] = { -+ /* [0x00000118] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+ /* [0x00000120] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+ /* [0x00000128] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000130] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000138] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+-/* [0x00000140] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00000148] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000150] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000158] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000160] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000168] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000170] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000178] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000180] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000188] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -+-/* [0x00000190] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -+-/* [0x00000198] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -+-/* [0x000001a0] */ 0x15427d80, 0x10020827, // mov r0, ra_x -+-/* [0x000001a8] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x000001b0] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_frame_base -+-/* [0x000001b8] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x000001c0] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x000001c8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000001d0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000001d8] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x, r0 -+-/* [0x000001e0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x000001e8] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x000001f0] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_frame_base, r2 -+-/* [0x000001f8] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x00000200] */ 0x15827d80, 0x10021327, // mov rb12,unif -+-/* [0x00000208] */ 0x15827d80, 0x10021367, // mov rb13,unif -+-/* [0x00000210] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000218] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000220] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000228] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000230] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000238] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000240] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x -+-/* [0x00000248] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -++/* [0x00000130] */ 0x119c17c0, 0xd00208a7, // shl r2, r3, 1 -++/* [0x00000138] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000140] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000148] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000150] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000158] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000160] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000168] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000170] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000178] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000180] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -++/* [0x00000188] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -++/* [0x00000190] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -++/* [0x00000198] */ 0x15427d80, 0x10020827, // mov r0, ra_x -++/* [0x000001a0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000001a8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_frame_base -++/* [0x000001b0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x000001b8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x000001c0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000001c8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000001d0] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x, r0 -++/* [0x000001d8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x000001e0] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x000001e8] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_frame_base, r2 -++/* [0x000001f0] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -++/* [0x000001f8] */ 0x15827d80, 0x10021327, // mov rb12,unif -++/* [0x00000200] */ 0x15827d80, 0x10021367, // mov rb13,unif -++/* [0x00000208] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000210] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000218] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000220] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000228] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000230] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x -++/* [0x00000238] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -+ // ::mc_filter_uv -+-/* [0x00000250] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000258] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000260] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000268] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000270] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000278] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000280] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000288] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000290] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -+-/* [0x00000298] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000002a0] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -+-/* [0x000002a8] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002b0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002b8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002c0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002c8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002d0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002d8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000002e0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000002e8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000002f0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000002f8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000300] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000308] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000310] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000318] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000320] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000330] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000340] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000348] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000350] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000358] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000360] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00000368] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000370] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00000378] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000380] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -+-/* [0x00000388] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000390] */ 0x0f9e7080, 0x100613a7, // asr.ifnz rb14, r0, r2 -+-/* [0x00000398] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000003a0] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000240] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000248] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000250] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000258] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000260] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000268] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000270] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000278] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000280] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000288] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000290] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x00000298] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000002a0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000002a8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002b0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000002b8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000002c0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000002c8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000002d0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000002d8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000002e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000002f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000002f8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000300] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000308] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000310] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000318] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000320] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000328] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000330] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000338] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000340] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000348] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000350] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00000358] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000360] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00000368] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000370] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -++/* [0x00000378] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000380] */ 0x0f9e7080, 0x100613a7, // asr.ifnz rb14, r0, r2 -++/* [0x00000388] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000390] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x000003a8] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003b0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -+-/* [0x000003b8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x000003c0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003c8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003d0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003d8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003e0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003e8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003f0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -+-/* [0x000003f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000400] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000408] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000410] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000418] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000420] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000428] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000430] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000438] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000440] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000448] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000450] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000458] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000460] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000468] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000470] */ 0x00000020, 0xe0021327, // mov rb12,32 -+-/* [0x00000478] */ 0x00000006, 0xe0021367, // mov rb13,6 -+-/* [0x00000480] */ 0x00000001, 0xe00213a7, // mov rb14,1 -+-/* [0x00000488] */ 0x00000000, 0xe00213e7, // mov rb15,0 -+-/* [0x00000490] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000498] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000004a0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000004a8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000004b0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000004b8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000004c0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000004c8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -+-/* [0x000004d0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -+-/* [0x000004d8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -+-/* [0x000004e0] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004e8] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -+-/* [0x000004f0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000004f8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000500] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000508] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000510] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000518] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000520] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000528] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000530] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000538] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000540] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000398] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000003a0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++/* [0x000003a8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x000003b0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000003b8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000003c0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000003c8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000003d0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003d8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x000003e0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -++/* [0x000003e8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003f0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000003f8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000400] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000408] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000410] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000418] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000420] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000428] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000430] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000438] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000440] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000448] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000450] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000458] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000460] */ 0x00000020, 0xe0021327, // mov rb12,32 -++/* [0x00000468] */ 0x00000006, 0xe0021367, // mov rb13,6 -++/* [0x00000470] */ 0x00000001, 0xe00213a7, // mov rb14,1 -++/* [0x00000478] */ 0x00000000, 0xe00213e7, // mov rb15,0 -++/* [0x00000480] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000488] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000490] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000498] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000004a0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000004a8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000004b0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000004b8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x000004c0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x000004c8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x000004d0] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x000004d8] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x000004e0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000004e8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000004f0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000004f8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000500] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000508] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000510] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000518] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000520] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000528] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000530] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x00000548] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000550] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000558] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000560] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000568] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000570] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000578] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000580] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000588] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -+-/* [0x00000590] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000598] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -+-/* [0x000005a0] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x000005a8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000005b0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005b8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000005c0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000005c8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000005d0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000005d8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000005e0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000005e8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000005f0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000005f8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000600] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000608] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000610] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000618] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000620] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000628] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000630] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000638] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000640] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000648] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000650] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000658] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000660] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000668] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000538] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000540] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000548] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000550] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000558] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000560] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000568] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000570] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000578] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000580] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000588] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x00000590] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000598] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000005a0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005a8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000005b0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000005b8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000005c0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000005c8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000005d0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000005d8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000005e0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000005e8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000005f0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005f8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000600] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000608] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000610] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000618] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000620] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000628] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000630] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000638] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000640] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000648] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000650] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000658] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000670] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000678] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -+-/* [0x00000680] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00000688] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000690] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000698] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000006a0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000006a8] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000006b0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-/* [0x000006b8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -+-/* [0x000006c0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000006c8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000006d0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000006d8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000006e0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000006e8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000006f0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000006f8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000700] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000708] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000710] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000718] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000720] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000728] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000730] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000738] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000740] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000748] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000750] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000758] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000760] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -+-/* [0x00000768] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000770] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -+-/* [0x00000778] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000780] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000788] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000790] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000798] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000007a0] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000660] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000668] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++/* [0x00000670] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000678] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000680] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000688] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000690] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000698] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000006a0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x000006a8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -++/* [0x000006b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000006b8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000006c0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000006c8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000006d0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000006d8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000006e0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000006e8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000006f0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000006f8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000700] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000708] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000710] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000718] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000720] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000728] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000730] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000738] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000740] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000748] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000750] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -++/* [0x00000758] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000760] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -++/* [0x00000768] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000770] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000778] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000780] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000788] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000790] */ 0x009e7000, 0x100009e7, // nop -+ // ::mc_filter_uv_b -+-/* [0x000007a8] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000007b0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000007b8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000007c0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000007c8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000007d0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000007d8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000007e0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000007e8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -+-/* [0x000007f0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000007f8] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -+-/* [0x00000800] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000808] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000810] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000818] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000820] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000828] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000830] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000838] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000840] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000848] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000850] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000858] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000860] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000868] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000870] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000878] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000880] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000888] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000890] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000898] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x000008a8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008c0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x000008c8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008d0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008d8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000008e0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008e8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000798] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000007a0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000007a8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000007b0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x000007b8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x000007c0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x000007c8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x000007d0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x000007d8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x000007e0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x000007e8] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x000007f0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000007f8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000800] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000808] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000810] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000818] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000820] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000828] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000830] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000838] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x00000840] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x00000848] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x00000850] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000858] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000860] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000868] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000870] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000878] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000880] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000888] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000890] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000898] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008a8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000008b0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x000008b8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008c0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000008c8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000008d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008d8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x000008f0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000008f8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -+-/* [0x00000900] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00000908] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000910] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000918] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000920] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000928] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000930] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000938] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -+-/* [0x00000940] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000948] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000950] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000958] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000960] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000968] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000970] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000978] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000980] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000988] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000990] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000998] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000009a0] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x000009a8] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x000009b0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000009b8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000009c0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000009c8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000009d0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000009d8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000009e0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000009e8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000009f0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x000009f8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x00000a00] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000a08] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000a10] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a18] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a20] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a28] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a30] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000a38] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000a40] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a48] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a50] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000a58] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a60] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000008e0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x000008e8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++/* [0x000008f0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x000008f8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000900] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000908] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000910] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000918] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000920] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x00000928] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -++/* [0x00000930] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000938] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000940] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000948] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000950] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000958] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000960] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000968] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000970] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000978] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000980] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000988] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000990] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000998] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000009a0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000009a8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000009b0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000009b8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000009c0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000009c8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000009d0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000009d8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000009e0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x000009e8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x000009f0] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009f8] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00000a00] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000a08] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000a10] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00000a18] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a20] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000a28] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x00000a30] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a38] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000a40] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x00000a48] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00000a50] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a68] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a70] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a58] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a60] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a68] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a70] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a78] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000a80] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a88] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a90] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a98] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000aa0] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000aa8] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a88] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a90] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a98] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000ab0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000aa0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000aa8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ab0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000ab8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00000ac0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ac8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ad0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000ac8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000ad0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000ad8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000ae0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b00] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b08] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b10] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000b18] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000b20] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000b00] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000b08] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000b10] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_setup -+-/* [0x00000b28] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000b30] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000b38] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000b40] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000b48] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000b50] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000b58] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x00000b60] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000b68] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -+-/* [0x00000b70] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000b78] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000b80] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000b88] */ 0x8c9e7452, 0x10025e18, // add t0s, r2, r1 ; mov ra_frame_base, r2 -+-/* [0x00000b90] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000b98] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000ba0] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000ba8] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -+-/* [0x00000bb0] */ 0x0c9c13c0, 0xd0020567, // add ra_y2, r1, 1 -+-/* [0x00000bb8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000bc0] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -+-/* [0x00000bc8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000bd0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000bd8] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000be0] */ 0x8c9e7452, 0x10025e19, // add t0s, r2, r1 ; mov ra_frame_base2, r2 -+-/* [0x00000be8] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -+-/* [0x00000bf0] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -+-/* [0x00000bf8] */ 0x15827d80, 0x10021427, // mov rb16, unif -+-/* [0x00000c00] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000c08] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+-/* [0x00000c10] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+-/* [0x00000c18] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x00000c20] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+-/* [0x00000c28] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -+-/* [0x00000c30] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x00000c38] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x00000c40] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x00000c48] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x00000c50] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x00000c58] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x00000c60] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x00000c68] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x00000c70] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x00000c78] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x00000c80] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x00000c88] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000c90] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000c98] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000ca0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000ca8] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000cb0] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000cb8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000cc0] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00000cc8] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00000cd0] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000cd8] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000ce0] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000ce8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000cf0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000cf8] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000d00] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000d08] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000d10] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000d18] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000d20] */ 0x15827d80, 0x10021327, // mov rb12,unif -+-/* [0x00000d28] */ 0x15827d80, 0x10021367, // mov rb13,unif -+-/* [0x00000d30] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000d38] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000d40] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000d48] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000d50] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000d58] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -+-/* [0x00000d60] */ 0x13540dc0, 0xd0020867, // max r1, ra_y2, 0 -+-/* [0x00000d68] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000d70] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000d78] */ 0x0c541dc0, 0xd0020567, // add ra_y2, ra_y2, 1 -+-/* [0x00000d80] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000d88] */ 0x0c667380, 0x10020e27, // add t0s, r1, ra_frame_base2 -++/* [0x00000b18] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000b20] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000b28] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000b30] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000b38] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000b40] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000b48] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x00000b50] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000b58] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -++/* [0x00000b60] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000b68] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000b70] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000b78] */ 0x8c9e7452, 0x10025e18, // add t0s, r2, r1 ; mov ra_frame_base, r2 -++/* [0x00000b80] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000b88] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000b90] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000b98] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x00000ba0] */ 0x0c9c13c0, 0xd0020567, // add ra_y2, r1, 1 -++/* [0x00000ba8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000bb0] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -++/* [0x00000bb8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000bc0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000bc8] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000bd0] */ 0x8c9e7452, 0x10025e19, // add t0s, r2, r1 ; mov ra_frame_base2, r2 -++/* [0x00000bd8] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -++/* [0x00000be0] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -++/* [0x00000be8] */ 0x15827d80, 0x10021427, // mov rb16, unif -++/* [0x00000bf0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000bf8] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x00000c00] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x00000c08] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x00000c10] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x00000c18] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -++/* [0x00000c20] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000c28] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000c30] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00000c38] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x00000c40] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x00000c48] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x00000c50] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x00000c58] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x00000c60] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x00000c68] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x00000c70] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x00000c78] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000c80] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000c88] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000c90] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000c98] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000ca0] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000ca8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000cb0] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000cb8] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000cc0] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000cc8] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000cd0] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000cd8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000ce0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000ce8] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000cf0] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000cf8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000d00] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000d08] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000d10] */ 0x15827d80, 0x10021327, // mov rb12,unif -++/* [0x00000d18] */ 0x15827d80, 0x10021367, // mov rb13,unif -++/* [0x00000d20] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000d28] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000d30] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000d38] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000d40] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000d48] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -++/* [0x00000d50] */ 0x13540dc0, 0xd0020867, // max r1, ra_y2, 0 -++/* [0x00000d58] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000d60] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000d68] */ 0x0c541dc0, 0xd0020567, // add ra_y2, ra_y2, 1 -++/* [0x00000d70] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000d78] */ 0x0c667380, 0x10020e27, // add t0s, r1, ra_frame_base2 -+ // ::mc_filter -+-/* [0x00000d90] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000d98] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000da0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000da8] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -+-/* [0x00000db0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000db8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000dc0] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000dc8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000dd0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000dd8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000de0] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -+-/* [0x00000de8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000df0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -+-/* [0x00000df8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000e00] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -+-/* [0x00000e08] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -+-/* [0x00000e10] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000e18] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -+-/* [0x00000e20] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000e28] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000e30] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000e38] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000e40] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000e48] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000e50] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000e58] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000e60] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000e68] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000e70] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000e78] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000e80] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000e88] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000e90] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000e98] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ea0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ea8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000eb0] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000eb8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ec0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ec8] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ed0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000ed8] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000ee0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ee8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ef0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ef8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000f00] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000f08] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f10] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f18] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f20] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -+-/* [0x00000f28] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000f30] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000f38] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00000f40] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000f48] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00000f50] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000d80] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000d88] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000d90] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000d98] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -++/* [0x00000da0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000da8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000db0] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000db8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000dc0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000dc8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000dd0] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -++/* [0x00000dd8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000de0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -++/* [0x00000de8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000df0] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x00000df8] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -++/* [0x00000e00] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000e08] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -++/* [0x00000e10] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000e18] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000e20] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000e28] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000e30] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000e38] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000e40] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000e48] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000e50] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000e58] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000e60] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000e68] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000e70] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000e78] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000e80] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000e88] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000e90] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000e98] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000ea0] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000ea8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000eb0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000eb8] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ec0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x00000ec8] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000ed0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ed8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ee0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ee8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x00000ef0] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000ef8] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f00] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f08] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000f10] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -++/* [0x00000f18] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000f20] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -++/* [0x00000f28] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00000f30] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000f38] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00000f40] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :yloop -+-/* [0x00000f58] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000f60] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -+-/* [0x00000f68] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00000f70] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000f78] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -+-/* [0x00000f80] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -+-/* [0x00000f88] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000f90] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000f98] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000fa0] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -+-/* [0x00000fa8] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -+-/* [0x00000fb0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000fb8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -+-/* [0x00000fc0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -+-/* [0x00000fc8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000fd0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000fd8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000fe0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000fe8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000ff0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000ff8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00001000] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00001008] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00001010] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00001018] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00001020] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00001028] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00001030] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00001038] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00001040] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00001048] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00001050] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00001058] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -+-/* [0x00001060] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00001068] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00001070] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00001078] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00001080] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloop -+-/* [0x00001088] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00001090] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00001098] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000010a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000010a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000010b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000010b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000010c0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -+-/* [0x000010c8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -+-/* [0x000010d0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -+-/* [0x000010d8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -+-/* [0x000010e0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000010e8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000010f0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000010f8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -+-/* [0x00001100] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -+-/* [0x00001108] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -+-/* [0x00001110] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloop -+-/* [0x00001118] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -+-/* [0x00001120] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00001128] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00001130] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001138] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00001140] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001148] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000f48] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000f50] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -++/* [0x00000f58] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000f60] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000f68] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -++/* [0x00000f70] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -++/* [0x00000f78] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000f80] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000f88] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000f90] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -++/* [0x00000f98] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -++/* [0x00000fa0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000fa8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++/* [0x00000fb0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++/* [0x00000fb8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000fc0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000fc8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000fd0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000fd8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000fe0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000fe8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000ff0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000ff8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00001000] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00001008] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00001010] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00001018] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00001020] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001028] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001030] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001038] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001040] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00001048] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -++/* [0x00001050] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001058] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001060] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001068] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001070] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloop -++/* [0x00001078] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001080] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00001088] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00001090] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00001098] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000010a0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000010a8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000010b0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -++/* [0x000010b8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -++/* [0x000010c0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -++/* [0x000010c8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -++/* [0x000010d0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000010d8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000010e0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000010e8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x000010f0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x000010f8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x00001100] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloop -++/* [0x00001108] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x00001110] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00001118] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00001120] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001128] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001130] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001138] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_b -+-/* [0x00001150] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00001158] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00001160] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00001168] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -+-/* [0x00001170] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00001178] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00001180] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00001188] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00001190] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00001198] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000011a0] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -+-/* [0x000011a8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000011b0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -+-/* [0x000011b8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x000011c0] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -+-/* [0x000011c8] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -+-/* [0x000011d0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000011d8] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -+-/* [0x000011e0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000011e8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000011f0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000011f8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00001200] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00001208] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00001210] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00001218] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00001220] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00001228] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00001230] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00001238] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00001240] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001248] */ 0x00000001, 0xe0020867, // mov r1, 1 -+-/* [0x00001250] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001258] */ 0x409f3001, 0xd00049e0, // nop ; mul24 r0, r0 << 13, r1 << 13 -+-/* [0x00001260] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001268] */ 0x409f2001, 0xd00049e0, // nop ; mul24 r0, r0 << 14, r1 << 14 -+-/* [0x00001270] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001278] */ 0x409f1001, 0xd00049e0, // nop ; mul24 r0, r0 << 15, r1 << 15 -+-/* [0x00001280] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001288] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00001290] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001298] */ 0x409f7001, 0xd00049e0, // nop ; mul24 r0, r0 << 9, r1 << 9 -+-/* [0x000012a0] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012a8] */ 0x409f6001, 0xd00049e0, // nop ; mul24 r0, r0 << 10, r1 << 10 -+-/* [0x000012b0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012b8] */ 0x409f5001, 0xd00049e0, // nop ; mul24 r0, r0 << 11, r1 << 11 -+-/* [0x000012c0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012c8] */ 0x409f4001, 0xd00049e0, // nop ; mul24 r0, r0 << 12, r1 << 12 -+-/* [0x000012d0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000012d8] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x000012e0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012e8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012f0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012f8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00001300] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001308] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001310] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001318] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001320] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -+-/* [0x00001328] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001330] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001338] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00001340] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00001348] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00001350] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00001140] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00001148] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00001150] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00001158] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -++/* [0x00001160] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00001168] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00001170] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00001178] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00001180] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00001188] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00001190] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -++/* [0x00001198] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000011a0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -++/* [0x000011a8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x000011b0] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x000011b8] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -++/* [0x000011c0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x000011c8] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -++/* [0x000011d0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000011d8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000011e0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000011e8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000011f0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000011f8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00001200] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00001208] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00001210] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00001218] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00001220] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00001228] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00001230] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001238] */ 0x00000001, 0xe0020867, // mov r1, 1 -++/* [0x00001240] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001248] */ 0x409f3001, 0xd00049e0, // nop ; mul24 r0, r0 << 13, r1 << 13 -++/* [0x00001250] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001258] */ 0x409f2001, 0xd00049e0, // nop ; mul24 r0, r0 << 14, r1 << 14 -++/* [0x00001260] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001268] */ 0x409f1001, 0xd00049e0, // nop ; mul24 r0, r0 << 15, r1 << 15 -++/* [0x00001270] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001278] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00001280] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001288] */ 0x409f7001, 0xd00049e0, // nop ; mul24 r0, r0 << 9, r1 << 9 -++/* [0x00001290] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001298] */ 0x409f6001, 0xd00049e0, // nop ; mul24 r0, r0 << 10, r1 << 10 -++/* [0x000012a0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012a8] */ 0x409f5001, 0xd00049e0, // nop ; mul24 r0, r0 << 11, r1 << 11 -++/* [0x000012b0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012b8] */ 0x409f4001, 0xd00049e0, // nop ; mul24 r0, r0 << 12, r1 << 12 -++/* [0x000012c0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -++/* [0x000012c8] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x000012d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000012e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -++/* [0x000012f0] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x000012f8] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001300] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001308] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00001310] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -++/* [0x00001318] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001320] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -++/* [0x00001328] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00001330] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00001338] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -++/* [0x00001340] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :yloopb -+-/* [0x00001358] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00001360] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -+-/* [0x00001368] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00001370] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00001378] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -+-/* [0x00001380] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -+-/* [0x00001388] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00001390] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00001398] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000013a0] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -+-/* [0x000013a8] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -+-/* [0x000013b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000013b8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -+-/* [0x000013c0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -+-/* [0x000013c8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000013d0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000013d8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000013e0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000013e8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000013f0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000013f8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00001400] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00001408] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00001410] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00001418] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00001420] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00001428] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00001430] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00001438] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00001440] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00001448] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00001450] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00001458] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -+-/* [0x00001460] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00001468] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00001470] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00001478] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00001480] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloopb -+-/* [0x00001488] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00001490] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00001498] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000014a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000014a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000014b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000014b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000014c0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -+-/* [0x000014c8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -+-/* [0x000014d0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -+-/* [0x000014d8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -+-/* [0x000014e0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000014e8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000014f0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000014f8] */ 0x4053800e, 0xd00049e1, // nop ; mul24 r1, r1 << 8, ra20 << 8 -+-/* [0x00001500] */ 0x4c78e38f, 0x10024860, // add r1, r1, ra30 ; mul24 r0, r1, rb14 -+-/* [0x00001508] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x00001510] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloopb -+-/* [0x00001518] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00001520] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00001528] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00001530] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001538] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00001540] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001548] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00001348] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00001350] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -++/* [0x00001358] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00001360] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00001368] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -++/* [0x00001370] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -++/* [0x00001378] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00001380] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00001388] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00001390] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -++/* [0x00001398] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -++/* [0x000013a0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000013a8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++/* [0x000013b0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++/* [0x000013b8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000013c0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000013c8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000013d0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000013d8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000013e0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000013e8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000013f0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000013f8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00001400] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00001408] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00001410] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00001418] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00001420] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001428] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001430] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001438] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001440] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00001448] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -++/* [0x00001450] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001458] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001460] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001468] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001470] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloopb -++/* [0x00001478] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001480] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00001488] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00001490] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00001498] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000014a0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000014a8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000014b0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -++/* [0x000014b8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -++/* [0x000014c0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -++/* [0x000014c8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -++/* [0x000014d0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000014d8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000014e0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x000014e8] */ 0x4053800e, 0xd00049e1, // nop ; mul24 r1, r1 << 8, ra20 << 8 -++/* [0x000014f0] */ 0x4c78e38f, 0x10024860, // add r1, r1, ra30 ; mul24 r0, r1, rb14 -++/* [0x000014f8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x00001500] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloopb -++/* [0x00001508] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x00001510] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00001518] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00001520] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001528] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001530] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001538] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_interrupt_exit12 -+-/* [0x00001550] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001540] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001548] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001550] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00001558] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+ /* [0x00001560] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001568] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001570] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001568] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001570] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001578] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001580] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x00001588] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+@@ -732,11 +732,9 @@ unsigned int rpi_shader[] = { -+ /* [0x000015a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x000015b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+ /* [0x000015b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015d0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000015d8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000015e0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x000015c0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000015c8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000015d0] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 3fa8531..6e552d9 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,15 +4,15 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 148) -+-#define mc_filter_uv_b0 (rpi_shader + 338) -+-#define mc_filter_uv_b (rpi_shader + 490) -+-#define mc_exit (rpi_shader + 666) -+-#define mc_interrupt_exit8 (rpi_shader + 684) -+-#define mc_setup (rpi_shader + 714) -+-#define mc_filter (rpi_shader + 868) -+-#define mc_filter_b (rpi_shader + 1108) -+-#define mc_interrupt_exit12 (rpi_shader + 1364) -+-#define mc_end (rpi_shader + 1402) -++#define mc_filter_uv (rpi_shader + 144) -++#define mc_filter_uv_b0 (rpi_shader + 334) -++#define mc_filter_uv_b (rpi_shader + 486) -++#define mc_exit (rpi_shader + 662) -++#define mc_interrupt_exit8 (rpi_shader + 680) -++#define mc_setup (rpi_shader + 710) -++#define mc_filter (rpi_shader + 864) -++#define mc_filter_b (rpi_shader + 1104) -++#define mc_interrupt_exit12 (rpi_shader + 1360) -++#define mc_end (rpi_shader + 1398) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 9cfc0d9..a0b8e5a 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -133,8 +133,8 @@ mov ra14, 0 -+ mov ra15, 0 -+ -+ # Compute part of VPM to use for DMA output -+-mov r2, qpu_num -+-shl r2, r2, 1 # Convert QPU numbers to be even (this means we can only use 8 QPUs, but is necessary as we need to save 16bit intermediate results) -++mov r3, unif -++shl r2, r3, 1 # Convert QPU numbers to be even (this means we can only use 8 QPUs, but is necessary as we need to save 16bit intermediate results) -+ and r2, r2, 15 -+ mov r1, r2 -+ asr r1, r1, 2 -+@@ -147,8 +147,7 @@ shl r0, r0, 5 -+ add rb27, r0, r1 -+ -+ # Compute part of VPM to save data into -+-mov r2, qpu_num # qpu_num = abcd -+-shl r2, r2, 1 -++shl r2, r3, 1 -+ and r2, r2, 15 # r2 = bcd0 -+ mov r1, r2 # r1 = bcd0 -+ asr r1, r1, 2 # r1 = bc -+@@ -181,9 +180,6 @@ add t0s, r2, r1 -+ mov rb12,unif # offset before shift -+ mov rb13,unif # offset after shift -+ -+-# Dump padding words -+-mov r0, unif -+- -+ # submit texture requests for second line -+ max r1, ra_y, 0 -+ min r1, r1, rb_frame_height_minus_1 -+-- -+2.5.0 -+ -+ -+From f9771d28dc02023eb3d051fb9104b6e051f0a58b Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Sat, 23 May 2015 13:20:21 +0100 -+Subject: [PATCH 45/68] Add new cache flushing routine -+ -+--- -+ libavcodec/hevc.c | 8 +++-- -+ libavcodec/hevc_filter.c | 39 ++++++++++----------- -+ libavcodec/rpi_qpu.c | 17 +++++++-- -+ libavcodec/rpi_qpu.h | 2 ++ -+ libavcodec/rpi_user_vcsm.h | 86 ++++++++++++++++++++++++++-------------------- -+ 5 files changed, 91 insertions(+), 61 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 9605459..52293bf 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3564,9 +3564,13 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) -+ } -+ -+ fail: -+- if (s->ref && s->threads_type == FF_THREAD_FRAME) -++ if (s->ref && s->threads_type == FF_THREAD_FRAME) { -++#ifdef RPI_INTER_QPU -++ void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n); -++ ff_hevc_flush_chroma(s, &s->ref->tf, s->ps.sps->height); -++#endif -+ ff_thread_report_progress(&s->ref->tf, INT_MAX, 0); -+- -++ } -+ return ret; -+ } -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 186317a..ec84e8a 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -883,36 +883,35 @@ static int ff_hevc_buf_base(AVBufferRef *bref) { -+ return p->vc & 0x3fffffff; -+ } -+ -+-static void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n) -++void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n); -++void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n) -+ { -+ if (s->enable_rpi && !( s->nal_unit_type == NAL_TRAIL_N || -+ s->nal_unit_type == NAL_TSA_N || -+ s->nal_unit_type == NAL_STSA_N || -+ s->nal_unit_type == NAL_RADL_N || -+ s->nal_unit_type == NAL_RASL_N )) { -+-#define RPI_FAST_CACHEFLUSH -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+- int curr_y = f->progress->data[0]; -++ int curr_y = ((int *)f->progress->data)[0]; -++ int curr_uv = curr_y >> s->ps.sps->vshift[1]; -++ int n_uv = n >> s->ps.sps->vshift[1]; -+ int sz,base; -+- if (curr_y < 0) curr_y = 0; -+- if (n<=curr_y) return; // Should not happen -+- sz = s->frame->linesize[1] * (n-curr_y); -+- base = s->frame->linesize[1] * curr_y; -+- iocache.s[0].cmd = 3; // Flush L1 cache -+- iocache.s[0].addr = 0; -+- iocache.s[0].size = 0; -+- -+- iocache.s[1].cmd = 2; -+- iocache.s[1].addr = ff_hevc_buf_base(s->frame->buf[1]) + base; -++ if (curr_uv < 0) curr_uv = 0; -++ if (n_uv<=curr_uv) { assert(0); return; } // Should not happen -++ sz = s->frame->linesize[1] * (n_uv-curr_uv); -++ base = s->frame->linesize[1] * curr_uv; -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(s->frame->buf[1]); -++ iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].cmd = 3; // clean+invalidate -++ iocache.s[0].addr = p->arm + base; -++ iocache.s[0].size = sz; -++ p = av_buffer_pool_opaque(s->frame->buf[2]); -++ iocache.s[1].handle = p->vcsm_handle; -++ iocache.s[1].cmd = 3; // clean+invalidate -++ iocache.s[1].addr = p->arm + base; -+ iocache.s[1].size = sz; -+- -+- iocache.s[2].cmd = 2; -+- iocache.s[2].addr = ff_hevc_buf_base(s->frame->buf[2]) + base; -+- iocache.s[2].size = sz; -+- -+- vcsm_clean_invalid( gpu_get_mailbox(), &iocache ); -+- -++ vcsm_clean_invalid( &iocache ); -+ #else -+ flush_buffer(s->frame->buf[1]); -+ flush_buffer(s->frame->buf[2]); -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index feb3284..aa65a77 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -211,6 +211,7 @@ static void gpu_unlock(void) { -+ } -+ -+ static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) { -++ p->numbytes = numbytes; -+ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); -+ assert(p->vcsm_handle); -+ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -+@@ -243,13 +244,25 @@ int gpu_get_mailbox(void) -+ return gpu->mb; -+ } -+ -++// Call this to clean and invalidate a region of memory -+ void gpu_cache_flush(GPU_MEM_PTR_T *p) -+ { -+- void *tmp = vcsm_lock(p->vcsm_handle); -+- vcsm_unlock_ptr(tmp); -++#define RPI_FAST_CACHEFLUSH -++#ifdef RPI_FAST_CACHEFLUSH -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].cmd = 3; // clean+invalidate -++ iocache.s[0].addr = p->arm; -++ iocache.s[0].size = p->numbytes; -++ vcsm_clean_invalid( &iocache ); -++#else -++ void *tmp = vcsm_lock(p->vcsm_handle); -++ vcsm_unlock_ptr(tmp); -++#endif -+ } -+ -+ static int gpu_malloc_cached_internal(int numbytes, GPU_MEM_PTR_T *p) { -++ p->numbytes = numbytes; -+ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST, (char *)"Video Frame" ); -+ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_VC, (char *)"Video Frame" ); -+ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 2f08f03..0565a60 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -1,6 +1,8 @@ -+ #ifndef RPI_QPU_H -+ #define RPI_QPU_H -+ -++#define RPI_FAST_CACHEFLUSH -++ -+ typedef struct gpu_mem_ptr_s { -+ unsigned char *arm; // Pointer to memory mapped on ARM side -+ int vc_handle; // Videocore handle of relocatable memory -+diff --git a/libavcodec/rpi_user_vcsm.h b/libavcodec/rpi_user_vcsm.h -+index 95e6de1..db41a4d 100644 -+--- a/libavcodec/rpi_user_vcsm.h -++++ b/libavcodec/rpi_user_vcsm.h -+@@ -1,29 +1,41 @@ -+-/* -+-Copyright (c) 2012, Broadcom Europe Ltd -+-All rights reserved. -+- -+-Redistribution and use in source and binary forms, with or without -+-modification, are permitted provided that the following conditions are met: -+- * Redistributions of source code must retain the above copyright -+- notice, this list of conditions and the following disclaimer. -+- * Redistributions in binary form must reproduce the above copyright -+- notice, this list of conditions and the following disclaimer in the -+- documentation and/or other materials provided with the distribution. -+- * Neither the name of the copyright holder nor the -+- names of its contributors may be used to endorse or promote products -+- derived from this software without specific prior written permission. -+- -+-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -+-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -+-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -+-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -+-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -+-ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+-*/ -++/***************************************************************************** -++* Copyright 2001 - 2011 Broadcom Corporation. All rights reserved. -++* -++* This program is the proprietary software of Broadcom Corporation and/or -++* its licensors, and may only be used, duplicated, modified or distributed -++* pursuant to the terms and conditions of a separate, written license -++* agreement executed between you and Broadcom (an "Authorized License"). -++* Except as set forth in an Authorized License, Broadcom grants no license -++* (express or implied), right to use, or waiver of any kind with respect to -++* the Software, and Broadcom expressly reserves all rights in and to the -++* Software and all intellectual property rights therein. IF YOU HAVE NO -++* AUTHORIZED LICENSE, THEN YOU HAVE NO RIGHT TO USE THIS SOFTWARE IN ANY -++* WAY, AND SHOULD IMMEDIATELY NOTIFY BROADCOM AND DISCONTINUE ALL USE OF -++* THE SOFTWARE. -++* -++* Except as expressly set forth in the Authorized License, -++* 1. This program, including its structure, sequence and organization, -++* constitutes the valuable trade secrets of Broadcom, and you shall use -++* all reasonable efforts to protect the confidentiality thereof, and to -++* use this information only in connection with your use of Broadcom -++* integrated circuit products. -++* 2. TO THE MAXIMUM EXTENT PERMITTED BY LAW, THE SOFTWARE IS PROVIDED "AS IS" -++* AND WITH ALL FAULTS AND BROADCOM MAKES NO PROMISES, REPRESENTATIONS OR -++* WARRANTIES, EITHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, WITH -++* RESPECT TO THE SOFTWARE. BROADCOM SPECIFICALLY DISCLAIMS ANY AND ALL -++* IMPLIED WARRANTIES OF TITLE, MERCHANTABILITY, NONINFRINGEMENT, FITNESS -++* FOR A PARTICULAR PURPOSE, LACK OF VIRUSES, ACCURACY OR COMPLETENESS, -++* QUIET ENJOYMENT, QUIET POSSESSION OR CORRESPONDENCE TO DESCRIPTION. YOU -++* ASSUME THE ENTIRE RISK ARISING OUT OF USE OR PERFORMANCE OF THE SOFTWARE. -++* 3. TO THE MAXIMUM EXTENT PERMITTED BY LAW, IN NO EVENT SHALL BROADCOM OR ITS -++* LICENSORS BE LIABLE FOR (i) CONSEQUENTIAL, INCIDENTAL, SPECIAL, INDIRECT, -++* OR EXEMPLARY DAMAGES WHATSOEVER ARISING OUT OF OR IN ANY WAY RELATING TO -++* YOUR USE OF OR INABILITY TO USE THE SOFTWARE EVEN IF BROADCOM HAS BEEN -++* ADVISED OF THE POSSIBILITY OF SUCH DAMAGES; OR (ii) ANY AMOUNT IN EXCESS -++* OF THE AMOUNT ACTUALLY PAID FOR THE SOFTWARE ITSELF OR U.S. $1, WHICHEVER -++* IS GREATER. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF -++* ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. -++*****************************************************************************/ -+ -+ #ifndef __USER_VCSM__H__INCLUDED__ -+ #define __USER_VCSM__H__INCLUDED__ -+@@ -424,21 +436,21 @@ int vcsm_unlock_hdl_sp( unsigned int handle, int cache_no_flush ); -+ ** -+ ** structure contains a list of flush/invalidate commands. Commands are: -+ ** 0: nop -+-** 1: invalidate given physical range in L2 -+-** 2: clean given physical range in L2 -+-** 3: clean+invalidate all of L1 -+-** 4: flush all of L2 and all of L1 -++** 1: invalidate given virtual range in L1/L2 -++** 2: clean given virtual range in L1/L2 -++** 3: clean+invalidate given virtual range in L1/L2 -++** 4: flush all L1/L2 -+ */ -+ struct vcsm_user_clean_invalid_s { -+- struct { -+- unsigned int cmd; -+- unsigned int addr; -+- unsigned int size; -+- } s[8]; -++ struct { -++ unsigned int cmd; -++ unsigned int handle; -++ unsigned int addr; -++ unsigned int size; -++ } s[8]; -+ }; -+ -+-int vcsm_clean_invalid( unsigned int handle, struct vcsm_user_clean_invalid_s *s ); -+- -++int vcsm_clean_invalid( struct vcsm_user_clean_invalid_s *s ); -+ -+ #ifdef __cplusplus -+ } -+-- -+2.5.0 -+ -+ -+From b91ec9a8437e65c59dddf323de875e62ee227403 Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Sat, 23 May 2015 21:10:10 +0100 -+Subject: [PATCH 46/68] Fix multi mailbox extra transform call -+ -+--- -+ libavcodec/hevc.c | 2 ++ -+ 1 file changed, 2 insertions(+) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 52293bf..fa6d788 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3013,7 +3013,9 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #ifdef RPI_INTER_QPU -+ rpi_execute_inter_qpu(s); -+ #endif -++#ifndef RPI_MULTI_MAILBOX -+ rpi_execute_transform(s); -++#endif -+ rpi_execute_inter_cmds(s); -+ vpu_wait(s->vpu_id); -+ rpi_execute_pred_cmds(s); -+-- -+2.5.0 -+ -+ -+From 03bbcfdda2db59b9603018b1cf0ca340d9ffc088 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 27 May 2015 16:44:29 +0100 -+Subject: [PATCH 47/68] Added support for running luma prediction on QPUs -+ -+--- -+ libavcodec/hevc.c | 237 +++++++- -+ libavcodec/hevc.h | 26 +- -+ libavcodec/hevc_filter.c | 23 +- -+ libavcodec/rpi_qpu.c | 156 ++++-- -+ libavcodec/rpi_qpu.h | 8 +- -+ libavcodec/rpi_shader.c | 1313 ++++++++++++++++++++++---------------------- -+ libavcodec/rpi_shader.h | 21 +- -+ libavcodec/rpi_shader.qasm | 883 ++++++++++++++--------------- -+ 8 files changed, 1464 insertions(+), 1203 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index fa6d788..11b9e60 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -52,6 +52,11 @@ -+ // Define RPI_MULTI_MAILBOX to use the updated mailbox that can launch both QPU and VPU -+ #define RPI_MULTI_MAILBOX -+ #endif -++ -++ // Define RPI_CACHE_UNIF_MVS to write motion vector uniform stream to cached memory -++ // RPI_CACHE_UNIF_MVS doesn't seem to make much difference, so left undefined. -++ -++ -+ #endif -+ -+ // #define DISABLE_MC -+@@ -74,6 +79,13 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ // The QPU code for UV blocks only works up to a block width of 8 -+ #define RPI_CHROMA_BLOCK_WIDTH 8 -+ -++// Split image of 2048 into parts 64 wide -++// So some QPUs will have 3 blocks of 64 to do, and others 2 blocks for an image 2048 wide with 32 blocks across -++// Each block of 64*64 -++// Smallest CTU size is 16x16, so smallest block is 8x8 -++// Corresponds to a total of 83kbytes over all 12 QPUs -++#define RPI_LUMA_COMMAND_WORDS 9 -++#define Y_COMMANDS_PER_QPU ((1+3*(64*64)/(8*8)) * RPI_LUMA_COMMAND_WORDS) -+ -+ #define ENCODE_COEFFS(c0, c1, c2, c3) (((c0) & 0xff) | ((c1) & 0xff) << 8 | ((c2) & 0xff) << 16 | ((c3) & 0xff) << 24) -+ -+@@ -2004,10 +2016,46 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; -+ int nPbH_c = nPbH >> s->ps.sps->vshift[1]; -+ -+- RPI_REDIRECT(luma_mc_uni)(s, dst0, s->frame->linesize[0], ref0->frame, -++#ifdef RPI_LUMA_QPU -++ if (s->enable_rpi) { -++ int reflist = 0; -++ const Mv *mv = ¤t_mv.mv[reflist]; -++ int mx = mv->x & 3; -++ int my = mv->y & 3; -++ int my_mx = (my<<8) + mx; -++ int my2_mx2_my_mx = (my_mx << 16) + my_mx; -++ int x1 = x0 + (mv->x >> 2); -++ int y1 = y0 + (mv->y >> 2); -++ int chan = x0>>6; // 64 wide blocks per QPU -++ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -++ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -++ uint32_t *y = s->y_mvs[chan % 12]; -++ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -++ for(int start_x=0;start_x < nPbW;start_x+=16) { -++ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + 8 + start_x) & 0xffff); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -++ *y++ = ( (nPbW<16 ? nPbW : 16) << 16 ) + (nPbH<16 ? nPbH : 16); -++ *y++ = my2_mx2_my_mx; -++ if (weight_flag) { -++ *y++ = (s->sh.luma_offset_l0[current_mv.ref_idx[reflist]] << 16) + (s->sh.luma_weight_l0[current_mv.ref_idx[reflist]] & 0xffff); -++ } else { -++ *y++ = 1; // Weight of 1 and offset of 0 -++ } -++ *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -++ } -++ } -++ s->y_mvs[chan % 12] = y; -++ } else -++#endif -++ { -++ RPI_REDIRECT(luma_mc_uni)(s, dst0, s->frame->linesize[0], ref0->frame, -+ ¤t_mv.mv[0], x0, y0, nPbW, nPbH, -+ s->sh.luma_weight_l0[current_mv.ref_idx[0]], -+ s->sh.luma_offset_l0[current_mv.ref_idx[0]]); -++ } -+ -+ if (s->ps.sps->chroma_format_idc) { -+ #ifdef RPI_INTER_QPU -+@@ -2067,10 +2115,47 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; -+ int nPbH_c = nPbH >> s->ps.sps->vshift[1]; -+ -+- RPI_REDIRECT(luma_mc_uni)(s, dst0, s->frame->linesize[0], ref1->frame, -++#ifdef RPI_LUMA_QPU -++ if (s->enable_rpi) { -++ int reflist = 1; -++ const Mv *mv = ¤t_mv.mv[reflist]; -++ int mx = mv->x & 3; -++ int my = mv->y & 3; -++ int my_mx = (my<<8) + mx; -++ int my2_mx2_my_mx = (my_mx << 16) + my_mx; -++ int x1 = x0 + (mv->x >> 2); -++ int y1 = y0 + (mv->y >> 2); -++ int chan = x0>>6; // 64 wide blocks per QPU -++ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -++ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -++ uint32_t *y = s->y_mvs[chan % 12]; -++ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -++ for(int start_x=0;start_x < nPbW;start_x+=16) { -++ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + 8 + start_x) & 0xffff); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -++ *y++ = ( (nPbW<16 ? nPbW : 16) << 16 ) + (nPbH<16 ? nPbH : 16); -++ *y++ = my2_mx2_my_mx; -++ if (weight_flag) { -++ *y++ = (s->sh.luma_offset_l0[current_mv.ref_idx[reflist]] << 16) + (s->sh.luma_weight_l0[current_mv.ref_idx[reflist]] & 0xffff); -++ } else { -++ *y++ = 1; // Weight of 1 and offset of 0 -++ } -++ *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -++ } -++ } -++ s->y_mvs[chan % 12] = y; -++ } else -++#endif -++ -++ { -++ RPI_REDIRECT(luma_mc_uni)(s, dst0, s->frame->linesize[0], ref1->frame, -+ ¤t_mv.mv[1], x0, y0, nPbW, nPbH, -+ s->sh.luma_weight_l1[current_mv.ref_idx[1]], -+ s->sh.luma_offset_l1[current_mv.ref_idx[1]]); -++ } -+ -+ if (s->ps.sps->chroma_format_idc) { -+ #ifdef RPI_INTER_QPU -+@@ -2104,8 +2189,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = rpi_filter_coefs[_mx][0]; -+ *u++ = rpi_filter_coefs[_my][0]; -+ if (weight_flag) { -+- *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[1]][0] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[1]][0] & 0xffff); -+- *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[1]][1] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[1]][1] & 0xffff); -++ *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[reflist]][0] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[reflist]][0] & 0xffff); -++ *u++ = (s->sh.chroma_offset_l0[current_mv.ref_idx[reflist]][1] << 16) + (s->sh.chroma_weight_l0[current_mv.ref_idx[reflist]][1] & 0xffff); -+ } else { -+ *u++ = 1; // Weight of 1 and offset of 0 -+ *u++ = 1; -+@@ -2132,9 +2217,44 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int nPbW_c = nPbW >> s->ps.sps->hshift[1]; -+ int nPbH_c = nPbH >> s->ps.sps->vshift[1]; -+ -+- RPI_REDIRECT(luma_mc_bi)(s, dst0, s->frame->linesize[0], ref0->frame, -++#ifdef RPI_LUMA_QPU -++ if (s->enable_rpi) { -++ const Mv *mv = ¤t_mv.mv[0]; -++ int mx = mv->x & 3; -++ int my = mv->y & 3; -++ int my_mx = (my<<8) + mx; -++ const Mv *mv2 = ¤t_mv.mv[1]; -++ int mx2 = mv2->x & 3; -++ int my2 = mv2->y & 3; -++ int my2_mx2 = (my2<<8) + mx2; -++ int my2_mx2_my_mx = (my2_mx2 << 16) + my_mx; -++ int x1 = x0 + (mv->x >> 2); -++ int y1 = y0 + (mv->y >> 2); -++ int x2 = x0 + (mv2->x >> 2); -++ int y2 = y0 + (mv2->y >> 2); -++ int chan = x0>>6; // 64 wide blocks per QPU -++ uint32_t *y = s->y_mvs[chan % 12]; -++ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -++ for(int start_x=0;start_x < nPbW;start_x+=8) { // B blocks work 8 at a time -++ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = ((y2 - 3 + start_y) << 16) + ( (x2 - 3 + start_x) & 0xffff); // Second fetch is for ref1 -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -++ *y++ = ( (nPbW<8 ? nPbW : 8) << 16 ) + (nPbH<16 ? nPbH : 16); -++ *y++ = my2_mx2_my_mx; -++ *y++ = 1; // B frame weighted prediction not supported -++ *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter_b; -++ } -++ } -++ s->y_mvs[chan % 12] = y; -++ } else -++#endif -++ { -++ RPI_REDIRECT(luma_mc_bi)(s, dst0, s->frame->linesize[0], ref0->frame, -+ ¤t_mv.mv[0], x0, y0, nPbW, nPbH, -+ ref1->frame, ¤t_mv.mv[1], ¤t_mv); -++ } -+ -+ if (s->ps.sps->chroma_format_idc) { -+ #ifdef RPI_INTER_QPU -+@@ -2823,7 +2943,6 @@ static void rpi_inter_clear(HEVCContext *s) -+ *s->u_mvs[i]++ = pic_height; -+ *s->u_mvs[i]++ = s->frame->linesize[1]; -+ *s->u_mvs[i]++ = s->frame->linesize[2]; -+- *s->u_mvs[i]++ = i; -+ if (weight_flag) { -+ *s->u_mvs[i]++ = 1 << (s->sh.chroma_log2_weight_denom + 6 - 1); -+ *s->u_mvs[i]++ = s->sh.chroma_log2_weight_denom + 6; -+@@ -2831,7 +2950,31 @@ static void rpi_inter_clear(HEVCContext *s) -+ *s->u_mvs[i]++ = 1 << 5; -+ *s->u_mvs[i]++ = 6; -+ } -++ *s->u_mvs[i]++ = i; // Select section of VPM (avoid collisions with 3d unit) -++ } -++ -++#ifdef RPI_LUMA_QPU -++ for(i=0;i<12;i++) { -++ s->y_mvs[i] = s->y_mvs_base[i]; -++ *s->y_mvs[i]++ = 0; // y_x -++ *s->y_mvs[i]++ = 0; // ref_y_base -++ *s->y_mvs[i]++ = 0; // y2_x2 -++ *s->y_mvs[i]++ = 0; // ref_y2_base -++ *s->y_mvs[i]++ = (s->ps.sps->width << 16) + s->ps.sps->height; -++ *s->y_mvs[i]++ = s->frame->linesize[0]; // pitch -++ *s->y_mvs[i]++ = s->frame->linesize[0]; // dst_pitch -++ if (weight_flag) { -++ int offset = 1 << (s->sh.luma_log2_weight_denom + 6 - 1); -++ int shift = s->sh.luma_log2_weight_denom + 6; -++ *s->y_mvs[i]++ = (offset << 16) + shift; -++ } else { -++ int offset = 1 << 5; -++ int shift = 6; -++ *s->y_mvs[i]++ = (offset << 16) + shift; -++ } -++ *s->y_mvs[i]++ = 0; // Next kernel -+ } -++#endif -+ } -+ -+ static void rpi_execute_inter_qpu(HEVCContext *s) -+@@ -2839,6 +2982,9 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ int k; -+ int i; -+ uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr.vc; -++#ifdef RPI_LUMA_QPU -++ uint32_t *y_unif_vc = (uint32_t *)s->y_unif_mvs_ptr.vc; -++#endif -+ if (s->sh.slice_type == I_SLICE) { -+ #ifdef RPI_MULTI_MAILBOX -+ rpi_execute_transform(s); -+@@ -2854,8 +3000,23 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ -+ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+ -++#ifdef RPI_LUMA_QPU -++ for(k=0;k<12;k++) { -++ s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+1] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for second request -++ s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -++ assert(s->y_mvs[k] - s->y_mvs_base[k] < Y_COMMANDS_PER_QPU); -++ } -++ s->y_mvs[12-1][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT12); // This QPU will signal interrupt when all others are done and have acquired a semaphore -++#endif -++ -++ -+ #ifdef RPI_MULTI_MAILBOX -++#ifdef RPI_CACHE_UNIF_MVS -++ gpu_cache_flush3(&s->coeffs_buf_accelerated,&s->y_unif_mvs_ptr, &s->unif_mvs_ptr); -++#else -+ gpu_cache_flush(&s->coeffs_buf_accelerated); -++#endif -+ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0, -+ qpu_get_fn(QPU_MC_SETUP_UV), -+ (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+@@ -2865,7 +3026,27 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ (uint32_t)(unif_vc+(s->mvs_base[4 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+ (uint32_t)(unif_vc+(s->mvs_base[5 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+ (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -++ (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++#ifdef RPI_LUMA_QPU -++ qpu_get_fn(QPU_MC_SETUP), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[0 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[1 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[2 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[3 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[4 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[5 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[6 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[7 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[8 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[9 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[10 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[11 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)) -++#else -++ 0, -++ 0,0,0,0, -++ 0,0,0,0, -++ 0,0,0,0 -++#endif -+ ); -+ for(i=0;i<4;i++) -+ s->num_coeffs[i] = 0; -+@@ -2881,6 +3062,8 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -+ ); -+ #endif -++ -++ -+ } -+ #endif -+ -+@@ -3568,8 +3751,7 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length) -+ fail: -+ if (s->ref && s->threads_type == FF_THREAD_FRAME) { -+ #ifdef RPI_INTER_QPU -+- void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n); -+- ff_hevc_flush_chroma(s, &s->ref->tf, s->ps.sps->height); -++ ff_hevc_flush_buffer(s, &s->ref->tf, s->ps.sps->height); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, INT_MAX, 0); -+ } -+@@ -3756,7 +3938,6 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ -+ #ifdef RPI -+ av_freep(&s->unif_mv_cmds); -+- av_freep(&s->unif_xfm_cmds); -+ av_freep(&s->univ_pred_cmds); -+ -+ #ifdef RPI_INTER_QPU -+@@ -3765,7 +3946,12 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ s->unif_mvs = 0; -+ } -+ #endif -+- //gpu_free(&s->dummy); -++#ifdef RPI_LUMA_QPU -++ if (s->y_unif_mvs) { -++ gpu_free( &s->y_unif_mvs_ptr ); -++ s->y_unif_mvs = 0; -++ } -++#endif -+ -+ #ifdef EARLY_MALLOC -+ printf("hevc_decode_free\n"); -+@@ -3855,9 +4041,6 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ s->unif_mv_cmds = av_mallocz(sizeof(HEVCMvCmd)*RPI_MAX_MV_CMDS); -+ if (!s->unif_mv_cmds) -+ goto fail; -+- s->unif_xfm_cmds = av_mallocz(sizeof(HEVCXfmCmd)*RPI_MAX_XFM_CMDS); -+- if (!s->unif_xfm_cmds) -+- goto fail; -+ s->univ_pred_cmds = av_mallocz(sizeof(HEVCPredCmd)*RPI_MAX_PRED_CMDS); -+ if (!s->univ_pred_cmds) -+ goto fail; -+@@ -3871,7 +4054,11 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ { -+ int uv_commands_per_qpu = UV_COMMANDS_PER_QPU; -+ uint32_t *p; -++#ifdef RPI_CACHE_UNIF_MVS -++ gpu_malloc_cached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr ); -++#else -+ gpu_malloc_uncached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr ); -++#endif -+ s->unif_mvs = (uint32_t *) s->unif_mvs_ptr.arm; // TODO support this allocation in non EARLY_MALLOC -+ -+ // Set up initial locations for uniform streams -+@@ -3886,6 +4073,28 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ -+ } -+ #endif -++#ifdef RPI_LUMA_QPU -++ { -++ int y_commands_per_qpu = Y_COMMANDS_PER_QPU; -++ uint32_t *p; -++#ifdef RPI_CACHE_UNIF_MVS -++ gpu_malloc_cached( 12 * y_commands_per_qpu * sizeof(uint32_t), &s->y_unif_mvs_ptr ); -++#else -++ gpu_malloc_uncached( 12 * y_commands_per_qpu * sizeof(uint32_t), &s->y_unif_mvs_ptr ); -++#endif -++ s->y_unif_mvs = (uint32_t *) s->y_unif_mvs_ptr.arm; // TODO support this allocation in non EARLY_MALLOC -++ -++ // Set up initial locations for uniform streams -++ p = s->y_unif_mvs; -++ for(i = 0; i < 12; i++) { -++ s->y_mvs_base[i] = p; -++ p += y_commands_per_qpu; -++ } -++ s->mc_filter = qpu_get_fn(QPU_MC_FILTER); -++ s->mc_filter_b = qpu_get_fn(QPU_MC_FILTER_B); -++ -++ } -++#endif -+ //gpu_malloc_uncached(2048*64,&s->dummy); -+ -+ #ifdef EARLY_MALLOC -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index d33ab74..a3668a2 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -43,9 +43,13 @@ -+ #ifdef RPI -+ -+ #include "rpi_qpu.h" -+- // Use QPU for inter prediction -++ // Define RPI_INTER_QPU to use QPU for chroma inter prediction -+ #define RPI_INTER_QPU -+ -++ #ifdef RPI_INTER_QPU -++ // Define RPI_LUMA_QPU to also use QPU for luma inter prediction -++ #define RPI_LUMA_QPU -++ #endif -+ #endif -+ -+ #define MAX_DPB_SIZE 16 // A.4.1 -+@@ -835,7 +839,6 @@ typedef struct HEVCLocalContext { -+ -+ // Worst case is for 4:4:4 4x4 blocks with 64 high coding tree blocks, so 16 MV cmds per 4 pixels across for each colour plane, * 2 for bi -+ #define RPI_MAX_MV_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -+-#define RPI_MAX_XFM_CMDS (16*3*(RPI_MAX_WIDTH/4)) -+ // Each block can have an intra prediction and a transform_add command -+ #define RPI_MAX_PRED_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -+ // Worst case is 16x16 CTUs -+@@ -870,9 +873,6 @@ typedef struct HEVCMvCmd { -+ int8_t ref_idx[2]; -+ } HEVCMvCmd; -+ -+-// Command for transform to process a block of coefficients -+-typedef struct HEVCXfmCmd { -+-} HEVCXfmCmd; -+ -+ // Command for intra prediction and transform_add of predictions to coefficients -+ #define RPI_PRED_TRANSFORM_ADD 0 -+@@ -918,8 +918,7 @@ typedef struct HEVCContext { -+ -+ #ifdef RPI -+ int enable_rpi; -+- HEVCMvCmd *unif_mv_cmds; // TODO rename -+- HEVCXfmCmd *unif_xfm_cmds; -++ HEVCMvCmd *unif_mv_cmds; -+ HEVCPredCmd *univ_pred_cmds; -+ int buf_width; -+ GPU_MEM_PTR_T coeffs_buf_default; -+@@ -946,6 +945,15 @@ typedef struct HEVCContext { -+ uint32_t mc_filter_uv_b0; -+ uint32_t mc_filter_uv_b; -+ #endif -++#ifdef RPI_LUMA_QPU -++ GPU_MEM_PTR_T y_unif_mvs_ptr; -++ uint32_t *y_unif_mvs; // Base of memory for motion vector commands -++ uint32_t *y_mvs_base[12]; -++ uint32_t *y_mvs[12]; -++ // Function pointers -++ uint32_t mc_filter; -++ uint32_t mc_filter_b; -++#endif -+ -+ #endif -+ -+@@ -1192,6 +1200,10 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ int log2_trafo_size, enum ScanType scan_idx, -+ int c_idx); -+ -++#ifdef RPI_INTER_QPU -++extern void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n); -++#endif -++ -+ void ff_hevc_hls_mvd_coding(HEVCContext *s, int x0, int y0, int log2_cb_size); -+ -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index ec84e8a..11629e4 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -883,8 +883,7 @@ static int ff_hevc_buf_base(AVBufferRef *bref) { -+ return p->vc & 0x3fffffff; -+ } -+ -+-void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n); -+-void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n) -++void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ { -+ if (s->enable_rpi && !( s->nal_unit_type == NAL_TRAIL_N || -+ s->nal_unit_type == NAL_TSA_N || -+@@ -911,10 +910,24 @@ void ff_hevc_flush_chroma(HEVCContext *s, ThreadFrame *f, int n) -+ iocache.s[1].cmd = 3; // clean+invalidate -+ iocache.s[1].addr = p->arm + base; -+ iocache.s[1].size = sz; -++ -++#ifdef RPI_LUMA_QPU -++ p = av_buffer_pool_opaque(s->frame->buf[0]); -++ sz = s->frame->linesize[0] * (n-curr_y); -++ base = s->frame->linesize[0] * curr_y; -++ iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].cmd = 3; // clean+invalidate -++ iocache.s[2].addr = p->arm + base; -++ iocache.s[2].size = sz; -++#endif -+ vcsm_clean_invalid( &iocache ); -+ #else -+ flush_buffer(s->frame->buf[1]); -+ flush_buffer(s->frame->buf[2]); -++#ifdef RPI_LUMA_QPU -++ flush_buffer(s->frame->buf[1]); -++#endif -++ -+ #endif -+ //memcpy(s->dummy.arm,s->frame->data[0],2048*64); -+ //memcpy(s->dummy.arm,s->frame->data[1],1024*32); -+@@ -938,7 +951,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ sao_filter_CTB(s, x, y - ctb_size); -+ if (s->threads_type & FF_THREAD_FRAME ) { -+ #ifdef RPI_INTER_QPU -+- ff_hevc_flush_chroma(s,&s->ref->tf, y); -++ ff_hevc_flush_buffer(s,&s->ref->tf, y); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y, 0); -+ } -+@@ -947,7 +960,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ sao_filter_CTB(s, x , y); -+ if (s->threads_type & FF_THREAD_FRAME ) { -+ #ifdef RPI_INTER_QPU -+- ff_hevc_flush_chroma(s, &s->ref->tf, y + ctb_size); -++ ff_hevc_flush_buffer(s, &s->ref->tf, y + ctb_size); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size, 0); -+ } -+@@ -957,7 +970,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ //int currh = s->ref->tf.progress->data[0]; -+ //if (((y + ctb_size)&63)==0) -+ #ifdef RPI_INTER_QPU -+- ff_hevc_flush_chroma(s, &s->ref->tf, y + ctb_size - 4); -++ ff_hevc_flush_buffer(s, &s->ref->tf, y + ctb_size - 4); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -+ } -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index aa65a77..e12304b 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -1,9 +1,11 @@ -+ #ifdef RPI -+ // This works better than the mmap in that the memory can be cached, but requires a kernel modification to enable the device. -+ // define RPI_TIME_TOTAL_QPU to print out how much time is spent in the QPU code -+-#define RPI_TIME_TOTAL_QPU -++//#define RPI_TIME_TOTAL_QPU -+ // define RPI_TIME_TOTAL_VPU to print out how much time is spent in the VPI code -+ //#define RPI_TIME_TOTAL_VPU -++// define RPI_TIME_TOTAL_POSTED to print out how much time is spent in the multi execute QPU/VPU combined -++//#define RPI_TIME_TOTAL_POSTED -+ // define RPI_ASYNC to run the VPU in a separate thread, need to make a separate call to check for completion -+ #define RPI_ASYNC -+ -+@@ -94,7 +96,8 @@ struct GPU -+ int open_count; // Number of allocated video buffers -+ int mb; // Mailbox handle -+ int vc; // Address in GPU memory -+- int mail[12]; // These are used to pass pairs of code/unifs to the QPUs -++ int mail[12*2]; // These are used to pass pairs of code/unifs to the QPUs for the first QPU task -++ int mail2[12*2]; // These are used to pass pairs of code/unifs to the QPUs for the second QPU task -+ }; -+ -+ // Stop more than one thread trying to allocate memory or use the processing resources at once -+@@ -102,7 +105,7 @@ static pthread_mutex_t gpu_mutex = PTHREAD_MUTEX_INITIALIZER; -+ static volatile struct GPU* gpu = NULL; -+ static GPU_MEM_PTR_T gpu_mem_ptr; -+ -+-#if defined(RPI_TIME_TOTAL_QPU) || defined(RPI_TIME_TOTAL_VPU) -++#if defined(RPI_TIME_TOTAL_QPU) || defined(RPI_TIME_TOTAL_VPU) || defined(RPI_TIME_TOTAL_POSTED) -+ static unsigned int Microseconds(void) { -+ struct timespec ts; -+ unsigned int x; -+@@ -123,7 +126,7 @@ static pthread_cond_t post_cond_head = PTHREAD_COND_INITIALIZER; -+ static pthread_cond_t post_cond_tail = PTHREAD_COND_INITIALIZER; -+ static pthread_mutex_t post_mutex = PTHREAD_MUTEX_INITIALIZER; -+ -+-static int vpu_cmds[MAXCMDS][16]; -++static int vpu_cmds[MAXCMDS][32]; -+ static volatile int vpu_async_tail=0; // Contains the number of posted jobs -+ static volatile int vpu_async_head=0; -+ #endif -+@@ -247,7 +250,6 @@ int gpu_get_mailbox(void) -+ // Call this to clean and invalidate a region of memory -+ void gpu_cache_flush(GPU_MEM_PTR_T *p) -+ { -+-#define RPI_FAST_CACHEFLUSH -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+ iocache.s[0].handle = p->vcsm_handle; -+@@ -261,6 +263,34 @@ void gpu_cache_flush(GPU_MEM_PTR_T *p) -+ #endif -+ } -+ -++void gpu_cache_flush3(GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2) -++{ -++#ifdef RPI_FAST_CACHEFLUSH -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ iocache.s[0].handle = p0->vcsm_handle; -++ iocache.s[0].cmd = 3; // clean+invalidate -++ iocache.s[0].addr = (int) p0->arm; -++ iocache.s[0].size = p0->numbytes; -++ iocache.s[1].handle = p1->vcsm_handle; -++ iocache.s[1].cmd = 3; // clean+invalidate -++ iocache.s[1].addr = (int) p1->arm; -++ iocache.s[1].size = p1->numbytes; -++ iocache.s[2].handle = p2->vcsm_handle; -++ iocache.s[2].cmd = 3; // clean+invalidate -++ iocache.s[2].addr = (int) p2->arm; -++ iocache.s[2].size = p2->numbytes; -++ vcsm_clean_invalid( &iocache ); -++#else -++ void *tmp; -++ tmp = vcsm_lock(p0->vcsm_handle); -++ vcsm_unlock_ptr(tmp); -++ tmp = vcsm_lock(p1->vcsm_handle); -++ vcsm_unlock_ptr(tmp); -++ tmp = vcsm_lock(p2->vcsm_handle); -++ vcsm_unlock_ptr(tmp); -++#endif -++} -++ -+ static int gpu_malloc_cached_internal(int numbytes, GPU_MEM_PTR_T *p) { -+ p->numbytes = numbytes; -+ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST, (char *)"Video Frame" ); -+@@ -357,9 +387,19 @@ unsigned int vpu_get_constants(void) { -+ #ifdef RPI_ASYNC -+ -+ static void *vpu_start(void *arg) { -++#ifdef RPI_TIME_TOTAL_POSTED -++ int last_time=0; -++ long long on_time=0; -++ long long off_time=0; -++ int start_time; -++ int end_time; -++ int count=0; -++#endif -+ while(1) { -++ int i; -+ int *p; -+ int qpu_code; -++ int qpu_codeb; -+ pthread_mutex_lock(&post_mutex); -+ while( vpu_async_tail - vpu_async_head <= 0) -+ { -+@@ -373,24 +413,49 @@ static void *vpu_start(void *arg) { -+ break; // Last job -+ } -+ qpu_code = p[7]; -++ qpu_codeb = p[16]; -+ //if (p[7]) { -+ //GPU_MEM_PTR_T *buf = (GPU_MEM_PTR_T *)p[7]; -+ //gpu_cache_flush(buf); -+ //} -++ -++#ifdef RPI_TIME_TOTAL_POSTED -++ start_time = Microseconds(); -++ if (last_time==0) -++ last_time = start_time; -++ off_time += start_time-last_time; -++#endif -++ -+ if (!qpu_code) { -+ vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -+ } else { -+- int i; -+ for(i=0;i<8;i++) { -+ gpu->mail[i*2] = p[8+i]; -+ gpu->mail[i*2 + 1] = qpu_code; -+ } -+- -+- execute_multi(gpu->mb,8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -+- 0, 0, 0, 0, -++ for(i=0;i<12;i++) { -++ gpu->mail2[i*2] = p[17+i]; -++ gpu->mail2[i*2 + 1] = qpu_codeb; -++ } -++#if (0) -++ vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -++ execute_qpu(gpu->mb,8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */); -++#else -++ execute_multi(gpu->mb, -++ 12,gpu->vc + offsetof(struct GPU, mail2), 1, 5000, -++ 8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -+ 0, 0 , 0 , 0 , 0 , 0 , 0); // VPU1 -++#endif -+ } -++#ifdef RPI_TIME_TOTAL_POSTED -++ end_time = Microseconds(); -++ last_time = end_time; -++ on_time += end_time - start_time; -++ count++; -++ if ((count&0x7f)==0) -++ printf("Posted %d On=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(off_time/1000)); -++#endif -+ pthread_mutex_lock(&post_mutex); -+ vpu_async_head++; -+ pthread_cond_broadcast(&post_cond_head); -+@@ -436,7 +501,9 @@ int vpu_post_code(unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned -+ } -+ -+ int vpu_qpu_post_code(unsigned vpu_code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, -+- int qpu_code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8) -++ int qpu_code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, -++ int qpu_codeb, int unifs1b, int unifs2b, int unifs3b, int unifs4b, int unifs5b, int unifs6b, int unifs7b, int unifs8b, int unifs9b, int unifs10b, int unifs11b, int unifs12b -++ ) -+ { -+ -+ pthread_mutex_lock(&post_mutex); -+@@ -464,6 +531,21 @@ int vpu_qpu_post_code(unsigned vpu_code, unsigned r0, unsigned r1, unsigned r2, -+ p[13] = unifs6; -+ p[14] = unifs7; -+ p[15] = unifs8; -++ -++ p[16] = qpu_codeb; -++ p[17] = unifs1b; -++ p[18] = unifs2b; -++ p[19] = unifs3b; -++ p[20] = unifs4b; -++ p[21] = unifs5b; -++ p[22] = unifs6b; -++ p[23] = unifs7b; -++ p[24] = unifs8b; -++ p[25] = unifs9b; -++ p[26] = unifs10b; -++ p[27] = unifs11b; -++ p[28] = unifs12b; -++ -+ if (num<=1) -+ pthread_cond_broadcast(&post_cond_tail); // Otherwise the vpu thread must already be awake -+ pthread_mutex_unlock(&post_mutex); -+@@ -544,27 +626,27 @@ void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int un -+ off_time += start_time-last_time; -+ #endif -+ for(i=0;imail[i*2 + 1] = code; -++ gpu->mail2[i*2 + 1] = code; -+ } -+ for(;imail[i*2 + 1] = code2; -++ gpu->mail2[i*2 + 1] = code2; -+ } -+- gpu->mail[0 ] = unifs1; -+- gpu->mail[2 ] = unifs2; -+- gpu->mail[4 ] = unifs3; -+- gpu->mail[6 ] = unifs4; -+- gpu->mail[8 ] = unifs5; -+- gpu->mail[10] = unifs6; -+- gpu->mail[12] = unifs7; -+- gpu->mail[14] = unifs8; -+- gpu->mail[16] = unifs9; -+- gpu->mail[18] = unifs10; -+- gpu->mail[20] = unifs11; -+- gpu->mail[22] = unifs12; -++ gpu->mail2[0 ] = unifs1; -++ gpu->mail2[2 ] = unifs2; -++ gpu->mail2[4 ] = unifs3; -++ gpu->mail2[6 ] = unifs4; -++ gpu->mail2[8 ] = unifs5; -++ gpu->mail2[10] = unifs6; -++ gpu->mail2[12] = unifs7; -++ gpu->mail2[14] = unifs8; -++ gpu->mail2[16] = unifs9; -++ gpu->mail2[18] = unifs10; -++ gpu->mail2[20] = unifs11; -++ gpu->mail2[22] = unifs12; -+ execute_qpu( -+ gpu->mb, -+ 12 /* Number of QPUs */, -+- gpu->vc + offsetof(struct GPU, mail), -++ gpu->vc + offsetof(struct GPU, mail2), -+ 1 /* no flush */, // Don't flush VPU L1 cache -+ 5000 /* timeout ms */); -+ #ifdef RPI_TIME_TOTAL_QPU -+@@ -635,21 +717,21 @@ unsigned int qpu_get_fn(int num) { -+ gpu_unlock(); -+ } -+ switch(num) { -+- //case QPU_MC_SETUP: -+- // fn = mc_setup; -+- // break; -+- //case QPU_MC_FILTER: -+- // fn = mc_filter; -+- // break; -++ case QPU_MC_SETUP: -++ fn = mc_setup; -++ break; -++ case QPU_MC_FILTER: -++ fn = mc_filter; -++ break; -+ case QPU_MC_EXIT: -+ fn = mc_exit; -+ break; -+- //case QPU_MC_INTERRUPT_EXIT: -+- // fn = mc_interrupt_exit; -+- // break; -+- //case QPU_MC_FILTER_B: -+- // fn = mc_filter_b; -+- // break; -++ case QPU_MC_INTERRUPT_EXIT12: -++ fn = mc_interrupt_exit12; -++ break; -++ case QPU_MC_FILTER_B: -++ fn = mc_filter_b; -++ break; -+ //case QPU_MC_FILTER_HONLY: -+ // fn = mc_filter_honly; -+ // break; -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 0565a60..81c2bb1 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -1,6 +1,7 @@ -+ #ifndef RPI_QPU_H -+ #define RPI_QPU_H -+ -++// Define RPI_FAST_CACHEFLUSH to use the VCSM cache flush code -+ #define RPI_FAST_CACHEFLUSH -+ -+ typedef struct gpu_mem_ptr_s { -+@@ -16,6 +17,7 @@ extern int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p); -+ extern int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p); -+ extern void gpu_free(GPU_MEM_PTR_T *p); -+ extern void gpu_cache_flush(GPU_MEM_PTR_T *p); -++extern void gpu_cache_flush3(GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2); -+ -+ // QPU specific functions -+ extern void qpu_run_shader8(int code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8); -+@@ -26,7 +28,7 @@ enum { -+ QPU_MC_SETUP, -+ QPU_MC_FILTER, -+ QPU_MC_EXIT, -+- QPU_MC_INTERRUPT_EXIT, -++ QPU_MC_INTERRUPT_EXIT12, -+ QPU_MC_FILTER_B, -+ QPU_MC_FILTER_HONLY, -+ QPU_MC_SETUP_UV, -+@@ -44,7 +46,9 @@ extern unsigned int vpu_get_constants(void); -+ extern unsigned vpu_execute_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5); -+ extern int vpu_post_code( unsigned code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, GPU_MEM_PTR_T *buf); -+ int vpu_qpu_post_code(unsigned vpu_code, unsigned r0, unsigned r1, unsigned r2, unsigned r3, unsigned r4, unsigned r5, -+- int qpu_code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8); -++ int qpu_code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, -++ int qpu_codeb, int unifs1b, int unifs2b, int unifs3b, int unifs4b, int unifs5b, int unifs6b, int unifs7b, int unifs8b, int unifs9b, int unifs10b, int unifs11b, int unifs12b -++ ); -+ extern void vpu_wait( int id); -+ -+ // Simple test of shader code -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index a0f0282..e86eb30 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -48,693 +48,674 @@ unsigned int rpi_shader[] = { -+ /* [0x000000b8] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+ /* [0x000000c0] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+ /* [0x000000c8] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x000000d0] */ 0x15827d80, 0x100208e7, // mov r3, unif -+-/* [0x000000d8] */ 0x119c17c0, 0xd00208a7, // shl r2, r3, 1 -+-/* [0x000000e0] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x000000e8] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x000000f0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x000000f8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000100] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000108] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000110] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000118] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00000120] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00000128] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000130] */ 0x119c17c0, 0xd00208a7, // shl r2, r3, 1 -+-/* [0x00000138] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -+-/* [0x00000140] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000148] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000150] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000158] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000160] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000168] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000170] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000178] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000180] */ 0x0f9c11c0, 0xd0020827, // asr r0, r0, 1 -+-/* [0x00000188] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -+-/* [0x00000190] */ 0x0c9e7040, 0x10021567, // add rb21, r0, r1 -+-/* [0x00000198] */ 0x15427d80, 0x10020827, // mov r0, ra_x -+-/* [0x000001a0] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -+-/* [0x000001a8] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_frame_base -+-/* [0x000001b0] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -+-/* [0x000001b8] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x000001c0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000001c8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000001d0] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x, r0 -++/* [0x000000d0] */ 0x15427d80, 0x10020827, // mov r0, ra_x -++/* [0x000000d8] */ 0x937401f6, 0xd0024821, // max r0, r0, 0; mov r1, ra_y -++/* [0x000000e0] */ 0x926191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, ra_frame_base -++/* [0x000000e8] */ 0x916431f6, 0xd00244e2, // shl ra_xshift_next, r0, 3 ; mov r2, ra_u2v_ref_offset -++/* [0x000000f0] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x000000f8] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000100] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000108] */ 0x939c03c0, 0xd0025850, // max r1, r1, 0 ; mov ra_x, r0 -++/* [0x00000110] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000118] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -++/* [0x00000120] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_frame_base, r2 -++/* [0x00000128] */ 0x0c9e7440, 0x10020f27, // add t1s, r2, r1 -++/* [0x00000130] */ 0x00000008, 0xe00208a7, // mov r2,8 -++/* [0x00000138] */ 0x11827c80, 0x10021327, // shl rb12,unif, r2 -++/* [0x00000140] */ 0x0c827c80, 0x10021367, // add rb13,unif,r2 -++/* [0x00000148] */ 0x15827d80, 0x100208a7, // mov r2, unif -++/* [0x00000150] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -++/* [0x00000158] */ 0x149cf5c0, 0xd00208a7, // and r2, r2, 15 -++/* [0x00000160] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000168] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000170] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000178] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000180] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000188] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000190] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000198] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x000001a0] */ 0x0f9c11c0, 0xd00208a7, // asr r2, r0, 1 -++/* [0x000001a8] */ 0x00002900, 0xe0020867, // mov r1, vpm_setup(0, 2, h16p(0, 0)) -++/* [0x000001b0] */ 0x0c9e7440, 0x10021567, // add rb21, r2, r1 -++/* [0x000001b8] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x000001c0] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x000001c8] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x000001d0] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+ /* [0x000001d8] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x000001e0] */ 0x4c9d040f, 0x100248a1, // add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+-/* [0x000001e8] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_frame_base, r2 -+-/* [0x000001f0] */ 0x0c9e7440, 0x10020e27, // add t0s, r2, r1 -+-/* [0x000001f8] */ 0x15827d80, 0x10021327, // mov rb12,unif -+-/* [0x00000200] */ 0x15827d80, 0x10021367, // mov rb13,unif -+-/* [0x00000208] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000210] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000218] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000220] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000228] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000230] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x -+-/* [0x00000238] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -++/* [0x000001e0] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x000001e8] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000001f0] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x000001f8] */ 0x0c427380, 0x10020e27, // add t0s, r1, ra_x -++/* [0x00000200] */ 0x0c627380, 0x10020f27, // add t1s, r1, ra_frame_base -+ // ::mc_filter_uv -+-/* [0x00000240] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000248] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000250] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000258] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000260] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000268] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000270] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000278] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000280] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -+-/* [0x00000288] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000290] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -+-/* [0x00000298] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000002a0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000002a8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000002b0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000002b8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000002c0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000002c8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000002d0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000002d8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000002e0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000002e8] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000002f0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000002f8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000300] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000308] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000310] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000318] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000320] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000328] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000330] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000338] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000340] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000348] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000350] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00000358] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000360] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00000368] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000370] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -+-/* [0x00000378] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000380] */ 0x0f9e7080, 0x100613a7, // asr.ifnz rb14, r0, r2 -+-/* [0x00000388] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000390] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000208] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000210] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000218] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000220] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000228] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000230] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000238] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000240] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000248] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000250] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000258] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x00000260] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000268] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000270] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000278] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000280] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000288] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000290] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000298] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000002a0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000002a8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x000002b0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x000002b8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x000002c0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000002c8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000002d0] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000002d8] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000002e0] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000002e8] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000002f0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000002f8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000300] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000308] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000310] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000318] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -++/* [0x00000320] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000328] */ 0x0f9e7080, 0x100208e7, // asr r3, r0, r2 -++/* [0x00000330] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000338] */ 0x0f9e7080, 0x100613e7, // asr.ifnz rb15, r0, r2 -++/* [0x00000340] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000348] */ 0x0f9e7080, 0x100608e7, // asr.ifnz r3, r0, r2 -++/* [0x00000350] */ 0x119c87c0, 0xd00213a7, // shl rb14,r3,8 -++/* [0x00000358] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop -+-/* [0x00000398] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000003a0] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -+-/* [0x000003a8] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x000003b0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x000003b8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x000003c0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x000003c8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000003d0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000003d8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-/* [0x000003e0] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -+-/* [0x000003e8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000003f0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000003f8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000400] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000408] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000410] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000418] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000420] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000428] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000430] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000438] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000440] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x00000448] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000450] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000458] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000460] */ 0x00000020, 0xe0021327, // mov rb12,32 -+-/* [0x00000468] */ 0x00000006, 0xe0021367, // mov rb13,6 -+-/* [0x00000470] */ 0x00000001, 0xe00213a7, // mov rb14,1 -+-/* [0x00000478] */ 0x00000000, 0xe00213e7, // mov rb15,0 -+-/* [0x00000480] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000488] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000490] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000498] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000004a0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000004a8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000004b0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000004b8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -+-/* [0x000004c0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -+-/* [0x000004c8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -+-/* [0x000004d0] */ 0xfffffea8, 0xf06809e7, // brr.anyn -, r:uvloop -+-/* [0x000004d8] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -+-/* [0x000004e0] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x000004e8] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x000004f0] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x000004f8] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000500] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000508] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000510] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000518] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000520] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000528] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000530] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000360] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000368] */ 0x8e4539bf, 0xb0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu1 -++/* [0x00000370] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000378] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000380] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000388] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000390] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000398] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000003a0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x000003a8] */ 0x0c627c80, 0x10020f27, // add t1s, ra_frame_base, r2 -++/* [0x000003b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000003b8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000003c0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000003c8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000003d0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000003d8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000003e0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x000003e8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x000003f0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000003f8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000400] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000408] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000410] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000418] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000420] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000428] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000430] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000438] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000440] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000448] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000450] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000458] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000460] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x00000468] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x00000470] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x00000478] */ 0xfffffec8, 0xf06809e7, // brr.anyn -, r:uvloop -++/* [0x00000480] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x00000488] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00000490] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00000498] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000004a0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004a8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000004b0] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000004b8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000004c0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000004c8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000004d0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000004d8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_uv_b0 -+-/* [0x00000538] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000540] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00000548] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000550] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000558] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x00000560] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000568] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x00000570] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x00000578] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -+-/* [0x00000580] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000588] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -+-/* [0x00000590] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -+-/* [0x00000598] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000005a0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005a8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000005b0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000005b8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x000005c0] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x000005c8] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x000005d0] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x000005d8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x000005e0] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x000005e8] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x000005f0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000005f8] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000600] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000608] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000610] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000618] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000620] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000628] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000630] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x00000638] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000640] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000648] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x00000650] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000658] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x000004e0] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x000004e8] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x000004f0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x000004f8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000500] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000508] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000510] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000518] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000520] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000528] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000530] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x00000538] */ 0x159d5fc0, 0x10021c67, // mov vw_setup, rb21 -++/* [0x00000540] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x00000548] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000550] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x00000558] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000560] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000568] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x00000570] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x00000578] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000580] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000588] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000590] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000598] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005a0] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005a8] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005b0] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005b8] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x000005c0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005c8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005d0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x000005d8] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x000005e0] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005e8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000005f0] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x000005f8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000600] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b0 -+-/* [0x00000660] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000668] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -+-/* [0x00000670] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00000678] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000680] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000688] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000690] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000698] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x000006a0] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-/* [0x000006a8] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -+-/* [0x000006b0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000006b8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000006c0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000006c8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000006d0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000006d8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000006e0] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000006e8] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000006f0] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x000006f8] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000700] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000708] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000710] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000718] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00000720] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00000728] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00000730] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x00000738] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x00000740] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x00000748] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x00000750] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -+-/* [0x00000758] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -+-/* [0x00000760] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -+-/* [0x00000768] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000770] */ 0x009e7000, 0x100009e7, // nop -+-/* [0x00000778] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000780] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000788] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000790] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000608] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000610] */ 0x8e4539bf, 0xb0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu1 -++/* [0x00000618] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00000620] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00000628] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x00000630] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00000638] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00000640] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x00000648] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x00000650] */ 0x0c627c80, 0x10020f27, // add t1s, ra_frame_base, r2 -++/* [0x00000658] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000660] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x00000668] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x00000670] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x00000678] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000680] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000688] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000690] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000698] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x000006a0] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x000006a8] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x000006b0] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x000006b8] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x000006c0] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000006c8] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000006d0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000006d8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000006e0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000006e8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000006f0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000006f8] */ 0x0d9d27c0, 0x100229e7, // sub.setf -, r3, rb18 -++/* [0x00000700] */ 0xfffffee8, 0xf06809e7, // brr.anyn -, r:uvloop_b0 -++/* [0x00000708] */ 0x0f9c63c0, 0xd0020c27, // asr vpm, r1, 6 -++/* [0x00000710] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000718] */ 0x009e7000, 0x100009e7, // nop -++/* [0x00000720] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000728] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000730] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000738] */ 0x009e7000, 0x100009e7, // nop -+ // ::mc_filter_uv_b -+-/* [0x00000798] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x000007a0] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x000007a8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000007b0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x000007b8] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -+-/* [0x000007c0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x000007c8] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -+-/* [0x000007d0] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -+-/* [0x000007d8] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -+-/* [0x000007e0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x000007e8] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -+-/* [0x000007f0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000007f8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000800] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000808] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000810] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000818] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000820] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -+-/* [0x00000828] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -+-/* [0x00000830] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000838] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -+-/* [0x00000840] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -+-/* [0x00000848] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -+-/* [0x00000850] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000858] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000860] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000868] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -+-/* [0x00000870] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000878] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000880] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000888] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000890] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000898] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a0] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008a8] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000008b0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -+-/* [0x000008b8] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008c0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000008c8] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -+-/* [0x000008d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000008d8] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000740] */ 0x15827d80, 0x100207e7, // mov ra31, unif -++/* [0x00000748] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -++/* [0x00000750] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -++/* [0x00000758] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -++/* [0x00000760] */ 0x928191f6, 0x10024823, // min r0, r0, rb_frame_width_minus_1 ; mov r3, unif -++/* [0x00000768] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000770] */ 0x0d827cc0, 0x100208a7, // sub r2, unif, r3 -++/* [0x00000778] */ 0x0c9e70c0, 0x10020827, // add r0, r0, r3 -++/* [0x00000780] */ 0x149dc1c0, 0xd00214e7, // and rb_x_next, r0, ~3 -++/* [0x00000788] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000790] */ 0x0c9d3e80, 0x100206a7, // add ra_frame_base_next, rb_x_next, r2 -++/* [0x00000798] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x000007a0] */ 0x00000010, 0xe00208a7, // mov r2, 16 -++/* [0x000007a8] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x000007b0] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -++/* [0x000007b8] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x000007c0] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x000007c8] */ 0x0c9c11c0, 0xd0021467, // add rb17, r0, 1 -++/* [0x000007d0] */ 0x0c9c31c0, 0xd00214a7, // add rb18, r0, 3 -++/* [0x000007d8] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x000007e0] */ 0x119cd1c0, 0xd00208e7, // shl r3, r0, 13 -++/* [0x000007e8] */ 0x119c87c0, 0xd00208e7, // shl r3, r3, 8 -++/* [0x000007f0] */ 0x0e9c87c0, 0xd00208e7, // shr r3, r3, 8 -++/* [0x000007f8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000800] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -++/* [0x00000808] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000810] */ 0x0c9d57c0, 0x10020c67, // add vr_setup, r3, rb21 -++/* [0x00000818] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000820] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000828] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000830] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000838] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -++/* [0x00000840] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000848] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000850] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000858] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000860] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000868] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000870] */ 0xfffffff8, 0xe0021967, // mov r5rep, -8 -++/* [0x00000878] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x00000880] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :uvloop_b -+-/* [0x000008e0] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x000008e8] */ 0x8e4539bf, 0xa0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -+-/* [0x000008f0] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x000008f8] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000900] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -+-/* [0x00000908] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000910] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000918] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000920] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-/* [0x00000928] */ 0x0c627c80, 0x10020e27, // add t0s, ra_frame_base, r2 -+-/* [0x00000930] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000938] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000940] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000948] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000950] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000958] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000960] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000968] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000970] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00000978] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00000980] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -+-/* [0x00000988] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x00000990] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00000998] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x000009a0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x000009a8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x000009b0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000009b8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000009c0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000009c8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000009d0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000009d8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000009e0] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -+-/* [0x000009e8] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -+-/* [0x000009f0] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -+-/* [0x000009f8] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00000a00] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00000a08] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00000a10] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00000a18] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a20] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+-/* [0x00000a28] */ 0x00000010, 0xe0020827, // mov r0, 16 -+-/* [0x00000a30] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a38] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00000a40] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -+-/* [0x00000a48] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00000a50] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00000888] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00000890] */ 0x8e4539bf, 0xb0029810, // shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu1 -++/* [0x00000898] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x000008a0] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x000008a8] */ 0xee454987, 0x10024860, // shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 -++/* [0x000008b0] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x000008b8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000008c0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000008c8] */ 0xec414c8f, 0x10024e21, // add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -++/* [0x000008d0] */ 0x0c627c80, 0x10020f27, // add t1s, ra_frame_base, r2 -++/* [0x000008d8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000008e0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000008e8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000008f0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000008f8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x00000900] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00000908] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00000910] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00000918] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00000920] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00000928] */ 0x8d3447f6, 0xd00279cc, // sub.setf -, r3, 4 ; mov ra12, ra13 -++/* [0x00000930] */ 0xffffff38, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x00000938] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00000940] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00000948] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x00000950] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x00000958] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x00000960] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x00000968] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x00000970] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x00000978] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x00000980] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00000988] */ 0x0cc27380, 0x10020867, // add r1, r1, vpm -++/* [0x00000990] */ 0x0c7a7380, 0x10020867, // add r1, r1, ra30 -++/* [0x00000998] */ 0xfffffed0, 0xf06809e7, // brr.anyn -, r:uvloop_b -++/* [0x000009a0] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -++/* [0x000009a8] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x000009b0] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x000009b8] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x000009c0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009c8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x000009d0] */ 0x00000010, 0xe0020827, // mov r0, 16 -++/* [0x000009d8] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000009e0] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x000009e8] */ 0x0c9dae00, 0x10021c67, // add vw_setup, rb26, r0 -++/* [0x000009f0] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x000009f8] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_exit -+-/* [0x00000a58] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000a60] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -+-/* [0x00000a68] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a70] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a78] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a80] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000a88] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000a90] */ 0x009e7000, 0x100009e7, // nop ; nop -+-/* [0x00000a98] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a00] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a08] */ 0x00000000, 0xe80009e7, // mov -,srel(0) -++/* [0x00000a10] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a18] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00000a20] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a28] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00000a30] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000a38] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a40] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_interrupt_exit8 -+-/* [0x00000aa0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00000aa8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ab0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ab8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ac0] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00000ac8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ad0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ad8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ae0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000ae8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000af0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000af8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00000b00] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x00000b08] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x00000b10] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00000a48] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00000a50] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a58] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00000a60] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00000a68] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00000a70] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a78] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a80] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a88] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a90] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000a98] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000aa0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00000aa8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00000ab0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00000ab8] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_setup -+-/* [0x00000b18] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000b20] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00000b28] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000b30] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000b38] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000b40] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000b48] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -+-/* [0x00000b50] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000b58] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -+-/* [0x00000b60] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000b68] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000b70] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000b78] */ 0x8c9e7452, 0x10025e18, // add t0s, r2, r1 ; mov ra_frame_base, r2 -+-/* [0x00000b80] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000b88] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000b90] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000b98] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -+-/* [0x00000ba0] */ 0x0c9c13c0, 0xd0020567, // add ra_y2, r1, 1 -+-/* [0x00000ba8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000bb0] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -+-/* [0x00000bb8] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -+-/* [0x00000bc0] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000bc8] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000bd0] */ 0x8c9e7452, 0x10025e19, // add t0s, r2, r1 ; mov ra_frame_base2, r2 -+-/* [0x00000bd8] */ 0x0d801dc0, 0xd0021667, // sub rb25,unif,1 -+-/* [0x00000be0] */ 0x0d801dc0, 0xd00217a7, // sub rb30,unif,1 -+-/* [0x00000be8] */ 0x15827d80, 0x10021427, // mov rb16, unif -+-/* [0x00000bf0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000bf8] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -+-/* [0x00000c00] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -+-/* [0x00000c08] */ 0x00000001, 0xe0020527, // mov ra20, 1 -+-/* [0x00000c10] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -+-/* [0x00000c18] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -+-/* [0x00000c20] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -+-/* [0x00000c28] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -+-/* [0x00000c30] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -+-/* [0x00000c38] */ 0x00000000, 0xe0020227, // mov ra8, 0 -+-/* [0x00000c40] */ 0x00000000, 0xe0020267, // mov ra9, 0 -+-/* [0x00000c48] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -+-/* [0x00000c50] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -+-/* [0x00000c58] */ 0x00000000, 0xe0020327, // mov ra12, 0 -+-/* [0x00000c60] */ 0x00000000, 0xe0020367, // mov ra13, 0 -+-/* [0x00000c68] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -+-/* [0x00000c70] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -+-/* [0x00000c78] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000c80] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000c88] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000c90] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000c98] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000ca0] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000ca8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000cb0] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -+-/* [0x00000cb8] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -+-/* [0x00000cc0] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -+-/* [0x00000cc8] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -+-/* [0x00000cd0] */ 0x159e7480, 0x10020867, // mov r1, r2 -+-/* [0x00000cd8] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -+-/* [0x00000ce0] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -+-/* [0x00000ce8] */ 0x159e7480, 0x10020827, // mov r0, r2 -+-/* [0x00000cf0] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -+-/* [0x00000cf8] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000d00] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -+-/* [0x00000d08] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -+-/* [0x00000d10] */ 0x15827d80, 0x10021327, // mov rb12,unif -+-/* [0x00000d18] */ 0x15827d80, 0x10021367, // mov rb13,unif -+-/* [0x00000d20] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000d28] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -+-/* [0x00000d30] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000d38] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -+-/* [0x00000d40] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000d48] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -+-/* [0x00000d50] */ 0x13540dc0, 0xd0020867, // max r1, ra_y2, 0 -+-/* [0x00000d58] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+-/* [0x00000d60] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00000ac0] */ 0x00000010, 0xe00208e7, // mov r3, 16 -++/* [0x00000ac8] */ 0x15827d80, 0x10020227, // mov ra8, unif -++/* [0x00000ad0] */ 0x15827d80, 0x10020267, // mov ra9, unif -++/* [0x00000ad8] */ 0x15827d80, 0x100202a7, // mov ra10, unif -++/* [0x00000ae0] */ 0x15827d80, 0x100202e7, // mov ra11, unif -++/* [0x00000ae8] */ 0x15827d80, 0x10020867, // mov r1, unif -++/* [0x00000af0] */ 0x119e72c0, 0x10020827, // shl r0,r1,r3 -++/* [0x00000af8] */ 0x0f9e72c0, 0x10020867, // asr r1,r1,r3 -++/* [0x00000b00] */ 0x0f9e70c0, 0x10020827, // asr r0,r0,r3 -++/* [0x00000b08] */ 0x0d9c13c0, 0xd0021667, // sub rb_frame_width_minus_1,r1,1 -++/* [0x00000b10] */ 0x0d9c11c0, 0xd00217a7, // sub rb_frame_height_minus_1,r0,1 -++/* [0x00000b18] */ 0x15827d80, 0x10021427, // mov rb_pitch, unif -++/* [0x00000b20] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000b28] */ 0xc0000000, 0xe0020867, // mov r1, vdw_setup_1(0) -++/* [0x00000b30] */ 0x0c9e7200, 0x10021627, // add rb24, r1, r0 -++/* [0x00000b38] */ 0x15227d80, 0x10020867, // mov r1, ra8 -++/* [0x00000b40] */ 0x119e72c0, 0x10020827, // shl r0,r1,r3 -++/* [0x00000b48] */ 0x0f9e72c0, 0x10020867, // asr r1,r1,r3 -++/* [0x00000b50] */ 0x0f9e70c0, 0x10020827, // asr r0,r0,r3 -++/* [0x00000b58] */ 0x0c9a7180, 0x10020827, // add r0, r0, elem_num -++/* [0x00000b60] */ 0x139c01c0, 0xd0020827, // max r0, r0, 0 -++/* [0x00000b68] */ 0x922591f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, ra9 -++/* [0x00000b70] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000b78] */ 0x0c9c13c0, 0xd0020767, // add ra_y, r1, 1 -++/* [0x00000b80] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000b88] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -++/* [0x00000b90] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000b98] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000ba0] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000ba8] */ 0x8c9e7452, 0x10025e18, // add t0s, r2, r1 ; mov ra_frame_base, r2 -++/* [0x00000bb0] */ 0x152a7d80, 0x10020867, // mov r1, ra10 -++/* [0x00000bb8] */ 0x119e72c0, 0x10020827, // shl r0,r1,r3 -++/* [0x00000bc0] */ 0x0f9e72c0, 0x10020867, // asr r1,r1,r3 -++/* [0x00000bc8] */ 0x0f9e70c0, 0x10020827, // asr r0,r0,r3 -++/* [0x00000bd0] */ 0x0c9a7180, 0x10020827, // add r0, r0, elem_num -++/* [0x00000bd8] */ 0x139c01c0, 0xd0020827, // max r0, r0, 0 -++/* [0x00000be0] */ 0x922d91f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, ra11 -++/* [0x00000be8] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x00000bf0] */ 0x0c9c13c0, 0xd0020567, // add ra_y2, r1, 1 -++/* [0x00000bf8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000c00] */ 0x0c9e7400, 0x100208a7, // add r2, r2, r0 -++/* [0x00000c08] */ 0x139c03c0, 0xd0020867, // max r1, r1, 0 -++/* [0x00000c10] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000c18] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000c20] */ 0x8c9e7452, 0x10025f19, // add t1s, r2, r1 ; mov ra_frame_base2, r2 -++/* [0x00000c28] */ 0x00000001, 0xe0020527, // mov ra20, 1 -++/* [0x00000c30] */ 0x00000100, 0xe00205a7, // mov ra22, 256 -++/* [0x00000c38] */ 0x00000040, 0xe00207a7, // mov ra30, 64 -++/* [0x00000c40] */ 0xffffff00, 0xe0021527, // mov rb20, 0xffffff00 -++/* [0x00000c48] */ 0x000000ff, 0xe00215a7, // mov rb22, 255 -++/* [0x00000c50] */ 0x00000018, 0xe00215e7, // mov rb23, 24 -++/* [0x00000c58] */ 0x00000000, 0xe0020227, // mov ra8, 0 -++/* [0x00000c60] */ 0x00000000, 0xe0020267, // mov ra9, 0 -++/* [0x00000c68] */ 0x00000000, 0xe00202a7, // mov ra10, 0 -++/* [0x00000c70] */ 0x00000000, 0xe00202e7, // mov ra11, 0 -++/* [0x00000c78] */ 0x00000000, 0xe0020327, // mov ra12, 0 -++/* [0x00000c80] */ 0x00000000, 0xe0020367, // mov ra13, 0 -++/* [0x00000c88] */ 0x00000000, 0xe00203a7, // mov ra14, 0 -++/* [0x00000c90] */ 0x00000000, 0xe00203e7, // mov ra15, 0 -++/* [0x00000c98] */ 0x00004000, 0xe00204a7, // mov ra18, 0x4000 -++/* [0x00000ca0] */ 0x159e6fc0, 0x100208a7, // mov r2, qpu_num -++/* [0x00000ca8] */ 0x159e7480, 0x10020867, // mov r1, r2 -++/* [0x00000cb0] */ 0x0f9c23c0, 0xd0020867, // asr r1, r1, 2 -++/* [0x00000cb8] */ 0x119c63c0, 0xd0020867, // shl r1, r1, 6 -++/* [0x00000cc0] */ 0x159e7480, 0x10020827, // mov r0, r2 -++/* [0x00000cc8] */ 0x149c31c0, 0xd0020827, // and r0, r0, 3 -++/* [0x00000cd0] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000cd8] */ 0x00004800, 0xe0020867, // mov r1, vpm_setup(0, 4, h8p(0, 0)) -++/* [0x00000ce0] */ 0x0c9e7040, 0x10021727, // add rb28, r0, r1 -++/* [0x00000ce8] */ 0x80004004, 0xe0020867, // mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) -++/* [0x00000cf0] */ 0x119c51c0, 0xd0020827, // shl r0, r0, 5 -++/* [0x00000cf8] */ 0x0c9e7040, 0x100216e7, // add rb27, r0, r1 -++/* [0x00000d00] */ 0x15827d80, 0x10020867, // mov r1, unif -++/* [0x00000d08] */ 0x919c82ff, 0xd0024822, // shl r0,r1,r3 ; mov r2,8 -++/* [0x00000d10] */ 0x0f9e70c0, 0x10021367, // asr rb13,r0,r3 -++/* [0x00000d18] */ 0x0f9e72c0, 0x10021327, // asr rb12,r1,r3 -++/* [0x00000d20] */ 0x0c9cde80, 0x10021367, // add rb13,rb13,r2 -++/* [0x00000d28] */ 0x119cce80, 0x10021327, // shl rb12, rb12, r2 -++/* [0x00000d30] */ 0x13740dc0, 0xd0020867, // max r1, ra_y, 0 -++/* [0x00000d38] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -++/* [0x00000d40] */ 0x0c741dc0, 0xd0020767, // add ra_y, ra_y, 1 -++/* [0x00000d48] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -++/* [0x00000d50] */ 0x0c627380, 0x10020e27, // add t0s, r1, ra_frame_base -++/* [0x00000d58] */ 0x13540dc0, 0xd0020867, // max r1, ra_y2, 0 -++/* [0x00000d60] */ 0x129de3c0, 0x10020867, // min r1, r1, rb_frame_height_minus_1 -+ /* [0x00000d68] */ 0x0c541dc0, 0xd0020567, // add ra_y2, ra_y2, 1 -+ /* [0x00000d70] */ 0x409d000f, 0x100049e1, // nop ; mul24 r1, r1, rb_pitch -+-/* [0x00000d78] */ 0x0c667380, 0x10020e27, // add t0s, r1, ra_frame_base2 -+-// ::mc_filter -++/* [0x00000d78] */ 0x0c667380, 0x10020f27, // add t1s, r1, ra_frame_base2 -++// :per_block_setup -+ /* [0x00000d80] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ /* [0x00000d88] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+ /* [0x00000d90] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+ /* [0x00000d98] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -+-/* [0x00000da0] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000da8] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00000db0] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000db8] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00000dc0] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00000dc8] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000dd0] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -+-/* [0x00000dd8] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00000de0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -+-/* [0x00000de8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00000df0] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -+-/* [0x00000df8] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -+-/* [0x00000e00] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00000e08] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -+-/* [0x00000e10] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x00000e18] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x00000e20] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000e28] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x00000e30] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x00000e38] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00000e40] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00000e48] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00000e50] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00000e58] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00000e60] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000e68] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00000e70] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000e78] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000e80] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000e88] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000e90] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000e98] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00000ea0] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000ea8] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000eb0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000eb8] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ec0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x00000ec8] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000ed0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ed8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ee0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000ee8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x00000ef0] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000ef8] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f00] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00000f08] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000da0] */ 0x00000010, 0xe00208e7, // mov r3, 16 -++/* [0x00000da8] */ 0x15827d80, 0x10020867, // mov r1, unif -++/* [0x00000db0] */ 0x119e72c0, 0x10020827, // shl r0,r1,r3 -++/* [0x00000db8] */ 0x0f9e72c0, 0x10020867, // asr r1,r1,r3 -++/* [0x00000dc0] */ 0x0f9e70c0, 0x10020827, // asr r0,r0,r3 -++/* [0x00000dc8] */ 0x0c9a7180, 0x10020827, // add r0, r0, elem_num -++/* [0x00000dd0] */ 0x139c01c0, 0xd0020827, // max r0, r0, 0 -++/* [0x00000dd8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000de0] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -++/* [0x00000de8] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -++/* [0x00000df0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000df8] */ 0x8c827436, 0x100246a1, // add ra_frame_base_next, r2, r0 ; mov r1, unif -++/* [0x00000e00] */ 0x119e72c0, 0x10020827, // shl r0,r1,r3 -++/* [0x00000e08] */ 0x0f9e72c0, 0x10020867, // asr r1,r1,r3 -++/* [0x00000e10] */ 0x0f9e70c0, 0x10020827, // asr r0,r0,r3 -++/* [0x00000e18] */ 0x0c9a7180, 0x10020827, // add r0, r0, elem_num -++/* [0x00000e20] */ 0x139c01c0, 0xd0020827, // max r0, r0, 0 -++/* [0x00000e28] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -++/* [0x00000e30] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -++/* [0x00000e38] */ 0x159e7240, 0x10021067, // mov ra_y2_next, r1 -++/* [0x00000e40] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -++/* [0x00000e48] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -++/* [0x00000e50] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -++/* [0x00000e58] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00000e60] */ 0x0e9e70c0, 0x10020867, // shr r1, r0, r3 -++/* [0x00000e68] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -++/* [0x00000e70] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -++/* [0x00000e78] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -++/* [0x00000e80] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -++/* [0x00000e88] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -++/* [0x00000e90] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -++/* [0x00000e98] */ 0x119e70c0, 0x10020827, // shl r0, r0, r3 -++/* [0x00000ea0] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -++/* [0x00000ea8] */ 0x95801dbf, 0xd0024821, // mov r0, unif ; mov r1,1 -++/* [0x00000eb0] */ 0x4f5971c6, 0x10024260, // asr ra9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000eb8] */ 0x4f5971c6, 0x10024220, // asr ra8, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ec0] */ 0x4f5971c6, 0x10044260, // asr.ifz ra9, r0, rb23; mul24 r0, r0, ra22 -++/* [0x00000ec8] */ 0x0f9d71c0, 0x10040227, // asr.ifz ra8, r0, rb23 -++/* [0x00000ed0] */ 0x0d243f80, 0xd0020267, // sub ra9,3,ra9 -++/* [0x00000ed8] */ 0x0d203f80, 0xd0020227, // sub ra8,3,ra8 -++/* [0x00000ee0] */ 0x11243dc0, 0xd0020267, // shl ra9,ra9,3 -++/* [0x00000ee8] */ 0x11203dc0, 0xd0020227, // shl ra8,ra8,3 -++/* [0x00000ef0] */ 0x00ffff00, 0xe0020867, // mov r1,0xffff00 -++/* [0x00000ef8] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000f00] */ 0x0f9d71c0, 0x10020027, // asr ra0, r0, rb23 -++/* [0x00000f08] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -+ /* [0x00000f10] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -+-/* [0x00000f18] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00000f20] */ 0x15827d80, 0x100009e7, // mov.ifnz -, unif -+-/* [0x00000f28] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00000f30] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00000f38] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00000f40] */ 0x00000000, 0xe00208e7, // mov r3, 0 -++/* [0x00000f18] */ 0x01040400, 0xe0020867, // mov r1,0x1040400 -++/* [0x00000f20] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000f28] */ 0x0f9d71c0, 0x10020067, // asr ra1, r0, rb23 -++/* [0x00000f30] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00000f38] */ 0x0f9d71c0, 0x10021167, // asr rb5, r0, rb23 -++/* [0x00000f40] */ 0xfbf5f600, 0xe0020867, // mov r1,0xfbf5f600 -++/* [0x00000f48] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000f50] */ 0x0f9d71c0, 0x100200a7, // asr ra2, r0, rb23 -++/* [0x00000f58] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00000f60] */ 0x0f9d71c0, 0x100211a7, // asr rb6, r0, rb23 -++/* [0x00000f68] */ 0x11283a40, 0xe0020867, // mov r1,0x11283a40 -++/* [0x00000f70] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000f78] */ 0x0f9d71c0, 0x100200e7, // asr ra3, r0, rb23 -++/* [0x00000f80] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00000f88] */ 0x0f9d71c0, 0x100211e7, // asr rb7, r0, rb23 -++/* [0x00000f90] */ 0x3a281100, 0xe0020867, // mov r1,0x3a281100 -++/* [0x00000f98] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000fa0] */ 0x0f9d71c0, 0x10020127, // asr ra4, r0, rb23 -++/* [0x00000fa8] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00000fb0] */ 0x0f9d71c0, 0x10021227, // asr rb8, r0, rb23 -++/* [0x00000fb8] */ 0xf6f5fb00, 0xe0020867, // mov r1,0xf6f5fb00 -++/* [0x00000fc0] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000fc8] */ 0x0f9d71c0, 0x10020167, // asr ra5, r0, rb23 -++/* [0x00000fd0] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00000fd8] */ 0x0f9d71c0, 0x10021267, // asr rb9, r0, rb23 -++/* [0x00000fe0] */ 0x04040100, 0xe0020867, // mov r1,0x4040100 -++/* [0x00000fe8] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00000ff0] */ 0x0f9d71c0, 0x100201a7, // asr ra6, r0, rb23 -++/* [0x00000ff8] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00001000] */ 0x0f9d71c0, 0x100212a7, // asr rb10, r0, rb23 -++/* [0x00001008] */ 0xffff0000, 0xe0020867, // mov r1,0xffff0000 -++/* [0x00001010] */ 0x11227380, 0x10020827, // shl r0, r1, ra8 -++/* [0x00001018] */ 0x0f9d71c0, 0x100201e7, // asr ra7, r0, rb23 -++/* [0x00001020] */ 0x11267380, 0x10020827, // shl r0, r1, ra9 -++/* [0x00001028] */ 0x0f9d71c0, 0x100212e7, // asr rb11, r0, rb23 -++/* [0x00001030] */ 0x15827d80, 0x10020827, // mov r0, unif -++/* [0x00001038] */ 0x0f9e70c0, 0x100213e7, // asr rb15, r0, r3 -++/* [0x00001040] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -++/* [0x00001048] */ 0x119e70c0, 0x10020827, // shl r0, r0, r3 -++/* [0x00001050] */ 0x8f9c00ff, 0xd0024823, // asr r0, r0, r3 ; mov r3, 0 -++/* [0x00001058] */ 0x119c81c0, 0xd00213a7, // shl rb14, r0, 8 -++// ::mc_filter -+ // :yloop -+-/* [0x00000f48] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00000f50] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -+-/* [0x00000f58] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00000f60] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00000f68] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -+-/* [0x00000f70] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -+-/* [0x00000f78] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00000f80] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000f88] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00000f90] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -+-/* [0x00000f98] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -+-/* [0x00000fa0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00000fa8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -+-/* [0x00000fb0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -+-/* [0x00000fb8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00000fc0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x00000fc8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x00000fd0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x00000fd8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x00000fe0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x00000fe8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x00000ff0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x00000ff8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00001000] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00001008] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00001010] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00001018] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00001020] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00001028] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00001030] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00001038] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00001040] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00001048] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -+-/* [0x00001050] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00001058] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00001060] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00001068] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00001070] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloop -+-/* [0x00001078] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00001080] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00001088] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00001090] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00001098] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000010a0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000010a8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000010b0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -+-/* [0x000010b8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -+-/* [0x000010c0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -+-/* [0x000010c8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -+-/* [0x000010d0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000010d8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000010e0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000010e8] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -+-/* [0x000010f0] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -+-/* [0x000010f8] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -+-/* [0x00001100] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloop -+-/* [0x00001108] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -+-/* [0x00001110] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00001118] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00001120] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001128] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00001130] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001138] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00001060] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00001068] */ 0x8e4539bf, 0xb0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu1 -++/* [0x00001070] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00001078] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00001080] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -++/* [0x00001088] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -++/* [0x00001090] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00001098] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000010a0] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000010a8] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -++/* [0x000010b0] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -++/* [0x000010b8] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000010c0] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++/* [0x000010c8] */ 0xec654c8f, 0x10024f21, // add t1s, ra_frame_base2, r2 ; v8subs r1, r1, rb20 -++/* [0x000010d0] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000010d8] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000010e0] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000010e8] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000010f0] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000010f8] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x00001100] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00001108] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00001110] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00001118] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00001120] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00001128] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00001130] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00001138] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001140] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001148] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001150] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001158] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00001160] */ 0x8d2487f6, 0xd00279c8, // sub.setf -, r3, 8 ; mov ra8, ra9 -++/* [0x00001168] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001170] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001178] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001180] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001188] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloop -++/* [0x00001190] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001198] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x000011a0] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000011a8] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000011b0] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000011b8] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000011c0] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000011c8] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -++/* [0x000011d0] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -++/* [0x000011d8] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -++/* [0x000011e0] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -++/* [0x000011e8] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000011f0] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000011f8] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -++/* [0x00001200] */ 0x409ce00f, 0x100049e1, // nop ; mul24 r1, r1, rb14 -++/* [0x00001208] */ 0x0c9cc3c0, 0x10020867, // add r1, r1, rb12 -++/* [0x00001210] */ 0x0f9cd3c0, 0x10020867, // asr r1, r1, rb13 -++/* [0x00001218] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloop -++/* [0x00001220] */ 0x0c9cf3c0, 0x10020867, // add r1, r1, rb15 -++/* [0x00001228] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00001230] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00001238] */ 0xfffffb28, 0xf0f809e7, // brr -, r:per_block_setup -++/* [0x00001240] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001248] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001250] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_filter_b -+-/* [0x00001140] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x00001148] */ 0x15827d80, 0x100207e7, // mov ra31, unif -+-/* [0x00001150] */ 0x154e7d80, 0x10020467, // mov ra_xshift, ra_xshift_next -+-/* [0x00001158] */ 0x155e7d80, 0x10021027, // mov rx_xshift2, rx_xshift2_next -+-/* [0x00001160] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x00001168] */ 0x938001f6, 0xd0024821, // max r0, r0, 0; mov r1, unif -+-/* [0x00001170] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x00001178] */ 0x119c31c0, 0xd00204e7, // shl ra_xshift_next, r0, 3 -+-/* [0x00001180] */ 0x159e7240, 0x10020727, // mov ra_y_next, r1 -+-/* [0x00001188] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x00001190] */ 0x0c9e7400, 0x100206a7, // add ra_frame_base_next, r2, r0 -+-/* [0x00001198] */ 0x0c9a0f80, 0x10020827, // add r0, unif, elem_num -+-/* [0x000011a0] */ 0x938001f6, 0xd0024821, // max r0, r0, 0 ; mov r1, unif -+-/* [0x000011a8] */ 0x928191f6, 0x10024822, // min r0, r0, rb_frame_width_minus_1 ; mov r2, unif -+-/* [0x000011b0] */ 0x119c31c0, 0xd00205e7, // shl rx_xshift2_next, r0, 3 -+-/* [0x000011b8] */ 0x0c9c13c0, 0xd0021067, // add ra_y2_next, r1, 1 -+-/* [0x000011c0] */ 0x149dc1c0, 0xd0020827, // and r0, r0, ~3 -+-/* [0x000011c8] */ 0x0c9e7400, 0x100214e7, // add rx_frame_base2_next, r2, r0 -+-/* [0x000011d0] */ 0x159dcfc0, 0x10021c67, // mov vw_setup, rb28 -+-/* [0x000011d8] */ 0x00000010, 0xe00208a7, // mov r2, 16 -+-/* [0x000011e0] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x000011e8] */ 0x0e9e7080, 0x10020867, // shr r1, r0, r2 -+-/* [0x000011f0] */ 0x0d9d8e40, 0x10021767, // sub rb29, rb24, r1 -+-/* [0x000011f8] */ 0x149d61c0, 0x10020827, // and r0, r0, rb22 -+-/* [0x00001200] */ 0x0c9c51c0, 0xd0021467, // add rb17, r0, 5 -+-/* [0x00001208] */ 0x0c9c71c0, 0xd00214a7, // add rb18, r0, 7 -+-/* [0x00001210] */ 0x119c71c0, 0xd0020827, // shl r0, r0, 7 -+-/* [0x00001218] */ 0x0c9e7040, 0x10020827, // add r0, r0, r1 -+-/* [0x00001220] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00001228] */ 0x0c9db1c0, 0x100216a7, // add rb26, r0, rb27 -+-/* [0x00001230] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001238] */ 0x00000001, 0xe0020867, // mov r1, 1 -+-/* [0x00001240] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001248] */ 0x409f3001, 0xd00049e0, // nop ; mul24 r0, r0 << 13, r1 << 13 -+-/* [0x00001250] */ 0x4f5971c6, 0x100240e0, // asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001258] */ 0x409f2001, 0xd00049e0, // nop ; mul24 r0, r0 << 14, r1 << 14 -+-/* [0x00001260] */ 0x4f5971c6, 0x100240a0, // asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001268] */ 0x409f1001, 0xd00049e0, // nop ; mul24 r0, r0 << 15, r1 << 15 -+-/* [0x00001270] */ 0x4f5971c6, 0x10024060, // asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001278] */ 0x8f8171f6, 0x10024020, // asr ra0, r0, rb23; mov r0, unif -+-/* [0x00001280] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001288] */ 0x409f7001, 0xd00049e0, // nop ; mul24 r0, r0 << 9, r1 << 9 -+-/* [0x00001290] */ 0x4f5971c6, 0x100241e0, // asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001298] */ 0x409f6001, 0xd00049e0, // nop ; mul24 r0, r0 << 10, r1 << 10 -+-/* [0x000012a0] */ 0x4f5971c6, 0x100241a0, // asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012a8] */ 0x409f5001, 0xd00049e0, // nop ; mul24 r0, r0 << 11, r1 << 11 -+-/* [0x000012b0] */ 0x4f5971c6, 0x10024160, // asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012b8] */ 0x409f4001, 0xd00049e0, // nop ; mul24 r0, r0 << 12, r1 << 12 -+-/* [0x000012c0] */ 0x8f8171f6, 0x10024120, // asr ra4, r0, rb23; mov r0, unif -+-/* [0x000012c8] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x000012d0] */ 0x4f5971c6, 0x100252e0, // asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012d8] */ 0x4f5971c6, 0x100252a0, // asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012e0] */ 0x4f5971c6, 0x10025260, // asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x000012e8] */ 0x8f8171f6, 0x10025220, // asr rb8, r0, rb23; mov r0, unif -+-/* [0x000012f0] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x000012f8] */ 0x4f5971c6, 0x100251e0, // asr rb7, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001300] */ 0x4f5971c6, 0x100251a0, // asr rb6, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001308] */ 0x4f5971c6, 0x10025160, // asr rb5, r0, rb23; mul24 r0, r0, ra22 -+-/* [0x00001310] */ 0x0f9d71c0, 0x10021127, // asr rb4, r0, rb23 -+-/* [0x00001318] */ 0x15827d80, 0x10020827, // mov r0, unif -+-/* [0x00001320] */ 0x15827d80, 0x10060827, // mov.ifnz r0, unif -+-/* [0x00001328] */ 0x0f9e7080, 0x100213e7, // asr rb15, r0, r2 -+-/* [0x00001330] */ 0x119e7080, 0x10020827, // shl r0, r0, r2 -+-/* [0x00001338] */ 0x0f9e7080, 0x100213a7, // asr rb14, r0, r2 -+-/* [0x00001340] */ 0x00000000, 0xe00208e7, // mov r3, 0 -+ // :yloopb -+-/* [0x00001348] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-/* [0x00001350] */ 0x8e4539bf, 0xa0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -+-/* [0x00001358] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-/* [0x00001360] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-/* [0x00001368] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -+-/* [0x00001370] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -+-/* [0x00001378] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -+-/* [0x00001380] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x00001388] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-/* [0x00001390] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -+-/* [0x00001398] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -+-/* [0x000013a0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -+-/* [0x000013a8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -+-/* [0x000013b0] */ 0xec654c87, 0x10024e20, // add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -+-/* [0x000013b8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-/* [0x000013c0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -+-/* [0x000013c8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-/* [0x000013d0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -+-/* [0x000013d8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-/* [0x000013e0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-/* [0x000013e8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-/* [0x000013f0] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-/* [0x000013f8] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-/* [0x00001400] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-/* [0x00001408] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-/* [0x00001410] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-/* [0x00001418] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-/* [0x00001420] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-/* [0x00001428] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-/* [0x00001430] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-/* [0x00001438] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-/* [0x00001440] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -+-/* [0x00001448] */ 0x8d3487f6, 0xd00279cc, // sub.setf -, r3, 8 ; mov ra12, ra13 -+-/* [0x00001450] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -+-/* [0x00001458] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -+-/* [0x00001460] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -+-/* [0x00001468] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -+-/* [0x00001470] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloopb -+-/* [0x00001478] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -+-/* [0x00001480] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -+-/* [0x00001488] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -+-/* [0x00001490] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -+-/* [0x00001498] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -+-/* [0x000014a0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-/* [0x000014a8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-/* [0x000014b0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -+-/* [0x000014b8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -+-/* [0x000014c0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -+-/* [0x000014c8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -+-/* [0x000014d0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -+-/* [0x000014d8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-/* [0x000014e0] */ 0x0f9ce3c0, 0xd0020867, // asr r1, r1, 14 -+-/* [0x000014e8] */ 0x4053800e, 0xd00049e1, // nop ; mul24 r1, r1 << 8, ra20 << 8 -+-/* [0x000014f0] */ 0x4c78e38f, 0x10024860, // add r1, r1, ra30 ; mul24 r0, r1, rb14 -+-/* [0x000014f8] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -+-/* [0x00001500] */ 0xfffffe28, 0xf06809e7, // brr.anyn -, r:yloopb -+-/* [0x00001508] */ 0x0f9c73c0, 0xd0020867, // asr r1, r1, 7 -+-/* [0x00001510] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -+-/* [0x00001518] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -+-/* [0x00001520] */ 0x00000000, 0xf0f7e9e7, // bra -, ra31 -+-/* [0x00001528] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -+-/* [0x00001530] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -+-/* [0x00001538] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -++/* [0x00001258] */ 0xcd5117de, 0xa00269e3, // sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++/* [0x00001260] */ 0x8e4539bf, 0xb0029819, // shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu1 -++/* [0x00001268] */ 0x956a7d9b, 0x1004461f, // mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++/* [0x00001270] */ 0x95710dbf, 0x10044763, // mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++/* [0x00001278] */ 0x0e9c09c0, 0x10020867, // shr r1, r4, rx_xshift2 -++/* [0x00001280] */ 0x159c1fc0, 0x10040567, // mov.ifz ra_y2, ra_y2_next -++/* [0x00001288] */ 0x13740dc0, 0xd00208a7, // max r2, ra_y, 0 -++/* [0x00001290] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x00001298] */ 0x4c741dd3, 0xd0024762, // add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++/* [0x000012a0] */ 0xec614c87, 0x10024e20, // add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 -++/* [0x000012a8] */ 0x13540dc0, 0xd00208a7, // max r2, ra_y2, 0 -++/* [0x000012b0] */ 0x129de5c0, 0x100208a7, // min r2, r2, rb_frame_height_minus_1 -++/* [0x000012b8] */ 0x4c541dd3, 0xd0024562, // add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++/* [0x000012c0] */ 0xec654c8f, 0x10024f21, // add t1s, ra_frame_base2, r2 ; v8subs r1, r1, rb20 -++/* [0x000012c8] */ 0x0000ff00, 0xe20229e7, // mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++/* [0x000012d0] */ 0x40027006, 0x100049e2, // nop ; mul24 r2, r0, ra0 -++/* [0x000012d8] */ 0x40038031, 0xd000c9e2, // nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++/* [0x000012e0] */ 0x4007f030, 0xd00049e3, // nop ; mul24 r3, ra1 << 1, r0 << 1 -++/* [0x000012e8] */ 0x40077031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++/* [0x000012f0] */ 0x4c0be4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++/* [0x000012f8] */ 0x400b6031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++/* [0x00001300] */ 0x4c0fd4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++/* [0x00001308] */ 0x400f5031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++/* [0x00001310] */ 0x4c13c4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++/* [0x00001318] */ 0x40134031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++/* [0x00001320] */ 0x4c17b4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++/* [0x00001328] */ 0x40173031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++/* [0x00001330] */ 0x4c1ba4f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++/* [0x00001338] */ 0x401b2031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++/* [0x00001340] */ 0x4c1f94f0, 0xd00248a3, // add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++/* [0x00001348] */ 0x401f1031, 0xd000c9e3, // nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++/* [0x00001350] */ 0x8c9df4ff, 0x10024823, // add r0, r2, r3 ; mov r3, rb31 -++/* [0x00001358] */ 0x8d2487f6, 0xd00279c8, // sub.setf -, r3, 8 ; mov ra8, ra9 -++/* [0x00001360] */ 0x152a7d80, 0x10020267, // mov ra9, ra10 -++/* [0x00001368] */ 0x152e7d80, 0x100202a7, // mov ra10, ra11 -++/* [0x00001370] */ 0x15327d80, 0x100202e7, // mov ra11, ra12 -++/* [0x00001378] */ 0x15367d80, 0x10020327, // mov ra12, ra13 -++/* [0x00001380] */ 0xfffffeb8, 0xf06809e7, // brr.anyn -, r:yloopb -++/* [0x00001388] */ 0x153a7d80, 0x10020367, // mov ra13, ra14 -++/* [0x00001390] */ 0x153e7d80, 0x100203a7, // mov ra14, ra15 -++/* [0x00001398] */ 0x159e7000, 0x100203e7, // mov ra15, r0 -++/* [0x000013a0] */ 0x4038a037, 0x100049e1, // nop ; mul24 r1, ra14, rb10 -++/* [0x000013a8] */ 0x40349037, 0x100049e0, // nop ; mul24 r0, ra13, rb9 -++/* [0x000013b0] */ 0x4c308237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra12, rb8 -++/* [0x000013b8] */ 0x4c3cb237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra15, rb11 -++/* [0x000013c0] */ 0x4c204237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra8, rb4 -++/* [0x000013c8] */ 0x4c245237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra9, rb5 -++/* [0x000013d0] */ 0x4c286237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra10, rb6 -++/* [0x000013d8] */ 0x4c2c7237, 0x10024860, // add r1, r1, r0 ; mul24 r0, ra11, rb7 -++/* [0x000013e0] */ 0x8c9f223f, 0x10020867, // add r1, r1, r0 ; mov -, vw_wait -++/* [0x000013e8] */ 0x4d5927ce, 0x100269e1, // sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++/* [0x000013f0] */ 0x0f9ce3c0, 0xd0020827, // asr r0, r1, 14 -++/* [0x000013f8] */ 0x0f9c63c0, 0xd0020867, // asr r1, r1, 6 -++/* [0x00001400] */ 0x405b8006, 0xd00049e0, // nop ; mul24 r0, r0 << 8, ra22 << 8 -++/* [0x00001408] */ 0x0c4a7380, 0x10020867, // add r1, r1, ra18 -++/* [0x00001410] */ 0x0c9e7200, 0x10020867, // add r1, r1, r0 -++/* [0x00001418] */ 0xfffffe20, 0xf06809e7, // brr.anyn -, r:yloopb -++/* [0x00001420] */ 0x0f9cf3c0, 0xd0020867, // asr r1, r1, 15 -++/* [0x00001428] */ 0x129d63c0, 0x10020867, // min r1, r1, rb22 -++/* [0x00001430] */ 0x139c03c0, 0xd0020c27, // max vpm, r1, 0 -++/* [0x00001438] */ 0xfffff928, 0xf0f809e7, // brr -, r:per_block_setup -++/* [0x00001440] */ 0x159dafc0, 0x10021c67, // mov vw_setup, rb26 -++/* [0x00001448] */ 0x159ddfc0, 0x10021c67, // mov vw_setup, rb29 -++/* [0x00001450] */ 0x15827d80, 0x10021ca7, // mov vw_addr, unif -+ // ::mc_interrupt_exit12 -+-/* [0x00001540] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -+-/* [0x00001548] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001550] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001558] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001560] */ 0x009e7000, 0xa00009e7, // ldtmu0 -+-/* [0x00001568] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001570] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001578] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001580] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001588] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001590] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x00001598] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015a0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -+-/* [0x000015c0] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -+-/* [0x000015c8] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -+-/* [0x000015d0] */ 0x009e7000, 0x100009e7, // nop ; nop -++/* [0x00001458] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x00001460] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001468] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001470] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00001478] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00001480] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001488] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001490] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x00001498] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014a0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014a8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014b0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014b8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014c0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014c8] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014d0] */ 0x00000010, 0xe80009e7, // mov -,sacq(0) -++/* [0x000014d8] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x000014e0] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x000014e8] */ 0x009e7000, 0x100009e7, // nop ; nop -++// ::mc_exit1 -++/* [0x000014f0] */ 0x159f2fc0, 0x100009e7, // mov -, vw_wait -++/* [0x000014f8] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001500] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00001508] */ 0x009e7000, 0xa00009e7, // ldtmu0 -++/* [0x00001510] */ 0x009e7000, 0xb00009e7, // ldtmu1 -++/* [0x00001518] */ 0x009e7000, 0x300009e7, // nop ; nop ; thrend -++/* [0x00001520] */ 0x00000001, 0xe00209a7, // mov interrupt, 1; nop -++/* [0x00001528] */ 0x009e7000, 0x100009e7, // nop ; nop -+ // ::mc_end -+ }; -+ #ifdef __HIGHC__ -+diff --git a/libavcodec/rpi_shader.h b/libavcodec/rpi_shader.h -+index 6e552d9..760bd17 100644 -+--- a/libavcodec/rpi_shader.h -++++ b/libavcodec/rpi_shader.h -+@@ -4,15 +4,16 @@ -+ extern unsigned int rpi_shader[]; -+ -+ #define mc_setup_uv (rpi_shader + 0) -+-#define mc_filter_uv (rpi_shader + 144) -+-#define mc_filter_uv_b0 (rpi_shader + 334) -+-#define mc_filter_uv_b (rpi_shader + 486) -+-#define mc_exit (rpi_shader + 662) -+-#define mc_interrupt_exit8 (rpi_shader + 680) -+-#define mc_setup (rpi_shader + 710) -+-#define mc_filter (rpi_shader + 864) -+-#define mc_filter_b (rpi_shader + 1104) -+-#define mc_interrupt_exit12 (rpi_shader + 1360) -+-#define mc_end (rpi_shader + 1398) -++#define mc_filter_uv (rpi_shader + 130) -++#define mc_filter_uv_b0 (rpi_shader + 312) -++#define mc_filter_uv_b (rpi_shader + 464) -++#define mc_exit (rpi_shader + 640) -++#define mc_interrupt_exit8 (rpi_shader + 658) -++#define mc_setup (rpi_shader + 688) -++#define mc_filter (rpi_shader + 1048) -++#define mc_filter_b (rpi_shader + 1174) -++#define mc_interrupt_exit12 (rpi_shader + 1302) -++#define mc_exit1 (rpi_shader + 1340) -++#define mc_end (rpi_shader + 1356) -+ -+ #endif -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index a0b8e5a..60d1ec2 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -21,6 +21,7 @@ -+ # -+ # ra16 clipped(row start address+elem_num)&~3 -+ # ra17 per-channel shifts -++# ra18 0x4000 -+ # ra19 next ra17 -+ # -+ # rb16 pitch -+@@ -86,7 +87,7 @@ -+ -+ -+ ################################################################################ -+-# mc_setup_uv(next_kernel, x, y, ref_u_base, ref_v_base, frame_width, frame_height, pitch, dst_pitch, pad0, pad1, pad2) -++# mc_setup_uv(next_kernel, x, y, ref_u_base, ref_v_base, frame_width, frame_height, pitch, dst_pitch, offset, denom, vpm_id) -+ ::mc_setup_uv -+ -+ # Read starting kernel -+@@ -132,36 +133,6 @@ mov ra13, 0 -+ mov ra14, 0 -+ mov ra15, 0 -+ -+-# Compute part of VPM to use for DMA output -+-mov r3, unif -+-shl r2, r3, 1 # Convert QPU numbers to be even (this means we can only use 8 QPUs, but is necessary as we need to save 16bit intermediate results) -+-and r2, r2, 15 -+-mov r1, r2 -+-asr r1, r1, 2 -+-shl r1, r1, 6 -+-mov r0, r2 -+-and r0, r0, 3 -+-add r0, r0, r1 -+-mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -+-shl r0, r0, 5 -+-add rb27, r0, r1 -+- -+-# Compute part of VPM to save data into -+-shl r2, r3, 1 -+-and r2, r2, 15 # r2 = bcd0 -+-mov r1, r2 # r1 = bcd0 -+-asr r1, r1, 2 # r1 = bc -+-shl r1, r1, 6 # r1 = bc000000 -+-mov r0, r2 # r0 = bcd0 -+-and r0, r0, 3 # r0 = d0 -+-add r0, r0, r1 # r0 = bc0000d0 -+-mov r1, vpm_setup(0, 4, h8p(0, 0)) # 4 is stride - stride acts on ADDR which is Y[5:0],B[1:0] for 8 bit -+-add rb28, r0, r1 -+-asr r0, r0, 1 # r0 = bc0000d -+-# Prepare VPM command for 16bit intermediates -+-mov r1, vpm_setup(0, 2, h16p(0, 0)) # 2 is stride - stride acts on ADDR which is Y[5:0],H[0] for 16 bit -+-add rb21, r0, r1 -+- -+ # Compute base address for first and second access -+ mov r0, ra_x # Load x -+ max r0, r0, 0; mov r1, ra_y # Load y -+@@ -175,10 +146,31 @@ min r1, r1, rb_frame_height_minus_1 -+ # submit texture requests for first line -+ add r2, r2, r0 ; mul24 r1, r1, rb_pitch -+ add t0s, r0, r1 ; mov ra_frame_base, r2 -+-add t0s, r2, r1 -++add t1s, r2, r1 -++ -++mov r2,8 -++shl rb12,unif, r2 # offset before shift -++add rb13,unif,r2 # offset after shift -++ -++# Compute part of VPM to use for DMA output -++mov r2, unif -++shl r2, r2, 1 # Convert QPU numbers to be even (this means we can only use 8 QPUs, but is necessary as we need to save 16bit intermediate results) -++and r2, r2, 15 -++mov r1, r2 -++asr r1, r1, 2 -++shl r1, r1, 6 -++mov r0, r2 -++and r0, r0, 3 -++add r0, r0, r1 -+ -+-mov rb12,unif # offset before shift -+-mov rb13,unif # offset after shift -++mov r1, vpm_setup(0, 4, h8p(0, 0)) # 4 is stride - stride acts on ADDR which is Y[5:0],B[1:0] for 8 bit -++add rb28, r0, r1 # VPM 8bit storage -++asr r2, r0, 1 # r0 = bc0000d -++mov r1, vpm_setup(0, 2, h16p(0, 0)) # 2 is stride - stride acts on ADDR which is Y[5:0],H[0] for 16 bit -++add rb21, r2, r1 # VPM for 16bit intermediates -++mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -++shl r0, r0, 5 -++add rb27, r0, r1 # DMA out -+ -+ # submit texture requests for second line -+ max r1, ra_y, 0 -+@@ -187,7 +179,7 @@ add ra_y, ra_y, 1 -+ bra -, ra31 -+ nop ; mul24 r1, r1, rb_pitch -+ add t0s, r1, ra_x -+-add t0s, r1, ra_frame_base -++add t1s, r1, ra_frame_base -+ -+ -+ -+@@ -248,17 +240,15 @@ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ mov r0, unif # U offset/weight -+ asr rb15, r0, r2 # Compute offset from MSBs -+ shl r0, r0, r2 -+-asr rb14, r0, r2 # Compute weight from LSBs -++asr r3, r0, r2 # Compute weight from LSBs -+ mov r0, unif # V offset/weight -+ asr.ifnz rb15, r0, r2 -+ shl r0, r0, r2 -+-asr.ifnz rb14, r0, r2 -++asr.ifnz r3, r0, r2 -++shl rb14,r3,8 # Scale up weights so we can use mul24 in signed fashion -+ -+ # r2 is elem_num -+ # r3 is loop counter -+- -+-mov r5rep, -8 -+- -+ # retrieve texture results and pick out bytes -+ # then submit two more texture requests -+ -+@@ -269,7 +259,7 @@ mov r3, 0 -+ # then submit two more texture requests -+ -+ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu1 -+ mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+ shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+@@ -278,7 +268,7 @@ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+ add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_frame_base, r2 -++add t1s, ra_frame_base, r2 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+@@ -301,11 +291,6 @@ mov ra13, ra14 # Delay slot 1 -+ mov ra14, ra15 # Delay slot 2 -+ mov ra15, r0 # Delay slot 3 -+ -+-mov rb12,32 # TODO remove these to make P weighted prediction work properly -+-mov rb13,6 -+-mov rb14,1 -+-mov rb15,0 -+- -+ # apply vertical filter and write to VPM -+ -+ nop ; mul24 r1, ra14, rb10 -+@@ -412,7 +397,7 @@ mov r3, 0 -+ # then submit two more texture requests -+ -+ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu1 -+ mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+ shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+@@ -421,7 +406,7 @@ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+ add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_frame_base, r2 -++add t1s, ra_frame_base, r2 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+@@ -542,7 +527,7 @@ mov r3, 0 -+ # then submit two more texture requests -+ -+ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 # loop counter increment -+-shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu0 -++shr r0, r4, ra_xshift ; mov.ifz ra_x, rb_x_next ; ldtmu1 -+ mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+ shr r1, r4, ra_xshift ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+@@ -551,7 +536,7 @@ max r2, ra_y, 0 # y -+ min r2, r2, rb_frame_height_minus_1 -+ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+ add t0s, ra_x, r2 ; v8subs r1, r1, rb20 -+-add t0s, ra_frame_base, r2 -++add t1s, ra_frame_base, r2 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+@@ -617,9 +602,9 @@ mov -, vw_wait # wait on the VDW -+ mov -,srel(0) -+ -+ ldtmu0 -++ldtmu1 -+ ldtmu0 -+-ldtmu0 -+-ldtmu0 -++ldtmu1 -+ -+ nop ; nop ; thrend -+ nop ; nop # delay slot 1 -+@@ -630,9 +615,9 @@ nop ; nop # delay slot 2 -+ mov -, vw_wait # wait on the VDW -+ -+ ldtmu0 -++ldtmu1 -+ ldtmu0 -+-ldtmu0 -+-ldtmu0 -++ldtmu1 -+ -+ mov -,sacq(0) # 1 -+ mov -,sacq(0) # 2 -+@@ -656,200 +641,249 @@ nop ; nop # delay slot 2 -+ # For P frames we make the second x,y coordinates offset by +8 -+ -+ ################################################################################ -+-# mc_setup(next_kernel, x, y, ref_y_base, x2, y2, ref_y2_base, frame_width, frame_height, pitch, dst_pitch, offset, shift, pad2) -++# mc_setup(y_x, ref_y_base, y2_x2, ref_y2_base, frame_width_height, pitch, dst_pitch, offset_shift, next_kernel) -+ ::mc_setup -++ mov r3, 16 -+ -+-# Read starting kernel -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-mov ra31, unif -+- -+-# Compute base address for first and second access -+-add r0, unif, elem_num # Load x -+-max r0, r0, 0; mov r1, unif # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -+-shl ra_xshift_next, r0, 3 # Compute shifts -+-add ra_y, r1, 1 -+-and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -+-add r2, r2, r0 # r2 is address for frame0 (not including y offset) -+-max r1, r1, 0 -+-min r1, r1, rb_frame_height_minus_1 -+-nop ; mul24 r1, r1, rb_pitch # r2 contains the addresses (not including y offset) for frame0 -+-add t0s, r2, r1 ; mov ra_frame_base, r2 -+- -+-add r0, unif, elem_num # Load x -+-max r0, r0, 0; mov r1, unif # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -+-shl rx_xshift2_next, r0, 3 # Compute shifts -+-add ra_y2, r1, 1 -+-and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -+-add r2, r2, r0 # r2 is address for frame1 (not including y offset) -+-max r1, r1, 0 -+-min r1, r1, rb_frame_height_minus_1 -+-nop ; mul24 r1, r1, rb_pitch # r2 contains the addresses (not including y offset) for frame0 -+-add t0s, r2, r1 ; mov ra_frame_base2, r2 -+- -++ # Need to save these because we need to know the frame dimensions before computing texture coordinates -++ mov ra8, unif -++ mov ra9, unif -++ mov ra10, unif -++ mov ra11, unif -+ -+ # Read image dimensions -+-sub rb25,unif,1 -+-sub rb30,unif,1 -++ mov r1, unif # width_height -++ shl r0,r1,r3 -++ asr r1,r1,r3 # width -++ asr r0,r0,r3 # height -++ sub rb_frame_width_minus_1,r1,1 -++ sub rb_frame_height_minus_1,r0,1 -+ -+ # get source pitch -+-mov rb16, unif -++ mov rb_pitch, unif -+ -+ # get destination pitch -+-mov r0, unif -+-mov r1, vdw_setup_1(0) -+-add rb24, r1, r0 -++ mov r0, unif -++ mov r1, vdw_setup_1(0) -++ add rb24, r1, r0 -+ -+-# load constants -+- -+-mov ra20, 1 -+-mov ra22, 256 -+-mov ra30, 64 -+- -+-mov rb20, 0xffffff00 -+-mov rb22, 255 -+-mov rb23, 24 -++# Compute base address for first and second access -++ mov r1, ra8 # y_x -++ shl r0,r1,r3 # r0 is x<<16 -++ asr r1,r1,r3 # r1 is y -++ asr r0,r0,r3 # r0 is x -++ add r0, r0, elem_num # Load x -++ max r0, r0, 0 -++ min r0, r0, rb_frame_width_minus_1 ; mov r2, ra9 # Load the frame base -++ shl ra_xshift_next, r0, 3 # Compute shifts -++ add ra_y, r1, 1 -++ and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++ add r2, r2, r0 # r2 is address for frame0 (not including y offset) -++ max r1, r1, 0 -++ min r1, r1, rb_frame_height_minus_1 -++ nop ; mul24 r1, r1, rb_pitch # r2 contains the addresses (not including y offset) for frame0 -++ add t0s, r2, r1 ; mov ra_frame_base, r2 -++ -++ mov r1, ra10 # y_x -++ shl r0,r1,r3 # r0 is x<<16 -++ asr r1,r1,r3 # r1 is y -++ asr r0,r0,r3 # r0 is x -++ add r0, r0, elem_num # Load x -++ max r0, r0, 0 -++ min r0, r0, rb_frame_width_minus_1 ; mov r2, ra11 # Load the frame base -++ shl rx_xshift2_next, r0, 3 # Compute shifts -++ add ra_y2, r1, 1 -++ and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++ add r2, r2, r0 # r2 is address for frame1 (not including y offset) -++ max r1, r1, 0 -++ min r1, r1, rb_frame_height_minus_1 -++ nop ; mul24 r1, r1, rb_pitch # r2 contains the addresses (not including y offset) for frame0 -++ add t1s, r2, r1 ; mov ra_frame_base2, r2 -+ -+-# touch vertical context to keep simulator happy -+ -+-mov ra8, 0 -+-mov ra9, 0 -+-mov ra10, 0 -+-mov ra11, 0 -+-mov ra12, 0 -+-mov ra13, 0 -+-mov ra14, 0 -+-mov ra15, 0 -++# load constants -+ -+-# Compute part of VPM to use for DMA output -+-mov r2, qpu_num -+-mov r1, r2 -+-asr r1, r1, 2 -+-shl r1, r1, 6 -+-mov r0, r2 -+-and r0, r0, 3 -+-add r0, r0, r1 -+-mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -+-shl r0, r0, 5 -+-add rb27, r0, r1 -++ mov ra20, 1 -++ mov ra22, 256 -++ mov ra30, 64 -+ -+-# Compute part of VPM to save data into -+-mov r2, qpu_num # qpu_num = abcd -+-mov r1, r2 -+-asr r1, r1, 2 -+-shl r1, r1, 6 -+-mov r0, r2 -+-and r0, r0, 3 -+-add r0, r0, r1 -+-mov r1, vpm_setup(0, 4, h8p(0, 0)) # 4 is stride - stride acts on ADDR which is Y[5:0],B[1:0] for 8 bit -+-add rb28, r0, r1 -++ mov rb20, 0xffffff00 -++ mov rb22, 255 -++ mov rb23, 24 -+ -+-mov rb12,unif # offset before shift -+-mov rb13,unif # shift -++# touch vertical context to keep simulator happy -+ -+-# Dump padding words -+-mov r0, unif -++ mov ra8, 0 -++ mov ra9, 0 -++ mov ra10, 0 -++ mov ra11, 0 -++ mov ra12, 0 -++ mov ra13, 0 -++ mov ra14, 0 -++ mov ra15, 0 -++ mov ra18, 0x4000 -++ -++# Compute part of VPM to use -++ mov r2, qpu_num -++ mov r1, r2 -++ asr r1, r1, 2 -++ shl r1, r1, 6 -++ mov r0, r2 -++ and r0, r0, 3 -++ add r0, r0, r1 -++ mov r1, vpm_setup(0, 4, h8p(0, 0)) # 4 is stride - stride acts on ADDR which is Y[5:0],B[1:0] for 8 bit -++ add rb28, r0, r1 # VPM for saving data -++ mov r1, vdw_setup_0(0, 0, dma_h8p(0,0,0)) # height,width added later -++ shl r0, r0, 5 -++ add rb27, r0, r1 # Command for dma output -++ -++# Weighted prediction denom -++ -++ mov r1, unif # offset_shift -++ shl r0,r1,r3 ; mov r2,8 -++ asr rb13,r0,r3 # shift -++ asr rb12,r1,r3 # offset -++ add rb13,rb13,r2 # mul24 is unsigned so scale up into high bits -++ shl rb12, rb12, r2 # Account for larger shift -+ -+ # submit texture requests for second line -+-max r1, ra_y, 0 -+-min r1, r1, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 -+-nop ; mul24 r1, r1, rb_pitch -+-add t0s, r1, ra_frame_base -+- -+-max r1, ra_y2, 0 -+-min r1, r1, rb_frame_height_minus_1 -+-bra -, ra31 -+-add ra_y2, ra_y2, 1 # Delay 1 -+-nop ; mul24 r1, r1, rb_pitch # Delay 2 -+-add t0s, r1, ra_frame_base2 # Delay 3 -+- -+- -+-################################################################################ -+- -+-# mc_filter(next_kernel, x, y, frame_base, x2, y2, frame_base2, height, hcoeffs[0], hcoeffs2[0], hcoeffs[1], hcoeffs2[1], vcoeffs[0], vcoeffs2[0], vcoeffs[1], vcoeffs2[1], offsetweight0, offsetweight1, this_dst) -+-# In a P block, only the first half of coefficients contain used information. -+-# At this point we have already issued two pairs of texture requests for the current block -+-# ra_x, ra_x16_base point to the current coordinates for this block -+-::mc_filter -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-mov ra31, unif -++ max r1, ra_y, 0 -++ min r1, r1, rb_frame_height_minus_1 -++ add ra_y, ra_y, 1 -++ nop ; mul24 r1, r1, rb_pitch -++ add t0s, r1, ra_frame_base -++ -++ max r1, ra_y2, 0 -++ min r1, r1, rb_frame_height_minus_1 -++ add ra_y2, ra_y2, 1 -++ nop ; mul24 r1, r1, rb_pitch -++ add t1s, r1, ra_frame_base2 -++ -++# FALL THROUGHT TO PER-BLOCK SETUP -++ -++# Start of per-block setup code -++# P and B blocks share the same setup code to save on Icache space -++:per_block_setup -++ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ mov ra31, unif -+ -+ # per-channel shifts were calculated on the *previous* invocation -+- -+-mov ra_xshift, ra_xshift_next -+-mov rx_xshift2, rx_xshift2_next -++ mov ra_xshift, ra_xshift_next -++ mov rx_xshift2, rx_xshift2_next -+ -+ # get base addresses and per-channel shifts for *next* invocation -+-add r0, unif, elem_num # Load x -+-max r0, r0, 0; mov r1, unif # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -+-shl ra_xshift_next, r0, 3 # Compute shifts -+-mov ra_y_next, r1 -+-and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -+-add ra_frame_base_next, r2, r0 # r2 is address for frame0 (not including y offset) -+- -+-add r0, unif, elem_num # Load x -+-max r0, r0, 0 ; mov r1, unif # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -+-shl rx_xshift2_next, r0, 3 # Compute shifts -+-add ra_y2_next, r1, 1 -+-and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -+-add rx_frame_base2_next, r2, r0 # r2 is address for frame1 (not including y offset) -+- -++ mov r3, 16 -++ mov r1, unif # y_x -++ shl r0,r1,r3 # r0 is x<<16 -++ asr r1,r1,r3 # r1 is y -++ asr r0,r0,r3 # r0 is x -++ add r0, r0, elem_num # Load x -++ max r0, r0, 0 -++ min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++ shl ra_xshift_next, r0, 3 # Compute shifts -++ mov ra_y_next, r1 -++ and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++ add ra_frame_base_next, r2, r0 ; mov r1, unif # y2_x2 -++ -++ shl r0,r1,r3 # r0 is x2<<16 -++ asr r1,r1,r3 # r1 is y2 -++ asr r0,r0,r3 # r0 is x2 -++ add r0, r0, elem_num # Load x -++ max r0, r0, 0 -++ min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -++ shl rx_xshift2_next, r0, 3 # Compute shifts -++ mov ra_y2_next, r1 -++ and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -++ add rx_frame_base2_next, r2, r0 # r2 is address for frame1 (not including y offset) -+ -+ # set up VPM write -+-mov vw_setup, rb28 -++ mov vw_setup, rb28 -+ -+ # get width,height of block -+-mov r2, 16 -+-mov r0, unif -+-shr r1, r0, r2 # Extract width -+-sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+-and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -+-shl r0, r0, 7 -+-add r0, r0, r1 # Combine width and height of destination area -+-shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+-add rb26, r0, rb27 -++ mov r0, unif -++ shr r1, r0, r3 # Extract width -++ sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -++ and r0, r0, rb22 # Extract height -++ add rb17, r0, 5 -++ add rb18, r0, 7 -++ shl r0, r0, 7 -++ add r0, r0, r1 # Combine width and height of destination area -++ shl r0, r0, r3 # Shift into bits 16 upwards of the vdw_setup0 register -++ add rb26, r0, rb27 -+ -+ # get filter coefficients and discard unused B frame values -+-mov r0, unif -+-mov.ifnz -, unif # Alternate coefficients are unused for P frames -+-asr ra3, r0, rb23; mul24 r0, r0, ra22 # These may need some pre-rotation to be used in B frames correctly -+-asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-asr ra0, r0, rb23; mov r0, unif -+-mov.ifnz -, unif -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-asr ra4, r0, rb23; mov r0, unif -+-mov.ifnz -, unif -+-asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -+-mov.ifnz -, unif -+-asr rb7, r0, rb23; mul24 r0, r0, ra22 -+-asr rb6, r0, rb23; mul24 r0, r0, ra22 -+-asr rb5, r0, rb23; mul24 r0, r0, ra22 -+-asr rb4, r0, rb23 -+- -+-mov r0, unif # Frame0 offset/weight -+-mov.ifnz -, unif # Frame1 offset/weight unused -+-asr rb15, r0, r2 # Compute offset from MSBs -+-shl r0, r0, r2 -+-asr rb14, r0, r2 # Compute weight from LSBs -+- -+-# r3 is loop counter -++ mov r0, unif ; mov r1,1 # Packed filter offsets, unpack into ra8... (to be used for vertical context later) -++ asr ra9, r0, rb23; mul24 r0, r0, ra22 # my2 -++ asr ra8, r0, rb23; mul24 r0, r0, ra22 # mx2 -++ asr.ifz ra9, r0, rb23; mul24 r0, r0, ra22 # my:my2 -++ asr.ifz ra8, r0, rb23 # mx:mx2 -++ sub ra9,3,ra9 -++ sub ra8,3,ra8 -++ shl ra9,ra9,3 # Scale up by 8 -++ shl ra8,ra8,3 # Scale up by 8 -++# Now if we want aligned we have a mul of 1, so put 0 coefficients at the top -++ mov r1,0xffff00 -++ shl r0, r1, ra8 -++ asr ra0, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb4, r0, rb23 -++ -++ mov r1,0x1040400 -++ shl r0, r1, ra8 -++ asr ra1, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb5, r0, rb23 -++ -++ mov r1,0xfbf5f600 -++ shl r0, r1, ra8 -++ asr ra2, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb6, r0, rb23 -++ -++ mov r1,0x11283a40 -++ shl r0, r1, ra8 -++ asr ra3, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb7, r0, rb23 -++ -++ mov r1,0x3a281100 -++ shl r0, r1, ra8 -++ asr ra4, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb8, r0, rb23 -++ -++ mov r1,0xf6f5fb00 -++ shl r0, r1, ra8 -++ asr ra5, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb9, r0, rb23 -++ -++ mov r1,0x4040100 -++ shl r0, r1, ra8 -++ asr ra6, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb10, r0, rb23 -++ -++ mov r1,0xffff0000 -++ shl r0, r1, ra8 -++ asr ra7, r0, rb23 -++ shl r0, r1, ra9 -++ asr rb11, r0, rb23 -++ -++# Extract weighted prediction information -++ mov r0, unif # offset/weight TODO move up -++ asr rb15, r0, r3 # Compute offset from MSBs -++ bra -, ra31 -++ shl r0, r0, r3 # Delay 1 -++ asr r0, r0, r3 ; mov r3, 0 # Compute weight from LSBs and reset loop counter Delay 2 -++ shl rb14, r0, 8 # Use a larger shift to avoid unsigned multiply problem Delay 3 -+ -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -++################################################################################ -++# mc_filter(y_x, frame_base, y2_x2, frame_base2, width_height, my2_mx2_my_mx, offsetweight0, this_dst, next_kernel) -++# In a P block, y2_x2 should be y_x+8 -++# At this point we have already issued two pairs of texture requests for the current block -+ -+-mov r3, 0 -++::mc_filter -+ -+ :yloop -+ # retrieve texture results and pick out bytes -+@@ -858,91 +892,90 @@ mov r3, 0 -+ # If we knew there was no clipping then this code would get simpler. -+ # Perhaps we could add on the pitch and clip using larger values? -+ -+-sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -+-mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-shr r1, r4, rx_xshift2 -+-mov.ifz ra_y2, ra_y2_next -++ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++ shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu1 -++ mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++ shr r1, r4, rx_xshift2 -++ mov.ifz ra_y2, ra_y2_next -+ -+-max r2, ra_y, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+- -+-max r2, ra_y2, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++ max r2, ra_y, 0 # y -++ min r2, r2, rb_frame_height_minus_1 -++ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++ add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+ -++ max r2, ra_y2, 0 # y -++ min r2, r2, rb_frame_height_minus_1 -++ add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++ add t1s, ra_frame_base2, r2 ; v8subs r1, r1, rb20 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+ -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+ # apply horizontal filter -+-nop ; mul24 r2, r0, ra0 -+-nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-nop ; mul24 r3, ra1 << 1, r0 << 1 -+-nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-add r0, r2, r3 ; mov r3, rb31 -+-sub.setf -, r3, 8 ; mov ra12, ra13 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+-mov ra12, ra13 -+-brr.anyn -, r:yloop -+-mov ra13, ra14 # Delay slot 1 -+-mov ra14, ra15 # Delay slot 2 -+-mov ra15, r0 # Delay slot 3 -++ nop ; mul24 r2, r0, ra0 -++ nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++ nop ; mul24 r3, ra1 << 1, r0 << 1 -++ nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++ add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++ nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++ add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++ nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++ add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++ nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++ add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++ nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++ add r0, r2, r3 ; mov r3, rb31 -++ sub.setf -, r3, 8 ; mov ra8, ra9 -++ mov ra9, ra10 -++ mov ra10, ra11 -++ mov ra11, ra12 -++ mov ra12, ra13 -++ brr.anyn -, r:yloop -++ mov ra13, ra14 # Delay slot 1 -++ mov ra14, ra15 # Delay slot 2 -++ mov ra15, r0 # Delay slot 3 -+ -+ # apply vertical filter and write to VPM -+ -+-nop ; mul24 r1, ra14, rb10 -+-nop ; mul24 r0, ra13, rb9 -+-add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-add r1, r1, r0 ; mul24 r0, ra8, rb4 -+-add r1, r1, r0 ; mul24 r0, ra9, rb5 -+-add r1, r1, r0 ; mul24 r0, ra10, rb6 -+-add r1, r1, r0 ; mul24 r0, ra11, rb7 -+- -+-add r1, r1, r0 ; mov -, vw_wait -+-sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 14 -+-nop ; mul24 r1, r1, rb14 -+-add r1, r1, rb12 -+-asr r1, r1, rb13 -+-brr.anyn -, r:yloop -+-add r1, r1, rb15 # Delay 1 -+-min r1, r1, rb22 # Delay 2 -+-max vpm, r1, 0 # Delay 3 -++ nop ; mul24 r1, ra14, rb10 -++ nop ; mul24 r0, ra13, rb9 -++ add r1, r1, r0 ; mul24 r0, ra12, rb8 -++ add r1, r1, r0 ; mul24 r0, ra15, rb11 -++ add r1, r1, r0 ; mul24 r0, ra8, rb4 -++ add r1, r1, r0 ; mul24 r0, ra9, rb5 -++ add r1, r1, r0 ; mul24 r0, ra10, rb6 -++ add r1, r1, r0 ; mul24 r0, ra11, rb7 -++ -++ add r1, r1, r0 ; mov -, vw_wait -++ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++ asr r1, r1, 14 -++ nop ; mul24 r1, r1, rb14 -++ add r1, r1, rb12 -++ asr r1, r1, rb13 -++ brr.anyn -, r:yloop -++ add r1, r1, rb15 # Delay 1 -++ min r1, r1, rb22 # Delay 2 -++ max vpm, r1, 0 # Delay 3 -+ -+ # DMA out -+ -+-bra -, ra31 -+-mov vw_setup, rb26 # VDW setup 0 Delay 1 -+-mov vw_setup, rb29 # Stride Delay 2 -+-mov vw_addr, unif # start the VDW Delay 3 -++ brr -, r:per_block_setup -++ mov vw_setup, rb26 # VDW setup 0 Delay 1 -++ mov vw_setup, rb29 # Stride Delay 2 -++ mov vw_addr, unif # start the VDW Delay 3 -+ -+ -+ -+ ################################################################################ -+ -+-# mc_filter_b(next_kernel, x, y, frame_base, x2, y2, frame_base2, width_height, hcoeffs[0], hcoeffs2[0], hcoeffs[1], hcoeffs2[1], vcoeffs[0], vcoeffs2[0], vcoeffs[1], vcoeffs2[1], offsetweight0, offsetweight1, this_dst) -++# mc_filter_b(y_x, frame_base, y2_x2, frame_base2, width_height, my2_mx2_my_mx, offsetweight0, this_dst, next_kernel) -+ # In a P block, only the first half of coefficients contain used information. -+ # At this point we have already issued two pairs of texture requests for the current block -+ # May be better to just send 16.16 motion vector and figure out the coefficients inside this block (only 4 cases so can compute hcoeffs in around 24 cycles?) -+@@ -952,92 +985,6 @@ mov vw_addr, unif # start the VDW Delay 3 -+ # Or possibly by taking advantage of symmetry? -+ # From 19->7 32bits per command. -+ ::mc_filter_b -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+-mov ra31, unif -+- -+-# per-channel shifts were calculated on the *previous* invocation -+- -+-mov ra_xshift, ra_xshift_next -+-mov rx_xshift2, rx_xshift2_next -+- -+-# get base addresses and per-channel shifts for *next* invocation -+-add r0, unif, elem_num # Load x -+-max r0, r0, 0; mov r1, unif # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -+-shl ra_xshift_next, r0, 3 # Compute shifts -+-mov ra_y_next, r1 -+-and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -+-add ra_frame_base_next, r2, r0 # r2 is address for frame0 (not including y offset) -+- -+-add r0, unif, elem_num # Load x -+-max r0, r0, 0 ; mov r1, unif # Load y -+-min r0, r0, rb_frame_width_minus_1 ; mov r2, unif # Load the frame base -+-shl rx_xshift2_next, r0, 3 # Compute shifts -+-add ra_y2_next, r1, 1 -+-and r0, r0, ~3 # r0 gives the clipped and aligned x coordinate -+-add rx_frame_base2_next, r2, r0 # r2 is address for frame1 (not including y offset) -+- -+- -+-# set up VPM write -+-mov vw_setup, rb28 -+- -+-# get width,height of block -+-mov r2, 16 -+-mov r0, unif -+-shr r1, r0, r2 # Extract width -+-sub rb29, rb24, r1 # Compute vdw_setup1(dst_pitch-width) -+-and r0, r0, rb22 # Extract height -+-add rb17, r0, 5 -+-add rb18, r0, 7 -+-shl r0, r0, 7 -+-add r0, r0, r1 # Combine width and height of destination area -+-shl r0, r0, r2 # Shift into bits 16 upwards of the vdw_setup0 register -+-add rb26, r0, rb27 -+- -+-# get filter coefficients and discard unused B frame values -+-mov r0, unif -+-mov r1, 1 -+-mov.ifnz r0, unif # Alternate coefficients are unused for P frames -+-nop ; mul24 r0, r0 << 13, r1 << 13 -+-asr ra3, r0, rb23; mul24 r0, r0, ra22 -+-nop ; mul24 r0, r0 << 14, r1 << 14 -+-asr ra2, r0, rb23; mul24 r0, r0, ra22 -+-nop ; mul24 r0, r0 << 15, r1 << 15 # Adjust such that a rotate of 1 will produce the values with first 8 on left, second 8 on right -+-asr ra1, r0, rb23; mul24 r0, r0, ra22 -+-asr ra0, r0, rb23; mov r0, unif -+-mov.ifnz r0, unif -+-nop ; mul24 r0, r0 << 9, r1 << 9 -+-asr ra7, r0, rb23; mul24 r0, r0, ra22 -+-nop ; mul24 r0, r0 << 10, r1 << 10 -+-asr ra6, r0, rb23; mul24 r0, r0, ra22 -+-nop ; mul24 r0, r0 << 11, r1 << 11 -+-asr ra5, r0, rb23; mul24 r0, r0, ra22 -+-nop ; mul24 r0, r0 << 12, r1 << 12 -+-asr ra4, r0, rb23; mov r0, unif -+-mov.ifnz r0, unif -+-asr rb11, r0, rb23; mul24 r0, r0, ra22 -+-asr rb10, r0, rb23; mul24 r0, r0, ra22 -+-asr rb9, r0, rb23; mul24 r0, r0, ra22 -+-asr rb8, r0, rb23; mov r0, unif -+-mov.ifnz r0, unif -+-asr rb7, r0, rb23; mul24 r0, r0, ra22 -+-asr rb6, r0, rb23; mul24 r0, r0, ra22 -+-asr rb5, r0, rb23; mul24 r0, r0, ra22 -+-asr rb4, r0, rb23 -+- -+-mov r0, unif # Frame0 offset/weight -+-mov.ifnz r0, unif # Frame1 offset/weight unused -+-asr rb15, r0, r2 # Compute offset from MSBs -+-shl r0, r0, r2 -+-asr rb14, r0, r2 # Compute weight from LSBs -+- -+-# r3 is loop counter -+- -+-# retrieve texture results and pick out bytes -+-# then submit two more texture requests -+- -+-mov r3, 0 -+- -+ :yloopb -+ # retrieve texture results and pick out bytes -+ # then submit two more texture requests -+@@ -1045,111 +992,123 @@ mov r3, 0 -+ # If we knew there was no clipping then this code would get simpler. -+ # Perhaps we could add on the pitch and clip using larger values? -+ -+-sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -+-shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu0 -+-mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -+-mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -+-shr r1, r4, rx_xshift2 -+-mov.ifz ra_y2, ra_y2_next -++ sub.setf -, r3, rb17 ; v8adds r3, r3, ra20 ; ldtmu0 -++ shr r0, r4, ra_xshift ; mov.ifz ra_frame_base2, rx_frame_base2_next ; ldtmu1 -++ mov.ifz ra_frame_base, ra_frame_base_next ; mov rb31, r3 -++ mov.ifz ra_y, ra_y_next ; mov r3, rb_pitch -++ shr r1, r4, rx_xshift2 -++ mov.ifz ra_y2, ra_y2_next -+ -+-max r2, ra_y, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+- -+-max r2, ra_y2, 0 # y -+-min r2, r2, rb_frame_height_minus_1 -+-add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -+-add t0s, ra_frame_base2, r2 ; v8subs r0, r0, rb20 -++ max r2, ra_y, 0 # y -++ min r2, r2, rb_frame_height_minus_1 -++ add ra_y, ra_y, 1 ; mul24 r2, r2, r3 -++ add t0s, ra_frame_base, r2 ; v8subs r0, r0, rb20 # v8subs masks out all but bottom byte -+ -++ max r2, ra_y2, 0 # y -++ min r2, r2, rb_frame_height_minus_1 -++ add ra_y2, ra_y2, 1 ; mul24 r2, r2, r3 -++ add t1s, ra_frame_base2, r2 ; v8subs r1, r1, rb20 -+ -+ # generate seven shifted versions -+ # interleave with scroll of vertical context -+ -+-mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -++ mov.setf -, [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1] -+ -+ # apply horizontal filter -+-nop ; mul24 r2, r0, ra0 -+-nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -+-nop ; mul24 r3, ra1 << 1, r0 << 1 -+-nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -+-add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -+-nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -+-add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -+-nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -+-add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -+-nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -+-add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -+-nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -+-add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -+-nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -+-add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -+-nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -+-add r0, r2, r3 ; mov r3, rb31 -+-sub.setf -, r3, 8 ; mov ra12, ra13 -+-mov ra9, ra10 -+-mov ra10, ra11 -+-mov ra11, ra12 -+-mov ra12, ra13 -+-brr.anyn -, r:yloopb -+-mov ra13, ra14 # Delay slot 1 -+-mov ra14, ra15 # Delay slot 2 -+-mov ra15, r0 # Delay slot 3 -+- -+-# apply vertical filter and write to VPM -+- -+-nop ; mul24 r1, ra14, rb10 -+-nop ; mul24 r0, ra13, rb9 -+-add r1, r1, r0 ; mul24 r0, ra12, rb8 -+-add r1, r1, r0 ; mul24 r0, ra15, rb11 -+-add r1, r1, r0 ; mul24 r0, ra8, rb4 -+-add r1, r1, r0 ; mul24 r0, ra9, rb5 -+-add r1, r1, r0 ; mul24 r0, ra10, rb6 -+-add r1, r1, r0 ; mul24 r0, ra11, rb7 -+- -+-add r1, r1, r0 ; mov -, vw_wait -+-sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -+-asr r1, r1, 14 -+-nop ; mul24 r1, r1 << 8, ra20 << 8 # Rotate to align left and right halves -+-add r1, r1, ra30 ; mul24 r0, r1, rb14 -+-add r1, r1, r0 -+-brr.anyn -, r:yloopb -+-asr r1, r1, 7 # Delay 1 -+-min r1, r1, rb22 # Delay 2 -+-max vpm, r1, 0 # Delay 3 -++ nop ; mul24 r2, r0, ra0 -++ nop ; mul24.ifnz r2, ra0 << 8, r1 << 8 -++ nop ; mul24 r3, ra1 << 1, r0 << 1 -++ nop ; mul24.ifnz r3, ra1 << 9, r1 << 9 -++ add r2, r2, r3 ; mul24 r3, ra2 << 2, r0 << 2 -++ nop ; mul24.ifnz r3, ra2 << 10, r1 << 10 -++ add r2, r2, r3 ; mul24 r3, ra3 << 3, r0 << 3 -++ nop ; mul24.ifnz r3, ra3 << 11, r1 << 11 -++ add r2, r2, r3 ; mul24 r3, ra4 << 4, r0 << 4 -++ nop ; mul24.ifnz r3, ra4 << 12, r1 << 12 -++ add r2, r2, r3 ; mul24 r3, ra5 << 5, r0 << 5 -++ nop ; mul24.ifnz r3, ra5 << 13, r1 << 13 -++ add r2, r2, r3 ; mul24 r3, ra6 << 6, r0 << 6 -++ nop ; mul24.ifnz r3, ra6 << 14, r1 << 14 -++ add r2, r2, r3 ; mul24 r3, ra7 << 7, r0 << 7 -++ nop ; mul24.ifnz r3, ra7 << 15, r1 << 15 -++ add r0, r2, r3 ; mov r3, rb31 -++ sub.setf -, r3, 8 ; mov ra8, ra9 -++ mov ra9, ra10 -++ mov ra10, ra11 -++ mov ra11, ra12 -++ mov ra12, ra13 -++ brr.anyn -, r:yloopb -++ mov ra13, ra14 # Delay slot 1 -++ mov ra14, ra15 # Delay slot 2 -++ mov ra15, r0 # Delay slot 3 -++ -++ # apply vertical filter and write to VPM -++ -++ nop ; mul24 r1, ra14, rb10 -++ nop ; mul24 r0, ra13, rb9 -++ add r1, r1, r0 ; mul24 r0, ra12, rb8 -++ add r1, r1, r0 ; mul24 r0, ra15, rb11 -++ add r1, r1, r0 ; mul24 r0, ra8, rb4 -++ add r1, r1, r0 ; mul24 r0, ra9, rb5 -++ add r1, r1, r0 ; mul24 r0, ra10, rb6 -++ add r1, r1, r0 ; mul24 r0, ra11, rb7 -++ -++ add r1, r1, r0 ; mov -, vw_wait -++ sub.setf -, r3, rb18 ; mul24 r1, r1, ra22 -++ asr r0, r1, 14 -++ asr r1, r1, 6 # Wait state so we can use the rotate instruction -++ nop ; mul24 r0, r0 << 8, ra22 << 8 # Rotate to align left and right halves -++ add r1, r1, ra18 -++ add r1, r1, r0 -++ brr.anyn -, r:yloopb -++ asr r1, r1, 15 # Delay 1 -++ min r1, r1, rb22 # Delay 2 -++ max vpm, r1, 0 # Delay 3 -+ -+ # DMA out -+-bra -, ra31 -+-mov vw_setup, rb26 # VDW setup 0 Delay 1 -+-mov vw_setup, rb29 # Stride Delay 2 -+-mov vw_addr, unif # start the VDW Delay 3 -++ brr -, r:per_block_setup -++ mov vw_setup, rb26 # VDW setup 0 Delay 1 -++ mov vw_setup, rb29 # Stride Delay 2 -++ mov vw_addr, unif # start the VDW Delay 3 -+ -+ ################################################################################ -+ -+ # mc_interrupt_exit12() -+ ::mc_interrupt_exit12 -+-mov -, vw_wait # wait on the VDW -+- -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+-ldtmu0 -+- -+-mov -,sacq(0) # 1 -+-mov -,sacq(0) # 2 -+-mov -,sacq(0) # 3 -+-mov -,sacq(0) # 4 -+-mov -,sacq(0) # 5 -+-mov -,sacq(0) # 6 -+-mov -,sacq(0) # 7 -+-mov -,sacq(0) # 8 -+-mov -,sacq(0) # 9 -+-mov -,sacq(0) # 10 -+-mov -,sacq(0) # 11 -+- -+-nop ; nop ; thrend -+-mov interrupt, 1; nop # delay slot 1 -+-nop ; nop # delay slot 2 -++ mov -, vw_wait # wait on the VDW -++ -++ ldtmu0 -++ ldtmu0 -++ ldtmu1 -++ ldtmu1 -++ -++ mov -,sacq(0) # 1 -++ mov -,sacq(0) # 2 -++ mov -,sacq(0) # 3 -++ mov -,sacq(0) # 4 -++ mov -,sacq(0) # 5 -++ mov -,sacq(0) # 6 -++ mov -,sacq(0) # 7 -++ mov -,sacq(0) # 8 -++ mov -,sacq(0) # 9 -++ mov -,sacq(0) # 10 -++ mov -,sacq(0) # 11 -++ -++ nop ; nop ; thrend -++ mov interrupt, 1; nop # delay slot 1 -++ nop ; nop # delay slot 2 -++ -++ -++::mc_exit1 -++ mov -, vw_wait # wait on the VDW -++ -++ ldtmu0 -++ ldtmu1 -++ ldtmu0 -++ ldtmu1 -++ nop ; nop ; thrend -++ mov interrupt, 1; nop # delay slot 1 -++ nop ; nop # delay slot 2 -+ -+ -+ ::mc_end -+-- -+2.5.0 -+ -+ -+From e5b20751b9a026e127ff0cdd8768b1d37ca5aa27 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 2 Jun 2015 10:58:25 +0100 -+Subject: [PATCH 48/68] Added option to simulate QPUs -+ -+--- -+ libavcodec/hevc.c | 288 +++++++++++++++++++++++++++++++++++++++++++-- -+ libavcodec/rpi_qpu.c | 24 ++-- -+ libavcodec/rpi_shader.qasm | 6 +- -+ 3 files changed, 295 insertions(+), 23 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 11b9e60..9be5276 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -56,6 +56,8 @@ -+ // Define RPI_CACHE_UNIF_MVS to write motion vector uniform stream to cached memory -+ // RPI_CACHE_UNIF_MVS doesn't seem to make much difference, so left undefined. -+ -++ // Define RPI_SIMULATE_QPUS for debugging to run QPU code on the ARMs -++ //#define RPI_SIMULATE_QPUS -+ -+ #endif -+ -+@@ -124,7 +126,6 @@ static void pic_arrays_free(HEVCContext *s) -+ -+ #ifdef EARLY_MALLOC -+ #else -+- printf("pic_arrays_free\n"); -+ if (s->coeffs_buf_arm[0]) { -+ gpu_free(&s->coeffs_buf_default); -+ s->coeffs_buf_arm[0] = 0; -+@@ -174,11 +175,9 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ #ifdef RPI -+ #ifdef EARLY_MALLOC -+ #else -+- assert(sps); -++ av_assert0(sps); -+ int coeffs_in_ctb = (1 << sps->log2_ctb_size) * (1 << sps->log2_ctb_size); -+ int coefs_per_row = sps->ctb_width * coeffs_in_ctb * 3; // Allow space for chroma -+- printf("pic_arrays_init\n"); -+- printf("Allocated %d\n",coefs_per_row); -+ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -+ s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -+ if (!s->coeffs_buf_arm[0]) -+@@ -2977,6 +2976,274 @@ static void rpi_inter_clear(HEVCContext *s) -+ #endif -+ } -+ -++ -++#ifdef RPI_SIMULATE_QPUS -++ -++static int32_t clipx(int x,int FRAME_WIDTH) -++{ -++ if (x<=0) return 0; -++ if (x>=FRAME_WIDTH) return FRAME_WIDTH-1; -++ return x; -++} -++ -++static int32_t clipy(int y,int FRAME_HEIGHT) -++{ -++ if (y<=0) return 0; -++ if (y>=FRAME_HEIGHT) return FRAME_HEIGHT-1; -++ return y; -++} -++ -++/*static int32_t filter8(uint8_t *data, int x0, int y0, int pitch, int mx, int my,int round,int denom,int weight,int offset) -++{ -++ int32_t vsum = 0; -++ int x, y; -++ -++ for (y = 0; y < 8; y++) { -++ int32_t hsum = 0; -++ -++ for (x = 0; x < 8; x++) -++ hsum += lumaFilter[mx][x]*data[clipx(x + x0) + clipy(y + y0) * pitch]; -++ -++ vsum += lumaFilter[my][y]*hsum; -++ } -++ vsum >>= 6; -++ vsum = (((vsum*weight)+round)>>denom)+offset; -++ -++ return av_clip_uint8( vsum ); -++}*/ -++ -++static int32_t filter8_chroma(uint8_t *data, int x0, int y0, int pitch, int hcoeffs, int vcoeffs,int offset_weight,int offset_before,int denom,int pic_width, int pic_height) -++{ -++ int32_t vsum = 0; -++ int x, y; -++ int chromaFilterH[4]; -++ int chromaFilterV[4]; -++ int i; -++ int offset_after = offset_weight>>16; -++ int weight = (offset_weight<<16)>>16; -++ for(i=0;i<4;i++) { -++ chromaFilterH[i] = ((hcoeffs>>(8*i))<<24)>>24; -++ chromaFilterV[i] = ((vcoeffs>>(8*i))<<24)>>24; -++ } -++ -++ for (y = 0; y < 4; y++) { -++ int32_t hsum = 0; -++ -++ for (x = 0; x < 4; x++) -++ hsum += chromaFilterH[x]*data[clipx(x + x0,pic_width) + clipy(y + y0,pic_height) * pitch]; -++ -++ vsum += chromaFilterV[y]*hsum; -++ } -++ vsum >>= 6; -++ vsum = (((vsum*weight)+offset_before)>>denom)+offset_after; -++ -++ return vsum; -++} -++ -++int lumaFilter[4][8]={ {0,0,0,64,0,0,0,0},{-1,4,-10,58,17,-5,1,0},{-1,4,-11,40,40,-11,4,-1},{0,1,-5,17,58,-10,4,-1} }; -++ -++static int32_t filter8_luma(uint8_t *data, int x0, int y0, int pitch, int my_mx,int offset_weight,int offset_before,int denom,int pic_width, int pic_height) -++{ -++ int32_t vsum = 0; -++ int x, y; -++ int i; -++ int offset_after = offset_weight>>16; -++ int weight = (offset_weight<<16)>>16; -++ -++ for (y = 0; y < 8; y++) { -++ int32_t hsum = 0; -++ -++ for (x = 0; x < 8; x++) -++ hsum += lumaFilter[my_mx&3][x]*data[clipx(x + x0,pic_width) + clipy(y + y0,pic_height) * pitch]; -++ -++ vsum += lumaFilter[(my_mx>>8)&3][y]*hsum; -++ } -++ vsum >>= 6; -++ vsum = (((vsum*weight)+offset_before)>>denom)+offset_after; -++ -++ return vsum; -++} -++ -++static uint8_t *test_frame(HEVCContext *s,uint32_t p, AVFrame *frame, int cIdx) -++{ -++ //int pic_width = s->ps.sps->width >> s->ps.sps->hshift[cIdx]; -++ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[cIdx]; -++ int pitch = frame->linesize[cIdx]; -++ uint32_t base = get_vc_address(frame->buf[cIdx]); -++ if (p>=base && pdata[cIdx] + (p-base); -++ } -++ return NULL; -++} -++ -++static uint8_t *compute_arm_addr(HEVCContext *s,uint32_t p, int cIdx) -++{ -++ SliceHeader *sh = &s->sh; -++ uint8_t *arm = test_frame(s,p,s->frame,cIdx); -++ int i; -++ if (arm) return arm; -++ if (sh->slice_type == P_SLICE || sh->slice_type == B_SLICE) -++ { -++ for(i=0;inb_refs[L0];i++) { -++ arm = test_frame(s,p,s->ref->refPicList[0].ref[i]->frame,cIdx); -++ if (arm) return arm; -++ } -++ } -++ if (sh->slice_type == B_SLICE) { -++ for(i=0;inb_refs[L1];i++) { -++ arm = test_frame(s,p,s->ref->refPicList[1].ref[i]->frame,cIdx); -++ if (arm) return arm; -++ } -++ } -++ printf("Frame 0x%x not found! Exit=%x\n",p,qpu_get_fn(QPU_MC_EXIT)); -++ exit(-1); -++ return NULL; -++} -++ -++static void rpi_simulate_inter_chroma(HEVCContext *s,uint32_t *p) -++{ -++ uint32_t next_kernel; -++ uint32_t x0; -++ uint32_t y0; -++ uint8_t *ref_u_base; -++ uint8_t *ref_v_base; -++ uint32_t frame_width = p[5]; -++ uint32_t frame_height = p[6]; -++ uint32_t pitch = p[7]; -++ uint32_t dst_pitch = p[8]; -++ int32_t offset_before = p[9]; -++ int32_t denom = p[10]; -++ uint32_t vpm_id = p[11]; -++ uint32_t tmp_u_dst[256]; -++ uint32_t tmp_v_dst[256]; -++ while(1) { -++ p += 12; -++ next_kernel = p[0-12]; -++ x0 = p[1-12]; -++ y0 = p[2-12]; -++ if (next_kernel==s->mc_filter_uv || next_kernel==s->mc_filter_uv_b0 || next_kernel==s->mc_filter_uv_b) { -++ int x,y; -++ uint32_t width_height = p[5]; -++ uint32_t hcoeffs = p[6]; -++ uint32_t vcoeffs = p[7]; -++ uint32_t offset_weight_u = p[8]; -++ uint32_t offset_weight_v = p[9]; -++ uint8_t *this_u_dst; -++ uint8_t *this_v_dst; -++ uint32_t width = width_height >> 16; -++ uint32_t height = (width_height << 16) >> 16; -++ ref_u_base = compute_arm_addr(s,p[3-12],1); -++ ref_v_base = compute_arm_addr(s,p[4-12],2); -++ if (next_kernel!=s->mc_filter_uv_b0) -++ { -++ this_u_dst = compute_arm_addr(s,p[10],1); -++ this_v_dst = compute_arm_addr(s,p[11],2); -++ } -++ for (y=0; ymc_filter_uv) { -++ int32_t refa = filter8_chroma(ref_u_base,x+x0, y+y0, pitch, hcoeffs, vcoeffs, offset_weight_u,offset_before,denom,frame_width,frame_height); -++ int32_t refb = filter8_chroma(ref_v_base,x+x0, y+y0, pitch, hcoeffs, vcoeffs, offset_weight_v,offset_before,denom,frame_width,frame_height); -++ this_u_dst[x+y*dst_pitch] = av_clip_uint8(refa); -++ this_v_dst[x+y*dst_pitch] = av_clip_uint8(refb); -++ } else if (next_kernel==s->mc_filter_uv_b0) { -++ int32_t refa = filter8_chroma(ref_u_base, x+x0, y+y0, pitch, hcoeffs, vcoeffs, 1,0,0,frame_width,frame_height); -++ int32_t refb = filter8_chroma(ref_v_base, x+x0, y+y0, pitch, hcoeffs, vcoeffs, 1,0,0,frame_width,frame_height); -++ tmp_u_dst[x+y*16] = refa; -++ tmp_v_dst[x+y*16] = refb; -++ } else { -++ int32_t refa = filter8_chroma(ref_u_base, x+x0, y+y0, pitch, hcoeffs, vcoeffs, 1, 64 + tmp_u_dst[x+y*16], 7, frame_width, frame_height); -++ int32_t refb = filter8_chroma(ref_v_base, x+x0, y+y0, pitch, hcoeffs, vcoeffs, 1, 64 + tmp_v_dst[x+y*16], 7, frame_width, frame_height); -++ this_u_dst[x+y*dst_pitch] = av_clip_uint8(refa); -++ this_v_dst[x+y*dst_pitch] = av_clip_uint8(refb); -++ } -++ } -++ } -++ } else { -++ av_assert0(next_kernel==qpu_get_fn(QPU_MC_INTERRUPT_EXIT8) || next_kernel==qpu_get_fn(QPU_MC_EXIT) ); -++ break; -++ } -++ } -++} -++ -++// mc_setup(y_x, ref_y_base, y2_x2, ref_y2_base, frame_width_height, pitch, dst_pitch, offset_shift, next_kernel) -++static void rpi_simulate_inter_luma(HEVCContext *s,uint32_t *p) -++{ -++ uint32_t next_kernel; -++ int y_x,y2_x2; -++ uint32_t x0; -++ uint32_t y0; -++ uint32_t x2; -++ uint32_t y2; -++ uint8_t *ref_y_base; -++ uint8_t *ref_y2_base; -++ uint32_t frame_width_height = p[4]; -++ uint32_t frame_width = frame_width_height>>16; -++ uint32_t frame_height = (frame_width_height<<16)>>16; -++ uint32_t pitch = p[5]; -++ uint32_t dst_pitch = p[6]; -++ int offset_shift = p[7]; -++ int32_t offset_before = offset_shift>>16; -++ int32_t denom = (offset_shift<<16)>>16; -++ while(1) { -++ p += 9; -++ next_kernel = p[8-9]; -++ y_x = p[0-9]; -++ x0 = (y_x<<16)>>16; -++ y0 = y_x>>16; -++ y2_x2 = p[2-9]; -++ x2 = (y2_x2<<16)>>16; -++ y2 = y2_x2>>16; -++ -++ if (next_kernel==s->mc_filter || next_kernel==s->mc_filter_b) { -++ // y_x, frame_base, y2_x2, frame_base2, width_height, my2_mx2_my_mx, offsetweight0, this_dst, next_kernel) -++ int x,y; -++ uint32_t width_height = p[4]; -++ uint32_t my2_mx2_my_mx = p[5]; -++ uint32_t offset_weight = p[6]; -++ uint8_t *this_dst = compute_arm_addr(s,p[7],0); -++ uint32_t width = width_height >> 16; -++ uint32_t height = (width_height << 16) >> 16; -++ ref_y_base = compute_arm_addr(s,p[1-9],0); -++ ref_y2_base = compute_arm_addr(s,p[3-9],0); -++ for (y=0; ymc_filter) { -++ int32_t refa = filter8_luma(ref_y_base,x+x0, y+y0, pitch, my2_mx2_my_mx, offset_weight,offset_before,denom,frame_width,frame_height); -++ this_dst[x+y*dst_pitch] = av_clip_uint8(refa); -++ } -++ else { -++ int32_t refa = filter8_luma(ref_y_base, x+x0, y+y0, pitch, my2_mx2_my_mx, 1, 0, 0, frame_width, frame_height); -++ int32_t refb = filter8_luma(ref_y2_base, x+x2, y+y2, pitch, my2_mx2_my_mx>>16, 1, 64 + refa, 7, frame_width, frame_height); -++ this_dst[x+y*dst_pitch] = av_clip_uint8(refb); -++ } -++ } -++ } -++ } else { -++ av_assert0(next_kernel==qpu_get_fn(QPU_MC_INTERRUPT_EXIT12) || next_kernel==qpu_get_fn(QPU_MC_EXIT) ); -++ break; -++ } -++ } -++} -++ -++static void rpi_simulate_inter_qpu(HEVCContext *s) -++{ -++ // First run the transform as normal -++ int i; -++ rpi_execute_transform(s); -++ for(i=0;i<8;i++) -++ { -++ rpi_simulate_inter_chroma(s,s->mvs_base[i]); -++ } -++ for(i=0;i<12;i++) -++ { -++ rpi_simulate_inter_luma(s,s->y_mvs_base[i]); -++ } -++} -++ -++#endif -++ -++ -+ static void rpi_execute_inter_qpu(HEVCContext *s) -+ { -+ int k; -+@@ -2995,7 +3262,7 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+ s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for V -+- assert(s->u_mvs[k] - s->mvs_base[k] < UV_COMMANDS_PER_QPU); -++ av_assert0(s->u_mvs[k] - s->mvs_base[k] < UV_COMMANDS_PER_QPU); -+ } -+ -+ s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+@@ -3005,11 +3272,16 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+1] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+ s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for second request -+ s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+- assert(s->y_mvs[k] - s->y_mvs_base[k] < Y_COMMANDS_PER_QPU); -++ av_assert0(s->y_mvs[k] - s->y_mvs_base[k] < Y_COMMANDS_PER_QPU); -+ } -+ s->y_mvs[12-1][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT12); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+ #endif -+ -++#ifdef RPI_SIMULATE_QPUS -++ rpi_simulate_inter_qpu(s); -++ s->vpu_id = -1; -++ return; -++#endif -+ -+ #ifdef RPI_MULTI_MAILBOX -+ #ifdef RPI_CACHE_UNIF_MVS -+@@ -3090,7 +3362,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ && s->ps.pps->num_tile_rows <= 1 && s->ps.pps->num_tile_columns <= 1; -+ #endif -+ -+- /*if (!s->enable_rpi) { -++ if (!s->enable_rpi) { -+ if (s->ps.pps->cross_component_prediction_enabled_flag) -+ printf("Cross component\n"); -+ if (s->ps.pps->num_tile_rows > 1 || s->ps.pps->num_tile_columns > 1) -+@@ -3099,7 +3371,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ printf("Weighted P slice\n"); -+ if (s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE) -+ printf("Weighted B slice\n"); -+- }*/ -++ } -+ -+ #endif -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index e12304b..4480f72 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -13,7 +13,7 @@ -+ #include -+ #include -+ #include -+-#include -++#include "libavutil/avassert.h" -+ -+ #include "config.h" -+ -+@@ -160,13 +160,13 @@ static int gpu_init(volatile struct GPU **gpu) { -+ // Now copy over the QPU code into GPU memory -+ { -+ int num_bytes = qpu_get_fn(QPU_MC_END) - qpu_get_fn(QPU_MC_SETUP_UV); -+- assert(num_bytes<=QPU_CODE_SIZE*sizeof(unsigned int)); -++ av_assert0(num_bytes<=QPU_CODE_SIZE*sizeof(unsigned int)); -+ memcpy((void*)ptr->qpu_code, rpi_shader, num_bytes); -+ } -+ // And the VPU code -+ { -+ int num_bytes = sizeof(rpi_hevc_transform); -+- assert(num_bytes<=VPU_CODE_SIZE*sizeof(unsigned int)); -++ av_assert0(num_bytes<=VPU_CODE_SIZE*sizeof(unsigned int)); -+ memcpy((void*)ptr->vpu_code, rpi_hevc_transform, num_bytes); -+ } -+ // And the transform coefficients -+@@ -216,13 +216,13 @@ static void gpu_unlock(void) { -+ static int gpu_malloc_uncached_internal(int numbytes, GPU_MEM_PTR_T *p, int mb) { -+ p->numbytes = numbytes; -+ p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); -+- assert(p->vcsm_handle); -++ av_assert0(p->vcsm_handle); -+ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -+- assert(p->vc_handle); -++ av_assert0(p->vc_handle); -+ p->arm = vcsm_lock(p->vcsm_handle); -+- assert(p->arm); -++ av_assert0(p->arm); -+ p->vc = mem_lock(mb, p->vc_handle); -+- assert(p->vc); -++ av_assert0(p->vc); -+ return 0; -+ } -+ -+@@ -243,7 +243,7 @@ int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p) -+ -+ int gpu_get_mailbox(void) -+ { -+- assert(gpu); -++ av_assert0(gpu); -+ return gpu->mb; -+ } -+ -+@@ -297,13 +297,13 @@ static int gpu_malloc_cached_internal(int numbytes, GPU_MEM_PTR_T *p) { -+ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_VC, (char *)"Video Frame" ); -+ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_NONE, (char *)"Video Frame" ); -+ //p->vcsm_handle = vcsm_malloc_cache(numbytes, VCSM_CACHE_TYPE_HOST_AND_VC, (char *)"Video Frame" ); -+- assert(p->vcsm_handle); -++ av_assert0(p->vcsm_handle); -+ p->vc_handle = vcsm_vc_hdl_from_hdl(p->vcsm_handle); -+- assert(p->vc_handle); -++ av_assert0(p->vc_handle); -+ p->arm = vcsm_lock(p->vcsm_handle); -+- assert(p->arm); -++ av_assert0(p->arm); -+ p->vc = mem_lock(gpu->mb, p->vc_handle); -+- assert(p->vc); -++ av_assert0(p->vc); -+ return 0; -+ } -+ -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 60d1ec2..0686249 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -149,8 +149,8 @@ add t0s, r0, r1 ; mov ra_frame_base, r2 -+ add t1s, r2, r1 -+ -+ mov r2,8 -+-shl rb12,unif, r2 # offset before shift -+-add rb13,unif,r2 # offset after shift -++shl rb12,unif,r2 # offset before shift -++add rb13,unif,r2 # denominator -+ -+ # Compute part of VPM to use for DMA output -+ mov r2, unif -+@@ -185,7 +185,7 @@ add t1s, r1, ra_frame_base -+ -+ ################################################################################ -+ -+-# mc_filter_uv(next_kernel, x, y, frame_u_base, frame_v_base, height, hcoeffs[0], hcoeffs[1], vcoeffs[0], vcoeffs[1], this_u_dst, this_v_dst) -++# mc_filter_uv(next_kernel, x, y, frame_u_base, frame_v_base, width_height, hcoeffs, vcoeffs, offset_weight_u, offset_weight_v, this_u_dst, this_v_dst) -+ -+ # At this point we have already issued two pairs of texture requests for the current block -+ # ra_x, ra_x16_base point to the current coordinates for this block -+-- -+2.5.0 -+ -+ -+From 1c4e1f07dbed84272a36cd8c25cf9d40be5cfd7c Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 2 Jun 2015 13:17:50 +0100 -+Subject: [PATCH 49/68] Increased motion vector memory and fixed block size -+ computation for non-multiple of 2 block sizes -+ -+--- -+ libavcodec/hevc.c | 50 +++++++++++++++++++++++++++++++------------------- -+ 1 file changed, 31 insertions(+), 19 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 9be5276..c864ddb 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -83,11 +83,9 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ -+ // Split image of 2048 into parts 64 wide -+ // So some QPUs will have 3 blocks of 64 to do, and others 2 blocks for an image 2048 wide with 32 blocks across -+-// Each block of 64*64 -+-// Smallest CTU size is 16x16, so smallest block is 8x8 -+-// Corresponds to a total of 83kbytes over all 12 QPUs -++// For each block of 64*64 the smallest block size is 8x4 -+ #define RPI_LUMA_COMMAND_WORDS 9 -+-#define Y_COMMANDS_PER_QPU ((1+3*(64*64)/(8*8)) * RPI_LUMA_COMMAND_WORDS) -++#define Y_COMMANDS_PER_QPU ((1+3*(64*64)/(8*4)) * RPI_LUMA_COMMAND_WORDS) -+ -+ #define ENCODE_COEFFS(c0, c1, c2, c3) (((c0) & 0xff) | ((c1) & 0xff) << 8 | ((c2) & 0xff) << 16 | ((c3) & 0xff) << 24) -+ -+@@ -2031,11 +2029,13 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ uint32_t *y = s->y_mvs[chan % 12]; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=16) { -++ int bw = nPbW-start_x; -++ int bh = nPbH-start_y; -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -+ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + 8 + start_x) & 0xffff); -+ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -+- *y++ = ( (nPbW<16 ? nPbW : 16) << 16 ) + (nPbH<16 ? nPbH : 16); -++ *y++ = ( (bw<16 ? bw : 16) << 16 ) + (bh<16 ? bh : 16); -+ *y++ = my2_mx2_my_mx; -+ if (weight_flag) { -+ *y++ = (s->sh.luma_offset_l0[current_mv.ref_idx[reflist]] << 16) + (s->sh.luma_weight_l0[current_mv.ref_idx[reflist]] & 0xffff); -+@@ -2078,12 +2078,14 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -++ int bw = nPbW_c-start_x; -++ int bh = nPbH_c-start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -+- *u++ = ( (nPbW_cy_mvs[chan % 12]; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=16) { -++ int bw = nPbW-start_x; -++ int bh = nPbH-start_y; -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -+ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + 8 + start_x) & 0xffff); -+ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -+- *y++ = ( (nPbW<16 ? nPbW : 16) << 16 ) + (nPbH<16 ? nPbH : 16); -++ *y++ = ( (bw<16 ? bw : 16) << 16 ) + (bh<16 ? bh : 16); -+ *y++ = my2_mx2_my_mx; -+ if (weight_flag) { -+ *y++ = (s->sh.luma_offset_l0[current_mv.ref_idx[reflist]] << 16) + (s->sh.luma_weight_l0[current_mv.ref_idx[reflist]] & 0xffff); -+@@ -2178,12 +2182,14 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -++ int bw = nPbW_c-start_x; -++ int bh = nPbH_c-start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -+- *u++ = ( (nPbW_csh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+ *u++ = rpi_filter_coefs[_my][0]; -+@@ -2235,11 +2241,13 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ uint32_t *y = s->y_mvs[chan % 12]; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=8) { // B blocks work 8 at a time -++ int bw = nPbW-start_x; -++ int bh = nPbH-start_y; -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -+ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y2 - 3 + start_y) << 16) + ( (x2 - 3 + start_x) & 0xffff); // Second fetch is for ref1 -+ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -+- *y++ = ( (nPbW<8 ? nPbW : 8) << 16 ) + (nPbH<16 ? nPbH : 16); -++ *y++ = ( (bw<8 ? bw : 8) << 16 ) + (bh<16 ? bh : 16); -+ *y++ = my2_mx2_my_mx; -+ *y++ = 1; // B frame weighted prediction not supported -+ *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -+@@ -2282,12 +2290,14 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ uint32_t *u = s->u_mvs[chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -++ int bw = nPbW_c-start_x; -++ int bh = nPbH_c-start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b0; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -+- *u++ = ( (nPbW_cframe->buf[1]); -+ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -+- *u++ = ( (nPbW_c> 16; -+ uint32_t height = (width_height << 16) >> 16; -++ uint8_t *dst_base = s->frame->data[0]; -+ ref_y_base = compute_arm_addr(s,p[1-9],0); -+ ref_y2_base = compute_arm_addr(s,p[3-9],0); -+ for (y=0; ymc_filter) { -+ int32_t refa = filter8_luma(ref_y_base,x+x0, y+y0, pitch, my2_mx2_my_mx, offset_weight,offset_before,denom,frame_width,frame_height); -+- this_dst[x+y*dst_pitch] = av_clip_uint8(refa); -++ refa = av_clip_uint8(refa); -++ this_dst[x+y*dst_pitch] = refa; -+ } -+ else { -+ int32_t refa = filter8_luma(ref_y_base, x+x0, y+y0, pitch, my2_mx2_my_mx, 1, 0, 0, frame_width, frame_height); -+@@ -3237,7 +3250,7 @@ static void rpi_simulate_inter_qpu(HEVCContext *s) -+ } -+ for(i=0;i<12;i++) -+ { -+- rpi_simulate_inter_luma(s,s->y_mvs_base[i]); -++ rpi_simulate_inter_luma(s,s->y_mvs_base[i],i); -+ } -+ } -+ -+@@ -3279,7 +3292,6 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ -+ #ifdef RPI_SIMULATE_QPUS -+ rpi_simulate_inter_qpu(s); -+- s->vpu_id = -1; -+ return; -+ #endif -+ -+-- -+2.5.0 -+ -+ -+From e6447ea51d299460471d5ac7e2fb6efe374574ee Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 2 Jun 2015 14:36:54 +0100 -+Subject: [PATCH 50/68] Added support for skip deblock -+ -+--- -+ libavcodec/hevc.c | 5 +++++ -+ libavcodec/hevc.h | 2 ++ -+ libavcodec/hevc_filter.c | 14 ++++---------- -+ 3 files changed, 11 insertions(+), 10 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index c864ddb..7acd243 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3386,6 +3386,11 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ } -+ -+ #endif -++ s->used_for_ref = !(s->nal_unit_type == NAL_TRAIL_N || -++ s->nal_unit_type == NAL_TSA_N || -++ s->nal_unit_type == NAL_STSA_N || -++ s->nal_unit_type == NAL_RADL_N || -++ s->nal_unit_type == NAL_RASL_N); -+ -+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { -+ av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n"); -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index a3668a2..520d16f 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -916,6 +916,8 @@ typedef struct HEVCContext { -+ int width; -+ int height; -+ -++ int used_for_ref; -++ -+ #ifdef RPI -+ int enable_rpi; -+ HEVCMvCmd *unif_mv_cmds; -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 11629e4..14a0952 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -512,16 +512,14 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->ps.pps->transquant_bypass_enable_flag; -+ -+ #ifdef DISABLE_DEBLOCK_NONREF -+- if ( s->nal_unit_type == NAL_TRAIL_N || -+- s->nal_unit_type == NAL_TSA_N || -+- s->nal_unit_type == NAL_STSA_N || -+- s->nal_unit_type == NAL_RADL_N || -+- s->nal_unit_type == NAL_RASL_N ) -++ if (!s->used_for_ref) -+ return; // Don't deblock non-reference frames -+ #endif -+ #ifdef DISABLE_DEBLOCK -+ return; -+ #endif -++ if (!s->used_for_ref && s->avctx->skip_loop_filter >= AVDISCARD_NONREF) -++ return; -+ -+ if (x0) { -+ left_tc_offset = s->deblock[ctb - 1].tc_offset; -+@@ -885,11 +883,7 @@ static int ff_hevc_buf_base(AVBufferRef *bref) { -+ -+ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ { -+- if (s->enable_rpi && !( s->nal_unit_type == NAL_TRAIL_N || -+- s->nal_unit_type == NAL_TSA_N || -+- s->nal_unit_type == NAL_STSA_N || -+- s->nal_unit_type == NAL_RADL_N || -+- s->nal_unit_type == NAL_RASL_N )) { -++ if (s->enable_rpi && s->used_for_ref) { -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+ int curr_y = ((int *)f->progress->data)[0]; -+-- -+2.5.0 -+ -+ -+From 0b1f5a86b7b99b237d1eae321ed4083365f4103b Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Tue, 2 Jun 2015 15:22:52 +0100 -+Subject: [PATCH 51/68] Added support for skip_frame -+ -+--- -+ libavcodec/hevc.c | 15 ++++++++++----- -+ 1 file changed, 10 insertions(+), 5 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 7acd243..0324968 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3386,11 +3386,6 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ } -+ -+ #endif -+- s->used_for_ref = !(s->nal_unit_type == NAL_TRAIL_N || -+- s->nal_unit_type == NAL_TSA_N || -+- s->nal_unit_type == NAL_STSA_N || -+- s->nal_unit_type == NAL_RADL_N || -+- s->nal_unit_type == NAL_RASL_N); -+ -+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { -+ av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n"); -+@@ -3914,6 +3909,16 @@ static int decode_nal_unit(HEVCContext *s, const HEVCNAL *nal) -+ if (ret < 0) -+ return ret; -+ -++ s->used_for_ref = !(s->nal_unit_type == NAL_TRAIL_N || -++ s->nal_unit_type == NAL_TSA_N || -++ s->nal_unit_type == NAL_STSA_N || -++ s->nal_unit_type == NAL_RADL_N || -++ s->nal_unit_type == NAL_RASL_N); -++ -++ if (!s->used_for_ref && s->avctx->skip_frame >= AVDISCARD_NONREF) { -++ s->is_decoded = 0; -++ break; -++ } -+ if (s->max_ra == INT_MAX) { -+ if (s->nal_unit_type == NAL_CRA_NUT || IS_BLA(s)) { -+ s->max_ra = s->poc; -+-- -+2.5.0 -+ -+ -+From 04e23231d9f7c40c6b6d124a048fac976f302a52 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 3 Jun 2015 09:15:38 +0100 -+Subject: [PATCH 52/68] Fixed cache flushing of luma when using old method -+ -+--- -+ libavcodec/hevc_filter.c | 2 +- -+ 1 file changed, 1 insertion(+), 1 deletion(-) -+ -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 14a0952..b286bbf 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -919,7 +919,7 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ flush_buffer(s->frame->buf[1]); -+ flush_buffer(s->frame->buf[2]); -+ #ifdef RPI_LUMA_QPU -+- flush_buffer(s->frame->buf[1]); -++ flush_buffer(s->frame->buf[0]); -+ #endif -+ -+ #endif -+-- -+2.5.0 -+ -+ -+From 26eae6b28ba1027063a48258f47d4702ccba53cc Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 3 Jun 2015 11:37:27 +0100 -+Subject: [PATCH 53/68] Option to parallelise coefficient decode and inter -+ prediction and deblock for each frame -+ -+--- -+ libavcodec/hevc.c | 701 +++++++++++++++++++++++++++-------------- -+ libavcodec/hevc.h | 74 +++-- -+ libavcodec/hevc_cabac.c | 12 +- -+ libavcodec/hevcpred_template.c | 5 +- -+ 4 files changed, 522 insertions(+), 270 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 0324968..6f67872 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -43,8 +43,6 @@ -+ -+ #ifdef RPI -+ #include "rpi_qpu.h" -+- // For some unknown reason, the code seems to crash if I do a late malloc -+- //#define EARLY_MALLOC -+ // Move Inter prediction into separate pass -+ #define RPI_INTER -+ -+@@ -58,6 +56,21 @@ -+ -+ // Define RPI_SIMULATE_QPUS for debugging to run QPU code on the ARMs -+ //#define RPI_SIMULATE_QPUS -++ #ifdef RPI_WORKER -++ #include "pthread.h" -++ #endif -++ -++ static void rpi_execute_dblk_cmds(HEVCContext *s); -++ static void rpi_execute_transform(HEVCContext *s); -++ static void rpi_execute_inter_qpu(HEVCContext *s); -++ static void rpi_execute_pred_cmds(HEVCContext *s); -++ static void rpi_execute_inter_cmds(HEVCContext *s); -++ static void rpi_inter_clear(HEVCContext *s); -++ -++ // Define INTER_PASS0 to do inter prediction in first pass -++ //#define INTER_PASS0 -++ // Define LAUNCH_PASS0 to launch QPU/VPU from pass0 -++ //#define LAUNCH_PASS0 -+ -+ #endif -+ -+@@ -105,6 +118,143 @@ static uint32_t get_vc_address(AVBufferRef *bref) { -+ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+ return p->vc; -+ } -++#endif -++ -++ -++#ifdef RPI_WORKER -++ -++//#define LOG_ENTER printf("Enter %s: p0=%d p1=%d (%d jobs) %p\n", __func__,s->pass0_job,s->pass1_job,s->worker_tail-s->worker_head,s); -++//#define LOG_EXIT printf("Exit %s: p0=%d p1=%d (%d jobs) %p\n", __func__,s->pass0_job,s->pass1_job,s->worker_tail-s->worker_head,s); -++ -++#define LOG_ENTER -++#define LOG_EXIT -++ -++// Call this when we have completed pass0 and wish to trigger pass1 for the current job -++static void worker_submit_job(HEVCContext *s) -++{ -++ LOG_ENTER -++ //pthread_mutex_lock(&s->worker_mutex); -++ s->worker_tail++; // This is the only place that can change tail so we do not need the mutex -++ s->pass0_job = (s->pass0_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -++ pthread_cond_broadcast(&s->worker_cond_tail); // Let people know that the tail has moved -++ //pthread_mutex_unlock(&s->worker_mutex); -++ LOG_EXIT -++} -++ -++// Call this to say we have completed pass1 -++static void worker_complete_middle_job(HEVCContext *s) -++{ -++ LOG_ENTER -++ //pthread_mutex_lock(&s->worker_mutex); -++ s->worker_middle++; // This is the only place that can change head so we do not need the mutex -++ s->pass1_job = (s->pass1_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -++ pthread_cond_broadcast(&s->worker_cond_middle); // Let people know that the tail has moved -++ //pthread_mutex_unlock(&s->worker_mutex); -++ LOG_EXIT -++} -++ -++// Call this to say we have completed pass2 -++static void worker_complete_job(HEVCContext *s) -++{ -++ LOG_ENTER -++ //pthread_mutex_lock(&s->worker_mutex); -++ s->worker_head++; // This is the only place that can change head so we do not need the mutex -++ s->pass2_job = (s->pass2_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -++ pthread_cond_broadcast(&s->worker_cond_head); // Let people know that the tail has moved -++ //pthread_mutex_unlock(&s->worker_mutex); -++ LOG_EXIT -++} -++ -++// Call this to wait for all jobs to have completed at the end of a frame -++static void worker_wait(HEVCContext *s) -++{ -++ LOG_ENTER -++ pthread_mutex_lock(&s->worker_mutex); -++ while( s->worker_head !=s->worker_tail) -++ { -++ pthread_cond_wait(&s->worker_cond_head, &s->worker_mutex); -++ } -++ pthread_mutex_unlock(&s->worker_mutex); -++ LOG_EXIT -++} -++ -++// Call worker_pass0_ready to wait until the s->pass0_job slot becomes -++// available to receive the next job. -++static void worker_pass0_ready(HEVCContext *s) -++{ -++ LOG_ENTER -++ pthread_mutex_lock(&s->worker_mutex); -++ // tail is number of submitted jobs -++ // head is number of completed jobs -++ // tail-head is number of outstanding jobs in the queue -++ // we need to ensure there is at least 1 space left for us to use -++ while( s->worker_tail - s->worker_head >= RPI_MAX_JOBS) -++ { -++ // Wait until another job is completed -++ pthread_cond_wait(&s->worker_cond_head, &s->worker_mutex); -++ } -++ pthread_mutex_unlock(&s->worker_mutex); -++ LOG_EXIT -++} -++ -++static void *worker_start(void *arg) -++{ -++ HEVCContext *s = (HEVCContext *)arg; -++ while(1) { -++ pthread_mutex_lock(&s->worker_mutex); -++ -++ while( !s->kill_worker && s->worker_tail - s->worker_middle <= 0) -++ { -++ pthread_cond_wait(&s->worker_cond_tail, &s->worker_mutex); -++ } -++ pthread_mutex_unlock(&s->worker_mutex); -++ -++ if (s->kill_worker) { -++ break; -++ } -++ LOG_ENTER -++ // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -++#ifndef LAUNCH_PASS0 -++ rpi_execute_inter_qpu(s); -++#endif -++#ifndef INTER_PASS0 -++ // Perform inter prediction -++ rpi_execute_inter_cmds(s); -++#endif -++ // Wait for transform completion -++ vpu_wait(s->vpu_id); -++ -++ worker_complete_middle_job(s); -++ LOG_EXIT -++ } -++ return NULL; -++} -++ -++static void *worker_deblock_start(void *arg) -++{ -++ HEVCContext *s = (HEVCContext *)arg; -++ while(1) { -++ pthread_mutex_lock(&s->worker_mutex); -++ while( !s->kill_worker && s->worker_middle - s->worker_head <= 0) -++ { -++ pthread_cond_wait(&s->worker_cond_middle, &s->worker_mutex); -++ } -++ pthread_mutex_unlock(&s->worker_mutex); -++ -++ if (s->kill_worker) { -++ break; -++ } -++ LOG_ENTER -++ // Perform intra prediction and residual reconstruction -++ rpi_execute_pred_cmds(s); -++ // Perform deblocking for CTBs in this row -++ rpi_execute_dblk_cmds(s); -++ -++ worker_complete_job(s); -++ LOG_EXIT -++ } -++ return NULL; -++} -+ -+ #endif -+ -+@@ -121,19 +271,18 @@ static uint32_t get_vc_address(AVBufferRef *bref) { -+ static void pic_arrays_free(HEVCContext *s) -+ { -+ #ifdef RPI -+- -+-#ifdef EARLY_MALLOC -+-#else -+- if (s->coeffs_buf_arm[0]) { -+- gpu_free(&s->coeffs_buf_default); -+- s->coeffs_buf_arm[0] = 0; -+- } -+- if (s->coeffs_buf_arm[2]) { -+- gpu_free(&s->coeffs_buf_accelerated); -+- s->coeffs_buf_arm[2] = 0; -++ int job; -++ for(job=0;jobcoeffs_buf_arm[job][0]) { -++ gpu_free(&s->coeffs_buf_default[job]); -++ s->coeffs_buf_arm[job][0] = 0; -++ } -++ if (s->coeffs_buf_arm[job][2]) { -++ gpu_free(&s->coeffs_buf_accelerated[job]); -++ s->coeffs_buf_arm[job][2] = 0; -++ } -+ } -+ #endif -+-#endif -+ av_freep(&s->sao); -+ av_freep(&s->deblock); -+ -+@@ -171,24 +320,26 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ int min_pu_size = sps->min_pu_width * sps->min_pu_height; -+ -+ #ifdef RPI -+-#ifdef EARLY_MALLOC -+-#else -+ av_assert0(sps); -+ int coeffs_in_ctb = (1 << sps->log2_ctb_size) * (1 << sps->log2_ctb_size); -+ int coefs_per_row = sps->ctb_width * coeffs_in_ctb * 3; // Allow space for chroma -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -+- s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -+- if (!s->coeffs_buf_arm[0]) -+- goto fail; -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated); -+- s->coeffs_buf_arm[2] = (int16_t*) s->coeffs_buf_accelerated.arm; -+- s->coeffs_buf_vc[2] = s->coeffs_buf_accelerated.vc; -+- if (!s->coeffs_buf_arm[2]) -+- goto fail; -+- s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -+- s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -+- printf("Done\n"); -+-#endif -++ int job; -++ for(job=0;jobcoeffs_buf_default[job]); -++ s->coeffs_buf_arm[job][0] = (int16_t*) s->coeffs_buf_default[job].arm; -++ if (!s->coeffs_buf_arm[job][0]) -++ goto fail; -++ gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated[job]); -++ s->coeffs_buf_arm[job][2] = (int16_t*) s->coeffs_buf_accelerated[job].arm; -++ s->coeffs_buf_vc[job][2] = s->coeffs_buf_accelerated[job].vc; -++ if (!s->coeffs_buf_arm[job][2]) -++ goto fail; -++ s->coeffs_buf_arm[job][3] = coefs_per_row + s->coeffs_buf_arm[job][2]; -++ s->coeffs_buf_vc[job][3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[job][2]; -++ } -++ } -+ #endif -+ -+ s->bs_width = (width >> 2) + 1; -+@@ -1025,7 +1176,7 @@ static void rpi_intra_pred(HEVCContext *s, int log2_trafo_size, int x0, int y0, -+ { -+ if (s->enable_rpi) { -+ HEVCLocalContext *lc = s->HEVClc; -+- HEVCPredCmd *cmd = s->univ_pred_cmds + s->num_pred_cmds++; -++ HEVCPredCmd *cmd = s->univ_pred_cmds[s->pass0_job] + s->num_pred_cmds[s->pass0_job]++; -+ cmd->type = RPI_PRED_INTRA; -+ cmd->size = log2_trafo_size; -+ cmd->c_idx = c_idx; -+@@ -1485,7 +1636,7 @@ static void rpi_luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref, const Mv *mv, int x_off, int y_off, -+ int block_w, int block_h, int luma_weight, int luma_offset) -+ { -+- HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds[s->pass0_job] + s->num_mv_cmds[s->pass0_job]++; -+ cmd->cmd = RPI_CMD_LUMA_UNI; -+ cmd->dst = dst; -+ cmd->dststride = dststride; -+@@ -1504,7 +1655,7 @@ static void rpi_luma_mc_bi(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, -+ AVFrame *ref0, const Mv *mv0, int x_off, int y_off, -+ int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) -+ { -+- HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds[s->pass0_job] + s->num_mv_cmds[s->pass0_job]++; -+ cmd->cmd = RPI_CMD_LUMA_BI; -+ cmd->dst = dst; -+ cmd->dststride = dststride; -+@@ -1526,7 +1677,7 @@ static void rpi_chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -+ ptrdiff_t dststride, uint8_t *src0, ptrdiff_t srcstride, int reflist, -+ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int chroma_weight, int chroma_offset) -+ { -+- HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds[s->pass0_job] + s->num_mv_cmds[s->pass0_job]++; -+ cmd->cmd = RPI_CMD_CHROMA_UNI; -+ cmd->dst = dst0; -+ cmd->dststride = dststride; -+@@ -1544,7 +1695,7 @@ static void rpi_chroma_mc_uni(HEVCContext *s, uint8_t *dst0, -+ static void rpi_chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1, -+ int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx) -+ { -+- HEVCMvCmd *cmd = s->unif_mv_cmds + s->num_mv_cmds++; -++ HEVCMvCmd *cmd = s->unif_mv_cmds[s->pass0_job] + s->num_mv_cmds[s->pass0_job]++; -+ cmd->cmd = RPI_CMD_CHROMA_BI+cidx; -+ cmd->dst = dst0; -+ cmd->dststride = dststride; -+@@ -2026,7 +2177,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int chan = x0>>6; // 64 wide blocks per QPU -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+- uint32_t *y = s->y_mvs[chan % 12]; -++ uint32_t *y = s->y_mvs[s->pass0_job][chan % 12]; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=16) { -+ int bw = nPbW-start_x; -+@@ -2046,7 +2197,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -+ } -+ } -+- s->y_mvs[chan % 12] = y; -++ s->y_mvs[s->pass0_job][chan % 12] = y; -+ } else -+ #endif -+ { -+@@ -2075,7 +2226,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+- uint32_t *u = s->u_mvs[chan & 7]; -++ uint32_t *u = s->u_mvs[s->pass0_job][chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ int bw = nPbW_c-start_x; -+@@ -2099,7 +2250,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+- s->u_mvs[chan & 7] = u; -++ s->u_mvs[s->pass0_job][chan & 7] = u; -+ return; -+ } -+ #endif -+@@ -2129,7 +2280,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int chan = x0>>6; // 64 wide blocks per QPU -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+- uint32_t *y = s->y_mvs[chan % 12]; -++ uint32_t *y = s->y_mvs[s->pass0_job][chan % 12]; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=16) { -+ int bw = nPbW-start_x; -+@@ -2149,7 +2300,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -+ } -+ } -+- s->y_mvs[chan % 12] = y; -++ s->y_mvs[s->pass0_job][chan % 12] = y; -+ } else -+ #endif -+ -+@@ -2179,7 +2330,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+- uint32_t *u = s->u_mvs[chan & 7]; -++ uint32_t *u = s->u_mvs[s->pass0_job][chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ int bw = nPbW_c-start_x; -+@@ -2204,7 +2355,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+- s->u_mvs[chan & 7] = u; -++ s->u_mvs[s->pass0_job][chan & 7] = u; -+ return; -+ } -+ #endif -+@@ -2238,7 +2389,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int x2 = x0 + (mv2->x >> 2); -+ int y2 = y0 + (mv2->y >> 2); -+ int chan = x0>>6; // 64 wide blocks per QPU -+- uint32_t *y = s->y_mvs[chan % 12]; -++ uint32_t *y = s->y_mvs[s->pass0_job][chan % 12]; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=8) { // B blocks work 8 at a time -+ int bw = nPbW-start_x; -+@@ -2254,7 +2405,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter_b; -+ } -+ } -+- s->y_mvs[chan % 12] = y; -++ s->y_mvs[s->pass0_job][chan % 12] = y; -+ } else -+ #endif -+ { -+@@ -2287,7 +2438,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ -+ int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -+ -+- uint32_t *u = s->u_mvs[chan & 7]; -++ uint32_t *u = s->u_mvs[s->pass0_job][chan & 7]; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ int bw = nPbW_c-start_x; -+@@ -2316,7 +2467,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+- s->u_mvs[chan & 7] = u; -++ s->u_mvs[s->pass0_job][chan & 7] = u; -+ return; -+ } -+ #endif -+@@ -2821,40 +2972,54 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, -+ static void rpi_execute_dblk_cmds(HEVCContext *s) -+ { -+ int n; -++ int job = s->pass2_job; -+ int ctb_size = 1 << s->ps.sps->log2_ctb_size; -+- int (*p)[2] = s->dblk_cmds; -+- for(n = s->num_dblk_cmds; n>0 ;n--,p++) { -++ int (*p)[2] = s->dblk_cmds[job]; -++ for(n = s->num_dblk_cmds[job]; n>0 ;n--,p++) { -+ ff_hevc_hls_filters(s, (*p)[0], (*p)[1], ctb_size); -+ } -+- s->num_dblk_cmds = 0; -++ s->num_dblk_cmds[job] = 0; -+ } -+ -+ static void rpi_execute_transform(HEVCContext *s) -+ { -+ int i=2; -++#ifdef LAUNCH_PASS0 -++ int job = s->pass0_job; -++#else -++ int job = s->pass1_job; -++#endif -+ //int j; -+ //int16_t *coeffs = s->coeffs_buf_arm[i]; -+ //for(j=s->num_coeffs[i]; j > 0; j-= 16*16, coeffs+=16*16) { -+ // s->hevcdsp.idct[4-2](coeffs, 16); -+ //} -+ -+- gpu_cache_flush(&s->coeffs_buf_accelerated); -+- s->vpu_id = vpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0, &s->coeffs_buf_accelerated); -++ gpu_cache_flush(&s->coeffs_buf_accelerated[job]); -++ s->vpu_id = vpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], -++ s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], -++ s->num_coeffs[job][3] >> 10, 0, &s->coeffs_buf_accelerated[job]); -+ //vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0); -+ //gpu_cache_flush(&s->coeffs_buf_accelerated); -+ //vpu_wait(s->vpu_id); -+ -+ for(i=0;i<4;i++) -+- s->num_coeffs[i] = 0; -++ s->num_coeffs[job][i] = 0; -+ } -+ -+ static void rpi_execute_pred_cmds(HEVCContext *s) -+ { -+ int i; -+- HEVCPredCmd *cmd = s->univ_pred_cmds; -++ int job = s->pass2_job; -++ HEVCPredCmd *cmd = s->univ_pred_cmds[job]; -++#ifdef RPI_WORKER -++ HEVCLocalContextIntra *lc = &s->HEVClcIntra; -++#else -+ HEVCLocalContext *lc = s->HEVClc; -++#endif -+ -+- for(i = s->num_pred_cmds; i > 0; i--, cmd++) { -++ for(i = s->num_pred_cmds[job]; i > 0; i--, cmd++) { -++ //printf("i=%d cmd=%p job1=%d job0=%d\n",i,cmd,s->pass1_job,s->pass0_job); -+ if (cmd->type == RPI_PRED_INTRA) { -+ lc->tu.intra_pred_mode_c = lc->tu.intra_pred_mode = cmd->mode; -+ lc->na.cand_bottom_left = (cmd->na >> 4) & 1; -+@@ -2873,21 +3038,26 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ #endif -+ } -+ } -+- s->num_pred_cmds = 0; -++ s->num_pred_cmds[job] = 0; -+ } -+ -+ static void rpi_execute_inter_cmds(HEVCContext *s) -+ { -+- HEVCMvCmd *cmd = s->unif_mv_cmds; -++#ifdef INTER_PASS0 -++ int job = s->pass0_job; -++#else -++ int job = s->pass1_job; -++#endif -++ HEVCMvCmd *cmd = s->unif_mv_cmds[job]; -+ int n,cidx; -+ AVFrame myref; -+ AVFrame myref1; -+ struct MvField mymv; -+- if (s->num_mv_cmds > RPI_MAX_MV_CMDS) { -++ if (s->num_mv_cmds[job] > RPI_MAX_MV_CMDS) { -+ printf("Overflow inter_cmds\n"); -+ exit(-1); -+ } -+- for(n = s->num_mv_cmds; n>0 ; n--, cmd++) { -++ for(n = s->num_mv_cmds[job]; n>0 ; n--, cmd++) { -+ switch(cmd->cmd) { -+ case RPI_CMD_LUMA_UNI: -+ myref.data[0] = cmd->src; -+@@ -2927,7 +3097,28 @@ static void rpi_execute_inter_cmds(HEVCContext *s) -+ break; -+ } -+ } -+- s->num_mv_cmds = 0; -++ s->num_mv_cmds[job] = 0; -++} -++ -++static void rpi_do_all_passes(HEVCContext *s) -++{ -++#ifdef RPI_INTER_QPU -++ // Kick off inter prediction on QPUs -++ rpi_execute_inter_qpu(s); -++#else -++ rpi_execute_transform(s); -++#endif -++ // Perform luma inter prediction -++ rpi_execute_inter_cmds(s); -++ // Wait for transform completion -++ vpu_wait(s->vpu_id); -++ // Perform intra prediction and residual reconstruction -++ rpi_execute_pred_cmds(s); -++ // Perform deblocking for CTBs in this row -++ rpi_execute_dblk_cmds(s); -++#ifdef RPI_INTER_QPU -++ rpi_inter_clear(s); -++#endif -+ } -+ -+ #endif -+@@ -2935,6 +3126,7 @@ static void rpi_execute_inter_cmds(HEVCContext *s) -+ #ifdef RPI_INTER_QPU -+ static void rpi_inter_clear(HEVCContext *s) -+ { -++ int job = s->pass0_job; -+ int i; -+ int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; -+ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; -+@@ -2942,51 +3134,50 @@ static void rpi_inter_clear(HEVCContext *s) -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+ for(i=0;i<8;i++) { -+- s->u_mvs[i] = s->mvs_base[i]; -+- *s->u_mvs[i]++ = 0; -+- *s->u_mvs[i]++ = 0; -+- *s->u_mvs[i]++ = 0; -+- *s->u_mvs[i]++ = 0; -+- *s->u_mvs[i]++ = 0; -+- *s->u_mvs[i]++ = pic_width; -+- *s->u_mvs[i]++ = pic_height; -+- *s->u_mvs[i]++ = s->frame->linesize[1]; -+- *s->u_mvs[i]++ = s->frame->linesize[2]; -++ s->u_mvs[job][i] = s->mvs_base[job][i]; -++ *s->u_mvs[job][i]++ = 0; -++ *s->u_mvs[job][i]++ = 0; -++ *s->u_mvs[job][i]++ = 0; -++ *s->u_mvs[job][i]++ = 0; -++ *s->u_mvs[job][i]++ = 0; -++ *s->u_mvs[job][i]++ = pic_width; -++ *s->u_mvs[job][i]++ = pic_height; -++ *s->u_mvs[job][i]++ = s->frame->linesize[1]; -++ *s->u_mvs[job][i]++ = s->frame->linesize[2]; -+ if (weight_flag) { -+- *s->u_mvs[i]++ = 1 << (s->sh.chroma_log2_weight_denom + 6 - 1); -+- *s->u_mvs[i]++ = s->sh.chroma_log2_weight_denom + 6; -++ *s->u_mvs[job][i]++ = 1 << (s->sh.chroma_log2_weight_denom + 6 - 1); -++ *s->u_mvs[job][i]++ = s->sh.chroma_log2_weight_denom + 6; -+ } else { -+- *s->u_mvs[i]++ = 1 << 5; -+- *s->u_mvs[i]++ = 6; -++ *s->u_mvs[job][i]++ = 1 << 5; -++ *s->u_mvs[job][i]++ = 6; -+ } -+- *s->u_mvs[i]++ = i; // Select section of VPM (avoid collisions with 3d unit) -++ *s->u_mvs[job][i]++ = i; // Select section of VPM (avoid collisions with 3d unit) -+ } -+ -+ #ifdef RPI_LUMA_QPU -+ for(i=0;i<12;i++) { -+- s->y_mvs[i] = s->y_mvs_base[i]; -+- *s->y_mvs[i]++ = 0; // y_x -+- *s->y_mvs[i]++ = 0; // ref_y_base -+- *s->y_mvs[i]++ = 0; // y2_x2 -+- *s->y_mvs[i]++ = 0; // ref_y2_base -+- *s->y_mvs[i]++ = (s->ps.sps->width << 16) + s->ps.sps->height; -+- *s->y_mvs[i]++ = s->frame->linesize[0]; // pitch -+- *s->y_mvs[i]++ = s->frame->linesize[0]; // dst_pitch -++ s->y_mvs[job][i] = s->y_mvs_base[job][i]; -++ *s->y_mvs[job][i]++ = 0; // y_x -++ *s->y_mvs[job][i]++ = 0; // ref_y_base -++ *s->y_mvs[job][i]++ = 0; // y2_x2 -++ *s->y_mvs[job][i]++ = 0; // ref_y2_base -++ *s->y_mvs[job][i]++ = (s->ps.sps->width << 16) + s->ps.sps->height; -++ *s->y_mvs[job][i]++ = s->frame->linesize[0]; // pitch -++ *s->y_mvs[job][i]++ = s->frame->linesize[0]; // dst_pitch -+ if (weight_flag) { -+ int offset = 1 << (s->sh.luma_log2_weight_denom + 6 - 1); -+ int shift = s->sh.luma_log2_weight_denom + 6; -+- *s->y_mvs[i]++ = (offset << 16) + shift; -++ *s->y_mvs[job][i]++ = (offset << 16) + shift; -+ } else { -+ int offset = 1 << 5; -+ int shift = 6; -+- *s->y_mvs[i]++ = (offset << 16) + shift; -++ *s->y_mvs[job][i]++ = (offset << 16) + shift; -+ } -+- *s->y_mvs[i]++ = 0; // Next kernel -++ *s->y_mvs[job][i]++ = 0; // Next kernel -+ } -+ #endif -+ } -+ -+- -+ #ifdef RPI_SIMULATE_QPUS -+ -+ static int32_t clipx(int x,int FRAME_WIDTH) -+@@ -3260,10 +3451,15 @@ static void rpi_simulate_inter_qpu(HEVCContext *s) -+ static void rpi_execute_inter_qpu(HEVCContext *s) -+ { -+ int k; -++#ifdef LAUNCH_PASS0 -++ int job = s->pass0_job; -++#else -++ int job = s->pass1_job; -++#endif -+ int i; -+- uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr.vc; -++ uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr[job].vc; -+ #ifdef RPI_LUMA_QPU -+- uint32_t *y_unif_vc = (uint32_t *)s->y_unif_mvs_ptr.vc; -++ uint32_t *y_unif_vc = (uint32_t *)s->y_unif_mvs_ptr[job].vc; -+ #endif -+ if (s->sh.slice_type == I_SLICE) { -+ #ifdef RPI_MULTI_MAILBOX -+@@ -3272,22 +3468,22 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ #endif -+ } -+ for(k=0;k<8;k++) { -+- s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+- s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+- s->u_mvs[k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for V -+- av_assert0(s->u_mvs[k] - s->mvs_base[k] < UV_COMMANDS_PER_QPU); -++ s->u_mvs[job][k][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -++ s->u_mvs[job][k][-RPI_CHROMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ s->u_mvs[job][k][-RPI_CHROMA_COMMAND_WORDS+4] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for V -++ av_assert0(s->u_mvs[job][k] - s->mvs_base[job][k] < UV_COMMANDS_PER_QPU); -+ } -+ -+- s->u_mvs[8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -++ s->u_mvs[job][8-1][-RPI_CHROMA_COMMAND_WORDS] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT8); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+ -+ #ifdef RPI_LUMA_QPU -+ for(k=0;k<12;k++) { -+- s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+1] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -+- s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for second request -+- s->y_mvs[k][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -+- av_assert0(s->y_mvs[k] - s->y_mvs_base[k] < Y_COMMANDS_PER_QPU); -++ s->y_mvs[job][k][-RPI_LUMA_COMMAND_WORDS+1] = qpu_get_fn(QPU_MC_SETUP_UV); // A dummy texture location (maps to our code) - this is needed as the texture requests are pipelined -++ s->y_mvs[job][k][-RPI_LUMA_COMMAND_WORDS+3] = qpu_get_fn(QPU_MC_SETUP_UV); // Also need a dummy for second request -++ s->y_mvs[job][k][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_EXIT); // Add exit command -++ av_assert0(s->y_mvs[job][k] - s->y_mvs_base[job][k] < Y_COMMANDS_PER_QPU); -+ } -+- s->y_mvs[12-1][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT12); // This QPU will signal interrupt when all others are done and have acquired a semaphore -++ s->y_mvs[job][12-1][-RPI_LUMA_COMMAND_WORDS+8] = qpu_get_fn(QPU_MC_INTERRUPT_EXIT12); // This QPU will signal interrupt when all others are done and have acquired a semaphore -+ #endif -+ -+ #ifdef RPI_SIMULATE_QPUS -+@@ -3297,34 +3493,34 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ -+ #ifdef RPI_MULTI_MAILBOX -+ #ifdef RPI_CACHE_UNIF_MVS -+- gpu_cache_flush3(&s->coeffs_buf_accelerated,&s->y_unif_mvs_ptr, &s->unif_mvs_ptr); -++ gpu_cache_flush3(&s->coeffs_buf_accelerated[job],&s->y_unif_mvs_ptr[job], &s->unif_mvs_ptr[job]); -+ #else -+- gpu_cache_flush(&s->coeffs_buf_accelerated); -++ gpu_cache_flush(&s->coeffs_buf_accelerated[job]); -+ #endif -+- s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0, -++ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], s->num_coeffs[job][3] >> 10, 0, -+ qpu_get_fn(QPU_MC_SETUP_UV), -+- (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[1 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[2 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[3 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[4 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[5 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][0 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][1 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][2 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][3 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][4 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][5 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][6 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][7 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -+ #ifdef RPI_LUMA_QPU -+ qpu_get_fn(QPU_MC_SETUP), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[0 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[1 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[2 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[3 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[4 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[5 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[6 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[7 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[8 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[9 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[10 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)), -+- (uint32_t)(y_unif_vc+(s->y_mvs_base[11 ] - (uint32_t*)s->y_unif_mvs_ptr.arm)) -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][0 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][1 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][2 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][3 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][4 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][5 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][6 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][7 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][8 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][9 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][10 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)), -++ (uint32_t)(y_unif_vc+(s->y_mvs_base[job][11 ] - (uint32_t*)s->y_unif_mvs_ptr[job].arm)) -+ #else -+ 0, -+ 0,0,0,0, -+@@ -3333,17 +3529,17 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ #endif -+ ); -+ for(i=0;i<4;i++) -+- s->num_coeffs[i] = 0; -++ s->num_coeffs[job][i] = 0; -+ #else -+ qpu_run_shader8(qpu_get_fn(QPU_MC_SETUP_UV), -+- (uint32_t)(unif_vc+(s->mvs_base[0 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[1 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[2 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[3 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[4 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[5 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[6 ] - (uint32_t*)s->unif_mvs_ptr.arm)), -+- (uint32_t)(unif_vc+(s->mvs_base[7 ] - (uint32_t*)s->unif_mvs_ptr.arm)) -++ (uint32_t)(unif_vc+(s->mvs_base[job][0 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][1 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][2 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][3 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][4 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][5 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][6 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -++ (uint32_t)(unif_vc+(s->mvs_base[job][7 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)) -+ ); -+ #endif -+ -+@@ -3400,6 +3596,11 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ } -+ } -+ -++#ifdef RPI_WORKER -++ s->pass0_job = 0; -++ s->pass1_job = 0; -++ s->pass2_job = 0; -++#endif -+ #ifdef RPI_INTER_QPU -+ rpi_inter_clear(s); -+ #endif -+@@ -3420,46 +3621,42 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag; -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -++ -+ #ifdef RPI -+ if (s->enable_rpi) { -+- s->dblk_cmds[s->num_dblk_cmds][0] = x_ctb; -+- s->dblk_cmds[s->num_dblk_cmds++][1] = y_ctb; -++ s->dblk_cmds[s->pass0_job][s->num_dblk_cmds[s->pass0_job]][0] = x_ctb; -++ s->dblk_cmds[s->pass0_job][s->num_dblk_cmds[s->pass0_job]++][1] = y_ctb; -+ if ( (((y_ctb + ctb_size)&63) == 0) && x_ctb + ctb_size >= s->ps.sps->width) { -+- // Transform all blocks -+- // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+-#ifdef RPI_MULTI_MAILBOX -+- // Kick off inter prediction on QPUs -+- rpi_execute_inter_qpu(s); -+- // Perform luma inter prediction -+- rpi_execute_inter_cmds(s); -+-#else -+- rpi_execute_transform(s); -+- // Perform inter prediction -+- rpi_execute_inter_cmds(s); -+-#ifdef RPI_INTER_QPU -+- // Kick off inter prediction on QPUs -+- rpi_execute_inter_qpu(s); -+-#endif -+-#endif -+- -+- // Wait for transform completion -+- vpu_wait(s->vpu_id); -+- -+- // Copy back reconstructed data -+- //memcpy(s->frame->data[0],s->dummy.arm,2048*64); -+- //memcpy(s->frame->data[1],s->dummy.arm,1024*32); -+- //memcpy(s->frame->data[2],s->dummy.arm,1024*32); -++#ifdef RPI_WORKER -++ if (s->used_for_ref) { -++ // Split work load onto separate threads so we make as rapid progress as possible with this frame -++ #ifdef INTER_PASS0 -++ rpi_execute_inter_cmds(s); -++ #endif -++ #ifdef LAUNCH_PASS0 -++ rpi_execute_inter_qpu(s); -++ #endif -++ // Pass on this job to worker thread -++ worker_submit_job(s); -++ // Make sure we have space to prepare the next job -++ worker_pass0_ready(s); -+ -+- // Perform intra prediction and residual reconstruction -+- rpi_execute_pred_cmds(s); -+- // Perform deblocking for CTBs in this row -+- rpi_execute_dblk_cmds(s); -++ // Prepare the next batch of commands -+ #ifdef RPI_INTER_QPU -+- rpi_inter_clear(s); -++ rpi_inter_clear(s); -++#endif -++ } else { -++ // Non-ref frame so do it all on this thread -++ rpi_do_all_passes(s); -++ } -++#else -++ rpi_do_all_passes(s); -+ #endif -+ } -+ } -+ #endif -++ -++ -+ if (more_data < 0) { -+ s->tab_slice_address[ctb_addr_rs] = -1; -+ return more_data; -+@@ -3476,18 +3673,21 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ } -+ -+ #ifdef RPI -+- if (s->enable_rpi && s->num_dblk_cmds) { -+-#ifdef RPI_INTER_QPU -+- rpi_execute_inter_qpu(s); -+-#endif -+-#ifndef RPI_MULTI_MAILBOX -+- rpi_execute_transform(s); -++ -++#ifdef RPI_WORKER -++ // Wait for the worker to finish all its jobs -++ if (s->enable_rpi) { -++ worker_wait(s); -++ av_assert0(s->pass0_job==s->pass1_job); -++ av_assert0(s->pass1_job==s->pass2_job); -++ } -+ #endif -+- rpi_execute_inter_cmds(s); -+- vpu_wait(s->vpu_id); -+- rpi_execute_pred_cmds(s); -+- rpi_execute_dblk_cmds(s); -++ -++ // Finish off any half-completed rows -++ if (s->enable_rpi && s->num_dblk_cmds[s->pass0_job]) { -++ rpi_do_all_passes(s); -+ } -++ -+ #endif -+ -+ if (x_ctb + ctb_size >= s->ps.sps->width && -+@@ -4219,6 +4419,48 @@ fail: -+ return AVERROR(ENOMEM); -+ } -+ -++#ifdef RPI_WORKER -++static av_cold void hevc_init_worker(HEVCContext *s) -++{ -++ int err; -++ pthread_cond_init(&s->worker_cond_head, NULL); -++ pthread_cond_init(&s->worker_cond_middle, NULL); -++ pthread_cond_init(&s->worker_cond_tail, NULL); -++ pthread_mutex_init(&s->worker_mutex, NULL); -++ -++ s->worker_tail=0; -++ s->worker_middle=0; -++ s->worker_head=0; -++ s->kill_worker=0; -++ err = pthread_create(&s->worker_thread, NULL, worker_start, s); -++ err = pthread_create(&s->worker_deblock_thread, NULL, worker_deblock_start, s); -++ if (err) { -++ printf("Failed to create worker thread\n"); -++ exit(-1); -++ } -++} -++ -++static av_cold void hevc_exit_worker(HEVCContext *s) -++{ -++ void *res; -++ s->kill_worker=1; -++ pthread_cond_broadcast(&s->worker_cond_tail); -++ pthread_cond_broadcast(&s->worker_cond_middle); -++ pthread_join(s->worker_thread, &res); -++ pthread_join(s->worker_deblock_thread, &res); -++ -++ pthread_cond_destroy(&s->worker_cond_head); -++ pthread_cond_destroy(&s->worker_cond_middle); -++ pthread_cond_destroy(&s->worker_cond_tail); -++ pthread_mutex_destroy(&s->worker_mutex); -++ -++ s->worker_tail=0; -++ s->worker_middle=0; -++ s->worker_head=0; -++ s->kill_worker=0; -++} -++#endif -++ -+ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ { -+ HEVCContext *s = avctx->priv_data; -+@@ -4231,33 +4473,29 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) -+ av_freep(&s->cabac_state); -+ -+ #ifdef RPI -+- av_freep(&s->unif_mv_cmds); -+- av_freep(&s->univ_pred_cmds); -++ -++#ifdef RPI_WORKER -++ hevc_exit_worker(s); -++#endif -++ -++ for(i=0;iunif_mv_cmds[i]); -++ av_freep(&s->univ_pred_cmds[i]); -+ -+ #ifdef RPI_INTER_QPU -+- if (s->unif_mvs) { -+- gpu_free( &s->unif_mvs_ptr ); -+- s->unif_mvs = 0; -+- } -++ if (s->unif_mvs[i]) { -++ gpu_free( &s->unif_mvs_ptr[i] ); -++ s->unif_mvs[i] = 0; -++ } -+ #endif -+ #ifdef RPI_LUMA_QPU -+- if (s->y_unif_mvs) { -+- gpu_free( &s->y_unif_mvs_ptr ); -+- s->y_unif_mvs = 0; -+- } -++ if (s->y_unif_mvs[i]) { -++ gpu_free( &s->y_unif_mvs_ptr[i] ); -++ s->y_unif_mvs[i] = 0; -++ } -+ #endif -+- -+-#ifdef EARLY_MALLOC -+- printf("hevc_decode_free\n"); -+- if (s->coeffs_buf_arm[0]) { -+- gpu_free(&s->coeffs_buf_default); -+- s->coeffs_buf_arm[0] = 0; -+- } -+- if (s->coeffs_buf_arm[2]) { -+- gpu_free(&s->coeffs_buf_accelerated); -+- s->coeffs_buf_arm[2] = 0; -+ } -+-#endif -++ -+ #endif -+ -+ for (i = 0; i < 3; i++) { -+@@ -4322,6 +4560,7 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ { -+ HEVCContext *s = avctx->priv_data; -+ int i; -++ int job; -+ -+ s->avctx = avctx; -+ -+@@ -4332,12 +4571,14 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ s->sList[0] = s; -+ -+ #ifdef RPI -+- s->unif_mv_cmds = av_mallocz(sizeof(HEVCMvCmd)*RPI_MAX_MV_CMDS); -+- if (!s->unif_mv_cmds) -+- goto fail; -+- s->univ_pred_cmds = av_mallocz(sizeof(HEVCPredCmd)*RPI_MAX_PRED_CMDS); -+- if (!s->univ_pred_cmds) -+- goto fail; -++ for(job=0;jobunif_mv_cmds[job] = av_mallocz(sizeof(HEVCMvCmd)*RPI_MAX_MV_CMDS); -++ if (!s->unif_mv_cmds[job]) -++ goto fail; -++ s->univ_pred_cmds[job] = av_mallocz(sizeof(HEVCPredCmd)*RPI_MAX_PRED_CMDS); -++ if (!s->univ_pred_cmds[job]) -++ goto fail; -++ } -+ -+ #ifdef RPI_INTER_QPU -+ // We divide the image into blocks 256 wide and 64 high -+@@ -4348,18 +4589,20 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ { -+ int uv_commands_per_qpu = UV_COMMANDS_PER_QPU; -+ uint32_t *p; -++ for(job=0;jobunif_mvs_ptr ); -++ gpu_malloc_cached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr[job] ); -+ #else -+- gpu_malloc_uncached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr ); -++ gpu_malloc_uncached( 8 * uv_commands_per_qpu * sizeof(uint32_t), &s->unif_mvs_ptr[job] ); -+ #endif -+- s->unif_mvs = (uint32_t *) s->unif_mvs_ptr.arm; // TODO support this allocation in non EARLY_MALLOC -++ s->unif_mvs[job] = (uint32_t *) s->unif_mvs_ptr[job].arm; -+ -+- // Set up initial locations for uniform streams -+- p = s->unif_mvs; -+- for(i = 0; i < 8; i++) { -+- s->mvs_base[i] = p; -++ // Set up initial locations for uniform streams -++ p = s->unif_mvs[job]; -++ for(i = 0; i < 8; i++) { -++ s->mvs_base[job][i] = p; -+ p += uv_commands_per_qpu; -++ } -+ } -+ s->mc_filter_uv = qpu_get_fn(QPU_MC_FILTER_UV); -+ s->mc_filter_uv_b0 = qpu_get_fn(QPU_MC_FILTER_UV_B0); -+@@ -4368,61 +4611,35 @@ static av_cold int hevc_init_context(AVCodecContext *avctx) -+ } -+ #endif -+ #ifdef RPI_LUMA_QPU -++ for(job=0;joby_unif_mvs_ptr ); -++ gpu_malloc_cached( 12 * y_commands_per_qpu * sizeof(uint32_t), &s->y_unif_mvs_ptr[job] ); -+ #else -+- gpu_malloc_uncached( 12 * y_commands_per_qpu * sizeof(uint32_t), &s->y_unif_mvs_ptr ); -++ gpu_malloc_uncached( 12 * y_commands_per_qpu * sizeof(uint32_t), &s->y_unif_mvs_ptr[job] ); -+ #endif -+- s->y_unif_mvs = (uint32_t *) s->y_unif_mvs_ptr.arm; // TODO support this allocation in non EARLY_MALLOC -++ s->y_unif_mvs[job] = (uint32_t *) s->y_unif_mvs_ptr[job].arm; -+ -+ // Set up initial locations for uniform streams -+- p = s->y_unif_mvs; -++ p = s->y_unif_mvs[job]; -+ for(i = 0; i < 12; i++) { -+- s->y_mvs_base[i] = p; -++ s->y_mvs_base[job][i] = p; -+ p += y_commands_per_qpu; -+ } -+- s->mc_filter = qpu_get_fn(QPU_MC_FILTER); -+- s->mc_filter_b = qpu_get_fn(QPU_MC_FILTER_B); -+- -+ } -++ s->mc_filter = qpu_get_fn(QPU_MC_FILTER); -++ s->mc_filter_b = qpu_get_fn(QPU_MC_FILTER_B); -+ #endif -+ //gpu_malloc_uncached(2048*64,&s->dummy); -+ -+-#ifdef EARLY_MALLOC -+- { -+- int coeffs_in_ctb = 64*64; -+- int coefs_per_row = (2048/64) * coeffs_in_ctb * 3; // Allow space for chroma -+- s->coeffs_buf_arm[0] = 0; -+- s->coeffs_buf_arm[2] = 0; -+- printf("Allocated %d\n",coefs_per_row); -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row, &s->coeffs_buf_default); -+- s->coeffs_buf_arm[0] = (int16_t*) s->coeffs_buf_default.arm; -+- if (!s->coeffs_buf_arm[0]) -+- goto fail; -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated); -+- s->coeffs_buf_arm[2] = (int16_t*) s->coeffs_buf_accelerated.arm; -+- s->coeffs_buf_vc[2] = s->coeffs_buf_accelerated.vc; -+- if (!s->coeffs_buf_arm[2]) -+- goto fail; -+- s->coeffs_buf_arm[3] = coefs_per_row + s->coeffs_buf_arm[2]; -+- s->coeffs_buf_vc[3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[2]; -+- printf("Done\n"); -+-#ifdef RPI_PRECLEAR -+- //memset(s->coeffs_buf_arm[0],0, sizeof(int16_t) * coefs_per_row); -+- memclear16(s->coeffs_buf_arm[0], coefs_per_row); -+- //memset(s->coeffs_buf_arm[2],0, sizeof(int16_t) * coefs_per_row); -+- memclear16(s->coeffs_buf_arm[2], coefs_per_row); -+- //memset(s->coeffs_buf_arm[3],0, sizeof(int16_t) * coefs_per_row); -+- memclear16(s->coeffs_buf_arm[3], coefs_per_row); -+-#endif -+- } -+-#endif -+- -+ s->enable_rpi = 0; -+ -++#ifdef RPI_WORKER -++ hevc_init_worker(s); -++#endif -++ -+ #endif -+ -+ s->cabac_state = av_malloc(HEVC_CONTEXTS); -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 520d16f..b540ca5 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -50,6 +50,12 @@ -+ // Define RPI_LUMA_QPU to also use QPU for luma inter prediction -+ #define RPI_LUMA_QPU -+ #endif -++ -++ // By passing jobs to a worker thread we hope to be able to catch up during slow frames -++ #define RPI_MAX_JOBS 2 -++ // Define RPI_WORKER to launch a worker thread for pixel processing tasks -++ #define RPI_WORKER -++ -+ #endif -+ -+ #define MAX_DPB_SIZE 16 // A.4.1 -+@@ -832,6 +838,13 @@ typedef struct HEVCLocalContext { -+ int boundary_flags; -+ } HEVCLocalContext; -+ -++#ifdef RPI_WORKER -++typedef struct HEVCLocalContextIntra { -++ TransformUnit tu; -++ NeighbourAvailable na; -++} HEVCLocalContextIntra; -++#endif -++ -+ #ifdef RPI -+ -+ // RPI_MAX_WIDTH is maximum width in pixels supported by the accelerated code -+@@ -900,7 +913,7 @@ typedef struct HEVCPredCmd { -+ -+ typedef struct HEVCContext { -+ #ifdef RPI -+- int dblk_cmds[RPI_MAX_DEBLOCK_CMDS][2]; -++ int dblk_cmds[RPI_MAX_JOBS][RPI_MAX_DEBLOCK_CMDS][2]; -+ #endif -+ const AVClass *c; // needed by private avoptions -+ AVCodecContext *avctx; -+@@ -909,7 +922,9 @@ typedef struct HEVCContext { -+ -+ HEVCLocalContext *HEVClcList[MAX_NB_THREADS]; -+ HEVCLocalContext *HEVClc; -+- -++#ifdef RPI_WORKER -++ HEVCLocalContextIntra HEVClcIntra; -++#endif -+ uint8_t threads_type; -+ uint8_t threads_number; -+ -+@@ -920,43 +935,60 @@ typedef struct HEVCContext { -+ -+ #ifdef RPI -+ int enable_rpi; -+- HEVCMvCmd *unif_mv_cmds; -+- HEVCPredCmd *univ_pred_cmds; -++ HEVCMvCmd *unif_mv_cmds[RPI_MAX_JOBS]; -++ HEVCPredCmd *univ_pred_cmds[RPI_MAX_JOBS]; -+ int buf_width; -+- GPU_MEM_PTR_T coeffs_buf_default; -+- GPU_MEM_PTR_T coeffs_buf_accelerated; -+- int16_t *coeffs_buf_arm[4]; -+- unsigned int coeffs_buf_vc[4]; -+- int num_coeffs[4]; -+- int num_xfm_cmds; -+- int num_mv_cmds; -+- int num_pred_cmds; -+- int num_dblk_cmds; -++ GPU_MEM_PTR_T coeffs_buf_default[RPI_MAX_JOBS]; -++ GPU_MEM_PTR_T coeffs_buf_accelerated[RPI_MAX_JOBS]; -++ int16_t *coeffs_buf_arm[RPI_MAX_JOBS][4]; -++ unsigned int coeffs_buf_vc[RPI_MAX_JOBS][4]; -++ int num_coeffs[RPI_MAX_JOBS][4]; -++ int num_xfm_cmds[RPI_MAX_JOBS]; -++ int num_mv_cmds[RPI_MAX_JOBS]; -++ int num_pred_cmds[RPI_MAX_JOBS]; -++ int num_dblk_cmds[RPI_MAX_JOBS]; -+ int vpu_id; -+ //GPU_MEM_PTR_T dummy; -++ int pass0_job; // Pass0 does coefficient decode -++ int pass1_job; // Pass1 does pixel processing -++ int pass2_job; // Pass2 does reconstruction and deblocking -+ #ifdef RPI_INTER_QPU -+- GPU_MEM_PTR_T unif_mvs_ptr; -+- uint32_t *unif_mvs; // Base of memory for motion vector commands -++ GPU_MEM_PTR_T unif_mvs_ptr[RPI_MAX_JOBS]; -++ uint32_t *unif_mvs[RPI_MAX_JOBS]; // Base of memory for motion vector commands -+ -+ // _base pointers are to the start of the row -+- uint32_t *mvs_base[8]; -++ uint32_t *mvs_base[RPI_MAX_JOBS][8]; -+ // these pointers are to the next free space -+- uint32_t *u_mvs[8]; -++ uint32_t *u_mvs[RPI_MAX_JOBS][8]; -+ // Function pointers -+ uint32_t mc_filter_uv; -+ uint32_t mc_filter_uv_b0; -+ uint32_t mc_filter_uv_b; -+ #endif -+ #ifdef RPI_LUMA_QPU -+- GPU_MEM_PTR_T y_unif_mvs_ptr; -+- uint32_t *y_unif_mvs; // Base of memory for motion vector commands -+- uint32_t *y_mvs_base[12]; -+- uint32_t *y_mvs[12]; -++ GPU_MEM_PTR_T y_unif_mvs_ptr[RPI_MAX_JOBS]; -++ uint32_t *y_unif_mvs[RPI_MAX_JOBS]; // Base of memory for motion vector commands -++ uint32_t *y_mvs_base[RPI_MAX_JOBS][12]; -++ uint32_t *y_mvs[RPI_MAX_JOBS][12]; -+ // Function pointers -+ uint32_t mc_filter; -+ uint32_t mc_filter_b; -+ #endif -+ -++#ifdef RPI_WORKER -++ pthread_t worker_thread; -++ pthread_t worker_deblock_thread; -++ pthread_cond_t worker_cond_head; -++ pthread_cond_t worker_cond_tail; -++ pthread_cond_t worker_cond_middle; -++ pthread_mutex_t worker_mutex; -++ -++ int worker_tail; // Contains the number of posted jobs -++ int worker_head; // Contains the number of completed jobs -++ int worker_middle; // Contains the number of completed jobs -++ int kill_worker; // set to 1 to terminate the worker -++#endif -++ -+ #endif -+ -+ uint8_t *cabac_state; -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index ca76cb0..b9f773b 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1051,11 +1051,11 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ if (s->enable_rpi) { -+ int n = trafo_size * trafo_size; -+ if (use_vpu) { -+- coeffs = s->coeffs_buf_arm[log2_trafo_size - 2] + s->num_coeffs[log2_trafo_size - 2]; -+- s->num_coeffs[log2_trafo_size - 2] += n; -++ coeffs = s->coeffs_buf_arm[s->pass0_job][log2_trafo_size - 2] + s->num_coeffs[s->pass0_job][log2_trafo_size - 2]; -++ s->num_coeffs[s->pass0_job][log2_trafo_size - 2] += n; -+ } else { -+- coeffs = s->coeffs_buf_arm[0] + s->num_coeffs[0]; -+- s->num_coeffs[0] += n; -++ coeffs = s->coeffs_buf_arm[s->pass0_job][0] + s->num_coeffs[s->pass0_job][0]; -++ s->num_coeffs[s->pass0_job][0] += n; -+ } -+ } -+ // We now do the memset after transform_add while we know the data is cached. -+@@ -1508,7 +1508,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ s->hevcdsp.transform_rdpcm(coeffs, log2_trafo_size, mode); -+ } -+ } else if (lc->cu.pred_mode == MODE_INTRA && c_idx == 0 && log2_trafo_size == 2) { -+- s->hevcdsp.idct_4x4_luma(coeffs); -++ s->hevcdsp.idct_4x4_luma(coeffs); -+ } else { -+ #ifdef RPI -+ if (!use_vpu) { -+@@ -1553,7 +1553,7 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ } -+ #ifdef RPI -+ if (s->enable_rpi) { -+- HEVCPredCmd *cmd = s->univ_pred_cmds + s->num_pred_cmds++; -++ HEVCPredCmd *cmd = s->univ_pred_cmds[s->pass0_job] + s->num_pred_cmds[s->pass0_job]++; -+ cmd->type = RPI_PRED_TRANSFORM_ADD; -+ cmd->size = log2_trafo_size; -+ cmd->buf = coeffs; -+diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c -+index 71c6d52..344e021 100644 -+--- a/libavcodec/hevcpred_template.c -++++ b/libavcodec/hevcpred_template.c -+@@ -71,8 +71,11 @@ do { \ -+ AV_WN4P(&ptr[i], a); \ -+ else \ -+ a = PIXEL_SPLAT_X4(ptr[i + 3]) -+- -++#ifdef RPI_WORKER -++ HEVCLocalContextIntra *lc = &s->HEVClcIntra; -++#else -+ HEVCLocalContext *lc = s->HEVClc; -++#endif -+ int i; -+ int hshift = s->ps.sps->hshift[c_idx]; -+ int vshift = s->ps.sps->vshift[c_idx]; -+-- -+2.5.0 -+ -+ -+From ec8c58875a457dcda45e8bbe1edc0efec41e4707 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 3 Jun 2015 13:43:48 +0100 -+Subject: [PATCH 54/68] Avoid lockup bug with RPI_WORKER enabled -+ -+--- -+ libavcodec/hevc.c | 22 +++++++++++----------- -+ libavcodec/hevc_cabac.c | 1 - -+ 2 files changed, 11 insertions(+), 12 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 6f67872..865f5ec 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -133,11 +133,11 @@ static uint32_t get_vc_address(AVBufferRef *bref) { -+ static void worker_submit_job(HEVCContext *s) -+ { -+ LOG_ENTER -+- //pthread_mutex_lock(&s->worker_mutex); -+- s->worker_tail++; // This is the only place that can change tail so we do not need the mutex -++ pthread_mutex_lock(&s->worker_mutex); -++ s->worker_tail++; -+ s->pass0_job = (s->pass0_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -+ pthread_cond_broadcast(&s->worker_cond_tail); // Let people know that the tail has moved -+- //pthread_mutex_unlock(&s->worker_mutex); -++ pthread_mutex_unlock(&s->worker_mutex); -+ LOG_EXIT -+ } -+ -+@@ -145,11 +145,11 @@ static void worker_submit_job(HEVCContext *s) -+ static void worker_complete_middle_job(HEVCContext *s) -+ { -+ LOG_ENTER -+- //pthread_mutex_lock(&s->worker_mutex); -+- s->worker_middle++; // This is the only place that can change head so we do not need the mutex -++ pthread_mutex_lock(&s->worker_mutex); -++ s->worker_middle++; -+ s->pass1_job = (s->pass1_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -+- pthread_cond_broadcast(&s->worker_cond_middle); // Let people know that the tail has moved -+- //pthread_mutex_unlock(&s->worker_mutex); -++ pthread_cond_broadcast(&s->worker_cond_middle); // Let people know that the middle has moved -++ pthread_mutex_unlock(&s->worker_mutex); -+ LOG_EXIT -+ } -+ -+@@ -157,11 +157,11 @@ static void worker_complete_middle_job(HEVCContext *s) -+ static void worker_complete_job(HEVCContext *s) -+ { -+ LOG_ENTER -+- //pthread_mutex_lock(&s->worker_mutex); -+- s->worker_head++; // This is the only place that can change head so we do not need the mutex -++ pthread_mutex_lock(&s->worker_mutex); -++ s->worker_head++; -+ s->pass2_job = (s->pass2_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -+- pthread_cond_broadcast(&s->worker_cond_head); // Let people know that the tail has moved -+- //pthread_mutex_unlock(&s->worker_mutex); -++ pthread_cond_broadcast(&s->worker_cond_head); // Let people know that the head has moved -++ pthread_mutex_unlock(&s->worker_mutex); -+ LOG_EXIT -+ } -+ -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index b9f773b..16e7ac3 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1497,7 +1497,6 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ for (i = 0; i < 8; i++) -+ FFSWAP(int16_t, coeffs[i], coeffs[16 - i - 1]); -+ } -+- -+ s->hevcdsp.transform_skip(coeffs, log2_trafo_size); -+ -+ if (explicit_rdpcm_flag || (s->ps.sps->implicit_rdpcm_enabled_flag && -+-- -+2.5.0 -+ -+ -+From d9e7ab6809af47b65372b9fd99e2d519c3d44b10 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 3 Jun 2015 15:37:19 +0100 -+Subject: [PATCH 55/68] Added code to flush buffers at start of frame -+ -+--- -+ libavcodec/hevc.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -+ 1 file changed, 72 insertions(+) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 865f5ec..3a94830 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -43,6 +43,7 @@ -+ -+ #ifdef RPI -+ #include "rpi_qpu.h" -++ #include "rpi_user_vcsm.h" -+ // Move Inter prediction into separate pass -+ #define RPI_INTER -+ -+@@ -3497,6 +3498,7 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ #else -+ gpu_cache_flush(&s->coeffs_buf_accelerated[job]); -+ #endif -++ -+ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], s->num_coeffs[job][3] >> 10, 0, -+ qpu_get_fn(QPU_MC_SETUP_UV), -+ (uint32_t)(unif_vc+(s->mvs_base[job][0 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -+@@ -3547,6 +3549,71 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ } -+ #endif -+ -++#ifdef RPI -++ -++static void flush_buffer(AVBufferRef *bref) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -++ gpu_cache_flush(p); -++} -++ -++static void flush_frame(HEVCContext *s,AVFrame *frame) -++{ -++#if 1 -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ int n = s->ps.sps->height; -++ int curr_y = 0; -++ int curr_uv = 0; -++ int n_uv = n >> s->ps.sps->vshift[1]; -++ int sz,base; -++ sz = s->frame->linesize[1] * (n_uv-curr_uv); -++ base = s->frame->linesize[1] * curr_uv; -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -++ iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].cmd = 3; // clean+invalidate -++ iocache.s[0].addr = p->arm + base; -++ iocache.s[0].size = sz; -++ p = av_buffer_pool_opaque(frame->buf[2]); -++ iocache.s[1].handle = p->vcsm_handle; -++ iocache.s[1].cmd = 3; // clean+invalidate -++ iocache.s[1].addr = p->arm + base; -++ iocache.s[1].size = sz; -++ p = av_buffer_pool_opaque(frame->buf[0]); -++ sz = s->frame->linesize[0] * (n-curr_y); -++ base = s->frame->linesize[0] * curr_y; -++ iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].cmd = 3; // clean+invalidate -++ iocache.s[2].addr = p->arm + base; -++ iocache.s[2].size = sz; -++ vcsm_clean_invalid( &iocache ); -++#else -++ flush_buffer(frame->buf[0]); -++ flush_buffer(frame->buf[1]); -++ flush_buffer(frame->buf[2]); -++#endif -++} -++ -++static void flush_all(HEVCContext *s) -++{ -++#if 0 -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(s->frame->buf[0]); -++ iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].cmd = 4; // Flush all -++ iocache.s[0].addr = p->arm; -++ iocache.s[0].size = 4096; -++ vcsm_clean_invalid( &iocache ); -++#else -++ int i,k; -++ for(i=0;i<2;i++) { -++ for (k = 0; k < s->sh.nb_refs[i]; k++) { -++ flush_frame(s,s->ref->refPicList[i].ref[k]->frame); -++ } -++ } -++ flush_frame(s,s->frame); -++#endif -++} -++#endif -++ -+ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ { -+ HEVCContext *s = avctxt->priv_data; -+@@ -3581,8 +3648,12 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ printf("Weighted B slice\n"); -+ } -+ -++ // Now flush all reference frames and our destination frame to get everything ready for decode -++ flush_all(s); -+ #endif -+ -++ //printf("L0=%d L1=%d\n",s->sh.nb_refs[L1],s->sh.nb_refs[L1]); -++ -+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { -+ av_log(s->avctx, AV_LOG_ERROR, "Impossible initial tile.\n"); -+ return AVERROR_INVALIDDATA; -+@@ -3653,6 +3724,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ rpi_do_all_passes(s); -+ #endif -+ } -++ -+ } -+ #endif -+ -+-- -+2.5.0 -+ -+ -+From 2e0fc42393a67cc61d84311640d1e44b32f2bffb Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 3 Jun 2015 16:42:24 +0100 -+Subject: [PATCH 56/68] Reduce the amount that needs to be flushed -+ -+--- -+ libavcodec/hevc.c | 35 +++++++++++------------------------ -+ 1 file changed, 11 insertions(+), 24 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 3a94830..3fcbc57 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3558,7 +3558,7 @@ static void flush_buffer(AVBufferRef *bref) { -+ -+ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ { -+-#if 1 -++#ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+ int n = s->ps.sps->height; -+ int curr_y = 0; -+@@ -3592,26 +3592,6 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ #endif -+ } -+ -+-static void flush_all(HEVCContext *s) -+-{ -+-#if 0 -+- struct vcsm_user_clean_invalid_s iocache = {}; -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(s->frame->buf[0]); -+- iocache.s[0].handle = p->vcsm_handle; -+- iocache.s[0].cmd = 4; // Flush all -+- iocache.s[0].addr = p->arm; -+- iocache.s[0].size = 4096; -+- vcsm_clean_invalid( &iocache ); -+-#else -+- int i,k; -+- for(i=0;i<2;i++) { -+- for (k = 0; k < s->sh.nb_refs[i]; k++) { -+- flush_frame(s,s->ref->refPicList[i].ref[k]->frame); -+- } -+- } -+- flush_frame(s,s->frame); -+-#endif -+-} -+ #endif -+ -+ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+@@ -3647,9 +3627,6 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ if (s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE) -+ printf("Weighted B slice\n"); -+ } -+- -+- // Now flush all reference frames and our destination frame to get everything ready for decode -+- flush_all(s); -+ #endif -+ -+ //printf("L0=%d L1=%d\n",s->sh.nb_refs[L1],s->sh.nb_refs[L1]); -+@@ -4119,6 +4096,11 @@ static int hevc_frame_start(HEVCContext *s) -+ if (!s->avctx->hwaccel) -+ ff_thread_finish_setup(s->avctx); -+ -++#ifdef RPI_INTER_QPU -++ // Invalidate the output data buffer so it is ready for the QPUs to write into it. -++ flush_frame(s,s->frame); -++#endif -++ -+ return 0; -+ -+ fail: -+@@ -4320,6 +4302,11 @@ fail: -+ ff_hevc_flush_buffer(s, &s->ref->tf, s->ps.sps->height); -+ #endif -+ ff_thread_report_progress(&s->ref->tf, INT_MAX, 0); -++ } else if (s->ref) { -++#ifdef RPI_INTER_QPU -++ // When running single threaded we need to flush the whole frame -++ flush_frame(s,s->frame); -++#endif -+ } -+ return ret; -+ } -+-- -+2.5.0 -+ -+ -+From 0cc4754dcc1c36647d92c3f42be39f24d24c48a2 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 4 Jun 2015 07:59:28 +0100 -+Subject: [PATCH 57/68] Corrected support for disabled rpi when using -+ RPI_WORKER -+ -+--- -+ libavcodec/hevc.h | 18 ++++++++++-------- -+ libavcodec/hevcpred_template.c | 2 +- -+ 2 files changed, 11 insertions(+), 9 deletions(-) -+ -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index b540ca5..c48d0cd 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -795,7 +795,17 @@ typedef struct HEVCPacket { -+ int nals_allocated; -+ } HEVCPacket; -+ -++#ifdef RPI_WORKER -++typedef struct HEVCLocalContextIntra { -++ TransformUnit tu; -++ NeighbourAvailable na; -++} HEVCLocalContextIntra; -++#endif -++ -+ typedef struct HEVCLocalContext { -++ TransformUnit tu; -++ NeighbourAvailable na; // WARNING tu and na must be the first two fields to match HEVCLocalContextIntra -++ -+ uint8_t cabac_state[HEVC_CONTEXTS]; -+ -+ uint8_t stat_coeff[4]; -+@@ -810,7 +820,6 @@ typedef struct HEVCLocalContext { -+ -+ int qPy_pred; -+ -+- TransformUnit tu; -+ -+ uint8_t ctb_left_flag; -+ uint8_t ctb_up_flag; -+@@ -827,7 +836,6 @@ typedef struct HEVCLocalContext { -+ int ct_depth; -+ CodingUnit cu; -+ PredictionUnit pu; -+- NeighbourAvailable na; -+ -+ #define BOUNDARY_LEFT_SLICE (1 << 0) -+ #define BOUNDARY_LEFT_TILE (1 << 1) -+@@ -838,12 +846,6 @@ typedef struct HEVCLocalContext { -+ int boundary_flags; -+ } HEVCLocalContext; -+ -+-#ifdef RPI_WORKER -+-typedef struct HEVCLocalContextIntra { -+- TransformUnit tu; -+- NeighbourAvailable na; -+-} HEVCLocalContextIntra; -+-#endif -+ -+ #ifdef RPI -+ -+diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c -+index 344e021..325b60e 100644 -+--- a/libavcodec/hevcpred_template.c -++++ b/libavcodec/hevcpred_template.c -+@@ -72,7 +72,7 @@ do { \ -+ else \ -+ a = PIXEL_SPLAT_X4(ptr[i + 3]) -+ #ifdef RPI_WORKER -+- HEVCLocalContextIntra *lc = &s->HEVClcIntra; -++ HEVCLocalContextIntra *lc = s->enable_rpi ? &s->HEVClcIntra : (HEVCLocalContextIntra *)s->HEVClc ; -+ #else -+ HEVCLocalContext *lc = s->HEVClc; -+ #endif -+-- -+2.5.0 -+ -+ -+From b1ca5230c3a2e5e74945c6f06f75c5dcec62d9d0 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 4 Jun 2015 11:52:55 +0100 -+Subject: [PATCH 58/68] Draft support for tiles -+ -+--- -+ libavcodec/hevc.c | 140 +++++++++++++++++++++++------------------ -+ libavcodec/hevc.h | 21 +++++-- -+ libavcodec/hevc_filter.c | 2 +- -+ libavcodec/hevcpred_template.c | 2 +- -+ 4 files changed, 99 insertions(+), 66 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 3fcbc57..23c4e17 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -63,10 +63,10 @@ -+ -+ static void rpi_execute_dblk_cmds(HEVCContext *s); -+ static void rpi_execute_transform(HEVCContext *s); -+- static void rpi_execute_inter_qpu(HEVCContext *s); -++ static void rpi_launch_vpu_qpu(HEVCContext *s); -+ static void rpi_execute_pred_cmds(HEVCContext *s); -+ static void rpi_execute_inter_cmds(HEVCContext *s); -+- static void rpi_inter_clear(HEVCContext *s); -++ static void rpi_begin(HEVCContext *s); -+ -+ // Define INTER_PASS0 to do inter prediction in first pass -+ //#define INTER_PASS0 -+@@ -90,16 +90,18 @@ const uint8_t ff_hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, [12 -+ -+ #ifdef RPI_INTER_QPU -+ -++// Each luma QPU processes 2*RPI_NUM_CHUNKS 64x64 blocks -++// Each chroma QPU processes 3*RPI_NUM_CHUNKS 64x64 blocks, but requires two commands for B blocks -++// For each block of 64*64 the smallest block size is 8x4 -++// We also need an extra command for the setup information -++ -+ #define RPI_CHROMA_COMMAND_WORDS 12 -+-#define UV_COMMANDS_PER_QPU ((1 + (256*64*2)/(4*4)) * RPI_CHROMA_COMMAND_WORDS) -++#define UV_COMMANDS_PER_QPU ((1 + 3*RPI_NUM_CHUNKS*(64*64)*2/(8*4)) * RPI_CHROMA_COMMAND_WORDS) -+ // The QPU code for UV blocks only works up to a block width of 8 -+ #define RPI_CHROMA_BLOCK_WIDTH 8 -+ -+-// Split image of 2048 into parts 64 wide -+-// So some QPUs will have 3 blocks of 64 to do, and others 2 blocks for an image 2048 wide with 32 blocks across -+-// For each block of 64*64 the smallest block size is 8x4 -+ #define RPI_LUMA_COMMAND_WORDS 9 -+-#define Y_COMMANDS_PER_QPU ((1+3*(64*64)/(8*4)) * RPI_LUMA_COMMAND_WORDS) -++#define Y_COMMANDS_PER_QPU ((1+2*RPI_NUM_CHUNKS*(64*64)/(8*4)) * RPI_LUMA_COMMAND_WORDS) -+ -+ #define ENCODE_COEFFS(c0, c1, c2, c3) (((c0) & 0xff) | ((c1) & 0xff) << 8 | ((c2) & 0xff) << 16 | ((c3) & 0xff) << 24) -+ -+@@ -216,7 +218,7 @@ static void *worker_start(void *arg) -+ LOG_ENTER -+ // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+ #ifndef LAUNCH_PASS0 -+- rpi_execute_inter_qpu(s); -++ rpi_launch_vpu_qpu(s); -+ #endif -+ #ifndef INTER_PASS0 -+ // Perform inter prediction -+@@ -322,9 +324,14 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ -+ #ifdef RPI -+ av_assert0(sps); -+- int coeffs_in_ctb = (1 << sps->log2_ctb_size) * (1 << sps->log2_ctb_size); -+- int coefs_per_row = sps->ctb_width * coeffs_in_ctb * 3; // Allow space for chroma -++ int coefs_in_ctb = (1 << sps->log2_ctb_size) * (1 << sps->log2_ctb_size); -++ int coefs_per_luma = 64*64*24*RPI_NUM_CHUNKS; -++ int coefs_per_chroma = (coefs_per_luma * 2) >> sps->vshift[1] >> sps->hshift[1]; -++ int coefs_per_row = coefs_per_luma + coefs_per_chroma; -+ int job; -++ s->max_ctu_count = coefs_per_luma / coefs_in_ctb; -++ s->ctu_per_y_chan = s->max_ctu_count / 12; -++ s->ctu_per_uv_chan = s->max_ctu_count / 8; -+ for(job=0;jobx >> 2); -+ int y1 = y0 + (mv->y >> 2); -+- int chan = x0>>6; // 64 wide blocks per QPU -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+- uint32_t *y = s->y_mvs[s->pass0_job][chan % 12]; -++ uint32_t *y = s->curr_y_mvs; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=16) { -+ int bw = nPbW-start_x; -+@@ -2198,7 +2204,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -+ } -+ } -+- s->y_mvs[s->pass0_job][chan % 12] = y; -++ s->curr_y_mvs = y; -+ } else -+ #endif -+ { -+@@ -2222,12 +2228,10 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ -+ int x1_c = x0_c + (mv->x >> (2 + hshift)); -+ int y1_c = y0_c + (mv->y >> (2 + hshift)); -+- //int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -+- int chan = x0>>8; -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+- uint32_t *u = s->u_mvs[s->pass0_job][chan & 7]; -++ uint32_t *u = s->curr_u_mvs; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ int bw = nPbW_c-start_x; -+@@ -2251,7 +2255,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+- s->u_mvs[s->pass0_job][chan & 7] = u; -++ s->curr_u_mvs = u; -+ return; -+ } -+ #endif -+@@ -2278,10 +2282,9 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int my2_mx2_my_mx = (my_mx << 16) + my_mx; -+ int x1 = x0 + (mv->x >> 2); -+ int y1 = y0 + (mv->y >> 2); -+- int chan = x0>>6; // 64 wide blocks per QPU -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+- uint32_t *y = s->y_mvs[s->pass0_job][chan % 12]; -++ uint32_t *y = s->curr_y_mvs; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=16) { -+ int bw = nPbW-start_x; -+@@ -2301,7 +2304,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -+ } -+ } -+- s->y_mvs[s->pass0_job][chan % 12] = y; -++ s->curr_y_mvs = y; -+ } else -+ #endif -+ -+@@ -2326,12 +2329,10 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ -+ int x1_c = x0_c + (mv->x >> (2 + hshift)); -+ int y1_c = y0_c + (mv->y >> (2 + hshift)); -+- //int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -+- int chan = x0>>8; -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+ (s->sh.slice_type == B_SLICE && s->ps.pps->weighted_bipred_flag); -+ -+- uint32_t *u = s->u_mvs[s->pass0_job][chan & 7]; -++ uint32_t *u = s->curr_u_mvs; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ int bw = nPbW_c-start_x; -+@@ -2356,7 +2357,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+- s->u_mvs[s->pass0_job][chan & 7] = u; -++ s->curr_u_mvs = u; -+ return; -+ } -+ #endif -+@@ -2389,8 +2390,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int y1 = y0 + (mv->y >> 2); -+ int x2 = x0 + (mv2->x >> 2); -+ int y2 = y0 + (mv2->y >> 2); -+- int chan = x0>>6; // 64 wide blocks per QPU -+- uint32_t *y = s->y_mvs[s->pass0_job][chan % 12]; -++ uint32_t *y = s->curr_y_mvs; -+ for(int start_y=0;start_y < nPbH;start_y+=16) { // Potentially we could change the assembly code to support taller sizes in one go -+ for(int start_x=0;start_x < nPbW;start_x+=8) { // B blocks work 8 at a time -+ int bw = nPbW-start_x; -+@@ -2406,7 +2406,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter_b; -+ } -+ } -+- s->y_mvs[s->pass0_job][chan % 12] = y; -++ s->curr_y_mvs = y; -+ } else -+ #endif -+ { -+@@ -2437,9 +2437,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int x2_c = x0_c + (mv2->x >> (2 + hshift)); -+ int y2_c = y0_c + (mv2->y >> (2 + hshift)); -+ -+- int chan = x0>>8; // Allocate commands for the first 256 luma pixels across to the first QPU. This is optimised for images around 1920 width -+ -+- uint32_t *u = s->u_mvs[s->pass0_job][chan & 7]; -++ uint32_t *u = s->curr_u_mvs; -+ for(int start_y=0;start_y < nPbH_c;start_y+=16) { -+ for(int start_x=0;start_x < nPbW_c;start_x+=RPI_CHROMA_BLOCK_WIDTH) { -+ int bw = nPbW_c-start_x; -+@@ -2468,7 +2467,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+- s->u_mvs[s->pass0_job][chan & 7] = u; -++ s->curr_u_mvs = u; -+ return; -+ } -+ #endif -+@@ -3103,12 +3102,8 @@ static void rpi_execute_inter_cmds(HEVCContext *s) -+ -+ static void rpi_do_all_passes(HEVCContext *s) -+ { -+-#ifdef RPI_INTER_QPU -+- // Kick off inter prediction on QPUs -+- rpi_execute_inter_qpu(s); -+-#else -+- rpi_execute_transform(s); -+-#endif -++ // Kick off QPUs and VPUs -++ rpi_launch_vpu_qpu(s); -+ // Perform luma inter prediction -+ rpi_execute_inter_cmds(s); -+ // Wait for transform completion -+@@ -3117,18 +3112,18 @@ static void rpi_do_all_passes(HEVCContext *s) -+ rpi_execute_pred_cmds(s); -+ // Perform deblocking for CTBs in this row -+ rpi_execute_dblk_cmds(s); -+-#ifdef RPI_INTER_QPU -+- rpi_inter_clear(s); -+-#endif -++ // Prepare next batch -++ rpi_begin(s); -+ } -+ -+ #endif -+ -+-#ifdef RPI_INTER_QPU -+-static void rpi_inter_clear(HEVCContext *s) -++#ifdef RPI -++static void rpi_begin(HEVCContext *s) -+ { -+ int job = s->pass0_job; -+ int i; -++#ifdef RPI_INTER_QPU -+ int pic_width = s->ps.sps->width >> s->ps.sps->hshift[1]; -+ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[1]; -+ int weight_flag = (s->sh.slice_type == P_SLICE && s->ps.pps->weighted_pred_flag) || -+@@ -3154,6 +3149,8 @@ static void rpi_inter_clear(HEVCContext *s) -+ } -+ *s->u_mvs[job][i]++ = i; // Select section of VPM (avoid collisions with 3d unit) -+ } -++ s->curr_u_mvs = s->u_mvs[job][0]; -++#endif -+ -+ #ifdef RPI_LUMA_QPU -+ for(i=0;i<12;i++) { -+@@ -3176,8 +3173,11 @@ static void rpi_inter_clear(HEVCContext *s) -+ } -+ *s->y_mvs[job][i]++ = 0; // Next kernel -+ } -++ s->curr_y_mvs = s->y_mvs[job][0]; -+ #endif -++ s->ctu_count = 0; -+ } -++#endif -+ -+ #ifdef RPI_SIMULATE_QPUS -+ -+@@ -3448,8 +3448,9 @@ static void rpi_simulate_inter_qpu(HEVCContext *s) -+ -+ #endif -+ -++#ifdef RPI_INTER_QPU -+ -+-static void rpi_execute_inter_qpu(HEVCContext *s) -++static void rpi_launch_vpu_qpu(HEVCContext *s) -+ { -+ int k; -+ #ifdef LAUNCH_PASS0 -+@@ -3547,6 +3548,15 @@ static void rpi_execute_inter_qpu(HEVCContext *s) -+ -+ -+ } -++#else -++ -++#ifdef RPI -++static void rpi_launch_vpu_qpu(HEVCContext *s) -++{ -++ rpi_execute_transform(s); -++} -++#endif -++ -+ #endif -+ -+ #ifdef RPI -+@@ -3606,29 +3616,20 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #ifdef RPI -+ #ifdef RPI_INTER_QPU -+ s->enable_rpi = s->ps.sps->bit_depth == 8 -+- && s->ps.sps->width <= RPI_MAX_WIDTH -+ && !s->ps.pps->cross_component_prediction_enabled_flag -+- && s->ps.pps->num_tile_rows <= 1 && s->ps.pps->num_tile_columns <= 1 -+ && !(s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE); -+ #else -+ s->enable_rpi = s->ps.sps->bit_depth == 8 -+- && s->ps.sps->width <= RPI_MAX_WIDTH -+- && !s->ps.pps->cross_component_prediction_enabled_flag -+- && s->ps.pps->num_tile_rows <= 1 && s->ps.pps->num_tile_columns <= 1; -++ && !s->ps.pps->cross_component_prediction_enabled_flag; -+ #endif -+ -+ if (!s->enable_rpi) { -+ if (s->ps.pps->cross_component_prediction_enabled_flag) -+ printf("Cross component\n"); -+- if (s->ps.pps->num_tile_rows > 1 || s->ps.pps->num_tile_columns > 1) -+- printf("Tiles\n"); -+- if (s->ps.pps->weighted_pred_flag && s->sh.slice_type == P_SLICE) -+- printf("Weighted P slice\n"); -+ if (s->ps.pps->weighted_bipred_flag && s->sh.slice_type == B_SLICE) -+ printf("Weighted B slice\n"); -+ } -+ #endif -+- -+ //printf("L0=%d L1=%d\n",s->sh.nb_refs[L1],s->sh.nb_refs[L1]); -+ -+ if (!ctb_addr_ts && s->sh.dependent_slice_segment_flag) { -+@@ -3649,8 +3650,8 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->pass1_job = 0; -+ s->pass2_job = 0; -+ #endif -+-#ifdef RPI_INTER_QPU -+- rpi_inter_clear(s); -++#ifdef RPI -++ rpi_begin(s); -+ #endif -+ -+ while (more_data && ctb_addr_ts < s->ps.sps->ctb_size) { -+@@ -3668,13 +3669,34 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->deblock[ctb_addr_rs].tc_offset = s->sh.tc_offset; -+ s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag; -+ -++#ifdef RPI_INTER_QPU -++ s->curr_u_mvs = s->u_mvs[s->pass0_job][s->ctu_count / s->ctu_per_uv_chan]; -++#endif -++#ifdef RPI_LUMA_QPU -++ s->curr_y_mvs = s->y_mvs[s->pass0_job][s->ctu_count / s->ctu_per_y_chan]; -++#endif -++ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -+ -++#ifdef RPI_INTER_QPU -++ s->u_mvs[s->pass0_job][s->ctu_count / s->ctu_per_uv_chan] = s->curr_u_mvs; -++#endif -++#ifdef RPI_LUMA_QPU -++ s->y_mvs[s->pass0_job][s->ctu_count / s->ctu_per_y_chan] = s->curr_y_mvs; -++#endif -++ -+ #ifdef RPI -+ if (s->enable_rpi) { -++ //av_assert0(s->num_dblk_cmds[s->pass0_job]>=0); -++ //av_assert0(s->num_dblk_cmds[s->pass0_job]pass0_jobpass0_job>=0); -+ s->dblk_cmds[s->pass0_job][s->num_dblk_cmds[s->pass0_job]][0] = x_ctb; -+ s->dblk_cmds[s->pass0_job][s->num_dblk_cmds[s->pass0_job]++][1] = y_ctb; -+- if ( (((y_ctb + ctb_size)&63) == 0) && x_ctb + ctb_size >= s->ps.sps->width) { -++ s->ctu_count++; -++ //printf("%d %d/%d job=%d\n",s->ctu_count,s->num_dblk_cmds[s->pass0_job],RPI_MAX_DEBLOCK_CMDS,s->pass0_job); -++ -++ if ( s->ctu_count >= s->max_ctu_count ) { -+ #ifdef RPI_WORKER -+ if (s->used_for_ref) { -+ // Split work load onto separate threads so we make as rapid progress as possible with this frame -+@@ -3682,7 +3704,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ rpi_execute_inter_cmds(s); -+ #endif -+ #ifdef LAUNCH_PASS0 -+- rpi_execute_inter_qpu(s); -++ rpi_launch_vpu_qpu(s); -+ #endif -+ // Pass on this job to worker thread -+ worker_submit_job(s); -+@@ -3690,9 +3712,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ worker_pass0_ready(s); -+ -+ // Prepare the next batch of commands -+-#ifdef RPI_INTER_QPU -+- rpi_inter_clear(s); -+-#endif -++ rpi_begin(s); -+ } else { -+ // Non-ref frame so do it all on this thread -+ rpi_do_all_passes(s); -+@@ -3733,7 +3753,7 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #endif -+ -+ // Finish off any half-completed rows -+- if (s->enable_rpi && s->num_dblk_cmds[s->pass0_job]) { -++ if (s->enable_rpi && s->ctu_count) { -+ rpi_do_all_passes(s); -+ } -+ -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index c48d0cd..3aea745 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -849,8 +849,15 @@ typedef struct HEVCLocalContext { -+ -+ #ifdef RPI -+ -++// The processing is done in chunks -++// Each chunk corresponds to 24 64x64 luma blocks (24 so it is divisible by 8 for chroma and 12 for luma) -++// This is a distance of 1536 pixels across the screen -++// Increasing RPI_NUM_CHUNKS will reduce time spent activating QPUs and cache flushing, -++// but allocate more memory and increase the latency before data in the next frame can be processed -++#define RPI_NUM_CHUNKS 1 -++ -+ // RPI_MAX_WIDTH is maximum width in pixels supported by the accelerated code -+-#define RPI_MAX_WIDTH 2048 -++#define RPI_MAX_WIDTH (RPI_NUM_CHUNKS*64*24) -+ -+ // Worst case is for 4:4:4 4x4 blocks with 64 high coding tree blocks, so 16 MV cmds per 4 pixels across for each colour plane, * 2 for bi -+ #define RPI_MAX_MV_CMDS (2*16*3*(RPI_MAX_WIDTH/4)) -+@@ -914,9 +921,6 @@ typedef struct HEVCPredCmd { -+ #endif -+ -+ typedef struct HEVCContext { -+-#ifdef RPI -+- int dblk_cmds[RPI_MAX_JOBS][RPI_MAX_DEBLOCK_CMDS][2]; -+-#endif -+ const AVClass *c; // needed by private avoptions -+ AVCodecContext *avctx; -+ -+@@ -954,6 +958,10 @@ typedef struct HEVCContext { -+ int pass0_job; // Pass0 does coefficient decode -+ int pass1_job; // Pass1 does pixel processing -+ int pass2_job; // Pass2 does reconstruction and deblocking -++ int ctu_count; // Number of CTUs done in pass0 so far -++ int max_ctu_count; // Number of CTUs when we trigger a round of processing -++ int ctu_per_y_chan; // Number of CTUs per luma QPU -++ int ctu_per_uv_chan; // Number of CTUs per chroma QPU -+ #ifdef RPI_INTER_QPU -+ GPU_MEM_PTR_T unif_mvs_ptr[RPI_MAX_JOBS]; -+ uint32_t *unif_mvs[RPI_MAX_JOBS]; // Base of memory for motion vector commands -+@@ -962,6 +970,7 @@ typedef struct HEVCContext { -+ uint32_t *mvs_base[RPI_MAX_JOBS][8]; -+ // these pointers are to the next free space -+ uint32_t *u_mvs[RPI_MAX_JOBS][8]; -++ uint32_t *curr_u_mvs; // Current uniform stream to use for chroma -+ // Function pointers -+ uint32_t mc_filter_uv; -+ uint32_t mc_filter_uv_b0; -+@@ -972,6 +981,7 @@ typedef struct HEVCContext { -+ uint32_t *y_unif_mvs[RPI_MAX_JOBS]; // Base of memory for motion vector commands -+ uint32_t *y_mvs_base[RPI_MAX_JOBS][12]; -+ uint32_t *y_mvs[RPI_MAX_JOBS][12]; -++ uint32_t *curr_y_mvs; // Current uniform stream for luma -+ // Function pointers -+ uint32_t mc_filter; -+ uint32_t mc_filter_b; -+@@ -1110,6 +1120,9 @@ typedef struct HEVCContext { -+ uint32_t max_mastering_luminance; -+ uint32_t min_mastering_luminance; -+ -++#ifdef RPI -++ int dblk_cmds[RPI_MAX_JOBS][RPI_MAX_DEBLOCK_CMDS][2]; -++#endif -+ } HEVCContext; -+ -+ int ff_hevc_decode_short_term_rps(GetBitContext *gb, AVCodecContext *avctx, -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index b286bbf..1f04790 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -891,7 +891,7 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ int n_uv = n >> s->ps.sps->vshift[1]; -+ int sz,base; -+ if (curr_uv < 0) curr_uv = 0; -+- if (n_uv<=curr_uv) { assert(0); return; } // Should not happen -++ if (n_uv<=curr_uv) { return; } -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(s->frame->buf[1]); -+diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c -+index 325b60e..28d2653 100644 -+--- a/libavcodec/hevcpred_template.c -++++ b/libavcodec/hevcpred_template.c -+@@ -72,7 +72,7 @@ do { \ -+ else \ -+ a = PIXEL_SPLAT_X4(ptr[i + 3]) -+ #ifdef RPI_WORKER -+- HEVCLocalContextIntra *lc = s->enable_rpi ? &s->HEVClcIntra : (HEVCLocalContextIntra *)s->HEVClc ; -++ HEVCLocalContextIntra *lc = (s->enable_rpi) ? &s->HEVClcIntra : (HEVCLocalContextIntra *)s->HEVClc ; -+ #else -+ HEVCLocalContext *lc = s->HEVClc; -+ #endif -+-- -+2.5.0 -+ -+ -+From eaaaee12acbb4d4c27191ceafadaa778d3ba0f2f Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 4 Jun 2015 15:48:10 +0100 -+Subject: [PATCH 59/68] Move deblocker into second pass -+ -+--- -+ libavcodec/hevc.c | 79 +++++++++++++++++++++++++++++++++++++++++++++---------- -+ 1 file changed, 65 insertions(+), 14 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 23c4e17..dde932f 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -67,6 +67,8 @@ -+ static void rpi_execute_pred_cmds(HEVCContext *s); -+ static void rpi_execute_inter_cmds(HEVCContext *s); -+ static void rpi_begin(HEVCContext *s); -++ static void flush_frame(HEVCContext *s,AVFrame *frame); -++ static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2); -+ -+ // Define INTER_PASS0 to do inter prediction in first pass -+ //#define INTER_PASS0 -+@@ -227,6 +229,11 @@ static void *worker_start(void *arg) -+ // Wait for transform completion -+ vpu_wait(s->vpu_id); -+ -++ // Perform intra prediction and residual reconstruction -++ rpi_execute_pred_cmds(s); -++ // Perform deblocking for CTBs in this row -++ rpi_execute_dblk_cmds(s); -++ -+ worker_complete_middle_job(s); -+ LOG_EXIT -+ } -+@@ -248,10 +255,6 @@ static void *worker_deblock_start(void *arg) -+ break; -+ } -+ LOG_ENTER -+- // Perform intra prediction and residual reconstruction -+- rpi_execute_pred_cmds(s); -+- // Perform deblocking for CTBs in this row -+- rpi_execute_dblk_cmds(s); -+ -+ worker_complete_job(s); -+ LOG_EXIT -+@@ -2972,7 +2975,7 @@ static void hls_decode_neighbour(HEVCContext *s, int x_ctb, int y_ctb, -+ static void rpi_execute_dblk_cmds(HEVCContext *s) -+ { -+ int n; -+- int job = s->pass2_job; -++ int job = s->pass1_job; -+ int ctb_size = 1 << s->ps.sps->log2_ctb_size; -+ int (*p)[2] = s->dblk_cmds[job]; -+ for(n = s->num_dblk_cmds[job]; n>0 ;n--,p++) { -+@@ -3010,7 +3013,7 @@ static void rpi_execute_transform(HEVCContext *s) -+ static void rpi_execute_pred_cmds(HEVCContext *s) -+ { -+ int i; -+- int job = s->pass2_job; -++ int job = s->pass1_job; -+ HEVCPredCmd *cmd = s->univ_pred_cmds[job]; -+ #ifdef RPI_WORKER -+ HEVCLocalContextIntra *lc = &s->HEVClcIntra; -+@@ -3495,11 +3498,10 @@ static void rpi_launch_vpu_qpu(HEVCContext *s) -+ -+ #ifdef RPI_MULTI_MAILBOX -+ #ifdef RPI_CACHE_UNIF_MVS -+- gpu_cache_flush3(&s->coeffs_buf_accelerated[job],&s->y_unif_mvs_ptr[job], &s->unif_mvs_ptr[job]); -++ flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],&s->y_unif_mvs_ptr[job], &s->unif_mvs_ptr[job]); -+ #else -+- gpu_cache_flush(&s->coeffs_buf_accelerated[job]); -++ flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],NULL,NULL); -+ #endif -+- -+ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], s->num_coeffs[job][3] >> 10, 0, -+ qpu_get_fn(QPU_MC_SETUP_UV), -+ (uint32_t)(unif_vc+(s->mvs_base[job][0 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -+@@ -3602,6 +3604,60 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ #endif -+ } -+ -++static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2) -++{ -++#ifdef RPI_FAST_CACHEFLUSH -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ int n = s->ps.sps->height; -++ int curr_y = 0; -++ int curr_uv = 0; -++ int n_uv = n >> s->ps.sps->vshift[1]; -++ int sz,base; -++ sz = s->frame->linesize[1] * (n_uv-curr_uv); -++ base = s->frame->linesize[1] * curr_uv; -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -++ iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].cmd = 3; // clean+invalidate -++ iocache.s[0].addr = p->arm + base; -++ iocache.s[0].size = sz; -++ p = av_buffer_pool_opaque(frame->buf[2]); -++ iocache.s[1].handle = p->vcsm_handle; -++ iocache.s[1].cmd = 3; // clean+invalidate -++ iocache.s[1].addr = p->arm + base; -++ iocache.s[1].size = sz; -++ p = av_buffer_pool_opaque(frame->buf[0]); -++ sz = s->frame->linesize[0] * (n-curr_y); -++ base = s->frame->linesize[0] * curr_y; -++ iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].cmd = 3; // clean+invalidate -++ iocache.s[2].addr = p->arm + base; -++ iocache.s[2].size = sz; -++ -++ iocache.s[3].handle = p0->vcsm_handle; -++ iocache.s[3].cmd = 3; // clean+invalidate -++ iocache.s[3].addr = (int) p0->arm; -++ iocache.s[3].size = p0->numbytes; -++ if (p1) { -++ iocache.s[4].handle = p1->vcsm_handle; -++ iocache.s[4].cmd = 3; // clean+invalidate -++ iocache.s[4].addr = (int) p1->arm; -++ iocache.s[4].size = p1->numbytes; -++ } -++ if (p2) { -++ iocache.s[5].handle = p2->vcsm_handle; -++ iocache.s[5].cmd = 3; // clean+invalidate -++ iocache.s[5].addr = (int) p2->arm; -++ iocache.s[5].size = p2->numbytes; -++ } -++ vcsm_clean_invalid( &iocache ); -++#else -++ flush_buffer(frame->buf[0]); -++ flush_buffer(frame->buf[1]); -++ flush_buffer(frame->buf[2]); -++ gpu_cache_flush3(p0, p1, p2); -++#endif -++} -++ -+ #endif -+ -+ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+@@ -4116,11 +4172,6 @@ static int hevc_frame_start(HEVCContext *s) -+ if (!s->avctx->hwaccel) -+ ff_thread_finish_setup(s->avctx); -+ -+-#ifdef RPI_INTER_QPU -+- // Invalidate the output data buffer so it is ready for the QPUs to write into it. -+- flush_frame(s,s->frame); -+-#endif -+- -+ return 0; -+ -+ fail: -+-- -+2.5.0 -+ -+ -+From f45417c35888b74a36a5ecc6959480787e727b0c Mon Sep 17 00:00:00 2001 -+From: popcornmix -+Date: Thu, 4 Jun 2015 16:10:23 +0100 -+Subject: [PATCH 60/68] Change order of ctu accesses to improve qpu performance -+ -+--- -+ libavcodec/hevc.c | 8 ++++---- -+ 1 file changed, 4 insertions(+), 4 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index dde932f..e247444 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -3726,19 +3726,19 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ s->filter_slice_edges[ctb_addr_rs] = s->sh.slice_loop_filter_across_slices_enabled_flag; -+ -+ #ifdef RPI_INTER_QPU -+- s->curr_u_mvs = s->u_mvs[s->pass0_job][s->ctu_count / s->ctu_per_uv_chan]; -++ s->curr_u_mvs = s->u_mvs[s->pass0_job][s->ctu_count % 8]; -+ #endif -+ #ifdef RPI_LUMA_QPU -+- s->curr_y_mvs = s->y_mvs[s->pass0_job][s->ctu_count / s->ctu_per_y_chan]; -++ s->curr_y_mvs = s->y_mvs[s->pass0_job][s->ctu_count % 12]; -+ #endif -+ -+ more_data = hls_coding_quadtree(s, x_ctb, y_ctb, s->ps.sps->log2_ctb_size, 0); -+ -+ #ifdef RPI_INTER_QPU -+- s->u_mvs[s->pass0_job][s->ctu_count / s->ctu_per_uv_chan] = s->curr_u_mvs; -++ s->u_mvs[s->pass0_job][s->ctu_count % 8]= s->curr_u_mvs; -+ #endif -+ #ifdef RPI_LUMA_QPU -+- s->y_mvs[s->pass0_job][s->ctu_count / s->ctu_per_y_chan] = s->curr_y_mvs; -++ s->y_mvs[s->pass0_job][s->ctu_count % 12] = s->curr_y_mvs; -+ #endif -+ -+ #ifdef RPI -+-- -+2.5.0 -+ -+ -+From 8d8b31eeffebf0a40c3b267d1b16401ef267bbf5 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Mon, 8 Jun 2015 09:36:59 +0100 -+Subject: [PATCH 61/68] Removed deblocker thread -+ -+--- -+ libavcodec/hevc.c | 77 +++---------------------------------------------------- -+ libavcodec/hevc.h | 4 --- -+ 2 files changed, 4 insertions(+), 77 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index e247444..bbb7ad3 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -70,11 +70,6 @@ -+ static void flush_frame(HEVCContext *s,AVFrame *frame); -+ static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2); -+ -+- // Define INTER_PASS0 to do inter prediction in first pass -+- //#define INTER_PASS0 -+- // Define LAUNCH_PASS0 to launch QPU/VPU from pass0 -+- //#define LAUNCH_PASS0 -+- -+ #endif -+ -+ // #define DISABLE_MC -+@@ -147,24 +142,12 @@ static void worker_submit_job(HEVCContext *s) -+ } -+ -+ // Call this to say we have completed pass1 -+-static void worker_complete_middle_job(HEVCContext *s) -+-{ -+- LOG_ENTER -+- pthread_mutex_lock(&s->worker_mutex); -+- s->worker_middle++; -+- s->pass1_job = (s->pass1_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -+- pthread_cond_broadcast(&s->worker_cond_middle); // Let people know that the middle has moved -+- pthread_mutex_unlock(&s->worker_mutex); -+- LOG_EXIT -+-} -+- -+-// Call this to say we have completed pass2 -+ static void worker_complete_job(HEVCContext *s) -+ { -+ LOG_ENTER -+ pthread_mutex_lock(&s->worker_mutex); -+ s->worker_head++; -+- s->pass2_job = (s->pass2_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -++ s->pass1_job = (s->pass1_job + 1) % RPI_MAX_JOBS; // Move onto the next slot -+ pthread_cond_broadcast(&s->worker_cond_head); // Let people know that the head has moved -+ pthread_mutex_unlock(&s->worker_mutex); -+ LOG_EXIT -+@@ -208,7 +191,7 @@ static void *worker_start(void *arg) -+ while(1) { -+ pthread_mutex_lock(&s->worker_mutex); -+ -+- while( !s->kill_worker && s->worker_tail - s->worker_middle <= 0) -++ while( !s->kill_worker && s->worker_tail - s->worker_head <= 0) -+ { -+ pthread_cond_wait(&s->worker_cond_tail, &s->worker_mutex); -+ } -+@@ -219,13 +202,9 @@ static void *worker_start(void *arg) -+ } -+ LOG_ENTER -+ // printf("%d %d %d : %d %d %d %d\n",s->poc, x_ctb, y_ctb, s->num_pred_cmds,s->num_mv_cmds,s->num_coeffs[2] >> 8,s->num_coeffs[3] >> 10); -+-#ifndef LAUNCH_PASS0 -+ rpi_launch_vpu_qpu(s); -+-#endif -+-#ifndef INTER_PASS0 -+ // Perform inter prediction -+ rpi_execute_inter_cmds(s); -+-#endif -+ // Wait for transform completion -+ vpu_wait(s->vpu_id); -+ -+@@ -234,28 +213,6 @@ static void *worker_start(void *arg) -+ // Perform deblocking for CTBs in this row -+ rpi_execute_dblk_cmds(s); -+ -+- worker_complete_middle_job(s); -+- LOG_EXIT -+- } -+- return NULL; -+-} -+- -+-static void *worker_deblock_start(void *arg) -+-{ -+- HEVCContext *s = (HEVCContext *)arg; -+- while(1) { -+- pthread_mutex_lock(&s->worker_mutex); -+- while( !s->kill_worker && s->worker_middle - s->worker_head <= 0) -+- { -+- pthread_cond_wait(&s->worker_cond_middle, &s->worker_mutex); -+- } -+- pthread_mutex_unlock(&s->worker_mutex); -+- -+- if (s->kill_worker) { -+- break; -+- } -+- LOG_ENTER -+- -+ worker_complete_job(s); -+ LOG_EXIT -+ } -+@@ -2987,11 +2944,7 @@ static void rpi_execute_dblk_cmds(HEVCContext *s) -+ static void rpi_execute_transform(HEVCContext *s) -+ { -+ int i=2; -+-#ifdef LAUNCH_PASS0 -+- int job = s->pass0_job; -+-#else -+ int job = s->pass1_job; -+-#endif -+ //int j; -+ //int16_t *coeffs = s->coeffs_buf_arm[i]; -+ //for(j=s->num_coeffs[i]; j > 0; j-= 16*16, coeffs+=16*16) { -+@@ -3046,11 +2999,7 @@ static void rpi_execute_pred_cmds(HEVCContext *s) -+ -+ static void rpi_execute_inter_cmds(HEVCContext *s) -+ { -+-#ifdef INTER_PASS0 -+- int job = s->pass0_job; -+-#else -+ int job = s->pass1_job; -+-#endif -+ HEVCMvCmd *cmd = s->unif_mv_cmds[job]; -+ int n,cidx; -+ AVFrame myref; -+@@ -3456,11 +3405,7 @@ static void rpi_simulate_inter_qpu(HEVCContext *s) -+ static void rpi_launch_vpu_qpu(HEVCContext *s) -+ { -+ int k; -+-#ifdef LAUNCH_PASS0 -+- int job = s->pass0_job; -+-#else -+ int job = s->pass1_job; -+-#endif -+ int i; -+ uint32_t *unif_vc = (uint32_t *)s->unif_mvs_ptr[job].vc; -+ #ifdef RPI_LUMA_QPU -+@@ -3563,10 +3508,12 @@ static void rpi_launch_vpu_qpu(HEVCContext *s) -+ -+ #ifdef RPI -+ -++#ifndef RPI_FAST_CACHEFLUSH -+ static void flush_buffer(AVBufferRef *bref) { -+ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+ gpu_cache_flush(p); -+ } -++#endif -+ -+ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ { -+@@ -3704,7 +3651,6 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #ifdef RPI_WORKER -+ s->pass0_job = 0; -+ s->pass1_job = 0; -+- s->pass2_job = 0; -+ #endif -+ #ifdef RPI -+ rpi_begin(s); -+@@ -3756,12 +3702,6 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ #ifdef RPI_WORKER -+ if (s->used_for_ref) { -+ // Split work load onto separate threads so we make as rapid progress as possible with this frame -+- #ifdef INTER_PASS0 -+- rpi_execute_inter_cmds(s); -+- #endif -+- #ifdef LAUNCH_PASS0 -+- rpi_launch_vpu_qpu(s); -+- #endif -+ // Pass on this job to worker thread -+ worker_submit_job(s); -+ // Make sure we have space to prepare the next job -+@@ -3803,8 +3743,6 @@ static int hls_decode_entry(AVCodecContext *avctxt, void *isFilterThread) -+ // Wait for the worker to finish all its jobs -+ if (s->enable_rpi) { -+ worker_wait(s); -+- av_assert0(s->pass0_job==s->pass1_job); -+- av_assert0(s->pass1_job==s->pass2_job); -+ } -+ #endif -+ -+@@ -4554,16 +4492,13 @@ static av_cold void hevc_init_worker(HEVCContext *s) -+ { -+ int err; -+ pthread_cond_init(&s->worker_cond_head, NULL); -+- pthread_cond_init(&s->worker_cond_middle, NULL); -+ pthread_cond_init(&s->worker_cond_tail, NULL); -+ pthread_mutex_init(&s->worker_mutex, NULL); -+ -+ s->worker_tail=0; -+- s->worker_middle=0; -+ s->worker_head=0; -+ s->kill_worker=0; -+ err = pthread_create(&s->worker_thread, NULL, worker_start, s); -+- err = pthread_create(&s->worker_deblock_thread, NULL, worker_deblock_start, s); -+ if (err) { -+ printf("Failed to create worker thread\n"); -+ exit(-1); -+@@ -4575,17 +4510,13 @@ static av_cold void hevc_exit_worker(HEVCContext *s) -+ void *res; -+ s->kill_worker=1; -+ pthread_cond_broadcast(&s->worker_cond_tail); -+- pthread_cond_broadcast(&s->worker_cond_middle); -+ pthread_join(s->worker_thread, &res); -+- pthread_join(s->worker_deblock_thread, &res); -+ -+ pthread_cond_destroy(&s->worker_cond_head); -+- pthread_cond_destroy(&s->worker_cond_middle); -+ pthread_cond_destroy(&s->worker_cond_tail); -+ pthread_mutex_destroy(&s->worker_mutex); -+ -+ s->worker_tail=0; -+- s->worker_middle=0; -+ s->worker_head=0; -+ s->kill_worker=0; -+ } -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index 3aea745..a577fcb 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -957,7 +957,6 @@ typedef struct HEVCContext { -+ //GPU_MEM_PTR_T dummy; -+ int pass0_job; // Pass0 does coefficient decode -+ int pass1_job; // Pass1 does pixel processing -+- int pass2_job; // Pass2 does reconstruction and deblocking -+ int ctu_count; // Number of CTUs done in pass0 so far -+ int max_ctu_count; // Number of CTUs when we trigger a round of processing -+ int ctu_per_y_chan; // Number of CTUs per luma QPU -+@@ -989,15 +988,12 @@ typedef struct HEVCContext { -+ -+ #ifdef RPI_WORKER -+ pthread_t worker_thread; -+- pthread_t worker_deblock_thread; -+ pthread_cond_t worker_cond_head; -+ pthread_cond_t worker_cond_tail; -+- pthread_cond_t worker_cond_middle; -+ pthread_mutex_t worker_mutex; -+ -+ int worker_tail; // Contains the number of posted jobs -+ int worker_head; // Contains the number of completed jobs -+- int worker_middle; // Contains the number of completed jobs -+ int kill_worker; // set to 1 to terminate the worker -+ #endif -+ -+-- -+2.5.0 -+ -+ -+From 9ad14cb77eeec547db386bd2c3a6e25f41ae5b31 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Mon, 8 Jun 2015 11:04:43 +0100 -+Subject: [PATCH 62/68] Reduced amount of output frame that is invalidated -+ -+--- -+ libavcodec/hevc.c | 45 +++++++++++++++++++++++++++++---------------- -+ 1 file changed, 29 insertions(+), 16 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index bbb7ad3..2374c2b 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -68,7 +68,7 @@ -+ static void rpi_execute_inter_cmds(HEVCContext *s); -+ static void rpi_begin(HEVCContext *s); -+ static void flush_frame(HEVCContext *s,AVFrame *frame); -+- static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2); -++ static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2, int job); -+ -+ #endif -+ -+@@ -3443,9 +3443,9 @@ static void rpi_launch_vpu_qpu(HEVCContext *s) -+ -+ #ifdef RPI_MULTI_MAILBOX -+ #ifdef RPI_CACHE_UNIF_MVS -+- flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],&s->y_unif_mvs_ptr[job], &s->unif_mvs_ptr[job]); -++ flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],&s->y_unif_mvs_ptr[job], &s->unif_mvs_ptr[job], job); -+ #else -+- flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],NULL,NULL); -++ flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],NULL,NULL, job); -+ #endif -+ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], s->num_coeffs[job][3] >> 10, 0, -+ qpu_get_fn(QPU_MC_SETUP_UV), -+@@ -3519,6 +3519,7 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ { -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -+ int n = s->ps.sps->height; -+ int curr_y = 0; -+ int curr_uv = 0; -+@@ -3526,22 +3527,21 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ int sz,base; -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -+ iocache.s[0].handle = p->vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = p->arm + base; -++ iocache.s[0].addr = (int)(p->arm) + base; -+ iocache.s[0].size = sz; -+ p = av_buffer_pool_opaque(frame->buf[2]); -+ iocache.s[1].handle = p->vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = p->arm + base; -++ iocache.s[1].addr = (int)(p->arm) + base; -+ iocache.s[1].size = sz; -+ p = av_buffer_pool_opaque(frame->buf[0]); -+ sz = s->frame->linesize[0] * (n-curr_y); -+ base = s->frame->linesize[0] * curr_y; -+ iocache.s[2].handle = p->vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = p->arm + base; -++ iocache.s[2].addr = (int)(p->arm) + base; -+ iocache.s[2].size = sz; -+ vcsm_clean_invalid( &iocache ); -+ #else -+@@ -3551,33 +3551,46 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ #endif -+ } -+ -+-static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2) -++static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2, int job) -+ { -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+- int n = s->ps.sps->height; -+- int curr_y = 0; -+- int curr_uv = 0; -+- int n_uv = n >> s->ps.sps->vshift[1]; -++ int n; -++ int curr_y; -++ int curr_uv; -++ int n_uv; -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -+ int sz,base; -++ int (*d)[2] = s->dblk_cmds[job]; -++ int low=(*d)[1]; -++ int high=(*d)[1]; -++ for(n = s->num_dblk_cmds[job]; n>0 ;n--,d++) { -++ int y = (*d)[1]; -++ low=FFMIN(low,y); -++ high=FFMAX(high,y); -++ } -++ curr_y = low; -++ n = high+(1 << s->ps.sps->log2_ctb_size); -++ curr_uv = curr_y >> s->ps.sps->vshift[1]; -++ n_uv = n >> s->ps.sps->vshift[1]; -++ -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -+ iocache.s[0].handle = p->vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = p->arm + base; -++ iocache.s[0].addr = (int)(p->arm) + base; -+ iocache.s[0].size = sz; -+ p = av_buffer_pool_opaque(frame->buf[2]); -+ iocache.s[1].handle = p->vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = p->arm + base; -++ iocache.s[1].addr = (int)(p->arm) + base; -+ iocache.s[1].size = sz; -+ p = av_buffer_pool_opaque(frame->buf[0]); -+ sz = s->frame->linesize[0] * (n-curr_y); -+ base = s->frame->linesize[0] * curr_y; -+ iocache.s[2].handle = p->vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = p->arm + base; -++ iocache.s[2].addr = (int)(p->arm) + base; -+ iocache.s[2].size = sz; -+ -+ iocache.s[3].handle = p0->vcsm_handle; -+-- -+2.5.0 -+ -+ -+From e5e5d6e39c9361a4c842656103b7411b75098c0c Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Mon, 8 Jun 2015 11:55:29 +0100 -+Subject: [PATCH 63/68] Packed 16x16 and 32x32 into the same buffer -+ -+--- -+ libavcodec/hevc.c | 24 +++++++++++++++--------- -+ libavcodec/hevc_cabac.c | 9 ++++++++- -+ libavcodec/rpi_qpu.c | 2 +- -+ 3 files changed, 24 insertions(+), 11 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 2374c2b..3df6308 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -299,12 +299,12 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ s->coeffs_buf_arm[job][0] = (int16_t*) s->coeffs_buf_default[job].arm; -+ if (!s->coeffs_buf_arm[job][0]) -+ goto fail; -+- gpu_malloc_cached(sizeof(int16_t) * coefs_per_row * 2, &s->coeffs_buf_accelerated[job]); -++ gpu_malloc_cached(sizeof(int16_t) * (coefs_per_row + 32*32), &s->coeffs_buf_accelerated[job]); // We prefetch past the end so provide an extra blocks worth of data -+ s->coeffs_buf_arm[job][2] = (int16_t*) s->coeffs_buf_accelerated[job].arm; -+ s->coeffs_buf_vc[job][2] = s->coeffs_buf_accelerated[job].vc; -+ if (!s->coeffs_buf_arm[job][2]) -+ goto fail; -+- s->coeffs_buf_arm[job][3] = coefs_per_row + s->coeffs_buf_arm[job][2]; -++ s->coeffs_buf_arm[job][3] = coefs_per_row + s->coeffs_buf_arm[job][2]; // This points to just beyond the end of the buffer. Coefficients fill in backwards. -+ s->coeffs_buf_vc[job][3] = sizeof(int16_t) * coefs_per_row + s->coeffs_buf_vc[job][2]; -+ } -+ } -+@@ -2945,15 +2945,20 @@ static void rpi_execute_transform(HEVCContext *s) -+ { -+ int i=2; -+ int job = s->pass1_job; -+- //int j; -+- //int16_t *coeffs = s->coeffs_buf_arm[i]; -+- //for(j=s->num_coeffs[i]; j > 0; j-= 16*16, coeffs+=16*16) { -+- // s->hevcdsp.idct[4-2](coeffs, 16); -+- //} -++ /*int j; -++ int16_t *coeffs = s->coeffs_buf_arm[job][i]; -++ for(j=s->num_coeffs[job][i]; j > 0; j-= 16*16, coeffs+=16*16) { -++ s->hevcdsp.idct[4-2](coeffs, 16); -++ } -++ i=3; -++ coeffs = s->coeffs_buf_arm[job][i] - s->num_coeffs[job][i]; -++ for(j=s->num_coeffs[job][i]; j > 0; j-= 32*32, coeffs+=32*32) { -++ s->hevcdsp.idct[5-2](coeffs, 32); -++ }*/ -+ -+ gpu_cache_flush(&s->coeffs_buf_accelerated[job]); -+ s->vpu_id = vpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], -+- s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], -++ s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3] - sizeof(int16_t) * s->num_coeffs[job][3], -+ s->num_coeffs[job][3] >> 10, 0, &s->coeffs_buf_accelerated[job]); -+ //vpu_execute_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[2], s->num_coeffs[2] >> 8, s->coeffs_buf_vc[3], s->num_coeffs[3] >> 10, 0); -+ //gpu_cache_flush(&s->coeffs_buf_accelerated); -+@@ -3447,7 +3452,8 @@ static void rpi_launch_vpu_qpu(HEVCContext *s) -+ #else -+ flush_frame3(s, s->frame,&s->coeffs_buf_accelerated[job],NULL,NULL, job); -+ #endif -+- s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], s->num_coeffs[job][2] >> 8, s->coeffs_buf_vc[job][3], s->num_coeffs[job][3] >> 10, 0, -++ s->vpu_id = vpu_qpu_post_code( vpu_get_fn(), vpu_get_constants(), s->coeffs_buf_vc[job][2], s->num_coeffs[job][2] >> 8, -++ s->coeffs_buf_vc[job][3] - sizeof(int16_t) * s->num_coeffs[job][3], s->num_coeffs[job][3] >> 10, 0, -+ qpu_get_fn(QPU_MC_SETUP_UV), -+ (uint32_t)(unif_vc+(s->mvs_base[job][0 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -+ (uint32_t)(unif_vc+(s->mvs_base[job][1 ] - (uint32_t*)s->unif_mvs_ptr[job].arm)), -+diff --git a/libavcodec/hevc_cabac.c b/libavcodec/hevc_cabac.c -+index 16e7ac3..271e17a 100644 -+--- a/libavcodec/hevc_cabac.c -++++ b/libavcodec/hevc_cabac.c -+@@ -1051,7 +1051,14 @@ void ff_hevc_hls_residual_coding(HEVCContext *s, int x0, int y0, -+ if (s->enable_rpi) { -+ int n = trafo_size * trafo_size; -+ if (use_vpu) { -+- coeffs = s->coeffs_buf_arm[s->pass0_job][log2_trafo_size - 2] + s->num_coeffs[s->pass0_job][log2_trafo_size - 2]; -++ // We support size 4 and size 5. -++ // Size 4 grows from the front (Coeffs_buf_arm[2] points to start of buf) -++ // Size 5 grows from the back (Coeffs_buf_arm[3] points to end of buf) -++ // num_coeffs is indexed by log2_trafo_size-2 -++ if (log2_trafo_size == 4) -++ coeffs = s->coeffs_buf_arm[s->pass0_job][log2_trafo_size - 2] + s->num_coeffs[s->pass0_job][log2_trafo_size - 2]; -++ else -++ coeffs = s->coeffs_buf_arm[s->pass0_job][log2_trafo_size - 2] - s->num_coeffs[s->pass0_job][log2_trafo_size - 2] - n; -+ s->num_coeffs[s->pass0_job][log2_trafo_size - 2] += n; -+ } else { -+ coeffs = s->coeffs_buf_arm[s->pass0_job][0] + s->num_coeffs[s->pass0_job][0]; -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 4480f72..0121fca 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -5,7 +5,7 @@ -+ // define RPI_TIME_TOTAL_VPU to print out how much time is spent in the VPI code -+ //#define RPI_TIME_TOTAL_VPU -+ // define RPI_TIME_TOTAL_POSTED to print out how much time is spent in the multi execute QPU/VPU combined -+-//#define RPI_TIME_TOTAL_POSTED -++#define RPI_TIME_TOTAL_POSTED -+ // define RPI_ASYNC to run the VPU in a separate thread, need to make a separate call to check for completion -+ #define RPI_ASYNC -+ -+-- -+2.5.0 -+ -+ -+From a1c0980a8ce8b0059637e9fdc61b1cbd64c58e43 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Thu, 25 Jun 2015 09:02:47 +0100 -+Subject: [PATCH 64/68] Moved luma deblock to VPU -+ -+--- -+ libavcodec/hevc.c | 18 +- -+ libavcodec/hevc.h | 11 + -+ libavcodec/hevc_filter.c | 120 ++- -+ libavcodec/rpi_hevc_transform.h | 1802 ++++++++++++++++++++++++++++++++++++++- -+ libavcodec/rpi_hevc_transform.s | 426 +++++++++ -+ libavcodec/rpi_qpu.c | 12 +- -+ libavcodec/rpi_shader.c | 2 +- -+ 7 files changed, 2378 insertions(+), 13 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 3df6308..0ecaf05 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -246,6 +246,12 @@ static void pic_arrays_free(HEVCContext *s) -+ } -+ } -+ #endif -++#ifdef RPI_DEBLOCK_VPU -++ if (s->y_setup_arm) { -++ gpu_free(&s->y_setup_ptr); -++ s->y_setup_arm = 0; -++ } -++#endif -+ av_freep(&s->sao); -+ av_freep(&s->deblock); -+ -+@@ -283,12 +289,12 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ int min_pu_size = sps->min_pu_width * sps->min_pu_height; -+ -+ #ifdef RPI -+- av_assert0(sps); -+ int coefs_in_ctb = (1 << sps->log2_ctb_size) * (1 << sps->log2_ctb_size); -+ int coefs_per_luma = 64*64*24*RPI_NUM_CHUNKS; -+ int coefs_per_chroma = (coefs_per_luma * 2) >> sps->vshift[1] >> sps->hshift[1]; -+ int coefs_per_row = coefs_per_luma + coefs_per_chroma; -+ int job; -++ av_assert0(sps); -+ s->max_ctu_count = coefs_per_luma / coefs_in_ctb; -+ s->ctu_per_y_chan = s->max_ctu_count / 12; -+ s->ctu_per_uv_chan = s->max_ctu_count / 8; -+@@ -309,6 +315,16 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ } -+ } -+ #endif -++#ifdef RPI_DEBLOCK_VPU -++ s->enable_rpi_deblock = !sps->sao_enabled; -++ s->setup_width = (sps->width+15) / 16; -++ s->setup_height = (sps->height+15) / 16; -++ gpu_malloc_uncached(sizeof(*s->y_setup_arm) * s->setup_width * s->setup_height, &s->y_setup_ptr); // TODO make this cached -++ s->y_setup_arm = (void*)s->y_setup_ptr.arm; -++ s->y_setup_vc = (void*)s->y_setup_ptr.vc; -++ memset(s->y_setup_arm, 0, s->y_setup_ptr.numbytes); -++ printf("Setup %d by %d by %d\n",s->setup_width,s->setup_height,sizeof(*s->y_setup_arm)); -++#endif -+ -+ s->bs_width = (width >> 2) + 1; -+ s->bs_height = (height >> 2) + 1; -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index a577fcb..b1d3ee0 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -56,6 +56,8 @@ -+ // Define RPI_WORKER to launch a worker thread for pixel processing tasks -+ #define RPI_WORKER -+ -++ #define RPI_DEBLOCK_VPU -++ -+ #endif -+ -+ #define MAX_DPB_SIZE 16 // A.4.1 -+@@ -997,6 +999,15 @@ typedef struct HEVCContext { -+ int kill_worker; // set to 1 to terminate the worker -+ #endif -+ -++#ifdef RPI_DEBLOCK_VPU -++ int enable_rpi_deblock; -++ GPU_MEM_PTR_T y_setup_ptr; -++ uint8_t (*y_setup_arm)[2][2][2][4]; -++ uint8_t (*y_setup_vc)[2][2][2][4]; -++ int setup_width; // Number of 16x16 blocks across the image -++ int setup_height; // Number of 16x16 blocks down the image -++#endif -++ -+ #endif -+ -+ uint8_t *cabac_state; -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 1f04790..06371da 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -564,6 +564,19 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->frame->linesize[LUMA], -+ beta, tc, no_p, no_q); -+ } else -++#ifdef RPI_DEBLOCK_VPU -++ if (s->enable_rpi_deblock) { -++ uint8_t (*setup)[2][2][4]; -++ int num16 = (y>>4)*s->setup_width + (x>>4); -++ int a = ((y>>3) & 1) << 1; -++ int b = (x>>3) & 1; -++ setup = s->y_setup_arm[num16]; -++ setup[0][b][0][a] = beta; -++ setup[0][b][0][a + 1] = beta; -++ setup[0][b][1][a] = tc[0]; -++ setup[0][b][1][a + 1] = tc[1]; -++ } else -++#endif -+ s->hevcdsp.hevc_v_loop_filter_luma(src, -+ s->frame->linesize[LUMA], -+ beta, tc, no_p, no_q); -+@@ -596,6 +609,19 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->frame->linesize[LUMA], -+ beta, tc, no_p, no_q); -+ } else -++#ifdef RPI_DEBLOCK_VPU -++ if (s->enable_rpi_deblock) { -++ uint8_t (*setup)[2][2][4]; -++ int num16 = (y>>4)*s->setup_width + (x>>4); -++ int a = ((x>>3) & 1) << 1; -++ int b = (y>>3) & 1; -++ setup = s->y_setup_arm[num16]; -++ setup[1][b][0][a] = beta; -++ setup[1][b][0][a + 1] = beta; -++ setup[1][b][1][a] = tc[0]; -++ setup[1][b][1][a + 1] = tc[1]; -++ } else -++#endif -+ s->hevcdsp.hevc_h_loop_filter_luma(src, -+ s->frame->linesize[LUMA], -+ beta, tc, no_p, no_q); -+@@ -876,33 +902,85 @@ static void flush_buffer(AVBufferRef *bref) { -+ } -+ -+ // Return Physical address for this image -+-static int ff_hevc_buf_base(AVBufferRef *bref) { -++static uint32_t get_vc_address(AVBufferRef *bref) { -+ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+- return p->vc & 0x3fffffff; -++ return p->vc; -+ } -+ -++// ff_hevc_flush_buffer_lines -++// flushes and invalidates all pixel rows in [start,end-1] -++static void ff_hevc_flush_buffer_lines(HEVCContext *s, int start, int end, int flush_luma, int flush_chroma) -++{ -++#ifdef RPI_FAST_CACHEFLUSH -++ struct vcsm_user_clean_invalid_s iocache = {}; -++ int curr_y = start; -++ int n = end; -++ int curr_uv = curr_y >> s->ps.sps->vshift[1]; -++ int n_uv = n >> s->ps.sps->vshift[1]; -++ int sz,base; -++ GPU_MEM_PTR_T *p; -++ if (curr_uv < 0) curr_uv = 0; -++ if (n_uv<=curr_uv) { return; } -++ sz = s->frame->linesize[1] * (n_uv-curr_uv); -++ base = s->frame->linesize[1] * curr_uv; -++ if (flush_chroma) { -++ p = av_buffer_pool_opaque(s->frame->buf[1]); -++ iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].cmd = 3; // clean+invalidate -++ iocache.s[0].addr = (int)p->arm + base; -++ iocache.s[0].size = sz; -++ p = av_buffer_pool_opaque(s->frame->buf[2]); -++ iocache.s[1].handle = p->vcsm_handle; -++ iocache.s[1].cmd = 3; // clean+invalidate -++ iocache.s[1].addr = (int)p->arm + base; -++ iocache.s[1].size = sz; -++ } -++ if (flush_luma) { -++ p = av_buffer_pool_opaque(s->frame->buf[0]); -++ sz = s->frame->linesize[0] * (n-curr_y); -++ base = s->frame->linesize[0] * curr_y; -++ iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].cmd = 3; // clean+invalidate -++ iocache.s[2].addr = (int)p->arm + base; -++ iocache.s[2].size = sz; -++ } -++ vcsm_clean_invalid( &iocache ); -++#else -++ if (flush_chroma) { -++ flush_buffer(s->frame->buf[1]); -++ flush_buffer(s->frame->buf[2]); -++ } -++ if (flush_luma) { -++ flush_buffer(s->frame->buf[0]); -++ } -++#endif -++} -++ -++ -+ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ { -+ if (s->enable_rpi && s->used_for_ref) { -++ // TODO make this use ff_hevc_flush_buffer_lines -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+ int curr_y = ((int *)f->progress->data)[0]; -+ int curr_uv = curr_y >> s->ps.sps->vshift[1]; -+ int n_uv = n >> s->ps.sps->vshift[1]; -+ int sz,base; -++ GPU_MEM_PTR_T *p; -+ if (curr_uv < 0) curr_uv = 0; -+ if (n_uv<=curr_uv) { return; } -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(s->frame->buf[1]); -++ p = av_buffer_pool_opaque(s->frame->buf[1]); -+ iocache.s[0].handle = p->vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = p->arm + base; -++ iocache.s[0].addr = (int)p->arm + base; -+ iocache.s[0].size = sz; -+ p = av_buffer_pool_opaque(s->frame->buf[2]); -+ iocache.s[1].handle = p->vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = p->arm + base; -++ iocache.s[1].addr = (int)p->arm + base; -+ iocache.s[1].size = sz; -+ -+ #ifdef RPI_LUMA_QPU -+@@ -911,7 +989,7 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ base = s->frame->linesize[0] * curr_y; -+ iocache.s[2].handle = p->vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = p->arm + base; -++ iocache.s[2].addr = (int)p->arm + base; -+ iocache.s[2].size = sz; -+ #endif -+ vcsm_clean_invalid( &iocache ); -+@@ -930,11 +1008,40 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ } -+ #endif -+ -++#ifdef RPI_DEBLOCK_VPU -++/* rpi_deblock deblocks an entire row of ctbs using the VPU */ -++static void rpi_deblock(HEVCContext *s, int y, int ctb_size) -++{ -++ // Flush image, 4 lines above to bottom of ctb stripe -++ ff_hevc_flush_buffer_lines(s, FFMAX(y-4,0), y+ctb_size, 1, 0); -++ // TODO flush buffer of beta/tc setup when it becomes cached -++ // Call VPU -++ // TODO add this to a separate pipeline of VPU jobs that can be run in parallel and wait for completion -++ vpu_wait(vpu_post_code( vpu_get_fn(), get_vc_address(s->frame->buf[0]) + s->frame->linesize[0] * y, s->frame->linesize[0], -++ s->setup_width, (int) ( s->y_setup_vc + s->setup_width * (y>>4) ), -++ ctb_size>>4, 2, 0)); // 2 means to do the deblocking code -++} -++ -++static void rpi_deblock2(HEVCContext *s, int y, int ctb_size) -++{ -++ int y2; -++ for(y2=y;y2= s->ps.sps->width - ctb_size; -+ if (s->avctx->skip_loop_filter < AVDISCARD_ALL) -+ deblocking_filter_CTB(s, x, y); -++#ifdef RPI_DEBLOCK_VPU -++ if (s->enable_rpi_deblock && x_end) -++ { -++ rpi_deblock(s, y, ctb_size); -++ } -++#endif -+ if (s->ps.sps->sao_enabled) { -+ int y_end = y >= s->ps.sps->height - ctb_size; -+ if (y && x) -+@@ -965,6 +1072,7 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ //if (((y + ctb_size)&63)==0) -+ #ifdef RPI_INTER_QPU -+ ff_hevc_flush_buffer(s, &s->ref->tf, y + ctb_size - 4); -++ // TODO we no longer need to flush the luma buffer as it is in GPU memory when using deblocking on the rpi -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -+ } -+diff --git a/libavcodec/rpi_hevc_transform.h b/libavcodec/rpi_hevc_transform.h -+index 4f13622..b3f155f 100644 -+--- a/libavcodec/rpi_hevc_transform.h -++++ b/libavcodec/rpi_hevc_transform.h -+@@ -3,7 +3,13 @@ unsigned char rpi_hevc_transform [] = { -+ 106, -+ 0, -+ 144, -+-35, -++38, -++1, -++37, -++106, -++0, -++144, -++57, -+ 1, -+ 169, -+ 3, -+@@ -627,4 +633,1798 @@ unsigned char rpi_hevc_transform [] = { -+ 30, -+ 90, -+ 0, -++169, -++3, -++73, -++64, -++52, -++64, -++45, -++64, -++2, -++64, -++10, -++64, -++64, -++198, -++1, -++7, -++8, -++232, -++63, -++0, -++0, -++0, -++6, -++232, -++253, -++255, -++255, -++255, -++0, -++246, -++0, -++0, -++0, -++4, -++215, -++64, -++3, -++96, -++2, -++248, -++0, -++35, -++0, -++0, -++64, -++56, -++0, -++0, -++4, -++248, -++0, -++36, -++0, -++0, -++64, -++56, -++8, -++0, -++0, -++240, -++64, -++0, -++132, -++3, -++128, -++240, -++0, -++0, -++132, -++3, -++128, -++144, -++137, -++0, -++131, -++98, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++129, -++0, -++131, -++102, -++0, -++158, -++67, -++0, -++2, -++248, -++0, -++35, -++0, -++0, -++64, -++56, -++0, -++0, -++4, -++248, -++0, -++36, -++0, -++0, -++64, -++56, -++8, -++0, -++0, -++240, -++64, -++0, -++132, -++3, -++128, -++240, -++0, -++0, -++132, -++3, -++128, -++144, -++108, -++0, -++131, -++98, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++100, -++0, -++131, -++102, -++0, -++248, -++64, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++128, -++248, -++0, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++128, -++144, -++161, -++0, -++188, -++64, -++67, -++232, -++0, -++2, -++0, -++0, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++150, -++0, -++195, -++232, -++0, -++2, -++0, -++0, -++12, -++128, -++7, -++192, -++130, -++248, -++0, -++0, -++112, -++192, -++224, -++16, -++195, -++31, -++132, -++248, -++1, -++0, -++112, -++0, -++224, -++16, -++203, -++31, -++3, -++99, -++131, -++71, -++68, -++232, -++32, -++0, -++0, -++0, -++0, -++99, -++2, -++99, -++23, -++102, -++7, -++106, -++127, -++156, -++182, -++255, -++0, -++248, -++64, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++128, -++248, -++0, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++128, -++144, -++112, -++0, -++188, -++64, -++67, -++232, -++0, -++2, -++0, -++0, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++101, -++0, -++195, -++232, -++0, -++2, -++0, -++0, -++12, -++128, -++7, -++192, -++130, -++248, -++0, -++0, -++112, -++192, -++224, -++16, -++195, -++31, -++132, -++248, -++1, -++0, -++112, -++0, -++224, -++16, -++203, -++31, -++25, -++102, -++9, -++106, -++2, -++30, -++41, -++3, -++26, -++87, -++162, -++64, -++64, -++198, -++1, -++23, -++127, -++158, -++103, -++255, -++239, -++3, -++0, -++254, -++0, -++143, -++92, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++64, -++143, -++93, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++128, -++143, -++94, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++143, -++95, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++142, -++208, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++128, -++142, -++209, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++64, -++142, -++210, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++0, -++142, -++211, -++0, -++0, -++240, -++12, -++0, -++128, -++144, -++107, -++0, -++8, -++255, -++99, -++23, -++0, -++212, -++192, -++51, -++0, -++0, -++8, -++255, -++163, -++23, -++0, -++228, -++192, -++51, -++0, -++0, -++8, -++255, -++227, -++23, -++0, -++244, -++192, -++51, -++0, -++0, -++8, -++255, -++35, -++52, -++0, -++180, -++192, -++51, -++0, -++0, -++8, -++255, -++99, -++52, -++0, -++164, -++192, -++51, -++0, -++0, -++8, -++255, -++163, -++52, -++0, -++148, -++192, -++51, -++0, -++0, -++111, -++3, -++239, -++3, -++0, -++254, -++0, -++143, -++12, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++64, -++143, -++13, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++128, -++143, -++14, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++143, -++15, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++142, -++16, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++128, -++142, -++17, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++64, -++142, -++18, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++0, -++142, -++19, -++0, -++0, -++240, -++12, -++0, -++128, -++144, -++33, -++0, -++8, -++255, -++99, -++3, -++0, -++212, -++192, -++51, -++0, -++0, -++8, -++255, -++163, -++3, -++0, -++228, -++192, -++51, -++0, -++0, -++8, -++255, -++227, -++3, -++0, -++244, -++192, -++51, -++0, -++0, -++8, -++255, -++35, -++4, -++0, -++180, -++192, -++51, -++0, -++0, -++8, -++255, -++99, -++4, -++0, -++164, -++192, -++51, -++0, -++0, -++8, -++255, -++163, -++4, -++0, -++148, -++192, -++51, -++0, -++0, -++111, -++3, -++32, -++246, -++192, -++11, -++1, -++16, -++32, -++246, -++2, -++137, -++47, -++240, -++40, -++246, -++2, -++140, -++47, -++240, -++128, -++245, -++99, -++140, -++5, -++4, -++0, -++247, -++99, -++140, -++1, -++20, -++88, -++246, -++99, -++140, -++1, -++20, -++0, -++247, -++35, -++136, -++62, -++226, -++32, -++247, -++35, -++136, -++32, -++210, -++0, -++247, -++34, -++136, -++63, -++2, -++208, -++246, -++34, -++136, -++0, -++4, -++0, -++247, -++99, -++136, -++58, -++162, -++32, -++247, -++99, -++136, -++33, -++146, -++0, -++247, -++98, -++136, -++59, -++18, -++208, -++246, -++98, -++136, -++0, -++20, -++0, -++247, -++162, -++136, -++33, -++2, -++88, -++246, -++98, -++137, -++2, -++68, -++88, -++246, -++162, -++137, -++3, -++68, -++208, -++254, -++227, -++136, -++60, -++242, -++192, -++243, -++188, -++11, -++208, -++254, -++227, -++136, -++56, -++178, -++192, -++243, -++188, -++10, -++32, -++255, -++226, -++136, -++38, -++58, -++192, -++243, -++60, -++0, -++208, -++254, -++227, -++136, -++59, -++242, -++192, -++243, -++60, -++128, -++32, -++255, -++226, -++136, -++49, -++58, -++192, -++243, -++60, -++128, -++0, -++255, -++226, -++136, -++34, -++34, -++192, -++243, -++60, -++128, -++32, -++255, -++226, -++136, -++37, -++58, -++192, -++243, -++60, -++128, -++0, -++254, -++192, -++136, -++1, -++4, -++0, -++240, -++0, -++160, -++0, -++255, -++194, -++8, -++0, -++52, -++195, -++243, -++0, -++128, -++0, -++255, -++202, -++40, -++0, -++52, -++195, -++243, -++0, -++128, -++0, -++254, -++0, -++240, -++35, -++10, -++0, -++240, -++60, -++0, -++0, -++254, -++192, -++136, -++1, -++4, -++0, -++240, -++0, -++160, -++0, -++255, -++226, -++140, -++34, -++34, -++195, -++243, -++60, -++0, -++32, -++255, -++227, -++140, -++36, -++58, -++192, -++243, -++60, -++0, -++0, -++254, -++192, -++136, -++0, -++4, -++0, -++240, -++0, -++160, -++16, -++246, -++226, -++136, -++35, -++50, -++16, -++246, -++226, -++136, -++35, -++50, -++32, -++246, -++226, -++136, -++35, -++50, -++32, -++254, -++226, -++136, -++35, -++58, -++192, -++243, -++60, -++0, -++11, -++96, -++0, -++254, -++0, -++240, -++1, -++4, -++0, -++240, -++64, -++115, -++5, -++106, -++0, -++144, -++173, -++1, -++27, -++96, -++0, -++254, -++0, -++240, -++1, -++4, -++0, -++240, -++64, -++147, -++5, -++106, -++0, -++144, -++227, -++0, -++64, -++246, -++163, -++140, -++1, -++4, -++0, -++246, -++192, -++175, -++63, -++2, -++0, -++246, -++192, -++174, -++59, -++2, -++0, -++246, -++128, -++175, -++62, -++2, -++0, -++246, -++128, -++174, -++58, -++2, -++0, -++246, -++64, -++175, -++61, -++2, -++0, -++246, -++64, -++174, -++57, -++2, -++0, -++255, -++43, -++240, -++4, -++212, -++192, -++243, -++128, -++11, -++64, -++254, -++43, -++240, -++1, -++228, -++192, -++243, -++128, -++10, -++64, -++254, -++43, -++240, -++1, -++244, -++192, -++243, -++128, -++10, -++64, -++254, -++43, -++240, -++1, -++180, -++192, -++243, -++128, -++10, -++64, -++254, -++43, -++141, -++0, -++164, -++192, -++243, -++128, -++10, -++88, -++246, -++35, -++141, -++3, -++68, -++32, -++247, -++35, -++141, -++191, -++66, -++240, -++246, -++35, -++141, -++50, -++66, -++0, -++255, -++235, -++143, -++52, -++242, -++192, -++243, -++60, -++128, -++0, -++255, -++43, -++240, -++2, -++212, -++192, -++243, -++128, -++11, -++0, -++255, -++43, -++240, -++191, -++226, -++192, -++243, -++188, -++10, -++64, -++254, -++43, -++141, -++0, -++180, -++192, -++243, -++128, -++10, -++88, -++246, -++35, -++141, -++2, -++68, -++32, -++247, -++35, -++141, -++190, -++66, -++240, -++246, -++35, -++141, -++50, -++66, -++0, -++255, -++171, -++143, -++52, -++226, -++192, -++243, -++60, -++128, -++0, -++255, -++43, -++240, -++4, -++180, -++192, -++243, -++128, -++11, -++0, -++255, -++43, -++240, -++191, -++226, -++192, -++243, -++188, -++10, -++128, -++253, -++43, -++240, -++3, -++212, -++192, -++243, -++128, -++10, -++64, -++254, -++35, -++141, -++1, -++196, -++192, -++243, -++128, -++10, -++88, -++246, -++35, -++141, -++3, -++68, -++32, -++247, -++35, -++141, -++189, -++66, -++240, -++246, -++35, -++141, -++50, -++66, -++0, -++255, -++107, -++143, -++52, -++210, -++192, -++243, -++60, -++128, -++0, -++255, -++43, -++240, -++4, -++148, -++192, -++243, -++128, -++11, -++64, -++254, -++43, -++240, -++1, -++164, -++192, -++243, -++128, -++10, -++64, -++254, -++43, -++240, -++1, -++180, -++192, -++243, -++128, -++10, -++64, -++254, -++43, -++240, -++1, -++244, -++192, -++243, -++128, -++10, -++64, -++254, -++43, -++141, -++0, -++228, -++192, -++243, -++128, -++10, -++88, -++246, -++35, -++141, -++3, -++68, -++32, -++247, -++35, -++141, -++187, -++66, -++240, -++246, -++35, -++141, -++50, -++66, -++0, -++255, -++235, -++142, -++52, -++178, -++192, -++243, -++60, -++128, -++0, -++255, -++43, -++240, -++2, -++148, -++192, -++243, -++128, -++11, -++0, -++255, -++43, -++240, -++187, -++162, -++192, -++243, -++188, -++10, -++64, -++254, -++43, -++141, -++0, -++244, -++192, -++243, -++128, -++10, -++88, -++246, -++35, -++141, -++2, -++68, -++32, -++247, -++35, -++141, -++186, -++66, -++240, -++246, -++35, -++141, -++50, -++66, -++0, -++255, -++171, -++142, -++52, -++162, -++192, -++243, -++60, -++128, -++0, -++255, -++43, -++240, -++4, -++244, -++192, -++243, -++128, -++11, -++0, -++255, -++43, -++240, -++187, -++162, -++192, -++243, -++188, -++10, -++128, -++253, -++43, -++240, -++3, -++148, -++192, -++243, -++128, -++10, -++64, -++254, -++35, -++141, -++1, -++132, -++192, -++243, -++128, -++10, -++88, -++246, -++35, -++141, -++3, -++68, -++32, -++247, -++35, -++141, -++185, -++66, -++240, -++246, -++35, -++141, -++50, -++66, -++0, -++255, -++107, -++142, -++52, -++146, -++192, -++243, -++60, -++128, -++64, -++255, -++98, -++141, -++0, -++52, -++192, -++243, -++0, -++0, -++0, -++254, -++0, -++240, -++53, -++10, -++0, -++240, -++60, -++0, -++0, -++254, -++0, -++240, -++1, -++4, -++0, -++240, -++64, -++147, -++5, -++106, -++0, -++144, -++177, -++0, -++88, -++246, -++163, -++140, -++1, -++4, -++128, -++245, -++99, -++141, -++10, -++4, -++88, -++246, -++162, -++138, -++1, -++68, -++0, -++247, -++162, -++138, -++36, -++162, -++88, -++254, -++162, -++138, -++3, -++164, -++192, -++243, -++128, -++11, -++0, -++255, -++226, -++137, -++32, -++2, -++195, -++243, -++60, -++0, -++32, -++247, -++226, -++137, -++42, -++114, -++0, -++255, -++34, -++138, -++33, -++18, -++195, -++243, -++60, -++0, -++32, -++247, -++34, -++138, -++42, -++130, -++16, -++246, -++98, -++138, -++40, -++114, -++16, -++246, -++98, -++138, -++41, -++146, -++32, -++246, -++98, -++138, -++41, -++146, -++32, -++246, -++226, -++137, -++41, -++146, -++40, -++246, -++34, -++138, -++41, -++146, -++32, -++247, -++163, -++141, -++63, -++178, -++32, -++247, -++227, -++141, -++62, -++162, -++0, -++254, -++0, -++240, -++8, -++4, -++0, -++240, -++128, -++11, -++128, -++253, -++35, -++240, -++9, -++100, -++192, -++243, -++128, -++10, -++128, -++253, -++163, -++141, -++128, -++115, -++192, -++243, -++152, -++10, -++88, -++246, -++163, -++141, -++4, -++100, -++208, -++246, -++35, -++139, -++0, -++100, -++32, -++255, -++34, -++139, -++53, -++202, -++192, -++243, -++60, -++128, -++0, -++254, -++0, -++139, -++0, -++4, -++0, -++240, -++0, -++160, -++240, -++246, -++163, -++141, -++48, -++98, -++0, -++247, -++99, -++139, -++63, -++210, -++0, -++247, -++98, -++139, -++1, -++212, -++88, -++254, -++98, -++139, -++1, -++212, -++192, -++243, -++128, -++11, -++32, -++255, -++99, -++139, -++62, -++98, -++192, -++243, -++188, -++10, -++88, -++246, -++98, -++139, -++1, -++212, -++240, -++246, -++98, -++139, -++50, -++210, -++0, -++247, -++163, -++128, -++59, -++146, -++0, -++247, -++160, -++128, -++1, -++36, -++88, -++254, -++160, -++128, -++1, -++36, -++192, -++243, -++128, -++11, -++0, -++247, -++163, -++128, -++58, -++98, -++64, -++255, -++35, -++240, -++0, -++100, -++192, -++243, -++128, -++10, -++64, -++255, -++163, -++128, -++0, -++164, -++192, -++243, -++128, -++10, -++88, -++246, -++160, -++128, -++1, -++36, -++240, -++246, -++160, -++128, -++50, -++34, -++8, -++255, -++227, -++143, -++54, -++242, -++192, -++243, -++60, -++128, -++40, -++255, -++227, -++142, -++54, -++178, -++192, -++243, -++60, -++128, -++0, -++254, -++0, -++240, -++39, -++10, -++0, -++240, -++60, -++128, -++8, -++255, -++163, -++143, -++45, -++226, -++192, -++243, -++60, -++128, -++0, -++254, -++0, -++240, -++44, -++10, -++0, -++240, -++60, -++0, -++0, -++254, -++0, -++240, -++40, -++10, -++0, -++240, -++60, -++128, -++8, -++255, -++163, -++142, -++2, -++162, -++192, -++243, -++60, -++128, -++90, -++0, -+ }; -+diff --git a/libavcodec/rpi_hevc_transform.s b/libavcodec/rpi_hevc_transform.s -+index fd159bc..b055208 100644 -+--- a/libavcodec/rpi_hevc_transform.s -++++ b/libavcodec/rpi_hevc_transform.s -+@@ -83,6 +83,8 @@ -+ hevc_trans_16x16: -+ cmp r5,1 -+ beq memclear16 -++ cmp r5,2 -++ beq hevc_deblock_16x16 -+ push r6-r15, lr # TODO cut down number of used registers -+ mov r14,r3 # coeffs32 -+ mov r15,r4 # num32 -+@@ -282,3 +284,427 @@ loop: -+ cmp r1,0 -+ bgt loop -+ b lr -++ -++ -++################################################################################ -++# HEVC VPU Deblock -++# -++# Vertical edges before horizontal -++# Decision can change every 4 pixels, but only 8 pixel boundaries are deblocked -++# -++# ARM is responsible for storing beta and tc for each 4 pixels horiz and vert edge. -++# The VPU code works in units of 16x16 blocks. -++# We do vertical filtering for the current block followed by horizontal filtering for the previous (except for the first time). -++# One final horizontal filter is required at the end. -++# PCM is not allowed in this code. -++# -++# -++# H(16-4:16+15,0) contains previous block (note that we need 4 lines above of context that may get altered during filtering) -++# H(16:31,16) contains current block (note that we do not need the upper lines until the horizontal filtering. -++ -++.set P0,63 -++.set P1,62 -++.set P2,61 -++.set P3,60 -++.set Q0,59 -++.set Q1,58 -++.set Q2,57 -++.set Q3,56 -++ -++.set dp,32 -++.set dq,33 -++.set d,34 -++.set decision,35 -++.set beta,36 -++.set beta2,37 -++.set beta3,38 -++.set ptest,39 -++.set qtest,40 -++.set pqtest,41 -++.set thresh,42 -++.set deltatest, 44 -++.set deltap1, 45 -++.set tc25, 46 -++.set setup,47 -++.set tc,48 -++.set tc25,49 -++.set tc2, 50 -++.set do_filter, 51 -++.set delta, 52 -++.set tc10, 53 -++.set delta0, 54 -++.set delta1, 55 -++.set zeros, 0 -++.set setup_input, 1 -++.set deltaq1, 2 -++ -++ -++ -++# hevc_deblock_16x16 deblocks an entire row that is 16 pixels high by the full width of the image. -++# Row has num16 16x16 blocks across -++# Beta goes from 0 to 64 -++# tc goes from 0 to 24 -++# setup[block_idx][0=vert,1=horz][0=first edge, 1=second edge][0=beta,1=tc][0..3=edge number] -++# has 8 bytes per edge -++# has 16 bytes per direction -++# has 32 bytes per 16x16 block -++# hevc_deblock_16x16(uint8_t *img (r0), int stride (r1), int num16w (r2), uint8_t setup[num16][2][2][2][4](r3),int num16h(r4)) -++hevc_deblock_16x16: -++ push r6-r15, lr -++ mov r9,r4 -++ mov r4,r3 -++ mov r13,r2 -++ mov r2,r0 -++ mov r10,r0 -++ subscale4 r0,r1 -++ mov r8,63 -++ mov r6,-3 -++ vmov H(zeros,0),0 -++# r7 is number of blocks still to load -++# r0 is location of current block - 4 * stride -++# r1 is stride -++# r2 is location of current block -++# r3 is offset of start of block (actual edges start at H(16,16)+r3 for horizontal and H(16,0)+r3 for vertical -++# r4 is setup -++# r5 is for temporary calculations -++# r8 holds 63 -++# r6 holds -3 -++# r9 holds the number of 16 high rows to process -++# r10 holds the original img base -++# r11 returns 0 if no filtering was done on the edge -++# r12 saves a copy of this -++# r13 is copy of width -++ -++process_row: -++ # First iteration does not do horizontal filtering on previous -++ mov r7, r13 -++ mov r3,0 -++ vldb H(12++,16)+r3,(r0 += r1) REP 4 # Load the current block -++ vldb H(16++,16)+r3,(r2 += r1) REP 16 -++ vldb H(setup_input,0), (r4) # We may wish to prefetch these -++ vstb H(zeros,0),(r4) -++ bl vert_filter -++ add r3,8 -++ vadd H(setup_input,0),H(setup_input,8),0 # Rotate to second set of 8 -++ bl vert_filter -++ sub r3,8 -++ b start_deblock_loop -++deblock_loop: -++ # Middle iterations do vertical on current block and horizontal on preceding -++ vldb H(12++,16)+r3,(r0 += r1) REP 4 # load the current block -++ vldb H(16++,16)+r3,(r2 += r1) REP 16 -++ vldb H(setup_input,0), (r4) -++ vstb H(zeros,0),(r4) -++ bl vert_filter -++ add r3,8 -++ vadd H(setup_input,0),H(setup_input,8),0 -++ bl vert_filter -++ sub r3,8 -++ vldb H(setup_input,0), -16(r4) -++ vstb H(zeros,0),-16(r4) -++ bl horz_filter -++ mov r12,r11 -++ add r3,8*64 -++ vadd H(setup_input,0),H(setup_input,8),0 -++ bl horz_filter -++ sub r3,8*64 -++ addcmpbeq r12,0,0,skip_save_top -++ vstb H(12++,0)+r3,-16(r0 += r1) REP 4 # Save the deblocked pixels for the previous block -++skip_save_top: -++ vstb H(16++,0)+r3,-16(r2 += r1) REP 16 -++start_deblock_loop: -++ # move onto next 16x16 (could do this with circular buffer support instead) -++ add r3,16 -++ and r3,r8 -++ add r4,32 -++ # Perform loop counter operations (may work with an addcmpbgt as well?) -++ add r0,16 -++ add r2,16 -++ sub r7,1 -++ cmp r7,0 # Are there still more blocks to load -++ bgt deblock_loop -++ -++ # Final iteration needs to just do horizontal filtering -++ vldb H(setup_input,0), -16(r4) -++ vstb H(zeros,0),-16(r4) -++ bl horz_filter -++ mov r12,r11 -++ add r3,8*64 -++ vadd H(setup_input,0),H(setup_input,8),0 -++ bl horz_filter -++ sub r3,64*8 -++ addcmpbeq r12,0,0,skip_save_top2 -++ vstb H(12++,0)+r3,-16(r0 += r1) REP 4 # Save the deblocked pixels for the previous block -++skip_save_top2: -++ vstb H(16++,0)+r3,-16(r2 += r1) REP 16 -++ -++# Now look to see if we should do another row -++ sub r9,1 -++ cmp r9,0 -++ bgt start_again -++ pop r6-r15, pc -++start_again: -++ # Need to sort out r0,r2 to point to next row down -++ addscale16 r10,r1 -++ mov r2,r10 -++ subscale4 r0,r2,r1 -++ b process_row -++ -++ -++# At this stage H(16,16)+r3 points to the first pixel of the 16 high edge to be filtered -++# So we can reuse the code we move the parts to be filtered into HX(P0/P1/P2/P3/Q0/Q1/Q2/Q3,0) - we will perform a final saturation step on placing them back into the correct locations -++ -++vert_filter: -++ push lr -++ -++ vmov HX(P3,0), V(16,12)+r3 -++ vmov HX(P2,0), V(16,13)+r3 -++ vmov HX(P1,0), V(16,14)+r3 -++ vmov HX(P0,0), V(16,15)+r3 -++ vmov HX(Q0,0), V(16,16)+r3 -++ vmov HX(Q1,0), V(16,17)+r3 -++ vmov HX(Q2,0), V(16,18)+r3 -++ vmov HX(Q3,0), V(16,19)+r3 -++ -++ bl do_luma_filter -++ -++ vadds V(16,13)+r3, HX(P2,0), 0 -++ vadds V(16,14)+r3, HX(P1,0), 0 -++ vadds V(16,15)+r3, HX(P0,0), 0 -++ # P3 and Q3 never change so don't bother saving back -++ vadds V(16,16)+r3, HX(Q0,0), 0 -++ vadds V(16,17)+r3, HX(Q1,0), 0 -++ vadds V(16,18)+r3, HX(Q2,0), 0 -++ -++ pop pc -++ -++# Filter edge at H(16,0)+r3 -++horz_filter: -++ push lr -++ -++ vmov HX(P3,0), H(12,0)+r3 -++ vmov HX(P2,0), H(13,0)+r3 -++ vmov HX(P1,0), H(14,0)+r3 -++ vmov HX(P0,0), H(15,0)+r3 -++ vmov HX(Q0,0), H(16,0)+r3 -++ vmov HX(Q1,0), H(17,0)+r3 -++ vmov HX(Q2,0), H(18,0)+r3 -++ vmov HX(Q3,0), H(19,0)+r3 -++ -++ bl do_luma_filter -++ -++ vadds H(13,0)+r3, HX(P2,0), 0 -++ vadds H(14,0)+r3, HX(P1,0), 0 -++ vadds H(15,0)+r3, HX(P0,0), 0 -++ # P3 and Q3 never change so don't bother saving back -++ vadds H(16,0)+r3, HX(Q0,0), 0 -++ vadds H(17,0)+r3, HX(Q1,0), 0 -++ vadds H(18,0)+r3, HX(Q2,0), 0 -++ -++ pop pc -++ -++# r4 points to array of beta/tc for each 4 length edge -++do_luma_filter: -++ valtl H(setup,0),H(setup_input,0),H(setup_input,0) # b*8tc*8 -++ valtl HX(beta,0),H(setup,0),H(setup,0) -++ valtu HX(tc,0),H(setup,0),H(setup,0) -++ vmul HX(tc25,0), HX(tc,0), 5 -++ vadd HX(tc25,0),HX(tc25,0), 1 -++ vasr HX(tc25,0), HX(tc25,0), 1 -++ -++ # Compute decision -++ vadd HX(dp,0),HX(P1,0),HX(P1,0) # 2*P1 -++ vsub HX(dp,0),HX(P2,0),HX(dp,0) # P2-2*P1 -++ vadd HX(dp,0),HX(dp,0),HX(P0,0) # P2-2*P1+P0 -++ vdist HX(dp,0),HX(dp,0),0 # abs(P2-2*P1+P0) # dp0 -++ -++ vadd HX(dq,0),HX(Q1,0),HX(Q1,0) # 2*Q1 -++ vsub HX(dq,0),HX(Q2,0),HX(dq,0) # Q2-2*Q1 -++ vadd HX(dq,0),HX(dq,0),HX(Q0,0) # Q2-2*Q1+Q0 -++ vdist HX(dq,0),HX(dq,0),0 # abs(Q2-2*Q1+Q0) # dq0 -++ -++ vadd HX(d,0), HX(dp,0), HX(dq,0) -++ vasr HX(beta2,0),HX(beta,0),2 -++ vasr HX(beta3,0),HX(beta,0),3 -++ -++ # Compute flags that are negative if all conditions pass -++ vdist HX(decision,0), HX(P0,0), HX(P3,0) CLRA SACC -++ vdist HX(decision,0), HX(Q0,0), HX(Q3,0) SACC -++ vsub HX(decision,0), HX(decision,0), HX(beta3,0) SETF -++ -++ vdist HX(decision,0), HX(P0,0), HX(Q0,0) IFN -++ vsub HX(decision,0), HX(decision,0), HX(tc25,0) IFN SETF -++ vadd HX(decision,0), HX(d,0), HX(d,0) IFN -++ vsub HX(decision,0), HX(decision,0), HX(beta2,0) IFN SETF -++ vmov HX(decision,0), 1 IFNN -++ vadd H(decision,0),H(decision,3),0 IFN -++ vadd H(decision,16),H(decision,19),0 IFN -++ vmov -,HX(decision,0) SETF # N marks strong filter -++ vmov HX(decision,0), 1 IFNN # NN marks normal filter -++ -++ vadd HX(do_filter,0), HX(d,3), HX(d,0) -++ vsub HX(do_filter,0), HX(do_filter,0), HX(beta,0) SETF # IFNN means no filter -++ vmov HX(decision,0),0 IFNN # Z marks no filter -++ -++ # Expand out decision (currently valid one every 4 pixels) 0...1...2...3 -++ # First extract out even terms -++ vodd HX(decision,0),HX(decision,0),HX(decision,0) # 0.1.2.3 -++ vodd HX(decision,0),HX(decision,0),HX(decision,0) # 0123 -++ # Now expand back -++ valtl HX(decision,0),HX(decision,0),HX(decision,0) # 00112233 -++ valtl HX(decision,0),HX(decision,0),HX(decision,0) SETF # 0000111122223333 -++ -++ # HX(decision,0) is negative if want strong filtering, 1 if want normal filtering, 0 if want no filtering -++ -++ # Do a quick check to see if there is anything to do -++ mov r11, 0 # Signal no filtering -++ vmov -,1 IFNZ SUMS r5 -++ cmp r5,0 -++ beq filtering_done -++ mov r11, 1 # Signal some filtering -++ # And whether there is any strong filtering -++ vmov -,1 IFN SUMS r5 -++ cmp r5,0 -++ beq normal_filtering -++ -++ ############################################################################## -++ # Strong filtering - could maybe fast case if all have same sign? (especially if all disabled!) -++ vshl HX(tc2,0), HX(tc,0), 1 # Note that in normal filtering tx2 is tc/2, while here it is tc*2 -++ -++ # Take a copy of the original pixels for use in decision calculation -++ vmov HX(P0,32),HX(P0,0) -++ vmov HX(Q0,32),HX(Q0,0) -++ vmov HX(P1,32),HX(P1,0) -++ vmov HX(Q1,32),HX(Q1,0) -++ vmov HX(P2,32),HX(P2,0) -++ vmov HX(Q2,32),HX(Q2,0) -++ -++ vadd -,HX(P2,32),4 CLRA SACC -++ vshl -,HX(P1,32),1 SACC -++ vshl -,HX(P0,32),1 SACC -++ vshl -,HX(Q0,32),1 SACC -++ vshl HX(delta,0),HX(Q1,32),0 SACC -++ vasr HX(delta,0),HX(delta,0), 3 -++ vsub HX(delta,0),HX(delta,0),HX(P0,32) -++ vclamps HX(delta,0), HX(delta,0), HX(tc2,0) -++ vadd HX(P0,0),HX(P0,32),HX(delta,0) IFN -++ -++ vadd -,HX(P2,32),2 CLRA SACC -++ vadd -,HX(P1,32),HX(P0,32) SACC -++ vshl HX(delta,0),HX(Q0,32),0 SACC -++ vasr HX(delta,0),HX(delta,0), 2 -++ vsub HX(delta,0),HX(delta,0),HX(P1,32) -++ vclamps HX(delta,0), HX(delta,0), HX(tc2,0) -++ vadd HX(P1,0),HX(P1,32),HX(delta,0) IFN -++ -++ vadd -,HX(Q0,32),4 CLRA SACC -++ vadd -,HX(P1,32),HX(P0,32) SACC -++ vmul -,HX(P2,32),3 SACC -++ vshl HX(delta,0),HX(P3,0),1 SACC # Note that we have not made a copy of P3, so using P3,0 is correct -++ vasr HX(delta,0),HX(delta,0), 3 -++ vsub HX(delta,0),HX(delta,0),HX(P2,32) -++ vclamps HX(delta,0), HX(delta,0), HX(tc2,0) -++ vadd HX(P2,0),HX(P2,32),HX(delta,0) IFN -++ #vmov HX(P2,0),3 IFN -++ -++ # Now reverse all P/Qs -++ -++ vadd -,HX(Q2,32),4 CLRA SACC -++ vshl -,HX(Q1,32),1 SACC -++ vshl -,HX(Q0,32),1 SACC -++ vshl -,HX(P0,32),1 SACC -++ vshl HX(delta,0),HX(P1,32),0 SACC -++ vasr HX(delta,0),HX(delta,0), 3 -++ vsub HX(delta,0),HX(delta,0),HX(Q0,32) -++ vclamps HX(delta,0), HX(delta,0), HX(tc2,0) -++ vadd HX(Q0,0),HX(Q0,32),HX(delta,0) IFN -++ -++ vadd -,HX(Q2,32),2 CLRA SACC -++ vadd -,HX(Q1,32),HX(Q0,32) SACC -++ vshl HX(delta,0),HX(P0,32),0 SACC -++ vasr HX(delta,0),HX(delta,0), 2 -++ vsub HX(delta,0),HX(delta,0),HX(Q1,32) -++ vclamps HX(delta,0), HX(delta,0), HX(tc2,0) -++ vadd HX(Q1,0),HX(Q1,32),HX(delta,0) IFN -++ -++ vadd -,HX(P0,32),4 CLRA SACC -++ vadd -,HX(Q1,32),HX(Q0,32) SACC -++ vmul -,HX(Q2,32),3 SACC -++ vshl HX(delta,0),HX(Q3,0),1 SACC # Note that we have not made a copy of Q3, so using Q3,0 is correct -++ vasr HX(delta,0),HX(delta,0), 3 -++ vsub HX(delta,0),HX(delta,0),HX(Q2,32) -++ vclamps HX(delta,0), HX(delta,0), HX(tc2,0) -++ vadd HX(Q2,0),HX(Q2,32),HX(delta,0) IFN -++ -++ ############################################################################## -++ # Normal filtering -++normal_filtering: -++ # Invert the decision flags -++ # make instruction more complicated as assembler has error and loses SETF -++ vrsub HX(tc10,0), HX(decision,0), 0 SETF # IFN means normal filtering -++ vmov -, HX(tc10,0) SETF # IFN means normal filtering -++ -++ vmov -,1 IFN SUMS r5 -++ cmp r5,0 -++ beq filtering_done -++ -++ vasr HX(tc2,0), HX(tc,0), 1 -++ vmul HX(tc10,0), HX(tc,0), 10 -++ -++ vasr HX(thresh,0), HX(beta,0), 1 -++ vadd HX(thresh,0), HX(thresh,0), HX(beta,0) -++ vasr HX(thresh,0), HX(thresh,0), 3 CLRA SACC -++ -++ vadd HX(ptest,0),HX(dp,3),HX(dp,0) -++ vsub HX(ptest,0),HX(ptest,0),HX(thresh,0) # ptest is negative if we need to do the P2 pixel -++ vadd HX(qtest,0),HX(dq,3),HX(dq,0) -++ vsub HX(qtest,0),HX(qtest,0),HX(thresh,0) # qtest is negative if we need to do the Q2 pixel -++ # Expand ptest and qtest together -++ vodd HX(pqtest,0),HX(ptest,0),HX(qtest,0) # p.p.p.p.q.q.q.q -++ vodd HX(pqtest,0),HX(pqtest,0),HX(pqtest,0) # ppppqqqq........ -++ valtl HX(pqtest,0),HX(pqtest,0),HX(pqtest,0) # ppppppppqqqqqqqq -++ valtl HX(ptest,0),HX(pqtest,0),HX(pqtest,0) -++ valtu HX(qtest,0),HX(pqtest,0),HX(pqtest,0) -++ -++ vsub HX(delta0,0), HX(Q0,0), HX(P0,0) -++ vsub HX(delta1,0), HX(Q1,0), HX(P1,0) -++ vmov -,8 CLRA SACC -++ vmul -,HX(delta0,0), 9 SACC -++ vmul HX(delta0,0),HX(delta1,0), r6 SACC -++ vasr HX(delta0,0), HX(delta0,0), 4 -++ vdist HX(deltatest,0), HX(delta0,0), 0 -++ vsub HX(deltatest,0), HX(deltatest,0), HX(tc10,0) IFN SETF # negative if still need to do something -++ vmov HX(deltatest,0), 0 IFNN # clear if no need to do anything so we can reload flags later -++ -++ vclamps HX(delta0,0), HX(delta0,0), HX(tc,0) -++ -++ vadd HX(deltap1,0), HX(P2,0), HX(P0,0) -++ vadd HX(deltap1,0), HX(deltap1,0), 1 -++ vasr HX(deltap1,0), HX(deltap1,0), 1 CLRA SACC -++ vsub HX(deltap1,0), HX(delta0,0), HX(P1,0) SACC -++ vasr HX(deltap1,0), HX(deltap1,0), 1 -++ vclamps HX(deltap1,0), HX(deltap1,0), HX(tc2,0) -++ -++ vadd HX(deltaq1,0), HX(Q2,0), HX(Q0,0) -++ vadd HX(deltaq1,0), HX(deltaq1,0), 1 -++ vasr HX(deltaq1,0), HX(deltaq1,0), 1 CLRA SACC -++ vadd HX(deltaq1,0), HX(delta0,0), HX(Q1,0) -++ vrsub -, HX(delta0,0), 0 SACC -++ vrsub HX(deltaq1,0), HX(Q1,0), 0 SACC -++ vasr HX(deltaq1,0), HX(deltaq1,0), 1 -++ vclamps HX(deltaq1,0), HX(deltaq1,0), HX(tc2,0) -++ -++ vadds HX(P0,0), HX(P0,0), HX(delta0,0) IFN -++ vsubs HX(Q0,0), HX(Q0,0), HX(delta0,0) IFN -++ -++ vmov -,HX(ptest,0) IFN SETF # Negative if need to do p1 -++ vadds HX(P1,0), HX(P1,0), HX(deltap1,0) IFN -++ -++ vmov -,HX(deltatest,0) SETF -++ vmov -,HX(qtest,0) IFN SETF # Negative if need to do q1 -++ vadds HX(Q1,0), HX(Q1,0), HX(deltaq1,0) IFN -++ -++ #vmov HX(P2,0),1 IFN -++ -++filtering_done: -++ b lr -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 0121fca..05b2169 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -147,7 +147,7 @@ static int gpu_init(volatile struct GPU **gpu) { -+ vcsm_init(); -+ gpu_malloc_uncached_internal(sizeof(struct GPU), &gpu_mem_ptr, mb); -+ ptr = (volatile struct GPU*)gpu_mem_ptr.arm; -+- memset(ptr, 0, sizeof *ptr); -++ memset((void*)ptr, 0, sizeof *ptr); -+ vc = gpu_mem_ptr.vc; -+ -+ ptr->mb = mb; -+@@ -254,7 +254,7 @@ void gpu_cache_flush(GPU_MEM_PTR_T *p) -+ struct vcsm_user_clean_invalid_s iocache = {}; -+ iocache.s[0].handle = p->vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = p->arm; -++ iocache.s[0].addr = (int) p->arm; -+ iocache.s[0].size = p->numbytes; -+ vcsm_clean_invalid( &iocache ); -+ #else -+@@ -390,6 +390,7 @@ static void *vpu_start(void *arg) { -+ #ifdef RPI_TIME_TOTAL_POSTED -+ int last_time=0; -+ long long on_time=0; -++ long long on_time_deblock=0; -+ long long off_time=0; -+ int start_time; -+ int end_time; -+@@ -451,10 +452,13 @@ static void *vpu_start(void *arg) { -+ #ifdef RPI_TIME_TOTAL_POSTED -+ end_time = Microseconds(); -+ last_time = end_time; -+- on_time += end_time - start_time; -++ if (p[6]==2) -++ on_time_deblock += end_time - start_time; -++ else -++ on_time += end_time - start_time; -+ count++; -+ if ((count&0x7f)==0) -+- printf("Posted %d On=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(off_time/1000)); -++ printf("Posted %d On=%dms, On_deblock=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(on_time_deblock/1000),(int)(off_time/1000)); -+ #endif -+ pthread_mutex_lock(&post_mutex); -+ vpu_async_head++; -+diff --git a/libavcodec/rpi_shader.c b/libavcodec/rpi_shader.c -+index e86eb30..c5d8b29 100644 -+--- a/libavcodec/rpi_shader.c -++++ b/libavcodec/rpi_shader.c -+@@ -61,7 +61,7 @@ unsigned int rpi_shader[] = { -+ /* [0x00000120] */ 0x8c9e7052, 0x10025e18, // add t0s, r0, r1 ; mov ra_frame_base, r2 -+ /* [0x00000128] */ 0x0c9e7440, 0x10020f27, // add t1s, r2, r1 -+ /* [0x00000130] */ 0x00000008, 0xe00208a7, // mov r2,8 -+-/* [0x00000138] */ 0x11827c80, 0x10021327, // shl rb12,unif, r2 -++/* [0x00000138] */ 0x11827c80, 0x10021327, // shl rb12,unif,r2 -+ /* [0x00000140] */ 0x0c827c80, 0x10021367, // add rb13,unif,r2 -+ /* [0x00000148] */ 0x15827d80, 0x100208a7, // mov r2, unif -+ /* [0x00000150] */ 0x119c15c0, 0xd00208a7, // shl r2, r2, 1 -+-- -+2.5.0 -+ -+ -+From 1c7aae12a916196defd7ca1d5e8f052551535034 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 1 Jul 2015 09:21:17 +0100 -+Subject: [PATCH 65/68] Added ability to combine jobs -+ -+--- -+ libavcodec/rpi_qpu.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++- -+ 1 file changed, 80 insertions(+), 1 deletion(-) -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 05b2169..91777be 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -8,6 +8,8 @@ -+ #define RPI_TIME_TOTAL_POSTED -+ // define RPI_ASYNC to run the VPU in a separate thread, need to make a separate call to check for completion -+ #define RPI_ASYNC -++// Define RPI_COMBINE_JOBS to find jobs that can be executed in parallel -++#define RPI_COMBINE_JOBS -+ -+ #include -+ #include -+@@ -398,9 +400,15 @@ static void *vpu_start(void *arg) { -+ #endif -+ while(1) { -+ int i; -+- int *p; -++ int *p; // Pointer for a QPU/VPU job -++#ifdef RPI_COMBINE_JOBS -++ int *q = NULL; // Pointer for a VPU only job -++ int have_qpu = 0; -++ int have_vpu = 0; -++#endif -+ int qpu_code; -+ int qpu_codeb; -++ int num_jobs; // Number of jobs available -+ pthread_mutex_lock(&post_mutex); -+ while( vpu_async_tail - vpu_async_head <= 0) -+ { -+@@ -408,13 +416,38 @@ static void *vpu_start(void *arg) { -+ pthread_cond_wait(&post_cond_tail, &post_mutex); -+ } -+ p = vpu_cmds[vpu_async_head%MAXCMDS]; -++ num_jobs = vpu_async_tail - vpu_async_head; -+ pthread_mutex_unlock(&post_mutex); -+ -+ if (p[6] == -1) { -+ break; // Last job -+ } -++ if (p[7] == 0 && p[0] == 0 && p[16]==0) -++ goto job_done_early; -++ -++#ifdef RPI_COMBINE_JOBS -++ // First scan for a qpu job -++ for (int x=0;xmail[i*2] = p[8+i]; -++ gpu->mail[i*2 + 1] = qpu_code; -++ } -++ for(i=0;i<12;i++) { -++ gpu->mail2[i*2] = p[17+i]; -++ gpu->mail2[i*2 + 1] = qpu_codeb; -++ } -++ if (have_vpu) { -++ execute_multi(gpu->mb, -++ 12,gpu->vc + offsetof(struct GPU, mail2), 1, 5000, -++ 8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -++ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -++ q[0], q[1], q[2], q[3], q[4], q[5], q[6]); // VPU1 -++ q[0] = 0; -++ } else { -++ execute_multi(gpu->mb, -++ 12,gpu->vc + offsetof(struct GPU, mail2), 1, 5000, -++ 8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -++ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -++ 0, 0 , 0 , 0 , 0 , 0 , 0); // VPU1 -++ } -++ p[0] = 0; -++ p[7] = 0; -++ p[16] = 0; -++ } else { -++ av_assert0(have_vpu); -++ vpu_execute_code(q[0], q[1], q[2], q[3], q[4], q[5], q[6]); -++ q[0] = 0; -++ } -++#else -++ -+ if (!qpu_code) { -+ vpu_execute_code(p[0], p[1], p[2], p[3], p[4], p[5], p[6]); -+ } else { -+@@ -449,17 +516,29 @@ static void *vpu_start(void *arg) { -+ 0, 0 , 0 , 0 , 0 , 0 , 0); // VPU1 -+ #endif -+ } -++#endif -++ -+ #ifdef RPI_TIME_TOTAL_POSTED -+ end_time = Microseconds(); -+ last_time = end_time; -++#ifdef RPI_COMBINE_JOBS -++ // There are three cases we may wish to distinguish of VPU/QPU activity -++ on_time += end_time - start_time; -++#else -+ if (p[6]==2) -+ on_time_deblock += end_time - start_time; -+ else -+ on_time += end_time - start_time; -++#endif -+ count++; -+ if ((count&0x7f)==0) -++#ifdef RPI_COMBINE_JOBS -+ printf("Posted %d On=%dms, On_deblock=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(on_time_deblock/1000),(int)(off_time/1000)); -++#else -++ printf("Posted %d On=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(off_time/1000)); -++#endif -+ #endif -++job_done_early: -+ pthread_mutex_lock(&post_mutex); -+ vpu_async_head++; -+ pthread_cond_broadcast(&post_cond_head); -+-- -+2.5.0 -+ -+ -+From 3b056ce7d9bc16ac6d62fc84cb26e0991741ec26 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 1 Jul 2015 12:53:10 +0100 -+Subject: [PATCH 66/68] Added chroma deblocking -+ -+--- -+ libavcodec/hevc.c | 20 ++ -+ libavcodec/hevc.h | 12 +- -+ libavcodec/hevc_filter.c | 92 +++++- -+ libavcodec/rpi_hevc_transform.h | 644 +++++++++++++++++++++++++++++++++++++++- -+ libavcodec/rpi_hevc_transform.s | 207 +++++++++++++ -+ libavcodec/rpi_qpu.c | 27 +- -+ libavcodec/rpi_shader.qasm | 11 + -+ 7 files changed, 988 insertions(+), 25 deletions(-) -+ -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 0ecaf05..35a1394 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -251,6 +251,14 @@ static void pic_arrays_free(HEVCContext *s) -+ gpu_free(&s->y_setup_ptr); -+ s->y_setup_arm = 0; -+ } -++ if (s->uv_setup_arm) { -++ gpu_free(&s->uv_setup_ptr); -++ s->uv_setup_arm = 0; -++ } -++ if (s->vpu_cmds_arm) { -++ gpu_free(&s->vpu_cmds_ptr); -++ s->vpu_cmds_arm = 0; -++ } -+ #endif -+ av_freep(&s->sao); -+ av_freep(&s->deblock); -+@@ -324,6 +332,18 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps) -+ s->y_setup_vc = (void*)s->y_setup_ptr.vc; -+ memset(s->y_setup_arm, 0, s->y_setup_ptr.numbytes); -+ printf("Setup %d by %d by %d\n",s->setup_width,s->setup_height,sizeof(*s->y_setup_arm)); -++ -++ s->uv_setup_width = ( (sps->width >> sps->hshift[1]) + 15) / 16; -++ s->uv_setup_height = ( (sps->height >> sps->vshift[1]) + 15) / 16; -++ gpu_malloc_uncached(sizeof(*s->uv_setup_arm) * s->uv_setup_width * s->uv_setup_height, &s->uv_setup_ptr); // TODO make this cached -++ s->uv_setup_arm = (void*)s->uv_setup_ptr.arm; -++ s->uv_setup_vc = (void*)s->uv_setup_ptr.vc; -++ memset(s->uv_setup_arm, 0, s->uv_setup_ptr.numbytes); -++ printf("Setup uv %d by %d by %d\n",s->uv_setup_width,s->uv_setup_height,sizeof(*s->uv_setup_arm)); -++ -++ gpu_malloc_uncached(sizeof(*s->vpu_cmds_arm) * 3,&s->vpu_cmds_ptr); -++ s->vpu_cmds_arm = (void*) s->vpu_cmds_ptr.arm; -++ s->vpu_cmds_vc = s->vpu_cmds_ptr.vc; -+ #endif -+ -+ s->bs_width = (width >> 2) + 1; -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index b1d3ee0..aa7cdc3 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -55,7 +55,7 @@ -+ #define RPI_MAX_JOBS 2 -+ // Define RPI_WORKER to launch a worker thread for pixel processing tasks -+ #define RPI_WORKER -+- -++ // Define RPI_DEBLOCK_VPU to perform deblocking on the VPUs -+ #define RPI_DEBLOCK_VPU -+ -+ #endif -+@@ -1006,6 +1006,16 @@ typedef struct HEVCContext { -+ uint8_t (*y_setup_vc)[2][2][2][4]; -+ int setup_width; // Number of 16x16 blocks across the image -+ int setup_height; // Number of 16x16 blocks down the image -++ -++ GPU_MEM_PTR_T uv_setup_ptr; -++ uint8_t (*uv_setup_arm)[2][2][2][4]; // Half of this is unused [][][1][], but easier for the VPU as it allows us to store with zeros and addresses are aligned -++ uint8_t (*uv_setup_vc)[2][2][2][4]; -++ int uv_setup_width; -++ int uv_setup_height; -++ -++ GPU_MEM_PTR_T vpu_cmds_ptr; -++ int (*vpu_cmds_arm)[6]; // r0-r5 for each command -++ int vpu_cmds_vc; -+ #endif -+ -+ #endif -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 06371da..6367068 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -656,9 +656,23 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->frame->linesize[chroma], -+ c_tc, no_p, no_q); -+ } else -++#ifdef RPI_DEBLOCK_VPU -++ if (s->enable_rpi_deblock) { -++ uint8_t (*setup)[2][2][4]; -++ int xc = x>>s->ps.sps->hshift[chroma]; -++ int yc = y>>s->ps.sps->vshift[chroma]; -++ int num16 = (yc>>4)*s->uv_setup_width + (xc>>4); -++ int a = ((yc>>3) & 1) << 1; -++ int b = (xc>>3) & 1; -++ setup = s->uv_setup_arm[num16]; -++ setup[0][b][0][a] = c_tc[0]; -++ setup[0][b][0][a + 1] = c_tc[1]; -++ } else -++#endif -+ s->hevcdsp.hevc_v_loop_filter_chroma(src, -+ s->frame->linesize[chroma], -+ c_tc, no_p, no_q); -++ -+ } -+ } -+ -+@@ -689,6 +703,19 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ s->frame->linesize[chroma], -+ c_tc, no_p, no_q); -+ } else -++#ifdef RPI_DEBLOCK_VPU -++ if (s->enable_rpi_deblock) { -++ uint8_t (*setup)[2][2][4]; -++ int xc = x>>s->ps.sps->hshift[chroma]; -++ int yc = y>>s->ps.sps->vshift[chroma]; -++ int num16 = (yc>>4)*s->uv_setup_width + (xc>>4); -++ int a = ((xc>>3) & 1) << 1; -++ int b = (yc>>3) & 1; -++ setup = s->uv_setup_arm[num16]; -++ setup[1][b][0][a] = c_tc[0]; -++ setup[1][b][0][a + 1] = c_tc[1]; -++ } else -++#endif -+ s->hevcdsp.hevc_h_loop_filter_chroma(src, -+ s->frame->linesize[chroma], -+ c_tc, no_p, no_q); -+@@ -1013,33 +1040,56 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ static void rpi_deblock(HEVCContext *s, int y, int ctb_size) -+ { -+ // Flush image, 4 lines above to bottom of ctb stripe -+- ff_hevc_flush_buffer_lines(s, FFMAX(y-4,0), y+ctb_size, 1, 0); -++ ff_hevc_flush_buffer_lines(s, FFMAX(y-4,0), y+ctb_size, 1, 1); -+ // TODO flush buffer of beta/tc setup when it becomes cached -++ -++ // Prepare three commands at once to avoid calling overhead -++ s->vpu_cmds_arm[0][0] = get_vc_address(s->frame->buf[0]) + s->frame->linesize[0] * y; -++ s->vpu_cmds_arm[0][1] = s->frame->linesize[0]; -++ s->vpu_cmds_arm[0][2] = s->setup_width; -++ s->vpu_cmds_arm[0][3] = (int) ( s->y_setup_vc + s->setup_width * (y>>4) ); -++ s->vpu_cmds_arm[0][4] = ctb_size>>4; -++ s->vpu_cmds_arm[0][5] = 2; -++ -++ s->vpu_cmds_arm[1][0] = get_vc_address(s->frame->buf[1]) + s->frame->linesize[1] * (y>> s->ps.sps->vshift[1]); -++ s->vpu_cmds_arm[1][1] = s->frame->linesize[1]; -++ s->vpu_cmds_arm[1][2] = s->uv_setup_width; -++ s->vpu_cmds_arm[1][3] = (int) ( s->uv_setup_vc + s->uv_setup_width * ((y>>4)>> s->ps.sps->vshift[1]) ); -++ s->vpu_cmds_arm[1][4] = (ctb_size>>4)>> s->ps.sps->vshift[1]; -++ s->vpu_cmds_arm[1][5] = 3; -++ -++ s->vpu_cmds_arm[2][0] = get_vc_address(s->frame->buf[2]) + s->frame->linesize[2] * (y>> s->ps.sps->vshift[2]); -++ s->vpu_cmds_arm[2][1] = s->frame->linesize[2]; -++ s->vpu_cmds_arm[2][2] = s->uv_setup_width; -++ s->vpu_cmds_arm[2][3] = (int) ( s->uv_setup_vc + s->uv_setup_width * ((y>>4)>> s->ps.sps->vshift[1]) ); -++ s->vpu_cmds_arm[2][4] = (ctb_size>>4)>> s->ps.sps->vshift[1]; -++ s->vpu_cmds_arm[2][5] = 4; -++ -+ // Call VPU -+- // TODO add this to a separate pipeline of VPU jobs that can be run in parallel and wait for completion -+- vpu_wait(vpu_post_code( vpu_get_fn(), get_vc_address(s->frame->buf[0]) + s->frame->linesize[0] * y, s->frame->linesize[0], -+- s->setup_width, (int) ( s->y_setup_vc + s->setup_width * (y>>4) ), -+- ctb_size>>4, 2, 0)); // 2 means to do the deblocking code -++ vpu_wait(vpu_post_code( vpu_get_fn(), s->vpu_cmds_vc, 3, 0, 0, 0, 5, 0)); // 5 means to do all the commands -+ } -+ -+-static void rpi_deblock2(HEVCContext *s, int y, int ctb_size) -+-{ -+- int y2; -+- for(y2=y;y2= s->ps.sps->width - ctb_size; -++#ifdef RPI_DEBLOCK_VPU -++ int done_deblock = 0; -++#endif -+ if (s->avctx->skip_loop_filter < AVDISCARD_ALL) -+ deblocking_filter_CTB(s, x, y); -+ #ifdef RPI_DEBLOCK_VPU -+ if (s->enable_rpi_deblock && x_end) -+ { -+- rpi_deblock(s, y, ctb_size); -++ int y_at_end = y >= s->ps.sps->height - ctb_size; -++ int height = 64; // Deblock in units 64 high to avoid too many VPU calls -++ int y_start = y&~63; -++ if (y_at_end) height = s->ps.sps->height - y_start; -++ if ((((y+ctb_size)&63)==0) || y_at_end) { -++ done_deblock = 1; -++ rpi_deblock(s, y_start, height); -++ } -+ } -+ #endif -+ if (s->ps.sps->sao_enabled) { -+@@ -1070,11 +1120,25 @@ void ff_hevc_hls_filter(HEVCContext *s, int x, int y, int ctb_size) -+ //int newh = y + ctb_size - 4; -+ //int currh = s->ref->tf.progress->data[0]; -+ //if (((y + ctb_size)&63)==0) -++#ifdef RPI_DEBLOCK_VPU -++ if (s->enable_rpi_deblock) { -++ // we no longer need to flush the luma buffer as it is in GPU memory when using deblocking on the rpi -++ if (done_deblock) { -++ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -++ } -++ } else { -++#ifdef RPI_INTER_QPU -++ ff_hevc_flush_buffer(s, &s->ref->tf, y + ctb_size - 4); -++#endif -++ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -++ } -++#else -+ #ifdef RPI_INTER_QPU -+ ff_hevc_flush_buffer(s, &s->ref->tf, y + ctb_size - 4); -+- // TODO we no longer need to flush the luma buffer as it is in GPU memory when using deblocking on the rpi -++ // we no longer need to flush the luma buffer as it is in GPU memory when using deblocking on the rpi -+ #endif -+ ff_thread_report_progress(&s->ref->tf, y + ctb_size - 4, 0); -++#endif -+ } -+ } -+ -+diff --git a/libavcodec/rpi_hevc_transform.h b/libavcodec/rpi_hevc_transform.h -+index b3f155f..4309f1c 100644 -+--- a/libavcodec/rpi_hevc_transform.h -++++ b/libavcodec/rpi_hevc_transform.h -+@@ -3,14 +3,32 @@ unsigned char rpi_hevc_transform [] = { -+ 106, -+ 0, -+ 144, -+-38, -++47, -+ 1, -+ 37, -+ 106, -+ 0, -+ 144, -+-57, -++66, -+ 1, -++53, -++106, -++0, -++144, -++192, -++4, -++69, -++106, -++0, -++144, -++192, -++4, -++85, -++106, -++0, -++144, -++220, -++5, -+ 169, -+ 3, -+ 62, -+@@ -2427,4 +2445,626 @@ unsigned char rpi_hevc_transform [] = { -+ 128, -+ 90, -+ 0, -++169, -++3, -++14, -++96, -++4, -++31, -++169, -++3, -++30, -++96, -++1, -++31, -++73, -++64, -++52, -++64, -++45, -++64, -++2, -++64, -++10, -++64, -++64, -++198, -++1, -++7, -++8, -++232, -++63, -++0, -++0, -++0, -++6, -++232, -++253, -++255, -++255, -++255, -++0, -++246, -++0, -++0, -++0, -++4, -++215, -++64, -++3, -++96, -++2, -++248, -++0, -++35, -++0, -++0, -++64, -++56, -++0, -++0, -++4, -++248, -++0, -++36, -++0, -++0, -++64, -++56, -++8, -++0, -++0, -++240, -++64, -++0, -++132, -++3, -++30, -++106, -++132, -++24, -++128, -++240, -++0, -++0, -++132, -++3, -++128, -++144, -++143, -++0, -++131, -++98, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++135, -++0, -++131, -++102, -++0, -++158, -++71, -++0, -++2, -++248, -++0, -++35, -++0, -++0, -++64, -++56, -++0, -++0, -++4, -++248, -++0, -++36, -++0, -++0, -++64, -++56, -++8, -++0, -++0, -++240, -++64, -++0, -++132, -++3, -++30, -++106, -++132, -++24, -++128, -++240, -++0, -++0, -++132, -++3, -++128, -++144, -++112, -++0, -++131, -++98, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++104, -++0, -++131, -++102, -++0, -++248, -++64, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++30, -++106, -++134, -++24, -++128, -++248, -++0, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++128, -++144, -++123, -++0, -++188, -++64, -++67, -++232, -++0, -++2, -++0, -++0, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++112, -++0, -++195, -++232, -++0, -++2, -++0, -++0, -++12, -++128, -++7, -++192, -++130, -++248, -++0, -++0, -++112, -++192, -++224, -++16, -++195, -++31, -++132, -++248, -++1, -++0, -++112, -++0, -++224, -++16, -++203, -++31, -++3, -++99, -++131, -++71, -++68, -++232, -++32, -++0, -++0, -++0, -++0, -++99, -++2, -++99, -++23, -++102, -++7, -++106, -++127, -++156, -++178, -++255, -++0, -++248, -++64, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++30, -++106, -++134, -++24, -++128, -++248, -++0, -++0, -++112, -++0, -++192, -++243, -++211, -++31, -++128, -++144, -++72, -++0, -++188, -++64, -++67, -++232, -++0, -++2, -++0, -++0, -++0, -++255, -++64, -++0, -++0, -++20, -++200, -++243, -++0, -++0, -++128, -++144, -++61, -++0, -++195, -++232, -++0, -++2, -++0, -++0, -++12, -++128, -++7, -++192, -++130, -++248, -++0, -++0, -++112, -++192, -++224, -++16, -++195, -++31, -++132, -++248, -++1, -++0, -++112, -++0, -++224, -++16, -++203, -++31, -++25, -++102, -++9, -++106, -++2, -++30, -++41, -++3, -++26, -++87, -++162, -++64, -++64, -++198, -++1, -++23, -++127, -++158, -++95, -++255, -++239, -++3, -++0, -++254, -++128, -++143, -++94, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++143, -++95, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++142, -++208, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++128, -++142, -++209, -++0, -++0, -++240, -++12, -++0, -++128, -++144, -++47, -++0, -++8, -++255, -++227, -++23, -++0, -++244, -++192, -++51, -++0, -++0, -++8, -++255, -++35, -++52, -++0, -++180, -++192, -++51, -++0, -++0, -++111, -++3, -++239, -++3, -++0, -++254, -++128, -++143, -++14, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++143, -++15, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++192, -++142, -++16, -++0, -++0, -++240, -++12, -++0, -++0, -++254, -++128, -++142, -++17, -++0, -++0, -++240, -++12, -++0, -++128, -++144, -++13, -++0, -++8, -++255, -++227, -++3, -++0, -++244, -++192, -++51, -++0, -++0, -++8, -++255, -++35, -++4, -++0, -++180, -++192, -++51, -++0, -++0, -++111, -++3, -++32, -++246, -++192, -++11, -++1, -++16, -++32, -++246, -++2, -++140, -++47, -++240, -++32, -++247, -++35, -++141, -++63, -++178, -++64, -++254, -++35, -++141, -++2, -++68, -++192, -++243, -++128, -++11, -++32, -++255, -++35, -++240, -++58, -++226, -++192, -++243, -++188, -++10, -++0, -++254, -++0, -++141, -++4, -++4, -++0, -++240, -++128, -++10, -++88, -++246, -++35, -++141, -++3, -++68, -++240, -++246, -++35, -++141, -++48, -++66, -++0, -++247, -++227, -++143, -++52, -++242, -++32, -++247, -++227, -++142, -++52, -++178, -++90, -++0, -++161, -++3, -++6, -++64, -++23, -++64, -++96, -++8, -++70, -++98, -++97, -++8, -++70, -++98, -++98, -++8, -++70, -++98, -++99, -++8, -++70, -++98, -++100, -++8, -++70, -++98, -++101, -++8, -++70, -++98, -++255, -++159, -++8, -++250, -++23, -++102, -++7, -++106, -++112, -++30, -++33, -++3, -+ }; -+diff --git a/libavcodec/rpi_hevc_transform.s b/libavcodec/rpi_hevc_transform.s -+index b055208..5543093 100644 -+--- a/libavcodec/rpi_hevc_transform.s -++++ b/libavcodec/rpi_hevc_transform.s -+@@ -85,6 +85,13 @@ hevc_trans_16x16: -+ beq memclear16 -+ cmp r5,2 -+ beq hevc_deblock_16x16 -++ cmp r5,3 -++ beq hevc_uv_deblock_16x16 -++ cmp r5,4 -++ beq hevc_uv_deblock_16x16_with_clear -++ cmp r5,5 -++ beq hevc_run_command_list -++ -+ push r6-r15, lr # TODO cut down number of used registers -+ mov r14,r3 # coeffs32 -+ mov r15,r4 # num32 -+@@ -708,3 +715,203 @@ normal_filtering: -+ -+ filtering_done: -+ b lr -++ -++ -++hevc_uv_deblock_16x16: -++ push r6-r15, lr -++ mov r14,0 -++ b hevc_uv_start -++hevc_uv_deblock_16x16_with_clear: -++ push r6-r15, lr -++ mov r14,1 -++ b hevc_uv_start -++ -++hevc_uv_start: -++ mov r9,r4 -++ mov r4,r3 -++ mov r13,r2 -++ mov r2,r0 -++ mov r10,r0 -++ subscale4 r0,r1 -++ mov r8,63 -++ mov r6,-3 -++ vmov H(zeros,0),0 -++# r7 is number of blocks still to load -++# r0 is location of current block - 4 * stride -++# r1 is stride -++# r2 is location of current block -++# r3 is offset of start of block (actual edges start at H(16,16)+r3 for horizontal and H(16,0)+r3 for vertical -++# r4 is setup -++# r5 is for temporary calculations -++# r8 holds 63 -++# r6 holds -3 -++# r9 holds the number of 16 high rows to process -++# r10 holds the original img base -++# r11 returns 0 if no filtering was done on the edge -++# r12 saves a copy of this -++# r13 is copy of width -++# r14 is 1 if we should clear the old contents, or 0 if not -++ -++uv_process_row: -++ # First iteration does not do horizontal filtering on previous -++ mov r7, r13 -++ mov r3,0 -++ vldb H(12++,16)+r3,(r0 += r1) REP 4 # Load the current block -++ vldb H(16++,16)+r3,(r2 += r1) REP 16 -++ vldb H(setup_input,0), (r4) # We may wish to prefetch these -++ cmp r14,1 -++ bne uv_skip0 -++ vstb H(zeros,0),(r4) -++uv_skip0: -++ bl uv_vert_filter -++ add r3,8 -++ vadd H(setup_input,0),H(setup_input,8),0 # Rotate to second set of 8 -++ bl uv_vert_filter -++ sub r3,8 -++ b uv_start_deblock_loop -++uv_deblock_loop: -++ # Middle iterations do vertical on current block and horizontal on preceding -++ vldb H(12++,16)+r3,(r0 += r1) REP 4 # load the current block -++ vldb H(16++,16)+r3,(r2 += r1) REP 16 -++ vldb H(setup_input,0), (r4) -++ cmp r14,1 -++ bne uv_skip1 -++ vstb H(zeros,0),(r4) -++uv_skip1: -++ bl uv_vert_filter -++ add r3,8 -++ vadd H(setup_input,0),H(setup_input,8),0 -++ bl uv_vert_filter -++ sub r3,8 -++ vldb H(setup_input,0), -16(r4) -++ cmp r14,1 -++ bne uv_skip3 -++ vstb H(zeros,0),-16(r4) -++uv_skip3: -++ bl uv_horz_filter -++ mov r12,r11 -++ add r3,8*64 -++ vadd H(setup_input,0),H(setup_input,8),0 -++ bl uv_horz_filter -++ sub r3,8*64 -++ addcmpbeq r12,0,0,uv_skip_save_top -++ vstb H(12++,0)+r3,-16(r0 += r1) REP 4 # Save the deblocked pixels for the previous block -++uv_skip_save_top: -++ vstb H(16++,0)+r3,-16(r2 += r1) REP 16 -++uv_start_deblock_loop: -++ # move onto next 16x16 (could do this with circular buffer support instead) -++ add r3,16 -++ and r3,r8 -++ add r4,32 -++ # Perform loop counter operations (may work with an addcmpbgt as well?) -++ add r0,16 -++ add r2,16 -++ sub r7,1 -++ cmp r7,0 # Are there still more blocks to load -++ bgt uv_deblock_loop -++ -++ # Final iteration needs to just do horizontal filtering -++ vldb H(setup_input,0), -16(r4) -++ cmp r14,1 -++ bne uv_skip2 -++ vstb H(zeros,0),-16(r4) -++uv_skip2: -++ bl uv_horz_filter -++ mov r12,r11 -++ add r3,8*64 -++ vadd H(setup_input,0),H(setup_input,8),0 -++ bl uv_horz_filter -++ sub r3,64*8 -++ addcmpbeq r12,0,0,uv_skip_save_top2 -++ vstb H(12++,0)+r3,-16(r0 += r1) REP 4 # Save the deblocked pixels for the previous block -++uv_skip_save_top2: -++ vstb H(16++,0)+r3,-16(r2 += r1) REP 16 -++ -++# Now look to see if we should do another row -++ sub r9,1 -++ cmp r9,0 -++ bgt uv_start_again -++ pop r6-r15, pc -++uv_start_again: -++ # Need to sort out r0,r2 to point to next row down -++ addscale16 r10,r1 -++ mov r2,r10 -++ subscale4 r0,r2,r1 -++ b uv_process_row -++ -++ -++# At this stage H(16,16)+r3 points to the first pixel of the 16 high edge to be filtered -++# So we can reuse the code we move the parts to be filtered into HX(P0/P1/P2/P3/Q0/Q1/Q2/Q3,0) - we will perform a final saturation step on placing them back into the correct locations -++ -++uv_vert_filter: -++ push lr -++ -++ vmov HX(P1,0), V(16,14)+r3 -++ vmov HX(P0,0), V(16,15)+r3 -++ vmov HX(Q0,0), V(16,16)+r3 -++ vmov HX(Q1,0), V(16,17)+r3 -++ -++ bl do_chroma_filter -++ -++ vadds V(16,15)+r3, HX(P0,0), 0 -++ vadds V(16,16)+r3, HX(Q0,0), 0 -++ -++ pop pc -++ -++# Filter edge at H(16,0)+r3 -++uv_horz_filter: -++ push lr -++ -++ vmov HX(P1,0), H(14,0)+r3 -++ vmov HX(P0,0), H(15,0)+r3 -++ vmov HX(Q0,0), H(16,0)+r3 -++ vmov HX(Q1,0), H(17,0)+r3 -++ -++ bl do_chroma_filter -++ -++ vadds H(15,0)+r3, HX(P0,0), 0 -++ # P3 and Q3 never change so don't bother saving back -++ vadds H(16,0)+r3, HX(Q0,0), 0 -++ -++ pop pc -++ -++# r4 points to array of beta/tc for each 4 length edge -++do_chroma_filter: -++ valtl H(setup,0),H(setup_input,0),H(setup_input,0) # tc*8 -++ valtl HX(tc,0),H(setup,0),H(setup,0) -++ -++ vsub HX(delta,0),HX(Q0,0),HX(P0,0) -++ vshl HX(delta,0),HX(delta,0),2 CLRA SACC -++ vsub -,HX(P1,0),HX(Q1,0) SACC -++ vmov HX(delta,0),4 SACC -++ vasr HX(delta,0),HX(delta,0),3 -++ vclamps HX(delta,0), HX(delta,0), HX(tc,0) -++ vadd HX(P0,0),HX(P0,0),HX(delta,0) -++ vsub HX(Q0,0),HX(Q0,0),HX(delta,0) -++ b lr -++ -++# r0 = list -++# r1 = number -++hevc_run_command_list: -++ push r6-r7, lr -++ mov r6, r0 -++ mov r7, r1 -++loop_cmds: -++ ld r0,(r6) # How to encode r6++? -++ add r6,4 -++ ld r1,(r6) -++ add r6,4 -++ ld r2,(r6) -++ add r6,4 -++ ld r3,(r6) -++ add r6,4 -++ ld r4,(r6) -++ add r6,4 -++ ld r5,(r6) -++ add r6,4 -++ bl hevc_trans_16x16 -++ sub r7,1 -++ cmp r7,0 -++ bgt loop_cmds -++ -++ pop r6-r7, pc -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 91777be..5aa0432 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -397,6 +397,8 @@ static void *vpu_start(void *arg) { -+ int start_time; -+ int end_time; -+ int count=0; -++ int count_deblock=0; -++ int count_qpu=0; -+ #endif -+ while(1) { -+ int i; -+@@ -442,7 +444,7 @@ static void *vpu_start(void *arg) { -+ break; -+ } -+ } -+- printf("Have_qpu = %d, have_vpu=%d\n",have_qpu,have_vpu); -++ //printf("Have_qpu = %d, have_vpu=%d\n",have_qpu,have_vpu); -+ #endif -+ qpu_code = p[7]; -+ qpu_codeb = p[16]; -+@@ -460,6 +462,12 @@ static void *vpu_start(void *arg) { -+ off_time += start_time-last_time; -+ #endif -+ -++#define NO_FLUSH 1 -++#define CLEAR_PROFILE 2 -++#define OUTPUT_COUNTS 4 -++ -++#define FLAGS_FOR_PROFILING (NO_FLUSH) -++ -+ #ifdef RPI_COMBINE_JOBS -+ if (have_qpu) { -+ for(i=0;i<8;i++) { -+@@ -472,14 +480,14 @@ static void *vpu_start(void *arg) { -+ } -+ if (have_vpu) { -+ execute_multi(gpu->mb, -+- 12,gpu->vc + offsetof(struct GPU, mail2), 1, 5000, -++ 12,gpu->vc + offsetof(struct GPU, mail2), FLAGS_FOR_PROFILING, 5000, -+ 8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -+ q[0], q[1], q[2], q[3], q[4], q[5], q[6]); // VPU1 -+ q[0] = 0; -+ } else { -+ execute_multi(gpu->mb, -+- 12,gpu->vc + offsetof(struct GPU, mail2), 1, 5000, -++ 12,gpu->vc + offsetof(struct GPU, mail2), FLAGS_FOR_PROFILING, 5000, -+ 8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -+ 0, 0 , 0 , 0 , 0 , 0 , 0); // VPU1 -+@@ -510,7 +518,7 @@ static void *vpu_start(void *arg) { -+ execute_qpu(gpu->mb,8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */); -+ #else -+ execute_multi(gpu->mb, -+- 12,gpu->vc + offsetof(struct GPU, mail2), 1, 5000, -++ 12,gpu->vc + offsetof(struct GPU, mail2), FLAGS_FOR_PROFILING , 5000, -+ 8,gpu->vc + offsetof(struct GPU, mail), 1 /* no flush */, 5000 /* timeout ms */, -+ p[0], p[1], p[2], p[3], p[4], p[5], p[6], // VPU0 -+ 0, 0 , 0 , 0 , 0 , 0 , 0); // VPU1 -+@@ -525,17 +533,20 @@ static void *vpu_start(void *arg) { -+ // There are three cases we may wish to distinguish of VPU/QPU activity -+ on_time += end_time - start_time; -+ #else -+- if (p[6]==2) -++ if (p[6]>1) { -++ count_deblock++; -+ on_time_deblock += end_time - start_time; -+- else -++ } else { -+ on_time += end_time - start_time; -++ count_qpu++; -++ } -+ #endif -+ count++; -+ if ((count&0x7f)==0) -+ #ifdef RPI_COMBINE_JOBS -+- printf("Posted %d On=%dms, On_deblock=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(on_time_deblock/1000),(int)(off_time/1000)); -+-#else -+ printf("Posted %d On=%dms, Off=%dms\n",count,(int)(on_time/1000),(int)(off_time/1000)); -++#else -++ printf("Posted %d On=%dms (%d calls), On_deblock=%dms (%d calls), Off=%dms\n",count,(int)(on_time/1000),count_qpu,(int)(on_time_deblock/1000),count_deblock,(int)(off_time/1000)); -+ #endif -+ #endif -+ job_done_early: -+diff --git a/libavcodec/rpi_shader.qasm b/libavcodec/rpi_shader.qasm -+index 0686249..64bf5b0 100644 -+--- a/libavcodec/rpi_shader.qasm -++++ b/libavcodec/rpi_shader.qasm -+@@ -1077,6 +1077,17 @@ nop ; nop # delay slot 2 -+ ::mc_interrupt_exit12 -+ mov -, vw_wait # wait on the VDW -+ -++ # Dummy wait to test instructions -++# mov r3,1000000 -++#:dummy_loop -++# sub.setf r3, r3, 1 -++# nop -++# nop -++# brr.anynn -, r:dummy_loop -++# nop -++# nop -++# nop -++ -+ ldtmu0 -+ ldtmu0 -+ ldtmu1 -+-- -+2.5.0 -+ -+ -+From 9f07110097a85bc056c338f9bd1891ca2027f580 Mon Sep 17 00:00:00 2001 -+From: Ben Avison -+Date: Tue, 23 Jun 2015 23:42:03 +0100 -+Subject: [PATCH 67/68] armv7/hevc: Optimise deblocking boundary strength -+ calculation -+ -+--- -+ libavcodec/arm/hevcdsp_deblock_neon.S | 115 +++++++++++++++++ -+ libavcodec/arm/hevcdsp_init_neon.c | 9 ++ -+ libavcodec/hevc.h | 11 -- -+ libavcodec/hevc_filter.c | 224 ++++++++++++++-------------------- -+ libavcodec/hevcdsp.c | 116 ++++++++++++++++++ -+ libavcodec/hevcdsp.h | 14 +++ -+ 6 files changed, 344 insertions(+), 145 deletions(-) -+ -+diff --git a/libavcodec/arm/hevcdsp_deblock_neon.S b/libavcodec/arm/hevcdsp_deblock_neon.S -+index 166bddb..bad4589 100644 -+--- a/libavcodec/arm/hevcdsp_deblock_neon.S -++++ b/libavcodec/arm/hevcdsp_deblock_neon.S -+@@ -383,3 +383,118 @@ function ff_hevc_h_loop_filter_chroma_neon, export=1 -+ vst1.8 {d4}, [r0] -+ bx lr -+ endfunc -++ -++/* ff_hevc_deblocking_boundary_strengths_neon(int pus, int dup, int in_inc, int out_inc, -++ * int *curr_rpl0, int *curr_rpl1, int *neigh_rpl0, int *neigh_rpl1, -++ * MvField *curr, MvField *neigh, uint8_t *bs) -++ */ -++function ff_hevc_deblocking_boundary_strengths_neon, export=1 -++ add ip, sp, #4*4 -++ push {a2-a4,v1-v8,lr} -++ ldmia ip, {v5-v7} -++1: ldmdb ip, {v1-v4} -++ ldrsb a3, [v5, #8] @ curr->ref_idx -++ ldrsb v8, [v5, #9] -++ ldrsb ip, [v6, #8] @ neigh->ref_idx -++ ldrsb lr, [v6, #9] -++ ldr v1, [v1, a3, lsl #2] -++ ldrb a3, [v5, #10] @ curr->pred_flag -++ ldr v2, [v2, v8, lsl #2] -++ ldrb v8, [v6, #10] @ neigh->pred_flag -++ ldr v3, [v3, ip, lsl #2] -++ ldr v4, [v4, lr, lsl #2] -++ teq a3, #3 -++ beq 20f -++ teq v8, #3 -++ beq 90f -++ -++ tst a3, #1 -++ ldrne a3, [v5, #0] @ curr->mv[0] -++ ldreq a3, [v5, #4] @ curr->mv[1] -++ moveq v1, v2 -++ tst v8, #1 -++ ldrne v8, [v6, #0] @ neigh->mv[0] -++ ldreq v8, [v6, #4] @ neigh->mv[1] -++ moveq v3, v4 -++ teq v1, v3 -++ bne 10f -++ ldr lr, =0xFFFCFFFC -++ ssub16 ip, v8, a3 -++ ssub16 a3, a3, v8 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ @ drop through -++10: movne a3, #1 -++11: subs a2, a2, #1 -++12: strbhs a3, [v7], a4 -++ subs a2, a2, #1 -++ bhs 12b -++ -++ ldm sp, {a2, a3} -++ add ip, sp, #16*4 -++ subs a1, a1, #1 -++ add v5, v5, a3 -++ add v6, v6, a3 -++ bhi 1b -++ pop {a2-a4,v1-v8,pc} -++ -++20: teq v8, #3 -++ bne 10b -++ -++ teq v1, v3 -++ teqeq v2, v4 -++ bne 40f -++ teq v1, v2 -++ bne 30f -++ -++ ldrd v1, v2, [v5] @ curr->mv -++ ldrd v3, v4, [v6] @ neigh->mv -++ ldr lr, =0xFFFCFFFC -++ ssub16 ip, v3, v1 -++ ssub16 a3, v1, v3 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ bne 25f -++ ssub16 ip, v4, v2 -++ ssub16 a3, v2, v4 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ beq 11b -++ @ drop through -++25: ssub16 ip, v4, v1 -++ ssub16 a3, v1, v4 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ bne 10b -++ ssub16 ip, v3, v2 -++ ssub16 a3, v2, v3 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ b 10b -++ -++30: ldrd v1, v2, [v5] @ curr->mv -++ ldrd v3, v4, [v6] @ neigh->mv -++ ldr lr, =0xFFFCFFFC -++ ssub16 ip, v3, v1 -++ ssub16 a3, v1, v3 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ bne 10b -++ ssub16 ip, v4, v2 -++ ssub16 a3, v2, v4 -++ sel a3, a3, ip -++ ands a3, a3, lr -++ b 10b -++ -++40: teq v1, v4 -++ teqeq v2, v3 -++ bne 10b -++ -++ ldrd v1, v2, [v5] @ curr->mv -++ ldrd v3, v4, [v6] @ neigh->mv -++ ldr lr, =0xFFFCFFFC -++ b 25b -++ -++90: mov a3, #1 -++ b 11b -++endfunc -+diff --git a/libavcodec/arm/hevcdsp_init_neon.c b/libavcodec/arm/hevcdsp_init_neon.c -+index e5da7e9..49c70dd 100644 -+--- a/libavcodec/arm/hevcdsp_init_neon.c -++++ b/libavcodec/arm/hevcdsp_init_neon.c -+@@ -290,6 +290,10 @@ static void ff_hevc_sao_edge_neon_wrapper(uint8_t *_dst /* align 16 */, uint8_t -+ } -+ #undef CMP -+ -++void ff_hevc_deblocking_boundary_strengths_neon(int pus, int dup, int in_inc, int out_inc, -++ int *curr_rpl0, int *curr_rpl1, int *neigh_rpl0, int *neigh_rpl1, -++ MvField *curr, MvField *neigh, uint8_t *bs); -++ -+ av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth) -+ { -+ if (bit_depth == 8) { -+@@ -387,4 +391,9 @@ av_cold void ff_hevcdsp_init_neon(HEVCDSPContext *c, const int bit_depth) -+ c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8; -+ c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8; -+ } -++ -++ assert(offsetof(MvField, mv) == 0); -++ assert(offsetof(MvField, ref_idx) == 8); -++ assert(offsetof(MvField, pred_flag) == 10); -++ c->hevc_deblocking_boundary_strengths = ff_hevc_deblocking_boundary_strengths_neon; -+ } -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index aa7cdc3..cfa7c61 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -683,17 +683,6 @@ typedef struct CodingUnit { -+ uint8_t cu_transquant_bypass_flag; -+ } CodingUnit; -+ -+-typedef struct Mv { -+- int16_t x; ///< horizontal component of motion vector -+- int16_t y; ///< vertical component of motion vector -+-} Mv; -+- -+-typedef struct MvField { -+- DECLARE_ALIGNED(4, Mv, mv)[2]; -+- int8_t ref_idx[2]; -+- int8_t pred_flag; -+-} MvField; -+- -+ typedef struct NeighbourAvailable { -+ int cand_bottom_left; -+ int cand_left; -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 6367068..826a82f 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -726,69 +726,6 @@ static void deblocking_filter_CTB(HEVCContext *s, int x0, int y0) -+ } -+ } -+ -+-static int boundary_strength(HEVCContext *s, MvField *curr, MvField *neigh, -+- RefPicList *neigh_refPicList) -+-{ -+- if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) { -+- // same L0 and L1 -+- if (s->ref->refPicList[0].list[curr->ref_idx[0]] == neigh_refPicList[0].list[neigh->ref_idx[0]] && -+- s->ref->refPicList[0].list[curr->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]] && -+- neigh_refPicList[0].list[neigh->ref_idx[0]] == neigh_refPicList[1].list[neigh->ref_idx[1]]) { -+- if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 || -+- FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) && -+- (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 || -+- FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4)) -+- return 1; -+- else -+- return 0; -+- } else if (neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[0].list[curr->ref_idx[0]] && -+- neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) { -+- if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 || -+- FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) -+- return 1; -+- else -+- return 0; -+- } else if (neigh_refPicList[1].list[neigh->ref_idx[1]] == s->ref->refPicList[0].list[curr->ref_idx[0]] && -+- neigh_refPicList[0].list[neigh->ref_idx[0]] == s->ref->refPicList[1].list[curr->ref_idx[1]]) { -+- if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 || -+- FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4) -+- return 1; -+- else -+- return 0; -+- } else { -+- return 1; -+- } -+- } else if ((curr->pred_flag != PF_BI) && (neigh->pred_flag != PF_BI)){ // 1 MV -+- Mv A, B; -+- int ref_A, ref_B; -+- -+- if (curr->pred_flag & 1) { -+- A = curr->mv[0]; -+- ref_A = s->ref->refPicList[0].list[curr->ref_idx[0]]; -+- } else { -+- A = curr->mv[1]; -+- ref_A = s->ref->refPicList[1].list[curr->ref_idx[1]]; -+- } -+- -+- if (neigh->pred_flag & 1) { -+- B = neigh->mv[0]; -+- ref_B = neigh_refPicList[0].list[neigh->ref_idx[0]]; -+- } else { -+- B = neigh->mv[1]; -+- ref_B = neigh_refPicList[1].list[neigh->ref_idx[1]]; -+- } -+- -+- if (ref_A == ref_B) { -+- if (FFABS(A.x - B.x) >= 4 || FFABS(A.y - B.y) >= 4) -+- return 1; -+- else -+- return 0; -+- } else -+- return 1; -+- } -+- -+- return 1; -+-} -+ -+ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ int log2_trafo_size) -+@@ -799,10 +736,17 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ int log2_min_tu_size = s->ps.sps->log2_min_tb_size; -+ int min_pu_width = s->ps.sps->min_pu_width; -+ int min_tu_width = s->ps.sps->min_tb_width; -+- int is_intra = tab_mvf[(y0 >> log2_min_pu_size) * min_pu_width + -+- (x0 >> log2_min_pu_size)].pred_flag == PF_INTRA; -+ int boundary_upper, boundary_left; -+- int i, j, bs; -++ int i, j; -++ RefPicList *rpl = s->ref->refPicList; -++ int min_pu_in_4pix = (1 << log2_min_pu_size) >> 2; -++ int trafo_in_min_pus = (1 << log2_trafo_size) >> log2_min_pu_size; -++ int y_pu = y0 >> log2_min_pu_size; -++ int x_pu = x0 >> log2_min_pu_size; -++ MvField *curr = &tab_mvf[y_pu * min_pu_width + x_pu]; -++ int is_intra = curr->pred_flag == PF_INTRA; -++ int inc = log2_min_pu_size == 2 ? 2 : 1; -++ uint8_t *bs; -+ -+ #ifdef DISABLE_STRENGTHS -+ return; -+@@ -818,34 +762,56 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ (y0 % (1 << s->ps.sps->log2_ctb_size)) == 0))) -+ boundary_upper = 0; -+ -++ bs = &s->horizontal_bs[(x0 + y0 * s->bs_width) >> 2]; -++ -+ if (boundary_upper) { -+ RefPicList *rpl_top = (lc->boundary_flags & BOUNDARY_UPPER_SLICE) ? -+ ff_hevc_get_ref_list(s, s->ref, x0, y0 - 1) : -+- s->ref->refPicList; -+- int yp_pu = (y0 - 1) >> log2_min_pu_size; -+- int yq_pu = y0 >> log2_min_pu_size; -+- int yp_tu = (y0 - 1) >> log2_min_tu_size; -+- int yq_tu = y0 >> log2_min_tu_size; -++ rpl; -++ MvField *top = curr - min_pu_width; -++ -++ if (is_intra) { -++ for (i = 0; i < (1 << log2_trafo_size); i += 4) -++ bs[i >> 2] = 2; -++ -++ } else { -++ int y_tu = y0 >> log2_min_tu_size; -++ int x_tu = x0 >> log2_min_tu_size; -++ uint8_t *curr_cbf_luma = &s->cbf_luma[y_tu * min_tu_width + x_tu]; -++ uint8_t *top_cbf_luma = curr_cbf_luma - min_tu_width; -++ -++ s->hevcdsp.hevc_deblocking_boundary_strengths(trafo_in_min_pus, -++ min_pu_in_4pix, sizeof (MvField), 4 >> 2, -++ rpl[0].list, rpl[1].list, rpl_top[0].list, rpl_top[1].list, -++ curr, top, bs); -+ -+ for (i = 0; i < (1 << log2_trafo_size); i += 4) { -+- int x_pu = (x0 + i) >> log2_min_pu_size; -+- int x_tu = (x0 + i) >> log2_min_tu_size; -+- MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; -+- MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; -+- uint8_t top_cbf_luma = s->cbf_luma[yp_tu * min_tu_width + x_tu]; -+- uint8_t curr_cbf_luma = s->cbf_luma[yq_tu * min_tu_width + x_tu]; -+- -+- if (curr->pred_flag == PF_INTRA || top->pred_flag == PF_INTRA) -+- bs = 2; -+- else if (curr_cbf_luma || top_cbf_luma) -+- bs = 1; -+- else -+- bs = boundary_strength(s, curr, top, rpl_top); -+- s->horizontal_bs[((x0 + i) + y0 * s->bs_width) >> 2] = bs; -++ int i_pu = i >> log2_min_pu_size; -++ int i_tu = i >> log2_min_tu_size; -++ -++ if (top[i_pu].pred_flag == PF_INTRA) -++ bs[i >> 2] = 2; -++ else if (curr_cbf_luma[i_tu] || top_cbf_luma[i_tu]) -++ bs[i >> 2] = 1; -+ } -++ } -++ } -++ -++ if (!is_intra) { -++ for (j = inc; j < trafo_in_min_pus; j += inc) { -++ MvField *top; -++ -++ curr += min_pu_width * inc; -++ top = curr - min_pu_width; -++ bs += s->bs_width * inc << log2_min_pu_size >> 2; -++ -++ s->hevcdsp.hevc_deblocking_boundary_strengths(trafo_in_min_pus, -++ min_pu_in_4pix, sizeof (MvField), 4 >> 2, -++ rpl[0].list, rpl[1].list, rpl[0].list, rpl[1].list, -++ curr, top, bs); -++ } -+ } -+ -+- // bs for vertical TU boundaries -+ boundary_left = x0 > 0 && !(x0 & 7); -+ if (boundary_left && -+ ((!s->sh.slice_loop_filter_across_slices_enabled_flag && -+@@ -856,64 +822,54 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ (x0 % (1 << s->ps.sps->log2_ctb_size)) == 0))) -+ boundary_left = 0; -+ -++ curr = &tab_mvf[y_pu * min_pu_width + x_pu]; -++ bs = &s->vertical_bs[(x0 + y0 * s->bs_width) >> 2]; -++ -+ if (boundary_left) { -+ RefPicList *rpl_left = (lc->boundary_flags & BOUNDARY_LEFT_SLICE) ? -+ ff_hevc_get_ref_list(s, s->ref, x0 - 1, y0) : -+- s->ref->refPicList; -+- int xp_pu = (x0 - 1) >> log2_min_pu_size; -+- int xq_pu = x0 >> log2_min_pu_size; -+- int xp_tu = (x0 - 1) >> log2_min_tu_size; -+- int xq_tu = x0 >> log2_min_tu_size; -+- -+- for (i = 0; i < (1 << log2_trafo_size); i += 4) { -+- int y_pu = (y0 + i) >> log2_min_pu_size; -+- int y_tu = (y0 + i) >> log2_min_tu_size; -+- MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; -+- MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; -+- uint8_t left_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xp_tu]; -+- uint8_t curr_cbf_luma = s->cbf_luma[y_tu * min_tu_width + xq_tu]; -+- -+- if (curr->pred_flag == PF_INTRA || left->pred_flag == PF_INTRA) -+- bs = 2; -+- else if (curr_cbf_luma || left_cbf_luma) -+- bs = 1; -+- else -+- bs = boundary_strength(s, curr, left, rpl_left); -+- s->vertical_bs[(x0 + (y0 + i) * s->bs_width) >> 2] = bs; -+- } -+- } -++ rpl; -++ MvField *left = curr - 1; -+ -+- if (log2_trafo_size > log2_min_pu_size && !is_intra) { -+- RefPicList *rpl = s->ref->refPicList; -++ if (is_intra) { -++ for (j = 0; j < (1 << log2_trafo_size); j += 4) -++ bs[j * s->bs_width >> 2] = 2; -+ -+- // bs for TU internal horizontal PU boundaries -+- for (j = 8; j < (1 << log2_trafo_size); j += 8) { -+- int yp_pu = (y0 + j - 1) >> log2_min_pu_size; -+- int yq_pu = (y0 + j) >> log2_min_pu_size; -+- -+- for (i = 0; i < (1 << log2_trafo_size); i += 4) { -+- int x_pu = (x0 + i) >> log2_min_pu_size; -+- MvField *top = &tab_mvf[yp_pu * min_pu_width + x_pu]; -+- MvField *curr = &tab_mvf[yq_pu * min_pu_width + x_pu]; -+- -+- bs = boundary_strength(s, curr, top, rpl); -+- s->horizontal_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs; -++ } else { -++ int y_tu = y0 >> log2_min_tu_size; -++ int x_tu = x0 >> log2_min_tu_size; -++ uint8_t *curr_cbf_luma = &s->cbf_luma[y_tu * min_tu_width + x_tu]; -++ uint8_t *left_cbf_luma = curr_cbf_luma - 1; -++ -++ s->hevcdsp.hevc_deblocking_boundary_strengths(trafo_in_min_pus, -++ min_pu_in_4pix, min_pu_width * sizeof (MvField), 4 * s->bs_width >> 2, -++ rpl[0].list, rpl[1].list, rpl_left[0].list, rpl_left[1].list, -++ curr, left, bs); -++ -++ for (j = 0; j < (1 << log2_trafo_size); j += 4) { -++ int j_pu = j >> log2_min_pu_size; -++ int j_tu = j >> log2_min_tu_size; -++ -++ if (left[j_pu * min_pu_width].pred_flag == PF_INTRA) -++ bs[j * s->bs_width >> 2] = 2; -++ else if (curr_cbf_luma[j_tu * min_tu_width] || left_cbf_luma[j_tu * min_tu_width]) -++ bs[j * s->bs_width >> 2] = 1; -+ } -+ } -++ } -+ -+- // bs for TU internal vertical PU boundaries -+- for (j = 0; j < (1 << log2_trafo_size); j += 4) { -+- int y_pu = (y0 + j) >> log2_min_pu_size; -++ if (!is_intra) { -++ for (i = inc; i < trafo_in_min_pus; i += inc) { -++ MvField *left; -+ -+- for (i = 8; i < (1 << log2_trafo_size); i += 8) { -+- int xp_pu = (x0 + i - 1) >> log2_min_pu_size; -+- int xq_pu = (x0 + i) >> log2_min_pu_size; -+- MvField *left = &tab_mvf[y_pu * min_pu_width + xp_pu]; -+- MvField *curr = &tab_mvf[y_pu * min_pu_width + xq_pu]; -++ curr += inc; -++ left = curr - 1; -++ bs += inc << log2_min_pu_size >> 2; -+ -+- bs = boundary_strength(s, curr, left, rpl); -+- s->vertical_bs[((x0 + i) + (y0 + j) * s->bs_width) >> 2] = bs; -+- } -++ s->hevcdsp.hevc_deblocking_boundary_strengths(trafo_in_min_pus, -++ min_pu_in_4pix, min_pu_width * sizeof (MvField), 4 * s->bs_width >> 2, -++ rpl[0].list, rpl[1].list, rpl[0].list, rpl[1].list, -++ curr, left, bs); -+ } -+ } -+ } -+diff --git a/libavcodec/hevcdsp.c b/libavcodec/hevcdsp.c -+index 9d773d9..a6534a9 100644 -+--- a/libavcodec/hevcdsp.c -++++ b/libavcodec/hevcdsp.c -+@@ -123,6 +123,120 @@ DECLARE_ALIGNED(16, const int8_t, ff_hevc_qpel_filters[3][16]) = { -+ #include "hevcdsp_template.c" -+ #undef BIT_DEPTH -+ -++static void hevc_deblocking_boundary_strengths(int pus, int dup, int in_inc, int out_inc, -++ int *curr_rpl0, int *curr_rpl1, int *neigh_rpl0, int *neigh_rpl1, -++ MvField *curr, MvField *neigh, uint8_t *bs) -++{ -++ for (; pus > 0; pus--) { -++ int strength, out; -++ int curr_refL0 = curr_rpl0[curr->ref_idx[0]]; -++ int curr_refL1 = curr_rpl1[curr->ref_idx[1]]; -++ int neigh_refL0 = neigh_rpl0[neigh->ref_idx[0]]; -++ int neigh_refL1 = neigh_rpl1[neigh->ref_idx[1]]; -++ -++#if 1 // This more directly matches the original implementation -++ if (curr->pred_flag == PF_BI && neigh->pred_flag == PF_BI) { -++ // same L0 and L1 -++ if (curr_refL0 == neigh_refL0 && -++ curr_refL0 == curr_refL1 && -++ neigh_refL0 == neigh_refL1) { -++ if ((FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 || -++ FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) && -++ (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 || -++ FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4)) -++ strength = 1; -++ else -++ strength = 0; -++ } else if (neigh_refL0 == curr_refL0 && -++ neigh_refL1 == curr_refL1) { -++ if (FFABS(neigh->mv[0].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[0].y) >= 4 || -++ FFABS(neigh->mv[1].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[1].y) >= 4) -++ strength = 1; -++ else -++ strength = 0; -++ } else if (neigh_refL1 == curr_refL0 && -++ neigh_refL0 == curr_refL1) { -++ if (FFABS(neigh->mv[1].x - curr->mv[0].x) >= 4 || FFABS(neigh->mv[1].y - curr->mv[0].y) >= 4 || -++ FFABS(neigh->mv[0].x - curr->mv[1].x) >= 4 || FFABS(neigh->mv[0].y - curr->mv[1].y) >= 4) -++ strength = 1; -++ else -++ strength = 0; -++ } else { -++ strength = 1; -++ } -++ } else if ((curr->pred_flag != PF_BI) && (neigh->pred_flag != PF_BI)){ // 1 MV -++ Mv curr_mv0, neigh_mv0; -++ -++ if (curr->pred_flag & 1) { -++ curr_mv0 = curr->mv[0]; -++ } else { -++ curr_mv0 = curr->mv[1]; -++ curr_refL0 = curr_refL1; -++ } -++ -++ if (neigh->pred_flag & 1) { -++ neigh_mv0 = neigh->mv[0]; -++ } else { -++ neigh_mv0 = neigh->mv[1]; -++ neigh_refL0 = neigh_refL1; -++ } -++ -++ if (curr_refL0 == neigh_refL0) { -++ if (FFABS(curr_mv0.x - neigh_mv0.x) >= 4 || FFABS(curr_mv0.y - neigh_mv0.y) >= 4) -++ strength = 1; -++ else -++ strength = 0; -++ } else -++ strength = 1; -++ } else -++ strength = 1; -++#else // This has exactly the same effect, but is more suitable for vectorisation -++ Mv curr_mv[2]; -++ Mv neigh_mv[2]; -++ memcpy(curr_mv, curr->mv, sizeof curr_mv); -++ memcpy(neigh_mv, neigh->mv, sizeof neigh_mv); -++ -++ if (!(curr->pred_flag & 2)) { -++ curr_mv[1] = curr_mv[0]; -++ curr_refL1 = curr_refL0; -++ } -++ if (!(neigh->pred_flag & 2)) { -++ neigh_mv[1] = neigh_mv[0]; -++ neigh_refL1 = neigh_refL0; -++ } -++ if (!(curr->pred_flag & 1)) { -++ curr_mv[0] = curr_mv[1]; -++ curr_refL0 = curr_refL1; -++ } -++ if (!(neigh->pred_flag & 1)) { -++ neigh_mv[0] = neigh_mv[1]; -++ neigh_refL0 = neigh_refL1; -++ } -++ -++ strength = 1; -++ -++ strength &= (neigh_refL0 != curr_refL0) | (neigh_refL1 != curr_refL1) | -++ (FFABS(neigh_mv[0].x - curr_mv[0].x) >= 4) | (FFABS(neigh_mv[0].y - curr_mv[0].y) >= 4) | -++ (FFABS(neigh_mv[1].x - curr_mv[1].x) >= 4) | (FFABS(neigh_mv[1].y - curr_mv[1].y) >= 4); -++ -++ strength &= (neigh_refL1 != curr_refL0) | (neigh_refL0 != curr_refL1) | -++ (FFABS(neigh_mv[1].x - curr_mv[0].x) >= 4) | (FFABS(neigh_mv[1].y - curr_mv[0].y) >= 4) | -++ (FFABS(neigh_mv[0].x - curr_mv[1].x) >= 4) | (FFABS(neigh_mv[0].y - curr_mv[1].y) >= 4); -++ -++ strength |= (((curr->pred_flag + 1) ^ (neigh->pred_flag + 1)) >> 2); -++#endif -++ -++ curr += in_inc / sizeof (MvField); -++ neigh += in_inc / sizeof (MvField); -++ -++ for (out = dup; out > 0; out--) -++ { -++ *bs = strength; -++ bs += out_inc; -++ } -++ } -++} -++ -+ void ff_hevc_dsp_init(HEVCDSPContext *hevcdsp, int bit_depth) -+ { -+ #undef FUNC -+@@ -257,6 +371,8 @@ int i = 0; -+ break; -+ } -+ -++ hevcdsp->hevc_deblocking_boundary_strengths = hevc_deblocking_boundary_strengths; -++ -+ if (ARCH_X86) -+ ff_hevc_dsp_init_x86(hevcdsp, bit_depth); -+ if (ARCH_ARM) -+diff --git a/libavcodec/hevcdsp.h b/libavcodec/hevcdsp.h -+index 9f1f6dd..e221e54 100644 -+--- a/libavcodec/hevcdsp.h -++++ b/libavcodec/hevcdsp.h -+@@ -42,6 +42,17 @@ typedef struct SAOParams { -+ uint8_t type_idx[3]; ///< sao_type_idx -+ } SAOParams; -+ -++typedef struct Mv { -++ int16_t x; ///< horizontal component of motion vector -++ int16_t y; ///< vertical component of motion vector -++} Mv; -++ -++typedef struct MvField { -++ DECLARE_ALIGNED(4, Mv, mv)[2]; -++ int8_t ref_idx[2]; -++ int8_t pred_flag; -++} MvField; -++ -+ typedef struct HEVCDSPContext { -+ void (*put_pcm)(uint8_t *_dst, ptrdiff_t _stride, int width, int height, -+ struct GetBitContext *gb, int pcm_bit_depth); -+@@ -120,6 +131,9 @@ typedef struct HEVCDSPContext { -+ void (*hevc_v_loop_filter_chroma_c)(uint8_t *pix, ptrdiff_t stride, -+ int32_t *tc, uint8_t *no_p, -+ uint8_t *no_q); -++ void (*hevc_deblocking_boundary_strengths)(int pus, int dup, int in_inc, int out_inc, -++ int *curr_rpl0, int *curr_rpl1, int *neigh_rpl0, int *neigh_rpl1, -++ MvField *curr, MvField *neigh, uint8_t *bs); -+ } HEVCDSPContext; -+ -+ void ff_hevc_dsp_init(HEVCDSPContext *hpc, int bit_depth); -+-- -+2.5.0 -+ -+ -+From 50c89ce45ad633db0a48f084d5ecae0ae989e704 Mon Sep 17 00:00:00 2001 -+From: Peter de Rivaz -+Date: Wed, 15 Jul 2015 09:09:11 +0100 -+Subject: [PATCH 68/68] Only enable qpu when needed -+ -+--- -+ libavcodec/hevc.h | 2 +- -+ libavcodec/rpi_qpu.c | 21 ++++++++++++++++----- -+ 2 files changed, 17 insertions(+), 6 deletions(-) -+ -+diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h -+index cfa7c61..cb4350d 100644 -+--- a/libavcodec/hevc.h -++++ b/libavcodec/hevc.h -+@@ -56,7 +56,7 @@ -+ // Define RPI_WORKER to launch a worker thread for pixel processing tasks -+ #define RPI_WORKER -+ // Define RPI_DEBLOCK_VPU to perform deblocking on the VPUs -+- #define RPI_DEBLOCK_VPU -++ //#define RPI_DEBLOCK_VPU -+ -+ #endif -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index 5aa0432..ffd13ca 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -9,7 +9,7 @@ -+ // define RPI_ASYNC to run the VPU in a separate thread, need to make a separate call to check for completion -+ #define RPI_ASYNC -+ // Define RPI_COMBINE_JOBS to find jobs that can be executed in parallel -+-#define RPI_COMBINE_JOBS -++//#define RPI_COMBINE_JOBS -+ -+ #include -+ #include -+@@ -143,9 +143,9 @@ static int gpu_init(volatile struct GPU **gpu) { -+ volatile struct GPU* ptr; -+ if (mb < 0) -+ return -1; -+- -++#ifndef RPI_ASYNC -+ if (qpu_enable(mb, 1)) return -2; -+- -++#endif -+ vcsm_init(); -+ gpu_malloc_uncached_internal(sizeof(struct GPU), &gpu_mem_ptr, mb); -+ ptr = (volatile struct GPU*)gpu_mem_ptr.arm; -+@@ -336,9 +336,9 @@ static void gpu_term(void) -+ vpu_post_code(0, 0, 0, 0, 0, 0, -1, NULL); -+ pthread_join(vpu_thread, &res); -+ } -+-#endif -+- -++#else -+ qpu_enable(mb, 0); -++#endif -+ gpu_free_internal(&gpu_mem_ptr); -+ -+ vcsm_exit(); -+@@ -400,6 +400,7 @@ static void *vpu_start(void *arg) { -+ int count_deblock=0; -+ int count_qpu=0; -+ #endif -++ int qpu_started = 0; -+ while(1) { -+ int i; -+ int *p; // Pointer for a QPU/VPU job -+@@ -427,6 +428,12 @@ static void *vpu_start(void *arg) { -+ if (p[7] == 0 && p[0] == 0 && p[16]==0) -+ goto job_done_early; -+ -++ if (!qpu_started) { -++ int result = qpu_enable(gpu->mb, 1); -++ av_assert0(result==0); -++ qpu_started = 1; -++ } -++ -+ #ifdef RPI_COMBINE_JOBS -+ // First scan for a qpu job -+ for (int x=0;xmb, 0); -++ } -++ -+ return NULL; -+ } -+ -+-- -+2.5.0 -+ -+From 544f5eb0b6f8cc1ad316a94cae5e78eadf2e1ec9 Mon Sep 17 00:00:00 2001 -+From: John Cox -+Date: Tue, 9 Feb 2016 11:57:40 +0000 -+Subject: [PATCH 1/2] Zero copy code v6 -+ -+This version has GPU buffer pooling code -+--- -+ ffmpeg.c | 123 +++++++++----- -+ libavcodec/Makefile | 2 + -+ libavcodec/avcodec.h | 6 + -+ libavcodec/hevc.c | 92 ++++++----- -+ libavcodec/hevc_filter.c | 83 +++++----- -+ libavcodec/rpi_qpu.c | 2 +- -+ libavcodec/rpi_qpu.h | 109 ++++++++++++- -+ libavcodec/rpi_zc.c | 406 +++++++++++++++++++++++++++++++++++++++++++++++ -+ libavcodec/rpi_zc.h | 83 ++++++++++ -+ 9 files changed, 779 insertions(+), 127 deletions(-) -+ create mode 100644 libavcodec/rpi_zc.c -+ create mode 100644 libavcodec/rpi_zc.h -+ -+diff --git a/ffmpeg.c b/ffmpeg.c -+index 8828f48..36dc1a3 100644 -+--- a/ffmpeg.c -++++ b/ffmpeg.c -+@@ -25,7 +25,7 @@ -+ -+ #ifdef RPI -+ #define RPI_DISPLAY -+-//#define RPI_ZERO_COPY -++#define RPI_ZERO_COPY -+ #endif -+ -+ #include "config.h" -+@@ -80,9 +80,7 @@ -+ #include -+ #include -+ #include -+-#ifdef RPI_ZERO_COPY -+-#include "libavcodec/rpi_qpu.h" -+-#endif -++#include "libavcodec/rpi_zc.h" -+ #endif -+ -+ #if HAVE_SYS_RESOURCE_H -+@@ -183,13 +181,7 @@ static void free_input_threads(void); -+ -+ static MMAL_COMPONENT_T* rpi_display = NULL; -+ static MMAL_POOL_T *rpi_pool = NULL; -+- -+-#ifdef RPI_ZERO_COPY -+-static uint8_t *get_vc_handle(AVBufferRef *bref) { -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+- return (uint8_t *)p->vc_handle; -+-} -+-#endif -++static volatile int rpi_display_count = 0; -+ -+ static MMAL_POOL_T* display_alloc_pool(MMAL_PORT_T* port, size_t w, size_t h) -+ { -+@@ -206,7 +198,7 @@ static MMAL_POOL_T* display_alloc_pool(MMAL_PORT_T* port, size_t w, size_t h) -+ for (i = 0; i < NUM_BUFFERS; ++i) -+ { -+ MMAL_BUFFER_HEADER_T* buffer = pool->header[i]; -+- void* bufPtr = buffer->data; -++ char * bufPtr = buffer->data; -+ memset(bufPtr, i*30, w*h); -+ memset(bufPtr+w*h, 128, (w*h)/2); -+ } -+@@ -215,23 +207,31 @@ static MMAL_POOL_T* display_alloc_pool(MMAL_PORT_T* port, size_t w, size_t h) -+ return pool; -+ } -+ -+-static void display_cb_input(MMAL_PORT_T *port,MMAL_BUFFER_HEADER_T *buffer) { -++static void display_cb_input(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) { -++#ifdef RPI_ZERO_COPY -++ av_rpi_zc_unref(buffer->user_data); -++ --rpi_display_count; -++#endif -++ mmal_buffer_header_release(buffer); -++} -++ -++static void display_cb_control(MMAL_PORT_T *port,MMAL_BUFFER_HEADER_T *buffer) { -+ mmal_buffer_header_release(buffer); -+ } -+ -+ static MMAL_COMPONENT_T* display_init(size_t x, size_t y, size_t w, size_t h) -+ { -+ MMAL_COMPONENT_T* display; -+- int w2 = (w+31)&~31; -+- int h2 = (h+15)&~15; -+ MMAL_DISPLAYREGION_T region = -+ { -+- {MMAL_PARAMETER_DISPLAYREGION, sizeof(region)}, -++ .hdr = {MMAL_PARAMETER_DISPLAYREGION, sizeof(region)}, -+ .set = MMAL_DISPLAY_SET_LAYER | MMAL_DISPLAY_SET_FULLSCREEN | MMAL_DISPLAY_SET_DEST_RECT, -+ .layer = 2, -+ .fullscreen = 0, -+ .dest_rect = {x, y, w, h} -+ }; -++ const AVRpiZcFrameGeometry geo = av_rpi_zc_frame_geometry(w, h); -++ -+ bcm_host_init(); // TODO is this needed? -+ mmal_component_create(MMAL_COMPONENT_DEFAULT_VIDEO_RENDERER, &display); -+ assert(display); -+@@ -240,8 +240,8 @@ static MMAL_COMPONENT_T* display_init(size_t x, size_t y, size_t w, size_t h) -+ -+ MMAL_ES_FORMAT_T* format = display->input[0]->format; -+ format->encoding = MMAL_ENCODING_I420; -+- format->es->video.width = w2; -+- format->es->video.height = h2; -++ format->es->video.width = geo.stride_y; -++ format->es->video.height = geo.height_y; -+ format->es->video.crop.x = 0; -+ format->es->video.crop.y = 0; -+ format->es->video.crop.width = w; -+@@ -250,46 +250,75 @@ static MMAL_COMPONENT_T* display_init(size_t x, size_t y, size_t w, size_t h) -+ -+ mmal_component_enable(display); -+ -+- rpi_pool = display_alloc_pool(display->input[0], w2, h2); -++ rpi_pool = display_alloc_pool(display->input[0], geo.stride_y, geo.height_y); -+ -+ mmal_port_enable(display->input[0],display_cb_input); -+- mmal_port_enable(display->control,display_cb_input); -++ mmal_port_enable(display->control,display_cb_control); -+ -+- printf("Allocated display %d %d\n",w,h); -++ printf("Allocated display %dx%d in %dx%d\n", w, h, geo.stride_y, geo.height_y); -+ -+ return display; -+ } -+ -+-static void display_frame(MMAL_COMPONENT_T* display,AVFrame* fr) -++static void display_frame(struct AVCodecContext * const s, MMAL_COMPONENT_T* const display, const AVFrame* const fr) -+ { -+- int w = fr->width; -+- int h = fr->height; -+- int w2 = (w+31)&~31; -+- int h2 = (h+15)&~15; -+ if (!display || !rpi_pool) -+ return; -++ -++ if (rpi_display_count >= 3) { -++ av_log(s, AV_LOG_VERBOSE, "Frame dropped\n"); -++ return; -++ } -++ -+ MMAL_BUFFER_HEADER_T* buf = mmal_queue_get(rpi_pool->queue); -+ if (!buf) { -+- // Running too fast so drop the frame -+- return; -++ // Running too fast so drop the frame -++ printf("Q alloc failure\n"); -++ return; -+ } -+ assert(buf); -+ buf->cmd = 0; -+- buf->length = (w2 * h2 * 3)/2; -+ buf->offset = 0; // Offset to valid data -+ buf->flags = 0; -+ #ifdef RPI_ZERO_COPY -+- buf->data = get_vc_handle(fr->buf[0]); -+- buf->alloc_size = (w2*h2*3)/2; -++{ -++ const AVRpiZcRefPtr fr_buf = av_rpi_zc_ref(s, fr, 1); -++ -++ buf->user_data = fr_buf; -++ buf->data = av_rpi_zc_vc_handle(fr_buf); -++ buf->alloc_size = -++ buf->length = av_rpi_zc_numbytes(fr_buf); -++ -++ ++rpi_display_count; -++} -+ #else -++{ -++#error YYY -++ int w = fr->width; -++ int h = fr->height; -++ int w2 = (w+31)&~31; -++ int h2 = (h+15)&~15; -++ -++ buf->length = (w2 * h2 * 3)/2; -++ buf->user_data = NULL; -++ -+ //mmal_buffer_header_mem_lock(buf); -+ memcpy(buf->data, fr->data[0], w2 * h); -+ memcpy(buf->data+w2*h2, fr->data[1], w2 * h / 4); -+ memcpy(buf->data+w2*h2*5/4, fr->data[2], w2 * h / 4); -+ //mmal_buffer_header_mem_unlock(buf); -++} -+ #endif -+ -+- mmal_port_send_buffer(display->input[0], buf); // I assume this will automatically get released -++ while (rpi_display_count >= 3) { -++ usleep(5000); -++ } -++ -++ if (mmal_port_send_buffer(display->input[0], buf) != MMAL_SUCCESS) -++ { -++ printf("** send failed: depth=%d\n", rpi_display_count); -++ display_cb_input(NULL, buf); -++ } -+ } -+ -+ static void display_exit(MMAL_COMPONENT_T* display) -+@@ -687,6 +716,11 @@ static void ffmpeg_cleanup(int ret) -+ avformat_close_input(&input_files[i]->ctx); -+ av_freep(&input_files[i]); -+ } -++ -++#ifdef RPI_DISPLAY -++ display_exit(rpi_display); -++#endif -++ -+ for (i = 0; i < nb_input_streams; i++) { -+ InputStream *ist = input_streams[i]; -+ -+@@ -698,6 +732,9 @@ static void ffmpeg_cleanup(int ret) -+ av_freep(&ist->filters); -+ av_freep(&ist->hwaccel_device); -+ -++#ifdef RPI_ZERO_COPY -++ av_rpi_zc_uninit(ist->dec_ctx); -++#endif -+ avcodec_free_context(&ist->dec_ctx); -+ -+ av_freep(&input_streams[i]); -+@@ -729,9 +766,6 @@ static void ffmpeg_cleanup(int ret) -+ term_exit(); -+ ffmpeg_exited = 1; -+ -+-#ifdef RPI_DISPLAY -+- display_exit(rpi_display); -+-#endif -+ } -+ -+ void remove_avoptions(AVDictionary **a, AVDictionary *b) -+@@ -1079,18 +1113,19 @@ static void do_video_out(AVFormatContext *s, -+ int frame_size = 0; -+ InputStream *ist = NULL; -+ AVFilterContext *filter = ost->filter->filter; -++ -++ if (ost->source_index >= 0) -++ ist = input_streams[ost->source_index]; -++ -+ #ifdef RPI_DISPLAY -+- if (next_picture) -++ if (next_picture && ist != NULL) -+ { -+- if (!rpi_display) -++ if (!rpi_display) -+ rpi_display = display_init(0,0,next_picture->width,next_picture->height); -+- display_frame(rpi_display,next_picture); -++ display_frame(ist->dec_ctx, rpi_display, next_picture); -+ } -+ #endif -+ -+- if (ost->source_index >= 0) -+- ist = input_streams[ost->source_index]; -+- -+ if (filter->inputs[0]->frame_rate.num > 0 && -+ filter->inputs[0]->frame_rate.den > 0) -+ duration = 1/(av_q2d(filter->inputs[0]->frame_rate) * av_q2d(enc->time_base)); -+@@ -2692,6 +2727,12 @@ static int init_input_stream(int ist_index, char *error, int error_len) -+ ist->dec_ctx->opaque = ist; -+ ist->dec_ctx->get_format = get_format; -+ ist->dec_ctx->get_buffer2 = get_buffer; -++ -++#ifdef RPI_ZERO_COPY -++ // Overrides the above get_buffer2 -++ av_rpi_zc_init(ist->dec_ctx); -++#endif -++ -+ ist->dec_ctx->thread_safe_callbacks = 1; -+ -+ av_opt_set_int(ist->dec_ctx, "refcounted_frames", 1, 0); -+diff --git a/libavcodec/Makefile b/libavcodec/Makefile -+index 0fd6767..bae3f2d 100644 -+--- a/libavcodec/Makefile -++++ b/libavcodec/Makefile -+@@ -9,6 +9,7 @@ HEADERS = avcodec.h \ -+ rpi_shader.h \ -+ rpi_mailbox.h \ -+ rpi_hevc_transform.h \ -++ rpi_zc.h \ -+ dv_profile.h \ -+ d3d11va.h \ -+ dirac.h \ -+@@ -46,6 +47,7 @@ OBJS = allcodecs.o \ -+ rpi_qpu.o \ -+ rpi_shader.o \ -+ rpi_mailbox.o \ -++ rpi_zc.o \ -+ vorbis_parser.o \ -+ xiph.o \ -+ -+diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h -+index d849765..b934740 100644 -+--- a/libavcodec/avcodec.h -++++ b/libavcodec/avcodec.h -+@@ -3355,6 +3355,12 @@ typedef struct AVCodecContext { -+ AVPacketSideData *coded_side_data; -+ int nb_coded_side_data; -+ -++ /** -++ * Opaque pointer for use by replacement get_buffer2 code -++ * -++ * @author jc (08/02/2016) -++ */ -++ void * get_buffer_context; -+ } AVCodecContext; -+ -+ AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx); -+diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c -+index 35a1394..001c9e8 100644 -+--- a/libavcodec/hevc.c -++++ b/libavcodec/hevc.c -+@@ -114,10 +114,6 @@ static uint32_t rpi_filter_coefs[8][1] = { -+ { ENCODE_COEFFS( -2, 10, 58, -2) } -+ }; -+ -+-static uint32_t get_vc_address(AVBufferRef *bref) { -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+- return p->vc; -+-} -+ #endif -+ -+ -+@@ -2186,9 +2182,9 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int bw = nPbW-start_x; -+ int bh = nPbH-start_y; -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -+- y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address_y(ref0->frame); -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + 8 + start_x) & 0xffff); -+- y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address_y(ref0->frame); -+ *y++ = ( (bw<16 ? bw : 16) << 16 ) + (bh<16 ? bh : 16); -+ *y++ = my2_mx2_my_mx; -+ if (weight_flag) { -+@@ -2196,7 +2192,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ } else { -+ *y++ = 1; // Weight of 1 and offset of 0 -+ } -+- *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -++ *y++ = (get_vc_address_y(s->frame) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -+ } -+ } -+@@ -2235,8 +2231,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_u(ref0->frame); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_v(ref0->frame); -+ *u++ = ( (bwframe->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+- *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ *u++ = (get_vc_address_u(s->frame) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -++ *u++ = (get_vc_address_v(s->frame) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+ s->curr_u_mvs = u; -+@@ -2286,9 +2282,9 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int bw = nPbW-start_x; -+ int bh = nPbH-start_y; -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -+- y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address_y(ref1->frame); -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + 8 + start_x) & 0xffff); -+- y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address_y(ref1->frame); -+ *y++ = ( (bw<16 ? bw : 16) << 16 ) + (bh<16 ? bh : 16); -+ *y++ = my2_mx2_my_mx; -+ if (weight_flag) { -+@@ -2296,7 +2292,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ } else { -+ *y++ = 1; // Weight of 1 and offset of 0 -+ } -+- *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -++ *y++ = (get_vc_address_y(s->frame) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter; -+ } -+ } -+@@ -2336,8 +2332,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_u(ref1->frame); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_v(ref1->frame); -+ *u++ = ( (bwsh.chroma_weight_l0[current_mv.ref_idx[0]][0], s->sh.chroma_offset_l0[current_mv.ref_idx[0]][0] -+ *u++ = rpi_filter_coefs[_mx][0]; -+@@ -2349,8 +2345,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ *u++ = 1; // Weight of 1 and offset of 0 -+ *u++ = 1; -+ } -+- *u++ = (get_vc_address(s->frame->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+- *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ *u++ = (get_vc_address_u(s->frame) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -++ *u++ = (get_vc_address_v(s->frame) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+ s->curr_u_mvs = u; -+@@ -2392,13 +2388,13 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ int bw = nPbW-start_x; -+ int bh = nPbH-start_y; -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y1 - 3 + start_y) << 16) + ( (x1 - 3 + start_x) & 0xffff); -+- y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address_y(ref0->frame); -+ y++[-RPI_LUMA_COMMAND_WORDS] = ((y2 - 3 + start_y) << 16) + ( (x2 - 3 + start_x) & 0xffff); // Second fetch is for ref1 -+- y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[0]); -++ y++[-RPI_LUMA_COMMAND_WORDS] = get_vc_address_y(ref1->frame); -+ *y++ = ( (bw<8 ? bw : 8) << 16 ) + (bh<16 ? bh : 16); -+ *y++ = my2_mx2_my_mx; -+ *y++ = 1; // B frame weighted prediction not supported -+- *y++ = (get_vc_address(s->frame->buf[0]) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -++ *y++ = (get_vc_address_y(s->frame) + x0 + start_x + (start_y + y0) * s->frame->linesize[0]); -+ y++[-RPI_LUMA_COMMAND_WORDS] = s->mc_filter_b; -+ } -+ } -+@@ -2442,8 +2438,8 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0, -+ u++[-RPI_CHROMA_COMMAND_WORDS] = s->mc_filter_uv_b0; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x1_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y1_c - 1 + start_y; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[1]); -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref0->frame->buf[2]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_u(ref0->frame); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_v(ref0->frame); -+ *u++ = ( (bwmc_filter_uv_b; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = x2_c - 1 + start_x; -+ u++[-RPI_CHROMA_COMMAND_WORDS] = y2_c - 1 + start_y; -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[1]); -+- u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address(ref1->frame->buf[2]); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_u(ref1->frame); -++ u++[-RPI_CHROMA_COMMAND_WORDS] = get_vc_address_v(ref1->frame); -+ *u++ = ( (bwframe->buf[1]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -+- *u++ = (get_vc_address(s->frame->buf[2]) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -++ *u++ = (get_vc_address_u(s->frame) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[1]); -++ *u++ = (get_vc_address_v(s->frame) + x0_c + start_x + (start_y + y0_c) * s->frame->linesize[2]); -+ } -+ } -+ s->curr_u_mvs = u; -+@@ -3259,12 +3255,13 @@ static int32_t filter8_luma(uint8_t *data, int x0, int y0, int pitch, int my_mx, -+ return vsum; -+ } -+ -+-static uint8_t *test_frame(HEVCContext *s,uint32_t p, AVFrame *frame, int cIdx) -++static uint8_t *test_frame(HEVCContext *s,uint32_t p, AVFrame *frame, const int cIdx) -+ { -+ //int pic_width = s->ps.sps->width >> s->ps.sps->hshift[cIdx]; -+ int pic_height = s->ps.sps->height >> s->ps.sps->vshift[cIdx]; -+ int pitch = frame->linesize[cIdx]; -+- uint32_t base = get_vc_address(frame->buf[cIdx]); -++ uint32_t base = c_idx == 0 ? get_vc_address_y(frame); -++ c_idx == 1 ? get_vc_address_u(frame) : get_vc_address_v(frame); -+ if (p>=base && pdata[cIdx] + (p-base); -+ } -+@@ -3551,6 +3548,7 @@ static void rpi_launch_vpu_qpu(HEVCContext *s) -+ #ifdef RPI -+ -+ #ifndef RPI_FAST_CACHEFLUSH -++#error RPI_FAST_CACHEFLUSH is broken -+ static void flush_buffer(AVBufferRef *bref) { -+ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+ gpu_cache_flush(p); -+@@ -3561,7 +3559,7 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ { -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -++ GPU_MEM_PTR_T p = get_gpu_mem_ptr_u(s->frame); -+ int n = s->ps.sps->height; -+ int curr_y = 0; -+ int curr_uv = 0; -+@@ -3569,21 +3567,21 @@ static void flush_frame(HEVCContext *s,AVFrame *frame) -+ int sz,base; -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+- iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].handle = p.vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = (int)(p->arm) + base; -++ iocache.s[0].addr = (int)(p.arm) + base; -+ iocache.s[0].size = sz; -+- p = av_buffer_pool_opaque(frame->buf[2]); -+- iocache.s[1].handle = p->vcsm_handle; -++ p = get_gpu_mem_ptr_v(s->frame); -++ iocache.s[1].handle = p.vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = (int)(p->arm) + base; -++ iocache.s[1].addr = (int)(p.arm) + base; -+ iocache.s[1].size = sz; -+- p = av_buffer_pool_opaque(frame->buf[0]); -++ p = get_gpu_mem_ptr_y(s->frame); -+ sz = s->frame->linesize[0] * (n-curr_y); -+ base = s->frame->linesize[0] * curr_y; -+- iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].handle = p.vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = (int)(p->arm) + base; -++ iocache.s[2].addr = (int)(p.arm) + base; -+ iocache.s[2].size = sz; -+ vcsm_clean_invalid( &iocache ); -+ #else -+@@ -3601,7 +3599,7 @@ static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM -+ int curr_y; -+ int curr_uv; -+ int n_uv; -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -++ GPU_MEM_PTR_T p = get_gpu_mem_ptr_u(s->frame); -+ int sz,base; -+ int (*d)[2] = s->dblk_cmds[job]; -+ int low=(*d)[1]; -+@@ -3618,21 +3616,21 @@ static void flush_frame3(HEVCContext *s,AVFrame *frame,GPU_MEM_PTR_T *p0,GPU_MEM -+ -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+- iocache.s[0].handle = p->vcsm_handle; -++ iocache.s[0].handle = p.vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = (int)(p->arm) + base; -++ iocache.s[0].addr = (int)(p.arm) + base; -+ iocache.s[0].size = sz; -+- p = av_buffer_pool_opaque(frame->buf[2]); -+- iocache.s[1].handle = p->vcsm_handle; -++ p = get_gpu_mem_ptr_v(s->frame); -++ iocache.s[1].handle = p.vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = (int)(p->arm) + base; -++ iocache.s[1].addr = (int)(p.arm) + base; -+ iocache.s[1].size = sz; -+- p = av_buffer_pool_opaque(frame->buf[0]); -++ p = get_gpu_mem_ptr_y(s->frame); -+ sz = s->frame->linesize[0] * (n-curr_y); -+ base = s->frame->linesize[0] * curr_y; -+- iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].handle = p.vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = (int)(p->arm) + base; -++ iocache.s[2].addr = (int)(p.arm) + base; -+ iocache.s[2].size = sz; -+ -+ iocache.s[3].handle = p0->vcsm_handle; -+diff --git a/libavcodec/hevc_filter.c b/libavcodec/hevc_filter.c -+index 826a82f..c4fa305 100644 -+--- a/libavcodec/hevc_filter.c -++++ b/libavcodec/hevc_filter.c -+@@ -879,17 +879,25 @@ void ff_hevc_deblocking_boundary_strengths(HEVCContext *s, int x0, int y0, -+ #undef CR -+ -+ #ifdef RPI_INTER_QPU -+-static void flush_buffer(AVBufferRef *bref) { -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+- gpu_cache_flush(p); -++static void flush_buffer_y(const AVFrame * const frame) { -++ GPU_MEM_PTR_T p = get_gpu_mem_ptr_y(frame); -++ gpu_cache_flush(&p); -+ } -+ -+-// Return Physical address for this image -+-static uint32_t get_vc_address(AVBufferRef *bref) { -+- GPU_MEM_PTR_T *p = av_buffer_pool_opaque(bref); -+- return p->vc; -++static void flush_buffer_u(const AVFrame * const frame) { -++ GPU_MEM_PTR_T p = get_gpu_mem_ptr_u(frame); -++ gpu_cache_flush(&p); -+ } -+ -++static void flush_buffer_v(const AVFrame * const frame) { -++ GPU_MEM_PTR_T p = get_gpu_mem_ptr_v(frame); -++ gpu_cache_flush(&p); -++} -++ -++ -++#ifdef RPI_DEBLOCK_VPU -++#error Not fixed yet -++ -+ // ff_hevc_flush_buffer_lines -+ // flushes and invalidates all pixel rows in [start,end-1] -+ static void ff_hevc_flush_buffer_lines(HEVCContext *s, int start, int end, int flush_luma, int flush_chroma) -+@@ -901,44 +909,44 @@ static void ff_hevc_flush_buffer_lines(HEVCContext *s, int start, int end, int f -+ int curr_uv = curr_y >> s->ps.sps->vshift[1]; -+ int n_uv = n >> s->ps.sps->vshift[1]; -+ int sz,base; -+- GPU_MEM_PTR_T *p; -++ GPU_MEM_PTR_T p; -+ if (curr_uv < 0) curr_uv = 0; -+ if (n_uv<=curr_uv) { return; } -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+ if (flush_chroma) { -+- p = av_buffer_pool_opaque(s->frame->buf[1]); -+- iocache.s[0].handle = p->vcsm_handle; -++ p = get_gpu_mem_ptr_u(s->frame); -++ iocache.s[0].handle = p.vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = (int)p->arm + base; -++ iocache.s[0].addr = (int)p.arm + base; -+ iocache.s[0].size = sz; -+- p = av_buffer_pool_opaque(s->frame->buf[2]); -+- iocache.s[1].handle = p->vcsm_handle; -++ p = get_gpu_mem_ptr_v(s->frame); -++ iocache.s[1].handle = p.vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = (int)p->arm + base; -++ iocache.s[1].addr = (int)p.arm + base; -+ iocache.s[1].size = sz; -+ } -+ if (flush_luma) { -+- p = av_buffer_pool_opaque(s->frame->buf[0]); -++ p = get_gpu_mem_ptr_y(s->frame); -+ sz = s->frame->linesize[0] * (n-curr_y); -+ base = s->frame->linesize[0] * curr_y; -+- iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].handle = p.vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = (int)p->arm + base; -++ iocache.s[2].addr = (int)p.arm + base; -+ iocache.s[2].size = sz; -+ } -+ vcsm_clean_invalid( &iocache ); -+ #else -+ if (flush_chroma) { -+- flush_buffer(s->frame->buf[1]); -+- flush_buffer(s->frame->buf[2]); -++ flush_buffer_u(s->frame); -++ flush_buffer_v(s->frame); -+ } -+ if (flush_luma) { -+- flush_buffer(s->frame->buf[0]); -++ flush_buffer_y(s->frame); -+ } -+ #endif -+ } -+- -++#endif -+ -+ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ { -+@@ -950,37 +958,37 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ int curr_uv = curr_y >> s->ps.sps->vshift[1]; -+ int n_uv = n >> s->ps.sps->vshift[1]; -+ int sz,base; -+- GPU_MEM_PTR_T *p; -++ GPU_MEM_PTR_T p; -+ if (curr_uv < 0) curr_uv = 0; -+ if (n_uv<=curr_uv) { return; } -+ sz = s->frame->linesize[1] * (n_uv-curr_uv); -+ base = s->frame->linesize[1] * curr_uv; -+- p = av_buffer_pool_opaque(s->frame->buf[1]); -+- iocache.s[0].handle = p->vcsm_handle; -++ p = get_gpu_mem_ptr_u(s->frame); -++ iocache.s[0].handle = p.vcsm_handle; -+ iocache.s[0].cmd = 3; // clean+invalidate -+- iocache.s[0].addr = (int)p->arm + base; -++ iocache.s[0].addr = (int)p.arm + base; -+ iocache.s[0].size = sz; -+- p = av_buffer_pool_opaque(s->frame->buf[2]); -+- iocache.s[1].handle = p->vcsm_handle; -++ p = get_gpu_mem_ptr_v(s->frame); -++ iocache.s[1].handle = p.vcsm_handle; -+ iocache.s[1].cmd = 3; // clean+invalidate -+- iocache.s[1].addr = (int)p->arm + base; -++ iocache.s[1].addr = (int)p.arm + base; -+ iocache.s[1].size = sz; -+ -+ #ifdef RPI_LUMA_QPU -+- p = av_buffer_pool_opaque(s->frame->buf[0]); -++ p = get_gpu_mem_ptr_y(s->frame); -+ sz = s->frame->linesize[0] * (n-curr_y); -+ base = s->frame->linesize[0] * curr_y; -+- iocache.s[2].handle = p->vcsm_handle; -++ iocache.s[2].handle = p.vcsm_handle; -+ iocache.s[2].cmd = 3; // clean+invalidate -+- iocache.s[2].addr = (int)p->arm + base; -++ iocache.s[2].addr = (int)p.arm + base; -+ iocache.s[2].size = sz; -+ #endif -+ vcsm_clean_invalid( &iocache ); -+ #else -+- flush_buffer(s->frame->buf[1]); -+- flush_buffer(s->frame->buf[2]); -++ flush_buffer_u(s->frame); -++ flush_buffer_v(s->frame); -+ #ifdef RPI_LUMA_QPU -+- flush_buffer(s->frame->buf[0]); -++ flush_buffer_y(s->frame); -+ #endif -+ -+ #endif -+@@ -992,6 +1000,7 @@ void ff_hevc_flush_buffer(HEVCContext *s, ThreadFrame *f, int n) -+ #endif -+ -+ #ifdef RPI_DEBLOCK_VPU -++#error XXX -+ /* rpi_deblock deblocks an entire row of ctbs using the VPU */ -+ static void rpi_deblock(HEVCContext *s, int y, int ctb_size) -+ { -+@@ -1000,21 +1009,21 @@ static void rpi_deblock(HEVCContext *s, int y, int ctb_size) -+ // TODO flush buffer of beta/tc setup when it becomes cached -+ -+ // Prepare three commands at once to avoid calling overhead -+- s->vpu_cmds_arm[0][0] = get_vc_address(s->frame->buf[0]) + s->frame->linesize[0] * y; -++ s->vpu_cmds_arm[0][0] = get_vc_address_y(s->frame) + s->frame->linesize[0] * y; -+ s->vpu_cmds_arm[0][1] = s->frame->linesize[0]; -+ s->vpu_cmds_arm[0][2] = s->setup_width; -+ s->vpu_cmds_arm[0][3] = (int) ( s->y_setup_vc + s->setup_width * (y>>4) ); -+ s->vpu_cmds_arm[0][4] = ctb_size>>4; -+ s->vpu_cmds_arm[0][5] = 2; -+ -+- s->vpu_cmds_arm[1][0] = get_vc_address(s->frame->buf[1]) + s->frame->linesize[1] * (y>> s->ps.sps->vshift[1]); -++ s->vpu_cmds_arm[1][0] = get_vc_address_u(s->frame) + s->frame->linesize[1] * (y>> s->ps.sps->vshift[1]); -+ s->vpu_cmds_arm[1][1] = s->frame->linesize[1]; -+ s->vpu_cmds_arm[1][2] = s->uv_setup_width; -+ s->vpu_cmds_arm[1][3] = (int) ( s->uv_setup_vc + s->uv_setup_width * ((y>>4)>> s->ps.sps->vshift[1]) ); -+ s->vpu_cmds_arm[1][4] = (ctb_size>>4)>> s->ps.sps->vshift[1]; -+ s->vpu_cmds_arm[1][5] = 3; -+ -+- s->vpu_cmds_arm[2][0] = get_vc_address(s->frame->buf[2]) + s->frame->linesize[2] * (y>> s->ps.sps->vshift[2]); -++ s->vpu_cmds_arm[2][0] = get_vc_address_v(s->frame) + s->frame->linesize[2] * (y>> s->ps.sps->vshift[2]); -+ s->vpu_cmds_arm[2][1] = s->frame->linesize[2]; -+ s->vpu_cmds_arm[2][2] = s->uv_setup_width; -+ s->vpu_cmds_arm[2][3] = (int) ( s->uv_setup_vc + s->uv_setup_width * ((y>>4)>> s->ps.sps->vshift[1]) ); -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index ffd13ca..b0c9bc5 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -250,7 +250,7 @@ int gpu_get_mailbox(void) -+ } -+ -+ // Call this to clean and invalidate a region of memory -+-void gpu_cache_flush(GPU_MEM_PTR_T *p) -++void gpu_cache_flush(const GPU_MEM_PTR_T * const p) -+ { -+ #ifdef RPI_FAST_CACHEFLUSH -+ struct vcsm_user_clean_invalid_s iocache = {}; -+diff --git a/libavcodec/rpi_qpu.h b/libavcodec/rpi_qpu.h -+index 81c2bb1..b913f79 100644 -+--- a/libavcodec/rpi_qpu.h -++++ b/libavcodec/rpi_qpu.h -+@@ -2,8 +2,11 @@ -+ #define RPI_QPU_H -+ -+ // Define RPI_FAST_CACHEFLUSH to use the VCSM cache flush code -++// *** N.B. Code has rotted & crashes if this is unset (before this set of changes) -+ #define RPI_FAST_CACHEFLUSH -+ -++#define RPI_ONE_BUF 1 -++ -+ typedef struct gpu_mem_ptr_s { -+ unsigned char *arm; // Pointer to memory mapped on ARM side -+ int vc_handle; // Videocore handle of relocatable memory -+@@ -16,9 +19,113 @@ typedef struct gpu_mem_ptr_s { -+ extern int gpu_malloc_cached(int numbytes, GPU_MEM_PTR_T *p); -+ extern int gpu_malloc_uncached(int numbytes, GPU_MEM_PTR_T *p); -+ extern void gpu_free(GPU_MEM_PTR_T *p); -+-extern void gpu_cache_flush(GPU_MEM_PTR_T *p); -++extern void gpu_cache_flush(const GPU_MEM_PTR_T * const p); -+ extern void gpu_cache_flush3(GPU_MEM_PTR_T *p0,GPU_MEM_PTR_T *p1,GPU_MEM_PTR_T *p2); -+ -++#include "libavutil/frame.h" -++#if !RPI_ONE_BUF -++static inline uint32_t get_vc_address_y(const AVFrame * const frame) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[0]); -++ return p->vc; -++} -++ -++static inline uint32_t get_vc_address_u(const AVFrame * const frame) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[1]); -++ return p->vc; -++} -++ -++static inline uint32_t get_vc_address_v(const AVFrame * const frame) { -++ GPU_MEM_PTR_T *p = av_buffer_pool_opaque(frame->buf[2]); -++ return p->vc; -++} -++ -++static inline GPU_MEM_PTR_T get_gpu_mem_ptr_y(const AVFrame * const frame) { -++ return *(GPU_MEM_PTR_T *)av_buffer_pool_opaque(frame->buf[0]); -++} -++ -++static inline GPU_MEM_PTR_T get_gpu_mem_ptr_u(const AVFrame * const frame) { -++ return *(GPU_MEM_PTR_T *)av_buffer_pool_opaque(frame->buf[1]); -++} -++ -++static inline GPU_MEM_PTR_T get_gpu_mem_ptr_v(const AVFrame * const frame) { -++ return *(GPU_MEM_PTR_T *)av_buffer_pool_opaque(frame->buf[2]); -++} -++ -++#else -++ -++static inline int gpu_is_buf1(const AVFrame * const frame) -++{ -++ return frame->buf[1] == NULL; -++} -++ -++static inline GPU_MEM_PTR_T * gpu_buf1_gmem(const AVFrame * const frame) -++{ -++ return av_buffer_get_opaque(frame->buf[0]); -++} -++ -++static inline GPU_MEM_PTR_T * gpu_buf3_gmem(const AVFrame * const frame, const int n) -++{ -++ return av_buffer_pool_opaque(frame->buf[n]); -++} -++ -++ -++static inline uint32_t get_vc_address_y(const AVFrame * const frame) { -++ return gpu_is_buf1(frame) ? gpu_buf1_gmem(frame)->vc : gpu_buf3_gmem(frame, 0)->vc; -++} -++ -++static inline uint32_t get_vc_address_u(const AVFrame * const frame) { -++ return gpu_is_buf1(frame) ? -++ gpu_buf1_gmem(frame)->vc + frame->data[1] - frame->data[0] : -++ gpu_buf3_gmem(frame, 1)->vc; -++} -++ -++static inline uint32_t get_vc_address_v(const AVFrame * const frame) { -++ return gpu_is_buf1(frame) ? -++ gpu_buf1_gmem(frame)->vc + frame->data[2] - frame->data[0] : -++ gpu_buf3_gmem(frame, 2)->vc; -++} -++ -++ -++static inline GPU_MEM_PTR_T get_gpu_mem_ptr_y(const AVFrame * const frame) { -++ if (gpu_is_buf1(frame)) -++ { -++ GPU_MEM_PTR_T g = *gpu_buf1_gmem(frame); -++ g.numbytes = frame->data[1] - frame->data[0]; -++ return g; -++ } -++ else -++ return *gpu_buf3_gmem(frame, 0); -++} -++ -++static inline GPU_MEM_PTR_T get_gpu_mem_ptr_u(const AVFrame * const frame) { -++ if (gpu_is_buf1(frame)) -++ { -++ GPU_MEM_PTR_T g = *gpu_buf1_gmem(frame); -++ g.arm += frame->data[1] - frame->data[0]; -++ g.vc += frame->data[1] - frame->data[0]; -++ g.numbytes = frame->data[2] - frame->data[1]; // chroma size -++ return g; -++ } -++ else -++ return *gpu_buf3_gmem(frame, 1); -++} -++ -++static inline GPU_MEM_PTR_T get_gpu_mem_ptr_v(const AVFrame * const frame) { -++ if (gpu_is_buf1(frame)) -++ { -++ GPU_MEM_PTR_T g = *gpu_buf1_gmem(frame); -++ g.arm += frame->data[2] - frame->data[0]; -++ g.vc += frame->data[2] - frame->data[0]; -++ g.numbytes = frame->data[2] - frame->data[1]; // chroma size -++ return g; -++ } -++ else -++ return *gpu_buf3_gmem(frame, 2); -++} -++ -++#endif -++ -++ -+ // QPU specific functions -+ extern void qpu_run_shader8(int code, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8); -+ extern void qpu_run_shader12(int code, int num, int code2, int num2, int unifs1, int unifs2, int unifs3, int unifs4, int unifs5, int unifs6, int unifs7, int unifs8, int unifs9, int unifs10, int unifs11, int unifs12); -+diff --git a/libavcodec/rpi_zc.c b/libavcodec/rpi_zc.c -+new file mode 100644 -+index 0000000..9580165 -+--- /dev/null -++++ b/libavcodec/rpi_zc.c -+@@ -0,0 +1,406 @@ -++#include "config.h" -++#ifdef RPI -++#include "rpi_qpu.h" -++#include "rpi_zc.h" -++ -++#include "libavutil/buffer_internal.h" -++ -++struct ZcPoolEnt; -++ -++typedef struct ZcPool -++{ -++ int numbytes; -++ struct ZcPoolEnt * head; -++ pthread_mutex_t lock; -++} ZcPool; -++ -++typedef struct ZcPoolEnt -++{ -++ // It is important that we start with gmem as other bits of code will expect to see that -++ GPU_MEM_PTR_T gmem; -++ struct ZcPoolEnt * next; -++ struct ZcPool * pool; -++} ZcPoolEnt; -++ -++static ZcPoolEnt * zc_pool_ent_alloc(ZcPool * const pool, const int size) -++{ -++ ZcPoolEnt * const zp = av_malloc(sizeof(ZcPoolEnt)); -++ -++ if (zp == NULL) { -++ av_log(NULL, AV_LOG_ERROR, "av_malloc(ZcPoolEnt) failed\n"); -++ goto fail0; -++ } -++ -++ if (gpu_malloc_cached(size, &zp->gmem) != 0) -++ { -++ av_log(NULL, AV_LOG_ERROR, "av_gpu_malloc_cached(%d) failed\n", size); -++ goto fail1; -++ } -++ -++ zp->next = NULL; -++ zp->pool = pool; -++ return zp; -++ -++fail1: -++ av_free(zp); -++fail0: -++ return NULL; -++} -++ -++static void zc_pool_ent_free(ZcPoolEnt * const zp) -++{ -++ gpu_free(&zp->gmem); -++ av_free(zp); -++} -++ -++static void zc_pool_flush(ZcPool * const pool) -++{ -++ ZcPoolEnt * p = pool->head; -++ pool->head = NULL; -++ while (p != NULL) -++ { -++ ZcPoolEnt * const zp = p; -++ p = p->next; -++ zc_pool_ent_free(zp); -++ } -++} -++ -++static ZcPoolEnt * zc_pool_alloc(ZcPool * const pool, const int numbytes) -++{ -++ ZcPoolEnt * zp; -++ pthread_mutex_lock(&pool->lock); -++ -++ if (numbytes != pool->numbytes) -++ { -++ zc_pool_flush(pool); -++ pool->numbytes = numbytes; -++ } -++ -++ if (pool->head != NULL) -++ { -++ zp = pool->head; -++ pool->head = zp->next; -++ } -++ else -++ { -++ zp = zc_pool_ent_alloc(pool, numbytes); -++ } -++ -++ pthread_mutex_unlock(&pool->lock); -++ return zp; -++} -++ -++static void zc_pool_free(ZcPoolEnt * const zp) -++{ -++ ZcPool * const pool = zp == NULL ? NULL : zp->pool; -++ if (zp != NULL) -++ { -++ pthread_mutex_lock(&pool->lock); -++ if (pool->numbytes == zp->gmem.numbytes) -++ { -++ zp->next = pool->head; -++ pool->head = zp; -++ pthread_mutex_unlock(&pool->lock); -++ } -++ else -++ { -++ pthread_mutex_unlock(&pool->lock); -++ zc_pool_ent_free(zp); -++ } -++ } -++} -++ -++static void -++zc_pool_init(ZcPool * const pool) -++{ -++ pool->numbytes = -1; -++ pool->head = NULL; -++ pthread_mutex_init(&pool->lock, NULL); -++} -++ -++static void -++zc_pool_destroy(ZcPool * const pool) -++{ -++ pool->numbytes = -1; -++ zc_pool_flush(pool); -++ pthread_mutex_destroy(&pool->lock); -++} -++ -++ -++typedef struct AVZcEnv -++{ -++ ZcPool pool; -++} ZcEnv; -++ -++// Callback when buffer unrefed to zero -++static void rpi_free_display_buffer(void *opaque, uint8_t *data) -++{ -++ ZcPoolEnt *const zp = opaque; -++// printf("%s: data=%p\n", __func__, data); -++ zc_pool_free(zp); -++} -++ -++static inline GPU_MEM_PTR_T * pic_gm_ptr(AVBufferRef * const buf) -++{ -++ // Kludge where we check the free fn to check this is really -++ // one of our buffers - can't think of a better way -++ return buf == NULL || buf->buffer->free != rpi_free_display_buffer ? NULL : -++ av_buffer_get_opaque(buf); -++} -++ -++AVRpiZcFrameGeometry av_rpi_zc_frame_geometry( -++ const unsigned int video_width, const unsigned int video_height) -++{ -++ AVRpiZcFrameGeometry geo; -++ geo.stride_y = (video_width + 32 + 31) & ~31; -++ geo.stride_c = geo.stride_y / 2; -++// geo.height_y = (video_height + 15) & ~15; -++ geo.height_y = (video_height + 32 + 31) & ~31; -++ geo.height_c = geo.height_y / 2; -++ return geo; -++} -++ -++static AVBufferRef * rpi_buf_pool_alloc(ZcPool * const pool, int size) -++{ -++ ZcPoolEnt *const zp = zc_pool_alloc(pool, size); -++ AVBufferRef * buf; -++ -++ if (zp == NULL) { -++ av_log(NULL, AV_LOG_ERROR, "zc_pool_alloc(%d) failed\n", size); -++ goto fail0; -++ } -++ -++ if ((buf = av_buffer_create(zp->gmem.arm, size, rpi_free_display_buffer, zp, AV_BUFFER_FLAG_READONLY)) == NULL) -++ { -++ av_log(NULL, AV_LOG_ERROR, "av_buffer_create() failed\n"); -++ goto fail2; -++ } -++ -++ return buf; -++ -++fail2: -++ zc_pool_free(zp); -++fail0: -++ return NULL; -++} -++ -++static int rpi_get_display_buffer(struct AVCodecContext * const s, AVFrame * const frame) -++{ -++ ZcEnv *const zc = s->get_buffer_context; -++ const AVRpiZcFrameGeometry geo = av_rpi_zc_frame_geometry(frame->width, frame->height); -++ const unsigned int size_y = geo.stride_y * geo.height_y; -++ const unsigned int size_c = geo.stride_c * geo.height_c; -++ const unsigned int size_pic = size_y + size_c * 2; -++ AVBufferRef * buf; -++ unsigned int i; -++ -++// printf("Do local alloc: format=%#x, %dx%d: %u\n", frame->format, frame->width, frame->height, size_pic); -++ -++ if ((buf = rpi_buf_pool_alloc(&zc->pool, size_pic)) == NULL) -++ { -++ av_log(s, AV_LOG_ERROR, "rpi_get_display_buffer: Failed to get buffer from pool\n"); -++ return AVERROR(ENOMEM); -++ } -++ -++ for (i = 0; i < AV_NUM_DATA_POINTERS; i++) { -++ frame->buf[i] = NULL; -++ frame->data[i] = NULL; -++ frame->linesize[i] = 0; -++ } -++ -++ frame->buf[0] = buf; -++ frame->linesize[0] = geo.stride_y; -++ frame->linesize[1] = geo.stride_c; -++ frame->linesize[2] = geo.stride_c; -++ frame->data[0] = buf->data; -++ frame->data[1] = frame->data[0] + size_y; -++ frame->data[2] = frame->data[1] + size_c; -++ frame->extended_data = frame->data; -++ // Leave extended buf alone -++ -++ return 0; -++} -++ -++ -++#define RPI_GET_BUFFER2 1 -++ -++int av_rpi_zc_get_buffer2(struct AVCodecContext *s, AVFrame *frame, int flags) -++{ -++#if !RPI_GET_BUFFER2 -++ return avcodec_default_get_buffer2(s, frame, flags); -++#else -++ int rv; -++ -++ if ((s->codec->capabilities & AV_CODEC_CAP_DR1) == 0 || -++ frame->format != AV_PIX_FMT_YUV420P) -++ { -++// printf("Do default alloc: format=%#x\n", frame->format); -++ rv = avcodec_default_get_buffer2(s, frame, flags); -++ } -++ else -++ { -++ rv = rpi_get_display_buffer(s, frame); -++ } -++ -++#if 0 -++ printf("%s: %dx%d lsize=%d/%d/%d data=%p/%p/%p bref=%p/%p/%p opaque[0]=%p\n", __func__, -++ frame->width, frame->height, -++ frame->linesize[0], frame->linesize[1], frame->linesize[2], -++ frame->data[0], frame->data[1], frame->data[2], -++ frame->buf[0], frame->buf[1], frame->buf[2], -++ av_buffer_get_opaque(frame->buf[0])); -++#endif -++ return rv; -++#endif -++} -++ -++ -++static AVBufferRef * zc_copy(struct AVCodecContext * const s, -++ const AVFrame * const src) -++{ -++ AVFrame dest_frame; -++ AVFrame * const dest = &dest_frame; -++ unsigned int i; -++ uint8_t * psrc, * pdest; -++ -++ dest->width = src->width; -++ dest->height = src->height; -++ -++ if (rpi_get_display_buffer(s, dest) != 0) -++ { -++ return NULL; -++ } -++ -++ for (i = 0, psrc = src->data[0], pdest = dest->data[0]; -++ i != dest->height; -++ ++i, psrc += src->linesize[0], pdest += dest->linesize[0]) -++ { -++ memcpy(pdest, psrc, dest->width); -++ } -++ for (i = 0, psrc = src->data[1], pdest = dest->data[1]; -++ i != dest->height / 2; -++ ++i, psrc += src->linesize[1], pdest += dest->linesize[1]) -++ { -++ memcpy(pdest, psrc, dest->width / 2); -++ } -++ for (i = 0, psrc = src->data[2], pdest = dest->data[2]; -++ i != dest->height / 2; -++ ++i, psrc += src->linesize[2], pdest += dest->linesize[2]) -++ { -++ memcpy(pdest, psrc, dest->width / 2); -++ } -++ -++ return dest->buf[0]; -++} -++ -++ -++AVRpiZcRefPtr av_rpi_zc_ref(struct AVCodecContext * const s, -++ const AVFrame * const frame, const int maycopy) -++{ -++ assert(s != NULL); -++ -++ if (frame->format != AV_PIX_FMT_YUV420P) -++ { -++ av_log(s, AV_LOG_WARNING, "%s: *** Format not YUV420P: %d\n", __func__, frame->format); -++ return NULL; -++ } -++ -++ if (frame->buf[1] != NULL) -++ { -++ if (maycopy) -++ { -++ av_log(s, AV_LOG_INFO, "%s: *** Not a single buf frame: copying\n", __func__); -++ return zc_copy(s, frame); -++ } -++ else -++ { -++ av_log(s, AV_LOG_WARNING, "%s: *** Not a single buf frame: NULL\n", __func__); -++ return NULL; -++ } -++ } -++ -++ if (pic_gm_ptr(frame->buf[0]) == NULL) -++ { -++ if (maycopy) -++ { -++ av_log(s, AV_LOG_INFO, "%s: *** Not one of our buffers: copying\n", __func__); -++ return zc_copy(s, frame); -++ } -++ else -++ { -++ av_log(s, AV_LOG_WARNING, "%s: *** Not one of our buffers: NULL\n", __func__); -++ return NULL; -++ } -++ } -++ -++ return av_buffer_ref(frame->buf[0]); -++} -++ -++int av_rpi_zc_vc_handle(const AVRpiZcRefPtr fr_ref) -++{ -++ const GPU_MEM_PTR_T * const p = pic_gm_ptr(fr_ref); -++ return p == NULL ? -1 : p->vc_handle; -++} -++ -++int av_rpi_zc_numbytes(const AVRpiZcRefPtr fr_ref) -++{ -++ const GPU_MEM_PTR_T * const p = pic_gm_ptr(fr_ref); -++ return p == NULL ? 0 : p->numbytes; -++} -++ -++void av_rpi_zc_unref(AVRpiZcRefPtr fr_ref) -++{ -++ if (fr_ref != NULL) -++ { -++ av_buffer_unref(&fr_ref); -++ } -++} -++ -++AVZcEnvPtr av_rpi_zc_env_alloc(void) -++{ -++ ZcEnv * const zc = av_mallocz(sizeof(ZcEnv)); -++ if (zc == NULL) -++ { -++ av_log(NULL, AV_LOG_ERROR, "av_rpi_zc_env_alloc: Context allocation failed\n"); -++ return NULL; -++ } -++ -++ zc_pool_init(&zc->pool); -++ return zc; -++} -++ -++void av_rpi_zc_env_free(AVZcEnvPtr zc) -++{ -++ if (zc != NULL) -++ { -++ zc_pool_destroy(&zc->pool); ; -++ av_free(zc); -++ } -++} -++ -++int av_rpi_zc_init(struct AVCodecContext * const s) -++{ -++ ZcEnv * const zc = av_rpi_zc_env_alloc(); -++ if (zc == NULL) -++ { -++ return AVERROR(ENOMEM); -++ } -++ -++ s->get_buffer_context = zc; -++ s->get_buffer2 = av_rpi_zc_get_buffer2; -++ return 0; -++} -++ -++void av_rpi_zc_uninit(struct AVCodecContext * const s) -++{ -++ if (s->get_buffer2 == av_rpi_zc_get_buffer2) -++ { -++ ZcEnv * const zc = s->get_buffer_context; -++ s->get_buffer2 = avcodec_default_get_buffer2; -++ s->get_buffer_context = NULL; -++ av_rpi_zc_env_free(zc); -++ } -++} -++ -++#endif // RPI -++ -+diff --git a/libavcodec/rpi_zc.h b/libavcodec/rpi_zc.h -+new file mode 100644 -+index 0000000..f0109f4 -+--- /dev/null -++++ b/libavcodec/rpi_zc.h -+@@ -0,0 +1,83 @@ -++#ifndef LIBAVCODEC_RPI_ZC_H -++#define LIBAVCODEC_RPI_ZC_H -++ -++// Zero-Copy frame code for RPi -++// RPi needs Y/U/V planes to be contiguous for display. By default -++// ffmpeg will allocate separated planes so a memcpy is needed before -++// display. This code prodes a method a making ffmpeg allocate a single -++// bit of memory for the frame when can then be refrence counted until -++// display ahs finsihed with it. -++ -++#include "libavutil/frame.h" -++#include "libavcodec/avcodec.h" -++ -++// "Opaque" pointer to whatever we are using as a buffer reference -++typedef AVBufferRef * AVRpiZcRefPtr; -++ -++struct AVZcEnv; -++typedef struct AVZcEnv * AVZcEnvPtr; -++ -++typedef struct AVRpiZcFrameGeometry -++{ -++ unsigned int stride_y; -++ unsigned int height_y; -++ unsigned int stride_c; -++ unsigned int height_c; -++} AVRpiZcFrameGeometry; -++ -++ -++AVRpiZcFrameGeometry av_rpi_zc_frame_geometry( -++ const unsigned int video_width, const unsigned int video_height); -++ -++// Replacement fn for avctx->get_buffer2 -++// Should be set before calling avcodec_decode_open2 -++// -++// N.B. in addition to to setting avctx->get_buffer2, avctx->refcounted_frames -++// must be set to 1 as otherwise the buffer info is killed before being returned -++// by avcodec_decode_video2. Note also that this means that the AVFrame that is -++// return must be manually derefed with av_frame_unref. This should be done -++// after av_rpi_zc_ref has been called. -++int av_rpi_zc_get_buffer2(struct AVCodecContext *s, AVFrame *frame, int flags); -++ -++// Generate a ZC reference to the buffer(s) in this frame -++// If the buffer doesn't appear to be one allocated by _get_buffer_2 -++// then the behaviour depends on maycopy: -++// If maycopy=0 then return NULL -++// If maycopy=1 && the src frame is in a form where we can easily copy -++// the data, then allocate a new buffer and copy the data into it -++// Otherwise return NULL -++AVRpiZcRefPtr av_rpi_zc_ref(struct AVCodecContext * const s, -++ const AVFrame * const frame, const int maycopy); -++ -++// Get the vc_handle from the frame ref -++// Returns -1 if ref doesn't look valid -++int av_rpi_zc_vc_handle(const AVRpiZcRefPtr fr_ref); -++// Get the number of bytes allocated from the frame ref -++// Returns 0 if ref doesn't look valid -++int av_rpi_zc_numbytes(const AVRpiZcRefPtr fr_ref); -++ -++// Unreference the buffer refed/allocated by _zc_ref -++// If fr_ref is NULL then this will NOP -++void av_rpi_zc_unref(AVRpiZcRefPtr fr_ref); -++ -++// Allocate an environment for the buffer pool used by the ZC code -++// This should be put in avctx->get_buffer_context so it can be found by -++// av_rpi_zc_get_buffer2 when it is called from ffmpeg -++AVZcEnvPtr av_rpi_zc_env_alloc(void); -++ -++// Allocate the environment used by the ZC code -++void av_rpi_zc_env_free(AVZcEnvPtr); -++ -++ -++// Init ZC into a context -++// There is nothing magic in this fn - it just packages setting -++// get_buffer2 & get_buffer_context -++int av_rpi_zc_init(struct AVCodecContext * const s); -++ -++// Free ZC from a context -++// There is nothing magic in this fn - it just packages unsetting -++// get_buffer2 & get_buffer_context -++void av_rpi_zc_uninit(struct AVCodecContext * const s); -++ -++#endif -++ -+-- -+2.5.0 -+ -+ -+From 4d8bccc7b9a611a54253c26dd55fbffbf9db4c48 Mon Sep 17 00:00:00 2001 -+From: John Cox -+Date: Tue, 1 Mar 2016 14:21:25 +0000 -+Subject: [PATCH 2/2] Set VPU scheduling thread to high priority after creation -+ -+--- -+ libavcodec/rpi_qpu.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++- -+ 1 file changed, 47 insertions(+), 1 deletion(-) -+ -+diff --git a/libavcodec/rpi_qpu.c b/libavcodec/rpi_qpu.c -+index b0c9bc5..ee19231 100644 -+--- a/libavcodec/rpi_qpu.c -++++ b/libavcodec/rpi_qpu.c -+@@ -182,9 +182,55 @@ static int gpu_init(volatile struct GPU **gpu) { -+ err = pthread_create(&vpu_thread, NULL, vpu_start, NULL); -+ //printf("Created thread\n"); -+ if (err) { -+- printf("Failed to create vpu thread\n"); -++ av_log(NULL, AV_LOG_FATAL, "Failed to create vpu thread\n"); -+ return -4; -+ } -++ -++ { -++ struct sched_param param = {0}; -++ int policy = 0; -++ -++ if (pthread_getschedparam(vpu_thread, &policy, ¶m) != 0) -++ { -++ av_log(NULL, AV_LOG_ERROR, "Unable to get VPU thread scheduling parameters\n"); -++ } -++ else -++ { -++ av_log(NULL, AV_LOG_INFO, "VPU thread: policy=%d (%s), pri=%d\n", -++ policy, -++ policy == SCHED_RR ? "RR" : policy == SCHED_FIFO ? "FIFO" : "???" , -++ param.sched_priority); -++ -++ policy = SCHED_FIFO; -++ param.sched_priority = sched_get_priority_max(SCHED_FIFO); -++ -++ av_log(NULL, AV_LOG_INFO, "Attempt to set: policy=%d (%s), pri=%d\n", -++ policy, -++ policy == SCHED_RR ? "RR" : policy == SCHED_FIFO ? "FIFO" : "???" , -++ param.sched_priority); -++ -++ if (pthread_setschedparam(vpu_thread, policy, ¶m) != 0) -++ { -++ av_log(NULL, AV_LOG_ERROR, "Unable to set VPU thread scheduling parameters\n"); -++ } -++ else -++ { -++ if (pthread_getschedparam(vpu_thread, &policy, ¶m) != 0) -++ { -++ av_log(NULL, AV_LOG_ERROR, "Unable to get VPU thread scheduling parameters\n"); -++ } -++ else -++ { -++ av_log(NULL, AV_LOG_INFO, "VPU thread (after): policy=%d (%s), pri=%d\n", -++ policy, -++ policy == SCHED_RR ? "RR" : policy == SCHED_FIFO ? "FIFO" : "???" , -++ param.sched_priority); -++ } -++ } -++ } -++ -++ } -++ -+ } -+ #endif -+ -+-- -+2.5.0 -+ -diff --git a/tools/depends/target/gettext/Makefile b/tools/depends/target/gettext/Makefile -index 31ee560..85ca94d 100644 ---- a/tools/depends/target/gettext/Makefile -+++ b/tools/depends/target/gettext/Makefile -@@ -3,7 +3,7 @@ DEPS= ../../Makefile.include Makefile - - # lib name, version - LIBNAME=gettext --VERSION=0.19.8 -+VERSION=0.18.2 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - -diff --git a/tools/depends/target/jpeg/Makefile b/tools/depends/target/jpeg/Makefile -new file mode 100644 -index 0000000..5144f1d ---- /dev/null -+++ b/tools/depends/target/jpeg/Makefile -@@ -0,0 +1,39 @@ -+include ../../Makefile.include -+DEPS= ../../Makefile.include Makefile -+ -+# lib name, version -+LIBNAME=jpeg -+VERSION=8b -+SOURCE=$(LIBNAME)-$(VERSION) -+ARCHIVE=$(LIBNAME)src.v$(VERSION).tar.gz -+ -+# configuration settings -+CONFIGURE=./configure --prefix=$(PREFIX) -+ -+LIBDYLIB=$(PLATFORM)/.libs/lib$(LIBNAME).so -+ -+CLEAN_FILES=$(ARCHIVE) $(PLATFORM) -+ -+all: $(LIBDYLIB) .installed-$(PLATFORM) -+ -+$(TARBALLS_LOCATION)/$(ARCHIVE): -+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) -+ -+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) -+ rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) -+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) -+ cd $(PLATFORM); $(CONFIGURE) -+ -+$(LIBDYLIB): $(PLATFORM) -+ $(MAKE) -C $(PLATFORM) -+ -+.installed-$(PLATFORM): $(LIBDYLIB) -+ $(MAKE) -C $(PLATFORM) install -+ touch $@ -+ -+clean: -+ $(MAKE) -C $(PLATFORM) clean -+ rm -f .installed-$(PLATFORM) -+ -+distclean:: -+ rm -rf $(PLATFORM) .installed-$(PLATFORM) -diff --git a/tools/depends/target/liblzo2/Makefile b/tools/depends/target/liblzo2/Makefile -index 32d29d8..9a670ed 100644 ---- a/tools/depends/target/liblzo2/Makefile -+++ b/tools/depends/target/liblzo2/Makefile -@@ -3,7 +3,7 @@ DEPS= ../../Makefile.include Makefile - - # lib name, version - LIBNAME=lzo --VERSION=2.09 -+VERSION=2.06 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - -diff --git a/tools/depends/target/libmicrohttpd/Makefile b/tools/depends/target/libmicrohttpd/Makefile -index c374c5f..d00d2ba 100644 ---- a/tools/depends/target/libmicrohttpd/Makefile -+++ b/tools/depends/target/libmicrohttpd/Makefile -@@ -3,7 +3,7 @@ DEPS= ../../Makefile.include Makefile - - # lib name, version - LIBNAME=libmicrohttpd --VERSION=0.9.50 -+VERSION=svn-35533 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - -diff --git a/tools/depends/target/libmodplug/Makefile b/tools/depends/target/libmodplug/Makefile -new file mode 100644 -index 0000000..e2d2440 ---- /dev/null -+++ b/tools/depends/target/libmodplug/Makefile -@@ -0,0 +1,42 @@ -+include ../../Makefile.include -+DEPS= ../../Makefile.include Makefile -+ -+# lib name, version -+LIBNAME=libmodplug -+VERSION=0.8.7 -+SOURCE=$(LIBNAME)-$(VERSION) -+ARCHIVE=$(SOURCE).tar.gz -+ -+# configuration settings -+CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ -+ ./configure --prefix=$(PREFIX) -+ -+LIBDYLIB=$(PLATFORM)/src/.libs/$(LIBNAME).la -+ -+CLEAN_FILES=$(ARCHIVE) $(PLATFORM) -+ -+all: .installed-$(PLATFORM) -+ -+$(TARBALLS_LOCATION)/$(ARCHIVE): -+ cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE) -+ -+$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) -+ rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) -+ cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) -+ cd $(PLATFORM); $(AUTORECONF) -vif -+ cd $(PLATFORM); $(CONFIGURE) -+ -+$(LIBDYLIB): $(PLATFORM) -+ $(MAKE) -C $(PLATFORM) -+ -+.installed-$(PLATFORM): $(LIBDYLIB) -+ $(MAKE) -C $(PLATFORM) install -+ touch $@ -+ -+clean: -+ $(MAKE) -C $(PLATFORM) clean -+ rm -f .installed-$(PLATFORM) -+ -+distclean:: -+ rm -rf $(PLATFORM) .installed-$(PLATFORM) -+ -diff --git a/tools/depends/target/libpng/Makefile b/tools/depends/target/libpng/Makefile -index ce45063..83fb583 100644 ---- a/tools/depends/target/libpng/Makefile -+++ b/tools/depends/target/libpng/Makefile -@@ -8,7 +8,7 @@ SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - - # configuration settings --CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ -+CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; CFLAGS=-fPIC \ - ./configure --prefix=$(PREFIX) --disable-shared - - LIBDYLIB=$(PLATFORM)/.libs/$(LIBNAME)15.a -diff --git a/tools/depends/target/librtmp/Makefile b/tools/depends/target/librtmp/Makefile -index e78d375..15829b4 100644 ---- a/tools/depends/target/librtmp/Makefile -+++ b/tools/depends/target/librtmp/Makefile -@@ -3,7 +3,7 @@ DEPS= ../../Makefile.include Makefile prefix.patch - - # lib name, version - LIBNAME=rtmpdump --VERSION=fa8646daeb19dfd12c181f7d19de708d623704c0 -+VERSION=a107cef9b392616dff54fabfd37f985ee2190a6f - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.gz - # configuration settings -diff --git a/tools/depends/target/python27/Makefile b/tools/depends/target/python27/Makefile -index d6a68bd..7bfc59f 100644 ---- a/tools/depends/target/python27/Makefile -+++ b/tools/depends/target/python27/Makefile -@@ -4,7 +4,7 @@ DEPS= ../../Makefile.include Makefile Python-2.7.10-crosscompile.patch Python-2. - - # lib name, version - LIBNAME=Python --VERSION=2.7.11 -+VERSION=2.7.10 - SOURCE=$(LIBNAME)-$(VERSION) - ARCHIVE=$(SOURCE).tar.xz - -@@ -39,6 +39,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - cd $(PLATFORM); patch -p0 < ../Python-2.7.10-android.patch - cd $(PLATFORM); patch -p0 < ../Python-no-export-path.patch - cd $(PLATFORM); patch -p0 < ../fix-ffi.patch -+ #cd $(PLATFORM); patch -p1 < ../urllib-ssl-no-cert_check.patch - ifeq ($(OS),ios) - cd $(PLATFORM); patch -p0 < ../make-fork-optional.patch - cd $(PLATFORM); patch -p0 < ../Python-2.6.5-urllib.diff -diff --git a/tools/depends/target/python27/Python-2.7.10-crosscompile.patch b/tools/depends/target/python27/Python-2.7.10-crosscompile.patch -index c7c1c42..7de1ead 100644 ---- a/tools/depends/target/python27/Python-2.7.10-crosscompile.patch -+++ b/tools/depends/target/python27/Python-2.7.10-crosscompile.patch -@@ -1,6 +1,6 @@ - --- Makefile.pre.in.orig 2015-05-23 18:09:16.000000000 +0200 - +++ Makefile.pre.in 2015-10-10 12:29:21.988926069 +0200 --@@ -238,6 +238,7 @@ -+@@ -234,6 +234,7 @@ - ########################################################################## - # Parser - PGEN= Parser/pgen$(EXE) -@@ -8,7 +8,7 @@ - - PSRCS= \ - Parser/acceler.c \ --@@ -497,9 +498,9 @@ -+@@ -472,9 +473,9 @@ - *\ -s*|s*) quiet="-q";; \ - *) quiet="";; \ - esac; \ -@@ -20,7 +20,7 @@ - - # Build static library - # avoid long command lines, same as LIBRARY_OBJS --@@ -636,7 +637,7 @@ -+@@ -611,7 +612,7 @@ - $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS) - @$(MKDIR_P) Include - $(MAKE) $(PGEN) -@@ -29,7 +29,7 @@ - $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS) - $(MAKE) $(GRAMMAR_H) - touch $(GRAMMAR_C) --@@ -1072,12 +1073,12 @@ -+@@ -1042,12 +1043,12 @@ - $(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \ - $(DESTDIR)$(LIBDEST)/distutils/tests ; \ - fi -@@ -44,7 +44,7 @@ - $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \ - -d $(LIBDEST) -f \ - -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \ --@@ -1205,11 +1206,13 @@ -+@@ -1175,11 +1176,13 @@ - # Install the dynamically loadable modules - # This goes into $(exec_prefix) - sharedinstall: sharedmods -diff --git a/tools/depends/target/python27/Python-no-export-path.patch b/tools/depends/target/python27/Python-no-export-path.patch -index 6c486cc..5b001b1 100644 ---- a/tools/depends/target/python27/Python-no-export-path.patch -+++ b/tools/depends/target/python27/Python-no-export-path.patch -@@ -1,6 +1,6 @@ - --- Makefile.pre.in.orig 2015-10-09 19:10:15.042905069 +0200 - +++ Makefile.pre.in 2015-10-09 19:11:01.513642241 +0200 --@@ -1100,8 +1100,6 @@ -+@@ -1070,8 +1070,6 @@ - $(srcdir)/Lib/$(PLATDIR): - mkdir $(srcdir)/Lib/$(PLATDIR) - cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen -diff --git a/tools/depends/target/python27/Python-setup.patch b/tools/depends/target/python27/Python-setup.patch -index e9ff0c2..e32dd50 100644 ---- a/tools/depends/target/python27/Python-setup.patch -+++ b/tools/depends/target/python27/Python-setup.patch -@@ -1,6 +1,6 @@ - --- setup.py.orig 2015-10-07 16:32:16.219083585 +0200 - +++ setup.py 2015-10-07 16:41:48.563085871 +0200 --@@ -321,6 +321,9 @@ -+@@ -320,6 +320,9 @@ - self.announce('WARNING: skipping import check for Cygwin-based "%s"' - % ext.name) - return -@@ -10,7 +10,7 @@ - ext_filename = os.path.join( - self.build_lib, - self.get_ext_filename(self.get_ext_fullname(ext.name))) --@@ -335,27 +338,30 @@ -+@@ -331,27 +334,30 @@ - try: - imp.load_dynamic(ext.name, ext_filename) - except ImportError, why: -diff --git a/tools/depends/target/python27/fix-ffi.patch b/tools/depends/target/python27/fix-ffi.patch -index 270ac0a..29f8af8 100644 ---- a/tools/depends/target/python27/fix-ffi.patch -+++ b/tools/depends/target/python27/fix-ffi.patch -@@ -23,7 +23,7 @@ - +*/ - --- Modules/_ctypes/cfield.c.orig 2015-10-11 20:34:03.034370393 +0200 - +++ Modules/_ctypes/cfield.c 2015-10-11 20:37:04.462377159 +0200 --@@ -1724,6 +1724,7 @@ -+@@ -1723,6 +1723,7 @@ - */ - - /* align and size are bogus for void, but they must not be zero */ -@@ -31,7 +31,7 @@ - ffi_type ffi_type_void = { 1, 1, FFI_TYPE_VOID }; - - ffi_type ffi_type_uint8 = { 1, 1, FFI_TYPE_UINT8 }; --@@ -1740,14 +1741,14 @@ -+@@ -1739,14 +1740,14 @@ - - ffi_type ffi_type_float = { sizeof(float), FLOAT_ALIGN, FFI_TYPE_FLOAT }; - ffi_type ffi_type_double = { sizeof(double), DOUBLE_ALIGN, FFI_TYPE_DOUBLE }; -diff --git a/tools/depends/target/python27/urllib-ssl-no-cert_check.patch b/tools/depends/target/python27/urllib-ssl-no-cert_check.patch -new file mode 100644 -index 0000000..e57c419 ---- /dev/null -+++ b/tools/depends/target/python27/urllib-ssl-no-cert_check.patch -@@ -0,0 +1,14 @@ -+diff --git a/Lib/ssl.py b/Lib/ssl.py -+index 5df6ed3..a871519 100644 -+--- a/Lib/ssl.py -++++ b/Lib/ssl.py -+@@ -482,7 +482,7 @@ def _create_unverified_context(protocol=PROTOCOL_SSLv23, cert_reqs=None, -+ return context -+ -+ # Used by http.client if no context is explicitly passed. -+-_create_default_https_context = create_default_context -++_create_default_https_context = _create_unverified_context -+ -+ -+ # Backwards compatibility alias, even though it's not a public name. -+ diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp -index 78e1253..ef87a89 100644 +index b44e467..39eb53c 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp -@@ -29,15 +29,16 @@ +@@ -29,6 +29,8 @@ #include "utils/Splash.h" #include "LangInfo.h" #include "utils/Screenshot.h" @@ -54872,25 +7325,7 @@ index 78e1253..ef87a89 100644 #include "Util.h" #include "URL.h" #include "guilib/TextureManager.h" - #include "cores/IPlayer.h" - #include "cores/VideoPlayer/DVDFileInfo.h" - #include "cores/AudioEngine/AEFactory.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "cores/AudioEngine/Utils/AEUtil.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "PlayListPlayer.h" - #include "Autorun.h" - #include "video/Bookmark.h" -@@ -49,7 +50,6 @@ - #include "guilib/GUIFontManager.h" - #include "guilib/GUIColorManager.h" - #include "guilib/StereoscopicsManager.h" --#include "addons/BinaryAddonCache.h" - #include "addons/LanguageResource.h" - #include "addons/Skin.h" - #include "interfaces/generic/ScriptInvocationManager.h" -@@ -94,6 +94,7 @@ +@@ -92,6 +94,7 @@ #include "utils/CPUInfo.h" #include "utils/SeekHandler.h" @@ -54898,7 +7333,7 @@ index 78e1253..ef87a89 100644 #include "input/KeyboardLayoutManager.h" #if HAVE_SDL_VERSION == 1 -@@ -112,6 +113,9 @@ +@@ -110,6 +113,9 @@ #ifdef HAS_FILESYSTEM_NFS #include "filesystem/NFSFile.h" #endif @@ -54908,7 +7343,7 @@ index 78e1253..ef87a89 100644 #ifdef HAS_FILESYSTEM_SFTP #include "filesystem/SFTPFile.h" #endif -@@ -217,10 +221,16 @@ +@@ -215,10 +221,16 @@ #include "utils/AMLUtils.h" #endif @@ -54925,7 +7360,7 @@ index 78e1253..ef87a89 100644 using namespace ADDON; using namespace XFILE; -@@ -281,6 +291,7 @@ CApplication::CApplication(void) +@@ -279,6 +291,7 @@ CApplication::CApplication(void) m_bPlaybackStarting = false; m_ePlayState = PLAY_STATE_NONE; m_skinReverting = false; @@ -54933,7 +7368,7 @@ index 78e1253..ef87a89 100644 #ifdef HAS_GLX XInitThreads(); -@@ -333,7 +344,10 @@ bool CApplication::OnEvent(XBMC_Event& newEvent) +@@ -331,7 +344,10 @@ bool CApplication::OnEvent(XBMC_Event& newEvent) { case XBMC_QUIT: if (!g_application.m_bStop) @@ -54944,7 +7379,7 @@ index 78e1253..ef87a89 100644 break; case XBMC_VIDEORESIZE: if (g_windowManager.Initialized() && -@@ -446,6 +460,7 @@ bool CApplication::Create() +@@ -444,6 +460,7 @@ bool CApplication::Create() CApplicationMessenger::GetInstance().RegisterReceiver(this); CApplicationMessenger::GetInstance().RegisterReceiver(&g_playlistPlayer); CApplicationMessenger::GetInstance().RegisterReceiver(&g_infoManager); @@ -54952,7 +7387,7 @@ index 78e1253..ef87a89 100644 for (int i = RES_HDTV_1080i; i <= RES_PAL60_16x9; i++) { -@@ -691,7 +706,7 @@ bool CApplication::Create() +@@ -689,7 +706,7 @@ bool CApplication::Create() return true; } @@ -54961,7 +7396,7 @@ index 78e1253..ef87a89 100644 { m_frameMoveGuard.lock(); -@@ -735,6 +750,8 @@ bool CApplication::CreateGUI() +@@ -733,6 +750,8 @@ bool CApplication::CreateGUI() // Initialize core peripheral port support. Note: If these parameters // are 0 and NULL, respectively, then the default number and types of // controllers will be initialized. @@ -54970,7 +7405,7 @@ index 78e1253..ef87a89 100644 if (!g_Windowing.InitWindowSystem()) { CLog::Log(LOGFATAL, "CApplication::Create: Unable to init windowing system"); -@@ -778,7 +795,7 @@ bool CApplication::CreateGUI() +@@ -776,7 +795,7 @@ bool CApplication::CreateGUI() if (sav_res) CDisplaySettings::GetInstance().SetCurrentResolution(RES_DESKTOP, true); @@ -54979,20 +7414,7 @@ index 78e1253..ef87a89 100644 CSplash::GetInstance().Show(); // The key mappings may already have been loaded by a peripheral -@@ -1066,9 +1083,9 @@ bool CApplication::Initialize() - cdio_loglevel_default = CDIO_LOG_ERROR; - #endif - --#ifdef TARGET_POSIX //! @todo Win32 has no special://home/ mapping by default, so we -- //! must create these here. Ideally this should be using special://home/ and -- //! be platform agnostic (i.e. unify the InitDirectories*() functions) -+#ifdef TARGET_POSIX // TODO: Win32 has no special://home/ mapping by default, so we -+ // must create these here. Ideally this should be using special://home/ and -+ // be platform agnostic (i.e. unify the InitDirectories*() functions) - if (!m_bPlatformDirectories) - #endif - { -@@ -1087,6 +1104,9 @@ bool CApplication::Initialize() +@@ -1085,6 +1104,9 @@ bool CApplication::Initialize() #if !defined(TARGET_DARWIN_IOS) g_peripherals.Initialise(); #endif @@ -55002,19 +7424,7 @@ index 78e1253..ef87a89 100644 // Load curl so curl_global_init gets called before any service threads // are started. Unloading will have no effect as curl is never fully unloaded. -@@ -1155,11 +1175,6 @@ bool CApplication::Initialize() - int firstWindow = g_SkinInfo->GetFirstWindow(); - g_windowManager.ActivateWindow(firstWindow); - -- if (g_windowManager.GetActiveWindowID() == WINDOW_STARTUP_ANIM) -- { -- CLog::Log(LOGWARNING, "CApplication::Initialize - startup.xml taints init process"); -- } -- - // the startup window is considered part of the initialization as it most likely switches to the final window - uiInitializationFinished = firstWindow != WINDOW_STARTUP_ANIM; - -@@ -1192,6 +1207,7 @@ bool CApplication::Initialize() +@@ -1185,6 +1207,7 @@ bool CApplication::Initialize() } m_slowTimer.StartZero(); @@ -55022,21 +7432,7 @@ index 78e1253..ef87a89 100644 CAddonMgr::GetInstance().StartServices(true); -@@ -1894,7 +1910,12 @@ void CApplication::Render() - g_infoManager.UpdateFPS(); - } - -- g_graphicsContext.Flip(hasRendered, m_pPlayer->IsRenderingVideoLayer()); -+ hasRendered &= !g_screen.GetScreenState(); -+ -+ // TODO: find better solution -+ // if video is rendered to a separate layer, we should not block this thread -+ if (!m_pPlayer->IsRenderingVideoLayer() || hasRendered) -+ g_graphicsContext.Flip(hasRendered); - - CTimeUtils::UpdateFrameTime(hasRendered); - } -@@ -2387,6 +2408,10 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg) +@@ -2382,6 +2405,10 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg) #endif break; @@ -55047,7 +7443,7 @@ index 78e1253..ef87a89 100644 case TMSG_INHIBITIDLESHUTDOWN: InhibitIdleShutdown(pMsg->param1 != 0); break; -@@ -2415,6 +2440,11 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg) +@@ -2410,6 +2437,11 @@ void CApplication::OnApplicationMessage(ThreadMessage* pMsg) break; #endif @@ -55059,7 +7455,7 @@ index 78e1253..ef87a89 100644 case TMSG_SETAUDIODSPSTATE: if(pMsg->param1 == ACTIVE_AE_DSP_STATE_ON) CServiceBroker::GetADSP().Activate(); -@@ -2700,13 +2730,19 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) +@@ -2695,13 +2727,19 @@ void CApplication::FrameMove(bool processEvents, bool processGUI) if (processGUI && m_renderGUI) { m_skipGuiRender = false; @@ -55080,55 +7476,7 @@ index 78e1253..ef87a89 100644 #endif unsigned int now = XbmcThreads::SystemClockMillis(); -@@ -3070,11 +3106,11 @@ PlayBackRet CApplication::PlayStack(const CFileItem& item, bool bRestart) - LoadVideoSettings(item); - - // see if we have the info in the database -- //! @todo If user changes the time speed (FPS via framerate conversion stuff) -- //! then these times will be wrong. -- //! Also, this is really just a hack for the slow load up times we have -- //! A much better solution is a fast reader of FPS and fileLength -- //! that we can use on a file to get it's time. -+ // TODO: If user changes the time speed (FPS via framerate conversion stuff) -+ // then these times will be wrong. -+ // Also, this is really just a hack for the slow load up times we have -+ // A much better solution is a fast reader of FPS and fileLength -+ // that we can use on a file to get it's time. - std::vector times; - bool haveTimes(false); - CVideoDatabase dbs; -@@ -3329,7 +3365,7 @@ PlayBackRet CApplication::PlayFile(CFileItem item, const std::string& player, bo - } - else if(m_itemCurrentFile->IsStack() && m_currentStack->Size() > 0) - { -- //! @todo - this will fail if user seeks back to first file in stack -+ // TODO - this will fail if user seeks back to first file in stack - if(m_currentStackPosition == 0 || m_itemCurrentFile->m_lStartOffset == STARTOFFSET_RESUME) - options.fullscreen = g_advancedSettings.m_fullScreenOnMovieStart && !CMediaSettings::GetInstance().DoesVideoStartWindowed(); - else -@@ -3708,8 +3744,8 @@ void CApplication::UpdateFileState() - // Ignore for PVR channels, PerformChannelSwitch takes care of this. - // Also ignore video playlists containing multiple items: video settings have already been saved in PlayFile() - // and we'd overwrite them with settings for the *previous* item. -- //! @todo these "exceptions" should be removed and the whole logic of saving settings be revisited and -- //! possibly moved out of CApplication. See PRs 5842, 5958, http://trac.kodi.tv/ticket/15704#comment:3 -+ // TODO: these "exceptions" should be removed and the whole logic of saving settings be revisited and -+ // possibly moved out of CApplication. See PRs 5842, 5958, http://trac.kodi.tv/ticket/15704#comment:3 - int playlist = g_playlistPlayer.GetCurrentPlaylist(); - if (!m_progressTrackingItem->IsPVRChannel() && !(playlist == PLAYLIST_VIDEO && g_playlistPlayer.GetPlaylist(playlist).size() > 1)) - SaveFileState(); -@@ -3878,8 +3914,8 @@ bool CApplication::WakeUpScreenSaverAndDPMS(bool bPowerOffKeyPressed /* = false - { - if (m_dpmsIsManual) - return false; -- //! @todo if screensaver lock is specified but screensaver is not active -- //! (DPMS came first), activate screensaver now. -+ // TODO: if screensaver lock is specified but screensaver is not active -+ // (DPMS came first), activate screensaver now. - ToggleDPMS(false); - ResetScreenSaverTimer(); - result = !m_bScreenSave || WakeUpScreenSaver(bPowerOffKeyPressed); -@@ -3893,6 +3929,9 @@ bool CApplication::WakeUpScreenSaverAndDPMS(bool bPowerOffKeyPressed /* = false +@@ -3882,6 +3920,9 @@ bool CApplication::WakeUpScreenSaverAndDPMS(bool bPowerOffKeyPressed /* = false CVariant data(CVariant::VariantTypeObject); data["shuttingdown"] = bPowerOffKeyPressed; CAnnouncementManager::GetInstance().Announce(GUI, "xbmc", "OnScreensaverDeactivated", data); @@ -55138,7 +7486,7 @@ index 78e1253..ef87a89 100644 #ifdef TARGET_ANDROID // Screensaver deactivated -> acquire wake lock CXBMCApp::EnableWakeLock(true); -@@ -4388,6 +4427,62 @@ void CApplication::ShowAppMigrationMessage() +@@ -4377,6 +4418,62 @@ void CApplication::ShowAppMigrationMessage() } } @@ -55201,7 +7549,7 @@ index 78e1253..ef87a89 100644 void CApplication::Process() { MEASURE_FUNCTION; -@@ -4433,6 +4528,12 @@ void CApplication::Process() +@@ -4422,6 +4519,12 @@ void CApplication::Process() // update sound m_pPlayer->DoAudioWork(); @@ -55214,7 +7562,7 @@ index 78e1253..ef87a89 100644 // do any processing that isn't needed on each run if( m_slowTimer.GetElapsedMilliseconds() > 500 ) { -@@ -4521,6 +4622,10 @@ void CApplication::ProcessSlow() +@@ -4510,6 +4613,10 @@ void CApplication::ProcessSlow() gNfsConnection.CheckIfIdle(); #endif @@ -55225,7 +7573,7 @@ index 78e1253..ef87a89 100644 #ifdef HAS_FILESYSTEM_SFTP CSFTPSessionManager::ClearOutIdleSessions(); #endif -@@ -5168,7 +5273,11 @@ void CApplication::CloseNetworkShares() +@@ -5158,7 +5265,11 @@ void CApplication::CloseNetworkShares() #ifdef HAS_FILESYSTEM_NFS gNfsConnection.Deinit(); #endif @@ -55239,57 +7587,19 @@ index 78e1253..ef87a89 100644 CSFTPSessionManager::DisconnectAllSessions(); #endif diff --git a/xbmc/Application.h b/xbmc/Application.h -index a43f802..aa1903f 100644 +index fc4f69c..e38712f 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h -@@ -29,11 +29,10 @@ - #include "messaging/IMessageTarget.h" - #include "ServiceManager.h" - --#include - #include - #include - #include --#include -+#include - - class CAction; - class CFileItem; -@@ -53,12 +52,9 @@ namespace MEDIA_DETECT - class CAutorun; - } - --namespace PLAYLIST --{ -- class CPlayList; --} -- - #include "cores/IPlayerCallback.h" -+#include "cores/playercorefactory/PlayerCoreFactory.h" -+#include "PlayListPlayer.h" - #include "settings/lib/ISettingsHandler.h" - #include "settings/lib/ISettingCallback.h" - #include "settings/lib/ISubSettings.h" -@@ -76,7 +72,9 @@ namespace PLAYLIST - #include "threads/Thread.h" - +@@ -74,6 +74,8 @@ namespace MEDIA_DETECT #include "ApplicationPlayer.h" --#include "FileItem.h" -+#include "interfaces/IActionListener.h" -+ -+#include "guilib/Resolution.h" + #include "interfaces/IActionListener.h" ++#include "guilib/Resolution.h" ++ class CSeekHandler; class CInertialScrollingHandler; -@@ -84,7 +82,6 @@ class DPMSSupport; - class CSplash; - class CBookmark; - class CNetwork; --class IActionListener; - - namespace VIDEO - { -@@ -148,7 +145,7 @@ public: + class DPMSSupport; +@@ -143,7 +145,7 @@ public: virtual bool Create() override; virtual bool Cleanup() override; @@ -55298,18 +7608,7 @@ index a43f802..aa1903f 100644 bool InitWindow(RESOLUTION res = RES_INVALID); bool DestroyWindow(); void StartServices(); -@@ -183,8 +180,8 @@ public: - virtual int GetMessageMask() override; - virtual void OnApplicationMessage(KODI::MESSAGING::ThreadMessage* pMsg) override; - -- bool PlayMedia(const CFileItem& item, const std::string &player, int iPlaylist); -- bool PlayMediaSync(const CFileItem& item, int iPlaylist); -+ bool PlayMedia(const CFileItem& item, const std::string &player, int iPlaylist = PLAYLIST_MUSIC); -+ bool PlayMediaSync(const CFileItem& item, int iPlaylist = PLAYLIST_MUSIC); - bool ProcessAndStartPlaylist(const std::string& strPlayList, PLAYLIST::CPlayList& playlist, int iPlaylist, int track=0); - PlayBackRet PlayFile(CFileItem item, const std::string& player, bool bRestart = false); - void SaveFileState(bool bForeground = false); -@@ -407,6 +404,9 @@ public: +@@ -401,6 +403,9 @@ public: */ void UnlockFrameMoveGuard(); @@ -55319,7 +7618,7 @@ index a43f802..aa1903f 100644 protected: virtual bool OnSettingsSaving() const override; -@@ -433,6 +433,9 @@ protected: +@@ -427,6 +432,9 @@ protected: bool m_saveSkinOnUnloading; bool m_autoExecScriptExecuted; @@ -55329,7 +7628,7 @@ index a43f802..aa1903f 100644 #if defined(TARGET_DARWIN_IOS) friend class CWinEventsIOS; #endif -@@ -455,6 +458,7 @@ protected: +@@ -449,6 +457,7 @@ protected: CStopWatch m_frameTime; CStopWatch m_navigationTimer; CStopWatch m_slowTimer; @@ -55337,675 +7636,10 @@ index a43f802..aa1903f 100644 CStopWatch m_shutdownTimer; bool m_bInhibitIdleShutdown; -diff --git a/xbmc/ApplicationPlayer.cpp b/xbmc/ApplicationPlayer.cpp -index f163bcd..576748c 100644 ---- a/xbmc/ApplicationPlayer.cpp -+++ b/xbmc/ApplicationPlayer.cpp -@@ -20,9 +20,7 @@ - - #include "ApplicationPlayer.h" - #include "cores/IPlayer.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "Application.h" --#include "PlayListPlayer.h" - #include "settings/MediaSettings.h" - - CApplicationPlayer::CApplicationPlayer() -diff --git a/xbmc/ApplicationPlayer.h b/xbmc/ApplicationPlayer.h -index 1cde0da..2a887f6 100644 ---- a/xbmc/ApplicationPlayer.h -+++ b/xbmc/ApplicationPlayer.h -@@ -21,12 +21,9 @@ - */ - - #include --#include --#include -- --#include "threads/CriticalSection.h" - #include "threads/SystemClock.h" - #include "guilib/Resolution.h" -+#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "cores/IPlayer.h" - - typedef enum -diff --git a/xbmc/AutoSwitch.cpp b/xbmc/AutoSwitch.cpp -index cd12746..fd5a5d5 100644 ---- a/xbmc/AutoSwitch.cpp -+++ b/xbmc/AutoSwitch.cpp -@@ -48,6 +48,20 @@ int CAutoSwitch::GetView(const CFileItemList &vecItems) - - switch (iCurrentWindow) - { -+ case WINDOW_MUSIC_FILES: -+ { -+ iSortMethod = METHOD_BYFOLDERTHUMBS; -+ iPercent = 50; -+ } -+ break; -+ -+ case WINDOW_VIDEO_FILES: -+ { -+ iSortMethod = METHOD_BYTHUMBPERCENT; -+ iPercent = 50; // 50% of thumbs -> use thumbs. -+ } -+ break; -+ - case WINDOW_PICTURES: - { - iSortMethod = METHOD_BYFILECOUNT; -diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp -index 909284d..fdf739a 100644 ---- a/xbmc/Autorun.cpp -+++ b/xbmc/Autorun.cpp -@@ -29,7 +29,6 @@ - #include "GUIPassword.h" - #include "GUIUserMessages.h" - #include "PlayListPlayer.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "filesystem/StackDirectory.h" - #include "filesystem/Directory.h" - #include "filesystem/DirectoryFactory.h" -@@ -201,7 +200,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde - - // Check if the current foldername indicates a Blu-Ray structure (default is "BDMV"). - // A BR should also include an "AACS" folder for encryption, Sony-BRs can also include update folders for PS3 (PS3_UPDATE / PS3_VPRM). -- //! @todo for the time beeing, the DVD autorun settings are used to determine if the BR should be started automatically. -+ // ToDo: for the time beeing, the DVD autorun settings are used to determine if the BR should be started automatically. - if (StringUtils::EqualsNoCase(name, "BDMV") && bAllowVideo - && (bypassSettings || CSettings::GetInstance().GetBool(CSettings::SETTING_DVDS_AUTORUN))) - { -@@ -222,7 +221,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde - - // Check if the current foldername indicates a HD DVD structure (default is "HVDVD_TS"). - // Most HD DVD will also include an "ADV_OBJ" folder for advanced content. This folder should be handled first. -- //! @todo for the time beeing, the DVD autorun settings are used to determine if the HD DVD should be started automatically. -+ // ToDo: for the time beeing, the DVD autorun settings are used to determine if the HD DVD should be started automatically. - CFileItemList items, sitems; - - // Advanced Content HD DVD (most discs?) -@@ -383,7 +382,7 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde - bPlaying = true; - if (pItem->IsStack()) - { -- //! @todo remove this once the app/player is capable of handling stacks immediately -+ // TODO: remove this once the app/player is capable of handling stacks immediately - CStackDirectory dir; - CFileItemList items; - dir.GetDirectory(pItem->GetURL(), items); -@@ -400,8 +399,9 @@ bool CAutorun::RunDisc(IDirectory* pDir, const std::string& strDrive, int& nAdde - if (!bypassSettings) - return false; - -- if (!g_passwordManager.IsMasterLockUnlocked(true)) -- return false; -+ if (g_windowManager.GetActiveWindow() != WINDOW_VIDEO_FILES) -+ if (!g_passwordManager.IsMasterLockUnlocked(true)) -+ return false; - } - g_playlistPlayer.ClearPlaylist(PLAYLIST_VIDEO); - g_playlistPlayer.Add(PLAYLIST_VIDEO, itemlist); -diff --git a/xbmc/ContextMenuItem.h b/xbmc/ContextMenuItem.h -index 27b4611..4c013b7 100644 ---- a/xbmc/ContextMenuItem.h -+++ b/xbmc/ContextMenuItem.h -@@ -61,7 +61,7 @@ private: - class CContextMenuItem : public IContextMenuItem - { - public: -- std::string GetLabel(const CFileItem& item) const override { return m_label; } -+ std::string GetLabel(const CFileItem& item) const { return m_label; } - bool IsVisible(const CFileItem& item) const override ; - bool IsParentOf(const CContextMenuItem& menuItem) const; - bool IsGroup() const override ; -diff --git a/xbmc/ContextMenuManager.cpp b/xbmc/ContextMenuManager.cpp -index 902ce1d..fc25540 100644 ---- a/xbmc/ContextMenuManager.cpp -+++ b/xbmc/ContextMenuManager.cpp -@@ -128,7 +128,7 @@ bool CContextMenuManager::IsVisible( - ContextMenuView CContextMenuManager::GetItems(const CFileItem& fileItem, const CContextMenuItem& root /*= MAIN*/) const - { - ContextMenuView result; -- //! @todo implement group support -+ //TODO: implement group support - if (&root == &MAIN) - { - CSingleLock lock(m_criticalSection); -diff --git a/xbmc/CueDocument.h b/xbmc/CueDocument.h -index d48c987..838bdd8 100644 ---- a/xbmc/CueDocument.h -+++ b/xbmc/CueDocument.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "music/Song.h" - - #define MAX_PATH_SIZE 1024 -diff --git a/xbmc/DatabaseManager.cpp b/xbmc/DatabaseManager.cpp -index ed0178d..5c13637 100644 ---- a/xbmc/DatabaseManager.cpp -+++ b/xbmc/DatabaseManager.cpp -@@ -28,7 +28,7 @@ - #include "pvr/PVRDatabase.h" - #include "epg/EpgDatabase.h" - #include "settings/AdvancedSettings.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - - using namespace EPG; - using namespace PVR; -diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in -index a4d4530..3bbab08 100644 ---- a/xbmc/DllPaths_generated.h.in -+++ b/xbmc/DllPaths_generated.h.in -@@ -28,8 +28,10 @@ - #define DLL_PATH_CPLUFF "special://xbmcbin/system/libcpluff-@ARCH@.so" - #define DLL_PATH_LIBEXIF "special://xbmcbin/system/libexif-@ARCH@.so" - -+#define DLL_PATH_LIBRTMP "@RTMP_SONAME@" - #define DLL_PATH_LIBNFS "@NFS_SONAME@" - -+#define DLL_PATH_LIBAFP "@AFPCLIENT_SONAME@" - #define DLL_PATH_LIBPLIST "@PLIST_SONAME@" - #define DLL_PATH_LIBSHAIRPLAY "@SHAIRPLAY_SONAME@" - #define DLL_PATH_LIBCEC "@LIBCEC_SONAME@" -diff --git a/xbmc/DllPaths_generated_android.h.in b/xbmc/DllPaths_generated_android.h.in -index e05b984..e1e0136 100644 ---- a/xbmc/DllPaths_generated_android.h.in -+++ b/xbmc/DllPaths_generated_android.h.in -@@ -30,7 +30,9 @@ - #define DLL_PATH_CPLUFF "libcpluff-@ARCH@.so" - #define DLL_PATH_LIBEXIF "libexif-@ARCH@.so" - -+#define DLL_PATH_LIBRTMP "@RTMP_SONAME@" - #define DLL_PATH_LIBNFS "@NFS_SONAME@" -+#define DLL_PATH_LIBAFP "@AFPCLIENT_SONAME@" - #define DLL_PATH_LIBPLIST "@PLIST_SONAME@" - #define DLL_PATH_LIBSHAIRPLAY "@SHAIRPLAY_SONAME@" - #define DLL_PATH_LIBCEC "@LIBCEC_SONAME@" -diff --git a/xbmc/DllPaths_win32.h b/xbmc/DllPaths_win32.h -index 3748589..ec3c346 100644 ---- a/xbmc/DllPaths_win32.h -+++ b/xbmc/DllPaths_win32.h -@@ -33,6 +33,7 @@ - /* VideoPlayer */ - #define DLL_PATH_LIBASS "special://xbmcbin/system/players/dvdplayer/libass.dll" - #define DLL_PATH_LIBDVDNAV "special://xbmcbin/system/players/VideoPlayer/libdvdnav.dll" -+#define DLL_PATH_LIBRTMP "special://xbmcbin/system/players/dvdplayer/librtmp.dll" - - /* libbluray */ - #define DLL_PATH_LIBBLURAY "special://xbmcbin/system/players/dvdplayer/libbluray.dll" -diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp -index 3cd0932..a3a5b91 100644 ---- a/xbmc/FileItem.cpp -+++ b/xbmc/FileItem.cpp -@@ -58,7 +58,6 @@ - #include "utils/log.h" - #include "utils/Variant.h" - #include "utils/Mime.h" --#include "utils/Random.h" - - #include - #include -@@ -1066,6 +1065,11 @@ bool CFileItem::IsNfs() const - return URIUtils::IsNfs(m_strPath); - } - -+bool CFileItem::IsAfp() const -+{ -+ return URIUtils::IsAfp(m_strPath); -+} -+ - bool CFileItem::IsOnLAN() const - { - return URIUtils::IsOnLAN(m_strPath); -@@ -1312,7 +1316,7 @@ bool CFileItem::IsParentFolder() const - - void CFileItem::FillInMimeType(bool lookup /*= true*/) - { -- //! @todo adapt this to use CMime::GetMimeType() -+ // TODO: adapt this to use CMime::GetMimeType() - if (m_mimetype.empty()) - { - if( m_bIsFolder ) -@@ -1422,8 +1426,7 @@ bool CFileItem::IsAlbum() const - void CFileItem::UpdateInfo(const CFileItem &item, bool replaceLabels /*=true*/) - { - if (item.HasVideoInfoTag()) -- { // copy info across -- //! @todo premiered info is normally stored in m_dateTime by the db -+ { // copy info across (TODO: premiered info is normally stored in m_dateTime by the db) - *GetVideoInfoTag() = *item.GetVideoInfoTag(); - // preferably use some information from PVR info tag if available - if (m_pvrRecordingInfoTag) -@@ -1561,13 +1564,13 @@ std::string CFileItem::GetOpticalMediaPath() const - return dvdPath; - } - --/** --* @todo Ideally this (and SetPath) would not be available outside of construction --* for CFileItem objects, or at least restricted to essentially be equivalent --* to construction. This would require re-formulating a bunch of CFileItem --* construction, and also allowing CFileItemList to have it's own (public) --* SetURL() function, so for now we give direct access. --*/ -+/* -+ TODO: Ideally this (and SetPath) would not be available outside of construction -+ for CFileItem objects, or at least restricted to essentially be equivalent -+ to construction. This would require re-formulating a bunch of CFileItem -+ construction, and also allowing CFileItemList to have it's own (public) -+ SetURL() function, so for now we give direct access. -+ */ - void CFileItem::SetURL(const CURL& url) - { - m_strPath = url.Get(); -@@ -2087,7 +2090,7 @@ void CFileItemList::Sort(SortDescription sortDescription) - void CFileItemList::Randomize() - { - CSingleLock lock(m_lock); -- KODI::UTILS::RandomShuffle(m_items.begin(), m_items.end()); -+ std::random_shuffle(m_items.begin(), m_items.end()); - } - - void CFileItemList::Archive(CArchive& ar) -@@ -2434,6 +2437,7 @@ void CFileItemList::StackFolders() - if( !item->IsRemote() - || item->IsSmb() - || item->IsNfs() -+ || item->IsAfp() - || URIUtils::IsInRAR(item->GetPath()) - || URIUtils::IsInZIP(item->GetPath()) - || URIUtils::IsOnLAN(item->GetPath()) -diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h -index 252f6c3..0b69f50 100644 ---- a/xbmc/FileItem.h -+++ b/xbmc/FileItem.h -@@ -204,6 +204,7 @@ public: - bool IsOnLAN() const; - bool IsHD() const; - bool IsNfs() const; -+ bool IsAfp() const; - bool IsRemote() const; - bool IsSmb() const; - bool IsURL() const; -diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp -index 4409dae..397401a 100644 ---- a/xbmc/GUIInfoManager.cpp -+++ b/xbmc/GUIInfoManager.cpp -@@ -44,7 +44,6 @@ - #include "music/tags/MusicInfoTag.h" - #include "guilib/IGUIContainer.h" - #include "guilib/GUIWindowManager.h" --#include "PlayListPlayer.h" - #include "playlists/PlayList.h" - #include "profiles/ProfilesManager.h" - #include "windowing/WindowingFactory.h" -@@ -95,7 +94,7 @@ - #include "music/MusicThumbLoader.h" - #include "video/VideoDatabase.h" - #include "cores/IPlayer.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h" - #include "cores/AudioEngine/Utils/AEUtil.h" - #include "cores/VideoPlayer/VideoRenderers/BaseRenderer.h" - #include "interfaces/info/InfoExpression.h" -@@ -3631,11 +3630,6 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, - /// _string_, - /// Todo - /// } --// \table_row3{ `ListItem.AddonOrigin`, --/// \anchor ListItem_AddonOrigin --/// _string_, --/// Name of the repository the add-on originates from. --/// } - /// \table_end - /// - /// ----------------------------------------------------------------------------- -@@ -3809,14 +3803,12 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB }, - { "addonsummary", LISTITEM_ADDON_SUMMARY }, - { "addondescription", LISTITEM_ADDON_DESCRIPTION }, - { "addondisclaimer", LISTITEM_ADDON_DISCLAIMER }, -- { "addonnews", LISTITEM_ADDON_NEWS }, - { "addonbroken", LISTITEM_ADDON_BROKEN }, - { "addontype", LISTITEM_ADDON_TYPE }, - { "addoninstalldate", LISTITEM_ADDON_INSTALL_DATE }, - { "addonlastupdated", LISTITEM_ADDON_LAST_UPDATED }, - { "addonlastused", LISTITEM_ADDON_LAST_USED }, -- { "addonorigin", LISTITEM_ADDON_ORIGIN }, -- { "addonsize", LISTITEM_ADDON_SIZE }, -+ - }; - - /// \page modules__General__List_of_gui_access -@@ -5268,7 +5260,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - else if (cat.name == "library") - { - if (prop.name == "isscanning") return LIBRARY_IS_SCANNING; -- else if (prop.name == "isscanningvideo") return LIBRARY_IS_SCANNING_VIDEO; //! @todo change to IsScanning(Video) -+ else if (prop.name == "isscanningvideo") return LIBRARY_IS_SCANNING_VIDEO; // TODO: change to IsScanning(Video) - else if (prop.name == "isscanningmusic") return LIBRARY_IS_SCANNING_MUSIC; - else if (prop.name == "hascontent" && prop.num_params()) - { -@@ -5288,7 +5280,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - } - else if (cat.name == "musicplayer") - { -- for (size_t i = 0; i < sizeof(player_times) / sizeof(infomap); i++) //! @todo remove these, they're repeats -+ for (size_t i = 0; i < sizeof(player_times) / sizeof(infomap); i++) // TODO: remove these, they're repeats - { - if (prop.name == player_times[i].str) - return AddMultiInfo(GUIInfo(player_times[i].val, TranslateTimeFormat(prop.param()))); -@@ -5306,7 +5298,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - } - else if (cat.name == "videoplayer") - { -- for (size_t i = 0; i < sizeof(player_times) / sizeof(infomap); i++) //! @todo remove these, they're repeats -+ for (size_t i = 0; i < sizeof(player_times) / sizeof(infomap); i++) // TODO: remove these, they're repeats - { - if (prop.name == player_times[i].str) - return AddMultiInfo(GUIInfo(player_times[i].val, TranslateTimeFormat(prop.param()))); -@@ -5422,7 +5414,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - else if (cat.name == "window") - { - if (prop.name == "property" && prop.num_params() == 1) -- { //! @todo this doesn't support foo.xml -+ { // TODO: this doesn't support foo.xml - int winID = cat.param().empty() ? 0 : CButtonTranslator::TranslateWindow(cat.param()); - if (winID != WINDOW_INVALID) - return AddMultiInfo(GUIInfo(WINDOW_PROPERTY, winID, ConditionalStringParameter(prop.param()))); -@@ -5430,7 +5422,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - for (size_t i = 0; i < sizeof(window_bools) / sizeof(infomap); i++) - { - if (prop.name == window_bools[i].str) -- { //! @todo The parameter for these should really be on the first not the second property -+ { // TODO: The parameter for these should really be on the first not the second property - if (prop.param().find("xml") != std::string::npos) - return AddMultiInfo(GUIInfo(window_bools[i].val, 0, ConditionalStringParameter(prop.param()))); - int winID = prop.param().empty() ? WINDOW_INVALID : CButtonTranslator::TranslateWindow(prop.param()); -@@ -5443,7 +5435,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - for (size_t i = 0; i < sizeof(control_labels) / sizeof(infomap); i++) - { - if (prop.name == control_labels[i].str) -- { //! @todo The parameter for these should really be on the first not the second property -+ { // TODO: The parameter for these should really be on the first not the second property - int controlID = atoi(prop.param().c_str()); - if (controlID) - return AddMultiInfo(GUIInfo(control_labels[i].val, controlID, 0)); -@@ -5516,7 +5508,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - else if (info.size() == 3 || info.size() == 4) - { - if (info[0].name == "system" && info[1].name == "platform") -- { //! @todo replace with a single system.platform -+ { // TODO: replace with a single system.platform - std::string platform = info[2].name; - if (platform == "linux") - { -@@ -5534,7 +5526,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - else if (platform == "android") return SYSTEM_PLATFORM_ANDROID; - } - if (info[0].name == "musicplayer") -- { //! @todo these two don't allow duration(foo) and also don't allow more than this number of levels... -+ { // TODO: these two don't allow duration(foo) and also don't allow more than this number of levels... - if (info[1].name == "position") - { - int position = atoi(info[1].param().c_str()); -@@ -5579,7 +5571,7 @@ int CGUIInfoManager::TranslateSingleString(const std::string &strCondition, bool - for (size_t i = 0; i < sizeof(control_labels) / sizeof(infomap); i++) - { - if (prop.name == control_labels[i].str) -- { //! @todo The parameter for these should really be on the first not the second property -+ { // TODO: The parameter for these should really be on the first not the second property - int controlID = atoi(prop.param().c_str()); - if (controlID) - return AddMultiInfo(GUIInfo(control_labels[i].val, controlID, atoi(info[2].param(0).c_str()))); -@@ -8654,8 +8646,8 @@ std::string CGUIInfoManager::GetVideoLabel(int item) - case VIDEOPLAYER_YEAR: - { - std::string strYear; -- if (m_currentFile->GetVideoInfoTag()->HasYear()) -- strYear = StringUtils::Format("%i", m_currentFile->GetVideoInfoTag()->GetYear()); -+ if (m_currentFile->GetVideoInfoTag()->m_iYear > 0) -+ strYear = StringUtils::Format("%i", m_currentFile->GetVideoInfoTag()->m_iYear); - return strYear; - } - break; -@@ -8664,8 +8656,8 @@ std::string CGUIInfoManager::GetVideoLabel(int item) - CDateTime dateTime; - if (m_currentFile->GetVideoInfoTag()->m_firstAired.IsValid()) - dateTime = m_currentFile->GetVideoInfoTag()->m_firstAired; -- else if (m_currentFile->GetVideoInfoTag()->HasPremiered()) -- dateTime = m_currentFile->GetVideoInfoTag()->GetPremiered(); -+ else if (m_currentFile->GetVideoInfoTag()->m_premiered.IsValid()) -+ dateTime = m_currentFile->GetVideoInfoTag()->m_premiered; - - if (dateTime.IsValid()) - return dateTime.GetAsLocalizedDate(); -@@ -9403,8 +9395,8 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std:: - case LISTITEM_YEAR: - { - std::string year; -- if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->HasYear()) -- year = StringUtils::Format("%i", item->GetVideoInfoTag()->GetYear()); -+ if (item->HasVideoInfoTag() && item->GetVideoInfoTag()->m_iYear > 0) -+ year = StringUtils::Format("%i", item->GetVideoInfoTag()->m_iYear); - if (item->HasMusicInfoTag()) - year = item->GetMusicInfoTag()->GetYearString(); - if (item->HasEPGInfoTag() && item->GetEPGInfoTag()->Year() > 0) -@@ -9415,8 +9407,8 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std:: - if (tag && tag->Year() > 0) - year = StringUtils::Format("%i", tag->Year()); - } -- if (item->HasPVRRecordingInfoTag() && item->GetPVRRecordingInfoTag()->HasYear()) -- year = StringUtils::Format("%i", item->GetPVRRecordingInfoTag()->GetYear()); -+ if (item->HasPVRRecordingInfoTag() && item->GetPVRRecordingInfoTag()->m_iYear > 0) -+ year = StringUtils::Format("%i", item->GetPVRRecordingInfoTag()->m_iYear); - return year; - } - case LISTITEM_PREMIERED: -@@ -9425,8 +9417,8 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std:: - CDateTime dateTime; - if (item->GetVideoInfoTag()->m_firstAired.IsValid()) - dateTime = item->GetVideoInfoTag()->m_firstAired; -- else if (item->GetVideoInfoTag()->HasPremiered()) -- dateTime = item->GetVideoInfoTag()->GetPremiered(); -+ else if (item->GetVideoInfoTag()->m_premiered.IsValid()) -+ dateTime = item->GetVideoInfoTag()->m_premiered; - - if (dateTime.IsValid()) - return dateTime.GetAsLocalizedDate(); -@@ -9937,8 +9929,6 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std:: - return item->GetEPGInfoTag()->EndAsLocalTime().GetAsLocalizedTime("", false); - else if (item->HasPVRTimerInfoTag()) - return item->GetPVRTimerInfoTag()->EndAsLocalTime().GetAsLocalizedTime("", false); -- else if (item->HasPVRRecordingInfoTag()) -- return (item->GetPVRRecordingInfoTag()->RecordingTimeAsLocalTime() + CDateTimeSpan(0, 0, 0, item->GetPVRRecordingInfoTag()->GetDuration())).GetAsLocalizedTime("", false); - else if (item->HasVideoInfoTag()) - { - CDateTimeSpan duration(0, 0, 0, item->GetVideoInfoTag()->GetDuration()); -@@ -10206,10 +10196,6 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std:: - if (item->HasAddonInfo()) - return item->GetAddonInfo()->Disclaimer(); - break; -- case LISTITEM_ADDON_NEWS: -- if (item->HasAddonInfo()) -- return item->GetAddonInfo()->ChangeLog(); -- break; - case LISTITEM_ADDON_BROKEN: - if (item->HasAddonInfo()) - { -@@ -10234,21 +10220,6 @@ std::string CGUIInfoManager::GetItemLabel(const CFileItem *item, int info, std:: - if (item->HasAddonInfo() && item->GetAddonInfo()->LastUsed().IsValid()) - return item->GetAddonInfo()->LastUsed().GetAsLocalizedDateTime(); - break; -- case LISTITEM_ADDON_ORIGIN: -- if (item->HasAddonInfo()) -- { -- if (item->GetAddonInfo()->Origin() == ORIGIN_SYSTEM) -- return g_localizeStrings.Get(24992); -- AddonPtr origin; -- if (CAddonMgr::GetInstance().GetAddon(item->GetAddonInfo()->Origin(), origin, ADDON_UNKNOWN, false)) -- return origin->Name(); -- return g_localizeStrings.Get(13205); -- } -- break; -- case LISTITEM_ADDON_SIZE: -- if (item->HasAddonInfo() && item->GetAddonInfo()->PackageSize() > 0) -- return StringUtils::FormatFileSize(item->GetAddonInfo()->PackageSize()); -- break; - } - - return ""; -diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h -index 1d08e8d..c2deb97 100644 ---- a/xbmc/GUIInfoManager.h -+++ b/xbmc/GUIInfoManager.h -@@ -40,7 +40,6 @@ - - #include - #include --#include - - namespace MUSIC_INFO - { -diff --git a/xbmc/GUILargeTextureManager.h b/xbmc/GUILargeTextureManager.h -index 87ba927..cc6cb3e 100644 ---- a/xbmc/GUILargeTextureManager.h -+++ b/xbmc/GUILargeTextureManager.h -@@ -21,7 +21,6 @@ - */ - - #include --#include - - #include "guilib/TextureManager.h" - #include "threads/CriticalSection.h" -diff --git a/xbmc/GUIPassword.cpp b/xbmc/GUIPassword.cpp -index 2c6de48..bec47d7 100644 ---- a/xbmc/GUIPassword.cpp -+++ b/xbmc/GUIPassword.cpp -@@ -373,13 +373,21 @@ bool CGUIPassword::CheckMenuLock(int iWindowID) - iSwitch = WINDOW_SETTINGS_MENU; - } - -+ if (iWindowID == WINDOW_MUSIC_FILES) -+ if (g_windowManager.GetActiveWindow() == WINDOW_MUSIC_NAV) -+ iSwitch = WINDOW_HOME; -+ - if (iWindowID == WINDOW_MUSIC_NAV) - if (g_windowManager.GetActiveWindow() == WINDOW_HOME) -- iSwitch = WINDOW_MUSIC_NAV; -+ iSwitch = WINDOW_MUSIC_FILES; - - if (iWindowID == WINDOW_VIDEO_NAV) - if (g_windowManager.GetActiveWindow() == WINDOW_HOME) -- iSwitch = WINDOW_VIDEO_NAV; -+ iSwitch = WINDOW_VIDEO_FILES; -+ -+ if (iWindowID == WINDOW_VIDEO_FILES) -+ if (g_windowManager.GetActiveWindow() == WINDOW_VIDEO_NAV) -+ iSwitch = WINDOW_HOME; - - switch (iSwitch) - { -@@ -395,10 +403,10 @@ bool CGUIPassword::CheckMenuLock(int iWindowID) - case WINDOW_PROGRAMS: // Programs - bCheckPW = CProfilesManager::GetInstance().GetCurrentProfile().programsLocked(); - break; -- case WINDOW_MUSIC_NAV: // Music -+ case WINDOW_MUSIC_FILES: // Music - bCheckPW = CProfilesManager::GetInstance().GetCurrentProfile().musicLocked(); - break; -- case WINDOW_VIDEO_NAV: // Video -+ case WINDOW_VIDEO_FILES: // Video - bCheckPW = CProfilesManager::GetInstance().GetCurrentProfile().videoLocked(); - break; - case WINDOW_PICTURES: // Pictures -diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp -index 63112f5..f049188 100644 ---- a/xbmc/LangInfo.cpp -+++ b/xbmc/LangInfo.cpp -@@ -310,7 +310,7 @@ void CLangInfo::CRegion::SetGlobalLocale() - strLocale = "C"; - } - -- g_langInfo.m_systemLocale = current_locale; //! @todo move to CLangInfo class -+ g_langInfo.m_systemLocale = current_locale; // TODO: move to CLangInfo class - std::locale::global(current_locale); - #endif - g_charsetConverter.resetSystemCharset(); -@@ -667,20 +667,7 @@ bool CLangInfo::SetLanguage(bool& fallback, const std::string &strLanguage /* = - } - } - -- LanguageResourcePtr languageAddon; -- { -- std::string addonId = ADDON::CLanguageResource::GetAddonId(language); -- if (addonId.empty()) -- addonId = CSettings::GetInstance().GetString(CSettings::SETTING_LOCALE_LANGUAGE); -- -- ADDON::AddonPtr addon; -- if (ADDON::CAddonMgr::GetInstance().GetAddon(addonId, addon, ADDON::ADDON_RESOURCE_LANGUAGE, false)) -- { -- languageAddon = std::static_pointer_cast(addon); -- ADDON::CAddonMgr::GetInstance().EnableAddon(languageAddon->ID()); -- } -- } -- -+ LanguageResourcePtr languageAddon = GetLanguageAddon(language); - if (languageAddon == NULL) - { - CLog::Log(LOGWARNING, "CLangInfo: unable to load language \"%s\". Trying to determine matching language addon...", language.c_str()); -diff --git a/xbmc/PartyModeManager.cpp b/xbmc/PartyModeManager.cpp -index 8ec533f..9c9ce90 100644 ---- a/xbmc/PartyModeManager.cpp -+++ b/xbmc/PartyModeManager.cpp -@@ -36,7 +36,6 @@ - #include "profiles/ProfilesManager.h" - #include "threads/SystemClock.h" - #include "utils/log.h" --#include "utils/Random.h" - #include "utils/StringUtils.h" - #include "utils/Variant.h" - #include "video/VideoDatabase.h" -@@ -645,7 +644,7 @@ bool CPartyModeManager::AddInitialSongs(std::vector< std::pair > &song - { - CFileItemPtr item(items[i]); - Add(item); -- //! @todo Allow "relaxed restrictions" later? -+ // TODO: Allow "relaxed restrictions" later? - } - } - return true; -@@ -694,7 +693,7 @@ void CPartyModeManager::AddToHistory(int type, int songID) - void CPartyModeManager::GetRandomSelection(std::vector< std::pair >& in, unsigned int number, std::vector< std::pair >& out) - { - number = std::min(number, (unsigned int)in.size()); -- KODI::UTILS::RandomShuffle(in.begin(), in.end()); -+ std::random_shuffle(in.begin(), in.end()); - out.assign(in.begin(), in.begin() + number); - } - diff --git a/xbmc/PlayListPlayer.cpp b/xbmc/PlayListPlayer.cpp -index 577409c..3e5e4c2 100644 +index d65087b..3e5e4c2 100644 --- a/xbmc/PlayListPlayer.cpp +++ b/xbmc/PlayListPlayer.cpp -@@ -335,9 +335,9 @@ bool CPlayListPlayer::Play(int iSong, std::string player, bool bAutoPlay /* = fa - if (item->m_lStartOffset == STARTOFFSET_RESUME) - item->m_lStartOffset = 0; - -- //! @todo - move the above failure logic and the below success logic -- //! to callbacks instead so we don't rely on the return value -- //! of PlayFile() -+ // TODO - move the above failure logic and the below success logic -+ // to callbacks instead so we don't rely on the return value -+ // of PlayFile() - - // consecutive error counter so reset if the current item is playing - m_iFailedSongs = 0; @@ -904,7 +904,6 @@ void PLAYLIST::CPlayListPlayer::OnApplicationMessage(KODI::MESSAGING::ThreadMess g_windowManager.PreviousWindow(); @@ -56030,136 +7664,11 @@ index 577409c..3e5e4c2 100644 g_application.m_pPlayer->Pause(); } break; -diff --git a/xbmc/ServiceManager.cpp b/xbmc/ServiceManager.cpp -index 3cc188c..be05791 100644 ---- a/xbmc/ServiceManager.cpp -+++ b/xbmc/ServiceManager.cpp -@@ -19,13 +19,10 @@ - */ - - #include "ServiceManager.h" --#include "addons/BinaryAddonCache.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "utils/log.h" - #include "interfaces/AnnouncementManager.h" - #include "interfaces/generic/ScriptInvocationManager.h" --#include "interfaces/python/XBPython.h" --#include "pvr/PVRManager.h" - - bool CServiceManager::Init1() - { -diff --git a/xbmc/ServiceManager.h b/xbmc/ServiceManager.h -index 9b7806f..cdb8399 100644 ---- a/xbmc/ServiceManager.h -+++ b/xbmc/ServiceManager.h -@@ -20,6 +20,10 @@ - - #pragma once - -+#include "addons/AddonManager.h" -+#include "addons/BinaryAddonCache.h" -+#include "interfaces/python/XBPython.h" -+#include "pvr/PVRManager.h" - #include - - namespace ADDON { -@@ -41,8 +45,6 @@ namespace PVR - class CPVRManager; - } - --class XBPython; -- - class CServiceManager - { - public: -diff --git a/xbmc/TextureCache.cpp b/xbmc/TextureCache.cpp -index bcd16c0..159310b 100644 ---- a/xbmc/TextureCache.cpp -+++ b/xbmc/TextureCache.cpp -@@ -168,7 +168,7 @@ bool CTextureCache::CacheImage(const std::string &image, CTextureDetails &detail - - void CTextureCache::ClearCachedImage(const std::string &url, bool deleteSource /*= false */) - { -- //! @todo This can be removed when the texture cache covers everything. -+ // TODO: This can be removed when the texture cache covers everything. - std::string path = deleteSource ? url : ""; - std::string cachedFile; - if (ClearCachedTexture(url, cachedFile)) -diff --git a/xbmc/TextureCache.h b/xbmc/TextureCache.h -index 696a64b..b4f07cd 100644 ---- a/xbmc/TextureCache.h -+++ b/xbmc/TextureCache.h -@@ -154,7 +154,7 @@ public: - \return true if we successfully exported the file, false otherwise. - */ - bool Export(const std::string &image, const std::string &destination, bool overwrite); -- bool Export(const std::string &image, const std::string &destination); //! @todo BACKWARD COMPATIBILITY FOR MUSIC THUMBS -+ bool Export(const std::string &image, const std::string &destination); // TODO: BACKWARD COMPATIBILITY FOR MUSIC THUMBS - private: - // private construction, and no assignements; use the provided singleton methods - CTextureCache(); -diff --git a/xbmc/TextureDatabase.cpp b/xbmc/TextureDatabase.cpp -index 9608243..db372e9 100644 ---- a/xbmc/TextureDatabase.cpp -+++ b/xbmc/TextureDatabase.cpp -@@ -183,7 +183,7 @@ void CTextureDatabase::CreateAnalytics() - m_pDS->exec("CREATE INDEX idxTexture ON texture(url)"); - m_pDS->exec("CREATE INDEX idxSize ON sizes(idtexture, size)"); - m_pDS->exec("CREATE INDEX idxSize2 ON sizes(idtexture, width, height)"); -- //! @todo Should the path index be a covering index? (we need only retrieve texture) -+ // TODO: Should the path index be a covering index? (we need only retrieve texture) - m_pDS->exec("CREATE INDEX idxPath ON path(url, type)"); - - CLog::Log(LOGINFO, "%s creating triggers", __FUNCTION__); -diff --git a/xbmc/TextureDatabase.h b/xbmc/TextureDatabase.h -index 9df9ca1..75676e4 100644 ---- a/xbmc/TextureDatabase.h -+++ b/xbmc/TextureDatabase.h -@@ -20,9 +20,6 @@ - - #pragma once - --#include --#include -- - #include "dbwrappers/Database.h" - #include "TextureCacheJob.h" - #include "dbwrappers/DatabaseQuery.h" -diff --git a/xbmc/ThumbnailCache.cpp b/xbmc/ThumbnailCache.cpp -index 6e60e06..9e3ff02 100644 ---- a/xbmc/ThumbnailCache.cpp -+++ b/xbmc/ThumbnailCache.cpp -@@ -23,6 +23,7 @@ - #include "threads/SingleLock.h" - - #include "FileItem.h" -+#include "video/VideoDatabase.h" - - using namespace XFILE; - using namespace MUSIC_INFO; diff --git a/xbmc/URL.cpp b/xbmc/URL.cpp -index cc734ad..a53b035 100644 +index 2349a80..a53b035 100644 --- a/xbmc/URL.cpp +++ b/xbmc/URL.cpp -@@ -152,6 +152,7 @@ void CURL::Parse(const std::string& strURL1) - IsProtocol("stack") || - IsProtocol("virtualpath") || - IsProtocol("multipath") || -+ IsProtocol("filereader") || - IsProtocol("special") || - IsProtocol("resource") - ) -@@ -179,7 +180,7 @@ void CURL::Parse(const std::string& strURL1) - size_t iEnd = strURL.length(); - const char* sep = NULL; - -- //! @todo fix all Addon paths -+ //TODO fix all Addon paths - std::string strProtocol2 = GetTranslatedProtocol(); - if(IsProtocol("rss") || - IsProtocol("rar") || -@@ -291,6 +292,8 @@ void CURL::Parse(const std::string& strURL1) +@@ -292,6 +292,8 @@ void CURL::Parse(const std::string& strURL1) if (m_strHostName.empty()) m_strHostName = strHostNameAndPort; @@ -56168,17 +7677,8 @@ index cc734ad..a53b035 100644 if (iSlash != std::string::npos) { iPos = iSlash + 1; -@@ -791,7 +794,7 @@ std::string CURL::Encode(const std::string& strURLData) - const char kar = strURLData[i]; - - // Don't URL encode "-_.!()" according to RFC1738 -- //! @todo Update it to "-_.~" after Gotham according to RFC3986 -+ // TODO: Update it to "-_.~" after Gotham according to RFC3986 - if (StringUtils::isasciialphanum(kar) || kar == '-' || kar == '.' || kar == '_' || kar == '!' || kar == '(' || kar == ')') - strResult.push_back(kar); - else diff --git a/xbmc/Util.cpp b/xbmc/Util.cpp -index b0de1c8..9996881 100644 +index 148bc09..9996881 100644 --- a/xbmc/Util.cpp +++ b/xbmc/Util.cpp @@ -793,8 +793,8 @@ bool CUtil::CreateDirectoryEx(const std::string& strPath) @@ -56221,15 +7721,6 @@ index b0de1c8..9996881 100644 if (URIUtils::IsDAV(strPath)) return true; if (URIUtils::IsStack(strPath)) -@@ -1463,7 +1465,7 @@ bool CUtil::RunCommandLine(const std::string& cmdLine, bool waitExit) - // Strip quotes and whitespace around the arguments, or exec will fail. - // This allows the python invocation to be written more naturally with any amount of whitespace around the args. - // But it's still limited, for example quotes inside the strings are not expanded, etc. -- //! @todo Maybe some python library routine can parse this more properly ? -+ // TODO: Maybe some python library routine can parse this more properly ? - for (std::vector::iterator it = args.begin(); it != args.end(); ++it) - { - size_t pos; @@ -1886,7 +1888,7 @@ void CUtil::ScanForExternalSubtitles(const std::string& strMovie, std::vector(localAddon)); - - //Fallback to the pre-install callback in the addon. -- //! @bug If primary extension point have changed we're calling the wrong method. -+ //BUG: If primary extension point have changed we're calling the wrong method. - addon->OnPreInstall(); - } - -diff --git a/xbmc/addons/Addon.h b/xbmc/addons/Addon.h -index acc489b..2f00e04 100644 ---- a/xbmc/addons/Addon.h -+++ b/xbmc/addons/Addon.h -@@ -38,8 +38,6 @@ namespace ADDON - typedef std::vector VECADDONS; - typedef std::vector::iterator IVECADDONS; - -- const char* const ORIGIN_SYSTEM = "b6a50484-93a0-4afb-a01c-8d17e059feda"; -- - // utils - std::string TranslateType(TYPE type, bool pretty=false); - std::string GetIcon(TYPE type); -@@ -56,8 +54,8 @@ void OnPostUnInstall(const AddonPtr& addon); - class AddonProps - { - public: -- AddonProps() : type(ADDON_UNKNOWN), packageSize(0) {}; -- AddonProps(std::string id, TYPE type) : id(std::move(id)), type(type), packageSize(0) {} -+ AddonProps() : type(ADDON_UNKNOWN) {}; -+ AddonProps(std::string id, TYPE type) : id(std::move(id)), type(type) {} - - std::string id; - TYPE type; -@@ -70,10 +68,10 @@ public: - std::string libname; - std::string author; - std::string source; -- //! @todo fix parts relying on mutating these -+ //TODO: fix parts relying on mutating these - mutable std::string path; - mutable std::string icon; -- std::string changelog; -+ mutable std::string changelog; - mutable std::string fanart; - std::string disclaimer; - ADDONDEPS dependencies; -@@ -82,8 +80,6 @@ public: - CDateTime installDate; - CDateTime lastUpdated; - CDateTime lastUsed; -- std::string origin; -- uint64_t packageSize; - }; - - -@@ -116,8 +112,6 @@ public: - CDateTime InstallDate() const override { return m_props.installDate; } - CDateTime LastUpdated() const override { return m_props.lastUpdated; } - CDateTime LastUsed() const override { return m_props.lastUsed; } -- std::string Origin() const override { return m_props.origin; } -- uint64_t PackageSize() const override { return m_props.packageSize; } - const InfoMap& ExtraInfo() const override { return m_props.extrainfo; } - const ADDONDEPS& GetDeps() const override { return m_props.dependencies; } - -diff --git a/xbmc/addons/AddonBuilder.cpp b/xbmc/addons/AddonBuilder.cpp -index 835b439..347153f 100644 ---- a/xbmc/addons/AddonBuilder.cpp -+++ b/xbmc/addons/AddonBuilder.cpp -@@ -27,14 +27,13 @@ - #include "addons/LanguageResource.h" - #include "addons/PluginSource.h" - #include "addons/Repository.h" --#include "addons/Scraper.h" - #include "addons/ScreenSaver.h" - #include "addons/Service.h" - #include "addons/Skin.h" - #include "addons/UISoundsResource.h" - #include "addons/Visualisation.h" - #include "addons/Webinterface.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.h" - #include "games/controllers/Controller.h" - #include "peripherals/addons/PeripheralAddon.h" - #include "addons/PVRClient.h" -@@ -214,7 +213,7 @@ AddonPtr CAddonBuilder::FromProps(AddonProps addonProps) - case ADDON_INPUTSTREAM: - return AddonPtr(new CInputStream(std::move(addonProps))); - case ADDON_PERIPHERALDLL: -- return AddonPtr(new PERIPHERALS::CPeripheralAddon(std::move(addonProps), false, false)); //! @todo implement -+ return AddonPtr(new PERIPHERALS::CPeripheralAddon(std::move(addonProps), false, false)); // TODO - case ADDON_GAME_CONTROLLER: - return AddonPtr(new GAME::CController(std::move(addonProps))); - default: -diff --git a/xbmc/addons/AddonBuilder.h b/xbmc/addons/AddonBuilder.h -index 074f7eb..0eef650 100644 ---- a/xbmc/addons/AddonBuilder.h -+++ b/xbmc/addons/AddonBuilder.h -@@ -53,8 +53,6 @@ public: - void SetInstallDate(CDateTime installDate) { m_props.installDate = installDate; } - void SetLastUpdated(CDateTime lastUpdated) { m_props.lastUpdated = lastUpdated; } - void SetLastUsed(CDateTime lastUsed) { m_props.lastUsed = lastUsed; } -- void SetOrigin(std::string origin) { m_props.origin = std::move(origin); } -- void SetPackageSize(uint64_t size) { m_props.packageSize = size; } - - const std::string& GetId() const { return m_props.id; } - const AddonVersion& GetVersion() const { return m_props.version; } -diff --git a/xbmc/addons/AddonDatabase.cpp b/xbmc/addons/AddonDatabase.cpp -index 6f49f14..d23be26 100644 ---- a/xbmc/addons/AddonDatabase.cpp -+++ b/xbmc/addons/AddonDatabase.cpp -@@ -28,8 +28,6 @@ - #include "addons/AddonManager.h" - #include "dbwrappers/dataset.h" - #include "filesystem/SpecialProtocol.h" --#include "utils/JSONVariantParser.h" --#include "utils/JSONVariantWriter.h" - #include "utils/log.h" - #include "utils/StringUtils.h" - #include "utils/Variant.h" -@@ -38,72 +36,6 @@ - - using namespace ADDON; - --static std::string SerializeMetadata(const IAddon& addon) --{ -- CVariant variant; -- variant["author"] = addon.Author(); -- variant["disclaimer"] = addon.Disclaimer(); -- variant["broken"] = addon.Broken(); -- variant["size"] = addon.PackageSize(); -- -- variant["path"] = addon.Path(); -- variant["fanart"] = addon.FanArt(); -- variant["icon"] = addon.Icon(); -- -- variant["extensions"] = CVariant(CVariant::VariantTypeArray); -- variant["extensions"].push_back(ADDON::TranslateType(addon.Type(), false)); -- -- variant["dependencies"] = CVariant(CVariant::VariantTypeArray); -- for (const auto& kv : addon.GetDeps()) -- { -- CVariant dep(CVariant::VariantTypeObject); -- dep["addonId"] = kv.first; -- dep["version"] = kv.second.first.asString(); -- dep["optional"] = kv.second.second; -- variant["dependencies"].push_back(std::move(dep)); -- } -- -- variant["extrainfo"] = CVariant(CVariant::VariantTypeArray); -- for (const auto& kv : addon.ExtraInfo()) -- { -- CVariant info(CVariant::VariantTypeObject); -- info["key"] = kv.first; -- info["value"] = kv.second; -- variant["extrainfo"].push_back(std::move(info)); -- } -- -- return CJSONVariantWriter::Write(variant, true); --} -- --static void DeserializeMetadata(const std::string& document, CAddonBuilder& builder) --{ -- CVariant variant = CJSONVariantParser::Parse(document); -- -- builder.SetAuthor(variant["author"].asString()); -- builder.SetDisclaimer(variant["disclaimer"].asString()); -- builder.SetBroken(variant["broken"].asString()); -- builder.SetPackageSize(variant["size"].asUnsignedInteger()); -- -- builder.SetPath(variant["path"].asString()); -- builder.SetFanart(variant["fanart"].asString()); -- builder.SetIcon(variant["icon"].asString()); -- -- builder.SetType(TranslateType(variant["extensions"][0].asString())); -- -- ADDONDEPS deps; -- for (auto it = variant["dependencies"].begin_array(); it != variant["dependencies"].end_array(); ++it) -- { -- AddonVersion version((*it)["version"].asString()); -- deps.emplace((*it)["addonId"].asString(), std::make_pair(std::move(version), (*it)["optional"].asBoolean())); -- } -- builder.SetDependencies(std::move(deps)); -- -- InfoMap extraInfo; -- for (auto it = variant["extrainfo"].begin_array(); it != variant["extrainfo"].end_array(); ++it) -- extraInfo.emplace((*it)["key"].asString(), (*it)["value"].asString()); -- builder.SetExtrainfo(std::move(extraInfo)); --} -- - CAddonDatabase::CAddonDatabase() - { - } -@@ -124,20 +56,23 @@ int CAddonDatabase::GetMinSchemaVersion() const - - int CAddonDatabase::GetSchemaVersion() const - { -- return 26; -+ return 24; - } - - void CAddonDatabase::CreateTables() - { -- CLog::Log(LOGINFO, "create addons table"); -- m_pDS->exec("CREATE TABLE addons (" -- "id INTEGER PRIMARY KEY," -- "metadata BLOB," -- "addonID TEXT NOT NULL," -- "version TEXT NOT NULL," -- "name TEXT NOT NULL," -- "summary TEXT NOT NULL," -- "description TEXT NOT NULL)"); -+ CLog::Log(LOGINFO, "create addon table"); -+ m_pDS->exec("CREATE TABLE addon (id integer primary key, type text," -+ "name text, summary text, description text, stars integer," -+ "path text, addonID text, icon text, version text, " -+ "changelog text, fanart text, author text, disclaimer text," -+ "minversion text)\n"); -+ -+ CLog::Log(LOGINFO, "create addonextra table"); -+ m_pDS->exec("CREATE TABLE addonextra (id integer, key text, value text)\n"); -+ -+ CLog::Log(LOGINFO, "create dependencies table"); -+ m_pDS->exec("CREATE TABLE dependencies (id integer, addon text, version text, optional boolean)\n"); - - CLog::Log(LOGINFO, "create repo table"); - m_pDS->exec("CREATE TABLE repo (id integer primary key, addonID text," -@@ -157,14 +92,15 @@ void CAddonDatabase::CreateTables() - - CLog::Log(LOGINFO, "create installed table"); - m_pDS->exec("CREATE TABLE installed (id INTEGER PRIMARY KEY, addonID TEXT UNIQUE, " -- "enabled BOOLEAN, installDate TEXT, lastUpdated TEXT, lastUsed TEXT, " -- "origin TEXT NOT NULL DEFAULT '') \n"); -+ "enabled BOOLEAN, installDate TEXT, lastUpdated TEXT, lastUsed TEXT) \n"); - } - - void CAddonDatabase::CreateAnalytics() - { - CLog::Log(LOGINFO, "%s creating indicies", __FUNCTION__); -- m_pDS->exec("CREATE INDEX idxAddons ON addons(addonID)"); -+ m_pDS->exec("CREATE INDEX idxAddon ON addon(addonID)"); -+ m_pDS->exec("CREATE INDEX idxAddonExtra ON addonextra(id)"); -+ m_pDS->exec("CREATE INDEX idxDependencies ON dependencies(id)"); - m_pDS->exec("CREATE UNIQUE INDEX ix_addonlinkrepo_1 ON addonlinkrepo ( idAddon, idRepo )\n"); - m_pDS->exec("CREATE UNIQUE INDEX ix_addonlinkrepo_2 ON addonlinkrepo ( idRepo, idAddon )\n"); - m_pDS->exec("CREATE UNIQUE INDEX idxBroken ON broken(addonID)"); -@@ -272,26 +208,6 @@ void CAddonDatabase::UpdateTables(int version) - m_pDS->exec("DELETE FROM addonlinkrepo"); - m_pDS->exec("DELETE FROM repo"); - } -- if (version < 25) -- { -- m_pDS->exec("ALTER TABLE installed ADD origin TEXT NOT NULL DEFAULT ''"); -- } -- if (version < 26) -- { -- m_pDS->exec("DROP TABLE addon"); -- m_pDS->exec("DROP TABLE addonextra"); -- m_pDS->exec("DROP TABLE dependencies"); -- m_pDS->exec("DELETE FROM addonlinkrepo"); -- m_pDS->exec("DELETE FROM repo"); -- m_pDS->exec("CREATE TABLE addons (" -- "id INTEGER PRIMARY KEY," -- "metadata BLOB," -- "addonID TEXT NOT NULL," -- "version TEXT NOT NULL," -- "name TEXT NOT NULL," -- "summary TEXT NOT NULL," -- "description TEXT NOT NULL)"); -- } - } - - void CAddonDatabase::SyncInstalled(const std::set& ids, -@@ -344,12 +260,7 @@ void CAddonDatabase::SyncInstalled(const std::set& ids, - } - - for (const auto& id : system) -- { - m_pDS->exec(PrepareSQL("UPDATE installed SET enabled=1 WHERE addonID='%s'", id.c_str())); -- // Set origin *only* for addons that do not have one yet as it may have been changed by an update. -- m_pDS->exec(PrepareSQL("UPDATE installed SET origin='%s' WHERE addonID='%s' AND origin=''", -- ORIGIN_SYSTEM, id.c_str())); -- } - - CommitTransaction(); - } -@@ -375,7 +286,6 @@ void CAddonDatabase::GetInstalled(std::vector& addons) - it->SetInstallDate(CDateTime::FromDBDateTime(m_pDS->fv(3).get_asString())); - it->SetLastUpdated(CDateTime::FromDBDateTime(m_pDS->fv(4).get_asString())); - it->SetLastUsed(CDateTime::FromDBDateTime(m_pDS->fv(5).get_asString())); -- it->SetOrigin(m_pDS->fv(6).get_asString()); - m_pDS->next(); - } - m_pDS->close(); -@@ -404,14 +314,18 @@ bool CAddonDatabase::SetLastUpdated(const std::string& addonId, const CDateTime& - return false; - } - --bool CAddonDatabase::SetOrigin(const std::string& addonId, const std::string& origin) -+bool CAddonDatabase::SetLastUsed(const std::string& addonId, const CDateTime& dateTime) - { - try - { - if (NULL == m_pDB.get()) return false; - if (NULL == m_pDS.get()) return false; - -- m_pDS->exec(PrepareSQL("UPDATE installed SET origin='%s' WHERE addonID='%s'", origin.c_str(), addonId.c_str())); -+ auto start = XbmcThreads::SystemClockMillis(); -+ m_pDS->exec(PrepareSQL("UPDATE installed SET lastUsed='%s' WHERE addonID='%s'", -+ dateTime.GetAsDBDateTime().c_str(), addonId.c_str())); -+ -+ CLog::Log(LOGDEBUG, "CAddonDatabase::SetLastUsed[%s] took %i ms", addonId.c_str(), XbmcThreads::SystemClockMillis() - start); - return true; - } - catch (...) -@@ -421,25 +335,51 @@ bool CAddonDatabase::SetOrigin(const std::string& addonId, const std::string& or - return false; - } - --bool CAddonDatabase::SetLastUsed(const std::string& addonId, const CDateTime& dateTime) -+int CAddonDatabase::AddAddon(const AddonPtr& addon, int idRepo) - { - try - { -- if (NULL == m_pDB.get()) return false; -- if (NULL == m_pDS.get()) return false; -+ if (NULL == m_pDB.get()) return -1; -+ if (NULL == m_pDS.get()) return -1; - -- auto start = XbmcThreads::SystemClockMillis(); -- m_pDS->exec(PrepareSQL("UPDATE installed SET lastUsed='%s' WHERE addonID='%s'", -- dateTime.GetAsDBDateTime().c_str(), addonId.c_str())); -+ std::string sql = PrepareSQL("insert into addon (id, type, name, summary," -+ "description, path, icon, changelog, " -+ "fanart, addonID, version, author, disclaimer, minversion)" -+ " values(NULL, '%s', '%s', '%s', '%s'," -+ "'%s', '%s', '%s', '%s', '%s','%s','%s','%s','%s')", -+ TranslateType(addon->Type(),false).c_str(), -+ addon->Name().c_str(), addon->Summary().c_str(), -+ addon->Description().c_str(), -+ addon->Path().c_str(), addon->Icon().c_str(), -+ addon->ChangeLog().c_str(),addon->FanArt().c_str(), -+ addon->ID().c_str(), addon->Version().asString().c_str(), -+ addon->Author().c_str(),addon->Disclaimer().c_str(), -+ addon->MinVersion().asString().c_str()); -+ m_pDS->exec(sql); -+ int idAddon = (int)m_pDS->lastinsertid(); - -- CLog::Log(LOGDEBUG, "CAddonDatabase::SetLastUsed[%s] took %i ms", addonId.c_str(), XbmcThreads::SystemClockMillis() - start); -- return true; -+ sql = PrepareSQL("insert into addonlinkrepo (idRepo, idAddon) values (%i,%i)",idRepo,idAddon); -+ m_pDS->exec(sql); -+ -+ const InfoMap &info = addon->ExtraInfo(); -+ for (InfoMap::const_iterator i = info.begin(); i != info.end(); ++i) -+ { -+ sql = PrepareSQL("insert into addonextra(id, key, value) values (%i, '%s', '%s')", idAddon, i->first.c_str(), i->second.c_str()); -+ m_pDS->exec(sql); -+ } -+ const ADDONDEPS &deps = addon->GetDeps(); -+ for (ADDONDEPS::const_iterator i = deps.begin(); i != deps.end(); ++i) -+ { -+ sql = PrepareSQL("insert into dependencies(id, addon, version, optional) values (%i, '%s', '%s', %i)", idAddon, i->first.c_str(), i->second.first.asString().c_str(), i->second.second ? 1 : 0); -+ m_pDS->exec(sql); -+ } -+ return idAddon; - } - catch (...) - { -- CLog::Log(LOGERROR, "%s failed on addon '%s'", __FUNCTION__, addonId.c_str()); -+ CLog::Log(LOGERROR, "%s failed on addon '%s'", __FUNCTION__, addon->Name().c_str()); - } -- return false; -+ return -1; - } - - std::pair CAddonDatabase::GetAddonVersion(const std::string &id) -@@ -470,14 +410,14 @@ bool CAddonDatabase::GetAvailableVersions(const std::string& addonId, - if (NULL == m_pDS.get()) return false; - - std::string sql = PrepareSQL( -- "SELECT addons.version, repo.addonID AS repoID FROM addons " -- "JOIN addonlinkrepo ON addonlinkrepo.idAddon=addons.id " -+ "SELECT addon.version, repo.addonID AS repoID FROM addon " -+ "JOIN addonlinkrepo ON addonlinkrepo.idAddon=addon.id " - "JOIN repo ON repo.id=addonlinkrepo.idRepo " - "WHERE " - "repo.checksum IS NOT NULL AND repo.checksum != '' " - "AND EXISTS (SELECT * FROM installed WHERE installed.addonID=repoID AND installed.enabled=1) " -- "AND NOT EXISTS (SELECT * FROM broken WHERE broken.addonID=addons.addonID) " -- "AND addons.addonID='%s'", addonId.c_str()); -+ "AND NOT EXISTS (SELECT * FROM broken WHERE broken.addonID=addon.addonID) " -+ "AND addon.addonID='%s'", addonId.c_str()); - - m_pDS->query(sql.c_str()); - while (!m_pDS->eof()) -@@ -504,10 +444,10 @@ bool CAddonDatabase::GetAddon(const std::string& addonID, const AddonVersion& ve - if (NULL == m_pDS.get()) return false; - - std::string sql = PrepareSQL( -- "SELECT addons.id FROM addons " -- "JOIN addonlinkrepo ON addonlinkrepo.idAddon=addons.id " -+ "SELECT addon.id, addon.addonID, repo.addonID AS repoID FROM addon " -+ "JOIN addonlinkrepo ON addonlinkrepo.idAddon=addon.id " - "JOIN repo ON repo.id=addonlinkrepo.idRepo " -- "WHERE addons.addonID='%s' AND addons.version='%s' AND repo.addonID='%s'", -+ "WHERE addon.addonID='%s' AND addon.version='%s' AND repoID='%s'", - addonID.c_str(), version.asString().c_str(), repoId.c_str()); - - m_pDS->query(sql.c_str()); -@@ -534,7 +474,7 @@ bool CAddonDatabase::GetAddon(const std::string& id, AddonPtr& addon) - // there may be multiple addons with this id (eg from different repositories) in the database, - // so we want to retrieve the latest version. Order by version won't work as the database - // won't know that 1.10 > 1.2, so grab them all and order outside -- std::string sql = PrepareSQL("select id,version from addons where addonID='%s'",id.c_str()); -+ std::string sql = PrepareSQL("select id,version from addon where addonID='%s'",id.c_str()); - m_pDS2->query(sql); - - if (m_pDS2->eof()) -@@ -569,24 +509,66 @@ bool CAddonDatabase::GetAddon(int id, AddonPtr &addon) - if (NULL == m_pDB.get()) return false; - if (NULL == m_pDS2.get()) return false; - -- m_pDS2->query(PrepareSQL("SELECT * FROM addons WHERE id=%i", id)); -- if (m_pDS2->eof()) -- return false; -+ std::string sql = "SELECT addon.*," -+ " broken.reason," -+ " addonextra.key, addonextra.value," -+ " dependencies.addon, dependencies.version, dependencies.optional" -+ " FROM addon" -+ " LEFT JOIN broken" -+ " ON broken.addonID = addon.addonID" -+ " LEFT JOIN addonextra" -+ " ON addonextra.id = addon.id" -+ " LEFT JOIN dependencies" -+ " ON dependencies.id = addon.id"; -+ -+ sql += PrepareSQL(" WHERE addon.id=%i", id); -+ -+ m_pDS2->query(sql); -+ if (!m_pDS2->eof()) -+ { -+ const dbiplus::query_data &data = m_pDS2->get_result_set().records; -+ const dbiplus::sql_record* const record = data[0]; -+ -+ CAddonBuilder builder; -+ builder.SetId(record->at(addon_addonID).get_asString()); -+ builder.SetType(TranslateType(record->at(addon_type).get_asString())); -+ builder.SetVersion(AddonVersion(record->at(addon_version).get_asString())); -+ builder.SetMinVersion(AddonVersion(record->at(addon_minversion).get_asString())); -+ builder.SetName(record->at(addon_name).get_asString()); -+ builder.SetSummary(record->at(addon_summary).get_asString()); -+ builder.SetDescription(record->at(addon_description).get_asString()); -+ builder.SetChangelog(record->at(addon_changelog).get_asString()); -+ builder.SetDisclaimer(record->at(addon_disclaimer).get_asString()); -+ builder.SetAuthor(record->at(addon_author).get_asString()); -+ builder.SetBroken(record->at(broken_reason).get_asString()); -+ builder.SetPath(record->at(addon_path).get_asString()); -+ builder.SetIcon(record->at(addon_icon).get_asString()); -+ builder.SetFanart(record->at(addon_fanart).get_asString()); -+ -+ InfoMap extrainfo; -+ ADDONDEPS dependencies; -+ /* while this is a cartesion join and we'll typically get multiple rows, we rely on the fact that -+ extrainfo and dependencies are maps, so insert() will insert the first instance only */ -+ for (dbiplus::query_data::const_iterator i = data.begin(); i != data.end(); ++i) -+ { -+ const dbiplus::sql_record* const record = *i; -+ if (!record->at(addonextra_key).get_asString().empty()) -+ extrainfo.insert(std::make_pair(record->at(addonextra_key).get_asString(), record->at(addonextra_value).get_asString())); -+ if (!m_pDS2->fv(dependencies_addon).get_asString().empty()) -+ dependencies.insert(std::make_pair(record->at(dependencies_addon).get_asString(), std::make_pair(AddonVersion(record->at(dependencies_version).get_asString()), record->at(dependencies_optional).get_asBool()))); -+ } -+ builder.SetExtrainfo(std::move(extrainfo)); -+ builder.SetDependencies(std::move(dependencies)); - -- CAddonBuilder builder; -- builder.SetId(m_pDS2->fv(2).get_asString()); -- builder.SetVersion(AddonVersion(m_pDS2->fv(3).get_asString())); -- builder.SetName(m_pDS2->fv(4).get_asString()); -- builder.SetSummary(m_pDS2->fv(5).get_asString()); -- builder.SetDescription(m_pDS2->fv(6).get_asString()); -- DeserializeMetadata(m_pDS2->fv(1).get_asString(), builder); -- addon = builder.Build(); -- return addon != nullptr; -+ addon = builder.Build(); -+ return NULL != addon.get(); -+ } - } - catch (...) - { - CLog::Log(LOGERROR, "%s failed on addon %i", __FUNCTION__, id); - } -+ addon.reset(); - return false; - } - -@@ -595,7 +577,7 @@ bool CAddonDatabase::GetRepositoryContent(VECADDONS& addons) - return GetRepositoryContent("", addons); - } - --bool CAddonDatabase::GetRepositoryContent(const std::string& id, VECADDONS& addons) -+bool CAddonDatabase::GetRepositoryContent(const std::string& repository, VECADDONS& addons) - { - try - { -@@ -613,8 +595,8 @@ bool CAddonDatabase::GetRepositoryContent(const std::string& id, VECADDONS& addo - " AND EXISTS (SELECT * FROM installed WHERE installed.addonID=repo.addonID AND" - " installed.enabled=1)"); - -- if (!id.empty()) -- sql += PrepareSQL(" AND repo.addonId='%s'", id.c_str()); -+ if (!repository.empty()) -+ sql += PrepareSQL(" AND repo.addonId='%s'", repository.c_str()); - - m_pDS->query(sql); - while (!m_pDS->eof()) -@@ -624,57 +606,124 @@ bool CAddonDatabase::GetRepositoryContent(const std::string& id, VECADDONS& addo - } - } - -- CLog::Log(LOGDEBUG, "CAddonDatabase: SELECT repo.id FROM repo .. took %d ms", XbmcThreads::SystemClockMillis() - start); -- - if (repoIds.empty()) - { -- CLog::Log(LOGDEBUG, "CAddonDatabase: no valid repository matching '%s'", id.c_str()); -+ CLog::Log(LOGDEBUG, "CAddonDatabase: no valid repository matching '%s'", repository.c_str()); - return false; - } - -+ std::string commonConstraint = PrepareSQL( -+ " JOIN addonlinkrepo ON addon.id=addonlinkrepo.idAddon" -+ " WHERE addonlinkrepo.idRepo IN (%s)" -+ " ORDER BY addon.addonID", StringUtils::Join(repoIds, ",").c_str()); -+ -+ std::vector result; -+ // Read basic info from the `addon` table -+ { -+ std::string sql = PrepareSQL("SELECT addon.*, broken.reason FROM addon " -+ "LEFT JOIN broken ON broken.addonID=addon.addonID ") + commonConstraint; -+ auto start = XbmcThreads::SystemClockMillis(); -+ m_pDS->query(sql); -+ CLog::Log(LOGDEBUG, "CAddonDatabase: query %s returned %d rows in %d ms", sql.c_str(), -+ m_pDS->num_rows(), XbmcThreads::SystemClockMillis() - start); -+ -+ while (!m_pDS->eof()) -+ { -+ std::string addonId = m_pDS->fv(addon_addonID).get_asString(); -+ AddonVersion version(m_pDS->fv(addon_version).get_asString()); -+ -+ if (!result.empty() && result.back().GetId() == addonId && result.back().GetVersion() >= version) -+ { -+ // We already have a version of this addon in our list which is newer. -+ m_pDS->next(); -+ continue; -+ } -+ -+ CAddonBuilder builder; -+ builder.SetId(addonId); -+ builder.SetVersion(version); -+ builder.SetType(TranslateType(m_pDS->fv(addon_type).get_asString())); -+ builder.SetMinVersion(AddonVersion(m_pDS->fv(addon_minversion).get_asString())); -+ builder.SetName(m_pDS->fv(addon_name).get_asString()); -+ builder.SetSummary(m_pDS->fv(addon_summary).get_asString()); -+ builder.SetDescription(m_pDS->fv(addon_description).get_asString()); -+ builder.SetChangelog(m_pDS->fv(addon_changelog).get_asString()); -+ builder.SetDisclaimer(m_pDS->fv(addon_disclaimer).get_asString()); -+ builder.SetAuthor(m_pDS->fv(addon_author).get_asString()); -+ builder.SetPath(m_pDS->fv(addon_path).get_asString()); -+ builder.SetIcon(m_pDS->fv(addon_icon).get_asString()); -+ builder.SetFanart(m_pDS->fv(addon_fanart).get_asString()); -+ builder.SetBroken(m_pDS->fv(broken_reason).get_asString()); -+ if (!result.empty() && result.back().GetId() == addonId) -+ result.back() = std::move(builder); -+ else -+ result.push_back(std::move(builder)); -+ m_pDS->next(); -+ } -+ } -+ -+ // Read extra info. - { - std::string sql = PrepareSQL( -- " SELECT * FROM addons" -- " JOIN addonlinkrepo ON addons.id=addonlinkrepo.idAddon" -- " WHERE addonlinkrepo.idRepo IN (%s)" -- " ORDER BY addons.addonID", StringUtils::Join(repoIds, ",").c_str()); -+ "SELECT addon.addonID as owner, addonextra.key, addonextra.value " -+ "FROM addon JOIN addonextra ON addon.id=addonextra.id ") + commonConstraint; - - auto start = XbmcThreads::SystemClockMillis(); - m_pDS->query(sql); - CLog::Log(LOGDEBUG, "CAddonDatabase: query %s returned %d rows in %d ms", sql.c_str(), - m_pDS->num_rows(), XbmcThreads::SystemClockMillis() - start); -+ -+ for (auto& builder : result) -+ { -+ //move cursor to current or next addon -+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() < builder.GetId()) -+ m_pDS->next(); -+ -+ InfoMap extraInfo; -+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() == builder.GetId()) -+ { -+ extraInfo.emplace(m_pDS->fv(1).get_asString(), m_pDS->fv(2).get_asString()); -+ m_pDS->next(); -+ } -+ builder.SetExtrainfo(std::move(extraInfo)); -+ } - } - -- VECADDONS result; -- while (!m_pDS->eof()) -+ // Read dependency info. - { -- std::string addonId = m_pDS->fv(2).get_asString(); -- AddonVersion version(m_pDS->fv(3).get_asString()); -+ std::string sql = PrepareSQL( -+ "SELECT addon.addonID as owner, dependencies.addon, dependencies.version, dependencies.optional " -+ "FROM addon JOIN dependencies ON addon.id=dependencies.id ") + commonConstraint; - -- if (!result.empty() && result.back()->ID() == addonId && result.back()->Version() >= version) -+ auto start = XbmcThreads::SystemClockMillis(); -+ m_pDS->query(sql); -+ CLog::Log(LOGDEBUG, "CAddonDatabase: query %s returned %d rows in %d ms", sql.c_str(), -+ m_pDS->num_rows(), XbmcThreads::SystemClockMillis() - start); -+ -+ for (auto& builder : result) - { -- // We already have a version of this addon in our list which is newer. -- m_pDS->next(); -- continue; -+ //move cursor to the current or next addon -+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() < builder.GetId()) -+ m_pDS->next(); -+ -+ ADDONDEPS dependencies; -+ while (!m_pDS->eof() && m_pDS->fv(0).get_asString() == builder.GetId()) -+ { -+ dependencies.emplace(m_pDS->fv(1).get_asString(), -+ std::make_pair(AddonVersion(m_pDS->fv(2).get_asString()), m_pDS->fv(3).get_asBool())); -+ m_pDS->next(); -+ } -+ builder.SetDependencies(std::move(dependencies)); - } -+ } -+ m_pDS->close(); - -- CAddonBuilder builder; -- builder.SetId(addonId); -- builder.SetVersion(version); -- builder.SetName(m_pDS->fv(4).get_asString()); -- builder.SetSummary(m_pDS->fv(5).get_asString()); -- builder.SetDescription(m_pDS->fv(6).get_asString()); -- DeserializeMetadata(m_pDS->fv(1).get_asString(), builder); -- -+ for (auto& builder : result) -+ { - auto addon = builder.Build(); - if (addon) -- result.push_back(std::move(addon)); -- else -- CLog::Log(LOGWARNING, "CAddonDatabase: failed to build %s", addonId.c_str()); -- m_pDS->next(); -+ addons.push_back(std::move(addon)); - } -- m_pDS->close(); -- addons = std::move(result); - - CLog::Log(LOGDEBUG, "CAddonDatabase::GetAddons took %i ms", XbmcThreads::SystemClockMillis() - start); - return true; -@@ -700,7 +749,9 @@ void CAddonDatabase::DeleteRepository(const std::string& id) - int idRepo = m_pDS->fv(0).get_asInt(); - - m_pDS->exec(PrepareSQL("DELETE FROM repo WHERE id=%i", idRepo)); -- m_pDS->exec(PrepareSQL("DELETE FROM addons WHERE id IN (SELECT idAddon FROM addonlinkrepo WHERE idRepo=%i)", idRepo)); -+ m_pDS->exec(PrepareSQL("DELETE FROM addon WHERE id IN (SELECT idAddon FROM addonlinkrepo WHERE idRepo=%i)", idRepo)); -+ m_pDS->exec(PrepareSQL("DELETE FROM addonextra WHERE id IN (SELECT idAddon FROM addonlinkrepo WHERE idRepo=%i)", idRepo)); -+ m_pDS->exec(PrepareSQL("DELETE FROM dependencies WHERE id IN (SELECT idAddon FROM addonlinkrepo WHERE idRepo=%i)", idRepo)); - m_pDS->exec(PrepareSQL("DELETE FROM addonlinkrepo WHERE idRepo=%i", idRepo)); - } - catch (...) -@@ -709,17 +760,17 @@ void CAddonDatabase::DeleteRepository(const std::string& id) - } - } - --bool CAddonDatabase::UpdateRepositoryContent(const std::string& repository, const AddonVersion& version, -- const std::string& checksum, const std::vector& addons) -+bool CAddonDatabase::UpdateRepositoryContent(const std::string& id, const VECADDONS& addons, -+ const std::string& checksum, const AddonVersion& version) - { - try - { - if (NULL == m_pDB.get()) return false; - if (NULL == m_pDS.get()) return false; - -- DeleteRepository(repository); -+ DeleteRepository(id); - -- if (!SetLastChecked(repository, version, CDateTime::GetCurrentDateTime().GetAsDBDateTime())) -+ if (!SetLastChecked(id, version, CDateTime::GetCurrentDateTime().GetAsDBDateTime())) - return false; - - int idRepo = static_cast(m_pDS->lastinsertid()); -@@ -728,34 +779,14 @@ bool CAddonDatabase::UpdateRepositoryContent(const std::string& repository, cons - m_pDB->start_transaction(); - m_pDS->exec(PrepareSQL("UPDATE repo SET checksum='%s' WHERE id='%d'", checksum.c_str(), idRepo)); - for (const auto& addon : addons) -- { -- m_pDS->exec(PrepareSQL( -- "INSERT INTO addons (id, metadata, addonID, version, name, summary, description) " -- "VALUES (NULL, '%s', '%s', '%s', '%s','%s', '%s')", -- SerializeMetadata(*addon).c_str(), -- addon->ID().c_str(), -- addon->Version().asString().c_str(), -- addon->Name().c_str(), -- addon->Summary().c_str(), -- addon->Description().c_str())); -- -- auto idAddon = m_pDS->lastinsertid(); -- if (idAddon <= 0) -- { -- CLog::Log(LOGERROR, "%s insert failed on addon '%s'", __FUNCTION__, addon->ID().c_str()); -- RollbackTransaction(); -- return false; -- } -- -- m_pDS->exec(PrepareSQL("INSERT INTO addonlinkrepo (idRepo, idAddon) VALUES (%i, %i)", idRepo, idAddon)); -- } -+ AddAddon(addon, idRepo); - - m_pDB->commit_transaction(); - return true; - } - catch (...) - { -- CLog::Log(LOGERROR, "%s failed on repo '%s'", __FUNCTION__, repository.c_str()); -+ CLog::Log(LOGERROR, "%s failed on repo '%s'", __FUNCTION__, id.c_str()); - RollbackTransaction(); - } - return false; -@@ -844,7 +875,7 @@ bool CAddonDatabase::Search(const std::string& search, VECADDONS& addons) - if (NULL == m_pDS.get()) return false; - - std::string strSQL; -- strSQL=PrepareSQL("SELECT addonID FROM addons WHERE name LIKE '%%%s%%' OR summary LIKE '%%%s%%' OR description LIKE '%%%s%%'", search.c_str(), search.c_str(), search.c_str()); -+ strSQL=PrepareSQL("SELECT addonID FROM addon WHERE name LIKE '%%%s%%' OR summary LIKE '%%%s%%' OR description LIKE '%%%s%%'", search.c_str(), search.c_str(), search.c_str()); - CLog::Log(LOGDEBUG, "%s query: %s", __FUNCTION__, strSQL.c_str()); - - if (!m_pDS->query(strSQL)) return false; -@@ -943,9 +974,9 @@ bool CAddonDatabase::GetBlacklisted(std::set& addons) - return false; - } - --bool CAddonDatabase::IsAddonBroken(const std::string &addonID) -+std::string CAddonDatabase::IsAddonBroken(const std::string &addonID) - { -- return !GetSingleValue(PrepareSQL("SELECT reason FROM broken WHERE addonID='%s'", addonID.c_str())).empty(); -+ return GetSingleValue(PrepareSQL("SELECT reason FROM broken WHERE addonID='%s'", addonID.c_str())); - } - - bool CAddonDatabase::BlacklistAddon(const std::string& addonID) -@@ -1015,7 +1046,7 @@ void CAddonDatabase::OnPostUnInstall(const std::string& addonId) - RemoveAddonFromBlacklist(addonId); - DeleteRepository(addonId); - -- //! @todo should be done before uninstall to avoid any race conditions -+ //TODO: should be done before uninstall to avoid any race conditions - try - { - if (NULL == m_pDB.get()) return; -diff --git a/xbmc/addons/AddonDatabase.h b/xbmc/addons/AddonDatabase.h -index 220d5c8..bb1140c 100644 ---- a/xbmc/addons/AddonDatabase.h -+++ b/xbmc/addons/AddonDatabase.h -@@ -48,9 +48,8 @@ public: - /*! Get the most recent version for an add-on and the repo id it belongs to*/ - std::pair GetAddonVersion(const std::string &id); - -- bool UpdateRepositoryContent(const std::string& repositoryId, const ADDON::AddonVersion& version, -- const std::string& checksum, const std::vector& addons); -- -+ bool UpdateRepositoryContent(const std::string& id, const ADDON::VECADDONS& addons, -+ const std::string& checksum, const ADDON::AddonVersion& version); - int GetRepoChecksum(const std::string& id, std::string& checksum); - - /*! -@@ -92,8 +91,9 @@ public: - - /*! \brief Check whether an addon has been marked as broken via BreakAddon. - \param addonID id of the addon to check -+ \return reason if the addon is broken, blank otherwise - \sa BreakAddon */ -- bool IsAddonBroken(const std::string &addonID); -+ std::string IsAddonBroken(const std::string &addonID); - - bool BlacklistAddon(const std::string& addonID); - bool RemoveAddonFromBlacklist(const std::string& addonID); -@@ -136,7 +136,6 @@ public: - void GetInstalled(std::vector& addons); - - bool SetLastUpdated(const std::string& addonId, const CDateTime& dateTime); -- bool SetOrigin(const std::string& addonId, const std::string& origin); - bool SetLastUsed(const std::string& addonId, const CDateTime& dateTime); - - -@@ -149,6 +148,33 @@ protected: - const char *GetBaseDBName() const { return "Addons"; } - - bool GetAddon(int id, ADDON::AddonPtr& addon); -+ int AddAddon(const ADDON::AddonPtr& item, int idRepo); - void DeleteRepository(const std::string& id); -+ -+ /* keep in sync with the addon table */ -+ enum AddonFields -+ { -+ addon_id=0, -+ addon_type, -+ addon_name, -+ addon_summary, -+ addon_description, -+ addon_stars, -+ addon_path, -+ addon_addonID, -+ addon_icon, -+ addon_version, -+ addon_changelog, -+ addon_fanart, -+ addon_author, -+ addon_disclaimer, -+ addon_minversion, -+ broken_reason, -+ addonextra_key, -+ addonextra_value, -+ dependencies_addon, -+ dependencies_version, -+ dependencies_optional -+ }; - }; - -diff --git a/xbmc/addons/AddonDll.h b/xbmc/addons/AddonDll.h -index 3058fe8..cc3c24a 100644 ---- a/xbmc/addons/AddonDll.h -+++ b/xbmc/addons/AddonDll.h -@@ -20,7 +20,6 @@ - */ - #include - #include --#include - - #include "Addon.h" - #include "DllAddon.h" -diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp -index c0e365c..b0a57b6 100644 ---- a/xbmc/addons/AddonInstaller.cpp -+++ b/xbmc/addons/AddonInstaller.cpp -@@ -266,7 +266,7 @@ bool CAddonInstaller::InstallFromZip(const std::string &path) - - // grab the descriptive XML document from the zip, and read it in - CFileItemList items; -- //! @bug some zip files return a single item (root folder) that we think is stored, so we don't use the zip:// protocol -+ // BUG: some zip files return a single item (root folder) that we think is stored, so we don't use the zip:// protocol - CURL pathToUrl(path); - CURL zipDir = URIUtils::CreateArchivePath("zip", pathToUrl, ""); - if (!CDirectory::GetDirectory(zipDir, items) || items.Size() != 1 || !items[0]->m_bIsFolder) -@@ -277,7 +277,7 @@ bool CAddonInstaller::InstallFromZip(const std::string &path) - return false; - } - -- //! @todo possibly add support for github generated zips here? -+ // TODO: possibly add support for github generated zips here? - std::string archive = URIUtils::AddFileToFolder(items[0]->GetPath(), "addon.xml"); - - CXBMCTinyXML xml; -@@ -351,7 +351,7 @@ bool CAddonInstaller::CheckDependencies(const AddonPtr &addon, - } - - // at this point we have our dep, or the dep is optional (and we don't have it) so check that it's OK as well -- //! @todo should we assume that installed deps are OK? -+ // TODO: should we assume that installed deps are OK? - if (dep && std::find(preDeps.begin(), preDeps.end(), dep->ID()) == preDeps.end()) - { - if (!CheckDependencies(dep, preDeps, database, failedDep)) -@@ -627,12 +627,15 @@ bool CAddonInstallJob::DoWork() - //Enable it if it was previously disabled - CAddonMgr::GetInstance().EnableAddon(m_addon->ID()); - -+ if (m_update) - { -- CAddonDatabase database; -- database.Open(); -- database.SetOrigin(m_addon->ID(), m_repo ? m_repo->ID() : ""); -- if (m_update) -- database.SetLastUpdated(m_addon->ID(), CDateTime::GetCurrentDateTime()); -+ auto& addon = m_addon; -+ auto time = CDateTime::GetCurrentDateTime(); -+ CJobManager::GetInstance().Submit([addon, time](){ -+ CAddonDatabase db; -+ if (db.Open()) -+ db.SetLastUpdated(addon->ID(), time); -+ }); - } - - // notify any observers that add-ons have changed -diff --git a/xbmc/addons/AddonInstaller.h b/xbmc/addons/AddonInstaller.h -index 02c7185..6cd7868 100644 ---- a/xbmc/addons/AddonInstaller.h -+++ b/xbmc/addons/AddonInstaller.h -@@ -19,9 +19,7 @@ - * - */ - --#include - #include --#include - - #include "addons/Addon.h" - #include "addons/Repository.h" -diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp -index e5a4c34..4c62232 100644 ---- a/xbmc/addons/AddonManager.cpp -+++ b/xbmc/addons/AddonManager.cpp -@@ -34,7 +34,7 @@ - #include "AudioEncoder.h" - #include "ContextMenuAddon.h" - #include "ContextMenuManager.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "DllAudioDSP.h" - #include "DllLibCPluff.h" - #include "events/AddonManagementEvent.h" -@@ -145,6 +145,7 @@ void CAddonMgr::FillCpluffMetadata(const cp_plugin_info_t* plugin, CAddonBuilder - builder.SetPath(plugin->plugin_path); - builder.SetIcon(URIUtils::AddFileToFolder(plugin->plugin_path, "icon.png")); - builder.SetFanart(URIUtils::AddFileToFolder(plugin->plugin_path, "fanart.jpg")); -+ builder.SetChangelog(URIUtils::AddFileToFolder(plugin->plugin_path, "changelog.txt")); - } - - { -@@ -169,9 +170,7 @@ void CAddonMgr::FillCpluffMetadata(const cp_plugin_info_t* plugin, CAddonBuilder - builder.SetSummary(CAddonMgr::GetInstance().GetTranslatedString(metadata->configuration, "summary")); - builder.SetDescription(CAddonMgr::GetInstance().GetTranslatedString(metadata->configuration, "description")); - builder.SetDisclaimer(CAddonMgr::GetInstance().GetTranslatedString(metadata->configuration, "disclaimer")); -- builder.SetChangelog(CAddonMgr::GetInstance().GetExtValue(metadata->configuration, "news")); - builder.SetLicense(CAddonMgr::GetInstance().GetExtValue(metadata->configuration, "license")); -- builder.SetPackageSize(StringUtils::ToUint64(CAddonMgr::GetInstance().GetExtValue(metadata->configuration, "size"), 0)); - - std::string language = CAddonMgr::GetInstance().GetExtValue(metadata->configuration, "language"); - if (!language.empty()) -@@ -187,6 +186,8 @@ void CAddonMgr::FillCpluffMetadata(const cp_plugin_info_t* plugin, CAddonBuilder - builder.SetFanart(""); - if (CAddonMgr::GetInstance().GetExtValue(metadata->configuration, "noicon") == "true") - builder.SetIcon(""); -+ if (CAddonMgr::GetInstance().GetExtValue(metadata->configuration, "nochangelog") == "true") -+ builder.SetChangelog(""); - } - } - -@@ -282,7 +283,8 @@ bool CAddonMgr::Init() - return false; - } - -- //! @todo could separate addons into different contexts would allow partial unloading of addon framework -+ //TODO could separate addons into different contexts -+ // would allow partial unloading of addon framework - m_cp_context = m_cpluff->create_context(&status); - assert(m_cp_context); - status = m_cpluff->register_pcollection(m_cp_context, CSpecialProtocol::TranslatePath("special://home/addons").c_str()); -@@ -574,7 +576,7 @@ bool CAddonMgr::GetAddon(const std::string &str, AddonPtr &addon, const TYPE &ty - return false; - } - --//! @todo handle all 'default' cases here, not just scrapers & vizs -+//TODO handle all 'default' cases here, not just scrapers & vizs - bool CAddonMgr::GetDefault(const TYPE &type, AddonPtr &addon) - { - std::string setting; -diff --git a/xbmc/addons/AddonStatusHandler.cpp b/xbmc/addons/AddonStatusHandler.cpp -index 660bc2c..b1b687c 100644 ---- a/xbmc/addons/AddonStatusHandler.cpp -+++ b/xbmc/addons/AddonStatusHandler.cpp -@@ -50,8 +50,8 @@ CAddonStatusHandler::CAddonStatusHandler(const std::string &addonID, ADDON_STATU - : CThread(("AddonStatus " + addonID).c_str()), - m_status(ADDON_STATUS_UNKNOWN) - { -- //! @todo The status handled CAddonStatusHandler by is related to the class, not the instance -- //! having CAddonMgr construct an instance makes no sense -+ // TODO: the status handled CAddonStatusHandler by is related to the class, not the instance -+ // having CAddonMgr construct an instance makes no sense - if (!CAddonMgr::GetInstance().GetAddon(addonID, m_addon)) - return; - -@@ -121,7 +121,7 @@ void CAddonStatusHandler::Process() - - if (CGUIDialogAddonSettings::ShowAndGetInput(m_addon)) - { -- //! @todo Doesn't dialogaddonsettings save these automatically? It should do this. -+ //todo doesn't dialogaddonsettings save these automatically? should do - m_addon->SaveSettings(); - CAddonMgr::GetInstance().GetCallbackForType(m_addon->Type())->RequestRestart(m_addon, true); - } -diff --git a/xbmc/addons/ContextMenuAddon.h b/xbmc/addons/ContextMenuAddon.h -index a3f9be2..63cd172 100644 ---- a/xbmc/addons/ContextMenuAddon.h -+++ b/xbmc/addons/ContextMenuAddon.h -@@ -21,9 +21,6 @@ - - #include - #include --#include --#include -- - #include "Addon.h" - #include "ContextMenuItem.h" - -diff --git a/xbmc/addons/GUIDialogAddonInfo.cpp b/xbmc/addons/GUIDialogAddonInfo.cpp -index ae5756a..3c3ba99 100644 ---- a/xbmc/addons/GUIDialogAddonInfo.cpp -+++ b/xbmc/addons/GUIDialogAddonInfo.cpp -@@ -27,7 +27,7 @@ - #include "FileItem.h" - #include "filesystem/Directory.h" - #include "GUIDialogAddonSettings.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "dialogs/GUIDialogContextMenu.h" - #include "dialogs/GUIDialogTextViewer.h" - #include "dialogs/GUIDialogOK.h" -@@ -53,6 +53,7 @@ - #define CONTROL_BTN_ENABLE 7 - #define CONTROL_BTN_UPDATE 8 - #define CONTROL_BTN_SETTINGS 9 -+#define CONTROL_BTN_CHANGELOG 10 - #define CONTROL_BTN_SELECT 12 - #define CONTROL_BTN_AUTOUPDATE 13 - -@@ -61,7 +62,9 @@ using namespace XFILE; - - CGUIDialogAddonInfo::CGUIDialogAddonInfo(void) - : CGUIDialog(WINDOW_DIALOG_ADDON_INFO, "DialogAddonInfo.xml"), -- m_addonEnabled(false) -+ m_addonEnabled(false), -+ m_jobid(0), -+ m_changelog(false) - { - m_item = CFileItemPtr(new CFileItem); - m_loadType = KEEP_IN_MEMORY; -@@ -75,6 +78,13 @@ bool CGUIDialogAddonInfo::OnMessage(CGUIMessage& message) - { - switch ( message.GetMessage() ) - { -+ case GUI_MSG_WINDOW_DEINIT: -+ { -+ if (m_jobid) -+ CJobManager::GetInstance().CancelJob(m_jobid); -+ } -+ break; -+ - case GUI_MSG_CLICKED: - { - int iControl = message.GetSenderId(); -@@ -130,6 +140,11 @@ bool CGUIDialogAddonInfo::OnMessage(CGUIMessage& message) - OnSettings(); - return true; - } -+ else if (iControl == CONTROL_BTN_CHANGELOG) -+ { -+ OnChangeLog(); -+ return true; -+ } - else if (iControl == CONTROL_BTN_AUTOUPDATE) - { - OnToggleAutoUpdates(); -@@ -158,6 +173,7 @@ void CGUIDialogAddonInfo::OnInitWindow() - { - UpdateControls(); - CGUIDialog::OnInitWindow(); -+ m_changelog = false; - } - - void CGUIDialogAddonInfo::UpdateControls() -@@ -170,6 +186,7 @@ void CGUIDialogAddonInfo::UpdateControls() - bool canDisable = isInstalled && CAddonMgr::GetInstance().CanAddonBeDisabled(m_localAddon->ID()); - bool canInstall = !isInstalled && m_item->GetAddonInfo()->Broken().empty(); - bool canUninstall = m_localAddon && CAddonMgr::GetInstance().CanUninstall(m_localAddon); -+ bool isRepo = (isInstalled && m_localAddon->Type() == ADDON_REPOSITORY) || (m_item->GetAddonInfo()->Type() == ADDON_REPOSITORY); - - CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_INSTALL, canInstall || canUninstall); - SET_CONTROL_LABEL(CONTROL_BTN_INSTALL, isInstalled ? 24037 : 24038); -@@ -198,6 +215,7 @@ void CGUIDialogAddonInfo::UpdateControls() - SET_CONTROL_LABEL(CONTROL_BTN_SELECT, CanUse() ? 21480 : (CanOpen() ? 21478 : 21479)); - - CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_SETTINGS, isInstalled && m_localAddon->HasSettings()); -+ CONTROL_ENABLE_ON_CONDITION(CONTROL_BTN_CHANGELOG, !isRepo); - } - - static const std::string LOCAL_CACHE = "\\0_local_cache"; // \0 to give it the lowest priority when sorting -@@ -215,8 +233,7 @@ int CGUIDialogAddonInfo::AskForVersion(std::vectorVersion() == versionInfo.first -- && m_item->GetAddonInfo()->Origin() == versionInfo.second) -+ if (m_localAddon && m_localAddon->Version() == versionInfo.first) - item.Select(true); - - AddonPtr repo; -@@ -442,6 +459,34 @@ void CGUIDialogAddonInfo::OnSettings() - CGUIDialogAddonSettings::ShowAndGetInput(m_localAddon); - } - -+void CGUIDialogAddonInfo::OnChangeLog() -+{ -+ CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER); -+ std::string name = m_localAddon ? m_localAddon->Name() : m_item->GetAddonInfo()->Name(); -+ pDlgInfo->SetHeading(g_localizeStrings.Get(24054)+" - "+name); -+ if (m_item->GetProperty("Addon.Changelog").empty()) -+ { -+ pDlgInfo->SetText(g_localizeStrings.Get(13413)); -+ CFileItemList items; -+ if (m_localAddon && !m_item->GetProperty("Addon.HasUpdate").asBoolean()) -+ { -+ items.Add(CFileItemPtr(new CFileItem(m_localAddon->ChangeLog(),false))); -+ } -+ else -+ items.Add(CFileItemPtr(new CFileItem(m_item->GetAddonInfo()->ChangeLog(),false))); -+ items[0]->Select(true); -+ m_jobid = CJobManager::GetInstance().AddJob( -+ new CFileOperationJob(CFileOperationJob::ActionCopy,items, -+ "special://temp/"),this); -+ } -+ else -+ pDlgInfo->SetText(m_item->GetProperty("Addon.Changelog").asString()); -+ -+ m_changelog = true; -+ pDlgInfo->Open(); -+ m_changelog = false; -+} -+ - bool CGUIDialogAddonInfo::ShowForItem(const CFileItemPtr& item) - { - if (!item) -@@ -467,3 +512,32 @@ bool CGUIDialogAddonInfo::SetItem(const CFileItemPtr& item) - CAddonMgr::GetInstance().GetAddon(item->GetAddonInfo()->ID(), m_localAddon, ADDON_UNKNOWN, false); - return true; - } -+ -+void CGUIDialogAddonInfo::OnJobComplete(unsigned int jobID, bool success, -+ CJob* job) -+{ -+ if (!m_changelog) -+ return; -+ -+ CGUIDialogTextViewer* pDlgInfo = (CGUIDialogTextViewer*)g_windowManager.GetWindow(WINDOW_DIALOG_TEXT_VIEWER); -+ -+ m_jobid = 0; -+ if (!success) -+ { -+ pDlgInfo->SetText(g_localizeStrings.Get(195)); -+ } -+ else -+ { -+ CFile file; -+ XFILE::auto_buffer buf; -+ if (file.LoadFile("special://temp/" + -+ URIUtils::GetFileName(((CFileOperationJob*)job)->GetItems()[0]->GetPath()), buf) > 0) -+ { -+ std::string str(buf.get(), buf.length()); -+ m_item->SetProperty("Addon.Changelog", str); -+ pDlgInfo->SetText(str); -+ } -+ } -+ CGUIMessage msg(GUI_MSG_NOTIFY_ALL, WINDOW_DIALOG_TEXT_VIEWER, 0, GUI_MSG_UPDATE); -+ g_windowManager.SendThreadMessage(msg); -+} -diff --git a/xbmc/addons/GUIDialogAddonInfo.h b/xbmc/addons/GUIDialogAddonInfo.h -index aa99800..8d0778e 100644 ---- a/xbmc/addons/GUIDialogAddonInfo.h -+++ b/xbmc/addons/GUIDialogAddonInfo.h -@@ -20,14 +20,13 @@ - * - */ - --#include --#include --#include -- - #include "guilib/GUIDialog.h" - #include "addons/IAddon.h" -+#include "utils/Job.h" - --class CGUIDialogAddonInfo : public CGUIDialog -+class CGUIDialogAddonInfo : -+ public CGUIDialog, -+ public IJobCallback - { - public: - CGUIDialogAddonInfo(void); -@@ -40,6 +39,9 @@ public: - - static bool ShowForItem(const CFileItemPtr& item); - -+ // job callback -+ void OnJobComplete(unsigned int jobID, bool success, CJob* job); -+ - private: - void OnInitWindow(); - -@@ -55,6 +57,7 @@ private: - void OnUninstall(); - void OnEnableDisable(); - void OnSettings(); -+ void OnChangeLog(); - void OnSelect(); - void OnToggleAutoUpdates(); - int AskForVersion(std::vector>& versions); -@@ -80,5 +83,7 @@ private: - CFileItemPtr m_item; - ADDON::AddonPtr m_localAddon; - bool m_addonEnabled; -+ unsigned int m_jobid; -+ bool m_changelog; - }; - -diff --git a/xbmc/addons/GUIDialogAddonSettings.cpp b/xbmc/addons/GUIDialogAddonSettings.cpp -index 1c9a05e..b7b1c12 100644 ---- a/xbmc/addons/GUIDialogAddonSettings.cpp -+++ b/xbmc/addons/GUIDialogAddonSettings.cpp -@@ -244,7 +244,7 @@ bool CGUIDialogAddonSettings::ShowVirtualKeyboard(int iControl) - const std::string id = XMLUtils::GetAttribute(setting, "id"); - const std::string type = XMLUtils::GetAttribute(setting, "type"); - -- //! @todo Refactor me. Special handling for actions: does not require id attribute. -+ //Special handling for actions: does not require id attribute. TODO: refactor me. - if (control && control->GetControlType() == CGUIControl::GUICONTROL_BUTTON && type == "action") - { - const char *option = setting->Attribute("option"); -diff --git a/xbmc/addons/GUIDialogAddonSettings.h b/xbmc/addons/GUIDialogAddonSettings.h -index be85195..2b25c53 100644 ---- a/xbmc/addons/GUIDialogAddonSettings.h -+++ b/xbmc/addons/GUIDialogAddonSettings.h -@@ -19,10 +19,6 @@ - * - */ - --#include --#include --#include -- - #include "dialogs/GUIDialogBoxBase.h" - #include "IAddon.h" - -diff --git a/xbmc/addons/GUIWindowAddonBrowser.h b/xbmc/addons/GUIWindowAddonBrowser.h -index 0831fd9..894d3f2 100644 ---- a/xbmc/addons/GUIWindowAddonBrowser.h -+++ b/xbmc/addons/GUIWindowAddonBrowser.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "addons/Addon.h" - #include "windows/GUIMediaWindow.h" - #include "ThumbLoader.h" -diff --git a/xbmc/addons/IAddon.h b/xbmc/addons/IAddon.h -index fcabb6a..3d913ba 100644 ---- a/xbmc/addons/IAddon.h -+++ b/xbmc/addons/IAddon.h -@@ -114,8 +114,6 @@ namespace ADDON - virtual CDateTime InstallDate() const =0; - virtual CDateTime LastUpdated() const =0; - virtual CDateTime LastUsed() const =0; -- virtual std::string Origin() const =0; -- virtual uint64_t PackageSize() const =0; - virtual const InfoMap &ExtraInfo() const =0; - virtual bool HasSettings() =0; - virtual void SaveSettings() =0; -diff --git a/xbmc/addons/InputStream.cpp b/xbmc/addons/InputStream.cpp -index 9d093b8..b4d3561 100644 ---- a/xbmc/addons/InputStream.cpp -+++ b/xbmc/addons/InputStream.cpp -@@ -34,19 +34,16 @@ std::unique_ptr CInputStream::FromExtension(AddonProps props, cons - { - std::string listitemprops = CAddonMgr::GetInstance().GetExtValue(ext->configuration, "@listitemprops"); - std::string extensions = CAddonMgr::GetInstance().GetExtValue(ext->configuration, "@extension"); -- std::string protocols = CAddonMgr::GetInstance().GetExtValue(ext->configuration, "@protocols"); - std::string name(ext->plugin->identifier); -- std::unique_ptr istr(new CInputStream(props, name, listitemprops, -- extensions, protocols)); -+ std::unique_ptr istr(new CInputStream(std::move(props), -+ std::move(name), -+ std::move(listitemprops), -+ std::move(extensions))); - istr->CheckConfig(); - return istr; - } - --CInputStream::CInputStream(const AddonProps& props, -- const std::string& name, -- const std::string& listitemprops, -- const std::string& extensions, -- const std::string& protocols) -+CInputStream::CInputStream(AddonProps props, std::string name, std::string listitemprops, std::string extensions) - : InputStreamDll(std::move(props)) - { - m_fileItemProps = StringUtils::Tokenize(listitemprops, "|"); -@@ -61,12 +58,6 @@ CInputStream::CInputStream(const AddonProps& props, - { - StringUtils::Trim(ext); - } -- -- m_protocolsList = StringUtils::Tokenize(protocols, "|"); -- for (auto &ext : m_protocolsList) -- { -- StringUtils::Trim(ext); -- } - } - - void CInputStream::SaveSettings() -@@ -165,15 +156,6 @@ bool CInputStream::Supports(const CFileItem &fileitem) - return true; - } - -- // check protocols -- std::string protocol = fileitem.GetURL().GetProtocol(); -- if (!protocol.empty()) -- { -- if (std::find(m_protocolsList.begin(), -- m_protocolsList.end(), protocol) != m_protocolsList.end()) -- return true; -- } -- - // check paths - CSingleLock lock(m_parentSection); - auto it = m_configMap.find(ID()); -@@ -376,7 +358,7 @@ void CInputStream::UpdateStreams() - } - else if (stream.m_streamType == INPUTSTREAM_INFO::TYPE_SUBTITLE) - { -- //! @todo needs identifier in INPUTSTREAM_INFO -+ // TODO needs identifier in INPUTSTREAM_INFO - continue; - } - else -diff --git a/xbmc/addons/InputStream.h b/xbmc/addons/InputStream.h -index 61273a9..4912ee1 100644 ---- a/xbmc/addons/InputStream.h -+++ b/xbmc/addons/InputStream.h -@@ -42,11 +42,7 @@ namespace ADDON - explicit CInputStream(AddonProps props) - : InputStreamDll(std::move(props)) - {}; -- CInputStream(const AddonProps& props, -- const std::string& name, -- const std::string& listitemprops, -- const std::string& extensions, -- const std::string& protocols); -+ CInputStream(AddonProps props, std::string name, std::string listitemprops, std::string extensions); - virtual ~CInputStream() {} - - virtual void SaveSettings() override; -@@ -99,7 +95,6 @@ namespace ADDON - - std::vector m_fileItemProps; - std::vector m_extensionsList; -- std::vector m_protocolsList; - INPUTSTREAM_CAPABILITIES m_caps; - std::map m_streams; - -diff --git a/xbmc/addons/LanguageResource.cpp b/xbmc/addons/LanguageResource.cpp -index 91b6355..33c9ed4 100644 ---- a/xbmc/addons/LanguageResource.cpp -+++ b/xbmc/addons/LanguageResource.cpp -@@ -195,7 +195,7 @@ bool CLanguageResource::FindLanguageAddonByName(const std::string &legacyLanguag - VECADDONS addons; - if (!languageAddons.empty()) - addons = languageAddons; -- else if (!CAddonMgr::GetInstance().GetInstalledAddons(addons, ADDON_RESOURCE_LANGUAGE) || addons.empty()) -+ else if (!CAddonMgr::GetInstance().GetAddons(addons, ADDON_RESOURCE_LANGUAGE) || addons.empty()) - return false; - - // try to find a language that matches the old language in name or id -diff --git a/xbmc/addons/PVRClient.cpp b/xbmc/addons/PVRClient.cpp -index e617adb..bc44db6 100644 ---- a/xbmc/addons/PVRClient.cpp -+++ b/xbmc/addons/PVRClient.cpp -@@ -166,7 +166,7 @@ ADDON_STATUS CPVRClient::Create(int iClientId) - - /* initialise the add-on */ - bool bReadyToUse(false); -- CLog::Log(LOGDEBUG, "PVR - %s - creating PVR add-on instance '%s'", __FUNCTION__, Name().c_str()); -+ CLog::Log(LOGPVR, "PVR - %s - creating PVR add-on instance '%s'", __FUNCTION__, Name().c_str()); - try - { - if ((status = CAddonDll::Create()) == ADDON_STATUS_OK) -@@ -193,7 +193,7 @@ void CPVRClient::Destroy(void) - m_bReadyToUse = false; - - /* reset 'ready to use' to false */ -- CLog::Log(LOGDEBUG, "PVR - %s - destroying PVR add-on '%s'", __FUNCTION__, GetFriendlyName().c_str()); -+ CLog::Log(LOGPVR, "PVR - %s - destroying PVR add-on '%s'", __FUNCTION__, GetFriendlyName().c_str()); - - /* destroy the add-on */ - try { CAddonDll::Destroy(); } -@@ -889,7 +889,7 @@ PVR_ERROR CPVRClient::GetChannelGroupMembers(CPVRChannelGroup *group) - PVR_CHANNEL_GROUP tag; - WriteClientGroupInfo(*group, tag); - -- CLog::Log(LOGDEBUG, "PVR - %s - get group members for group '%s' from add-on '%s'", -+ CLog::Log(LOGPVR, "PVR - %s - get group members for group '%s' from add-on '%s'", - __FUNCTION__, tag.strGroupName, GetFriendlyName().c_str()); - retVal = m_pStruct->GetChannelGroupMembers(&handle, tag); - -@@ -1739,11 +1739,11 @@ bool CPVRClient::OpenStream(const CPVRChannelPtr &channel, bool bIsSwitchingChan - - if(!CanPlayChannel(channel)) - { -- CLog::Log(LOGDEBUG, "add-on '%s' can not play channel '%s'", GetFriendlyName().c_str(), channel->ChannelName().c_str()); -+ CLog::Log(LOGPVR, "add-on '%s' can not play channel '%s'", GetFriendlyName().c_str(), channel->ChannelName().c_str()); - } - else if (!channel->StreamURL().empty()) - { -- CLog::Log(LOGDEBUG, "opening live stream on url '%s'", channel->StreamURL().c_str()); -+ CLog::Log(LOGPVR, "opening live stream on url '%s'", channel->StreamURL().c_str()); - bReturn = true; - - // the Njoy N7 sometimes doesn't switch channels, but opens a stream to the previous channel -@@ -1759,7 +1759,7 @@ bool CPVRClient::OpenStream(const CPVRChannelPtr &channel, bool bIsSwitchingChan - } - else - { -- CLog::Log(LOGDEBUG, "opening live stream for channel '%s'", channel->ChannelName().c_str()); -+ CLog::Log(LOGPVR, "opening live stream for channel '%s'", channel->ChannelName().c_str()); - PVR_CHANNEL tag; - WriteClientChannelInfo(channel, tag); - -@@ -1982,14 +1982,14 @@ bool CPVRClient::Autoconfigure(void) - { - // %s service found at %s - std::string strLogLine(StringUtils::Format(g_localizeStrings.Get(19689).c_str(), (*it).GetName().c_str(), (*it).GetIP().c_str())); -- CLog::Log(LOGDEBUG, "%s - %s", __FUNCTION__, strLogLine.c_str()); -+ CLog::Log(LOGPVR, "%s - %s", __FUNCTION__, strLogLine.c_str()); - - if (DialogResponse::YES != - HELPERS::ShowYesNoDialogLines(CVariant{19688}, // Scanning for PVR services - CVariant{strLogLine}, - CVariant{19690})) // Do you want to use this service? - { -- CLog::Log(LOGDEBUG, "%s - %s service found but not enabled by the user", __FUNCTION__, (*it).GetName().c_str()); -+ CLog::Log(LOGPVR, "%s - %s service found but not enabled by the user", __FUNCTION__, (*it).GetName().c_str()); - m_rejectedAvahiHosts.push_back(*it); - } - else -diff --git a/xbmc/addons/PVRClient.h b/xbmc/addons/PVRClient.h -index 5eef0eb..5d27f17 100644 ---- a/xbmc/addons/PVRClient.h -+++ b/xbmc/addons/PVRClient.h -@@ -19,16 +19,13 @@ - * - */ - --#include --#include --#include -- - #include "addons/Addon.h" - #include "addons/AddonDll.h" - #include "addons/DllPVRClient.h" - #include "network/ZeroconfBrowser.h" - - #include "pvr/channels/PVRChannel.h" -+#include "pvr/recordings/PVRRecordings.h" - - namespace EPG - { -diff --git a/xbmc/addons/Repository.cpp b/xbmc/addons/Repository.cpp -index 3de88c0..dcb196d 100644 ---- a/xbmc/addons/Repository.cpp -+++ b/xbmc/addons/Repository.cpp -@@ -192,12 +192,15 @@ bool CRepository::Parse(const DirInfo& dir, VECADDONS& addons) - std::string file = StringUtils::Format("%s/%s-%s.zip", addon->ID().c_str(), addon->ID().c_str(), addon->Version().asString().c_str()); - addon->Props().path = URIUtils::AddFileToFolder(dir.datadir,file); - SET_IF_NOT_EMPTY(addon->Props().icon,URIUtils::AddFileToFolder(dir.datadir,addon->ID()+"/icon.png")) -+ file = StringUtils::Format("%s/changelog-%s.txt", addon->ID().c_str(), addon->Version().asString().c_str()); -+ SET_IF_NOT_EMPTY(addon->Props().changelog,URIUtils::AddFileToFolder(dir.datadir,file)) - SET_IF_NOT_EMPTY(addon->Props().fanart,URIUtils::AddFileToFolder(dir.datadir,addon->ID()+"/fanart.jpg")) - } - else - { - addon->Props().path = URIUtils::AddFileToFolder(dir.datadir,addon->ID()+"/"); - SET_IF_NOT_EMPTY(addon->Props().icon,URIUtils::AddFileToFolder(dir.datadir,addon->ID()+"/icon.png")) -+ SET_IF_NOT_EMPTY(addon->Props().changelog,URIUtils::AddFileToFolder(dir.datadir,addon->ID()+"/changelog.txt")) - SET_IF_NOT_EMPTY(addon->Props().fanart,URIUtils::AddFileToFolder(dir.datadir,addon->ID()+"/fanart.jpg")) - } - } -@@ -258,7 +261,7 @@ bool CRepositoryUpdateJob::DoWork() - textureDB.CommitMultipleExecute(); - } - -- database.UpdateRepositoryContent(m_repo->ID(), m_repo->Version(), newChecksum, addons); -+ database.UpdateRepositoryContent(m_repo->ID(), addons, newChecksum, m_repo->Version()); - - //Update broken status - database.BeginMultipleExecute(); -@@ -282,7 +285,7 @@ bool CRepositoryUpdateJob::DoWork() - - if (localAddon) - { -- bool brokenInDb = database.IsAddonBroken(addon->ID()); -+ bool brokenInDb = !database.IsAddonBroken(addon->ID()).empty(); - if (!broken.empty() && !brokenInDb) - { - //newly broken -diff --git a/xbmc/addons/Repository.h b/xbmc/addons/Repository.h -index 5ceabc4..b3cac90 100644 ---- a/xbmc/addons/Repository.h -+++ b/xbmc/addons/Repository.h -@@ -19,10 +19,6 @@ - * - */ - --#include --#include --#include -- - #include "Addon.h" - #include "utils/Job.h" - #include "utils/ProgressJob.h" -diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp -index 63e0191..567db49 100644 ---- a/xbmc/addons/Scraper.cpp -+++ b/xbmc/addons/Scraper.cpp -@@ -358,9 +358,9 @@ bool CScraper::Load() - bool result=m_parser.Load(LibPath()); - if (result) - { -- //! @todo this routine assumes that deps are a single level, and assumes the dep is installed. -- //! 1. Does it make sense to have recursive dependencies? -- //! 2. Should we be checking the dep versions or do we assume it is ok? -+ // TODO: this routine assumes that deps are a single level, and assumes the dep is installed. -+ // 1. Does it make sense to have recursive dependencies? -+ // 2. Should we be checking the dep versions or do we assume it is ok? - ADDONDEPS deps = GetDeps(); - ADDONDEPS::iterator itr = deps.begin(); - while (itr != deps.end()) -diff --git a/xbmc/addons/Scraper.h b/xbmc/addons/Scraper.h -index 081aace..2e9357b 100644 ---- a/xbmc/addons/Scraper.h -+++ b/xbmc/addons/Scraper.h -@@ -18,11 +18,6 @@ - * . - * - */ -- --#include --#include --#include -- - #include "addons/Addon.h" - #include "XBDateTime.h" - #include "utils/ScraperUrl.h" -diff --git a/xbmc/addons/Skin.cpp b/xbmc/addons/Skin.cpp -index c57ee3a..7975cea 100644 ---- a/xbmc/addons/Skin.cpp -+++ b/xbmc/addons/Skin.cpp -@@ -311,8 +311,8 @@ bool CSkinInfo::LoadStartupWindows(const cp_extension_t *ext) - m_startupWindows.emplace_back(WINDOW_RADIO_CHANNELS, "19183"); - m_startupWindows.emplace_back(WINDOW_PROGRAMS, "0"); - m_startupWindows.emplace_back(WINDOW_PICTURES, "1"); -- m_startupWindows.emplace_back(WINDOW_MUSIC_NAV, "2"); -- m_startupWindows.emplace_back(WINDOW_VIDEO_NAV, "3"); -+ m_startupWindows.emplace_back(WINDOW_MUSIC, "2"); -+ m_startupWindows.emplace_back(WINDOW_VIDEOS, "3"); - m_startupWindows.emplace_back(WINDOW_FILES, "7"); - m_startupWindows.emplace_back(WINDOW_SETTINGS_MENU, "5"); - m_startupWindows.emplace_back(WINDOW_WEATHER, "8"); -diff --git a/xbmc/addons/Visualisation.h b/xbmc/addons/Visualisation.h -index f5aee2f..10bcb64 100644 ---- a/xbmc/addons/Visualisation.h -+++ b/xbmc/addons/Visualisation.h -@@ -29,7 +29,6 @@ - #include - #include - #include --#include - - #define AUDIO_BUFFER_SIZE 512 // MUST BE A POWER OF 2!!! - #define MAX_AUDIO_BUFFERS 16 -diff --git a/xbmc/addons/binary/interfaces/AddonInterfaces.cpp b/xbmc/addons/binary/interfaces/AddonInterfaces.cpp -index b8d55a8..e317b4f 100644 ---- a/xbmc/addons/binary/interfaces/AddonInterfaces.cpp -+++ b/xbmc/addons/binary/interfaces/AddonInterfaces.cpp -@@ -316,7 +316,7 @@ void CAddonInterfaces::OnApplicationMessage(ThreadMessage* pMsg) - case TMSG_GUI_ADDON_DIALOG: - { - if (pMsg->lpVoid) -- { //! @todo This is ugly - really these binary add-on dialogs should just be normal Kodi dialogs -+ { // TODO: This is ugly - really these binary add-on dialogs should just be normal Kodi dialogs - switch (pMsg->param1) - { - case 1: -diff --git a/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp b/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp -index c0e3e40..a12c804 100644 ---- a/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp -+++ b/xbmc/addons/binary/interfaces/api1/AudioDSP/AddonCallbacksAudioDSP.cpp -@@ -20,8 +20,8 @@ - - #include "Application.h" - #include "cores/AudioEngine/AEFactory.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h" - #include "cores/AudioEngine/Interfaces/AESound.h" - #include "dialogs/GUIDialogKaiToast.h" - #include "settings/AdvancedSettings.h" -diff --git a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp -index 891dafa..92cef20 100644 ---- a/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp -+++ b/xbmc/addons/binary/interfaces/api1/GUI/AddonGUIWindow.cpp -@@ -25,7 +25,6 @@ - #include "addons/Addon.h" - #include "guilib/GUIWindowManager.h" - #include "guilib/TextureManager.h" --#include "input/Key.h" - #include "messaging/ApplicationMessenger.h" - #include "utils/log.h" - #include "utils/URIUtils.h" -@@ -78,9 +77,9 @@ bool CGUIAddonWindow::OnAction(const CAction &action) - - bool CGUIAddonWindow::OnMessage(CGUIMessage& message) - { -- //! @todo We shouldn't be dropping down to CGUIWindow in any of this ideally. -- //! We have to make up our minds about what python should be doing and -- //! what this side of things should be doing -+ // TODO: We shouldn't be dropping down to CGUIWindow in any of this ideally. -+ // We have to make up our minds about what python should be doing and -+ // what this side of things should be doing - switch (message.GetMessage()) - { - case GUI_MSG_WINDOW_DEINIT: -diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/dlfcn-win32.cpp b/xbmc/addons/kodi-addon-dev-kit/include/kodi/dlfcn-win32.cpp -index 2e182a1..5839921 100644 ---- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/dlfcn-win32.cpp -+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/dlfcn-win32.cpp -@@ -36,7 +36,7 @@ static HMODULE global_objects[MAX_OBJECTS]; - - /* This function adds an object to the list of global objects. - * The implementation is very simple and slow. -- * @todo should failing this function be enough to fail the call to dlopen( )? -+ * TODO: should failing this function be enough to fail the call to dlopen( )? - */ - static void global_object_add( HMODULE hModule ) - { -diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h -index 31433a4..591afcc 100644 ---- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h -+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h -@@ -22,7 +22,7 @@ - - #include "kodi_peripheral_types.h" - --#define PERIPHERAL_ADDON_JOYSTICKS //! @todo -+#define PERIPHERAL_ADDON_JOYSTICKS // TODO - - #ifdef __cplusplus - extern "C" -diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h -index f81ee74..85e2363 100644 ---- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h -+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h -@@ -268,7 +268,7 @@ extern "C" - } ATTRIBUTE_PACKED JOYSTICK_FEATURE; - ///} - -- //! @todo Mouse, light gun, multitouch -+ // TODO: Mouse, light gun, multitouch - - /*! - * @brief Structure to transfer the methods from kodi_peripheral_dll.h to the frontend -diff --git a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h -index 516bb86..700f912 100644 ---- a/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h -+++ b/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h -@@ -36,7 +36,7 @@ - - #define DVD_TIME_BASE 1000000 - --//! @todo original definition is in DVDClock.h -+//TODO original definition is in DVDClock.h - #define DVD_NOPTS_VALUE 0xFFF0000000000000 - - class CHelper_libXBMC_pvr -diff --git a/xbmc/commons/ilog.h b/xbmc/commons/ilog.h -index 0a97616..c234148 100644 ---- a/xbmc/commons/ilog.h -+++ b/xbmc/commons/ilog.h -@@ -45,6 +45,7 @@ - #define LOGSAMBA (1 << (LOGMASKBIT + 0)) - #define LOGCURL (1 << (LOGMASKBIT + 1)) - #define LOGFFMPEG (1 << (LOGMASKBIT + 2)) -+#define LOGRTMP (1 << (LOGMASKBIT + 3)) - #define LOGDBUS (1 << (LOGMASKBIT + 4)) - #define LOGJSONRPC (1 << (LOGMASKBIT + 5)) - #define LOGAUDIO (1 << (LOGMASKBIT + 6)) -@@ -53,6 +54,7 @@ - #define LOGCEC (1 << (LOGMASKBIT + 9)) - #define LOGVIDEO (1 << (LOGMASKBIT + 10)) - #define LOGWEBSERVER (1 << (LOGMASKBIT + 11)) -+#define LOGPVR (1 << (LOGMASKBIT + 12)) - - #include "utils/params_check_macros.h" - -diff --git a/xbmc/cores/AudioEngine/AESinkFactory.cpp b/xbmc/cores/AudioEngine/AESinkFactory.cpp -index 97f22e2..13a6393 100644 ---- a/xbmc/cores/AudioEngine/AESinkFactory.cpp -+++ b/xbmc/cores/AudioEngine/AESinkFactory.cpp -@@ -30,7 +30,7 @@ - #include "Sinks/AESinkALSA.h" - #if defined(HAS_PULSEAUDIO) - #include "Sinks/AESinkPULSE.h" -- #endif -+ #endif - #elif defined(TARGET_DARWIN_IOS) - #include "Sinks/AESinkDARWINIOS.h" - #elif defined(TARGET_DARWIN_OSX) -@@ -278,9 +278,7 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force) - info.m_sinkName = "ALSA"; - CAESinkALSA::EnumerateDevicesEx(info.m_deviceInfoList, force); - if(!info.m_deviceInfoList.empty()) -- { - list.push_back(info); -- } - #endif - - #if defined(HAS_PULSEAUDIO) -@@ -288,10 +286,7 @@ void CAESinkFactory::EnumerateEx(AESinkInfoList &list, bool force) - info.m_sinkName = "PULSE"; - CAESinkPULSE::EnumerateDevicesEx(info.m_deviceInfoList, force); - if(!info.m_deviceInfoList.empty()) -- { - list.push_back(info); -- return; -- } - #endif - - info.m_deviceInfoList.clear(); -diff --git a/xbmc/cores/AudioEngine/CMakeLists.txt b/xbmc/cores/AudioEngine/CMakeLists.txt -index 41190ad..1bced66 100644 ---- a/xbmc/cores/AudioEngine/CMakeLists.txt -+++ b/xbmc/cores/AudioEngine/CMakeLists.txt -@@ -1,11 +1,11 @@ - set(SOURCES AEFactory.cpp - AEResampleFactory.cpp - AESinkFactory.cpp -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.cpp -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPAddon.cpp -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPDatabase.cpp -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.cpp -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPProcess.cpp -+ DSPAddons/ActiveAEDSP.cpp -+ DSPAddons/ActiveAEDSPAddon.cpp -+ DSPAddons/ActiveAEDSPDatabase.cpp -+ DSPAddons/ActiveAEDSPMode.cpp -+ DSPAddons/ActiveAEDSPProcess.cpp - Encoders/AEEncoderFFmpeg.cpp - Engines/ActiveAE/ActiveAE.cpp - Engines/ActiveAE/ActiveAEBuffer.cpp -@@ -25,11 +25,11 @@ set(SOURCES AEFactory.cpp - set(HEADERS AEFactory.h - AEResampleFactory.h - AESinkFactory.h -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPAddon.h -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPDatabase.h -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.h -- Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPProcess.h -+ DSPAddons/ActiveAEDSP.h -+ DSPAddons/ActiveAEDSPAddon.h -+ DSPAddons/ActiveAEDSPDatabase.h -+ DSPAddons/ActiveAEDSPMode.h -+ DSPAddons/ActiveAEDSPProcess.h - Encoders/AEEncoderFFmpeg.h - Engines/ActiveAE/ActiveAE.h - Engines/ActiveAE/ActiveAEBuffer.h -@@ -95,7 +95,7 @@ if(CORE_SYSTEM_NAME STREQUAL rbpi) - Sinks/AESinkPi.h) - endif() - --if(CORE_SYSTEM_NAME STREQUAL osx) -+if(CORE_SYSTEM_NAME STREQUAL darwin) - list(APPEND SOURCES Sinks/AESinkDARWINOSX.cpp - Sinks/osx/AEDeviceEnumerationOSX.cpp - Sinks/osx/CoreAudioChannelLayout.cpp -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp -new file mode 100644 -index 0000000..5dce177 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.cpp -@@ -0,0 +1,935 @@ -+/* -+ * Copyright (C) 2010-2015 Team Kodi -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with Kodi; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "ActiveAEDSP.h" -+ -+#include -+#include -+ -+extern "C" { -+#include "libavutil/channel_layout.h" -+} -+ -+#include "ActiveAEDSPProcess.h" -+#include "addons/AddonInstaller.h" -+#include "addons/AddonSystemSettings.h" -+#include "addons/GUIDialogAddonSettings.h" -+#include "Application.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" -+#include "cores/AudioEngine/Interfaces/AEResample.h" -+#include "cores/AudioEngine/Utils/AEUtil.h" -+#include "cores/IPlayer.h" -+#include "dialogs/GUIDialogKaiToast.h" -+#include "dialogs/GUIDialogOK.h" -+#include "dialogs/GUIDialogSelect.h" -+#include "guiinfo/GUIInfoLabels.h" -+#include "guilib/GUIWindowManager.h" -+#include "GUIUserMessages.h" -+#include "messaging/ApplicationMessenger.h" -+#include "messaging/helpers/DialogHelper.h" -+#include "settings/AdvancedSettings.h" -+#include "settings/dialogs/GUIDialogAudioDSPManager.h" -+#include "settings/MediaSettings.h" -+#include "settings/MediaSourceSettings.h" -+#include "settings/Settings.h" -+#include "utils/JobManager.h" -+#include "utils/StringUtils.h" -+ -+ -+using namespace ADDON; -+using namespace ActiveAE; -+using namespace KODI::MESSAGING; -+ -+using KODI::MESSAGING::HELPERS::DialogResponse; -+ -+#define MIN_DSP_ARRAY_SIZE 4096 -+ -+/*! @name Master audio dsp control class */ -+//@{ -+CActiveAEDSP::CActiveAEDSP() -+ : m_isActive(false) -+ , m_usedProcessesCnt(0) -+ , m_activeProcessId(-1) -+ , m_isValidAudioDSPSettings(false) -+{ -+ Cleanup(); -+} -+ -+CActiveAEDSP::~CActiveAEDSP() -+{ -+ Deactivate(); -+ CAddonMgr::GetInstance().UnregisterAddonMgrCallback(ADDON_ADSPDLL); -+ CSettings::GetInstance().UnregisterCallback(this); -+ CLog::Log(LOGDEBUG, "ActiveAE DSP - destroyed"); -+} -+ -+void CActiveAEDSP::Init(void) -+{ -+ std::set settingSet; -+ settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_DSPADDONSENABLED); -+ settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_DSPSETTINGS); -+ settingSet.insert(CSettings::SETTING_AUDIOOUTPUT_DSPRESETDB); -+ CSettings::GetInstance().RegisterCallback(this, settingSet); -+ -+ CAddonMgr::GetInstance().RegisterAddonMgrCallback(ADDON_ADSPDLL, this); -+ -+ if (CSettings::GetInstance().GetBool(CSettings::SETTING_AUDIOOUTPUT_DSPADDONSENABLED)) -+ Activate(); -+} -+//@} -+ -+/*! @name initialization and configuration methods */ -+//@{ -+void CActiveAEDSP::Activate(void) -+{ -+ /* first stop and remove any audio dsp add-on's */ -+ Deactivate(); -+ -+ CSingleLock lock(m_critSection); -+ -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - starting"); -+ -+ UpdateAddons(); -+ m_isActive = true; -+} -+ -+class CActiveAEDSPModeUpdateJob : public CJob -+{ -+public: -+ CActiveAEDSPModeUpdateJob() {} -+ ~CActiveAEDSPModeUpdateJob(void) {} -+ -+ bool DoWork(void) -+ { -+ CServiceBroker::GetADSP().TriggerModeUpdate(false); -+ return true; -+ } -+}; -+ -+void CActiveAEDSP::TriggerModeUpdate(bool bAsync /* = true */) -+{ -+ if (bAsync) -+ { -+ CActiveAEDSPModeUpdateJob *job = new CActiveAEDSPModeUpdateJob(); -+ CJobManager::GetInstance().AddJob(job, NULL); -+ return; -+ } -+ -+ CLog::Log(LOGINFO, "ActiveAE DSP - %s - Update mode selections", __FUNCTION__); -+ -+ if (!m_databaseDSP.IsOpen()) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - failed to open the database"); -+ return; -+ } -+ -+ for (unsigned int i = 0; i < AE_DSP_MODE_TYPE_MAX; ++i) -+ { -+ m_modes[i].clear(); -+ m_databaseDSP.GetModes(m_modes[i], i); -+ } -+ -+ /* -+ * if any dsp processing is active restart playback -+ */ -+ if (m_usedProcessesCnt > 0) -+ { -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - restarting playback after disabled dsp system"); -+ CApplicationMessenger::GetInstance().SendMsg(TMSG_MEDIA_RESTART); -+ } -+} -+ -+void CActiveAEDSP::Deactivate(void) -+{ -+ /* check whether the audio dsp is loaded */ -+ if (!m_isActive) -+ return; -+ -+ CSingleLock lock(m_critSection); -+ -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - stopping"); -+ -+ m_addonMap.clear(); -+ -+ /* unload all data */ -+ Cleanup(); -+ -+ /* close database */ -+ if (m_databaseDSP.IsOpen()) -+ m_databaseDSP.Close(); -+} -+ -+void CActiveAEDSP::Cleanup(void) -+{ -+ CActiveAEDSPProcessPtr tmp; -+ for (unsigned int i = 0; i < AE_DSP_STREAM_MAX_STREAMS; ++i) -+ m_usedProcesses[i] = tmp; -+ -+ m_isActive = false; -+ m_usedProcessesCnt = 0; -+ m_isValidAudioDSPSettings = false; -+ -+ for (unsigned int i = 0; i < AE_DSP_MODE_TYPE_MAX; ++i) -+ m_modes[i].clear(); -+} -+ -+bool CActiveAEDSP::InstallAddonAllowed(const std::string &strAddonId) const -+{ -+ return !m_isActive || -+ !IsInUse(strAddonId) || -+ m_usedProcessesCnt == 0; -+} -+ -+void CActiveAEDSP::ResetDatabase(void) -+{ -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - clearing the audio DSP database"); -+ -+ if (IsProcessing()) -+ { -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - stopping playback"); -+ CApplicationMessenger::GetInstance().PostMsg(TMSG_MEDIA_STOP); -+ } -+ -+ /* stop the system */ -+ Deactivate(); -+ -+ if (m_databaseDSP.Open()) -+ { -+ m_databaseDSP.DeleteModes(); -+ m_databaseDSP.DeleteActiveDSPSettings(); -+ m_databaseDSP.DeleteAddons(); -+ -+ m_databaseDSP.Close(); -+ } -+ -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - database cleared"); -+ -+ CLog::Log(LOGNOTICE, "ActiveAE DSP - restarting the audio DSP handler"); -+ m_databaseDSP.Open(); -+ Cleanup(); -+ Activate(); -+} -+//@} -+ -+/*! @name Settings and action callback methods (OnAction currently unused */ -+//@{ -+void CActiveAEDSP::OnSettingAction(const CSetting *setting) -+{ -+ if (setting == NULL) -+ return; -+ -+ const std::string &settingId = setting->GetId(); -+ -+ if (settingId == CSettings::SETTING_AUDIOOUTPUT_DSPSETTINGS) -+ { -+ if (!IsActivated() || !HasAvailableModes()) -+ { -+ CGUIDialogOK::ShowAndGetInput(14117, 0, 15065, 0); -+ return; -+ } -+ -+ CGUIDialogAudioDSPManager *dialog = (CGUIDialogAudioDSPManager *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_DSP_MANAGER); -+ if (dialog) -+ dialog->Open(); -+ } -+ else if (settingId == CSettings::SETTING_AUDIOOUTPUT_DSPRESETDB) -+ { -+ if (HELPERS::ShowYesNoDialogLines(CVariant{19098}, CVariant{36440}, CVariant{750}) == -+ DialogResponse::YES) -+ { -+ CDateTime::ResetTimezoneBias(); -+ ResetDatabase(); -+ } -+ } -+} -+//@} -+ -+/*! @name addon installation callback methods */ -+//@{ -+bool CActiveAEDSP::RequestRestart(AddonPtr addon, bool bDataChanged) -+{ -+ return StopAudioDSPAddon(addon, true); -+} -+ -+bool CActiveAEDSP::RequestRemoval(AddonPtr addon) -+{ -+ return StopAudioDSPAddon(addon, false); -+} -+ -+bool CActiveAEDSP::IsInUse(const std::string &strAddonId) const -+{ -+ CSingleLock lock(m_critSection); -+ -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(citr->second->ID()) && citr->second->ID() == strAddonId) -+ return true; -+ return false; -+} -+ -+bool CActiveAEDSP::IsKnownAudioDSPAddon(const AddonPtr &addon) const -+{ -+ // database IDs start at 1 -+ return GetAudioDSPAddonId(addon) > 0; -+} -+ -+int CActiveAEDSP::GetAudioDSPAddonId(const AddonPtr &addon) const -+{ -+ CSingleLock lock(m_critUpdateSection); -+ -+ for (auto &entry : m_addonMap) -+ { -+ if (entry.second->ID() == addon->ID()) -+ { -+ return entry.first; -+ } -+ } -+ -+ return -1; -+} -+//@} -+ -+/*! @name GUIInfoManager calls */ -+//@{ -+bool CActiveAEDSP::TranslateBoolInfo(DWORD dwInfo) const -+{ -+ bool bReturn(false); -+ -+ CSingleLock lock(m_critSection); -+ -+ if (dwInfo == ADSP_HAS_MODES) -+ return HasAvailableModes(); -+ -+ if (!IsProcessing() || !m_usedProcesses[m_activeProcessId]) -+ return bReturn; -+ -+ switch (dwInfo) -+ { -+ case ADSP_IS_ACTIVE: -+ bReturn = true; -+ break; -+ case ADSP_HAS_INPUT_RESAMPLE: -+ bReturn = m_usedProcesses[m_activeProcessId]->HasActiveModes(AE_DSP_MODE_TYPE_INPUT_RESAMPLE); -+ break; -+ case ADSP_HAS_PRE_PROCESS: -+ bReturn = m_usedProcesses[m_activeProcessId]->HasActiveModes(AE_DSP_MODE_TYPE_PRE_PROCESS); -+ break; -+ case ADSP_HAS_MASTER_PROCESS: -+ bReturn = m_usedProcesses[m_activeProcessId]->HasActiveModes(AE_DSP_MODE_TYPE_MASTER_PROCESS); -+ break; -+ case ADSP_HAS_POST_PROCESS: -+ bReturn = m_usedProcesses[m_activeProcessId]->HasActiveModes(AE_DSP_MODE_TYPE_POST_PROCESS); -+ break; -+ case ADSP_HAS_OUTPUT_RESAMPLE: -+ bReturn = m_usedProcesses[m_activeProcessId]->HasActiveModes(AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE); -+ break; -+ case ADSP_MASTER_ACTIVE: -+ bReturn = m_usedProcesses[m_activeProcessId]->GetActiveMasterMode() != NULL; -+ break; -+ default: -+ break; -+ }; -+ -+ return bReturn; -+} -+ -+bool CActiveAEDSP::TranslateCharInfo(DWORD dwInfo, std::string &strValue) const -+{ -+ bool bReturn(true); -+ -+ CSingleLock lock(m_critSection); -+ -+ if (!IsProcessing() || !m_usedProcesses[m_activeProcessId]) -+ return false; -+ -+ CActiveAEDSPModePtr activeMaster = m_usedProcesses[m_activeProcessId]->GetActiveMasterMode(); -+ if (activeMaster == NULL) -+ return false; -+ -+ switch (dwInfo) -+ { -+ case ADSP_ACTIVE_STREAM_TYPE: -+ strValue = g_localizeStrings.Get(GetStreamTypeName(m_usedProcesses[m_activeProcessId]->GetUsedStreamType())); -+ break; -+ case ADSP_DETECTED_STREAM_TYPE: -+ strValue = g_localizeStrings.Get(GetStreamTypeName(m_usedProcesses[m_activeProcessId]->GetDetectedStreamType())); -+ break; -+ case ADSP_MASTER_NAME: -+ { -+ AE_DSP_ADDON addon; -+ int modeId = activeMaster->ModeID(); -+ if (modeId == AE_DSP_MASTER_MODE_ID_PASSOVER || modeId >= AE_DSP_MASTER_MODE_ID_INTERNAL_TYPES) -+ strValue = g_localizeStrings.Get(activeMaster->ModeName()); -+ else if (CServiceBroker::GetADSP().GetAudioDSPAddon(activeMaster->AddonID(), addon)) -+ strValue = g_localizeStrings.GetAddonString(addon->ID(), activeMaster->ModeName()); -+ } -+ break; -+ case ADSP_MASTER_INFO: -+ bReturn = m_usedProcesses[m_activeProcessId]->GetMasterModeStreamInfoString(strValue); -+ break; -+ case ADSP_MASTER_OWN_ICON: -+ strValue = activeMaster->IconOwnModePath(); -+ break; -+ case ADSP_MASTER_OVERRIDE_ICON: -+ strValue = activeMaster->IconOverrideModePath(); -+ break; -+ default: -+ strValue.clear(); -+ bReturn = false; -+ break; -+ }; -+ -+ return bReturn; -+} -+//@} -+ -+/*! @name Current processing streams control function methods */ -+//@{ -+CAEChannelInfo CActiveAEDSP::GetInternalChannelLayout(AEStdChLayout stdLayout) -+{ -+ uint64_t channelLayoutOut; -+ switch (stdLayout) -+ { -+ default: -+ case AE_CH_LAYOUT_2_0: -+ channelLayoutOut = AV_CH_LAYOUT_STEREO; -+ break; -+ case AE_CH_LAYOUT_2_1: -+ channelLayoutOut = AV_CH_LAYOUT_2POINT1; -+ break; -+ case AE_CH_LAYOUT_3_0: -+ channelLayoutOut = AV_CH_LAYOUT_SURROUND; -+ break; -+ case AE_CH_LAYOUT_3_1: -+ channelLayoutOut = AV_CH_LAYOUT_3POINT1; -+ break; -+ case AE_CH_LAYOUT_4_0: -+ channelLayoutOut = AV_CH_LAYOUT_2_2; -+ break; -+ case AE_CH_LAYOUT_4_1: -+ channelLayoutOut = AV_CH_LAYOUT_2_2|AV_CH_LOW_FREQUENCY; -+ break; -+ case AE_CH_LAYOUT_5_0: -+ channelLayoutOut = AV_CH_LAYOUT_5POINT0; -+ break; -+ case AE_CH_LAYOUT_5_1: -+ channelLayoutOut = AV_CH_LAYOUT_5POINT1; -+ break; -+ case AE_CH_LAYOUT_7_0: -+ channelLayoutOut = AV_CH_LAYOUT_7POINT0; -+ break; -+ case AE_CH_LAYOUT_7_1: -+ channelLayoutOut = AV_CH_LAYOUT_7POINT1; -+ break; -+ } -+ return CAEUtil::GetAEChannelLayout(channelLayoutOut); -+} -+ -+bool CActiveAEDSP::CreateDSPs(unsigned int &streamId, CActiveAEDSPProcessPtr &process, const AEAudioFormat &inputFormat, const AEAudioFormat &outputFormat, bool upmix, -+ AEQuality quality, enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type, -+ int profile, bool wasActive) -+{ -+ if (!IsActivated() || m_usedProcessesCnt >= AE_DSP_STREAM_MAX_STREAMS) -+ return false; -+ -+ CSingleLock lock(m_critSection); -+ -+ AE_DSP_STREAMTYPE requestedStreamType = LoadCurrentAudioSettings(); -+ -+ CActiveAEDSPProcessPtr usedProc; -+ if (wasActive && streamId != (unsigned int)-1 && streamId < AE_DSP_STREAM_MAX_STREAMS) -+ { -+ if (m_usedProcesses[streamId] != NULL) -+ { -+ usedProc = m_usedProcesses[streamId]; -+ } -+ } -+ else -+ { -+ for (unsigned int i = 0; i < AE_DSP_STREAM_MAX_STREAMS; ++i) -+ { -+ /* find a free position */ -+ if (m_usedProcesses[i] == NULL) -+ { -+ usedProc = CActiveAEDSPProcessPtr(new CActiveAEDSPProcess(i)); -+ streamId = i; -+ break; -+ } -+ } -+ } -+ -+ if (usedProc == NULL) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - can't find active processing class", __FUNCTION__); -+ return false; -+ } -+ -+ if (!usedProc->Create(inputFormat, outputFormat, upmix, quality, requestedStreamType, matrix_encoding, audio_service_type, profile)) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - Creation of processing class failed", __FUNCTION__); -+ return false; -+ } -+ -+ if (!wasActive) -+ { -+ process = usedProc; -+ m_activeProcessId = streamId; -+ m_usedProcesses[streamId] = usedProc; -+ m_usedProcessesCnt++; -+ } -+ return true; -+} -+ -+void CActiveAEDSP::DestroyDSPs(unsigned int streamId) -+{ -+ CSingleLock lock(m_critSection); -+ -+ if (streamId != (unsigned int)-1 && m_usedProcesses[streamId] != NULL) -+ { -+ m_usedProcesses[streamId]->Destroy(); -+ m_usedProcesses[streamId] = CActiveAEDSPProcessPtr(); -+ --m_usedProcessesCnt; -+ } -+ if (m_usedProcessesCnt == 0) -+ { -+ m_activeProcessId = -1; -+ } -+} -+ -+CActiveAEDSPProcessPtr CActiveAEDSP::GetDSPProcess(unsigned int streamId) -+{ -+ CSingleLock lock(m_critSection); -+ -+ if (streamId != (unsigned int)-1 && m_usedProcesses[streamId]) -+ return m_usedProcesses[streamId]; -+ return CActiveAEDSPProcessPtr(); -+} -+ -+unsigned int CActiveAEDSP::GetProcessingStreamsAmount(void) -+{ -+ CSingleLock lock(m_critSection); -+ return m_usedProcessesCnt; -+} -+ -+unsigned int CActiveAEDSP::GetActiveStreamId(void) -+{ -+ CSingleLock lock(m_critSection); -+ -+ return m_activeProcessId; -+} -+ -+bool CActiveAEDSP::HasAvailableModes(void) const -+{ -+ CSingleLock lock(m_critSection); -+ -+ for (unsigned int i = 0; i < AE_DSP_MODE_TYPE_MAX; ++i) -+ { -+ if (!m_modes[i].empty()) -+ return true; -+ } -+ -+ return false; -+} -+ -+const AE_DSP_MODELIST &CActiveAEDSP::GetAvailableModes(AE_DSP_MODE_TYPE modeType) -+{ -+ static AE_DSP_MODELIST emptyArray; -+ if (modeType < 0 || modeType >= AE_DSP_MODE_TYPE_MAX) -+ return emptyArray; -+ -+ CSingleLock lock(m_critSection); -+ return m_modes[modeType]; -+} -+ -+/*! @name addon update process methods */ -+//@{ -+bool CActiveAEDSP::StopAudioDSPAddon(AddonPtr addon, bool bRestart) -+{ -+ CSingleLock lock(m_critSection); -+ -+ int iId = GetAudioDSPAddonId(addon); -+ AE_DSP_ADDON mappedAddon; -+ if (GetReadyAudioDSPAddon(iId, mappedAddon)) -+ { -+ if (bRestart) -+ mappedAddon->ReCreate(); -+ else -+ mappedAddon->Destroy(); -+ -+ return true; -+ } -+ -+ return false; -+} -+ -+void CActiveAEDSP::UpdateAddons() -+{ -+ VECADDONS addons; -+ AE_DSP_ADDON dspAddon; -+ -+ CAddonMgr::GetInstance().GetAddons(addons, ADDON_ADSPDLL); -+ -+ if (addons.empty()) -+ return; -+ -+ for (auto &addon : addons) -+ { -+ bool bEnabled = !CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()); -+ if (bEnabled && (!IsKnownAudioDSPAddon(addon) || !IsReadyAudioDSPAddon(addon))) -+ { -+ std::hash hasher; -+ int iAddonId = static_cast(hasher(addon->ID())); -+ if (iAddonId < 0) -+ iAddonId = -iAddonId; -+ -+ /* create and open database */ -+ if (!m_databaseDSP.IsOpen()) -+ m_databaseDSP.Open(); -+ -+ if (IsKnownAudioDSPAddon(addon)) -+ { -+ AE_DSP_ADDON dspAddon; -+ GetAudioDSPAddon(iAddonId, dspAddon); -+ dspAddon->Create(iAddonId); -+ } -+ else -+ { -+ AE_DSP_ADDON dspAddon = std::dynamic_pointer_cast(addon); -+ if (!dspAddon) -+ { -+ CLog::Log(LOGERROR, "CActiveAEDSP::UpdateAndInitialiseAddons - severe error, incorrect add type"); -+ continue; -+ } -+ -+ dspAddon.get()->Create(iAddonId); -+ // register the add-on -+ if (m_addonMap.find(iAddonId) == m_addonMap.end()) -+ { -+ m_addonMap.insert(std::make_pair(iAddonId, dspAddon)); -+ m_addonNameIds.insert(make_pair(addon->ID(), iAddonId)); -+ } -+ } -+ } -+ } -+ -+ TriggerModeUpdate(); -+} -+//@} -+ -+/*! @name Played source settings methods -+ * @note for save of settings see CSaveFileStateJob */ -+//@{ -+AE_DSP_STREAMTYPE CActiveAEDSP::LoadCurrentAudioSettings(void) -+{ -+ CSingleLock lock(m_critSection); -+ -+ AE_DSP_STREAMTYPE type = AE_DSP_ASTREAM_INVALID; -+ -+ if (g_application.m_pPlayer->HasPlayer()) -+ { -+ CFileItem currentFile(g_application.CurrentFileItem()); -+ -+ /* load the persisted audio settings and set them as current */ -+ CAudioSettings loadedAudioSettings = CMediaSettings::GetInstance().GetDefaultAudioSettings(); -+ m_databaseDSP.GetActiveDSPSettings(currentFile, loadedAudioSettings); -+ -+ CMediaSettings::GetInstance().GetCurrentAudioSettings() = loadedAudioSettings; -+ type = (AE_DSP_STREAMTYPE) loadedAudioSettings.m_MasterStreamTypeSel; -+ -+ /* settings can be saved on next audio stream change */ -+ m_isValidAudioDSPSettings = true; -+ } -+ return type; -+} -+//@} -+ -+/*! @name Backend methods */ -+//@{ -+ -+bool CActiveAEDSP::IsProcessing(void) const -+{ -+ return m_isActive && m_usedProcessesCnt > 0; -+} -+ -+bool CActiveAEDSP::IsActivated(void) const -+{ -+ return m_isActive; -+} -+ -+int CActiveAEDSP::EnabledAudioDSPAddonAmount(void) const -+{ -+ int iReturn(0); -+ CSingleLock lock(m_critUpdateSection); -+ -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ { -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(citr->second->ID())) -+ ++iReturn; -+ } -+ -+ return iReturn; -+} -+ -+bool CActiveAEDSP::HasEnabledAudioDSPAddons(void) const -+{ -+ return EnabledAudioDSPAddonAmount() > 0; -+} -+ -+int CActiveAEDSP::GetEnabledAudioDSPAddons(AE_DSP_ADDONMAP &addons) const -+{ -+ int iReturn(0); -+ CSingleLock lock(m_critUpdateSection); -+ -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ { -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(citr->second->ID())) -+ { -+ addons.insert(std::make_pair(citr->second->GetID(), citr->second)); -+ ++iReturn; -+ } -+ } -+ -+ return iReturn; -+} -+ -+int CActiveAEDSP::ReadyAudioDSPAddonAmount(void) const -+{ -+ int iReturn(0); -+ CSingleLock lock(m_critUpdateSection); -+ -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ { -+ if (citr->second->ReadyToUse()) -+ ++iReturn; -+ } -+ -+ return iReturn; -+} -+ -+bool CActiveAEDSP::HasReadyAudioDSPAddons(void) const -+{ -+ return ReadyAudioDSPAddonAmount() > 0; -+} -+ -+bool CActiveAEDSP::IsReadyAudioDSPAddon(int iAddonId) const -+{ -+ AE_DSP_ADDON addon; -+ return GetReadyAudioDSPAddon(iAddonId, addon); -+} -+ -+bool CActiveAEDSP::IsReadyAudioDSPAddon(const AddonPtr &addon) -+{ -+ CSingleLock lock(m_critUpdateSection); -+ -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ { -+ if (citr->second->ID() == addon->ID()) -+ return citr->second->ReadyToUse(); -+ } -+ -+ return false; -+} -+ -+int CActiveAEDSP::GetAddonId(const std::string& strId) const -+{ -+ CSingleLock lock(m_critSection); -+ std::map::const_iterator it = m_addonNameIds.find(strId); -+ return it != m_addonNameIds.end() ? it->second : -1; -+} -+ -+bool CActiveAEDSP::GetReadyAudioDSPAddon(int iAddonId, AE_DSP_ADDON &addon) const -+{ -+ if (GetAudioDSPAddon(iAddonId, addon)) -+ return addon->ReadyToUse(); -+ return false; -+} -+ -+bool CActiveAEDSP::GetAudioDSPAddonName(int iAddonId, std::string &strName) const -+{ -+ bool bReturn(false); -+ AE_DSP_ADDON addon; -+ if ((bReturn = GetReadyAudioDSPAddon(iAddonId, addon)) == true) -+ strName = addon->GetAudioDSPName(); -+ -+ return bReturn; -+} -+ -+bool CActiveAEDSP::GetAudioDSPAddon(int iAddonId, AE_DSP_ADDON &addon) const -+{ -+ bool bReturn(false); -+ if (iAddonId <= AE_DSP_INVALID_ADDON_ID) -+ return bReturn; -+ -+ CSingleLock lock(m_critUpdateSection); -+ -+ AE_DSP_ADDONMAP_CITR citr = m_addonMap.find(iAddonId); -+ if (citr != m_addonMap.end()) -+ { -+ addon = citr->second; -+ bReturn = true; -+ } -+ -+ return bReturn; -+} -+ -+bool CActiveAEDSP::GetAudioDSPAddon(const std::string &strId, AddonPtr &addon) const -+{ -+ CSingleLock lock(m_critUpdateSection); -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ { -+ if (citr->second->ID() == strId) -+ { -+ addon = citr->second; -+ return true; -+ } -+ } -+ return false; -+} -+//@} -+ -+/*! @name Menu hook methods */ -+//@{ -+bool CActiveAEDSP::HaveMenuHooks(AE_DSP_MENUHOOK_CAT cat, int iDSPAddonID) -+{ -+ for (AE_DSP_ADDONMAP_CITR citr = m_addonMap.begin(); citr != m_addonMap.end(); ++citr) -+ { -+ if (citr->second->ReadyToUse()) -+ { -+ if (citr->second->HaveMenuHooks(cat)) -+ { -+ if (iDSPAddonID > 0 && citr->second->GetID() == iDSPAddonID) -+ return true; -+ else if (iDSPAddonID < 0) -+ return true; -+ } -+ else if (cat == AE_DSP_MENUHOOK_SETTING) -+ { -+ AddonPtr addon; -+ if (CAddonMgr::GetInstance().GetAddon(citr->second->ID(), addon) && addon->HasSettings()) -+ return true; -+ } -+ } -+ } -+ -+ return false; -+} -+ -+bool CActiveAEDSP::GetMenuHooks(int iDSPAddonID, AE_DSP_MENUHOOK_CAT cat, AE_DSP_MENUHOOKS &hooks) -+{ -+ bool bReturn(false); -+ -+ if (iDSPAddonID < 0) -+ return bReturn; -+ -+ AE_DSP_ADDON addon; -+ if (GetReadyAudioDSPAddon(iDSPAddonID, addon) && addon->HaveMenuHooks(cat)) -+ { -+ AE_DSP_MENUHOOKS *addonhooks = addon->GetMenuHooks(); -+ for (unsigned int i = 0; i < addonhooks->size(); ++i) -+ { -+ if (cat == AE_DSP_MENUHOOK_ALL || addonhooks->at(i).category == cat) -+ { -+ hooks.push_back(addonhooks->at(i)); -+ bReturn = true; -+ } -+ } -+ } -+ -+ return bReturn; -+} -+//@} -+ -+/*! @name General helper functions */ -+//@{ -+enum AEChannel CActiveAEDSP::GetKODIChannel(AE_DSP_CHANNEL channel) -+{ -+ switch (channel) -+ { -+ case AE_DSP_CH_FL: return AE_CH_FL; -+ case AE_DSP_CH_FR: return AE_CH_FR; -+ case AE_DSP_CH_FC: return AE_CH_FC; -+ case AE_DSP_CH_LFE: return AE_CH_LFE; -+ case AE_DSP_CH_BL: return AE_CH_BL; -+ case AE_DSP_CH_BR: return AE_CH_BR; -+ case AE_DSP_CH_FLOC: return AE_CH_FLOC; -+ case AE_DSP_CH_FROC: return AE_CH_FROC; -+ case AE_DSP_CH_BC: return AE_CH_BC; -+ case AE_DSP_CH_SL: return AE_CH_SL; -+ case AE_DSP_CH_SR: return AE_CH_SR; -+ case AE_DSP_CH_TC: return AE_CH_TC; -+ case AE_DSP_CH_TFL: return AE_CH_TFL; -+ case AE_DSP_CH_TFC: return AE_CH_TFC; -+ case AE_DSP_CH_TFR: return AE_CH_TFR; -+ case AE_DSP_CH_TBL: return AE_CH_TBL; -+ case AE_DSP_CH_TBC: return AE_CH_TBC; -+ case AE_DSP_CH_TBR: return AE_CH_TBR; -+ default: -+ return AE_CH_NULL; -+ } -+} -+ -+AE_DSP_CHANNEL CActiveAEDSP::GetDSPChannel(enum AEChannel channel) -+{ -+ switch (channel) -+ { -+ case AE_CH_FL: return AE_DSP_CH_FL; -+ case AE_CH_FR: return AE_DSP_CH_FR; -+ case AE_CH_FC: return AE_DSP_CH_FC; -+ case AE_CH_LFE: return AE_DSP_CH_LFE; -+ case AE_CH_BL: return AE_DSP_CH_BL; -+ case AE_CH_BR: return AE_DSP_CH_BR; -+ case AE_CH_FLOC: return AE_DSP_CH_FLOC; -+ case AE_CH_FROC: return AE_DSP_CH_FROC; -+ case AE_CH_BC: return AE_DSP_CH_BC; -+ case AE_CH_SL: return AE_DSP_CH_SL; -+ case AE_CH_SR: return AE_DSP_CH_SR; -+ case AE_CH_TC: return AE_DSP_CH_TC; -+ case AE_CH_TFL: return AE_DSP_CH_TFL; -+ case AE_CH_TFC: return AE_DSP_CH_TFC; -+ case AE_CH_TFR: return AE_DSP_CH_TFR; -+ case AE_CH_TBL: return AE_DSP_CH_TBL; -+ case AE_CH_TBC: return AE_DSP_CH_TBC; -+ case AE_CH_TBR: return AE_DSP_CH_TBR; -+ default: -+ return AE_DSP_CH_INVALID; -+ } -+} -+ -+/*! -+ * Contains string name id's related to the AE_DSP_ASTREAM_ values -+ */ -+const int CActiveAEDSP::m_StreamTypeNameTable[] = -+{ -+ 15004, //!< "Basic" -+ 249, //!< "Music" -+ 157, //!< "Video" -+ 15016, //!< "Games" -+ 15005, //!< "Application" -+ 15006, //!< "Phone" -+ 15007, //!< "Message" -+ 14061 //!< "Auto" -+}; -+ -+int CActiveAEDSP::GetStreamTypeName(unsigned int streamType) -+{ -+ if (streamType > AE_DSP_ASTREAM_AUTO) -+ return -1; -+ return m_StreamTypeNameTable[streamType]; -+} -+//@} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h -new file mode 100644 -index 0000000..9631847 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSP.h -@@ -0,0 +1,413 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "ServiceBroker.h" -+#include "cores/AudioEngine/Utils/AEAudioFormat.h" -+#include "cores/AudioEngine/Interfaces/AE.h" -+#include "threads/CriticalSection.h" -+#include "threads/Thread.h" -+#include "utils/Observer.h" -+#include "messaging/IMessageTarget.h" -+ -+#include "ActiveAEDSPAddon.h" -+#include "ActiveAEDSPDatabase.h" -+#include "ActiveAEDSPMode.h" -+ -+#define ACTIVE_AE_DSP_STATE_OFF 0 -+#define ACTIVE_AE_DSP_STATE_ON 1 -+ -+#define ACTIVE_AE_DSP_SYNC_ACTIVATE 0 -+#define ACTIVE_AE_DSP_ASYNC_ACTIVATE 1 -+ -+extern "C" { -+#include "libavcodec/avcodec.h" -+} -+ -+class CAction; -+ -+namespace ActiveAE -+{ -+ class CActiveAEDSPProcess; -+ class CActiveAEDSPAddon; -+ -+ typedef std::shared_ptr CActiveAEDSPProcessPtr; -+ typedef std::map< int, AE_DSP_ADDON > AE_DSP_ADDONMAP; -+ typedef std::map< int, AE_DSP_ADDON >::iterator AE_DSP_ADDONMAP_ITR; -+ typedef std::map< int, AE_DSP_ADDON >::const_iterator AE_DSP_ADDONMAP_CITR; -+ -+ //@{ -+ /*! -+ * Static dsp handling class -+ */ -+ class CActiveAEDSP : public ADDON::IAddonMgrCallback, -+ public ISettingCallback -+ { -+ /*! @name Master audio dsp control class */ -+ //@{ -+ public: -+ /*! -+ * @brief Create a new CActiveAEDSP instance, which handles all audio DSP related operations in KODI. -+ */ -+ CActiveAEDSP(void); -+ -+ /*! -+ * @brief Stop the ActiveAEDSP and destroy all objects it created. -+ */ -+ virtual ~CActiveAEDSP(); -+ -+ void Init(void); -+ //@} -+ -+ /*! @name initialization and configuration methods */ -+ //@{ -+ /*! -+ * @brief Activate the addon dsp processing. -+ */ -+ void Activate(void); -+ -+ /*! -+ * @brief Stops dsp processing and the backend info update thread. -+ */ -+ void Deactivate(void); -+ -+ /*! -+ * @brief Delete all objects and processing classes. -+ */ -+ void Cleanup(void); -+ -+ /*! -+ * @brief Reset the audio dsp database to it's initial state and delete all the data inside. -+ */ -+ void ResetDatabase(void); -+ -+ /*! -+ * @brief Check whether an add-on can be upgraded or installed without restarting the audio dsp, when the add-on is in use -+ * @param strAddonId The add-on to check. -+ * @return True when the add-on can be installed, false otherwise. -+ */ -+ bool InstallAddonAllowed(const std::string& strAddonId) const; -+ -+ /*! -+ * @brief Get the audio dsp database pointer. -+ * @return The audio dsp database. -+ */ -+ CActiveAEDSPDatabase *GetADSPDatabase(void) { return &m_databaseDSP; } -+ //@} -+ -+ /*! @name Settings and action callback methods */ -+ //@{ -+ virtual void OnSettingAction(const CSetting *setting) override; -+ //@} -+ -+ /*! @name Backend methods */ -+ //@{ -+ /*! -+ * @return True when processing is possible -+ */ -+ bool IsActivated(void) const; -+ -+ /*! -+ * @return True when processing is active -+ */ -+ bool IsProcessing(void) const; -+ //@} -+ -+ /*! @name addon installation callback methods */ -+ //@{ -+ /*! -+ * @brief Restart a single audio dsp addon add-on. -+ * @param addon The add-on to restart. -+ * @param bDataChanged True if the addon's data changed, false otherwise (unused). -+ * @return True if the audio dsp addon was found and restarted, false otherwise. -+ */ -+ virtual bool RequestRestart(ADDON::AddonPtr addon, bool bDataChanged) override; -+ -+ /*! -+ * @brief Remove a single audio dsp add-on. -+ * @param addon The add-on to remove. -+ * @return True if it was found and removed, false otherwise. -+ */ -+ virtual bool RequestRemoval(ADDON::AddonPtr addon) override; -+ -+ /*! -+ * @brief Checks whether an add-on is loaded -+ * @param strAddonId The add-on id to check -+ * @return True when in use, false otherwise -+ */ -+ bool IsInUse(const std::string& strAddonId) const; -+ -+ /*! -+ * @brief Stop a audio dsp addon. -+ * @param addon The dsp addon to stop. -+ * @param bRestart If true, restart the addon. -+ * @return True if the it was found, false otherwise. -+ */ -+ bool StopAudioDSPAddon(ADDON::AddonPtr addon, bool bRestart); -+ -+ /*! -+ * @return The amount of enabled audio dsp addons. -+ */ -+ int EnabledAudioDSPAddonAmount(void) const; -+ -+ /*! -+ * @return True when at least one audio dsp addon is known and enabled, false otherwise. -+ */ -+ bool HasEnabledAudioDSPAddons(void) const; -+ -+ /*! -+ * @brief Get all enabled audio dsp addons. -+ * @param addons Store the enabled addons in this map. -+ * @return The amount of enabled audio addons. -+ */ -+ int GetEnabledAudioDSPAddons(AE_DSP_ADDONMAP &addons) const; -+ -+ /*! -+ * @return The amount of ready audio dsp addons on current stream. -+ */ -+ int ReadyAudioDSPAddonAmount(void) const; -+ -+ /*! -+ * @brief Check whether there are any ready audio dsp addons. -+ * @return True if at least one audio dsp addon is ready. -+ */ -+ bool HasReadyAudioDSPAddons(void) const; -+ -+ /*! -+ * @brief Check whether a audio dsp addon ID points to a valid and ready add-on. -+ * @param iAddonId The addon ID. -+ * @return True when the addon ID is valid and ready, false otherwise. -+ */ -+ bool IsReadyAudioDSPAddon(int iAddonId) const; -+ -+ /*! -+ * @brief Check whether a audio dsp addon pointer points to a valid and ready add-on. -+ * @param addon The addon addon pointer. -+ * @return True when the addon pointer is valid and ready, false otherwise. -+ */ -+ bool IsReadyAudioDSPAddon(const ADDON::AddonPtr& addon); -+ -+ /*! -+ * @brief Get the instance of the audio dsp addon. -+ * @param strId The string id of the addon to get. -+ * @param addon The audio dsp addon. -+ * @return True if the addon was found, false otherwise. -+ */ -+ bool GetAudioDSPAddon(const std::string &strId, ADDON::AddonPtr &addon) const; -+ -+ /*! -+ * @brief Get the instance of the audio dsp addon. -+ * @param iAddonId The id of the addon to get. -+ * @param addon The audio dsp addon. -+ * @return True if the addon was found, false otherwise. -+ */ -+ bool GetAudioDSPAddon(int iAddonId, AE_DSP_ADDON &addon) const; -+ -+ /*! -+ * @brief Get the friendly name for the audio dsp addon with the given id. -+ * @param iAddonId The id of the addon. -+ * @param strName The friendly name of the audio dsp addon or an empty string when it wasn't found. -+ * @return True if it was found, false otherwise. -+ */ -+ bool GetAudioDSPAddonName(int iAddonId, std::string &strName) const; -+ -+ /*! -+ * @brief Update add-ons from the AddonManager -+ */ -+ void UpdateAddons(void); -+ -+ int GetAddonId(const std::string& strId) const; -+ //@} -+ -+ /*! @name GUIInfoManager calls */ -+ //@{ -+ /*! -+ * @brief Get a GUIInfoManager boolean. -+ * @param dwInfo The boolean to get. -+ * @return The requested boolean or false if it wasn't found. -+ */ -+ bool TranslateBoolInfo(DWORD dwInfo) const; -+ -+ /*! -+ * @brief Get a GUIInfoManager character string. -+ * @param dwInfo The string to get. -+ * @return The requested string or an empty one if it wasn't found. -+ */ -+ bool TranslateCharInfo(DWORD dwInfo, std::string &strValue) const; -+ //@} -+ -+ /*! @name Current processing streams control function methods */ -+ //@{ -+ /*!> -+ * Get the channel position defination for given channel layout -+ * @param stdLayout The layout identifier -+ * @return the from given identifier set channel information class -+ */ -+ CAEChannelInfo GetInternalChannelLayout(AEStdChLayout stdLayout); -+ -+ /*!> -+ * Create the dsp processing with check of all addons about the used input and output audio format. -+ * @param streamId The id of this stream -+ * @param inputFormat The used audio stream input format -+ * @param outputFormat Audio output format which is needed to send to the sinks -+ * @param quality The requested quality from settings -+ * @param wasActive if it is true a recreation of present stream control becomes performed (process class becomes not deleted) -+ * @return True if the dsp processing becomes available -+ */ -+ bool CreateDSPs(unsigned int &streamId, CActiveAEDSPProcessPtr &process, const AEAudioFormat &inputFormat, const AEAudioFormat &outputFormat, -+ bool upmix, AEQuality quality, enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type, -+ int profile, bool wasActive = false); -+ -+ /*!> -+ * Destroy all allocated dsp addons for this stream id and stops the processing. -+ * @param streamId The id of this stream -+ */ -+ void DestroyDSPs(unsigned int streamId); -+ -+ /*!> -+ * Get the dsp processing class of given stream id -+ * @param streamId The id of this stream -+ */ -+ CActiveAEDSPProcessPtr GetDSPProcess(unsigned int streamId); -+ -+ /*!> -+ * Get the amount of used dsp process stream handlers -+ * @return Returns amount of processes -+ */ -+ unsigned int GetProcessingStreamsAmount(void); -+ -+ /*!> -+ * Get the currently active processing stream id -+ * @return Stream id, or max unsigned int value (-1) if not active -+ */ -+ unsigned int GetActiveStreamId(void); -+ -+ /*! -+ * @brief Check for available modes present from add-ons -+ * -+ * @return true if one or more modes are available -+ */ -+ bool HasAvailableModes(void) const; -+ -+ /*!> -+ * Used to get all available modes on currently enabled add-ons -+ * It is used from CActiveAEDSPProcess to get a sorted modes list for a processing -+ * over the add-ons, several call to the same addon is possible with different mode id's. -+ * @param modeType The type to get -+ * @return modes Pointer to a buffer array where all available modes of type written in -+ */ -+ const AE_DSP_MODELIST &GetAvailableModes(AE_DSP_MODE_TYPE modeType); -+ -+ /*! -+ * @brief Load the settings for the current audio from the database. -+ * @return If it was present inside settings it return the type of this settings -+ */ -+ AE_DSP_STREAMTYPE LoadCurrentAudioSettings(void); -+ -+ /*! -+ * @brief Perfoms a update of all processing calls over the add-ons -+ * @param bAsync if true the update becomes performed on background -+ */ -+ void TriggerModeUpdate(bool bAsync = true); -+ //@} -+ -+ /*! @name Menu hook methods */ -+ //@{ -+ /*! -+ * @brief Check whether a audio dsp addon has any audio DSP specific menu entries. -+ * @param cat The category to know -+ * @param iAddonId The ID of the addon to get the menu entries for. Get the menu for the active channel if iAddonId < 0. -+ * @return True if the dsp addon has any menu hooks, false otherwise. -+ * @note The main usage for this method is to have bigger modifiable addon setting dialogs which make the usage of -+ * standard addon settings dialog as option to it -+ * see kodi_adsp_types.h for available types -+ */ -+ bool HaveMenuHooks(AE_DSP_MENUHOOK_CAT cat, int iAddonId = -1); -+ -+ /*! -+ * @brief Get the menu hooks for a dsp addon. -+ * @param iDSPAddonID The dsp addon to get the hooks for. -+ * @param cat The requested menu category -+ * @param hooks The container to add the hooks to. -+ * @return True if the hooks were added successfully (if any), false otherwise. -+ * @note The main usage for this method is to have bigger modifiable addon setting dialogs, the basic addon settings dialog -+ * can't be opened with it (is only in the menu list from ProcessMenuHooks) -+ * see kodi_adsp_types.h for available types -+ */ -+ bool GetMenuHooks(int iDSPAddonID, AE_DSP_MENUHOOK_CAT cat, AE_DSP_MENUHOOKS &hooks); -+ //@} -+ -+ /*! @name General helper functions */ -+ //@{ -+ /*! -+ * @brief Translate audio dsp channel flag to KODI channel flag -+ */ -+ static enum AEChannel GetKODIChannel(AE_DSP_CHANNEL channel); -+ -+ /*! -+ * @brief Translate KODI channel flag to audio dsp channel flag -+ */ -+ static AE_DSP_CHANNEL GetDSPChannel(enum AEChannel channel); -+ -+ /*! -+ * @brief Get name label id to given stream type id -+ */ -+ static int GetStreamTypeName(unsigned int streamType); -+ //@} -+ -+ protected: -+ /*! -+ * @brief Check whether a dsp addon is registered. -+ * @param addon The dsp addon to check. -+ * @return True if this addon is registered, false otherwise. -+ */ -+ bool IsKnownAudioDSPAddon(const ADDON::AddonPtr& addon) const; -+ -+ /*! -+ * @brief Get the instance of the dsp addon, if it's ready. -+ * @param iAddonId The id of the dsp addon to get. -+ * @param addon The addon data pointer. -+ * @return True if the addon is ready, false otherwise. -+ */ -+ bool GetReadyAudioDSPAddon(int iAddonId, AE_DSP_ADDON &addon) const; -+ -+ /*! -+ * @brief Get the dsp related Id for selected addon -+ * @param addon The addon class pointer. -+ * @return the id of the asked addon, -1 if not available -+ */ -+ int GetAudioDSPAddonId(const ADDON::AddonPtr& addon) const; -+ -+ -+ static const int m_StreamTypeNameTable[]; /*!< Table for stream type strings related to type id */ -+ bool m_isActive; /*!< set to true if all available dsp addons are loaded */ -+ AE_DSP_ADDONMAP m_addonMap; /*!< a map of all known audio dsp addons */ -+ CActiveAEDSPDatabase m_databaseDSP; /*!< the database for all audio DSP related data */ -+ CCriticalSection m_critSection; /*!< Critical lock for control functions */ -+ CCriticalSection m_critUpdateSection; /*!< Critical lock for update thread related functions */ -+ unsigned int m_usedProcessesCnt; /*!< the amount of used addon processes */ -+ CActiveAEDSPProcessPtr m_usedProcesses[AE_DSP_STREAM_MAX_STREAMS]; /*!< Pointer to active process performing classes */ -+ unsigned int m_activeProcessId; /*!< The currently active audio stream id of a playing file source */ -+ bool m_isValidAudioDSPSettings; /*!< if settings load was successfull it becomes true */ -+ AE_DSP_MODELIST m_modes[AE_DSP_MODE_TYPE_MAX]; /*!< list of currently used dsp processing calls */ -+ std::map m_addonNameIds; /*!< map add-on names to IDs */ -+ }; -+ //@} -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp -new file mode 100644 -index 0000000..bccc4d1 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.cpp -@@ -0,0 +1,871 @@ -+/* -+ * Copyright (C) 2010-2015 Team Kodi -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with Kodi; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include -+#include "Application.h" -+#include "ActiveAEDSPAddon.h" -+#include "ActiveAEDSP.h" -+#include "addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h" -+#include "commons/Exception.h" -+#include "settings/AdvancedSettings.h" -+#include "settings/Settings.h" -+#include "utils/log.h" -+#include "utils/StringUtils.h" -+ -+using namespace ADDON; -+using namespace ActiveAE; -+ -+#define DEFAULT_INFO_STRING_VALUE "unknown" -+ -+CActiveAEDSPAddon::CActiveAEDSPAddon(AddonProps props) : -+ CAddonDll(std::move(props)), -+ m_apiVersion("0.0.0") -+{ -+ ResetProperties(); -+} -+ -+CActiveAEDSPAddon::~CActiveAEDSPAddon(void) -+{ -+ Destroy(); -+ SAFE_DELETE(m_pInfo); -+} -+ -+void CActiveAEDSPAddon::OnDisabled() -+{ -+ CServiceBroker::GetADSP().UpdateAddons(); -+} -+ -+void CActiveAEDSPAddon::OnEnabled() -+{ -+ CServiceBroker::GetADSP().UpdateAddons(); -+} -+ -+AddonPtr CActiveAEDSPAddon::GetRunningInstance() const -+{ -+ if (CServiceBroker::GetADSP().IsActivated()) -+ { -+ AddonPtr adspAddon; -+ if (CServiceBroker::GetADSP().GetAudioDSPAddon(ID(), adspAddon)) -+ return adspAddon; -+ } -+ return CAddon::GetRunningInstance(); -+} -+ -+void CActiveAEDSPAddon::OnPreInstall() -+{ -+ CServiceBroker::GetADSP().UpdateAddons(); -+} -+ -+void CActiveAEDSPAddon::OnPostInstall(bool restart, bool update) -+{ -+ CServiceBroker::GetADSP().UpdateAddons(); -+} -+ -+void CActiveAEDSPAddon::OnPreUnInstall() -+{ -+ // stop the ADSP manager, so running ADSP add-ons are stopped and closed -+ CServiceBroker::GetADSP().Deactivate(); -+} -+ -+void CActiveAEDSPAddon::OnPostUnInstall() -+{ -+ CServiceBroker::GetADSP().UpdateAddons(); -+} -+ -+void CActiveAEDSPAddon::ResetProperties(int iClientId /* = AE_DSP_INVALID_ADDON_ID */) -+{ -+ /* initialise members */ -+ SAFE_DELETE(m_pInfo); -+ m_pInfo = new AE_DSP_PROPERTIES; -+ m_strUserPath = CSpecialProtocol::TranslatePath(Profile()); -+ m_pInfo->strUserPath = m_strUserPath.c_str(); -+ m_strAddonPath = CSpecialProtocol::TranslatePath(Path()); -+ m_pInfo->strAddonPath = m_strAddonPath.c_str(); -+ m_menuhooks.clear(); -+ m_bReadyToUse = false; -+ m_isInUse = false; -+ m_iClientId = iClientId; -+ m_strAudioDSPVersion = DEFAULT_INFO_STRING_VALUE; -+ m_strFriendlyName = DEFAULT_INFO_STRING_VALUE; -+ m_strAudioDSPName = DEFAULT_INFO_STRING_VALUE; -+ memset(&m_addonCapabilities, 0, sizeof(m_addonCapabilities)); -+ m_apiVersion = AddonVersion("0.0.0"); -+} -+ -+ADDON_STATUS CActiveAEDSPAddon::Create(int iClientId) -+{ -+ ADDON_STATUS status(ADDON_STATUS_UNKNOWN); -+ if (iClientId <= AE_DSP_INVALID_ADDON_ID) -+ return status; -+ -+ /* ensure that a previous instance is destroyed */ -+ Destroy(); -+ -+ /* reset all properties to defaults */ -+ ResetProperties(iClientId); -+ -+ /* initialise the add-on */ -+ bool bReadyToUse(false); -+ CLog::Log(LOGDEBUG, "ActiveAE DSP - %s - creating audio dsp add-on instance '%s'", __FUNCTION__, Name().c_str()); -+ try -+ { -+ if ((status = CAddonDll::Create()) == ADDON_STATUS_OK) -+ bReadyToUse = GetAddonProperties(); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ m_bReadyToUse = bReadyToUse; -+ -+ return status; -+} -+ -+bool CActiveAEDSPAddon::DllLoaded(void) const -+{ -+ try -+ { -+ return CAddonDll::DllLoaded(); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ } -+ -+ return false; -+} -+ -+void CActiveAEDSPAddon::Destroy(void) -+{ -+ /* reset 'ready to use' to false */ -+ if (!m_bReadyToUse) -+ return; -+ m_bReadyToUse = false; -+ -+ CLog::Log(LOGDEBUG, "ActiveAE DSP - %s - destroying audio dsp add-on '%s'", __FUNCTION__, GetFriendlyName().c_str()); -+ -+ /* destroy the add-on */ -+ try -+ { -+ CAddonDll::Destroy(); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ /* reset all properties to defaults */ -+ ResetProperties(); -+} -+ -+void CActiveAEDSPAddon::ReCreate(void) -+{ -+ int iClientID(m_iClientId); -+ Destroy(); -+ -+ /* recreate the instance */ -+ Create(iClientID); -+} -+ -+bool CActiveAEDSPAddon::ReadyToUse(void) const -+{ -+ return m_bReadyToUse; -+} -+ -+int CActiveAEDSPAddon::GetID(void) const -+{ -+ return m_iClientId; -+} -+ -+bool CActiveAEDSPAddon::IsInUse() const -+{ -+ return m_isInUse; -+}; -+ -+bool CActiveAEDSPAddon::IsCompatibleAPIVersion(const ADDON::AddonVersion &minVersion, const ADDON::AddonVersion &version) -+{ -+ AddonVersion myMinVersion = AddonVersion(KODI_AE_DSP_MIN_API_VERSION); -+ AddonVersion myVersion = AddonVersion(KODI_AE_DSP_API_VERSION); -+ return (version >= myMinVersion && minVersion <= myVersion); -+} -+ -+bool CActiveAEDSPAddon::IsCompatibleGUIAPIVersion(const ADDON::AddonVersion &minVersion, const ADDON::AddonVersion &version) -+{ -+ AddonVersion myMinVersion = AddonVersion(KODI_GUILIB_MIN_API_VERSION); -+ AddonVersion myVersion = AddonVersion(KODI_GUILIB_API_VERSION); -+ return (version >= myMinVersion && minVersion <= myVersion); -+} -+ -+bool CActiveAEDSPAddon::CheckAPIVersion(void) -+{ -+ /* check the API version */ -+ AddonVersion minVersion = AddonVersion(KODI_AE_DSP_MIN_API_VERSION); -+ try -+ { -+ m_apiVersion = AddonVersion(m_pStruct->GetAudioDSPAPIVersion()); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException("GetAudioDSPAPIVersion()"); -+ return false; -+ } -+ -+ if (!IsCompatibleAPIVersion(minVersion, m_apiVersion)) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - Add-on '%s' is using an incompatible API version. KODI minimum API version = '%s', add-on API version '%s'", Name().c_str(), minVersion.asString().c_str(), m_apiVersion.asString().c_str()); -+ return false; -+ } -+ -+ /* check the GUI API version */ -+ AddonVersion guiVersion = AddonVersion("0.0.0"); -+ minVersion = AddonVersion(KODI_GUILIB_MIN_API_VERSION); -+ try -+ { -+ guiVersion = AddonVersion(m_pStruct->GetGUIAPIVersion()); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException("GetGUIAPIVersion()"); -+ return false; -+ } -+ -+ if (!IsCompatibleGUIAPIVersion(minVersion, guiVersion)) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - Add-on '%s' is using an incompatible GUI API version. KODI minimum GUI API version = '%s', add-on GUI API version '%s'", Name().c_str(), minVersion.asString().c_str(), guiVersion.asString().c_str()); -+ return false; -+ } -+ -+ return true; -+} -+ -+bool CActiveAEDSPAddon::GetAddonProperties(void) -+{ -+ std::string strDSPName, strFriendlyName, strAudioDSPVersion; -+ AE_DSP_ADDON_CAPABILITIES addonCapabilities; -+ -+ /* get the capabilities */ -+ try -+ { -+ memset(&addonCapabilities, 0, sizeof(addonCapabilities)); -+ AE_DSP_ERROR retVal = m_pStruct->GetAddonCapabilities(&addonCapabilities); -+ if (retVal != AE_DSP_ERROR_NO_ERROR) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - couldn't get the capabilities for add-on '%s'. Please contact the developer of this add-on: %s", GetFriendlyName().c_str(), Author().c_str()); -+ return false; -+ } -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException("GetAddonCapabilities()"); -+ return false; -+ } -+ -+ /* get the name of the dsp addon */ -+ try -+ { -+ strDSPName = m_pStruct->GetDSPName(); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException("GetDSPName()"); -+ return false; -+ } -+ -+ /* display name = backend name string */ -+ strFriendlyName = StringUtils::Format("%s", strDSPName.c_str()); -+ -+ /* backend version number */ -+ try -+ { -+ strAudioDSPVersion = m_pStruct->GetDSPVersion(); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException("GetDSPVersion()"); -+ return false; -+ } -+ -+ /* update the members */ -+ m_strAudioDSPName = strDSPName; -+ m_strFriendlyName = strFriendlyName; -+ m_strAudioDSPVersion = strAudioDSPVersion; -+ m_addonCapabilities = addonCapabilities; -+ -+ return true; -+} -+ -+AE_DSP_ADDON_CAPABILITIES CActiveAEDSPAddon::GetAddonCapabilities(void) const -+{ -+ AE_DSP_ADDON_CAPABILITIES addonCapabilities(m_addonCapabilities); -+ return addonCapabilities; -+} -+ -+const std::string &CActiveAEDSPAddon::GetAudioDSPName(void) const -+{ -+ return m_strAudioDSPName; -+} -+ -+const std::string &CActiveAEDSPAddon::GetAudioDSPVersion(void) const -+{ -+ return m_strAudioDSPVersion; -+} -+ -+const std::string &CActiveAEDSPAddon::GetFriendlyName(void) const -+{ -+ return m_strFriendlyName; -+} -+ -+bool CActiveAEDSPAddon::HaveMenuHooks(AE_DSP_MENUHOOK_CAT cat) const -+{ -+ if (m_bReadyToUse && !m_menuhooks.empty()) -+ { -+ for (unsigned int i = 0; i < m_menuhooks.size(); ++i) -+ { -+ if (m_menuhooks[i].category == cat || m_menuhooks[i].category == AE_DSP_MENUHOOK_ALL) -+ return true; -+ } -+ } -+ return false; -+} -+ -+AE_DSP_MENUHOOKS *CActiveAEDSPAddon::GetMenuHooks(void) -+{ -+ return &m_menuhooks; -+} -+ -+void CActiveAEDSPAddon::CallMenuHook(const AE_DSP_MENUHOOK &hook, AE_DSP_MENUHOOK_DATA &hookData) -+{ -+ if (!m_bReadyToUse || hookData.category == AE_DSP_MENUHOOK_UNKNOWN) -+ return; -+ -+ try -+ { -+ m_pStruct->MenuHook(hook, hookData); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+} -+ -+AE_DSP_ERROR CActiveAEDSPAddon::StreamCreate(const AE_DSP_SETTINGS *addonSettings, const AE_DSP_STREAM_PROPERTIES* pProperties, ADDON_HANDLE handle) -+{ -+ AE_DSP_ERROR retVal(AE_DSP_ERROR_UNKNOWN); -+ -+ try -+ { -+ retVal = m_pStruct->StreamCreate(addonSettings, pProperties, handle); -+ if (retVal == AE_DSP_ERROR_NO_ERROR) -+ m_isInUse = true; -+ LogError(retVal, __FUNCTION__); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return retVal; -+} -+ -+void CActiveAEDSPAddon::StreamDestroy(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ m_pStruct->StreamDestroy(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ m_isInUse = false; -+} -+ -+bool CActiveAEDSPAddon::StreamIsModeSupported(const ADDON_HANDLE handle, AE_DSP_MODE_TYPE type, unsigned int addon_mode_id, int unique_db_mode_id) -+{ -+ try -+ { -+ AE_DSP_ERROR retVal = m_pStruct->StreamIsModeSupported(handle, type, addon_mode_id, unique_db_mode_id); -+ if (retVal == AE_DSP_ERROR_NO_ERROR) -+ return true; -+ else if (retVal != AE_DSP_ERROR_IGNORE_ME) -+ LogError(retVal, __FUNCTION__); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return false; -+} -+ -+AE_DSP_ERROR CActiveAEDSPAddon::StreamInitialize(const ADDON_HANDLE handle, const AE_DSP_SETTINGS *addonSettings) -+{ -+ AE_DSP_ERROR retVal(AE_DSP_ERROR_UNKNOWN); -+ -+ try -+ { -+ retVal = m_pStruct->StreamInitialize(handle, addonSettings); -+ LogError(retVal, __FUNCTION__); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return retVal; -+} -+ -+bool CActiveAEDSPAddon::InputProcess(const ADDON_HANDLE handle, const float **array_in, unsigned int samples) -+{ -+ try -+ { -+ return m_pStruct->InputProcess(handle, array_in, samples); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+unsigned int CActiveAEDSPAddon::InputResampleProcessNeededSamplesize(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->InputResampleProcessNeededSamplesize(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+unsigned int CActiveAEDSPAddon::InputResampleProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples) -+{ -+ try -+ { -+ return m_pStruct->InputResampleProcess(handle, array_in, array_out, samples); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+int CActiveAEDSPAddon::InputResampleSampleRate(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->InputResampleSampleRate(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return -1; -+} -+ -+float CActiveAEDSPAddon::InputResampleGetDelay(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->InputResampleGetDelay(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0.0f; -+} -+ -+unsigned int CActiveAEDSPAddon::PreProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id) -+{ -+ try -+ { -+ return m_pStruct->PreProcessNeededSamplesize(handle, mode_id); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+float CActiveAEDSPAddon::PreProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id) -+{ -+ try -+ { -+ return m_pStruct->PreProcessGetDelay(handle, mode_id); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0.0f; -+} -+ -+unsigned int CActiveAEDSPAddon::PreProcess(const ADDON_HANDLE handle, unsigned int mode_id, float **array_in, float **array_out, unsigned int samples) -+{ -+ try -+ { -+ return m_pStruct->PostProcess(handle, mode_id, array_in, array_out, samples); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+AE_DSP_ERROR CActiveAEDSPAddon::MasterProcessSetMode(const ADDON_HANDLE handle, AE_DSP_STREAMTYPE type, unsigned int mode_id, int unique_db_mode_id) -+{ -+ AE_DSP_ERROR retVal(AE_DSP_ERROR_UNKNOWN); -+ -+ try -+ { -+ retVal = m_pStruct->MasterProcessSetMode(handle, type, mode_id, unique_db_mode_id); -+ LogError(retVal, __FUNCTION__); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return retVal; -+} -+ -+unsigned int CActiveAEDSPAddon::MasterProcessNeededSamplesize(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->MasterProcessNeededSamplesize(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+float CActiveAEDSPAddon::MasterProcessGetDelay(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->MasterProcessGetDelay(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0.0f; -+} -+ -+int CActiveAEDSPAddon::MasterProcessGetOutChannels(const ADDON_HANDLE handle, unsigned long &out_channel_present_flags) -+{ -+ try -+ { -+ return m_pStruct->MasterProcessGetOutChannels(handle, out_channel_present_flags); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return -1; -+} -+ -+unsigned int CActiveAEDSPAddon::MasterProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples) -+{ -+ try -+ { -+ return m_pStruct->MasterProcess(handle, array_in, array_out, samples); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+std::string CActiveAEDSPAddon::MasterProcessGetStreamInfoString(const ADDON_HANDLE handle) -+{ -+ std::string strReturn; -+ -+ if (!m_bReadyToUse) -+ return strReturn; -+ -+ try -+ { -+ strReturn = m_pStruct->MasterProcessGetStreamInfoString(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return strReturn; -+} -+ -+unsigned int CActiveAEDSPAddon::PostProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id) -+{ -+ try -+ { -+ return m_pStruct->PostProcessNeededSamplesize(handle, mode_id); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+float CActiveAEDSPAddon::PostProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id) -+{ -+ try -+ { -+ return m_pStruct->PostProcessGetDelay(handle, mode_id); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0.0f; -+} -+ -+unsigned int CActiveAEDSPAddon::PostProcess(const ADDON_HANDLE handle, unsigned int mode_id, float **array_in, float **array_out, unsigned int samples) -+{ -+ try -+ { -+ return m_pStruct->PostProcess(handle, mode_id, array_in, array_out, samples); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+unsigned int CActiveAEDSPAddon::OutputResampleProcessNeededSamplesize(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->OutputResampleProcessNeededSamplesize(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+unsigned int CActiveAEDSPAddon::OutputResampleProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples) -+{ -+ try -+ { -+ return m_pStruct->OutputResampleProcess(handle, array_in, array_out, samples); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0; -+} -+ -+int CActiveAEDSPAddon::OutputResampleSampleRate(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->OutputResampleSampleRate(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return -1; -+} -+ -+float CActiveAEDSPAddon::OutputResampleGetDelay(const ADDON_HANDLE handle) -+{ -+ try -+ { -+ return m_pStruct->OutputResampleGetDelay(handle); -+ } -+ XBMCCOMMONS_HANDLE_UNCHECKED -+ catch (...) -+ { -+ LogUnhandledException(__FUNCTION__); -+ Destroy(); -+ } -+ -+ return 0.0f; -+} -+ -+bool CActiveAEDSPAddon::SupportsInputInfoProcess(void) const -+{ -+ return m_addonCapabilities.bSupportsInputProcess; -+} -+ -+bool CActiveAEDSPAddon::SupportsInputResample(void) const -+{ -+ return m_addonCapabilities.bSupportsInputResample; -+} -+ -+bool CActiveAEDSPAddon::SupportsPreProcess(void) const -+{ -+ return m_addonCapabilities.bSupportsPreProcess; -+} -+ -+bool CActiveAEDSPAddon::SupportsMasterProcess(void) const -+{ -+ return m_addonCapabilities.bSupportsMasterProcess; -+} -+ -+bool CActiveAEDSPAddon::SupportsPostProcess(void) const -+{ -+ return m_addonCapabilities.bSupportsPostProcess; -+} -+ -+bool CActiveAEDSPAddon::SupportsOutputResample(void) const -+{ -+ return m_addonCapabilities.bSupportsOutputResample; -+} -+ -+const char *CActiveAEDSPAddon::ToString(const AE_DSP_ERROR error) -+{ -+ switch (error) -+ { -+ case AE_DSP_ERROR_NO_ERROR: -+ return "no error"; -+ case AE_DSP_ERROR_NOT_IMPLEMENTED: -+ return "not implemented"; -+ case AE_DSP_ERROR_REJECTED: -+ return "rejected by the backend"; -+ case AE_DSP_ERROR_INVALID_PARAMETERS: -+ return "invalid parameters for this method"; -+ case AE_DSP_ERROR_INVALID_SAMPLERATE: -+ return "invalid samplerate for this method"; -+ case AE_DSP_ERROR_INVALID_IN_CHANNELS: -+ return "invalid input channel layout for this method"; -+ case AE_DSP_ERROR_INVALID_OUT_CHANNELS: -+ return "invalid output channel layout for this method"; -+ case AE_DSP_ERROR_FAILED: -+ return "the command failed"; -+ case AE_DSP_ERROR_UNKNOWN: -+ default: -+ return "unknown error"; -+ } -+} -+ -+bool CActiveAEDSPAddon::LogError(const AE_DSP_ERROR error, const char *strMethod) const -+{ -+ if (error != AE_DSP_ERROR_NO_ERROR && error != AE_DSP_ERROR_IGNORE_ME) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - addon '%s' returned an error: %s", -+ strMethod, GetFriendlyName().c_str(), ToString(error)); -+ return false; -+ } -+ return true; -+} -+ -+void CActiveAEDSPAddon::LogUnhandledException(const char *strFunctionName) const -+{ -+ CLog::Log(LOGERROR, "ActiveAE DSP - Unhandled exception caught while trying to call '%s' on add-on '%s', becomes diabled. Please contact the developer of this add-on: %s", strFunctionName, GetFriendlyName().c_str(), Author().c_str()); -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.h b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.h -new file mode 100644 -index 0000000..4210394 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPAddon.h -@@ -0,0 +1,424 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "addons/Addon.h" -+#include "addons/AddonDll.h" -+#include "addons/DllAudioDSP.h" -+ -+namespace ActiveAE -+{ -+ class CActiveAEDSPAddon; -+ -+ typedef std::vector AE_DSP_MENUHOOKS; -+ typedef std::shared_ptr AE_DSP_ADDON; -+ -+ #define AE_DSP_INVALID_ADDON_ID (-1) -+ -+ /*! -+ * Interface from KODI to a Audio DSP add-on. -+ * -+ * Also translates KODI's C++ structures to the addon's C structures. -+ */ -+ class CActiveAEDSPAddon : public ADDON::CAddonDll -+ { -+ public: -+ explicit CActiveAEDSPAddon(ADDON::AddonProps props); -+ ~CActiveAEDSPAddon(void); -+ -+ virtual void OnDisabled(); -+ virtual void OnEnabled(); -+ virtual ADDON::AddonPtr GetRunningInstance() const; -+ virtual void OnPreInstall(); -+ virtual void OnPostInstall(bool restart, bool update); -+ virtual void OnPreUnInstall(); -+ virtual void OnPostUnInstall(); -+ -+ /** @name Audio DSP add-on methods */ -+ //@{ -+ /*! -+ * @brief Initialise the instance of this add-on. -+ * @param iClientId The ID of this add-on. -+ */ -+ ADDON_STATUS Create(int iClientId); -+ -+ /*! -+ * @return True when the dll for this add-on was loaded, false otherwise (e.g. unresolved symbols) -+ */ -+ bool DllLoaded(void) const; -+ -+ /*! -+ * @brief Destroy the instance of this add-on. -+ */ -+ void Destroy(void); -+ -+ /*! -+ * @brief Destroy and recreate this add-on. -+ */ -+ void ReCreate(void); -+ -+ /*! -+ * @return True if this instance is initialised, false otherwise. -+ */ -+ bool ReadyToUse(void) const; -+ -+ /*! -+ * @return The ID of this instance. -+ */ -+ int GetID(void) const; -+ -+ /*! -+ * @return The false if this addon is currently not used. -+ */ -+ virtual bool IsInUse() const; -+ //@} -+ -+ /** @name Audio DSP processing methods */ -+ //@{ -+ /*! -+ * @brief Query this add-on's capabilities. -+ * @return pCapabilities The add-on's capabilities. -+ */ -+ AE_DSP_ADDON_CAPABILITIES GetAddonCapabilities(void) const; -+ -+ /*! -+ * @return The name reported by the backend. -+ */ -+ const std::string &GetAudioDSPName(void) const; -+ -+ /*! -+ * @return The version string reported by the backend. -+ */ -+ const std::string &GetAudioDSPVersion(void) const; -+ -+ /*! -+ * @return A friendly name for this add-on that can be used in log messages. -+ */ -+ const std::string &GetFriendlyName(void) const; -+ -+ /*! -+ * @return True if this add-on has menu hooks, false otherwise. -+ */ -+ bool HaveMenuHooks(AE_DSP_MENUHOOK_CAT cat) const; -+ -+ /*! -+ * @return The menu hooks for this add-on. -+ */ -+ AE_DSP_MENUHOOKS *GetMenuHooks(void); -+ -+ /*! -+ * @brief Call one of the menu hooks of this addon. -+ * @param hook The hook to call. -+ * @param item The selected file item for which the hook was called. -+ */ -+ void CallMenuHook(const AE_DSP_MENUHOOK &hook, AE_DSP_MENUHOOK_DATA &hookData); -+ -+ /*! -+ * Set up Audio DSP with selected audio settings (use the basic present audio stream data format) -+ * Used to detect available addons for present stream, as example stereo surround upmix not needed on 5.1 audio stream -+ * @param addonSettings The add-on's audio settings. -+ * @param pProperties The properties of the currently playing stream. -+ * @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully and data can be performed. AE_DSP_ERROR_IGNORE_ME if format is not supported, but without fault. -+ */ -+ AE_DSP_ERROR StreamCreate(const AE_DSP_SETTINGS *addonSettings, const AE_DSP_STREAM_PROPERTIES* pProperties, ADDON_HANDLE handle); -+ -+ /*! -+ * Remove the selected id from currently used dsp processes -+ * @param id The stream id -+ */ -+ void StreamDestroy(const ADDON_HANDLE handle); -+ -+ /*! -+ * @brief Ask the addon about a requested processing mode that it is supported on the current -+ * stream. Is called about every addon mode after successed StreamCreate. -+ * @param id The stream id -+ * @param addon_mode_id The mode inside addon which must be performed on call. Id is set from addon by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * @param unique_mode_id The Mode unique id generated from dsp database. -+ * @return true if supported -+ */ -+ bool StreamIsModeSupported(const ADDON_HANDLE handle, AE_DSP_MODE_TYPE type, unsigned int addon_mode_id, int unique_db_mode_id); -+ -+ /*! -+ * Set up Audio DSP with selected audio settings (detected on data of first present audio packet) -+ * @param addonSettings The add-on's audio settings. -+ * @return AE_DSP_ERROR_NO_ERROR if the properties were fetched successfully. -+ */ -+ AE_DSP_ERROR StreamInitialize(const ADDON_HANDLE handle, const AE_DSP_SETTINGS *addonSettings); -+ -+ /*! -+ * @brief DSP input processing -+ * Can be used to have unchanged stream.. -+ * All DSP add-ons allowed to-do this. -+ * @param id The stream id -+ * @param array_in Pointer to data memory -+ * @param samples Amount of samples inside array_in -+ * @return true if work was OK -+ * @remarks Optional. Is set by AE_DSP_ADDON_CAPABILITIES and asked with GetAddonCapabilities -+ */ -+ bool InputProcess(const ADDON_HANDLE handle, const float **array_in, unsigned int samples); -+ -+ /*! -+ * If the add-on operate with buffered arrays and the output size can be higher as the input -+ * it becomes asked about needed size before any InputResampleProcess call. -+ * @param id The stream id -+ * @return The needed size of output array or 0 if no changes within it -+ */ -+ unsigned int InputResampleProcessNeededSamplesize(const ADDON_HANDLE handle); -+ -+ /*! -+ * @brief DSP re sample processing before master Here a high quality resample can be performed. -+ * Only one DSP add-on is allowed to-do this! -+ * @param id The stream id -+ * @param array_in Pointer to input data memory -+ * @param array_out Pointer to output data memory -+ * @param samples Amount of samples inside array_in -+ * @return Amount of samples processed -+ */ -+ unsigned int InputResampleProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples); -+ -+ /*! -+ * Returns the re-sampling generated new sample rate used before the master process -+ * @param id The stream id -+ * @return The new sample rate -+ */ -+ int InputResampleSampleRate(const ADDON_HANDLE handle); -+ -+ /*! -+ * Returns the time in seconds that it will take -+ * for the next added packet to be heard from the speakers. -+ * @param id The stream id -+ * @return the delay in seconds -+ */ -+ float InputResampleGetDelay(const ADDON_HANDLE handle); -+ -+ /*! -+ * If the addon operate with buffered arrays and the output size can be higher as the input -+ * it becomes asked about needed size before any PreProcess call. -+ * @param id The stream id -+ * @param mode_id The mode inside add-on which must be performed on call. Id is set from add-on by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * and can be defined from add-on as a structure pointer or anything else what is needed to find it. -+ * @return The needed size of output array or 0 if no changes within it -+ */ -+ unsigned int PreProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id); -+ -+ /*! -+ * Returns the time in seconds that it will take -+ * for the next added packet to be heard from the speakers. -+ * @param id The stream id -+ * @param mode_id The mode inside add-on which must be performed on call. Id is set from add-on by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * and can be defined from add-on as a structure pointer or anything else what is needed to find it. -+ * @return the delay in seconds -+ */ -+ float PreProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id); -+ -+ /*! -+ * @brief DSP preprocessing -+ * All DSP add-ons allowed to-do this. -+ * @param id The stream id -+ * @param mode_id The mode inside add-on which must be performed on call. Id is set from add-on by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * and can be defined from add-on as a structure pointer or anything else what is needed to find it. -+ * @param array_in Pointer to input data memory -+ * @param array_out Pointer to output data memory -+ * @param samples Amount of samples inside array_in -+ * @return Amount of samples processed -+ */ -+ unsigned int PreProcess(const ADDON_HANDLE handle, unsigned int mode_id, float **array_in, float **array_out, unsigned int samples); -+ -+ /*! -+ * @brief Set the active master process mode -+ * @param id The stream id -+ * @param type Requested stream type for the selected master mode -+ * @param mode_id The Mode identifier. -+ * @param unique_mode_id The Mode unique id generated from DSP database. -+ * @return AE_DSP_ERROR_NO_ERROR if the setup was successful -+ */ -+ AE_DSP_ERROR MasterProcessSetMode(const ADDON_HANDLE handle, AE_DSP_STREAMTYPE type, unsigned int mode_id, int unique_db_mode_id); -+ -+ /*! -+ * @brief If the add-on operate with buffered arrays and the output size can be higher as the input -+ * it becomes asked about needed size before any MasterProcess call. -+ * @param id The stream id -+ * @return The needed size of output array or 0 if no changes within it -+ */ -+ unsigned int MasterProcessNeededSamplesize(const ADDON_HANDLE handle); -+ -+ /*! -+ * @brief Returns the time in seconds that it will take -+ * for the next added packet to be heard from the speakers. -+ * @param id The stream id -+ * @return the delay in seconds -+ */ -+ float MasterProcessGetDelay(const ADDON_HANDLE handle); -+ -+ /*! -+ * @brief Returns the from selected master mode performed channel alignment -+ * @param id The stream id -+ * @retval out_channel_present_flags the exact channel present flags after performed up-/downmix -+ * @return the amount channels -+ */ -+ int MasterProcessGetOutChannels(const ADDON_HANDLE handle, unsigned long &out_channel_present_flags); -+ -+ /*! -+ * @brief Master processing becomes performed with it -+ * Here a channel up-mix/down-mix for stereo surround sound can be performed -+ * Only one DSP add-on is allowed to-do this! -+ * @param id The stream id -+ * @param array_in Pointer to input data memory -+ * @param array_out Pointer to output data memory -+ * @param samples Amount of samples inside array_in -+ * @return Amount of samples processed -+ */ -+ unsigned int MasterProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples); -+ -+ /*! -+ * @brief Get a from addon generated information string -+ * @param id The stream id -+ * @return Info string -+ */ -+ std::string MasterProcessGetStreamInfoString(const ADDON_HANDLE handle); -+ -+ /*! -+ * If the add-on operate with buffered arrays and the output size can be higher as the input -+ * it becomes asked about needed size before any PostProcess call. -+ * @param id The stream id -+ * @param mode_id The mode inside add-on which must be performed on call. Id is set from add-on by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * and can be defined from add-on as a structure pointer or anything else what is needed to find it. -+ * @return The needed size of output array or 0 if no changes within it -+ */ -+ unsigned int PostProcessNeededSamplesize(const ADDON_HANDLE handle, unsigned int mode_id); -+ -+ /*! -+ * Returns the time in seconds that it will take -+ * for the next added packet to be heard from the speakers. -+ * @param id The stream id -+ * @param mode_id The mode inside add-on which must be performed on call. Id is set from add-on by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * and can be defined from add-on as a structure pointer or anything else what is needed to find it. -+ * @return the delay in seconds -+ */ -+ float PostProcessGetDelay(const ADDON_HANDLE handle, unsigned int mode_id); -+ -+ /*! -+ * @brief DSP post processing -+ * @param id The stream id -+ * @param mode_id The mode inside add-on which must be performed on call. Id is set from add-on by iModeNumber on AE_DSP_MODE structure during RegisterMode callback, -+ * and can be defined from add-on as a structure pointer or anything else what is needed to find it. -+ * @param array_in Pointer to input data memory -+ * @param array_out Pointer to output data memory -+ * @param samples Amount of samples inside array_in -+ * @return Amount of samples processed -+ */ -+ unsigned int PostProcess(const ADDON_HANDLE handle, unsigned int mode_id, float **array_in, float **array_out, unsigned int samples); -+ -+ /*! -+ * @brief If the add-on operate with buffered arrays and the output size can be higher as the input -+ * it becomes asked about needed size before any OutputResampleProcess call. -+ * @param id The stream id -+ * @return The needed size of output array or 0 if no changes within it -+ */ -+ unsigned int OutputResampleProcessNeededSamplesize(const ADDON_HANDLE handle); -+ -+ /*! -+ * @brief Re-sampling after master processing becomes performed with it if needed, only -+ * one add-on can perform it. -+ * @param id The stream id -+ * @param array_in Pointer to input data memory -+ * @param array_out Pointer to output data memory -+ * @param samples Amount of samples inside array_in -+ * @return Amount of samples processed -+ */ -+ unsigned int OutputResampleProcess(const ADDON_HANDLE handle, float **array_in, float **array_out, unsigned int samples); -+ -+ /*! -+ * Returns the re-sampling generated new sample rate used after the master process -+ * @param id The stream id -+ * @return The new sample rate -+ */ -+ int OutputResampleSampleRate(const ADDON_HANDLE handle); -+ -+ /*! -+ * Returns the time in seconds that it will take -+ * for the next added packet to be heard from the speakers. -+ * @param id The stream id -+ * @return the delay in seconds -+ */ -+ float OutputResampleGetDelay(const ADDON_HANDLE handle); -+ -+ bool SupportsInputInfoProcess(void) const; -+ bool SupportsPreProcess(void) const; -+ bool SupportsInputResample(void) const; -+ bool SupportsMasterProcess(void) const; -+ bool SupportsPostProcess(void) const; -+ bool SupportsOutputResample(void) const; -+ -+ static const char *ToString(const AE_DSP_ERROR error); -+ -+ private: -+ /*! -+ * @brief Checks whether the provided API version is compatible with KODI -+ * @param minVersion The add-on's KODI_AE_DSP_MIN_API_VERSION version -+ * @param version The add-on's KODI_AE_DSP_API_VERSION version -+ * @return True when compatible, false otherwise -+ */ -+ static bool IsCompatibleAPIVersion(const ADDON::AddonVersion &minVersion, const ADDON::AddonVersion &version); -+ -+ /*! -+ * @brief Checks whether the provided GUI API version is compatible with KODI -+ * @param minVersion The add-on's KODI_GUILIB_MIN_API_VERSION version -+ * @param version The add-on's KODI_GUILIB_API_VERSION version -+ * @return True when compatible, false otherwise -+ */ -+ static bool IsCompatibleGUIAPIVersion(const ADDON::AddonVersion &minVersion, const ADDON::AddonVersion &version); -+ -+ /*! -+ * @brief Request the API version from the add-on, and check if it's compatible -+ * @return True when compatible, false otherwise. -+ */ -+ bool CheckAPIVersion(void); -+ -+ /*! -+ * @brief Resets all class members to their defaults. Called by the constructors. -+ */ -+ void ResetProperties(int iClientId = AE_DSP_INVALID_ADDON_ID); -+ -+ bool GetAddonProperties(void); -+ -+ bool LogError(const AE_DSP_ERROR error, const char *strMethod) const; -+ void LogUnhandledException(const char *strFunctionName) const; -+ -+ bool m_bReadyToUse; /*!< true if this add-on is connected to the audio DSP, false otherwise */ -+ bool m_isInUse; /*!< true if this add-on currentyl processing data */ -+ AE_DSP_MENUHOOKS m_menuhooks; /*!< the menu hooks for this add-on */ -+ int m_iClientId; /*!< database ID of the audio DSP */ -+ -+ /* cached data */ -+ std::string m_strAudioDSPName; /*!< the cached audio DSP version */ -+ std::string m_strAudioDSPVersion; /*!< the cached audio DSP version */ -+ std::string m_strFriendlyName; /*!< the cached friendly name */ -+ AE_DSP_ADDON_CAPABILITIES m_addonCapabilities; /*!< the cached add-on capabilities */ -+ -+ /* stored strings to make sure const char* members in AE_DSP_PROPERTIES stay valid */ -+ std::string m_strUserPath; /*!< @brief translated path to the user profile */ -+ std::string m_strAddonPath ; /*!< @brief translated path to this add-on */ -+ -+ CCriticalSection m_critSection; -+ -+ ADDON::AddonVersion m_apiVersion; -+ }; -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.cpp b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.cpp -new file mode 100644 -index 0000000..0ec4094 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.cpp -@@ -0,0 +1,545 @@ -+/* -+ * Copyright (C) 2012-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "ActiveAEDSPDatabase.h" -+#include "ActiveAEDSP.h" -+ -+#include "URL.h" -+#include "dbwrappers/dataset.h" -+#include "settings/AdvancedSettings.h" -+#include "settings/MediaSettings.h" -+#include "utils/log.h" -+#include "utils/StringUtils.h" -+ -+using namespace dbiplus; -+using namespace ActiveAE; -+using namespace ADDON; -+ -+#define ADSPDB_DEBUGGING 0 -+ -+bool CActiveAEDSPDatabase::Open() -+{ -+ return CDatabase::Open(g_advancedSettings.m_databaseADSP); -+} -+ -+void CActiveAEDSPDatabase::CreateTables() -+{ -+ BeginTransaction(); -+ CLog::Log(LOGINFO, "Audio DSP - %s - creating tables", __FUNCTION__); -+ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - creating table 'addons'", __FUNCTION__); -+ m_pDS->exec( -+ "CREATE TABLE addons (" -+ "idAddon integer primary key, " -+ "sName varchar(64), " -+ "sUid varchar(32)" -+ ")" -+ ); -+ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - creating table 'modes'", __FUNCTION__); -+ m_pDS->exec( -+ "CREATE TABLE modes (" -+ "idMode integer primary key, " -+ "iType integer, " -+ "iPosition integer, " -+ "iStreamTypeFlags integer, " -+ "iBaseType integer, " -+ "bIsEnabled bool, " -+ "sOwnIconPath varchar(255), " -+ "sOverrideIconPath varchar(255), " -+ "iModeName integer, " -+ "iModeSetupName integer, " -+ "iModeHelp integer, " -+ "iModeDescription integer, " -+ "sAddonModeName varchar(64), " -+ "iAddonId integer, " -+ "iAddonModeNumber integer, " -+ "bHasSettings bool" -+ ")" -+ ); -+ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - create settings table", __FUNCTION__); -+ m_pDS->exec( -+ "CREATE TABLE settings (" -+ "id integer primary key, " -+ "strPath varchar(255), " -+ "strFileName varchar(255), " -+ "MasterStreamTypeSel integer, " -+ "MasterStreamType integer, " -+ "MasterBaseType integer, " -+ "MasterModeId integer" -+ ")" -+ ); -+ -+ // disable all Audio DSP add-on when started the first time -+ ADDON::VECADDONS addons; -+ if (CAddonMgr::GetInstance().GetAddons(addons, ADDON_ADSPDLL)) -+ { -+ for (IVECADDONS it = addons.begin(); it != addons.end(); ++it) -+ CAddonMgr::GetInstance().DisableAddon(it->get()->ID()); -+ } -+} -+ -+void CActiveAEDSPDatabase::CreateAnalytics() -+{ -+ CLog::Log(LOGINFO, "Audio DSP - %s - creating indices", __FUNCTION__); -+ m_pDS->exec("CREATE UNIQUE INDEX idx_mode_iAddonId_iAddonModeNumber on modes(iAddonId, iAddonModeNumber);"); -+ m_pDS->exec("CREATE UNIQUE INDEX ix_settings ON settings ( id )\n"); -+} -+ -+void CActiveAEDSPDatabase::UpdateTables(int iVersion) -+{ -+} -+ -+/********** Mode methods **********/ -+ -+bool CActiveAEDSPDatabase::ContainsModes(int modeType) -+{ -+ return !GetSingleValue(PrepareSQL("SELECT 1 FROM modes WHERE modes.iType='%i'", modeType)).empty(); -+} -+ -+bool CActiveAEDSPDatabase::DeleteModes(void) -+{ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - deleting all modes from the database", __FUNCTION__); -+ return DeleteValues("modes"); -+} -+ -+bool CActiveAEDSPDatabase::DeleteModes(int modeType) -+{ -+ /* invalid addon Id */ -+ if (modeType <= 0) -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - invalid mode type id: %i", __FUNCTION__, modeType); -+ return false; -+ } -+ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - deleting all modes from type '%i' from the database", __FUNCTION__, modeType); -+ -+ Filter filter; -+ filter.AppendWhere(PrepareSQL("iType = %u", modeType)); -+ -+ return DeleteValues("modes", filter); -+} -+ -+bool CActiveAEDSPDatabase::DeleteAddonModes(int addonId) -+{ -+ /* invalid addon Id */ -+ if (addonId <= 0) -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - invalid add-on id: %i", __FUNCTION__, addonId); -+ return false; -+ } -+ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - deleting all modes from add-on '%i' from the database", __FUNCTION__, addonId); -+ -+ Filter filter; -+ filter.AppendWhere(PrepareSQL("iAddonId = %u", addonId)); -+ -+ return DeleteValues("modes", filter); -+} -+ -+bool CActiveAEDSPDatabase::DeleteMode(const CActiveAEDSPMode &mode) -+{ -+ /* invalid mode */ -+ if (mode.ModeID() <= 0) -+ return false; -+ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - deleting mode '%s' from the database", __FUNCTION__, mode.AddonModeName().c_str()); -+ -+ Filter filter; -+ filter.AppendWhere(PrepareSQL("idMode = %u", mode.ModeID())); -+ -+ return DeleteValues("modes", filter); -+} -+ -+bool CActiveAEDSPDatabase::PersistModes(std::vector &modes, int modeType) -+{ -+ bool bReturn(true); -+ -+ for (unsigned int iModePtr = 0; iModePtr < modes.size(); ++iModePtr) -+ { -+ CActiveAEDSPModePtr member = modes.at(iModePtr); -+ if (!member->IsInternal() && (member->IsChanged() || member->IsNew())) -+ { -+ bReturn &= AddUpdateMode(*member); -+ } -+ } -+ -+ bReturn &= CommitInsertQueries(); -+ -+ return bReturn; -+} -+ -+bool CActiveAEDSPDatabase::UpdateMode(int modeType, bool active, int addonId, int addonModeNumber, int listNumber) -+{ -+ return ExecuteQuery(PrepareSQL("UPDATE modes SET iPosition=%i,bIsEnabled=%i WHERE modes.iAddonId=%i AND modes.iAddonModeNumber=%i AND modes.iType=%i", -+ listNumber, -+ (active ? 1 : 0), -+ addonId, -+ addonModeNumber, -+ modeType)); -+} -+ -+bool CActiveAEDSPDatabase::AddUpdateMode(CActiveAEDSPMode &mode) -+{ -+ bool bReturn(true); -+ -+ try -+ { -+ if (mode.IsInternal()) -+ return false; -+ -+ if (NULL == m_pDB.get()) return false; -+ if (NULL == m_pDS.get()) return false; -+ std::string strSQL = PrepareSQL("SELECT * FROM modes WHERE modes.iAddonId=%i AND modes.iAddonModeNumber=%i AND modes.iType=%i", mode.AddonID(), mode.AddonModeNumber(), mode.ModeType()); -+ -+ m_pDS->query( strSQL ); -+ if (m_pDS->num_rows() > 0) -+ { -+ /* get user selected settings */ -+ mode.m_iModeId = m_pDS->fv("idMode").get_asInt(); -+ mode.m_iModePosition = m_pDS->fv("iPosition").get_asInt(); -+ mode.m_iBaseType = (AE_DSP_BASETYPE)m_pDS->fv("iBaseType").get_asInt(); -+ mode.m_bIsEnabled = m_pDS->fv("bIsEnabled").get_asBool(); -+ m_pDS->close(); -+ -+ /* update addon related settings */ -+ strSQL = PrepareSQL( -+ "UPDATE modes set " -+ "iStreamTypeFlags=%i, " -+ "sOwnIconPath='%s', " -+ "sOverrideIconPath='%s', " -+ "iModeName=%i, " -+ "iModeSetupName=%i, " -+ "iModeHelp=%i, " -+ "iModeDescription=%i, " -+ "sAddonModeName='%s', " -+ "bHasSettings=%i " -+ "WHERE modes.iAddonId=%i AND modes.iAddonModeNumber=%i AND modes.iType=%i", -+ mode.StreamTypeFlags(), -+ mode.IconOwnModePath().c_str(), -+ mode.IconOverrideModePath().c_str(), -+ mode.ModeName(), -+ mode.ModeSetupName(), -+ mode.ModeHelp(), -+ mode.ModeDescription(), -+ mode.AddonModeName().c_str(), -+ (mode.HasSettingsDialog() ? 1 : 0), -+ mode.AddonID(), mode.AddonModeNumber(), mode.ModeType()); -+ bReturn = m_pDS->exec(strSQL); -+ } -+ else -+ { // add the items -+ m_pDS->close(); -+ strSQL = PrepareSQL( -+ "INSERT INTO modes (" -+ "iType, " -+ "iPosition, " -+ "iStreamTypeFlags, " -+ "iBaseType, " -+ "bIsEnabled, " -+ "sOwnIconPath, " -+ "sOverrideIconPath, " -+ "iModeName, " -+ "iModeSetupName, " -+ "iModeHelp, " -+ "iModeDescription, " -+ "sAddonModeName, " -+ "iAddonId, " -+ "iAddonModeNumber, " -+ "bHasSettings) " -+ "VALUES (%i, %i, %i, %i, %i, '%s', '%s', %i, %i, %i, %i, '%s', %i, %i, %i)", -+ mode.ModeType(), -+ mode.ModePosition(), -+ mode.StreamTypeFlags(), -+ mode.BaseType(), -+ (mode.IsEnabled() ? 1 : 0), -+ mode.IconOwnModePath().c_str(), -+ mode.IconOverrideModePath().c_str(), -+ mode.ModeName(), -+ mode.ModeSetupName(), -+ mode.ModeHelp(), -+ mode.ModeDescription(), -+ mode.AddonModeName().c_str(), -+ mode.AddonID(), -+ mode.AddonModeNumber(), -+ (mode.HasSettingsDialog() ? 1 : 0)); -+ bReturn = m_pDS->exec(strSQL); -+ } -+ } -+ catch (...) -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - (Addon='%i', Mode='%i', Name: %s) failed", __FUNCTION__, mode.AddonID(), mode.AddonModeNumber(), mode.AddonModeName().c_str()); -+ } -+ return bReturn; -+} -+ -+int CActiveAEDSPDatabase::GetModeId(const CActiveAEDSPMode &mode) -+{ -+ std::string id = GetSingleValue(PrepareSQL("SELECT * from modes WHERE modes.iAddonId=%i and modes.iAddonModeNumber=%i and modes.iType=%i", mode.AddonID(), mode.AddonModeNumber(), mode.ModeType())); -+ if (id.empty()) -+ return -1; -+ return strtol(id.c_str(), NULL, 10); -+} -+ -+int CActiveAEDSPDatabase::GetModes(AE_DSP_MODELIST &results, int modeType) -+{ -+ int iReturn(0); -+ -+ std::string strQuery=PrepareSQL("SELECT * FROM modes WHERE modes.iType=%i ORDER BY iPosition", modeType); -+ -+ m_pDS->query( strQuery ); -+ if (m_pDS->num_rows() > 0) -+ { -+ try -+ { -+ while (!m_pDS->eof()) -+ { -+ CActiveAEDSPModePtr mode = CActiveAEDSPModePtr(new CActiveAEDSPMode()); -+ -+ mode->m_iModeId = m_pDS->fv("idMode").get_asInt(); -+ mode->m_iModeType = (AE_DSP_MODE_TYPE)m_pDS->fv("iType").get_asInt(); -+ mode->m_iModePosition = m_pDS->fv("iPosition").get_asInt(); -+ mode->m_iStreamTypeFlags = m_pDS->fv("iStreamTypeFlags").get_asInt(); -+ mode->m_iBaseType = (AE_DSP_BASETYPE)m_pDS->fv("iBaseType").get_asInt(); -+ mode->m_bIsEnabled = m_pDS->fv("bIsEnabled").get_asBool(); -+ mode->m_strOwnIconPath = m_pDS->fv("sOwnIconPath").get_asString(); -+ mode->m_strOverrideIconPath = m_pDS->fv("sOverrideIconPath").get_asString(); -+ mode->m_iModeName = m_pDS->fv("iModeName").get_asInt(); -+ mode->m_iModeSetupName = m_pDS->fv("iModeSetupName").get_asInt(); -+ mode->m_iModeHelp = m_pDS->fv("iModeHelp").get_asInt(); -+ mode->m_iModeDescription = m_pDS->fv("iModeDescription").get_asInt(); -+ mode->m_strModeName = m_pDS->fv("sAddonModeName").get_asString(); -+ mode->m_iAddonId = m_pDS->fv("iAddonId").get_asInt(); -+ mode->m_iAddonModeNumber = m_pDS->fv("iAddonModeNumber").get_asInt(); -+ mode->m_bHasSettingsDialog = m_pDS->fv("bHasSettings").get_asBool(); -+ -+#ifdef ADSPDB_DEBUGGING -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - mode '%s' loaded from the database", __FUNCTION__, mode->m_strModeName.c_str()); -+#endif -+ AE_DSP_ADDON addon; -+ if (CServiceBroker::GetADSP().GetAudioDSPAddon(mode->m_iAddonId, addon)) -+ results.push_back(AE_DSP_MODEPAIR(mode, addon)); -+ -+ m_pDS->next(); -+ ++iReturn; -+ } -+ m_pDS->close(); -+ } -+ catch (...) -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - couldn't load modes from the database", __FUNCTION__); -+ } -+ } -+ else -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - query failed", __FUNCTION__); -+ } -+ -+ m_pDS->close(); -+ return iReturn; -+} -+ -+/********** Settings methods **********/ -+ -+bool CActiveAEDSPDatabase::DeleteActiveDSPSettings() -+{ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - deleting all active dsp settings from the database", __FUNCTION__); -+ return DeleteValues("settings"); -+} -+ -+bool CActiveAEDSPDatabase::DeleteActiveDSPSettings(const CFileItem &item) -+{ -+ std::string strPath, strFileName; -+ URIUtils::Split(item.GetPath(), strPath, strFileName); -+ return ExecuteQuery(PrepareSQL("DELETE FROM settings WHERE settings.strPath='%s' and settings.strFileName='%s'", strPath.c_str() , strFileName.c_str())); -+} -+ -+bool CActiveAEDSPDatabase::GetActiveDSPSettings(const CFileItem &item, CAudioSettings &settings) -+{ -+ try -+ { -+ if (NULL == m_pDB.get()) return false; -+ if (NULL == m_pDS.get()) return false; -+ std::string strPath, strFileName; -+ URIUtils::Split(item.GetPath(), strPath, strFileName); -+ std::string strSQL=PrepareSQL("SELECT * FROM settings WHERE settings.strPath='%s' and settings.strFileName='%s'", strPath.c_str() , strFileName.c_str()); -+ -+ m_pDS->query( strSQL ); -+ if (m_pDS->num_rows() > 0) -+ { // get the audio dsp settings info -+ settings.m_MasterStreamTypeSel = m_pDS->fv("MasterStreamTypeSel").get_asInt(); -+ int type = m_pDS->fv("MasterStreamType").get_asInt(); -+ int base = m_pDS->fv("MasterBaseType").get_asInt(); -+ settings.m_MasterStreamType = type; -+ settings.m_MasterStreamBase = base; -+ settings.m_MasterModes[type][base] = m_pDS->fv("MasterModeId").get_asInt(); -+ -+ /*! if auto mode is selected, copy the identifier of previous used processor to the auto mode entry */ -+ settings.m_MasterModes[settings.m_MasterStreamTypeSel][base] = settings.m_MasterModes[type][base]; -+ -+ m_pDS->close(); -+ return true; -+ } -+ m_pDS->close(); -+ } -+ catch (...) -+ { -+ CLog::Log(LOGERROR, "%s failed", __FUNCTION__); -+ } -+ return false; -+} -+ -+void CActiveAEDSPDatabase::SetActiveDSPSettings(const CFileItem &item, const CAudioSettings &setting) -+{ -+ try -+ { -+ if (NULL == m_pDB.get()) return ; -+ if (NULL == m_pDS.get()) return ; -+ std::string strPath, strFileName; -+ URIUtils::Split(item.GetPath(), strPath, strFileName); -+ std::string strSQL = StringUtils::Format("select * from settings WHERE settings.strPath='%s' and settings.strFileName='%s'", strPath.c_str() , strFileName.c_str()); -+ m_pDS->query( strSQL ); -+ if (m_pDS->num_rows() > 0) -+ { -+ m_pDS->close(); -+ // update the item -+ strSQL=PrepareSQL( -+ "update settings set " -+ "MasterStreamTypeSel=%i," -+ "MasterStreamType=%i," -+ "MasterBaseType=%i," -+ "MasterModeId=%i," -+ "WHERE settings.strPath='%s' and settings.strFileName='%s'\n", -+ setting.m_MasterStreamTypeSel, -+ setting.m_MasterStreamType, -+ setting.m_MasterStreamBase, -+ setting.m_MasterModes[setting.m_MasterStreamType][setting.m_MasterStreamBase], -+ strPath.c_str(), -+ strFileName.c_str()); -+ m_pDS->exec(strSQL); -+ return ; -+ } -+ else -+ { // add the items -+ m_pDS->close(); -+ strSQL= "INSERT INTO settings (" -+ "id, " -+ "strPath," -+ "strFileName," -+ "MasterStreamTypeSel," -+ "MasterStreamType," -+ "MasterBaseType," -+ "MasterModeId) " -+ "VALUES "; -+ strSQL += PrepareSQL("(NULL,'%s','%s',%i,%i,%i,%i)", -+ strPath.c_str(), -+ strFileName.c_str(), -+ setting.m_MasterStreamTypeSel, -+ setting.m_MasterStreamType, -+ setting.m_MasterStreamBase, -+ setting.m_MasterModes[setting.m_MasterStreamType][setting.m_MasterStreamBase]); -+ m_pDS->exec(strSQL); -+ } -+ } -+ catch (...) -+ { -+ CLog::Log(LOGERROR, "%s (%s) failed", __FUNCTION__, item.GetPath().c_str()); -+ } -+} -+ -+void CActiveAEDSPDatabase::EraseActiveDSPSettings() -+{ -+ CLog::Log(LOGINFO, "Deleting dsp settings information for all files"); -+ ExecuteQuery(PrepareSQL("DELETE from settings")); -+} -+ -+void CActiveAEDSPDatabase::SplitPath(const std::string& strFileNameAndPath, std::string& strPath, std::string& strFileName) -+{ -+ if (URIUtils::IsStack(strFileNameAndPath) || StringUtils::StartsWithNoCase(strFileNameAndPath, "rar://") || StringUtils::StartsWithNoCase(strFileNameAndPath, "zip://")) -+ { -+ URIUtils::GetParentPath(strFileNameAndPath,strPath); -+ strFileName = strFileNameAndPath; -+ } -+ else if (URIUtils::IsPlugin(strFileNameAndPath)) -+ { -+ CURL url(strFileNameAndPath); -+ strPath = url.GetWithoutFilename(); -+ strFileName = strFileNameAndPath; -+ } -+ else -+ URIUtils::Split(strFileNameAndPath,strPath, strFileName); -+} -+ -+/********** Audio DSP add-on methods **********/ -+ -+bool CActiveAEDSPDatabase::DeleteAddons() -+{ -+ CLog::Log(LOGDEBUG, "Audio DSP - %s - deleting all add-on's from the database", __FUNCTION__); -+ -+ return DeleteValues("addons"); -+} -+ -+bool CActiveAEDSPDatabase::Delete(const std::string &strAddonUid) -+{ -+ /* invalid addon uid */ -+ if (strAddonUid.empty()) -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - invalid addon uid", __FUNCTION__); -+ return false; -+ } -+ -+ Filter filter; -+ filter.AppendWhere(PrepareSQL("sUid = '%s'", strAddonUid.c_str())); -+ -+ return DeleteValues("addons", filter); -+} -+ -+int CActiveAEDSPDatabase::GetAudioDSPAddonId(const std::string &strAddonUid) -+{ -+ std::string strWhereClause = PrepareSQL("sUid = '%s'", strAddonUid.c_str()); -+ std::string strValue = GetSingleValue("addons", "idAddon", strWhereClause); -+ -+ if (strValue.empty()) -+ return -1; -+ -+ return strtol(strValue.c_str(), NULL, 10); -+} -+ -+int CActiveAEDSPDatabase::Persist(const AddonPtr& addon) -+{ -+ int iReturn(-1); -+ -+ /* invalid addon uid or name */ -+ if (addon->Name().empty() || addon->ID().empty()) -+ { -+ CLog::Log(LOGERROR, "Audio DSP - %s - invalid add-on uid or name", __FUNCTION__); -+ return iReturn; -+ } -+ -+ std::string strQuery = PrepareSQL("REPLACE INTO addons (sName, sUid) VALUES ('%s', '%s');", -+ addon->Name().c_str(), addon->ID().c_str()); -+ -+ if (ExecuteQuery(strQuery)) -+ iReturn = (int) m_pDS->lastinsertid(); -+ -+ return iReturn; -+} -+ -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.h b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.h -new file mode 100644 -index 0000000..e2c9ecb ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.h -@@ -0,0 +1,216 @@ -+#pragma once -+/* -+ * Copyright (C) 2012-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "ActiveAEDSPMode.h" -+ -+class CAudioSettings; -+ -+namespace ActiveAE -+{ -+ class CActiveAEDSPAddon; -+ class CActiveAEDSPProcess; -+ -+ /** The audio DSP database */ -+ -+ class CActiveAEDSPDatabase : public CDatabase -+ { -+ public: -+ /*! -+ * @brief Create a new instance of the audio DSP database. -+ */ -+ CActiveAEDSPDatabase(void) {}; -+ virtual ~CActiveAEDSPDatabase(void) {}; -+ -+ /*! -+ * @brief Open the database. -+ * @return True if it was opened successfully, false otherwise. -+ */ -+ virtual bool Open(); -+ -+ /*! -+ * @brief Get the minimal database version that is required to operate correctly. -+ * @return The minimal database version. -+ */ -+ virtual int GetMinVersion() const { return 1; }; -+ -+ /*! -+ * @brief Get the default sqlite database filename. -+ * @return The default filename. -+ */ -+ const char *GetBaseDBName() const { return "ADSP"; }; -+ -+ /*! @name mode methods */ -+ //@{ -+ /*! -+ * @brief Used to check for present mode types -+ * @param modeType The mode type identfier -+ * @return True if modes present of given type -+ */ -+ bool ContainsModes(int modeType); -+ -+ /*! -+ * @brief Remove all modes from the database. -+ * @return True if all modes were removed, false otherwise. -+ */ -+ bool DeleteModes(void); -+ -+ /*! -+ * @brief Remove all modes from the database of a type. -+ * @param modeType The mode type identfier of functions to delete. -+ * @return True if the modes were deleted, false otherwise. -+ */ -+ bool DeleteModes(int modeType); -+ -+ /*! -+ * @brief Remove all modes from a add-on from the database. -+ * @param addonId The add-on identifier to delete the modes for. -+ * @return True if the modes were deleted, false otherwise. -+ */ -+ bool DeleteAddonModes(int addonId); -+ -+ /*! -+ * @brief Remove a mode entry from the database -+ * @param mode The mode to remove. -+ * @return True if the mode was removed, false otherwise. -+ */ -+ bool DeleteMode(const CActiveAEDSPMode &mode); -+ -+ /*! -+ * @brief Add or update mode entries in the database -+ * @param modes The modes to persist. -+ * @param modeType If true, don't write immediately -+ * @return True when persisted or queued, false otherwise. -+ */ -+ bool PersistModes(std::vector &modes, int modeType); -+ -+ /*! -+ * @brief Update user selectable mode settings inside database -+ * @param modeType the mode type to get -+ * @param active true if the mode is enabled -+ * @param addonId the addon id of this mode -+ * @param addonModeNumber the from addon set mode number -+ * @param listNumber the list number on processing chain -+ * @return True if the modes were updated, false otherwise. -+ */ -+ bool UpdateMode(int modeType, bool active, int addonId, int addonModeNumber, int listNumber); -+ -+ /*! -+ * @brief Add or if present update mode inside database -+ * @param addon The add-on to check the modes for. -+ * @return True if the modes were updated or added, false otherwise. -+ */ -+ bool AddUpdateMode(CActiveAEDSPMode &mode); -+ -+ /*! -+ * @brief Get id of mode inside database -+ * @param mode The mode to check for inside the database -+ * @return The id or -1 if not found -+ */ -+ int GetModeId(const CActiveAEDSPMode &mode); -+ -+ /*! -+ * @brief Get the list of modes from type on database -+ * @param results The mode group to store the results in. -+ * @param modeType the mode type to get -+ * @return The amount of modes that were added. -+ */ -+ int GetModes(AE_DSP_MODELIST &results, int modeType); -+ //@} -+ -+ /*! @name Add-on methods */ -+ //@{ -+ /*! -+ * @brief Remove all add-on information from the database. -+ * @return True if all add-on's were removed successfully. -+ */ -+ bool DeleteAddons(); -+ -+ /*! -+ * @brief Remove a add-on from the database -+ * @param strAddonUid The unique ID of the add-on. -+ * @return True if the add-on was removed successfully, false otherwise. -+ */ -+ bool Delete(const std::string &strAddonUid); -+ -+ /*! -+ * @brief Get the database ID of a add-on. -+ * @param strAddonUid The unique ID of the add-on. -+ * @return The database ID of the add-on or -1 if it wasn't found. -+ */ -+ int GetAudioDSPAddonId(const std::string &strAddonUid); -+ -+ /*! -+ * @brief Add a add-on to the database if it's not already in there. -+ * @param addon The pointer to the addon class -+ * @return The database ID of the client. -+ */ -+ int Persist(const ADDON::AddonPtr &addon); -+ //@} -+ -+ /*! @name Settings methods */ -+ //@{ -+ -+ /*! -+ * @brief Remove all active dsp settings from the database. -+ * @return True if all dsp data were removed successfully, false if not. -+ */ -+ bool DeleteActiveDSPSettings(); -+ -+ /*! -+ * @brief Remove active dsp settings from the database for file. -+ * @return True if dsp data were removed successfully, false if not. -+ */ -+ bool DeleteActiveDSPSettings(const CFileItem &item); -+ -+ /*! -+ * @brief GetVideoSettings() obtains any saved video settings for the current file. -+ * @return Returns true if the settings exist, false otherwise. -+ */ -+ bool GetActiveDSPSettings(const CFileItem &item, CAudioSettings &settings); -+ -+ /*! -+ * @brief Sets the settings for a particular used file -+ */ -+ void SetActiveDSPSettings(const CFileItem &item, const CAudioSettings &settings); -+ -+ /*! -+ * @brief EraseActiveDSPSettings() Erases the dsp Settings table and reconstructs it -+ */ -+ void EraseActiveDSPSettings(); -+ //@} -+ -+ private: -+ /*! -+ * @brief Create the audio DSP database tables. -+ */ -+ virtual void CreateTables(); -+ virtual void CreateAnalytics(); -+ -+ /*! -+ * @brief Update an old version of the database. -+ * @param version The version to update the database from. -+ */ -+ virtual void UpdateTables(int version); -+ virtual int GetSchemaVersion() const { return 0; } -+ -+ void SplitPath(const std::string& strFileNameAndPath, std::string& strPath, std::string& strFileName); -+ }; -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.cpp b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.cpp -new file mode 100644 -index 0000000..738e494 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.cpp -@@ -0,0 +1,430 @@ -+/* -+ * Copyright (C) 2010-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "ActiveAEDSPMode.h" -+#include "ActiveAEDSPDatabase.h" -+#include "ActiveAEDSP.h" -+#include "utils/StringUtils.h" -+ -+using namespace ActiveAE; -+ -+bool CActiveAEDSPMode::operator==(const CActiveAEDSPMode &right) const -+{ -+ return (m_iModeId == right.m_iModeId && -+ m_iAddonId == right.m_iAddonId && -+ m_iAddonModeNumber == right.m_iAddonModeNumber && -+ m_iModeType == right.m_iModeType && -+ m_iModePosition == right.m_iModePosition); -+} -+ -+bool CActiveAEDSPMode::operator!=(const CActiveAEDSPMode &right) const -+{ -+ return !(*this == right); -+} -+ -+CActiveAEDSPMode::CActiveAEDSPMode() -+{ -+ m_iModeType = AE_DSP_MODE_TYPE_UNDEFINED; -+ m_iModeId = -1; -+ m_iModePosition = -1; -+ m_bIsEnabled = false; -+ m_strOwnIconPath = ""; -+ m_strOverrideIconPath = ""; -+ m_iStreamTypeFlags = 0; -+ m_iBaseType = AE_DSP_ABASE_INVALID; -+ m_iModeName = -1; -+ m_iModeSetupName = -1; -+ m_iModeDescription = -1; -+ m_iModeHelp = -1; -+ m_bChanged = false; -+ m_bIsInternal = false; -+ m_bHasSettingsDialog = false; -+ -+ m_fCPUUsage = 0.0f; -+ -+ m_iAddonId = -1; -+ m_iAddonModeNumber = -1; -+ m_strModeName = ""; -+} -+ -+CActiveAEDSPMode::CActiveAEDSPMode(int modeId, const AE_DSP_BASETYPE baseType) -+{ -+ m_iModeType = AE_DSP_MODE_TYPE_MASTER_PROCESS; -+ m_iModeId = modeId; -+ m_iModePosition = 0; -+ m_bIsEnabled = true; -+ m_strOwnIconPath = ""; -+ m_strOverrideIconPath = ""; -+ m_iStreamTypeFlags = AE_DSP_PRSNT_ASTREAM_BASIC | -+ AE_DSP_PRSNT_ASTREAM_MUSIC | -+ AE_DSP_PRSNT_ASTREAM_MOVIE/* | -+ AE_DSP_PRSNT_ASTREAM_GAME | -+ AE_DSP_PRSNT_ASTREAM_APP | -+ AE_DSP_PRSNT_ASTREAM_PHONE | -+ AE_DSP_PRSNT_ASTREAM_MESSAGE*/; -+ m_iBaseType = baseType; -+ -+ switch (modeId) -+ { -+ case AE_DSP_MASTER_MODE_ID_PASSOVER: -+ m_iModeName = 16039; -+ m_iModeDescription = -1; -+ m_iModeHelp = -1; -+ m_iModeSetupName = -1; -+ m_strModeName = "Passover"; -+ break; -+ case AE_DSP_MASTER_MODE_ID_INTERNAL_STEREO_UPMIX: -+ m_iModeName = 252; -+ m_iModeDescription = 36364; -+ m_iModeHelp = -1; -+ m_iModeSetupName = -1; -+ m_strModeName = "Stereo Upmix"; -+ break; -+ default: -+ m_iModeName = 16039; -+ m_iModeDescription = -1; -+ m_iModeHelp = -1; -+ m_iModeSetupName = -1; -+ m_strModeName = "Unknown"; -+ break; -+ }; -+ -+ m_bChanged = false; -+ m_bIsInternal = true; -+ m_bHasSettingsDialog = false; -+ -+ m_fCPUUsage = 0.0f; -+ -+ m_iAddonId = -1; -+ m_iAddonModeNumber = -1; -+} -+ -+CActiveAEDSPMode::CActiveAEDSPMode(const AE_DSP_MODES::AE_DSP_MODE &mode, int iAddonId) -+{ -+ m_iModeType = mode.iModeType; -+ m_iModePosition = -1; -+ m_iModeId = mode.iUniqueDBModeId; -+ m_iAddonId = iAddonId; -+ m_iBaseType = AE_DSP_ABASE_INVALID; -+ m_bIsEnabled = m_iModeType == AE_DSP_MODE_TYPE_MASTER_PROCESS ? !mode.bIsDisabled : false; -+ m_strOwnIconPath = mode.strOwnModeImage; -+ m_strOverrideIconPath = mode.strOverrideModeImage; -+ m_iStreamTypeFlags = mode.iModeSupportTypeFlags; -+ m_iModeName = mode.iModeName; -+ m_iModeSetupName = mode.iModeSetupName; -+ m_iModeDescription = mode.iModeDescription; -+ m_iModeHelp = mode.iModeHelp; -+ m_iAddonModeNumber = mode.iModeNumber; -+ m_strModeName = mode.strModeName; -+ m_bHasSettingsDialog = mode.bHasSettingsDialog; -+ m_bChanged = false; -+ m_bIsInternal = false; -+ -+ m_fCPUUsage = 0.0f; -+ -+ if (m_strModeName.empty()) -+ m_strModeName = StringUtils::Format("%s %d", g_localizeStrings.Get(15023).c_str(), m_iModeId); -+} -+ -+CActiveAEDSPMode::CActiveAEDSPMode(const CActiveAEDSPMode &mode) -+{ -+ *this = mode; -+} -+ -+CActiveAEDSPMode &CActiveAEDSPMode::operator=(const CActiveAEDSPMode &mode) -+{ -+ m_iModeId = mode.m_iModeId; -+ m_iModeType = mode.m_iModeType; -+ m_iModePosition = mode.m_iModePosition; -+ m_bIsEnabled = mode.m_bIsEnabled; -+ m_strOwnIconPath = mode.m_strOwnIconPath; -+ m_strOverrideIconPath = mode.m_strOverrideIconPath; -+ m_iStreamTypeFlags = mode.m_iStreamTypeFlags; -+ m_iBaseType = mode.m_iBaseType; -+ m_iModeName = mode.m_iModeName; -+ m_iModeSetupName = mode.m_iModeSetupName; -+ m_iModeDescription = mode.m_iModeDescription; -+ m_iModeHelp = mode.m_iModeHelp; -+ m_iAddonId = mode.m_iAddonId; -+ m_iAddonModeNumber = mode.m_iAddonModeNumber; -+ m_strModeName = mode.m_strModeName; -+ m_bChanged = mode.m_bChanged; -+ m_bIsInternal = mode.m_bIsInternal; -+ m_bHasSettingsDialog = mode.m_bHasSettingsDialog; -+ m_fCPUUsage = mode.m_fCPUUsage; -+ -+ return *this; -+} -+ -+/********** General mode related functions **********/ -+ -+bool CActiveAEDSPMode::IsNew(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeId <= 0; -+} -+ -+bool CActiveAEDSPMode::IsChanged(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bChanged; -+} -+ -+ -+bool CActiveAEDSPMode::IsInternal(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bIsInternal; -+} -+ -+bool CActiveAEDSPMode::IsEnabled(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bIsEnabled; -+} -+ -+bool CActiveAEDSPMode::SetEnabled(bool bIsEnabled) -+{ -+ CSingleLock lock(m_critSection); -+ -+ if (m_bIsEnabled != bIsEnabled) -+ { -+ /* update the Enabled flag */ -+ m_bIsEnabled = bIsEnabled; -+ SetChanged(); -+ m_bChanged = true; -+ -+ return true; -+ } -+ -+ return false; -+} -+ -+int CActiveAEDSPMode::ModePosition(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModePosition; -+} -+ -+bool CActiveAEDSPMode::SetModePosition(int iModePosition) -+{ -+ CSingleLock lock(m_critSection); -+ if (m_iModePosition != iModePosition) -+ { -+ /* update the type */ -+ m_iModePosition = iModePosition; -+ SetChanged(); -+ m_bChanged = true; -+ -+ return true; -+ } -+ -+ return false; -+} -+ -+bool CActiveAEDSPMode::SupportStreamType(AE_DSP_STREAMTYPE streamType, unsigned int flags) -+{ -+ if (streamType == AE_DSP_ASTREAM_BASIC && (flags & AE_DSP_PRSNT_ASTREAM_BASIC)) return true; -+ else if (streamType == AE_DSP_ASTREAM_MUSIC && (flags & AE_DSP_PRSNT_ASTREAM_MUSIC)) return true; -+ else if (streamType == AE_DSP_ASTREAM_MOVIE && (flags & AE_DSP_PRSNT_ASTREAM_MOVIE)) return true; -+ else if (streamType == AE_DSP_ASTREAM_GAME && (flags & AE_DSP_PRSNT_ASTREAM_GAME)) return true; -+ else if (streamType == AE_DSP_ASTREAM_APP && (flags & AE_DSP_PRSNT_ASTREAM_APP)) return true; -+ else if (streamType == AE_DSP_ASTREAM_PHONE && (flags & AE_DSP_PRSNT_ASTREAM_PHONE)) return true; -+ else if (streamType == AE_DSP_ASTREAM_MESSAGE && (flags & AE_DSP_PRSNT_ASTREAM_MESSAGE)) return true; -+ return false; -+} -+ -+bool CActiveAEDSPMode::SupportStreamType(AE_DSP_STREAMTYPE streamType) const -+{ -+ return SupportStreamType(streamType, m_iStreamTypeFlags); -+} -+ -+/********** Mode user interface related data functions **********/ -+ -+int CActiveAEDSPMode::ModeName(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeName; -+} -+ -+int CActiveAEDSPMode::ModeSetupName(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeSetupName; -+} -+ -+int CActiveAEDSPMode::ModeDescription(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeDescription; -+} -+ -+int CActiveAEDSPMode::ModeHelp(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeHelp; -+} -+ -+const std::string &CActiveAEDSPMode::IconOwnModePath(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_strOwnIconPath; -+} -+ -+const std::string &CActiveAEDSPMode::IconOverrideModePath(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_strOverrideIconPath; -+} -+ -+ -+/********** Master mode type related functions **********/ -+ -+bool CActiveAEDSPMode::SetBaseType(AE_DSP_BASETYPE baseType) -+{ -+ CSingleLock lock(m_critSection); -+ if (m_iBaseType != baseType) -+ { -+ /* update the mode base */ -+ m_iBaseType = baseType; -+ SetChanged(); -+ m_bChanged = true; -+ -+ return true; -+ } -+ -+ return false; -+} -+ -+AE_DSP_BASETYPE CActiveAEDSPMode::BaseType(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iBaseType; -+} -+ -+ -+/********** Audio DSP database related functions **********/ -+ -+int CActiveAEDSPMode::ModeID(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeId; -+} -+ -+int CActiveAEDSPMode::AddUpdate(bool force) -+{ -+ if (!force) -+ { -+ // not changed -+ CSingleLock lock(m_critSection); -+ if (!m_bChanged && m_iModeId > 0) -+ return m_iModeId; -+ } -+ -+ CActiveAEDSPDatabase *database = CServiceBroker::GetADSP().GetADSPDatabase(); -+ if (!database || !database->IsOpen()) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - failed to open the database"); -+ return -1; -+ } -+ -+ database->AddUpdateMode(*this); -+ m_iModeId = database->GetModeId(*this); -+ -+ return m_iModeId; -+} -+ -+bool CActiveAEDSPMode::Delete(void) -+{ -+ CActiveAEDSPDatabase *database = CServiceBroker::GetADSP().GetADSPDatabase(); -+ if (!database || !database->IsOpen()) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - failed to open the database"); -+ return false; -+ } -+ -+ return database->DeleteMode(*this); -+} -+ -+bool CActiveAEDSPMode::IsKnown(void) const -+{ -+ CActiveAEDSPDatabase *database = CServiceBroker::GetADSP().GetADSPDatabase(); -+ if (!database || !database->IsOpen()) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - failed to open the database"); -+ return false; -+ } -+ -+ return database->GetModeId(*this) > 0; -+} -+ -+ -+/********** Dynamic processing related data methods **********/ -+ -+void CActiveAEDSPMode::SetCPUUsage(float percent) -+{ -+ CSingleLock lock(m_critSection); -+ m_fCPUUsage = percent; -+} -+ -+float CActiveAEDSPMode::CPUUsage(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_fCPUUsage; -+} -+ -+ -+/********** Fixed addon related Mode methods **********/ -+ -+int CActiveAEDSPMode::AddonID(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iAddonId; -+} -+ -+unsigned int CActiveAEDSPMode::AddonModeNumber(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iAddonModeNumber; -+} -+ -+AE_DSP_MODE_TYPE CActiveAEDSPMode::ModeType(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iModeType; -+} -+ -+const std::string &CActiveAEDSPMode::AddonModeName(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_strModeName; -+} -+ -+bool CActiveAEDSPMode::HasSettingsDialog(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bHasSettingsDialog; -+} -+ -+unsigned int CActiveAEDSPMode::StreamTypeFlags(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_iStreamTypeFlags; -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h -new file mode 100644 -index 0000000..a6ded93 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h -@@ -0,0 +1,325 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include -+ -+#include "ActiveAEDSPAddon.h" -+#include "threads/CriticalSection.h" -+#include "utils/Observer.h" -+ -+namespace ActiveAE -+{ -+ class CActiveAEDSPMode; -+ class CActiveAEDSPDatabase; -+ -+ typedef std::shared_ptr CActiveAEDSPModePtr; -+ typedef std::pair AE_DSP_MODEPAIR; -+ typedef std::vector AE_DSP_MODELIST; -+ -+ #define AE_DSP_MASTER_MODE_ID_INTERNAL_TYPES 0xFF00 -+ #define AE_DSP_MASTER_MODE_ID_INTERNAL_STEREO_UPMIX (AE_DSP_MASTER_MODE_ID_INTERNAL_TYPES) /*!< Used to for internal stereo upmix over ffmpeg */ -+ #define AE_DSP_MASTER_MODE_ID_PASSOVER 0 /*!< Used to ignore master processing */ -+ #define AE_DSP_MASTER_MODE_ID_INVALID -1 -+ -+ /*! -+ * DSP Mode information class -+ */ -+ //@{ -+ class CActiveAEDSPMode : public Observable -+ { -+ public: -+ /*! @brief Create a new mode */ -+ CActiveAEDSPMode(); -+ -+ /*! -+ * @brief Create a KODI internal processing mode infomation class -+ * @param modeId internal processing mode identifier -+ * @param baseType the used base of this internal mode -+ * @note this creation is only used to get a internal bypass mode (no addon call process mode) -+ */ -+ CActiveAEDSPMode(int modeId, const AE_DSP_BASETYPE baseType); -+ -+ /*! -+ * @brief Create the class about from addon given values -+ * @param mode the from addon set identification structure -+ * @param iAddonId the addon identification of the given data -+ */ -+ CActiveAEDSPMode(const AE_DSP_MODES::AE_DSP_MODE &mode, int iAddonId); -+ -+ /*! -+ * @brief Create a new class about given class -+ * @param mode the parent mode to copy data from -+ */ -+ CActiveAEDSPMode(const CActiveAEDSPMode &mode); -+ -+ bool operator ==(const CActiveAEDSPMode &right) const; -+ bool operator !=(const CActiveAEDSPMode &right) const; -+ CActiveAEDSPMode &operator=(const CActiveAEDSPMode &mode); -+ -+ /*! @name General mode related functions -+ * @note changes are not written inside database and must be performed with AddUpdate call -+ */ -+ //@{ -+ /*! -+ * @brief Check this mode as known or new one -+ * @return true if this mode is new and not stored inside database -+ */ -+ bool IsNew(void) const; -+ -+ /*! -+ * @brief Check this mode about data changes -+ * @return true if anything becomes changed on the mode data -+ */ -+ bool IsChanged(void) const; -+ -+ /*! -+ * @brief Check this mode about source -+ * @return true if internal KODI mode -+ */ -+ bool IsInternal(void) const; -+ -+ /*! -+ * @brief Check this mode is enabled for usage -+ * @return true if enabled -+ */ -+ bool IsEnabled(void) const; -+ -+ /*! -+ * @brief Enable or disable the usage of this mode -+ * @param bIsEnabled true to enable -+ * @return true if set was successful -+ */ -+ bool SetEnabled(bool bIsEnabled); -+ -+ /*! -+ * @brief Get the mode process chain position inside his mode type -+ * @return the mode process position or -1 not set -+ */ -+ int ModePosition(void) const; -+ -+ /*! -+ * @brief Set the mode process chain position inside his mode type -+ * @param iModePosition the process chain position -+ * @return true if the position becomes set and a database update becomes required -+ */ -+ bool SetModePosition(int iModePosition); -+ -+ /*! -+ * @brief Ask about stream type to given flags -+ * @param streamType the type to ask -+ * @param flags the stream types flags to check in accordance with AE_DSP_ASTREAM_PRESENT -+ * @return true if the mode is set as enabled under the flags -+ */ -+ static bool SupportStreamType(AE_DSP_STREAMTYPE streamType, unsigned int flags); -+ -+ /*! -+ * @brief Ask this mode about stream type -+ * @param streamType the type to ask -+ * @return true if the mode is set as enabled of this mode -+ */ -+ bool SupportStreamType(AE_DSP_STREAMTYPE streamType) const; -+ //@} -+ -+ /*! @name Mode user interface related data functions -+ */ -+ //@{ -+ /*! -+ * @brief Get the mode name string identification code -+ * @return the identifier code on addon strings or -1 if unset -+ */ -+ int ModeName(void) const; -+ -+ /*! -+ * @brief Get the mode name string identification code used on setup entries -+ * @return the identifier code on addon strings or -1 if unset -+ */ -+ int ModeSetupName(void) const; -+ -+ /*! -+ * @brief Get the mode help string identification code used as help text on dsp manager helper dialog -+ * @return the identifier code on addon strings or -1 if unset -+ */ -+ int ModeHelp(void) const; -+ -+ /*! -+ * @brief Get the mode description string identification code used as small help text on dsp manager dialog -+ * @return the identifier code on addon strings or -1 if unset -+ */ -+ int ModeDescription(void) const; -+ -+ /*! -+ * @brief Get the path to a from addon set mode identification image -+ * @return the path to the image or empty if not present -+ */ -+ const std::string &IconOwnModePath(void) const; -+ -+ /*! -+ * @brief Get the path to a from addon set mode identification image to overirde the from KODI used one, e.g. Dolby Digital with Dolby Digital EX -+ * @return the path to the image or empty if not present -+ */ -+ const std::string &IconOverrideModePath(void) const; -+ //@} -+ -+ /*! @name Master mode type related functions -+ */ -+ //@{ -+ /*! -+ * @brief Get the used base type of this mode -+ * @return the base type -+ */ -+ AE_DSP_BASETYPE BaseType(void) const; -+ -+ /*! -+ * @brief Set the used base type of this mode -+ * @return baseType the base type to set -+ * @return true if the position becomes set and a database update becomes required -+ */ -+ bool SetBaseType(AE_DSP_BASETYPE baseType); -+ //@} -+ -+ /*! @name Audio DSP database related functions -+ */ -+ //@{ -+ /*! -+ * @brief Get the identifier of this mode used on database -+ * @return the mode identifier or -1 if unknown and not safed to database -+ */ -+ int ModeID(void) const; -+ -+ /*! -+ * @brief Add or update this mode to the audio DSP database -+ * @param force if it is false it write only to the database on uknown id or if a change was inside the mode -+ * @return the database identifier of this mode, or -1 if a error was occurred -+ */ -+ int AddUpdate(bool force = false); -+ -+ /*! -+ * @brief Delete this mode from the audio dsp database -+ * @return true if deletion was successful -+ */ -+ bool Delete(void); -+ -+ /*! -+ * @brief Ask database about this mode that it is alread known -+ * @return true if present inside database -+ */ -+ bool IsKnown(void) const; -+ //@} -+ -+ /*! @name Dynamic processing related functions -+ */ -+ //@{ -+ /*! -+ * @brief Get the cpu usage of this mode -+ * @return percent The percent value (0.0 - 100.0) -+ * @note only be usable if mode is active in process chain -+ */ -+ float CPUUsage(void) const; -+ -+ /*! -+ * @brief Set the cpu usage of this mode if active and in process list -+ * @param percent The percent value (0.0 - 100.0) -+ */ -+ void SetCPUUsage(float percent); -+ //@} -+ -+ /*! @name Fixed audio dsp add-on related mode functions -+ */ -+ //@{ -+ /*! -+ * @brief Get the addon identifier -+ * @return returns the inside addon database used identifier of this mode based addon -+ */ -+ int AddonID(void) const; -+ -+ /*! -+ * @brief Get the addon processing mode identifier -+ * @return returns the from addon itself set identifier of this mode -+ */ -+ unsigned int AddonModeNumber(void) const; -+ -+ /*! -+ * @brief The processing mode type identifier of this mode -+ * @return returns the mode type, it should be never AE_DSP_MODE_TYPE_UNDEFINED -+ */ -+ AE_DSP_MODE_TYPE ModeType(void) const; -+ -+ /*! -+ * @brief Get the addon mode name -+ * @return returns the from addon set name of this mode, used for log messages -+ */ -+ const std::string &AddonModeName(void) const; -+ -+ /*! -+ * @brief Have this mode settings dialogs -+ * @return returns true if one or more dialogs are available to this mode -+ * @note if it is true the addon menu hook database can be checked with the addon mode identifier -+ */ -+ bool HasSettingsDialog(void) const; -+ -+ /*! -+ * @brief Get the from addon mode supported stream type flags -+ * @return returns the flags in accordance with AE_DSP_ASTREAM_PRESENT -+ */ -+ unsigned int StreamTypeFlags(void) const; -+ //@} -+ -+ private: -+ friend class CActiveAEDSPDatabase; -+ -+ /*! @name KODI related mode data -+ */ -+ //@{ -+ AE_DSP_MODE_TYPE m_iModeType; /*!< the processing mode type */ -+ int m_iModePosition; /*!< the processing mode position */ -+ int m_iModeId; /*!< the identifier given to this mode by the DSP database */ -+ AE_DSP_BASETYPE m_iBaseType; /*!< The stream source coding format */ -+ bool m_bIsEnabled; /*!< true if this mode is enabled, false if not */ -+ std::string m_strOwnIconPath; /*!< the path to the icon for this mode */ -+ std::string m_strOverrideIconPath; /*!< the path to the icon for this mode */ -+ int m_iModeName; /*!< the name id for this mode used by KODI */ -+ int m_iModeSetupName; /*!< the name id for this mode inside settings used by KODI */ -+ int m_iModeDescription; /*!< the description id for this mode used by KODI */ -+ int m_iModeHelp; /*!< the help id for this mode used by KODI */ -+ bool m_bChanged; /*!< true if anything in this entry was changed that needs to be persisted */ -+ bool m_bIsInternal; /*!< true if this mode is an internal KODI mode */ -+ std::string m_strModeName; /*!< the log name of this mode on the Addon or inside KODI */ -+ //@} -+ -+ /*! @name Dynamic processing related data -+ */ -+ //@{ -+ float m_fCPUUsage; /*!< if mode is active the used cpu force in percent is set here */ -+ //@} -+ -+ /*! @name Audio dsp add-on related mode data -+ */ -+ //@{ -+ int m_iAddonId; /*!< the identifier of the Addon that serves this mode */ -+ unsigned int m_iAddonModeNumber; /*!< the mode number on the Addon */ -+ bool m_bHasSettingsDialog; /*!< the mode have a own settings dialog */ -+ unsigned int m_iStreamTypeFlags; /*!< The stream content type flags in accordance with AE_DSP_ASTREAM_PRESENT */ -+ //@} -+ -+ CCriticalSection m_critSection; -+ }; -+ //@} -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.cpp b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.cpp -new file mode 100644 -index 0000000..2ec15df ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.cpp -@@ -0,0 +1,1801 @@ -+/* -+ * Copyright (C) 2010-2015 Team Kodi -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with Kodi; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "ActiveAEDSPProcess.h" -+ -+#include -+ -+extern "C" { -+#include "libavutil/channel_layout.h" -+#include "libavutil/opt.h" -+} -+ -+#include "ActiveAEDSPMode.h" -+#include "Application.h" -+#include "cores/AudioEngine/AEResampleFactory.h" -+#include "cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h" -+#include "cores/AudioEngine/Utils/AEUtil.h" -+#include "cores/IPlayer.h" -+#include "settings/MediaSettings.h" -+#include "utils/TimeUtils.h" -+ -+using namespace ADDON; -+using namespace ActiveAE; -+ -+#define MIN_DSP_ARRAY_SIZE 4096 -+ -+CActiveAEDSPProcess::CActiveAEDSPProcess(AE_DSP_STREAM_ID streamId) -+ : m_streamId(streamId) -+{ -+ m_channelLayoutIn = 0; /* Undefined input channel layout */ -+ m_channelLayoutOut = 0; /* Undefined output channel layout */ -+ m_streamTypeUsed = AE_DSP_ASTREAM_INVALID; -+ m_NewStreamType = AE_DSP_ASTREAM_INVALID; -+ m_NewMasterMode = AE_DSP_MASTER_MODE_ID_INVALID; -+ m_forceInit = false; -+ m_resamplerDSPProcessor = NULL; -+ m_convertInput = NULL; -+ m_convertOutput = NULL; -+ m_iLastProcessTime = 0; -+ -+ /*! -+ * Create predefined process arrays on every supported channel for audio dsp's. -+ * All are set if used or not for safety reason and unsued ones can be used from -+ * dsp addons as buffer arrays. -+ * If a bigger size is neeeded it becomes reallocated during DSP processing. -+ */ -+ m_processArraySize = MIN_DSP_ARRAY_SIZE; -+ for (int i = 0; i < AE_DSP_CH_MAX; ++i) -+ { -+ m_processArray[0][i] = (float*)calloc(m_processArraySize, sizeof(float)); -+ m_processArray[1][i] = (float*)calloc(m_processArraySize, sizeof(float)); -+ } -+} -+ -+CActiveAEDSPProcess::~CActiveAEDSPProcess() -+{ -+ ResetStreamFunctionsSelection(); -+ -+ if (m_resamplerDSPProcessor) -+ { -+ delete m_resamplerDSPProcessor; -+ m_resamplerDSPProcessor = NULL; -+ } -+ -+ /* Clear the buffer arrays */ -+ for (int i = 0; i < AE_DSP_CH_MAX; ++i) -+ { -+ if(m_processArray[0][i]) -+ free(m_processArray[0][i]); -+ if(m_processArray[1][i]) -+ free(m_processArray[1][i]); -+ } -+ -+ swr_free(&m_convertInput); -+ swr_free(&m_convertOutput); -+} -+ -+void CActiveAEDSPProcess::ResetStreamFunctionsSelection() -+{ -+ m_NewMasterMode = AE_DSP_MASTER_MODE_ID_INVALID; -+ m_NewStreamType = AE_DSP_ASTREAM_INVALID; -+ m_addon_InputResample.Clear(); -+ m_addon_OutputResample.Clear(); -+ -+ m_addons_InputProc.clear(); -+ m_addons_PreProc.clear(); -+ m_addons_MasterProc.clear(); -+ m_addons_PostProc.clear(); -+ m_usedMap.clear(); -+} -+ -+bool CActiveAEDSPProcess::Create(const AEAudioFormat &inputFormat, const AEAudioFormat &outputFormat, bool upmix, AEQuality quality, AE_DSP_STREAMTYPE iStreamType, -+ enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type, int profile) -+{ -+ m_inputFormat = inputFormat; /*!< Input format of processed stream */ -+ m_outputFormat = outputFormat; /*!< Output format of required stream (set from ADSP system on startup, to have ffmpeg compatible format */ -+ m_outputSamplerate = m_inputFormat.m_sampleRate; /*!< If no resampler addon is present output samplerate is the same as input */ -+ m_outputFrames = m_inputFormat.m_frames; -+ m_streamQuality = quality; /*!< from KODI on settings selected resample quality, also passed to addons to support different quality */ -+ m_dataFormat = AE_FMT_FLOAT; /*!< the base stream format, hard set to float */ -+ m_activeMode = AE_DSP_MASTER_MODE_ID_PASSOVER; /*!< Reset the pointer for m_MasterModes about active master process, set here during mode selection */ -+ m_ffMpegMatrixEncoding = matrix_encoding; -+ m_ffMpegAudioServiceType= audio_service_type; -+ m_ffMpegProfile = profile; -+ -+ CSingleLock lock(m_restartSection); -+ -+ CLog::Log(LOGDEBUG, "ActiveAE DSP - %s - Audio DSP processing id %d created:", __FUNCTION__, m_streamId); -+ -+ m_convertInput = swr_alloc_set_opts(m_convertInput, -+ CAEUtil::GetAVChannelLayout(m_inputFormat.m_channelLayout), -+ AV_SAMPLE_FMT_FLTP, -+ m_inputFormat.m_sampleRate, -+ CAEUtil::GetAVChannelLayout(m_inputFormat.m_channelLayout), -+ CAEUtil::GetAVSampleFormat(m_inputFormat.m_dataFormat), -+ m_inputFormat.m_sampleRate, -+ 0, NULL); -+ if (m_convertInput == NULL) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - DSP input convert with data format '%s' not supported!", __FUNCTION__, CAEUtil::DataFormatToStr(inputFormat.m_dataFormat)); -+ return false; -+ } -+ -+ if (swr_init(m_convertInput) < 0) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - DSP input convert failed", __FUNCTION__); -+ return false; -+ } -+ -+ m_convertOutput = swr_alloc_set_opts(m_convertOutput, -+ CAEUtil::GetAVChannelLayout(m_outputFormat.m_channelLayout), -+ CAEUtil::GetAVSampleFormat(m_outputFormat.m_dataFormat), -+ m_outputFormat.m_sampleRate, -+ CAEUtil::GetAVChannelLayout(m_outputFormat.m_channelLayout), -+ AV_SAMPLE_FMT_FLTP, -+ m_outputFormat.m_sampleRate, -+ 0, NULL); -+ if (m_convertOutput == NULL) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - DSP output convert with data format '%s' not supported!", __FUNCTION__, CAEUtil::DataFormatToStr(outputFormat.m_dataFormat)); -+ return false; -+ } -+ -+ if (swr_init(m_convertOutput) < 0) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - DSP output convert failed", __FUNCTION__); -+ return false; -+ } -+ -+ ResetStreamFunctionsSelection(); -+ -+ CFileItem currentFile(g_application.CurrentFileItem()); -+ -+ m_streamTypeDetected = DetectStreamType(¤tFile); -+ -+ if (iStreamType == AE_DSP_ASTREAM_AUTO) -+ m_streamTypeUsed = m_streamTypeDetected; -+ else if (iStreamType >= AE_DSP_ASTREAM_BASIC || iStreamType < AE_DSP_ASTREAM_AUTO) -+ m_streamTypeUsed = iStreamType; -+ else -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - Unknown audio stream type, falling back to basic", __FUNCTION__); -+ m_streamTypeUsed = AE_DSP_ASTREAM_BASIC; -+ } -+ -+ /*! -+ * Set general stream information about the processed stream -+ */ -+ -+ if (g_application.m_pPlayer->GetAudioStreamCount() > 0) -+ { -+ int identifier = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_AudioStream; -+ if(identifier < 0) -+ identifier = g_application.m_pPlayer->GetAudioStream(); -+ if (identifier < 0) -+ identifier = 0; -+ -+ SPlayerAudioStreamInfo info; -+ g_application.m_pPlayer->GetAudioStreamInfo(identifier, info); -+ -+ m_addonStreamProperties.strName = info.name.c_str(); -+ m_addonStreamProperties.strLanguage = info.language.c_str(); -+ m_addonStreamProperties.strCodecId = info.audioCodecName.c_str(); -+ m_addonStreamProperties.iIdentifier = identifier; -+ m_addonStreamProperties.iSampleRate = info.samplerate; -+ m_addonStreamProperties.iChannels = info.channels; -+ } -+ else -+ { -+ m_addonStreamProperties.strName = "Unknown"; -+ m_addonStreamProperties.strLanguage = ""; -+ m_addonStreamProperties.strCodecId = ""; -+ m_addonStreamProperties.iIdentifier = m_streamId; -+ m_addonStreamProperties.iSampleRate = m_inputFormat.m_sampleRate; -+ m_addonStreamProperties.iChannels = m_inputFormat.m_channelLayout.Count(); -+ } -+ -+ m_addonStreamProperties.iStreamID = m_streamId; -+ m_addonStreamProperties.iStreamType = m_streamTypeUsed; -+ m_addonStreamProperties.iBaseType = GetBaseType(&m_addonStreamProperties); -+ -+ /*! -+ * Create the profile about additional stream related data, e.g. the different Dolby Digital stream flags -+ */ -+ CreateStreamProfile(); -+ -+ /*! -+ * Set exact input and output format settings -+ */ -+ m_addonSettings.iStreamID = m_streamId; -+ m_addonSettings.iStreamType = m_streamTypeUsed; -+ m_addonSettings.lInChannelPresentFlags = 0; /*!< Reset input channel present flags, becomes set on next steps */ -+ m_addonSettings.iInChannels = m_inputFormat.m_channelLayout.Count();/*!< The from stream given channel amount */ -+ m_addonSettings.iInFrames = m_inputFormat.m_frames; /*!< Input frames given */ -+ m_addonSettings.iInSamplerate = m_inputFormat.m_sampleRate; /*!< The basic input samplerate from stream source */ -+ m_addonSettings.iProcessFrames = m_inputFormat.m_frames; /*!< Default the same as input frames, if input resampler is present it becomes corrected */ -+ m_addonSettings.iProcessSamplerate = m_inputFormat.m_sampleRate; /*!< Default the same as input samplerate, if input resampler is present it becomes corrected */ -+ m_addonSettings.lOutChannelPresentFlags = 0; /*!< Reset output channel present flags, becomes set on next steps */ -+ m_addonSettings.iOutChannels = m_outputFormat.m_channelLayout.Count(); /*!< The for output required amount of channels */ -+ m_addonSettings.iOutFrames = m_outputFormat.m_frames; /*! Output frames requested */ -+ m_addonSettings.iOutSamplerate = m_outputFormat.m_sampleRate; /*!< The required sample rate for pass over resampling on ActiveAEResample */ -+ m_addonSettings.bStereoUpmix = upmix; /*! Stereo upmix value given from KODI settings */ -+ m_addonSettings.bInputResamplingActive = false; /*! Becomes true if input resampling is in use */ -+ m_addonSettings.iQualityLevel = m_streamQuality; /*! Requested stream processing quality, is optional and can be from addon ignored */ -+ -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_FL)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FL; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_FR)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FR; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_FC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_LFE)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_LFE; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_BL)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BL; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_BR)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BR; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_FLOC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FLOC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_FROC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FROC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_BC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_SL)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_SL; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_SR)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_SR; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TFL)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TFL; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TFR)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TFR; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TFC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TFC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TBL)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBL; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TBR)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBR; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_TBC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_BLOC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BLOC; -+ if (m_inputFormat.m_channelLayout.HasChannel(AE_CH_BROC)) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BROC; -+ -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_FL)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FL; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_FR)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FR; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_FC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_LFE)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_LFE; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_BL)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BL; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_BR)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BR; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_FLOC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FLOC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_FROC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FROC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_BC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_SL)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_SL; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_SR)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_SR; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TFL)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TFL; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TFR)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TFR; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TFC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TFC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TBL)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TBL; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TBR)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TBR; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_TBC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TBC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_BLOC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BLOC; -+ if (m_outputFormat.m_channelLayout.HasChannel(AE_CH_BROC)) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BROC; -+ -+ /*! -+ * Setup off mode, used if dsp master processing is set off, required to have data -+ * for stream information functions. -+ */ -+ sDSPProcessHandle internalMode; -+ internalMode.Clear(); -+ internalMode.iAddonModeNumber = AE_DSP_MASTER_MODE_ID_PASSOVER; -+ internalMode.pMode = CActiveAEDSPModePtr(new CActiveAEDSPMode(internalMode.iAddonModeNumber, (AE_DSP_BASETYPE)m_addonStreamProperties.iBaseType)); -+ internalMode.iLastTime = 0; -+ m_addons_MasterProc.push_back(internalMode); -+ m_activeMode = AE_DSP_MASTER_MODE_ID_PASSOVER; -+ -+ if (upmix && m_addonSettings.iInChannels <= 2) -+ { -+ internalMode.Clear(); -+ internalMode.iAddonModeNumber = AE_DSP_MASTER_MODE_ID_INTERNAL_STEREO_UPMIX; -+ internalMode.pMode = CActiveAEDSPModePtr(new CActiveAEDSPMode(internalMode.iAddonModeNumber, (AE_DSP_BASETYPE)m_addonStreamProperties.iBaseType)); -+ internalMode.iLastTime = 0; -+ m_addons_MasterProc.push_back(internalMode); -+ } -+ -+ /*! -+ * Load all selected processing types, stored in a database and available from addons -+ */ -+ AE_DSP_ADDONMAP addonMap; -+ if (CServiceBroker::GetADSP().GetEnabledAudioDSPAddons(addonMap) > 0) -+ { -+ int foundInputResamplerId = -1; /*!< Used to prevent double call of StreamCreate if input stream resampling is together with outer processing types */ -+ -+ /*! -+ * First find input resample addon to become information about processing sample rate and -+ * load one allowed before master processing & final resample addon -+ */ -+ CLog::Log(LOGDEBUG, " ---- DSP input resample addon ---"); -+ const AE_DSP_MODELIST listInputResample = CServiceBroker::GetADSP().GetAvailableModes(AE_DSP_MODE_TYPE_INPUT_RESAMPLE); -+ if (listInputResample.empty()) -+ CLog::Log(LOGDEBUG, " | - no input resample addon present or enabled"); -+ for (unsigned int i = 0; i < listInputResample.size(); ++i) -+ { -+ /// For resample only one call is allowed. Use first one and ignore everything else. -+ CActiveAEDSPModePtr pMode = listInputResample[i].first; -+ AE_DSP_ADDON addon = listInputResample[i].second; -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && addon->SupportsInputResample() && pMode->IsEnabled()) -+ { -+ ADDON_HANDLE_STRUCT handle; -+ AE_DSP_ERROR err = addon->StreamCreate(&m_addonSettings, &m_addonStreamProperties, &handle); -+ if (err == AE_DSP_ERROR_NO_ERROR) -+ { -+ if (addon->StreamIsModeSupported(&handle, pMode->ModeType(), pMode->AddonModeNumber(), pMode->ModeID())) -+ { -+ int processSamplerate = addon->InputResampleSampleRate(&handle); -+ if (processSamplerate == (int)m_inputFormat.m_sampleRate) -+ { -+ CLog::Log(LOGDEBUG, " | - input resample addon %s ignored, input sample rate %i the same as process rate", addon->GetFriendlyName().c_str(), m_inputFormat.m_sampleRate); -+ } -+ else if (processSamplerate > 0) -+ { -+ CLog::Log(LOGDEBUG, " | - %s with resampling from %i to %i", addon->GetAudioDSPName().c_str(), m_inputFormat.m_sampleRate, processSamplerate); -+ -+ m_outputSamplerate = processSamplerate; /*!< overwrite output sample rate with the new rate */ -+ m_outputFrames = (int) ceil((1.0 * processSamplerate) / m_addonSettings.iInSamplerate * m_addonSettings.iInFrames); -+ m_addonSettings.iProcessSamplerate = m_outputSamplerate; /*!< the processing sample rate required for all behind called processes */ -+ m_addonSettings.iProcessFrames = m_outputFrames; -+ m_addonSettings.bInputResamplingActive = true; -+ -+ m_addon_InputResample.iAddonModeNumber = pMode->AddonModeNumber(); -+ m_addon_InputResample.pMode = pMode; -+ m_addon_InputResample.pAddon = addon; -+ m_addon_InputResample.iLastTime = 0; -+ } -+ else -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - input resample addon %s return invalid samplerate and becomes disabled", __FUNCTION__, addon->GetFriendlyName().c_str()); -+ } -+ -+ unsigned int id = addon->GetID(); -+ m_addon_Handles[id] = handle; -+ foundInputResamplerId = id; -+ m_usedMap.insert(std::make_pair(id, addon)); -+ } -+ } -+ else if (err != AE_DSP_ERROR_IGNORE_ME) -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - input resample addon creation failed on %s with %s", __FUNCTION__, addon->GetAudioDSPName().c_str(), CActiveAEDSPAddon::ToString(err)); -+ break; -+ } -+ } -+ -+ /*! -+ * Now init all other dsp relavant addons -+ */ -+ for (AE_DSP_ADDONMAP_ITR itr = addonMap.begin(); itr != addonMap.end(); ++itr) -+ { -+ AE_DSP_ADDON addon = itr->second; -+ int id = addon->GetID(); -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && id != foundInputResamplerId) -+ { -+ ADDON_HANDLE_STRUCT handle; -+ AE_DSP_ERROR err = addon->StreamCreate(&m_addonSettings, &m_addonStreamProperties, &handle); -+ if (err == AE_DSP_ERROR_NO_ERROR) -+ { -+ m_addon_Handles[id] = handle; -+ m_usedMap.insert(std::make_pair(id, addon)); -+ } -+ else if (err == AE_DSP_ERROR_IGNORE_ME) -+ continue; -+ else -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - addon creation failed on %s with %s", __FUNCTION__, addon->GetAudioDSPName().c_str(), CActiveAEDSPAddon::ToString(err)); -+ } -+ } -+ -+ for (AE_DSP_ADDONMAP_ITR itr = m_usedMap.begin(); itr != m_usedMap.end(); ++itr) -+ { -+ AE_DSP_ADDON addon = itr->second; -+ if (addon->SupportsInputInfoProcess()) -+ { -+ sDSPProcessHandle modeHandle; -+ modeHandle.pAddon = addon; -+ modeHandle.handle = m_addon_Handles[addon->GetID()]; -+ m_addons_InputProc.push_back(modeHandle); -+ } -+ } -+ -+ /*! -+ * Load all required pre process dsp addon functions -+ */ -+ CLog::Log(LOGDEBUG, " ---- DSP active pre process modes ---"); -+ const AE_DSP_MODELIST listPreProcess = CServiceBroker::GetADSP().GetAvailableModes(AE_DSP_MODE_TYPE_PRE_PROCESS); -+ for (unsigned int i = 0; i < listPreProcess.size(); ++i) -+ { -+ CActiveAEDSPModePtr pMode = listPreProcess[i].first; -+ AE_DSP_ADDON addon = listPreProcess[i].second; -+ int id = addon->GetID(); -+ -+ if (m_usedMap.find(id) == m_usedMap.end()) -+ continue; -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && addon->SupportsPreProcess() && pMode->IsEnabled() && -+ addon->StreamIsModeSupported(&m_addon_Handles[id], pMode->ModeType(), pMode->AddonModeNumber(), pMode->ModeID())) -+ { -+ CLog::Log(LOGDEBUG, " | - %i - %s (%s)", i, pMode->AddonModeName().c_str(), addon->GetAudioDSPName().c_str()); -+ -+ sDSPProcessHandle modeHandle; -+ modeHandle.iAddonModeNumber = pMode->AddonModeNumber(); -+ modeHandle.pMode = pMode; -+ modeHandle.pAddon = addon; -+ modeHandle.iLastTime = 0; -+ modeHandle.handle = m_addon_Handles[id]; -+ m_addons_PreProc.push_back(modeHandle); -+ } -+ } -+ if (m_addons_PreProc.empty()) -+ CLog::Log(LOGDEBUG, " | - no pre processing addon's present or enabled"); -+ -+ /*! -+ * Load all available master modes from addons and put together with database -+ */ -+ CLog::Log(LOGDEBUG, " ---- DSP active master process modes ---"); -+ const AE_DSP_MODELIST listMasterProcess = CServiceBroker::GetADSP().GetAvailableModes(AE_DSP_MODE_TYPE_MASTER_PROCESS); -+ for (unsigned int i = 0; i < listMasterProcess.size(); ++i) -+ { -+ CActiveAEDSPModePtr pMode = listMasterProcess[i].first; -+ AE_DSP_ADDON addon = listMasterProcess[i].second; -+ int id = addon->GetID(); -+ -+ if (m_usedMap.find(id) == m_usedMap.end()) -+ continue; -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && addon->SupportsMasterProcess() && pMode->IsEnabled() && -+ addon->StreamIsModeSupported(&m_addon_Handles[id], pMode->ModeType(), pMode->AddonModeNumber(), pMode->ModeID())) -+ { -+ CLog::Log(LOGDEBUG, " | - %i - %s (%s)", i, pMode->AddonModeName().c_str(), addon->GetAudioDSPName().c_str()); -+ -+ sDSPProcessHandle modeHandle; -+ modeHandle.iAddonModeNumber = pMode->AddonModeNumber(); -+ modeHandle.pMode = pMode; -+ modeHandle.pAddon = addon; -+ modeHandle.iLastTime = 0; -+ modeHandle.handle = m_addon_Handles[id]; -+ modeHandle.pMode->SetBaseType((AE_DSP_BASETYPE)m_addonStreamProperties.iBaseType); -+ m_addons_MasterProc.push_back(modeHandle); -+ } -+ } -+ if (m_addons_MasterProc.empty()) -+ CLog::Log(LOGDEBUG, " | - no master processing addon's present or enabled"); -+ -+ /*! -+ * Get selected source for current input -+ */ -+ int modeID = CMediaSettings::GetInstance().GetCurrentAudioSettings().m_MasterModes[m_addonStreamProperties.iStreamType][m_addonStreamProperties.iBaseType]; -+ if (modeID == AE_DSP_MASTER_MODE_ID_INVALID) -+ modeID = AE_DSP_MASTER_MODE_ID_PASSOVER; -+ -+ for (unsigned int ptr = 0; ptr < m_addons_MasterProc.size(); ++ptr) -+ { -+ CActiveAEDSPModePtr mode = m_addons_MasterProc.at(ptr).pMode; -+ if (mode->ModeID() == modeID) -+ { -+ m_activeMode = (int)ptr; -+ CLog::Log(LOGDEBUG, " | -- %s (selected)", mode->AddonModeName().c_str()); -+ break; -+ } -+ } -+ -+ /*! -+ * Setup the one allowed master processing addon and inform about selected mode -+ */ -+ m_activeModeOutChannels = -1; -+ if (m_addons_MasterProc[m_activeMode].pAddon) -+ { -+ AE_DSP_ERROR err = m_addons_MasterProc[m_activeMode].pAddon->MasterProcessSetMode(&m_addons_MasterProc[m_activeMode].handle, m_addonStreamProperties.iStreamType, m_addons_MasterProc[m_activeMode].pMode->AddonModeNumber(), m_addons_MasterProc[m_activeMode].pMode->ModeID()); -+ if (err != AE_DSP_ERROR_NO_ERROR) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - addon master mode selection failed on %s with Mode '%s' with %s", -+ __FUNCTION__, -+ m_addons_MasterProc[m_activeMode].pAddon->GetAudioDSPName().c_str(), -+ m_addons_MasterProc[m_activeMode].pMode->AddonModeName().c_str(), -+ CActiveAEDSPAddon::ToString(err)); -+ m_addons_MasterProc.erase(m_addons_MasterProc.begin()+m_activeMode); -+ m_activeMode = AE_DSP_MASTER_MODE_ID_PASSOVER; -+ } -+ else -+ m_activeModeOutChannels = m_addons_MasterProc[m_activeMode].pAddon->MasterProcessGetOutChannels(&m_addons_MasterProc[m_activeMode].handle, m_activeModeOutChannelsPresent); -+ } -+ else -+ { -+ CLog::Log(LOGDEBUG, " | -- No master process selected!"); -+ } -+ -+ /*! -+ * Load all required post process dsp addon functions -+ */ -+ CLog::Log(LOGDEBUG, " ---- DSP active post process modes ---"); -+ const AE_DSP_MODELIST listPostProcess = CServiceBroker::GetADSP().GetAvailableModes(AE_DSP_MODE_TYPE_POST_PROCESS); -+ for (unsigned int i = 0; i < listPostProcess.size(); ++i) -+ { -+ CActiveAEDSPModePtr pMode = listPostProcess[i].first; -+ AE_DSP_ADDON addon = listPostProcess[i].second; -+ int id = addon->GetID(); -+ -+ if (m_usedMap.find(id) == m_usedMap.end()) -+ continue; -+ -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && addon->SupportsPostProcess() && pMode->IsEnabled() && -+ addon->StreamIsModeSupported(&m_addon_Handles[id], pMode->ModeType(), pMode->AddonModeNumber(), pMode->ModeID())) -+ { -+ CLog::Log(LOGDEBUG, " | - %i - %s (%s)", i, pMode->AddonModeName().c_str(), addon->GetAudioDSPName().c_str()); -+ -+ sDSPProcessHandle modeHandle; -+ modeHandle.iAddonModeNumber = pMode->AddonModeNumber(); -+ modeHandle.pMode = pMode; -+ modeHandle.pAddon = addon; -+ modeHandle.iLastTime = 0; -+ modeHandle.handle = m_addon_Handles[id]; -+ m_addons_PostProc.push_back(modeHandle); -+ } -+ } -+ if (m_addons_PostProc.empty()) -+ CLog::Log(LOGDEBUG, " | - no post processing addon's present or enabled"); -+ -+ /*! -+ * Load one allowed addon for resampling after final post processing -+ */ -+ CLog::Log(LOGDEBUG, " ---- DSP post resample addon ---"); -+ if (m_addonSettings.iProcessSamplerate != m_outputFormat.m_sampleRate) -+ { -+ const AE_DSP_MODELIST listOutputResample = CServiceBroker::GetADSP().GetAvailableModes(AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE); -+ if (listOutputResample.empty()) -+ CLog::Log(LOGDEBUG, " | - no final post resample addon present or enabled, becomes performed by KODI"); -+ for (unsigned int i = 0; i < listOutputResample.size(); ++i) -+ { -+ /// For resample only one call is allowed. Use first one and ignore everything else. -+ CActiveAEDSPModePtr pMode = listOutputResample[i].first; -+ AE_DSP_ADDON addon = listOutputResample[i].second; -+ int id = addon->GetID(); -+ -+ if (m_usedMap.find(id) != m_usedMap.end() && -+ !CAddonMgr::GetInstance().IsAddonDisabled(addon->ID()) && addon->SupportsOutputResample() && pMode->IsEnabled() && -+ addon->StreamIsModeSupported(&m_addon_Handles[id], pMode->ModeType(), pMode->AddonModeNumber(), pMode->ModeID())) -+ { -+ int outSamplerate = addon->OutputResampleSampleRate(&m_addon_Handles[id]); -+ if (outSamplerate > 0) -+ { -+ CLog::Log(LOGDEBUG, " | - %s with resampling to %i", addon->GetAudioDSPName().c_str(), outSamplerate); -+ -+ m_outputSamplerate = outSamplerate; -+ m_outputFrames = (int) ceil((1.0 * outSamplerate) / m_addonSettings.iProcessSamplerate * m_addonSettings.iProcessFrames); -+ -+ m_addon_OutputResample.iAddonModeNumber = pMode->AddonModeNumber(); -+ m_addon_OutputResample.pMode = pMode; -+ m_addon_OutputResample.pAddon = addon; -+ m_addon_OutputResample.iLastTime = 0; -+ m_addon_OutputResample.handle = m_addon_Handles[id]; -+ } -+ else -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - post resample addon %s return invalid samplerate and becomes disabled", __FUNCTION__, addon->GetFriendlyName().c_str()); -+ } -+ break; -+ } -+ } -+ } -+ else -+ { -+ CLog::Log(LOGDEBUG, " | - no final resampling needed, process and final samplerate the same"); -+ } -+ } -+ -+ /*! -+ * Initialize fallback matrix mixer -+ */ -+ InitFFMpegDSPProcessor(); -+ -+ if (CLog::GetLogLevel() == LOGDEBUG) // Speed improve -+ { -+ CLog::Log(LOGDEBUG, " ---- Input stream ----"); -+ CLog::Log(LOGDEBUG, " | Identifier : %d", m_addonStreamProperties.iIdentifier); -+ CLog::Log(LOGDEBUG, " | Stream Type : %s", m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_BASIC ? "Basic" : -+ m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_MUSIC ? "Music" : -+ m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_MOVIE ? "Movie" : -+ m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_GAME ? "Game" : -+ m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_APP ? "App" : -+ m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_PHONE ? "Phone" : -+ m_addonStreamProperties.iStreamType == AE_DSP_ASTREAM_MESSAGE ? "Message" : -+ "Unknown"); -+ CLog::Log(LOGDEBUG, " | Name : %s", m_addonStreamProperties.strName); -+ CLog::Log(LOGDEBUG, " | Language : %s", m_addonStreamProperties.strLanguage); -+ CLog::Log(LOGDEBUG, " | Codec : %s", m_addonStreamProperties.strCodecId); -+ CLog::Log(LOGDEBUG, " | Sample Rate : %d", m_addonStreamProperties.iSampleRate); -+ CLog::Log(LOGDEBUG, " | Channels : %d", m_addonStreamProperties.iChannels); -+ CLog::Log(LOGDEBUG, " ---- Input format ----"); -+ CLog::Log(LOGDEBUG, " | Sample Rate : %d", m_addonSettings.iInSamplerate); -+ CLog::Log(LOGDEBUG, " | Sample Format : %s", CAEUtil::DataFormatToStr(m_inputFormat.m_dataFormat)); -+ CLog::Log(LOGDEBUG, " | Channel Count : %d", m_inputFormat.m_channelLayout.Count()); -+ CLog::Log(LOGDEBUG, " | Channel Layout : %s", ((std::string)m_inputFormat.m_channelLayout).c_str()); -+ CLog::Log(LOGDEBUG, " | Frames : %d", m_addonSettings.iInFrames); -+ CLog::Log(LOGDEBUG, " ---- Process format ----"); -+ CLog::Log(LOGDEBUG, " | Sample Rate : %d", m_addonSettings.iProcessSamplerate); -+ CLog::Log(LOGDEBUG, " | Sample Format : %s", "AE_FMT_FLOATP"); -+ CLog::Log(LOGDEBUG, " | Frames : %d", m_addonSettings.iProcessFrames); -+ CLog::Log(LOGDEBUG, " | Internal processing : %s", m_resamplerDSPProcessor ? "yes" : "no"); -+ CLog::Log(LOGDEBUG, " ---- Output format ----"); -+ CLog::Log(LOGDEBUG, " | Sample Rate : %d", m_outputSamplerate); -+ CLog::Log(LOGDEBUG, " | Sample Format : %s", CAEUtil::DataFormatToStr(m_outputFormat.m_dataFormat)); -+ CLog::Log(LOGDEBUG, " | Channel Count : %d", m_outputFormat.m_channelLayout.Count()); -+ CLog::Log(LOGDEBUG, " | Channel Layout : %s", ((std::string)m_outputFormat.m_channelLayout).c_str()); -+ CLog::Log(LOGDEBUG, " | Frames : %d", m_outputFrames); -+ } -+ -+ m_forceInit = true; -+ return true; -+} -+ -+void CActiveAEDSPProcess::InitFFMpegDSPProcessor() -+{ -+ /*! -+ * If ffmpeg resampler is already present delete it first to create it from new -+ */ -+ if (m_resamplerDSPProcessor) -+ { -+ delete m_resamplerDSPProcessor; -+ m_resamplerDSPProcessor = NULL; -+ } -+ -+ /*! -+ * if the amount of input channels is higher as output and the active master mode gives more channels out or if it is not set of it -+ * a forced channel downmix becomes enabled. -+ */ -+ bool upmix = m_addonSettings.bStereoUpmix && m_addons_MasterProc[m_activeMode].pMode->ModeID() == AE_DSP_MASTER_MODE_ID_INTERNAL_STEREO_UPMIX ? true : false; -+ if (upmix || (m_addonSettings.iInChannels > m_addonSettings.iOutChannels && (m_activeModeOutChannels <= 0 || m_activeModeOutChannels > m_addonSettings.iOutChannels))) -+ { -+ m_resamplerDSPProcessor = CAEResampleFactory::Create(); -+ if (!m_resamplerDSPProcessor->Init(CAEUtil::GetAVChannelLayout(m_outputFormat.m_channelLayout), -+ m_outputFormat.m_channelLayout.Count(), -+ m_addonSettings.iProcessSamplerate, -+ AV_SAMPLE_FMT_FLTP, sizeof(float) << 3, 0, -+ CAEUtil::GetAVChannelLayout(m_inputFormat.m_channelLayout), -+ m_inputFormat.m_channelLayout.Count(), -+ m_addonSettings.iProcessSamplerate, -+ AV_SAMPLE_FMT_FLTP, sizeof(float) << 3, 0, -+ upmix, -+ true, -+ NULL, -+ m_streamQuality, -+ true)) -+ { -+ delete m_resamplerDSPProcessor; -+ m_resamplerDSPProcessor = NULL; -+ -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - Initialize of channel mixer failed", __FUNCTION__); -+ } -+ } -+} -+ -+bool CActiveAEDSPProcess::CreateStreamProfile() -+{ -+ bool ret = true; -+ -+ switch (m_addonStreamProperties.iBaseType) -+ { -+ case AE_DSP_ABASE_AC3: -+ case AE_DSP_ABASE_EAC3: -+ { -+ unsigned int iProfile; -+ switch (m_ffMpegMatrixEncoding) -+ { -+ case AV_MATRIX_ENCODING_DOLBY: -+ iProfile = AE_DSP_PROFILE_DOLBY_SURROUND; -+ break; -+ case AV_MATRIX_ENCODING_DPLII: -+ iProfile = AE_DSP_PROFILE_DOLBY_PLII; -+ break; -+ case AV_MATRIX_ENCODING_DPLIIX: -+ iProfile = AE_DSP_PROFILE_DOLBY_PLIIX; -+ break; -+ case AV_MATRIX_ENCODING_DPLIIZ: -+ iProfile = AE_DSP_PROFILE_DOLBY_PLIIZ; -+ break; -+ case AV_MATRIX_ENCODING_DOLBYEX: -+ iProfile = AE_DSP_PROFILE_DOLBY_EX; -+ break; -+ case AV_MATRIX_ENCODING_DOLBYHEADPHONE: -+ iProfile = AE_DSP_PROFILE_DOLBY_HEADPHONE; -+ break; -+ case AV_MATRIX_ENCODING_NONE: -+ default: -+ iProfile = AE_DSP_PROFILE_DOLBY_NONE; -+ break; -+ } -+ -+ unsigned int iServiceType; -+ switch (m_ffMpegAudioServiceType) -+ { -+ case AV_AUDIO_SERVICE_TYPE_EFFECTS: -+ iServiceType = AE_DSP_SERVICE_TYPE_EFFECTS; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED: -+ iServiceType = AE_DSP_SERVICE_TYPE_VISUALLY_IMPAIRED; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED: -+ iServiceType = AE_DSP_SERVICE_TYPE_HEARING_IMPAIRED; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_DIALOGUE: -+ iServiceType = AE_DSP_SERVICE_TYPE_DIALOGUE; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_COMMENTARY: -+ iServiceType = AE_DSP_SERVICE_TYPE_COMMENTARY; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_EMERGENCY: -+ iServiceType = AE_DSP_SERVICE_TYPE_EMERGENCY; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_VOICE_OVER: -+ iServiceType = AE_DSP_SERVICE_TYPE_VOICE_OVER; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_KARAOKE: -+ iServiceType = AE_DSP_SERVICE_TYPE_KARAOKE; -+ break; -+ case AV_AUDIO_SERVICE_TYPE_MAIN: -+ default: -+ iServiceType = AE_DSP_SERVICE_TYPE_MAIN; -+ break; -+ } -+ m_addonStreamProperties.Profile.ac3_eac3.iProfile = iProfile; -+ m_addonStreamProperties.Profile.ac3_eac3.iServiceType = iServiceType; -+ break; -+ } -+ case AE_DSP_ABASE_DTS: -+ case AE_DSP_ABASE_DTSHD_HRA: -+ case AE_DSP_ABASE_DTSHD_MA: -+ { -+ -+ unsigned int iProfile; -+ switch (m_ffMpegProfile) -+ { -+ case FF_PROFILE_DTS_ES: -+ iProfile = AE_DSP_PROFILE_DTS_ES; -+ break; -+ case FF_PROFILE_DTS_96_24: -+ iProfile = AE_DSP_PROFILE_DTS_96_24; -+ break; -+ case FF_PROFILE_DTS_HD_HRA: -+ iProfile = AE_DSP_PROFILE_DTS_HD_HRA; -+ break; -+ case FF_PROFILE_DTS_HD_MA: -+ iProfile = AE_DSP_PROFILE_DTS_HD_MA; -+ break; -+ case FF_PROFILE_DTS: -+ default: -+ iProfile = AE_DSP_PROFILE_DTS; -+ break; -+ } -+ -+ m_addonStreamProperties.Profile.dts_dtshd.iProfile = iProfile; -+ m_addonStreamProperties.Profile.dts_dtshd.bSurroundMatrix = m_ffMpegMatrixEncoding == AV_MATRIX_ENCODING_DOLBY ? true : false; -+ break; -+ } -+ case AE_DSP_ABASE_TRUEHD: -+ case AE_DSP_ABASE_MLP: -+ { -+ unsigned int iProfile; -+ switch (m_ffMpegMatrixEncoding) -+ { -+ case AV_MATRIX_ENCODING_DOLBY: -+ iProfile = AE_DSP_PROFILE_DOLBY_SURROUND; -+ break; -+ case AV_MATRIX_ENCODING_DPLII: -+ iProfile = AE_DSP_PROFILE_DOLBY_PLII; -+ break; -+ case AV_MATRIX_ENCODING_DPLIIX: -+ iProfile = AE_DSP_PROFILE_DOLBY_PLIIX; -+ break; -+ case AV_MATRIX_ENCODING_DPLIIZ: -+ iProfile = AE_DSP_PROFILE_DOLBY_PLIIZ; -+ break; -+ case AV_MATRIX_ENCODING_DOLBYEX: -+ iProfile = AE_DSP_PROFILE_DOLBY_EX; -+ break; -+ case AV_MATRIX_ENCODING_DOLBYHEADPHONE: -+ iProfile = AE_DSP_PROFILE_DOLBY_HEADPHONE; -+ break; -+ case AV_MATRIX_ENCODING_NONE: -+ default: -+ iProfile = AE_DSP_PROFILE_DOLBY_NONE; -+ break; -+ } -+ -+ m_addonStreamProperties.Profile.mlp_truehd.iProfile = iProfile; -+ break; -+ } -+ case AE_DSP_ABASE_FLAC: -+ break; -+ default: -+ ret = false; -+ break; -+ } -+ -+ return ret; -+} -+ -+void CActiveAEDSPProcess::Destroy() -+{ -+ CSingleLock lock(m_restartSection); -+ -+ if (!CServiceBroker::GetADSP().IsActivated()) -+ return; -+ -+ for (AE_DSP_ADDONMAP_ITR itr = m_usedMap.begin(); itr != m_usedMap.end(); ++itr) -+ { -+ itr->second->StreamDestroy(&m_addon_Handles[itr->first]); -+ } -+ -+ ResetStreamFunctionsSelection(); -+} -+ -+void CActiveAEDSPProcess::ForceReinit() -+{ -+ CSingleLock lock(m_restartSection); -+ m_forceInit = true; -+} -+ -+AE_DSP_STREAMTYPE CActiveAEDSPProcess::DetectStreamType(const CFileItem *item) -+{ -+ AE_DSP_STREAMTYPE detected = AE_DSP_ASTREAM_BASIC; -+ if (item->HasMusicInfoTag()) -+ detected = AE_DSP_ASTREAM_MUSIC; -+ else if (item->HasVideoInfoTag() || g_application.m_pPlayer->HasVideo()) -+ detected = AE_DSP_ASTREAM_MOVIE; -+// else if (item->HasVideoInfoTag()) -+// detected = AE_DSP_ASTREAM_GAME; -+// else if (item->HasVideoInfoTag()) -+// detected = AE_DSP_ASTREAM_APP; -+// else if (item->HasVideoInfoTag()) -+// detected = AE_DSP_ASTREAM_MESSAGE; -+// else if (item->HasVideoInfoTag()) -+// detected = AE_DSP_ASTREAM_PHONE; -+ else -+ detected = AE_DSP_ASTREAM_BASIC; -+ -+ return detected; -+} -+ -+AE_DSP_STREAM_ID CActiveAEDSPProcess::GetStreamId() const -+{ -+ return m_streamId; -+} -+ -+unsigned int CActiveAEDSPProcess::GetInputChannels() -+{ -+ return m_inputFormat.m_channelLayout.Count(); -+} -+ -+std::string CActiveAEDSPProcess::GetInputChannelNames() -+{ -+ return m_inputFormat.m_channelLayout; -+} -+ -+unsigned int CActiveAEDSPProcess::GetInputSamplerate() -+{ -+ return m_inputFormat.m_sampleRate; -+} -+ -+unsigned int CActiveAEDSPProcess::GetProcessSamplerate() -+{ -+ return m_addonSettings.iProcessSamplerate; -+} -+ -+unsigned int CActiveAEDSPProcess::GetOutputChannels() -+{ -+ return m_outputFormat.m_channelLayout.Count(); -+} -+ -+std::string CActiveAEDSPProcess::GetOutputChannelNames() -+{ -+ return m_outputFormat.m_channelLayout; -+} -+ -+unsigned int CActiveAEDSPProcess::GetOutputSamplerate() -+{ -+ return m_outputSamplerate; -+} -+ -+unsigned int CActiveAEDSPProcess::GetOutputFrames() -+{ -+ return m_outputFrames; -+} -+ -+float CActiveAEDSPProcess::GetCPUUsage(void) const -+{ -+ return m_fLastProcessUsage; -+} -+ -+CAEChannelInfo CActiveAEDSPProcess::GetChannelLayout() -+{ -+ return m_outputFormat.m_channelLayout; -+} -+ -+AEDataFormat CActiveAEDSPProcess::GetDataFormat() -+{ -+ return m_dataFormat; -+} -+ -+AEAudioFormat CActiveAEDSPProcess::GetInputFormat() -+{ -+ return m_inputFormat; -+} -+ -+AE_DSP_STREAMTYPE CActiveAEDSPProcess::GetDetectedStreamType() -+{ -+ return m_streamTypeDetected; -+} -+ -+AE_DSP_STREAMTYPE CActiveAEDSPProcess::GetUsedStreamType() -+{ -+ return m_streamTypeUsed; -+} -+ -+AE_DSP_BASETYPE CActiveAEDSPProcess::GetBaseType(AE_DSP_STREAM_PROPERTIES *props) -+{ -+ if (!strcmp(props->strCodecId, "ac3")) -+ return AE_DSP_ABASE_AC3; -+ else if (!strcmp(props->strCodecId, "eac3")) -+ return AE_DSP_ABASE_EAC3; -+ else if (!strcmp(props->strCodecId, "dca") || !strcmp(props->strCodecId, "dts")) -+ return AE_DSP_ABASE_DTS; -+ else if (!strcmp(props->strCodecId, "dtshd_hra")) -+ return AE_DSP_ABASE_DTSHD_HRA; -+ else if (!strcmp(props->strCodecId, "dtshd_ma")) -+ return AE_DSP_ABASE_DTSHD_MA; -+ else if (!strcmp(props->strCodecId, "truehd")) -+ return AE_DSP_ABASE_TRUEHD; -+ else if (!strcmp(props->strCodecId, "mlp")) -+ return AE_DSP_ABASE_MLP; -+ else if (!strcmp(props->strCodecId, "flac")) -+ return AE_DSP_ABASE_FLAC; -+ else if (props->iChannels > 2) -+ return AE_DSP_ABASE_MULTICHANNEL; -+ else if (props->iChannels == 2) -+ return AE_DSP_ABASE_STEREO; -+ else -+ return AE_DSP_ABASE_MONO; -+} -+ -+AE_DSP_BASETYPE CActiveAEDSPProcess::GetUsedBaseType() -+{ -+ return GetBaseType(&m_addonStreamProperties); -+} -+ -+bool CActiveAEDSPProcess::GetMasterModeStreamInfoString(std::string &strInfo) -+{ -+ if (m_activeMode <= AE_DSP_MASTER_MODE_ID_PASSOVER) -+ { -+ strInfo = ""; -+ return true; -+ } -+ -+ if (m_activeMode < 0 || !m_addons_MasterProc[m_activeMode].pAddon) -+ return false; -+ -+ strInfo = m_addons_MasterProc[m_activeMode].pAddon->MasterProcessGetStreamInfoString(&m_addons_MasterProc[m_activeMode].handle); -+ -+ return true; -+} -+ -+bool CActiveAEDSPProcess::GetMasterModeTypeInformation(AE_DSP_STREAMTYPE &streamTypeUsed, AE_DSP_BASETYPE &baseType, int &iModeID) -+{ -+ streamTypeUsed = (AE_DSP_STREAMTYPE)m_addonStreamProperties.iStreamType; -+ -+ if (m_activeMode < 0) -+ return false; -+ -+ baseType = m_addons_MasterProc[m_activeMode].pMode->BaseType(); -+ iModeID = m_addons_MasterProc[m_activeMode].pMode->ModeID(); -+ return true; -+} -+ -+const char *CActiveAEDSPProcess::GetStreamTypeName(AE_DSP_STREAMTYPE iStreamType) -+{ -+ return iStreamType == AE_DSP_ASTREAM_BASIC ? "Basic" : -+ iStreamType == AE_DSP_ASTREAM_MUSIC ? "Music" : -+ iStreamType == AE_DSP_ASTREAM_MOVIE ? "Movie" : -+ iStreamType == AE_DSP_ASTREAM_GAME ? "Game" : -+ iStreamType == AE_DSP_ASTREAM_APP ? "App" : -+ iStreamType == AE_DSP_ASTREAM_PHONE ? "Phone" : -+ iStreamType == AE_DSP_ASTREAM_MESSAGE ? "Message" : -+ iStreamType == AE_DSP_ASTREAM_AUTO ? "Automatic" : -+ "Unknown"; -+} -+ -+bool CActiveAEDSPProcess::MasterModeChange(int iModeID, AE_DSP_STREAMTYPE iStreamType) -+{ -+ bool bReturn = false; -+ bool bSwitchStreamType = iStreamType != AE_DSP_ASTREAM_INVALID; -+ -+ /* The Mode is already used and need not to set up again */ -+ if (m_addons_MasterProc[m_activeMode].pMode->ModeID() == iModeID && !bSwitchStreamType) -+ return true; -+ -+ CSingleLock lock(m_restartSection); -+ -+ CLog::Log(LOGDEBUG, "ActiveAE DSP - %s - Audio DSP processing id %d mode change:", __FUNCTION__, m_streamId); -+ if (bSwitchStreamType && m_streamTypeUsed != iStreamType) -+ { -+ AE_DSP_STREAMTYPE old = m_streamTypeUsed; -+ CLog::Log(LOGDEBUG, " ---- Input stream ----"); -+ if (iStreamType == AE_DSP_ASTREAM_AUTO) -+ m_streamTypeUsed = m_streamTypeDetected; -+ else if (iStreamType >= AE_DSP_ASTREAM_BASIC || iStreamType < AE_DSP_ASTREAM_AUTO) -+ m_streamTypeUsed = iStreamType; -+ else -+ { -+ CLog::Log(LOGWARNING, "ActiveAE DSP - %s - Unknown audio stream type, falling back to basic", __FUNCTION__); -+ m_streamTypeUsed = AE_DSP_ASTREAM_BASIC; -+ } -+ -+ CLog::Log(LOGDEBUG, " | Stream Type change : From '%s' to '%s'", GetStreamTypeName(old), GetStreamTypeName(m_streamTypeUsed)); -+ } -+ -+ /*! -+ * Set the new stream type to the addon settings and properties structures. -+ * If the addon want to use another stream type, it can be becomes written inside -+ * the m_addonStreamProperties.iStreamType. -+ */ -+ m_addonStreamProperties.iStreamType = m_streamTypeUsed; -+ m_addonSettings.iStreamType = m_streamTypeUsed; -+ m_activeModeOutChannels = -1; -+ -+ if (iModeID <= AE_DSP_MASTER_MODE_ID_PASSOVER) -+ { -+ CLog::Log(LOGINFO, "ActiveAE DSP - Switching master mode off"); -+ m_activeMode = 0; -+ bReturn = true; -+ } -+ else -+ { -+ CActiveAEDSPModePtr mode; -+ for (unsigned int ptr = 0; ptr < m_addons_MasterProc.size(); ++ptr) -+ { -+ mode = m_addons_MasterProc.at(ptr).pMode; -+ if (mode->ModeID() == iModeID && mode->IsEnabled()) -+ { -+ if (m_addons_MasterProc[ptr].pAddon) -+ { -+ AE_DSP_ERROR err = m_addons_MasterProc[ptr].pAddon->MasterProcessSetMode(&m_addons_MasterProc[ptr].handle, m_addonStreamProperties.iStreamType, mode->AddonModeNumber(), mode->ModeID()); -+ if (err != AE_DSP_ERROR_NO_ERROR) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - addon master mode selection failed on %s with Mode '%s' with %s", -+ __FUNCTION__, -+ m_addons_MasterProc[ptr].pAddon->GetAudioDSPName().c_str(), -+ mode->AddonModeName().c_str(), -+ CActiveAEDSPAddon::ToString(err)); -+ } -+ else -+ { -+ CLog::Log(LOGINFO, "ActiveAE DSP - Switching master mode to '%s' as '%s' on '%s'", -+ mode->AddonModeName().c_str(), -+ GetStreamTypeName((AE_DSP_STREAMTYPE)m_addonStreamProperties.iStreamType), -+ m_addons_MasterProc[ptr].pAddon->GetAudioDSPName().c_str()); -+ -+ m_activeMode = (int)ptr; -+ m_activeModeOutChannels = m_addons_MasterProc[m_activeMode].pAddon->MasterProcessGetOutChannels(&m_addons_MasterProc[ptr].handle, m_activeModeOutChannelsPresent); -+ bReturn = true; -+ } -+ } -+ else if (mode->ModeID() >= AE_DSP_MASTER_MODE_ID_INTERNAL_TYPES) -+ { -+ CLog::Log(LOGINFO, "ActiveAE DSP - Switching master mode to internal '%s' as '%s'", -+ mode->AddonModeName().c_str(), -+ GetStreamTypeName((AE_DSP_STREAMTYPE)m_addonStreamProperties.iStreamType)); -+ -+ m_activeMode = (int)ptr; -+ m_activeModeOutChannels = -1; -+ bReturn = true; -+ } -+ break; -+ } -+ } -+ } -+ -+ /*! -+ * Initialize fallback matrix mixer -+ */ -+ InitFFMpegDSPProcessor(); -+ -+ return bReturn; -+} -+ -+void CActiveAEDSPProcess::ClearArray(float **array, unsigned int samples) -+{ -+ unsigned int presentFlag = 1; -+ for (int i = 0; i < AE_DSP_CH_MAX; ++i) -+ { -+ if (m_addonSettings.lOutChannelPresentFlags & presentFlag) -+ memset(array[i], 0, samples*sizeof(float)); -+ presentFlag <<= 1; -+ } -+} -+ -+bool CActiveAEDSPProcess::Process(CSampleBuffer *in, CSampleBuffer *out) -+{ -+ CSingleLock lock(m_restartSection); -+ -+ bool needDSPAddonsReinit = m_forceInit; -+ uint64_t iTime = static_cast(XbmcThreads::SystemClockMillis()) * 10000; -+ int64_t hostFrequency = CurrentHostFrequency(); -+ unsigned int frames = in->pkt->nb_samples; -+ -+ /* Detect interleaved input stream channel positions if unknown or changed */ -+ if (m_channelLayoutIn != in->pkt->config.channel_layout) -+ { -+ m_channelLayoutIn = in->pkt->config.channel_layout; -+ -+ m_idx_in[AE_CH_FL] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_FRONT_LEFT); -+ m_idx_in[AE_CH_FR] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_FRONT_RIGHT); -+ m_idx_in[AE_CH_FC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_FRONT_CENTER); -+ m_idx_in[AE_CH_LFE] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_LOW_FREQUENCY); -+ m_idx_in[AE_CH_BL] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_BACK_LEFT); -+ m_idx_in[AE_CH_BR] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_BACK_RIGHT); -+ m_idx_in[AE_CH_FLOC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_FRONT_LEFT_OF_CENTER); -+ m_idx_in[AE_CH_FROC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_FRONT_RIGHT_OF_CENTER); -+ m_idx_in[AE_CH_BC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_BACK_CENTER); -+ m_idx_in[AE_CH_SL] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_SIDE_LEFT); -+ m_idx_in[AE_CH_SR] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_SIDE_RIGHT); -+ m_idx_in[AE_CH_TC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_CENTER); -+ m_idx_in[AE_CH_TFL] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_FRONT_LEFT); -+ m_idx_in[AE_CH_TFC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_FRONT_CENTER); -+ m_idx_in[AE_CH_TFR] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_FRONT_RIGHT); -+ m_idx_in[AE_CH_TBL] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_BACK_LEFT); -+ m_idx_in[AE_CH_TBC] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_BACK_CENTER); -+ m_idx_in[AE_CH_TBR] = av_get_channel_layout_channel_index(m_channelLayoutIn, AV_CH_TOP_BACK_RIGHT); -+ m_idx_in[AE_CH_BLOC] = -1; // manually disable these channels because ffmpeg does not support them -+ m_idx_in[AE_CH_BROC] = -1; -+ -+ needDSPAddonsReinit = true; -+ } -+ -+ /* Detect also interleaved output stream channel positions if unknown or changed */ -+ if (m_channelLayoutOut != out->pkt->config.channel_layout) -+ { -+ m_channelLayoutOut = out->pkt->config.channel_layout; -+ -+ m_idx_out[AE_CH_FL] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_FRONT_LEFT); -+ m_idx_out[AE_CH_FR] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_FRONT_RIGHT); -+ m_idx_out[AE_CH_FC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_FRONT_CENTER); -+ m_idx_out[AE_CH_LFE] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_LOW_FREQUENCY); -+ m_idx_out[AE_CH_BL] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_BACK_LEFT); -+ m_idx_out[AE_CH_BR] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_BACK_RIGHT); -+ m_idx_out[AE_CH_FLOC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_FRONT_LEFT_OF_CENTER); -+ m_idx_out[AE_CH_FROC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_FRONT_RIGHT_OF_CENTER); -+ m_idx_out[AE_CH_BC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_BACK_CENTER); -+ m_idx_out[AE_CH_SL] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_SIDE_LEFT); -+ m_idx_out[AE_CH_SR] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_SIDE_RIGHT); -+ m_idx_out[AE_CH_TC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_CENTER); -+ m_idx_out[AE_CH_TFL] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_FRONT_LEFT); -+ m_idx_out[AE_CH_TFC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_FRONT_CENTER); -+ m_idx_out[AE_CH_TFR] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_FRONT_RIGHT); -+ m_idx_out[AE_CH_TBL] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_BACK_LEFT); -+ m_idx_out[AE_CH_TBC] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_BACK_CENTER); -+ m_idx_out[AE_CH_TBR] = av_get_channel_layout_channel_index(m_channelLayoutOut, AV_CH_TOP_BACK_RIGHT); -+ m_idx_out[AE_CH_BLOC] = -1; // manually disable these channels because ffmpeg does not support them -+ m_idx_out[AE_CH_BROC] = -1; -+ -+ needDSPAddonsReinit = true; -+ } -+ -+ if (needDSPAddonsReinit) -+ { -+ m_addonSettings.lInChannelPresentFlags = 0; -+ if (m_idx_in[AE_CH_FL] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FL; -+ if (m_idx_in[AE_CH_FR] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FR; -+ if (m_idx_in[AE_CH_FC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FC; -+ if (m_idx_in[AE_CH_LFE] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_LFE; -+ if (m_idx_in[AE_CH_BL] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BL; -+ if (m_idx_in[AE_CH_BR] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BR; -+ if (m_idx_in[AE_CH_FLOC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FLOC; -+ if (m_idx_in[AE_CH_FROC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_FROC; -+ if (m_idx_in[AE_CH_BC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BC; -+ if (m_idx_in[AE_CH_SL] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_SL; -+ if (m_idx_in[AE_CH_SR] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_SR; -+ if (m_idx_in[AE_CH_TFL] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TFL; -+ if (m_idx_in[AE_CH_TFR] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TFR; -+ if (m_idx_in[AE_CH_TFC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TFC; -+ if (m_idx_in[AE_CH_TC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TC; -+ if (m_idx_in[AE_CH_TBL] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBL; -+ if (m_idx_in[AE_CH_TBR] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBR; -+ if (m_idx_in[AE_CH_TBC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBC; -+ if (m_idx_in[AE_CH_TBR] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_TBR; -+ if (m_idx_in[AE_CH_BLOC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BLOC; -+ if (m_idx_in[AE_CH_BROC] >= 0) m_addonSettings.lInChannelPresentFlags |= AE_DSP_PRSNT_CH_BROC; -+ -+ m_addonSettings.lOutChannelPresentFlags = 0; -+ if (m_idx_out[AE_CH_FL] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FL; -+ if (m_idx_out[AE_CH_FR] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FR; -+ if (m_idx_out[AE_CH_FC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FC; -+ if (m_idx_out[AE_CH_LFE] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_LFE; -+ if (m_idx_out[AE_CH_BL] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BL; -+ if (m_idx_out[AE_CH_BR] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BR; -+ if (m_idx_out[AE_CH_FLOC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FLOC; -+ if (m_idx_out[AE_CH_FROC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_FROC; -+ if (m_idx_out[AE_CH_BC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BC; -+ if (m_idx_out[AE_CH_SL] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_SL; -+ if (m_idx_out[AE_CH_SR] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_SR; -+ if (m_idx_out[AE_CH_TFL] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TFL; -+ if (m_idx_out[AE_CH_TFR] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TFR; -+ if (m_idx_out[AE_CH_TFC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TFC; -+ if (m_idx_out[AE_CH_TC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TC; -+ if (m_idx_out[AE_CH_TBL] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TBL; -+ if (m_idx_out[AE_CH_TBR] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TBR; -+ if (m_idx_out[AE_CH_TBC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_TBC; -+ if (m_idx_out[AE_CH_BLOC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BLOC; -+ if (m_idx_out[AE_CH_BROC] >= 0) m_addonSettings.lOutChannelPresentFlags |= AE_DSP_PRSNT_CH_BROC; -+ -+ m_addonSettings.iStreamID = m_streamId; -+ m_addonSettings.iInChannels = in->pkt->config.channels; -+ m_addonSettings.iOutChannels = out->pkt->config.channels; -+ m_addonSettings.iInSamplerate = in->pkt->config.sample_rate; -+ m_addonSettings.iProcessSamplerate = m_addon_InputResample.pAddon ? m_addon_InputResample.pAddon->InputResampleSampleRate(&m_addon_InputResample.handle) : m_addonSettings.iInSamplerate; -+ m_addonSettings.iOutSamplerate = m_addon_OutputResample.pAddon ? m_addon_OutputResample.pAddon->OutputResampleSampleRate(&m_addon_OutputResample.handle) : m_addonSettings.iProcessSamplerate; -+ -+ if (m_NewMasterMode >= 0) -+ { -+ MasterModeChange(m_NewMasterMode, m_NewStreamType); -+ m_NewMasterMode = AE_DSP_MASTER_MODE_ID_INVALID; -+ m_NewStreamType = AE_DSP_ASTREAM_INVALID; -+ } -+ -+ for (AE_DSP_ADDONMAP_ITR itr = m_usedMap.begin(); itr != m_usedMap.end(); ++itr) -+ { -+ AE_DSP_ERROR err = itr->second->StreamInitialize(&m_addon_Handles[itr->first], &m_addonSettings); -+ if (err != AE_DSP_ERROR_NO_ERROR) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - addon initialize failed on %s with %s", __FUNCTION__, itr->second->GetAudioDSPName().c_str(), CActiveAEDSPAddon::ToString(err)); -+ } -+ } -+ -+ RecheckProcessArray(frames); -+ ClearArray(m_processArray[0], m_processArraySize); -+ ClearArray(m_processArray[1], m_processArraySize); -+ -+ m_forceInit = false; -+ m_iLastProcessTime = static_cast(XbmcThreads::SystemClockMillis()) * 10000; -+ m_iLastProcessUsage = 0; -+ m_fLastProcessUsage = 0.0f; -+ -+ /** -+ * Setup ffmpeg convert array for input stream -+ */ -+ SetFFMpegDSPProcessorArray(m_ffMpegConvertArray, m_processArray[0], NULL); -+ } -+ -+ int64_t startTime; -+ float **lastOutArray = m_processArray[0]; -+ unsigned int togglePtr = 1; -+ -+ /** -+ * Convert to required planar float format inside dsp system -+ */ -+ if (swr_convert(m_convertInput, (uint8_t **)m_ffMpegConvertArray[0], m_processArraySize, (const uint8_t **)in->pkt->data , frames) < 0) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - input audio convert failed", __FUNCTION__); -+ return false; -+ } -+ -+ /**********************************************/ -+ /** DSP Processing Algorithms following here **/ -+ /**********************************************/ -+ -+ /** -+ * DSP input processing -+ * Can be used to have unchanged input stream.. -+ * All DSP addons allowed todo this. -+ */ -+ for (unsigned int i = 0; i < m_addons_InputProc.size(); ++i) -+ { -+ if (!m_addons_InputProc[i].pAddon->InputProcess(&m_addons_InputProc[i].handle, (const float **)lastOutArray, frames)) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - input process failed on addon No. %i", __FUNCTION__, i); -+ return false; -+ } -+ } -+ -+ /** -+ * DSP resample processing before master -+ * Here a high quality resample can be performed. -+ * Only one DSP addon is allowed todo this! -+ */ -+ if (m_addon_InputResample.pAddon) -+ { -+ startTime = CurrentHostCounter(); -+ -+ frames = m_addon_InputResample.pAddon->InputResampleProcess(&m_addon_InputResample.handle, lastOutArray, m_processArray[togglePtr], frames); -+ if (frames == 0) -+ return false; -+ -+ m_addon_InputResample.iLastTime += 1000 * 10000 * (CurrentHostCounter() - startTime) / hostFrequency; -+ -+ lastOutArray = m_processArray[togglePtr]; -+ togglePtr ^= 1; -+ } -+ -+ /** -+ * DSP pre processing -+ * All DSP addons allowed todo this and order of it set on settings. -+ */ -+ for (unsigned int i = 0; i < m_addons_PreProc.size(); ++i) -+ { -+ startTime = CurrentHostCounter(); -+ -+ frames = m_addons_PreProc[i].pAddon->PreProcess(&m_addons_PreProc[i].handle, m_addons_PreProc[i].iAddonModeNumber, lastOutArray, m_processArray[togglePtr], frames); -+ if (frames == 0) -+ return false; -+ -+ m_addons_PreProc[i].iLastTime += 1000 * 10000 * (CurrentHostCounter() - startTime) / hostFrequency; -+ -+ lastOutArray = m_processArray[togglePtr]; -+ togglePtr ^= 1; -+ } -+ -+ /** -+ * DSP master processing -+ * Here a channel upmix/downmix for stereo surround sound can be performed -+ * Only one DSP addon is allowed todo this! -+ */ -+ if (m_addons_MasterProc[m_activeMode].pAddon) -+ { -+ startTime = CurrentHostCounter(); -+ -+ frames = m_addons_MasterProc[m_activeMode].pAddon->MasterProcess(&m_addons_MasterProc[m_activeMode].handle, lastOutArray, m_processArray[togglePtr], frames); -+ if (frames == 0) -+ return false; -+ -+ m_addons_MasterProc[m_activeMode].iLastTime += 1000 * 10000 * (CurrentHostCounter() - startTime) / hostFrequency; -+ -+ lastOutArray = m_processArray[togglePtr]; -+ togglePtr ^= 1; -+ } -+ -+ /** -+ * Perform fallback channel mixing if input channel alignment is different -+ * from output and not becomes processed by active master processing mode or -+ * perform ffmpeg related internal master processes. -+ */ -+ if (m_resamplerDSPProcessor) -+ { -+ startTime = CurrentHostCounter(); -+ -+ if (needDSPAddonsReinit) -+ SetFFMpegDSPProcessorArray(m_ffMpegProcessArray, lastOutArray, m_processArray[togglePtr]); -+ -+ frames = m_resamplerDSPProcessor->Resample((uint8_t**)m_ffMpegProcessArray[FFMPEG_PROC_ARRAY_OUT], frames, (uint8_t**)m_ffMpegProcessArray[FFMPEG_PROC_ARRAY_IN], frames, 1.0); -+ if (frames <= 0) -+ { -+ CLog::Log(LOGERROR, "CActiveAEResample::Resample - resample failed"); -+ return false; -+ } -+ -+ m_addons_MasterProc[m_activeMode].iLastTime += 1000 * 10000 * (CurrentHostCounter() - startTime) / hostFrequency; -+ -+ lastOutArray = m_processArray[togglePtr]; -+ togglePtr ^= 1; -+ } -+ -+ /** -+ * DSP post processing -+ * On the post processing can be things performed with additional channel upmix like 6.1 to 7.1 -+ * or frequency/volume corrections, speaker distance handling, equalizer... . -+ * All DSP addons allowed todo this and order of it set on settings. -+ */ -+ for (unsigned int i = 0; i < m_addons_PostProc.size(); ++i) -+ { -+ startTime = CurrentHostCounter(); -+ -+ frames = m_addons_PostProc[i].pAddon->PostProcess(&m_addons_PostProc[i].handle, m_addons_PostProc[i].iAddonModeNumber, lastOutArray, m_processArray[togglePtr], frames); -+ if (frames == 0) -+ return false; -+ -+ m_addons_PostProc[i].iLastTime += 1000 * 10000 * (CurrentHostCounter() - startTime) / hostFrequency; -+ -+ lastOutArray = m_processArray[togglePtr]; -+ togglePtr ^= 1; -+ } -+ -+ /** -+ * DSP resample processing behind master -+ * Here a high quality resample can be performed. -+ * Only one DSP addon is allowed todo this! -+ */ -+ if (m_addon_OutputResample.pAddon) -+ { -+ startTime = CurrentHostCounter(); -+ -+ frames = m_addon_OutputResample.pAddon->OutputResampleProcess(&m_addon_OutputResample.handle, lastOutArray, m_processArray[togglePtr], frames); -+ if (frames == 0) -+ return false; -+ -+ m_addon_OutputResample.iLastTime += 1000 * 10000 * (CurrentHostCounter() - startTime) / hostFrequency; -+ -+ lastOutArray = m_processArray[togglePtr]; -+ togglePtr ^= 1; -+ } -+ -+ /** -+ * Setup ffmpeg convert array for output stream, performed here to now last array -+ */ -+ if (needDSPAddonsReinit) -+ SetFFMpegDSPProcessorArray(m_ffMpegConvertArray, NULL, lastOutArray); -+ -+ /** -+ * Convert back to required output format -+ */ -+ if (swr_convert(m_convertOutput, (uint8_t **)out->pkt->data, m_processArraySize, (const uint8_t **)m_ffMpegConvertArray[1], frames) < 0) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - output audio convert failed", __FUNCTION__); -+ return false; -+ } -+ out->pkt->nb_samples = frames; -+ -+ /** -+ * Update cpu process percent usage values for modes and total (every second) -+ */ -+ if (iTime >= m_iLastProcessTime + 1000*10000) -+ CalculateCPUUsage(iTime); -+ -+ return true; -+} -+ -+bool CActiveAEDSPProcess::RecheckProcessArray(unsigned int inputFrames) -+{ -+ /* Check for big enough array */ -+ unsigned int framesNeeded; -+ unsigned int framesOut = m_processArraySize; -+ -+ if (inputFrames > framesOut) -+ framesOut = inputFrames; -+ -+ if (m_addon_InputResample.pAddon) -+ { -+ framesNeeded = m_addon_InputResample.pAddon->InputResampleProcessNeededSamplesize(&m_addon_InputResample.handle); -+ if (framesNeeded > framesOut) -+ framesOut = framesNeeded; -+ } -+ -+ for (unsigned int i = 0; i < m_addons_PreProc.size(); ++i) -+ { -+ framesNeeded = m_addons_PreProc[i].pAddon->PreProcessNeededSamplesize(&m_addons_PreProc[i].handle, m_addons_PreProc[i].iAddonModeNumber); -+ if (framesNeeded > framesOut) -+ framesOut = framesNeeded; -+ } -+ -+ if (m_addons_MasterProc[m_activeMode].pAddon) -+ { -+ framesNeeded = m_addons_MasterProc[m_activeMode].pAddon->MasterProcessNeededSamplesize(&m_addons_MasterProc[m_activeMode].handle); -+ if (framesNeeded > framesOut) -+ framesOut = framesNeeded; -+ } -+ -+ for (unsigned int i = 0; i < m_addons_PostProc.size(); ++i) -+ { -+ framesNeeded = m_addons_PostProc[i].pAddon->PostProcessNeededSamplesize(&m_addons_PostProc[i].handle, m_addons_PostProc[i].iAddonModeNumber); -+ if (framesNeeded > framesOut) -+ framesOut = framesNeeded; -+ } -+ -+ if (m_addon_OutputResample.pAddon) -+ { -+ framesNeeded = m_addon_OutputResample.pAddon->OutputResampleProcessNeededSamplesize(&m_addon_OutputResample.handle); -+ if (framesNeeded > framesOut) -+ framesOut = framesNeeded; -+ } -+ -+ if (framesOut > m_processArraySize) -+ { -+ if (!ReallocProcessArray(framesOut)) -+ return false; -+ -+ m_processArraySize = framesOut; -+ } -+ return true; -+} -+ -+bool CActiveAEDSPProcess::ReallocProcessArray(unsigned int requestSize) -+{ -+ m_processArraySize = requestSize + MIN_DSP_ARRAY_SIZE / 10; -+ for (int i = 0; i < AE_DSP_CH_MAX; ++i) -+ { -+ m_processArray[0][i] = (float*)realloc(m_processArray[0][i], m_processArraySize*sizeof(float)); -+ m_processArray[1][i] = (float*)realloc(m_processArray[1][i], m_processArraySize*sizeof(float)); -+ if (m_processArray[0][i] == NULL || m_processArray[1][i] == NULL) -+ { -+ CLog::Log(LOGERROR, "ActiveAE DSP - %s - realloc of process data array failed", __FUNCTION__); -+ return false; -+ } -+ } -+ return true; -+} -+ -+// in this function the usage for each adsp-mode in percent is calculated -+void CActiveAEDSPProcess::CalculateCPUUsage(uint64_t iTime) -+{ -+ int64_t iUsage = CThread::GetCurrentThread()->GetAbsoluteUsage(); -+ -+ if (iTime != m_iLastProcessTime) -+ { -+ // calculate usage only if we don't divide by zero -+ if (m_iLastProcessUsage > 0 && m_iLastProcessTime > 0) -+ { -+ m_fLastProcessUsage = (float)(iUsage - m_iLastProcessUsage) / (float)(iTime - m_iLastProcessTime) * 100.0f; -+ } -+ -+ float dTFactor = 100.0f / (float)(iTime - m_iLastProcessTime); -+ -+ if(m_addon_InputResample.pMode) -+ { -+ m_addon_InputResample.pMode->SetCPUUsage((float)(m_addon_InputResample.iLastTime)*dTFactor); -+ m_addon_InputResample.iLastTime = 0; -+ } -+ -+ for (unsigned int i = 0; i < m_addons_PreProc.size(); ++i) -+ { -+ m_addons_PreProc[i].pMode->SetCPUUsage((float)(m_addons_PreProc[i].iLastTime)*dTFactor); -+ m_addons_PreProc[i].iLastTime = 0; -+ } -+ -+ if (m_addons_MasterProc[m_activeMode].pMode) -+ { -+ m_addons_MasterProc[m_activeMode].pMode->SetCPUUsage((float)(m_addons_MasterProc[m_activeMode].iLastTime)*dTFactor); -+ m_addons_MasterProc[m_activeMode].iLastTime = 0; -+ } -+ -+ for (unsigned int i = 0; i < m_addons_PostProc.size(); ++i) -+ { -+ m_addons_PostProc[i].pMode->SetCPUUsage((float)(m_addons_PostProc[i].iLastTime)*dTFactor); -+ m_addons_PostProc[i].iLastTime = 0; -+ } -+ -+ if (m_addon_OutputResample.pMode) -+ { -+ m_addon_OutputResample.pMode->SetCPUUsage((float)(m_addon_OutputResample.iLastTime)*dTFactor); -+ m_addon_OutputResample.iLastTime = 0; -+ } -+ } -+ -+ m_iLastProcessUsage = iUsage; -+ m_iLastProcessTime = iTime; -+} -+ -+void CActiveAEDSPProcess::SetFFMpegDSPProcessorArray(float *array_ffmpeg[2][AE_DSP_CH_MAX], float **array_in, float **array_out) -+{ -+ /*! -+ * Setup ffmpeg resampler channel setup, this way is not my favorite but it works to become -+ * the correct channel alignment on the given input and output signal. -+ * The problem is, the process array of ffmpeg is not fixed and for every selected channel setup -+ * the positions are different. For this case a translation from the fixed dsp stream format to -+ * ffmpeg format must be performed. It use a separate process array table which becomes set by -+ * already present channel memory storage. -+ */ -+ -+ //! Initialize input channel alignmment for ffmpeg process array -+ if (array_in) -+ { -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_FL) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_FL]] = array_in[AE_DSP_CH_FL]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_FR) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_FR]] = array_in[AE_DSP_CH_FR]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_FC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_FC]] = array_in[AE_DSP_CH_FC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_LFE) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_LFE]] = array_in[AE_DSP_CH_LFE]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_BL) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_BL]] = array_in[AE_DSP_CH_BL]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_BR) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_BR]] = array_in[AE_DSP_CH_BR]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_FLOC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_FLOC]] = array_in[AE_DSP_CH_FLOC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_FROC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_FROC]] = array_in[AE_DSP_CH_FROC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_BC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_BC]] = array_in[AE_DSP_CH_BC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_SL) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_SL]] = array_in[AE_DSP_CH_SL]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_SR) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_SR]] = array_in[AE_DSP_CH_SR]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TFL) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TFL]] = array_in[AE_DSP_CH_TFL]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TFR) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TFR]] = array_in[AE_DSP_CH_TFR]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TFC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TFC]] = array_in[AE_DSP_CH_TFC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TC]] = array_in[AE_DSP_CH_TC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TBL) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TBL]] = array_in[AE_DSP_CH_TBL]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TBR) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TBR]] = array_in[AE_DSP_CH_TBR]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_TBC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_TBC]] = array_in[AE_DSP_CH_TBC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_BLOC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_BLOC]] = array_in[AE_DSP_CH_BLOC]; -+ if (m_addonSettings.lInChannelPresentFlags & AE_DSP_PRSNT_CH_BROC) array_ffmpeg[FFMPEG_PROC_ARRAY_IN][m_idx_in[AE_CH_BROC]] = array_in[AE_DSP_CH_BROC]; -+ } -+ -+ //! Initialize output channel alignmment for ffmpeg process array -+ if (array_out) -+ { -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_FL) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_FL]] = array_out[AE_DSP_CH_FL]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_FR) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_FR]] = array_out[AE_DSP_CH_FR]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_FC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_FC]] = array_out[AE_DSP_CH_FC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_LFE) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_LFE]] = array_out[AE_DSP_CH_LFE]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_BL) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_BL]] = array_out[AE_DSP_CH_BL]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_BR) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_BR]] = array_out[AE_DSP_CH_BR]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_FLOC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_FLOC]] = array_out[AE_DSP_CH_FLOC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_FROC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_FROC]] = array_out[AE_DSP_CH_FROC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_BC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_BC]] = array_out[AE_DSP_CH_BC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_SL) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_SL]] = array_out[AE_DSP_CH_SL]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_SR) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_SR]] = array_out[AE_DSP_CH_SR]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TFL) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TFL]] = array_out[AE_DSP_CH_TFL]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TFR) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TFR]] = array_out[AE_DSP_CH_TFR]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TFC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TFC]] = array_out[AE_DSP_CH_TFC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TC]] = array_out[AE_DSP_CH_TC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TBL) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TBL]] = array_out[AE_DSP_CH_TBL]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TBR) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TBR]] = array_out[AE_DSP_CH_TBR]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_TBC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_TBC]] = array_out[AE_DSP_CH_TBC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_BLOC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_BLOC]] = array_out[AE_DSP_CH_BLOC]; -+ if (m_addonSettings.lOutChannelPresentFlags & AE_DSP_PRSNT_CH_BROC) array_ffmpeg[FFMPEG_PROC_ARRAY_OUT][m_idx_out[AE_CH_BROC]] = array_out[AE_DSP_CH_BROC]; -+ } -+} -+ -+float CActiveAEDSPProcess::GetDelay() -+{ -+ float delay = 0.0f; -+ -+ CSingleLock lock(m_critSection); -+ -+ if (m_addon_InputResample.pAddon) -+ delay += m_addon_InputResample.pAddon->InputResampleGetDelay(&m_addon_InputResample.handle); -+ -+ for (unsigned int i = 0; i < m_addons_PreProc.size(); ++i) -+ delay += m_addons_PreProc[i].pAddon->PreProcessGetDelay(&m_addons_PreProc[i].handle, m_addons_PreProc[i].iAddonModeNumber); -+ -+ if (m_addons_MasterProc[m_activeMode].pAddon) -+ delay += m_addons_MasterProc[m_activeMode].pAddon->MasterProcessGetDelay(&m_addons_MasterProc[m_activeMode].handle); -+ -+ for (unsigned int i = 0; i < m_addons_PostProc.size(); ++i) -+ delay += m_addons_PostProc[i].pAddon->PostProcessGetDelay(&m_addons_PostProc[i].handle, m_addons_PostProc[i].iAddonModeNumber); -+ -+ if (m_addon_OutputResample.pAddon) -+ delay += m_addon_OutputResample.pAddon->OutputResampleGetDelay(&m_addon_OutputResample.handle); -+ -+ return delay; -+} -+ -+bool CActiveAEDSPProcess::HasActiveModes(AE_DSP_MODE_TYPE type) -+{ -+ bool bReturn(false); -+ -+ CSingleLock lock(m_critSection); -+ -+ switch (type) -+ { -+ case AE_DSP_MODE_TYPE_INPUT_RESAMPLE: -+ if (m_addon_InputResample.pAddon != NULL) -+ bReturn = true; -+ break; -+ case AE_DSP_MODE_TYPE_PRE_PROCESS: -+ if (!m_addons_PreProc.empty()) -+ bReturn = true; -+ break; -+ case AE_DSP_MODE_TYPE_MASTER_PROCESS: -+ if (!m_addons_MasterProc.empty()) -+ bReturn = true; -+ break; -+ case AE_DSP_MODE_TYPE_POST_PROCESS: -+ if (!m_addons_PostProc.empty()) -+ bReturn = true; -+ break; -+ case AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE: -+ if (m_addon_OutputResample.pAddon != NULL) -+ bReturn = true; -+ break; -+ default: -+ break; -+ }; -+ -+ return bReturn; -+} -+ -+void CActiveAEDSPProcess::GetActiveModes(AE_DSP_MODE_TYPE type, std::vector &modes) -+{ -+ CSingleLock lock(m_critSection); -+ -+ if (m_addon_InputResample.pAddon != NULL && (type == AE_DSP_MODE_TYPE_UNDEFINED || type == AE_DSP_MODE_TYPE_INPUT_RESAMPLE)) -+ modes.push_back(m_addon_InputResample.pMode); -+ -+ if (type == AE_DSP_MODE_TYPE_UNDEFINED || type == AE_DSP_MODE_TYPE_PRE_PROCESS) -+ for (unsigned int i = 0; i < m_addons_PreProc.size(); ++i) -+ modes.push_back(m_addons_PreProc[i].pMode); -+ -+ if (m_addons_MasterProc[m_activeMode].pAddon != NULL && (type == AE_DSP_MODE_TYPE_UNDEFINED || type == AE_DSP_MODE_TYPE_MASTER_PROCESS)) -+ modes.push_back(m_addons_MasterProc[m_activeMode].pMode); -+ -+ if (type == AE_DSP_MODE_TYPE_UNDEFINED || type == AE_DSP_MODE_TYPE_POST_PROCESS) -+ for (unsigned int i = 0; i < m_addons_PostProc.size(); ++i) -+ modes.push_back(m_addons_PostProc[i].pMode); -+ -+ if (m_addon_OutputResample.pAddon != NULL && (type == AE_DSP_MODE_TYPE_UNDEFINED || type == AE_DSP_MODE_TYPE_OUTPUT_RESAMPLE)) -+ modes.push_back(m_addon_OutputResample.pMode); -+} -+ -+void CActiveAEDSPProcess::GetAvailableMasterModes(AE_DSP_STREAMTYPE streamType, std::vector &modes) -+{ -+ CSingleLock lock(m_critSection); -+ -+ for (unsigned int i = 0; i < m_addons_MasterProc.size(); ++i) -+ { -+ if (m_addons_MasterProc[i].pMode->SupportStreamType(streamType)) -+ modes.push_back(m_addons_MasterProc[i].pMode); -+ } -+} -+ -+int CActiveAEDSPProcess::GetActiveMasterModeID() -+{ -+ CSingleLock lock(m_critSection); -+ -+ return m_activeMode < 0 ? AE_DSP_MASTER_MODE_ID_INVALID : m_addons_MasterProc[m_activeMode].pMode->ModeID(); -+} -+ -+CActiveAEDSPModePtr CActiveAEDSPProcess::GetActiveMasterMode() const -+{ -+ CSingleLock lock(m_critSection); -+ -+ CActiveAEDSPModePtr mode; -+ -+ if (m_activeMode < 0) -+ return mode; -+ -+ mode = m_addons_MasterProc[m_activeMode].pMode; -+ return mode; -+} -+ -+bool CActiveAEDSPProcess::SetMasterMode(AE_DSP_STREAMTYPE streamType, int iModeID, bool bSwitchStreamType) -+{ -+ /*! -+ * if the unique master mode id is already used a reinit is not needed -+ */ -+ if (m_addons_MasterProc[m_activeMode].pMode->ModeID() == iModeID && !bSwitchStreamType) -+ return true; -+ -+ CSingleLock lock(m_restartSection); -+ -+ m_NewMasterMode = iModeID; -+ m_NewStreamType = bSwitchStreamType ? streamType : AE_DSP_ASTREAM_INVALID; -+ m_forceInit = true; -+ return true; -+} -+ -+bool CActiveAEDSPProcess::IsMenuHookModeActive(AE_DSP_MENUHOOK_CAT category, int iAddonId, unsigned int iModeNumber) -+{ -+ std::vector *addons = NULL; -+ -+ switch (category) -+ { -+ case AE_DSP_MENUHOOK_MASTER_PROCESS: -+ addons = &m_addons_MasterProc; -+ break; -+ case AE_DSP_MENUHOOK_PRE_PROCESS: -+ addons = &m_addons_PreProc; -+ break; -+ case AE_DSP_MENUHOOK_POST_PROCESS: -+ addons = &m_addons_PostProc; -+ break; -+ case AE_DSP_MENUHOOK_RESAMPLE: -+ { -+ if (m_addon_InputResample.iAddonModeNumber > 0 && -+ m_addon_InputResample.pMode && -+ m_addon_InputResample.pMode->AddonID() == iAddonId && -+ m_addon_InputResample.pMode->AddonModeNumber() == iModeNumber) -+ return true; -+ -+ if (m_addon_OutputResample.iAddonModeNumber > 0 && -+ m_addon_OutputResample.pMode && -+ m_addon_OutputResample.pMode->AddonID() == iAddonId && -+ m_addon_OutputResample.pMode->AddonModeNumber() == iModeNumber) -+ return true; -+ } -+ default: -+ break; -+ } -+ -+ if (addons) -+ { -+ for (unsigned int i = 0; i < addons->size(); ++i) -+ { -+ if (addons->at(i).iAddonModeNumber > 0 && -+ addons->at(i).pMode->AddonID() == iAddonId && -+ addons->at(i).pMode->AddonModeNumber() == iModeNumber) -+ return true; -+ } -+ } -+ return false; -+} -diff --git a/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h -new file mode 100644 -index 0000000..10de3a1 ---- /dev/null -+++ b/xbmc/cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h -@@ -0,0 +1,353 @@ -+#pragma once -+/* -+ * Copyright (C) 2010-2014 Team KODI -+ * http://kodi.tv -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with KODI; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include -+ -+#include "ActiveAEDSP.h" -+ -+extern "C" { -+#include "libavcodec/avcodec.h" -+#include "libswresample/swresample.h" -+} -+ -+namespace ActiveAE -+{ -+ class CSampleBuffer; -+ class IAEResample; -+ class CActiveAEResample; -+ -+ //@{ -+ /*! -+ * Individual DSP Processing class -+ */ -+ class CActiveAEDSPProcess -+ { -+ public: -+ CActiveAEDSPProcess(AE_DSP_STREAM_ID streamId); -+ virtual ~CActiveAEDSPProcess(); -+ -+ //@{ -+ /*!> -+ * Create the dsp processing with check of all addons about the used input and output audio format. -+ * @param inputFormat The used audio stream input format -+ * @param outputFormat Audio output format which is needed to send to the sinks -+ * @param upmix stereo upmix value from KODI settings is passed in with it -+ * @param quality The requested quality from settings -+ * @param streamType The input stream type to find allowed master process dsp addons for it, e.g. AE_DSP_ASTREAM_MUSIC -+ * @return True if the dsp processing becomes available -+ */ -+ bool Create(const AEAudioFormat &inputFormat, const AEAudioFormat &outputFormat, bool upmix, AEQuality quality, AE_DSP_STREAMTYPE streamType, -+ enum AVMatrixEncoding matrix_encoding, enum AVAudioServiceType audio_service_type, int profile); -+ -+ /*!> -+ * Destroy all allocated dsp addons for this stream id and stops the processing. -+ */ -+ void Destroy(); -+ -+ /*!> -+ * Force processing function (Process(...)) to perform a reinitialization of addons and data -+ */ -+ void ForceReinit(); -+ -+ /*!> -+ * Get the stream id for this processing class -+ */ -+ AE_DSP_STREAM_ID GetStreamId() const; -+ -+ /*!> -+ * Get the currently used input stream format -+ * @note used to have a fallback to normal operation without dsp -+ */ -+ AEAudioFormat GetInputFormat(); -+ -+ /*!> -+ * Get the incoming channels amount for this class -+ */ -+ unsigned int GetInputChannels(); -+ -+ /*!> -+ * Get the incoming sample rate for this class -+ */ -+ unsigned int GetInputSamplerate(); -+ -+ /*!> -+ * Get the incoming channel names as string -+ */ -+ std::string GetInputChannelNames(); -+ -+ /*!> -+ * Get the inside addons used samplerate for this class -+ */ -+ unsigned int GetProcessSamplerate(); -+ -+ /*!> -+ * Get the outgoing channels amount for this class -+ */ -+ unsigned int GetOutputChannels(); -+ -+ /*!> -+ * Get the outgoing channel names -+ */ -+ std::string GetOutputChannelNames(); -+ -+ /*!> -+ * Get the used output samplerate for this class -+ */ -+ unsigned int GetOutputSamplerate(); -+ -+ /*!> -+ * Get the used output frames for this class -+ */ -+ unsigned int GetOutputFrames(); -+ -+ /*!> -+ * Get the amount of percent what the cpu need to process complete dsp stream -+ * @return The current cpu usage -+ */ -+ float GetCPUUsage(void) const; -+ -+ /*!> -+ * Get the channel layout which is passed out from it -+ * @return Channel information class -+ */ -+ CAEChannelInfo GetChannelLayout(); -+ -+ /*!> -+ * Get the currently used output data fromat -+ * @note Is normally float -+ */ -+ AEDataFormat GetDataFormat(); -+ -+ /*!> -+ * It returns the on input source detected stream type, not always the active one. -+ */ -+ AE_DSP_STREAMTYPE GetDetectedStreamType(); -+ -+ /*!> -+ * Get the currently on addons processed audio stream type which is set from KODI, -+ * it is user selectable or if auto mode is enabled it becomes detected upon the -+ * stream input source, eg. Movie, Music... -+ */ -+ AE_DSP_STREAMTYPE GetUsedStreamType(); -+ -+ /*!> -+ * Get the currently on addons processed audio base type which is detected from KODI. -+ * The base type is relevant to the type of input source, eg. Mono, Stereo, Dolby Digital... -+ */ -+ AE_DSP_BASETYPE GetUsedBaseType(); -+ -+ /*!> -+ * Used to check for active modes to given type on running stream id -+ * @param type The type to get, AE_DSP_MODE_TYPE_UNDEFINED to get from all types -+ * @return true if any of selected type is present -+ */ -+ bool HasActiveModes(AE_DSP_MODE_TYPE type); -+ -+ /*!> -+ * Used to get all active mode classes to given type on running stream id -+ * @param type The type to get, AE_DSP_MODE_TYPE_UNDEFINED to get from all types -+ * @retval modes The active modes classes in process chain list -+ */ -+ void GetActiveModes(AE_DSP_MODE_TYPE type, std::vector &modes); -+ -+ /*!> -+ * Used to get all available Master modes on current stream and base type. -+ * It is used to get informations about selectable modes and can be used as information -+ * for the gui to make the mode selection available. -+ * @param streamType the stream type to check about available master modes, e.g. AE_DSP_ASTREAM_MUSIC -+ * @retval modes Pointer to a buffer array where all available master mode written in -+ */ -+ void GetAvailableMasterModes(AE_DSP_STREAMTYPE streamType, std::vector &modes); -+ -+ /*!> -+ * Get the 32 bit individual identification code of the running master mode -+ * @return The identification code, or 0 if no master process is running -+ */ -+ int GetActiveMasterModeID(); -+ -+ /*!> -+ * Returns the information class from the currently used dsp addon -+ * @return pointer to the info class, or unitialized class if no master processing present -+ */ -+ CActiveAEDSPModePtr GetActiveMasterMode() const; -+ -+ /*!> -+ * Change master mode with the 32 bit individual identification code, the change -+ * is not directly performed in this function, is changed on next processing -+ * calls and must be observed that it becomes changed. -+ * @param streamType Stream type on the selection of the master mode -+ * @param iModeID The database identification code of the mode -+ * @param bSwitchStreamType force switching to given stream type -+ * @return True if the mode is allowed and can become changed -+ */ -+ bool SetMasterMode(AE_DSP_STREAMTYPE streamType, int iModeID, bool bSwitchStreamType = false); -+ -+ /*!> -+ * Read a description string from currently processed audio dsp master mode. -+ * It can be used to show additional stream information as string on the skin. -+ * The addon can have more stream information. -+ * @retval strInfo Pointer to a string where it is written in -+ * @return Returns false if no master processing is enabled -+ */ -+ bool GetMasterModeStreamInfoString(std::string &strInfo); -+ -+ /*!> -+ * Get all dsp addon relavant information to detect processing mode type and base values. -+ * @retval streamTypeUsed The current stream type processed by addon -+ * @retval baseType The current base type type processed by addon -+ * @retval iModeID The database identification code of the mode -+ * @return Returns false if no master processing is enabled -+ */ -+ bool GetMasterModeTypeInformation(AE_DSP_STREAMTYPE &streamTypeUsed, AE_DSP_BASETYPE &baseType, int &iModeID); -+ -+ /*!> -+ * Used check that asked addon with his mode id is used on given stream identifier -+ * @param category The type to get -+ * @param iAddonId The ID of the addon to get the menu entries for it -+ * @param iModeNumber From addon defined identifier of the mode -+ * @return true if in use -+ */ -+ bool IsMenuHookModeActive(AE_DSP_MENUHOOK_CAT category, int iAddonId, unsigned int iModeNumber); -+ -+ protected: -+ friend class CActiveAEBufferPoolResample; -+ -+ /*!> -+ * Master processing -+ * @param in the ActiveAE input samples -+ * @param out the processed ActiveAE output samples -+ * @return true if processing becomes performed correct -+ */ -+ bool Process(CSampleBuffer *in, CSampleBuffer *out); -+ -+ /*!> -+ * Returns the time in seconds that it will take -+ * for the next added packet to be heard from the speakers. -+ * @return seconds -+ */ -+ float GetDelay(); -+ //@} -+ private: -+ //@{ -+ /*! -+ * Helper functions -+ */ -+ void InitFFMpegDSPProcessor(); -+ bool CreateStreamProfile(); -+ void ResetStreamFunctionsSelection(); -+ AE_DSP_STREAMTYPE DetectStreamType(const CFileItem *item); -+ const char *GetStreamTypeName(AE_DSP_STREAMTYPE iStreamType); -+ void ClearArray(float **array, unsigned int samples); -+ bool MasterModeChange(int iModeID, AE_DSP_STREAMTYPE iStreamType = AE_DSP_ASTREAM_INVALID); -+ AE_DSP_BASETYPE GetBaseType(AE_DSP_STREAM_PROPERTIES *props); -+ bool RecheckProcessArray(unsigned int inputFrames); -+ bool ReallocProcessArray(unsigned int requestSize); -+ void CalculateCPUUsage(uint64_t iTime); -+ void SetFFMpegDSPProcessorArray(float *array_ffmpeg[2][AE_DSP_CH_MAX], float **array_in, float **array_out); -+ //@} -+ //@{ -+ /*! -+ * Data -+ */ -+ const AE_DSP_STREAM_ID m_streamId; /*!< stream id of this class, is a increase/decrease number of the amount of process streams */ -+ AE_DSP_STREAMTYPE m_streamTypeDetected; /*! The detected stream type of the stream from the source of it */ -+ AE_DSP_STREAMTYPE m_streamTypeUsed; /*!< The currently used stream type */ -+ bool m_forceInit; /*!< if set to true the process function perform a reinitialization of addons and data */ -+ AE_DSP_ADDONMAP m_usedMap; /*!< a map of all currently used audio dsp add-on's */ -+ AEAudioFormat m_inputFormat; /*!< the used input stream format */ -+ AEAudioFormat m_outputFormat; /*!< the from XBMX requested output format */ -+ unsigned int m_outputSamplerate; /*!< the currently active output samplerate can be become changed from addon resamplers */ -+ unsigned int m_outputFrames; /*!< the maximum present output frames */ -+ AEQuality m_streamQuality; /*!< from KODI requested stream quality, based also to addons */ -+ enum AEDataFormat m_dataFormat; /*!< The inside addon system used data format, currently fixed to float */ -+ AE_DSP_SETTINGS m_addonSettings; /*!< the current stream's settings passed to dsp add-ons */ -+ AE_DSP_STREAM_PROPERTIES m_addonStreamProperties; /*!< the current stream's properties (eg. stream type) passed to dsp add-ons */ -+ int m_NewMasterMode; /*!< if master mode is changed it set here and handled by process function */ -+ AE_DSP_STREAMTYPE m_NewStreamType; /*!< if stream type is changed it set here and handled by process function */ -+ enum AVMatrixEncoding m_ffMpegMatrixEncoding; -+ enum AVAudioServiceType m_ffMpegAudioServiceType; -+ int m_ffMpegProfile; -+ SwrContext *m_convertInput; -+ SwrContext *m_convertOutput; -+ -+ CCriticalSection m_critSection; -+ CCriticalSection m_restartSection; -+ -+ /*!> -+ * Selected dsp addon functions -+ */ -+ struct sDSPProcessHandle -+ { -+ void Clear() -+ { -+ iAddonModeNumber = -1; -+ iLastTime = 0; -+ } -+ unsigned int iAddonModeNumber; /*!< The identifier, send from addon during mode registration and can be used from addon to select mode from a function table */ -+ CActiveAEDSPModePtr pMode; /*!< Processing mode information data */ -+ AE_DSP_ADDON pAddon; /*!< Addon control class */ -+ ADDON_HANDLE_STRUCT handle; -+ uint64_t iLastTime; /*!< last processing time of the mode */ -+ }; -+ std::vector m_addons_InputProc; /*!< Input processing list, called to all enabled dsp addons with the basic unchanged input stream, is read only. */ -+ sDSPProcessHandle m_addon_InputResample; /*!< Input stream resampling over one on settings enabled input resample function only on one addon */ -+ std::vector m_addons_PreProc; /*!< Input stream preprocessing function calls set and aligned from dsp settings stored inside database */ -+ std::vector m_addons_MasterProc; /*!< The current from user selected master processing function on addon */ -+ int m_activeMode; /*!< the current used master mode, is a pointer to m_addons_MasterProc */ -+ int m_activeModeOutChannels; /*!< Amount of channels given from active master mode or -1 if unhandled */ -+ unsigned long m_activeModeOutChannelsPresent; /*! The exact present flags of output processing channels from active master mode */ -+ std::vector m_addons_PostProc; /*!< Output stream postprocessing function calls set and aligned from dsp settings stored inside database */ -+ sDSPProcessHandle m_addon_OutputResample; /*!< Output stream resampling over one on settings enabled output resample function only on one addon */ -+ std::map m_addon_Handles; /*!< Handle identifier for the called dsp functions */ -+ -+ /*!> -+ * Process arrays -+ */ -+ float *m_processArray[2][AE_DSP_CH_MAX]; -+ unsigned int m_processArraySize; -+ -+ /*!> -+ * CPU usage data -+ */ -+ uint64_t m_iLastProcessTime; -+ uint64_t m_iLastProcessUsage; -+ float m_fLastProcessUsage; -+ -+ /*!> -+ * Internal ffmpeg process data -+ */ -+ #define FFMPEG_PROC_ARRAY_IN 0 -+ #define FFMPEG_PROC_ARRAY_OUT 1 -+ IAEResample *m_resamplerDSPProcessor; /*!< ffmpeg resampler usage for down mix of input stream to required output channel alignment or internal processing*/ -+ float *m_ffMpegConvertArray[2][AE_DSP_CH_MAX]; /*!< the process array memory pointers for ffmpeg used for format convert. No own memory only addresses taken from m_processArray in correct ffmpeg channel alignment */ -+ float *m_ffMpegProcessArray[2][AE_DSP_CH_MAX]; /*!< the process array memory pointers for ffmpeg. No own memory only addresses taken from m_processArray in correct ffmpeg channel alignment */ -+ -+ /*!> -+ * Index pointers for interleaved audio streams to detect correct channel alignment -+ */ -+ int m_idx_in[AE_CH_MAX]; -+ uint64_t m_channelLayoutIn; -+ int m_idx_out[AE_CH_MAX]; -+ uint64_t m_channelLayoutOut; -+ //@} -+ }; -+ //@} -+} diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -index f61e387..c3e7ff6 100644 +index 8c0cca3..8d3ba85 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.cpp -@@ -23,8 +23,8 @@ - using namespace ActiveAE; - #include "ActiveAESound.h" - #include "ActiveAEStream.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPProcess.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h" - #include "cores/AudioEngine/Utils/AEUtil.h" - #include "cores/AudioEngine/Utils/AEStreamInfo.h" - #include "cores/AudioEngine/AEResampleFactory.h" -@@ -297,7 +297,9 @@ CActiveAE::~CActiveAE() - - void CActiveAE::Dispose() - { -+#if defined(HAS_GLX) || defined(TARGET_DARWIN) - g_Windowing.Unregister(this); -+#endif - - m_bStop = true; - m_outMsgEvent.Set(); -@@ -1213,7 +1215,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) - format.m_streamInfo.m_channels = 2; - format.m_streamInfo.m_sampleRate = 48000; - format.m_streamInfo.m_ac3FrameSize = m_encoderFormat.m_frames; -- //! @todo implement -+ // TODO - if (m_encoderBuffers && initSink) - { - m_discardBufferPools.push_back(m_encoderBuffers); -@@ -1249,7 +1251,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) - uint64_t avlayout = CAEUtil::GetAVChannelLayout(outputFormat.m_channelLayout); - outputFormat.m_channelLayout = CAEUtil::GetAEChannelLayout(avlayout); - -- //! @todo adjust to decoder -+ // TODO: adjust to decoder - sinkInputFormat = outputFormat; - } - m_internalFormat = outputFormat; -@@ -1323,7 +1325,7 @@ void CActiveAE::Configure(AEAudioFormat *desiredFmt) - - // resample buffers - m_vizBuffers = new CActiveAEBufferPoolResample(m_internalFormat, vizFormat, m_settings.resampleQuality); -- //! @todo use cache of sync + water level -+ // TODO use cache of sync + water level - m_vizBuffers->Create(2000, false, false); - m_vizInitialized = false; - } -@@ -1904,7 +1906,8 @@ bool CActiveAE::RunStages() - CActiveAEStream *slave = (CActiveAEStream*)((*it)->m_streamSlave); - slave->m_paused = false; - -- //! @todo find better solution for this gapless bites audiophile -+ // TODO: find better solution for this -+ // gapless bites audiophile - if (m_settings.config == AE_CONFIG_MATCH) - Configure(&slave->m_format); - -@@ -2327,7 +2330,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) +@@ -2322,7 +2322,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) double threshold = 100; if (stream->m_resampleMode) { @@ -64496,7 +7743,7 @@ index f61e387..c3e7ff6 100644 threshold *= 10; else threshold *= 2; -@@ -2339,8 +2342,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) +@@ -2334,8 +2334,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) if (newerror && fabs(error) > threshold && stream->m_syncState == CAESyncInfo::AESyncState::SYNC_INSYNC) { stream->m_syncState = CAESyncInfo::AESyncState::SYNC_ADJUST; @@ -64506,7 +7753,7 @@ index f61e387..c3e7ff6 100644 stream->m_lastSyncError = error; CLog::Log(LOGDEBUG,"ActiveAE::SyncStream - average error %f above threshold of %f", error, threshold); } -@@ -2449,6 +2451,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) +@@ -2444,6 +2443,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) } } @@ -64514,7 +7761,7 @@ index f61e387..c3e7ff6 100644 if (fabs(error) < 30) { if (stream->m_lastSyncError > threshold * 2) -@@ -2460,13 +2463,18 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) +@@ -2455,13 +2455,18 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) } else { @@ -64535,7 +7782,7 @@ index f61e387..c3e7ff6 100644 return ret; } -@@ -2479,6 +2487,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) +@@ -2474,6 +2479,7 @@ CSampleBuffer* CActiveAE::SyncStream(CActiveAEStream *stream) if (stream->m_resampleBuffers) { stream->m_resampleBuffers->m_resampleRatio = stream->CalcResampleRatio(error); @@ -64543,115 +7790,10 @@ index f61e387..c3e7ff6 100644 } } else if (stream->m_resampleBuffers) -@@ -2615,7 +2624,9 @@ bool CActiveAE::Initialize() - } - - // hook into windowing for receiving display reset events -+#if defined(HAS_GLX) || defined(TARGET_DARWIN) - g_Windowing.Register(this); -+#endif - - m_inMsgEvent.Reset(); - return true; -@@ -3211,7 +3222,7 @@ IAEStream *CActiveAE::MakeStream(AEAudioFormat &audioFormat, unsigned int option - if (IsSuspended()) - return NULL; - -- //! @todo pass number of samples in audio packet -+ //TODO: pass number of samples in audio packet - - AEAudioFormat format = audioFormat; - format.m_frames = format.m_sampleRate / 10; -@@ -3284,7 +3295,7 @@ void CActiveAE::FlushStream(CActiveAEStream *stream) - - void CActiveAE::PauseStream(CActiveAEStream *stream, bool pause) - { -- //! @todo pause sink, needs api change -+ // TODO pause sink, needs api change - if (pause) - m_controlPort.SendOutMessage(CActiveAEControlProtocol::PAUSESTREAM, - &stream, sizeof(CActiveAEStream*)); -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -index 2a31a6e..f0c0eac 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAE.h -@@ -19,10 +19,6 @@ - * - */ - --#include --#include --#include -- - #include "system.h" - #include "threads/Thread.h" - -@@ -220,7 +216,11 @@ protected: - std::vector m_streamStats; - }; - -+#if defined(HAS_GLX) || defined(TARGET_DARWIN) - class CActiveAE : public IAE, public IDispResource, private CThread -+#else -+class CActiveAE : public IAE, private CThread -+#endif - { - protected: - friend class ::CAEFactory; -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -index bc49ce2..a64ee31 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.cpp -@@ -20,7 +20,7 @@ - - #include "ActiveAEBuffer.h" - #include "cores/AudioEngine/AEFactory.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPProcess.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h" - #include "cores/AudioEngine/Engines/ActiveAE/ActiveAE.h" - #include "cores/AudioEngine/Utils/AEUtil.h" - #include "cores/AudioEngine/AEResampleFactory.h" -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -index 3bb7990..aadbb0d 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEBuffer.h -@@ -21,7 +21,7 @@ - - #include "cores/AudioEngine/Utils/AEAudioFormat.h" - #include "cores/AudioEngine/Interfaces/AE.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include - - extern "C" { diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -index 8961d66..fde70b1 100644 +index 1598900..fde70b1 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp -@@ -271,10 +271,10 @@ void CActiveAESink::StateMachine(int signal, Protocol *port, Message *msg) - { - SinkReply reply; - reply.format = m_sinkFormat; -- //! @todo -- //! use max raw packet size, for now use max size of an IEC packed packet -- //! maxIECPpacket > maxRawPacket -- //! for raw packets frameSize is set to 1 -+ // TODO -+ // use max raw packet size, for now use max size of an IEC packed packet -+ // maxIECPpacket > maxRawPacket -+ // for raw packets frameSize is set to 1 - if (m_requestedFormat.m_dataFormat == AE_FMT_RAW) - { - reply.format.m_frames = 61440; -@@ -818,7 +818,7 @@ void CActiveAESink::OpenSink() - } - - // open NULL sink -- //! @todo should not be required by ActiveAE -+ // TODO: should not be required by ActiveAE - if (!m_sink) - { - device = "NULL:NULL"; @@ -1005,28 +1005,15 @@ unsigned int CActiveAESink::OutputSamples(CSampleBuffer* samples) { maxFrames = std::min(frames, m_sinkFormat.m_frames); @@ -64685,19 +7827,6 @@ index 8961d66..fde70b1 100644 status.SetDelay(0); framesOrPackets = frames; if (m_requestedFormat.m_dataFormat == AE_FMT_RAW) -diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.cpp -index e6aaf6a..50073e7 100644 ---- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.cpp -+++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESound.cpp -@@ -68,7 +68,7 @@ void CActiveAESound::Stop() - - bool CActiveAESound::IsPlaying() - { -- //! @todo implement -+ // TODO - return false; - } - diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp index 1d58691..f95e54a 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEStream.cpp @@ -64735,42 +7864,10 @@ index 1d58691..f95e54a 100644 //CLog::Log(LOGNOTICE,"----- error: %f, rr: %f, prop: %f, int: %f", // error, ret, proportional, m_resampleIntegral); return ret; -diff --git a/xbmc/cores/AudioEngine/Makefile.in b/xbmc/cores/AudioEngine/Makefile.in -index 4167eec..7aab111 100644 ---- a/xbmc/cores/AudioEngine/Makefile.in -+++ b/xbmc/cores/AudioEngine/Makefile.in -@@ -57,11 +57,11 @@ SRCS += Sinks/AESinkPULSE.cpp - endif - endif - --SRCS += Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.cpp --SRCS += Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.cpp --SRCS += Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPAddon.cpp --SRCS += Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPDatabase.cpp --SRCS += Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPProcess.cpp -+SRCS += DSPAddons/ActiveAEDSP.cpp -+SRCS += DSPAddons/ActiveAEDSPMode.cpp -+SRCS += DSPAddons/ActiveAEDSPAddon.cpp -+SRCS += DSPAddons/ActiveAEDSPDatabase.cpp -+SRCS += DSPAddons/ActiveAEDSPProcess.cpp - - SRCS += Utils/AEChannelInfo.cpp - SRCS += Utils/AEBuffer.cpp diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -index 6a9066b..d77707f 100644 +index 95db8cf..d77707f 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp -@@ -351,8 +351,8 @@ snd_pcm_chmap_t* CAESinkALSA::CopyALSAchmap(snd_pcm_chmap_t* alsaMap) - std::string CAESinkALSA::ALSAchmapToString(snd_pcm_chmap_t* alsaMap) - { - char buf[128] = { 0 }; -- //! @bug ALSA bug - buffer overflow by a factor of 2 is possible -- //! http://mailman.alsa-project.org/pipermail/alsa-devel/2014-December/085815.html -+ // ALSA bug - buffer overflow by a factor of 2 is possible -+ // http://mailman.alsa-project.org/pipermail/alsa-devel/2014-December/085815.html - int err = snd_pcm_chmap_print(alsaMap, sizeof(buf) / 2, buf); - if (err < 0) - return "Error"; @@ -926,50 +926,43 @@ unsigned int CAESinkALSA::AddPackets(uint8_t **data, unsigned int frames, unsign unsigned int amount = 0; int64_t data_left = (int64_t) frames; @@ -64873,269 +7970,11 @@ index 4ca5941..8de0318 100644 std::string m_initDevice; AEAudioFormat m_initFormat; -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp -index 1ae3f1f..31f7946 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkDARWINOSX.cpp -@@ -293,7 +293,7 @@ bool CAESinkDARWINOSX::Initialize(AEAudioFormat &format, std::string &device) - // update the channel map based on the new stream format - devEnum.GetAEChannelMap(format.m_channelLayout, numOutputChannels); - -- //! @todo Should we use the virtual format to determine our data format? -+ /* TODO: Should we use the virtual format to determine our data format? */ - format.m_frameSize = format.m_channelLayout.Count() * (CAEUtil::DataFormatToBits(format.m_dataFormat) >> 3); - format.m_frames = m_device.GetBufferSize(); - -@@ -315,14 +315,14 @@ bool CAESinkDARWINOSX::Initialize(AEAudioFormat &format, std::string &device) - - void CAESinkDARWINOSX::SetHogMode(bool on) - { -- //! @todo Auto hogging sets this for us. Figure out how/when to turn it off or use it -- //! It appears that leaving this set will aslo restore the previous stream format when the -- //! Application exits. If auto hogging is set and we try to set hog mode, we will deadlock -- //! From the SDK docs: "If the AudioDevice is in a non-mixable mode, the HAL will automatically take hog mode on behalf of the first process to start an IOProc." -- //! -- //! Lock down the device. This MUST be done PRIOR to switching to a non-mixable format, if it is done at all -- //! If it is attempted after the format change, there is a high likelihood of a deadlock -- //! We may need to do this sooner to enable mix-disable (i.e. before setting the stream format) -+ // TODO: Auto hogging sets this for us. Figure out how/when to turn it off or use it -+ // It appears that leaving this set will aslo restore the previous stream format when the -+ // Application exits. If auto hogging is set and we try to set hog mode, we will deadlock -+ // From the SDK docs: "If the AudioDevice is in a non-mixable mode, the HAL will automatically take hog mode on behalf of the first process to start an IOProc." -+ -+ // Lock down the device. This MUST be done PRIOR to switching to a non-mixable format, if it is done at all -+ // If it is attempted after the format change, there is a high likelihood of a deadlock -+ // We may need to do this sooner to enable mix-disable (i.e. before setting the stream format) - if (on) - { - // Auto-Hog does not always un-hog the device when changing back to a mixable mode. -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp -index 4cdbf5a..aa0a357 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkNULL.cpp -@@ -125,7 +125,7 @@ void CAESinkNULL::Process() - { - if (m_draining) - { -- //! @todo is it correct to not take data at the appropriate rate while draining? -+ // TODO: is it correct to not take data at the appropriate rate while draining? - m_sinkbuffer_level = 0; - m_draining = false; - } -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp -index 583f559..043d0d5 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkPULSE.cpp -@@ -579,13 +579,9 @@ bool CAESinkPULSE::Initialize(AEAudioFormat &format, std::string &device) - return false; - } - -- // Pulse can resample everything between 1 hz and 192000 hz / 384000 hz (starting with 9.0) -+ // Pulse can resample everything between 1 hz and 192000 hz - // Make sure we are in the range that we originally added -- unsigned int max_pulse_sample_rate = 192000U; --#if PA_CHECK_VERSION(9,0,0) -- max_pulse_sample_rate = 384000U; --#endif -- format.m_sampleRate = std::max(5512U, std::min(format.m_sampleRate, max_pulse_sample_rate)); -+ format.m_sampleRate = std::max(5512U, std::min(format.m_sampleRate, 192000U)); - - pa_format_info *info[1]; - info[0] = pa_format_info_new(); -diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp -index e3e0895..534c383 100644 ---- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp -@@ -105,12 +105,11 @@ struct sampleFormat - AEDataFormat subFormatType; - }; - --//! @todo --//! Sample formats go from float -> 32 bit int -> 24 bit int (packed in 32) -> -> 24 bit int -> 16 bit int */ --//! versions of Kodi before 14.0 had a bug which made S24NE4MSB the first format selected --//! this bug worked around some driver bug of some IEC958 devices which report S32 but can't handle it --//! correctly. So far I have never seen and WASAPI device using S32 and don't think probing S24 before --//! S32 has any negative impact. -+/* Sample formats go from float -> 32 bit int -> 24 bit int (packed in 32) -> -> 24 bit int -> 16 bit int */ -+// versions of Kodi before 14.0 had a bug which made S24NE4MSB the first format selected -+// this bug worked around some driver bug of some IEC958 devices which report S32 but can't handle it -+// correctly. So far I have never seen and WASAPI device using S32 and don't think probing S24 before -+// S32 has any negative impact. - static const sampleFormat testFormats[] = { {KSDATAFORMAT_SUBTYPE_IEEE_FLOAT, 32, 32, AE_FMT_FLOAT}, - {KSDATAFORMAT_SUBTYPE_PCM, 32, 24, AE_FMT_S24NE4MSB}, - {KSDATAFORMAT_SUBTYPE_PCM, 32, 32, AE_FMT_S32NE}, -diff --git a/xbmc/cores/AudioEngine/Sinks/osx/AEDeviceEnumerationOSX.h b/xbmc/cores/AudioEngine/Sinks/osx/AEDeviceEnumerationOSX.h -index defd18d..7f12391 100644 ---- a/xbmc/cores/AudioEngine/Sinks/osx/AEDeviceEnumerationOSX.h -+++ b/xbmc/cores/AudioEngine/Sinks/osx/AEDeviceEnumerationOSX.h -@@ -19,10 +19,6 @@ - * - */ - --#include --#include --#include -- - #include "cores/AudioEngine/Utils/AEDeviceInfo.h" - #include "cores/AudioEngine/Sinks/osx/CoreAudioDevice.h" - -diff --git a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioDevice.h b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioDevice.h -index 68cde14..331b876 100644 ---- a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioDevice.h -+++ b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioDevice.h -@@ -23,9 +23,7 @@ - - #if defined(TARGET_DARWIN_OSX) - --#include - #include --#include - - #include "cores/AudioEngine/Sinks/osx/CoreAudioStream.h" - -diff --git a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.cpp b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.cpp -index c9169f1..d280e2f 100644 ---- a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.cpp -+++ b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.cpp -@@ -59,8 +59,8 @@ bool CCoreAudioStream::Open(AudioStreamID streamId) - return true; - } - --//! @todo Should it even be possible to change both the --//! physical and virtual formats, since the devices do it themselves? -+// TODO: Should it even be possible to change both the -+// physical and virtual formats, since the devices do it themselves? - void CCoreAudioStream::Close(bool restore) - { - if (!m_StreamId) -diff --git a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.h b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.h -index 3f01060..3fb01c1 100644 ---- a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.h -+++ b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioStream.h -@@ -28,7 +28,6 @@ - #include - - #include --#include - - // not defined in 10.6 sdk - #ifndef kIOAudioDeviceTransportTypeThunderbolt -diff --git a/xbmc/cores/AudioEngine/Utils/AEELDParser.cpp b/xbmc/cores/AudioEngine/Utils/AEELDParser.cpp -index 29c645d..69171cf 100644 ---- a/xbmc/cores/AudioEngine/Utils/AEELDParser.cpp -+++ b/xbmc/cores/AudioEngine/Utils/AEELDParser.cpp -@@ -191,7 +191,7 @@ void CAEELDParser::Parse(const uint8_t *data, size_t length, CAEDeviceInfo& info - AEDataFormat fmt = AE_FMT_INVALID; - switch (formatCode) - { -- //! @todo implement -+ // TODO - case CEA_861_FORMAT_AC3 : fmt = AE_FMT_RAW ; break; - case CEA_861_FORMAT_DTS : fmt = AE_FMT_RAW ; break; - case CEA_861_FORMAT_DTSHD: fmt = AE_FMT_RAW ; break; -diff --git a/xbmc/cores/DllLoader/DllLoader.cpp b/xbmc/cores/DllLoader/DllLoader.cpp -index 6438705..01f8e9a 100644 ---- a/xbmc/cores/DllLoader/DllLoader.cpp -+++ b/xbmc/cores/DllLoader/DllLoader.cpp -@@ -383,8 +383,8 @@ int DllLoader::LoadExports() - PrintExportTable(ExportDirTable); - #endif - -- //! @todo Validate all pointers are valid. Is a zero RVA valid or not? I'd guess not as it would -- //! point to the coff file header, thus not right. -+ // TODO - Validate all pointers are valid. Is a zero RVA valid or not? I'd guess not as it would -+ // point to the coff file header, thus not right. - - unsigned long *ExportAddressTable = (unsigned long*)RVA2Data(ExportDirTable->ExportAddressTable_RVA); - unsigned long *NamePointerTable = (unsigned long*)RVA2Data(ExportDirTable->NamePointerTable_RVA); -diff --git a/xbmc/cores/DllLoader/Win32DllLoader.cpp b/xbmc/cores/DllLoader/Win32DllLoader.cpp -index 9db3216..050b358 100644 ---- a/xbmc/cores/DllLoader/Win32DllLoader.cpp -+++ b/xbmc/cores/DllLoader/Win32DllLoader.cpp -@@ -372,7 +372,7 @@ bool FunctionNeedsWrapping(Export *exports, const char *functionName, void **fix - while (exp->name) - { - if (strcmp(exp->name, functionName) == 0) -- { //! @todo Should we be tracking stuff? -+ { // TODO: Should we be tracking stuff? - if (0) - *fixup = exp->track_function; - else -@@ -395,7 +395,7 @@ bool Win32DllLoader::ResolveOrdinal(const char *dllName, unsigned long ordinal, - while (exp->name) - { - if (exp->ordinal == ordinal) -- { //! @todo Should we be tracking stuff? -+ { // TODO: Should we be tracking stuff? - if (0) - *fixup = exp->track_function; - else -diff --git a/xbmc/cores/DllLoader/exports/CMakeLists.txt b/xbmc/cores/DllLoader/exports/CMakeLists.txt -index 71b470a..32e612f 100644 ---- a/xbmc/cores/DllLoader/exports/CMakeLists.txt -+++ b/xbmc/cores/DllLoader/exports/CMakeLists.txt -@@ -8,7 +8,7 @@ set(HEADERS emu_dummy.h - - core_add_library(dllexports) - --if(APPLE) -+if(CORE_SYSTEM_NAME STREQUAL darwin OR CORE_SYSTEM_NAME STREQUAL ios) - add_library(wrapper OBJECT wrapper.c) - add_custom_target(wrapper.def ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/wrapper_mach_alias wrapper.def) - add_dependencies(wrapper.def wrapper) -@@ -19,8 +19,8 @@ elseif(NOT CORE_SYSTEM_NAME STREQUAL windows) - add_custom_target(wrapper.def ALL nm ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/wrapper.dir/wrapper.c.o | grep __wrap | awk '{ printf(\"%s \", \$\$3) }' | sed \"s/___wrap_/__wrap_/g\" | sed \"s/__wrap_/-Wl,-wrap,/g\" > wrapper.def) - - if(CORE_SYSTEM_NAME STREQUAL android) -- add_custom_command(TARGET wrapper.def COMMAND echo \"-l$\" >> wrapper.def) -- add_dependencies(wrapper.def ${APP_NAME_LC}) -+ add_custom_target(patchdef ALL echo \"-L${CMAKE_INSTALL_PREFIX}/lib/dummy-libxbmc/ -lxbmc\" >> wrapper.def) -+ add_dependencies(patchdef wrapper.def xbmc) - endif() - - add_dependencies(wrapper.def wrapper) -diff --git a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp -index 44578fe..c8e17b3 100644 ---- a/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp -+++ b/xbmc/cores/DllLoader/exports/emu_msvcrt.cpp -@@ -877,6 +877,11 @@ extern "C" - while ((iDirSlot < MAX_OPEN_DIRS) && (vecDirsOpen[iDirSlot].curr_index != -1)) iDirSlot++; - if (iDirSlot >= MAX_OPEN_DIRS) - return -1; // no free slots -+ if (url.IsProtocol("filereader")) -+ { -+ CURL url2(url.GetFileName()); -+ url = url2; -+ } - strURL = url.Get(); - bVecDirsInited = true; - vecDirsOpen[iDirSlot].items.Clear(); -@@ -997,6 +1002,12 @@ extern "C" - return NULL; // no free slots - } - -+ if (url.IsProtocol("filereader")) -+ { -+ CURL url2(url.GetFileName()); -+ url = url2; -+ } -+ - bVecDirsInited = true; - vecDirsOpen[iDirSlot].items.Clear(); - diff --git a/xbmc/cores/IPlayer.h b/xbmc/cores/IPlayer.h -index 771355c..4b07b4e 100644 +index 484dcde..4b07b4e 100644 --- a/xbmc/cores/IPlayer.h +++ b/xbmc/cores/IPlayer.h -@@ -22,7 +22,6 @@ - - #include "system.h" // until we get sane int types used here - #include --#include - #include "IPlayerCallback.h" - #include "guilib/Geometry.h" - #include "guilib/Resolution.h" -@@ -174,6 +173,10 @@ enum EINTERLACEMETHOD +@@ -173,6 +173,10 @@ enum EINTERLACEMETHOD VS_INTERLACEMETHOD_IMX_FASTMOTION = 29, VS_INTERLACEMETHOD_IMX_FASTMOTION_DOUBLE = 30, @@ -65146,735 +7985,6 @@ index 771355c..4b07b4e 100644 VS_INTERLACEMETHOD_MAX // do not use and keep as last enum value. }; -diff --git a/xbmc/cores/VideoPlayer/DVDClock.cpp b/xbmc/cores/VideoPlayer/DVDClock.cpp -index bcf9cc7..7d0b84c 100644 ---- a/xbmc/cores/VideoPlayer/DVDClock.cpp -+++ b/xbmc/cores/VideoPlayer/DVDClock.cpp -@@ -34,7 +34,6 @@ CDVDClock::CDVDClock() - - m_pauseClock = 0; - m_bReset = true; -- m_paused = false; - m_iDisc = 0; - m_maxspeedadjust = 0.0; - m_systemAdjust = 0; -@@ -101,41 +100,14 @@ double CDVDClock::GetVsyncAdjust() - return m_vSyncAdjust; - } - --void CDVDClock::Pause(bool pause) --{ -- CSingleLock lock(m_critSection); -- -- if (pause && !m_paused) -- { -- if (!m_pauseClock) -- m_speedAfterPause = m_systemFrequency * DVD_PLAYSPEED_NORMAL / m_systemUsed; -- else -- m_speedAfterPause = DVD_PLAYSPEED_PAUSE; -- -- SetSpeed(DVD_PLAYSPEED_PAUSE); -- m_paused = true; -- } -- else if (!pause && m_paused) -- { -- m_paused = false; -- SetSpeed(m_speedAfterPause); -- } --} -- - void CDVDClock::SetSpeed(int iSpeed) - { - // this will sometimes be a little bit of due to rounding errors, ie clock might jump abit when changing speed - CSingleLock lock(m_critSection); - -- if (m_paused) -- { -- m_speedAfterPause = iSpeed; -- return; -- } -- -- if (iSpeed == DVD_PLAYSPEED_PAUSE) -+ if(iSpeed == DVD_PLAYSPEED_PAUSE) - { -- if (!m_pauseClock) -+ if(!m_pauseClock) - m_pauseClock = m_videoRefClock->GetTime(); - return; - } -@@ -144,7 +116,7 @@ void CDVDClock::SetSpeed(int iSpeed) - int64_t newfreq = m_systemFrequency * DVD_PLAYSPEED_NORMAL / iSpeed; - - current = m_videoRefClock->GetTime(); -- if (m_pauseClock) -+ if( m_pauseClock ) - { - m_startClock += current - m_pauseClock; - m_pauseClock = 0; -@@ -212,6 +184,7 @@ void CDVDClock::Discontinuity(double clock, double absolute) - m_bReset = false; - m_systemAdjust = 0; - m_speedAdjust = 0; -+ m_vSyncAdjust = 0; - } - - void CDVDClock::SetMaxSpeedAdjust(double speed) -@@ -255,6 +228,11 @@ int CDVDClock::UpdateFramerate(double fps, double* interval /*= NULL*/) - return rate; - } - -+double CDVDClock::GetRefreshRate() -+{ -+ return m_videoRefClock->GetRefreshRate(); -+} -+ - bool CDVDClock::GetClockInfo(int& MissedVblanks, double& ClockSpeed, double& RefreshRate) const - { - return m_videoRefClock->GetClockInfo(MissedVblanks, ClockSpeed, RefreshRate); -diff --git a/xbmc/cores/VideoPlayer/DVDClock.h b/xbmc/cores/VideoPlayer/DVDClock.h -index 931ee68..b1fde18 100644 ---- a/xbmc/cores/VideoPlayer/DVDClock.h -+++ b/xbmc/cores/VideoPlayer/DVDClock.h -@@ -70,12 +70,11 @@ public: - double GetAbsoluteClock(bool interpolated = true); - double GetFrequency() { return (double)m_systemFrequency ; } - -+ double GetRefreshRate(); - bool GetClockInfo(int& MissedVblanks, double& ClockSpeed, double& RefreshRate) const; - void SetVsyncAdjust(double adjustment); - double GetVsyncAdjust(); - -- void Pause(bool pause); -- - protected: - double SystemToAbsolute(int64_t system); - int64_t AbsoluteToSystem(double absolute); -@@ -87,8 +86,6 @@ protected: - int64_t m_pauseClock; - double m_iDisc; - bool m_bReset; -- bool m_paused; -- int m_speedAfterPause; - std::unique_ptr m_videoRefClock; - - int64_t m_systemFrequency; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -index 3a080d0..c793ff4 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp -@@ -45,11 +45,6 @@ CDVDOverlayCodecFFmpeg::~CDVDOverlayCodecFFmpeg() - - bool CDVDOverlayCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - { -- -- // decoding of this kind of subs does not work reliable -- if (hints.codec == AV_CODEC_ID_EIA_608) -- return false; -- - AVCodec* pCodec = avcodec_find_decoder(hints.codec); - if (!pCodec) - { -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder708.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder708.cpp -index 4c5d524..61a3acf 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder708.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Overlay/contrib/cc_decoder708.cpp -@@ -31,7 +31,7 @@ unsigned char get_internal_from_G1 (unsigned char g1_char) - return g1_char; - } - --//! @todo Probably not right -+// TODO: Probably not right - // G2: Extended Control Code Set 1 - unsigned char get_internal_from_G2 (unsigned char g2_char) - { -@@ -46,7 +46,7 @@ unsigned char get_internal_from_G2 (unsigned char g2_char) - return 0x20; - } - --//! @todo Probably not right -+// TODO: Probably not right - // G3: Future Characters and Icon Expansion - unsigned char get_internal_from_G3 (unsigned char g3_char) - { -@@ -314,7 +314,7 @@ void rollupWindow(cc708_service_decoder *decoder, int window) - how many bytes would be consumed if these codes were supported, as defined in the specs. - Note: EXT1 not included */ - // C2: Extended Miscellaneous Control Codes --//! @todo This code is completely untested due to lack of samples. Just following specs! -+// TODO: This code is completely untested due to lack of samples. Just following specs! - int handle_708_C2 (cc708_service_decoder *decoder, unsigned char *data, int data_length) - { - if (data[0]<=0x07) // 00-07... -@@ -338,7 +338,7 @@ int handle_708_C3 (cc708_service_decoder *decoder, unsigned char *data, int data - - // These are variable length commands, that can even span several segments - // (they allow even downloading fonts or graphics). -- //! @todo Implemen if a sample ever appears -+ // TODO: Implemen if a sample ever appears - return 0; // Unreachable, but otherwise there's compilers warnings - } - -@@ -346,7 +346,7 @@ int handle_708_C3 (cc708_service_decoder *decoder, unsigned char *data, int data - // G2 (20-7F) => Mostly unmapped, except for a few characters. - // G3 (A0-FF) => A0 is the CC symbol, everything else reserved for future expansion in EIA708-B - // C2 (00-1F) => Reserved for future extended misc. control and captions command codes --//! @todo This code is completely untested due to lack of samples. Just following specs! -+// TODO: This code is completely untested due to lack of samples. Just following specs! - // Returns number of used bytes, usually 1 (since EXT1 is not counted). - int handle_708_extended_char (cc708_service_decoder *decoder, unsigned char *data, int data_length) - { -@@ -368,7 +368,7 @@ int handle_708_extended_char (cc708_service_decoder *decoder, unsigned char *dat - else if (code>=0x80 && code<=0x9F) - { - used=handle_708_C3 (decoder, data, data_length); -- //! @todo Something -+ // TODO: Something - } - // Group G3 - else -@@ -429,10 +429,10 @@ int handle_708_C0 (cc708_service_decoder *decoder, unsigned char *data, int data - process_cr (decoder); - break; - case 0x0e: // HCR (Horizontal Carriage Return) -- //! @todo Process HDR -+ // TODO: Process HDR - break; - case 0x0c: // FF (Form Feed) -- //! @todo Process FF -+ // TODO: Process FF - break; - } - len=1; -@@ -448,7 +448,7 @@ int handle_708_C0 (cc708_service_decoder *decoder, unsigned char *data, int data - // Only PE16 is defined. - if (data[0]==0x18) // PE16 - { -- ; //! @todo Handle PE16 -+ ; // TODO: Handle PE16 - } - len=3; - } -@@ -460,7 +460,7 @@ int handle_708_C0 (cc708_service_decoder *decoder, unsigned char *data, int data - { - return -1; - } -- //! @todo Do something useful eventually -+ // TODO: Do something useful eventually - return len; - } - -@@ -505,7 +505,7 @@ void process_character (cc708_service_decoder *decoder, unsigned char internal_c - // G0 - Code Set - ASCII printable characters - int handle_708_G0 (cc708_service_decoder *decoder, unsigned char *data, int data_length) - { -- //! @todo Substitution of the music note character for the ASCII DEL character -+ // TODO: Substitution of the music note character for the ASCII DEL character - unsigned char c=get_internal_from_G0 (data[0]); - process_character (decoder, c); - return 1; -@@ -603,7 +603,7 @@ void handle_708_HDW_HideWindows (cc708_service_decoder *decoder, int windows_bit - changes=1; - decoder->windows[i].visible=0; - } -- //! @todo Actually Hide Window -+ // TODO: Actually Hide Window - } - windows_bitmap>>=1; - } -@@ -672,7 +672,7 @@ void handle_708_DFx_DefineWindow (cc708_service_decoder *decoder, int window, un - { - // If the window is being created, all character positions in the window - // are set to the fill color... -- //! @todo COLORS -+ // TODO: COLORS - // ...and the pen location is set to (0,0) - decoder->windows[window].pen_column=0; - decoder->windows[window].pen_row=0; -@@ -687,7 +687,7 @@ void handle_708_DFx_DefineWindow (cc708_service_decoder *decoder, int window, un - decoder->current_window=-1; - for (int j=0;jwindows[window].rows[j]); -- return; //! @todo Warn somehow -+ return; // TODO: Warn somehow - } - } - decoder->windows[window].memory_reserved=1; -@@ -745,7 +745,7 @@ void deleteWindow (cc708_service_decoder *decoder, int window) - // or DefineWindow command. - decoder->current_window=-1; - } -- //! @todo Do the actual deletion (remove from display if needed, etc), mark as -+ // TODO: Do the actual deletion (remove from display if needed, etc), mark as - // not defined, etc - if (decoder->windows[window].is_defined) - { -@@ -843,13 +843,13 @@ void handle_708_SPL_SetPenLocation (cc708_service_decoder *decoder, unsigned cha - ------------------------------------------------------- */ - void handle_708_DLY_Delay (cc708_service_decoder *decoder, int tenths_of_sec) - { -- //! @todo Probably ask for the current FTS and wait for this time before resuming - -+ // TODO: Probably ask for the current FTS and wait for this time before resuming - - // not sure it's worth it though - } - - void handle_708_DLC_DelayCancel (cc708_service_decoder *decoder) - { -- //! @todo See above -+ // TODO: See above - } - - // C1 Code Set - Captioning Commands Control Codes -@@ -959,7 +959,7 @@ void process_service_block (cc708_service_decoder *decoder, unsigned char *data, - used=handle_708_G1 (decoder,data+i,data_length-i); - if (used==-1) - { -- //! @todo Not sure if a local reset is going to be helpful here. -+ // TODO: Not sure if a local reset is going to be helpful here. - cc708_service_reset (decoder); - return; - } -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -index ae0abee..392cb26 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.cpp -@@ -54,49 +54,12 @@ extern "C" { - #include - #include - #include --#include - - // amcodec include - extern "C" { - #include - } // extern "C" - --class PosixFile --{ --public: -- PosixFile() : -- m_fd(-1) -- { -- } -- -- PosixFile(int fd) : -- m_fd(fd) -- { -- } -- -- ~PosixFile() -- { -- if (m_fd >= 0) -- close(m_fd); -- } -- -- bool Open(const std::string &pathName, int flags) -- { -- m_fd = open(pathName.c_str(), flags); -- return m_fd >= 0; -- } -- -- int GetDescriptor() const { return m_fd; } -- -- int IOControl(unsigned long request, void *param) -- { -- return ioctl(m_fd, request, param); -- } -- --private: -- int m_fd; --}; -- - typedef struct { - bool noblock; - int video_pid; -@@ -401,6 +364,27 @@ void dumpfile_write(am_private_t *para, void* buf, int bufsiz) - write(para->dumpfile, buf, bufsiz); - } - -+/*************************************************************************/ -+/*************************************************************************/ -+static int64_t get_pts_video() -+{ -+ int fd = open("/sys/class/tsync/pts_video", O_RDONLY); -+ if (fd >= 0) -+ { -+ char pts_str[16]; -+ int size = read(fd, pts_str, sizeof(pts_str)); -+ close(fd); -+ if (size > 0) -+ { -+ unsigned long pts = strtoul(pts_str, NULL, 16); -+ return pts; -+ } -+ } -+ -+ CLog::Log(LOGERROR, "get_pts_video: open /tsync/event error"); -+ return -1; -+} -+ - static int set_pts_pcrscr(int64_t value) - { - int fd = open("/sys/class/tsync/pts_pcrscr", O_WRONLY); -@@ -1434,6 +1418,9 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - m_speed = DVD_PLAYSPEED_NORMAL; - m_1st_pts = 0; - m_cur_pts = 0; -+ m_player_pts = 0; -+ m_cur_pictcnt = 0; -+ m_old_pictcnt = 0; - m_dst_rect.SetRect(0, 0, 0, 0); - m_zoom = -1; - m_contrast = -1; -@@ -1443,12 +1430,6 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - m_start_pts = 0; - m_hints = hints; - -- if (!OpenAmlVideo(hints)) -- { -- CLog::Log(LOGERROR, "CAMLCodec::OpenDecoder - cannot open amlvideo device"); -- return false; -- } -- - ShowMainVideo(false); - - am_packet_init(&am_private->am_pkt); -@@ -1471,7 +1452,12 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - am_private->video_ratio64 = ((int64_t)video_ratio.num << 32) | video_ratio.den; - - // handle video rate -- if (hints.fpsrate > 0 && hints.fpsscale != 0) -+ if (hints.rfpsrate > 0 && hints.rfpsscale != 0) -+ { -+ // check ffmpeg r_frame_rate 1st -+ am_private->video_rate = 0.5 + (float)UNIT_FREQ * hints.rfpsscale / hints.rfpsrate; -+ } -+ else if (hints.fpsrate > 0 && hints.fpsscale != 0) - { - // then ffmpeg avg_frame_rate next - am_private->video_rate = 0.5 + (float)UNIT_FREQ * hints.fpsscale / hints.fpsrate; -@@ -1539,8 +1525,8 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder " - "hints.width(%d), hints.height(%d), hints.codec(%d), hints.codec_tag(%d)", - hints.width, hints.height, hints.codec, hints.codec_tag); -- CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.fpsrate(%d), hints.fpsscale(%d), video_rate(%d)", -- hints.fpsrate, hints.fpsscale, am_private->video_rate); -+ CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.fpsrate(%d), hints.fpsscale(%d), hints.rfpsrate(%d), hints.rfpsscale(%d), video_rate(%d)", -+ hints.fpsrate, hints.fpsscale, hints.rfpsrate, hints.rfpsscale, am_private->video_rate); - CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.aspect(%f), video_ratio.num(%d), video_ratio.den(%d)", - hints.aspect, video_ratio.num, video_ratio.den); - CLog::Log(LOGDEBUG, "CAMLCodec::OpenDecoder hints.orientation(%d), hints.forced_aspect(%d), hints.extrasize(%d)", -@@ -1631,7 +1617,7 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - am_private->dumpdemux = false; - dumpfile_open(am_private); - -- //! @bug make sure we are not stuck in pause (amcodec bug) -+ // make sure we are not stuck in pause (amcodec bug) - m_dll->codec_resume(&am_private->vcodec); - m_dll->codec_set_cntl_mode(&am_private->vcodec, TRICKMODE_NONE); - -@@ -1671,53 +1657,6 @@ bool CAMLCodec::OpenDecoder(CDVDStreamInfo &hints) - return true; - } - --bool CAMLCodec::OpenAmlVideo(const CDVDStreamInfo &hints) --{ -- PosixFilePtr amlVideoFile = std::make_shared(); -- if (!amlVideoFile->Open("/dev/video10", O_RDONLY | O_NONBLOCK)) -- { -- CLog::Log(LOGERROR, "CAMLCodec::OpenAmlVideo - cannot open V4L amlvideo device /dev/video10: %s", strerror(errno)); -- return false; -- } -- -- m_amlVideoFile = amlVideoFile; -- -- m_defaultVfmMap = GetVfmMap("default"); -- SetVfmMap("default", "decoder ppmgr deinterlace amlvideo amvideo"); -- -- SysfsUtils::SetInt("/sys/module/amlvideodri/parameters/freerun_mode", 1); -- -- return true; --} -- --std::string CAMLCodec::GetVfmMap(const std::string &name) --{ -- std::string vfmMap; -- SysfsUtils::GetString("/sys/class/vfm/map", vfmMap); -- std::vector sections = StringUtils::Split(vfmMap, '\n'); -- std::string sectionMap; -- for (size_t i = 0; i < sections.size(); ++i) -- { -- if (StringUtils::StartsWith(sections[i], name + " {")) -- { -- sectionMap = sections[i]; -- break; -- } -- } -- -- int openingBracePos = sectionMap.find('{') + 1; -- sectionMap = sectionMap.substr(openingBracePos, sectionMap.size() - openingBracePos - 1); -- StringUtils::Replace(sectionMap, "(0)", ""); -- -- return sectionMap; --} -- --void CAMLCodec::SetVfmMap(const std::string &name, const std::string &map) --{ -- SysfsUtils::SetString("/sys/class/vfm/map", "rm " + name); -- SysfsUtils::SetString("/sys/class/vfm/map", "add " + name + " " + map); --} -- - void CAMLCodec::CloseDecoder() - { - CLog::Log(LOGDEBUG, "CAMLCodec::CloseDecoder"); -@@ -1740,14 +1679,6 @@ void CAMLCodec::CloseDecoder() - SysfsUtils::SetInt("/sys/class/tsync/enable", 1); - - ShowMainVideo(false); -- -- CloseAmlVideo(); --} -- --void CAMLCodec::CloseAmlVideo() --{ -- m_amlVideoFile.reset(); -- SetVfmMap("default", m_defaultVfmMap); - } - - void CAMLCodec::Reset() -@@ -1785,7 +1716,8 @@ void CAMLCodec::Reset() - // reset some interal vars - m_1st_pts = 0; - m_cur_pts = 0; -- m_ptsQueue.clear(); -+ m_cur_pictcnt = 0; -+ m_old_pictcnt = 0; - SetSpeed(m_speed); - } - -@@ -1796,6 +1728,7 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts) - - if (pData) - { -+ m_player_pts = pts; - am_private->am_pkt.data = pData; - am_private->am_pkt.data_size = iSize; - -@@ -1816,6 +1749,7 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts) - if (am_private->am_pkt.avpts != (int64_t)AV_NOPTS_VALUE) - am_private->am_pkt.avpts -= m_start_pts; - -+ - // handle dts, including 31bit wrap, aml can only handle 31 - // bit dts as it uses an int in kernel. - if (dts == DVD_NOPTS_VALUE) -@@ -1872,22 +1806,28 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts) - if (iSize < 20) - target_timesize = 2.0; - -- int rtn = 0; -- - // keep hw buffered demux above 1 second -- if (GetTimeSize() < target_timesize) -- rtn |= VC_BUFFER; -+ if (GetTimeSize() < target_timesize && m_speed == DVD_PLAYSPEED_NORMAL) -+ return VC_BUFFER; - - // wait until we get a new frame or 25ms, -- if (m_ptsQueue.size() == 0) -+ if (m_old_pictcnt == m_cur_pictcnt) - m_ready_event.WaitMSec(25); - -- if (m_ptsQueue.size() > 0) -+ // we must return VC_BUFFER or VC_PICTURE, -+ // default to VC_BUFFER. -+ int rtn = VC_BUFFER; -+ m_player_pts = DVD_NOPTS_VALUE; -+ if (m_old_pictcnt != m_cur_pictcnt) - { -- CSingleLock lock(m_ptsQueueMutex); -- m_cur_pts = m_ptsQueue.front(); -- m_ptsQueue.pop_front(); -- rtn |= VC_PICTURE; -+ m_old_pictcnt++; -+ rtn = VC_PICTURE; -+ m_player_pts = pts; -+ // we got a new pict, try and keep hw buffered demux above 2 seconds. -+ // this, combined with the above 1 second check, keeps hw buffered demux between 1 and 2 seconds. -+ // we also check to make sure we keep from filling hw buffer. -+ if (GetTimeSize() < 2.0 && GetDataSize() < m_vbufsize/3) -+ rtn |= VC_BUFFER; - } - /* - CLog::Log(LOGDEBUG, "CAMLCodec::Decode: " -@@ -1897,36 +1837,6 @@ int CAMLCodec::Decode(uint8_t *pData, size_t iSize, double dts, double pts) - return rtn; - } - --int CAMLCodec::DequeueBuffer(int &pts) --{ -- v4l2_buffer vbuf = { 0 }; -- vbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; -- -- if (m_amlVideoFile->IOControl(VIDIOC_DQBUF, &vbuf) < 0) -- { -- if (errno != EAGAIN) -- CLog::Log(LOGERROR, "CAMLCodec::DequeueBuffer - VIDIOC_DQBUF failed: %s", strerror(errno)); -- return -errno; -- } -- -- // Since kernel 3.14 Amlogic changed length and units of PTS values reported here. -- // To differentiate such PTS values we check for existence of omx_pts_interval_lower -- // parameter, because it was introduced since kernel 3.14. -- if (access("/sys/module/amvideo/parameters/omx_pts_interval_lower", F_OK) != -1) -- { -- int64_t pts64 = vbuf.timestamp.tv_sec & 0xFFFFFFFF; -- pts64 <<= 32; -- pts64 += vbuf.timestamp.tv_usec & 0xFFFFFFFF; -- pts = (int)((pts64 * PTS_FREQ) / DVD_TIME_BASE); -- } -- else -- { -- pts = vbuf.timestamp.tv_usec; -- } -- -- return 0; --} -- - bool CAMLCodec::GetPicture(DVDVideoPicture *pDvdVideoPicture) - { - if (!m_opened) -@@ -1938,7 +1848,7 @@ bool CAMLCodec::GetPicture(DVDVideoPicture *pDvdVideoPicture) - - pDvdVideoPicture->dts = DVD_NOPTS_VALUE; - if (m_speed == DVD_PLAYSPEED_NORMAL) -- pDvdVideoPicture->pts = (double)m_cur_pts / PTS_FREQ * DVD_TIME_BASE; -+ pDvdVideoPicture->pts = m_player_pts; - else - { - if (m_cur_pts == 0) -@@ -2021,25 +1931,40 @@ void CAMLCodec::Process() - { - CLog::Log(LOGDEBUG, "CAMLCodec::Process Started"); - -+ // bump our priority to be level with SoftAE -+ SetPriority(THREAD_PRIORITY_ABOVE_NORMAL); - while (!m_bStop) - { -- if (m_dll->codec_poll_cntl(&am_private->vcodec) < 0) -+ int64_t pts_video = 0; -+ if (am_private->am_pkt.lastpts > 0) - { -- CLog::Log(LOGDEBUG, "CAMLCodec::Process: codec_poll_cntl failed"); -- Sleep(10); -- } -+ // this is a blocking poll that returns every vsync. -+ // since we are running at a higher priority, make sure -+ // we sleep if the call fails or does a timeout. -+ if (m_dll->codec_poll_cntl(&am_private->vcodec) < 0) -+ { -+ CLog::Log(LOGDEBUG, "CAMLCodec::Process: codec_poll_cntl failed"); -+ Sleep(10); -+ } - -- { -- CSingleLock lock(m_ptsQueueMutex); -- int pts = 0; -- if (DequeueBuffer(pts) == 0) -+ pts_video = get_pts_video(); -+ if (m_cur_pts != pts_video) - { -- m_ptsQueue.push_back(pts); -+ //CLog::Log(LOGDEBUG, "CAMLCodec::Process: pts_video(%lld), pts_video/PTS_FREQ(%f), duration(%f)", -+ // pts_video, (double)pts_video/PTS_FREQ, 1.0/((double)(pts_video - m_cur_pts)/PTS_FREQ)); -+ -+ // other threads look at these, do them first -+ m_cur_pts = pts_video; -+ m_cur_pictcnt++; - m_ready_event.Set(); - } - } -+ else -+ { -+ Sleep(100); -+ } - } -- -+ SetPriority(THREAD_PRIORITY_NORMAL); - CLog::Log(LOGDEBUG, "CAMLCodec::Process Stopped"); - } - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h -index 813b913..5b9ee4f 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h -@@ -25,15 +25,11 @@ - #include "guilib/Geometry.h" - #include "rendering/RenderSystem.h" - #include "threads/Thread.h" --#include - - typedef struct am_private_t am_private_t; - - class DllLibAmCodec; - --class PosixFile; --typedef std::shared_ptr PosixFilePtr; -- - class CAMLCodec : public CThread - { - public: -@@ -51,7 +47,6 @@ public: - int GetDataSize(); - double GetTimeSize(); - void SetVideoRect(const CRect &SrcRect, const CRect &DestRect); -- int64_t GetCurPts() const { return m_cur_pts; } - - protected: - virtual void Process(); -@@ -65,11 +60,6 @@ private: - void SetVideoSaturation(const int saturation); - void SetVideo3dMode(const int mode3d); - std::string GetStereoMode(); -- bool OpenAmlVideo(const CDVDStreamInfo &hints); -- void CloseAmlVideo(); -- std::string GetVfmMap(const std::string &name); -- void SetVfmMap(const std::string &name, const std::string &map); -- int DequeueBuffer(int &pts); - - DllLibAmCodec *m_dll; - bool m_opened; -@@ -78,6 +68,8 @@ private: - volatile int m_speed; - volatile int64_t m_1st_pts; - volatile int64_t m_cur_pts; -+ volatile int64_t m_cur_pictcnt; -+ volatile int64_t m_old_pictcnt; - volatile double m_timesize; - volatile int64_t m_vbufsize; - int64_t m_start_dts; -@@ -94,8 +86,5 @@ private: - int m_contrast; - int m_brightness; - -- PosixFilePtr m_amlVideoFile; -- std::string m_defaultVfmMap; -- std::deque m_ptsQueue; -- CCriticalSection m_ptsQueueMutex; -+ double m_player_pts; - }; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/CMakeLists.txt b/xbmc/cores/VideoPlayer/DVDCodecs/Video/CMakeLists.txt -index 491ee8a..be28f08 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/CMakeLists.txt -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/CMakeLists.txt -@@ -40,7 +40,7 @@ if(VAAPI_FOUND) - list(APPEND HEADERS VAAPI.h) - endif() - --if(APPLE) -+if(CORE_SYSTEM_NAME STREQUAL darwin OR CORE_SYSTEM_NAME STREQUAL ios) - list(APPEND SOURCES VTB.cpp) - list(APPEND HEADERS DllVideoToolBox.h - VTB.h) diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h index a2da9de..99d2bb3 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodec.h @@ -65888,167 +7998,6 @@ index a2da9de..99d2bb3 100644 protected: CProcessInfo &m_processInfo; }; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp -index 80f25dd..43ca555 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.cpp -@@ -91,7 +91,9 @@ bool CDVDVideoCodecAmlogic::Open(CDVDStreamInfo &hints, CDVDCodecOptions &option - m_mpeg2_sequence->width = m_hints.width; - m_mpeg2_sequence->height = m_hints.height; - m_mpeg2_sequence->ratio = m_hints.aspect; -- if (m_hints.fpsrate > 0 && m_hints.fpsscale != 0) -+ if (m_hints.rfpsrate > 0 && m_hints.rfpsscale != 0) -+ m_mpeg2_sequence->rate = (float)m_hints.rfpsrate / m_hints.rfpsscale; -+ else if (m_hints.fpsrate > 0 && m_hints.fpsscale != 0) - m_mpeg2_sequence->rate = (float)m_hints.fpsrate / m_hints.fpsscale; - else - m_mpeg2_sequence->rate = 1.0; -@@ -294,7 +296,7 @@ bool CDVDVideoCodecAmlogic::GetPicture(DVDVideoPicture* pDvdVideoPicture) - m_Codec->GetPicture(&m_videobuffer); - *pDvdVideoPicture = m_videobuffer; - -- CDVDAmlogicInfo* info = new CDVDAmlogicInfo(this, m_Codec, (int)m_Codec->GetCurPts()); -+ CDVDAmlogicInfo* info = new CDVDAmlogicInfo(this, m_Codec); - - { - CSingleLock lock(m_secure); -@@ -440,41 +442,43 @@ void CDVDVideoCodecAmlogic::FrameRateTracking(uint8_t *pData, int iSize, double - { - default: - case 0x01: -- m_hints.fpsrate = 24000.0; -- m_hints.fpsscale = 1001.0; -+ m_hints.rfpsrate = 24000.0; -+ m_hints.rfpsscale = 1001.0; - break; - case 0x02: -- m_hints.fpsrate = 24000.0; -- m_hints.fpsscale = 1000.0; -+ m_hints.rfpsrate = 24000.0; -+ m_hints.rfpsscale = 1000.0; - break; - case 0x03: -- m_hints.fpsrate = 25000.0; -- m_hints.fpsscale = 1000.0; -+ m_hints.rfpsrate = 25000.0; -+ m_hints.rfpsscale = 1000.0; - break; - case 0x04: -- m_hints.fpsrate = 30000.0; -- m_hints.fpsscale = 1001.0; -+ m_hints.rfpsrate = 30000.0; -+ m_hints.rfpsscale = 1001.0; - break; - case 0x05: -- m_hints.fpsrate = 30000.0; -- m_hints.fpsscale = 1000.0; -+ m_hints.rfpsrate = 30000.0; -+ m_hints.rfpsscale = 1000.0; - break; - case 0x06: -- m_hints.fpsrate = 50000.0; -- m_hints.fpsscale = 1000.0; -+ m_hints.rfpsrate = 50000.0; -+ m_hints.rfpsscale = 1000.0; - break; - case 0x07: -- m_hints.fpsrate = 60000.0; -- m_hints.fpsscale = 1001.0; -+ m_hints.rfpsrate = 60000.0; -+ m_hints.rfpsscale = 1001.0; - break; - case 0x08: -- m_hints.fpsrate = 60000.0; -- m_hints.fpsscale = 1000.0; -+ m_hints.rfpsrate = 60000.0; -+ m_hints.rfpsscale = 1000.0; - break; - } - m_hints.width = m_mpeg2_sequence->width; - m_hints.height = m_mpeg2_sequence->height; - m_hints.aspect = m_mpeg2_sequence->ratio; -+ m_hints.fpsrate = m_hints.rfpsrate; -+ m_hints.fpsscale = m_hints.rfpsscale; - } - return; - } -@@ -573,11 +577,10 @@ void CDVDVideoCodecAmlogic::RemoveInfo(CDVDAmlogicInfo *info) - m_inflight.erase(m_inflight.find(info)); - } - --CDVDAmlogicInfo::CDVDAmlogicInfo(CDVDVideoCodecAmlogic *codec, CAMLCodec *amlcodec, int omxPts) -+CDVDAmlogicInfo::CDVDAmlogicInfo(CDVDVideoCodecAmlogic *codec, CAMLCodec *amlcodec) - : m_refs(0) - , m_codec(codec) - , m_amlCodec(amlcodec) -- , m_omxPts(omxPts) - { - } - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h -index a4cc25c..c15238b 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecAmlogic.h -@@ -36,14 +36,13 @@ class CDVDVideoCodecAmlogic; - class CDVDAmlogicInfo - { - public: -- CDVDAmlogicInfo(CDVDVideoCodecAmlogic *codec, CAMLCodec *amlcodec, int omxPts); -+ CDVDAmlogicInfo(CDVDVideoCodecAmlogic *codec, CAMLCodec *amlcodec); - - // reference counting - CDVDAmlogicInfo* Retain(); - long Release(); - - CAMLCodec *getAmlCodec() const; -- int GetOmxPts() const { return m_omxPts; } - void invalidate(); - - protected: -@@ -52,7 +51,6 @@ protected: - - CDVDVideoCodecAmlogic* m_codec; - CAMLCodec* m_amlCodec; -- int m_omxPts; - }; - - class CDVDVideoCodecAmlogic : public CDVDVideoCodec -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -index 0414d85..86f476a 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp -@@ -28,7 +28,9 @@ - #include "DVDClock.h" - #include "DVDCodecs/DVDCodecs.h" - #include "DVDCodecs/DVDCodecUtils.h" -+#if defined(TARGET_POSIX) || defined(TARGET_WINDOWS) - #include "utils/CPUInfo.h" -+#endif - #include "settings/AdvancedSettings.h" - #include "settings/Settings.h" - #include "settings/VideoSettings.h" -@@ -300,9 +302,9 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options - } - else - { -- int num_threads = g_cpuInfo.getCPUCount() * 3 / 2; -- num_threads = std::max(1, std::min(num_threads, 16)); -- m_pCodecContext->thread_count = num_threads; -+ int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount()); -+ if( num_threads > 1) -+ m_pCodecContext->thread_count = num_threads; - m_pCodecContext->thread_safe_callbacks = 1; - m_decoderState = STATE_SW_MULTI; - CLog::Log(LOGDEBUG, "CDVDVideoCodecFFmpeg - open frame threaded with %d threads", num_threads); -@@ -334,7 +336,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options - } - - // advanced setting override for skip loop filter (see avcodec.h for valid options) -- //! @todo allow per video setting? -+ // TODO: allow per video setting? - if (g_advancedSettings.m_iSkipLoopFilter != 0) - { - m_pCodecContext->skip_loop_filter = (AVDiscard)g_advancedSettings.m_iSkipLoopFilter; diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp index e6f46c5..711b071 100644 --- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp @@ -69348,596 +11297,8 @@ index b0286e2..5b64310 100644 + std::string m_pFormatName; // Current decoder format name }; + -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp -index fd15bf5..47e2ecc 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/DVDVideoCodecOpenMax.cpp -@@ -192,7 +192,7 @@ bool CDVDVideoCodecOpenMax::GetPicture(DVDVideoPicture* pDvdVideoPicture) - m_omx_decoder->GetPicture(&m_videobuffer); - *pDvdVideoPicture = m_videobuffer; - -- //! @todo what's going on here? bool is required as return value. -+ // TODO what's going on here? bool is required as return value. - return VC_PICTURE | VC_BUFFER; - } - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -index 3d026cd..dbc24af 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.cpp -@@ -51,12 +51,10 @@ using namespace KODI::MESSAGING; - - #define CLASSNAME "CMMALVideoBuffer" - --#define VERBOSE 0 -- - CMMALVideoBuffer::CMMALVideoBuffer(CMMALVideo *omv) - : m_omv(omv) - { -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - mmal_buffer = NULL; - m_width = 0; -@@ -71,7 +69,7 @@ CMMALVideoBuffer::~CMMALVideoBuffer() - { - if (mmal_buffer) - mmal_buffer_header_release(mmal_buffer); -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, this); - } - -@@ -108,7 +106,6 @@ CMMALVideo::CMMALVideo(CProcessInfo &processInfo) : CDVDVideoCodec(processInfo) - m_codingType = 0; - - m_es_format = mmal_format_alloc(); -- m_preroll = true; - m_speed = DVD_PLAYSPEED_NORMAL; - m_fps = 0.0f; - m_num_decoded = 0; -@@ -220,8 +217,6 @@ void CMMALVideo::dec_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buff - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s port:%p buffer %p, len %d cmd:%x", CLASSNAME, __func__, port, buffer, buffer->length, buffer->cmd); - mmal_buffer_header_release(buffer); -- CSingleLock lock(m_output_mutex); -- m_output_cond.notifyAll(); - } - - static void dec_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer) -@@ -729,7 +724,6 @@ bool CMMALVideo::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) - return false; - - Prime(); -- m_preroll = !m_hints.stills; - m_speed = DVD_PLAYSPEED_NORMAL; - - return true; -@@ -847,12 +841,9 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - bool full = queued > DVD_MSEC_TO_TIME(1000); - int ret = 0; - -- unsigned int pics = m_output_ready.size(); -- if (m_preroll && (pics >= GetAllowedReferences() || m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)) -- m_preroll = false; -- if (pics > 0 && !m_preroll) -+ if (!m_output_ready.empty()) - ret |= VC_PICTURE; -- if ((m_preroll || pics <= 1) && mmal_queue_length(m_dec_input_pool->queue) > 0 && !(m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)) -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !(m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)) - ret |= VC_BUFFER; - - bool slept = false; -@@ -861,22 +852,20 @@ int CMMALVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - slept = true; - { - // otherwise we busy spin -- lock.Leave(); -- CSingleLock output_lock(m_output_mutex); -- m_output_cond.wait(output_lock, 30); -- lock.Enter(); -+ CSingleExit unlock(m_sharedSection); -+ CSingleLock lock(m_output_mutex); -+ m_output_cond.wait(lock, 30); - } -- unsigned int pics = m_output_ready.size(); -- if (m_preroll && (pics >= GetAllowedReferences() || m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)) -- m_preroll = false; -- if (pics > 0 && !m_preroll) -+ if (!m_output_ready.empty()) - ret |= VC_PICTURE; -- if ((m_preroll || pics <= 1) && (mmal_queue_length(m_dec_input_pool->queue) > 0 || m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)) -+ if (mmal_queue_length(m_dec_input_pool->queue) > 0 && !(m_codecControlFlags & DVD_CODEC_CTRL_DRAIN)) -+ ret |= VC_BUFFER; -+ else if (m_codecControlFlags & DVD_CODEC_CTRL_DRAIN && !ret) - ret |= VC_BUFFER; - } - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d) flags(%x) preroll(%d)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full, m_codecControlFlags, m_preroll); -+ CLog::Log(LOGDEBUG, "%s::%s - ret(%x) pics(%d) inputs(%d) slept(%d) queued(%.2f) (%.2f:%.2f) full(%d) flags(%x)", CLASSNAME, __func__, ret, m_output_ready.size(), mmal_queue_length(m_dec_input_pool->queue), slept, queued*1e-6, m_demuxerPts*1e-6, m_decoderPts*1e-6, full, m_codecControlFlags); - - return ret; - } -@@ -885,12 +874,9 @@ void CMMALVideo::Prime() - { - MMAL_BUFFER_HEADER_T *buffer; - assert(m_renderer); -- if (!m_pool) -- m_pool = m_renderer->GetPool(RENDER_FMT_MMAL, AV_PIX_FMT_YUV420P, true); -- assert(m_pool); -- MMAL_POOL_T *render_pool = m_pool->Get(); -+ MMAL_POOL_T *render_pool = m_renderer->GetPool(RENDER_FMT_MMAL, true); - assert(render_pool); -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - queue(%p)", CLASSNAME, __func__, render_pool); - while (buffer = mmal_queue_get(render_pool->queue), buffer) - Recycle(buffer); -@@ -949,7 +935,6 @@ void CMMALVideo::Reset(void) - m_demuxerPts = DVD_NOPTS_VALUE; - m_codecControlFlags = 0; - m_dropState = false; -- m_preroll = !m_hints.stills && (m_speed == DVD_PLAYSPEED_NORMAL || m_speed == DVD_PLAYSPEED_PAUSE); - } - - void CMMALVideo::SetSpeed(int iSpeed) -@@ -963,7 +948,7 @@ void CMMALVideo::SetSpeed(int iSpeed) - void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - { - CSingleLock lock(m_sharedSection); -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s %p", CLASSNAME, __func__, buffer); - - if (m_finished) -@@ -975,7 +960,7 @@ void CMMALVideo::Recycle(MMAL_BUFFER_HEADER_T *buffer) - MMAL_STATUS_T status; - mmal_buffer_header_reset(buffer); - buffer->cmd = 0; -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s Send buffer %p from pool to decoder output port %p ready_queue(%d)", CLASSNAME, __func__, buffer, m_dec_output, - m_output_ready.size()); - status = mmal_port_send_buffer(m_dec_output, buffer); -@@ -1022,8 +1007,8 @@ bool CMMALVideo::GetPicture(DVDVideoPicture* pDvdVideoPicture) - } - - // timestamp is in microseconds -- pDvdVideoPicture->dts = buffer->mmal_buffer->dts == MMAL_TIME_UNKNOWN ? DVD_NOPTS_VALUE : buffer->mmal_buffer->dts; -- pDvdVideoPicture->pts = buffer->mmal_buffer->pts == MMAL_TIME_UNKNOWN ? DVD_NOPTS_VALUE : buffer->mmal_buffer->pts; -+ pDvdVideoPicture->dts = buffer->mmal_buffer->dts == MMAL_TIME_UNKNOWN || buffer->mmal_buffer->dts == 0 ? DVD_NOPTS_VALUE : buffer->mmal_buffer->dts; -+ pDvdVideoPicture->pts = buffer->mmal_buffer->pts == MMAL_TIME_UNKNOWN || buffer->mmal_buffer->pts == 0 ? DVD_NOPTS_VALUE : buffer->mmal_buffer->pts; - - pDvdVideoPicture->MMALBuffer->Acquire(); - pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; -@@ -1049,9 +1034,9 @@ bool CMMALVideo::ClearPicture(DVDVideoPicture* pDvdVideoPicture) - CSingleLock lock(m_sharedSection); - if (pDvdVideoPicture->format == RENDER_FMT_MMAL) - { -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - %p (%p)", CLASSNAME, __func__, pDvdVideoPicture->MMALBuffer, pDvdVideoPicture->MMALBuffer->mmal_buffer); -- SAFE_RELEASE(pDvdVideoPicture->MMALBuffer); -+ pDvdVideoPicture->MMALBuffer->Release(); - } - memset(pDvdVideoPicture, 0, sizeof *pDvdVideoPicture); - return true; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -index d008c6c..a84d4b3 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALCodec.h -@@ -57,7 +57,6 @@ public: - - class CMMALVideo; - class CMMALRenderer; --class CMMALPool; - - // a mmal video frame - class CMMALVideoBuffer : public CMMALBuffer -@@ -133,7 +132,6 @@ protected: - int m_speed; - int m_codecControlFlags; - bool m_dropState; -- bool m_preroll; - - CCriticalSection m_sharedSection; - MMAL_COMPONENT_T *m_dec; -@@ -141,7 +139,6 @@ protected: - MMAL_PORT_T *m_dec_output; - MMAL_POOL_T *m_dec_input_pool; - CMMALRenderer *m_renderer; -- std::shared_ptr m_pool; - - MMAL_ES_FORMAT_T *m_es_format; - MMAL_COMPONENT_T *m_deint; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -index 3825e4c..6d7b0a0 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.cpp -@@ -45,7 +45,6 @@ using namespace MMAL; - CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *dec, unsigned int width, unsigned int height, unsigned int aligned_width, unsigned int aligned_height) - : m_dec(dec) - { -- unsigned int size_pic = 0; - dec->Acquire(); - m_width = width; - m_height = height; -@@ -53,13 +52,7 @@ CMMALYUVBuffer::CMMALYUVBuffer(CDecoder *dec, unsigned int width, unsigned int h - m_aligned_height = aligned_height; - m_aspect_ratio = 0.0f; - mmal_buffer = nullptr; -- if (dec->m_fmt == AV_PIX_FMT_YUV420P) -- size_pic = (m_aligned_width * m_aligned_height * 3) >> 1; -- else if (dec->m_fmt == AV_PIX_FMT_BGR0) -- size_pic = (m_aligned_width << 2) * m_aligned_height; -- else if (dec->m_fmt == AV_PIX_FMT_RGB565LE) -- size_pic = (m_aligned_width << 1) * m_aligned_height; -- else assert(0); -+ unsigned int size_pic = (m_aligned_width * m_aligned_height * 3) >> 1; - gmem = m_dec->AllocateBuffer(size_pic); - if (gmem) - gmem->m_opaque = (void *)this; -@@ -89,8 +82,6 @@ CGPUMEM *CDecoder::AllocateBuffer(unsigned int size_pic) - m_freeBuffers.pop_front(); - if (gmem->m_numbytes == size_pic) - return gmem; -- if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s discarding gmem:%p size %d/%d", CLASSNAME, __FUNCTION__, gmem, gmem->m_numbytes, size_pic); - delete gmem; - } - -@@ -102,7 +93,6 @@ CGPUMEM *CDecoder::AllocateBuffer(unsigned int size_pic) - - void CDecoder::ReleaseBuffer(CGPUMEM *gmem) - { -- CSingleLock lock(m_section); - if (m_closing) - delete gmem; - else -@@ -209,9 +199,9 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *frame, int flags) - CDVDVideoCodecFFmpeg *ctx = (CDVDVideoCodecFFmpeg*)avctx->opaque; - CDecoder *dec = (CDecoder*)ctx->GetHardware(); - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG,"%s::%s %dx%d format:%x:%x flags:%x", CLASSNAME, __FUNCTION__, frame->width, frame->height, frame->format, dec->m_fmt, flags); -+ CLog::Log(LOGDEBUG,"%s::%s %dx%d format:%x flags:%x", CLASSNAME, __FUNCTION__, frame->width, frame->height, frame->format, flags); - -- if ((avctx->codec && (avctx->codec->capabilities & AV_CODEC_CAP_DR1) == 0) || frame->format != dec->m_fmt) -+ if ((avctx->codec->capabilities & AV_CODEC_CAP_DR1) == 0 || frame->format != AV_PIX_FMT_YUV420P) - { - assert(0); - return avcodec_default_get_buffer2(avctx, frame, flags); -@@ -237,29 +227,13 @@ int CDecoder::FFGetBuffer(AVCodecContext *avctx, AVFrame *frame, int flags) - frame->linesize[i] = 0; - } - -- if (dec->m_fmt == AV_PIX_FMT_YUV420P) -- { -- frame->buf[0] = buf; -- frame->linesize[0] = YUVBuffer->m_aligned_width; -- frame->linesize[1] = YUVBuffer->m_aligned_width>>1; -- frame->linesize[2] = YUVBuffer->m_aligned_width>>1; -- frame->data[0] = (uint8_t *)gmem->m_arm; -- frame->data[1] = frame->data[0] + YUVBuffer->m_aligned_width * YUVBuffer->m_aligned_height; -- frame->data[2] = frame->data[1] + (YUVBuffer->m_aligned_width>>1) * (YUVBuffer->m_aligned_height>>1); -- } -- else if (dec->m_fmt == AV_PIX_FMT_BGR0) -- { -- frame->buf[0] = buf; -- frame->linesize[0] = YUVBuffer->m_aligned_width << 2; -- frame->data[0] = (uint8_t *)gmem->m_arm; -- } -- else if (dec->m_fmt == AV_PIX_FMT_RGB565LE) -- { -- frame->buf[0] = buf; -- frame->linesize[0] = YUVBuffer->m_aligned_width << 1; -- frame->data[0] = (uint8_t *)gmem->m_arm; -- } -- else assert(0); -+ frame->buf[0] = buf; -+ frame->linesize[0] = YUVBuffer->m_aligned_width; -+ frame->linesize[1] = YUVBuffer->m_aligned_width>>1; -+ frame->linesize[2] = YUVBuffer->m_aligned_width>>1; -+ frame->data[0] = (uint8_t *)gmem->m_arm; -+ frame->data[1] = frame->data[0] + YUVBuffer->m_aligned_width * YUVBuffer->m_aligned_height; -+ frame->data[2] = frame->data[1] + (YUVBuffer->m_aligned_width>>1) * (YUVBuffer->m_aligned_height>>1); - frame->extended_data = frame->data; - // Leave extended buf alone - -@@ -289,7 +263,6 @@ bool CDecoder::Open(AVCodecContext *avctx, AVCodecContext* mainctx, enum AVPixel - mainctx->get_buffer2 = CDecoder::FFGetBuffer; - - m_avctx = mainctx; -- m_fmt = fmt; - return true; - } - -@@ -307,11 +280,7 @@ int CDecoder::Decode(AVCodecContext* avctx, AVFrame* frame) - - MMAL_BUFFER_HEADER_T *CDecoder::GetMmal() - { -- if (!m_pool) -- m_pool = m_renderer->GetPool(RENDER_FMT_MMAL, m_fmt, false); -- -- assert(m_pool); -- MMAL_POOL_T *render_pool = m_pool->Get(); -+ MMAL_POOL_T *render_pool = m_renderer->GetPool(RENDER_FMT_MMAL, false); - assert(render_pool); - MMAL_BUFFER_HEADER_T *mmal_buffer = mmal_queue_timedwait(render_pool->queue, 500); - if (!mmal_buffer) -@@ -334,8 +303,7 @@ bool CDecoder::GetPicture(AVCodecContext* avctx, AVFrame* frame, DVDVideoPicture - if (!ret) - return false; - -- if ((frame->format != AV_PIX_FMT_YUV420P && frame->format != AV_PIX_FMT_BGR0 && frame->format != AV_PIX_FMT_RGB565LE) || -- frame->buf[1] != nullptr || frame->buf[0] == nullptr) -+ if (frame->format != AV_PIX_FMT_YUV420P || frame->buf[1] != nullptr || frame->buf[0] == nullptr) - return false; - - MMAL_BUFFER_HEADER_T *mmal_buffer = GetMmal(); -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -index e0ae5ed..a2c3555 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/MMALFFmpeg.h -@@ -27,7 +27,6 @@ - #include "MMALCodec.h" - - class CMMALRenderer; --class CMMALPool; - struct MMAL_BUFFER_HEADER_T; - class CGPUMEM; - -@@ -70,14 +69,12 @@ public: - CGPUMEM *AllocateBuffer(unsigned int numbytes); - void ReleaseBuffer(CGPUMEM *gmem); - unsigned sizeFree() { return m_freeBuffers.size(); } -- enum AVPixelFormat m_fmt; - protected: - MMAL_BUFFER_HEADER_T *GetMmal(); - AVCodecContext *m_avctx; - unsigned int m_shared; - CCriticalSection m_section; - CMMALRenderer *m_renderer; -- std::shared_ptr m_pool; - std::deque m_freeBuffers; - bool m_closing; - }; -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMax.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMax.h -index ef6da1b..a659191 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMax.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMax.h -@@ -26,8 +26,6 @@ - #include "threads/Event.h" - - #include --#include --#include - #include - #include - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.cpp b/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.cpp -index 3d5744b..420831e 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.cpp -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.cpp -@@ -55,8 +55,8 @@ using namespace KODI::MESSAGING; - - #define CLASSNAME "COpenMaxVideo" - --//! @todo These are Nvidia Tegra2 dependent, need to dynamiclly find the --//! right codec matched to video format. -+// TODO: These are Nvidia Tegra2 dependent, need to dynamiclly find the -+// right codec matched to video format. - #define OMX_H264BASE_DECODER "OMX.Nvidia.h264.decode" - // OMX.Nvidia.h264ext.decode segfaults, not sure why. - //#define OMX_H264MAIN_DECODER "OMX.Nvidia.h264ext.decode" -@@ -95,6 +95,8 @@ do \ - (a).nVersion.s.nRevision = OMX_VERSION_REVISION; \ - (a).nVersion.s.nStep = OMX_VERSION_STEP - -+#undef OMX_DEBUG_VERBOSE -+ - pthread_mutex_t m_omx_queue_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; - - COpenMaxVideo::COpenMaxVideo() -@@ -168,7 +170,7 @@ bool COpenMaxVideo::Open(CDVDStreamInfo &hints) - decoder_name = OMX_MPEG4_DECODER; - break; - /* -- @todo what mpeg4 formats are "ext" ???? -+ TODO: what mpeg4 formats are "ext" ???? - case NvxStreamType_MPEG4Ext: - // (role name) video_decoder.mpeg4 - // MPEG-4, DivX 4/5 and Xvid compatible -@@ -197,9 +199,9 @@ bool COpenMaxVideo::Open(CDVDStreamInfo &hints) - return false; - } - -- //! @todo Find component from role name. -- //! Get the port information. This will obtain information about the -- //! number of ports and index of the first port. -+ // TODO: Find component from role name. -+ // Get the port information. This will obtain information about the -+ // number of ports and index of the first port. - OMX_PORT_PARAM_TYPE port_param; - OMX_INIT_STRUCTURE(port_param); - omx_err = OMX_GetParameter(m_omx_decoder, OMX_IndexParamVideoInit, &port_param); -@@ -216,7 +218,7 @@ bool COpenMaxVideo::Open(CDVDStreamInfo &hints) - CLASSNAME, __func__, m_omx_decoder, m_omx_input_port, m_omx_output_port); - #endif - -- //! @todo Set role for the component because components could have multiple roles. -+ // TODO: Set role for the component because components could have multiple roles. - //QueryCodec(); - - // Component will be in OMX_StateLoaded now so we can alloc omx input/output buffers. -@@ -357,7 +359,7 @@ int COpenMaxVideo::Decode(uint8_t* pData, int iSize, double dts, double pts) - demux_packet.pts = pts; - - demux_packet.size = demuxer_bytes; -- //! @todo memory leak? where does this memory get does get freed? -+ // TODO memory leak? where does this memory get does get freed? - demux_packet.buff = new OMX_U8[demuxer_bytes]; - memcpy(demux_packet.buff, demuxer_content, demuxer_bytes); - -@@ -422,7 +424,7 @@ void COpenMaxVideo::Reset(void) - - StartDecoder(); - -- //! @todo error checking? -+ // TODO error checking? - } - ::Sleep(100); - } -@@ -441,7 +443,7 @@ void COpenMaxVideo::ReleaseBuffer(OpenMaxVideoBuffer* releaseBuffer) - if (!releaseBuffer) - return; - -- //! @todo this is NOT multithreading safe. Buffer lifetime managment needs to be adopted. -+ // TODO this is NOT multithreading safe. Buffer lifetime managment needs to be adopted. - - pthread_mutex_lock(&m_omx_queue_mutex); - OpenMaxVideoBuffer *buffer = releaseBuffer; -@@ -1211,7 +1213,7 @@ void OpenMaxVideoBuffer::ReleaseTexture() - DeleteImageInfo *deleteInfo = new DeleteImageInfo; - - // add egl resources to deletion info -- //! @todo delete from constructor! -+ // TODO delete from constructor! - deleteInfo->egl_image = egl_image; - deleteInfo->egl_sync = eglSync; - deleteInfo->texture_id = texture_id; -@@ -1222,7 +1224,7 @@ void OpenMaxVideoBuffer::ReleaseTexture() - } - else - { -- //! @todo put the callbackData pointer into userptr so that it can be delete afterwards -+ // TODO put the callbackData pointer into userptr so that it can be delete afterwards - deleteInfo->callback.callback = &OpenMaxDeleteTextures; - deleteInfo->callback.userptr = (void *)deleteInfo; - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.h -index cf569c0..a235a01 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/OpenMaxVideo.h -@@ -20,8 +20,6 @@ - */ - - #if defined(HAVE_LIBOPENMAX) --#include --#include - - #include "OpenMax.h" - #include -@@ -116,7 +114,7 @@ protected: - static void CallbackAllocOMXEGLTextures(void*); - OMX_ERRORTYPE AllocOMXOutputEGLTextures(void); - -- //! @todo Those should move into the base class. After start actions can be executed by callbacks. -+ // TODO Those should move into the base class. After start actions can be executed by callbacks. - OMX_ERRORTYPE StartDecoder(void); - OMX_ERRORTYPE StopDecoder(void); - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h -index cc744c7..6f74a72 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VAAPI.h -@@ -37,7 +37,6 @@ - #include - #include - #include --#include - #include - #include "linux/sse4/DllLibSSE4.h" - -diff --git a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h -index 56601a1..8cc4683 100644 ---- a/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h -+++ b/xbmc/cores/VideoPlayer/DVDCodecs/Video/VDPAU.h -@@ -57,10 +57,8 @@ - #include "threads/Thread.h" - #include "utils/ActorProtocol.h" - #include "guilib/Geometry.h" --#include - #include - #include --#include - - extern "C" { - #include "libavutil/avutil.h" -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h -index 23cd50c..7d778e6 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemux.h -@@ -148,6 +148,8 @@ public: - { - iFpsScale = 0; - iFpsRate = 0; -+ irFpsScale = 0; -+ irFpsRate = 0; - iHeight = 0; - iWidth = 0; - fAspect = 0.0; -@@ -162,6 +164,8 @@ public: - virtual ~CDemuxStreamVideo() {} - int iFpsScale; // scale of 1000 and a rate of 29970 will result in 29.97 fps - int iFpsRate; -+ int irFpsScale; -+ int irFpsRate; - int iHeight; // height of the stream reported by the demuxer - int iWidth; // width of the stream reported by the demuxer - float fAspect; // display aspect of stream -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp -index ec96daf..041fd8a 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.cpp -@@ -383,7 +383,6 @@ void CDVDDemuxClient::RequestStreams() - streamAudio->iBitsPerSample = source->iBitsPerSample; - if (source->ExtraSize > 0 && source->ExtraData) - { -- delete[] streamAudio->ExtraData; - streamAudio->ExtraData = new uint8_t[source->ExtraSize]; - streamAudio->ExtraSize = source->ExtraSize; - for (unsigned int j=0; jExtraSize; j++) -@@ -417,15 +416,14 @@ void CDVDDemuxClient::RequestStreams() - streamVideo->m_parser->flags |= PARSER_FLAG_COMPLETE_FRAMES; - } - -- streamVideo->iFpsScale = source->iFpsScale; -- streamVideo->iFpsRate = source->iFpsRate; -+ streamVideo->iFpsScale = source->irFpsScale; -+ streamVideo->iFpsRate = source->irFpsRate; - streamVideo->iHeight = source->iHeight; - streamVideo->iWidth = source->iWidth; - streamVideo->fAspect = source->fAspect; - streamVideo->stereo_mode = "mono"; - if (source->ExtraSize > 0 && source->ExtraData) - { -- delete[] streamVideo->ExtraData; - streamVideo->ExtraData = new uint8_t[source->ExtraSize]; - streamVideo->ExtraSize = source->ExtraSize; - for (unsigned int j=0; jExtraSize; j++) -@@ -460,7 +458,6 @@ void CDVDDemuxClient::RequestStreams() - - if (source->ExtraSize == 4) - { -- delete[] streamSubtitle->ExtraData; - streamSubtitle->ExtraData = new uint8_t[4]; - streamSubtitle->ExtraSize = 4; - for (int j=0; j<4; j++) -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.h b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.h -index af6a599..e6c9bfd 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.h -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxClient.h -@@ -21,7 +21,6 @@ - - #include "DVDDemux.h" - #include --#include - - extern "C" { - #include "libavcodec/avcodec.h" diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp -index b76e248..fd041c1 100644 +index f37a2ea..fd041c1 100644 --- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxFFmpeg.cpp @@ -419,7 +419,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput, bool streaminfo, bool filein @@ -69949,924 +11310,11 @@ index b76e248..fd041c1 100644 m_checkvideo = true; skipCreateStreams = true; } -@@ -1228,9 +1228,21 @@ CDemuxStream* CDVDDemuxFFmpeg::AddStream(int streamIdx) - st->iFpsScale = 0; - } - -- if (pStream->codec_info_nb_frames > 0 && -- pStream->codec_info_nb_frames <= 2 && -- m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD)) -+ // added for aml hw decoder, mkv frame-rate can be wrong. -+ if (r_frame_rate.den && r_frame_rate.num) -+ { -+ st->irFpsRate = r_frame_rate.num; -+ st->irFpsScale = r_frame_rate.den; -+ } -+ else -+ { -+ st->irFpsRate = 0; -+ st->irFpsScale = 0; -+ } -+ -+ if (pStream->codec_info_nb_frames > 0 -+ && pStream->codec_info_nb_frames <= 2 -+ && m_pInput->IsStreamType(DVDSTREAM_TYPE_DVD)) - { - CLog::Log(LOGDEBUG, "%s - fps may be unreliable since ffmpeg decoded only %d frame(s)", __FUNCTION__, pStream->codec_info_nb_frames); - st->iFpsRate = 0; -diff --git a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp -index 807ad89..84c3276 100644 ---- a/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp -+++ b/xbmc/cores/VideoPlayer/DVDDemuxers/DVDFactoryDemuxer.cpp -@@ -30,8 +30,7 @@ - #include "DVDDemuxClient.h" - #include "DemuxMultiSource.h" - #include "pvr/PVRManager.h" --#include "utils/log.h" --#include "utils/URIUtils.h" -+#include "pvr/addons/PVRClients.h" - - using namespace PVR; - -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/CMakeLists.txt b/xbmc/cores/VideoPlayer/DVDInputStreams/CMakeLists.txt -index 9de5f14..70d4153 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/CMakeLists.txt -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/CMakeLists.txt -@@ -5,6 +5,7 @@ set(SOURCES DVDFactoryInputStream.cpp - DVDInputStreamMemory.cpp - DVDInputStreamNavigator.cpp - DVDInputStreamPVRManager.cpp -+ DVDInputStreamRTMP.cpp - DVDInputStreamStack.cpp - DVDStateSerializer.cpp - InputStreamAddon.cpp -@@ -17,9 +18,11 @@ set(HEADERS DVDFactoryInputStream.h - DVDInputStreamMemory.h - DVDInputStreamNavigator.h - DVDInputStreamPVRManager.h -+ DVDInputStreamRTMP.h - DVDInputStreamStack.h - DVDStateSerializer.h - DllDvdNav.h -+ DllLibRTMP.h - InputStreamAddon.h - InputStreamMultiStreams.h - InputStreamMultiSource.h) -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp -index fc782b2..bbb1fc3 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.cpp -@@ -25,6 +25,7 @@ - #include "DVDInputStreamNavigator.h" - #include "DVDInputStreamFFmpeg.h" - #include "DVDInputStreamPVRManager.h" -+#include "DVDInputStreamRTMP.h" - #include "InputStreamAddon.h" - #include "InputStreamMultiSource.h" - #ifdef HAVE_LIBBLURAY -@@ -76,10 +77,6 @@ CDVDInputStream* CDVDFactoryInputStream::CreateInputStream(IVideoPlayer* pPlayer - ADDON_STATUS status = addon->Create(); - if (status == ADDON_STATUS_OK) - { -- unsigned int videoWidth, videoHeight; -- pPlayer->GetVideoResolution(videoWidth, videoHeight); -- addon->SetVideoResolution(videoWidth, videoHeight); -- - return new CInputStreamAddon(fileitem, addon); - } - } -@@ -131,6 +128,14 @@ CDVDInputStream* CDVDFactoryInputStream::CreateInputStream(IVideoPlayer* pPlayer - else if(file.substr(0, 8) == "stack://") - return new CDVDInputStreamStack(fileitem); - #endif -+#ifdef HAS_LIBRTMP -+ else if(file.substr(0, 7) == "rtmp://" -+ || file.substr(0, 8) == "rtmpt://" -+ || file.substr(0, 8) == "rtmpe://" -+ || file.substr(0, 9) == "rtmpte://" -+ || file.substr(0, 8) == "rtmps://") -+ return new CDVDInputStreamRTMP(fileitem); -+#endif - else if (fileitem.IsInternetStream()) - { - if (fileitem.IsType(".m3u8")) -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.h -index 65e57e7..2f2b43e 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.h -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDFactoryInputStream.h -@@ -21,8 +21,6 @@ - */ - - #include --#include -- - #include "FileItem.h" - - class CDVDInputStream; -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h -index 1049855..4807012 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStream.h -@@ -38,6 +38,7 @@ enum DVDStreamType - DVDSTREAM_TYPE_MEMORY = 4, - DVDSTREAM_TYPE_FFMPEG = 5, - DVDSTREAM_TYPE_TV = 6, -+ DVDSTREAM_TYPE_RTMP = 7, - DVDSTREAM_TYPE_MPLS = 10, - DVDSTREAM_TYPE_BLURAY = 11, - DVDSTREAM_TYPE_PVRMANAGER = 12, -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp -index 6ccd9a8..f37668e 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamBluray.cpp -@@ -78,7 +78,7 @@ int DllLibbluray::file_eof(BD_FILE_H *file) - - int64_t DllLibbluray::file_read(BD_FILE_H *file, uint8_t *buf, int64_t size) - { -- return static_cast(file->internal)->Read(buf, size); //! @todo fix size cast -+ return static_cast(file->internal)->Read(buf, size); // TODO: fix size cast - } - - int64_t DllLibbluray::file_write(BD_FILE_H *file, const uint8_t *buf, int64_t size) -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.cpp -index df78857..ec03c9d 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.cpp -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.cpp -@@ -29,7 +29,6 @@ - #include "pvr/addons/PVRClients.h" - #include "pvr/channels/PVRChannelGroupsContainer.h" - #include "pvr/recordings/PVRRecordingsPath.h" --#include "pvr/recordings/PVRRecordings.h" - #include "settings/Settings.h" - #include "cores/VideoPlayer/DVDDemuxers/DVDDemux.h" - -@@ -419,9 +418,9 @@ bool CDVDInputStreamPVRManager::IsRecording() - return g_PVRClients->IsRecordingOnPlayingChannel(); - } - --void CDVDInputStreamPVRManager::Record(bool bOnOff) -+bool CDVDInputStreamPVRManager::Record(bool bOnOff) - { -- g_PVRManager.StartRecordingOnPlayingChannel(bOnOff); -+ return g_PVRManager.StartRecordingOnPlayingChannel(bOnOff); - } - - bool CDVDInputStreamPVRManager::CanPause() -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h -index a86b5a8..d037b19 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamPVRManager.h -@@ -70,7 +70,7 @@ public: - - bool CanRecord(); - bool IsRecording(); -- void Record(bool bOnOff); -+ bool Record(bool bOnOff); - bool CanSeek() override; - bool CanPause() override; - void Pause(bool bPaused); -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp -new file mode 100644 -index 0000000..9a4b889 ---- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.cpp -@@ -0,0 +1,265 @@ -+/* -+ * Copyright (C) 2005-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) -+ #include "config.h" -+#endif -+#ifdef TARGET_WINDOWS -+#include "system.h" // just for HAS_LIBRTMP -+#endif -+ -+#ifdef HAS_LIBRTMP -+#include "settings/AdvancedSettings.h" -+#include "DVDInputStreamRTMP.h" -+#include "threads/SingleLock.h" -+#include "utils/log.h" -+#include "utils/Variant.h" -+ -+#include -+ -+using namespace XFILE; -+ -+static int RTMP_level=0; -+extern "C" -+{ -+ static void CDVDInputStreamRTMP_Log(int level, const char *fmt, va_list args) -+ { -+ char buf[2048]; -+ -+ if (level > RTMP_level) -+ return; -+ -+ switch(level) -+ { -+ default: -+ case RTMP_LOGCRIT: level = LOGFATAL; break; -+ case RTMP_LOGERROR: level = LOGERROR; break; -+ case RTMP_LOGWARNING: level = LOGWARNING; break; -+ case RTMP_LOGINFO: level = LOGNOTICE; break; -+ case RTMP_LOGDEBUG: level = LOGINFO; break; -+ case RTMP_LOGDEBUG2: level = LOGDEBUG; break; -+ } -+ -+ vsnprintf(buf, sizeof(buf), fmt, args); -+ CLog::Log(level, "%s", buf); -+ } -+} -+ -+CDVDInputStreamRTMP::CDVDInputStreamRTMP(const CFileItem &fileitem) -+ : CDVDInputStream(DVDSTREAM_TYPE_RTMP, fileitem) -+ , m_canSeek(true) -+ , m_canPause(true) -+{ -+ if (m_libRTMP.Load()) -+ { -+ CLog::Log(LOGINFO,"%s: Using external libRTMP",__FUNCTION__); -+ RTMP_LogLevel level; -+ -+ m_libRTMP.LogSetCallback(CDVDInputStreamRTMP_Log); -+ switch (g_advancedSettings.m_logLevel) -+ { -+ case LOG_LEVEL_DEBUG_FREEMEM: -+ case LOG_LEVEL_DEBUG: level = RTMP_LOGDEBUG; break; -+ case LOG_LEVEL_NORMAL: level = RTMP_LOGINFO; break; -+ default: level = RTMP_LOGCRIT; break; -+ } -+ -+ if (g_advancedSettings.CanLogComponent(LOGRTMP)) -+ level = RTMP_LOGDEBUG2; -+ -+ m_libRTMP.LogSetLevel(level); -+ RTMP_level = level; -+ -+ m_rtmp = m_libRTMP.Alloc(); -+ m_libRTMP.Init(m_rtmp); -+ } -+ else -+ { -+ m_rtmp = NULL; -+ } -+ -+ m_eof = true; -+ m_bPaused = false; -+ m_sStreamPlaying = NULL; -+} -+ -+CDVDInputStreamRTMP::~CDVDInputStreamRTMP() -+{ -+ free(m_sStreamPlaying); -+ m_sStreamPlaying = NULL; -+ -+ Close(); -+ if (m_rtmp) -+ m_libRTMP.Free(m_rtmp); -+ m_rtmp = NULL; -+ m_bPaused = false; -+} -+ -+bool CDVDInputStreamRTMP::IsEOF() -+{ -+ return m_eof; -+} -+ -+#define SetAVal(av, cstr) av.av_val = (char *)cstr.c_str(); av.av_len = cstr.length() -+#undef AVC -+#define AVC(str) {(char *)str,sizeof(str)-1} -+ -+/* librtmp option names are slightly different */ -+static const struct { -+ const char *name; -+ AVal key; -+} options[] = { -+ { "SWFPlayer", AVC("swfUrl") }, -+ { "PageURL", AVC("pageUrl") }, -+ { "PlayPath", AVC("playpath") }, -+ { "TcUrl", AVC("tcUrl") }, -+ { "IsLive", AVC("live") }, -+ { NULL } -+}; -+ -+bool CDVDInputStreamRTMP::Open() -+{ -+ if (m_sStreamPlaying) -+ { -+ free(m_sStreamPlaying); -+ m_sStreamPlaying = NULL; -+ } -+ -+ m_item.SetMimeType("video/x-flv"); -+ if (!m_rtmp || !CDVDInputStream::Open()) -+ return false; -+ -+ CSingleLock lock(m_RTMPSection); -+ -+ // libRTMP can and will alter strFile, so take a copy of it -+ m_sStreamPlaying = (char*)calloc(strlen(m_item.GetPath().c_str())+1,sizeof(char)); -+ strcpy(m_sStreamPlaying, m_item.GetPath().c_str()); -+ -+ if (!m_libRTMP.SetupURL(m_rtmp, m_sStreamPlaying)) -+ return false; -+ -+ /* Look for protocol options in the URL. -+ * Options are added to the URL in space separated key=value pairs. -+ * We are only interested in the "live" option to disable seeking, -+ * the rest is handled by librtmp internally -+ * -+ * example URL suitable for use with RTMP_SetupURL(): -+ * "rtmp://flashserver:1935/ondemand/thefile swfUrl=http://flashserver/player.swf swfVfy=1 live=1" -+ * details: https://rtmpdump.mplayerhq.hu/librtmp.3.html -+ */ -+ std::string url = m_item.GetPath(); -+ size_t iPosBlank = url.find(' '); -+ if (iPosBlank != std::string::npos && (url.find("live=true") != std::string::npos || url.find("live=1") != std::string::npos)) -+ { -+ m_canSeek = false; -+ m_canPause = false; -+ m_realtime = true; -+ } -+ CLog::Log(LOGDEBUG, "RTMP canseek: %s", m_canSeek ? "true" : "false"); -+ -+ /* SetOpt and SetAVal copy pointers to the value. librtmp doesn't use the values until the Connect() call, -+ * so value objects must stay allocated until then. To be extra safe, keep the values around until Close(), -+ * in case librtmp needs them again. -+ */ -+ m_optionvalues.clear(); -+ for (int i=0; options[i].name; i++) -+ { -+ std::string tmp = m_item.GetProperty(options[i].name).asString(); -+ if (!tmp.empty()) -+ { -+ m_optionvalues.push_back(tmp); -+ AVal av_tmp; -+ SetAVal(av_tmp, m_optionvalues.back()); -+ m_libRTMP.SetOpt(m_rtmp, &options[i].key, &av_tmp); -+ } -+ } -+ -+ if (!m_libRTMP.Connect(m_rtmp, NULL) || !m_libRTMP.ConnectStream(m_rtmp, 0)) -+ return false; -+ -+ m_eof = false; -+ -+ return true; -+} -+ -+// close file and reset everything -+void CDVDInputStreamRTMP::Close() -+{ -+ CSingleLock lock(m_RTMPSection); -+ CDVDInputStream::Close(); -+ -+ if (m_rtmp) -+ m_libRTMP.Close(m_rtmp); -+ -+ m_optionvalues.clear(); -+ m_eof = true; -+ m_bPaused = false; -+} -+ -+int CDVDInputStreamRTMP::Read(uint8_t* buf, int buf_size) -+{ -+ if (!m_rtmp) -+ return -1; -+ -+ int i = m_libRTMP.Read(m_rtmp, (char *)buf, buf_size); -+ if (i < 0) -+ m_eof = true; -+ -+ return i; -+} -+ -+int64_t CDVDInputStreamRTMP::Seek(int64_t offset, int whence) -+{ -+ if (whence == SEEK_POSSIBLE) -+ return 0; -+ else -+ return -1; -+} -+ -+bool CDVDInputStreamRTMP::PosTime(int iTimeInMsec) -+{ -+ CLog::Log(LOGNOTICE, "RTMP Seek to %i requested", iTimeInMsec); -+ CSingleLock lock(m_RTMPSection); -+ -+ if (m_rtmp && m_libRTMP.SendSeek(m_rtmp, iTimeInMsec)) -+ return true; -+ -+ return false; -+} -+ -+int64_t CDVDInputStreamRTMP::GetLength() -+{ -+ return -1; -+} -+ -+bool CDVDInputStreamRTMP::Pause(double dTime) -+{ -+ CSingleLock lock(m_RTMPSection); -+ -+ m_bPaused = !m_bPaused; -+ -+ CLog::Log(LOGNOTICE, "RTMP Pause %s requested", m_bPaused ? "TRUE" : "FALSE"); -+ -+ if (m_rtmp) -+ m_libRTMP.Pause(m_rtmp, m_bPaused); -+ -+ return true; -+} -+#endif -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h -new file mode 100644 -index 0000000..5af246a ---- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamRTMP.h -@@ -0,0 +1,61 @@ -+#pragma once -+/* -+ * Copyright (C) 2005-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#ifdef HAS_LIBRTMP -+ -+#include "DVDInputStream.h" -+#include "DllLibRTMP.h" -+ -+class CDVDInputStreamRTMP -+ : public CDVDInputStream -+ , public CDVDInputStream::IPosTime -+{ -+public: -+ CDVDInputStreamRTMP(const CFileItem &fileitem); -+ virtual ~CDVDInputStreamRTMP(); -+ virtual bool Open(); -+ virtual void Close(); -+ virtual int Read(uint8_t* buf, int buf_size); -+ virtual int64_t Seek(int64_t offset, int whence); -+ bool PosTime(int iTimeInMsec); -+ bool CanSeek() { return m_canSeek; } -+ bool CanPause() { return m_canPause; } -+ virtual bool Pause(double dTime); -+ virtual bool IsEOF(); -+ virtual int64_t GetLength(); -+ -+ CDVDInputStream::IPosTime* GetIPosTime() override { return this; } -+ -+ CCriticalSection m_RTMPSection; -+ -+protected: -+ bool m_eof; -+ bool m_bPaused; -+ bool m_canSeek; -+ bool m_canPause; -+ char* m_sStreamPlaying; -+ std::vector m_optionvalues; -+ -+ RTMP *m_rtmp; -+ DllLibRTMP m_libRTMP; -+}; -+ -+#endif -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamStack.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamStack.h -index 3ff964e..a00fed4 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamStack.h -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DVDInputStreamStack.h -@@ -22,7 +22,6 @@ - - #include "DVDInputStream.h" - #include --#include - - class CDVDInputStreamStack : public CDVDInputStream - { -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/DllLibRTMP.h b/xbmc/cores/VideoPlayer/DVDInputStreams/DllLibRTMP.h -new file mode 100644 -index 0000000..ac58132 ---- /dev/null -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/DllLibRTMP.h -@@ -0,0 +1,79 @@ -+#pragma once -+ -+/* -+ * Copyright (C) 2005-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "DynamicDll.h" -+ -+#include -+#include -+ -+class DllLibRTMPInterface -+{ -+public: -+ virtual ~DllLibRTMPInterface() {} -+ virtual void LogSetLevel(int level)=0; -+ virtual void LogSetCallback(RTMP_LogCallback* cb)=0; -+ virtual RTMP *Alloc(void)=0; -+ virtual void Free(RTMP* r)=0; -+ virtual void Init(RTMP* r)=0; -+ virtual void Close(RTMP* r)=0; -+ virtual bool SetupURL(RTMP* r, char* url)=0; -+ virtual bool SetOpt(RTMP* r, const AVal* opt, AVal* arg)=0; -+ virtual bool Connect(RTMP* r, RTMPPacket* cp)=0; -+ virtual bool ConnectStream(RTMP* r, int seekTime)=0; -+ virtual int Read(RTMP* r, char* buf, int size)=0; -+ virtual bool SendSeek(RTMP*r, int dTime)=0; -+ virtual bool Pause(RTMP* r, bool DoPause)=0; -+}; -+ -+class DllLibRTMP : public DllDynamic, DllLibRTMPInterface -+{ -+ DECLARE_DLL_WRAPPER(DllLibRTMP, DLL_PATH_LIBRTMP) -+ DEFINE_METHOD1(void, LogSetLevel, (int p1)) -+ DEFINE_METHOD1(void, LogSetCallback, (RTMP_LogCallback* p1)) -+ DEFINE_METHOD0(RTMP *, Alloc ) -+ DEFINE_METHOD1(void, Free, (RTMP* p1)) -+ DEFINE_METHOD1(void, Init, (RTMP* p1)) -+ DEFINE_METHOD1(void, Close, (RTMP* p1)) -+ DEFINE_METHOD2(bool, SetupURL, (RTMP* p1, char* p2)) -+ DEFINE_METHOD3(bool, SetOpt, (RTMP* p1, const AVal* p2, AVal* p3)) -+ DEFINE_METHOD2(bool, Connect, (RTMP* p1, RTMPPacket* p2)) -+ DEFINE_METHOD2(bool, ConnectStream, (RTMP* p1, int p2)) -+ DEFINE_METHOD3(int, Read, (RTMP* p1, char* p2, int p3)) -+ DEFINE_METHOD2(bool, SendSeek, (RTMP* p1, int p2)) -+ DEFINE_METHOD2(bool, Pause, (RTMP* p1, bool p2)) -+ BEGIN_METHOD_RESOLVE() -+ RESOLVE_METHOD_RENAME(RTMP_LogSetLevel,LogSetLevel) -+ RESOLVE_METHOD_RENAME(RTMP_LogSetCallback,LogSetCallback) -+ RESOLVE_METHOD_RENAME(RTMP_Alloc,Alloc) -+ RESOLVE_METHOD_RENAME(RTMP_Free,Free) -+ RESOLVE_METHOD_RENAME(RTMP_Init,Init) -+ RESOLVE_METHOD_RENAME(RTMP_Close,Close) -+ RESOLVE_METHOD_RENAME(RTMP_SetupURL,SetupURL) -+ RESOLVE_METHOD_RENAME(RTMP_SetOpt,SetOpt) -+ RESOLVE_METHOD_RENAME(RTMP_Connect,Connect) -+ RESOLVE_METHOD_RENAME(RTMP_ConnectStream,ConnectStream) -+ RESOLVE_METHOD_RENAME(RTMP_Read,Read) -+ RESOLVE_METHOD_RENAME(RTMP_SendSeek,SendSeek) -+ RESOLVE_METHOD_RENAME(RTMP_Pause,Pause) -+ END_METHOD_RESOLVE() -+}; -+ -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamAddon.h b/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamAddon.h -index 57fb887..f0d0d49 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamAddon.h -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/InputStreamAddon.h -@@ -20,9 +20,6 @@ - - #pragma once - --#include --#include -- - #include "DVDInputStream.h" - #include "addons/InputStream.h" - -diff --git a/xbmc/cores/VideoPlayer/DVDInputStreams/Makefile b/xbmc/cores/VideoPlayer/DVDInputStreams/Makefile -index 2cd0f71..1809e63 100644 ---- a/xbmc/cores/VideoPlayer/DVDInputStreams/Makefile -+++ b/xbmc/cores/VideoPlayer/DVDInputStreams/Makefile -@@ -8,6 +8,7 @@ SRCS= DVDFactoryInputStream.cpp \ - DVDInputStreamFile.cpp \ - DVDInputStreamMemory.cpp \ - DVDInputStreamNavigator.cpp \ -+ DVDInputStreamRTMP.cpp \ - DVDInputStreamPVRManager.cpp \ - DVDInputStreamStack.cpp \ - InputStreamAddon.cpp \ -diff --git a/xbmc/cores/VideoPlayer/DVDMessage.h b/xbmc/cores/VideoPlayer/DVDMessage.h -index dadc640..20bfd94 100644 ---- a/xbmc/cores/VideoPlayer/DVDMessage.h -+++ b/xbmc/cores/VideoPlayer/DVDMessage.h -@@ -48,12 +48,12 @@ public: - GENERAL_RESYNC, // - GENERAL_FLUSH, // flush all buffers - GENERAL_RESET, // reset codecs for new data -- GENERAL_PAUSE, - GENERAL_STREAMCHANGE, // - GENERAL_SYNCHRONIZE, // - GENERAL_GUI_ACTION, // gui action of some sort - GENERAL_EOF, // eof of stream - -+ - // player core related messages (cVideoPlayer.cpp) - - PLAYER_SET_AUDIOSTREAM, // -diff --git a/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp b/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp -index e59c84c..db1a651 100644 ---- a/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp -+++ b/xbmc/cores/VideoPlayer/DVDStreamInfo.cpp -@@ -54,6 +54,8 @@ void CDVDStreamInfo::Clear() - - fpsscale = 0; - fpsrate = 0; -+ rfpsscale= 0; -+ rfpsrate = 0; - height = 0; - width = 0; - aspect = 0.0; -@@ -98,6 +100,8 @@ bool CDVDStreamInfo::Equal(const CDVDStreamInfo& right, bool withextradata) - // VIDEO - if( fpsscale != right.fpsscale - || fpsrate != right.fpsrate -+ || rfpsscale!= right.rfpsscale -+ || rfpsrate != right.rfpsrate - || height != right.height - || width != right.width - || stills != right.stills -@@ -162,6 +166,8 @@ void CDVDStreamInfo::Assign(const CDVDStreamInfo& right, bool withextradata) - // VIDEO - fpsscale = right.fpsscale; - fpsrate = right.fpsrate; -+ rfpsscale= right.rfpsscale; -+ rfpsrate = right.rfpsrate; - height = right.height; - width = right.width; - aspect = right.aspect; -@@ -224,6 +230,8 @@ void CDVDStreamInfo::Assign(const CDemuxStream& right, bool withextradata) - const CDemuxStreamVideo *stream = static_cast(&right); - fpsscale = stream->iFpsScale; - fpsrate = stream->iFpsRate; -+ rfpsscale = stream->irFpsScale; -+ rfpsrate = stream->irFpsRate; - height = stream->iHeight; - width = stream->iWidth; - aspect = stream->fAspect; -diff --git a/xbmc/cores/VideoPlayer/DVDStreamInfo.h b/xbmc/cores/VideoPlayer/DVDStreamInfo.h -index f141708..2252d65 100644 ---- a/xbmc/cores/VideoPlayer/DVDStreamInfo.h -+++ b/xbmc/cores/VideoPlayer/DVDStreamInfo.h -@@ -61,6 +61,8 @@ public: - // VIDEO - int fpsscale; // scale of 1001 and a rate of 60000 will result in 59.94 fps - int fpsrate; -+ int rfpsscale; -+ int rfpsrate; - int height; // height of the stream reported by the demuxer - int width; // width of the stream reported by the demuxer - float aspect; // display aspect as reported by demuxer -diff --git a/xbmc/cores/VideoPlayer/Edl.cpp b/xbmc/cores/VideoPlayer/Edl.cpp -index ca60764..1775eac 100644 ---- a/xbmc/cores/VideoPlayer/Edl.cpp -+++ b/xbmc/cores/VideoPlayer/Edl.cpp -@@ -98,7 +98,8 @@ bool CEdl::ReadEditDecisionLists(const std::string& strMovie, const float fFrame - */ - if ((URIUtils::IsHD(strMovie) || - URIUtils::IsSmb(strMovie) || -- URIUtils::IsNfs(strMovie)) && -+ URIUtils::IsNfs(strMovie) || -+ URIUtils::IsAfp(strMovie)) && - !URIUtils::IsPVRRecording(strMovie) && - !URIUtils::IsInternetStream(strMovie)) - { -@@ -749,8 +750,8 @@ int CEdl::RemoveCutTime(int iSeek) const - if (!HasCut()) - return iSeek; - -- /** -- * @todo Consider an optimisation of using the (now unused) total cut time if the seek time -+ /* -+ * TODO: Consider an optimisation of using the (now unused) total cut time if the seek time - * requested is later than the end of the last recorded cut. For example, when calculating the - * total duration for display. - */ -diff --git a/xbmc/cores/VideoPlayer/IVideoPlayer.h b/xbmc/cores/VideoPlayer/IVideoPlayer.h -index aa9033a..6cd95bb 100644 ---- a/xbmc/cores/VideoPlayer/IVideoPlayer.h -+++ b/xbmc/cores/VideoPlayer/IVideoPlayer.h -@@ -20,10 +20,6 @@ - * - */ - --#include --#include --#include -- - #include "DVDClock.h" - - #define VideoPlayer_AUDIO 1 -@@ -107,7 +103,6 @@ class IVideoPlayer - { - public: - virtual int OnDVDNavResult(void* pData, int iMessage) = 0; -- virtual void GetVideoResolution(unsigned int &width, unsigned int &height) = 0; - virtual ~IVideoPlayer() { } - }; - -diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.cpp b/xbmc/cores/VideoPlayer/VideoPlayer.cpp -index 9ed9176..fc3746c 100644 ---- a/xbmc/cores/VideoPlayer/VideoPlayer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoPlayer.cpp -@@ -895,7 +895,7 @@ void CVideoPlayer::OpenDefaultStreams(bool reset) - - // open video stream - valid = false; -- -+ - for (const auto &stream : m_SelectionStreams.Get(STREAM_VIDEO, PredicateVideoPriority)) - { - if(OpenStream(m_CurrentVideo, stream.demuxerId, stream.id, stream.source, reset)) -@@ -2369,10 +2369,10 @@ void CVideoPlayer::SynchronizePlayers(unsigned int sources) - - if (m_CurrentVideo.id >= 0) - m_VideoPlayerVideo->SendMessage(message->Acquire()); --//! @todo we have to rewrite the sync class, to not require --//! all other players waiting for subtitle, should only --//! be the oposite way --/* if (m_CurrentSubtitle.id >= 0) -+/* TODO - we have to rewrite the sync class, to not require -+ all other players waiting for subtitle, should only -+ be the oposite way -+ if (m_CurrentSubtitle.id >= 0) - m_VideoPlayerSubtitle->SendMessage(message->Acquire()); - */ - message->Release(); -@@ -2485,11 +2485,11 @@ void CVideoPlayer::HandleMessages() - int time = msg.GetRestore() ? m_Edl.RestoreCutTime(msg.GetTime()) : msg.GetTime(); - - // if input stream doesn't support ISeekTime, convert back to pts -- //! @todo -- //! After demuxer we add an offset to input pts so that displayed time and clock are -- //! increasing steadily. For seeking we need to determine the boundaries and offset -- //! of the desired segment. With the current approach calculated time may point -- //! to nirvana -+ // TODO: -+ // After demuxer we add an offset to input pts so that displayed time and clock are -+ // increasing steadily. For seeking we need to determine the boundaries and offset -+ // of the desired segment. With the current approach calculated time may point -+ // to nirvana - if (m_pInputStream->GetIPosTime() == nullptr) - time -= DVD_TIME_TO_MSEC(m_State.time_offset); - -@@ -2738,8 +2738,8 @@ void CVideoPlayer::HandleMessages() - { - FlushBuffers(false); - CDVDInputStreamPVRManager* input = dynamic_cast(m_pInputStream); -- //! @todo find a better solution for the "otherStreaHack" -- //! a stream is not sopposed to be terminated before demuxer -+ // TODO find a better solution for the "otherStreaHack" -+ // a stream is not sopposed to be terminated before demuxer - if (input && input->IsOtherStreamHack()) - { - SAFE_DELETE(m_pDemuxer); -@@ -3714,7 +3714,12 @@ bool CVideoPlayer::OpenVideoStream(CDVDStreamInfo& hint, bool reset) - m_SelectionStreams.Clear(STREAM_NONE, STREAM_SOURCE_VIDEOMUX); - } - -+ // TODO desired resolution needs to come from somewhere else -+ RESOLUTION_INFO res = g_graphicsContext.GetResInfo(); -+ m_pDemuxer->SetVideoResolution(res.iWidth, res.iHeight); -+ - return true; -+ - } - - bool CVideoPlayer::OpenSubtitleStream(CDVDStreamInfo& hint) -@@ -4135,13 +4140,6 @@ int CVideoPlayer::OnDVDNavResult(void* pData, int iMessage) - return NAVRESULT_NOP; - } - --void CVideoPlayer::GetVideoResolution(unsigned int &width, unsigned int &height) --{ -- RESOLUTION_INFO res = g_graphicsContext.GetResInfo(); -- width = res.iWidth; -- height = res.iHeight; --} -- - bool CVideoPlayer::ShowPVRChannelInfo(void) - { - bool bReturn(false); -@@ -5024,17 +5022,11 @@ void CVideoPlayer::GetDebugInfo(std::string &audio, std::string &video, std::str - void CVideoPlayer::OnLostDisplay() - { - CLog::Log(LOGNOTICE, "VideoPlayer: OnLostDisplay received"); -- m_VideoPlayerAudio->SendMessage(new CDVDMsgBool(CDVDMsg::GENERAL_PAUSE, true), 1); -- m_VideoPlayerVideo->SendMessage(new CDVDMsgBool(CDVDMsg::GENERAL_PAUSE, true), 1); -- m_clock.Pause(true); - m_displayLost = true; - } - - void CVideoPlayer::OnResetDisplay() - { - CLog::Log(LOGNOTICE, "VideoPlayer: OnResetDisplay received"); -- m_VideoPlayerAudio->SendMessage(new CDVDMsgBool(CDVDMsg::GENERAL_PAUSE, false), 1); -- m_VideoPlayerVideo->SendMessage(new CDVDMsgBool(CDVDMsg::GENERAL_PAUSE, false), 1); -- m_clock.Pause(false); - m_displayLost = false; - } -diff --git a/xbmc/cores/VideoPlayer/VideoPlayer.h b/xbmc/cores/VideoPlayer/VideoPlayer.h -index 560b975..40573c6 100644 ---- a/xbmc/cores/VideoPlayer/VideoPlayer.h -+++ b/xbmc/cores/VideoPlayer/VideoPlayer.h -@@ -22,7 +22,6 @@ - - #include - #include --#include - #include "cores/IPlayer.h" - #include "cores/VideoPlayer/VideoRenderers/RenderManager.h" - #include "threads/Thread.h" -@@ -350,8 +349,7 @@ public: - virtual bool IsCaching() const { return m_caching > CACHESTATE_DONE && m_caching < CACHESTATE_PLAY; } - virtual int GetCacheLevel() const ; - -- virtual int OnDVDNavResult(void* pData, int iMessage) override; -- void GetVideoResolution(unsigned int &width, unsigned int &height) override; -+ virtual int OnDVDNavResult(void* pData, int iMessage); - - virtual bool ControlsVolume() {return m_omxplayer_mode;} - diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp -index fb1d993..39c23ca 100644 +index e8f073f..39c23ca 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.cpp -@@ -67,7 +67,6 @@ CVideoPlayerAudio::CVideoPlayerAudio(CDVDClock* pClock, CDVDMessageQueue& parent - m_audioClock = 0; - m_speed = DVD_PLAYSPEED_NORMAL; - m_stalled = true; -- m_paused = false; - m_syncState = IDVDStreamPlayer::SYNC_STARTING; - m_silence = false; - m_synctype = SYNC_DISCON; -@@ -250,12 +249,9 @@ void CVideoPlayerAudio::Process() - if (m_syncState == IDVDStreamPlayer::SYNC_WAITSYNC) - priority = 1; - -- if (m_paused) -- priority = 1; -- - // consider stream stalled if queue is empty - // we can't sync audio to clock with an empty queue -- if (ALLOW_AUDIO(m_speed) && !m_stalled && !m_paused) -+ if (ALLOW_AUDIO(m_speed) && !m_stalled) - { - timeout = 0; - } -@@ -359,11 +355,6 @@ void CVideoPlayerAudio::Process() - OpenStream(msg->m_hints, msg->m_codec); - msg->m_codec = NULL; - } -- else if (pMsg->IsType(CDVDMsg::GENERAL_PAUSE)) -- { -- m_paused = static_cast(pMsg)->m_value; -- CLog::Log(LOGDEBUG, "CVideoPlayerAudio - CDVDMsg::GENERAL_PAUSE: %d", m_paused); -- } - else if (pMsg->IsType(CDVDMsg::DEMUXER_PACKET)) - { - DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); -@@ -494,6 +485,8 @@ void CVideoPlayerAudio::Process() +@@ -485,6 +485,8 @@ void CVideoPlayerAudio::Process() } } } @@ -70875,46 +11323,8 @@ index fb1d993..39c23ca 100644 } // guess next pts -@@ -545,9 +538,10 @@ bool CVideoPlayerAudio::OutputPacket(DVDAudioFrame &audioframe) - { - double syncerror = m_dvdAudio.GetSyncError(); - -- if (m_synctype == SYNC_DISCON && fabs(syncerror) > DVD_MSEC_TO_TIME(10)) -+ if (m_synctype == SYNC_DISCON) - { -- double correction = m_pClock->ErrorAdjust(syncerror, "CVideoPlayerAudio::OutputPacket"); -+ double error = syncerror; -+ double correction = m_pClock->ErrorAdjust(error, "CVideoPlayerAudio::OutputPacket"); - if (correction != 0) - { - m_dvdAudio.SetSyncErrorCorrection(-correction); -diff --git a/xbmc/cores/VideoPlayer/VideoPlayerAudio.h b/xbmc/cores/VideoPlayer/VideoPlayerAudio.h -index d1653e0..f6b5003 100644 ---- a/xbmc/cores/VideoPlayer/VideoPlayerAudio.h -+++ b/xbmc/cores/VideoPlayer/VideoPlayerAudio.h -@@ -99,7 +99,6 @@ protected: - int m_speed; - bool m_stalled; - bool m_silence; -- bool m_paused; - IDVDStreamPlayer::ESyncState m_syncState; - XbmcThreads::EndTime m_syncTimer; - -diff --git a/xbmc/cores/VideoPlayer/VideoPlayerTeletext.cpp b/xbmc/cores/VideoPlayer/VideoPlayerTeletext.cpp -index 89c8365..dea99c7 100644 ---- a/xbmc/cores/VideoPlayer/VideoPlayerTeletext.cpp -+++ b/xbmc/cores/VideoPlayer/VideoPlayerTeletext.cpp -@@ -609,7 +609,7 @@ void CDVDTeletextData::Process() - case 2: /* page key */ - break; /* ignore */ - case 3: /* types of PTUs in DRCS */ -- break; //! @todo implement -+ break; /* TODO */ - case 4: /* CLUTs 0/1, only level 3.5 */ - break; /* ignore */ - default: diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp -index 8e5d33d..7ee8702 100644 +index cdd1938..7ee8702 100644 --- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp +++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.cpp @@ -38,6 +38,9 @@ @@ -70927,57 +11337,7 @@ index 8e5d33d..7ee8702 100644 using namespace RenderManager; -@@ -77,7 +80,6 @@ CVideoPlayerVideo::CVideoPlayerVideo(CDVDClock* pClock - - m_bRenderSubs = false; - m_stalled = false; -- m_paused = false; - m_syncState = IDVDStreamPlayer::SYNC_STARTING; - m_iSubtitleDelay = 0; - m_iLateFrames = 0; -@@ -260,9 +262,6 @@ void CVideoPlayerVideo::Process() - if (m_syncState == IDVDStreamPlayer::SYNC_WAITSYNC) - iPriority = 1; - -- if (m_paused) -- iPriority = 1; -- - CDVDMsg* pMsg; - MsgQueueReturnCode ret = m_messageQueue.Get(&pMsg, iQueueTimeOut, iPriority); - -@@ -345,7 +344,7 @@ void CVideoPlayerVideo::Process() - - m_pullupCorrection.Flush(); - //we need to recalculate the framerate -- //! @todo this needs to be set on a streamchange instead -+ //TODO: this needs to be set on a streamchange instead - ResetFrameRateCalc(); - m_droppingStats.Reset(); - -@@ -400,11 +399,6 @@ void CVideoPlayerVideo::Process() - break; - } - } -- else if (pMsg->IsType(CDVDMsg::GENERAL_PAUSE)) -- { -- m_paused = static_cast(pMsg)->m_value; -- CLog::Log(LOGDEBUG, "CVideoPlayerVideo - CDVDMsg::GENERAL_PAUSE: %d", m_paused); -- } - else if (pMsg->IsType(CDVDMsg::DEMUXER_PACKET)) - { - DemuxPacket* pPacket = ((CDVDMsgDemuxerPacket*)pMsg)->GetPacket(); -@@ -617,8 +611,8 @@ bool CVideoPlayerVideo::ProcessDecoderOutput(int &decoderState, double &frametim - m_syncState = IDVDStreamPlayer::SYNC_WAITSYNC; - SStartMsg msg; - msg.player = VideoPlayer_VIDEO; -- msg.cachetime = DVD_MSEC_TO_TIME(50); //! @todo implement -- msg.cachetotal = DVD_MSEC_TO_TIME(100); //! @todo implement -+ msg.cachetime = DVD_MSEC_TO_TIME(50); // TODO -+ msg.cachetotal = DVD_MSEC_TO_TIME(100); // TODO - msg.timestamp = hasTimestamp ? pts : DVD_NOPTS_VALUE; - m_messageParent.Put(new CDVDMsgType(CDVDMsg::PLAYER_STARTED, msg)); - } -@@ -778,6 +772,7 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) +@@ -769,6 +772,7 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) } flags |= stereo_flags; @@ -70985,17 +11345,7 @@ index 8e5d33d..7ee8702 100644 if(!m_renderManager.Configure(picture, config_framerate, -@@ -799,8 +794,7 @@ int CVideoPlayerVideo::OutputPicture(const DVDVideoPicture* src, double pts) - } - - //try to calculate the framerate -- if (!m_stalled) -- CalcFrameRate(); -+ CalcFrameRate(); - - // signal to clock what our framerate is, it may want to adjust it's - // speed to better match with our video renderer's output speed -@@ -917,6 +911,9 @@ std::string CVideoPlayerVideo::GetPlayerInfo() +@@ -907,6 +911,9 @@ std::string CVideoPlayerVideo::GetPlayerInfo() s << ", pc:" << pc; else s << ", pc:none"; @@ -71005,18 +11355,6 @@ index 8e5d33d..7ee8702 100644 return s.str(); } -diff --git a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h -index 8ada932..4dff792 100644 ---- a/xbmc/cores/VideoPlayer/VideoPlayerVideo.h -+++ b/xbmc/cores/VideoPlayer/VideoPlayerVideo.h -@@ -130,7 +130,6 @@ protected: - float m_fForcedAspectRatio; - int m_speed; - bool m_stalled; -- bool m_paused; - IDVDStreamPlayer::ESyncState m_syncState; - std::atomic_bool m_bAbortOutput; - diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp index f18c671..60224b6 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/BaseRenderer.cpp @@ -71052,373 +11390,6 @@ index f18c671..60224b6 100644 // scale up image as much as possible // and keep the aspect ratio (introduces with black bars) // calculate the correct output frame ratio (using the users pixel ratio setting -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt -index 91260dc..47e8212 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/CMakeLists.txt -@@ -13,7 +13,7 @@ if(VDPAU_FOUND) - list(APPEND HEADERS RendererVDPAU.h) - endif() - --if(CORE_SYSTEM_NAME STREQUAL osx) -+if(CORE_SYSTEM_NAME STREQUAL darwin) - list(APPEND SOURCES RendererVTBGL.cpp) - list(APPEND HEADERS RendererVTBGL.h) - endif() -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -index cd57312..8097c65 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.cpp -@@ -37,14 +37,12 @@ - - #define CLASSNAME "CMMALRenderer" - --#define VERBOSE 0 - --std::shared_ptr CMMALRenderer::GetPool(ERenderFormat format, AVPixelFormat pixfmt, bool opaque) -+MMAL_POOL_T *CMMALRenderer::GetPool(ERenderFormat format, bool opaque) - { - CSingleLock lock(m_sharedSection); -- bool formatChanged = m_format != format || m_opaque != opaque; -- if (!m_bMMALConfigured || formatChanged) -- m_bMMALConfigured = init_vout(format, pixfmt, opaque); -+ if (!m_bMMALConfigured) -+ m_bMMALConfigured = init_vout(format, opaque); - - return m_vout_input_pool; - } -@@ -55,7 +53,7 @@ CRenderInfo CMMALRenderer::GetRenderInfo() - CRenderInfo info; - - if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s opaque:%p", CLASSNAME, __func__, this); -+ CLog::Log(LOGDEBUG, "%s::%s cookie:%p", CLASSNAME, __func__, (void *)m_vout_input_pool); - - info.max_buffer_size = NUM_BUFFERS; - info.optimal_buffer_size = NUM_BUFFERS; -@@ -69,8 +67,8 @@ void CMMALRenderer::vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T * - assert(!(buffer->flags & MMAL_BUFFER_HEADER_FLAG_TRANSMISSION_FAILED)); - buffer->flags &= ~MMAL_BUFFER_HEADER_FLAG_USER2; - CMMALBuffer *omvb = (CMMALBuffer *)buffer->user_data; -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -- CLog::Log(LOGDEBUG, "%s::%s port:%p omvb:%p mmal:%p:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, buffer, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ CLog::Log(LOGDEBUG, "%s::%s YUV port:%p omvb:%p mmal:%p:%p len:%d cmd:%x flags:%x flight:%d", CLASSNAME, __func__, port, omvb, buffer, omvb->mmal_buffer, buffer->length, buffer->cmd, buffer->flags, m_inflight); - assert(buffer == omvb->mmal_buffer); - m_inflight--; - omvb->Release(); -@@ -82,78 +80,21 @@ static void vout_input_port_cb_static(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *b - mmal->vout_input_port_cb(port, buffer); - } - --static struct { -- uint32_t encoding; -- AVPixelFormat pixfmt; --} pixfmt_to_encoding_table[] = --{ -- {MMAL_ENCODING_I420, AV_PIX_FMT_YUV420P}, -- {MMAL_ENCODING_I422, AV_PIX_FMT_YUV422P}, -- {MMAL_ENCODING_I420, AV_PIX_FMT_YUVJ420P}, // FIXME -- {MMAL_ENCODING_I422, AV_PIX_FMT_YUVJ422P}, // FIXME -- {MMAL_ENCODING_RGB16, AV_PIX_FMT_RGB565}, -- {MMAL_ENCODING_RGB16, AV_PIX_FMT_RGB565LE}, -- {MMAL_ENCODING_BGR16, AV_PIX_FMT_BGR565}, -- {MMAL_ENCODING_RGB24, AV_PIX_FMT_RGB24}, -- {MMAL_ENCODING_BGR24, AV_PIX_FMT_BGR24}, -- {MMAL_ENCODING_ARGB, AV_PIX_FMT_ARGB}, -- {MMAL_ENCODING_RGBA, AV_PIX_FMT_RGBA}, -- {MMAL_ENCODING_ABGR, AV_PIX_FMT_ABGR}, -- {MMAL_ENCODING_BGRA, AV_PIX_FMT_BGRA}, -- {MMAL_ENCODING_BGRA, AV_PIX_FMT_BGR0}, -- {MMAL_ENCODING_UNKNOWN, AV_PIX_FMT_NONE} --}; -- --static uint32_t pixfmt_to_encoding(AVPixelFormat pixfmt) --{ -- unsigned int i; -- for (i = 0; pixfmt_to_encoding_table[i].encoding != MMAL_ENCODING_UNKNOWN; i++) -- if (pixfmt_to_encoding_table[i].pixfmt == pixfmt) -- break; -- return pixfmt_to_encoding_table[i].encoding; --} -- --CMMALPool::CMMALPool(MMAL_PORT_T *input, uint32_t num_buffers, uint32_t buffer_size) --{ -- m_input = input; -- m_pool = mmal_port_pool_create(input, num_buffers, buffer_size); -- if (!m_pool) -- CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port", CLASSNAME, __func__); -- else -- CLog::Log(LOGDEBUG, "%s::%s Created pool %p of size %d x %d", CLASSNAME, __func__, m_pool, num_buffers, buffer_size); --} -- --CMMALPool::~CMMALPool() --{ -- CLog::Log(LOGDEBUG, "%s::%s destroying pool (%p)", CLASSNAME, __func__, m_pool); -- mmal_port_pool_destroy(m_input, m_pool); -- m_pool = nullptr; -- m_input = nullptr; --} -- --bool CMMALRenderer::init_vout(ERenderFormat format, AVPixelFormat pixfmt, bool opaque) -+bool CMMALRenderer::init_vout(ERenderFormat format, bool opaque) - { - CSingleLock lock(m_sharedSection); -- bool formatChanged = m_format != format || m_opaque != opaque || m_pixfmt != pixfmt; -+ bool formatChanged = m_format != format || m_opaque != opaque; - MMAL_STATUS_T status; -- uint32_t encoding = pixfmt_to_encoding(pixfmt); - -- CLog::Log(LOGDEBUG, "%s::%s configured:%d format %d->%d pixfmt %x->%x opaque %d->%d", CLASSNAME, __func__, m_bConfigured, m_format, format, m_pixfmt, pixfmt, m_opaque, opaque); -+ CLog::Log(LOGDEBUG, "%s::%s configured:%d format %d->%d opaque %d->%d", CLASSNAME, __func__, m_bConfigured, m_format, format, m_opaque, opaque); - - if (m_bMMALConfigured && formatChanged) - UnInitMMAL(); - -- if (m_bMMALConfigured || format == RENDER_FMT_BYPASS) -+ if (m_bMMALConfigured || format != RENDER_FMT_MMAL) - return true; - -- if (format != RENDER_FMT_MMAL || encoding == MMAL_ENCODING_UNKNOWN) -- { -- CLog::Log(LOGERROR, "%s::%s Unsupported format", CLASSNAME, __func__); -- return false; -- } -- - m_format = format; -- m_pixfmt = pixfmt; - m_opaque = opaque; - - /* Create video renderer */ -@@ -181,7 +122,7 @@ bool CMMALRenderer::init_vout(ERenderFormat format, AVPixelFormat pixfmt, bool o - es_format->es->video.width = m_sourceWidth; - es_format->es->video.height = m_sourceHeight; - -- es_format->encoding = m_opaque ? MMAL_ENCODING_OPAQUE : encoding; -+ es_format->encoding = m_opaque ? MMAL_ENCODING_OPAQUE : MMAL_ENCODING_I420; - - status = mmal_port_parameter_set_boolean(m_vout_input, MMAL_PARAMETER_ZERO_COPY, MMAL_TRUE); - if (status != MMAL_SUCCESS) -@@ -211,7 +152,13 @@ bool CMMALRenderer::init_vout(ERenderFormat format, AVPixelFormat pixfmt, bool o - return false; - } - -- m_vout_input_pool = std::make_shared(m_vout_input, m_vout_input->buffer_num, m_opaque ? m_vout_input->buffer_size:0); -+ CLog::Log(LOGDEBUG, "%s::%s Created pool of size %d x %d", CLASSNAME, __func__, m_vout_input->buffer_num, m_vout_input->buffer_size); -+ m_vout_input_pool = mmal_port_pool_create(m_vout_input , m_vout_input->buffer_num, m_opaque ? m_vout_input->buffer_size:0); -+ if (!m_vout_input_pool) -+ { -+ CLog::Log(LOGERROR, "%s::%s Failed to create pool for decoder input port (status=%x %s)", CLASSNAME, __func__, status, mmal_status_to_string(status)); -+ return false; -+ } - if (!CSettings::GetInstance().GetBool("videoplayer.usedisplayasclock")) - { - m_queue = mmal_queue_create(); -@@ -229,7 +176,6 @@ CMMALRenderer::CMMALRenderer() : CThread("MMALRenderer") - memset(m_buffers, 0, sizeof m_buffers); - m_iFlags = 0; - m_format = RENDER_FMT_NONE; -- m_pixfmt = AV_PIX_FMT_YUV420P; - m_opaque = true; - m_bConfigured = false; - m_bMMALConfigured = false; -@@ -300,7 +246,7 @@ void CMMALRenderer::AddVideoPictureHW(DVDVideoPicture& pic, int index) - - CMMALBuffer *buffer = pic.MMALBuffer; - assert(buffer); -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s MMAL - %p (%p) %i", CLASSNAME, __func__, buffer, buffer->mmal_buffer, index); - - m_buffers[index] = buffer->Acquire(); -@@ -334,7 +280,7 @@ bool CMMALRenderer::Configure(unsigned int width, unsigned int height, unsigned - SetViewMode(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_ViewMode); - ManageRenderArea(); - -- m_bMMALConfigured = init_vout(format, m_pixfmt, m_opaque); -+ m_bMMALConfigured = init_vout(format, m_opaque); - m_bConfigured = m_bMMALConfigured; - assert(m_bConfigured); - return m_bConfigured; -@@ -364,7 +310,7 @@ void CMMALRenderer::ReleaseBuffer(int idx) - } - - CMMALBuffer *omvb = m_buffers[idx]; -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - MMAL: source:%d omvb:%p mmal:%p flight:%d", CLASSNAME, __func__, idx, omvb, omvb ? omvb->mmal_buffer:NULL, m_inflight); - if (omvb) - SAFE_RELEASE(m_buffers[idx]); -@@ -477,7 +423,7 @@ void CMMALRenderer::FlipPage(int source) - return; - } - -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s - source:%d", CLASSNAME, __func__, source); - - m_iYV12RenderBuffer = source; -@@ -504,7 +450,7 @@ void CMMALRenderer::PreInit() - - void CMMALRenderer::ReleaseBuffers() - { -- if (VERBOSE && g_advancedSettings.CanLogComponent(LOGVIDEO)) -+ if (g_advancedSettings.CanLogComponent(LOGVIDEO)) - CLog::Log(LOGDEBUG, "%s::%s", CLASSNAME, __func__); - for (int i=0; iGet() : nullptr); -+ CLog::Log(LOGDEBUG, "%s::%s pool(%p)", CLASSNAME, __func__, m_vout_input_pool); - if (m_queue) - { - StopThread(true); -@@ -533,8 +479,11 @@ void CMMALRenderer::UnInitMMAL() - - ReleaseBuffers(); - -- m_vout_input_pool = NULL; -- -+ if (m_vout_input_pool) -+ { -+ mmal_port_pool_destroy(m_vout_input, m_vout_input_pool); -+ m_vout_input_pool = NULL; -+ } - m_vout_input = NULL; - - if (m_vout) -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -index e2c0223..d29bbef 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/MMALRenderer.h -@@ -20,8 +20,6 @@ - * - */ - --#include -- - #include "guilib/GraphicContext.h" - #include "../RenderFlags.h" - #include "../RenderFormats.h" -@@ -45,17 +43,6 @@ class CMMALBuffer; - - struct DVDVideoPicture; - --class CMMALPool --{ --public: -- CMMALPool(MMAL_PORT_T *input, uint32_t num_buffers, uint32_t buffer_size); -- ~CMMALPool(); -- MMAL_POOL_T *Get() { return m_pool; } --protected: -- MMAL_POOL_T *m_pool; -- MMAL_PORT_T *m_input; --}; -- - class CMMALRenderer : public CBaseRenderer, public CThread - { - public: -@@ -96,7 +83,7 @@ public: - virtual bool IsGuiLayer() { return false; } - - void vout_input_port_cb(MMAL_PORT_T *port, MMAL_BUFFER_HEADER_T *buffer); -- std::shared_ptr GetPool(ERenderFormat format, AVPixelFormat pixfmt, bool opaque); -+ MMAL_POOL_T *GetPool(ERenderFormat format, bool opaque); - protected: - int m_iYV12RenderBuffer; - int m_NumYV12Buffers; -@@ -116,16 +103,15 @@ protected: - bool m_StereoInvert; - int m_inflight; - bool m_opaque; -- AVPixelFormat m_pixfmt; - - CCriticalSection m_sharedSection; - MMAL_COMPONENT_T *m_vout; - MMAL_PORT_T *m_vout_input; -- std::shared_ptr m_vout_input_pool; -+ MMAL_POOL_T *m_vout_input_pool; - MMAL_QUEUE_T *m_queue; - double m_error; - -- bool init_vout(ERenderFormat format, AVPixelFormat pixfmt, bool opaque); -+ bool init_vout(ERenderFormat format, bool opaque); - void ReleaseBuffers(); - void UnInitMMAL(); - }; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp -index d0baa27..f6b7bb1 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.cpp -@@ -27,18 +27,18 @@ - #include "cores/VideoPlayer/DVDCodecs/Video/AMLCodec.h" - #include "utils/log.h" - #include "utils/GLUtils.h" --#include "utils/SysfsUtils.h" - #include "settings/MediaSettings.h" - #include "windowing/WindowingFactory.h" - #include "cores/VideoPlayer/VideoRenderers/RenderCapture.h" - - CRendererAML::CRendererAML() - { -- m_prevPts = -1; -+ - } - - CRendererAML::~CRendererAML() - { -+ - } - - bool CRendererAML::RenderCapture(CRenderCapture* capture) -@@ -118,7 +118,7 @@ bool CRendererAML::LoadShadersHook() - { - CLog::Log(LOGNOTICE, "GL: Using AML render method"); - m_textureTarget = GL_TEXTURE_2D; -- m_renderMethod = RENDER_BYPASS; -+ m_renderMethod = RENDER_FMT_AML; - return false; - } - -@@ -132,19 +132,15 @@ bool CRendererAML::RenderUpdateVideoHook(bool clear, DWORD flags, DWORD alpha) - ManageRenderArea(); - - CDVDAmlogicInfo *amli = static_cast(m_buffers[m_iYV12RenderBuffer].hwDec); -- if (amli && amli->GetOmxPts() != m_prevPts) -+ if (amli) - { -- m_prevPts = amli->GetOmxPts(); -- SysfsUtils::SetInt("/sys/module/amvideo/parameters/omx_pts", amli->GetOmxPts()); -- - CAMLCodec *amlcodec = amli->getAmlCodec(); - if (amlcodec) - amlcodec->SetVideoRect(m_sourceRect, m_destRect); - } - -- usleep(10000); -- - return true; - } - - #endif -+ -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.h b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.h -index 819f6e3..deea29b 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererAML.h -@@ -55,9 +55,6 @@ protected: - virtual bool RenderHook(int index); - virtual int GetImageHook(YV12Image *image, int source = AUTOSOURCE, bool readonly = false); - virtual bool RenderUpdateVideoHook(bool clear, DWORD flags = 0, DWORD alpha = 255); -- --private: -- int m_prevPts; - }; - - #endif diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp index ed5b643..ffd807d 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/HwDecRender/RendererIMX.cpp @@ -71562,127 +11533,6 @@ index 22b1ed0..74f6888 100644 }; #endif -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp -index 976dd36..95c6fea 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.cpp -@@ -61,10 +61,9 @@ extern "C" { - #include "platform/darwin/DarwinUtils.h" - #endif - --//! @bug --//! due to a bug on osx nvidia, using gltexsubimage2d with a pbo bound and a null pointer --//! screws up the alpha, an offset fixes this, there might still be a problem if stride + PBO_OFFSET --//! is a multiple of 128 and deinterlacing is on -+//due to a bug on osx nvidia, using gltexsubimage2d with a pbo bound and a null pointer -+//screws up the alpha, an offset fixes this, there might still be a problem if stride + PBO_OFFSET -+//is a multiple of 128 and deinterlacing is on - #define PBO_OFFSET 16 - - using namespace Shaders; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.h b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.h -index e92010b..41a696d 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGL.h -@@ -23,8 +23,6 @@ - #include "system.h" - - #ifdef HAS_GL --#include -- - #include "system_gl.h" - - #include "FrameBufferObject.h" -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp -index 3760970..30c686d 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.cpp -@@ -940,7 +940,7 @@ void CLinuxRendererGLES::RenderSinglePass(int index, int field) - - void CLinuxRendererGLES::RenderMultiPass(int index, int field) - { -- //! @todo Multipass rendering does not currently work! FIX! -+ // TODO: Multipass rendering does not currently work! FIX! - CLog::Log(LOGERROR, "GLES: MULTIPASS rendering was called! But it doesnt work!!!"); - return; - -@@ -996,7 +996,7 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field) - m_pYUVProgShader->SetField(0); - - VerifyGLState(); --//! @todo implement section -+//TODO - // glPushAttrib(GL_VIEWPORT_BIT); - // glPushAttrib(GL_SCISSOR_BIT); - glMatrixModview.Push(); -@@ -1017,7 +1017,7 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field) - } - - // 1st Pass to video frame size --//! @todo implement section -+//TODO - // float imgwidth = planes[0].rect.x2 - planes[0].rect.x1; - // float imgheight = planes[0].rect.y2 - planes[0].rect.y1; - // if (m_textureTarget == GL_TEXTURE_2D) -@@ -1056,7 +1056,7 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field) - glMatrixModview.PopLoad(); - glMatrixProject.PopLoad(); - --//! @todo implement section -+//TODO - // glPopAttrib(); // pop scissor - // glPopAttrib(); // pop viewport - VerifyGLState(); -@@ -1091,7 +1091,7 @@ void CLinuxRendererGLES::RenderMultiPass(int index, int field) - - VerifyGLState(); - --//! @todo implement section -+//TODO - // imgwidth /= m_sourceWidth; - // imgheight /= m_sourceHeight; - // -@@ -1200,6 +1200,12 @@ void CLinuxRendererGLES::UploadYV12Texture(int source) - return; - } - -+ bool deinterlacing = false; -+ if (m_currentField == FIELD_FULL) -+ deinterlacing = false; -+ else -+ deinterlacing = true; -+ - glEnable(m_textureTarget); - VerifyGLState(); - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h -index afc130e..8af1ad3 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/LinuxRendererGLES.h -@@ -22,7 +22,6 @@ - */ - - #if HAS_GLES == 2 --#include - - #include "system_gl.h" - -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp -index e6b92e4..d308029 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/OverlayRendererGUI.cpp -@@ -159,11 +159,6 @@ void COverlayText::PrepareRender(const std::string &font, int color, int height, - if (!m_layout) - m_layout = GetFontLayout(font, color, height, style, fontcache, fontbordercache); - -- if (m_layout == NULL) -- { -- CLog::Log(LOGERROR, "COverlayText::PrepareRender - GetFontLayout failed for font %s", font.c_str()); -- return; -- } - RESOLUTION_INFO res = g_graphicsContext.GetResInfo(); - float width_max = (float)res.Overscan.right - res.Overscan.left; - m_layout->Update(m_text, width_max * 0.9f, false, true); // true to force LTR reading order (most Hebrew subs are this format) diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp index 809766a..b4c6586 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderFlags.cpp @@ -71723,20 +11573,10 @@ index f65d4b2..39e4743 100644 } diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp -index 93f8d6f..9e0b81d 100644 +index aaf5359..9e0b81d 100644 --- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp +++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.cpp -@@ -799,6 +799,9 @@ void CRenderManager::FlipPage(volatile std::atomic_bool& bStop, double pts /* = - EDEINTERLACEMODE deinterlacemode = CMediaSettings::GetInstance().GetCurrentVideoSettings().m_DeinterlaceMode; - EINTERLACEMETHOD interlacemethod = AutoInterlaceMethodInternal(CMediaSettings::GetInstance().GetCurrentVideoSettings().m_InterlaceMethod); - -+ if(g_advancedSettings.m_videoDisableBackgroundDeinterlace && !g_graphicsContext.IsFullScreenVideo()) -+ deinterlacemode = VS_DEINTERLACEMODE_OFF; -+ - if (deinterlacemode == VS_DEINTERLACEMODE_OFF) - { - presentmethod = PRESENT_METHOD_SINGLE; -@@ -811,32 +814,22 @@ void CRenderManager::FlipPage(volatile std::atomic_bool& bStop, double pts /* = +@@ -814,32 +814,22 @@ void CRenderManager::FlipPage(volatile std::atomic_bool& bStop, double pts /* = else { bool invert = false; @@ -71780,7 +11620,7 @@ index 93f8d6f..9e0b81d 100644 /* invert present field */ if (invert) -@@ -881,11 +874,22 @@ RESOLUTION CRenderManager::GetResolution() +@@ -884,7 +874,7 @@ RESOLUTION CRenderManager::GetResolution() return res; if (CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF) @@ -71789,22 +11629,7 @@ index 93f8d6f..9e0b81d 100644 return res; } - -+float CRenderManager::GetMaximumFPS() -+{ -+ float fps; -+ -+ fps = (float)m_dvdClock.GetRefreshRate(); -+ if (fps <= 0) -+ fps = g_graphicsContext.GetFPS(); -+ -+ return fps; -+} -+ - void CRenderManager::Render(bool clear, DWORD flags, DWORD alpha, bool gui) - { - CSingleExit exitLock(g_graphicsContext); -@@ -1076,7 +1080,7 @@ void CRenderManager::UpdateResolution() +@@ -1090,7 +1080,7 @@ void CRenderManager::UpdateResolution() { if (CSettings::GetInstance().GetInt(CSettings::SETTING_VIDEOPLAYER_ADJUSTREFRESHRATE) != ADJUST_REFRESHRATE_OFF && m_fps > 0.0f) { @@ -71813,27 +11638,7 @@ index 93f8d6f..9e0b81d 100644 g_graphicsContext.SetVideoResolution(res); UpdateDisplayLatency(); -@@ -1307,7 +1311,7 @@ void CRenderManager::PrepareNextRender() - } - - double frameOnScreen = m_dvdClock.GetClock(); -- double frametime = 1.0 / g_graphicsContext.GetFPS() * DVD_TIME_BASE; -+ double frametime = 1.0 / GetMaximumFPS() * DVD_TIME_BASE; - - // correct display latency - // internal buffers of driver, assume that driver lets us go one frame in advance -@@ -1333,10 +1337,6 @@ void CRenderManager::PrepareNextRender() - } - renderPts += frametime / 2 - m_clockSync.m_syncOffset; - } -- else -- { -- m_dvdClock.SetVsyncAdjust(0); -- } - - if (renderPts >= nextFramePts) - { -@@ -1403,6 +1403,12 @@ bool CRenderManager::GetStats(int &lateframes, double &pts, int &queued, int &di +@@ -1413,6 +1403,12 @@ bool CRenderManager::GetStats(int &lateframes, double &pts, int &queued, int &di void CRenderManager::CheckEnableClockSync() { @@ -71846,163 +11651,6 @@ index 93f8d6f..9e0b81d 100644 // refresh rate can be a multiple of video fps double diff = 1.0; -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.h b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.h -index bce8892..894e9c2 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/RenderManager.h -@@ -96,6 +96,7 @@ public: - bool Supports(ESCALINGMETHOD method); - EINTERLACEMETHOD AutoInterlaceMethod(EINTERLACEMETHOD mInt); - -+ float GetMaximumFPS(); - int GetSkippedFrames() { return m_QueueSkip; } - - // Functions called from mplayer -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/GLSLOutput.cpp b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/GLSLOutput.cpp -index 72ffa0d..b6cd2e2 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/GLSLOutput.cpp -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/GLSLOutput.cpp -@@ -72,7 +72,7 @@ void GLSLOutput::OnCompiledAndLinked(GLuint programHandle) - - if (m_dither) - { -- //! @todo create a dither pattern -+ // TODO: create a dither pattern - - // create a dither texture - glGenTextures(1, &m_tDitherTex); -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h -index f349cf7..554dda2 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/VideoShaders/WinVideoFilter.h -@@ -21,8 +21,6 @@ - */ - - #ifdef HAS_DX --#include --#include - - #include "../../guilib/Geometry.h" - #include "../WinRenderer.h" -diff --git a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.h b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.h -index e7adc1c..d4f3984 100644 ---- a/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.h -+++ b/xbmc/cores/VideoPlayer/VideoRenderers/WinRenderer.h -@@ -21,7 +21,6 @@ - */ - - #if !defined(TARGET_POSIX) && !defined(HAS_GL) --#include - - #include "BaseRenderer.h" - #include "HwDecRender/DXVAHD.h" -diff --git a/xbmc/cores/omxplayer/OMXImage.cpp b/xbmc/cores/omxplayer/OMXImage.cpp -index d2560aa..7c689a8 100644 ---- a/xbmc/cores/omxplayer/OMXImage.cpp -+++ b/xbmc/cores/omxplayer/OMXImage.cpp -@@ -1545,7 +1545,7 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned - } - } - -- //! @todo jpeg decoder can decimate by factors of 2 -+ // TODO: jpeg decoder can decimate by factors of 2 - port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; - if (m_omx_resize.IsInitialized()) - port_def.format.image.nSliceHeight = 16; -@@ -2004,7 +2004,7 @@ bool COMXTexture::HandlePortSettingChange(unsigned int resize_width, unsigned in - return false; - } - -- //! @todo jpeg decoder can decimate by factors of 2 -+ // TODO: jpeg decoder can decimate by factors of 2 - port_def.format.image.eColorFormat = OMX_COLOR_FormatYUV420PackedPlanar; - port_def.format.image.nSliceHeight = 16; - port_def.format.image.nStride = 0; -diff --git a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -index 236f1b3..b0f5ae1 100644 ---- a/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -+++ b/xbmc/cores/omxplayer/OMXPlayerVideo.cpp -@@ -475,8 +475,8 @@ void OMXPlayerVideo::Process() - m_syncState = IDVDStreamPlayer::SYNC_WAITSYNC; - SStartMsg msg; - msg.player = VideoPlayer_VIDEO; -- msg.cachetime = DVD_MSEC_TO_TIME(50); //! @todo implement -- msg.cachetotal = DVD_MSEC_TO_TIME(100); //! @todo implement -+ msg.cachetime = DVD_MSEC_TO_TIME(50); // TODO -+ msg.cachetotal = DVD_MSEC_TO_TIME(100); // TODO - msg.timestamp = pts; - m_messageParent.Put(new CDVDMsgType(CDVDMsg::PLAYER_STARTED, msg)); - } -diff --git a/xbmc/cores/paplayer/AudioDecoder.cpp b/xbmc/cores/paplayer/AudioDecoder.cpp -index ae7a88c..5b286bd 100644 ---- a/xbmc/cores/paplayer/AudioDecoder.cpp -+++ b/xbmc/cores/paplayer/AudioDecoder.cpp -@@ -298,7 +298,7 @@ int CAudioDecoder::ReadSamples(int numsamples) - int result = m_codec->ReadRaw(&m_rawBuffer, &m_rawBufferSize); - if (result == READ_SUCCESS && m_rawBufferSize) - { -- //! @todo trash this useless ringbuffer -+ // TODO, trash this useless ringbuffer - if (m_status == STATUS_QUEUING) - { - m_status = STATUS_QUEUED; -diff --git a/xbmc/cores/paplayer/ICodec.h b/xbmc/cores/paplayer/ICodec.h -index baae3d0..89e1795 100644 ---- a/xbmc/cores/paplayer/ICodec.h -+++ b/xbmc/cores/paplayer/ICodec.h -@@ -52,8 +52,9 @@ public: - // Init(filename) - // This routine should handle any initialization necessary. At a minimum it needs to: - // 1. Load any dlls and make sure any buffers etc. are allocated. -- // 2. Load the file (or at least attempt to load it) -- // 3. Fill in the m_TotalTime, m_SampleRate, m_BitsPerSample and m_Channels parameters. -+ // 2. If it's using a filereader, initialize it with the appropriate cache size. -+ // 3. Load the file (or at least attempt to load it) -+ // 4. Fill in the m_TotalTime, m_SampleRate, m_BitsPerSample and m_Channels parameters. - virtual bool Init(const CFileItem &file, unsigned int filecache)=0; - - // DeInit() -diff --git a/xbmc/cores/paplayer/PAPlayer.h b/xbmc/cores/paplayer/PAPlayer.h -index b82a874..5c85f2e 100644 ---- a/xbmc/cores/paplayer/PAPlayer.h -+++ b/xbmc/cores/paplayer/PAPlayer.h -@@ -21,7 +21,6 @@ - */ - - #include --#include - - #include "cores/IPlayer.h" - #include "threads/Thread.h" -diff --git a/xbmc/cores/paplayer/VideoPlayerCodec.cpp b/xbmc/cores/paplayer/VideoPlayerCodec.cpp -index 9056cf8..7c25d82 100644 ---- a/xbmc/cores/paplayer/VideoPlayerCodec.cpp -+++ b/xbmc/cores/paplayer/VideoPlayerCodec.cpp -@@ -102,8 +102,8 @@ bool VideoPlayerCodec::Init(const CFileItem &file, unsigned int filecache) - return false; - } - -- //! @todo -- //! convey CFileItem::ContentLookup() into Open() -+ // TODO: -+ // convey CFileItem::ContentLookup() into Open() - if (!m_pInputStream->Open()) - { - CLog::Log(LOGERROR, "%s: Error opening file %s", __FUNCTION__, strFileToOpen.c_str()); -diff --git a/xbmc/cores/playercorefactory/PlayerSelectionRule.h b/xbmc/cores/playercorefactory/PlayerSelectionRule.h -index 536cea6..c7cf3eb 100644 ---- a/xbmc/cores/playercorefactory/PlayerSelectionRule.h -+++ b/xbmc/cores/playercorefactory/PlayerSelectionRule.h -@@ -19,9 +19,6 @@ - * - */ - --#include --#include -- - #include "FileItem.h" - #include "PlayerCoreFactory.h" - diff --git a/xbmc/dbwrappers/Database.cpp b/xbmc/dbwrappers/Database.cpp index 4dc71c5..a590487 100644 --- a/xbmc/dbwrappers/Database.cpp @@ -72017,2757 +11665,8 @@ index 4dc71c5..a590487 100644 CLog::Log(LOGNOTICE, "Attempting to update the database %s from version %i to %i", dbName.c_str(), version, GetSchemaVersion()); bool success = true; BeginTransaction(); -diff --git a/xbmc/dbwrappers/dataset.h b/xbmc/dbwrappers/dataset.h -index 133b63a..101ea5a 100644 ---- a/xbmc/dbwrappers/dataset.h -+++ b/xbmc/dbwrappers/dataset.h -@@ -29,10 +29,9 @@ - **********************************************************************/ - - #include --#include --#include - #include --#include -+#include -+#include - #include "qry_dat.h" - #include - -diff --git a/xbmc/dbwrappers/mysqldataset.cpp b/xbmc/dbwrappers/mysqldataset.cpp -index b304d88..527bd1d 100644 ---- a/xbmc/dbwrappers/mysqldataset.cpp -+++ b/xbmc/dbwrappers/mysqldataset.cpp -@@ -1520,7 +1520,7 @@ int MysqlDataset::exec(const std::string &sql) { - } - else - { -- //! @todo collect results and store in exec_res -+ // TODO: collect results and store in exec_res - return res; - } - } -diff --git a/xbmc/dialogs/GUIDialogContextMenu.cpp b/xbmc/dialogs/GUIDialogContextMenu.cpp -index 19b1dc5..9d8d5a0 100644 ---- a/xbmc/dialogs/GUIDialogContextMenu.cpp -+++ b/xbmc/dialogs/GUIDialogContextMenu.cpp -@@ -42,10 +42,10 @@ - #include "filesystem/File.h" - #include "guilib/LocalizeStrings.h" - #include "TextureCache.h" -+#include "video/windows/GUIWindowVideoBase.h" - #include "URL.h" - #include "utils/StringUtils.h" - #include "utils/Variant.h" --#include "addons/Scraper.h" - - #define BACKGROUND_IMAGE 999 - #define GROUP_LIST 996 -@@ -208,7 +208,7 @@ float CGUIDialogContextMenu::GetWidth() const - - bool CGUIDialogContextMenu::SourcesMenu(const std::string &strType, const CFileItemPtr& item, float posX, float posY) - { -- //! @todo This should be callable even if we don't have any valid items -+ // TODO: This should be callable even if we don't have any valid items - if (!item) - return false; - -@@ -246,7 +246,7 @@ void CGUIDialogContextMenu::GetContextButtons(const std::string &type, const CFi - if (share) - { - // Note. from now on, remove source & disable plugin should mean the same thing -- //! @todo might be smart to also combine editing source & plugin settings into one concept/dialog -+ //TODO might be smart to also combine editing source & plugin settings into one concept/dialog - // Note. Temporarily disabled ability to remove plugin sources until installer is operational - - CURL url(share->strPath); -@@ -621,9 +621,9 @@ void CGUIDialogContextMenu::SwitchMedia(const std::string& strType, const std::s - // create menu - CContextButtons choices; - if (strType != "music") -- choices.Add(WINDOW_MUSIC_NAV, 2); -+ choices.Add(WINDOW_MUSIC_FILES, 2); - if (strType != "video") -- choices.Add(WINDOW_VIDEO_NAV, 3); -+ choices.Add(WINDOW_VIDEO_FILES, 3); - if (strType != "pictures") - choices.Add(WINDOW_PICTURES, 1); - if (strType != "files") -diff --git a/xbmc/dialogs/GUIDialogContextMenu.h b/xbmc/dialogs/GUIDialogContextMenu.h -index 5c3316c..4c4a140 100644 ---- a/xbmc/dialogs/GUIDialogContextMenu.h -+++ b/xbmc/dialogs/GUIDialogContextMenu.h -@@ -20,9 +20,7 @@ - * - */ - --#include - #include --#include - - #include "guilib/GUIDialog.h" - -diff --git a/xbmc/dialogs/GUIDialogExtendedProgressBar.h b/xbmc/dialogs/GUIDialogExtendedProgressBar.h -index 24759b7..59a1692 100644 ---- a/xbmc/dialogs/GUIDialogExtendedProgressBar.h -+++ b/xbmc/dialogs/GUIDialogExtendedProgressBar.h -@@ -19,9 +19,6 @@ - * - */ - --#include --#include -- - #include "guilib/GUIDialog.h" - - class CGUIDialogProgressBarHandle -diff --git a/xbmc/dialogs/GUIDialogFileBrowser.cpp b/xbmc/dialogs/GUIDialogFileBrowser.cpp -index 2f96c1f..2f5d034 100644 ---- a/xbmc/dialogs/GUIDialogFileBrowser.cpp -+++ b/xbmc/dialogs/GUIDialogFileBrowser.cpp -@@ -575,7 +575,7 @@ bool CGUIDialogFileBrowser::HaveDiscOrConnection( int iDriveType ) - } - else if ( iDriveType == CMediaSource::SOURCE_TYPE_REMOTE ) - { -- //! @todo Handle not connected to a remote share -+ // TODO: Handle not connected to a remote share - if ( !g_application.getNetwork().IsConnected() ) - { - CGUIDialogOK::ShowAndGetInput(CVariant{220}, CVariant{221}); -diff --git a/xbmc/dialogs/GUIDialogFileBrowser.h b/xbmc/dialogs/GUIDialogFileBrowser.h -index 1850a64..d4788e0 100644 ---- a/xbmc/dialogs/GUIDialogFileBrowser.h -+++ b/xbmc/dialogs/GUIDialogFileBrowser.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "guilib/GUIDialog.h" - #include "filesystem/VirtualDirectory.h" - #include "filesystem/DirectoryHistory.h" -diff --git a/xbmc/dialogs/GUIDialogGamepad.cpp b/xbmc/dialogs/GUIDialogGamepad.cpp -index de8afd0..9d8f6f3 100644 ---- a/xbmc/dialogs/GUIDialogGamepad.cpp -+++ b/xbmc/dialogs/GUIDialogGamepad.cpp -@@ -208,7 +208,7 @@ bool CGUIDialogGamepad::ShowAndVerifyNewPassword(std::string& strNewPassword) - std::string strUserInput; - if (ShowAndVerifyInput(strUserInput, "12340", "12330", "12331", "", true, true)) - { -- //! @todo Show error to user saying the password entry was blank -+ // TODO: Show error to user saying the password entry was blank - CGUIDialogOK::ShowAndGetInput(CVariant{12357}, CVariant{12358}); // Password is empty/blank - return false; - } -@@ -220,7 +220,7 @@ bool CGUIDialogGamepad::ShowAndVerifyNewPassword(std::string& strNewPassword) - // Prompt again for password input, this time sending previous input as the password to verify - if (!ShowAndVerifyInput(strUserInput, "12341", "12330", "12331", "", false, true)) - { -- //! @todo Show error to user saying the password re-entry failed -+ // TODO: Show error to user saying the password re-entry failed - CGUIDialogOK::ShowAndGetInput(CVariant{12357}, CVariant{12344}); // Password do not match - return false; - } -diff --git a/xbmc/dialogs/GUIDialogKeyboardGeneric.h b/xbmc/dialogs/GUIDialogKeyboardGeneric.h -index 1694733..356abeb 100644 ---- a/xbmc/dialogs/GUIDialogKeyboardGeneric.h -+++ b/xbmc/dialogs/GUIDialogKeyboardGeneric.h -@@ -20,9 +20,6 @@ - - #pragma once - --#include --#include -- - #include "guilib/GUIKeyboard.h" - #include "guilib/GUIDialog.h" - #include "input/KeyboardLayout.h" -diff --git a/xbmc/dialogs/GUIDialogMediaFilter.h b/xbmc/dialogs/GUIDialogMediaFilter.h -index 6995fe3..b6f5647 100644 ---- a/xbmc/dialogs/GUIDialogMediaFilter.h -+++ b/xbmc/dialogs/GUIDialogMediaFilter.h -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - - #include "dbwrappers/Database.h" - #include "dbwrappers/DatabaseQuery.h" -diff --git a/xbmc/dialogs/GUIDialogMediaSource.h b/xbmc/dialogs/GUIDialogMediaSource.h -index 2694a41..66ec95a 100644 ---- a/xbmc/dialogs/GUIDialogMediaSource.h -+++ b/xbmc/dialogs/GUIDialogMediaSource.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "guilib/GUIDialog.h" - - class CFileItemList; -diff --git a/xbmc/dialogs/GUIDialogSelect.h b/xbmc/dialogs/GUIDialogSelect.h -index 9b4c1f4..eabd9fe 100644 ---- a/xbmc/dialogs/GUIDialogSelect.h -+++ b/xbmc/dialogs/GUIDialogSelect.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "GUIDialogBoxBase.h" - #include "view/GUIViewControl.h" - -diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp b/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -index b06d510..09f0a8b 100644 ---- a/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -+++ b/xbmc/dialogs/GUIDialogSmartPlaylistRule.cpp -@@ -342,7 +342,7 @@ void CGUIDialogSmartPlaylistRule::OnBrowse() - iLabel = 20459; - } - else -- { //! @todo Add browseability in here. -+ { // TODO: Add browseability in here. - assert(false); - } - -diff --git a/xbmc/epg/Epg.cpp b/xbmc/epg/Epg.cpp -index b8e09b8..a1ba577 100644 ---- a/xbmc/epg/Epg.cpp -+++ b/xbmc/epg/Epg.cpp -@@ -111,6 +111,17 @@ void CEpg::SetName(const std::string &strName) - } - } - -+void CEpg::SetScraperName(const std::string &strScraperName) -+{ -+ CSingleLock lock(m_critSection); -+ -+ if (m_strScraperName != strScraperName) -+ { -+ m_bChanged = true; -+ m_strScraperName = strScraperName; -+ } -+} -+ - void CEpg::SetUpdatePending(bool bUpdatePending /* = true */) - { - { -@@ -242,6 +253,18 @@ bool CEpg::CheckPlayingEvent(void) - return false; - } - -+CEpgInfoTagPtr CEpg::GetTag(const CDateTime &StartTime) const -+{ -+ CSingleLock lock(m_critSection); -+ std::map::const_iterator it = m_tags.find(StartTime); -+ if (it != m_tags.end()) -+ { -+ return it->second; -+ } -+ -+ return CEpgInfoTagPtr(); -+} -+ - CEpgInfoTagPtr CEpg::GetTagByBroadcastId(unsigned int iUniqueBroadcastId) const - { - if (iUniqueBroadcastId != EPG_TAG_INVALID_UID) -@@ -268,23 +291,16 @@ CEpgInfoTagPtr CEpg::GetTagBetween(const CDateTime &beginTime, const CDateTime & - return CEpgInfoTagPtr(); - } - --std::vector CEpg::GetTagsBetween(const CDateTime &beginTime, const CDateTime &endTime) const -+CEpgInfoTagPtr CEpg::GetTagAround(const CDateTime &time) const - { -- std::vector epgTags; -- - CSingleLock lock(m_critSection); -- for (const auto &infoTag : m_tags) -+ for (std::map::const_iterator it = m_tags.begin(); it != m_tags.end(); ++it) - { -- if (infoTag.second->StartAsUTC() >= beginTime) -- { -- if (infoTag.second->EndAsUTC() <= endTime) -- epgTags.emplace_back(infoTag.second); -- else -- break; // done. -- } -+ if ((it->second->StartAsUTC() < time) && (it->second->EndAsUTC() > time)) -+ return it->second; - } - -- return epgTags; -+ return CEpgInfoTagPtr(); - } - - void CEpg::AddEntry(const CEpgInfoTag &tag) -@@ -386,7 +402,7 @@ bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, std: - auto it = (eit == m_tags.end()) ? m_tags.find(tag->StartAsUTC()) : eit; - if (it == m_tags.end()) - { -- // It is not guaranteed that the deleted tag contains valid start time. search sequential. -+ // not guranteed that deleted tag contains valid start time. search sequential. - for (it = m_tags.begin(); it != m_tags.end(); ++it) - { - if (it->second->UniqueBroadcastID() == tag->UniqueBroadcastID()) -@@ -396,16 +412,11 @@ bool CEpg::UpdateEntry(const CEpgInfoTagPtr &tag, EPG_EVENT_STATE newState, std: - - if (it != m_tags.end()) - { -- // Respect epg linger time. -- const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0)); -- if (it->second->EndAsUTC() < cleanupTime) -- { -- if (bUpdateDatabase) -- m_deletedTags.insert(std::make_pair(it->second->UniqueBroadcastID(), it->second)); -+ it->second->ClearTimer(); -+ m_tags.erase(it); - -- it->second->ClearTimer(); -- m_tags.erase(it); -- } -+ if (bUpdateDatabase) -+ m_deletedTags.insert(std::make_pair(infoTag->UniqueBroadcastID(), infoTag)); - } - else - { -@@ -447,13 +458,13 @@ bool CEpg::Load(void) - int iEntriesLoaded = database->Get(*this); - if (iEntriesLoaded <= 0) - { -- CLog::Log(LOGDEBUG, "EPG - %s - no database entries found for table '%s'.", __FUNCTION__, m_strName.c_str()); -+ CLog::Log(LOGPVR, "EPG - %s - no database entries found for table '%s'.", __FUNCTION__, m_strName.c_str()); - } - else - { - m_lastScanTime = GetLastScanTime(); - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "EPG - %s - %d entries loaded for table '%s'.", __FUNCTION__, (int) m_tags.size(), m_strName.c_str()); -+ CLog::Log(LOGPVR, "EPG - %s - %d entries loaded for table '%s'.", __FUNCTION__, (int) m_tags.size(), m_strName.c_str()); - #endif - bReturn = true; - } -@@ -467,19 +478,19 @@ bool CEpg::UpdateEntries(const CEpg &epg, bool bStoreInDb /* = true */) - { - CSingleLock lock(m_critSection); - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "EPG - %s - %" PRIuS" entries in memory before merging", __FUNCTION__, m_tags.size()); -+ CLog::Log(LOGPVR, "EPG - %s - %" PRIuS" entries in memory before merging", __FUNCTION__, m_tags.size()); - #endif - /* copy over tags */ - for (std::map::const_iterator it = epg.m_tags.begin(); it != epg.m_tags.end(); ++it) - UpdateEntry(it->second, false, bStoreInDb); - - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "EPG - %s - %" PRIuS" entries in memory after merging and before fixing", __FUNCTION__, m_tags.size()); -+ CLog::Log(LOGPVR, "EPG - %s - %" PRIuS" entries in memory after merging and before fixing", __FUNCTION__, m_tags.size()); - #endif - FixOverlappingEvents(bStoreInDb); - - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "EPG - %s - %" PRIuS" entries in memory after fixing", __FUNCTION__, m_tags.size()); -+ CLog::Log(LOGPVR, "EPG - %s - %" PRIuS" entries in memory after fixing", __FUNCTION__, m_tags.size()); - #endif - /* update the last scan time of this table */ - m_lastScanTime = CDateTime::GetCurrentDateTime().GetAsUTCDateTime(); -@@ -610,7 +621,7 @@ bool CEpg::Persist(void) - return true; - - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "persist table '%s' (#%d) changed=%d deleted=%d", Name().c_str(), m_iEpgID, m_changedTags.size(), m_deletedTags.size()); -+ CLog::Log(LOGPVR, "persist table '%s' (#%d) changed=%d deleted=%d", Name().c_str(), m_iEpgID, m_changedTags.size(), m_deletedTags.size()); - #endif - - CEpgDatabase *database = g_EpgContainer.GetDatabase(); -@@ -731,24 +742,24 @@ bool CEpg::UpdateFromScraper(time_t start, time_t end) - else if (!channel->EPGEnabled()) - { - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "EPG - %s - EPG updating disabled in the channel configuration", __FUNCTION__); -+ CLog::Log(LOGPVR, "EPG - %s - EPG updating disabled in the channel configuration", __FUNCTION__); - #endif - bGrabSuccess = true; - } - else if (channel->IsHidden()) - { - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "EPG - %s - channel '%s' on client '%i' is hidden", __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); -+ CLog::Log(LOGPVR, "EPG - %s - channel '%s' on client '%i' is hidden", __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); - #endif - bGrabSuccess = true; - } - else if (!g_PVRClients->SupportsEPG(channel->ClientID())) - { -- CLog::Log(LOGDEBUG, "EPG - %s - the backend for channel '%s' on client '%i' does not support EPGs", __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); -+ CLog::Log(LOGPVR, "EPG - %s - the backend for channel '%s' on client '%i' does not support EPGs", __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); - } - else - { -- CLog::Log(LOGDEBUG, "EPG - %s - updating EPG for channel '%s' from client '%i'", __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); -+ CLog::Log(LOGPVR, "EPG - %s - updating EPG for channel '%s' from client '%i'", __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); - bGrabSuccess = (g_PVRClients->GetEPGForChannel(channel, this, start, end) == PVR_ERROR_NO_ERROR); - } - } -@@ -758,7 +769,7 @@ bool CEpg::UpdateFromScraper(time_t start, time_t end) - { - CLog::Log(LOGINFO, "EPG - %s - updating EPG table '%s' with scraper '%s'", __FUNCTION__, m_strName.c_str(), m_strScraperName.c_str()); - CLog::Log(LOGWARNING, "loading the EPG via scraper has not been implemented yet"); -- //! @todo Add Support for Web EPG Scrapers here -+ // TODO: Add Support for Web EPG Scrapers here - } - - return bGrabSuccess; -@@ -814,6 +825,17 @@ const std::string &CEpg::ConvertGenreIdToString(int iID, int iSubID) - return g_localizeStrings.Get(iLabelId); - } - -+bool CEpg::IsRadio(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_pvrChannel ? m_pvrChannel->IsRadio() : false; -+} -+ -+bool CEpg::IsRemovableTag(const CEpgInfoTag &tag) const -+{ -+ return !tag.HasTimer(); -+} -+ - bool CEpg::LoadFromClients(time_t start, time_t end) - { - bool bReturn(false); -@@ -845,6 +867,20 @@ CEpgInfoTagPtr CEpg::GetNextEvent(const CEpgInfoTag& tag) const - return retVal; - } - -+CEpgInfoTagPtr CEpg::GetPreviousEvent(const CEpgInfoTag& tag) const -+{ -+ CSingleLock lock(m_critSection); -+ std::map::const_iterator it = m_tags.find(tag.StartAsUTC()); -+ if (it != m_tags.end() && it != m_tags.begin()) -+ { -+ --it; -+ return it->second; -+ } -+ -+ CEpgInfoTagPtr retVal; -+ return retVal; -+} -+ - CPVRChannelPtr CEpg::Channel(void) const - { - CSingleLock lock(m_critSection); -@@ -857,6 +893,18 @@ int CEpg::ChannelID(void) const - return m_pvrChannel ? m_pvrChannel->ChannelID() : -1; - } - -+int CEpg::ChannelNumber(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_pvrChannel ? m_pvrChannel->ChannelNumber() : -1; -+} -+ -+int CEpg::SubChannelNumber(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_pvrChannel ? m_pvrChannel->SubChannelNumber() : -1; -+} -+ - void CEpg::SetChannel(const PVR::CPVRChannelPtr &channel) - { - CSingleLock lock(m_critSection); -@@ -873,6 +921,12 @@ void CEpg::SetChannel(const PVR::CPVRChannelPtr &channel) - } - } - -+bool CEpg::HasPVRChannel(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_pvrChannel != NULL; -+} -+ - bool CEpg::UpdatePending(void) const - { - CSingleLock lock(m_critSection); -diff --git a/xbmc/epg/Epg.h b/xbmc/epg/Epg.h -index d47c8d0..1280a55 100644 ---- a/xbmc/epg/Epg.h -+++ b/xbmc/epg/Epg.h -@@ -82,6 +82,8 @@ namespace EPG - PVR::CPVRChannelPtr Channel(void) const; - - int ChannelID(void) const; -+ int ChannelNumber(void) const; -+ int SubChannelNumber(void) const; - - /*! - * @brief Channel the channel tag linked to this EPG table. -@@ -96,6 +98,12 @@ namespace EPG - const std::string &ScraperName(void) const { return m_strScraperName; } - - /*! -+ * @brief Change the name of the scraper to use. -+ * @param strScraperName The new scraper. -+ */ -+ void SetScraperName(const std::string &strScraperName); -+ -+ /*! - * @brief Specify if EPG should be manually updated on the next cycle - * @param bUpdatePending True if EPG should be manually updated - */ -@@ -137,6 +145,11 @@ namespace EPG - bool HasValidEntries(void) const; - - /*! -+ * @return True if this EPG has a PVR channel set, false otherwise. -+ */ -+ bool HasPVRChannel(void) const; -+ -+ /*! - * @brief Remove all entries from this EPG that finished before the given time - * and that have no timers set. - * @param Time Delete entries with an end time before this time in UTC. -@@ -167,6 +180,13 @@ namespace EPG - CEpgInfoTagPtr GetTagNext() const; - - /*! -+ * @brief Get the event that occurs at the given time. -+ * @param time The time in UTC to find the event for. -+ * @return The found tag or NULL if it wasn't found. -+ */ -+ CEpgInfoTagPtr GetTagAround(const CDateTime &time) const; -+ -+ /*! - * Get the event that occurs between the given begin and end time. - * @param beginTime Minimum start time in UTC of the event. - * @param endTime Maximum end time in UTC of the event. -@@ -175,12 +195,15 @@ namespace EPG - CEpgInfoTagPtr GetTagBetween(const CDateTime &beginTime, const CDateTime &endTime) const; - - /*! -- * Get all events occuring between the given begin and end time. -- * @param beginTime Minimum start time in UTC of the event. -- * @param endTime Maximum end time in UTC of the event. -- * @return The tags found or an empty vector if none was found. -+ * @brief Get the infotag with the given begin time. -+ * -+ * Get the infotag with the given ID. -+ * If it wasn't found, try finding the event with the given start time -+ * -+ * @param beginTime The start time in UTC of the event to find if it wasn't found by it's unique ID. -+ * @return The found tag or an empty tag if it wasn't found. - */ -- std::vector GetTagsBetween(const CDateTime &beginTime, const CDateTime &endTime) const; -+ CEpgInfoTagPtr GetTag(const CDateTime &beginTime) const; - - /*! - * @brief Get the event matching the given unique broadcast id -@@ -276,7 +299,13 @@ namespace EPG - */ - bool UpdateEntry(const EPG_TAG *data, bool bUpdateDatabase = false); - -+ /*! -+ * @return True if this is an EPG table for a radio channel, false otherwise. -+ */ -+ bool IsRadio(void) const; -+ - CEpgInfoTagPtr GetNextEvent(const CEpgInfoTag& tag) const; -+ CEpgInfoTagPtr GetPreviousEvent(const CEpgInfoTag& tag) const; - - size_t Size(void) const; - -@@ -302,7 +331,7 @@ namespace EPG - - /*! - * @brief Update the EPG from a scraper set in the channel tag. -- * @todo not implemented yet for non-pvr EPGs -+ * TODO: not implemented yet for non-pvr EPGs - * @param start Get entries with a start date after this time. - * @param end Get entries with an end date before this time. - * @return True if the update was successful, false otherwise. -@@ -338,6 +367,8 @@ namespace EPG - */ - bool UpdateEntries(const CEpg &epg, bool bStoreInDb = true); - -+ bool IsRemovableTag(const EPG::CEpgInfoTag &tag) const; -+ - std::map m_tags; - std::map m_changedTags; - std::map m_deletedTags; -diff --git a/xbmc/epg/EpgContainer.cpp b/xbmc/epg/EpgContainer.cpp -index 023aa7d..08fc87b 100644 ---- a/xbmc/epg/EpgContainer.cpp -+++ b/xbmc/epg/EpgContainer.cpp -@@ -31,7 +31,6 @@ - #include "pvr/channels/PVRChannelGroupsContainer.h" - #include "pvr/PVRManager.h" - #include "pvr/recordings/PVRRecordings.h" --#include "pvr/timers/PVRTimerInfoTag.h" - #include "settings/AdvancedSettings.h" - #include "settings/lib/Setting.h" - #include "settings/Settings.h" -@@ -240,21 +239,18 @@ void CEpgContainer::LoadFromDB(void) - if (m_database.IsOpen()) - { - { -- //! @bug -- //! unlock m_critSection before calling ShowProgressDialog() - -- //! this is not legal, but works around a deadlock bug (because -- //! ShowProgressDialog() calls functions which lock -- //! g_graphicsContext); note that ShowProgressDialog() is -- //! sometimes called with m_critSection locked and sometimes -- //! without; this is a major bug that must be addressed -- //! eventually -+ /* unlock m_critSection before calling ShowProgressDialog() - -+ this is not legal, but works around a deadlock bug (because -+ ShowProgressDialog() calls functions which lock -+ g_graphicsContext); note that ShowProgressDialog() is -+ sometimes called with m_critSection locked and sometimes -+ without; this is a major bug that must be addressed -+ eventually */ - CSingleExit exit(m_critSection); - ShowProgressDialog(false); - } - -- const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - -- CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0)); -- m_database.DeleteEpgEntries(cleanupTime); -+ m_database.DeleteOldEpgEntries(); - m_database.Get(*this); - - for (const auto &epgEntry : m_epgs) -@@ -273,6 +269,14 @@ void CEpgContainer::LoadFromDB(void) - m_bLoaded = bLoaded; - } - -+bool CEpgContainer::PersistTables(void) -+{ -+ m_critSection.lock(); -+ auto copy = m_epgs; -+ m_critSection.unlock(); -+ return m_database.Persist(copy); -+} -+ - bool CEpgContainer::PersistAll(void) - { - bool bReturn(true); -@@ -311,7 +315,7 @@ void CEpgContainer::Process(void) - m_bIsInitialising = false; - - /* clean up old entries */ -- if (!m_bStop && iNow >= m_iLastEpgCleanup + g_advancedSettings.m_iEpgCleanupInterval) -+ if (!m_bStop && iNow >= m_iLastEpgCleanup) - RemoveOldEntries(); - - /* check for pending manual EPG updates */ -@@ -390,20 +394,16 @@ CEpgInfoTagPtr CEpgContainer::GetTagById(const CPVRChannelPtr &channel, unsigned - return retval; - } - --std::vector CEpgContainer::GetEpgTagsForTimer(const CPVRTimerInfoTagPtr &timer) const -+CEpgPtr CEpgContainer::GetByChannel(const CPVRChannel &channel) const - { -- CPVRChannelPtr channel(timer->ChannelTag()); -- -- if (!channel) -- channel = timer->UpdateChannel(); -- -- if (channel) -+ CSingleLock lock(m_critSection); -+ for (const auto &epgEntry : m_epgs) - { -- const CEpgPtr epg(channel->GetEPG()); -- if (epg) -- return epg->GetTagsBetween(timer->StartAsUTC(), timer->EndAsUTC()); -+ if (channel.ChannelID() == epgEntry.second->ChannelID()) -+ return epgEntry.second; - } -- return std::vector(); -+ -+ return CEpgPtr(); - } - - void CEpgContainer::InsertFromDatabase(int iEpgID, const std::string &strName, const std::string &strScraperName) -@@ -432,7 +432,7 @@ void CEpgContainer::InsertFromDatabase(int iEpgID, const std::string &strName, c - } - } - --CEpgPtr CEpgContainer::CreateChannelEpg(const CPVRChannelPtr &channel) -+CEpgPtr CEpgContainer::CreateChannelEpg(CPVRChannelPtr channel) - { - if (!channel) - return CEpgPtr(); -@@ -480,19 +480,20 @@ bool CEpgContainer::LoadSettings(void) - - bool CEpgContainer::RemoveOldEntries(void) - { -- const CDateTime cleanupTime(CDateTime::GetUTCDateTime() - -- CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0)); -+ CDateTime now = CDateTime::GetUTCDateTime() - -+ CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0); - - /* call Cleanup() on all known EPG tables */ - for (const auto &epgEntry : m_epgs) -- epgEntry.second->Cleanup(cleanupTime); -+ epgEntry.second->Cleanup(now); - - /* remove the old entries from the database */ - if (!m_bIgnoreDbForClient && m_database.IsOpen()) -- m_database.DeleteEpgEntries(cleanupTime); -+ m_database.DeleteOldEpgEntries(); - - CSingleLock lock(m_critSection); - CDateTime::GetCurrentDateTime().GetAsUTCDateTime().GetAsTime(m_iLastEpgCleanup); -+ m_iLastEpgCleanup += g_advancedSettings.m_iEpgCleanupInterval; - - return true; - } -@@ -508,7 +509,7 @@ bool CEpgContainer::DeleteEpg(const CEpg &epg, bool bDeleteFromDatabase /* = fal - if (epgEntry == m_epgs.end()) - return false; - -- CLog::Log(LOGDEBUG, "deleting EPG table %s (%d)", epg.Name().c_str(), epg.EpgID()); -+ CLog::Log(LOGPVR, "deleting EPG table %s (%d)", epg.Name().c_str(), epg.EpgID()); - if (bDeleteFromDatabase && !m_bIgnoreDbForClient && m_database.IsOpen()) - m_database.Delete(*epgEntry->second); - -@@ -695,6 +696,17 @@ bool CEpgContainer::UpdateEPG(bool bOnlyPending /* = false */) - return !bInterrupted; - } - -+int CEpgContainer::GetEPGAll(CFileItemList &results) -+{ -+ int iInitialSize = results.Size(); -+ -+ CSingleLock lock(m_critSection); -+ for (const auto &epgEntry : m_epgs) -+ epgEntry.second->Get(results); -+ -+ return results.Size() - iInitialSize; -+} -+ - const CDateTime CEpgContainer::GetFirstEPGDate(void) - { - CDateTime returnValue; -@@ -780,6 +792,12 @@ bool CEpgContainer::CheckPlayingEvents(void) - return bReturn; - } - -+bool CEpgContainer::IsInitialising(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bIsInitialising; -+} -+ - void CEpgContainer::SetHasPendingUpdates(bool bHasPendingUpdates /* = true */) - { - CSingleLock lock(m_critSection); -diff --git a/xbmc/epg/EpgContainer.h b/xbmc/epg/EpgContainer.h -index 5c0bfb9..006fd07 100644 ---- a/xbmc/epg/EpgContainer.h -+++ b/xbmc/epg/EpgContainer.h -@@ -76,29 +76,29 @@ namespace EPG - * @brief Start the EPG update thread. - * @param bAsync Should the EPG container starts asynchronously - */ -- void Start(bool bAsync); -+ virtual void Start(bool bAsync); - - /*! - * @brief Stop the EPG update thread. - * @return - */ -- bool Stop(void); -+ virtual bool Stop(void); - - /*! - * @brief Clear all EPG entries. - * @param bClearDb Clear the database too if true. - */ -- void Clear(bool bClearDb = false); -+ virtual void Clear(bool bClearDb = false); - - /*! - * @brief Stop the update thread and unload all data. - */ -- void Unload(void); -+ virtual void Unload(void); - - /*! - * @brief Clear the EPG and all it's database entries. - */ -- void Reset(void) { Clear(true); } -+ virtual void Reset(void) { Clear(true); } - - /*! - * @brief Check whether the EpgContainer has fully started. -@@ -112,7 +112,7 @@ namespace EPG - * @param bDeleteFromDatabase Delete this table from the database too if true. - * @return - */ -- bool DeleteEpg(const CEpg &epg, bool bDeleteFromDatabase = false); -+ virtual bool DeleteEpg(const CEpg &epg, bool bDeleteFromDatabase = false); - - /*! - * @brief Process a notification from an observable. -@@ -123,7 +123,7 @@ namespace EPG - - virtual void OnSettingChanged(const CSetting *setting) override; - -- CEpgPtr CreateChannelEpg(const PVR::CPVRChannelPtr &channel); -+ CEpgPtr CreateChannelEpg(PVR::CPVRChannelPtr channel); - - /*! - * @brief Get all EPG tables and apply a filter. -@@ -131,26 +131,33 @@ namespace EPG - * @param filter The filter to apply. - * @return The amount of entries that were added. - */ -- int GetEPGSearch(CFileItemList &results, const EpgSearchFilter &filter); -+ virtual int GetEPGSearch(CFileItemList &results, const EpgSearchFilter &filter); -+ -+ /*! -+ * @brief Get all EPG tables. -+ * @param results The fileitem list to store the results in. -+ * @return The amount of entries that were added. -+ */ -+ virtual int GetEPGAll(CFileItemList &results); - - /*! - * @brief Get the start time of the first entry. - * @return The start time. - */ -- const CDateTime GetFirstEPGDate(void); -+ virtual const CDateTime GetFirstEPGDate(void); - - /*! - * @brief Get the end time of the last entry. - * @return The end time. - */ -- const CDateTime GetLastEPGDate(void); -+ virtual const CDateTime GetLastEPGDate(void); - - /*! - * @brief Get an EPG table given it's ID. - * @param iEpgId The database ID of the table. - * @return The table or NULL if it wasn't found. - */ -- CEpgPtr GetById(int iEpgId) const; -+ virtual CEpgPtr GetById(int iEpgId) const; - - /*! - * @brief Get the EPG event with the given event id -@@ -158,20 +165,20 @@ namespace EPG - * @param iBroadcastId The event id to get - * @return The requested event, or an empty tag when not found - */ -- CEpgInfoTagPtr GetTagById(const PVR::CPVRChannelPtr &channel, unsigned int iBroadcastId) const; -+ virtual CEpgInfoTagPtr GetTagById(const PVR::CPVRChannelPtr &channel, unsigned int iBroadcastId) const; - - /*! -- * @brief Get the EPG events matching the given timer -- * @param timer The timer to get the matching events for. -- * @return The matching events, or an empty vector when no matching tag was found -+ * @brief Get an EPG table given a PVR channel. -+ * @param channel The channel to get the EPG table for. -+ * @return The table or NULL if it wasn't found. - */ -- std::vector GetEpgTagsForTimer(const PVR::CPVRTimerInfoTagPtr &timer) const; -+ virtual CEpgPtr GetByChannel(const PVR::CPVRChannel &channel) const; - - /*! - * @brief Notify EPG table observers when the currently active tag changed. - * @return True if the check was done, false if it was not the right time to check - */ -- bool CheckPlayingEvents(void); -+ virtual bool CheckPlayingEvents(void); - - /*! - * @brief The next EPG ID to be given to a table when the db isn't being used. -@@ -182,13 +189,13 @@ namespace EPG - /*! - * @brief Close the progress bar if it's visible. - */ -- void CloseProgressDialog(void); -+ virtual void CloseProgressDialog(void); - - /*! - * @brief Show the progress bar - * @param bUpdating True if updating epg entries, false if just loading them from db - */ -- void ShowProgressDialog(bool bUpdating = true); -+ virtual void ShowProgressDialog(bool bUpdating = true); - - /*! - * @brief Update the progress bar. -@@ -196,12 +203,12 @@ namespace EPG - * @param iMax The maximum position. - * @param strText The text to display. - */ -- void UpdateProgressDialog(int iCurrent, int iMax, const std::string &strText); -+ virtual void UpdateProgressDialog(int iCurrent, int iMax, const std::string &strText); - - /*! - * @return True to not to store EPG entries in the database. - */ -- bool IgnoreDB(void) const { return m_bIgnoreDbForClient; } -+ virtual bool IgnoreDB(void) const { return m_bIgnoreDbForClient; } - - /*! - * @brief Wait for an EPG update to finish. -@@ -222,11 +229,18 @@ namespace EPG - void SetHasPendingUpdates(bool bHasPendingUpdates = true); - - /*! -+ * @return True while being initialised. -+ */ -+ bool IsInitialising(void) const; -+ -+ /*! - * @brief Call Persist() on each table - * @return True when they all were persisted, false otherwise. - */ - bool PersistAll(void); - -+ bool PersistTables(void); -+ - /*! - * @brief client can trigger an update request for a channel - */ -@@ -237,25 +251,25 @@ namespace EPG - * @brief Load the EPG settings. - * @return True if the settings were loaded successfully, false otherwise. - */ -- bool LoadSettings(void); -+ virtual bool LoadSettings(void); - - /*! - * @brief Remove old EPG entries. - * @return True if the old entries were removed successfully, false otherwise. - */ -- bool RemoveOldEntries(void); -+ virtual bool RemoveOldEntries(void); - - /*! - * @brief Load and update the EPG data. - * @param bOnlyPending Only check and update EPG tables with pending manual updates - * @return True if the update has not been interrupted, false otherwise. - */ -- bool UpdateEPG(bool bOnlyPending = false); -+ virtual bool UpdateEPG(bool bOnlyPending = false); - - /*! - * @return True if a running update should be interrupted, false otherwise. - */ -- bool InterruptUpdate(void) const; -+ virtual bool InterruptUpdate(void) const; - - /*! - * @brief EPG update thread -diff --git a/xbmc/epg/EpgDatabase.cpp b/xbmc/epg/EpgDatabase.cpp -index 6b5049f..a9bd1d0 100644 ---- a/xbmc/epg/EpgDatabase.cpp -+++ b/xbmc/epg/EpgDatabase.cpp -@@ -42,7 +42,7 @@ void CEpgDatabase::CreateTables(void) - { - CLog::Log(LOGINFO, "EpgDB - %s - creating tables", __FUNCTION__); - -- CLog::Log(LOGDEBUG, "EpgDB - %s - creating table 'epg'", __FUNCTION__); -+ CLog::Log(LOGPVR, "EpgDB - %s - creating table 'epg'", __FUNCTION__); - m_pDS->exec( - "CREATE TABLE epg (" - "idEpg integer primary key, " -@@ -51,7 +51,7 @@ void CEpgDatabase::CreateTables(void) - ")" - ); - -- CLog::Log(LOGDEBUG, "EpgDB - %s - creating table 'epgtags'", __FUNCTION__); -+ CLog::Log(LOGPVR, "EpgDB - %s - creating table 'epgtags'", __FUNCTION__); - m_pDS->exec( - "CREATE TABLE epgtags (" - "idBroadcast integer primary key, " -@@ -83,7 +83,7 @@ void CEpgDatabase::CreateTables(void) - "iFlags integer" - ")" - ); -- CLog::Log(LOGDEBUG, "EpgDB - %s - creating table 'lastepgscan'", __FUNCTION__); -+ CLog::Log(LOGPVR, "EpgDB - %s - creating table 'lastepgscan'", __FUNCTION__); - m_pDS->exec("CREATE TABLE lastepgscan (" - "idEpg integer primary key, " - "sLastScan varchar(20)" -@@ -93,7 +93,7 @@ void CEpgDatabase::CreateTables(void) - - void CEpgDatabase::CreateAnalytics() - { -- CLog::Log(LOGDEBUG, "%s - creating indices", __FUNCTION__); -+ CLog::Log(LOGPVR, "%s - creating indices", __FUNCTION__); - m_pDS->exec("CREATE UNIQUE INDEX idx_epg_idEpg_iStartTime on epgtags(idEpg, iStartTime desc);"); - m_pDS->exec("CREATE INDEX idx_epg_iEndTime on epgtags(iEndTime);"); - } -@@ -125,7 +125,7 @@ void CEpgDatabase::UpdateTables(int iVersion) - bool CEpgDatabase::DeleteEpg(void) - { - bool bReturn(false); -- CLog::Log(LOGDEBUG, "EpgDB - %s - deleting all EPG data from the database", __FUNCTION__); -+ CLog::Log(LOGPVR, "EpgDB - %s - deleting all EPG data from the database", __FUNCTION__); - - bReturn = DeleteValues("epg") || bReturn; - bReturn = DeleteValues("epgtags") || bReturn; -@@ -149,13 +149,15 @@ bool CEpgDatabase::Delete(const CEpg &table) - return DeleteValues("epg", filter); - } - --bool CEpgDatabase::DeleteEpgEntries(const CDateTime &maxEndTime) -+bool CEpgDatabase::DeleteOldEpgEntries(void) - { -- time_t iMaxEndTime; -- maxEndTime.GetAsTime(iMaxEndTime); -+ time_t iCleanupTime; -+ CDateTime cleanupTime = CDateTime::GetCurrentDateTime().GetAsUTCDateTime() - -+ CDateTimeSpan(0, g_advancedSettings.m_iEpgLingerTime / 60, g_advancedSettings.m_iEpgLingerTime % 60, 0); -+ cleanupTime.GetAsTime(iCleanupTime); - - Filter filter; -- filter.AppendWhere(PrepareSQL("iEndTime < %u", iMaxEndTime)); -+ filter.AppendWhere(PrepareSQL("iEndTime < %u", iCleanupTime)); - - return DeleteValues("epgtags", filter); - } -diff --git a/xbmc/epg/EpgDatabase.h b/xbmc/epg/EpgDatabase.h -index b25ac20..19ac90f 100644 ---- a/xbmc/epg/EpgDatabase.h -+++ b/xbmc/epg/EpgDatabase.h -@@ -84,11 +84,10 @@ namespace EPG - virtual bool Delete(const CEpg &table); - - /*! -- * @brief Erase all EPG entries with an end time less than the given time. -- * @param maxEndTime The maximum allowed end time. -+ * @brief Erase all EPG entries older than 1 day. - * @return True if the entries were removed successfully, false otherwise. - */ -- virtual bool DeleteEpgEntries(const CDateTime &maxEndTime); -+ virtual bool DeleteOldEpgEntries(void); - - /*! - * @brief Remove a single EPG entry. -diff --git a/xbmc/epg/EpgInfoTag.cpp b/xbmc/epg/EpgInfoTag.cpp -index d69b469..aa3b2a3 100644 ---- a/xbmc/epg/EpgInfoTag.cpp -+++ b/xbmc/epg/EpgInfoTag.cpp -@@ -134,6 +134,8 @@ CEpgInfoTag::CEpgInfoTag(const EPG_TAG &data) : - - CEpgInfoTag::~CEpgInfoTag() - { -+ ClearTimer(); -+ ClearRecording(); - } - - bool CEpgInfoTag::operator ==(const CEpgInfoTag& right) const -@@ -288,6 +290,11 @@ CEpgInfoTagPtr CEpgInfoTag::GetNextEvent(void) const - return GetTable()->GetNextEvent(*this); - } - -+CEpgInfoTagPtr CEpgInfoTag::GetPreviousEvent(void) const -+{ -+ return GetTable()->GetPreviousEvent(*this); -+} -+ - void CEpgInfoTag::SetUniqueBroadcastID(unsigned int iUniqueBroadcastID) - { - m_iUniqueBroadcastID = iUniqueBroadcastID; -@@ -669,7 +676,7 @@ bool CEpgInfoTag::Persist(bool bSingleUpdate /* = true */) - bool bReturn = false; - - #if EPG_DEBUGGING -- CLog::Log(LOGDEBUG, "Epg - %s - Infotag '%s' %s, persisting...", __FUNCTION__, m_strTitle.c_str(), m_iBroadcastId > 0 ? "has changes" : "is new"); -+ CLog::Log(LOGPVR, "Epg - %s - Infotag '%s' %s, persisting...", __FUNCTION__, m_strTitle.c_str(), m_iBroadcastId > 0 ? "has changes" : "is new"); - #endif - - CEpgDatabase *database = g_EpgContainer.GetDatabase(); -diff --git a/xbmc/epg/EpgInfoTag.h b/xbmc/epg/EpgInfoTag.h -index cabc86c..3f5d080 100644 ---- a/xbmc/epg/EpgInfoTag.h -+++ b/xbmc/epg/EpgInfoTag.h -@@ -21,7 +21,6 @@ - - #include - #include --#include - - #include "XBDateTime.h" - #include "addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h" -@@ -68,8 +67,17 @@ namespace EPG - */ - CEpgInfoTag(CEpg *epg, PVR::CPVRChannelPtr pvrChannel, const std::string &strTableName = "", const std::string &strIconPath = ""); - -- CEpgInfoTag(const CEpgInfoTag &tag) = delete; -- CEpgInfoTag &operator =(const CEpgInfoTag &other) = delete; -+ // Prevent copy construction, even for CEpgInfoTag instances and friends. -+ // Note: Only declared, but intentionally not implemented -+ // to prevent compiler generated copy ctor and to force -+ // a linker error in case somebody tries to call it. -+ CEpgInfoTag(const CEpgInfoTag &tag); -+ -+ // Prevent copy by assignment, even for CEpgInfoTag instances and friends. -+ // Note: Only declared, but intentionally not implemented -+ // to prevent compiler generated assignment operator and to force -+ // a linker error in case somebody tries to call it. -+ CEpgInfoTag &operator =(const CEpgInfoTag &other); - - public: - virtual ~CEpgInfoTag(); -@@ -112,6 +120,12 @@ namespace EPG - CEpgInfoTagPtr GetNextEvent(void) const; - - /*! -+ * @brief Get a pointer to the previous event. Set by CEpg in a call to Sort() -+ * @return A pointer to the previous event or NULL if it's not set. -+ */ -+ CEpgInfoTagPtr GetPreviousEvent(void) const; -+ -+ /*! - * @brief The table this event belongs to - * @return The table this event belongs to - */ -diff --git a/xbmc/epg/EpgSearchFilter.cpp b/xbmc/epg/EpgSearchFilter.cpp -index f87d3e4..e706334 100644 ---- a/xbmc/epg/EpgSearchFilter.cpp -+++ b/xbmc/epg/EpgSearchFilter.cpp -@@ -191,3 +191,75 @@ bool EpgSearchFilter::MatchChannelGroup(const CEpgInfoTag &tag) const - - return bReturn; - } -+ -+int EpgSearchFilter::FilterRecordings(CFileItemList &results) -+{ -+ int iRemoved(0); -+ if (!g_PVRManager.IsStarted()) -+ return iRemoved; -+ -+ CFileItemList recordings; -+ g_PVRRecordings->GetAll(recordings); -+ -+ // TODO inefficient! -+ CPVRRecordingPtr recording; -+ for (int iRecordingPtr = 0; iRecordingPtr < recordings.Size(); iRecordingPtr++) -+ { -+ recording = recordings.Get(iRecordingPtr)->GetPVRRecordingInfoTag(); -+ if (!recording) -+ continue; -+ -+ for (int iResultPtr = 0; iResultPtr < results.Size(); iResultPtr++) -+ { -+ const CEpgInfoTagPtr epgentry(results.Get(iResultPtr)->GetEPGInfoTag()); -+ -+ /* no match */ -+ if (!epgentry || -+ epgentry->Title() != recording->m_strTitle || -+ epgentry->Plot() != recording->m_strPlot) -+ continue; -+ -+ results.Remove(iResultPtr); -+ iResultPtr--; -+ ++iRemoved; -+ } -+ } -+ -+ return iRemoved; -+} -+ -+int EpgSearchFilter::FilterTimers(CFileItemList &results) -+{ -+ int iRemoved(0); -+ if (!g_PVRManager.IsStarted()) -+ return iRemoved; -+ -+ std::vector timers = g_PVRTimers->GetActiveTimers(); -+ // TODO inefficient! -+ for (unsigned int iTimerPtr = 0; iTimerPtr < timers.size(); iTimerPtr++) -+ { -+ CFileItemPtr fileItem = timers.at(iTimerPtr); -+ if (!fileItem || !fileItem->HasPVRTimerInfoTag()) -+ continue; -+ -+ CPVRTimerInfoTagPtr timer = fileItem->GetPVRTimerInfoTag(); -+ if (!timer) -+ continue; -+ -+ for (int iResultPtr = 0; iResultPtr < results.Size(); iResultPtr++) -+ { -+ const CEpgInfoTagPtr epgentry(results.Get(iResultPtr)->GetEPGInfoTag()); -+ if (!epgentry || -+ *epgentry->ChannelTag() != *timer->ChannelTag() || -+ epgentry->StartAsUTC() < timer->StartAsUTC() || -+ epgentry->EndAsUTC() > timer->EndAsUTC()) -+ continue; -+ -+ results.Remove(iResultPtr); -+ iResultPtr--; -+ ++iRemoved; -+ } -+ } -+ -+ return iRemoved; -+} -diff --git a/xbmc/epg/EpgSearchFilter.h b/xbmc/epg/EpgSearchFilter.h -index c6132e6..8d85f4e 100644 ---- a/xbmc/epg/EpgSearchFilter.h -+++ b/xbmc/epg/EpgSearchFilter.h -@@ -33,6 +33,9 @@ namespace EPG - - struct EpgSearchFilter - { -+ static int FilterRecordings(CFileItemList &results); -+ static int FilterTimers(CFileItemList &results); -+ - /*! - * @brief Clear this filter. - */ -diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp -index 162ef94..5f05163 100644 ---- a/xbmc/epg/GUIEPGGridContainer.cpp -+++ b/xbmc/epg/GUIEPGGridContainer.cpp -@@ -510,7 +510,7 @@ void CGUIEPGGridContainer::UpdateItems() - } - else // "gap" tag seleceted - { -- const GridItem *prevItem(GetPrevItem(m_channelCursor)); -+ const GridItemsPtr *prevItem(GetPrevItem(m_channelCursor)); - if (prevItem) - { - const CEpgInfoTagPtr tag(prevItem->item->GetEPGInfoTag()); -@@ -1037,9 +1037,9 @@ std::string CGUIEPGGridContainer::GetLabel(int info) const - return label; - } - --GridItem *CGUIEPGGridContainer::GetClosestItem(int channel) -+GridItemsPtr *CGUIEPGGridContainer::GetClosestItem(int channel) - { -- GridItem *closest = GetItem(channel); -+ GridItemsPtr *closest = GetItem(channel); - - if (!closest) - return nullptr; -@@ -1071,7 +1071,7 @@ GridItem *CGUIEPGGridContainer::GetClosestItem(int channel) - return m_gridModel->GetGridItemPtr(channel + m_channelOffset, m_blockCursor - left + m_blockOffset); - } - --int CGUIEPGGridContainer::GetItemSize(GridItem *item) -+int CGUIEPGGridContainer::GetItemSize(GridItemsPtr *item) - { - if (!item) - return MathUtils::round_int(m_blockSize); // stops it crashing -@@ -1098,7 +1098,7 @@ int CGUIEPGGridContainer::GetRealBlock(const CGUIListItemPtr &item, int channel) - return block; - } - --GridItem *CGUIEPGGridContainer::GetNextItem(int channel) -+GridItemsPtr *CGUIEPGGridContainer::GetNextItem(int channel) - { - int channelIndex = channel + m_channelOffset; - int blockIndex = m_blockCursor + m_blockOffset; -@@ -1116,7 +1116,7 @@ GridItem *CGUIEPGGridContainer::GetNextItem(int channel) - return m_gridModel->GetGridItemPtr(channelIndex, i + m_blockOffset); - } - --GridItem *CGUIEPGGridContainer::GetPrevItem(int channel) -+GridItemsPtr *CGUIEPGGridContainer::GetPrevItem(int channel) - { - int channelIndex = channel + m_channelOffset; - int blockIndex = m_blockCursor + m_blockOffset; -@@ -1131,7 +1131,7 @@ GridItem *CGUIEPGGridContainer::GetPrevItem(int channel) - return m_gridModel->GetGridItemPtr(channelIndex, i + m_blockOffset); - } - --GridItem *CGUIEPGGridContainer::GetItem(int channel) -+GridItemsPtr *CGUIEPGGridContainer::GetItem(int channel) - { - int channelIndex = channel + m_channelOffset; - int blockIndex = m_blockCursor + m_blockOffset; -@@ -1803,7 +1803,7 @@ void CGUIEPGGridContainer::HandleProgrammeGrid(bool bRender, unsigned int curren - - bool focused = (channel == m_channelOffset + m_channelCursor) && (item == m_gridModel->GetGridItem(m_channelOffset + m_channelCursor, m_blockOffset + m_blockCursor)); - -- if (bRender) //! @todo Why the functional difference wrt truncate here? -+ if (bRender) // @@@ TODO why the functional difference wrt truncate here? - { - // reset to grid start position if first item is out of grid view - if (posA2 < posA) -diff --git a/xbmc/epg/GUIEPGGridContainer.h b/xbmc/epg/GUIEPGGridContainer.h -index e867f16..1064013 100644 ---- a/xbmc/epg/GUIEPGGridContainer.h -+++ b/xbmc/epg/GUIEPGGridContainer.h -@@ -19,9 +19,6 @@ - * - */ - --#include --#include -- - #include "XBDateTime.h" - #include "FileItem.h" - #include "guilib/GUIControl.h" -@@ -30,7 +27,7 @@ - - namespace EPG - { -- struct GridItem; -+ class GridItemsPtr; - class CGUIEPGGridContainerModel; - - class CGUIEPGGridContainer : public IGUIContainer -@@ -95,12 +92,12 @@ namespace EPG - void ValidateOffset(); - void UpdateLayout(); - -- GridItem *GetItem(int channel); -- GridItem *GetNextItem(int channel); -- GridItem *GetPrevItem(int channel); -- GridItem *GetClosestItem(int channel); -+ GridItemsPtr *GetItem(int channel); -+ GridItemsPtr *GetNextItem(int channel); -+ GridItemsPtr *GetPrevItem(int channel); -+ GridItemsPtr *GetClosestItem(int channel); - -- int GetItemSize(GridItem *item); -+ int GetItemSize(GridItemsPtr *item); - int GetBlock(const CGUIListItemPtr &item, int channel); - int GetRealBlock(const CGUIListItemPtr &item, int channel); - void MoveToRow(int row); -@@ -198,6 +195,6 @@ namespace EPG - std::unique_ptr m_updatedGridModel; - std::unique_ptr m_outdatedGridModel; - -- GridItem *m_item; -+ GridItemsPtr *m_item; - }; - } -diff --git a/xbmc/epg/GUIEPGGridContainerModel.cpp b/xbmc/epg/GUIEPGGridContainerModel.cpp -index 6434edd..be75067 100644 ---- a/xbmc/epg/GUIEPGGridContainerModel.cpp -+++ b/xbmc/epg/GUIEPGGridContainerModel.cpp -@@ -147,7 +147,7 @@ void CGUIEPGGridContainerModel::Refresh(const std::unique_ptr &it - m_blocks = MAXBLOCKS; - - m_gridIndex.reserve(m_channelItems.size()); -- const std::vector blocks(m_blocks); -+ const std::vector blocks(m_blocks); - - for (size_t channel = 0; channel < m_channelItems.size(); ++channel) - { -diff --git a/xbmc/epg/GUIEPGGridContainerModel.h b/xbmc/epg/GUIEPGGridContainerModel.h -index 4d5b21f..794d280 100644 ---- a/xbmc/epg/GUIEPGGridContainerModel.h -+++ b/xbmc/epg/GUIEPGGridContainerModel.h -@@ -31,14 +31,14 @@ class CFileItemList; - - namespace EPG - { -- struct GridItem -+ struct GridItemsPtr - { - CFileItemPtr item; - float originWidth; - float width; - int progIndex; - -- GridItem() : originWidth(0.0f), width(0.0f), progIndex(-1) {} -+ GridItemsPtr() : originWidth(0.0), width(0.0), progIndex(-1) {} - }; - - class CGUIEPGGridContainerModel -@@ -72,7 +72,7 @@ namespace EPG - - int GetBlockCount() const { return m_blocks; } - bool HasGridItems() const { return !m_gridIndex.empty(); } -- GridItem *GetGridItemPtr(int iChannel, int iBlock) { return &m_gridIndex[iChannel][iBlock]; } -+ GridItemsPtr *GetGridItemPtr(int iChannel, int iBlock) { return &m_gridIndex[iChannel][iBlock]; } - CFileItemPtr GetGridItem(int iChannel, int iBlock) const { return m_gridIndex[iChannel][iBlock].item; } - float GetGridItemWidth(int iChannel, int iBlock) const { return m_gridIndex[iChannel][iBlock].width; } - float GetGridItemOriginWidth(int iChannel, int iBlock) const { return m_gridIndex[iChannel][iBlock].originWidth; } -@@ -100,7 +100,7 @@ namespace EPG - std::vector m_channelItems; - std::vector m_rulerItems; - std::vector m_epgItemsPtr; -- std::vector > m_gridIndex; -+ std::vector > m_gridIndex; - - int m_blocks; - }; -diff --git a/xbmc/events/MediaLibraryEvent.cpp b/xbmc/events/MediaLibraryEvent.cpp -index 2915537..964a685 100644 ---- a/xbmc/events/MediaLibraryEvent.cpp -+++ b/xbmc/events/MediaLibraryEvent.cpp -@@ -83,12 +83,15 @@ bool CMediaLibraryEvent::Execute() const - } - else - { -- //! @todo remove the filename for now as CGUIMediaWindow::GetDirectory() can't handle it -+ // TODO: remove the filename for now as CGUIMediaWindow::GetDirectory() can't handle it - if (m_mediaType == MediaTypeMovie || m_mediaType == MediaTypeMusicVideo || m_mediaType == MediaTypeEpisode) - path = URIUtils::GetDirectory(path); - } - -- windowId = WINDOW_VIDEO_NAV; -+ if (URIUtils::IsVideoDb(path)) -+ windowId = WINDOW_VIDEO_NAV; -+ else -+ windowId = WINDOW_VIDEO_FILES; - } - else if (m_mediaType == MediaTypeMusic || m_mediaType == MediaTypeArtist || - m_mediaType == MediaTypeAlbum || m_mediaType == MediaTypeSong) -@@ -106,12 +109,15 @@ bool CMediaLibraryEvent::Execute() const - } - else - { -- //! @todo remove the filename for now as CGUIMediaWindow::GetDirectory() can't handle it -+ // TODO: remove the filename for now as CGUIMediaWindow::GetDirectory() can't handle it - if (m_mediaType == MediaTypeSong) - path = URIUtils::GetDirectory(path); - } - -- windowId = WINDOW_MUSIC_NAV; -+ if (URIUtils::IsMusicDb(path)) -+ windowId = WINDOW_MUSIC_NAV; -+ else -+ windowId = WINDOW_MUSIC_FILES; - } - - if (windowId < 0) -diff --git a/xbmc/events/windows/GUIWindowEventLog.h b/xbmc/events/windows/GUIWindowEventLog.h -index 4808397..0bd9f3e 100644 ---- a/xbmc/events/windows/GUIWindowEventLog.h -+++ b/xbmc/events/windows/GUIWindowEventLog.h -@@ -28,7 +28,7 @@ public: - virtual ~CGUIWindowEventLog(); - - // specialization of CGUIControl -- virtual bool OnMessage(CGUIMessage& message) override; -+ virtual bool OnMessage(CGUIMessage& message); - - protected: - // specialization of CGUIMediaWindow -diff --git a/xbmc/filesystem/AFPDirectory.cpp b/xbmc/filesystem/AFPDirectory.cpp -new file mode 100644 -index 0000000..a9a7b0a ---- /dev/null -+++ b/xbmc/filesystem/AFPDirectory.cpp -@@ -0,0 +1,326 @@ -+/* -+ * Copyright (C) 2011-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "system.h" -+ -+#if defined(HAS_FILESYSTEM_AFP) -+#include "AFPDirectory.h" -+#include "AFPFile.h" -+#include "Util.h" -+#include "guilib/LocalizeStrings.h" -+#include "Application.h" -+#include "FileItem.h" -+#include "settings/AdvancedSettings.h" -+#include "utils/StringUtils.h" -+#include "utils/log.h" -+#include "utils/URIUtils.h" -+#include "threads/SingleLock.h" -+#include "PasswordManager.h" -+#include "DllLibAfp.h" -+ -+#include "linux/XTimeUtils.cpp" -+ -+struct CachedDirEntry -+{ -+ unsigned int type; -+ std::string name; -+}; -+ -+using namespace XFILE; -+using namespace std; -+ -+CAFPDirectory::CAFPDirectory(void) -+{ -+ gAfpConnection.AddActiveConnection(); -+} -+ -+CAFPDirectory::~CAFPDirectory(void) -+{ -+ gAfpConnection.AddIdleConnection(); -+} -+ -+bool CAFPDirectory::ResolveSymlink( const std::string &dirName, const std::string &fileName, -+ struct stat *stat, CURL &resolvedUrl) -+{ -+ CSingleLock lock(gAfpConnection); -+ int ret = 0; -+ bool retVal = true; -+ char resolvedLink[MAX_PATH]; -+ std::string fullpath = dirName; -+ URIUtils::AddSlashAtEnd(fullpath); -+ fullpath += fileName; -+ -+ CPasswordManager::GetInstance().AuthenticateURL(resolvedUrl); -+ resolvedUrl.SetProtocol("afp"); -+ resolvedUrl.SetHostName(gAfpConnection.GetConnectedIp()); -+ -+ ret = gAfpConnection.GetImpl()->afp_wrap_readlink(gAfpConnection.GetVolume(), fullpath.c_str(), resolvedLink, MAX_PATH); -+ -+ if(ret == 0) -+ { -+ fullpath = dirName; -+ URIUtils::AddSlashAtEnd(fullpath); -+ fullpath.append(resolvedLink); -+ -+ if(resolvedLink[0] == '/') -+ { -+ //use the special stat function for using an extra context -+ //because we are inside of a dir traversation -+ //and just can't change the global nfs context here -+ //without destroying something... -+ fullpath = resolvedLink; -+ fullpath.erase(0, 1); -+ resolvedUrl.SetFileName(fullpath); -+ ret = gAfpConnection.stat(resolvedUrl, stat); -+ if(ret < 0) -+ { -+ URIUtils::AddSlashAtEnd(fullpath); -+ resolvedUrl.SetFileName(fullpath); -+ ret = gAfpConnection.stat(resolvedUrl, stat); -+ } -+ } -+ else -+ { -+ ret = gAfpConnection.GetImpl()->afp_wrap_getattr(gAfpConnection.GetVolume(), fullpath.c_str(), stat); -+ resolvedUrl.SetFileName(gAfpConnection.GetUrl()->volumename + fullpath); -+ } -+ -+ if (ret != 0) -+ { -+ CLog::Log(LOGERROR, "AFP: Failed to stat(%s) on link resolve %s\n", fullpath.c_str(), strerror(errno)); -+ retVal = false;; -+ } -+ } -+ else -+ { -+ CLog::Log(LOGERROR, "Failed to readlink(%s) %s\n", fullpath.c_str(), strerror(errno)); -+ retVal = false; -+ } -+ return retVal; -+} -+ -+ -+bool CAFPDirectory::GetDirectory(const CURL& url, CFileItemList &items) -+{ -+ // We accept afp://[[user[:password@]]server[/share[/path[/file]]]] -+ // silence gdb breaking on signal SIGUSR2 with "handle SIGUSR2 nostop noprint" -+ bool bListVolumes = false; -+ FILETIME fileTime, localTime; -+ -+ CSingleLock lock(gAfpConnection); -+ CAfpConnection::afpConnnectError afpError = gAfpConnection.Connect(url); -+ -+ if (afpError != CAfpConnection::AfpOk || (!url.GetShareName().empty() && !gAfpConnection.GetVolume())) -+ { -+ if (afpError == CAfpConnection::AfpAuth) -+ { -+ if (m_flags & DIR_FLAG_ALLOW_PROMPT) -+ { -+ RequireAuthentication(url); -+ } -+ } -+ return false; -+ } -+ std::string strDirName = gAfpConnection.GetPath(url); -+ -+ vector vecEntries; -+ struct afp_file_info *dirEnt = NULL; -+ struct afp_file_info *curDirPtr = NULL; -+ -+ // if no share name in url - try to fetch the volumes on the server and treat them like folders -+ if (url.GetShareName().empty()) -+ { -+ bListVolumes = true; -+ struct afp_server *serv = gAfpConnection.GetServer(); -+ for (int i = 0; i < serv->num_volumes; i++) -+ { -+ CachedDirEntry aDir; -+ aDir.type = 1; -+ aDir.name = serv->volumes[i].volume_name; -+ vecEntries.push_back(aDir); -+ } -+ } -+ -+ // if we not only list volumes - read the dir -+ if (!bListVolumes) -+ { -+ if (gAfpConnection.GetImpl()->afp_wrap_readdir(gAfpConnection.GetVolume(), strDirName.c_str(), &dirEnt)) -+ return false; -+ lock.Leave(); -+ -+ for (curDirPtr = dirEnt; curDirPtr; curDirPtr = curDirPtr->next) -+ { -+ CachedDirEntry aDir; -+ aDir.type = curDirPtr->isdir; -+#ifdef USE_CVS_AFPFS -+ aDir.name = curDirPtr->basic.name; -+#else -+ aDir.name = curDirPtr->name; -+#endif -+ vecEntries.push_back(aDir); -+ } -+ gAfpConnection.GetImpl()->afp_ml_filebase_free(&dirEnt); -+ } -+ -+ std::string myStrPath(url.Get()); -+ URIUtils::AddSlashAtEnd(myStrPath); //be sure the dir ends with a slash -+ for (size_t i = 0; i < vecEntries.size(); i++) -+ { -+ CachedDirEntry aDir = vecEntries[i]; -+ // We use UTF-8 internally, as does AFP -+ std::string strFile = aDir.name; -+ std::string path(myStrPath + strFile); -+ -+ if (strFile != "." && strFile != ".." && strFile != "lost+found") -+ { -+ int64_t iSize = 0; -+ bool bIsDir = aDir.type; -+ int64_t lTimeDate = 0; -+ -+ // if we not only list volumes - stat the files in folder -+ if (!bListVolumes) -+ { -+ struct stat info = {0}; -+ -+ if ((m_flags & DIR_FLAG_NO_FILE_INFO)==0 && g_advancedSettings.m_sambastatfiles) -+ { -+ // make sure we use the authenticated path wich contains any default username -+ std::string strFullName = strDirName + strFile; -+ -+ lock.Enter(); -+ -+ if (gAfpConnection.GetImpl()->afp_wrap_getattr(gAfpConnection.GetVolume(), strFullName.c_str(), &info) == 0) -+ { -+ //resolve symlinks -+ if(S_ISLNK(info.st_mode)) -+ { -+ CURL linkUrl(url); -+ if(!ResolveSymlink(strDirName, strFile, &info, linkUrl)) -+ { -+ lock.Leave(); -+ continue; -+ } -+ path = linkUrl.Get(); -+ bIsDir = S_ISDIR(info.st_mode); -+ } -+ lTimeDate = info.st_mtime; -+ if (lTimeDate == 0) // if modification date is missing, use create date -+ lTimeDate = info.st_ctime; -+ iSize = info.st_size; -+ } -+ else -+ { -+ CLog::Log(LOGERROR, "%s - Failed to stat file %s (%s)", __FUNCTION__, strFullName.c_str(),strerror(errno)); -+ } -+ -+ lock.Leave(); -+ } -+ LONGLONG ll = Int32x32To64(lTimeDate & 0xffffffff, 10000000) + 116444736000000000ll; -+ fileTime.dwLowDateTime = (DWORD)(ll & 0xffffffff); -+ fileTime.dwHighDateTime = (DWORD)(ll >> 32); -+ FileTimeToLocalFileTime(&fileTime, &localTime); -+ } -+ else -+ { -+ bIsDir = true; -+ localTime.dwHighDateTime = 0; -+ localTime.dwLowDateTime = 0; -+ } -+ -+ CFileItemPtr pItem(new CFileItem(strFile)); -+ pItem->m_dateTime = localTime; -+ pItem->m_dwSize = iSize; -+ -+ if (bIsDir) -+ { -+ URIUtils::AddSlashAtEnd(path); -+ pItem->m_bIsFolder = true; -+ } -+ else -+ { -+ pItem->m_bIsFolder = false; -+ } -+ -+ if (!aDir.name.empty() && aDir.name[0] == '.') -+ { -+ pItem->SetProperty("file:hidden", true); -+ } -+ -+ pItem->SetPath(path); -+ items.Add(pItem); -+ } -+ } -+ -+ return true; -+} -+ -+bool CAFPDirectory::Create(const CURL& url) -+{ -+ CSingleLock lock(gAfpConnection); -+ -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ -+ std::string strFilename = gAfpConnection.GetPath(url); -+ -+ int result = gAfpConnection.GetImpl()->afp_wrap_mkdir(gAfpConnection.GetVolume(), strFilename.c_str(), 0); -+ -+ if (result != 0) -+ CLog::Log(LOGERROR, "%s - Error( %s )", __FUNCTION__, strerror(errno)); -+ -+ return (result == 0 || EEXIST == result); -+} -+ -+bool CAFPDirectory::Remove(const CURL& url) -+{ -+ CSingleLock lock(gAfpConnection); -+ -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ -+ std::string strFileName = gAfpConnection.GetPath(url); -+ -+ int result = gAfpConnection.GetImpl()->afp_wrap_rmdir(gAfpConnection.GetVolume(), strFileName.c_str()); -+ -+ if (result != 0 && errno != ENOENT) -+ { -+ CLog::Log(LOGERROR, "%s - Error( %s )", __FUNCTION__, strerror(errno)); -+ return false; -+ } -+ -+ return true; -+} -+ -+bool CAFPDirectory::Exists(const CURL& url) -+{ -+ CSingleLock lock(gAfpConnection); -+ -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ -+ std::string strFileName(gAfpConnection.GetPath(url)); -+ -+ struct stat info; -+ if (gAfpConnection.GetImpl()->afp_wrap_getattr(gAfpConnection.GetVolume(), strFileName.c_str(), &info) != 0) -+ return false; -+ -+ return S_ISDIR(info.st_mode); -+} -+#endif -diff --git a/xbmc/filesystem/AFPDirectory.h b/xbmc/filesystem/AFPDirectory.h -new file mode 100644 -index 0000000..7fa3734 ---- /dev/null -+++ b/xbmc/filesystem/AFPDirectory.h -@@ -0,0 +1,47 @@ -+#pragma once -+/* -+ * Copyright (C) 2011-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "IDirectory.h" -+#include "MediaSource.h" -+#include "URL.h" -+ -+struct afp_file_info; -+ -+namespace XFILE -+{ -+class CAFPDirectory : public IDirectory -+{ -+public: -+ CAFPDirectory(void); -+ virtual ~CAFPDirectory(void); -+ virtual bool GetDirectory(const CURL& url, CFileItemList &items); -+ virtual DIR_CACHE_TYPE GetCacheType(const CURL& url) const { return DIR_CACHE_ONCE; }; -+ virtual bool Create(const CURL& url); -+ virtual bool Exists(const CURL& url); -+ virtual bool Remove(const CURL& url); -+ -+ afp_file_info *Open(const CURL &url); -+private: -+ afp_file_info *OpenDir(const CURL &url, std::string& strAuth); -+ bool ResolveSymlink( const std::string &dirName, const std::string &fileName, -+ struct stat *stat, CURL &resolvedUrl); -+}; -+} -diff --git a/xbmc/filesystem/AFPFile.cpp b/xbmc/filesystem/AFPFile.cpp -new file mode 100644 -index 0000000..a4de580 ---- /dev/null -+++ b/xbmc/filesystem/AFPFile.cpp -@@ -0,0 +1,728 @@ -+/* -+ * Copyright (C) 2011-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+// FileAFP.cpp: implementation of the CAFPFile class. -+// -+////////////////////////////////////////////////////////////////////// -+#ifdef TARGET_POSIX -+#include "system.h" -+ -+#if defined(HAS_FILESYSTEM_AFP) -+#include "AFPFile.h" -+#include "PasswordManager.h" -+#include "AFPDirectory.h" -+#include "Util.h" -+#include "settings/AdvancedSettings.h" -+#include "threads/SingleLock.h" -+#include "utils/log.h" -+#include "utils/StringUtils.h" -+#include "utils/TimeUtils.h" -+ -+using namespace XFILE; -+ -+#define AFP_MAX_READ_SIZE 131072 -+ -+void AfpConnectionLog(void *priv, enum loglevels loglevel, int logtype, const char *message) -+{ -+ if (!message) return; -+ std::string msg = "LIBAFPCLIENT: " + std::string(message); -+ -+ switch(logtype) -+ { -+ case LOG_WARNING: -+ CLog::Log(LOGWARNING, "%s", msg.c_str()); -+ break; -+ case LOG_ERR: -+ CLog::Log(LOGERROR, "%s", msg.c_str()); -+ break; -+ default: -+ CLog::Log(LOGDEBUG, "%s", msg.c_str()); -+ break; -+ } -+} -+ -+CAfpConnection::CAfpConnection() -+ : m_OpenConnections(0) -+ , m_IdleTimeout(0) -+ , m_pAfpServer(NULL) -+ , m_pAfpVol(NULL) -+ , m_pAfpUrl((struct afp_url*)malloc(sizeof(struct afp_url))) -+ , m_pAfpClient((struct libafpclient*)malloc(sizeof(struct libafpclient))) -+ , m_pLibAfp(new DllLibAfp()) -+ , m_bDllInited(false) -+{ -+} -+ -+CAfpConnection::~CAfpConnection() -+{ -+ Disconnect(); -+ free(m_pAfpClient); -+ free(m_pAfpUrl); -+ if (m_pLibAfp->IsLoaded()) -+ m_pLibAfp->Unload(); -+ delete m_pLibAfp; -+} -+ -+bool CAfpConnection::initLib() -+{ -+ if (!m_bDllInited) -+ { -+ if (m_pLibAfp->Load()) -+ { -+ m_pAfpClient->unmount_volume = NULL; -+ m_pAfpClient->log_for_client = AfpConnectionLog; -+ m_pAfpClient->forced_ending_hook = NULL; -+ m_pAfpClient->scan_extra_fds = NULL; -+ m_pAfpClient->loop_started = NULL; -+ -+ m_pLibAfp->libafpclient_register(m_pAfpClient); -+ m_pLibAfp->init_uams(); -+ m_pLibAfp->afp_main_quick_startup(NULL); -+ CLog::Log(LOGDEBUG, "AFP: Supported UAMs: %s", m_pLibAfp->get_uam_names_list()); -+ m_bDllInited = true; -+ } -+ else -+ { -+ CLog::Log(LOGERROR, "AFP: Error loading afpclient lib."); -+ } -+ } -+ -+ return m_bDllInited; -+} -+ -+//only unmount here - afpclient lib is not -+//stoppable (no afp_main_quick_shutdown as counter part -+//for afp_main_quick_startup) -+void CAfpConnection::Deinit() -+{ -+ if(m_pAfpVol && m_pLibAfp->IsLoaded()) -+ { -+ disconnectVolume(); -+ Disconnect(); -+ m_pAfpUrl->servername[0] = '\0'; -+ } -+} -+ -+void CAfpConnection::Disconnect() -+{ -+ CSingleLock lock(*this); -+ m_pAfpServer = NULL; -+} -+ -+void CAfpConnection::disconnectVolume() -+{ -+ if (m_pAfpVol) -+ { -+ // afp_unmount_volume(m_pAfpVol); -+ m_pLibAfp->afp_unmount_all_volumes(m_pAfpServer); -+ m_pAfpVol = NULL; -+ } -+} -+ -+// taken from cmdline tool -+bool CAfpConnection::connectVolume(const char *volumename, struct afp_volume *&pVolume) -+{ -+ bool ret = false; -+ if (strlen(volumename) != 0) -+ { -+ // Ah, we're not connected to a volume -+ unsigned int len = 0; -+ char mesg[1024]; -+ -+ if ((pVolume = m_pLibAfp->find_volume_by_name(m_pAfpServer, volumename)) == NULL) -+ { -+ CLog::Log(LOGDEBUG, "AFP: Could not find a volume called %s\n", volumename); -+ } -+ else -+ { -+ pVolume->mapping = AFP_MAPPING_LOGINIDS; -+ pVolume->extra_flags |= VOLUME_EXTRA_FLAGS_NO_LOCKING; -+ -+ if (m_pLibAfp->afp_connect_volume(pVolume, m_pAfpServer, mesg, &len, 1024 )) -+ { -+ CLog::Log(LOGDEBUG, "AFP: Could not access volume %s (error: %s)\n", pVolume->volume_name, mesg); -+ pVolume = NULL; -+ } -+ else -+ { -+ CLog::Log(LOGDEBUG, "AFP: Connected to volume %s\n", pVolume->volume_name_printable); -+ ret = true; -+ } -+ } -+ } -+ -+ return ret; -+} -+ -+CURL CAfpConnection::getAuthenticatedPath(const CURL &url) -+{ -+ CURL authURL(url); -+ CPasswordManager::GetInstance().AuthenticateURL(authURL); -+ return authURL; -+} -+ -+CAfpConnection::afpConnnectError CAfpConnection::Connect(const CURL& url) -+{ -+ CSingleLock lock(*this); -+ struct afp_connection_request *conn_req = NULL; -+ struct afp_url tmpurl; -+ CURL nonConstUrl(getAuthenticatedPath(url)); // we need a editable copy of the url -+ bool serverChanged=false; -+ -+ if (!initLib()) -+ return AfpFailed; -+ -+ m_pLibAfp->afp_default_url(&tmpurl); -+ -+ // if hostname has changed - assume server changed -+ if (nonConstUrl.GetHostName() != m_pAfpUrl->servername || (m_pAfpServer && m_pAfpServer->connect_state == 0)) -+ { -+ serverChanged = true; -+ Disconnect(); -+ } -+ -+ // if volume changed - also assume server changed (afpclient can't reuse old servobject it seems) -+ if (nonConstUrl.GetShareName() != m_pAfpUrl->volumename) -+ { -+ // no reusing of old server object possible with libafpclient it seems... -+ serverChanged = true; -+ Disconnect(); -+ } -+ -+ // first, try to parse the URL -+ if (m_pLibAfp->afp_parse_url(&tmpurl, nonConstUrl.Get().c_str(), 0) != 0) -+ { -+ // Okay, this isn't a real URL -+ CLog::Log(LOGDEBUG, "AFP: Could not parse url: %s!\n", nonConstUrl.Get().c_str()); -+ return AfpFailed; -+ } -+ else // parsed successfully -+ { -+ // this is our current url object whe are connected to (at least we try) -+ *m_pAfpUrl = tmpurl; -+ } -+ -+ // if no username and password is set - use no user authent uam -+ if (strlen(m_pAfpUrl->password) == 0 && strlen(m_pAfpUrl->username) == 0) -+ { -+ // try anonymous -+ strncpy(m_pAfpUrl->uamname, "No User Authent", sizeof(m_pAfpUrl->uamname)); -+ CLog::Log(LOGDEBUG, "AFP: Using anonymous authentication."); -+ } -+ else if ((nonConstUrl.GetPassWord().empty() || nonConstUrl.GetUserName().empty()) && serverChanged) -+ { -+ // this is our current url object whe are connected to (at least we try) -+ return AfpAuth; -+ } -+ -+ // we got a password in the url -+ if (!nonConstUrl.GetPassWord().empty()) -+ { -+ // copy password because afp_parse_url just puts garbage into the password field :( -+ strncpy(m_pAfpUrl->password, nonConstUrl.GetPassWord().c_str(), 127); -+ } -+ -+ // whe are not connected or we want to connect to another server -+ if (!m_pAfpServer || serverChanged) -+ { -+ // code from cmdline tool -+ conn_req = (struct afp_connection_request*)malloc(sizeof(struct afp_connection_request)); -+ memset(conn_req, 0, sizeof(struct afp_connection_request)); -+ -+ conn_req->url = *m_pAfpUrl; -+ conn_req->url.requested_version = 31; -+ -+ if (strlen(m_pAfpUrl->uamname)>0) -+ { -+ if ((conn_req->uam_mask = m_pLibAfp->find_uam_by_name(m_pAfpUrl->uamname)) == 0) -+ { -+ CLog::Log(LOGDEBUG, "AFP:I don't know about UAM %s\n", m_pAfpUrl->uamname); -+ m_pAfpUrl->volumename[0] = '\0'; -+ m_pAfpUrl->servername[0] = '\0'; -+ free(conn_req); -+ return AfpFailed; -+ } -+ } -+ else -+ { -+ conn_req->uam_mask = m_pLibAfp->default_uams_mask(); -+ } -+ -+ // try to connect -+#ifdef USE_CVS_AFPFS -+ if ((m_pAfpServer = m_pLibAfp->afp_wrap_server_full_connect(NULL, conn_req, NULL)) == NULL) -+#else -+ if ((m_pAfpServer = m_pLibAfp->afp_wrap_server_full_connect(NULL, conn_req)) == NULL) -+#endif -+ { -+ m_pAfpUrl->volumename[0] = '\0'; -+ m_pAfpUrl->servername[0] = '\0'; -+ free(conn_req); -+ CLog::Log(LOGERROR, "AFP: Error connecting to %s", url.Get().c_str()); -+ return AfpFailed; -+ } -+ // success! -+ CLog::Log(LOGDEBUG, "AFP: Connected to server %s using UAM \"%s\"\n", -+ m_pAfpServer->server_name, m_pLibAfp->uam_bitmap_to_string(m_pAfpServer->using_uam)); -+ // we don't need it after here ... -+ free(conn_req); -+ } -+ -+ // if server changed reconnect volume -+ if (serverChanged) -+ { -+ connectVolume(m_pAfpUrl->volumename, m_pAfpVol); // connect new volume -+ } -+ return AfpOk; -+} -+ -+int CAfpConnection::stat(const CURL &url, struct stat *statbuff) -+{ -+ CSingleLock lock(*this); -+ std::string strPath = gAfpConnection.GetPath(url); -+ struct afp_volume *pTmpVol = NULL; -+ struct afp_url tmpurl; -+ int iResult = -1; -+ CURL nonConstUrl(getAuthenticatedPath(url)); // we need a editable copy of the url -+ -+ if (!initLib() || !m_pAfpServer) -+ return -1; -+ -+ m_pLibAfp->afp_default_url(&tmpurl); -+ -+ // first, try to parse the URL -+ if (m_pLibAfp->afp_parse_url(&tmpurl, nonConstUrl.Get().c_str(), 0) != 0) -+ { -+ // Okay, this isn't a real URL -+ CLog::Log(LOGDEBUG, "AFP: Could not parse url: %s!\n", nonConstUrl.Get().c_str()); -+ return -1; -+ } -+ -+ // if no username and password is set - use no user authent uam -+ if (strlen(tmpurl.password) == 0 && strlen(tmpurl.username) == 0) -+ { -+ // try anonymous -+ strncpy(tmpurl.uamname, "No User Authent", sizeof(tmpurl.uamname)); -+ CLog::Log(LOGDEBUG, "AFP: Using anonymous authentication."); -+ } -+ else if ((nonConstUrl.GetPassWord().empty() || nonConstUrl.GetUserName().empty())) -+ { -+ // this is our current url object whe are connected to (at least we try) -+ return -1; -+ } -+ -+ // we got a password in the url -+ if (!nonConstUrl.GetPassWord().empty()) -+ { -+ // copy password because afp_parse_url just puts garbage into the password field :( -+ strncpy(tmpurl.password, nonConstUrl.GetPassWord().c_str(), 127); -+ } -+ -+ // connect new volume -+ if(connectVolume(tmpurl.volumename, pTmpVol) && pTmpVol) -+ { -+ iResult = m_pLibAfp->afp_wrap_getattr(pTmpVol, strPath.c_str(), statbuff); -+ //unmount single volume crashs -+ //we will get rid of the mounted volume -+ //once the context is changed in connect function -+ //ppppooooorrrr!! -+ //m_pLibAfp->afp_unmount_volume(pTmpVol); -+ } -+ return iResult; -+} -+ -+ -+/* This is called from CApplication::ProcessSlow() and is used to tell if afp have been idle for too long */ -+void CAfpConnection::CheckIfIdle() -+{ -+ /* We check if there are open connections. This is done without a lock to not halt the mainthread. It should be thread safe as -+ worst case scenario is that m_OpenConnections could read 0 and then changed to 1 if this happens it will enter the if wich will lead to another check, wich is locked. */ -+ if (m_OpenConnections == 0 && m_pAfpVol != NULL) -+ { /* I've set the the maxiumum IDLE time to be 1 min and 30 sec. */ -+ CSingleLock lock(*this); -+ if (m_OpenConnections == 0 /* check again - when locked */) -+ { -+ if (m_IdleTimeout > 0) -+ { -+ m_IdleTimeout--; -+ } -+ else -+ { -+ CLog::Log(LOGNOTICE, "AFP is idle. Closing the remaining connections."); -+ gAfpConnection.Deinit(); -+ } -+ } -+ } -+} -+ -+/* The following two function is used to keep track on how many Opened files/directories there are. -+needed for unloading the dylib*/ -+void CAfpConnection::AddActiveConnection() -+{ -+ CSingleLock lock(*this); -+ m_OpenConnections++; -+} -+ -+void CAfpConnection::AddIdleConnection() -+{ -+ CSingleLock lock(*this); -+ m_OpenConnections--; -+ /* If we close a file we reset the idle timer so that we don't have any wierd behaviours if a user -+ leaves the movie paused for a long while and then press stop */ -+ m_IdleTimeout = 180; -+} -+ -+std::string CAfpConnection::GetPath(const CURL &url) -+{ -+ struct afp_url tmpurl; -+ std::string ret; -+ -+ m_pLibAfp->afp_default_url(&tmpurl); -+ -+ // First, try to parse the URL -+ if (m_pLibAfp->afp_parse_url(&tmpurl, url.Get().c_str(), 0) != 0 ) -+ { -+ // Okay, this isn't a real URL -+ CLog::Log(LOGDEBUG, "AFP: Could not parse url.\n"); -+ } -+ else -+ { -+ ret = tmpurl.path; -+ } -+ return ret; -+} -+ -+CAfpConnection gAfpConnection; -+ -+CAFPFile::CAFPFile() -+ : m_fileSize(0) -+ , m_fileOffset(0) -+ , m_pFp(NULL) -+ , m_pAfpVol(NULL) -+{ -+ gAfpConnection.AddActiveConnection(); -+} -+ -+CAFPFile::~CAFPFile() -+{ -+ gAfpConnection.AddIdleConnection(); -+ Close(); -+} -+ -+int64_t CAFPFile::GetPosition() -+{ -+ if (m_pFp == NULL) return 0; -+ return m_fileOffset; -+} -+ -+int64_t CAFPFile::GetLength() -+{ -+ if (m_pFp == NULL) return 0; -+ return m_fileSize; -+} -+ -+bool CAFPFile::Open(const CURL& url) -+{ -+ Close(); -+ // we can't open files like afp://file.f or afp://server/file.f -+ // if a file matches the if below return false, it can't exist on a afp share. -+ if (!IsValidFile(url.GetFileName())) -+ { -+ CLog::Log(LOGNOTICE, "FileAfp: Bad URL : '%s'", url.GetFileName().c_str()); -+ return false; -+ } -+ -+ CSingleLock lock(gAfpConnection); -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ m_pAfpVol = gAfpConnection.GetVolume(); -+ -+ std::string strPath = gAfpConnection.GetPath(url); -+ -+ if (gAfpConnection.GetImpl()->afp_wrap_open(m_pAfpVol, strPath.c_str(), O_RDONLY, &m_pFp)) -+ { -+ if (gAfpConnection.GetImpl()->afp_wrap_open(m_pAfpVol, CURL::Encode(strPath.c_str()).c_str(), O_RDONLY, &m_pFp)) -+ { -+ // write error to logfile -+ CLog::Log(LOGINFO, "CAFPFile::Open: Unable to open file : '%s'\nunix_err:'%x' error : '%s'", strPath.c_str(), errno, strerror(errno)); -+ return false; -+ } -+ } -+ -+ CLog::Log(LOGDEBUG,"CAFPFile::Open - opened %s, fd=%d",url.GetFileName().c_str(), m_pFp ? m_pFp->fileid:-1); -+ m_url = url; -+ -+#ifdef TARGET_POSIX -+ struct __stat64 tmpBuffer; -+#else -+ struct stat tmpBuffer; -+#endif -+ if(Stat(&tmpBuffer)) -+ { -+ m_url.Reset(); -+ Close(); -+ return false; -+ } -+ -+ m_fileSize = tmpBuffer.st_size; -+ m_fileOffset = 0; -+ // We've successfully opened the file! -+ return true; -+} -+ -+ -+bool CAFPFile::Exists(const CURL& url) -+{ -+ return Stat(url, NULL) == 0; -+} -+ -+int CAFPFile::Stat(struct __stat64* buffer) -+{ -+ if (m_pFp == NULL) -+ return -1; -+ return Stat(m_url, buffer); -+} -+ -+// TODO - maybe check returncode! -+int CAFPFile::Stat(const CURL& url, struct __stat64* buffer) -+{ -+ CSingleLock lock(gAfpConnection); -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return -1; -+ -+ std::string strPath = gAfpConnection.GetPath(url); -+ -+ struct stat tmpBuffer = {0}; -+ int iResult = gAfpConnection.GetImpl()->afp_wrap_getattr(gAfpConnection.GetVolume(), strPath.c_str(), &tmpBuffer); -+ -+ if (buffer) -+ { -+ memset(buffer, 0, sizeof(struct __stat64)); -+ buffer->st_dev = tmpBuffer.st_dev; -+ buffer->st_ino = tmpBuffer.st_ino; -+ buffer->st_mode = tmpBuffer.st_mode; -+ buffer->st_nlink = tmpBuffer.st_nlink; -+ buffer->st_uid = tmpBuffer.st_uid; -+ buffer->st_gid = tmpBuffer.st_gid; -+ buffer->st_rdev = tmpBuffer.st_rdev; -+ buffer->st_size = tmpBuffer.st_size; -+ buffer->st_atime = tmpBuffer.st_atime; -+ buffer->st_mtime = tmpBuffer.st_mtime; -+ buffer->st_ctime = tmpBuffer.st_ctime; -+ } -+ -+ return iResult; -+} -+ -+ssize_t CAFPFile::Read(void *lpBuf, size_t uiBufSize) -+{ -+ CSingleLock lock(gAfpConnection); -+ if (m_pFp == NULL || !m_pAfpVol) -+ return -1; -+ -+ if (uiBufSize > AFP_MAX_READ_SIZE) -+ uiBufSize = AFP_MAX_READ_SIZE; -+ -+#ifdef USE_CVS_AFPFS -+ char *name = m_pFp->basename; -+#else -+ char *name = m_pFp->name; -+ if (strlen(name) == 0) -+ name = m_pFp->basename; -+ -+#endif -+ int eof = 0; -+ ssize_t bytesRead = gAfpConnection.GetImpl()->afp_wrap_read(m_pAfpVol, -+ name, (char *)lpBuf,(size_t)uiBufSize, m_fileOffset, m_pFp, &eof); -+ if (bytesRead > 0) -+ m_fileOffset += bytesRead; -+ -+ if (bytesRead < 0) -+ { -+ CLog::Log(LOGERROR, "%s - Error( %d, %d, %s )", __FUNCTION__, bytesRead, errno, strerror(errno)); -+ return -1; -+ } -+ -+ return bytesRead; -+} -+ -+int64_t CAFPFile::Seek(int64_t iFilePosition, int iWhence) -+{ -+ off_t newOffset = m_fileOffset; -+ if (m_pFp == NULL) return -1; -+ -+ switch(iWhence) -+ { -+ case SEEK_SET: -+ newOffset = iFilePosition; -+ break; -+ case SEEK_END: -+ newOffset = m_fileSize+iFilePosition; -+ break; -+ case SEEK_CUR: -+ newOffset += iFilePosition; -+ break; -+ } -+ -+ if ( newOffset < 0 || newOffset > m_fileSize) -+ { -+ CLog::Log(LOGERROR, "%s - Error( %" PRId64")", __FUNCTION__, newOffset); -+ return -1; -+ } -+ -+ m_fileOffset = newOffset; -+ return (int64_t)m_fileOffset; -+} -+ -+void CAFPFile::Close() -+{ -+ CSingleLock lock(gAfpConnection); -+ if (m_pFp != NULL && m_pAfpVol) -+ { -+ CLog::Log(LOGDEBUG, "CAFPFile::Close closing fd %d", m_pFp->fileid); -+#ifdef USE_CVS_AFPFS -+ char *name = m_pFp->basename; -+#else -+ char *name = m_pFp->name; -+ if (strlen(name) == 0) -+ name = m_pFp->basename; -+#endif -+ gAfpConnection.GetImpl()->afp_wrap_close(m_pAfpVol, name, m_pFp); -+ delete m_pFp; -+ m_pFp = NULL; -+ m_pAfpVol = NULL; -+ } -+} -+ -+ssize_t CAFPFile::Write(const void* lpBuf, size_t uiBufSize) -+{ -+ CSingleLock lock(gAfpConnection); -+ if (m_pFp == NULL || !m_pAfpVol) -+ return -1; -+ -+ ssize_t numberOfBytesWritten = 0; -+ uid_t uid; -+ gid_t gid; -+ -+ // FIXME need a better way to get server's uid/gid -+ uid = getuid(); -+ gid = getgid(); -+#ifdef USE_CVS_AFPFS -+ char *name = m_pFp->basename; -+#else -+ char *name = m_pFp->name; -+ if (strlen(name) == 0) -+ name = m_pFp->basename; -+#endif -+ numberOfBytesWritten = gAfpConnection.GetImpl()->afp_wrap_write(m_pAfpVol, -+ name, (const char *)lpBuf, uiBufSize, m_fileOffset, m_pFp, uid, gid); -+ -+ if (numberOfBytesWritten > 0) -+ m_fileOffset += numberOfBytesWritten; -+ -+ return numberOfBytesWritten; -+} -+ -+bool CAFPFile::Delete(const CURL& url) -+{ -+ CSingleLock lock(gAfpConnection); -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ -+ std::string strPath = gAfpConnection.GetPath(url); -+ -+ int result = gAfpConnection.GetImpl()->afp_wrap_unlink(gAfpConnection.GetVolume(), strPath.c_str()); -+ -+ if (result != 0) -+ CLog::Log(LOGERROR, "%s - Error( %s )", __FUNCTION__, strerror(errno)); -+ -+ return (result == 0); -+} -+ -+bool CAFPFile::Rename(const CURL& url, const CURL& urlnew) -+{ -+ CSingleLock lock(gAfpConnection); -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ -+ std::string strFile = gAfpConnection.GetPath(url); -+ std::string strFileNew = gAfpConnection.GetPath(urlnew); -+ -+ int result = gAfpConnection.GetImpl()->afp_wrap_rename(gAfpConnection.GetVolume(), strFile.c_str(), strFileNew.c_str()); -+ -+ if (result != 0) -+ CLog::Log(LOGERROR, "%s - Error( %s )", __FUNCTION__, strerror(errno)); -+ -+ return (result == 0); -+} -+ -+bool CAFPFile::OpenForWrite(const CURL& url, bool bOverWrite) -+{ -+ -+ int ret = 0; -+ m_fileSize = 0; -+ m_fileOffset = 0; -+ -+ Close(); -+ CSingleLock lock(gAfpConnection); -+ if (gAfpConnection.Connect(url) != CAfpConnection::AfpOk || !gAfpConnection.GetVolume()) -+ return false; -+ -+ // we can't open files like afp://file.f or afp://server/file.f -+ // if a file matches the if below return false, it can't exist on a afp share. -+ if (!IsValidFile(url.GetFileName())) -+ return false; -+ -+ m_pAfpVol = gAfpConnection.GetVolume(); -+ -+ std::string strPath = gAfpConnection.GetPath(url); -+ -+ if (bOverWrite) -+ { -+ CLog::Log(LOGWARNING, "FileAFP::OpenForWrite() called with overwriting enabled! - %s", strPath.c_str()); -+ ret = gAfpConnection.GetImpl()->afp_wrap_creat(m_pAfpVol, strPath.c_str(), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); -+ } -+ -+ ret = gAfpConnection.GetImpl()->afp_wrap_open(m_pAfpVol, strPath.c_str(), O_RDWR, &m_pFp); -+ -+ if (ret || m_pFp == NULL) -+ { -+ // write error to logfile -+ CLog::Log(LOGERROR, "CAFPFile::Open: Unable to open file : '%s'\nunix_err:'%x' error : '%s'", strPath.c_str(), errno, strerror(errno)); -+ return false; -+ } -+ -+ // We've successfully opened the file! -+ return true; -+} -+ -+bool CAFPFile::IsValidFile(const std::string& strFileName) -+{ -+ if (strFileName.find('/') == std::string::npos || // doesn't have sharename -+ StringUtils::EndsWith(strFileName, "/.") || // not current folder -+ StringUtils::EndsWith(strFileName, "/..")) // not parent folder -+ { -+ return false; -+ } -+ -+ return true; -+} -+#endif // HAS_FILESYSTEM_AFP -+#endif // TARGET_POSIX -diff --git a/xbmc/filesystem/AFPFile.h b/xbmc/filesystem/AFPFile.h -new file mode 100644 -index 0000000..9880b26 ---- /dev/null -+++ b/xbmc/filesystem/AFPFile.h -@@ -0,0 +1,134 @@ -+/* -+ * Copyright (C) 2011-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+// FileAFP.h: interface for the CAFPFile class. -+#ifndef FILEAFP_H_ -+#define FILEAFP_H_ -+ -+ -+#ifdef TARGET_POSIX -+ -+#include "IFile.h" -+#include "URL.h" -+#include "threads/CriticalSection.h" -+#include "DllLibAfp.h" -+ -+// libafpclient includes -+#ifdef __cplusplus -+extern "C" { -+#endif -+#ifdef __cplusplus -+} -+#endif -+ -+class CAfpConnection : public CCriticalSection -+{ -+public: -+ enum eAfpConnectError -+ { -+ AfpOk = 0, -+ AfpFailed = 1, -+ AfpAuth = 2, -+ }; -+ typedef enum eAfpConnectError afpConnnectError; -+ -+ CAfpConnection(); -+ ~CAfpConnection(); -+ -+ afpConnnectError Connect(const CURL &url); -+ void Disconnect(void); -+ struct afp_server *GetServer() {return m_pAfpServer;} -+ struct afp_volume *GetVolume() {return m_pAfpVol;}; -+ struct afp_url *GetUrl() {return m_pAfpUrl;}; -+ std::string GetPath(const CURL &url); -+ DllLibAfp *GetImpl() {return m_pLibAfp;} -+ -+ const char *GetConnectedIp() const { if(m_pAfpUrl) return m_pAfpUrl->servername;else return "";} -+ -+ //special stat which uses its own context -+ //needed for getting intervolume symlinks to work -+ //it uses the same global server connection -+ //but its own volume -+ int stat(const CURL &url, struct stat *statbuff); -+ -+ void AddActiveConnection(); -+ void AddIdleConnection(); -+ void CheckIfIdle(); -+ void Deinit(); -+ -+private: -+ bool initLib(void); -+ bool connectVolume(const char *volumename, struct afp_volume *&pVolume); -+ void disconnectVolume(void); -+ CURL getAuthenticatedPath(const CURL &url); -+ -+ int m_OpenConnections; -+ int m_IdleTimeout; -+ struct afp_server *m_pAfpServer; -+ struct afp_volume *m_pAfpVol; -+ struct afp_url *m_pAfpUrl; -+ struct libafpclient *m_pAfpClient; -+ DllLibAfp *m_pLibAfp; -+ bool m_bDllInited; -+}; -+ -+extern CAfpConnection gAfpConnection; -+ -+namespace XFILE -+{ -+class CAFPFile : public IFile -+{ -+public: -+ CAFPFile(); -+ virtual ~CAFPFile(); -+ virtual void Close(); -+ virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); -+ virtual ssize_t Read(void* lpBuf, size_t uiBufSize); -+ virtual bool Open(const CURL& url); -+ virtual bool Exists(const CURL& url); -+ virtual int Stat(const CURL& url, struct __stat64* buffer); -+ virtual int Stat(struct __stat64* buffer); -+ virtual int64_t GetLength(); -+ virtual int64_t GetPosition(); -+ virtual ssize_t Write(const void* lpBuf, size_t uiBufSize); -+ -+ virtual bool OpenForWrite(const CURL& url, bool bOverWrite = false); -+ virtual bool Delete(const CURL& url); -+ virtual bool Rename(const CURL& url, const CURL& urlnew); -+ virtual int GetChunkSize() {return 1;} -+ // implement iocontrol for seek_possible for preventing the stat in File class for -+ // getting this info ... -+ virtual int IoControl(EIoControl request, void* param) -+ { if (request == IOCTRL_SEEK_POSSIBLE) return 1; -+ return -1; -+ }; -+ -+protected: -+ bool IsValidFile(const std::string& strFileName); -+ -+ CURL m_url; -+ int64_t m_fileSize; -+ off_t m_fileOffset; // current SEEK pointer -+ struct afp_file_info *m_pFp; -+ struct afp_volume *m_pAfpVol; -+}; -+} -+#endif // TARGET_POSIX -+#endif // FILEAFP_H_ -diff --git a/xbmc/filesystem/APKDirectory.cpp b/xbmc/filesystem/APKDirectory.cpp -index 7c29421..c2a133b 100644 ---- a/xbmc/filesystem/APKDirectory.cpp -+++ b/xbmc/filesystem/APKDirectory.cpp -@@ -96,7 +96,7 @@ bool CAPKDirectory::GetDirectory(const CURL& url, CFileItemList &items) - - bool CAPKDirectory::ContainsFiles(const CURL& url) - { -- //! @todo why might we need this ? -+ // TODO: why might we need this ? - return false; - } - -diff --git a/xbmc/filesystem/AddonsDirectory.cpp b/xbmc/filesystem/AddonsDirectory.cpp -index f176161..db98719 100644 ---- a/xbmc/filesystem/AddonsDirectory.cpp -+++ b/xbmc/filesystem/AddonsDirectory.cpp -@@ -348,7 +348,6 @@ static bool Browse(const CURL& path, CFileItemList &items) - const std::string repo = path.GetHostName(); - - VECADDONS addons; -- items.SetPath(path.Get()); - if (repo == "all") - { - CAddonDatabase database; -@@ -654,7 +653,7 @@ CFileItemPtr CAddonsDirectory::FileItemFromAddon(const AddonPtr &addon, - if (URIUtils::IsInternetStream(addon->FanArt()) || CFile::Exists(addon->FanArt())) - item->SetArt("fanart", addon->FanArt()); - -- //! @todo fix hacks that depends on these -+ //TODO: fix hacks that depends on these - item->SetProperty("Addon.ID", addon->ID()); - item->SetProperty("Addon.Name", addon->Name()); - const auto it = addon->ExtraInfo().find("language"); -diff --git a/xbmc/filesystem/CMakeLists.txt b/xbmc/filesystem/CMakeLists.txt -index 6818acf..da0f782 100644 ---- a/xbmc/filesystem/CMakeLists.txt -+++ b/xbmc/filesystem/CMakeLists.txt -@@ -18,6 +18,7 @@ set(SOURCES AddonsDirectory.cpp - File.cpp - FileDirectoryFactory.cpp - FileFactory.cpp -+ FileReaderFile.cpp - FTPDirectory.cpp - FTPParse.cpp - HTTPDirectory.cpp -@@ -99,6 +100,7 @@ set(HEADERS AddonsDirectory.h - FileCache.h - FileDirectoryFactory.h - FileFactory.h -+ FileReaderFile.h - HTTPDirectory.h - IDirectory.h - IFile.h diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp -index bb116dd..ee1ad20 100644 +index d3ab8b1..ee1ad20 100644 --- a/xbmc/filesystem/CurlFile.cpp +++ b/xbmc/filesystem/CurlFile.cpp @@ -18,6 +18,8 @@ @@ -74779,41 +11678,7 @@ index bb116dd..ee1ad20 100644 #include "CurlFile.h" #include "utils/URIUtils.h" #include "Util.h" -@@ -235,7 +237,7 @@ size_t CCurlFile::CReadState::WriteCallback(char *buffer, size_t size, size_t ni - { - // CLog::Log(LOGDEBUG, "CCurlFile::WriteCallback(%p) not enough free space for %i bytes", (void*)this, amount); - -- //! @todo Limit max. amount of the overflowbuffer -+ // TODO: Limit max. amount of the overflowbuffer - m_overflowBuffer = (char*)realloc_simple(m_overflowBuffer, amount + m_overflowSize); - if(m_overflowBuffer == NULL) - { -@@ -648,11 +650,10 @@ void CCurlFile::SetCommonOptions(CReadState* state) - g_curlInterface.easy_setopt(h, CURLOPT_LOW_SPEED_TIME, m_lowspeedtime); - - if (m_skipshout) -- //! @todo -- //! For shoutcast file, content-length should not be set, and in libcurl there is a bug, if the -- //! cast file was 302 redirected then getinfo of CURLINFO_CONTENT_LENGTH_DOWNLOAD will return -- //! the 302 response's body length, which cause the next read request failed, so we ignore -- //! content-length for shoutcast file to workaround this. -+ // For shoutcast file, content-length should not be set, and in libcurl there is a bug, if the -+ // cast file was 302 redirected then getinfo of CURLINFO_CONTENT_LENGTH_DOWNLOAD will return -+ // the 302 response's body length, which cause the next read request failed, so we ignore -+ // content-length for shoutcast file to workaround this. - g_curlInterface.easy_setopt(h, CURLOPT_IGNORE_CONTENT_LENGTH, 1); - - // Setup allowed TLS/SSL ciphers. New versions of cURL may deprecate things that are still in use. -@@ -732,7 +733,7 @@ void CCurlFile::ParseAndCorrectUrl(CURL &url2) - if (url2.GetProtocolOption("utf8") == "0") - g_charsetConverter.utf8ToStringCharset(filename); - -- //! @todo create a tokenizer that doesn't skip empty's -+ /* TODO: create a tokenizer that doesn't skip empty's */ - StringUtils::Tokenize(filename, array, "/"); - filename.clear(); - for(std::vector::iterator it = array.begin(); it != array.end(); it++) -@@ -918,13 +919,13 @@ bool CCurlFile::Download(const std::string& strURL, const std::string& strFileNa +@@ -917,13 +919,13 @@ bool CCurlFile::Download(const std::string& strURL, const std::string& strFileNa // Detect whether we are "online" or not! Very simple and dirty! bool CCurlFile::IsInternet() { @@ -74829,30 +11694,8 @@ index bb116dd..ee1ad20 100644 found = Exists(url); } Close(); -@@ -1291,7 +1292,7 @@ int64_t CCurlFile::Seek(int64_t iFilePosition, int iWhence) - SetCommonOptions(m_state); - - /* caller might have changed some headers (needed for daap)*/ -- //! @todo daap is gone. is this needed for something else? -+ // TODO: daap is gone. is this needed for something else? - SetRequestHeaders(m_state); - - m_state->m_filePos = nextPos; -diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp -index 05a3e43..1a713dc 100644 ---- a/xbmc/filesystem/Directory.cpp -+++ b/xbmc/filesystem/Directory.cpp -@@ -217,7 +217,7 @@ bool CDirectory::GetDirectory(const CURL& url, CFileItemList &items, const CHint - } - } - // filter hidden files -- //! @todo we shouldn't be checking the gui setting here, callers should use getHidden instead -+ // TODO: we shouldn't be checking the gui setting here, callers should use getHidden instead - if (!CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_SHOWHIDDEN) && !(hints.flags & DIR_FLAG_GET_HIDDEN)) - { - for (int i = 0; i < items.Size(); ++i) diff --git a/xbmc/filesystem/DirectoryFactory.cpp b/xbmc/filesystem/DirectoryFactory.cpp -index 662b63b..c87cb63 100644 +index c66e1d8..c87cb63 100644 --- a/xbmc/filesystem/DirectoryFactory.cpp +++ b/xbmc/filesystem/DirectoryFactory.cpp @@ -91,6 +91,9 @@ @@ -74865,19 +11708,7 @@ index 662b63b..c87cb63 100644 #ifdef HAVE_LIBBLURAY #include "BlurayDirectory.h" #endif -@@ -157,6 +160,11 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) - if (url.IsProtocol("videodb")) return new CVideoDatabaseDirectory(); - if (url.IsProtocol("library")) return new CLibraryDirectory(); - if (url.IsProtocol("favourites")) return new CFavouritesDirectory(); -+ if (url.IsProtocol("filereader")) -+ { -+ CURL url2(url.GetFileName()); -+ return CDirectoryFactory::Create(url2); -+ } - #if defined(TARGET_ANDROID) - if (url.IsProtocol("androidapp")) return new CAndroidAppDirectory(); - #endif -@@ -166,7 +174,7 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) +@@ -171,7 +174,7 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) if (url.IsProtocol("resource")) return new CResourceDirectory(); if (url.IsProtocol("events")) return new CEventsDirectory(); @@ -74886,7 +11717,7 @@ index 662b63b..c87cb63 100644 if (networkAvailable) { if (url.IsProtocol("ftp") || url.IsProtocol("ftps")) return new CFTPDirectory(); -@@ -197,6 +205,9 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) +@@ -202,6 +205,9 @@ IDirectory* CDirectoryFactory::Create(const CURL& url) #ifdef HAS_FILESYSTEM_NFS if (url.IsProtocol("nfs")) return new CNFSDirectory(); #endif @@ -74896,252 +11727,11 @@ index 662b63b..c87cb63 100644 } CLog::Log(LOGWARNING, "%s - %sunsupported protocol(%s) in %s", __FUNCTION__, networkAvailable ? "" : "Network down or ", url.GetProtocol().c_str(), url.GetRedacted().c_str() ); -diff --git a/xbmc/filesystem/DllLibAfp.h b/xbmc/filesystem/DllLibAfp.h -new file mode 100644 -index 0000000..c87d920 ---- /dev/null -+++ b/xbmc/filesystem/DllLibAfp.h -@@ -0,0 +1,214 @@ -+#pragma once -+ -+/* -+ * Copyright (C) 2011-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "DynamicDll.h" -+ -+//libafpclient includes -+#ifdef __cplusplus -+extern "C" { -+#endif -+#include -+#include -+#include -+#ifdef __cplusplus -+} -+#endif -+ -+ -+//#define USE_CVS_AFPFS -+#ifdef USE_CVS_AFPFS -+#define afp_wrap_open afp_ml_open -+#define afp_wrap_close afp_ml_close -+#define afp_wrap_read afp_ml_read -+#define afp_wrap_write afp_ml_write -+#define afp_wrap_getattr afp_ml_getattr -+#define afp_wrap_server_full_connect afp_server_full_connect -+#define afp_wrap_unlink afp_ml_unlink -+#define afp_wrap_rename afp_ml_rename -+#define afp_wrap_creat afp_ml_creat -+#define afp_wrap_readdir afp_ml_readdir -+#define afp_wrap_readlink afp_ml_readlink -+#define afp_wrap_mkdir afp_ml_mkdir -+#define afp_wrap_rmdir afp_ml_rmdir -+#else -+#define afp_wrap_open ml_open -+#define afp_wrap_close ml_close -+#define afp_wrap_read ml_read -+#define afp_wrap_write ml_write -+#define afp_wrap_getattr ml_getattr -+#define afp_wrap_server_full_connect afp_server_full_connect -+#define afp_wrap_unlink ml_unlink -+#define afp_wrap_rename ml_rename -+#define afp_wrap_creat ml_creat -+#define afp_wrap_readdir ml_readdir -+#define afp_wrap_readlink ml_readlink -+#define afp_wrap_mkdir ml_mkdir -+#define afp_wrap_rmdir ml_rmdir -+#endif -+ -+ -+class DllLibAfpInterface -+{ -+public: -+ virtual ~DllLibAfpInterface() {} -+ -+ virtual void libafpclient_register(struct libafpclient * tmpclient)=0; -+ virtual int init_uams(void)=0; -+ virtual int afp_main_quick_startup(pthread_t * thread)=0; -+ virtual int afp_unmount_all_volumes(struct afp_server * server)=0; -+ virtual int afp_unmount_volume(struct afp_volume * volume)=0; -+ virtual struct afp_volume * find_volume_by_name(struct afp_server * server, const char * volname)=0; -+ virtual int afp_connect_volume(struct afp_volume * volume, struct afp_server * server, char * mesg, unsigned int * l, unsigned int max)=0; -+ virtual int afp_parse_url(struct afp_url * url, const char * toparse, int verbose)=0; -+ virtual unsigned int find_uam_by_name(const char * name)=0; -+ virtual unsigned int default_uams_mask(void)=0; -+ virtual char * uam_bitmap_to_string(unsigned int bitmap)=0; -+ virtual void afp_default_url(struct afp_url *url)=0; -+ virtual char * get_uam_names_list(void)=0; -+ virtual void afp_ml_filebase_free(struct afp_file_info **filebase)=0; -+ -+#ifdef USE_CVS_AFPFS -+ virtual struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req, int * error)=0; -+ virtual int afp_ml_open(struct afp_volume * volume, const char *path, int flags, struct afp_file_info **newfp)=0; -+ virtual int afp_ml_close(struct afp_volume * volume, const char * path, struct afp_file_info * fp)=0; -+ virtual int afp_ml_read(struct afp_volume * volume, const char *path, char *buf, size_t size, off_t offset, struct afp_file_info *fp, int * eof)=0; -+ virtual int afp_ml_write(struct afp_volume * volume, const char * path, const char *data, size_t size, off_t offset, struct afp_file_info * fp, uid_t uid, gid_t gid)=0; -+ virtual int afp_ml_getattr(struct afp_volume * volume, const char *path, struct stat *stbuf)=0; -+ virtual int afp_ml_unlink(struct afp_volume * vol, const char *path)=0; -+ virtual int afp_ml_rename(struct afp_volume * vol, const char * path_from, const char * path_to)=0; -+ virtual int afp_ml_creat(struct afp_volume * volume, const char *path, mode_t mode)=0; -+ virtual int afp_ml_readdir(struct afp_volume * volume, const char *path, struct afp_file_info **base)=0; -+ virtual int afp_ml_readlink(struct afp_volume * vol, const char * path, char *buf, size_t size)=0; -+ virtual int afp_ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode)=0; -+ virtual int afp_ml_rmdir(struct afp_volume * vol, const char *path)=0; -+ -+#else -+ virtual struct afp_server * afp_server_full_connect(void * priv, struct afp_connection_request * req)=0; -+ virtual int ml_open(struct afp_volume * volume, const char *path, int flags, struct afp_file_info **newfp)=0; -+ virtual int ml_close(struct afp_volume * volume, const char * path, struct afp_file_info * fp)=0; -+ virtual int ml_read(struct afp_volume * volume, const char *path, char *buf, size_t size, off_t offset, struct afp_file_info *fp, int * eof)=0; -+ virtual int ml_write(struct afp_volume * volume, const char * path, const char *data, size_t size, off_t offset, struct afp_file_info * fp, uid_t uid, gid_t gid)=0; -+ virtual int ml_getattr(struct afp_volume * volume, const char *path, struct stat *stbuf)=0; -+ virtual int ml_unlink(struct afp_volume * vol, const char *path)=0; -+ virtual int ml_rename(struct afp_volume * vol, const char * path_from, const char * path_to)=0; -+ virtual int ml_creat(struct afp_volume * volume, const char *path, mode_t mode)=0; -+ virtual int ml_readdir(struct afp_volume * volume, const char *path, struct afp_file_info **base)=0; -+ virtual int ml_readlink(struct afp_volume * vol, const char * path, char *buf, size_t size)=0; -+ virtual int ml_mkdir(struct afp_volume * vol, const char * path, mode_t mode)=0; -+ virtual int ml_rmdir(struct afp_volume * vol, const char *path)=0; -+ -+#endif -+ -+}; -+ -+class DllLibAfp : public DllDynamic, DllLibAfpInterface -+{ -+ DECLARE_DLL_WRAPPER(DllLibAfp, DLL_PATH_LIBAFP) -+ DEFINE_METHOD0(int, init_uams) -+ DEFINE_METHOD0(unsigned int, default_uams_mask) -+ DEFINE_METHOD0(char *, get_uam_names_list) -+ -+ DEFINE_METHOD1(void, libafpclient_register, (struct libafpclient *p1)) -+ DEFINE_METHOD1(int, afp_main_quick_startup, (pthread_t *p1)) -+ DEFINE_METHOD1(int, afp_unmount_all_volumes, (struct afp_server *p1)) -+ DEFINE_METHOD1(int, afp_unmount_volume, (struct afp_volume *p1)) -+ DEFINE_METHOD1(unsigned int, find_uam_by_name, (const char *p1)) -+ DEFINE_METHOD1(char *, uam_bitmap_to_string, (unsigned int p1)) -+ DEFINE_METHOD1(void, afp_default_url, (struct afp_url *p1)) -+ DEFINE_METHOD1(void, afp_ml_filebase_free, (struct afp_file_info **p1)) -+ -+#ifdef USE_CVS_AFPFS -+ DEFINE_METHOD3(struct afp_server *, afp_wrap_server_full_connect, (void *p1, struct afp_connection_request *p2, int *p3)) -+#else -+ DEFINE_METHOD2(struct afp_server *, afp_wrap_server_full_connect, (void *p1, struct afp_connection_request *p2)) -+#endif -+ -+ DEFINE_METHOD2(struct afp_volume *, find_volume_by_name, (struct afp_server *p1, const char *p2)) -+ DEFINE_METHOD2(int, afp_wrap_unlink, (struct afp_volume *p1, const char *p2)) -+ DEFINE_METHOD2(int, afp_wrap_rmdir, (struct afp_volume *p1, const char *p2)) -+ -+ DEFINE_METHOD3(int, afp_parse_url, (struct afp_url *p1, const char *p2, int p3)) -+ DEFINE_METHOD3(int, afp_wrap_close, (struct afp_volume *p1, const char *p2, struct afp_file_info *p3)) -+ DEFINE_METHOD3(int, afp_wrap_getattr, (struct afp_volume *p1, const char *p2, struct stat *p3)) -+ DEFINE_METHOD3(int, afp_wrap_rename, (struct afp_volume *p1, const char *p2, const char *p3)) -+ DEFINE_METHOD3(int, afp_wrap_creat, (struct afp_volume *p1, const char *p2, mode_t p3)) -+ DEFINE_METHOD3(int, afp_wrap_readdir, (struct afp_volume *p1, const char *p2, struct afp_file_info **p3)) -+ DEFINE_METHOD3(int, afp_wrap_mkdir, (struct afp_volume *p1, const char *p2, mode_t p3)) -+ -+ DEFINE_METHOD4(int, afp_wrap_open, (struct afp_volume *p1, const char *p2, int p3, struct afp_file_info **p4)) -+ DEFINE_METHOD4(int, afp_wrap_readlink, (struct afp_volume *p1, const char *p2, char *p3, size_t p4)) -+ -+ DEFINE_METHOD5(int, afp_connect_volume, (struct afp_volume *p1, struct afp_server *p2, char *p3, unsigned int *p4, unsigned int p5)) -+ -+ DEFINE_METHOD7(int, afp_wrap_read, (struct afp_volume *p1, const char *p2, char *p3, size_t p4, off_t p5, struct afp_file_info *p6, int *p7)) -+ -+ DEFINE_METHOD8(int, afp_wrap_write, (struct afp_volume *p1, const char *p2, const char *p3, size_t p4, off_t p5, struct afp_file_info *p6, uid_t p7, gid_t p8)) -+ -+ -+ -+ BEGIN_METHOD_RESOLVE() -+ RESOLVE_METHOD_RENAME(init_uams,init_uams) -+ RESOLVE_METHOD_RENAME(libafpclient_register, libafpclient_register) -+ RESOLVE_METHOD_RENAME(afp_main_quick_startup, afp_main_quick_startup) -+ RESOLVE_METHOD_RENAME(afp_unmount_all_volumes, afp_unmount_all_volumes) -+ RESOLVE_METHOD_RENAME(afp_unmount_all_volumes, afp_unmount_all_volumes) -+ RESOLVE_METHOD_RENAME(find_volume_by_name, find_volume_by_name) -+ RESOLVE_METHOD_RENAME(afp_connect_volume, afp_connect_volume) -+ RESOLVE_METHOD_RENAME(afp_parse_url, afp_parse_url) -+ RESOLVE_METHOD_RENAME(find_uam_by_name, find_uam_by_name) -+ RESOLVE_METHOD_RENAME(default_uams_mask, default_uams_mask) -+ RESOLVE_METHOD_RENAME(uam_bitmap_to_string, uam_bitmap_to_string) -+ RESOLVE_METHOD_RENAME(afp_default_url, afp_default_url) -+ RESOLVE_METHOD_RENAME(get_uam_names_list, get_uam_names_list) -+ RESOLVE_METHOD_RENAME(afp_ml_filebase_free, afp_ml_filebase_free) -+ -+#ifdef USE_CVS_AFPFS -+ RESOLVE_METHOD_RENAME(afp_server_full_connect, afp_server_full_connect) -+ RESOLVE_METHOD_RENAME(afp_ml_open, afp_ml_open) -+ RESOLVE_METHOD_RENAME(afp_ml_close, afp_ml_close) -+ RESOLVE_METHOD_RENAME(afp_ml_read, afp_ml_read) -+ RESOLVE_METHOD_RENAME(afp_ml_write, afp_ml_write) -+ RESOLVE_METHOD_RENAME(afp_ml_getattr, afp_ml_getattr) -+ RESOLVE_METHOD_RENAME(afp_ml_unlink, afp_ml_unlink) -+ RESOLVE_METHOD_RENAME(afp_ml_rename, afp_ml_rename) -+ RESOLVE_METHOD_RENAME(afp_ml_creat, afp_ml_creat) -+ RESOLVE_METHOD_RENAME(afp_ml_readdir, afp_ml_readdir) -+ RESOLVE_METHOD_RENAME(afp_ml_readlink, afp_ml_readlink) -+ RESOLVE_METHOD_RENAME(afp_ml_mkdir, afp_ml_mkdir) -+ RESOLVE_METHOD_RENAME(afp_ml_rmdir, afp_ml_rmdir) -+#else -+ RESOLVE_METHOD_RENAME(afp_server_full_connect, afp_server_full_connect) -+ RESOLVE_METHOD_RENAME(ml_open, ml_open) -+ RESOLVE_METHOD_RENAME(ml_close, ml_close) -+ RESOLVE_METHOD_RENAME(ml_read, ml_read) -+ RESOLVE_METHOD_RENAME(ml_write, ml_write) -+ RESOLVE_METHOD_RENAME(ml_getattr, ml_getattr) -+ RESOLVE_METHOD_RENAME(ml_unlink, ml_unlink) -+ RESOLVE_METHOD_RENAME(ml_rename, ml_rename) -+ RESOLVE_METHOD_RENAME(ml_creat, ml_creat) -+ RESOLVE_METHOD_RENAME(ml_readdir, ml_readdir) -+ RESOLVE_METHOD_RENAME(ml_readlink, ml_readlink) -+ RESOLVE_METHOD_RENAME(ml_mkdir, ml_mkdir) -+ RESOLVE_METHOD_RENAME(ml_rmdir, ml_rmdir) -+#endif -+ END_METHOD_RESOLVE() -+}; -diff --git a/xbmc/filesystem/FavouritesDirectory.cpp b/xbmc/filesystem/FavouritesDirectory.cpp -index 94a133e..bd83428 100644 ---- a/xbmc/filesystem/FavouritesDirectory.cpp -+++ b/xbmc/filesystem/FavouritesDirectory.cpp -@@ -190,7 +190,7 @@ std::string CFavouritesDirectory::GetExecutePath(const CFileItem &item, const st - if (!contextWindow.empty()) - execute = StringUtils::Format("ActivateWindow(%s,%s,return)", contextWindow.c_str(), StringUtils::Paramify(item.GetPath()).c_str()); - } -- //! @todo STRING_CLEANUP -+ /* TODO:STRING_CLEANUP */ - else if (item.IsScript() && item.GetPath().size() > 9) // plugin:// - execute = StringUtils::Format("RunScript(%s)", StringUtils::Paramify(item.GetPath().substr(9)).c_str()); - else if (item.IsAndroidApp() && item.GetPath().size() > 26) // androidapp://sources/apps/ diff --git a/xbmc/filesystem/FileFactory.cpp b/xbmc/filesystem/FileFactory.cpp -index 6ba98d2..dc1044e 100644 +index 66e2c4b..dc1044e 100644 --- a/xbmc/filesystem/FileFactory.cpp +++ b/xbmc/filesystem/FileFactory.cpp -@@ -32,6 +32,7 @@ - #include "CurlFile.h" - #include "DAVFile.h" - #include "ShoutcastFile.h" -+#include "FileReaderFile.h" - #ifdef HAS_FILESYSTEM_SMB - #ifdef TARGET_WINDOWS - #include "win32/Win32SMBFile.h" -@@ -59,6 +60,9 @@ +@@ -60,6 +60,9 @@ #ifdef HAS_FILESYSTEM_NFS #include "NFSFile.h" #endif @@ -75151,15 +11741,7 @@ index 6ba98d2..dc1044e 100644 #if defined(TARGET_ANDROID) #include "AndroidAppFile.h" #endif -@@ -124,6 +128,7 @@ IFile* CFileFactory::CreateLoader(const CURL& url) - #elif defined(TARGET_WINDOWS) - else if (url.IsProtocol("file") || url.GetProtocol().empty()) return new CWin32File(); - #endif // TARGET_WINDOWS -+ else if (url.IsProtocol("filereader")) return new CFileReaderFile(); - #if defined(HAS_FILESYSTEM_CDDA) && defined(HAS_DVD_DRIVE) - else if (url.IsProtocol("cdda")) return new CFileCDDA(); - #endif -@@ -140,7 +145,7 @@ IFile* CFileFactory::CreateLoader(const CURL& url) +@@ -142,7 +145,7 @@ IFile* CFileFactory::CreateLoader(const CURL& url) #endif else if (url.IsProtocol("resource")) return new CResourceFile(); @@ -75168,7 +11750,7 @@ index 6ba98d2..dc1044e 100644 if (networkAvailable) { if (url.IsProtocol("ftp") -@@ -163,6 +168,9 @@ IFile* CFileFactory::CreateLoader(const CURL& url) +@@ -165,6 +168,9 @@ IFile* CFileFactory::CreateLoader(const CURL& url) #ifdef HAS_FILESYSTEM_NFS else if (url.IsProtocol("nfs")) return new CNFSFile(); #endif @@ -75178,1717 +11760,6 @@ index 6ba98d2..dc1044e 100644 #ifdef HAS_UPNP else if (url.IsProtocol("upnp")) return new CUPnPFile(); #endif -diff --git a/xbmc/filesystem/FileReaderFile.cpp b/xbmc/filesystem/FileReaderFile.cpp -new file mode 100644 -index 0000000..4e6c08c ---- /dev/null -+++ b/xbmc/filesystem/FileReaderFile.cpp -@@ -0,0 +1,105 @@ -+/* -+ * Copyright (c) 2002 Frodo -+ * Portions Copyright (c) by the authors of ffmpeg and xvid -+ * Copyright (C) 2002-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "FileReaderFile.h" -+#include "URL.h" -+ -+using namespace XFILE; -+ -+////////////////////////////////////////////////////////////////////// -+// Construction/Destruction -+////////////////////////////////////////////////////////////////////// -+ -+//********************************************************************************************* -+CFileReaderFile::CFileReaderFile() -+{ -+} -+ -+//********************************************************************************************* -+CFileReaderFile::~CFileReaderFile() -+{ -+ Close(); -+} -+ -+//********************************************************************************************* -+bool CFileReaderFile::Open(const CURL& url) -+{ -+ // URL is of the form filereader:// -+ std::string strURL = url.Get(); -+ strURL = strURL.substr(13); -+ return m_reader.Open(strURL,READ_CACHED); -+} -+ -+bool CFileReaderFile::Exists(const CURL& url) -+{ -+ return CFile::Exists(url.Get().substr(13)); -+} -+ -+int CFileReaderFile::Stat(const CURL& url, struct __stat64* buffer) -+{ -+ return CFile::Stat(url.Get().substr(13), buffer); -+} -+ -+ -+//********************************************************************************************* -+bool CFileReaderFile::OpenForWrite(const CURL& url, bool bOverWrite) -+{ -+ return false; -+} -+ -+//********************************************************************************************* -+ssize_t CFileReaderFile::Read(void *lpBuf, size_t uiBufSize) -+{ -+ return m_reader.Read(lpBuf,uiBufSize); -+} -+ -+//********************************************************************************************* -+ssize_t CFileReaderFile::Write(const void *lpBuf, size_t uiBufSize) -+{ -+ return -1; -+} -+ -+//********************************************************************************************* -+void CFileReaderFile::Close() -+{ -+ m_reader.Close(); -+} -+ -+//********************************************************************************************* -+int64_t CFileReaderFile::Seek(int64_t iFilePosition, int iWhence) -+{ -+ return m_reader.Seek(iFilePosition,iWhence); -+} -+ -+//********************************************************************************************* -+int64_t CFileReaderFile::GetLength() -+{ -+ return m_reader.GetLength(); -+} -+ -+//********************************************************************************************* -+int64_t CFileReaderFile::GetPosition() -+{ -+ return m_reader.GetPosition(); -+} -+ -+ -diff --git a/xbmc/filesystem/FileReaderFile.h b/xbmc/filesystem/FileReaderFile.h -new file mode 100644 -index 0000000..2e6e89b ---- /dev/null -+++ b/xbmc/filesystem/FileReaderFile.h -@@ -0,0 +1,51 @@ -+#pragma once -+/* -+ * Copyright (c) 2002 Frodo -+ * Portions Copyright (c) by the authors of ffmpeg and xvid -+ * Copyright (C) 2002-2013 Team XBMC -+ * http://xbmc.org -+ * -+ * This Program is free software; you can redistribute it and/or modify -+ * it under the terms of the GNU General Public License as published by -+ * the Free Software Foundation; either version 2, or (at your option) -+ * any later version. -+ * -+ * This Program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with XBMC; see the file COPYING. If not, see -+ * . -+ * -+ */ -+ -+#include "File.h" -+#include "IFile.h" -+ -+namespace XFILE -+{ -+class CFileReaderFile : public IFile -+{ -+public: -+ CFileReaderFile(); -+ virtual ~CFileReaderFile(); -+ virtual int64_t GetPosition(); -+ virtual int64_t GetLength(); -+ virtual bool Open(const CURL& url); -+ virtual bool Exists(const CURL& url); -+ virtual int Stat(const CURL& url, struct __stat64* buffer); -+ virtual ssize_t Read(void* lpBuf, size_t uiBufSize); -+ virtual ssize_t Write(const void* lpBuf, size_t uiBufSize); -+ virtual int64_t Seek(int64_t iFilePosition, int iWhence = SEEK_SET); -+ virtual void Close(); -+ -+ virtual bool OpenForWrite(const CURL& url, bool bOverWrite = false); -+ protected: -+ CFile m_reader; -+}; -+ -+} -+ -+ -diff --git a/xbmc/filesystem/Makefile.in b/xbmc/filesystem/Makefile.in -index 14fb7b7..6381452 100644 ---- a/xbmc/filesystem/Makefile.in -+++ b/xbmc/filesystem/Makefile.in -@@ -20,6 +20,7 @@ SRCS += File.cpp - SRCS += FileCache.cpp - SRCS += FileDirectoryFactory.cpp - SRCS += FileFactory.cpp -+SRCS += FileReaderFile.cpp - SRCS += FTPDirectory.cpp - SRCS += FTPParse.cpp - SRCS += HTTPDirectory.cpp -@@ -94,6 +95,11 @@ SRCS += NFSFile.cpp - SRCS += NFSDirectory.cpp - endif - -+ifeq (@USE_LIBAFPCLIENT@,1) -+SRCS += AFPFile.cpp -+SRCS += AFPDirectory.cpp -+endif -+ - ifeq (@HAVE_LIBBLURAY@,1) - SRCS += BlurayDirectory.cpp - SRCS += BlurayFile.cpp -diff --git a/xbmc/filesystem/MultiPathDirectory.h b/xbmc/filesystem/MultiPathDirectory.h -index 68e2586..481c2f8 100644 ---- a/xbmc/filesystem/MultiPathDirectory.h -+++ b/xbmc/filesystem/MultiPathDirectory.h -@@ -21,8 +21,6 @@ - - #include - #include --#include -- - #include "IDirectory.h" - - namespace XFILE -diff --git a/xbmc/filesystem/NFSFile.cpp b/xbmc/filesystem/NFSFile.cpp -index c15fa65..1666a3e 100644 ---- a/xbmc/filesystem/NFSFile.cpp -+++ b/xbmc/filesystem/NFSFile.cpp -@@ -326,8 +326,8 @@ bool CNfsConnection::Connect(const CURL& url, std::string &relativePath) - m_exportPath = exportPath; - m_hostName = url.GetHostName(); - //read chunksize only works after mount -- m_readChunkSize = m_pLibNfs->nfs_get_readmax(m_pNfsContext); -- m_writeChunkSize = m_pLibNfs->nfs_get_writemax(m_pNfsContext); -+ m_readChunkSize = 262144; /*m_pLibNfs->nfs_get_readmax(m_pNfsContext);*/ -+ m_writeChunkSize = 262144; /*m_pLibNfs->nfs_get_writemax(m_pNfsContext);*/ - - if(contextRet == CONTEXT_NEW) - { -@@ -613,7 +613,7 @@ int CNFSFile::Stat(const CURL& url, struct __stat64* buffer) - { - if(buffer) - { --#if defined(TARGET_WINDOWS)//! @todo get rid of this define after gotham v13 -+#if defined(TARGET_WINDOWS)// TODO get rid of this define after gotham - memcpy(buffer, &tmpBuffer, sizeof(struct __stat64)); - #else - memset(buffer, 0, sizeof(struct __stat64)); -diff --git a/xbmc/filesystem/PipeFile.h b/xbmc/filesystem/PipeFile.h -index ae307eb..62c945d 100644 ---- a/xbmc/filesystem/PipeFile.h -+++ b/xbmc/filesystem/PipeFile.h -@@ -28,8 +28,6 @@ - #define AFX_FILEPIPE_H__DD2B0A9E_4971_4A29_B525_78CEFCDAF4A1__INCLUDED_ - - #pragma once --#include --#include - - #include "IFile.h" - #include "threads/CriticalSection.h" -diff --git a/xbmc/filesystem/PluginDirectory.cpp b/xbmc/filesystem/PluginDirectory.cpp -index bcadd68..78de661 100644 ---- a/xbmc/filesystem/PluginDirectory.cpp -+++ b/xbmc/filesystem/PluginDirectory.cpp -@@ -245,7 +245,7 @@ void CPluginDirectory::AddSortMethod(int handle, SORT_METHOD sortMethod, const s - if (!dir) - return; - -- //! @todo Add all sort methods and fix which labels go on the right or left -+ // TODO: Add all sort methods and fix which labels go on the right or left - switch(sortMethod) - { - case SORT_METHOD_LABEL: -diff --git a/xbmc/filesystem/RSSDirectory.cpp b/xbmc/filesystem/RSSDirectory.cpp -index 3d9477e..df48f4b 100644 ---- a/xbmc/filesystem/RSSDirectory.cpp -+++ b/xbmc/filesystem/RSSDirectory.cpp -@@ -106,7 +106,7 @@ static bool IsPathToThumbnail(const std::string& strPath ) - static time_t ParseDate(const std::string & strDate) - { - struct tm pubDate = {0}; -- //! @todo Handle time zone -+ // TODO: Handle time zone - strptime(strDate.c_str(), "%a, %d %b %Y %H:%M:%S", &pubDate); - // Check the difference between the time of last check and time of the item - return mktime(&pubDate); -@@ -326,7 +326,7 @@ static void ParseItemVoddler(CFileItem* item, SResources& resources, TiXmlElemen - resources.push_back(res); - } - else if(name == "year") -- vtag->SetYear(atoi(text.c_str())); -+ vtag->m_iYear = atoi(text.c_str()); - else if(name == "rating") - vtag->SetRating((float)atof(text.c_str())); - else if(name == "tagline") -diff --git a/xbmc/filesystem/RarManager.cpp b/xbmc/filesystem/RarManager.cpp -index f3a5622..94e2b9c 100644 ---- a/xbmc/filesystem/RarManager.cpp -+++ b/xbmc/filesystem/RarManager.cpp -@@ -49,10 +49,15 @@ - using namespace XFILE; - - CFileInfo::CFileInfo() -- : m_bAutoDel{true} -- , m_iUsed{0} -- , m_iOffset{0} -- , m_iIsSeekable{-1} -+{ -+ m_strCachedPath.clear(); -+ m_bAutoDel = true; -+ m_iUsed = 0; -+ m_iIsSeekable = -1; -+ m_iOffset = 0; -+} -+ -+CFileInfo::~CFileInfo() - { - } - -@@ -205,10 +210,8 @@ bool CRarManager::CacheRarredFile(std::string& strPathInCache, const std::string - StringUtils::Replace(strPath, '/', '\\'); - #endif - //g_charsetConverter.unknownToUTF8(strPath); -- std::string strCachedPath = URIUtils::AddFileToFolder( -- URIUtils::AddFileToFolder( -- CSpecialProtocol::TranslatePath(strDir), "rarfolder%04d"), -- URIUtils::GetFileName(strPathInRar)); -+ std::string strCachedPath = URIUtils::AddFileToFolder(strDir + "rarfolder%04d", -+ URIUtils::GetFileName(strPathInRar)); - strCachedPath = CUtil::GetNextPathname(strCachedPath, 9999); - if (strCachedPath.empty()) - { -diff --git a/xbmc/filesystem/RarManager.h b/xbmc/filesystem/RarManager.h -index c7f557d..ca1eb69 100644 ---- a/xbmc/filesystem/RarManager.h -+++ b/xbmc/filesystem/RarManager.h -@@ -41,7 +41,7 @@ class CFileItemList; - class CFileInfo{ - public: - CFileInfo(); -- ~CFileInfo() = default; -+ ~CFileInfo(); - std::string m_strCachedPath; - std::string m_strPathInRar; - bool m_bAutoDel; -diff --git a/xbmc/filesystem/SMBFile.cpp b/xbmc/filesystem/SMBFile.cpp -index d633840..1f7af9b 100644 ---- a/xbmc/filesystem/SMBFile.cpp -+++ b/xbmc/filesystem/SMBFile.cpp -@@ -390,13 +390,13 @@ int CSMBFile::OpenFile(std::string& strAuth) - std::string strPath = g_passwordManager.GetSMBAuthFilename(strAuth); - - fd = smbc_open(strPath.c_str(), O_RDONLY, 0); -- //! @todo Run a loop here that prompts for our username/password as appropriate? -- //! We have the ability to run a file (eg from a button action) without browsing to -- //! the directory first. In the case of a password protected share that we do -- //! not have the authentication information for, the above smbc_open() will have -- //! returned negative, and the file will not be opened. While this is not a particular -- //! likely scenario, we might want to implement prompting for the password in this case. -- //! The code from SMBDirectory can be used for this. -+ // TODO: Run a loop here that prompts for our username/password as appropriate? -+ // We have the ability to run a file (eg from a button action) without browsing to -+ // the directory first. In the case of a password protected share that we do -+ // not have the authentication information for, the above smbc_open() will have -+ // returned negative, and the file will not be opened. While this is not a particular -+ // likely scenario, we might want to implement prompting for the password in this case. -+ // The code from SMBDirectory can be used for this. - if(fd >= 0) - strAuth = strPath; - -diff --git a/xbmc/filesystem/SourcesDirectory.h b/xbmc/filesystem/SourcesDirectory.h -index a5c6780..3d6dc2d 100644 ---- a/xbmc/filesystem/SourcesDirectory.h -+++ b/xbmc/filesystem/SourcesDirectory.h -@@ -19,8 +19,6 @@ - * - */ - --#include -- - #include "IDirectory.h" - - class CMediaSource; -diff --git a/xbmc/filesystem/StackDirectory.h b/xbmc/filesystem/StackDirectory.h -index ee3236c..e3697f5 100644 ---- a/xbmc/filesystem/StackDirectory.h -+++ b/xbmc/filesystem/StackDirectory.h -@@ -22,7 +22,6 @@ - #include "IDirectory.h" - #include "utils/RegExp.h" - #include --#include - - namespace XFILE - { -diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp -index 0c588d5..cd8430c 100644 ---- a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp -+++ b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp -@@ -39,6 +39,7 @@ - #include "URL.h" - #include "FileItem.h" - #include "utils/StringUtils.h" -+#include "video/VideoDatabase.h" - - using namespace XFILE::VIDEODATABASEDIRECTORY; - -diff --git a/xbmc/filesystem/VirtualDirectory.cpp b/xbmc/filesystem/VirtualDirectory.cpp -index 99e8eb3..1e1c369 100644 ---- a/xbmc/filesystem/VirtualDirectory.cpp -+++ b/xbmc/filesystem/VirtualDirectory.cpp -@@ -155,7 +155,7 @@ bool CVirtualDirectory::IsInSource(const std::string &path) const - } - return false; - } -- //! @todo May need to handle other special cases that GetMatchingSource() fails on -+ // TODO: May need to handle other special cases that GetMatchingSource() fails on - return (iShare > -1); - } - -diff --git a/xbmc/filesystem/XbtFile.cpp b/xbmc/filesystem/XbtFile.cpp -index 87b3cad..7839276 100644 ---- a/xbmc/filesystem/XbtFile.cpp -+++ b/xbmc/filesystem/XbtFile.cpp -@@ -22,11 +22,7 @@ - #include - - #ifdef TARGET_WINDOWS --#ifdef NDEBUG --#pragma comment(lib,"lzo2.lib") --#else --#pragma comment(lib, "lzo2-no_idb.lib") --#endif -+#pragma comment(lib,"liblzo2.lib") - #endif - - #include -diff --git a/xbmc/filesystem/XbtFile.h b/xbmc/filesystem/XbtFile.h -index 116c6f2..05ab78a 100644 ---- a/xbmc/filesystem/XbtFile.h -+++ b/xbmc/filesystem/XbtFile.h -@@ -19,8 +19,6 @@ - * - */ - --#include -- - #include "IFile.h" - #include "URL.h" - #include "guilib/XBTF.h" -diff --git a/xbmc/filesystem/XbtManager.h b/xbmc/filesystem/XbtManager.h -index 8932c06..0e15889 100644 ---- a/xbmc/filesystem/XbtManager.h -+++ b/xbmc/filesystem/XbtManager.h -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - - #include "guilib/XBTFReader.h" - -diff --git a/xbmc/filesystem/ZeroconfDirectory.cpp b/xbmc/filesystem/ZeroconfDirectory.cpp -index 264f0b7..1f3159a 100644 ---- a/xbmc/filesystem/ZeroconfDirectory.cpp -+++ b/xbmc/filesystem/ZeroconfDirectory.cpp -@@ -52,6 +52,8 @@ namespace - return "WebDAV"; - else if(fcr_service_type == "_nfs._tcp.") - return "NFS"; -+ else if(fcr_service_type == "_afpovertcp._tcp.") -+ return "AFP"; - else if(fcr_service_type == "_sftp-ssh._tcp.") - return "SFTP"; - //fallback, just return the received type -@@ -67,6 +69,8 @@ namespace - fr_protocol = "dav"; - else if(fcr_service_type == "_nfs._tcp.") - fr_protocol = "nfs"; -+ else if(fcr_service_type == "_afpovertcp._tcp.") -+ fr_protocol = "afp"; - else if(fcr_service_type == "_sftp-ssh._tcp.") - fr_protocol = "sftp"; - else -@@ -211,7 +215,7 @@ bool CZeroconfDirectory::GetDirectory(const CURL& url, CFileItemList &items) - service.SetPort(zeroconf_service.GetPort()); - service.SetHostName(zeroconf_service.GetIP()); - //do protocol conversion (_smb._tcp -> smb) -- //! @todo try automatic conversion -> remove leading '_' and '._tcp'? -+ //ToDo: try automatic conversion -> remove leading '_' and '._tcp'? - std::string protocol; - if(!GetXBMCProtocol(zeroconf_service.GetType(), protocol)) - { -diff --git a/xbmc/filesystem/posix/PosixFile.cpp b/xbmc/filesystem/posix/PosixFile.cpp -index a7fbe76..11a3d57 100644 ---- a/xbmc/filesystem/posix/PosixFile.cpp -+++ b/xbmc/filesystem/posix/PosixFile.cpp -@@ -183,8 +183,8 @@ int64_t CPosixFile::Seek(int64_t iFilePosition, int iWhence /* = SEEK_SET*/) - return -1; - - #ifdef TARGET_ANDROID -- //! @todo properly support with detection in configure -- //! Android special case: Android doesn't substitute off64_t for off_t and similar functions -+ // TODO: properly support with detection in configure -+ // Android special case: Android doesn't substitute off64_t for off_t and similar functions - m_filePos = lseek64(m_fd, (off64_t)iFilePosition, iWhence); - #else // !TARGET_ANDROID - const off_t filePosOffT = (off_t) iFilePosition; -diff --git a/xbmc/filesystem/test/TestRarFile.cpp b/xbmc/filesystem/test/TestRarFile.cpp -index 70cf7ae..2ea62cf 100644 ---- a/xbmc/filesystem/test/TestRarFile.cpp -+++ b/xbmc/filesystem/test/TestRarFile.cpp -@@ -22,7 +22,6 @@ - #ifdef HAS_FILESYSTEM_RAR - #include "filesystem/Directory.h" - #include "filesystem/File.h" --#include "filesystem/RarManager.h" - #include "URL.h" - #include "utils/URIUtils.h" - #include "FileItem.h" -@@ -87,8 +86,6 @@ TEST(TestRarFile, Read) - EXPECT_TRUE(!memcmp("About\n-----\nXBMC is ", buf, sizeof(buf) - 1)); - EXPECT_EQ(0, file.Seek(0, SEEK_SET)); - EXPECT_EQ(-1, file.Seek(-100, SEEK_SET)); -- // Manual clear to avoid shutdown race -- g_RarManager.ClearCache(); - file.Close(); - } - -@@ -104,9 +101,6 @@ TEST(TestRarFile, Exists) - strpathinrar = itemlist[0]->GetPath(); - - EXPECT_TRUE(XFILE::CFile::Exists(strpathinrar)); -- -- // Manual clear to avoid shutdown race -- g_RarManager.ClearCache(); - } - - TEST(TestRarFile, Stat) -@@ -123,9 +117,6 @@ TEST(TestRarFile, Stat) - - EXPECT_EQ(0, XFILE::CFile::Stat(strpathinrar, &buffer)); - EXPECT_TRUE(buffer.st_mode | _S_IFREG); -- -- // Manual clear to avoid shutdown race -- g_RarManager.ClearCache(); - } - - /* Test case to test for graceful handling of corrupted input. -@@ -201,9 +192,6 @@ TEST(TestRarFile, CorruptedFile) - } - file->Close(); - XBMC_DELETETEMPFILE(file); -- -- // Manual clear to avoid shutdown race -- g_RarManager.ClearCache(); - } - - TEST(TestRarFile, StoredRAR) -@@ -352,12 +340,12 @@ TEST(TestRarFile, StoredRAR) - /* /testdir/testemptysubdir */ - strpathinrar = itemlist[2]->GetPath(); - ASSERT_TRUE(StringUtils::EndsWith(strpathinrar, "/testdir/testemptysubdir")); -- //! @todo Should this set the itemlist to an empty list instead? -+ /* TODO: Should this set the itemlist to an empty list instead? */ - EXPECT_FALSE(XFILE::CDirectory::GetDirectory(strpathinrar, itemlistemptydir)); - EXPECT_EQ(0, XFILE::CFile::Stat(strpathinrar, &stat_buffer)); - EXPECT_TRUE((stat_buffer.st_mode & S_IFMT) | S_IFDIR); - -- //! @todo FIXME: This directory appears a second time as a file -+ /* FIXME: This directory appears a second time as a file */ - strpathinrar = itemlist[3]->GetPath(); - ASSERT_TRUE(StringUtils::EndsWith(strpathinrar, "/testdir/testsubdir")); - -@@ -570,7 +558,7 @@ TEST(TestRarFile, NormalRAR) - /* /testdir/testemptysubdir */ - strpathinrar = itemlist[2]->GetPath(); - ASSERT_TRUE(StringUtils::EndsWith(strpathinrar, "/testdir/testemptysubdir")); -- /* @todo Should this set the itemlist to an empty list instead? */ -+ /* TODO: Should this set the itemlist to an empty list instead? */ - EXPECT_FALSE(XFILE::CDirectory::GetDirectory(strpathinrar, itemlistemptydir)); - EXPECT_EQ(0, XFILE::CFile::Stat(strpathinrar, &stat_buffer)); - EXPECT_TRUE((stat_buffer.st_mode & S_IFMT) | S_IFDIR); -@@ -644,8 +632,5 @@ TEST(TestRarFile, NormalRAR) - EXPECT_EQ(0, file.Seek(0, SEEK_SET)); - EXPECT_EQ(-1, file.Seek(-100, SEEK_SET)); - file.Close(); -- -- // Manual clear to avoid shutdown race -- g_RarManager.ClearCache(); - } - #endif /*HAS_FILESYSTEM_RAR*/ -diff --git a/xbmc/filesystem/test/TestZipFile.cpp b/xbmc/filesystem/test/TestZipFile.cpp -index 1497f1a..65004b8 100644 ---- a/xbmc/filesystem/test/TestZipFile.cpp -+++ b/xbmc/filesystem/test/TestZipFile.cpp -@@ -39,8 +39,7 @@ protected: - /* Add default settings for locale. - * Settings here are taken from CGUISettings::Initialize() - */ -- //! @todo implement -- /* -+ /* TODO - CSettingsCategory *loc = CSettings::GetInstance().AddCategory(7, "locale", 14090); - CSettings::GetInstance().AddString(loc, CSettings::SETTING_LOCALE_LANGUAGE,248,"english", - SPIN_CONTROL_TEXT); -diff --git a/xbmc/filesystem/udf25.cpp b/xbmc/filesystem/udf25.cpp -index 76ccb97..7917756 100644 ---- a/xbmc/filesystem/udf25.cpp -+++ b/xbmc/filesystem/udf25.cpp -@@ -315,7 +315,7 @@ static int UDFFileIdentifier( uint8_t *data, uint8_t *FileCharacteristics, - static int UDFDescriptor( uint8_t *data, uint16_t *TagID ) - { - *TagID = GETN2(0); -- //! @todo check CRC 'n stuff -+ /* TODO: check CRC 'n stuff */ - return 0; - } - -@@ -654,7 +654,7 @@ int udf25::UDFGetAVDP( struct avdp_t *avdp) - lbnum = lastsector; - terminate = 1; - } else { -- //! @todo Find last sector of the disc (this is optional). -+ /* TODO: Find last sector of the disc (this is optional). */ - if( lastsector ) - /* Try #2, backup anchor */ - lbnum = lastsector - 256; -@@ -720,7 +720,7 @@ int udf25::UDFFindPartition( int partnum, struct Partition *part ) - } else if( ( TagID == 6 ) && ( !volvalid ) ) { - /* Logical Volume Descriptor */ - if( UDFLogVolume( LogBlock, part->VolumeDesc ) ) { -- //! @todo sector size wrong! -+ /* TODO: sector size wrong! */ - } else - volvalid = 1; - } -diff --git a/xbmc/filesystem/win32/Win32Directory.cpp b/xbmc/filesystem/win32/Win32Directory.cpp -index 41abde4..408d402 100644 ---- a/xbmc/filesystem/win32/Win32Directory.cpp -+++ b/xbmc/filesystem/win32/Win32Directory.cpp -@@ -69,7 +69,7 @@ bool CWin32Directory::GetDirectory(const CURL& url, CFileItemList &items) - if (searchMask.empty()) - return false; - -- //! @todo support m_strFileMask, require rewrite of internal caching -+ // TODO: support m_strFileMask, require rewrite of internal caching - searchMask += L'*'; - - HANDLE hSearch; -diff --git a/xbmc/filesystem/win32/Win32File.cpp b/xbmc/filesystem/win32/Win32File.cpp -index 645b1b9..a210eab 100644 ---- a/xbmc/filesystem/win32/Win32File.cpp -+++ b/xbmc/filesystem/win32/Win32File.cpp -@@ -393,7 +393,7 @@ bool CWin32File::Rename(const CURL& urlCurrentName, const CURL& urlNewName) - if (m_smbFile) - m_lastSMBFileErr = ERROR_INVALID_DATA; // used to indicate internal errors, cleared by successful file operation - -- //! @todo check whether it's file or directory -+ // TODO: check whether it's file or directory - std::wstring curNameW(CWIN32Util::ConvertPathToWin32Form(urlCurrentName)); - if (curNameW.empty()) - return false; -diff --git a/xbmc/filesystem/win32/Win32SMBDirectory.cpp b/xbmc/filesystem/win32/Win32SMBDirectory.cpp -index ad594a8..ed8cecd 100644 ---- a/xbmc/filesystem/win32/Win32SMBDirectory.cpp -+++ b/xbmc/filesystem/win32/Win32SMBDirectory.cpp -@@ -111,7 +111,7 @@ bool CWin32SMBDirectory::GetDirectory(const CURL& url, CFileItemList &items) - if (searchMask.empty()) - return false; - -- //! @todo support m_strFileMask, require rewrite of internal caching -+ // TODO: support m_strFileMask, require rewrite of internal caching - if (searchMask.back() == '\\') - searchMask += L'*'; - else -@@ -263,7 +263,7 @@ bool CWin32SMBDirectory::RealExists(const CURL& url, bool tryToConnect) - if (url.GetHostName().empty()) - return true; // 'root' of network is always exist - -- //! @todo use real caseless string comparison everywhere in this function -+ // TODO: use real caseless string comparison everywhere in this function - if (url.GetShareName().empty() || url.GetShareName() == url.GetFileName()) - { - if (!url.GetShareName().empty()) -diff --git a/xbmc/games/controllers/ControllerLayout.cpp b/xbmc/games/controllers/ControllerLayout.cpp -index 34234fd..0384eb0 100644 ---- a/xbmc/games/controllers/ControllerLayout.cpp -+++ b/xbmc/games/controllers/ControllerLayout.cpp -@@ -104,7 +104,7 @@ bool CControllerLayout::Deserialize(const TiXmlElement* pElement, const CControl - { - std::string strCategory = pElement->Value(); - -- //! @todo Something with category -+ // TODO: Something with category - - for (const TiXmlElement* pFeature = pCategory->FirstChildElement(); pFeature != NULL; pFeature = pFeature->NextSiblingElement()) - { -diff --git a/xbmc/games/controllers/guicontrols/GUIGameController.cpp b/xbmc/games/controllers/guicontrols/GUIGameController.cpp -index 84e63de..569a300 100644 ---- a/xbmc/games/controllers/guicontrols/GUIGameController.cpp -+++ b/xbmc/games/controllers/guicontrols/GUIGameController.cpp -@@ -52,7 +52,7 @@ void CGUIGameController::Render(void) - - if (m_currentController) - { -- //! @todo Render pressed buttons -+ // TODO: Render pressed buttons - } - } - -@@ -66,7 +66,7 @@ void CGUIGameController::ActivateController(const ControllerPtr& controller) - - lock.Leave(); - -- //! @todo Sometimes this fails on window init -+ // TODO: Sometimes this fails on window init - SetFileName(m_currentController->ImagePath()); - } - } -diff --git a/xbmc/games/controllers/windows/GUIControllerList.cpp b/xbmc/games/controllers/windows/GUIControllerList.cpp -index 3a088a6..48132fb 100644 ---- a/xbmc/games/controllers/windows/GUIControllerList.cpp -+++ b/xbmc/games/controllers/windows/GUIControllerList.cpp -@@ -20,7 +20,6 @@ - - #include "GUIControllerList.h" - --#include - #include - #include - -@@ -35,9 +34,7 @@ - #include "guilib/GUIButtonControl.h" - #include "guilib/GUIControlGroupList.h" - #include "guilib/GUIWindow.h" --#include "guilib/WindowIDs.h" - #include "input/joysticks/DefaultJoystick.h" // for DEFAULT_CONTROLLER_ID --#include "messaging/ApplicationMessenger.h" - #include "peripherals/Peripherals.h" - - using namespace ADDON; -@@ -79,13 +76,13 @@ void CGUIControllerList::Deinitialize(void) - m_controllerButton = nullptr; - } - --bool CGUIControllerList::Refresh(void) -+void CGUIControllerList::Refresh(void) - { -- if (!RefreshControllers()) -- return false; -- - CleanupButtons(); - -+ if (!RefreshControllers()) -+ return; -+ - if (m_controllerList) - { - unsigned int buttonId = 0; -@@ -101,8 +98,6 @@ bool CGUIControllerList::Refresh(void) - break; - } - } -- -- return true; - } - - void CGUIControllerList::OnFocus(unsigned int controllerIndex) -@@ -114,7 +109,7 @@ void CGUIControllerList::OnFocus(unsigned int controllerIndex) - const ControllerPtr& controller = m_controllers[controllerIndex]; - m_featureList->Load(controller); - -- //! @todo Activate controller for all game controller controls -+ // TODO: Activate controller for all game controller controls - CGUIGameController* pController = dynamic_cast(m_guiWindow->GetControl(CONTROL_GAME_CONTROLLER)); - if (pController) - pController->ActivateController(controller); -@@ -123,7 +118,10 @@ void CGUIControllerList::OnFocus(unsigned int controllerIndex) - - void CGUIControllerList::OnSelect(unsigned int controllerIndex) - { -- m_featureList->OnSelect(0); -+ if (controllerIndex < m_controllers.size()) -+ { -+ // TODO -+ } - } - - void CGUIControllerList::ResetController(void) -@@ -132,7 +130,7 @@ void CGUIControllerList::ResetController(void) - { - const std::string strControllerId = m_controllers[m_focusedController]->ID(); - -- //! @todo Choose peripheral -+ // TODO: Choose peripheral - // For now, ask the user if they would like to reset all peripherals - // "Reset controller profile" - // "Would you like to reset this controller profile for all devices?" -@@ -145,41 +143,75 @@ void CGUIControllerList::ResetController(void) - - void CGUIControllerList::Notify(const Observable& obs, const ObservableMessage msg) - { -- using namespace KODI::MESSAGING; -- - if (msg == ObservableMessageAddons) -- { -- CGUIMessage msg(GUI_MSG_REFRESH_LIST, m_guiWindow->GetID(), CONTROL_CONTROLLER_LIST); -- CApplicationMessenger::GetInstance().SendGUIMessage(msg); -- } -+ Refresh(); - } - - bool CGUIControllerList::RefreshControllers(void) - { -- // Cache discovered add-ons between function calls -- VECADDONS addonCache; -+ bool bChanged = false; - -- std::set currentIds = GetControllerIDs(); -- std::set newIds = GetNewControllerIDs(addonCache); -+ // Get controller add-ons -+ ADDON::VECADDONS addons; -+ CAddonMgr::GetInstance().GetAddons(addons, ADDON_GAME_CONTROLLER); - -- std::set added; -- std::set removed; -+ // Convert to controllers -+ ControllerVector controllers; -+ std::transform(addons.begin(), addons.end(), std::back_inserter(controllers), -+ [](const AddonPtr& addon) -+ { -+ return std::static_pointer_cast(addon); -+ }); - -- std::set_difference(newIds.begin(), newIds.end(), currentIds.begin(), currentIds.end(), std::inserter(added, added.end())); -- std::set_difference(currentIds.begin(), currentIds.end(), newIds.begin(), newIds.end(), std::inserter(removed, removed.end())); -+ // Look for new controllers -+ ControllerVector newControllers; -+ for (ControllerVector::const_iterator it = controllers.begin(); it != controllers.end(); ++it) -+ { -+ const ControllerPtr& controller = *it; - -- // Register new controllers -- for (const std::string& addonId : added) -- RegisterController(addonId, addonCache); -+ if (std::find_if(m_controllers.begin(), m_controllers.end(), -+ [controller](const ControllerPtr& ctrl) -+ { -+ return ctrl->ID() == controller->ID(); -+ }) == m_controllers.end()) -+ { -+ newControllers.push_back(controller); -+ } -+ } - -- // Erase removed controllers -- for (const std::string& addonId : removed) -- UnregisterController(addonId); -+ // Remove old controllers -+ for (ControllerVector::iterator it = m_controllers.begin(); it != m_controllers.end(); /* ++it */) -+ { -+ ControllerPtr& controller = *it; - -+ if (std::find_if(controllers.begin(), controllers.end(), -+ [controller](const ControllerPtr& ctrl) -+ { -+ return ctrl->ID() == controller->ID(); -+ }) == controllers.end()) -+ { -+ it = m_controllers.erase(it); // Not found, remove it -+ bChanged = true; -+ } -+ else -+ { -+ ++it; -+ } -+ } - -+ // Add new controllers -+ for (ControllerVector::iterator it = newControllers.begin(); it != newControllers.end(); ++it) -+ { -+ ControllerPtr& newController = *it; -+ -+ if (newController->LoadLayout()) -+ { -+ m_controllers.push_back(newController); -+ bChanged = true; -+ } -+ } - - // Sort add-ons, with default controller first -- const bool bChanged = !added.empty() || !removed.empty(); - if (bChanged) - { - std::sort(m_controllers.begin(), m_controllers.end(), -@@ -188,66 +220,13 @@ bool CGUIControllerList::RefreshControllers(void) - if (i->ID() == DEFAULT_CONTROLLER_ID && j->ID() != DEFAULT_CONTROLLER_ID) return true; - if (i->ID() != DEFAULT_CONTROLLER_ID && j->ID() == DEFAULT_CONTROLLER_ID) return false; - -- return i->Name() < j->Name(); -+ return i->ID() < j->ID(); - }); - } - - return bChanged; - } - --std::set CGUIControllerList::GetControllerIDs() const --{ -- std::set controllerIds; -- -- std::transform(m_controllers.begin(), m_controllers.end(), std::inserter(controllerIds, controllerIds.end()), -- [](const ControllerPtr& addon) -- { -- return addon->ID(); -- }); -- -- return controllerIds; --} -- --std::set CGUIControllerList::GetNewControllerIDs(ADDON::VECADDONS& addonCache) const --{ -- std::set controllerIds; -- -- CAddonMgr::GetInstance().GetAddons(addonCache, ADDON_GAME_CONTROLLER); -- -- std::transform(addonCache.begin(), addonCache.end(), std::inserter(controllerIds, controllerIds.end()), -- [](const AddonPtr& addon) -- { -- return addon->ID(); -- }); -- -- return controllerIds; --} -- --void CGUIControllerList::RegisterController(const std::string& addonId, const ADDON::VECADDONS& addonCache) --{ -- auto it = std::find_if(addonCache.begin(), addonCache.end(), -- [addonId](const AddonPtr& addon) -- { -- return addon->ID() == addonId; -- }); -- -- if (it != addonCache.end()) -- { -- ControllerPtr newController = std::dynamic_pointer_cast(*it); -- if (newController && newController->LoadLayout()) -- m_controllers.push_back(newController); -- } --} -- --void CGUIControllerList::UnregisterController(const std::string& controllerId) --{ -- m_controllers.erase(std::remove_if(m_controllers.begin(), m_controllers.end(), -- [controllerId](const ControllerPtr& controller) -- { -- return controller->ID() == controllerId; -- }), m_controllers.end()); --} -- - void CGUIControllerList::CleanupButtons(void) - { - if (m_controllerList) -diff --git a/xbmc/games/controllers/windows/GUIControllerList.h b/xbmc/games/controllers/windows/GUIControllerList.h -index 44197d5..f59fde0 100644 ---- a/xbmc/games/controllers/windows/GUIControllerList.h -+++ b/xbmc/games/controllers/windows/GUIControllerList.h -@@ -20,13 +20,9 @@ - #pragma once - - #include "IConfigurationWindow.h" --#include "addons/Addon.h" - #include "games/controllers/ControllerTypes.h" - #include "utils/Observer.h" - --#include --#include -- - class CGUIButtonControl; - class CGUIControlGroupList; - class CGUIWindow; -@@ -45,7 +41,7 @@ namespace GAME - // implementation of IControllerList - virtual bool Initialize(void) override; - virtual void Deinitialize(void) override; -- virtual bool Refresh(void) override; -+ virtual void Refresh(void) override; - virtual void OnFocus(unsigned int controllerIndex) override; - virtual void OnSelect(unsigned int controllerIndex) override; - virtual void ResetController(void) override; -@@ -56,12 +52,6 @@ namespace GAME - private: - bool RefreshControllers(void); - -- std::set GetControllerIDs() const; -- std::set GetNewControllerIDs(ADDON::VECADDONS& addonCache) const; -- -- void RegisterController(const std::string& controllerId, const ADDON::VECADDONS& addonCache); -- void UnregisterController(const std::string& controllerId); -- - void CleanupButtons(void); - - // GUI stuff -diff --git a/xbmc/games/controllers/windows/GUIControllerWindow.cpp b/xbmc/games/controllers/windows/GUIControllerWindow.cpp -index 65bb09f..598caa8 100644 ---- a/xbmc/games/controllers/windows/GUIControllerWindow.cpp -+++ b/xbmc/games/controllers/windows/GUIControllerWindow.cpp -@@ -62,7 +62,7 @@ bool CGUIControllerWindow::OnMessage(CGUIMessage& message) - { - case GUI_MSG_WINDOW_INIT: - { -- //! @todo Process parameter -+ // TODO: Process parameter - //std::string strParam = message.GetStringParam(); - break; - } -@@ -130,20 +130,6 @@ bool CGUIControllerWindow::OnMessage(CGUIMessage& message) - } - break; - } -- case GUI_MSG_REFRESH_LIST: -- { -- int controlId = message.GetControlId(); -- -- if (controlId == CONTROL_CONTROLLER_LIST) -- { -- if (m_controllerList && m_controllerList->Refresh()) -- { -- CGUIDialog::OnMessage(message); -- return true; -- } -- } -- break; -- } - default: - break; - } -@@ -187,13 +173,12 @@ void CGUIControllerWindow::OnInitWindow(void) - CGUIMessage msgFocus(GUI_MSG_SETFOCUS, GetID(), CONTROL_CONTROLLER_BUTTONS_START); - OnMessage(msgFocus); - -- // Check for button mapping support -- //! @todo remove this -+ // Check for button mapping support (TODO: remove this) - PeripheralBusAddonPtr bus = std::static_pointer_cast(g_peripherals.GetBusByType(PERIPHERAL_BUS_ADDON)); - if (bus && !bus->HasFeature(FEATURE_JOYSTICK)) - { -- //! @todo Move the XML implementation of button map storage from add-on to -- //! Kodi while keeping support for add-on button-mapping -+ // TODO: Move the XML implementation of button map storage from add-on to -+ // Kodi while keeping support for add-on button-mapping - - CLog::Log(LOGERROR, "Joystick support not found"); - -@@ -239,8 +224,8 @@ void CGUIControllerWindow::OnControllerFocused(unsigned int controllerIndex) - - void CGUIControllerWindow::OnControllerSelected(unsigned int controllerIndex) - { -- if (m_controllerList) -- m_controllerList->OnSelect(controllerIndex); -+ // jump to the feature list -+ SET_CONTROL_FOCUS(CONTROL_FEATURE_BUTTONS_START, 0); - } - - void CGUIControllerWindow::OnFeatureFocused(unsigned int featureIndex) -diff --git a/xbmc/games/controllers/windows/IConfigurationWindow.h b/xbmc/games/controllers/windows/IConfigurationWindow.h -index b6ef34c..2d02091 100644 ---- a/xbmc/games/controllers/windows/IConfigurationWindow.h -+++ b/xbmc/games/controllers/windows/IConfigurationWindow.h -@@ -23,7 +23,6 @@ - #include "input/joysticks/JoystickTypes.h" - - #include --#include - - class CEvent; - -@@ -71,9 +70,8 @@ namespace GAME - - /*! - * \brief Refresh the contents of the list -- * \return True if the list was changed - */ -- virtual bool Refresh(void) = 0; -+ virtual void Refresh(void) = 0; - - /* - * \brief The specified controller has been focused -diff --git a/xbmc/guiinfo/GUIInfoLabels.h b/xbmc/guiinfo/GUIInfoLabels.h -index 27d6bc2..230e390 100644 ---- a/xbmc/guiinfo/GUIInfoLabels.h -+++ b/xbmc/guiinfo/GUIInfoLabels.h -@@ -759,9 +759,6 @@ - #define LISTITEM_ADDON_LAST_USED (LISTITEM_START + 174) - #define LISTITEM_STATUS (LISTITEM_START + 175) - #define LISTITEM_ENDTIME_RESUME (LISTITEM_START + 176) --#define LISTITEM_ADDON_ORIGIN (LISTITEM_START + 177) --#define LISTITEM_ADDON_NEWS (LISTITEM_START + 178) --#define LISTITEM_ADDON_SIZE (LISTITEM_START + 179) - - #define LISTITEM_PROPERTY_START (LISTITEM_START + 200) - #define LISTITEM_PROPERTY_END (LISTITEM_PROPERTY_START + 1300) -diff --git a/xbmc/guilib/D3DResource.cpp b/xbmc/guilib/D3DResource.cpp -index 88b4721..36aa6a8 100644 ---- a/xbmc/guilib/D3DResource.cpp -+++ b/xbmc/guilib/D3DResource.cpp -@@ -843,7 +843,7 @@ void CD3DVertexShader::Release() - g_Windowing.Unregister(this); - ReleaseShader(); - SAFE_RELEASE(m_VSBuffer); -- SAFE_DELETE_ARRAY(m_vertexLayout); -+ SAFE_DELETE(m_vertexLayout); - } - - void CD3DVertexShader::ReleaseShader() -diff --git a/xbmc/guilib/DirtyRegionSolvers.cpp b/xbmc/guilib/DirtyRegionSolvers.cpp -index 826c597..4c6c758 100644 ---- a/xbmc/guilib/DirtyRegionSolvers.cpp -+++ b/xbmc/guilib/DirtyRegionSolvers.cpp -@@ -66,7 +66,7 @@ void CGreedyDirtyRegionSolver::Solve(const CDirtyRegionList &input, CDirtyRegion - float temporaryCost = m_costPerArea * (temporaryUnion.Area() - output[j].Area()); - if (temporaryCost < possibleUnionCost) - { -- //! @todo if the temporaryCost is 0 then we could skip checking the other regions since there exist no better solution -+ // TODO if the temporaryCost is 0 then we could skip checking the other regions since there exist no better solution - possibleUnionRegion = temporaryUnion; - possibleUnionNbr = j; - possibleUnionCost = temporaryCost; -diff --git a/xbmc/guilib/GUIBaseContainer.h b/xbmc/guilib/GUIBaseContainer.h -index 52960bf..b941689 100644 ---- a/xbmc/guilib/GUIBaseContainer.h -+++ b/xbmc/guilib/GUIBaseContainer.h -@@ -26,7 +26,6 @@ - */ - - #include --#include - - #include "GUIListItemLayout.h" - #include "IGUIContainer.h" -diff --git a/xbmc/guilib/GUIControl.cpp b/xbmc/guilib/GUIControl.cpp -index 84c750b..eed9789 100644 ---- a/xbmc/guilib/GUIControl.cpp -+++ b/xbmc/guilib/GUIControl.cpp -@@ -524,8 +524,8 @@ void CGUIControl::SetHeight(float height) - void CGUIControl::SetVisible(bool bVisible, bool setVisState) - { - if (bVisible && setVisState) -- { //! @todo currently we only update m_visible from GUI_MSG_VISIBLE (SET_CONTROL_VISIBLE) -- //! otherwise we just set m_forceHidden -+ { // TODO: currently we only update m_visible from GUI_MSG_VISIBLE (SET_CONTROL_VISIBLE) -+ // otherwise we just set m_forceHidden - GUIVISIBLE visible; - if (m_visibleCondition) - visible = m_visibleCondition->Get() ? VISIBLE : HIDDEN; -diff --git a/xbmc/guilib/GUIControl.h b/xbmc/guilib/GUIControl.h -index 29858fc..0293bd6 100644 ---- a/xbmc/guilib/GUIControl.h -+++ b/xbmc/guilib/GUIControl.h -@@ -27,8 +27,6 @@ - * - */ - --#include -- - #include "GraphicContext.h" // needed by any rendering operation (all controls) - #include "GUIMessage.h" // needed by practically all controls - #include "VisibleEffect.h" // needed for the CAnimation members -diff --git a/xbmc/guilib/GUIControlFactory.cpp b/xbmc/guilib/GUIControlFactory.cpp -index 53f8fe1..a3a9c9b 100644 ---- a/xbmc/guilib/GUIControlFactory.cpp -+++ b/xbmc/guilib/GUIControlFactory.cpp -@@ -778,8 +778,8 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl - - if (!pControlNode->Attribute("id", (int*) &id)) - XMLUtils::GetInt(pControlNode, "id", (int&) id); // backward compatibility - not desired -- //! @todo Perhaps we should check here whether id is valid for focusable controls -- //! such as buttons etc. For labels/fadelabels/images it does not matter -+ // TODO: Perhaps we should check here whether id is valid for focusable controls -+ // such as buttons etc. For labels/fadelabels/images it does not matter - - GetAlignment(pControlNode, "align", labelInfo.align); - if (!GetDimensions(pControlNode, "left", "right", "centerleft", "centerright", "width", rect.Width(), posX, width, minWidth)) -diff --git a/xbmc/guilib/GUIControlFactory.h b/xbmc/guilib/GUIControlFactory.h -index ce9177e..3ae86df 100644 ---- a/xbmc/guilib/GUIControlFactory.h -+++ b/xbmc/guilib/GUIControlFactory.h -@@ -28,9 +28,6 @@ - * - */ - --#include --#include -- - #include "GUIControl.h" - - class CTextureInfo; // forward -diff --git a/xbmc/guilib/GUIControlGroup.h b/xbmc/guilib/GUIControlGroup.h -index ea1d8fc..0b38a56 100644 ---- a/xbmc/guilib/GUIControlGroup.h -+++ b/xbmc/guilib/GUIControlGroup.h -@@ -25,8 +25,6 @@ - * - */ - --#include -- - #include "GUIControl.h" - - /*! -diff --git a/xbmc/guilib/GUIControlProfiler.h b/xbmc/guilib/GUIControlProfiler.h -index c432b01..b62ebb3 100644 ---- a/xbmc/guilib/GUIControlProfiler.h -+++ b/xbmc/guilib/GUIControlProfiler.h -@@ -22,8 +22,6 @@ - #define GUILIB_GUICONTROLPROFILER_H__ - #pragma once - --#include -- - #include "GUIControl.h" - - class CGUIControlProfiler; -diff --git a/xbmc/guilib/GUIEditControl.cpp b/xbmc/guilib/GUIEditControl.cpp -index acda8bc..52b1a4d 100644 ---- a/xbmc/guilib/GUIEditControl.cpp -+++ b/xbmc/guilib/GUIEditControl.cpp -@@ -358,7 +358,7 @@ void CGUIEditControl::OnClick() - textChanged = CGUIDialogNumeric::ShowAndVerifyNewPassword(utf8); - break; - case INPUT_TYPE_PASSWORD_MD5: -- utf8 = ""; //! @todo Ideally we'd send this to the keyboard and tell the keyboard we have this type of input -+ utf8 = ""; // TODO: Ideally we'd send this to the keyboard and tell the keyboard we have this type of input - // fallthrough - case INPUT_TYPE_TEXT: - default: -@@ -397,7 +397,7 @@ void CGUIEditControl::SetInputType(CGUIEditControl::INPUT_TYPE type, CVariant he - m_inputHeading = heading.asString(); - else if (heading.isInteger() && heading.asInteger()) - m_inputHeading = g_localizeStrings.Get(static_cast(heading.asInteger())); -- //! @todo Verify the current input string? -+ // TODO: Verify the current input string? - } - - void CGUIEditControl::RecalcLabelPosition() -diff --git a/xbmc/guilib/GUIFadeLabelControl.cpp b/xbmc/guilib/GUIFadeLabelControl.cpp -index 01826a5..d981d66 100644 ---- a/xbmc/guilib/GUIFadeLabelControl.cpp -+++ b/xbmc/guilib/GUIFadeLabelControl.cpp -@@ -19,7 +19,6 @@ - */ - - #include "GUIFadeLabelControl.h" --#include "utils/Random.h" - - CGUIFadeLabelControl::CGUIFadeLabelControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, bool scrollOut, unsigned int timeToDelayAtEnd, bool resetOnLabelChange, bool randomized) - : CGUIControl(parentID, controlID, posX, posY, width, height), m_label(labelInfo), m_scrollInfo(50, labelInfo.offsetX, labelInfo.scrollSpeed) -@@ -64,7 +63,7 @@ void CGUIFadeLabelControl::SetInfo(const std::vector &infoLabels) - m_lastLabel = -1; - m_infoLabels = infoLabels; - if (m_randomized) -- KODI::UTILS::RandomShuffle(m_infoLabels.begin(), m_infoLabels.end()); -+ std::random_shuffle(m_infoLabels.begin(), m_infoLabels.end()); - } - - void CGUIFadeLabelControl::AddLabel(const std::string &label) -diff --git a/xbmc/guilib/GUIFadeLabelControl.h b/xbmc/guilib/GUIFadeLabelControl.h -index f17c14d..6cae459 100644 ---- a/xbmc/guilib/GUIFadeLabelControl.h -+++ b/xbmc/guilib/GUIFadeLabelControl.h -@@ -28,8 +28,6 @@ - * - */ - --#include -- - #include "GUIControl.h" - #include "GUILabel.h" - -diff --git a/xbmc/guilib/GUIFontManager.cpp b/xbmc/guilib/GUIFontManager.cpp -index 7e42707..8e044dd 100644 ---- a/xbmc/guilib/GUIFontManager.cpp -+++ b/xbmc/guilib/GUIFontManager.cpp -@@ -411,7 +411,7 @@ void GUIFontManager::LoadFonts(const TiXmlNode* fontNode) - - if (!fontName.empty() && URIUtils::HasExtension(fileName, ".ttf")) - { -- //! @todo Why do we tolower() this shit? -+ // TODO: Why do we tolower() this shit? - std::string strFontFileName = fileName; - StringUtils::ToLower(strFontFileName); - LoadTTF(fontName, strFontFileName, textColor, shadowColor, iSize, iStyle, false, lineSpacing, aspect); -diff --git a/xbmc/guilib/GUIFontManager.h b/xbmc/guilib/GUIFontManager.h -index 5f8745d..5d1a07b 100644 ---- a/xbmc/guilib/GUIFontManager.h -+++ b/xbmc/guilib/GUIFontManager.h -@@ -29,7 +29,6 @@ - */ - - #include --#include - - #include "GraphicContext.h" - #include "IMsgTargetCallback.h" -diff --git a/xbmc/guilib/GUIFontTTFDX.h b/xbmc/guilib/GUIFontTTFDX.h -index c66ce34..af7f557 100644 ---- a/xbmc/guilib/GUIFontTTFDX.h -+++ b/xbmc/guilib/GUIFontTTFDX.h -@@ -30,7 +30,6 @@ - #include "D3DResource.h" - #include "GUIFontTTF.h" - #include --#include - - #define ELEMENT_ARRAY_MAX_CHAR_INDEX (2000) - -diff --git a/xbmc/guilib/GUIFontTTFGL.h b/xbmc/guilib/GUIFontTTFGL.h -index 88c5f40..bcde308 100644 ---- a/xbmc/guilib/GUIFontTTFGL.h -+++ b/xbmc/guilib/GUIFontTTFGL.h -@@ -28,9 +28,6 @@ - #pragma once - - --#include --#include -- - #include "GUIFontTTF.h" - #include "system.h" - #include "system_gl.h" -diff --git a/xbmc/guilib/GUIImage.h b/xbmc/guilib/GUIImage.h -index 8eb8097..27f9fd9 100644 ---- a/xbmc/guilib/GUIImage.h -+++ b/xbmc/guilib/GUIImage.h -@@ -28,8 +28,6 @@ - * - */ - --#include -- - #include "GUIControl.h" - #include "GUITexture.h" - -diff --git a/xbmc/guilib/GUIKeyboardFactory.cpp b/xbmc/guilib/GUIKeyboardFactory.cpp -index 73f9631..4c6ea49 100644 ---- a/xbmc/guilib/GUIKeyboardFactory.cpp -+++ b/xbmc/guilib/GUIKeyboardFactory.cpp -@@ -201,8 +201,7 @@ int CGUIKeyboardFactory::ShowAndVerifyPassword(std::string& strPassword, const s - g_localizeStrings.Get(12343).c_str()); - - std::string strUserInput; -- //! @todo GUI Setting to enable disable this feature y/n? -- if (!ShowAndGetInput(strUserInput, strHeadingTemp, false, true, autoCloseMs)) //bool hiddenInput = false/true ? -+ if (!ShowAndGetInput(strUserInput, strHeadingTemp, false, true, autoCloseMs)) //bool hiddenInput = false/true ? TODO: GUI Setting to enable disable this feature y/n? - return -1; // user canceled out - - if (!strPassword.empty()) -diff --git a/xbmc/guilib/GUILabel.cpp b/xbmc/guilib/GUILabel.cpp -index db20131..759ac09 100644 ---- a/xbmc/guilib/GUILabel.cpp -+++ b/xbmc/guilib/GUILabel.cpp -@@ -88,7 +88,7 @@ color_t CGUILabel::GetColor() const - - bool CGUILabel::Process(unsigned int currentTime) - { -- //! @todo Add the correct processing -+ // TODO Add the correct processing - - bool overFlows = (m_renderRect.Width() + 0.5f < m_textLayout.GetTextWidth()); // 0.5f to deal with floating point rounding issues - bool renderSolid = (m_color == COLOR_DISABLED); -diff --git a/xbmc/guilib/GUIMoverControl.cpp b/xbmc/guilib/GUIMoverControl.cpp -index 13c0fd3..bee68cc 100644 ---- a/xbmc/guilib/GUIMoverControl.cpp -+++ b/xbmc/guilib/GUIMoverControl.cpp -@@ -33,9 +33,9 @@ CGUIMoverControl::CGUIMoverControl(int parentID, int controlID, float posX, floa - m_frameCounter = 0; - m_lastMoveTime = 0; - m_fSpeed = 1.0; -- m_fAnalogSpeed = 2.0f; //! @todo implement correct analog speed -- m_fAcceleration = 0.2f; //! @todo implement correct computation of acceleration -- m_fMaxSpeed = 10.0; //! @todo implement correct computation of maxspeed -+ m_fAnalogSpeed = 2.0f; // TODO: implement correct analog speed -+ m_fAcceleration = 0.2f; // TODO: implement correct computation of acceleration -+ m_fMaxSpeed = 10.0; // TODO: implement correct computation of maxspeed - ControlType = GUICONTROL_MOVER; - SetLimits(0, 0, 720, 576); // defaults - SetLocation(0, 0, false); // defaults -diff --git a/xbmc/guilib/GUIMultiImage.cpp b/xbmc/guilib/GUIMultiImage.cpp -index 4d43531..9038bdd 100644 ---- a/xbmc/guilib/GUIMultiImage.cpp -+++ b/xbmc/guilib/GUIMultiImage.cpp -@@ -28,7 +28,6 @@ - #include "input/Key.h" - #include "TextureCache.h" - #include "WindowIDs.h" --#include "utils/Random.h" - #include "utils/StringUtils.h" - - using namespace XFILE; -@@ -250,7 +249,7 @@ void CGUIMultiImage::OnDirectoryLoaded() - { - // Randomize or sort our images if necessary - if (m_randomized) -- KODI::UTILS::RandomShuffle(m_files.begin(), m_files.end()); -+ random_shuffle(m_files.begin(), m_files.end()); - else - sort(m_files.begin(), m_files.end()); - -diff --git a/xbmc/guilib/GUIMultiImage.h b/xbmc/guilib/GUIMultiImage.h -index 84535c5..e4af967 100644 ---- a/xbmc/guilib/GUIMultiImage.h -+++ b/xbmc/guilib/GUIMultiImage.h -@@ -28,8 +28,6 @@ - * - */ - --#include -- - #include "GUIImage.h" - #include "utils/Stopwatch.h" - #include "utils/Job.h" -diff --git a/xbmc/guilib/GUIRSSControl.h b/xbmc/guilib/GUIRSSControl.h -index 583ea20..33dc2f7 100644 ---- a/xbmc/guilib/GUIRSSControl.h -+++ b/xbmc/guilib/GUIRSSControl.h -@@ -28,8 +28,6 @@ - * - */ - --#include -- - #include "GUIControl.h" - #include "GUILabel.h" - #include "utils/IRssObserver.h" -diff --git a/xbmc/guilib/GUIRenderingControl.cpp b/xbmc/guilib/GUIRenderingControl.cpp -index 8aa58e3..143bb8f 100644 ---- a/xbmc/guilib/GUIRenderingControl.cpp -+++ b/xbmc/guilib/GUIRenderingControl.cpp -@@ -81,7 +81,7 @@ void CGUIRenderingControl::UpdateVisibility(const CGUIListItem *item) - - void CGUIRenderingControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) - { -- //! @todo Add processing to the addon so it could mark when actually changing -+ // TODO Add processing to the addon so it could mark when actually changing - CSingleLock lock(m_rendering); - if (m_callback && m_callback->IsDirty()) - MarkDirtyRegion(); -@@ -113,7 +113,7 @@ void CGUIRenderingControl::FreeResources(bool immediately) - - if (!m_callback) return; - -- g_graphicsContext.CaptureStateBlock(); //! @todo locking -+ g_graphicsContext.CaptureStateBlock(); //TODO locking - m_callback->Stop(); - g_graphicsContext.ApplyStateBlock(); - m_callback = NULL; -diff --git a/xbmc/guilib/GUIRenderingControl.h b/xbmc/guilib/GUIRenderingControl.h -index d46adf4..796d318 100644 ---- a/xbmc/guilib/GUIRenderingControl.h -+++ b/xbmc/guilib/GUIRenderingControl.h -@@ -28,7 +28,7 @@ class CGUIRenderingControl : public CGUIControl - public: - CGUIRenderingControl(int parentID, int controlID, float posX, float posY, float width, float height); - CGUIRenderingControl(const CGUIRenderingControl &from); -- virtual CGUIRenderingControl *Clone() const { return new CGUIRenderingControl(*this); }; //! @todo check for naughties -+ virtual CGUIRenderingControl *Clone() const { return new CGUIRenderingControl(*this); }; //TODO check for naughties - - virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions); - virtual void Render(); -diff --git a/xbmc/guilib/GUIResizeControl.cpp b/xbmc/guilib/GUIResizeControl.cpp -index d0531a0..89d3039 100644 ---- a/xbmc/guilib/GUIResizeControl.cpp -+++ b/xbmc/guilib/GUIResizeControl.cpp -@@ -33,9 +33,9 @@ CGUIResizeControl::CGUIResizeControl(int parentID, int controlID, float posX, fl - m_frameCounter = 0; - m_lastMoveTime = 0; - m_fSpeed = 1.0; -- m_fAnalogSpeed = 2.0f; //! @todo implement correct analog speed -- m_fAcceleration = 0.2f; //! @todo implement correct computation of acceleration -- m_fMaxSpeed = 10.0; //! @todo implement correct computation of maxspeed -+ m_fAnalogSpeed = 2.0f; // TODO: implement correct analog speed -+ m_fAcceleration = 0.2f; // TODO: implement correct computation of acceleration -+ m_fMaxSpeed = 10.0; // TODO: implement correct computation of maxspeed - ControlType = GUICONTROL_RESIZE; - SetLimits(0, 0, 720, 576); // defaults - m_nDirection = DIRECTION_NONE; -diff --git a/xbmc/guilib/GUISpinControl.h b/xbmc/guilib/GUISpinControl.h -index 83866d7..fee7875 100644 ---- a/xbmc/guilib/GUISpinControl.h -+++ b/xbmc/guilib/GUISpinControl.h -@@ -28,8 +28,6 @@ - * - */ - --#include -- - #include "GUIControl.h" - #include "GUITexture.h" - #include "GUILabel.h" -diff --git a/xbmc/guilib/GUIStaticItem.h b/xbmc/guilib/GUIStaticItem.h -index a3f268e..20c7182 100644 ---- a/xbmc/guilib/GUIStaticItem.h -+++ b/xbmc/guilib/GUIStaticItem.h -@@ -26,7 +26,6 @@ - */ - - #include --#include - - #include "GUIAction.h" - #include "GUIInfoTypes.h" -diff --git a/xbmc/guilib/GUITextLayout.cpp b/xbmc/guilib/GUITextLayout.cpp -index 8c17f67..cc6d04f 100644 ---- a/xbmc/guilib/GUITextLayout.cpp -+++ b/xbmc/guilib/GUITextLayout.cpp -@@ -174,10 +174,10 @@ void CGUITextLayout::RenderOutline(float x, float y, color_t color, color_t outl - align &= ~XBFONT_JUSTIFIED; - // text centered horizontally must be computed using the original font, not the bordered - // font, as the bordered font will be wider, and thus will end up uncentered. -- //! @todo We should really have a better way to handle text extent - at the moment we assume -- //! that text is rendered from a posx, posy, width, and height which isn't enough to -- //! accurately position text. We need a vertical and horizontal offset of the baseline -- //! and cursor as well. -+ // TODO: We should really have a better way to handle text extent - at the moment we assume -+ // that text is rendered from a posx, posy, width, and height which isn't enough to -+ // accurately position text. We need a vertical and horizontal offset of the baseline -+ // and cursor as well. - float bx = x; - if (align & XBFONT_CENTER_X) - { -diff --git a/xbmc/guilib/GUITexture.cpp b/xbmc/guilib/GUITexture.cpp -index 34237e4..5a6ffa0 100644 ---- a/xbmc/guilib/GUITexture.cpp -+++ b/xbmc/guilib/GUITexture.cpp -@@ -198,9 +198,9 @@ void CGUITextureBase::Render() - v3 *= m_texCoordsScaleV; - } - -- //! @todo The diffuse coloring applies to all vertices, which will -- //! look weird for stuff with borders, as will the -ve height/width -- //! for flipping -+ // TODO: The diffuse coloring applies to all vertices, which will -+ // look weird for stuff with borders, as will the -ve height/width -+ // for flipping - - // left segment (0,0,u1,v3) - if (m_info.border.x1) -diff --git a/xbmc/guilib/GUIVideoControl.cpp b/xbmc/guilib/GUIVideoControl.cpp -index dd1e594..a3f6039 100644 ---- a/xbmc/guilib/GUIVideoControl.cpp -+++ b/xbmc/guilib/GUIVideoControl.cpp -@@ -36,7 +36,7 @@ CGUIVideoControl::~CGUIVideoControl(void) - - void CGUIVideoControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) - { -- //! @todo Proper processing which marks when its actually changed. Just mark always for now. -+ // TODO Proper processing which marks when its actually changed. Just mark always for now. - if (g_application.m_pPlayer->IsRenderingGuiLayer()) - MarkDirtyRegion(); - -@@ -73,8 +73,8 @@ void CGUIVideoControl::Render() - - g_graphicsContext.RemoveTransform(); - } -- //! @todo remove this crap: HAS_VIDEO_PLAYBACK -- //! instantiating a video control having no playback is complete nonsense -+ // TODO: remove this crap: HAS_VIDEO_PLAYBACK -+ // instantiating a video control having no playback is complete nonsense - CGUIControl::Render(); - } - -diff --git a/xbmc/guilib/GUIVisualisationControl.h b/xbmc/guilib/GUIVisualisationControl.h -index c765cd0..1abdcff 100644 ---- a/xbmc/guilib/GUIVisualisationControl.h -+++ b/xbmc/guilib/GUIVisualisationControl.h -@@ -27,7 +27,7 @@ class CGUIVisualisationControl : public CGUIRenderingControl - public: - CGUIVisualisationControl(int parentID, int controlID, float posX, float posY, float width, float height); - CGUIVisualisationControl(const CGUIVisualisationControl &from); -- virtual CGUIVisualisationControl *Clone() const { return new CGUIVisualisationControl(*this); }; //! @todo check for naughties -+ virtual CGUIVisualisationControl *Clone() const { return new CGUIVisualisationControl(*this); }; //TODO check for naughties - virtual void FreeResources(bool immediately = false); - virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions); - virtual bool OnAction(const CAction &action); -diff --git a/xbmc/guilib/GUIWindowManager.cpp b/xbmc/guilib/GUIWindowManager.cpp -index 0a952e3..912a429 100644 ---- a/xbmc/guilib/GUIWindowManager.cpp -+++ b/xbmc/guilib/GUIWindowManager.cpp -@@ -301,9 +301,11 @@ bool CGUIWindowManager::DestroyWindows() - Delete(WINDOW_SPLASH); - Delete(WINDOW_MUSIC_PLAYLIST); - Delete(WINDOW_MUSIC_PLAYLIST_EDITOR); -+ Delete(WINDOW_MUSIC_FILES); - Delete(WINDOW_MUSIC_NAV); - Delete(WINDOW_DIALOG_MUSIC_INFO); - Delete(WINDOW_DIALOG_VIDEO_INFO); -+ Delete(WINDOW_VIDEO_FILES); - Delete(WINDOW_VIDEO_PLAYLIST); - Delete(WINDOW_VIDEO_NAV); - Delete(WINDOW_FILES); -@@ -631,8 +633,8 @@ void CGUIWindowManager::PreviousWindow() - // check to see whether our current window has a tag - if (pCurrentWindow->GetPreviousWindow() != WINDOW_INVALID) - { -- //! @todo we may need to test here for the -- //! whether our history should be changed -+ // TODO: we may need to test here for the -+ // whether our history should be changed - - // don't reactivate the previouswindow if it is ourselves. - if (currentWindow != pCurrentWindow->GetPreviousWindow()) -@@ -727,6 +729,20 @@ void CGUIWindowManager::ActivateWindow(int iWindowID, const std::vector& params, bool swappingWindows, bool force /* = false */) - { - // translate virtual windows -+ // virtual music window which returns the last open music window (aka the music start window) -+ if (iWindowID == WINDOW_MUSIC || iWindowID == WINDOW_MUSIC_FILES) -+ { // backward compatibility for pre-something -+ iWindowID = WINDOW_MUSIC_NAV; -+ } -+ // virtual video window which returns the last open video window (aka the video start window) -+ if (iWindowID == WINDOW_VIDEOS || iWindowID == WINDOW_VIDEO_FILES) -+ { // backward compatibility for pre-Eden -+ iWindowID = WINDOW_VIDEO_NAV; -+ } -+ if (iWindowID == WINDOW_SCRIPTS) -+ { // backward compatibility for pre-Dharma -+ iWindowID = WINDOW_PROGRAMS; -+ } - if (iWindowID == WINDOW_START) - { // virtual start window - iWindowID = g_SkinInfo->GetStartWindow(); -@@ -748,14 +764,10 @@ void CGUIWindowManager::ActivateWindow_Internal(int iWindowID, const std::vector - if (!pNewWindow) - { // nothing to see here - move along - CLog::Log(LOGERROR, "Unable to locate window with id %d. Check skin files", iWindowID - WINDOW_HOME); -- if (GetActiveWindowID() == WINDOW_STARTUP_ANIM) -- ActivateWindow(WINDOW_HOME); - return ; - } - else if (!pNewWindow->CanBeActivated()) - { -- if (GetActiveWindowID() == WINDOW_STARTUP_ANIM) -- ActivateWindow(WINDOW_HOME); - return; - } - else if (pNewWindow->IsDialog()) -diff --git a/xbmc/guilib/GUIWindowManager.h b/xbmc/guilib/GUIWindowManager.h -index 85c81fc..150765d 100644 ---- a/xbmc/guilib/GUIWindowManager.h -+++ b/xbmc/guilib/GUIWindowManager.h -@@ -30,7 +30,6 @@ - - #include - #include --#include - - #include "DirtyRegionTracker.h" - #include "guilib/WindowIDs.h" -diff --git a/xbmc/guilib/GraphicContext.cpp b/xbmc/guilib/GraphicContext.cpp -index 9caa431..9c43486 100644 ---- a/xbmc/guilib/GraphicContext.cpp -+++ b/xbmc/guilib/GraphicContext.cpp -@@ -975,12 +975,12 @@ void CGraphicContext::SetMediaDir(const std::string &strMediaDir) - m_strMediaDir = strMediaDir; - } - --void CGraphicContext::Flip(bool rendered, bool videoLayer) -+void CGraphicContext::Flip(bool rendered) - { - if (IsFullScreenVideo()) - g_Windowing.FinishPipeline(); - -- g_Windowing.PresentRender(rendered, videoLayer); -+ g_Windowing.PresentRender(rendered); - - if(m_stereoMode != m_nextStereoMode) - { -diff --git a/xbmc/guilib/GraphicContext.h b/xbmc/guilib/GraphicContext.h -index 08bbfd7..50a0a6d 100644 ---- a/xbmc/guilib/GraphicContext.h -+++ b/xbmc/guilib/GraphicContext.h -@@ -130,7 +130,7 @@ public: - void SetRenderingResolution(const RESOLUTION_INFO &res, bool needsScaling); ///< Sets scaling up for rendering - void SetScalingResolution(const RESOLUTION_INFO &res, bool needsScaling); ///< Sets scaling up for skin loading etc. - float GetScalingPixelRatio() const; -- void Flip(bool rendered, bool videoLayer); -+ void Flip(bool rendered); - void InvertFinalCoords(float &x, float &y) const; - inline float ScaleFinalXCoord(float x, float y) const XBMC_FORCE_INLINE { return m_finalTransform.matrix.TransformXCoord(x, y, 0); } - inline float ScaleFinalYCoord(float x, float y) const XBMC_FORCE_INLINE { return m_finalTransform.matrix.TransformYCoord(x, y, 0); } -diff --git a/xbmc/guilib/LocalizeStrings.cpp b/xbmc/guilib/LocalizeStrings.cpp -index e62ed7b..c49b290 100644 ---- a/xbmc/guilib/LocalizeStrings.cpp -+++ b/xbmc/guilib/LocalizeStrings.cpp -@@ -123,16 +123,16 @@ static bool LoadPO(const std::string &filename, std::map& stri - } - else if (PODoc.GetEntryType() == MSGID_FOUND) - { -- //! @todo implement reading of non-id based string entries from the PO files. -- //! These entries would go into a separate memory map, using hash codes for fast look-up. -- //! With this memory map we can implement using gettext(), ngettext(), pgettext() calls, -- //! so that we don't have to use new IDs for new strings. Even we can start converting -- //! the ID based calls to normal gettext calls. -+ // TODO: implement reading of non-id based string entries from the PO files. -+ // These entries would go into a separate memory map, using hash codes for fast look-up. -+ // With this memory map we can implement using gettext(), ngettext(), pgettext() calls, -+ // so that we don't have to use new IDs for new strings. Even we can start converting -+ // the ID based calls to normal gettext calls. - } - else if (PODoc.GetEntryType() == MSGID_PLURAL_FOUND) - { -- //! @todo implement reading of non-id based pluralized string entries from the PO files. -- //! We can store the pluralforms for each language, in the langinfo.xml files. -+ // TODO: implement reading of non-id based pluralized string entries from the PO files. -+ // We can store the pluralforms for each language, in the langinfo.xml files. - } - } - -@@ -210,7 +210,7 @@ void CLocalizeStrings::ClearSkinStrings() - - bool CLocalizeStrings::LoadSkinStrings(const std::string& path, const std::string& language) - { -- //! @todo shouldn't hold lock while loading file -+ //TODO: shouldn't hold lock while loading file - CExclusiveLock lock(m_stringsMutex); - ClearSkinStrings(); - // load the skin strings in. diff --git a/xbmc/guilib/Resolution.cpp b/xbmc/guilib/Resolution.cpp index b307524..64c7eda 100644 --- a/xbmc/guilib/Resolution.cpp @@ -77116,419 +11987,11 @@ index f571528..9c69aee 100644 + static void FindResolutionFromFpsMatch(float fps, int width, int height, bool is3D, bool isI, RESOLUTION &resolution, float& weight); static float RefreshWeight(float refresh, float fps); }; -diff --git a/xbmc/guilib/TextureBundle.cpp b/xbmc/guilib/TextureBundle.cpp -index 596fdf3..d224155 100644 ---- a/xbmc/guilib/TextureBundle.cpp -+++ b/xbmc/guilib/TextureBundle.cpp -@@ -18,10 +18,15 @@ - * - */ - -+#include "system.h" - #include "TextureBundle.h" - --CTextureBundle::CTextureBundle() -- : m_useXBT{false} -+CTextureBundle::CTextureBundle(void) -+{ -+ m_useXBT = false; -+} -+ -+CTextureBundle::~CTextureBundle(void) - { - } - -@@ -31,14 +36,15 @@ bool CTextureBundle::HasFile(const std::string& Filename) - { - return m_tbXBT.HasFile(Filename); - } -- -- if (m_tbXBT.HasFile(Filename)) -+ else if (m_tbXBT.HasFile(Filename)) - { - m_useXBT = true; - return true; - } -- -- return false; -+ else -+ { -+ return false; -+ } - } - - void CTextureBundle::GetTexturesFromPath(const std::string &path, std::vector &textures) -@@ -56,8 +62,10 @@ bool CTextureBundle::LoadTexture(const std::string& Filename, CBaseTexture** ppT - { - return m_tbXBT.LoadTexture(Filename, ppTexture, width, height); - } -- -- return false; -+ else -+ { -+ return false; -+ } - } - - int CTextureBundle::LoadAnim(const std::string& Filename, CBaseTexture*** ppTextures, -@@ -67,8 +75,16 @@ int CTextureBundle::LoadAnim(const std::string& Filename, CBaseTexture*** ppText - { - return m_tbXBT.LoadAnim(Filename, ppTextures, width, height, nLoops, ppDelays); - } -+ else -+ { -+ return 0; -+ } -+} - -- return 0; -+void CTextureBundle::Cleanup() -+{ -+ m_tbXBT.Cleanup(); -+ m_useXBT = false; - } - - void CTextureBundle::SetThemeBundle(bool themeBundle) -diff --git a/xbmc/guilib/TextureBundle.h b/xbmc/guilib/TextureBundle.h -index 67d62b4..1a4ec48 100644 ---- a/xbmc/guilib/TextureBundle.h -+++ b/xbmc/guilib/TextureBundle.h -@@ -27,8 +27,10 @@ - class CTextureBundle - { - public: -- CTextureBundle(); -- ~CTextureBundle() = default; -+ CTextureBundle(void); -+ ~CTextureBundle(void); -+ -+ void Cleanup(); - - void SetThemeBundle(bool themeBundle); - bool HasFile(const std::string& Filename); -diff --git a/xbmc/guilib/TextureBundleXBT.cpp b/xbmc/guilib/TextureBundleXBT.cpp -index 85ebd5b..4c06ed3 100644 ---- a/xbmc/guilib/TextureBundleXBT.cpp -+++ b/xbmc/guilib/TextureBundleXBT.cpp -@@ -18,46 +18,39 @@ - * - */ - --#include "TextureBundleXBT.h" -- - #include "system.h" -+#include "TextureBundleXBT.h" - #include "Texture.h" - #include "GraphicContext.h" - #include "utils/log.h" -+#include "addons/Skin.h" - #include "settings/Settings.h" - #include "filesystem/SpecialProtocol.h" - #include "filesystem/XbtManager.h" - #include "utils/URIUtils.h" - #include "utils/StringUtils.h" - #include "XBTF.h" --#include "XBTFReader.h" - #include - - #ifdef TARGET_WINDOWS --#ifdef NDEBUG --#pragma comment(lib,"lzo2.lib") --#else --#pragma comment(lib, "lzo2-no_idb.lib") --#endif -+#pragma comment(lib,"liblzo2.lib") - #endif - - CTextureBundleXBT::CTextureBundleXBT(void) -- : m_TimeStamp{0} -- , m_themeBundle{false} - { -+ m_themeBundle = false; -+ m_TimeStamp = 0; - } - - CTextureBundleXBT::~CTextureBundleXBT(void) - { -- if (m_XBTFReader != nullptr && m_XBTFReader->IsOpen()) -- { -- XFILE::CXbtManager::GetInstance().Release(CURL(m_path)); -- CLog::Log(LOGDEBUG, "%s - Closed %sbundle", __FUNCTION__, m_themeBundle ? "theme " : ""); -- } -+ Cleanup(); - } - - bool CTextureBundleXBT::OpenBundle() - { -+ Cleanup(); -+ - // Find the correct texture file (skin or theme) - if (m_themeBundle) - { -@@ -245,6 +238,15 @@ bool CTextureBundleXBT::ConvertFrameToTexture(const std::string& name, CXBTFFram - return true; - } - -+void CTextureBundleXBT::Cleanup() -+{ -+ if (m_XBTFReader != nullptr && m_XBTFReader->IsOpen()) -+ { -+ XFILE::CXbtManager::GetInstance().Release(CURL(m_path)); -+ CLog::Log(LOGDEBUG, "%s - Closed %sbundle", __FUNCTION__, m_themeBundle ? "theme " : ""); -+ } -+} -+ - void CTextureBundleXBT::SetThemeBundle(bool themeBundle) - { - m_themeBundle = themeBundle; -diff --git a/xbmc/guilib/TextureBundleXBT.h b/xbmc/guilib/TextureBundleXBT.h -index 408ec5e..1c5c516 100644 ---- a/xbmc/guilib/TextureBundleXBT.h -+++ b/xbmc/guilib/TextureBundleXBT.h -@@ -21,20 +21,18 @@ - */ - - #include --#include - #include --#include -+#include "XBTFReader.h" - - class CBaseTexture; --class CXBTFReader; --class CXBTFFrame; - - class CTextureBundleXBT - { - public: -- CTextureBundleXBT(); -- ~CTextureBundleXBT(); -+ CTextureBundleXBT(void); -+ ~CTextureBundleXBT(void); - -+ void Cleanup(); - void SetThemeBundle(bool themeBundle); - bool HasFile(const std::string& Filename); - void GetTexturesFromPath(const std::string &path, std::vector &textures); -@@ -56,7 +54,7 @@ private: - - bool m_themeBundle; - std::string m_path; -- std::shared_ptr m_XBTFReader; -+ CXBTFReaderPtr m_XBTFReader; - }; - - -diff --git a/xbmc/guilib/TextureManager.cpp b/xbmc/guilib/TextureManager.cpp -index c1c5c8f..f47ef52 100644 ---- a/xbmc/guilib/TextureManager.cpp -+++ b/xbmc/guilib/TextureManager.cpp -@@ -540,7 +540,7 @@ void CGUITextureManager::Cleanup() - i = m_vecTextures.erase(i); - } - for (int i = 0; i < 2; i++) -- m_TexBundle[i] = CTextureBundle(); -+ m_TexBundle[i].Cleanup(); - FreeUnusedTextures(); - } - -diff --git a/xbmc/guilib/WindowIDs.h b/xbmc/guilib/WindowIDs.h -index fcfcc5d..74f2a0c 100644 ---- a/xbmc/guilib/WindowIDs.h -+++ b/xbmc/guilib/WindowIDs.h -@@ -27,16 +27,20 @@ - #define WINDOW_PICTURES 10002 - #define WINDOW_FILES 10003 - #define WINDOW_SETTINGS_MENU 10004 -+#define WINDOW_MUSIC 10005 // virtual window to return the music start window. -+#define WINDOW_VIDEOS 10006 - #define WINDOW_SYSTEM_INFORMATION 10007 - #define WINDOW_TEST_PATTERN 10008 - #define WINDOW_SCREEN_CALIBRATION 10011 - - #define WINDOW_SETTINGS_START 10016 - #define WINDOW_SETTINGS_SYSTEM 10016 --#define WINDOW_SETTINGS_SERVICE 10018 -+#define WINDOW_SETTINGS_SERVICE 10018 // former (Eden) WINDOW_SETTINGS_NETWORK - -+#define WINDOW_SCRIPTS 10020 // virtual window for backward compatibility - #define WINDOW_SETTINGS_MYPVR 10021 - -+#define WINDOW_VIDEO_FILES 10024 - #define WINDOW_VIDEO_NAV 10025 - #define WINDOW_VIDEO_PLAYLIST 10028 - -@@ -102,6 +106,7 @@ - #define WINDOW_DIALOG_KEYBOARD_TOUCH 10156 - - #define WINDOW_MUSIC_PLAYLIST 10500 -+#define WINDOW_MUSIC_FILES 10501 - #define WINDOW_MUSIC_NAV 10502 - #define WINDOW_MUSIC_PLAYLIST_EDITOR 10503 - -diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp -index 7398fbf..1ff5435 100644 ---- a/xbmc/input/ButtonTranslator.cpp -+++ b/xbmc/input/ButtonTranslator.cpp -@@ -297,9 +297,12 @@ static const ActionMapping windows[] = - { "programs" , WINDOW_PROGRAMS }, - { "pictures" , WINDOW_PICTURES }, - { "filemanager" , WINDOW_FILES }, -+ { "files" , WINDOW_FILES }, // backward compat - { "settings" , WINDOW_SETTINGS_MENU }, -- { "music" , WINDOW_MUSIC_NAV }, -+ { "music" , WINDOW_MUSIC }, -+ { "video" , WINDOW_VIDEOS }, - { "videos" , WINDOW_VIDEO_NAV }, -+ { "pvr" , WINDOW_TV_CHANNELS }, // backward compat - { "tvchannels" , WINDOW_TV_CHANNELS }, - { "tvrecordings" , WINDOW_TV_RECORDINGS }, - { "tvguide" , WINDOW_TV_GUIDE }, -@@ -326,12 +329,18 @@ static const ActionMapping windows[] = - { "systeminfo" , WINDOW_SYSTEM_INFORMATION }, - { "testpattern" , WINDOW_TEST_PATTERN }, - { "screencalibration" , WINDOW_SCREEN_CALIBRATION }, -+ { "guicalibration" , WINDOW_SCREEN_CALIBRATION }, // backward compat - { "systemsettings" , WINDOW_SETTINGS_SYSTEM }, - { "servicesettings" , WINDOW_SETTINGS_SERVICE }, -+ { "networksettings" , WINDOW_SETTINGS_SERVICE }, // backward compat - { "pvrsettings" , WINDOW_SETTINGS_MYPVR }, -+ { "tvsettings" , WINDOW_SETTINGS_MYPVR }, // backward compat - { "playersettings" , WINDOW_SETTINGS_PLAYER }, - { "librarysettings" , WINDOW_SETTINGS_LIBRARY }, - { "interfacesettings" , WINDOW_SETTINGS_INTERFACE }, -+ { "scripts" , WINDOW_PROGRAMS }, // backward compat -+ { "videofiles" , WINDOW_VIDEO_FILES }, -+ { "videolibrary" , WINDOW_VIDEO_NAV }, - { "videoplaylist" , WINDOW_VIDEO_PLAYLIST }, - { "loginscreen" , WINDOW_LOGIN_SCREEN }, - { "profiles" , WINDOW_SETTINGS_PROFILES }, -@@ -345,6 +354,7 @@ static const ActionMapping windows[] = - { "favourites" , WINDOW_DIALOG_FAVOURITES }, - { "contextmenu" , WINDOW_DIALOG_CONTEXT_MENU }, - { "notification" , WINDOW_DIALOG_KAI_TOAST }, -+ { "infodialog" , WINDOW_DIALOG_KAI_TOAST }, // backward compat - { "numericinput" , WINDOW_DIALOG_NUMERIC }, - { "gamepadinput" , WINDOW_DIALOG_GAMEPAD }, - { "shutdownmenu" , WINDOW_DIALOG_BUTTON_MENU }, -@@ -352,6 +362,7 @@ static const ActionMapping windows[] = - { "seekbar" , WINDOW_DIALOG_SEEK_BAR }, - { "musicosd" , WINDOW_DIALOG_MUSIC_OSD }, - { "addonsettings" , WINDOW_DIALOG_ADDON_SETTINGS }, -+ { "visualisationsettings" , WINDOW_DIALOG_ADDON_SETTINGS }, // backward compat - { "visualisationpresetlist" , WINDOW_DIALOG_VIS_PRESET_LIST }, - { "osdvideosettings" , WINDOW_DIALOG_VIDEO_OSD_SETTINGS }, - { "osdaudiosettings" , WINDOW_DIALOG_AUDIO_OSD_SETTINGS }, -@@ -375,6 +386,8 @@ static const ActionMapping windows[] = - { "addoninformation" , WINDOW_DIALOG_ADDON_INFO }, - { "subtitlesearch" , WINDOW_DIALOG_SUBTITLES }, - { "musicplaylist" , WINDOW_MUSIC_PLAYLIST }, -+ { "musicfiles" , WINDOW_MUSIC_FILES }, -+ { "musiclibrary" , WINDOW_MUSIC_NAV }, - { "musicplaylisteditor" , WINDOW_MUSIC_PLAYLIST_EDITOR }, - { "teletext" , WINDOW_DIALOG_OSD_TELETEXT }, - { "selectdialog" , WINDOW_DIALOG_SELECT }, -diff --git a/xbmc/input/InputCodingTableBaiduPY.h b/xbmc/input/InputCodingTableBaiduPY.h -index 3f7c3bb..032d398 100644 ---- a/xbmc/input/InputCodingTableBaiduPY.h -+++ b/xbmc/input/InputCodingTableBaiduPY.h -@@ -22,9 +22,6 @@ - - #include - #include --#include --#include -- - #include "InputCodingTable.h" - #include "threads/Thread.h" - -diff --git a/xbmc/input/InputCodingTableBasePY.h b/xbmc/input/InputCodingTableBasePY.h -index 10a5463..7d9f6da 100644 ---- a/xbmc/input/InputCodingTableBasePY.h -+++ b/xbmc/input/InputCodingTableBasePY.h -@@ -23,7 +23,6 @@ - #include "InputCodingTable.h" - #include - #include --#include - - class CInputCodingTableBasePY : public IInputCodingTable - { -diff --git a/xbmc/input/InputCodingTableKorean.h b/xbmc/input/InputCodingTableKorean.h -index 7cff581..d2d3d9b 100644 ---- a/xbmc/input/InputCodingTableKorean.h -+++ b/xbmc/input/InputCodingTableKorean.h -@@ -23,7 +23,6 @@ - #include "InputCodingTable.h" - #include - #include --#include - - class CInputCodingTableKorean : public IInputCodingTable - { -diff --git a/xbmc/input/InputManager.cpp b/xbmc/input/InputManager.cpp -index 009a16e..b88599e 100644 ---- a/xbmc/input/InputManager.cpp -+++ b/xbmc/input/InputManager.cpp -@@ -88,7 +88,7 @@ void CInputManager::InitializeInputs() - - void CInputManager::SetEnabledJoystick(bool enabled /* = true */) - { -- //! @todo -+ // TODO - } - - bool CInputManager::ProcessRemote(int windowId) -diff --git a/xbmc/input/KeyboardLayoutManager.h b/xbmc/input/KeyboardLayoutManager.h -index cfe7ad9..351eb93 100644 ---- a/xbmc/input/KeyboardLayoutManager.h -+++ b/xbmc/input/KeyboardLayoutManager.h -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - - #include "input/KeyboardLayout.h" - -diff --git a/xbmc/input/joysticks/DefaultJoystick.cpp b/xbmc/input/joysticks/DefaultJoystick.cpp -index 7fddefa..ffd45f9 100644 ---- a/xbmc/input/joysticks/DefaultJoystick.cpp -+++ b/xbmc/input/joysticks/DefaultJoystick.cpp -@@ -110,7 +110,7 @@ bool CDefaultJoystick::OnAnalogStickMotion(const FeatureName& feature, float x, - - bool CDefaultJoystick::OnAccelerometerMotion(const FeatureName& feature, float x, float y, float z) - { -- return false; //! @todo implement -+ return false; // TODO - } - - bool CDefaultJoystick::ActivateDirection(const FeatureName& feature, float magnitude, CARDINAL_DIRECTION dir) -@@ -193,7 +193,7 @@ unsigned int CDefaultJoystick::GetKeyID(const FeatureName& feature, CARDINAL_DIR - break; - } - } -- else if (feature == "accelerometer") return 0; //! @todo implement -+ else if (feature == "accelerometer") return 0; // TODO - - return 0; - } diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp -index 3875138..1da2986 100644 +index 5486e28..1da2986 100644 --- a/xbmc/input/linux/LinuxInputDevices.cpp +++ b/xbmc/input/linux/LinuxInputDevices.cpp -@@ -30,6 +30,10 @@ - #include "system.h" - #if defined(HAS_LINUX_EVENTS) - -+#if defined(HAS_LIBAMCODEC) -+#include "utils/AMLUtils.h" -+#endif -+ - #include - - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) -@@ -1241,6 +1245,17 @@ void CLinuxInputDevices::InitAvailable() +@@ -1245,6 +1245,17 @@ void CLinuxInputDevices::InitAvailable() } } @@ -77558,70 +12021,6 @@ index 44a05fe..409bc2e 100644 void CheckHotplugged(); XBMC_Event ReadEvent(); bool IsRemoteLowBattery(); -diff --git a/xbmc/interfaces/AnnouncementManager.cpp b/xbmc/interfaces/AnnouncementManager.cpp -index 7e693aa..41272ea 100644 ---- a/xbmc/interfaces/AnnouncementManager.cpp -+++ b/xbmc/interfaces/AnnouncementManager.cpp -@@ -165,7 +165,7 @@ void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag, const char *sender, - { - id = item->GetVideoInfoTag()->m_iDbId; - -- //! @todo Can be removed once this is properly handled when starting playback of a file -+ // TODO: Can be removed once this is properly handled when starting playback of a file - if (id <= 0 && !item->GetPath().empty() && - (!item->HasProperty(LOOKUP_PROPERTY) || item->GetProperty(LOOKUP_PROPERTY).asBoolean())) - { -@@ -190,7 +190,7 @@ void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag, const char *sender, - - if (id <= 0) - { -- //! @todo Can be removed once this is properly handled when starting playback of a file -+ // TODO: Can be removed once this is properly handled when starting playback of a file - item->SetProperty(LOOKUP_PROPERTY, false); - - std::string title = item->GetVideoInfoTag()->m_strTitle; -@@ -201,8 +201,8 @@ void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag, const char *sender, - switch (item->GetVideoContentType()) - { - case VIDEODB_CONTENT_MOVIES: -- if (item->GetVideoInfoTag()->HasYear()) -- object["item"]["year"] = item->GetVideoInfoTag()->GetYear(); -+ if (item->GetVideoInfoTag()->m_iYear > 0) -+ object["item"]["year"] = item->GetVideoInfoTag()->m_iYear; - break; - case VIDEODB_CONTENT_EPISODES: - if (item->GetVideoInfoTag()->m_iEpisode >= 0) -@@ -226,7 +226,7 @@ void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag, const char *sender, - id = item->GetMusicInfoTag()->GetDatabaseId(); - type = MediaTypeSong; - -- //! @todo Can be removed once this is properly handled when starting playback of a file -+ // TODO: Can be removed once this is properly handled when starting playback of a file - if (id <= 0 && !item->GetPath().empty() && - (!item->HasProperty(LOOKUP_PROPERTY) || item->GetProperty(LOOKUP_PROPERTY).asBoolean())) - { -@@ -246,7 +246,7 @@ void CAnnouncementManager::DoAnnounce(AnnouncementFlag flag, const char *sender, - - if (id <= 0) - { -- //! @todo Can be removed once this is properly handled when starting playback of a file -+ // TODO: Can be removed once this is properly handled when starting playback of a file - item->SetProperty(LOOKUP_PROPERTY, false); - - std::string title = item->GetMusicInfoTag()->GetTitle(); -diff --git a/xbmc/interfaces/IActionListener.h b/xbmc/interfaces/IActionListener.h -index a612c59..84225ab 100644 ---- a/xbmc/interfaces/IActionListener.h -+++ b/xbmc/interfaces/IActionListener.h -@@ -20,7 +20,7 @@ - * - */ - --class CAction; -+#include "input/Key.h" - - class IActionListener - { diff --git a/xbmc/interfaces/IAnnouncer.h b/xbmc/interfaces/IAnnouncer.h index e3dfdd1..3284590 100644 --- a/xbmc/interfaces/IAnnouncer.h @@ -77649,78 +12048,6 @@ index e3dfdd1..3284590 100644 default: return "Unknown"; } -diff --git a/xbmc/interfaces/builtins/AddonBuiltins.cpp b/xbmc/interfaces/builtins/AddonBuiltins.cpp -index 446fc97..5012324 100644 ---- a/xbmc/interfaces/builtins/AddonBuiltins.cpp -+++ b/xbmc/interfaces/builtins/AddonBuiltins.cpp -@@ -275,8 +275,8 @@ static int AddonSettings(const std::vector& params) - */ - static int StopScript(const std::vector& params) - { -- //! @todo FIXME: This does not work for addons with multiple extension points! -- //! Are there any use for this? TODO: Fix hack in CScreenSaver::Destroy() and deprecate. -+ // FIXME: This does not work for addons with multiple extension points! -+ // Are there any use for this? TODO: Fix hack in CScreenSaver::Destroy() and deprecate. - std::string scriptpath(params[0]); - // Test to see if the param is an addon ID - AddonPtr script; -diff --git a/xbmc/interfaces/builtins/ApplicationBuiltins.cpp b/xbmc/interfaces/builtins/ApplicationBuiltins.cpp -index 86be03f..e9a41ae 100644 ---- a/xbmc/interfaces/builtins/ApplicationBuiltins.cpp -+++ b/xbmc/interfaces/builtins/ApplicationBuiltins.cpp -@@ -21,12 +21,9 @@ - #include "ApplicationBuiltins.h" - - #include "Application.h" --#ifdef HAS_FILESYSTEM_RAR - #include "filesystem/RarManager.h" --#endif - #include "filesystem/ZipManager.h" - #include "messaging/ApplicationMessenger.h" --#include "input/Key.h" - #include "interfaces/AnnouncementManager.h" - #include "network/Network.h" - #include "settings/AdvancedSettings.h" -diff --git a/xbmc/interfaces/builtins/GUIBuiltins.cpp b/xbmc/interfaces/builtins/GUIBuiltins.cpp -index ccee9af..a15dbbb 100644 ---- a/xbmc/interfaces/builtins/GUIBuiltins.cpp -+++ b/xbmc/interfaces/builtins/GUIBuiltins.cpp -@@ -25,7 +25,6 @@ - #include "dialogs/GUIDialogKaiToast.h" - #include "dialogs/GUIDialogNumeric.h" - #include "filesystem/Directory.h" --#include "input/Key.h" - #include "guilib/GUIWindowManager.h" - #include "guilib/LocalizeStrings.h" - #include "guilib/StereoscopicsManager.h" -diff --git a/xbmc/interfaces/builtins/GUIControlBuiltins.cpp b/xbmc/interfaces/builtins/GUIControlBuiltins.cpp -index e503230..4bc8b64 100644 ---- a/xbmc/interfaces/builtins/GUIControlBuiltins.cpp -+++ b/xbmc/interfaces/builtins/GUIControlBuiltins.cpp -@@ -52,8 +52,8 @@ static int SendClick(const std::vector& params) - g_windowManager.SendMessage(message); - } - else -- { // single param - assume you meant the focused window -- CGUIMessage message(GUI_MSG_CLICKED, atoi(params[0].c_str()), g_windowManager.GetFocusedWindow()); -+ { // single param - assume you meant the active window -+ CGUIMessage message(GUI_MSG_CLICKED, atoi(params[0].c_str()), g_windowManager.GetActiveWindow()); - g_windowManager.SendMessage(message); - } - -diff --git a/xbmc/interfaces/builtins/PlayerBuiltins.cpp b/xbmc/interfaces/builtins/PlayerBuiltins.cpp -index a97f5ce..2de9975 100644 ---- a/xbmc/interfaces/builtins/PlayerBuiltins.cpp -+++ b/xbmc/interfaces/builtins/PlayerBuiltins.cpp -@@ -424,7 +424,7 @@ static int PlayMedia(const std::vector& params) - break; - } - -- std::unique_ptr state(CGUIViewState::GetViewState(containsVideo ? WINDOW_VIDEO_NAV : WINDOW_MUSIC_NAV, items)); -+ std::unique_ptr state(CGUIViewState::GetViewState(containsVideo ? WINDOW_VIDEO_NAV : WINDOW_MUSIC, items)); - if (state.get()) - items.Sort(state->GetSortMethod()); - else diff --git a/xbmc/interfaces/builtins/SystemBuiltins.cpp b/xbmc/interfaces/builtins/SystemBuiltins.cpp index a3b568e..e6976be 100644 --- a/xbmc/interfaces/builtins/SystemBuiltins.cpp @@ -77747,1138 +12074,11 @@ index a3b568e..e6976be 100644 + {"changevt", {"Change active VT", 1, ChangeVT}} }; } -diff --git a/xbmc/interfaces/generic/LanguageInvokerThread.h b/xbmc/interfaces/generic/LanguageInvokerThread.h -index 65a7765..b3bf52e 100644 ---- a/xbmc/interfaces/generic/LanguageInvokerThread.h -+++ b/xbmc/interfaces/generic/LanguageInvokerThread.h -@@ -19,9 +19,6 @@ - * - */ - --#include --#include -- - #include "interfaces/generic/ILanguageInvoker.h" - #include "threads/Thread.h" - -diff --git a/xbmc/interfaces/generic/ScriptInvocationManager.h b/xbmc/interfaces/generic/ScriptInvocationManager.h -index aa5a162..a9ebc9c 100644 ---- a/xbmc/interfaces/generic/ScriptInvocationManager.h -+++ b/xbmc/interfaces/generic/ScriptInvocationManager.h -@@ -20,9 +20,8 @@ - */ - - #include --#include - #include --#include -+#include - - #include "addons/IAddon.h" - #include "interfaces/generic/ILanguageInvoker.h" -diff --git a/xbmc/interfaces/json-rpc/ApplicationOperations.cpp b/xbmc/interfaces/json-rpc/ApplicationOperations.cpp -index 749c670..3ab538e 100644 ---- a/xbmc/interfaces/json-rpc/ApplicationOperations.cpp -+++ b/xbmc/interfaces/json-rpc/ApplicationOperations.cpp -@@ -24,7 +24,6 @@ - #include "messaging/ApplicationMessenger.h" - #include "FileItem.h" - #include "Util.h" --#include "input/Key.h" - #include "utils/log.h" - #include "GUIInfoManager.h" - #include "system.h" -diff --git a/xbmc/interfaces/json-rpc/AudioLibrary.h b/xbmc/interfaces/json-rpc/AudioLibrary.h -index 6b4a2dd..33c05de 100644 ---- a/xbmc/interfaces/json-rpc/AudioLibrary.h -+++ b/xbmc/interfaces/json-rpc/AudioLibrary.h -@@ -20,8 +20,6 @@ - */ - - #include --#include --#include - - #include "JSONRPC.h" - #include "FileItemHandler.h" -diff --git a/xbmc/interfaces/json-rpc/FileItemHandler.cpp b/xbmc/interfaces/json-rpc/FileItemHandler.cpp -index ac24843..ed381a8 100644 ---- a/xbmc/interfaces/json-rpc/FileItemHandler.cpp -+++ b/xbmc/interfaces/json-rpc/FileItemHandler.cpp -@@ -399,7 +399,7 @@ bool CFileItemHandler::FillFileItemList(const CVariant ¶meterObject, CFileIt - bool added = false; - for (int index = 0; index < list.Size(); index++) - { -- if (list[index]->GetPath() == file || list[index]->GetMusicInfoTag()->GetURL() == file || list[index]->GetVideoInfoTag()->GetPath() == file) -+ if (list[index]->GetPath() == file) - { - added = true; - break; -diff --git a/xbmc/interfaces/json-rpc/InputOperations.cpp b/xbmc/interfaces/json-rpc/InputOperations.cpp -index 1166471..d70c6e6 100644 ---- a/xbmc/interfaces/json-rpc/InputOperations.cpp -+++ b/xbmc/interfaces/json-rpc/InputOperations.cpp -@@ -26,7 +26,6 @@ - #include "guilib/GUIWindowManager.h" - #include "guilib/GUIKeyboardFactory.h" - #include "input/ButtonTranslator.h" --#include "input/Key.h" - #include "utils/Variant.h" - #include "input/XBMC_keyboard.h" - #include "input/XBMC_vkeys.h" -@@ -35,9 +34,9 @@ - using namespace JSONRPC; - using namespace KODI::MESSAGING; - --//! @todo the breakage of the screensaver should be refactored --//! to one central super duper place for getting rid of --//! 1 million dupes -+//TODO the breakage of the screensaver should be refactored -+//to one central super duper place for getting rid of -+//1 million dupes - bool CInputOperations::handleScreenSaver() - { - g_application.ResetScreenSaver(); -diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp -index 1690be5..17a222a 100644 ---- a/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp -+++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.cpp -@@ -123,7 +123,6 @@ JsonRpcMethodMap CJSONServiceDescription::m_methodMaps[] = { - - // Video Library - { "VideoLibrary.GetGenres", CVideoLibrary::GetGenres }, -- { "VideoLibrary.GetTags", CVideoLibrary::GetTags }, - { "VideoLibrary.GetMovies", CVideoLibrary::GetMovies }, - { "VideoLibrary.GetMovieDetails", CVideoLibrary::GetMovieDetails }, - { "VideoLibrary.GetMovieSets", CVideoLibrary::GetMovieSets }, -diff --git a/xbmc/interfaces/json-rpc/JSONUtils.h b/xbmc/interfaces/json-rpc/JSONUtils.h -index 0e1cd1c..a3c9a0b 100644 ---- a/xbmc/interfaces/json-rpc/JSONUtils.h -+++ b/xbmc/interfaces/json-rpc/JSONUtils.h -@@ -21,7 +21,6 @@ - - #include - #include --#include - - #include "JSONRPCUtils.h" - #include "XBDateTime.h" -diff --git a/xbmc/interfaces/json-rpc/SettingsOperations.h b/xbmc/interfaces/json-rpc/SettingsOperations.h -index c4680ae..c221129 100644 ---- a/xbmc/interfaces/json-rpc/SettingsOperations.h -+++ b/xbmc/interfaces/json-rpc/SettingsOperations.h -@@ -19,8 +19,6 @@ - * - */ - --#include -- - #include "JSONRPC.h" - - class CVariant; -diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.cpp b/xbmc/interfaces/json-rpc/VideoLibrary.cpp -index c9067a7..cf1393e 100644 ---- a/xbmc/interfaces/json-rpc/VideoLibrary.cpp -+++ b/xbmc/interfaces/json-rpc/VideoLibrary.cpp -@@ -478,47 +478,6 @@ JSONRPC_STATUS CVideoLibrary::GetGenres(const std::string &method, ITransportLay - return OK; - } - --JSONRPC_STATUS CVideoLibrary::GetTags(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result) --{ -- std::string media = parameterObject["type"].asString(); -- StringUtils::ToLower(media); -- int idContent = -1; -- -- std::string strPath = "videodb://"; -- /* select which video content to get tags from*/ -- if (media == MediaTypeMovie) -- { -- idContent = VIDEODB_CONTENT_MOVIES; -- strPath += "movies"; -- } -- else if (media == MediaTypeTvShow) -- { -- idContent = VIDEODB_CONTENT_TVSHOWS; -- strPath += "tvshows"; -- } -- else if (media == MediaTypeMusicVideo) -- { -- idContent = VIDEODB_CONTENT_MUSICVIDEOS; -- strPath += "musicvideos"; -- } -- strPath += "/tags/"; -- -- CVideoDatabase videodatabase; -- if (!videodatabase.Open()) -- return InternalError; -- -- CFileItemList items; -- if (!videodatabase.GetTagsNav(strPath, items, idContent)) -- return InternalError; -- -- /* need to set strTitle in each item*/ -- for (int i = 0; i < items.Size(); i++) -- items[i]->GetVideoInfoTag()->m_strTitle = items[i]->GetLabel(); -- -- HandleFileItemList("tagid", false, "tags", items, parameterObject, result); -- return OK; --} -- - JSONRPC_STATUS CVideoLibrary::SetMovieDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result) - { - int id = (int)parameterObject["movieid"].asInteger(); -@@ -528,7 +487,7 @@ JSONRPC_STATUS CVideoLibrary::SetMovieDetails(const std::string &method, ITransp - return InternalError; - - CVideoInfoTag infos; -- if (!videodatabase.GetMovieInfo("", infos, id, RequiresInitialDetails(parameterObject)) || infos.m_iDbId <= 0) -+ if (!videodatabase.GetMovieInfo("", infos, id) || infos.m_iDbId <= 0) - return InvalidParams; - - // get artwork -@@ -605,7 +564,7 @@ JSONRPC_STATUS CVideoLibrary::SetTVShowDetails(const std::string &method, ITrans - return InternalError; - - CVideoInfoTag infos; -- if (!videodatabase.GetTvShowInfo("", infos, id, (CFileItem *)0, RequiresInitialDetails(parameterObject)) || infos.m_iDbId <= 0) -+ if (!videodatabase.GetTvShowInfo("", infos, id) || infos.m_iDbId <= 0) - return InvalidParams; - - // get artwork -@@ -676,7 +635,7 @@ JSONRPC_STATUS CVideoLibrary::SetEpisodeDetails(const std::string &method, ITran - return InternalError; - - CVideoInfoTag infos; -- videodatabase.GetEpisodeInfo("", infos, id, RequiresInitialDetails(parameterObject)); -+ videodatabase.GetEpisodeInfo("", infos, id); - if (infos.m_iDbId <= 0) - { - videodatabase.Close(); -@@ -988,14 +947,6 @@ bool CVideoLibrary::FillFileItemList(const CVariant ¶meterObject, CFileItemL - return success; - } - --int CVideoLibrary::RequiresInitialDetails(const CVariant ¶meterObject) --{ -- int details = VideoDbDetailsNone; -- if (ParameterNotNull(parameterObject, "ratings") || ParameterNotNull(parameterObject, "rating") || ParameterNotNull(parameterObject, "votes")) -- return VideoDbDetailsRating; -- return details; --} -- - int CVideoLibrary::RequiresAdditionalDetails(const MediaType& mediaType, const CVariant ¶meterObject) - { - if (mediaType != MediaTypeMovie && mediaType != MediaTypeTvShow && mediaType != MediaTypeEpisode && mediaType != MediaTypeMusicVideo) -@@ -1097,6 +1048,8 @@ void CVideoLibrary::UpdateVideoTag(const CVariant ¶meterObject, CVideoInfoTa - UpdateVideoTagField(parameterObject, "studio", studio, updatedDetails); - details.SetStudio(studio); - -+ if (ParameterNotNull(parameterObject, "year")) -+ details.m_iYear = (int)parameterObject["year"].asInteger(); - if (ParameterNotNull(parameterObject, "plot")) - details.SetPlot(parameterObject["plot"].asString()); - if (ParameterNotNull(parameterObject, "album")) -@@ -1127,22 +1080,14 @@ void CVideoLibrary::UpdateVideoTag(const CVariant ¶meterObject, CVideoInfoTa - CVariant ratings = parameterObject["ratings"]; - for (CVariant::const_iterator_map rIt = ratings.begin_map(); rIt != ratings.end_map(); rIt++) - { -- if (rIt->second.isObject() && ParameterNotNull(rIt->second, "rating")) -+ if (rIt->second.isArray() && ParameterNotNull(rIt->second, "name") && ParameterNotNull(rIt->second, "rating")) - { -- const auto& rating = rIt->second; -- if (ParameterNotNull(rating, "votes")) -- details.AddRating(rating["rating"].asFloat(), rating["votes"].asFloat(), rIt->first, (ParameterNotNull(rating, "default") && rating["default"].asBoolean())); -- else -- details.SetRating(rating["rating"].asFloat(), rIt->first, (ParameterNotNull(rating, "default") && rating["default"].asBoolean())); -- -- updatedDetails.insert("ratings"); -- } -- else if (rIt->second.isNull()) -- { -- details.RemoveRating(rIt->first); -- updatedDetails.insert("ratings"); -+ details.SetRating(rIt->second["rating"].asFloat(), rIt->second["name"].asString()); -+ if (ParameterNotNull(rIt->second, "votes")) -+ details.SetVotes(StringUtils::ReturnDigits(parameterObject["votes"].asString()), rIt->second["name"].asString()); - } - } -+ updatedDetails.insert("ratings"); - } - if (ParameterNotNull(parameterObject, "userrating")) - details.m_iUserRating = parameterObject["userrating"].asInteger(); -@@ -1151,13 +1096,7 @@ void CVideoLibrary::UpdateVideoTag(const CVariant ¶meterObject, CVideoInfoTa - if (ParameterNotNull(parameterObject, "imdbnumber")) - details.SetIMDBNumber(parameterObject["imdbnumber"].asString()); - if (ParameterNotNull(parameterObject, "premiered")) -- { -- CDateTime premiered; -- SetFromDBDate(parameterObject["premiered"], premiered); -- details.SetPremiered(premiered); -- } -- else if (ParameterNotNull(parameterObject, "year")) -- details.SetYear((int)parameterObject["year"].asInteger()); -+ SetFromDBDate(parameterObject["premiered"], details.m_premiered); - if (ParameterNotNull(parameterObject, "lastplayed")) - SetFromDBDateTime(parameterObject["lastplayed"], details.m_lastPlayed); - if (ParameterNotNull(parameterObject, "firstaired")) -diff --git a/xbmc/interfaces/json-rpc/VideoLibrary.h b/xbmc/interfaces/json-rpc/VideoLibrary.h -index efe9d5c..e466de3 100644 ---- a/xbmc/interfaces/json-rpc/VideoLibrary.h -+++ b/xbmc/interfaces/json-rpc/VideoLibrary.h -@@ -19,9 +19,6 @@ - * - */ - --#include --#include -- - #include "utils/DatabaseUtils.h" - #include "JSONRPC.h" - #include "FileItemHandler.h" -@@ -55,7 +52,6 @@ namespace JSONRPC - static JSONRPC_STATUS GetInProgressTVShows(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result); - - static JSONRPC_STATUS GetGenres(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result); -- static JSONRPC_STATUS GetTags(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result); - - static JSONRPC_STATUS SetMovieDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result); - static JSONRPC_STATUS SetMovieSetDetails(const std::string &method, ITransportLayer *transport, IClient *client, const CVariant ¶meterObject, CVariant &result); -@@ -84,7 +80,6 @@ namespace JSONRPC - - private: - static int RequiresAdditionalDetails(const MediaType& mediaType, const CVariant ¶meterObject); -- static int RequiresInitialDetails(const CVariant ¶meterObject); - static JSONRPC_STATUS HandleItems(const char *idProperty, const char *resultName, CFileItemList &items, const CVariant ¶meterObject, CVariant &result, bool limit = true); - static JSONRPC_STATUS RemoveVideo(const CVariant ¶meterObject); - static void UpdateVideoTag(const CVariant ¶meterObject, CVideoInfoTag &details, std::map &artwork, std::set &removedArtwork, std::set& updatedDetails); -diff --git a/xbmc/interfaces/json-rpc/schema/methods.json b/xbmc/interfaces/json-rpc/schema/methods.json -index e4897ef..bd0eab3 100644 ---- a/xbmc/interfaces/json-rpc/schema/methods.json -+++ b/xbmc/interfaces/json-rpc/schema/methods.json -@@ -1434,27 +1434,6 @@ - } - } - }, -- "VideoLibrary.GetTags": { -- "type": "method", -- "description": "Retrieve all tags", -- "transport": "Response", -- "permission": "ReadData", -- "params": [ -- { "name": "type", "type": "string", "required": true, "enum": [ "movie", "tvshow", "musicvideo" ] }, -- { "name": "properties", "$ref": "Library.Fields.Tag" }, -- { "name": "limits", "$ref": "List.Limits" }, -- { "name": "sort", "$ref": "List.Sort" } -- ], -- "returns": { -- "type": "object", -- "properties": { -- "limits": { "$ref": "List.LimitsReturned", "required": true }, -- "tags": { "type": "array", "required": true, -- "items": { "$ref": "Library.Details.Tag" } -- } -- } -- } -- }, - "VideoLibrary.SetMovieDetails": { - "type": "method", - "description": "Update the given movie with the given details", -@@ -1467,7 +1446,7 @@ - { "name": "runtime", "$ref": "Optional.Integer", "description": "Runtime in seconds" }, - { "name": "director", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, - { "name": "studio", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, -- { "name": "year", "$ref": "Optional.Integer", "description": "linked with premiered. Overridden by premiered parameter" }, -+ { "name": "year", "$ref": "Optional.Integer" }, - { "name": "plot", "$ref": "Optional.String" }, - { "name": "genre", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, - { "name": "rating", "$ref": "Optional.Number" }, -@@ -1491,9 +1470,8 @@ - { "name": "art", "type": [ "null", { "$ref": "Media.Artwork.Set", "required": true } ], "default": null }, - { "name": "resume", "type": [ "null", { "$ref": "Video.Resume", "required": true } ], "default": null }, - { "name": "userrating", "$ref": "Optional.Integer" }, -- { "name": "ratings", "$ref": "Video.Ratings.Set" }, -- { "name": "dateadded", "$ref": "Optional.String" }, -- { "name": "premiered", "$ref": "Optional.String", "description": "linked with year. Overriedes year" } -+ { "name": "ratings", "$ref": "Video.Ratings" }, -+ { "name": "dateadded", "$ref": "Optional.String" } - ], - "returns": "string" - }, -@@ -1535,7 +1513,7 @@ - { "name": "tag", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, - { "name": "art", "type": [ "null", { "$ref": "Media.Artwork.Set", "required": true } ], "default": null }, - { "name": "userrating", "$ref": "Optional.Integer" }, -- { "name": "ratings", "$ref": "Video.Ratings.Set" }, -+ { "name": "ratings", "$ref": "Video.Ratings" }, - { "name": "dateadded", "$ref": "Optional.String" }, - { "name": "runtime", "$ref": "Optional.Integer", "description": "Runtime in seconds" }, - { "name": "status", "$ref": "Optional.String" } -@@ -1580,7 +1558,7 @@ - { "name": "art", "type": [ "null", { "$ref": "Media.Artwork.Set", "required": true } ], "default": null }, - { "name": "resume", "type": [ "null", { "$ref": "Video.Resume", "required": true } ], "default": null }, - { "name": "userrating", "$ref": "Optional.Integer" }, -- { "name": "ratings", "$ref": "Video.Ratings.Set" }, -+ { "name": "ratings", "$ref": "Video.Ratings" }, - { "name": "dateadded", "$ref": "Optional.String" } - ], - "returns": "string" -@@ -1597,7 +1575,7 @@ - { "name": "runtime", "$ref": "Optional.Integer", "description": "Runtime in seconds" }, - { "name": "director", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, - { "name": "studio", "type": [ "null", { "$ref": "Array.String", "required": true } ], "default": null }, -- { "name": "year", "$ref": "Optional.Integer", "description": "linked with premiered. Overridden by premiered parameter" }, -+ { "name": "year", "$ref": "Optional.Integer" }, - { "name": "plot", "$ref": "Optional.String" }, - { "name": "album", "$ref": "Optional.String" }, - { "name": "artist", "type": [ "null", { "$ref": "Array.String", "required": true } ] }, -@@ -1611,8 +1589,7 @@ - { "name": "resume", "type": [ "null", { "$ref": "Video.Resume", "required": true } ], "default": null }, - { "name": "rating", "$ref": "Optional.Number" }, - { "name": "userrating", "$ref": "Optional.Integer" }, -- { "name": "dateadded", "$ref": "Optional.String" }, -- { "name": "premiered", "$ref": "Optional.String", "description": "linked with year. Overriedes year" } -+ { "name": "dateadded", "$ref": "Optional.String" } - ], - "returns": "string" - }, -diff --git a/xbmc/interfaces/json-rpc/schema/types.json b/xbmc/interfaces/json-rpc/schema/types.json -index 6264dea..c7211d9 100644 ---- a/xbmc/interfaces/json-rpc/schema/types.json -+++ b/xbmc/interfaces/json-rpc/schema/types.json -@@ -392,22 +392,6 @@ - }, - "additionalProperties": { "type": [ "null", { "$ref": "Global.String.NotEmpty", "required": true } ] } - }, -- "Video.Rating": { -- "type": "object", -- "properties": { -- "rating": { "type": "number", "required": true }, -- "votes": { "type": "integer" }, -- "default": { "type": "boolean" } -- } -- }, -- "Video.Ratings": { -- "type": "object", -- "additionalProperties": { "$ref": "Video.Rating" } -- }, -- "Video.Ratings.Set": { -- "type": "object", -- "additionalProperties": { "type": [ "null", { "$ref": "Video.Rating", "required": true } ] } -- }, - "Library.Fields.Genre": { - "extends": "Item.Fields.Base", - "items": { "type": "string", "enum": [ "title", "thumbnail" ] } -@@ -420,17 +404,6 @@ - "thumbnail": { "type": "string" } - } - }, -- "Library.Fields.Tag": { -- "extends": "Item.Fields.Base", -- "items": { "type": "string", "enum": [ "title" ] } -- }, -- "Library.Details.Tag": { -- "extends": "Item.Details.Base", -- "properties": { -- "tagid": { "$ref": "Library.Id", "required": true }, -- "title": { "type": "string" } -- } -- }, - "Audio.Fields.Role": { - "extends": "Item.Fields.Base", - "items": { "type": "string", "enum": [ "title" ] } -@@ -624,7 +597,7 @@ - "playcount", "writer", "studio", "mpaa", "cast", "country", - "imdbnumber", "runtime", "set", "showlink", "streamdetails", - "top250", "votes", "fanart", "thumbnail", "file", "sorttitle", -- "resume", "setid", "dateadded", "tag", "art", "userrating", "ratings", "premiered" ] -+ "resume", "setid", "dateadded", "tag", "art", "userrating", "ratings" ] - } - }, - "Video.Fields.MovieSet": { -@@ -673,7 +646,7 @@ - "studio", "year", "plot", "album", "artist", - "genre", "track", "streamdetails", "lastplayed", - "fanart", "thumbnail", "file", "resume", "dateadded", -- "tag", "art", "rating", "userrating", "premiered" ] -+ "tag", "art", "rating", "userrating" ] - } - }, - "Video.Cast": { -@@ -688,6 +661,18 @@ - "additionalProperties": false - } - }, -+ "Video.Ratings": { -+ "type": "array", -+ "items": { "type": "object", -+ "properties": { -+ "name": { "type": "string", "required": true }, -+ "rating": { "type": "number", "required": true }, -+ "votes": { "type": "integer" }, -+ "default": { "type": "boolean" } -+ }, -+ "additionalProperties": false -+ } -+ }, - "Video.Streams": { - "type": "object", - "properties": { -@@ -788,8 +773,7 @@ - "setid": { "$ref": "Library.Id" }, - "tag": { "$ref": "Array.String" }, - "userrating": { "type": "integer" }, -- "ratings": { "type": "Video.Ratings" }, -- "premiered": { "type": "string" } -+ "ratings": { "type": "Video.Ratings" } - } - }, - "Video.Details.MovieSet": { -@@ -880,8 +864,7 @@ - "track": { "type": "integer" }, - "tag": { "$ref": "Array.String" }, - "rating": { "type": "number" }, -- "userrating": { "type": "integer" }, -- "premiered": { "type": "string" } -+ "userrating": { "type": "integer" } - } - }, - "PVR.Property.Name": { -diff --git a/xbmc/interfaces/json-rpc/schema/version.txt b/xbmc/interfaces/json-rpc/schema/version.txt -index ee0a997..30338c7 100644 ---- a/xbmc/interfaces/json-rpc/schema/version.txt -+++ b/xbmc/interfaces/json-rpc/schema/version.txt -@@ -1 +1 @@ --7.16.0 -\ No newline at end of file -+7.13.2 -diff --git a/xbmc/interfaces/legacy/CallbackHandler.h b/xbmc/interfaces/legacy/CallbackHandler.h -index db5a56f..4199b34 100644 ---- a/xbmc/interfaces/legacy/CallbackHandler.h -+++ b/xbmc/interfaces/legacy/CallbackHandler.h -@@ -47,8 +47,8 @@ namespace XBMCAddon - * messages over to a language controlled thread for eventual - * execution. - * -- * @todo Allow a cross thread synchronous execution. -- * Fix the stupid means of calling the clearPendingCalls by passing -+ * TODO: Allow a cross thread synchronous execution. -+ * TODO: Fix the stupid means of calling the clearPendingCalls by passing - * userData which is specific to the handler/language type. - */ - class RetardedAsynchCallbackHandler : public CallbackHandler -diff --git a/xbmc/interfaces/legacy/Control.h b/xbmc/interfaces/legacy/Control.h -index ac7b848..7da4249 100644 ---- a/xbmc/interfaces/legacy/Control.h -+++ b/xbmc/interfaces/legacy/Control.h -@@ -20,8 +20,6 @@ - - #pragma once - --#include -- - #include "guilib/GUIControl.h" - #include "guilib/GUIFont.h" - #include "input/Key.h" -diff --git a/xbmc/interfaces/legacy/InfoTagMusic.cpp b/xbmc/interfaces/legacy/InfoTagMusic.cpp -index 8ee24c1..6b6e416 100644 ---- a/xbmc/interfaces/legacy/InfoTagMusic.cpp -+++ b/xbmc/interfaces/legacy/InfoTagMusic.cpp -@@ -77,16 +77,6 @@ namespace XBMCAddon - return infoTag->GetDuration(); - } - -- int InfoTagMusic::getRating() -- { -- return infoTag->GetRating(); -- } -- -- int InfoTagMusic::getUserRating() -- { -- return infoTag->GetUserrating(); -- } -- - int InfoTagMusic::getTrack() - { - return infoTag->GetTrackNumber(); -diff --git a/xbmc/interfaces/legacy/InfoTagMusic.h b/xbmc/interfaces/legacy/InfoTagMusic.h -index bbfd7c8..ae4dc38 100644 ---- a/xbmc/interfaces/legacy/InfoTagMusic.h -+++ b/xbmc/interfaces/legacy/InfoTagMusic.h -@@ -197,42 +197,6 @@ namespace XBMCAddon - #ifdef DOXYGEN_SHOULD_USE_THIS - /// - /// \ingroup python_InfoTagMusic -- /// @brief \python_func{ getRating() } -- ///----------------------------------------------------------------------- -- /// Returns the scraped rating as integer. -- /// -- /// @return [integer] Rating -- /// -- /// -- ///----------------------------------------------------------------------- -- /// -- /// -- getRating(); --#else -- int getRating(); --#endif -- --#ifdef DOXYGEN_SHOULD_USE_THIS -- /// -- /// \ingroup python_InfoTagMusic -- /// @brief \python_func{ getUserRating() } -- ///----------------------------------------------------------------------- -- /// Returns the user rating as integer (-1 if not existing) -- /// -- /// @return [integer] User rating -- /// -- /// -- ///----------------------------------------------------------------------- -- /// -- /// -- getUserRating(); --#else -- int getUserRating(); --#endif -- --#ifdef DOXYGEN_SHOULD_USE_THIS -- /// -- /// \ingroup python_InfoTagMusic - /// @brief \python_func{ getTrack() } - ///----------------------------------------------------------------------- - /// Returns the track number (if present) from music info tag as integer. -diff --git a/xbmc/interfaces/legacy/InfoTagVideo.cpp b/xbmc/interfaces/legacy/InfoTagVideo.cpp -index 2f635be..f5568f1 100644 ---- a/xbmc/interfaces/legacy/InfoTagVideo.cpp -+++ b/xbmc/interfaces/legacy/InfoTagVideo.cpp -@@ -134,7 +134,7 @@ namespace XBMCAddon - - int InfoTagVideo::getYear() - { -- return infoTag->GetYear(); -+ return infoTag->m_iYear; - } - - double InfoTagVideo::getRating() -@@ -142,11 +142,6 @@ namespace XBMCAddon - return infoTag->GetRating().rating; - } - -- int InfoTagVideo::getUserRating() -- { -- return infoTag->m_iUserRating; -- } -- - int InfoTagVideo::getPlayCount() - { - return infoTag->m_playCount; -@@ -164,7 +159,7 @@ namespace XBMCAddon - - String InfoTagVideo::getPremiered() - { -- return infoTag->GetPremiered().GetAsLocalizedDate(); -+ return infoTag->m_premiered.GetAsLocalizedDate(); - } - - String InfoTagVideo::getFirstAired() -diff --git a/xbmc/interfaces/legacy/InfoTagVideo.h b/xbmc/interfaces/legacy/InfoTagVideo.h -index fc90001..99df329 100644 ---- a/xbmc/interfaces/legacy/InfoTagVideo.h -+++ b/xbmc/interfaces/legacy/InfoTagVideo.h -@@ -441,24 +441,6 @@ namespace XBMCAddon - #ifdef DOXYGEN_SHOULD_USE_THIS - /// - /// \ingroup python_InfoTagVideo -- /// @brief \python_func{ getUserRating() } -- ///----------------------------------------------------------------------- -- /// Get the user rating if present as integer. -- /// -- /// @return [integer] The user rating of the video -- /// -- /// -- ///----------------------------------------------------------------------- -- /// -- /// -- getUserRating(); --#else -- int getUserRating(); --#endif -- --#ifdef DOXYGEN_SHOULD_USE_THIS -- /// -- /// \ingroup python_InfoTagVideo - /// @brief \python_func{ getPlayCount() } - ///----------------------------------------------------------------------- - /// To get the number of plays of the video. -diff --git a/xbmc/interfaces/legacy/ListItem.cpp b/xbmc/interfaces/legacy/ListItem.cpp -index 244ec80..db195dd 100644 ---- a/xbmc/interfaces/legacy/ListItem.cpp -+++ b/xbmc/interfaces/legacy/ListItem.cpp -@@ -294,7 +294,7 @@ namespace XBMCAddon - if (key == "dbid") - item->GetVideoInfoTag()->m_iDbId = strtol(value.c_str(), NULL, 10); - else if (key == "year") -- item->GetVideoInfoTag()->SetYear(strtol(value.c_str(), NULL, 10)); -+ item->GetVideoInfoTag()->m_iYear = strtol(value.c_str(), NULL, 10); - else if (key == "episode") - item->GetVideoInfoTag()->m_iEpisode = strtol(value.c_str(), NULL, 10); - else if (key == "season") -@@ -388,11 +388,7 @@ namespace XBMCAddon - else if (key == "tvshowtitle") - item->GetVideoInfoTag()->m_strShowTitle = value; - else if (key == "premiered") -- { -- CDateTime premiered; -- premiered.SetFromDateString(value); -- item->GetVideoInfoTag()->SetPremiered(premiered); -- } -+ item->GetVideoInfoTag()->m_premiered.SetFromDateString(value); - else if (key == "status") - item->GetVideoInfoTag()->m_strStatus = value; - else if (key == "set") -@@ -446,7 +442,7 @@ namespace XBMCAddon - const InfoLabelValue& alt = it->second; - const String value(alt.which() == first ? alt.former() : emptyString); - -- //! @todo add the rest of the infolabels -+ // TODO: add the rest of the infolabels - if (key == "tracknumber") - item->GetMusicInfoTag()->SetTrackNumber(strtol(value.c_str(), NULL, 10)); - else if (key == "discnumber") -diff --git a/xbmc/interfaces/legacy/ModuleXbmc.cpp b/xbmc/interfaces/legacy/ModuleXbmc.cpp -index af6472f..d7e65ab 100644 ---- a/xbmc/interfaces/legacy/ModuleXbmc.cpp -+++ b/xbmc/interfaces/legacy/ModuleXbmc.cpp -@@ -18,7 +18,7 @@ - * - */ - --//! @todo Need a uniform way of returning an error status -+// TODO: Need a uniform way of returning an error status - - #if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) - #include "config.h" -@@ -43,7 +43,6 @@ - #include "utils/Crc32.h" - #include "FileItem.h" - #include "LangInfo.h" --#include "PlayListPlayer.h" - #include "settings/AdvancedSettings.h" - #include "settings/Settings.h" - #include "guilib/TextureManager.h" -@@ -454,7 +453,7 @@ namespace XBMCAddon - return result; - } - -- //! @todo Add a mediaType enum -+ // TODO: Add a mediaType enum - String getSupportedMedia(const char* mediaType) - { - XBMC_TRACE; -@@ -466,7 +465,7 @@ namespace XBMCAddon - else if (strcmpi(mediaType, "picture") == 0) - result = g_advancedSettings.m_pictureExtensions; - -- //! @todo implement -+ // TODO: - // else - // return an error - -diff --git a/xbmc/interfaces/legacy/ModuleXbmcplugin.h b/xbmc/interfaces/legacy/ModuleXbmcplugin.h -index 184ada9..39d56d1 100644 ---- a/xbmc/interfaces/legacy/ModuleXbmcplugin.h -+++ b/xbmc/interfaces/legacy/ModuleXbmcplugin.h -@@ -18,8 +18,6 @@ - * - */ - --#include -- - #include "Tuple.h" - #include "AddonString.h" - #include "ListItem.h" -diff --git a/xbmc/interfaces/legacy/PlayList.cpp b/xbmc/interfaces/legacy/PlayList.cpp -index 5d97a2d..a04edda 100644 ---- a/xbmc/interfaces/legacy/PlayList.cpp -+++ b/xbmc/interfaces/legacy/PlayList.cpp -@@ -30,8 +30,8 @@ namespace XBMCAddon - { - namespace xbmc - { -- //! @todo need a means to check for a valid construction -- //! either by throwing an exception or by an "isValid" check -+ // TODO: need a means to check for a valid construction -+ // either by throwing an exception or by an "isValid" check - PlayList::PlayList(int playList) : - refs(1), iPlayList(playList), pPlayList(NULL) - { -diff --git a/xbmc/interfaces/legacy/Player.h b/xbmc/interfaces/legacy/Player.h -index 29ee6fc..717fabc 100644 ---- a/xbmc/interfaces/legacy/Player.h -+++ b/xbmc/interfaces/legacy/Player.h -@@ -20,8 +20,6 @@ - - #pragma once - --#include -- - #include "ListItem.h" - #include "PlayList.h" - #include "InfoTagVideo.h" -diff --git a/xbmc/interfaces/legacy/Window.cpp b/xbmc/interfaces/legacy/Window.cpp -index 420bae7..d3404c6 100644 ---- a/xbmc/interfaces/legacy/Window.cpp -+++ b/xbmc/interfaces/legacy/Window.cpp -@@ -168,13 +168,13 @@ namespace XBMCAddon - } - else - { -- //! @bug -- //! This is an existing window, so no resources are free'd. Note that -- //! THIS WILL FAIL for any controls newly created by python - they will -- //! remain after the script ends. Ideally this would be remedied by -- //! a flag in Control that specifies that it was python created - any python -- //! created controls could then be removed + free'd from the window. -- //! how this works with controlgroups though could be a bit tricky. -+ // BUG: -+ // This is an existing window, so no resources are free'd. Note that -+ // THIS WILL FAIL for any controls newly created by python - they will -+ // remain after the script ends. Ideally this would be remedied by -+ // a flag in Control that specifies that it was python created - any python -+ // created controls could then be removed + free'd from the window. -+ // how this works with controlgroups though could be a bit tricky. - } - - // and free our list of controls -@@ -276,7 +276,7 @@ namespace XBMCAddon - - Control* pControl = NULL; - -- //! @todo Yuck! Should probably be done with a Factory pattern -+ // TODO: Yuck! Should probably be done with a Factory pattern - switch(pGUIControl->GetControlType()) - { - case CGUIControl::GUICONTROL_BUTTON: -@@ -305,7 +305,6 @@ namespace XBMCAddon - pControl = new ControlTextBox(); - break; - case CGUIControl::GUICONTROL_IMAGE: -- case CGUIControl::GUICONTROL_BORDEREDIMAGE: - pControl = new ControlImage(); - break; - case CGUIControl::GUICONTROL_PROGRESS: -@@ -679,9 +678,9 @@ namespace XBMCAddon - - while (bModal && !g_application.m_bStop) - { --//! @todo garbear added this code to the pythin window.cpp class and --//! commented in XBPyThread.cpp. I'm not sure how to handle this --//! in this native implementation. -+// TODO: garbear added this code to the pythin window.cpp class and -+// commented in XBPyThread.cpp. I'm not sure how to handle this -+// in this native implementation. - // // Check if XBPyThread::stop() raised a SystemExit exception - // if (PyThreadState_Get()->async_exc == PyExc_SystemExit) - // { -diff --git a/xbmc/interfaces/legacy/Window.h b/xbmc/interfaces/legacy/Window.h -index 746692c..af26b17 100644 ---- a/xbmc/interfaces/legacy/Window.h -+++ b/xbmc/interfaces/legacy/Window.h -@@ -20,7 +20,6 @@ - - #pragma once - #include --#include - - #include "AddonCallback.h" - #include "Control.h" -diff --git a/xbmc/interfaces/legacy/WindowDialogMixin.cpp b/xbmc/interfaces/legacy/WindowDialogMixin.cpp -index 9bc70c4..3da6d88 100644 ---- a/xbmc/interfaces/legacy/WindowDialogMixin.cpp -+++ b/xbmc/interfaces/legacy/WindowDialogMixin.cpp -@@ -62,7 +62,7 @@ namespace XBMCAddon - CGUIMessage msg(GUI_MSG_WINDOW_INIT,0,0); - w->OnMessage(msg); - w->window->setActive(true); -- //! @todo Figure out how to clean up the CAction -+ // TODO: Figure out how to clean up the CAction - return true; - } - break; -diff --git a/xbmc/interfaces/legacy/WindowXML.cpp b/xbmc/interfaces/legacy/WindowXML.cpp -index 4650c6d..67afe20 100644 ---- a/xbmc/interfaces/legacy/WindowXML.cpp -+++ b/xbmc/interfaces/legacy/WindowXML.cpp -@@ -53,7 +53,7 @@ namespace XBMCAddon - #define checkedv(methcall) { if (window.isNotNull()) xwin-> methcall ; } - - -- //! @todo This should be done with template specialization -+ // TODO: This should be done with template specialization - class WindowXMLInterceptor : public InterceptorDialog - { - WindowXML* xwin; -@@ -62,30 +62,30 @@ namespace XBMCAddon - InterceptorDialog("CGUIMediaWindow",_window,windowid,xmlfile), xwin(_window) - { } - -- virtual void AllocResources(bool forceLoad = false) override -+ virtual void AllocResources(bool forceLoad = false) - { XBMC_TRACE; if(up()) CGUIMediaWindow::AllocResources(forceLoad); else checkedv(AllocResources(forceLoad)); } -- virtual void FreeResources(bool forceUnLoad = false) override -+ virtual void FreeResources(bool forceUnLoad = false) - { XBMC_TRACE; if(up()) CGUIMediaWindow::FreeResources(forceUnLoad); else checkedv(FreeResources(forceUnLoad)); } - virtual bool OnClick(int iItem, const std::string &player = "") override { XBMC_TRACE; return up() ? CGUIMediaWindow::OnClick(iItem, player) : checkedb(OnClick(iItem)); } - -- virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override -+ virtual void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) - { XBMC_TRACE; if(up()) CGUIMediaWindow::Process(currentTime,dirtyregions); else checkedv(Process(currentTime,dirtyregions)); } - - // this is a hack to SKIP the CGUIMediaWindow -- virtual bool OnAction(const CAction &action) override -+ virtual bool OnAction(const CAction &action) - { XBMC_TRACE; return up() ? CGUIWindow::OnAction(action) : checkedb(OnAction(action)); } - - protected: - // CGUIWindow -- virtual bool LoadXML(const std::string &strPath, const std::string &strPathLower) override -+ virtual bool LoadXML(const std::string &strPath, const std::string &strPathLower) - { XBMC_TRACE; return up() ? CGUIMediaWindow::LoadXML(strPath,strPathLower) : xwin->LoadXML(strPath,strPathLower); } - - // CGUIMediaWindow -- virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) override -+ virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) - { XBMC_TRACE; if (up()) CGUIMediaWindow::GetContextButtons(itemNumber,buttons); else xwin->GetContextButtons(itemNumber,buttons); } -- virtual bool Update(const std::string &strPath) override -+ virtual bool Update(const std::string &strPath) - { XBMC_TRACE; return up() ? CGUIMediaWindow::Update(strPath) : xwin->Update(strPath); } -- virtual void SetupShares() override { XBMC_TRACE; if(up()) CGUIMediaWindow::SetupShares(); else checkedv(SetupShares()); } -+ virtual void SetupShares() { XBMC_TRACE; if(up()) CGUIMediaWindow::SetupShares(); else checkedv(SetupShares()); } - - friend class WindowXML; - friend class WindowXMLDialog; -@@ -185,25 +185,12 @@ namespace XBMCAddon - A(m_vecItems)->AddFront(fileItem,position); - } - A(m_viewControl).SetItems(*(A(m_vecItems))); -+ A(UpdateButtons()); - } - //---------------------------------------------------- - } - } - -- void WindowXML::addItems(const std::vector > & items) -- { -- XBMC_TRACE; -- LOCKGUI; -- for (auto item : items) -- { -- AddonClass::Ref ritem = item.which() == XBMCAddon::first ? ListItem::fromString(item.former()) : AddonClass::Ref(item.later()); -- CFileItemPtr& fileItem = ritem->item; -- A(m_vecItems)->Add(fileItem); -- } -- A(m_viewControl).SetItems(*(A(m_vecItems))); -- } -- -- - void WindowXML::removeItem(int position) - { - XBMC_TRACE; -@@ -211,6 +198,7 @@ namespace XBMCAddon - LOCKGUI; - A(m_vecItems)->Remove(position); - A(m_viewControl).SetItems(*(A(m_vecItems))); -+ A(UpdateButtons()); - } - - int WindowXML::getCurrentListPosition() -@@ -265,6 +253,7 @@ namespace XBMCAddon - A(ClearFileItems()); - - A(m_viewControl).SetItems(*(A(m_vecItems))); -+ A(UpdateButtons()); - } - - void WindowXML::setContainerProperty(const String& key, const String& value) -@@ -301,9 +290,9 @@ namespace XBMCAddon - CLog::Log(LOGDEBUG,"%sMessage id:%d",_tg.getSpaces(),(int)message.GetMessage()); - #endif - -- //! @todo We shouldn't be dropping down to CGUIWindow in any of this ideally. -- //! We have to make up our minds about what python should be doing and -- //! what this side of things should be doing -+ // TODO: We shouldn't be dropping down to CGUIWindow in any of this ideally. -+ // We have to make up our minds about what python should be doing and -+ // what this side of things should be doing - switch (message.GetMessage()) - { - case GUI_MSG_WINDOW_DEINIT: -@@ -478,6 +467,7 @@ namespace XBMCAddon - void WindowXML::SetupShares() - { - XBMC_TRACE; -+ A(UpdateButtons()); - } - - bool WindowXML::Update(const String &strPath) -diff --git a/xbmc/interfaces/legacy/WindowXML.h b/xbmc/interfaces/legacy/WindowXML.h -index d2fa2c7..c2cfb9a 100644 ---- a/xbmc/interfaces/legacy/WindowXML.h -+++ b/xbmc/interfaces/legacy/WindowXML.h -@@ -21,7 +21,6 @@ - #pragma once - - #include --#include - - #include "Window.h" - #include "windows/GUIMediaWindow.h" -@@ -146,31 +145,6 @@ namespace XBMCAddon - #ifdef DOXYGEN_SHOULD_USE_THIS - /// - /// \ingroup python_xbmcgui_window_xml -- /// @brief \python_func{ addItems(items) } -- ///----------------------------------------------------------------------- -- /// Add a list of items to to the window list. -- /// -- /// -- /// @param items List - list of strings, unicode objects or ListItems to add. -- /// -- /// -- /// ---------------------------------------------------------------------- -- /// -- /// **Example:** -- /// ~~~~~~~~~~~~~{.py} -- /// .. -- /// self.addItems(['Reboot Kodi', 'Restart Kodi']) -- /// .. -- /// ~~~~~~~~~~~~~ -- /// -- addItems(...); --#else -- SWIGHIDDENVIRTUAL void addItems(const std::vector > & items); --#endif -- --#ifdef DOXYGEN_SHOULD_USE_THIS -- /// -- /// \ingroup python_xbmcgui_window_xml - /// @brief \python_func{ removeItem(position) } - ///----------------------------------------------------------------------- - /// Removes a specified item based on position, from the Window List. -diff --git a/xbmc/interfaces/legacy/wsgi/WsgiResponse.h b/xbmc/interfaces/legacy/wsgi/WsgiResponse.h -index a741631..a679faa 100644 ---- a/xbmc/interfaces/legacy/wsgi/WsgiResponse.h -+++ b/xbmc/interfaces/legacy/wsgi/WsgiResponse.h -@@ -19,8 +19,6 @@ - * - */ - --#include -- - #include "interfaces/legacy/AddonClass.h" - #include "interfaces/legacy/Tuple.h" - #include "interfaces/legacy/wsgi/WsgiResponseBody.h" -diff --git a/xbmc/interfaces/python/CallbackHandler.cpp b/xbmc/interfaces/python/CallbackHandler.cpp -index 1636740..6bcaff6 100644 ---- a/xbmc/interfaces/python/CallbackHandler.cpp -+++ b/xbmc/interfaces/python/CallbackHandler.cpp -@@ -59,7 +59,7 @@ namespace XBMCAddon - * For this method we expect the PyThreadState to be passed as the user - * data for the check. - * -- * @todo This is a stupid way to get this information back to the handler. -+ * TODO: This is a stupid way to get this information back to the handler. - * there should be a more language neutral means. - */ - bool PythonCallbackHandler::shouldRemoveCallback(AddonClass* obj, void* threadState) -diff --git a/xbmc/interfaces/python/PythonInvoker.h b/xbmc/interfaces/python/PythonInvoker.h -index 11fb396..6dab1df 100644 ---- a/xbmc/interfaces/python/PythonInvoker.h -+++ b/xbmc/interfaces/python/PythonInvoker.h -@@ -21,7 +21,6 @@ - - #include - #include --#include - - #include "interfaces/generic/ILanguageInvoker.h" - #include "threads/CriticalSection.h" -diff --git a/xbmc/interfaces/python/swig.cpp b/xbmc/interfaces/python/swig.cpp -index 947c442..fea0a23 100644 ---- a/xbmc/interfaces/python/swig.cpp -+++ b/xbmc/interfaces/python/swig.cpp -@@ -55,9 +55,9 @@ namespace PythonBindings - return; - } - -- //! @todo UTF-8: Does python use UTF-16? -- //! Do we need to convert from the string charset to UTF-8 -- //! for non-unicode data? -+ // TODO: UTF-8: Does python use UTF-16? -+ // Do we need to convert from the string charset to UTF-8 -+ // for non-unicode data? - if (PyUnicode_Check(pObject)) - { - // Python unicode objects are UCS2 or UCS4 depending on compilation -diff --git a/xbmc/linux/LinuxTimezone.cpp b/xbmc/linux/LinuxTimezone.cpp -index b562c49..b780e62 100644 ---- a/xbmc/linux/LinuxTimezone.cpp -+++ b/xbmc/linux/LinuxTimezone.cpp -@@ -119,7 +119,7 @@ CLinuxTimezone::CLinuxTimezone() : m_IsDST(0) - s = line; - StringUtils::Trim(s); - -- //! @todo STRING_CLEANUP -+ /* TODO:STRING_CLEANUP */ - if (s.length() == 0) - continue; - -diff --git a/xbmc/linux/OMXCore.h b/xbmc/linux/OMXCore.h -index 5536cb9..a89b77b 100644 ---- a/xbmc/linux/OMXCore.h -+++ b/xbmc/linux/OMXCore.h -@@ -23,9 +23,8 @@ - - #include - #include --#include - --//! @todo should this be in configure -+// TODO: should this be in configure - #ifndef OMX_SKIP64BIT - #define OMX_SKIP64BIT - #endif -diff --git a/xbmc/linux/PosixMountProvider.h b/xbmc/linux/PosixMountProvider.h -index df4cabe..d34247f 100644 ---- a/xbmc/linux/PosixMountProvider.h -+++ b/xbmc/linux/PosixMountProvider.h -@@ -18,9 +18,6 @@ - * . - * - */ --#include --#include -- - #include "storage/IStorageProvider.h" - - class CPosixMountProvider : public IStorageProvider diff --git a/xbmc/linux/RBP.cpp b/xbmc/linux/RBP.cpp -index d101638..494865d 100644 +index 080f176..494865d 100644 --- a/xbmc/linux/RBP.cpp +++ b/xbmc/linux/RBP.cpp -@@ -213,8 +213,10 @@ uint32_t CRBP::WaitVsync(uint32_t target) - target = m_vsync_count+1; - while (!delay.IsTimePast()) - { -+ CSingleLock lock(m_critSection); - if ((signed)(m_vsync_count - target) >= 0) - break; -+ lock.Leave(); - if (!m_vsync_cond.wait(vlock, delay.MillisLeft())) - break; - } -@@ -262,6 +264,20 @@ void CRBP::Deinitialize() +@@ -264,6 +264,20 @@ void CRBP::Deinitialize() vcsm_exit(); } @@ -79063,104 +12263,6 @@ index 75378ff..1d3d937 100644 + std::atomic m_iRefs; +}; + -diff --git a/xbmc/listproviders/DirectoryProvider.cpp b/xbmc/listproviders/DirectoryProvider.cpp -index 75abf5b..f5457bc 100644 ---- a/xbmc/listproviders/DirectoryProvider.cpp -+++ b/xbmc/listproviders/DirectoryProvider.cpp -@@ -211,7 +211,7 @@ bool CDirectoryProvider::Update(bool forceRefresh) - - for (std::vector::iterator i = m_items.begin(); i != m_items.end(); ++i) - changed |= (*i)->UpdateVisibility(m_parentID); -- return changed; //! @todo Also returned changed if properties are changed (if so, need to update scroll to letter). -+ return changed; // TODO: Also returned changed if properties are changed (if so, need to update scroll to letter). - } - - void CDirectoryProvider::Announce(AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) -diff --git a/xbmc/listproviders/DirectoryProvider.h b/xbmc/listproviders/DirectoryProvider.h -index a15fdd2..d8dad25 100644 ---- a/xbmc/listproviders/DirectoryProvider.h -+++ b/xbmc/listproviders/DirectoryProvider.h -@@ -21,8 +21,6 @@ - #pragma once - - #include --#include -- - #include "IListProvider.h" - #include "guilib/GUIStaticItem.h" - #include "utils/Job.h" -@@ -56,17 +54,17 @@ public: - CDirectoryProvider(const TiXmlElement *element, int parentID); - virtual ~CDirectoryProvider(); - -- virtual bool Update(bool forceRefresh) override; -- virtual void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) override; -- virtual void Fetch(std::vector &items) const override; -- virtual void Reset(bool immediately = false) override; -- virtual bool OnClick(const CGUIListItemPtr &item) override; -+ virtual bool Update(bool forceRefresh); -+ virtual void Announce(ANNOUNCEMENT::AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data); -+ virtual void Fetch(std::vector &items) const; -+ virtual void Reset(bool immediately = false); -+ virtual bool OnClick(const CGUIListItemPtr &item); - bool OnInfo(const CGUIListItemPtr &item) override; - bool OnContextMenu(const CGUIListItemPtr &item) override; -- virtual bool IsUpdating() const override; -+ virtual bool IsUpdating() const; - - // callback from directory job -- virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job) override; -+ virtual void OnJobComplete(unsigned int jobID, bool success, CJob *job); - private: - UpdateState m_updateState; - bool m_isAnnounced; -diff --git a/xbmc/listproviders/StaticProvider.cpp b/xbmc/listproviders/StaticProvider.cpp -index a0bcd3d..43ef9a3 100644 ---- a/xbmc/listproviders/StaticProvider.cpp -+++ b/xbmc/listproviders/StaticProvider.cpp -@@ -75,7 +75,7 @@ bool CStaticListProvider::Update(bool forceRefresh) - } - for (std::vector::iterator i = m_items.begin(); i != m_items.end(); ++i) - changed |= (*i)->UpdateVisibility(m_parentID); -- return changed; //! @todo Also returned changed if properties are changed (if so, need to update scroll to letter). -+ return changed; // TODO: Also returned changed if properties are changed (if so, need to update scroll to letter). - } - - void CStaticListProvider::Fetch(std::vector &items) const -diff --git a/xbmc/listproviders/StaticProvider.h b/xbmc/listproviders/StaticProvider.h -index 9a36691..5a869e8 100644 ---- a/xbmc/listproviders/StaticProvider.h -+++ b/xbmc/listproviders/StaticProvider.h -@@ -20,8 +20,6 @@ - - #pragma once - --#include -- - #include "IListProvider.h" - #include "guilib/GUIStaticItem.h" - -@@ -32,14 +30,14 @@ public: - CStaticListProvider(const std::vector &items); // for python - virtual ~CStaticListProvider(); - -- virtual bool Update(bool forceRefresh) override; -- virtual void Fetch(std::vector &items) const override; -- virtual bool OnClick(const CGUIListItemPtr &item) override; -+ virtual bool Update(bool forceRefresh); -+ virtual void Fetch(std::vector &items) const; -+ virtual bool OnClick(const CGUIListItemPtr &item); - bool OnInfo(const CGUIListItemPtr &item) override { return false; } - bool OnContextMenu(const CGUIListItemPtr &item) override { return false; } -- virtual void SetDefaultItem(int item, bool always) override; -- virtual int GetDefaultItem() const override; -- virtual bool AlwaysFocusDefaultItem() const override; -+ virtual void SetDefaultItem(int item, bool always); -+ virtual int GetDefaultItem() const; -+ virtual bool AlwaysFocusDefaultItem() const; - private: - int m_defaultItem; - bool m_defaultAlways; diff --git a/xbmc/messaging/ApplicationMessenger.h b/xbmc/messaging/ApplicationMessenger.h index b54b1c8..67cda36 100644 --- a/xbmc/messaging/ApplicationMessenger.h @@ -79175,128 +12277,8 @@ index b54b1c8..67cda36 100644 #define TMSG_GUI_INFOLABEL TMSG_MASK_GUIINFOMANAGER + 0 #define TMSG_GUI_INFOBOOL TMSG_MASK_GUIINFOMANAGER + 1 -diff --git a/xbmc/music/Album.cpp b/xbmc/music/Album.cpp -index a091766..413b53d 100644 ---- a/xbmc/music/Album.cpp -+++ b/xbmc/music/Album.cpp -@@ -391,9 +391,9 @@ bool CAlbum::Load(const TiXmlElement *album, bool append, bool prioritise) - float max_rating = 10; - XMLUtils::GetFloat(album, "userrating", rating); - if (userrating->QueryFloatAttribute("max", &max_rating) == TIXML_SUCCESS && max_rating >= 1) -- rating *= (10.f / max_rating); // Normalise the Rating to between 0 and 10 -- if (rating > 10.f) -- rating = 10.f; -+ rating *= (5.f / max_rating); // Normalise the Rating to between 0 and 10 -+ if (rating > 5.f) -+ rating = 5.f; - iUserrating = MathUtils::round_int(rating); - } - XMLUtils::GetInt(album, "votes", iVotes); -diff --git a/xbmc/music/GUIViewStateMusic.cpp b/xbmc/music/GUIViewStateMusic.cpp -index bf6fd4c..4d8adae 100644 ---- a/xbmc/music/GUIViewStateMusic.cpp -+++ b/xbmc/music/GUIViewStateMusic.cpp -@@ -61,6 +61,7 @@ std::string CGUIViewStateWindowMusic::GetExtensions() - - VECSOURCES& CGUIViewStateWindowMusic::GetSources() - { -+ AddAddonsSource("audio", g_localizeStrings.Get(1038), "DefaultAddonMusic.png"); - return CGUIViewState::GetSources(); - } - -@@ -416,12 +417,12 @@ CGUIViewStateMusicPlaylist::CGUIViewStateMusicPlaylist(const CFileItemList& item - SetViewAsControl(viewState->m_viewMode); - SetSortOrder(viewState->m_sortDescription.sortOrder); - -- LoadViewState(items.GetPath(), WINDOW_MUSIC_NAV); -+ LoadViewState(items.GetPath(), WINDOW_MUSIC_FILES); - } - - void CGUIViewStateMusicPlaylist::SaveViewState() - { -- SaveViewToDb(m_items.GetPath(), WINDOW_MUSIC_NAV); -+ SaveViewToDb(m_items.GetPath(), WINDOW_MUSIC_FILES); - } - - CGUIViewStateWindowMusicNav::CGUIViewStateWindowMusicNav(const CFileItemList& items) : CGUIViewStateWindowMusic(items) -@@ -535,6 +536,54 @@ VECSOURCES& CGUIViewStateWindowMusicNav::GetSources() - return CGUIViewStateWindowMusic::GetSources(); - } - -+CGUIViewStateWindowMusicSongs::CGUIViewStateWindowMusicSongs(const CFileItemList& items) : CGUIViewStateWindowMusic(items) -+{ -+ if (items.IsVirtualDirectoryRoot()) -+ { -+ AddSortMethod(SortByLabel, 551, LABEL_MASKS()); // Preformated -+ AddSortMethod(SortByDriveType, 564, LABEL_MASKS()); // Preformated -+ SetSortMethod(SortByLabel); -+ -+ SetViewAsControl(DEFAULT_VIEW_LIST); -+ -+ SetSortOrder(SortOrderAscending); -+ } -+ else if (items.GetPath() == "special://musicplaylists/") -+ { // playlists list sorts by label only, ignoring folders -+ AddSortMethod(SortByLabel, SortAttributeIgnoreFolders, 551, LABEL_MASKS("%F", "%D", "%L", "")); // Filename, Duration | Foldername, empty -+ SetSortMethod(SortByLabel); -+ } -+ else -+ { -+ std::string strTrack=CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_TRACKFORMAT); -+ AddSortMethod(SortByLabel, 551, LABEL_MASKS(strTrack, "%D", "%L", ""), // Userdefined, Duration | FolderName, empty -+ CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone); -+ AddSortMethod(SortBySize, 553, LABEL_MASKS(strTrack, "%I", "%L", "%I")); // Userdefined, Size | FolderName, Size -+ AddSortMethod(SortByBitrate, 623, LABEL_MASKS(strTrack, "%X", "%L", "%X")); // Userdefined, Bitrate | FolderName, Bitrate -+ AddSortMethod(SortByDate, 552, LABEL_MASKS(strTrack, "%J", "%L", "%J")); // Userdefined, Date | FolderName, Date -+ AddSortMethod(SortByFile, 561, LABEL_MASKS(strTrack, "%F", "%L", "")); // Userdefined, FileName | FolderName, empty -+ AddSortMethod(SortByListeners, 20455,LABEL_MASKS(strTrack, "%W", "%L", "%W")); -+ -+ const CViewState *viewState = CViewStateSettings::GetInstance().Get("musicfiles"); -+ SetSortMethod(viewState->m_sortDescription); -+ SetViewAsControl(viewState->m_viewMode); -+ SetSortOrder(viewState->m_sortDescription.sortOrder); -+ } -+ LoadViewState(items.GetPath(), WINDOW_MUSIC_FILES); -+} -+ -+void CGUIViewStateWindowMusicSongs::SaveViewState() -+{ -+ SaveViewToDb(m_items.GetPath(), WINDOW_MUSIC_FILES, CViewStateSettings::GetInstance().Get("musicfiles")); -+} -+ -+VECSOURCES& CGUIViewStateWindowMusicSongs::GetSources() -+{ -+ VECSOURCES *musicSources = CMediaSourceSettings::GetInstance().GetSources("music"); -+ AddOrReplace(*musicSources, CGUIViewStateWindowMusic::GetSources()); -+ return *musicSources; -+} -+ - CGUIViewStateWindowMusicPlaylist::CGUIViewStateWindowMusicPlaylist(const CFileItemList& items) : CGUIViewStateWindowMusic(items) - { - std::string strTrack=CSettings::GetInstance().GetString(CSettings::SETTING_MUSICFILES_NOWPLAYINGTRACKFORMAT); -diff --git a/xbmc/music/GUIViewStateMusic.h b/xbmc/music/GUIViewStateMusic.h -index 95a123f..e4f7931 100644 ---- a/xbmc/music/GUIViewStateMusic.h -+++ b/xbmc/music/GUIViewStateMusic.h -@@ -83,6 +83,16 @@ private: - void AddOnlineShares(); - }; - -+class CGUIViewStateWindowMusicSongs : public CGUIViewStateWindowMusic -+{ -+public: -+ CGUIViewStateWindowMusicSongs(const CFileItemList& items); -+ -+protected: -+ virtual void SaveViewState(); -+ virtual VECSOURCES& GetSources(); -+}; -+ - class CGUIViewStateWindowMusicPlaylist : public CGUIViewStateWindowMusic - { - public: diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp -index 3ae0510..4673b75 100644 +index 87494f2..4673b75 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -3225,7 +3225,7 @@ bool CMusicDatabase::LookupCDDBInfo(bool bRequery/*=false*/) @@ -79308,735 +12290,6 @@ index 3ae0510..4673b75 100644 return false; // Get information for the inserted disc -@@ -4086,6 +4086,8 @@ bool CMusicDatabase::GetAlbumsByWhere(const std::string &baseDir, const Filter & - try - { - total = -1; -+ // Get data from album and album_artist tables to fully populate albums -+ std::string strSQL = "SELECT %s FROM albumview JOIN albumartistview on albumartistview.idalbum = albumview.idalbum "; - - Filter extFilter = filter; - CMusicDbUrl musicUrl; -@@ -4111,9 +4113,9 @@ bool CMusicDatabase::GetAlbumsByWhere(const std::string &baseDir, const Filter & - return true; - - // Apply the limiting directly here if there's no special sorting but limiting -- bool limited = extFilter.limit.empty() && sortDescription.sortBy == SortByNone && -- (sortDescription.limitStart > 0 || sortDescription.limitEnd > 0); -- if (limited) -+ if (extFilter.limit.empty() && -+ sortDescription.sortBy == SortByNone && -+ (sortDescription.limitStart > 0 || sortDescription.limitEnd > 0)) - { - strSQLExtra += DatabaseUtils::BuildLimitClause(sortDescription.limitEnd, sortDescription.limitStart); - albums.reserve(sortDescription.limitEnd - sortDescription.limitStart); -@@ -4121,19 +4123,8 @@ bool CMusicDatabase::GetAlbumsByWhere(const std::string &baseDir, const Filter & - else - albums.reserve(total); - -- std::string strSQL; -- -- // Get data from album, album_artist and artist tables to fully populate albums with album artists -- // All albums have at least one artist so inner join sufficient -- if (limited) -- //Apply where clause and limits to albumview, then join as mutiple records in result set per album -- strSQL = "SELECT av.*, albumartistview.* " -- "FROM (SELECT albumview.* FROM albumview " + strSQLExtra + ") AS av " -- "JOIN albumartistview ON albumartistview.idalbum = av.idalbum "; -- else -- strSQL = "SELECT albumview.*, albumartistview.* " -- "FROM albumview JOIN albumartistview ON albumartistview.idalbum = albumview.idalbum " + strSQLExtra; -- -+ strSQL = PrepareSQL(strSQL, !filter.fields.empty() && filter.fields.compare("*") != 0 ? filter.fields.c_str() : "albumview.*, albumartistview.* ") + strSQLExtra; -+ - CLog::Log(LOGDEBUG, "%s query: %s", __FUNCTION__, strSQL.c_str()); - // run query - unsigned int time = XbmcThreads::SystemClockMillis(); -@@ -4149,16 +4140,10 @@ bool CMusicDatabase::GetAlbumsByWhere(const std::string &baseDir, const Filter & - return true; - } - -+ //Sort the results set - need to add sort by iOrder to maintain artist name order?? - DatabaseResults results; -- results.reserve(iRowsFound); -- // Do not apply any limit when sorting as have join with albumartistview so limit would -- // apply incorrectly (although when SortByNone limit already applied in SQL). -- // Apply limits later to album list rather than dataset -- // But Artist order may be disturbed by sort??? -- sorting = sortDescription; -- sorting.limitStart = 0; -- sorting.limitEnd = -1; -- if (!SortUtils::SortFromDataset(sorting, MediaTypeAlbum, m_pDS, results)) -+ results.reserve(iRowsFound); -+ if (!SortUtils::SortFromDataset(sortDescription, MediaTypeAlbum, m_pDS, results)) - return false; - - // Get albums from returned rows. Join means there is a row for every album artist -@@ -4174,26 +4159,13 @@ bool CMusicDatabase::GetAlbumsByWhere(const std::string &baseDir, const Filter & - if (albumId != record->at(album_idAlbum).get_asInt()) - { // New album - albumId = record->at(album_idAlbum).get_asInt(); -- albums.emplace_back(GetAlbumFromDataset(record)); -+ albums.push_back(GetAlbumFromDataset(record)); - } - // Get artists -- albums.back().artistCredits.emplace_back(GetArtistCreditFromDataset(record, albumArtistOffset)); -+ albums.back().artistCredits.push_back(GetArtistCreditFromDataset(record, albumArtistOffset)); - } - - m_pDS->close(); // cleanup recordset data -- -- // Apply any limits to sorted albums -- if (sortDescription.sortBy != SortByNone && (sortDescription.limitStart > 0 || sortDescription.limitEnd > 0)) -- { -- int limitEnd = sortDescription.limitEnd; -- if (sortDescription.limitStart > 0 && (size_t)sortDescription.limitStart < albums.size()) -- { -- albums.erase(albums.begin(), albums.begin() + sortDescription.limitStart); -- limitEnd = sortDescription.limitEnd - sortDescription.limitStart; -- } -- if (limitEnd > 0 && (size_t)limitEnd < albums.size()) -- albums.erase(albums.begin() + limitEnd, albums.end()); -- } - return true; - } - catch (...) -@@ -4274,16 +4246,10 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte - - DatabaseResults results; - results.reserve(iRowsFound); -- // Avoid sorting with limits when have join with songartistview -- // Limit when SortByNone already applied in SQL, -- // apply sort later to fileitems list rather than dataset -- sorting = sortDescription; -- if (artistData && sortDescription.sortBy != SortByNone) -- sorting.sortBy = SortByNone; -- if (!SortUtils::SortFromDataset(sorting, MediaTypeSong, m_pDS, results)) -+ if (!SortUtils::SortFromDataset(sortDescription, MediaTypeSong, m_pDS, results)) - return false; - -- // Get songs from returned rows. If join songartistview then there is a row for every artist -+ // Get songs from returned rows. If join songartistview then there is a row for every album artist - items.Reserve(total); - int songArtistOffset = song_enumCount; - int songId = -1; -@@ -4338,10 +4304,6 @@ bool CMusicDatabase::GetSongsFullByWhere(const std::string &baseDir, const Filte - // cleanup - m_pDS->close(); - -- // When have join with songartistview apply sort (and limit) to items rather than dataset -- if (artistData && sortDescription.sortBy != SortByNone) -- items.Sort(sortDescription); -- - if (cueSheetData) - { // Load some info from embedded cuesheet if present (now only ReplayGain) - CueInfoLoader cueLoader; -@@ -5053,7 +5015,7 @@ bool CMusicDatabase::GetAlbumPath(int idAlbum, std::string& path) - bool CMusicDatabase::SaveAlbumThumb(int idAlbum, const std::string& strThumb) - { - SetArtForItem(idAlbum, MediaTypeAlbum, "thumb", strThumb); -- //! @todo We should prompt the user to update the art for songs -+ // TODO: We should prompt the user to update the art for songs - std::string sql = PrepareSQL("UPDATE art" - " SET url='-'" - " WHERE media_type='song'" -@@ -5371,7 +5333,7 @@ bool CMusicDatabase::RemoveSongsFromPath(const std::string &path1, MAPSONGS& son - // from the song link tables (as otherwise if a song is added back - // to the table with the same idSong, these tables can't be cleaned up properly later) - -- //! @todo SQLite probably doesn't allow this, but can we rely on that?? -+ // TODO: SQLite probably doesn't allow this, but can we rely on that?? - - // We don't need to remove orphaned albums at this point as in AddAlbum() we check - // first whether the album has already been read during this scan, and if it hasn't -@@ -5422,7 +5384,7 @@ bool CMusicDatabase::RemoveSongsFromPath(const std::string &path1, MAPSONGS& son - } - m_pDS->close(); - -- //! @todo move this below the m_pDS->exec block, once UPnP doesn't rely on this anymore -+ //TODO: move this below the m_pDS->exec block, once UPnP doesn't rely on this anymore - for (MAPSONGS::iterator songit = songs.begin(); songit != songs.end(); ++songit) - AnnounceRemove(MediaTypeSong, songit->second.idSong); - -diff --git a/xbmc/music/MusicDatabase.h b/xbmc/music/MusicDatabase.h -index 0a23add..12c0d96 100644 ---- a/xbmc/music/MusicDatabase.h -+++ b/xbmc/music/MusicDatabase.h -@@ -23,7 +23,6 @@ - */ - #pragma once - #include --#include - - #include "addons/Scraper.h" - #include "Album.h" -diff --git a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp -index 25026b0..3fca559 100644 ---- a/xbmc/music/dialogs/GUIDialogMusicInfo.cpp -+++ b/xbmc/music/dialogs/GUIDialogMusicInfo.cpp -@@ -171,7 +171,16 @@ void CGUIDialogMusicInfo::SetAlbum(const CAlbum& album, const std::string &path) - m_album = album; - SetSongs(m_album.infoSongs); - *m_albumItem = CFileItem(path, true); -- m_albumItem->GetMusicInfoTag()->SetAlbum(m_album); -+ m_albumItem->GetMusicInfoTag()->SetAlbum(m_album.strAlbum); -+ m_albumItem->GetMusicInfoTag()->SetAlbumArtist(m_album.GetAlbumArtist()); -+ m_albumItem->GetMusicInfoTag()->SetArtist(m_album.GetAlbumArtist()); -+ m_albumItem->GetMusicInfoTag()->SetYear(m_album.iYear); -+ m_albumItem->GetMusicInfoTag()->SetLoaded(true); -+ m_albumItem->GetMusicInfoTag()->SetRating(m_album.fRating); -+ m_albumItem->GetMusicInfoTag()->SetVotes(m_album.iVotes); -+ m_albumItem->GetMusicInfoTag()->SetUserrating(m_album.iUserrating); -+ m_albumItem->GetMusicInfoTag()->SetGenre(m_album.genre); -+ m_albumItem->GetMusicInfoTag()->SetDatabaseId(m_album.idAlbum, MediaTypeAlbum); - CMusicDatabase::SetPropertiesFromAlbum(*m_albumItem,m_album); - - CMusicThumbLoader loader; -@@ -342,8 +351,8 @@ void CGUIDialogMusicInfo::SetUserrating(int userrating) const - // 3. Local thumb - // 4. No thumb (if no Local thumb is available) - --//! @todo Currently no support for "embedded thumb" as there is no easy way to grab it --//! without sending a file that has this as it's album to this class -+// TODO: Currently no support for "embedded thumb" as there is no easy way to grab it -+// without sending a file that has this as it's album to this class - void CGUIDialogMusicInfo::OnGetThumb() - { - CFileItemList items; -@@ -373,7 +382,7 @@ void CGUIDialogMusicInfo::OnGetThumb() - item->SetIconImage("DefaultPicture.png"); - item->SetLabel(g_localizeStrings.Get(20015)); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - // CTextureCache::GetInstance().ClearCachedImage(thumb); - items.Add(item); - } -@@ -475,7 +484,7 @@ void CGUIDialogMusicInfo::OnGetFanart() - item->SetIconImage("DefaultPicture.png"); - item->SetLabel(g_localizeStrings.Get(20441)); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - // CTextureCache::GetInstance().ClearCachedImage(thumb); - items.Add(item); - } -@@ -493,7 +502,7 @@ void CGUIDialogMusicInfo::OnGetFanart() - itemLocal->SetArt("thumb", strLocal); - itemLocal->SetLabel(g_localizeStrings.Get(20438)); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - CTextureCache::GetInstance().ClearCachedImage(strLocal); - items.Add(itemLocal); - } -diff --git a/xbmc/music/dialogs/GUIDialogSongInfo.cpp b/xbmc/music/dialogs/GUIDialogSongInfo.cpp -index 8be349c..a7c97fa 100644 ---- a/xbmc/music/dialogs/GUIDialogSongInfo.cpp -+++ b/xbmc/music/dialogs/GUIDialogSongInfo.cpp -@@ -235,7 +235,7 @@ CFileItemPtr CGUIDialogSongInfo::GetCurrentListItem(int offset) - - bool CGUIDialogSongInfo::DownloadThumbnail(const std::string &thumbFile) - { -- //! @todo Obtain the source... -+ // TODO: Obtain the source... - std::string source; - CCurlFile http; - http.Download(source, thumbFile); -@@ -249,8 +249,8 @@ bool CGUIDialogSongInfo::DownloadThumbnail(const std::string &thumbFile) - // 3. Local thumb - // 4. No thumb (if no Local thumb is available) - --//! @todo Currently no support for "embedded thumb" as there is no easy way to grab it --//! without sending a file that has this as it's album to this class -+// TODO: Currently no support for "embedded thumb" as there is no easy way to grab it -+// without sending a file that has this as it's album to this class - void CGUIDialogSongInfo::OnGetThumb() - { - CFileItemList items; -diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp -index 1ebc77e..22dc78d 100644 ---- a/xbmc/music/infoscanner/MusicInfoScanner.cpp -+++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp -@@ -740,7 +740,7 @@ void CMusicInfoScanner::FileItemsToAlbums(CFileItemList& items, VECALBUMS& album - { - if ((*k)->GetAlbumArtist().empty()) - (*k)->SetAlbumArtist(common); -- //! @todo in future we may wish to union up the genres, for now we assume they're the same -+ // TODO: in future we may wish to union up the genres, for now we assume they're the same - album.genre = (*k)->genre; - // in addition, we may want to use year as discriminating for albums - album.iYear = (*k)->iYear; -diff --git a/xbmc/music/infoscanner/MusicInfoScanner.h b/xbmc/music/infoscanner/MusicInfoScanner.h -index 5584b91..ac1ae92 100644 ---- a/xbmc/music/infoscanner/MusicInfoScanner.h -+++ b/xbmc/music/infoscanner/MusicInfoScanner.h -@@ -167,7 +167,7 @@ public: - */ - std::map GetArtistArtwork(const CArtist& artist); - protected: -- virtual void Process() override; -+ virtual void Process(); - - /*! \brief Scan in the ID3/Ogg/FLAC tags for a bunch of FileItems - Given a list of FileItems, scan in the tags for those FileItems -@@ -191,7 +191,7 @@ protected: - - bool DoScan(const std::string& strDirectory) override; - -- virtual void Run() override; -+ virtual void Run(); - int CountFiles(const CFileItemList& items, bool recursive); - int CountFilesRecursively(const std::string& strPath); - -diff --git a/xbmc/music/infoscanner/MusicInfoScraper.cpp b/xbmc/music/infoscanner/MusicInfoScraper.cpp -index 3489ba6..b9fc76a 100644 ---- a/xbmc/music/infoscanner/MusicInfoScraper.cpp -+++ b/xbmc/music/infoscanner/MusicInfoScraper.cpp -@@ -193,8 +193,8 @@ void CMusicInfoScraper::Process() - bool CMusicInfoScraper::CheckValidOrFallback(const std::string &fallbackScraper) - { - return true; --//! @todo Handle fallback mechanism --/* -+/* -+ * TODO handle fallback mechanism - if (m_scraper->Path() != fallbackScraper && - parser.Load("special://xbmc/system/scrapers/music/" + fallbackScraper)) - { -diff --git a/xbmc/music/infoscanner/MusicInfoScraper.h b/xbmc/music/infoscanner/MusicInfoScraper.h -index b5f3188..fa9a977 100644 ---- a/xbmc/music/infoscanner/MusicInfoScraper.h -+++ b/xbmc/music/infoscanner/MusicInfoScraper.h -@@ -20,8 +20,6 @@ - * - */ - --#include -- - #include "MusicAlbumInfo.h" - #include "MusicArtistInfo.h" - #include "addons/Scraper.h" -diff --git a/xbmc/music/tags/MusicInfoTagLoaderFactory.cpp b/xbmc/music/tags/MusicInfoTagLoaderFactory.cpp -index 19872f8..aa15153 100644 ---- a/xbmc/music/tags/MusicInfoTagLoaderFactory.cpp -+++ b/xbmc/music/tags/MusicInfoTagLoaderFactory.cpp -@@ -80,7 +80,6 @@ IMusicInfoTagLoader* CMusicInfoTagLoaderFactory::CreateLoader(const CFileItem& i - strExtension == "m4a" || strExtension == "mp4" || - strExtension == "mpc" || strExtension == "mpp" || strExtension == "mp+" || - strExtension == "ogg" || strExtension == "oga" || strExtension == "oggstream" || -- strExtension == "opus" || - strExtension == "aif" || strExtension == "aiff" || - strExtension == "wav" || - strExtension == "mod" || -@@ -103,7 +102,7 @@ IMusicInfoTagLoader* CMusicInfoTagLoaderFactory::CreateLoader(const CFileItem& i - return (IMusicInfoTagLoader*)pTagLoader; - } - else if (strExtension == "mka" || strExtension == "dsf" || -- strExtension == "dff") -+ strExtension == "dff" || strExtension == "opus") - return new CMusicInfoTagLoaderFFmpeg(); - - return NULL; -diff --git a/xbmc/music/tags/MusicInfoTagLoaderShn.cpp b/xbmc/music/tags/MusicInfoTagLoaderShn.cpp -index ee37747..b2d25fd 100644 ---- a/xbmc/music/tags/MusicInfoTagLoaderShn.cpp -+++ b/xbmc/music/tags/MusicInfoTagLoaderShn.cpp -@@ -36,7 +36,7 @@ bool CMusicInfoTagLoaderSHN::Load(const std::string& strFileName, CMusicInfoTag& - { - - tag.SetURL(strFileName); -- tag.SetDuration((long)0); //! @todo Use libavformat to calculate duration. -+ tag.SetDuration((long)0); //TODO: Use libavformat to calculate duration. - tag.SetLoaded(false); - - return true; -diff --git a/xbmc/music/tags/TagLoaderTagLib.cpp b/xbmc/music/tags/TagLoaderTagLib.cpp -index 45d6408..004849a 100644 ---- a/xbmc/music/tags/TagLoaderTagLib.cpp -+++ b/xbmc/music/tags/TagLoaderTagLib.cpp -@@ -36,7 +36,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -420,7 +419,7 @@ bool CTagLoaderTagLib::ParseTag(ID3v2::Tag *id3v2, MUSIC_INFO::EmbeddedArt *art, - - // @xbmc.org ratings trump others (of course) - if (popFrame->email() == "ratings@xbmc.org") -- tag.SetUserrating(popFrame->rating() / 51); //! @todo wtf? Why 51 find some explanation, somewhere... -+ tag.SetUserrating(popFrame->rating() / 51); //TODO wtf? Why 51 find some explanation, somewhere... - else if (tag.GetUserrating() == 0) - { - if (popFrame->email() != "Windows Media Player 9 Series" && -@@ -651,7 +650,6 @@ bool CTagLoaderTagLib::ParseTag(Ogg::XiphComment *xiph, EmbeddedArt *art, CMusic - if (iUserrating > 0 && iUserrating <= 100) - tag.SetUserrating((iUserrating / 10)); - } --#if TAGLIB_MAJOR_VERSION <= 1 && TAGLIB_MINOR_VERSION < 11 - else if (it->first == "METADATA_BLOCK_PICTURE") - { - const char* b64 = it->second.front().toCString(); -@@ -678,12 +676,10 @@ bool CTagLoaderTagLib::ParseTag(Ogg::XiphComment *xiph, EmbeddedArt *art, CMusic - { - pictures[2].setMimeType(it->second.front()); - } --#endif - else if (g_advancedSettings.m_logLevel == LOG_LEVEL_MAX) - CLog::Log(LOGDEBUG, "unrecognized XipComment name: %s", it->first.toCString(true)); - } - --#if TAGLIB_MAJOR_VERSION <= 1 && TAGLIB_MINOR_VERSION < 11 - // Process the extracted picture frames; 0 = CoverArt, 1 = Other, 2 = COVERART/COVERARTMIME - for (int i = 0; i < 3; ++i) - if (pictures[i].data().size()) -@@ -698,29 +694,6 @@ bool CTagLoaderTagLib::ParseTag(Ogg::XiphComment *xiph, EmbeddedArt *art, CMusic - - break; - } --#else -- auto pictureList = xiph->pictureList(); -- FLAC::Picture *cover[2] = {}; -- -- for (auto i: pictureList) -- { -- FLAC::Picture *picture = i; -- if (picture->type() == FLAC::Picture::FrontCover) -- cover[0] = picture; -- else // anything else is taken as second priority -- cover[1] = picture; -- } -- for (unsigned int i = 0; i < 2; i++) -- { -- if (cover[i]) -- { -- tag.SetCoverArtInfo(cover[i]->data().size(), cover[i]->mimeType().to8Bit(true)); -- if (art) -- art->set(reinterpret_cast(cover[i]->data().data()), cover[i]->data().size(), cover[i]->mimeType().to8Bit(true)); -- break; // one is enough -- } -- } --#endif - - if (xiph->comment() != String::null) - tag.SetComment(xiph->comment().toCString(true)); -@@ -1023,7 +996,6 @@ bool CTagLoaderTagLib::Load(const std::string& strFileName, CMusicInfoTag& tag, - TagLib::MPEG::File* mpegFile = nullptr; - TagLib::Ogg::Vorbis::File* oggVorbisFile = nullptr; - TagLib::Ogg::FLAC::File* oggFlacFile = nullptr; -- TagLib::Ogg::Opus::File* oggOpusFile = nullptr; - TagLib::TrueAudio::File* ttaFile = nullptr; - TagLib::WavPack::File* wvFile = nullptr; - TagLib::RIFF::WAV::File * wavFile = nullptr; -@@ -1063,8 +1035,6 @@ bool CTagLoaderTagLib::Load(const std::string& strFileName, CMusicInfoTag& tag, - file = new XM::File(stream); - else if (strExtension == "ogg") - file = oggVorbisFile = new Ogg::Vorbis::File(stream); -- else if (strExtension == "opus") -- file = oggOpusFile = new Ogg::Opus::File(stream); - else if (strExtension == "oga") // Leave this madness until last - oga container can have Vorbis or FLAC - { - file = oggFlacFile = new Ogg::FLAC::File(stream); -@@ -1118,8 +1088,6 @@ bool CTagLoaderTagLib::Load(const std::string& strFileName, CMusicInfoTag& tag, - xiph = dynamic_cast(oggFlacFile->tag()); - else if (oggVorbisFile) - xiph = dynamic_cast(oggVorbisFile->tag()); -- else if (oggOpusFile) -- xiph = dynamic_cast(oggOpusFile->tag()); - else if (ttaFile) - id3v2 = ttaFile->ID3v2Tag(false); - else if (aiffFile) -diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp -index 2e0c897..2a1fdc6 100644 ---- a/xbmc/music/windows/GUIWindowMusicBase.cpp -+++ b/xbmc/music/windows/GUIWindowMusicBase.cpp -@@ -62,9 +62,8 @@ - #include "URL.h" - #include "music/infoscanner/MusicInfoScanner.h" - #include "guiinfo/GUIInfoLabels.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "cores/IPlayer.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "CueDocument.h" - #include "Autorun.h" - -@@ -81,6 +80,7 @@ using namespace MUSIC_INFO; - #define CONTROL_BTNVIEWASICONS 2 - #define CONTROL_BTNSORTBY 3 - #define CONTROL_BTNSORTASC 4 -+#define CONTROL_BTNTYPE 5 - #define CONTROL_BTNPLAYLISTS 7 - #define CONTROL_BTNSCAN 9 - #define CONTROL_BTNREC 10 -@@ -122,6 +122,7 @@ bool CGUIWindowMusicBase::OnBack(int actionID) - ... the base class reacts on the following controls:\n - Buttons:\n - - #CONTROL_BTNVIEWASICONS - switch between list, thumb and with large items -+ - #CONTROL_BTNTYPE - switch between music windows - - #CONTROL_BTNSEARCH - Search for items\n - Other Controls: - - The container controls\n -@@ -151,6 +152,14 @@ bool CGUIWindowMusicBase::OnMessage(CGUIMessage& message) - if (!CGUIMediaWindow::OnMessage(message)) - return false; - -+ // save current window, unless the current window is the music playlist window -+ if (GetID() != WINDOW_MUSIC_PLAYLIST && -+ CSettings::GetInstance().GetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW) != GetID()) -+ { -+ CSettings::GetInstance().SetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW, GetID()); -+ CSettings::GetInstance().Save(); -+ } -+ - return true; - } - break; -@@ -178,7 +187,26 @@ bool CGUIWindowMusicBase::OnMessage(CGUIMessage& message) - case GUI_MSG_CLICKED: - { - int iControl = message.GetSenderId(); -- if (iControl == CONTROL_BTNRIP) -+ if (iControl == CONTROL_BTNTYPE) -+ { -+ CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_BTNTYPE); -+ g_windowManager.SendMessage(msg); -+ -+ int nWindow = WINDOW_MUSIC_FILES + msg.GetParam1(); -+ -+ if (nWindow == GetID()) -+ return true; -+ -+ CSettings::GetInstance().SetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW, nWindow); -+ CSettings::GetInstance().Save(); -+ g_windowManager.ChangeActiveWindow(nWindow); -+ -+ CGUIMessage msg2(GUI_MSG_SETFOCUS, CSettings::GetInstance().GetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW), CONTROL_BTNTYPE); -+ g_windowManager.SendMessage(msg2); -+ -+ return true; -+ } -+ else if (iControl == CONTROL_BTNRIP) - { - OnRipCD(); - } -@@ -224,6 +252,13 @@ bool CGUIWindowMusicBase::OnMessage(CGUIMessage& message) - if (m_vecItems->IsPath("special://musicplaylists/")) - OnDeleteItem(iItem); - -+ // or be at the files window and have file deletion enabled -+ else if (GetID() == WINDOW_MUSIC_FILES && -+ CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION)) -+ { -+ OnDeleteItem(iItem); -+ } -+ - else - return false; - } -@@ -457,7 +492,7 @@ bool CGUIWindowMusicBase::ShowAlbumInfo(const CFileItem *pItem, bool bShowInfo / - { - if (!CProfilesManager::GetInstance().GetCurrentProfile().canWriteDatabases() && !g_passwordManager.bMasterUser) - { -- //! @todo should display a dialog saying no permissions -+ // TODO: should display a dialog saying no permissions - if (m_dlgProgress) - m_dlgProgress->Close(); - return false; -@@ -551,7 +586,7 @@ void CGUIWindowMusicBase::RetrieveMusicInfo() - - OnRetrieveMusicInfo(*m_vecItems); - -- //! @todo Scan for multitrack items here... -+ // \todo Scan for multitrack items here... - std::vector itemsForRemove; - CFileItemList itemsForAdd; - for (int i = 0; i < m_vecItems->Size(); ++i) -@@ -732,6 +767,26 @@ void CGUIWindowMusicBase::AddItemToPlayList(const CFileItemPtr &pItem, CFileItem - - void CGUIWindowMusicBase::UpdateButtons() - { -+ // Update window selection control -+ -+ // Remove labels from the window selection -+ CGUIMessage msg(GUI_MSG_LABEL_RESET, GetID(), CONTROL_BTNTYPE); -+ g_windowManager.SendMessage(msg); -+ -+ // Add labels to the window selection -+ CGUIMessage msg2(GUI_MSG_LABEL_ADD, GetID(), CONTROL_BTNTYPE); -+ msg2.SetLabel(g_localizeStrings.Get(744)); // Files -+ g_windowManager.SendMessage(msg2); -+ -+ msg2.SetLabel(g_localizeStrings.Get(14022)); // Library -+ g_windowManager.SendMessage(msg2); -+ -+ msg2.SetLabel(g_localizeStrings.Get(20389)); // Music Videos -+ g_windowManager.SendMessage(msg2); -+ -+ // Select the current window as default item -+ CONTROL_SELECT_ITEM(CONTROL_BTNTYPE, CSettings::GetInstance().GetInt(CSettings::SETTING_MYMUSIC_STARTWINDOW) - WINDOW_MUSIC_FILES); -+ - CONTROL_ENABLE_ON_CONDITION(CONTROL_BTNRIP, g_mediaManager.IsAudio()); - - CONTROL_ENABLE_ON_CONDITION(CONTROL_BTNSCAN, -@@ -1038,7 +1093,7 @@ void CGUIWindowMusicBase::PlayItem(int iItem) - else - { - // just a single item, play it -- //! @todo Add music-specific code for single playback of an item here (See OnClick in MediaWindow, and OnPlayMedia below) -+ // TODO: Add music-specific code for single playback of an item here (See OnClick in MediaWindow, and OnPlayMedia below) - OnClick(iItem); - } - } -@@ -1093,7 +1148,7 @@ bool CGUIWindowMusicBase::OnPlayMedia(int iItem, const std::string &player) - // following etc. - if ( (CSettings::GetInstance().GetBool(CSettings::SETTING_MUSICPLAYER_QUEUEBYDEFAULT) && g_windowManager.GetActiveWindow() != WINDOW_MUSIC_PLAYLIST_EDITOR) ) - { -- //! @todo Should the playlist be cleared if nothing is already playing? -+ // TODO: Should the playlist be cleared if nothing is already playing? - OnQueueItem(iItem); - return true; - } -@@ -1163,8 +1218,8 @@ void CGUIWindowMusicBase::UpdateThumb(const CAlbum &album, const std::string &pa - - // update the file listing - we have to update the whole lot, as it's likely that - // more than just our thumbnaias changed -- //! @todo Ideally this would only be done when needed - at the moment we appear to be -- //! doing this for every lookup, possibly twice (see ShowAlbumInfo) -+ // TODO: Ideally this would only be done when needed - at the moment we appear to be -+ // doing this for every lookup, possibly twice (see ShowAlbumInfo) - Refresh(true); - - // Do we have to autoswitch to the thumb control? -@@ -1346,8 +1401,8 @@ void CGUIWindowMusicBase::OnScan(int iItem) - else if (m_vecItems->Get(iItem)->m_bIsFolder) - strPath = m_vecItems->Get(iItem)->GetPath(); - else -- { //! @todo MUSICDB - should we allow scanning a single item into the database? -- //! This will require changes to the info scanner, which assumes we're running on a folder -+ { // TODO: MUSICDB - should we allow scanning a single item into the database? -+ // This will require changes to the info scanner, which assumes we're running on a folder - strPath = m_vecItems->GetPath(); - } - DoScan(strPath); -diff --git a/xbmc/music/windows/GUIWindowMusicBase.h b/xbmc/music/windows/GUIWindowMusicBase.h -index 6d26e8d..11c22da 100644 ---- a/xbmc/music/windows/GUIWindowMusicBase.h -+++ b/xbmc/music/windows/GUIWindowMusicBase.h -@@ -23,8 +23,6 @@ - * - */ - --#include -- - #include "windows/GUIMediaWindow.h" - #include "music/MusicDatabase.h" - #include "music/infoscanner/MusicInfoScraper.h" -diff --git a/xbmc/music/windows/GUIWindowMusicNav.h b/xbmc/music/windows/GUIWindowMusicNav.h -index 5954d28..e648db0 100644 ---- a/xbmc/music/windows/GUIWindowMusicNav.h -+++ b/xbmc/music/windows/GUIWindowMusicNav.h -@@ -32,22 +32,22 @@ public: - CGUIWindowMusicNav(void); - virtual ~CGUIWindowMusicNav(void); - -- virtual bool OnMessage(CGUIMessage& message) override; -- virtual bool OnAction(const CAction& action) override; -- virtual void FrameMove() override; -+ virtual bool OnMessage(CGUIMessage& message); -+ virtual bool OnAction(const CAction& action); -+ virtual void FrameMove(); - - protected: -- virtual void OnItemLoaded(CFileItem* pItem) override {}; -+ virtual void OnItemLoaded(CFileItem* pItem) {}; - // override base class methods -- virtual bool Update(const std::string &strDirectory, bool updateFilterPath = true) override; -- virtual bool GetDirectory(const std::string &strDirectory, CFileItemList &items) override; -- virtual void UpdateButtons() override; -- virtual void PlayItem(int iItem) override; -- virtual void OnWindowLoaded() override; -- virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) override; -- virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override; -+ virtual bool Update(const std::string &strDirectory, bool updateFilterPath = true); -+ virtual bool GetDirectory(const std::string &strDirectory, CFileItemList &items); -+ virtual void UpdateButtons(); -+ virtual void PlayItem(int iItem); -+ virtual void OnWindowLoaded(); -+ virtual void GetContextButtons(int itemNumber, CContextButtons &buttons); -+ virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button); - virtual bool OnClick(int iItem, const std::string &player = "") override; -- virtual std::string GetStartFolder(const std::string &url) override; -+ virtual std::string GetStartFolder(const std::string &url); - - bool GetSongsFromPlayList(const std::string& strPlayList, CFileItemList &items); - std::string GetQuickpathName(const std::string& strPath) const; -diff --git a/xbmc/music/windows/GUIWindowMusicPlaylist.cpp b/xbmc/music/windows/GUIWindowMusicPlaylist.cpp -index c846e66..fa7e871 100644 ---- a/xbmc/music/windows/GUIWindowMusicPlaylist.cpp -+++ b/xbmc/music/windows/GUIWindowMusicPlaylist.cpp -@@ -26,7 +26,6 @@ - #include "Application.h" - #include "PlayListPlayer.h" - #include "PartyModeManager.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "utils/LabelFormatter.h" - #include "music/tags/MusicInfoTag.h" - #include "guilib/GUIWindowManager.h" -diff --git a/xbmc/music/windows/GUIWindowVisualisation.cpp b/xbmc/music/windows/GUIWindowVisualisation.cpp -index a4a371f..fd47ec2 100644 ---- a/xbmc/music/windows/GUIWindowVisualisation.cpp -+++ b/xbmc/music/windows/GUIWindowVisualisation.cpp -@@ -112,8 +112,8 @@ bool CGUIWindowVisualisation::OnAction(const CAction &action) - g_infoManager.SetShowInfo(true); - } - break; -- //! @todo These should be mapped to it's own function - at the moment it's overriding -- //! the global action of fastforward/rewind and OSD. -+ // TODO: These should be mapped to it's own function - at the moment it's overriding -+ // the global action of fastforward/rewind and OSD. - /* case KEY_BUTTON_Y: - g_application.m_CdgParser.Pause(); - return true; -diff --git a/xbmc/network/AirPlayServer.cpp b/xbmc/network/AirPlayServer.cpp -index 7dede5d..ca809ad 100644 ---- a/xbmc/network/AirPlayServer.cpp -+++ b/xbmc/network/AirPlayServer.cpp -@@ -37,7 +37,6 @@ - #include "FileItem.h" - #include "Application.h" - #include "messaging/ApplicationMessenger.h" --#include "PlayListPlayer.h" - #include "utils/md5.h" - #include "utils/Variant.h" - #include "settings/Settings.h" -diff --git a/xbmc/network/AirPlayServer.h b/xbmc/network/AirPlayServer.h -index 46f80d6..971d464 100644 ---- a/xbmc/network/AirPlayServer.h -+++ b/xbmc/network/AirPlayServer.h -@@ -26,7 +26,6 @@ - #ifdef HAS_AIRPLAY - - #include --#include - #include - #include "threads/Thread.h" - #include "threads/CriticalSection.h" -diff --git a/xbmc/network/AirTunesServer.cpp b/xbmc/network/AirTunesServer.cpp -index 72a06dc..e1a6c7d 100644 ---- a/xbmc/network/AirTunesServer.cpp -+++ b/xbmc/network/AirTunesServer.cpp -@@ -37,7 +37,6 @@ - #include "filesystem/PipeFile.h" - #include "GUIInfoManager.h" - #include "guilib/GUIWindowManager.h" --#include "input/Key.h" - #include "interfaces/AnnouncementManager.h" - #include "messaging/ApplicationMessenger.h" - #include "music/tags/MusicInfoTag.h" diff --git a/xbmc/network/DNSNameCache.cpp b/xbmc/network/DNSNameCache.cpp index f12c782..e1a8ec4 100644 --- a/xbmc/network/DNSNameCache.cpp @@ -80190,139 +12443,6 @@ index 97bb20b..126a980 100644 static bool GetCached(const std::string& strHostName, std::string& strIpAddress); static CCriticalSection m_critical; std::vector m_vecDNSNames; -diff --git a/xbmc/network/EventClient.cpp b/xbmc/network/EventClient.cpp -index 9715f2c..80ab25a 100644 ---- a/xbmc/network/EventClient.cpp -+++ b/xbmc/network/EventClient.cpp -@@ -135,7 +135,7 @@ bool CEventClient::AddPacket(CEventPacket *packet) - ResetTimeout(); - if ( packet->Size() > 1 ) - { -- //! @todo limit payload size -+ // TODO: limit payload size - if (m_seqPackets[ packet->Sequence() ]) - { - if(!m_bSequenceError) -@@ -276,8 +276,8 @@ bool CEventClient::ProcessPacket(CEventPacket *packet) - - bool CEventClient::OnPacketHELO(CEventPacket *packet) - { -- //! @todo check it last HELO packet was received less than 5 minutes back -- //! if so, do not show notification of connection. -+ // TODO: check it last HELO packet was received less than 5 minutes back -+ // if so, do not show notification of connection. - if (Greeted()) - return false; - -diff --git a/xbmc/network/EventPacket.h b/xbmc/network/EventPacket.h -index d436612..694cfcf 100644 ---- a/xbmc/network/EventPacket.h -+++ b/xbmc/network/EventPacket.h -@@ -163,7 +163,6 @@ namespace EVENTPACKET - - PT_BROADCAST = 0x06, - /************************************************************************/ -- /* @todo implement */ - /* Payload format: TODO */ - /************************************************************************/ - -diff --git a/xbmc/network/GUIDialogNetworkSetup.cpp b/xbmc/network/GUIDialogNetworkSetup.cpp -index 51b8425..58003ed 100644 ---- a/xbmc/network/GUIDialogNetworkSetup.cpp -+++ b/xbmc/network/GUIDialogNetworkSetup.cpp -@@ -208,6 +208,9 @@ void CGUIDialogNetworkSetup::InitializeSettings() - #ifdef HAS_FILESYSTEM_SFTP - labels.push_back(std::make_pair(20260, NET_PROTOCOL_SFTP)); - #endif -+#ifdef HAS_FILESYSTEM_AFP -+ labels.push_back(std::make_pair(20261, NET_PROTOCOL_AFP)); -+#endif - - AddSpinner(group, SETTING_PROTOCOL, 1008, 0, m_protocol, labels); - AddEdit(group, SETTING_SERVER_ADDRESS, 1010, 0, m_server, true); -@@ -379,7 +382,8 @@ void CGUIDialogNetworkSetup::UpdateButtons() - m_protocol == NET_PROTOCOL_DAV || - m_protocol == NET_PROTOCOL_DAVS || - m_protocol == NET_PROTOCOL_RSS || -- m_protocol == NET_PROTOCOL_SFTP)); -+ m_protocol == NET_PROTOCOL_SFTP || -+ m_protocol == NET_PROTOCOL_AFP)); - } - } - -@@ -406,6 +410,8 @@ std::string CGUIDialogNetworkSetup::ConstructPath() const - url.SetProtocol("nfs"); - else if (m_protocol == NET_PROTOCOL_SFTP) - url.SetProtocol("sftp"); -+ else if (m_protocol == NET_PROTOCOL_AFP) -+ url.SetProtocol("afp"); - - if (!m_username.empty()) - { -@@ -455,6 +461,8 @@ void CGUIDialogNetworkSetup::SetPath(const std::string &path) - m_protocol = NET_PROTOCOL_NFS; - else if (url.IsProtocol("sftp") || url.IsProtocol("ssh")) - m_protocol = NET_PROTOCOL_SFTP; -+ else if (url.IsProtocol("afp")) -+ m_protocol = NET_PROTOCOL_AFP; - else - m_protocol = NET_PROTOCOL_SMB; // default to smb - m_username = url.GetUserName(); -diff --git a/xbmc/network/GUIDialogNetworkSetup.h b/xbmc/network/GUIDialogNetworkSetup.h -index e42ff34..42b9ba6 100644 ---- a/xbmc/network/GUIDialogNetworkSetup.h -+++ b/xbmc/network/GUIDialogNetworkSetup.h -@@ -35,37 +35,38 @@ public: - NET_PROTOCOL_UPNP, - NET_PROTOCOL_RSS, - NET_PROTOCOL_SFTP, -- NET_PROTOCOL_NFS}; -+ NET_PROTOCOL_NFS, -+ NET_PROTOCOL_AFP}; - CGUIDialogNetworkSetup(void); - virtual ~CGUIDialogNetworkSetup(void); -- virtual bool OnMessage(CGUIMessage& message) override; -- virtual bool OnBack(int actionID) override; -- virtual void OnInitWindow() override; -- virtual void OnDeinitWindow(int nextWindowID) override; -+ virtual bool OnMessage(CGUIMessage& message); -+ virtual bool OnBack(int actionID); -+ virtual void OnInitWindow(); -+ virtual void OnDeinitWindow(int nextWindowID); - - static bool ShowAndGetNetworkAddress(std::string &path); - - std::string ConstructPath() const; - void SetPath(const std::string &path); -- bool IsConfirmed() const override { return m_confirmed; }; -+ bool IsConfirmed() const { return m_confirmed; }; - - protected: - // implementations of ISettingCallback -- virtual void OnSettingChanged(const CSetting *setting) override; -- virtual void OnSettingAction(const CSetting *setting) override; -+ virtual void OnSettingChanged(const CSetting *setting); -+ virtual void OnSettingAction(const CSetting *setting); - - // specialization of CGUIDialogSettingsBase - bool AllowResettingSettings() const override { return false; } -- virtual void Save() override { } -- virtual void SetupView() override; -+ virtual void Save() { } -+ virtual void SetupView(); - - // specialization of CGUIDialogSettingsManualBase -- virtual void InitializeSettings() override; -+ virtual void InitializeSettings(); - - void OnProtocolChange(); - void OnServerBrowse(); - void OnOK(); -- void OnCancel() override; -+ void OnCancel(); - void UpdateButtons(); - - NET_PROTOCOL m_protocol; diff --git a/xbmc/network/Makefile.in b/xbmc/network/Makefile.in index c80651c..4baa1ce 100644 --- a/xbmc/network/Makefile.in @@ -81198,18 +13318,9 @@ index 0df104f..496b047 100644 #include "linux/NetworkLinux.h" #else diff --git a/xbmc/network/NetworkServices.cpp b/xbmc/network/NetworkServices.cpp -index f56cb50..46a677b 100644 +index 1aa03f8..46a677b 100644 --- a/xbmc/network/NetworkServices.cpp +++ b/xbmc/network/NetworkServices.cpp -@@ -441,7 +441,7 @@ void CNetworkServices::OnSettingChanged(const CSetting *setting) - settingId == CSettings::SETTING_SMB_WORKGROUP) - { - // okey we really don't need to restart, only deinit samba, but that could be damn hard if something is playing -- //! @todo - General way of handling setting changes that require restart -+ // TODO - General way of handling setting changes that require restart - if (HELPERS::ShowYesNoDialogText(CVariant{14038}, CVariant{14039}) == DialogResponse::YES) - { - CSettings::GetInstance().Save(); @@ -512,9 +512,6 @@ void CNetworkServices::Stop(bool bWait) bool CNetworkServices::StartWebserver() { @@ -81238,46 +13349,11 @@ index f56cb50..46a677b 100644 return false; if (IsAirTunesServerRunning()) -diff --git a/xbmc/network/Socket.h b/xbmc/network/Socket.h -index 20088c9..2d51ccc 100644 ---- a/xbmc/network/Socket.h -+++ b/xbmc/network/Socket.h -@@ -166,7 +166,7 @@ namespace SOCKETS - int Read(CAddress& addr, const int buffersize, void *buffer); - bool Broadcast(const CAddress& addr, const int datasize, const void* data) - { -- //! @todo implement -+ // TODO - return false; - } - SOCKET Socket() { return m_iSock; } diff --git a/xbmc/network/TCPServer.cpp b/xbmc/network/TCPServer.cpp -index 7089911..1009de5 100644 +index 51f6b93..1009de5 100644 --- a/xbmc/network/TCPServer.cpp +++ b/xbmc/network/TCPServer.cpp -@@ -67,20 +67,7 @@ bool CTCPServer::StartServer(int port, bool nonlocal) - ServerInstance = new CTCPServer(port, nonlocal); - if (ServerInstance->Initialize()) - { -- size_t thread_stacksize = 0; --#if defined(TARGET_DARWIN_TVOS) -- void *stack_addr; -- pthread_attr_t attr; -- pthread_attr_init(&attr); -- pthread_attr_getstack(&attr, &stack_addr, &thread_stacksize); -- pthread_attr_destroy(&attr); -- // double the stack size under tvos, not sure why yet -- // but it stoped crashing using Kodi json -> play video. -- // non-tvos will pass a value of zero which means 'system default' -- thread_stacksize *= 2; -- CLog::Log(LOGDEBUG, "CTCPServer: increasing thread stack to %zu", thread_stacksize); --#endif -- ServerInstance->Create(false, thread_stacksize); -+ ServerInstance->Create(); - return true; - } - else -@@ -480,8 +467,11 @@ void CTCPServer::Deinitialize() +@@ -467,8 +467,11 @@ void CTCPServer::Deinitialize() m_connections.clear(); @@ -81291,18 +13367,6 @@ index 7089911..1009de5 100644 m_servers.clear(); -diff --git a/xbmc/network/UdpClient.h b/xbmc/network/UdpClient.h -index ef018c4..576849b 100644 ---- a/xbmc/network/UdpClient.h -+++ b/xbmc/network/UdpClient.h -@@ -24,7 +24,6 @@ - */ - - #include --#include - #include "threads/Thread.h" - #include "threads/CriticalSection.h" - #include diff --git a/xbmc/network/WakeOnAccess.cpp b/xbmc/network/WakeOnAccess.cpp index 2112798..27a1d12 100644 --- a/xbmc/network/WakeOnAccess.cpp @@ -81387,173 +13451,6 @@ index 2112798..27a1d12 100644 { CLog::Log(LOGNOTICE,"WakeOnAccess success exit, server already running"); return true; -diff --git a/xbmc/network/WakeOnAccess.h b/xbmc/network/WakeOnAccess.h -index 27ab581..47f86b4 100644 ---- a/xbmc/network/WakeOnAccess.h -+++ b/xbmc/network/WakeOnAccess.h -@@ -24,7 +24,6 @@ - #include "settings/lib/ISettingCallback.h" - #include "settings/lib/ISettingsHandler.h" - #include --#include - - class CWakeOnAccess : private IJobCallback, public ISettingCallback, public ISettingsHandler - { -diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp -index 779ca70..31dbeb6 100644 ---- a/xbmc/network/WebServer.cpp -+++ b/xbmc/network/WebServer.cpp -@@ -102,23 +102,9 @@ CWebServer::CWebServer() - #endif - } - --static MHD_Response* create_response(size_t size, void* data, int free, int copy) --{ --#if (MHD_VERSION >= 0x00094001) -- MHD_ResponseMemoryMode mode = MHD_RESPMEM_PERSISTENT; -- if (copy) -- mode = MHD_RESPMEM_MUST_COPY; -- else if (free) -- mode = MHD_RESPMEM_MUST_FREE; -- return MHD_create_response_from_buffer(size, data, mode); --#else -- return MHD_create_response_from_data(size, data, free, copy); --#endif --} -- - int CWebServer::AskForAuthentication(struct MHD_Connection *connection) const - { -- struct MHD_Response *response = create_response(0, nullptr, MHD_NO, MHD_NO); -+ struct MHD_Response *response = MHD_create_response_from_data(0, nullptr, MHD_NO, MHD_NO); - if (!response) - { - CLog::Log(LOGERROR, "CWebServer[%hu]: unable to create HTTP Unauthorized response", m_port); -@@ -298,7 +284,7 @@ int CWebServer::HandlePartialRequest(struct MHD_Connection *connection, Connecti - ifModifiedSinceDate.SetFromRFC1123DateTime(ifModifiedSince) && - lastModified.GetAsUTCDateTime() <= ifModifiedSinceDate) - { -- struct MHD_Response *response = create_response(0, nullptr, MHD_NO, MHD_NO); -+ struct MHD_Response *response = MHD_create_response_from_data(0, nullptr, MHD_NO, MHD_NO); - if (response == nullptr) - { - CLog::Log(LOGERROR, "CWebServer[%hu]: failed to create a HTTP 304 response", m_port); -@@ -742,7 +728,7 @@ int CWebServer::CreateRangedMemoryDownloadResponse(const std::shared_ptr(data), free ? MHD_YES : MHD_NO, copy ? MHD_YES : MHD_NO); -+ response = MHD_create_response_from_data(size, const_cast(data), free ? MHD_YES : MHD_NO, copy ? MHD_YES : MHD_NO); - if (response == nullptr) - { - CLog::Log(LOGERROR, "CWebServer[%hu]: failed to create a HTTP download response", m_port); -@@ -988,11 +974,7 @@ int CWebServer::ContentReaderCallback(void *cls, size_t pos, char *buf, int max) - return -1; - - if (g_advancedSettings.CanLogComponent(LOGWEBSERVER)) --#if (MHD_VERSION >= 0x00090200) -- CLog::Log(LOGDEBUG, "CWebServer [OUT] write maximum %zu bytes from %" PRIu64 " (%" PRIu64 ")", max, context->writePosition, pos); --#else - CLog::Log(LOGDEBUG, "CWebServer [OUT] write maximum %d bytes from %" PRIu64 " (%" PRIu64 ")", max, context->writePosition, pos); --#endif - - // check if we need to add the end-boundary - if (context->rangeCountTotal > 1 && context->ranges.IsEmpty()) -diff --git a/xbmc/network/Zeroconf.h b/xbmc/network/Zeroconf.h -index 0afbb70..f4aca4b 100644 ---- a/xbmc/network/Zeroconf.h -+++ b/xbmc/network/Zeroconf.h -@@ -35,8 +35,8 @@ class CCriticalSection; - /// free to add it. The main purpose currently is to provide an easy - /// way to publish services in the different StartXXX/StopXXX methods - /// in CApplication --//! @todo Make me safe for use in static initialization. CritSec is a static member :/ --//! use e.g. loki's singleton implementation to make do it properly -+/// TODO: Make me safe for use in static initialization. CritSec is a static member :/ -+/// use e.g. loki's singleton implementation to make do it properly - class CZeroconf - { - public: -diff --git a/xbmc/network/ZeroconfBrowser.cpp b/xbmc/network/ZeroconfBrowser.cpp -index 4b55bda..d96a135 100644 ---- a/xbmc/network/ZeroconfBrowser.cpp -+++ b/xbmc/network/ZeroconfBrowser.cpp -@@ -61,6 +61,9 @@ CZeroconfBrowser::CZeroconfBrowser():mp_crit_sec(new CCriticalSection),m_started - #ifdef HAS_FILESYSTEM_NFS - AddServiceType("_nfs._tcp."); - #endif// HAS_FILESYSTEM_NFS -+#ifdef HAS_FILESYSTEM_AFP -+ AddServiceType("_afpovertcp._tcp."); -+#endif - AddServiceType("_sftp-ssh._tcp."); - } - -diff --git a/xbmc/network/cddb.cpp b/xbmc/network/cddb.cpp -index 3878bfc..7ab238d 100644 ---- a/xbmc/network/cddb.cpp -+++ b/xbmc/network/cddb.cpp -@@ -515,7 +515,7 @@ void Xcddb::parseData(const char *buffer) - std::string strKeyword = *it; - std::string strValue = keywords[strKeyword]; - -- //! @todo STRING_CLEANUP -+ /* TODO:STRING_CLEANUP */ - if (strKeyword == "DTITLE") - { - // DTITLE may contain artist and disc title, separated with " / ", -diff --git a/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.cpp b/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.cpp -index 88d9999..51040da 100644 ---- a/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.cpp -+++ b/xbmc/network/httprequesthandler/HTTPImageTransformationHandler.cpp -@@ -75,7 +75,7 @@ CHTTPImageTransformationHandler::CHTTPImageTransformationHandler(const HTTPReque - StringUtils::ToLower(ext); - m_response.contentType = CMime::GetMimeType(ext); - -- //! @todo determine the maximum age -+ // TODO: determine the maximum age - - // determine the last modified date - struct __stat64 statBuffer; -diff --git a/xbmc/network/httprequesthandler/IHTTPRequestHandler.cpp b/xbmc/network/httprequesthandler/IHTTPRequestHandler.cpp -index f8119a5..9b611ad 100644 ---- a/xbmc/network/httprequesthandler/IHTTPRequestHandler.cpp -+++ b/xbmc/network/httprequesthandler/IHTTPRequestHandler.cpp -@@ -54,9 +54,6 @@ std::string GetHTTPMethod(HTTPMethod method) - - case POST: - return HTTPMethodPost; -- -- case UNKNOWN: -- break; - } - - return ""; diff --git a/xbmc/network/linux/Makefile b/xbmc/network/linux/Makefile index 207ecda..557c587 100644 --- a/xbmc/network/linux/Makefile @@ -81564,7 +13461,7 @@ index 207ecda..557c587 100644 -include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) +CXXFLAGS += --std=c++11 -DHAVE_CHAR32_T -DHAVE_CHAR16_T diff --git a/xbmc/network/linux/NetworkLinux.cpp b/xbmc/network/linux/NetworkLinux.cpp -index 66d996d..1a6e684 100644 +index 5868845..1a6e684 100644 --- a/xbmc/network/linux/NetworkLinux.cpp +++ b/xbmc/network/linux/NetworkLinux.cpp @@ -19,15 +19,29 @@ @@ -81784,7 +13681,7 @@ index 66d996d..1a6e684 100644 } CNetworkLinux::~CNetworkLinux(void) -@@ -319,25 +333,32 @@ CNetworkLinux::~CNetworkLinux(void) +@@ -319,18 +333,26 @@ CNetworkLinux::~CNetworkLinux(void) if (m_sock != -1) close(CNetworkLinux::m_sock); @@ -81805,13 +13702,8 @@ index 66d996d..1a6e684 100644 { - return m_interfaces; + m_interfaces.remove_if(IsRemoved); - } - --//! @bug --//! Overwrite the GetFirstConnectedInterface and requery --//! the interface list if no connected device is found --//! this fixes a bug when no network is available after first start of xbmc --//! and the interface comes up during runtime ++} ++ +void CNetworkLinux::InterfacesClear(void) +{ + for (auto &&iface: m_interfaces) @@ -81822,16 +13714,10 @@ index 66d996d..1a6e684 100644 +{ + CSingleLock lock(m_lockInterfaces); + return m_interfaces; -+} -+ -+// Overwrite the GetFirstConnectedInterface and requery -+// the interface list if no connected device is found -+// this fixes a bug when no network is available after first start of xbmc -+// and the interface comes up during runtime - CNetworkInterface* CNetworkLinux::GetFirstConnectedInterface(void) - { - CNetworkInterface *pNetIf=CNetwork::GetFirstConnectedInterface(); -@@ -354,147 +375,128 @@ CNetworkInterface* CNetworkLinux::GetFirstConnectedInterface(void) + } + + // Overwrite the GetFirstConnectedInterface and requery +@@ -353,147 +375,128 @@ CNetworkInterface* CNetworkLinux::GetFirstConnectedInterface(void) return pNetIf; } @@ -82067,7 +13953,7 @@ index 66d996d..1a6e684 100644 char nameserver[PROP_VALUE_MAX]; if (__system_property_get("net.dns1",nameserver)) -@@ -503,19 +505,34 @@ std::vector CNetworkLinux::GetNameServers(void) +@@ -502,19 +505,34 @@ std::vector CNetworkLinux::GetNameServers(void) result.push_back(nameserver); if (__system_property_get("net.dns3",nameserver)) result.push_back(nameserver); @@ -82110,13 +13996,7 @@ index 66d996d..1a6e684 100644 } void CNetworkLinux::SetNameServers(const std::vector& nameServers) -@@ -532,24 +549,28 @@ void CNetworkLinux::SetNameServers(const std::vector& nameServers) - } - else - { -- //! @todo implement -+ // TODO: - } +@@ -536,19 +554,23 @@ void CNetworkLinux::SetNameServers(const std::vector& nameServers) #endif } @@ -82147,7 +14027,7 @@ index 66d996d..1a6e684 100644 #endif int status = system (cmd_line); -@@ -567,9 +588,12 @@ bool CNetworkLinux::PingHost(unsigned long remote_ip, unsigned int timeout_ms) +@@ -566,9 +588,12 @@ bool CNetworkLinux::PingHost(unsigned long remote_ip, unsigned int timeout_ms) return result == 0; } @@ -82161,7 +14041,7 @@ index 66d996d..1a6e684 100644 bool ret = false; size_t needed; char *buf, *next; -@@ -616,10 +640,7 @@ bool CNetworkInterfaceLinux::GetHostMacAddress(unsigned long host_ip, std::strin +@@ -615,10 +640,7 @@ bool CNetworkInterfaceLinux::GetHostMacAddress(unsigned long host_ip, std::strin } } return ret; @@ -82172,7 +14052,7 @@ index 66d996d..1a6e684 100644 struct arpreq areq; struct sockaddr_in* sin; -@@ -653,8 +674,8 @@ bool CNetworkInterfaceLinux::GetHostMacAddress(unsigned long host_ip, std::strin +@@ -652,8 +674,8 @@ bool CNetworkInterfaceLinux::GetHostMacAddress(unsigned long host_ip, std::strin return true; return false; @@ -82182,42 +14062,7 @@ index 66d996d..1a6e684 100644 std::vector CNetworkInterfaceLinux::GetAccessPoints(void) { -@@ -906,7 +927,7 @@ void CNetworkInterfaceLinux::GetSettings(NetworkAssignment& assignment, std::str - FILE* fp = fopen("/etc/network/interfaces", "r"); - if (!fp) - { -- //! @todo implement -+ // TODO - return; - } - -@@ -983,14 +1004,14 @@ void CNetworkInterfaceLinux::SetSettings(NetworkAssignment& assignment, std::str - FILE* fr = fopen("/etc/network/interfaces", "r"); - if (!fr) - { -- //! @todo implement -+ // TODO - return; - } - - FILE* fw = fopen("/tmp/interfaces.temp", "w"); - if (!fw) - { -- //! @todo implement -+ // TODO - fclose(fr); - return; - } -@@ -1060,7 +1081,7 @@ void CNetworkInterfaceLinux::SetSettings(NetworkAssignment& assignment, std::str - // Rename the file - if (rename("/tmp/interfaces.temp", "/etc/network/interfaces") < 0) - { -- //! @todo implement -+ // TODO - return; - } - -@@ -1118,4 +1139,53 @@ void CNetworkInterfaceLinux::WriteSettings(FILE* fw, NetworkAssignment assignmen +@@ -1117,4 +1139,53 @@ void CNetworkInterfaceLinux::WriteSettings(FILE* fw, NetworkAssignment assignmen fprintf(fw, "auto %s\n\n", GetName().c_str()); } @@ -82380,71 +14225,6 @@ index d8b65bc..8d316cd 100644 #endif +void WatcherProcess(void *caller); -diff --git a/xbmc/network/linux/ZeroconfAvahi.cpp b/xbmc/network/linux/ZeroconfAvahi.cpp -index 9be965b..746275a 100644 ---- a/xbmc/network/linux/ZeroconfAvahi.cpp -+++ b/xbmc/network/linux/ZeroconfAvahi.cpp -@@ -74,7 +74,7 @@ CZeroconfAvahi::CZeroconfAvahi(): mp_client(0), mp_poll (0), m_shutdown(false),m - if (! (mp_poll = avahi_threaded_poll_new())) - { - CLog::Log(LOGERROR, "CZeroconfAvahi::CZeroconfAvahi(): Could not create threaded poll object"); -- //! @todo throw exception? -+ //TODO: throw exception? - return; - } - -@@ -102,7 +102,7 @@ CZeroconfAvahi::~CZeroconfAvahi() - //so instead of calling - //avahi_threaded_poll_stop(mp_poll); - //we set m_shutdown=true, post an event and wait for it to stop itself -- struct timeval tv = { 0, 0 }; //! @todo does tv survive the thread? -+ struct timeval tv = { 0, 0 }; //TODO: does tv survive the thread? - AvahiTimeout* lp_timeout; - { - ScopedEventLoopBlock l_block(mp_poll); -@@ -428,7 +428,7 @@ void CZeroconfAvahi::addService(tServiceMap::mapped_type fp_service_info, AvahiC - if ((ret = avahi_entry_group_commit(fp_service_info->mp_group)) < 0) - { - CLog::Log(LOGERROR, "CZeroconfAvahi::addService(): Failed to commit entry group! Error:%s", avahi_strerror(ret)); -- //! @todo what now? reset the group? free it? -+ // TODO what now? reset the group? free it? - } - } - -diff --git a/xbmc/network/linux/ZeroconfBrowserAvahi.cpp b/xbmc/network/linux/ZeroconfBrowserAvahi.cpp -index 7e44e7e..1a0402f 100644 ---- a/xbmc/network/linux/ZeroconfBrowserAvahi.cpp -+++ b/xbmc/network/linux/ZeroconfBrowserAvahi.cpp -@@ -52,7 +52,7 @@ CZeroconfBrowserAvahi::CZeroconfBrowserAvahi() : mp_client ( 0 ), mp_poll ( 0 ) - if ( ! ( mp_poll = avahi_threaded_poll_new() ) ) - { - CLog::Log ( LOGERROR, "CZeroconfAvahi::CZeroconfAvahi(): Could not create threaded poll object" ); -- //! @todo throw exception? can this even happen? -+ //TODO: throw exception? can this even happen? - return; - } - -@@ -241,7 +241,7 @@ void CZeroconfBrowserAvahi::browseCallback ( - { - case AVAHI_BROWSER_FAILURE: - CLog::Log ( LOGERROR, "CZeroconfBrowserAvahi::browseCallback error: %s\n", avahi_strerror ( avahi_client_errno ( avahi_service_browser_get_client ( browser ) ) ) ); -- //! @todo implement -+ //TODO - return; - case AVAHI_BROWSER_NEW: - { -diff --git a/xbmc/network/linux/ZeroconfBrowserAvahi.h b/xbmc/network/linux/ZeroconfBrowserAvahi.h -index a20028e..4e56ad9 100644 ---- a/xbmc/network/linux/ZeroconfBrowserAvahi.h -+++ b/xbmc/network/linux/ZeroconfBrowserAvahi.h -@@ -24,7 +24,6 @@ - - #include - #include --#include - - #include "network/ZeroconfBrowser.h" - #include "threads/Thread.h" diff --git a/xbmc/network/linux/android-ifaddrs/Makefile b/xbmc/network/linux/android-ifaddrs/Makefile new file mode 100644 index 0000000..39e43ea @@ -83198,66 +14978,6 @@ index 0000000..9cd19fe +__END_DECLS + +#endif -diff --git a/xbmc/network/mdns/ZeroconfBrowserMDNS.h b/xbmc/network/mdns/ZeroconfBrowserMDNS.h -index 83206b4..fb35106 100644 ---- a/xbmc/network/mdns/ZeroconfBrowserMDNS.h -+++ b/xbmc/network/mdns/ZeroconfBrowserMDNS.h -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - - #include - -diff --git a/xbmc/network/mdns/ZeroconfMDNS.cpp b/xbmc/network/mdns/ZeroconfMDNS.cpp -index 8bfd7df..00d02c5 100644 ---- a/xbmc/network/mdns/ZeroconfMDNS.cpp -+++ b/xbmc/network/mdns/ZeroconfMDNS.cpp -@@ -19,7 +19,6 @@ - */ - - #include "ZeroconfMDNS.h" --#include - - #include - #include -diff --git a/xbmc/network/mdns/ZeroconfMDNS.h b/xbmc/network/mdns/ZeroconfMDNS.h -index fdad063..e6360ab 100644 ---- a/xbmc/network/mdns/ZeroconfMDNS.h -+++ b/xbmc/network/mdns/ZeroconfMDNS.h -@@ -25,9 +25,7 @@ - #include "threads/Thread.h" - - #include --#include - #include --#include - - class CZeroconfMDNS : public CZeroconf,public CThread - { -diff --git a/xbmc/network/osx/ZeroconfBrowserOSX.h b/xbmc/network/osx/ZeroconfBrowserOSX.h -index f787f68..581bede 100644 ---- a/xbmc/network/osx/ZeroconfBrowserOSX.h -+++ b/xbmc/network/osx/ZeroconfBrowserOSX.h -@@ -21,8 +21,6 @@ - - #include - #include --#include --#include - - #include "network/ZeroconfBrowser.h" - #include "threads/Thread.h" -@@ -66,7 +64,7 @@ private: - CFRunLoopRef m_runloop; - - //shared variables (with guard) -- //! @todo split the guard for discovered, resolved access? -+ //TODO: split the guard for discovered, resolved access? - CCriticalSection m_data_guard; - // tBrowserMap maps service types the corresponding browser - typedef std::map tBrowserMap; diff --git a/xbmc/network/osx/priv_netlink.h b/xbmc/network/osx/priv_netlink.h new file mode 100644 index 0000000..9630969 @@ -83384,348 +15104,6 @@ index 0000000..9630969 +}; + +#endif /* PRIV_NETLINK_H */ -diff --git a/xbmc/network/upnp/UPnP.cpp b/xbmc/network/upnp/UPnP.cpp -index a8d5f00..36f5907 100644 ---- a/xbmc/network/upnp/UPnP.cpp -+++ b/xbmc/network/upnp/UPnP.cpp -@@ -37,7 +37,6 @@ - #include "network/Network.h" - #include "utils/log.h" - #include "URL.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "profiles/ProfilesManager.h" - #include "settings/AdvancedSettings.h" - #include "settings/Settings.h" -@@ -275,11 +274,11 @@ public: - NPT_CHECK_LABEL(FindServer(url.GetHostName().c_str(), device),failed); - NPT_CHECK_LABEL(device->FindServiceById("urn:upnp-org:serviceId:ContentDirectory", cds),failed); - -- NPT_CHECK_LABEL(m_CtrlPoint->CreateAction( -+ NPT_CHECK_SEVERE(m_CtrlPoint->CreateAction( - device, - "urn:schemas-upnp-org:service:ContentDirectory:1", - "UpdateObject", -- action), failed); -+ action)); - - NPT_CHECK_LABEL(action->SetArgumentValue("ObjectID", url.GetFileName().c_str()), failed); - NPT_CHECK_LABEL(action->SetArgumentValue("CurrentTagValue", curr_value), failed); -diff --git a/xbmc/network/upnp/UPnPInternal.cpp b/xbmc/network/upnp/UPnPInternal.cpp -index 8732c58..a01f830 100644 ---- a/xbmc/network/upnp/UPnPInternal.cpp -+++ b/xbmc/network/upnp/UPnPInternal.cpp -@@ -33,6 +33,7 @@ - #include "filesystem/StackDirectory.h" - #include "filesystem/MusicDatabaseDirectory.h" - #include "filesystem/VideoDatabaseDirectory.h" -+#include "video/VideoDatabase.h" - #include "video/VideoInfoTag.h" - #include "music/MusicDatabase.h" - #include "music/tags/MusicInfoTag.h" -@@ -176,15 +177,15 @@ GetProtocolInfo(const CFileItem& item, - { - NPT_String proto = protocol; - -- //! @todo fixup the protocol just in case nothing was passed -+ /* fixup the protocol just in case nothing was passed */ - if (proto.IsEmpty()) { - proto = item.GetURL().GetProtocol().c_str(); - } - -- /** -- * map protocol to right prefix and use xbmc-get for -- * unsupported UPnP protocols for other xbmc clients -- * @todo add rtsp ? -+ /* -+ map protocol to right prefix and use xbmc-get for -+ unsupported UPnP protocols for other xbmc clients -+ TODO: add rtsp ? - */ - if (proto == "http") { - proto = "http-get"; -@@ -281,12 +282,12 @@ PopulateObjectFromTag(CVideoInfoTag& tag, - object.m_People.artists.Add(itArtist->c_str()); - object.m_Affiliation.album = tag.m_strAlbum.c_str(); - object.m_Title = tag.m_strTitle.c_str(); -- object.m_Date = tag.GetPremiered().GetAsW3CDate().c_str(); -+ object.m_Date = CDateTime(tag.m_iYear, 1, 1, 0, 0, 0).GetAsW3CDate().c_str(); - object.m_ReferenceID = NPT_String::Format("videodb://musicvideos/titles/%i", tag.m_iDbId); - } else if (tag.m_type == MediaTypeMovie) { - object.m_ObjectClass.type = "object.item.videoItem.movie"; - object.m_Title = tag.m_strTitle.c_str(); -- object.m_Date = tag.GetPremiered().GetAsW3CDate().c_str(); -+ object.m_Date = CDateTime(tag.m_iYear, 1, 1, 0, 0, 0).GetAsW3CDate().c_str(); - object.m_ReferenceID = NPT_String::Format("videodb://movies/titles/%i", tag.m_iDbId); - } else { - object.m_ObjectClass.type = "object.item.videoItem.videoBroadcast"; -@@ -529,7 +530,10 @@ BuildObject(CFileItem& item, - container->m_Recorded.episode_number = tag.m_iEpisode; - container->m_MiscInfo.play_count = tag.m_playCount; - container->m_Title = tag.m_strTitle.c_str(); -- container->m_Date = tag.GetPremiered().GetAsW3CDate().c_str(); -+ if (!tag.m_premiered.IsValid() && tag.m_iYear) -+ container->m_Date = CDateTime(tag.m_iYear, 1, 1, 0, 0, 0).GetAsW3CDateTime().c_str(); -+ else -+ container->m_Date = tag.m_premiered.GetAsW3CDate().c_str(); - - for (unsigned int index = 0; index < tag.m_genre.size(); index++) - container->m_Affiliation.genres.Add(tag.m_genre.at(index).c_str()); -@@ -567,7 +571,7 @@ BuildObject(CFileItem& item, - container->m_ChildrenCount = (NPT_Int32)count; - } else { - /* this should be a standard path */ -- //! @todo - get file count of this directory -+ // TODO - get file count of this directory - } - } - } -@@ -800,7 +804,7 @@ PopulateTagFromObject(CVideoInfoTag& tag, - tag.m_strTitle = object.m_Title; // because could be TV show Title, or Season 1 etc - tag.m_iSeason = object.m_Recorded.episode_number / 100; - tag.m_iEpisode = object.m_Recorded.episode_number % 100; -- tag.SetPremiered(date); -+ tag.m_premiered = date; - } - else if(object.m_ObjectClass.type == "object.item.videoItem.musicVideoClip") { - tag.m_type = MediaTypeMusicVideo; -@@ -812,9 +816,12 @@ PopulateTagFromObject(CVideoInfoTag& tag, - { - tag.m_type = MediaTypeMovie; - tag.m_strTitle = object.m_Title; -- tag.SetPremiered(date); -+ tag.m_premiered = date; - } - -+ if (date.IsValid()) -+ tag.m_iYear = date.GetYear(); -+ - for (unsigned int index = 0; index < object.m_People.publisher.GetItemCount(); index++) - tag.m_studio.push_back(object.m_People.publisher.GetItem(index)->GetChars()); - -diff --git a/xbmc/network/upnp/UPnPRenderer.cpp b/xbmc/network/upnp/UPnPRenderer.cpp -index ab4545e..fbec1b4 100644 ---- a/xbmc/network/upnp/UPnPRenderer.cpp -+++ b/xbmc/network/upnp/UPnPRenderer.cpp -@@ -34,7 +34,6 @@ - #include "pictures/PictureInfoTag.h" - #include "interfaces/AnnouncementManager.h" - #include "settings/Settings.h" --#include "PlayListPlayer.h" - #include "TextureDatabase.h" - #include "ThumbLoader.h" - #include "URL.h" -@@ -261,7 +260,7 @@ CUPnPRenderer::Announce(AnnouncementFlag flag, const char *sender, const char *m - avt->SetStateVariable("AVTransportURIMetaData", meta); - } - -- avt->SetStateVariable("TransportPlaySpeed", NPT_String::FromInteger(data["player"]["speed"].asInteger())); -+ avt->SetStateVariable("TransportPlaySpeed", NPT_String::FromInteger(data["speed"].asInteger())); - avt->SetStateVariable("TransportState", "PLAYING"); - - /* this could be a transition to next track, so clear next */ -@@ -269,12 +268,11 @@ CUPnPRenderer::Announce(AnnouncementFlag flag, const char *sender, const char *m - avt->SetStateVariable("NextAVTransportURIMetaData", ""); - } - else if (strcmp(message, "OnPause") == 0) { -- int64_t speed = data["player"]["speed"].asInteger(); -- avt->SetStateVariable("TransportPlaySpeed", NPT_String::FromInteger(speed != 0 ? speed : 1)); -+ avt->SetStateVariable("TransportPlaySpeed", NPT_String::FromInteger(data["speed"].asInteger())); - avt->SetStateVariable("TransportState", "PAUSED_PLAYBACK"); - } - else if (strcmp(message, "OnSpeedChanged") == 0) { -- avt->SetStateVariable("TransportPlaySpeed", NPT_String::FromInteger(data["player"]["speed"].asInteger())); -+ avt->SetStateVariable("TransportPlaySpeed", NPT_String::FromInteger(data["speed"].asInteger())); - } - } - else if (flag == Application && strcmp(message, "OnVolumeChanged") == 0) { -diff --git a/xbmc/network/upnp/UPnPServer.cpp b/xbmc/network/upnp/UPnPServer.cpp -index c27ea8f..c89205f 100644 ---- a/xbmc/network/upnp/UPnPServer.cpp -+++ b/xbmc/network/upnp/UPnPServer.cpp -@@ -616,7 +616,7 @@ CUPnPServer::OnBrowseMetadata(PLT_ActionReference& action, - // update ID may be wrong here, it should be the one of the container? - NPT_CHECK(action->SetArgumentValue("UpdateId", "0")); - -- //! @todo We need to keep track of the overall SystemUpdateID of the CDS -+ // TODO: We need to keep track of the overall SystemUpdateID of the CDS - - return NPT_SUCCESS; - } -@@ -1097,7 +1097,7 @@ CUPnPServer::OnUpdateObject(PLT_ActionReference& action, - } - - } else if (updated.IsMusicDb()) { -- //! @todo implement this -+ //TODO implement this - - } else { - err = 701; -diff --git a/xbmc/network/windows/NetworkWin32.cpp b/xbmc/network/windows/NetworkWin32.cpp -index 7ae8cff..c6c3e69 100644 ---- a/xbmc/network/windows/NetworkWin32.cpp -+++ b/xbmc/network/windows/NetworkWin32.cpp -@@ -150,28 +150,25 @@ std::string CNetworkInterfaceWin32::GetCurrentDefaultGateway(void) - CNetworkWin32::CNetworkWin32(void) - { - queryInterfaceList(); -+ CApplicationMessenger::GetInstance().PostMsg(TMSG_NETWORKMESSAGE, CNetwork::SERVICES_UP, 0); - } - - CNetworkWin32::~CNetworkWin32(void) - { -- CleanInterfaceList(); - m_netrefreshTimer.Stop(); -+ CleanInterfaceList(); - } - - void CNetworkWin32::CleanInterfaceList() - { -- std::vector::iterator it = m_interfaces.begin(); -- while(it != m_interfaces.end()) -- { -- CNetworkInterface* nInt = *it; -- delete nInt; -- it = m_interfaces.erase(it); -- } -+ CSingleLock lock (m_lockInterfaces); -+ auto it = m_interfaces.before_begin(); -+ m_interfaces.erase_after(it, m_interfaces.end()); - } - --std::vector& CNetworkWin32::GetInterfaceList(void) -+std::forward_list& CNetworkWin32::GetInterfaceList(void) - { -- CSingleLock lock (m_critSection); -+ CSingleLock lock (m_lockInterfaces); - if(m_netrefreshTimer.GetElapsedSeconds() >= 5.0f) - queryInterfaceList(); - -@@ -185,6 +182,7 @@ void CNetworkWin32::queryInterfaceList() - - PIP_ADAPTER_INFO adapterInfo; - PIP_ADAPTER_INFO adapter = NULL; -+ auto *pos = m_interfaces.before_begin(); - - ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO); - -@@ -205,7 +203,8 @@ void CNetworkWin32::queryInterfaceList() - adapter = adapterInfo; - while (adapter) - { -- m_interfaces.push_back(new CNetworkInterfaceWin32(this, *adapter)); -+ m_interfaces.insert_after(pos, new CNetworkInterfaceWin32(this, *adapter)); -+ ++pos; - adapter = adapter->Next; - } - } -@@ -254,15 +253,19 @@ void CNetworkWin32::SetNameServers(const std::vector& nameServers) - return; - } - --bool CNetworkWin32::PingHost(unsigned long host, unsigned int timeout_ms /* = 2000 */) -+bool CNetworkWin32::PingHostImpl(const std::string &target, unsigned int timeout_ms /* = 2000 */) - { -+ struct sockaddr_in sa; -+ if (!CNetwork::ConvIPv4(target, &sa)) -+ return false; -+ - char SendData[] = "poke"; - HANDLE hIcmpFile = IcmpCreateFile(); - BYTE ReplyBuffer [sizeof(ICMP_ECHO_REPLY) + sizeof(SendData)]; - - SetLastError(ERROR_SUCCESS); - -- DWORD dwRetVal = IcmpSendEcho(hIcmpFile, host, SendData, sizeof(SendData), -+ DWORD dwRetVal = IcmpSendEcho(hIcmpFile, ntohl(sa.sin_addr), SendData, sizeof(SendData), - NULL, ReplyBuffer, sizeof(ReplyBuffer), timeout_ms); - - DWORD lastErr = GetLastError(); -@@ -371,7 +374,7 @@ std::vector CNetworkInterfaceWin32::GetAccessPoints(void) - bss_entry.dot11Bssid[0], bss_entry.dot11Bssid[1], bss_entry.dot11Bssid[2], - bss_entry.dot11Bssid[3], bss_entry.dot11Bssid[4], bss_entry.dot11Bssid[5]); - int signalLevel = bss_entry.lRssi; -- EncMode encryption = ENC_NONE; //! @todo implement -+ EncMode encryption = ENC_NONE; // TODO - int channel = NetworkAccessPoint::FreqToChannel((float)bss_entry.ulChCenterFrequency * 1000); - result.push_back(NetworkAccessPoint(essId, macAddress, signalLevel, encryption, channel)); - } -@@ -495,7 +498,7 @@ void CNetworkInterfaceWin32::GetSettings(NetworkAssignment& assignment, std::str - else - CLog::Log(LOGERROR, "%s: Can't open wlan handle", __FUNCTION__); - } -- //! @todo get the key (WlanGetProfile, CryptUnprotectData?) -+ // Todo: get the key (WlanGetProfile, CryptUnprotectData?) - #endif - } - -diff --git a/xbmc/network/windows/NetworkWin32.h b/xbmc/network/windows/NetworkWin32.h -index 3d5405a..0443825 100644 ---- a/xbmc/network/windows/NetworkWin32.h -+++ b/xbmc/network/windows/NetworkWin32.h -@@ -22,10 +22,10 @@ - - #include - #include -+#include - #include "network/Network.h" - #include "Iphlpapi.h" - #include "utils/stopwatch.h" --#include "threads/CriticalSection.h" - - class CNetworkWin32; - -@@ -71,10 +71,10 @@ public: - virtual ~CNetworkWin32(void); - - // Return the list of interfaces -- virtual std::vector& GetInterfaceList(void); -+ virtual std::forward_list& GetInterfaceList(void); - - // Ping remote host -- virtual bool PingHost(unsigned long host, unsigned int timeout_ms = 2000); -+ virtual bool PingHostImpl(const std::string &target, unsigned int timeout_ms = 2000); - - // Get/set the nameserver(s) - virtual std::vector GetNameServers(void); -@@ -82,14 +82,14 @@ public: - - friend class CNetworkInterfaceWin32; - -+ bool ForceRereadInterfaces() { queryInterfaceList(); return true; } - private: - int GetSocket() { return m_sock; } - void queryInterfaceList(); - void CleanInterfaceList(); -- std::vector m_interfaces; -+ std::forward_list m_interfaces; - int m_sock; - CStopWatch m_netrefreshTimer; -- CCriticalSection m_critSection; - }; - - #endif -diff --git a/xbmc/peripherals/EventScanner.h b/xbmc/peripherals/EventScanner.h -index 1951016..a645c00 100644 ---- a/xbmc/peripherals/EventScanner.h -+++ b/xbmc/peripherals/EventScanner.h -@@ -19,8 +19,6 @@ - */ - #pragma once - --#include -- - #include "EventScanRate.h" - #include "threads/CriticalSection.h" - #include "threads/Event.h" -@@ -60,7 +58,7 @@ namespace PERIPHERALS - EventRateHandle SetRate(float rateHz); - - // implementation of IEventRateCallback -- virtual void Release(CEventRateHandle* handle) override; -+ virtual void Release(CEventRateHandle* handle); - - protected: - // implementation of CThread diff --git a/xbmc/peripherals/PeripheralTypes.h b/xbmc/peripherals/PeripheralTypes.h index f93adc2..efcd352 100644 --- a/xbmc/peripherals/PeripheralTypes.h @@ -83830,7 +15208,7 @@ index f93adc2..efcd352 100644 class PeripheralScanResult diff --git a/xbmc/peripherals/Peripherals.cpp b/xbmc/peripherals/Peripherals.cpp -index 55c8f1d..20a4aae 100644 +index 51cd664..20a4aae 100644 --- a/xbmc/peripherals/Peripherals.cpp +++ b/xbmc/peripherals/Peripherals.cpp @@ -39,6 +39,7 @@ @@ -83841,43 +15219,7 @@ index 55c8f1d..20a4aae 100644 #include "dialogs/GUIDialogKaiToast.h" #include "dialogs/GUIDialogOK.h" #include "dialogs/GUIDialogPeripheralSettings.h" -@@ -100,26 +101,22 @@ void CPeripherals::Initialise() - /* load mappings from peripherals.xml */ - LoadMappings(); - -- std::vector busses; -- -+ { -+ CSingleLock bussesLock(m_critSectionBusses); - #if defined(HAVE_PERIPHERAL_BUS_USB) -- busses.push_back(std::make_shared(this)); -+ m_busses.push_back(std::make_shared(this)); - #endif - #if defined(HAVE_LIBCEC) -- busses.push_back(std::make_shared(this)); -+ m_busses.push_back(std::make_shared(this)); - #endif -- busses.push_back(std::make_shared(this)); -+ m_busses.push_back(std::make_shared(this)); - #if defined(TARGET_ANDROID) -- busses.push_back(std::make_shared(this)); -+ m_busses.push_back(std::make_shared(this)); - #endif - -- /* initialise all known busses and run an initial scan for devices */ -- for (auto& bus : busses) -- bus->Initialise(); -- -- { -- CSingleLock bussesLock(m_critSectionBusses); -- m_busses = std::move(busses); -+ /* initialise all known busses and run an initial scan for devices */ -+ for (auto& bus : m_busses) -+ bus->Initialise(); - } - - m_eventScanner.Start(); -@@ -329,6 +326,10 @@ CPeripheral *CPeripherals::CreatePeripheral(CPeripheralBus &bus, const Periphera +@@ -325,6 +326,10 @@ CPeripheral *CPeripherals::CreatePeripheral(CPeripheralBus &bus, const Periphera peripheral = new CPeripheralJoystick(mappedResult, &bus); break; @@ -83888,25 +15230,7 @@ index 55c8f1d..20a4aae 100644 default: break; } -@@ -556,7 +557,7 @@ void CPeripherals::GetSettingsFromMappingsFile(TiXmlElement *xmlNode, std::mapSetVisible(bConfigurable); -@@ -731,7 +732,7 @@ void CPeripherals::ProcessEvents(void) - { - std::vector busses; - { -- CSingleLock lock(m_critSectionBusses); -+ CSingleLock lock(m_critSection); - busses = m_busses; - } - -@@ -900,3 +901,10 @@ int CPeripherals::GetMessageMask() +@@ -896,3 +901,10 @@ int CPeripherals::GetMessageMask() { return TMSG_MASK_PERIPHERALS; } @@ -83918,35 +15242,10 @@ index 55c8f1d..20a4aae 100644 + bus->Initialise(); +} diff --git a/xbmc/peripherals/Peripherals.h b/xbmc/peripherals/Peripherals.h -index ed886df..ea5201e 100644 +index 311af06..ea5201e 100644 --- a/xbmc/peripherals/Peripherals.h +++ b/xbmc/peripherals/Peripherals.h -@@ -19,8 +19,6 @@ - * - */ - --#include -- - #include "EventScanner.h" - #include "bus/PeripheralBus.h" - #include "devices/Peripheral.h" -@@ -193,13 +191,13 @@ namespace PERIPHERALS - * @brief Try to mute the audio via a peripheral. - * @return True when this change was handled by a peripheral (and should not be handled by anything else), false otherwise. - */ -- virtual bool Mute() { return ToggleMute(); } //! @todo CEC only supports toggling the mute status at this time -+ virtual bool Mute() { return ToggleMute(); } // TODO CEC only supports toggling the mute status at this time - - /*! - * @brief Try to unmute the audio via a peripheral. - * @return True when this change was handled by a peripheral (and should not be handled by anything else), false otherwise. - */ -- virtual bool UnMute() { return ToggleMute(); } //! @todo CEC only supports toggling the mute status at this time -+ virtual bool UnMute() { return ToggleMute(); } // TODO CEC only supports toggling the mute status at this time - - /*! - * @brief Try to get a keypress from a peripheral. -@@ -216,6 +214,8 @@ namespace PERIPHERALS +@@ -214,6 +214,8 @@ namespace PERIPHERALS */ EventRateHandle SetEventScanRate(float rateHz) { return m_eventScanner.SetRate(rateHz); } @@ -83955,19 +15254,6 @@ index ed886df..ea5201e 100644 bool SupportsCEC() const { #if defined(HAVE_LIBCEC) -diff --git a/xbmc/peripherals/addons/AddonButtonMap.cpp b/xbmc/peripherals/addons/AddonButtonMap.cpp -index ae65bd8..af82583 100644 ---- a/xbmc/peripherals/addons/AddonButtonMap.cpp -+++ b/xbmc/peripherals/addons/AddonButtonMap.cpp -@@ -272,7 +272,7 @@ bool CAddonButtonMap::AddAccelerometer(const FeatureName& feature, - accelerometer.SetPositiveZ(CPeripheralAddonTranslator::TranslatePrimitive(positiveZ)); - } - -- //! @todo Unmap complementary semiaxes -+ // TODO: Unmap complementary semiaxes - - m_features[feature] = accelerometer; - } diff --git a/xbmc/peripherals/bus/Makefile.in b/xbmc/peripherals/bus/Makefile.in index df5250c..d7b0e93 100644 --- a/xbmc/peripherals/bus/Makefile.in @@ -83981,18 +15267,10 @@ index df5250c..d7b0e93 100644 ifeq (@USE_LIBUSB@,1) diff --git a/xbmc/peripherals/bus/PeripheralBus.cpp b/xbmc/peripherals/bus/PeripheralBus.cpp -index 6f07e27..3cddd2e 100644 +index b58696b..3cddd2e 100644 --- a/xbmc/peripherals/bus/PeripheralBus.cpp +++ b/xbmc/peripherals/bus/PeripheralBus.cpp -@@ -114,6 +114,7 @@ void CPeripheralBus::UnregisterRemovedDevices(const PeripheralScanResults &resul - - void CPeripheralBus::RegisterNewDevices(const PeripheralScanResults &results) - { -+ CSingleLock lock(m_critSection); - for (unsigned int iResultPtr = 0; iResultPtr < results.m_results.size(); iResultPtr++) - { - const PeripheralScanResult& result = results.m_results.at(iResultPtr); -@@ -122,6 +123,15 @@ void CPeripheralBus::RegisterNewDevices(const PeripheralScanResults &results) +@@ -123,6 +123,15 @@ void CPeripheralBus::RegisterNewDevices(const PeripheralScanResults &results) } } @@ -84008,7 +15286,7 @@ index 6f07e27..3cddd2e 100644 bool CPeripheralBus::ScanForDevices(void) { bool bReturn(false); -@@ -209,6 +219,13 @@ size_t CPeripheralBus::GetNumberOfPeripheralsWithId(const int iVendorId, const i +@@ -210,6 +219,13 @@ size_t CPeripheralBus::GetNumberOfPeripheralsWithId(const int iVendorId, const i return iReturn; } @@ -84043,27 +15321,6 @@ index 8093ca2..49f25bc 100644 protected: virtual void Process(void); virtual bool ScanForDevices(void); -diff --git a/xbmc/peripherals/bus/android/PeripheralBusAndroid.cpp b/xbmc/peripherals/bus/android/PeripheralBusAndroid.cpp -index d5a84b1..3ba40d8 100644 ---- a/xbmc/peripherals/bus/android/PeripheralBusAndroid.cpp -+++ b/xbmc/peripherals/bus/android/PeripheralBusAndroid.cpp -@@ -339,13 +339,15 @@ bool CPeripheralBusAndroid::GetDeviceId(const std::string& deviceLocation, int& - bool CPeripheralBusAndroid::ConvertToPeripheralScanResult(const CJNIViewInputDevice& inputDevice, PeripheralScanResult& peripheralScanResult) - { - int deviceId = inputDevice.getId(); -+ int sources = inputDevice.getSources(); - std::string deviceName = inputDevice.getName(); - if (inputDevice.isVirtual()) - { - CLog::Log(LOGDEBUG, "CPeripheralBusAndroid: ignoring virtual input device \"%s\" with ID %d", deviceName.c_str(), deviceId); - return false; - } -- if (!inputDevice.supportsSource(CJNIViewInputDevice::SOURCE_JOYSTICK) && !inputDevice.supportsSource(CJNIViewInputDevice::SOURCE_GAMEPAD)) -+ if ((sources & CJNIViewInputDevice::SOURCE_JOYSTICK) != CJNIViewInputDevice::SOURCE_JOYSTICK && -+ (sources & CJNIViewInputDevice::SOURCE_GAMEPAD) != CJNIViewInputDevice::SOURCE_GAMEPAD) - { - CLog::Log(LOGDEBUG, "CPeripheralBusAndroid: ignoring unknown input device \"%s\" with ID %d", deviceName.c_str(), deviceId); - return false; diff --git a/xbmc/peripherals/bus/linux/PeripheralBusPLATFORMLibUdev.cpp b/xbmc/peripherals/bus/linux/PeripheralBusPLATFORMLibUdev.cpp new file mode 100644 index 0000000..44762c7 @@ -84266,7 +15523,7 @@ index 0000000..32a181a + }; +} diff --git a/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp b/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp -index acbb54b..636f579 100644 +index 15709c6..636f579 100644 --- a/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp +++ b/xbmc/peripherals/bus/linux/PeripheralBusUSBLibUdev.cpp @@ -76,8 +76,8 @@ extern "C" { @@ -84296,17 +15553,6 @@ index acbb54b..636f579 100644 udev_monitor_unref(m_udevMon); udev_unref(m_udev); } -@@ -147,8 +148,8 @@ bool CPeripheralBusUSB::PerformDeviceScan(PeripheralScanResults &results) - int iClass = PeripheralTypeTranslator::HexStringToInt(strClass.c_str()); - if (iClass == USB_CLASS_PER_INTERFACE) - { -- //! @todo just assume this is a HID device for now, since the only devices that we're currently -- //! interested in are HID devices -+ //TODO just assume this is a HID device for now, since the only devices that we're currently -+ // interested in are HID devices - iClass = USB_CLASS_HID; - } - @@ -246,7 +247,10 @@ bool CPeripheralBusUSB::WaitForUpdate() /* we have to read the message from the queue, even though we're not actually using it */ struct udev_device *dev = udev_monitor_receive_device(m_udevMon); @@ -84331,18 +15577,6 @@ index b7715ce..eed2134 100644 virtual ~CPeripheralBusUSB(void); virtual void Clear(void); -diff --git a/xbmc/peripherals/bus/virtual/PeripheralBusAddon.h b/xbmc/peripherals/bus/virtual/PeripheralBusAddon.h -index 2f09b5a..36c76ff 100644 ---- a/xbmc/peripherals/bus/virtual/PeripheralBusAddon.h -+++ b/xbmc/peripherals/bus/virtual/PeripheralBusAddon.h -@@ -29,7 +29,6 @@ - - #include - #include --#include - - namespace PERIPHERALS - { diff --git a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp b/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp index b04fe00..3dc3d0e 100644 --- a/xbmc/peripherals/bus/virtual/PeripheralBusCEC.cpp @@ -84370,32 +15604,11 @@ index b79d94a..0743986 100644 ifeq (@USE_LIBCEC@,1) SRCS += PeripheralCecAdapter.cpp -diff --git a/xbmc/peripherals/devices/Peripheral.cpp b/xbmc/peripherals/devices/Peripheral.cpp -index 95aa63a..a14e10b 100644 ---- a/xbmc/peripherals/devices/Peripheral.cpp -+++ b/xbmc/peripherals/devices/Peripheral.cpp -@@ -255,7 +255,7 @@ void CPeripheral::AddSetting(const std::string &strKey, const CSetting *setting, - } - break; - default: -- //! @todo add more types if needed -+ //TODO add more types if needed - break; - } - diff --git a/xbmc/peripherals/devices/Peripheral.h b/xbmc/peripherals/devices/Peripheral.h -index 646f588..e79306d 100644 +index 1b9da9b..e79306d 100644 --- a/xbmc/peripherals/devices/Peripheral.h +++ b/xbmc/peripherals/devices/Peripheral.h -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - #include "peripherals/PeripheralTypes.h" - - class TiXmlDocument; -@@ -47,6 +46,13 @@ namespace PERIPHERALS +@@ -46,6 +46,13 @@ namespace PERIPHERALS STATE_STANDBY } CecStateChange; @@ -84409,7 +15622,7 @@ index 646f588..e79306d 100644 class CPeripheral { friend class CGUIDialogPeripheralSettings; -@@ -106,6 +112,11 @@ namespace PERIPHERALS +@@ -105,6 +112,11 @@ namespace PERIPHERALS virtual void OnSettingChanged(const std::string &strChangedSetting) {}; /*! @@ -84422,7 +15635,7 @@ index 646f588..e79306d 100644 */ virtual void OnDeviceRemoved(void) {} diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp -index f784bde..a54a794 100644 +index af84e7a..a54a794 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.cpp +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.cpp @@ -35,6 +35,7 @@ @@ -84433,15 +15646,6 @@ index f784bde..a54a794 100644 #include -@@ -128,7 +129,7 @@ void CPeripheralCecAdapter::ResetMembers(void) - m_lastKeypress = 0; - m_lastChange = VOLUME_CHANGE_NONE; - m_iExitCode = EXITCODE_QUIT; -- m_bIsMuted = false; //! @todo fetch the correct initial value when system audiostatus is implemented in libCEC -+ m_bIsMuted = false; // TODO fetch the correct initial value when system audiostatus is implemented in libCEC - m_bGoingToStandby = false; - m_bIsRunning = false; - m_bDeviceRemoved = false; @@ -170,6 +171,9 @@ void CPeripheralCecAdapter::Announce(AnnouncementFlag flag, const char *sender, m_configuration.bActivateSource == 1) { @@ -84697,21 +15901,18 @@ index f784bde..a54a794 100644 } diff --git a/xbmc/peripherals/devices/PeripheralCecAdapter.h b/xbmc/peripherals/devices/PeripheralCecAdapter.h -index e7f769f..af84e42 100644 +index 2f1aa12..af84e42 100644 --- a/xbmc/peripherals/devices/PeripheralCecAdapter.h +++ b/xbmc/peripherals/devices/PeripheralCecAdapter.h -@@ -48,9 +48,9 @@ namespace PERIPHERALS +@@ -48,6 +48,7 @@ namespace PERIPHERALS #include "PeripheralHID.h" #include "interfaces/AnnouncementManager.h" #include "threads/Thread.h" +#include "threads/Timer.h" #include "threads/CriticalSection.h" #include --#include - // undefine macro isset, it collides with function in cectypes.h - #ifdef isset -@@ -143,8 +143,11 @@ namespace PERIPHERALS +@@ -142,8 +143,11 @@ namespace PERIPHERALS void GetNextKey(void); void SetAudioSystemConnected(bool bSetTo); @@ -84723,7 +15924,7 @@ index e7f769f..af84e42 100644 // callbacks from libCEC static int CecLogMessage(void *cbParam, const CEC::cec_log_message message); static int CecCommand(void *cbParam, const CEC::cec_command command); -@@ -184,7 +187,7 @@ namespace PERIPHERALS +@@ -183,7 +187,7 @@ namespace PERIPHERALS std::string m_strComPort; }; @@ -84732,7 +15933,7 @@ index e7f769f..af84e42 100644 { public: CPeripheralCecAdapterUpdateThread(CPeripheralCecAdapter *adapter, CEC::libcec_configuration *configuration); -@@ -199,6 +202,7 @@ namespace PERIPHERALS +@@ -198,6 +202,7 @@ namespace PERIPHERALS bool WaitReady(void); bool SetInitialConfiguration(void); void Process(void); @@ -84740,19 +15941,6 @@ index e7f769f..af84e42 100644 CPeripheralCecAdapter * m_adapter; CEvent m_event; -diff --git a/xbmc/peripherals/devices/PeripheralJoystick.h b/xbmc/peripherals/devices/PeripheralJoystick.h -index 965285e..67c6ec4 100644 ---- a/xbmc/peripherals/devices/PeripheralJoystick.h -+++ b/xbmc/peripherals/devices/PeripheralJoystick.h -@@ -33,7 +33,7 @@ - - namespace PERIPHERALS - { -- class CPeripheralJoystick : public CPeripheral, //! @todo extend CPeripheralHID -+ class CPeripheralJoystick : public CPeripheral, // TODO: extend CPeripheralHID - public JOYSTICK::IDriverHandler - { - public: diff --git a/xbmc/peripherals/devices/PeripheralVideo.cpp b/xbmc/peripherals/devices/PeripheralVideo.cpp new file mode 100644 index 0000000..b2a433b @@ -84948,189 +16136,6 @@ index 0000000..bbbfcfd + }; +} + -diff --git a/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp b/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp -index 53aa157..96dfa37 100644 ---- a/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp -+++ b/xbmc/peripherals/dialogs/GUIDialogPeripheralSettings.cpp -@@ -221,7 +221,7 @@ void CGUIDialogPeripheralSettings::InitializeSettings() - } - - default: -- //! @todo add more types if needed -+ // TODO: add more types if needed - CLog::Log(LOGDEBUG, "%s - unknown type", __FUNCTION__); - break; - } -diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp -index 2197079..f87eb70 100644 ---- a/xbmc/pictures/GUIWindowPictures.cpp -+++ b/xbmc/pictures/GUIWindowPictures.cpp -@@ -35,7 +35,6 @@ - #include "input/Key.h" - #include "dialogs/GUIDialogOK.h" - #include "view/GUIViewState.h" --#include "PlayListPlayer.h" - #include "playlists/PlayList.h" - #include "settings/MediaSourceSettings.h" - #include "settings/Settings.h" -diff --git a/xbmc/pictures/GUIWindowSlideShow.cpp b/xbmc/pictures/GUIWindowSlideShow.cpp -index e62255d..0f8face 100644 ---- a/xbmc/pictures/GUIWindowSlideShow.cpp -+++ b/xbmc/pictures/GUIWindowSlideShow.cpp -@@ -45,7 +45,6 @@ - #include "interfaces/AnnouncementManager.h" - #include "pictures/GUIViewStatePictures.h" - #include "pictures/PictureThumbLoader.h" --#include "PlayListPlayer.h" - #ifdef TARGET_POSIX - #include "linux/XTimeUtils.h" - #endif -diff --git a/xbmc/pictures/SlideShowPicture.cpp b/xbmc/pictures/SlideShowPicture.cpp -index 7d77391..5ea4cfe 100644 ---- a/xbmc/pictures/SlideShowPicture.cpp -+++ b/xbmc/pictures/SlideShowPicture.cpp -@@ -460,7 +460,7 @@ void CSlideShowPic::Process(unsigned int currentTime, CDirtyRegionList &dirtyreg - float fScreenRatio = fScreenWidth / fScreenHeight * fPixelRatio; - // work out if we should be compensating the zoom to minimize blackbars - // we should compute this based on the % of black bars on screen perhaps?? -- //! @todo change m_displayEffect != EFFECT_NO_TIMEOUT to whether we're running the slideshow -+ // TODO: change m_displayEffect != EFFECT_NO_TIMEOUT to whether we're running the slideshow - if (m_displayEffect != EFFECT_NO_TIMEOUT && fScreenRatio < fSourceAR * fComp && fSourceAR < fScreenRatio * fComp) - bFillScreen = true; - if ((!bFillScreen && fScreenWidth*fPixelRatio > fScreenHeight*fSourceAR) || (bFillScreen && fScreenWidth*fPixelRatio < fScreenHeight*fSourceAR)) -diff --git a/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm b/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm -index 8ff14cc..5a278e8 100644 ---- a/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm -+++ b/xbmc/platform/darwin/ios-common/AnnounceReceiver.mm -@@ -31,7 +31,6 @@ - #import "music/MusicDatabase.h" - #import "TextureCache.h" - #import "filesystem/SpecialProtocol.h" --#include "PlayListPlayer.h" - #import "playlists/PlayList.h" - - #import "threads/Atomics.h" -diff --git a/xbmc/platform/darwin/ios/Info.plist.in b/xbmc/platform/darwin/ios/Info.plist.in -index 6c4443c..68dc31d 100644 ---- a/xbmc/platform/darwin/ios/Info.plist.in -+++ b/xbmc/platform/darwin/ios/Info.plist.in -@@ -51,6 +51,11 @@ - - iPhoneOS - -+ UISupportedInterfaceOrientations -+ -+ UIInterfaceOrientationLandscapeLeft -+ UIInterfaceOrientationLandscapeRight -+ - BuildMachineOSBuild - 15E65 - DTPlatformBuild -@@ -147,23 +152,5 @@ - iphoneos - DTCompiler - com.apple.compilers.llvm.clang.1_0 -- UIRequiresFullScreen -- -- UIRequiresPersistentWiFi -- YES -- UIStatusBarHidden -- -- UISupportedInterfaceOrientations -- -- UIInterfaceOrientationLandscapeLeft -- UIInterfaceOrientationLandscapeRight -- -- UISupportedInterfaceOrientations~ipad -- -- UIInterfaceOrientationLandscapeLeft -- UIInterfaceOrientationLandscapeRight -- -- UIViewControllerBasedStatusBarAppearance -- - - -diff --git a/xbmc/platform/darwin/ios/XBMCController.mm b/xbmc/platform/darwin/ios/XBMCController.mm -index b961052..59af2ac 100644 ---- a/xbmc/platform/darwin/ios/XBMCController.mm -+++ b/xbmc/platform/darwin/ios/XBMCController.mm -@@ -360,7 +360,7 @@ XBMCController *g_xbmcController; - //-------------------------------------------------------------- - -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event - { -- if( m_glView && [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING -+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING - { - UITouch *touch = (UITouch *)[[touches allObjects] objectAtIndex:0]; - CGPoint point = [touch locationInView:m_glView]; -@@ -372,7 +372,7 @@ XBMCController *g_xbmcController; - //-------------------------------------------------------------- - -(void)handlePinch:(UIPinchGestureRecognizer*)sender - { -- if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches )//NO GESTURES BEFORE WE ARE UP AND RUNNING -+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING - { - CGPoint point = [sender locationOfTouch:0 inView:m_glView]; - point.x *= screenScale; -@@ -398,7 +398,7 @@ XBMCController *g_xbmcController; - //-------------------------------------------------------------- - -(void)handleRotate:(UIRotationGestureRecognizer*)sender - { -- if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches )//NO GESTURES BEFORE WE ARE UP AND RUNNING -+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING - { - CGPoint point = [sender locationOfTouch:0 inView:m_glView]; - point.x *= screenScale; -@@ -423,11 +423,11 @@ XBMCController *g_xbmcController; - //-------------------------------------------------------------- - - (IBAction)handlePan:(UIPanGestureRecognizer *)sender - { -- if( m_glView && [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING -+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING - { - CGPoint velocity = [sender velocityInView:m_glView]; - -- if( [sender state] == UIGestureRecognizerStateBegan && sender.numberOfTouches ) -+ if( [sender state] == UIGestureRecognizerStateBegan ) - { - CGPoint point = [sender locationOfTouch:0 inView:m_glView]; - point.x *= screenScale; -@@ -436,7 +436,7 @@ XBMCController *g_xbmcController; - lastGesturePoint = point; - } - -- if( [sender state] == UIGestureRecognizerStateChanged && sender.numberOfTouches ) -+ if( [sender state] == UIGestureRecognizerStateChanged ) - { - CGPoint point = [sender locationOfTouch:0 inView:m_glView]; - point.x *= screenScale; -@@ -484,7 +484,7 @@ XBMCController *g_xbmcController; - //-------------------------------------------------------------- - - (IBAction)handleSwipe:(UISwipeGestureRecognizer *)sender - { -- if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches )//NO GESTURES BEFORE WE ARE UP AND RUNNING -+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING - { - - -@@ -534,7 +534,7 @@ XBMCController *g_xbmcController; - //-------------------------------------------------------------- - - (IBAction)handleSingleFingerSingleLongTap:(UIGestureRecognizer *)sender - { -- if( m_glView && [m_glView isXBMCAlive] && sender.numberOfTouches)//NO GESTURES BEFORE WE ARE UP AND RUNNING -+ if( [m_glView isXBMCAlive] )//NO GESTURES BEFORE WE ARE UP AND RUNNING - { - CGPoint point = [sender locationOfTouch:0 inView:m_glView]; - point.x *= screenScale; -@@ -567,8 +567,6 @@ XBMCController *g_xbmcController; - if ( !self ) - return ( nil ); - -- m_glView = NULL; -- - m_isPlayingBeforeInactive = NO; - m_bgTask = UIBackgroundTaskInvalid; - m_playbackState = IOS_PLAYBACK_STOPPED; diff --git a/xbmc/platform/xbmc.cpp b/xbmc/platform/xbmc.cpp index 0c7a4d1..19de6b8 100644 --- a/xbmc/platform/xbmc.cpp @@ -85179,114 +16184,6 @@ index 0c7a4d1..19de6b8 100644 try { status = g_application.Run(); -diff --git a/xbmc/playlists/PlayList.cpp b/xbmc/playlists/PlayList.cpp -index 6129f8d..0d2fb66 100644 ---- a/xbmc/playlists/PlayList.cpp -+++ b/xbmc/playlists/PlayList.cpp -@@ -25,7 +25,6 @@ - #include "music/tags/MusicInfoTag.h" - #include "filesystem/File.h" - #include "utils/log.h" --#include "utils/Random.h" - #include "utils/URIUtils.h" - #include "utils/Variant.h" - #include "utils/StringUtils.h" -@@ -281,7 +280,7 @@ void CPlayList::Shuffle(int iPosition) - CLog::Log(LOGDEBUG,"%s shuffling at pos:%i", __FUNCTION__, iPosition); - - ivecItems it = m_vecItems.begin() + iPosition; -- KODI::UTILS::RandomShuffle(it, m_vecItems.end()); -+ std::random_shuffle(it, m_vecItems.end()); - - // the list is now shuffled! - m_bShuffled = true; -diff --git a/xbmc/playlists/PlayList.h b/xbmc/playlists/PlayList.h -index 1126992..20fb964 100644 ---- a/xbmc/playlists/PlayList.h -+++ b/xbmc/playlists/PlayList.h -@@ -22,7 +22,6 @@ - #include "FileItem.h" - #include - #include --#include - - namespace PLAYLIST - { -diff --git a/xbmc/playlists/PlayListPLS.h b/xbmc/playlists/PlayListPLS.h -index eb9cb21..49769c4 100644 ---- a/xbmc/playlists/PlayListPLS.h -+++ b/xbmc/playlists/PlayListPLS.h -@@ -18,10 +18,6 @@ - * . - * - */ -- --#include --#include -- - #include "PlayList.h" - - namespace PLAYLIST -diff --git a/xbmc/playlists/SmartPlayList.cpp b/xbmc/playlists/SmartPlayList.cpp -index 26dc5d1..500d234 100644 ---- a/xbmc/playlists/SmartPlayList.cpp -+++ b/xbmc/playlists/SmartPlayList.cpp -@@ -26,7 +26,6 @@ - - #include "SmartPlayList.h" - #include "Util.h" --#include "dbwrappers/Database.h" - #include "filesystem/File.h" - #include "filesystem/SmartPlaylistDirectory.h" - #include "guilib/LocalizeStrings.h" -@@ -34,12 +33,12 @@ - #include "utils/JSONVariantParser.h" - #include "utils/JSONVariantWriter.h" - #include "utils/log.h" --#include "utils/StreamDetails.h" - #include "utils/StringUtils.h" - #include "utils/StringValidation.h" - #include "utils/URIUtils.h" - #include "utils/Variant.h" - #include "utils/XMLUtils.h" -+#include "video/VideoDatabase.h" - - using namespace XFILE; - -@@ -346,7 +345,6 @@ std::vector CSmartPlaylistRule::GetFields(const std::string &type) - fields.push_back(FieldDisbanded); - fields.push_back(FieldDied); - fields.push_back(FieldRole); -- fields.push_back(FieldPath); - } - else if (type == "tvshows") - { -@@ -736,7 +734,7 @@ CDatabaseQueryRule::SEARCH_OPERATOR CSmartPlaylistRule::GetOperator(const std::s - SEARCH_OPERATOR op = CDatabaseQueryRule::GetOperator(strType); - if ((strType == "tvshows" || strType == "episodes") && m_field == FieldYear) - { // special case for premiered which is a date rather than a year -- //! @todo SMARTPLAYLISTS do we really need this, or should we just make this field the premiered date and request a date? -+ // TODO: SMARTPLAYLISTS do we really need this, or should we just make this field the premiered date and request a date? - if (op == OPERATOR_EQUALS) - op = OPERATOR_CONTAINS; - else if (op == OPERATOR_DOES_NOT_EQUAL) -@@ -808,15 +806,10 @@ std::string CSmartPlaylistRule::FormatWhereClause(const std::string &negate, con - query += " OR "; - query += "EXISTS (SELECT DISTINCT album_artist.idArtist FROM album_artist, album_genre, genre WHERE album_artist.idArtist = " + GetField(FieldId, strType) + " AND album_artist.idAlbum = album_genre.idAlbum AND album_genre.idGenre = genre.idGenre AND genre.strGenre" + parameter + "))"; - } -- else if (m_field == FieldRole) -+ if (m_field == FieldRole) - { - query = negate + " (EXISTS (SELECT DISTINCT song_artist.idArtist FROM song_artist, role WHERE song_artist.idArtist = " + GetField(FieldId, strType) + " AND song_artist.idRole = role.idRole AND role.strRole" + parameter + "))"; - } -- else if (m_field == FieldPath) -- { -- query = negate + " (EXISTS (SELECT DISTINCT song_artist.idArtist FROM song_artist JOIN song ON song.idSong = song_artist.idSong JOIN path ON song.idpath = path.idpath "; -- query += "WHERE song_artist.idArtist = " + GetField(FieldId, strType) + " AND path.strPath" + parameter + "))"; -- } - } - else if (strType == "movies") - { diff --git a/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp b/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp index 4e5bcc6..0212306 100644 --- a/xbmc/powermanagement/linux/LogindUPowerSyscall.cpp @@ -85311,10 +16208,10 @@ index 4e5bcc6..0212306 100644 m_batteryLevel = 0; diff --git a/xbmc/powermanagement/linux/UPowerSyscall.cpp b/xbmc/powermanagement/linux/UPowerSyscall.cpp -index e3b4725..20175e7 100644 +index 28ce475..20175e7 100644 --- a/xbmc/powermanagement/linux/UPowerSyscall.cpp +++ b/xbmc/powermanagement/linux/UPowerSyscall.cpp -@@ -62,9 +62,12 @@ CUPowerSyscall::CUPowerSyscall() +@@ -62,6 +62,9 @@ CUPowerSyscall::CUPowerSyscall() m_lowBattery = false; @@ -85322,13 +16219,8 @@ index e3b4725..20175e7 100644 + m_CanReboot = true; + dbus_error_init (&m_error); -- //! @todo do not use dbus_connection_pop_message() that requires the use of a -- //! private connection -+ // TODO: do not use dbus_connection_pop_message() that requires the use of a -+ // private connection - m_connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &m_error); - - if (m_connection) + // TODO: do not use dbus_connection_pop_message() that requires the use of a + // private connection @@ -83,9 +86,6 @@ CUPowerSyscall::CUPowerSyscall() m_connection = NULL; } @@ -85353,6623 +16245,10 @@ index e3b4725..20175e7 100644 } #endif -diff --git a/xbmc/powermanagement/osx/CocoaPowerSyscall.cpp b/xbmc/powermanagement/osx/CocoaPowerSyscall.cpp -index db03d1e..a22449b 100644 ---- a/xbmc/powermanagement/osx/CocoaPowerSyscall.cpp -+++ b/xbmc/powermanagement/osx/CocoaPowerSyscall.cpp -@@ -341,12 +341,12 @@ void CCocoaPowerSyscall::OSPowerCallBack(void *refcon, io_service_t service, nat - IOAllowPowerChange(ctx->m_root_port, (long)msg_arg); - //CLog::Log(LOGDEBUG, "%s - kIOMessageSystemWillSleep", __FUNCTION__); - // let XBMC know system will sleep -- //! @todo implement -+ // TODO: - break; - case kIOMessageSystemHasPoweredOn: - // System has awakened from sleep. - // let XBMC know system has woke -- //! @todo implement -+ // TODO: - ctx->m_OnResume = true; - //CLog::Log(LOGDEBUG, "%s - kIOMessageSystemHasPoweredOn", __FUNCTION__); - break; -diff --git a/xbmc/profiles/ProfilesManager.cpp b/xbmc/profiles/ProfilesManager.cpp -index 54f6b8c..86db51a 100644 ---- a/xbmc/profiles/ProfilesManager.cpp -+++ b/xbmc/profiles/ProfilesManager.cpp -@@ -53,10 +53,10 @@ - #include "utils/Variant.h" - #include "utils/XMLUtils.h" - --//! @todo --//! eventually the profile should dictate where special://masterprofile/ is --//! but for now it makes sense to leave all the profile settings in a user --//! writeable location like special://masterprofile/ -+// TODO -+// eventually the profile should dictate where special://masterprofile/ is -+// but for now it makes sense to leave all the profile settings in a user -+// writeable location like special://masterprofile/ - #define PROFILES_FILE "special://masterprofile/profiles.xml" - - #define XML_PROFILES "profiles" -diff --git a/xbmc/programs/GUIWindowPrograms.h b/xbmc/programs/GUIWindowPrograms.h -index 1398e19..759774e 100644 ---- a/xbmc/programs/GUIWindowPrograms.h -+++ b/xbmc/programs/GUIWindowPrograms.h -@@ -30,16 +30,16 @@ class CGUIWindowPrograms : - public: - CGUIWindowPrograms(void); - virtual ~CGUIWindowPrograms(void); -- virtual bool OnMessage(CGUIMessage& message) override; -+ virtual bool OnMessage(CGUIMessage& message); - virtual void OnItemInfo(int iItem); - protected: -- virtual void OnItemLoaded(CFileItem* pItem) override {}; -- virtual bool Update(const std::string& strDirectory, bool updateFilterPath = true) override; -+ virtual void OnItemLoaded(CFileItem* pItem) {}; -+ virtual bool Update(const std::string& strDirectory, bool updateFilterPath = true); - virtual bool OnPlayMedia(int iItem); -- virtual void GetContextButtons(int itemNumber, CContextButtons &buttons) override; -- virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override; -+ virtual void GetContextButtons(int itemNumber, CContextButtons &buttons); -+ virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button); - bool OnAddMediaSource() override; -- virtual std::string GetStartFolder(const std::string &dir) override; -+ virtual std::string GetStartFolder(const std::string &dir); - - CGUIDialogProgress* m_dlgProgress; - -diff --git a/xbmc/pvr/PVRActionListener.cpp b/xbmc/pvr/PVRActionListener.cpp -index d8e29a1..ff5a312 100644 ---- a/xbmc/pvr/PVRActionListener.cpp -+++ b/xbmc/pvr/PVRActionListener.cpp -@@ -111,7 +111,7 @@ bool CPVRActionListener::OnAction(const CAction &action) - CFileItemPtr fileItem = group->GetLastPlayedChannel(playingChannel->ChannelID()); - if (fileItem && fileItem->HasPVRChannelInfoTag()) - { -- CLog::Log(LOGDEBUG, "%s - switch to channel number %d", __FUNCTION__, fileItem->GetPVRChannelInfoTag()->ChannelNumber()); -+ CLog::Log(LOGPVR, "%s - switch to channel number %d", __FUNCTION__, fileItem->GetPVRChannelInfoTag()->ChannelNumber()); - CApplicationMessenger::GetInstance().SendMsg(TMSG_GUI_ACTION, WINDOW_INVALID, -1,static_cast( - new CAction(ACTION_CHANNEL_SWITCH, static_cast(fileItem->GetPVRChannelInfoTag()->ChannelNumber())))); - } -diff --git a/xbmc/pvr/PVRDatabase.cpp b/xbmc/pvr/PVRDatabase.cpp -index 9d350cd..bb04c06 100644 ---- a/xbmc/pvr/PVRDatabase.cpp -+++ b/xbmc/pvr/PVRDatabase.cpp -@@ -47,7 +47,7 @@ void CPVRDatabase::CreateTables() - { - CLog::Log(LOGINFO, "PVR - %s - creating tables", __FUNCTION__); - -- CLog::Log(LOGDEBUG, "PVR - %s - creating table 'channels'", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVR - %s - creating table 'channels'", __FUNCTION__); - m_pDS->exec( - "CREATE TABLE channels (" - "idChannel integer primary key, " -@@ -64,14 +64,14 @@ void CPVRDatabase::CreateTables() - "sEPGScraper varchar(32), " - "iLastWatched integer," - -- //! @todo use mapping table -+ // TODO use mapping table - "iClientId integer, " - - "idEpg integer" - ")" - ); - -- CLog::Log(LOGDEBUG, "PVR - %s - creating table 'channelgroups'", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVR - %s - creating table 'channelgroups'", __FUNCTION__); - m_pDS->exec( - "CREATE TABLE channelgroups (" - "idGroup integer primary key," -@@ -84,7 +84,7 @@ void CPVRDatabase::CreateTables() - ")" - ); - -- CLog::Log(LOGDEBUG, "PVR - %s - creating table 'map_channelgroups_channels'", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVR - %s - creating table 'map_channelgroups_channels'", __FUNCTION__); - m_pDS->exec( - "CREATE TABLE map_channelgroups_channels (" - "idChannel integer, " -@@ -150,17 +150,34 @@ void CPVRDatabase::UpdateTables(int iVersion) - - bool CPVRDatabase::DeleteChannels(void) - { -- CLog::Log(LOGDEBUG, "PVR - %s - deleting all channels from the database", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVR - %s - deleting all channels from the database", __FUNCTION__); - return DeleteValues("channels"); - } - -+bool CPVRDatabase::DeleteClientChannels(const CPVRClient &client) -+{ -+ /* invalid client Id */ -+ if (client.GetID() <= 0) -+ { -+ CLog::Log(LOGERROR, "PVR - %s - invalid client id: %i", __FUNCTION__, client.GetID()); -+ return false; -+ } -+ -+ CLog::Log(LOGPVR, "PVR - %s - deleting all channels from client '%i' from the database", __FUNCTION__, client.GetID()); -+ -+ Filter filter; -+ filter.AppendWhere(PrepareSQL("iClientId = %u", client.GetID())); -+ -+ return DeleteValues("channels", filter); -+} -+ - bool CPVRDatabase::Delete(const CPVRChannel &channel) - { - /* invalid channel */ - if (channel.ChannelID() <= 0) - return false; - -- CLog::Log(LOGDEBUG, "PVR - %s - deleting channel '%s' from the database", __FUNCTION__, channel.ChannelName().c_str()); -+ CLog::Log(LOGPVR, "PVR - %s - deleting channel '%s' from the database", __FUNCTION__, channel.ChannelName().c_str()); - - Filter filter; - filter.AppendWhere(PrepareSQL("idChannel = %u", channel.ChannelID())); -@@ -207,7 +224,7 @@ int CPVRDatabase::Get(CPVRChannelGroupInternal &results) - channel->UpdateEncryptionName(); - - #if PVRDB_DEBUGGING -- CLog::Log(LOGDEBUG, "PVR - %s - channel '%s' loaded from the database", __FUNCTION__, channel->m_strChannelName.c_str()); -+ CLog::Log(LOGPVR, "PVR - %s - channel '%s' loaded from the database", __FUNCTION__, channel->m_strChannelName.c_str()); - #endif - PVRChannelGroupMember newMember = { channel, (unsigned int)m_pDS->fv("iChannelNumber").get_asInt() }; - results.m_sortedMembers.push_back(newMember); -@@ -278,6 +295,21 @@ bool CPVRDatabase::GetCurrentGroupMembers(const CPVRChannelGroup &group, std::ve - return bReturn; - } - -+bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group) -+{ -+ /* invalid group id */ -+ if (group.GroupID() <= 0) -+ { -+ CLog::Log(LOGERROR, "PVR - %s - invalid group id: %d", __FUNCTION__, group.GroupID()); -+ return false; -+ } -+ -+ Filter filter; -+ filter.AppendWhere(PrepareSQL("idGroup = %u", group.GroupID())); -+ -+ return DeleteValues("map_channelgroups_channels", filter); -+} -+ - bool CPVRDatabase::DeleteChannelsFromGroup(const CPVRChannelGroup &group, const std::vector &channelsToDelete) - { - bool bDelete(true); -@@ -371,7 +403,7 @@ bool CPVRDatabase::RemoveStaleChannelsFromGroup(const CPVRChannelGroup &group) - - bool CPVRDatabase::DeleteChannelGroups(void) - { -- CLog::Log(LOGDEBUG, "PVR - %s - deleting all channel groups from the database", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVR - %s - deleting all channel groups from the database", __FUNCTION__); - - return DeleteValues("channelgroups") && - DeleteValues("map_channelgroups_channels"); -@@ -412,7 +444,7 @@ bool CPVRDatabase::Get(CPVRChannelGroups &results) - data.SetPosition(m_pDS->fv("iPosition").get_asInt()); - results.Update(data); - -- CLog::Log(LOGDEBUG, "PVR - %s - group '%s' loaded from the database", __FUNCTION__, data.GroupName().c_str()); -+ CLog::Log(LOGPVR, "PVR - %s - group '%s' loaded from the database", __FUNCTION__, data.GroupName().c_str()); - m_pDS->next(); - } - m_pDS->close(); -@@ -454,7 +486,7 @@ int CPVRDatabase::Get(CPVRChannelGroup &group) - if (channel) - { - #if PVRDB_DEBUGGING -- CLog::Log(LOGDEBUG, "PVR - %s - channel '%s' loaded from the database", __FUNCTION__, channel->m_strChannelName.c_str()); -+ CLog::Log(LOGPVR, "PVR - %s - channel '%s' loaded from the database", __FUNCTION__, channel->m_strChannelName.c_str()); - #endif - PVRChannelGroupMember newMember = { channel, (unsigned int)iChannelNumber }; - group.m_sortedMembers.push_back(newMember); -diff --git a/xbmc/pvr/PVRDatabase.h b/xbmc/pvr/PVRDatabase.h -index e64d82b..4aa8c0b 100644 ---- a/xbmc/pvr/PVRDatabase.h -+++ b/xbmc/pvr/PVRDatabase.h -@@ -19,8 +19,6 @@ - * - */ - --#include -- - #include "dbwrappers/Database.h" - #include "utils/log.h" - -@@ -76,6 +74,13 @@ namespace PVR - bool DeleteChannels(void); - - /*! -+ * @brief Remove all channels from a client from the database. -+ * @param client The client to delete the channels for. -+ * @return True if the channels were deleted, false otherwise. -+ */ -+ bool DeleteClientChannels(const CPVRClient &client); -+ -+ /*! - * @brief Add or update a channel entry in the database - * @param channel The channel to persist. - * @return True when persisted or queued, false otherwise. -@@ -168,6 +173,7 @@ namespace PVR - void CreateTables(); - void CreateAnalytics(); - -+ bool DeleteChannelsFromGroup(const CPVRChannelGroup &group); - bool DeleteChannelsFromGroup(const CPVRChannelGroup &group, const std::vector &channelsToDelete); - - bool GetCurrentGroupMembers(const CPVRChannelGroup &group, std::vector &members); -diff --git a/xbmc/pvr/PVRGUIInfo.h b/xbmc/pvr/PVRGUIInfo.h -index a5529fc..6245dc8 100644 ---- a/xbmc/pvr/PVRGUIInfo.h -+++ b/xbmc/pvr/PVRGUIInfo.h -@@ -27,8 +27,6 @@ - #include "utils/Observer.h" - - #include --#include --#include - - namespace EPG - { -diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp -index 295e639..2e12a1c 100644 ---- a/xbmc/pvr/PVRManager.cpp -+++ b/xbmc/pvr/PVRManager.cpp -@@ -29,7 +29,6 @@ - #include "dialogs/GUIDialogNumeric.h" - #include "dialogs/GUIDialogOK.h" - #include "dialogs/GUIDialogProgress.h" --#include "dialogs/GUIDialogSelect.h" - #include "epg/EpgContainer.h" - #include "GUIInfoManager.h" - #include "guilib/GUIWindowManager.h" -@@ -39,7 +38,6 @@ - #include "messaging/helpers/DialogHelper.h" - #include "music/tags/MusicInfoTag.h" - #include "network/Network.h" --#include "PlayListPlayer.h" - #include "pvr/addons/PVRClients.h" - #include "pvr/channels/PVRChannel.h" - #include "pvr/channels/PVRChannelGroupInternal.h" -@@ -66,6 +64,7 @@ - #include "utils/Variant.h" - #include "video/VideoDatabase.h" - #include "ServiceBroker.h" -+#include "settings/AdvancedSettings.h" - - using namespace MUSIC_INFO; - using namespace PVR; -@@ -111,7 +110,7 @@ CPVRManager::~CPVRManager(void) - CAnnouncementManager::GetInstance().RemoveAnnouncer(this); - Stop(); - m_addons.reset(); -- CLog::Log(LOGDEBUG,"PVRManager - destroyed"); -+ CLog::Log(LOGPVR,"PVRManager - destroyed"); - } - - void CPVRManager::Announce(AnnouncementFlag flag, const char *sender, const char *message, const CVariant &data) -@@ -235,6 +234,16 @@ void CPVRManager::OnSettingAction(const CSetting *setting) - } - } - -+bool CPVRManager::IsPVRWindowActive(void) const -+{ -+ return (IsPVRWindow(g_windowManager.GetActiveWindow() & WINDOW_ID_MASK)) ? true : false; -+} -+ -+bool CPVRManager::IsPVRWindow(int windowId) -+{ -+ return (windowId >= WINDOW_PVR_ID_START && windowId <= WINDOW_PVR_ID_END) ? true : false; -+} -+ - void CPVRManager::Cleanup(void) - { - CSingleLock lock(m_critSection); -@@ -401,7 +410,7 @@ void CPVRManager::Process(void) - g_EpgContainer.Start(true); - - /* main loop */ -- CLog::Log(LOGDEBUG, "PVRManager - %s - entering main loop", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVRManager - %s - entering main loop", __FUNCTION__); - - bool bRestart(false); - while (IsStarted() && m_addons->HasCreatedClients() && !bRestart) -@@ -492,7 +501,7 @@ bool CPVRManager::Load(bool bShowProgress) - if (!IsInitialising() || !m_addons->HasCreatedClients()) - return false; - -- CLog::Log(LOGDEBUG, "PVRManager - %s - active clients found. continue to start", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVRManager - %s - active clients found. continue to start", __FUNCTION__); - - /* reset observer for pvr windows */ - for (std::size_t i = 0; i != ARRAY_SIZE(m_pvrWindowIds); i++) -@@ -613,7 +622,7 @@ bool CPVRManager::ContinueLastChannel(void) - return true; - } - -- CLog::Log(LOGDEBUG, "PVRManager - %s - no last played channel to continue playback found", __FUNCTION__); -+ CLog::Log(LOGPVR, "PVRManager - %s - no last played channel to continue playback found", __FUNCTION__); - - return false; - } -@@ -736,7 +745,7 @@ int CPVRManager::GetCurrentEpg(CFileItemList &results) const - if (channel) - iReturn = channel->GetEPG(results); - else -- CLog::Log(LOGDEBUG,"PVRManager - %s - no current channel set", __FUNCTION__); -+ CLog::Log(LOGPVR,"PVRManager - %s - no current channel set", __FUNCTION__); - - return iReturn; - } -@@ -750,245 +759,45 @@ void CPVRManager::ResetPlayingTag(void) - - bool CPVRManager::ToggleRecordingOnChannel(unsigned int iChannelId) - { -- const CPVRChannelPtr channel(m_channelGroups->GetChannelById(iChannelId)); -- if (!channel) -- return false; -- -- return SetRecordingOnChannel(channel, !channel->IsRecording()); --} -- --void CPVRManager::StartRecordingOnPlayingChannel(bool bOnOff) --{ -- // can be called from VideoPlayer thread. SetRecordingOnChannel can open a dialog. Thus, execute async. -- CJobManager::GetInstance().AddJob(new CPVRSetRecordingOnChannelJob(m_addons->GetPlayingChannel(), bOnOff), NULL); --} -- --namespace --{ --enum PVRRECORD_INSTANTRECORDACTION --{ -- NONE = -1, -- RECORD_CURRENT_SHOW = 0, -- RECORD_INSTANTRECORDTIME = 1, -- ASK = 2, -- RECORD_30_MINUTES = 3, -- RECORD_60_MINUTES = 4, -- RECORD_120_MINUTES = 5, -- RECORD_NEXT_SHOW = 6 --}; -- --class InstantRecordingActionSelector --{ --public: -- InstantRecordingActionSelector(); -- virtual ~InstantRecordingActionSelector() {} -- -- void AddAction(PVRRECORD_INSTANTRECORDACTION eAction, const std::string &title); -- void PreSelectAction(PVRRECORD_INSTANTRECORDACTION eAction); -- PVRRECORD_INSTANTRECORDACTION Select(); -- --private: -- CGUIDialogSelect *m_pDlgSelect; // not owner! -- std::map m_actions; --}; -+ bool bReturn = false; - --InstantRecordingActionSelector::InstantRecordingActionSelector() --: m_pDlgSelect(dynamic_cast(g_windowManager.GetWindow(WINDOW_DIALOG_SELECT))) --{ -- if (m_pDlgSelect) -- { -- m_pDlgSelect->SetMultiSelection(false); -- m_pDlgSelect->SetHeading(CVariant{19086}); // Instant recording action -- } -- else -- { -- CLog::Log(LOGERROR, "InstantRecordingActionSelector - %s - unable to obtain WINDOW_DIALOG_SELECT instance", __FUNCTION__); -- } --} -+ CPVRChannelPtr channel(m_channelGroups->GetChannelById(iChannelId)); -+ if (!channel) -+ return bReturn; - --void InstantRecordingActionSelector::AddAction(PVRRECORD_INSTANTRECORDACTION eAction, const std::string &title) --{ -- if (m_actions.find(eAction) == m_actions.end()) -+ if (m_addons->HasTimerSupport(channel->ClientID())) - { -- switch (eAction) -+ /* timers are supported on this channel */ -+ if (!channel->IsRecording()) - { -- case RECORD_INSTANTRECORDTIME: -- m_pDlgSelect->Add(StringUtils::Format(g_localizeStrings.Get(19090).c_str(), -- CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME))); // Record next minutes -- break; -- case RECORD_30_MINUTES: -- m_pDlgSelect->Add(StringUtils::Format(g_localizeStrings.Get(19090).c_str(), 30)); // Record next 30 minutes -- break; -- case RECORD_60_MINUTES: -- m_pDlgSelect->Add(StringUtils::Format(g_localizeStrings.Get(19090).c_str(), 60)); // Record next 60 minutes -- break; -- case RECORD_120_MINUTES: -- m_pDlgSelect->Add(StringUtils::Format(g_localizeStrings.Get(19090).c_str(), 120)); // Record next 120 minutes -- break; -- case RECORD_CURRENT_SHOW: -- m_pDlgSelect->Add(StringUtils::Format(g_localizeStrings.Get(19091).c_str(), title.c_str())); // Record current show () -- break; -- case RECORD_NEXT_SHOW: -- m_pDlgSelect->Add(StringUtils::Format(g_localizeStrings.Get(19092).c_str(), title.c_str())); // Record next show (<title>) -- break; -- case NONE: -- case ASK: -- default: -- return; -+ bReturn = m_timers->InstantTimer(channel); -+ if (!bReturn) -+ CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19164}); - } -- -- m_actions.insert(std::make_pair(eAction, m_actions.size())); -- } --} -- --void InstantRecordingActionSelector::PreSelectAction(PVRRECORD_INSTANTRECORDACTION eAction) --{ -- const auto &it = m_actions.find(eAction); -- if (it != m_actions.end()) -- m_pDlgSelect->SetSelected(it->second); --} -- --PVRRECORD_INSTANTRECORDACTION InstantRecordingActionSelector::Select() --{ -- PVRRECORD_INSTANTRECORDACTION eAction = NONE; -- -- m_pDlgSelect->Open(); -- -- if (m_pDlgSelect->IsConfirmed()) -- { -- int iSelection = m_pDlgSelect->GetSelectedItem(); -- for (const auto &action : m_actions) -+ else - { -- if (action.second == iSelection) -- { -- eAction = action.first; -- break; -- } -+ /* delete active timers */ -+ bReturn = m_timers->DeleteTimersOnChannel(channel, true, true); - } - } - -- return eAction; -+ return bReturn; - } - --} // unnamed namespace -- --bool CPVRManager::SetRecordingOnChannel(const CPVRChannelPtr &channel, bool bOnOff) -+bool CPVRManager::StartRecordingOnPlayingChannel(bool bOnOff) - { - bool bReturn = false; - -+ CPVRChannelPtr channel(m_addons->GetPlayingChannel()); - if (!channel) - return bReturn; - -- if (!g_PVRManager.CheckParentalLock(channel)) -- return bReturn; -- - if (m_addons->HasTimerSupport(channel->ClientID())) - { - /* timers are supported on this channel */ - if (bOnOff && !channel->IsRecording()) - { -- CEpgInfoTagPtr epgTag; -- int iDuration = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME); -- -- int iAction = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDACTION); -- switch (iAction) -- { -- case RECORD_CURRENT_SHOW: -- epgTag = channel->GetEPGNow(); -- break; -- -- case RECORD_INSTANTRECORDTIME: -- epgTag.reset(); -- break; -- -- case ASK: -- { -- PVRRECORD_INSTANTRECORDACTION ePreselect = RECORD_INSTANTRECORDTIME; -- InstantRecordingActionSelector selector; -- CEpgInfoTagPtr epgTagNext; -- -- // fixed length recordings -- selector.AddAction(RECORD_30_MINUTES, ""); -- selector.AddAction(RECORD_60_MINUTES, ""); -- selector.AddAction(RECORD_120_MINUTES, ""); -- -- const int iDurationDefault = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME); -- if (iDurationDefault != 30 && iDurationDefault != 60 && iDurationDefault != 120) -- selector.AddAction(RECORD_INSTANTRECORDTIME, ""); -- -- // epg-based recordings -- epgTag = channel->GetEPGNow(); -- if (epgTag) -- { -- // "now" -- selector.AddAction(RECORD_CURRENT_SHOW, epgTag->Title()); -- ePreselect = RECORD_CURRENT_SHOW; -- -- // "next" -- epgTagNext = channel->GetEPGNext(); -- if (epgTagNext) -- { -- selector.AddAction(RECORD_NEXT_SHOW, epgTagNext->Title()); -- -- // be smart. if current show is almost over, preselect next show. -- if (epgTag->ProgressPercentage() > 90.0f) -- ePreselect = RECORD_NEXT_SHOW; -- } -- } -- -- selector.PreSelectAction(ePreselect); -- -- PVRRECORD_INSTANTRECORDACTION eSelected = selector.Select(); -- switch (eSelected) -- { -- case NONE: -- return false; // dialog canceled -- -- case RECORD_30_MINUTES: -- iDuration = 30; -- epgTag.reset(); -- break; -- -- case RECORD_60_MINUTES: -- iDuration = 60; -- epgTag.reset(); -- break; -- -- case RECORD_120_MINUTES: -- iDuration = 120; -- epgTag.reset(); -- break; -- -- case RECORD_INSTANTRECORDTIME: -- iDuration = iDurationDefault; -- epgTag.reset(); -- break; -- -- case RECORD_CURRENT_SHOW: -- break; -- -- case RECORD_NEXT_SHOW: -- epgTag = epgTagNext; -- break; -- -- default: -- CLog::Log(LOGERROR, "PVRManager - %s - unknown instant record action selection (%d), defaulting to fixed length recording.", __FUNCTION__, eSelected); -- epgTag.reset(); -- break; -- } -- break; -- } -- -- default: -- CLog::Log(LOGERROR, "PVRManager - %s - unknown instant record action setting value (%d), defaulting to fixed length recording.", __FUNCTION__, iAction); -- break; -- } -- -- const CPVRTimerInfoTagPtr newTimer(epgTag ? CPVRTimerInfoTag::CreateFromEpg(epgTag, false) : CPVRTimerInfoTag::CreateInstantTimerTag(channel, iDuration)); -- -- if (newTimer) -- bReturn = newTimer->AddToClient(); -- -+ bReturn = m_timers->InstantTimer(channel); - if (!bReturn) - CGUIDialogOK::ShowAndGetInput(CVariant{19033}, CVariant{19164}); - } -@@ -1123,7 +932,7 @@ bool CPVRManager::OpenLiveStream(const CFileItem &fileItem) - if (!fileItem.HasPVRChannelInfoTag()) - return bReturn; - -- CLog::Log(LOGDEBUG,"PVRManager - %s - opening live stream on channel '%s'", -+ CLog::Log(LOGPVR,"PVRManager - %s - opening live stream on channel '%s'", - __FUNCTION__, fileItem.GetPVRChannelInfoTag()->ChannelName().c_str()); - - // check if we're allowed to play this file -@@ -1401,7 +1210,7 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannelPtr &channel, bool bPrev - CSingleLock lock(m_critSection); - if (m_bIsSwitchingChannels) - { -- CLog::Log(LOGDEBUG, "PVRManager - %s - can't switch to channel '%s'. waiting for the previous switch to complete", -+ CLog::Log(LOGPVR, "PVRManager - %s - can't switch to channel '%s'. waiting for the previous switch to complete", - __FUNCTION__, channel->ChannelName().c_str()); - return false; - } -@@ -1417,7 +1226,7 @@ bool CPVRManager::PerformChannelSwitch(const CPVRChannelPtr &channel, bool bPrev - m_bIsSwitchingChannels = true; - } - -- CLog::Log(LOGDEBUG, "PVRManager - %s - switching to channel '%s'", __FUNCTION__, channel->ChannelName().c_str()); -+ CLog::Log(LOGPVR, "PVRManager - %s - switching to channel '%s'", __FUNCTION__, channel->ChannelName().c_str()); - - // will be deleted by CPVRChannelSwitchJob::DoWork() - CFileItem* previousFile = m_currentFile; -@@ -1496,11 +1305,29 @@ int CPVRManager::TranslateIntInfo(DWORD dwInfo) const - return IsStarted() && m_guiInfo ? m_guiInfo->TranslateIntInfo(dwInfo) : 0; - } - -+bool CPVRManager::HasTimers(void) const -+{ -+ return IsStarted() && m_timers ? m_timers->HasActiveTimers() : false; -+} -+ - bool CPVRManager::IsRecording(void) const - { - return IsStarted() && m_timers ? m_timers->IsRecording() : false; - } - -+bool CPVRManager::IsIdle(void) const -+{ -+ bool bReturn(true); -+ if (IsStarted()) -+ { -+ if (IsRecording() || IsPlaying()) // pvr recording or playing? -+ bReturn = false; -+ else -+ bReturn = !IsNextEventWithinBackendIdleTime(); -+ } -+ return bReturn; -+} -+ - bool CPVRManager::CanSystemPowerdown(bool bAskUser /*= true*/) const - { - bool bReturn(true); -@@ -1827,12 +1654,6 @@ bool CPVRClientConnectionJob::DoWork(void) - return true; - } - --bool CPVRSetRecordingOnChannelJob::DoWork(void) --{ -- g_PVRManager.SetRecordingOnChannel(m_channel, m_bOnOff); -- return true; --} -- - bool CPVRManager::CreateChannelEpgs(void) - { - if (EpgsCreated()) -diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h -index 5d7b809..8c46733 100644 ---- a/xbmc/pvr/PVRManager.h -+++ b/xbmc/pvr/PVRManager.h -@@ -32,7 +32,6 @@ - - #include <map> - #include <memory> --#include <vector> - - class CGUIDialogProgressBarHandle; - class CStopWatch; -@@ -173,6 +172,16 @@ private: - void Cleanup(void); - - /*! -+ * @return True when a PVR window is active, false otherwise. -+ */ -+ bool IsPVRWindowActive(void) const; -+ -+ /*! -+ * @return True when the given window id is an PVR window, false otherwise. -+ */ -+ static bool IsPVRWindow(int windowId); -+ -+ /*! - * @brief Get the TV database. - * @return The TV database. - */ -@@ -241,6 +250,7 @@ private: - return GetState() == ManagerStateStarted; - } - -+ - /*! - * @brief Check whether the PVRManager is stopping - * @return True while the PVRManager is stopping. -@@ -332,16 +342,15 @@ private: - /*! - * @brief Start or stop recording on the channel that is currently being played. - * @param bOnOff True to start recording, false to stop. -+ * @return True if the recording was started or stopped successfully, false otherwise. - */ -- void StartRecordingOnPlayingChannel(bool bOnOff); -+ bool StartRecordingOnPlayingChannel(bool bOnOff); - - /*! -- * @brief Start or stop recording on a given channel. -- * @param channel the channel to start/stop recording. -- * @param bOnOff True to start recording, false to stop. -- * @return True if the recording was started or stopped successfully, false otherwise. -+ * @brief Check whether there are active timers. -+ * @return True if there are active timers, false otherwise. - */ -- bool SetRecordingOnChannel(const CPVRChannelPtr &channel, bool bOnOff); -+ bool HasTimers(void) const; - - /*! - * @brief Check whether there are active recordings. -@@ -350,6 +359,12 @@ private: - bool IsRecording(void) const; - - /*! -+ * @brief Check whether the pvr backend is idle. -+ * @return True if there are no active timers/recordings/wake-ups within the configured time span. -+ */ -+ bool IsIdle(void) const; -+ -+ /*! - * @brief Check whether the system Kodi is running on can be powered down - * (shutdown/reboot/suspend/hibernate) without stopping any active - * recordings and/or without preventing the start of recordings -@@ -543,6 +558,12 @@ private: - void OnWake(); - - /*! -+ * @brief Wait until the pvr manager is loaded -+ * @return True when loaded, false otherwise -+ */ -+ bool WaitUntilInitialised(void); -+ -+ /*! - * @brief Create EPG tags for all channels in internal channel groups - * @return True if EPG tags where created successfully, false otherwise - */ -@@ -755,18 +776,4 @@ private: - PVR_CONNECTION_STATE m_state; - std::string m_message; - }; -- -- class CPVRSetRecordingOnChannelJob : public CJob -- { -- public: -- CPVRSetRecordingOnChannelJob(const CPVRChannelPtr &channel, bool bOnOff) : -- m_channel(channel), m_bOnOff(bOnOff) {} -- virtual ~CPVRSetRecordingOnChannelJob() {} -- virtual const char *GetType() const { return "pvr-set-recording-on-channel"; } -- -- bool DoWork(); -- private: -- CPVRChannelPtr m_channel; -- bool m_bOnOff; -- }; - } -diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp -index 63aa3a2..66b062f 100644 ---- a/xbmc/pvr/addons/PVRClients.cpp -+++ b/xbmc/pvr/addons/PVRClients.cpp -@@ -68,6 +68,16 @@ CPVRClients::~CPVRClients(void) - Unload(); - } - -+bool CPVRClients::IsInUse(const std::string& strAddonId) const -+{ -+ CSingleLock lock(m_critSection); -+ -+ for (const auto &client : m_clientMap) -+ if (!CAddonMgr::GetInstance().IsAddonDisabled(client.second->ID()) && client.second->ID() == strAddonId) -+ return true; -+ return false; -+} -+ - void CPVRClients::Start(void) - { - CAddonMgr::GetInstance().RegisterAddonMgrCallback(ADDON_PVRDLL, this); -@@ -378,7 +388,7 @@ bool CPVRClients::SwitchChannel(const CPVRChannelPtr &channel) - CSingleLock lock(m_critSection); - if (m_bIsSwitchingChannels) - { -- CLog::Log(LOGDEBUG, "PVRClients - %s - can't switch to channel '%s'. waiting for the previous switch to complete", __FUNCTION__, channel->ChannelName().c_str()); -+ CLog::Log(LOGPVR, "PVRClients - %s - can't switch to channel '%s'. waiting for the previous switch to complete", __FUNCTION__, channel->ChannelName().c_str()); - return false; - } - m_bIsSwitchingChannels = true; -@@ -878,6 +888,23 @@ bool CPVRClients::HasMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat) - client->HaveMenuHooks(cat)); - } - -+bool CPVRClients::GetMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, PVR_MENUHOOKS *hooks) -+{ -+ bool bReturn(false); -+ -+ if (iClientID < 0) -+ iClientID = GetPlayingClientID(); -+ -+ PVR_CLIENT client; -+ if (GetCreatedClient(iClientID, client) && client->HaveMenuHooks(cat)) -+ { -+ *hooks = *(client->GetMenuHooks()); -+ bReturn = true; -+ } -+ -+ return bReturn; -+} -+ - void CPVRClients::ProcessMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, const CFileItem *item) - { - // get client id -@@ -1375,6 +1402,14 @@ int64_t CPVRClients::SeekStream(int64_t iFilePosition, int iWhence/* = SEEK_SET* - return -EINVAL; - } - -+int64_t CPVRClients::GetStreamPosition(void) -+{ -+ PVR_CLIENT client; -+ if (GetPlayingClient(client)) -+ return client->GetStreamPosition(); -+ return -EINVAL; -+} -+ - void CPVRClients::PauseStream(bool bPaused) - { - PVR_CLIENT client; -@@ -1420,6 +1455,12 @@ bool CPVRClients::IsPlayingRecording(void) const - return m_bIsPlayingRecording; - } - -+bool CPVRClients::IsReadingLiveStream(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bIsPlayingLiveTV; -+} -+ - bool CPVRClients::IsEncrypted(void) const - { - PVR_CLIENT client; -diff --git a/xbmc/pvr/addons/PVRClients.h b/xbmc/pvr/addons/PVRClients.h -index d5ee5bc..8e9e07f 100644 ---- a/xbmc/pvr/addons/PVRClients.h -+++ b/xbmc/pvr/addons/PVRClients.h -@@ -70,6 +70,13 @@ namespace PVR - virtual ~CPVRClients(void); - - /*! -+ * @brief Checks whether an add-on is loaded by the pvr manager -+ * @param strAddonId The add-on id to check -+ * @return True when in use, false otherwise -+ */ -+ bool IsInUse(const std::string& strAddonId) const; -+ -+ /*! - * @brief Start the backend. - */ - void Start(void); -@@ -223,6 +230,12 @@ namespace PVR - int64_t SeekStream(int64_t iFilePosition, int iWhence = SEEK_SET); - - /*! -+ * @brief Get the currently playing position in a stream. -+ * @return The current position. -+ */ -+ int64_t GetStreamPosition(void); -+ -+ /*! - * @brief Close a PVR stream. - */ - void CloseStream(void); -@@ -249,6 +262,11 @@ namespace PVR - std::string GetCurrentInputFormat(void) const; - - /*! -+ * @return True if a live stream is playing, false otherwise. -+ */ -+ bool IsReadingLiveStream(void) const; -+ -+ /*! - * @return True if a TV channel is playing, false otherwise. - */ - bool IsPlayingTV(void) const; -@@ -677,6 +695,14 @@ namespace PVR - void UpdateAddons(void); - - /*! -+ * @brief Get the menu hooks for a client. -+ * @param iClientID The client to get the hooks for. -+ * @param hooks The container to add the hooks to. -+ * @return True if the hooks were added successfully (if any), false otherwise. -+ */ -+ bool GetMenuHooks(int iClientID, PVR_MENUHOOK_CAT cat, PVR_MENUHOOKS *hooks); -+ -+ /*! - * @brief Get the instance of the client. - * @param iClientId The id of the client to get. - * @param addon The client. -diff --git a/xbmc/pvr/channels/PVRChannel.cpp b/xbmc/pvr/channels/PVRChannel.cpp -index 136b02e..6994260 100644 ---- a/xbmc/pvr/channels/PVRChannel.cpp -+++ b/xbmc/pvr/channels/PVRChannel.cpp -@@ -545,7 +545,7 @@ int CPVRChannel::GetEPG(CFileItemList &results) const - CEpgPtr epg = GetEPG(); - if (!epg) - { -- CLog::Log(LOGDEBUG, "PVR - %s - cannot get EPG for channel '%s'", -+ CLog::Log(LOGPVR, "PVR - %s - cannot get EPG for channel '%s'", - __FUNCTION__, m_strChannelName.c_str()); - return -1; - } -@@ -675,6 +675,11 @@ bool CPVRChannel::IsSubChannel(void) const - return SubChannelNumber() > 0; - } - -+bool CPVRChannel::IsClientSubChannel(void) const -+{ -+ return ClientSubChannelNumber() > 0; -+} -+ - std::string CPVRChannel::FormattedChannelNumber(void) const - { - return !IsSubChannel() ? -diff --git a/xbmc/pvr/channels/PVRChannel.h b/xbmc/pvr/channels/PVRChannel.h -index 54e5a7f..adc3f18 100644 ---- a/xbmc/pvr/channels/PVRChannel.h -+++ b/xbmc/pvr/channels/PVRChannel.h -@@ -149,6 +149,11 @@ namespace PVR - */ - std::string FormattedChannelNumber(void) const; - -+ /** -+ * @return True when this channel is marked as sub channel by the add-on, false if it's marked as main channel -+ */ -+ bool IsClientSubChannel(void) const; -+ - /*! - * @brief Set to true to hide this channel. Set to false to unhide it. - * -@@ -359,6 +364,7 @@ namespace PVR - */ - bool IsEncrypted(void) const; - -+ - /*! - * @brief Return the encryption system ID for this channel. 0 for FTA. - * -diff --git a/xbmc/pvr/channels/PVRChannelGroup.cpp b/xbmc/pvr/channels/PVRChannelGroup.cpp -index c1201fb..73fabd2 100644 ---- a/xbmc/pvr/channels/PVRChannelGroup.cpp -+++ b/xbmc/pvr/channels/PVRChannelGroup.cpp -@@ -18,7 +18,10 @@ - * - */ - --//! @todo use Observable here, so we can use event driven operations later -+/** -+ * TODO: -+ * - use Observable here, so we can use event driven operations later -+ */ - - #include "PVRChannelGroup.h" - #include "PVRChannelGroupsContainer.h" -@@ -136,6 +139,11 @@ bool CPVRChannelGroup::operator!=(const CPVRChannelGroup &right) const - - PVRChannelGroupMember CPVRChannelGroup::EmptyMember = { CPVRChannelPtr(), 0, 0 }; - -+std::pair<int, int> CPVRChannelGroup::PathIdToStorageId(uint64_t storageId) -+{ -+ return std::make_pair(storageId >> 32, storageId & 0xFFFFFFFF); -+} -+ - void CPVRChannelGroup::OnInit(void) - { - CSettings::GetInstance().RegisterCallback(this, { -@@ -153,7 +161,7 @@ bool CPVRChannelGroup::Load(void) - m_bUsingBackendChannelNumbers = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRMANAGER_USEBACKENDCHANNELNUMBERS); - - int iChannelCount = m_iGroupId > 0 ? LoadFromDb() : 0; -- CLog::Log(LOGDEBUG, "PVRChannelGroup - %s - %d channels loaded from the database for group '%s'", -+ CLog::Log(LOGPVR, "PVRChannelGroup - %s - %d channels loaded from the database for group '%s'", - __FUNCTION__, iChannelCount, m_strGroupName.c_str()); - - if (!Update()) -@@ -164,7 +172,7 @@ bool CPVRChannelGroup::Load(void) - - if (Size() - iChannelCount > 0) - { -- CLog::Log(LOGDEBUG, "PVRChannelGroup - %s - %d channels added from clients to group '%s'", -+ CLog::Log(LOGPVR, "PVRChannelGroup - %s - %d channels added from clients to group '%s'", - __FUNCTION__, static_cast<int>(Size() - iChannelCount), m_strGroupName.c_str()); - } - -@@ -333,7 +341,7 @@ void CPVRChannelGroup::SearchAndSetChannelIcons(bool bUpdateDb /* = false */) - if (bUpdateDb) - channel->Persist(); - -- //! @todo start channel icon scraper here if nothing was found -+ /* TODO: start channel icon scraper here if nothing was found */ - } - - if (dlgProgressHandle) -@@ -730,6 +738,51 @@ bool CPVRChannelGroup::UpdateGroupEntries(const CPVRChannelGroup &channels) - return bReturn; - } - -+void CPVRChannelGroup::RemoveInvalidChannels(void) -+{ -+ CPVRChannelPtr channel; -+ CSingleLock lock(m_critSection); -+ for (PVR_CHANNEL_GROUP_SORTED_MEMBERS::iterator it = m_sortedMembers.begin(); it != m_sortedMembers.end();) -+ { -+ bool bDelete = false; -+ channel = (*it).channel; -+ -+ if (channel->ClientChannelNumber() <= 0) -+ { -+ CLog::Log(LOGERROR, "PVRChannelGroup - %s - removing invalid channel '%s' from client '%i': no valid client channel number", -+ __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); -+ bDelete = true; -+ } -+ -+ if (!bDelete && channel->UniqueID() <= 0) -+ { -+ CLog::Log(LOGERROR, "PVRChannelGroup - %s - removing invalid channel '%s' from client '%i': no valid unique ID", -+ __FUNCTION__, channel->ChannelName().c_str(), channel->ClientID()); -+ bDelete = true; -+ } -+ -+ /* remove this channel from all non-system groups if this is the internal group */ -+ if (bDelete) -+ { -+ if (IsInternalGroup()) -+ { -+ g_PVRChannelGroups->Get(m_bRadio)->RemoveFromAllGroups(channel); -+ channel->Delete(); -+ } -+ else -+ { -+ m_members.erase(channel->StorageId()); -+ it = m_sortedMembers.erase(it); -+ } -+ m_bChanged = true; -+ } -+ else -+ { -+ ++it; -+ } -+ } -+} -+ - bool CPVRChannelGroup::RemoveFromGroup(const CPVRChannelPtr &channel) - { - bool bReturn(false); -@@ -739,7 +792,7 @@ bool CPVRChannelGroup::RemoveFromGroup(const CPVRChannelPtr &channel) - { - if (*channel == *((*it).channel)) - { -- //! @todo notify observers -+ // TODO notify observers - m_members.erase((*it).channel->StorageId()); - it = m_sortedMembers.erase(it); - bReturn = true; -@@ -784,7 +837,7 @@ bool CPVRChannelGroup::AddToGroup(const CPVRChannelPtr &channel, int iChannelNum - - SortAndRenumber(); - -- //! @todo notify observers -+ // TODO notify observers - bReturn = true; - } - } -@@ -846,7 +899,7 @@ bool CPVRChannelGroup::Persist(void) - - if (CPVRDatabase *database = GetPVRDatabase()) - { -- CLog::Log(LOGDEBUG, "CPVRChannelGroup - %s - persisting channel group '%s' with %d channels", -+ CLog::Log(LOGPVR, "CPVRChannelGroup - %s - persisting channel group '%s' with %d channels", - __FUNCTION__, GroupName().c_str(), (int) m_members.size()); - m_bChanged = false; - lock.Leave(); -@@ -957,7 +1010,7 @@ void CPVRChannelGroup::OnSettingChanged(const CSetting *setting) - if (setting == NULL) - return; - -- //! @todo while pvr manager is starting up do accept setting changes. -+ /* TODO: while pvr manager is starting up do accept setting changes. */ - if(!g_PVRManager.IsStarted()) - { - CLog::Log(LOGWARNING, "CPVRChannelGroup setting change ignored while PVRManager is starting\n"); -@@ -980,7 +1033,7 @@ void CPVRChannelGroup::OnSettingChanged(const CSetting *setting) - /* check whether this channel group has to be renumbered */ - if (bChannelOrderChanged || bChannelNumbersChanged) - { -- CLog::Log(LOGDEBUG, "CPVRChannelGroup - %s - renumbering group '%s' to use the backend channel order and/or numbers", -+ CLog::Log(LOGPVR, "CPVRChannelGroup - %s - renumbering group '%s' to use the backend channel order and/or numbers", - __FUNCTION__, m_strGroupName.c_str()); - SortAndRenumber(); - Persist(); -@@ -993,6 +1046,28 @@ bool CPVRPersistGroupJob::DoWork(void) - return m_group->Persist(); - } - -+int CPVRChannelGroup::GetEPGSearch(CFileItemList &results, const EpgSearchFilter &filter) -+{ -+ int iInitialSize = results.Size(); -+ -+ /* get filtered results from all tables */ -+ g_EpgContainer.GetEPGSearch(results, filter); -+ -+ /* remove duplicate entries */ -+ if (filter.m_bPreventRepeats) -+ EpgSearchFilter::RemoveDuplicates(results); -+ -+ /* filter recordings */ -+ if (filter.m_bIgnorePresentRecordings) -+ EpgSearchFilter::FilterRecordings(results); -+ -+ /* filter timers */ -+ if (filter.m_bIgnorePresentTimers) -+ EpgSearchFilter::FilterTimers(results); -+ -+ return results.Size() - iInitialSize; -+} -+ - int CPVRChannelGroup::GetEPGNowOrNext(CFileItemList &results, bool bGetNext) const - { - int iInitialSize = results.Size(); -@@ -1182,7 +1257,7 @@ bool CPVRChannelGroup::UpdateChannel(const CFileItem &item, bool bHidden, bool b - if (iEPGSource == 0) - member.channel->SetEPGScraper("client"); - -- //! @todo add other scrapers -+ // TODO add other scrapers - member.channel->SetEPGEnabled(bEPGEnabled); - - /* set new values in the channel tag */ -@@ -1211,12 +1286,36 @@ bool CPVRChannelGroup::HasChannels() const - return !m_members.empty(); - } - -+bool CPVRChannelGroup::ToggleChannelLocked(const CFileItem &item) -+{ -+ if (!item.HasPVRChannelInfoTag()) -+ return false; -+ -+ CSingleLock lock(m_critSection); -+ -+ /* get the real channel from the group */ -+ const PVRChannelGroupMember& member(GetByUniqueID(item.GetPVRChannelInfoTag()->StorageId())); -+ if (member.channel) -+ { -+ member.channel->SetLocked(!member.channel->IsLocked()); -+ return true; -+ } -+ -+ return false; -+} -+ - void CPVRChannelGroup::SetSelectedGroup(bool bSetTo) - { - CSingleLock lock(m_critSection); - m_bSelectedGroup = bSetTo; - } - -+bool CPVRChannelGroup::IsSelectedGroup(void) const -+{ -+ CSingleLock lock(m_critSection); -+ return m_bSelectedGroup; -+} -+ - bool CPVRChannelGroup::CreateChannelEpgs(bool bForce /* = false */) - { - /* used only by internal channel groups */ -diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h -index dd2ede5..30594bc 100644 ---- a/xbmc/pvr/channels/PVRChannelGroup.h -+++ b/xbmc/pvr/channels/PVRChannelGroup.h -@@ -25,7 +25,6 @@ - - #include <memory> - #include <utility> --#include <vector> - - class CDateTime; - class CFileItem; -@@ -110,6 +109,13 @@ namespace PVR - static PVRChannelGroupMember EmptyMember; - - /*! -+ * Translate an id used in the path to a client id + unique channel id pair -+ * @param pathId Id in the path to translate -+ * @return The requested pair -+ */ -+ static std::pair<int, int> PathIdToStorageId(uint64_t pathId); -+ -+ /*! - * @return The amount of group members - */ - size_t Size(void) const; -@@ -379,6 +385,14 @@ namespace PVR - void OnJobComplete(unsigned int jobID, bool success, CJob* job) override {} - - /*! -+ * @brief Get all EPG tables and apply a filter. -+ * @param results The fileitem list to store the results in. -+ * @param filter The filter to apply. -+ * @return The amount of entries that were added. -+ */ -+ int GetEPGSearch(CFileItemList &results, const EPG::EpgSearchFilter &filter); -+ -+ /*! - * @brief Get all EPG tables. - * @param results The fileitem list to store the results in. - * @param bIncludeChannelsWithoutEPG, for channels without EPG data, put an empty EPG tag associated with the channel into results -@@ -414,6 +428,8 @@ namespace PVR - - bool UpdateChannel(const CFileItem &channel, bool bHidden, bool bEPGEnabled, bool bParentalLocked, int iEPGSource, int iChannelNumber, const std::string &strChannelName, const std::string &strIconPath, const std::string &strStreamURL, bool bUserSetIcon = false); - -+ bool ToggleChannelLocked(const CFileItem &channel); -+ - /*! - * @brief Get a channel given the channel number on the client. - * @param iUniqueChannelId The unique channel id on the client. -@@ -424,6 +440,7 @@ namespace PVR - const PVRChannelGroupMember& GetByUniqueID(const std::pair<int, int>& id) const; - - void SetSelectedGroup(bool bSetTo); -+ bool IsSelectedGroup(void) const; - - void SetHidden(bool bHidden); - bool IsHidden(void) const; -@@ -467,6 +484,11 @@ namespace PVR - virtual bool CreateChannelEpgs(bool bForce = false); - - /*! -+ * @brief Remove invalid channels from this container. -+ */ -+ void RemoveInvalidChannels(void); -+ -+ /*! - * @brief Load the channels from the database. - * @return True when loaded successfully, false otherwise. - */ -diff --git a/xbmc/pvr/channels/PVRChannelGroups.cpp b/xbmc/pvr/channels/PVRChannelGroups.cpp -index 06e23a2..ceeac57 100644 ---- a/xbmc/pvr/channels/PVRChannelGroups.cpp -+++ b/xbmc/pvr/channels/PVRChannelGroups.cpp -@@ -231,6 +231,42 @@ bool CPVRChannelGroups::Update(bool bChannelsOnly /* = false */) - return PersistAll() && bReturn; - } - -+bool CPVRChannelGroups::UpdateGroupsEntries(const CPVRChannelGroups &groups) -+{ -+ CSingleLock lock(m_critSection); -+ -+ // go through groups list and check for deleted groups -+ for (int iGroupPtr = m_groups.size() - 1; iGroupPtr > 0; iGroupPtr--) -+ { -+ CPVRChannelGroup existingGroup(*m_groups.at(iGroupPtr)); -+ CPVRChannelGroupPtr group = groups.GetByName(existingGroup.GroupName()); -+ // user defined group wasn't found -+ if (existingGroup.GroupType() == PVR_GROUP_TYPE_DEFAULT && !group) -+ { -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - user defined group %s with id '%u' does not exist on the client anymore; deleting it", __FUNCTION__, existingGroup.GroupName().c_str(), existingGroup.GroupID()); -+ DeleteGroup(*m_groups.at(iGroupPtr)); -+ } -+ } -+ -+ // go through the groups list and check for new groups -+ for (std::vector<CPVRChannelGroupPtr>::const_iterator it = groups.m_groups.begin(); it != groups.m_groups.end(); ++it) -+ { -+ // check if this group is present in this container -+ CPVRChannelGroupPtr existingGroup = GetByName((*it)->GroupName()); -+ -+ // add it if not -+ if (!existingGroup) -+ { -+ CPVRChannelGroupPtr newGroup(CPVRChannelGroupPtr(new CPVRChannelGroup())); -+ newGroup->SetRadio(m_bRadio); -+ newGroup->SetGroupName((*it)->GroupName()); -+ m_groups.push_back(newGroup); -+ } -+ } -+ -+ return true; -+} -+ - bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void) - { - bool bSyncWithBackends = CSettings::GetInstance().GetBool(CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS); -@@ -242,10 +278,10 @@ bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void) - if (bSyncWithBackends) - { - GetGroupsFromClients(); -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - %" PRIuS" new user defined %s channel groups fetched from clients", __FUNCTION__, (m_groups.size() - iSize), m_bRadio ? "radio" : "TV"); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - %" PRIuS" new user defined %s channel groups fetched from clients", __FUNCTION__, (m_groups.size() - iSize), m_bRadio ? "radio" : "TV"); - } - else -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - 'synchannelgroups' is disabled; skipping groups from clients", __FUNCTION__); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - 'synchannelgroups' is disabled; skipping groups from clients", __FUNCTION__); - - std::vector<CPVRChannelGroupPtr> emptyGroups; - -@@ -257,7 +293,7 @@ bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void) - { - if (!(*it)->Load()) - { -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - failed to load channel group '%s'", __FUNCTION__, (*it)->GroupName().c_str()); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - failed to load channel group '%s'", __FUNCTION__, (*it)->GroupName().c_str()); - return false; - } - -@@ -269,7 +305,7 @@ bool CPVRChannelGroups::LoadUserDefinedChannelGroups(void) - - for (std::vector<CPVRChannelGroupPtr>::iterator it = emptyGroups.begin(); it != emptyGroups.end(); ++it) - { -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - deleting empty group '%s'", __FUNCTION__, (*it)->GroupName().c_str()); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - deleting empty group '%s'", __FUNCTION__, (*it)->GroupName().c_str()); - DeleteGroup(*(*it)); - } - -@@ -288,7 +324,7 @@ bool CPVRChannelGroups::Load(void) - // remove previous contents - Clear(); - -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - loading all %s channel groups", __FUNCTION__, m_bRadio ? "radio" : "TV"); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - loading all %s channel groups", __FUNCTION__, m_bRadio ? "radio" : "TV"); - - // create the internal channel group - CPVRChannelGroupPtr internalGroup = CPVRChannelGroupPtr(new CPVRChannelGroupInternal(m_bRadio)); -@@ -296,7 +332,7 @@ bool CPVRChannelGroups::Load(void) - - // load groups from the database - database->Get(*this); -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - %" PRIuS" %s groups fetched from the database", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - %" PRIuS" %s groups fetched from the database", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); - - // load channels of internal group - if (!internalGroup->Load()) -@@ -316,7 +352,7 @@ bool CPVRChannelGroups::Load(void) - CPVRChannelGroupPtr lastPlayedGroup = GetLastPlayedGroup(); - SetSelectedGroup(lastPlayedGroup ? lastPlayedGroup : internalGroup); - -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - %" PRIuS" %s channel groups loaded", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - %" PRIuS" %s channel groups loaded", __FUNCTION__, m_groups.size(), m_bRadio ? "radio" : "TV"); - - // need at least 1 group - return m_groups.size() > 0; -@@ -325,7 +361,7 @@ bool CPVRChannelGroups::Load(void) - bool CPVRChannelGroups::PersistAll(void) - { - bool bReturn(true); -- CLog::Log(LOGDEBUG, "CPVRChannelGroups - %s - persisting all changes in channel groups", __FUNCTION__); -+ CLog::Log(LOGPVR, "CPVRChannelGroups - %s - persisting all changes in channel groups", __FUNCTION__); - - CSingleLock lock(m_critSection); - for (std::vector<CPVRChannelGroupPtr>::iterator it = m_groups.begin(); it != m_groups.end(); ++it) -diff --git a/xbmc/pvr/channels/PVRChannelGroups.h b/xbmc/pvr/channels/PVRChannelGroups.h -index ca9567c..de20b7a 100644 ---- a/xbmc/pvr/channels/PVRChannelGroups.h -+++ b/xbmc/pvr/channels/PVRChannelGroups.h -@@ -214,6 +214,7 @@ namespace PVR - bool Update(bool bChannelsOnly = false); - - private: -+ bool UpdateGroupsEntries(const CPVRChannelGroups &groups); - bool LoadUserDefinedChannelGroups(void); - bool GetGroupsFromClients(void); - void SortGroups(void); -diff --git a/xbmc/pvr/channels/PVRChannelGroupsContainer.cpp b/xbmc/pvr/channels/PVRChannelGroupsContainer.cpp -index 6b87392..36b17a8 100644 ---- a/xbmc/pvr/channels/PVRChannelGroupsContainer.cpp -+++ b/xbmc/pvr/channels/PVRChannelGroupsContainer.cpp -@@ -54,7 +54,7 @@ bool CPVRChannelGroupsContainer::Update(bool bChannelsOnly /* = false */) - m_bUpdateChannelsOnly = bChannelsOnly; - lock.Leave(); - -- CLog::Log(LOGDEBUG, "CPVRChannelGroupsContainer - %s - updating %s", __FUNCTION__, bChannelsOnly ? "channels" : "channel groups"); -+ CLog::Log(LOGPVR, "CPVRChannelGroupsContainer - %s - updating %s", __FUNCTION__, bChannelsOnly ? "channels" : "channel groups"); - bool bReturn = m_groupsRadio->Update(bChannelsOnly) && - m_groupsTV->Update(bChannelsOnly); - -@@ -203,6 +203,11 @@ bool CPVRChannelGroupsContainer::GetDirectory(const std::string& strPath, CFileI - return false; - } - -+int CPVRChannelGroupsContainer::GetNumChannelsFromAll() const -+{ -+ return GetGroupAllTV()->Size() + GetGroupAllRadio()->Size(); -+} -+ - CPVRChannelGroupPtr CPVRChannelGroupsContainer::GetSelectedGroup(bool bRadio) const - { - return Get(bRadio)->GetSelectedGroup(); -diff --git a/xbmc/pvr/channels/PVRChannelGroupsContainer.h b/xbmc/pvr/channels/PVRChannelGroupsContainer.h -index e155ad4..1c497c2 100644 ---- a/xbmc/pvr/channels/PVRChannelGroupsContainer.h -+++ b/xbmc/pvr/channels/PVRChannelGroupsContainer.h -@@ -141,6 +141,12 @@ namespace PVR - bool GetDirectory(const std::string& strPath, CFileItemList &results) const; - - /*! -+ * @brief The total amount of unique channels in all containers. -+ * @return The total amount of unique channels in all containers. -+ */ -+ int GetNumChannelsFromAll(void) const; -+ -+ /*! - * @brief Get the group that is currently selected in the UI. - * @param bRadio True to get the selected radio group, false to get the selected TV group. - * @return The selected group. -diff --git a/xbmc/pvr/channels/PVRRadioRDSInfoTag.cpp b/xbmc/pvr/channels/PVRRadioRDSInfoTag.cpp -index d810ff4..c5abf89 100644 ---- a/xbmc/pvr/channels/PVRRadioRDSInfoTag.cpp -+++ b/xbmc/pvr/channels/PVRRadioRDSInfoTag.cpp -@@ -221,6 +221,11 @@ void CPVRRadioRDSInfoTag::SetSpeechActive(bool active) - m_RDS_SpeechActive = active; - } - -+bool CPVRRadioRDSInfoTag::IsSpeechActive() -+{ -+ return m_RDS_SpeechActive; -+} -+ - void CPVRRadioRDSInfoTag::SetLanguage(const std::string& strLanguage) - { - m_strLanguage = Trim(strLanguage); -@@ -347,6 +352,16 @@ void CPVRRadioRDSInfoTag::SetInfoNews(const std::string& strNews) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoNews() -+{ -+ m_strInfoNews.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoNewsDeque() const -+{ -+ return m_strInfoNews; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoNews() const - { - std::string retStr = ""; -@@ -381,6 +396,16 @@ void CPVRRadioRDSInfoTag::SetInfoNewsLocal(const std::string& strNews) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoNewsLocal() -+{ -+ m_strInfoNewsLocal.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoNewsLocalDeque() const -+{ -+ return m_strInfoNewsLocal; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoNewsLocal() const - { - std::string retStr = ""; -@@ -415,6 +440,16 @@ void CPVRRadioRDSInfoTag::SetInfoSport(const std::string& strSport) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoSport() -+{ -+ m_strInfoSport.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoSportDeque() const -+{ -+ return m_strInfoSport; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoSport() const - { - std::string retStr = ""; -@@ -449,6 +484,16 @@ void CPVRRadioRDSInfoTag::SetInfoStock(const std::string& strStock) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoStock() -+{ -+ m_strInfoStock.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoStockDeque() const -+{ -+ return m_strInfoStock; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoStock() const - { - std::string retStr = ""; -@@ -482,6 +527,16 @@ void CPVRRadioRDSInfoTag::SetInfoWeather(const std::string& strWeather) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoWeather() -+{ -+ m_strInfoWeather.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoWeatherDeque() const -+{ -+ return m_strInfoWeather; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoWeather() const - { - std::string retStr = ""; -@@ -515,6 +570,16 @@ void CPVRRadioRDSInfoTag::SetInfoLottery(const std::string& strLottery) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoLottery() -+{ -+ m_strInfoLottery.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoLotteryDeque() const -+{ -+ return m_strInfoLottery; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoLottery() const - { - std::string retStr = ""; -@@ -548,6 +613,16 @@ void CPVRRadioRDSInfoTag::SetEditorialStaff(const std::string& strEditorialStaff - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearEditorialStaff() -+{ -+ m_strEditorialStaff.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetEditorialStaffDeque() const -+{ -+ return m_strEditorialStaff; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetEditorialStaff() const - { - std::string retStr = ""; -@@ -581,6 +656,16 @@ void CPVRRadioRDSInfoTag::SetInfoHoroscope(const std::string& strHoroscope) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoHoroscope() -+{ -+ m_strInfoHoroscope.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoHoroscopeDeque() const -+{ -+ return m_strInfoHoroscope; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoHoroscope() const - { - std::string retStr = ""; -@@ -614,6 +699,16 @@ void CPVRRadioRDSInfoTag::SetInfoCinema(const std::string& strCinema) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoCinema() -+{ -+ m_strInfoCinema.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoCinemaDeque() const -+{ -+ return m_strInfoCinema; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoCinema() const - { - std::string retStr = ""; -@@ -647,6 +742,16 @@ void CPVRRadioRDSInfoTag::SetInfoOther(const std::string& strOther) - g_windowManager.SendThreadMessage(msg); - } - -+void CPVRRadioRDSInfoTag::ClearInfoOther() -+{ -+ m_strInfoOther.clear(); -+} -+ -+const std::deque<std::string>& CPVRRadioRDSInfoTag::GetInfoOtherDeque() const -+{ -+ return m_strInfoOther; -+} -+ - const std::string CPVRRadioRDSInfoTag::GetInfoOther() const - { - std::string retStr = ""; -diff --git a/xbmc/pvr/channels/PVRRadioRDSInfoTag.h b/xbmc/pvr/channels/PVRRadioRDSInfoTag.h -index 17bffda..be45546 100644 ---- a/xbmc/pvr/channels/PVRRadioRDSInfoTag.h -+++ b/xbmc/pvr/channels/PVRRadioRDSInfoTag.h -@@ -76,6 +76,7 @@ public: - - /**! Basic RDS related information */ - void SetSpeechActive(bool active); -+ bool IsSpeechActive(); - void SetLanguage(const std::string& strLanguage); - const std::string& GetLanguage() const; - void SetCountry(const std::string& strCountry); -@@ -125,34 +126,54 @@ public: - const std::string& GetSMSStudio() const; - - void SetInfoNews(const std::string& strNews); -+ void ClearInfoNews(); - const std::string GetInfoNews() const; -+ const std::deque<std::string>& GetInfoNewsDeque() const; - - void SetInfoNewsLocal(const std::string& strNews); -+ void ClearInfoNewsLocal(); - const std::string GetInfoNewsLocal() const; -+ const std::deque<std::string>& GetInfoNewsLocalDeque() const; - - void SetInfoSport(const std::string& strSport); -+ void ClearInfoSport(); - const std::string GetInfoSport() const; -+ const std::deque<std::string>& GetInfoSportDeque() const; - - void SetInfoStock(const std::string& strSport); -+ void ClearInfoStock(); - const std::string GetInfoStock() const; -+ const std::deque<std::string>& GetInfoStockDeque() const; - - void SetInfoWeather(const std::string& strWeather); -+ void ClearInfoWeather(); - const std::string GetInfoWeather() const; -+ const std::deque<std::string>& GetInfoWeatherDeque() const; - - void SetInfoHoroscope(const std::string& strHoroscope); -+ void ClearInfoHoroscope(); - const std::string GetInfoHoroscope() const; -+ const std::deque<std::string>& GetInfoHoroscopeDeque() const; - - void SetInfoCinema(const std::string& strCinema); -+ void ClearInfoCinema(); - const std::string GetInfoCinema() const; -+ const std::deque<std::string>& GetInfoCinemaDeque() const; - - void SetInfoLottery(const std::string& strLottery); -+ void ClearInfoLottery(); - const std::string GetInfoLottery() const; -+ const std::deque<std::string>& GetInfoLotteryDeque() const; - - void SetInfoOther(const std::string& strOther); -+ void ClearInfoOther(); - const std::string GetInfoOther() const; -+ const std::deque<std::string>& GetInfoOtherDeque() const; - - void SetEditorialStaff(const std::string& strEditorialStaff); -+ void ClearEditorialStaff(); - const std::string GetEditorialStaff() const; -+ const std::deque<std::string>& GetEditorialStaffDeque() const; - - void SetRadioStyle(const std::string& style) { m_strRadioStyle = style; } - const std::string GetRadioStyle() const { return m_strRadioStyle; } -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp -index eb69c41..9b8b470 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp -+++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.cpp -@@ -409,7 +409,7 @@ bool CGUIDialogPVRChannelManager::OnClickButtonUseEPG(CGUIMessage &message) - - bool CGUIDialogPVRChannelManager::OnClickEPGSourceSpin(CGUIMessage &message) - { -- //! @todo Add EPG scraper support -+ // TODO: Add EPG scraper support - return true; - // CGUISpinControlEx *pSpin = (CGUISpinControlEx *)GetControl(SPIN_EPGSOURCE_SELECTION); - // if (pSpin) -@@ -694,7 +694,7 @@ void CGUIDialogPVRChannelManager::Update() - { - std::vector< std::pair<std::string, int> > labels; - labels.push_back(std::make_pair(g_localizeStrings.Get(19210), 0)); -- //! @todo Add Labels for EPG scrapers here -+ /// TODO: Add Labels for EPG scrapers here - SET_CONTROL_LABELS(SPIN_EPGSOURCE_SELECTION, 0, &labels); - } - -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h -index c84246f..9b9584b 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h -+++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelManager.h -@@ -19,8 +19,6 @@ - * - */ - --#include <vector> -- - #include "dialogs/GUIDialogContextMenu.h" - #include "guilib/GUIDialog.h" - #include "view/GUIViewControl.h" -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp b/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp -index 30f7a73..533dfa8 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp -+++ b/xbmc/pvr/dialogs/GUIDialogPVRGroupManager.cpp -@@ -74,7 +74,7 @@ bool CGUIDialogPVRGroupManager::PersistChanges(void) - - bool CGUIDialogPVRGroupManager::CancelChanges(void) - { -- //! @todo -+ // TODO - return false; - } - -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h -index 2cfbfe4..e44ee8a 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h -+++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h -@@ -37,15 +37,15 @@ namespace PVR - public: - CGUIDialogPVRGuideInfo(void); - virtual ~CGUIDialogPVRGuideInfo(void); -- virtual bool OnMessage(CGUIMessage& message) override; -+ virtual bool OnMessage(CGUIMessage& message); - virtual bool OnInfo(int actionID) override; -- virtual bool HasListItems() const override { return true; }; -- virtual CFileItemPtr GetCurrentListItem(int offset = 0) override; -+ virtual bool HasListItems() const { return true; }; -+ virtual CFileItemPtr GetCurrentListItem(int offset = 0); - - void SetProgInfo(const EPG::CEpgInfoTagPtr &tag); - - protected: -- virtual void OnInitWindow() override; -+ virtual void OnInitWindow(); - - bool ActionStartTimer(const EPG::CEpgInfoTagPtr &tag); - bool ActionCancelTimer(const CFileItemPtr &timer); -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.cpp b/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.cpp -index ade193f..c83d8c1 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.cpp -+++ b/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.cpp -@@ -415,6 +415,11 @@ void CGUIDialogPVRRadioRDSInfo::OnDeinitWindow(int nextWindowID) - CGUIDialog::OnDeinitWindow(nextWindowID); - } - -+void CGUIDialogPVRRadioRDSInfo::SetRadioRDS(const CFileItem *item) -+{ -+ *m_rdsItem = *item; -+} -+ - CFileItemPtr CGUIDialogPVRRadioRDSInfo::GetCurrentListItem(int offset) - { - return m_rdsItem; -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.h b/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.h -index 68a8e84..e451f55 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.h -+++ b/xbmc/pvr/dialogs/GUIDialogPVRRadioRDSInfo.h -@@ -32,6 +32,8 @@ namespace PVR - virtual bool HasListItems() const { return true; }; - virtual CFileItemPtr GetCurrentListItem(int offset = 0); - -+ void SetRadioRDS(const CFileItem *item); -+ - protected: - virtual void OnInitWindow(); - virtual void OnDeinitWindow(int nextWindowID); -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRRecordingInfo.h b/xbmc/pvr/dialogs/GUIDialogPVRRecordingInfo.h -index 076cdaf..d6a8022 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRRecordingInfo.h -+++ b/xbmc/pvr/dialogs/GUIDialogPVRRecordingInfo.h -@@ -28,10 +28,10 @@ namespace PVR - public: - CGUIDialogPVRRecordingInfo(void); - virtual ~CGUIDialogPVRRecordingInfo(void) {} -- virtual bool OnMessage(CGUIMessage& message) override; -+ virtual bool OnMessage(CGUIMessage& message); - virtual bool OnInfo(int actionID) override; -- virtual bool HasListItems() const override { return true; }; -- virtual CFileItemPtr GetCurrentListItem(int offset = 0) override; -+ virtual bool HasListItems() const { return true; }; -+ virtual CFileItemPtr GetCurrentListItem(int offset = 0); - - void SetRecording(const CFileItem *item); - -diff --git a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp -index 2e2bd3b..08132fc 100644 ---- a/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp -+++ b/xbmc/pvr/dialogs/GUIDialogPVRTimerSettings.cpp -@@ -601,7 +601,7 @@ void CGUIDialogPVRTimerSettings::Save() - { - if (m_endLocalTime < m_startLocalTime) // And the end clock is earlier than the start clock - { -- CLog::Log(LOGDEBUG, "CGUIDialogPVRTimerSettings::Save - End before start, adding a day."); -+ CLog::Log(LOGPVR, "CGUIDialogPVRTimerSettings::Save - End before start, adding a day."); - m_endLocalTime += CDateTimeSpan(1, 0, 0, 0); - if (m_endLocalTime < m_startLocalTime) - { -@@ -611,7 +611,7 @@ void CGUIDialogPVRTimerSettings::Save() - } - else if (m_endLocalTime > (m_startLocalTime + CDateTimeSpan(1, 0, 0, 0))) // Or the duration is more than a day - { -- CLog::Log(LOGDEBUG, "CGUIDialogPVRTimerSettings::Save - End > 1 day after start, removing a day."); -+ CLog::Log(LOGPVR, "CGUIDialogPVRTimerSettings::Save - End > 1 day after start, removing a day."); - m_endLocalTime -= CDateTimeSpan(1, 0, 0, 0); - if (m_endLocalTime > (m_startLocalTime + CDateTimeSpan(1, 0, 0, 0))) - { -diff --git a/xbmc/pvr/recordings/PVRRecording.cpp b/xbmc/pvr/recordings/PVRRecording.cpp -index 3de7eca..ad096ee 100644 ---- a/xbmc/pvr/recordings/PVRRecording.cpp -+++ b/xbmc/pvr/recordings/PVRRecording.cpp -@@ -36,6 +36,17 @@ - using namespace PVR; - using namespace EPG; - -+CPVRRecordingUid::CPVRRecordingUid() : -+ m_iClientId(PVR_INVALID_CLIENT_ID) -+{ -+} -+ -+CPVRRecordingUid::CPVRRecordingUid(const CPVRRecordingUid &recordingId) : -+ m_iClientId(recordingId.m_iClientId), -+ m_strRecordingId(recordingId.m_strRecordingId) -+{ -+} -+ - CPVRRecordingUid::CPVRRecordingUid(int iClientId, const std::string& strRecordingId) : - m_iClientId(iClientId), - m_strRecordingId(strRecordingId) -@@ -81,7 +92,7 @@ CPVRRecording::CPVRRecording(const PVR_RECORDING &recording, unsigned int iClien - m_strShowTitle = recording.strEpisodeName; - m_iSeason = recording.iSeriesNumber; - m_iEpisode = recording.iEpisodeNumber; -- SetYear(recording.iYear); -+ m_iYear = recording.iYear; - m_iClientId = iClientId; - m_recordingTime = recording.recordingTime + g_advancedSettings.m_iPVRTimeCorrection; - m_duration = CDateTimeSpan(0, 0, recording.iDuration / 60, recording.iDuration % 60); -@@ -152,7 +163,7 @@ bool CPVRRecording::operator ==(const CPVRRecording& right) const - m_strShowTitle == right.m_strShowTitle && - m_iSeason == right.m_iSeason && - m_iEpisode == right.m_iEpisode && -- GetPremiered() == right.GetPremiered() && -+ m_iYear == right.m_iYear && - m_strIconPath == right.m_strIconPath && - m_strThumbnailPath == right.m_strThumbnailPath && - m_strFanartPath == right.m_strFanartPath && -@@ -377,7 +388,7 @@ void CPVRRecording::Update(const CPVRRecording &tag) - m_strShowTitle = tag.m_strShowTitle; - m_iSeason = tag.m_iSeason; - m_iEpisode = tag.m_iEpisode; -- SetPremiered(tag.GetPremiered()); -+ m_iYear = tag.m_iYear; - m_recordingTime = tag.m_recordingTime; - m_duration = tag.m_duration; - m_iPriority = tag.m_iPriority; -@@ -409,7 +420,7 @@ void CPVRRecording::Update(const CPVRRecording &tag) - std::string strShow = StringUtils::Format("%s - ", g_localizeStrings.Get(20364).c_str()); - if (StringUtils::StartsWithNoCase(m_strPlotOutline, strShow)) - { -- CLog::Log(LOGDEBUG,"CPVRRecording::Update - PVR addon provides episode name in strPlotOutline which is deprecated"); -+ CLog::Log(LOGPVR,"CPVRRecording::Update - PVR addon provides episode name in strPlotOutline which is deprecated"); - std::string strEpisode = m_strPlotOutline; - std::string strTitle = m_strDirectory; - -@@ -437,7 +448,7 @@ void CPVRRecording::UpdatePath(void) - else - { - m_strFileNameAndPath = CPVRRecordingsPath( -- m_bIsDeleted, m_bRadio, m_strDirectory, m_strTitle, m_iSeason, m_iEpisode, GetYear(), m_strShowTitle, m_strChannelName, m_recordingTime, m_strRecordingId); -+ m_bIsDeleted, m_bRadio, m_strDirectory, m_strTitle, m_iSeason, m_iEpisode, m_iYear, m_strShowTitle, m_strChannelName, m_recordingTime, m_strRecordingId); - } - } - -@@ -470,3 +481,17 @@ CPVRChannelPtr CPVRRecording::Channel(void) const - - return CPVRChannelPtr(); - } -+ -+bool CPVRRecording::IsBeingRecorded(void) const -+{ -+ if (m_iEpgEventId != EPG_TAG_INVALID_UID) -+ { -+ const CPVRChannelPtr channel(Channel()); -+ if (channel) -+ { -+ const EPG::CEpgInfoTagPtr epgTag(EPG::CEpgContainer::GetInstance().GetTagById(channel, m_iEpgEventId)); -+ return epgTag ? epgTag->HasRecording() : false; -+ } -+ } -+ return false; -+} -diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h -index 9d261b6..c12c7d3 100644 ---- a/xbmc/pvr/recordings/PVRRecording.h -+++ b/xbmc/pvr/recordings/PVRRecording.h -@@ -35,10 +35,6 @@ - * - */ - --#include <string> --#include <memory> --#include <vector> -- - #include "XBDateTime.h" - #include "addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h" - #include "video/VideoInfoTag.h" -@@ -63,6 +59,8 @@ namespace PVR - int m_iClientId; /*!< ID of the backend */ - std::string m_strRecordingId; /*!< unique ID of the recording on the client */ - -+ CPVRRecordingUid(); -+ CPVRRecordingUid(const CPVRRecordingUid& recordingId); - CPVRRecordingUid(int iClientId, const std::string &strRecordingId); - - bool operator >(const CPVRRecordingUid& right) const; -@@ -183,6 +181,8 @@ namespace PVR - - const CDateTime &RecordingTimeAsUTC(void) const { return m_recordingTime; } - const CDateTime &RecordingTimeAsLocalTime(void) const; -+ void SetRecordingTimeFromUTC(CDateTime &recordingTime) { m_recordingTime = recordingTime; } -+ void SetRecordingTimeFromLocalTime(CDateTime &recordingTime) { m_recordingTime = recordingTime.GetAsUTCDateTime(); } - - /*! - * @brief Retrieve the recording title from the URL path -@@ -214,12 +214,23 @@ namespace PVR - unsigned int BroadcastUid(void) const { return m_iEpgEventId; } - - /*! -+ * @return channel id associated with this recording or PVR_CHANNEL_INVALID_UID -+ */ -+ int ChannelUid(void) const { return m_iChannelUid; } -+ -+ /*! - * @return Get the channel on which this recording is/was running - * @note Only works if the recording has a channel uid provided by the add-on - */ - CPVRChannelPtr Channel(void) const; - - /*! -+ * @return True while the recording is running -+ * @note Only works if the recording has a channel uid and an EPG id provided by the add-on -+ */ -+ bool IsBeingRecorded(void) const; -+ -+ /*! - * @brief Retrieve the recording Episode Name - * @note Returns an empty string if no Episode Name was provided by the PVR client - */ -diff --git a/xbmc/pvr/recordings/PVRRecordings.cpp b/xbmc/pvr/recordings/PVRRecordings.cpp -index 84d19d7..163dc29 100644 ---- a/xbmc/pvr/recordings/PVRRecordings.cpp -+++ b/xbmc/pvr/recordings/PVRRecordings.cpp -@@ -147,6 +147,11 @@ int CPVRRecordings::Load(void) - return m_recordings.size(); - } - -+void CPVRRecordings::Unload() -+{ -+ Clear(); -+} -+ - void CPVRRecordings::Update(void) - { - CSingleLock lock(m_critSection); -@@ -155,7 +160,7 @@ void CPVRRecordings::Update(void) - m_bIsUpdating = true; - lock.Leave(); - -- CLog::Log(LOGDEBUG, "CPVRRecordings - %s - updating recordings", __FUNCTION__); -+ CLog::Log(LOGPVR, "CPVRRecordings - %s - updating recordings", __FUNCTION__); - UpdateFromClients(); - - lock.Enter(); -@@ -260,7 +265,7 @@ bool CPVRRecordings::SetRecordingsPlayCount(const CFileItemPtr &item, int count) - { - bResult = true; - -- CLog::Log(LOGDEBUG, "CPVRRecordings - %s - item path %s", __FUNCTION__, item->GetPath().c_str()); -+ CLog::Log(LOGPVR, "CPVRRecordings - %s - item path %s", __FUNCTION__, item->GetPath().c_str()); - CFileItemList items; - if (item->m_bIsFolder) - { -@@ -269,15 +274,15 @@ bool CPVRRecordings::SetRecordingsPlayCount(const CFileItemPtr &item, int count) - else - items.Add(item); - -- CLog::Log(LOGDEBUG, "CPVRRecordings - %s - will set watched for %d items", __FUNCTION__, items.Size()); -+ CLog::Log(LOGPVR, "CPVRRecordings - %s - will set watched for %d items", __FUNCTION__, items.Size()); - for (int i=0;i<items.Size();++i) - { -- CLog::Log(LOGDEBUG, "CPVRRecordings - %s - setting watched for item %d", __FUNCTION__, i); -+ CLog::Log(LOGPVR, "CPVRRecordings - %s - setting watched for item %d", __FUNCTION__, i); - - CFileItemPtr pItem=items[i]; - if (pItem->m_bIsFolder) - { -- CLog::Log(LOGDEBUG, "CPVRRecordings - %s - path %s is a folder, will call recursively", __FUNCTION__, pItem->GetPath().c_str()); -+ CLog::Log(LOGPVR, "CPVRRecordings - %s - path %s is a folder, will call recursively", __FUNCTION__, pItem->GetPath().c_str()); - if (pItem->GetLabel() != "..") - { - SetRecordingsPlayCount(pItem, count); -diff --git a/xbmc/pvr/recordings/PVRRecordings.h b/xbmc/pvr/recordings/PVRRecordings.h -index 675dde8..d32d918 100644 ---- a/xbmc/pvr/recordings/PVRRecordings.h -+++ b/xbmc/pvr/recordings/PVRRecordings.h -@@ -65,6 +65,7 @@ namespace PVR - virtual ~CPVRRecordings(void); - - int Load(); -+ void Unload(); - void Clear(); - void UpdateFromClient(const CPVRRecordingPtr &tag); - void UpdateEpgTags(void); -@@ -97,5 +98,6 @@ namespace PVR - CFileItemPtr GetById(unsigned int iId) const; - - void SetGroupItems(bool value) { m_bGroupItems = value; }; -+ bool IsGroupItems() const { return m_bGroupItems; }; - }; - } -diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.cpp b/xbmc/pvr/timers/PVRTimerInfoTag.cpp -index 2ff44d4..8024967 100644 ---- a/xbmc/pvr/timers/PVRTimerInfoTag.cpp -+++ b/xbmc/pvr/timers/PVRTimerInfoTag.cpp -@@ -46,28 +46,29 @@ using KODI::MESSAGING::HELPERS::DialogResponse; - CPVRTimerInfoTag::CPVRTimerInfoTag(bool bRadio /* = false */) : - m_strTitle(g_localizeStrings.Get(19056)), // New Timer - m_bFullTextEpgSearch(false), -- m_state(PVR_TIMER_STATE_SCHEDULED), -- m_iClientId(g_PVRClients->GetFirstConnectedClientID()), -- m_iClientIndex(PVR_TIMER_NO_CLIENT_INDEX), -- m_iParentClientIndex(PVR_TIMER_NO_PARENT), -- m_iClientChannelUid(PVR_CHANNEL_INVALID_UID), -- m_bStartAnyTime(false), -- m_bEndAnyTime(false), -- m_iPriority(CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_DEFAULTPRIORITY)), -- m_iLifetime(CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_DEFAULTLIFETIME)), -- m_iMaxRecordings(0), -- m_iPreventDupEpisodes(CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_PREVENTDUPLICATEEPISODES)), -- m_iRecordingGroup(0), -- m_iChannelNumber(0), -- m_bIsRadio(bRadio), -- m_iTimerId(0), -- m_iMarginStart(CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_MARGINSTART)), -- m_iMarginEnd(CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_MARGINEND)), -- m_StartTime(CDateTime::GetUTCDateTime()), -- m_StopTime(m_StartTime), - m_iEpgUid(EPG_TAG_INVALID_UID) - { -+ m_iClientId = g_PVRClients->GetFirstConnectedClientID(); -+ m_iClientIndex = PVR_TIMER_NO_CLIENT_INDEX; -+ m_iParentClientIndex = PVR_TIMER_NO_PARENT; -+ m_iClientChannelUid = PVR_CHANNEL_INVALID_UID; -+ m_iPriority = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_DEFAULTPRIORITY); -+ m_iLifetime = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_DEFAULTLIFETIME); -+ m_iMaxRecordings = 0; -+ m_iPreventDupEpisodes = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_PREVENTDUPLICATEEPISODES); -+ m_iRecordingGroup = 0; -+ m_iChannelNumber = 0; -+ m_bIsRadio = bRadio; -+ m_iMarginStart = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_MARGINSTART); -+ m_iMarginEnd = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_MARGINEND); -+ m_StartTime = CDateTime::GetUTCDateTime(); -+ m_StopTime = m_StartTime; -+ m_bStartAnyTime = false; -+ m_bEndAnyTime = false; -+ m_state = PVR_TIMER_STATE_SCHEDULED; - m_FirstDay.SetValid(false); -+ m_iTimerId = 0; -+ ResetChildState(); - - if (g_PVRClients->SupportsTimers(m_iClientId)) - { -@@ -88,10 +89,6 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(bool bRadio /* = false */) : - } - - m_iWeekdays = (m_timerType && m_timerType->IsRepeating()) ? PVR_WEEKDAY_ALLDAYS : PVR_WEEKDAY_NONE; -- -- ResetChildState(); -- UpdateSummary(); -- UpdateEpgInfoTag(); - } - - CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr &channel, unsigned int iClientId) : -@@ -99,34 +96,37 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr - m_strEpgSearchString(timer.strEpgSearchString), - m_bFullTextEpgSearch(timer.bFullTextEpgSearch), - m_strDirectory(timer.strDirectory), -- m_state(timer.state), -- m_iClientId(iClientId), -- m_iClientIndex(timer.iClientIndex), -- m_iParentClientIndex(timer.iParentClientIndex), -- m_iClientChannelUid(channel ? channel->UniqueID() : (timer.iClientChannelUid > 0) ? timer.iClientChannelUid : PVR_CHANNEL_INVALID_UID), -- m_bStartAnyTime(timer.bStartAnyTime), -- m_bEndAnyTime(timer.bEndAnyTime), -- m_iPriority(timer.iPriority), -- m_iLifetime(timer.iLifetime), -- m_iMaxRecordings(timer.iMaxRecordings), -- m_iWeekdays(timer.iWeekdays), -- m_iPreventDupEpisodes(timer.iPreventDuplicateEpisodes), -- m_iRecordingGroup(timer.iRecordingGroup), -- m_strFileNameAndPath(StringUtils::Format("pvr://client%i/timers/%i", m_iClientId, m_iClientIndex)), -- m_iChannelNumber(channel ? g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->GetChannelNumber(channel) : 0), -- m_bIsRadio(channel && channel->IsRadio()), -- m_iTimerId(0), -- m_channel(channel), -- m_iMarginStart(timer.iMarginStart), -- m_iMarginEnd(timer.iMarginEnd), -- m_StartTime(timer.startTime + g_advancedSettings.m_iPVRTimeCorrection), -- m_StopTime(timer.endTime + g_advancedSettings.m_iPVRTimeCorrection), -- m_FirstDay(timer.firstDay + g_advancedSettings.m_iPVRTimeCorrection), - m_iEpgUid(timer.iEpgUid) - { -+ m_iClientId = iClientId; -+ m_iClientIndex = timer.iClientIndex; -+ - if (m_iClientIndex == PVR_TIMER_NO_CLIENT_INDEX) - CLog::Log(LOGERROR, "%s: invalid client index supplied by client %d (must be > 0)!", __FUNCTION__, m_iClientId); - -+ m_iParentClientIndex = timer.iParentClientIndex; -+ m_iClientChannelUid = channel ? channel->UniqueID() : (timer.iClientChannelUid > 0) ? timer.iClientChannelUid : PVR_CHANNEL_INVALID_UID; -+ m_iChannelNumber = channel ? g_PVRChannelGroups->GetGroupAll(channel->IsRadio())->GetChannelNumber(channel) : 0; -+ m_StartTime = timer.startTime + g_advancedSettings.m_iPVRTimeCorrection; -+ m_StopTime = timer.endTime + g_advancedSettings.m_iPVRTimeCorrection; -+ m_bStartAnyTime = timer.bStartAnyTime; -+ m_bEndAnyTime = timer.bEndAnyTime; -+ m_iPreventDupEpisodes = timer.iPreventDuplicateEpisodes; -+ m_iRecordingGroup = timer.iRecordingGroup; -+ m_FirstDay = timer.firstDay + g_advancedSettings.m_iPVRTimeCorrection; -+ m_iWeekdays = timer.iWeekdays; -+ m_iPriority = timer.iPriority; -+ m_iLifetime = timer.iLifetime; -+ m_iMaxRecordings = timer.iMaxRecordings; -+ m_iMarginStart = timer.iMarginStart; -+ m_iMarginEnd = timer.iMarginEnd; -+ m_channel = channel; -+ m_bIsRadio = channel && channel->IsRadio(); -+ m_state = timer.state; -+ m_strFileNameAndPath = StringUtils::Format("pvr://client%i/timers/%i", m_iClientId, m_iClientIndex); -+ m_iTimerId = 0; -+ ResetChildState(); -+ - if (g_PVRClients->SupportsTimers(m_iClientId)) - { - // begin compat section -@@ -170,7 +170,6 @@ CPVRTimerInfoTag::CPVRTimerInfoTag(const PVR_TIMER &timer, const CPVRChannelPtr - CLog::Log(LOGERROR, "%s: no epg tag given for epg based timer type (%d)!", __FUNCTION__, m_timerType->GetTypeId()); - } - -- ResetChildState(); - UpdateSummary(); - UpdateEpgInfoTag(); - } -@@ -220,6 +219,7 @@ bool CPVRTimerInfoTag::operator ==(const CPVRTimerInfoTag& right) const - - CPVRTimerInfoTag::~CPVRTimerInfoTag(void) - { -+ ClearEpgTag(); - } - - /** -@@ -331,6 +331,22 @@ void CPVRTimerInfoTag::Serialize(CVariant &value) const - value["epguid"] = m_iEpgUid; - } - -+int CPVRTimerInfoTag::Compare(const CPVRTimerInfoTag &timer) const -+{ -+ CSingleLock lock(m_critSection); -+ int iTimerDelta = 0; -+ if (StartAsUTC() != timer.StartAsUTC()) -+ { -+ CDateTimeSpan timerDelta = StartAsUTC() - timer.StartAsUTC(); -+ iTimerDelta = (timerDelta.GetSeconds() + timerDelta.GetMinutes() * 60 + timerDelta.GetHours() * 3600 + timerDelta.GetDays() * 86400); -+ } -+ -+ /* if the start times are equal, compare the priority of the timers */ -+ return iTimerDelta == 0 ? -+ timer.m_iPriority - m_iPriority : -+ iTimerDelta; -+} -+ - void CPVRTimerInfoTag::UpdateEpgInfoTag(void) - { - CSingleLock lock(m_critSection); -@@ -721,9 +737,19 @@ std::string CPVRTimerInfoTag::ChannelIcon() const - return strReturn; - } - --static const time_t INSTANT_TIMER_START = 0; // PVR addon API: special start time value to denote an instant timer -+bool CPVRTimerInfoTag::SetDuration(int iDuration) -+{ -+ CSingleLock lock(m_critSection); -+ if (m_StartTime.IsValid()) -+ { -+ m_StopTime = m_StartTime + CDateTimeSpan(0, iDuration / 60, iDuration % 60, 0); -+ return true; -+ } -+ -+ return false; -+} - --CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateInstantTimerTag(const CPVRChannelPtr &channel, int iDuration /* = DEFAULT_PVRRECORD_INSTANTRECORDTIME */) -+CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateInstantTimerTag(const CPVRChannelPtr &channel) - { - if (!channel) - { -@@ -761,24 +787,17 @@ CPVRTimerInfoTagPtr CPVRTimerInfoTag::CreateInstantTimerTag(const CPVRChannelPtr - newTimer->SetTimerType(timerType); - } - -- /* no matter the timer was created from an epg tag, overwrite timer start and end times. */ -- CDateTime now(CDateTime::GetUTCDateTime()); -- newTimer->SetStartFromUTC(now); -- -- if (iDuration == DEFAULT_PVRRECORD_INSTANTRECORDTIME) -- iDuration = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME); -+ // no matter the timer was created from an epg tag, set special instant timer start and end times. -+ CDateTime startTime(0); -+ newTimer->SetStartFromUTC(startTime); -+ newTimer->m_iMarginStart = 0; /* set the start margin to 0 for instant timers */ - -- CDateTime endTime = now + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0); -+ int iDuration = CSettings::GetInstance().GetInt(CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME); -+ CDateTime endTime = CDateTime::GetUTCDateTime() + CDateTimeSpan(0, 0, iDuration ? iDuration : 120, 0); - newTimer->SetEndFromUTC(endTime); - -- /* update summary string according to instant recording start/end time */ -+ /* update summary string according to changed start/end time */ - newTimer->UpdateSummary(); -- newTimer->m_strSummary = StringUtils::Format(g_localizeStrings.Get(19093).c_str(), newTimer->Summary().c_str()); -- -- CDateTime startTime(INSTANT_TIMER_START); -- newTimer->SetStartFromUTC(startTime); -- newTimer->m_iMarginStart = 0; -- newTimer->m_iMarginEnd = 0; - - /* set epg tag at timer & timer at epg tag */ - newTimer->UpdateEpgInfoTag(); -@@ -978,9 +997,10 @@ CEpgInfoTagPtr CPVRTimerInfoTag::GetEpgInfoTag(bool bCreate /* = true */) const - { - // if no epg uid present, try to find a tag according to timer's start/end time - m_epgTag = epg->GetTagBetween(StartAsUTC() - CDateTimeSpan(0, 0, 2, 0), EndAsUTC() + CDateTimeSpan(0, 0, 2, 0)); -- if (m_epgTag) -- m_iEpgUid = m_epgTag->UniqueBroadcastID(); - } -+ -+ if (m_epgTag) -+ m_epgTag->SetTimer(g_PVRTimers->GetById(m_iTimerId)); - } - } - } -@@ -988,22 +1008,17 @@ CEpgInfoTagPtr CPVRTimerInfoTag::GetEpgInfoTag(bool bCreate /* = true */) const - return m_epgTag; - } - --void CPVRTimerInfoTag::SetEpgTag(const CEpgInfoTagPtr &tag) -+void CPVRTimerInfoTag::ClearEpgTag(void) - { -- CEpgInfoTagPtr previousTag; -+ CEpgInfoTagPtr deletedTag; - { - CSingleLock lock(m_critSection); -- previousTag = m_epgTag; -- m_epgTag = tag; -+ deletedTag = m_epgTag; -+ m_epgTag.reset(); - } - -- if (previousTag) -- previousTag->ClearTimer(); --} -- --void CPVRTimerInfoTag::ClearEpgTag(void) --{ -- SetEpgTag(CEpgInfoTagPtr()); -+ if (deletedTag) -+ deletedTag->ClearTimer(); - } - - CPVRChannelPtr CPVRTimerInfoTag::ChannelTag(void) const -@@ -1011,11 +1026,10 @@ CPVRChannelPtr CPVRTimerInfoTag::ChannelTag(void) const - return m_channel; - } - --CPVRChannelPtr CPVRTimerInfoTag::UpdateChannel(void) -+void CPVRTimerInfoTag::UpdateChannel(void) - { - CSingleLock lock(m_critSection); - m_channel = g_PVRChannelGroups->Get(m_bIsRadio)->GetGroupAll()->GetByUniqueID(m_iClientChannelUid, m_iClientId); -- return m_channel; - } - - const std::string& CPVRTimerInfoTag::Title(void) const -diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.h b/xbmc/pvr/timers/PVRTimerInfoTag.h -index 988f670..9c714b1 100644 ---- a/xbmc/pvr/timers/PVRTimerInfoTag.h -+++ b/xbmc/pvr/timers/PVRTimerInfoTag.h -@@ -86,6 +86,8 @@ namespace PVR - - virtual void Serialize(CVariant &value) const; - -+ int Compare(const CPVRTimerInfoTag &timer) const; -+ - void UpdateSummary(void); - - void DisplayError(PVR_ERROR err) const; -@@ -93,15 +95,14 @@ namespace PVR - std::string GetStatus() const; - std::string GetTypeAsString() const; - -- static const int DEFAULT_PVRRECORD_INSTANTRECORDTIME = -1; -+ bool SetDuration(int iDuration); - - /*! - * @brief create a tag for an instant timer for a given channel -- * @param channel is the channel the instant timer is to be created for -- * @param iDuration is the duration for the instant timer, DEFAULT_PVRRECORD_INSTANTRECORDTIME denotes system default (setting value) -+ * @parame the channel the instant timer is be created for - * @return the timer or null if timer could not be created - */ -- static CPVRTimerInfoTagPtr CreateInstantTimerTag(const CPVRChannelPtr &channel, int iDuration = DEFAULT_PVRRECORD_INSTANTRECORDTIME); -+ static CPVRTimerInfoTagPtr CreateInstantTimerTag(const CPVRChannelPtr &channel); - - /*! - * @brief create a timer or timer rule for the given epg info tag. -@@ -140,6 +141,8 @@ namespace PVR - */ - void ResetChildState(); - -+ void UpdateEpgEvent(bool bClear = false); -+ - bool IsActive(void) const - { - return m_state == PVR_TIMER_STATE_SCHEDULED -@@ -207,9 +210,14 @@ namespace PVR - - CDateTime FirstDayAsUTC(void) const; - CDateTime FirstDayAsLocalTime(void) const; -+ void SetFirstDayFromUTC(CDateTime &firstDay) { m_FirstDay = firstDay; } - void SetFirstDayFromLocalTime(CDateTime &firstDay) { m_FirstDay = firstDay.GetAsUTCDateTime(); } - - unsigned int MarginStart(void) const { return m_iMarginStart; } -+ void SetMarginStart(unsigned int iMinutes) { m_iMarginStart = iMinutes; } -+ -+ unsigned int MarginEnd(void) const { return m_iMarginEnd; } -+ void SetMarginEnd(unsigned int iMinutes) { m_iMarginEnd = iMinutes; } - - /*! - * @brief Get the text for the notification. -@@ -232,22 +240,9 @@ namespace PVR - bool RenameOnClient(const std::string &strNewName); - bool UpdateOnClient(); - -- /*! -- * @brief Associate the given epg tag with this timer; before, clear old timer at associated epg tag, if any. -- * @param tag The epg tag to assign. -- */ -- void SetEpgTag(const EPG::CEpgInfoTagPtr &tag); -- -- /*! -- * @brief Clear the epg tag associated with this timer; before, clear this timer at associated epg tag, if any. -- */ - void ClearEpgTag(void); - -- /*! -- * @brief Update the channel associated with this timer. -- * @return the channel for the timer. Can be empty for epg based repeating timers (e.g. "match any channel" rules) -- */ -- CPVRChannelPtr UpdateChannel(void); -+ void UpdateChannel(void); - - /*! - * @brief Return string representation for any possible combination of weekdays. -@@ -296,6 +291,7 @@ namespace PVR - void UpdateEpgInfoTag(void); - - CCriticalSection m_critSection; -+ unsigned int m_iEpgUid; /*!< id of epg event associated with this timer, EPG_TAG_INVALID_UID if none. */ - CDateTime m_StartTime; /*!< start time */ - CDateTime m_StopTime; /*!< stop time */ - CDateTime m_FirstDay; /*!< if it is a manual repeating timer the first date it starts */ -@@ -306,7 +302,6 @@ namespace PVR - bool m_bHasChildRecording; /*!< @brief Has at least one child timer with status PVR_TIMER_STATE_RECORDING */ - bool m_bHasChildErrors; /*!< @brief Has at least one child timer with status PVR_TIMER_STATE_ERROR */ - -- mutable unsigned int m_iEpgUid; /*!< id of epg event associated with this timer, EPG_TAG_INVALID_UID if none. */ - mutable EPG::CEpgInfoTagPtr m_epgTag; /*!< epg info tag matching m_iEpgUid. */ - }; - } -diff --git a/xbmc/pvr/timers/PVRTimers.cpp b/xbmc/pvr/timers/PVRTimers.cpp -index 8f48b52..3a38cb6 100644 ---- a/xbmc/pvr/timers/PVRTimers.cpp -+++ b/xbmc/pvr/timers/PVRTimers.cpp -@@ -84,7 +84,7 @@ bool CPVRTimers::Update(void) - m_bIsUpdating = true; - } - -- CLog::Log(LOGDEBUG, "CPVRTimers - %s - updating timers", __FUNCTION__); -+ CLog::Log(LOGPVR, "CPVRTimers - %s - updating timers", __FUNCTION__); - CPVRTimers newTimerList; - std::vector<int> failedClients; - g_PVRClients->GetTimers(&newTimerList, failedClients); -@@ -103,42 +103,6 @@ bool CPVRTimers::IsRecording(void) const - return false; - } - --bool CPVRTimers::SetEpgTagTimer(const CPVRTimerInfoTagPtr &timer) --{ -- if (timer->IsRepeating() || timer->m_bStartAnyTime || timer->m_bEndAnyTime) -- return false; -- -- std::vector<CEpgInfoTagPtr> tags(g_EpgContainer.GetEpgTagsForTimer(timer)); -- -- if (tags.empty()) -- return false; -- -- // assign first matching epg tag to the timer. -- timer->SetEpgTag(tags.front()); -- -- // assign timer to every matching epg tag. -- for (const auto &tag : tags) -- tag->SetTimer(timer); -- -- return true; --} -- --bool CPVRTimers::ClearEpgTagTimer(const CPVRTimerInfoTagPtr &timer) --{ -- if (timer->IsRepeating() || timer->m_bStartAnyTime || timer->m_bEndAnyTime) -- return false; -- -- std::vector<CEpgInfoTagPtr> tags(g_EpgContainer.GetEpgTagsForTimer(timer)); -- -- if (tags.empty()) -- return false; -- -- for (const auto &tag : tags) -- tag->ClearTimer(); -- -- return true; --} -- - bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> &failedClients) - { - bool bChanged(false); -@@ -158,11 +122,8 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - { - /* if it's present, update the current tag */ - bool bStateChanged(existingTimer->m_state != (*timerIt)->m_state); -- ClearEpgTagTimer(existingTimer); - if (existingTimer->UpdateEntry(*timerIt)) - { -- SetEpgTagTimer(existingTimer); -- - bChanged = true; - existingTimer->ResetChildState(); - -@@ -173,7 +134,7 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - timerNotifications.push_back(std::make_pair((*timerIt)->m_iClientId, strMessage)); - } - -- CLog::Log(LOGDEBUG,"PVRTimers - %s - updated timer %d on client %d", -+ CLog::Log(LOGPVR,"PVRTimers - %s - updated timer %d on client %d", - __FUNCTION__, (*timerIt)->m_iClientIndex, (*timerIt)->m_iClientId); - } - } -@@ -196,8 +157,6 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - } - - newTimer->m_iTimerId = ++m_iLastId; -- SetEpgTagTimer(newTimer); -- - addEntry->push_back(newTimer); - bChanged = true; - bAddedOrDeleted = true; -@@ -209,7 +168,7 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - timerNotifications.push_back(std::make_pair(newTimer->m_iClientId, strMessage)); - } - -- CLog::Log(LOGDEBUG,"PVRTimers - %s - added timer %d on client %d", -+ CLog::Log(LOGPVR,"PVRTimers - %s - added timer %d on client %d", - __FUNCTION__, (*timerIt)->m_iClientIndex, (*timerIt)->m_iClientId); - } - } -@@ -243,14 +202,14 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - continue; - } - -- CLog::Log(LOGDEBUG,"PVRTimers - %s - deleted timer %d on client %d", -+ CLog::Log(LOGPVR,"PVRTimers - %s - deleted timer %d on client %d", - __FUNCTION__, timer->m_iClientIndex, timer->m_iClientId); - - if (g_PVRManager.IsStarted()) - timerNotifications.push_back(std::make_pair(timer->m_iClientId, timer->GetDeletedNotificationText())); - -- ClearEpgTagTimer(timer); -- -+ /** clear the EPG tag explicitly here, because it no longer happens automatically with shared pointers */ -+ timer->ClearEpgTag(); - it2 = it->second->erase(it2); - - bChanged = true; -@@ -260,10 +219,10 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - (!timer->m_bStartAnyTime && timer->StartAsUTC() != it->first)) - { - /* timer start has changed */ -- CLog::Log(LOGDEBUG,"PVRTimers - %s - changed start time timer %d on client %d", -+ CLog::Log(LOGPVR,"PVRTimers - %s - changed start time timer %d on client %d", - __FUNCTION__, timer->m_iClientIndex, timer->m_iClientId); - -- ClearEpgTagTimer(timer); -+ timer->ClearEpgTag(); - - /* remember timer */ - timersToMove.push_back(timer); -@@ -300,8 +259,6 @@ bool CPVRTimers::UpdateEntries(const CPVRTimers &timers, const std::vector<int> - addEntry = itr->second; - } - -- SetEpgTagTimer(*timerIt); -- - addEntry->push_back(*timerIt); - } - -@@ -577,7 +534,7 @@ bool CPVRTimers::DeleteTimersOnChannel(const CPVRChannelPtr &channel, bool bDele - - if (bDeleteActiveItem && bDeleteRepeatingItem && bChannelsMatch) - { -- CLog::Log(LOGDEBUG,"PVRTimers - %s - deleted timer %d on client %d", __FUNCTION__, (*timerIt)->m_iClientIndex, (*timerIt)->m_iClientId); -+ CLog::Log(LOGPVR,"PVRTimers - %s - deleted timer %d on client %d", __FUNCTION__, (*timerIt)->m_iClientIndex, (*timerIt)->m_iClientId); - bReturn = (*timerIt)->DeleteFromClient(true) || bReturn; - SetChanged(); - } -@@ -590,6 +547,25 @@ bool CPVRTimers::DeleteTimersOnChannel(const CPVRChannelPtr &channel, bool bDele - return bReturn; - } - -+bool CPVRTimers::InstantTimer(const CPVRChannelPtr &channel) -+{ -+ assert(channel.get()); -+ -+ if (!g_PVRManager.CheckParentalLock(channel)) -+ return false; -+ -+ CPVRTimerInfoTagPtr newTimer(CPVRTimerInfoTag::CreateInstantTimerTag(channel)); -+ -+ bool bReturn(false); -+ if (newTimer) -+ bReturn = newTimer->AddToClient(); -+ -+ if (!bReturn) -+ CLog::Log(LOGERROR, "PVRTimers - %s - unable to add an instant timer on the client", __FUNCTION__); -+ -+ return bReturn; -+} -+ - /********** static methods **********/ - - bool CPVRTimers::AddTimer(const CPVRTimerInfoTagPtr &item) -diff --git a/xbmc/pvr/timers/PVRTimers.h b/xbmc/pvr/timers/PVRTimers.h -index 93874a4..a6129bd 100644 ---- a/xbmc/pvr/timers/PVRTimers.h -+++ b/xbmc/pvr/timers/PVRTimers.h -@@ -21,7 +21,6 @@ - - #include <map> - #include <memory> --#include <vector> - - #include "addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h" - #include "PVRTimerInfoTag.h" -@@ -137,6 +136,13 @@ namespace PVR - bool DeleteTimersOnChannel(const CPVRChannelPtr &channel, bool bDeleteRepeating = true, bool bCurrentlyActiveOnly = false); - - /*! -+ * @brief Create a new instant timer on a channel. -+ * @param channel The channel to create the timer on. -+ * @return True if the timer was created, false otherwise. -+ */ -+ bool InstantTimer(const CPVRChannelPtr &channel); -+ -+ /*! - * @return Next event time (timer or daily wake up) - */ - CDateTime GetNextEventTime(void) const; -@@ -210,8 +216,6 @@ namespace PVR - CPVRTimerInfoTagPtr GetByClient(int iClientId, unsigned int iClientTimerId) const; - bool GetRootDirectory(const CPVRTimersPath &path, CFileItemList &items) const; - bool GetSubDirectory(const CPVRTimersPath &path, CFileItemList &items) const; -- bool SetEpgTagTimer(const CPVRTimerInfoTagPtr &timer); -- bool ClearEpgTagTimer(const CPVRTimerInfoTagPtr &timer); - - CCriticalSection m_critSection; - bool m_bIsUpdating; -diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.cpp b/xbmc/pvr/windows/GUIWindowPVRBase.cpp -index 310aba0..9b4c435 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRBase.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRBase.cpp -@@ -22,7 +22,7 @@ - #include "GUIWindowPVRRecordings.h" - - #include "Application.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "dialogs/GUIDialogKaiToast.h" - #include "dialogs/GUIDialogNumeric.h" - #include "dialogs/GUIDialogOK.h" -@@ -94,20 +94,6 @@ void CGUIWindowPVRBase::ResetObservers(void) - RegisterObservers(); - } - --void CGUIWindowPVRBase::RegisterObservers(void) --{ -- CSingleLock lock(m_critSection); -- if (m_group) -- m_group->RegisterObserver(this); --}; -- --void CGUIWindowPVRBase::UnregisterObservers(void) --{ -- CSingleLock lock(m_critSection); -- if (m_group) -- m_group->UnregisterObserver(this); --}; -- - void CGUIWindowPVRBase::Notify(const Observable &obs, const ObservableMessage msg) - { - CGUIMessage m(GUI_MSG_REFRESH_LIST, GetID(), 0, msg); -@@ -388,7 +374,7 @@ CPVRChannelGroupPtr CGUIWindowPVRBase::GetGroup(void) - return m_group; - } - --void CGUIWindowPVRBase::SetGroup(const CPVRChannelGroupPtr &group) -+void CGUIWindowPVRBase::SetGroup(CPVRChannelGroupPtr group) - { - CSingleLock lock(m_critSection); - if (!group) -@@ -587,12 +573,8 @@ bool CGUIWindowPVRBase::EditTimer(CFileItem *item) - return false; - } - -- // clone the timer. -- const CPVRTimerInfoTagPtr newTimer(new CPVRTimerInfoTag); -- newTimer->UpdateEntry(timer); -- -- if (ShowTimerSettings(newTimer) && !timer->GetTimerType()->IsReadOnly()) -- return g_PVRTimers->UpdateTimer(newTimer); -+ if (ShowTimerSettings(timer) && !timer->GetTimerType()->IsReadOnly()) -+ return g_PVRTimers->UpdateTimer(timer); - - return false; - } -diff --git a/xbmc/pvr/windows/GUIWindowPVRBase.h b/xbmc/pvr/windows/GUIWindowPVRBase.h -index ebf1347..414367a 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRBase.h -+++ b/xbmc/pvr/windows/GUIWindowPVRBase.h -@@ -97,7 +97,7 @@ namespace PVR - - virtual std::string GetDirectoryPath(void) = 0; - virtual CPVRChannelGroupPtr GetGroup(void); -- virtual void SetGroup(const CPVRChannelGroupPtr &group); -+ virtual void SetGroup(CPVRChannelGroupPtr group); - - virtual bool ActionShowTimerRule(CFileItem *item); - virtual bool ActionToggleTimer(CFileItem *item); -@@ -119,8 +119,8 @@ namespace PVR - bool OnContextButtonEditTimerRule(CFileItem *item, CONTEXT_BUTTON button); - bool OnContextButtonDeleteTimerRule(CFileItem *item, CONTEXT_BUTTON button); - -- virtual void RegisterObservers(void); -- virtual void UnregisterObservers(void); -+ virtual void RegisterObservers(void) {}; -+ virtual void UnregisterObservers(void) {}; - - static CCriticalSection m_selectedItemPathsLock; - static std::string m_selectedItemPaths[2]; -diff --git a/xbmc/pvr/windows/GUIWindowPVRChannels.cpp b/xbmc/pvr/windows/GUIWindowPVRChannels.cpp -index 8580529..0903370 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRChannels.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRChannels.cpp -@@ -21,7 +21,7 @@ - - #include "ContextMenuManager.h" - #include "GUIInfoManager.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "epg/EpgContainer.h" - #include "dialogs/GUIDialogKaiToast.h" - #include "dialogs/GUIDialogOK.h" -@@ -56,20 +56,17 @@ void CGUIWindowPVRChannels::RegisterObservers(void) - { - CSingleLock lock(m_critSection); - g_EpgContainer.RegisterObserver(this); -- if (g_PVRTimers) -- g_PVRTimers->RegisterObserver(this); -+ g_PVRTimers->RegisterObserver(this); - g_infoManager.RegisterObserver(this); -- CGUIWindowPVRBase::RegisterObservers(); - } - - void CGUIWindowPVRChannels::UnregisterObservers(void) - { - CSingleLock lock(m_critSection); -- CGUIWindowPVRBase::UnregisterObservers(); -- g_infoManager.UnregisterObserver(this); -+ g_EpgContainer.UnregisterObserver(this); - if (g_PVRTimers) - g_PVRTimers->UnregisterObserver(this); -- g_EpgContainer.UnregisterObserver(this); -+ g_infoManager.UnregisterObserver(this); - } - - void CGUIWindowPVRChannels::GetContextButtons(int itemNumber, CContextButtons &buttons) -diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -index 194d1b5..f38231d 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp -@@ -37,6 +37,8 @@ - - #include "GUIWindowPVRGuide.h" - -+#define MAX_UPDATE_FREQUENCY 3000 // limit to maximum one update/refresh in x milliseconds -+ - using namespace PVR; - using namespace EPG; - -@@ -53,17 +55,13 @@ CGUIWindowPVRGuide::~CGUIWindowPVRGuide(void) - StopRefreshTimelineItemsThread(); - } - --CGUIEPGGridContainer* CGUIWindowPVRGuide::GetGridControl() --{ -- return dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl())); --} -- - void CGUIWindowPVRGuide::OnInitWindow() - { - if (m_guiState.get()) - m_viewControl.SetCurrentView(m_guiState->GetViewAsControl(), false); - -- CGUIEPGGridContainer *epgGridContainer = GetGridControl(); -+ CGUIEPGGridContainer *epgGridContainer = -+ dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl())); - if (epgGridContainer) - { - epgGridContainer->SetChannel(GetSelectedItemPath(m_bRadio)); -@@ -97,19 +95,11 @@ void CGUIWindowPVRGuide::StopRefreshTimelineItemsThread() - - void CGUIWindowPVRGuide::RegisterObservers(void) - { -- CSingleLock lock(m_critSection); - g_EpgContainer.RegisterObserver(this); -- if (g_PVRTimers) -- g_PVRTimers->RegisterObserver(this); -- CGUIWindowPVRBase::RegisterObservers(); - } - - void CGUIWindowPVRGuide::UnregisterObservers(void) - { -- CSingleLock lock(m_critSection); -- CGUIWindowPVRBase::UnregisterObservers(); -- if (g_PVRTimers) -- g_PVRTimers->UnregisterObserver(this); - g_EpgContainer.UnregisterObserver(this); - } - -@@ -118,7 +108,6 @@ void CGUIWindowPVRGuide::Notify(const Observable &obs, const ObservableMessage m - if (m_viewControl.GetCurrentControl() == GUIDE_VIEW_TIMELINE && - (msg == ObservableMessageEpg || - msg == ObservableMessageEpgContainer || -- msg == ObservableMessageChannelGroupReset || - msg == ObservableMessageChannelGroup)) - { - CSingleLock lock(m_critSection); -@@ -130,15 +119,6 @@ void CGUIWindowPVRGuide::Notify(const Observable &obs, const ObservableMessage m - } - } - --void CGUIWindowPVRGuide::SetInvalid() --{ -- CGUIEPGGridContainer *epgGridContainer = GetGridControl(); -- if (epgGridContainer) -- epgGridContainer->SetInvalid(); -- -- CGUIWindowPVRBase::SetInvalid(); --} -- - void CGUIWindowPVRGuide::GetContextButtons(int itemNumber, CContextButtons &buttons) - { - if (itemNumber < 0 || itemNumber >= m_vecItems->Size()) -@@ -370,7 +350,8 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message) - case ACTION_PLAY: - { - // EPG "gap" selected => switch to associated channel. -- CGUIEPGGridContainer *epgGridContainer = GetGridControl(); -+ CGUIEPGGridContainer *epgGridContainer = -+ dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl())); - if (epgGridContainer) - { - CFileItemPtr item(epgGridContainer->GetSelectedChannelItem()); -@@ -405,7 +386,6 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message) - case GUI_MSG_REFRESH_LIST: - switch(message.GetParam1()) - { -- case ObservableMessageChannelGroupReset: - case ObservableMessageChannelGroup: - case ObservableMessageEpg: - case ObservableMessageEpgContainer: -@@ -413,12 +393,6 @@ bool CGUIWindowPVRGuide::OnMessage(CGUIMessage& message) - Refresh(true); - break; - } -- case ObservableMessageTimersReset: -- case ObservableMessageTimers: -- { -- SetInvalid(); -- break; -- } - case ObservableMessageEpgActiveItem: - { - if (m_viewControl.GetCurrentControl() != GUIDE_VIEW_TIMELINE) -@@ -503,7 +477,7 @@ bool CGUIWindowPVRGuide::RefreshTimelineItems() - { - m_bRefreshTimelineItems = false; - -- CGUIEPGGridContainer* epgGridContainer = GetGridControl(); -+ CGUIEPGGridContainer* epgGridContainer = dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl())); - if (epgGridContainer) - { - const CPVRChannelGroupPtr group(GetGroup()); -@@ -549,7 +523,7 @@ void CGUIWindowPVRGuide::GetViewTimelineItems(CFileItemList &items) - // group change detected reset grid coordinates and refresh grid items - if (!m_bRefreshTimelineItems && *m_cachedChannelGroup != *GetGroup()) - { -- CGUIEPGGridContainer* epgGridContainer = GetGridControl(); -+ CGUIEPGGridContainer* epgGridContainer = dynamic_cast<CGUIEPGGridContainer*>(GetControl(m_viewControl.GetCurrentControl())); - if (!epgGridContainer) - return; - -diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.h b/xbmc/pvr/windows/GUIWindowPVRGuide.h -index 224cf05..0120f86 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRGuide.h -+++ b/xbmc/pvr/windows/GUIWindowPVRGuide.h -@@ -26,11 +26,6 @@ - - class CSetting; - --namespace EPG --{ -- class CGUIEPGGridContainer; --} -- - namespace PVR - { - class CPVRRefreshTimelineItemsThread; -@@ -49,7 +44,6 @@ namespace PVR - virtual bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override; - virtual void UpdateButtons(void) override; - virtual void Notify(const Observable &obs, const ObservableMessage msg) override; -- virtual void SetInvalid() override; - - bool RefreshTimelineItems(); - -@@ -61,8 +55,6 @@ namespace PVR - virtual void UnregisterObservers(void) override; - - private: -- EPG::CGUIEPGGridContainer* GetGridControl(); -- - bool SelectPlayingFile(void); - - bool OnContextButtonBegin(CFileItem *item, CONTEXT_BUTTON button); -diff --git a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp -index 5ff21c7..5406929 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRRecordings.cpp -@@ -20,7 +20,7 @@ - - #include "ContextMenuManager.h" - #include "GUIInfoManager.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "dialogs/GUIDialogYesNo.h" - #include "guilib/LocalizeStrings.h" - #include "guilib/GUIKeyboardFactory.h" -@@ -52,23 +52,19 @@ CGUIWindowPVRRecordings::CGUIWindowPVRRecordings(bool bRadio) : - void CGUIWindowPVRRecordings::RegisterObservers(void) - { - CSingleLock lock(m_critSection); -- if (g_PVRRecordings) -- g_PVRRecordings->RegisterObserver(this); -- if (g_PVRTimers) -- g_PVRTimers->RegisterObserver(this); -+ g_PVRRecordings->RegisterObserver(this); -+ g_PVRTimers->RegisterObserver(this); - g_infoManager.RegisterObserver(this); -- CGUIWindowPVRBase::RegisterObservers(); - } - - void CGUIWindowPVRRecordings::UnregisterObservers(void) - { - CSingleLock lock(m_critSection); -- CGUIWindowPVRBase::UnregisterObservers(); -- g_infoManager.UnregisterObserver(this); -- if (g_PVRTimers) -- g_PVRTimers->UnregisterObserver(this); - if (g_PVRRecordings) - g_PVRRecordings->UnregisterObserver(this); -+ if (g_PVRTimers) -+ g_PVRTimers->UnregisterObserver(this); -+ g_infoManager.UnregisterObserver(this); - } - - void CGUIWindowPVRRecordings::OnWindowLoaded() -diff --git a/xbmc/pvr/windows/GUIWindowPVRSearch.cpp b/xbmc/pvr/windows/GUIWindowPVRSearch.cpp -index 636ed9f..482fb94 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRSearch.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRSearch.cpp -@@ -181,7 +181,7 @@ void CGUIWindowPVRSearch::OnPrepareFileItems(CFileItemList &items) - dlgProgress->Progress(); - } - -- //! @todo should we limit the find similar search to the selected group? -+ // TODO should we limit the find similar search to the selected group? - g_EpgContainer.GetEPGSearch(items, m_searchfilter); - - if (dlgProgress) -diff --git a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp -index acf7c0b..7a8071a 100644 ---- a/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp -+++ b/xbmc/pvr/windows/GUIWindowPVRTimersBase.cpp -@@ -48,19 +48,16 @@ CGUIWindowPVRTimersBase::CGUIWindowPVRTimersBase(bool bRadio, int id, const std: - void CGUIWindowPVRTimersBase::RegisterObservers(void) - { - CSingleLock lock(m_critSection); -- if (g_PVRTimers) -- g_PVRTimers->RegisterObserver(this); -+ g_PVRTimers->RegisterObserver(this); - g_infoManager.RegisterObserver(this); -- CGUIWindowPVRBase::RegisterObservers(); - } - - void CGUIWindowPVRTimersBase::UnregisterObservers(void) - { - CSingleLock lock(m_critSection); -- CGUIWindowPVRBase::UnregisterObservers(); -- g_infoManager.UnregisterObserver(this); - if (g_PVRTimers) - g_PVRTimers->UnregisterObserver(this); -+ g_infoManager.UnregisterObserver(this); - } - - void CGUIWindowPVRTimersBase::GetContextButtons(int itemNumber, CContextButtons &buttons) -diff --git a/xbmc/rendering/RenderSystem.h b/xbmc/rendering/RenderSystem.h -index cba4e58..c4352e7 100644 ---- a/xbmc/rendering/RenderSystem.h -+++ b/xbmc/rendering/RenderSystem.h -@@ -102,7 +102,7 @@ public: - - virtual bool BeginRender() = 0; - virtual bool EndRender() = 0; -- virtual void PresentRender(bool rendered, bool videoLayer) = 0; -+ virtual void PresentRender(bool rendered) = 0; - virtual bool ClearBuffers(color_t color) = 0; - virtual bool IsExtSupported(const char* extension) = 0; - -diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp -index 1666c87..e22c364 100644 ---- a/xbmc/rendering/dx/RenderSystemDX.cpp -+++ b/xbmc/rendering/dx/RenderSystemDX.cpp -@@ -32,15 +32,16 @@ - #include "settings/AdvancedSettings.h" - #include "threads/SingleLock.h" - #include "utils/MathUtils.h" -+#include "utils/TimeUtils.h" - #include "utils/log.h" -+#include "win32/WIN32Util.h" - #include "win32/dxerr.h" - - #pragma comment(lib, "d3d11.lib") - #pragma comment(lib, "dxgi.lib") - #pragma comment(lib, "dxguid.lib") - --#define RATIONAL_TO_FLOAT(rational) ((rational.Denominator != 0) ? \ -- static_cast<float>(rational.Numerator) / static_cast<float>(rational.Denominator) : 0.0f) -+#define RATIONAL_TO_FLOAT(rational) ((rational.Denominator != 0) ? (float)rational.Numerator / (float)rational.Denominator : 0.0) - - using namespace DirectX::PackedVector; - -@@ -48,12 +49,52 @@ CRenderSystemDX::CRenderSystemDX() : CRenderSystemBase() - { - m_enumRenderingSystem = RENDERING_SYSTEM_DIRECTX; - -+ m_hFocusWnd = nullptr; -+ m_hDeviceWnd = nullptr; -+ m_nBackBufferWidth = 0; -+ m_nBackBufferHeight = 0; -+ m_bFullScreenDevice = false; - m_bVSync = true; -+ m_nDeviceStatus = S_OK; -+ m_inScene = false; -+ m_needNewDevice = false; -+ m_resizeInProgress = false; -+ m_screenHeight = 0; -+ m_systemFreq = CurrentHostFrequency(); -+ m_defaultD3DUsage = D3D11_USAGE_DEFAULT; -+ m_featureLevel = D3D_FEATURE_LEVEL_11_1; -+ m_driverType = D3D_DRIVER_TYPE_HARDWARE; -+ m_adapter = nullptr; -+ m_pOutput = nullptr; -+ m_dxgiFactory = nullptr; -+ m_pD3DDev = nullptr; -+ m_pImdContext = nullptr; -+ m_pContext = nullptr; -+ -+ m_pSwapChain = nullptr; -+ m_pSwapChain1 = nullptr; -+ m_pRenderTargetView = nullptr; -+ m_depthStencilState = nullptr; -+ m_depthStencilView = nullptr; -+ m_BlendEnableState = nullptr; -+ m_BlendDisableState = nullptr; -+ m_BlendEnabled = false; -+ m_RSScissorDisable = nullptr; -+ m_RSScissorEnable = nullptr; -+ m_ScissorsEnabled = false; - -+ m_pTextureRight = nullptr; -+ m_pRenderTargetViewRight = nullptr; -+ m_pShaderResourceViewRight = nullptr; -+ m_pGUIShader = nullptr; -+ m_bResizeRequred = false; -+ m_bHWStereoEnabled = false; - ZeroMemory(&m_cachedMode, sizeof(m_cachedMode)); - ZeroMemory(&m_viewPort, sizeof(m_viewPort)); - ZeroMemory(&m_scissor, sizeof(CRect)); - ZeroMemory(&m_adapterDesc, sizeof(DXGI_ADAPTER_DESC)); -+ m_bDefaultStereoEnabled = false; -+ m_bStereoEnabled = false; - } - - CRenderSystemDX::~CRenderSystemDX() -@@ -174,7 +215,7 @@ void CRenderSystemDX::OnMove() - m_pOutput->GetDesc(&outputDesc); - HMONITOR newMonitor = MonitorFromWindow(m_hDeviceWnd, MONITOR_DEFAULTTONULL); - -- if (newMonitor != nullptr && outputDesc.Monitor != newMonitor) -+ if (newMonitor != NULL && outputDesc.Monitor != newMonitor) - { - SetMonitor(newMonitor); - if (m_needNewDevice) -@@ -246,12 +287,12 @@ void CRenderSystemDX::GetDisplayMode(DXGI_MODE_DESC *mode, bool useCached /*= fa - - inline void DXWait(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - { -- ID3D11Query* wait = nullptr; -+ ID3D11Query* wait = NULL; - CD3D11_QUERY_DESC qd(D3D11_QUERY_EVENT); - if (SUCCEEDED(pDevice->CreateQuery(&qd, &wait))) - { - pContext->End(wait); -- while (S_FALSE == pContext->GetData(wait, nullptr, 0, 0)) -+ while (S_FALSE == pContext->GetData(wait, NULL, 0, 0)) - Sleep(1); - } - SAFE_RELEASE(wait); -@@ -264,7 +305,7 @@ void CRenderSystemDX::SetFullScreenInternal() - - HRESULT hr = S_OK; - BOOL bFullScreen; -- m_pSwapChain->GetFullscreenState(&bFullScreen, nullptr); -+ m_pSwapChain->GetFullscreenState(&bFullScreen, NULL); - - // full-screen to windowed translation. Only change FS state and return - if (!!bFullScreen && m_useWindowedDX) -@@ -272,7 +313,7 @@ void CRenderSystemDX::SetFullScreenInternal() - CLog::Log(LOGDEBUG, "%s - Switching swap chain to windowed mode.", __FUNCTION__); - - OnDisplayLost(); -- hr = m_pSwapChain->SetFullscreenState(false, nullptr); -+ hr = m_pSwapChain->SetFullscreenState(false, NULL); - if (SUCCEEDED(hr)) - m_bResizeRequred = true; - else -@@ -281,7 +322,7 @@ void CRenderSystemDX::SetFullScreenInternal() - // true full-screen - else if (m_bFullScreenDevice && !m_useWindowedDX) - { -- IDXGIOutput* pOutput = nullptr; -+ IDXGIOutput* pOutput = NULL; - m_pSwapChain->GetContainingOutput(&pOutput); - - DXGI_OUTPUT_DESC trgDesc, currDesc; -@@ -390,7 +431,7 @@ void CRenderSystemDX::DeleteDevice() - (*i)->OnDestroyDevice(); - - if (m_pSwapChain) -- m_pSwapChain->SetFullscreenState(false, nullptr); -+ m_pSwapChain->SetFullscreenState(false, NULL); - - SAFE_DELETE(m_pGUIShader); - SAFE_RELEASE(m_pTextureRight); -@@ -584,7 +625,7 @@ bool CRenderSystemDX::CreateDevice() - - // use multi-thread protection on the device context to prevent deadlock issues that can sometimes happen - // when decoder call ID3D11VideoContext::GetDecoderBuffer or ID3D11VideoContext::ReleaseDecoderBuffer. -- ID3D10Multithread *pMultiThreading = nullptr; -+ ID3D10Multithread *pMultiThreading = NULL; - if (SUCCEEDED(m_pD3DDev->QueryInterface(__uuidof(ID3D10Multithread), reinterpret_cast<void**>(&pMultiThreading)))) - { - pMultiThreading->SetMultithreadProtected(true); -@@ -724,7 +765,7 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - { - DXGI_SWAP_CHAIN_DESC1 scDesc; - m_pSwapChain1->GetDesc1(&scDesc); -- bNeedRecreate = (scDesc.Stereo == TRUE) != bHWStereoEnabled; -+ bNeedRecreate = scDesc.Stereo != bHWStereoEnabled; - } - - if (!bNeedRecreate && !bNeedResize) -@@ -741,13 +782,13 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - ID3D11RenderTargetView* pRTView; ID3D11DepthStencilView* pDSView; - m_pContext->OMGetRenderTargets(1, &pRTView, &pDSView); - -- bRestoreRTView = (nullptr != pRTView || nullptr != pDSView); -+ bRestoreRTView = NULL != pRTView || NULL != pDSView; - - SAFE_RELEASE(pRTView); - SAFE_RELEASE(pDSView); - } - -- m_pContext->OMSetRenderTargets(0, nullptr, nullptr); -+ m_pContext->OMSetRenderTargets(0, NULL, NULL); - FinishCommandList(false); - - SAFE_RELEASE(m_pRenderTargetView); -@@ -765,9 +806,9 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - } - - BOOL fullScreen; -- m_pSwapChain1->GetFullscreenState(&fullScreen, nullptr); -+ m_pSwapChain1->GetFullscreenState(&fullScreen, NULL); - if (fullScreen) -- m_pSwapChain1->SetFullscreenState(false, nullptr); -+ m_pSwapChain1->SetFullscreenState(false, NULL); - - // disable/enable stereo 3D on system level - if (g_advancedSettings.m_useDisplayControlHWStereo) -@@ -791,7 +832,7 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - CLog::Log(LOGDEBUG, "%s - Creating swapchain in %s mode.", __FUNCTION__, bHWStereoEnabled ? "Stereoscopic 3D" : "Mono"); - - // Create swap chain -- IDXGIFactory2* dxgiFactory2 = nullptr; -+ IDXGIFactory2* dxgiFactory2 = NULL; - hr = m_dxgiFactory->QueryInterface(__uuidof(IDXGIFactory2), reinterpret_cast<void**>(&dxgiFactory2)); - if (SUCCEEDED(hr) && dxgiFactory2) - { -@@ -814,7 +855,7 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - scFSDesc.ScanlineOrdering = m_interlaced ? DXGI_MODE_SCANLINE_ORDER_UPPER_FIELD_FIRST : DXGI_MODE_SCANLINE_ORDER_PROGRESSIVE; - scFSDesc.Windowed = m_useWindowedDX; - -- hr = dxgiFactory2->CreateSwapChainForHwnd(m_pD3DDev, m_hFocusWnd, &scDesc1, &scFSDesc, nullptr, &m_pSwapChain1); -+ hr = dxgiFactory2->CreateSwapChainForHwnd(m_pD3DDev, m_hFocusWnd, &scDesc1, &scFSDesc, NULL, &m_pSwapChain1); - - // some drivers (AMD) are denied to switch in stereoscopic 3D mode, if so then fallback to mono mode - if (FAILED(hr) && bHWStereoEnabled) -@@ -825,7 +866,7 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - - scDesc1.Stereo = false; - bHWStereoEnabled = false; -- hr = dxgiFactory2->CreateSwapChainForHwnd(m_pD3DDev, m_hFocusWnd, &scDesc1, &scFSDesc, nullptr, &m_pSwapChain1); -+ hr = dxgiFactory2->CreateSwapChainForHwnd(m_pD3DDev, m_hFocusWnd, &scDesc1, &scFSDesc, NULL, &m_pSwapChain1); - - // fallback to split_horisontal mode. - g_graphicsContext.SetStereoMode(RENDER_STEREO_MODE_SPLIT_HORIZONTAL); -@@ -933,11 +974,11 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - else if (IsFormatSupport(DXGI_FORMAT_D24_UNORM_S8_UINT, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL)) zFormat = DXGI_FORMAT_D24_UNORM_S8_UINT; - else if (IsFormatSupport(DXGI_FORMAT_D16_UNORM, D3D11_FORMAT_SUPPORT_DEPTH_STENCIL)) zFormat = DXGI_FORMAT_D16_UNORM; - -- ID3D11Texture2D* depthStencilBuffer = nullptr; -+ ID3D11Texture2D* depthStencilBuffer = NULL; - // Initialize the description of the depth buffer. - CD3D11_TEXTURE2D_DESC depthBufferDesc(zFormat, m_nBackBufferWidth, m_nBackBufferHeight, 1, 1, D3D11_BIND_DEPTH_STENCIL); - // Create the texture for the depth buffer using the filled out description. -- hr = m_pD3DDev->CreateTexture2D(&depthBufferDesc, nullptr, &depthStencilBuffer); -+ hr = m_pD3DDev->CreateTexture2D(&depthBufferDesc, NULL, &depthStencilBuffer); - if (FAILED(hr)) - { - CLog::Log(LOGERROR, "%s - Failed to create depth stencil buffer (%s).", __FUNCTION__, GetErrorDescription(hr).c_str()); -@@ -957,9 +998,7 @@ bool CRenderSystemDX::CreateWindowSizeDependentResources() - - if (m_viewPort.Height == 0 || m_viewPort.Width == 0) - { -- CRect rect(0.0f, 0.0f, -- static_cast<float>(m_nBackBufferWidth), -- static_cast<float>(m_nBackBufferHeight)); -+ CRect rect(0, 0, m_nBackBufferWidth, m_nBackBufferHeight); - SetViewPort(rect); - } - -@@ -1005,7 +1044,7 @@ void CRenderSystemDX::CheckInterlasedStereoView(void) - HRESULT hr; - CD3D11_TEXTURE2D_DESC texDesc(DXGI_FORMAT_B8G8R8A8_UNORM, m_nBackBufferWidth, m_nBackBufferHeight, 1, 1, - D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE); -- hr = m_pD3DDev->CreateTexture2D(&texDesc, nullptr, &m_pTextureRight); -+ hr = m_pD3DDev->CreateTexture2D(&texDesc, NULL, &m_pTextureRight); - if (SUCCEEDED(hr)) - { - CD3D11_RENDER_TARGET_VIEW_DESC rtDesc(D3D11_RTV_DIMENSION_TEXTURE2D); -@@ -1148,7 +1187,7 @@ void CRenderSystemDX::PresentRenderImpl(bool rendered) - ? SHADER_METHOD_RENDER_STEREO_INTERLACED_RIGHT - : SHADER_METHOD_RENDER_STEREO_CHECKERBOARD_RIGHT; - SetAlphaBlendEnable(true); -- CD3DTexture::DrawQuad(destRect, 0, 1, &m_pShaderResourceViewRight, nullptr, method); -+ CD3DTexture::DrawQuad(destRect, 0, 1, &m_pShaderResourceViewRight, NULL, method); - CD3DHelper::PSClearShaderResources(m_pContext); - } - -@@ -1280,9 +1319,7 @@ bool CRenderSystemDX::ClearBuffers(color_t color) - if (pRTView == nullptr) - return true; - -- CRect clRect(0.0f, 0.0f, -- static_cast<float>(m_nBackBufferWidth), -- static_cast<float>(m_nBackBufferHeight)); -+ CRect clRect(0, 0, m_nBackBufferWidth, m_nBackBufferHeight); - - // Unlike Direct3D 9, D3D11 ClearRenderTargetView always clears full extent of the resource view. - // Viewport and scissor settings are not applied. So clear RT by drawing full sized rect with clear color -@@ -1487,7 +1524,7 @@ bool CRenderSystemDX::ScissorsCanEffectClipping() - if (!m_bRenderCreated) - return false; - -- return m_pGUIShader != nullptr && m_pGUIShader->HardwareClipIsPossible(); -+ return m_pGUIShader != NULL && m_pGUIShader->HardwareClipIsPossible(); - } - - CRect CRenderSystemDX::ClipRectToScissorRect(const CRect &rect) -@@ -1527,9 +1564,7 @@ void CRenderSystemDX::ResetScissors() - if (!m_bRenderCreated) - return; - -- m_scissor.SetRect(0.0f, 0.0f, -- static_cast<float>(m_nBackBufferWidth), -- static_cast<float>(m_nBackBufferHeight)); -+ m_scissor.SetRect(0, 0, m_nBackBufferWidth, m_nBackBufferHeight); - - m_pContext->RSSetState(m_RSScissorDisable); - m_ScissorsEnabled = false; -@@ -1623,7 +1658,7 @@ bool CRenderSystemDX::GetStereoEnabled() const - - IDXGIFactory2* dxgiFactory2 = nullptr; - if (SUCCEEDED(m_dxgiFactory->QueryInterface(__uuidof(IDXGIFactory2), reinterpret_cast<void**>(&dxgiFactory2)))) -- result = dxgiFactory2->IsWindowedStereoEnabled() == TRUE; -+ result = dxgiFactory2->IsWindowedStereoEnabled(); - SAFE_RELEASE(dxgiFactory2); - - return result; -@@ -1634,17 +1669,17 @@ bool CRenderSystemDX::GetDisplayStereoEnabled() const - bool result = false; - - IDXGIDisplayControl * pDXGIDisplayControl = nullptr; -- if (SUCCEEDED(m_dxgiFactory->QueryInterface(__uuidof(IDXGIDisplayControl), reinterpret_cast<void **>(&pDXGIDisplayControl)))) -- result = pDXGIDisplayControl->IsStereoEnabled() == TRUE; -+ if (SUCCEEDED(m_dxgiFactory->QueryInterface(__uuidof(IDXGIDisplayControl), (void **)&pDXGIDisplayControl))) -+ result = pDXGIDisplayControl->IsStereoEnabled(); - SAFE_RELEASE(pDXGIDisplayControl); - - return result; - } - --void CRenderSystemDX::SetDisplayStereoEnabled(bool enable) const -+void CRenderSystemDX::SetDisplayStereoEnabled(bool enable) - { - IDXGIDisplayControl * pDXGIDisplayControl = nullptr; -- if (SUCCEEDED(m_dxgiFactory->QueryInterface(__uuidof(IDXGIDisplayControl), reinterpret_cast<void **>(&pDXGIDisplayControl)))) -+ if (SUCCEEDED(m_dxgiFactory->QueryInterface(__uuidof(IDXGIDisplayControl), (void **)&pDXGIDisplayControl))) - pDXGIDisplayControl->SetStereoEnabled(enable); - SAFE_RELEASE(pDXGIDisplayControl); - } -@@ -1678,7 +1713,7 @@ bool CRenderSystemDX::SupportsStereo(RENDER_STEREO_MODE mode) const - } - } - --void CRenderSystemDX::FlushGPU() const -+void CRenderSystemDX::FlushGPU() - { - if (!m_bRenderCreated) - return; -@@ -1711,16 +1746,16 @@ void CRenderSystemDX::SetAlphaBlendEnable(bool enable) - return; - - float blendFactors[] = { 0.0f, 0.0f, 0.0f, 0.0f }; -- m_pContext->OMSetBlendState(enable ? m_BlendEnableState : m_BlendDisableState, nullptr, 0xFFFFFFFF); -+ m_pContext->OMSetBlendState(enable ? m_BlendEnableState : m_BlendDisableState, 0, 0xFFFFFFFF); - m_BlendEnabled = enable; - } - --void CRenderSystemDX::FinishCommandList(bool bExecute /*= true*/) const -+void CRenderSystemDX::FinishCommandList(bool bExecute /*= true*/) - { - if (m_pImdContext == m_pContext) - return; - -- ID3D11CommandList* pCommandList = nullptr; -+ ID3D11CommandList* pCommandList = NULL; - if (FAILED(m_pContext->FinishCommandList(true, &pCommandList))) - { - CLog::Log(LOGERROR, "%s - Failed to finish command queue.", __FUNCTION__); -@@ -1733,7 +1768,7 @@ void CRenderSystemDX::FinishCommandList(bool bExecute /*= true*/) const - SAFE_RELEASE(pCommandList); - } - --void CRenderSystemDX::SetMaximumFrameLatency(uint8_t latency) const -+void CRenderSystemDX::SetMaximumFrameLatency(uint8_t latency) - { - if (!m_pD3DDev) - return; -diff --git a/xbmc/rendering/dx/RenderSystemDX.h b/xbmc/rendering/dx/RenderSystemDX.h -index a07dfc8..6ff32bc 100644 ---- a/xbmc/rendering/dx/RenderSystemDX.h -+++ b/xbmc/rendering/dx/RenderSystemDX.h -@@ -46,47 +46,47 @@ public: - virtual ~CRenderSystemDX(); - - // CRenderBase -- bool InitRenderSystem() override; -- bool DestroyRenderSystem() override; -- bool ResetRenderSystem(int width, int height, bool fullScreen, float refreshRate) override; -- bool BeginRender() override; -- bool EndRender() override; -- bool ClearBuffers(color_t color) override; -- bool IsExtSupported(const char* extension) override; -+ virtual bool InitRenderSystem(); -+ virtual bool DestroyRenderSystem(); -+ virtual bool ResetRenderSystem(int width, int height, bool fullScreen, float refreshRate); -+ virtual bool BeginRender(); -+ virtual bool EndRender(); -+ virtual bool ClearBuffers(color_t color); -+ virtual bool IsExtSupported(const char* extension); - virtual bool IsFormatSupport(DXGI_FORMAT format, unsigned int usage); - virtual void SetVSync(bool vsync); -- void SetViewPort(CRect& viewPort) override; -- void GetViewPort(CRect& viewPort) override; -- void RestoreViewPort() override; -- CRect ClipRectToScissorRect(const CRect &rect) override; -- bool ScissorsCanEffectClipping() override; -- void SetScissors(const CRect &rect) override; -- void ResetScissors() override; -- void CaptureStateBlock() override; -- void ApplyStateBlock() override; -- void SetCameraPosition(const CPoint &camera, int screenWidth, int screenHeight, float stereoFactor = 0.f) override; -- void ApplyHardwareTransform(const TransformMatrix &matrix) override; -- void RestoreHardwareTransform() override; -- void SetStereoMode(RENDER_STEREO_MODE mode, RENDER_STEREO_VIEW view) override; -- bool SupportsStereo(RENDER_STEREO_MODE mode) const override; -- bool TestRender() override; -- void Project(float &x, float &y, float &z) override; -+ virtual void SetViewPort(CRect& viewPort); -+ virtual void GetViewPort(CRect& viewPort); -+ virtual void RestoreViewPort(); -+ virtual CRect ClipRectToScissorRect(const CRect &rect); -+ virtual bool ScissorsCanEffectClipping(); -+ virtual void SetScissors(const CRect &rect); -+ virtual void ResetScissors(); -+ virtual void CaptureStateBlock(); -+ virtual void ApplyStateBlock(); -+ virtual void SetCameraPosition(const CPoint &camera, int screenWidth, int screenHeight, float stereoFactor = 0.f); -+ virtual void ApplyHardwareTransform(const TransformMatrix &matrix); -+ virtual void RestoreHardwareTransform(); -+ virtual void SetStereoMode(RENDER_STEREO_MODE mode, RENDER_STEREO_VIEW view); -+ virtual bool SupportsStereo(RENDER_STEREO_MODE mode) const; -+ virtual bool TestRender(); -+ virtual void Project(float &x, float &y, float &z); - virtual CRect GetBackBufferRect() { return CRect(0.f, 0.f, static_cast<float>(m_nBackBufferWidth), static_cast<float>(m_nBackBufferHeight)); } - -- IDXGIOutput* GetCurrentOutput() const { return m_pOutput; } -+ IDXGIOutput* GetCurrentOutput(void) { return m_pOutput; } - void GetDisplayMode(DXGI_MODE_DESC *mode, bool useCached = false); -- void FinishCommandList(bool bExecute = true) const; -- void FlushGPU() const; -- -- ID3D11Device* Get3D11Device() const { return m_pD3DDev; } -- ID3D11DeviceContext* Get3D11Context() const { return m_pContext; } -- ID3D11DeviceContext* GetImmediateContext() const { return m_pImdContext; } -- CGUIShaderDX* GetGUIShader() const { return m_pGUIShader; } -- unsigned GetFeatureLevel() const { return m_featureLevel; } -- D3D11_USAGE DefaultD3DUsage() const { return m_defaultD3DUsage; } -- DXGI_ADAPTER_DESC GetAIdentifier() const { return m_adapterDesc; } -- bool Interlaced() const { return m_interlaced; } -- int GetBackbufferCount() const { return 2; } -+ void FinishCommandList(bool bExecute = true); -+ void FlushGPU(); -+ -+ ID3D11Device* Get3D11Device() { return m_pD3DDev; } -+ ID3D11DeviceContext* Get3D11Context() { return m_pContext; } -+ ID3D11DeviceContext* GetImmediateContext(){ return m_pImdContext; } -+ CGUIShaderDX* GetGUIShader() { return m_pGUIShader; } -+ unsigned GetFeatureLevel() { return m_featureLevel; } -+ D3D11_USAGE DefaultD3DUsage() { return m_defaultD3DUsage; } -+ DXGI_ADAPTER_DESC GetAIdentifier() { return m_adapterDesc; } -+ bool Interlaced() { return m_interlaced; } -+ int GetBackbufferCount() const { return 2; } - void SetAlphaBlendEnable(bool enable); - - static std::string GetErrorDescription(HRESULT hr); -@@ -110,11 +110,11 @@ protected: - void SetFullScreenInternal(); - void GetClosestDisplayModeToCurrent(IDXGIOutput* output, DXGI_MODE_DESC* outCurrentDisplayMode, bool useCached = false); - void CheckInterlasedStereoView(void); -- void SetMaximumFrameLatency(uint8_t latency = -1) const; -+ void SetMaximumFrameLatency(uint8_t latency = -1); - - bool GetStereoEnabled() const; - bool GetDisplayStereoEnabled() const; -- void SetDisplayStereoEnabled(bool enable) const; -+ void SetDisplayStereoEnabled(bool enable); - void UpdateDisplayStereoStatus(bool isfirst = false); - - virtual void Register(ID3DResource *resource); -@@ -125,59 +125,60 @@ protected: - virtual void OnDisplayBack() {}; - - // our adapter could change as we go -- bool m_needNewDevice{false}; -+ bool m_needNewDevice; - bool m_needNewViews; -- bool m_resizeInProgress{false}; -- unsigned int m_screenHeight{0}; -- HWND m_hFocusWnd{nullptr}; -- HWND m_hDeviceWnd{nullptr}; -- unsigned int m_nBackBufferWidth{0}; -- unsigned int m_nBackBufferHeight{0}; -- bool m_bFullScreenDevice{false}; -+ bool m_resizeInProgress; -+ unsigned int m_screenHeight; -+ HWND m_hFocusWnd; -+ HWND m_hDeviceWnd; -+ unsigned int m_nBackBufferWidth; -+ unsigned int m_nBackBufferHeight; -+ bool m_bFullScreenDevice; - float m_refreshRate; - bool m_interlaced; -- HRESULT m_nDeviceStatus{S_OK}; -- D3D11_USAGE m_defaultD3DUsage{D3D11_USAGE_DEFAULT}; -+ HRESULT m_nDeviceStatus; -+ int64_t m_systemFreq; -+ D3D11_USAGE m_defaultD3DUsage; - bool m_useWindowedDX; - CCriticalSection m_resourceSection; - std::vector<ID3DResource*> m_resources; -- bool m_inScene{false}; ///< True if we're in a BeginScene()/EndScene() block -- D3D_DRIVER_TYPE m_driverType{D3D_DRIVER_TYPE_HARDWARE}; -- D3D_FEATURE_LEVEL m_featureLevel{D3D_FEATURE_LEVEL_11_1}; -- IDXGIFactory1* m_dxgiFactory{nullptr}; -- ID3D11Device* m_pD3DDev{nullptr}; -- IDXGIAdapter1* m_adapter{nullptr}; -- IDXGIOutput* m_pOutput{nullptr}; -- ID3D11DeviceContext* m_pContext{nullptr}; -- ID3D11DeviceContext* m_pImdContext{nullptr}; -- IDXGISwapChain* m_pSwapChain{nullptr}; -- IDXGISwapChain1* m_pSwapChain1{nullptr}; -- ID3D11RenderTargetView* m_pRenderTargetView{nullptr}; -- ID3D11DepthStencilState* m_depthStencilState{nullptr}; -- ID3D11DepthStencilView* m_depthStencilView{nullptr}; -+ bool m_inScene; ///< True if we're in a BeginScene()/EndScene() block -+ D3D_DRIVER_TYPE m_driverType; -+ D3D_FEATURE_LEVEL m_featureLevel; -+ IDXGIFactory1* m_dxgiFactory; -+ ID3D11Device* m_pD3DDev; -+ IDXGIAdapter1* m_adapter; -+ IDXGIOutput* m_pOutput; -+ ID3D11DeviceContext* m_pContext; -+ ID3D11DeviceContext* m_pImdContext; -+ IDXGISwapChain* m_pSwapChain; -+ IDXGISwapChain1* m_pSwapChain1; -+ ID3D11RenderTargetView* m_pRenderTargetView; -+ ID3D11DepthStencilState* m_depthStencilState; -+ ID3D11DepthStencilView* m_depthStencilView; - D3D11_VIEWPORT m_viewPort; - CRect m_scissor; -- CGUIShaderDX* m_pGUIShader{nullptr}; -- ID3D11BlendState* m_BlendEnableState{nullptr}; -- ID3D11BlendState* m_BlendDisableState{nullptr}; -- bool m_BlendEnabled{false}; -- ID3D11RasterizerState* m_RSScissorDisable{nullptr}; -- ID3D11RasterizerState* m_RSScissorEnable{nullptr}; -- bool m_ScissorsEnabled{false}; -+ CGUIShaderDX* m_pGUIShader; -+ ID3D11BlendState* m_BlendEnableState; -+ ID3D11BlendState* m_BlendDisableState; -+ bool m_BlendEnabled; -+ ID3D11RasterizerState* m_RSScissorDisable; -+ ID3D11RasterizerState* m_RSScissorEnable; -+ bool m_ScissorsEnabled; - DXGI_ADAPTER_DESC m_adapterDesc; - // stereo interlaced/checkerboard intermediate target -- ID3D11Texture2D* m_pTextureRight{nullptr}; -- ID3D11RenderTargetView* m_pRenderTargetViewRight{nullptr}; -- ID3D11ShaderResourceView* m_pShaderResourceViewRight{nullptr}; -- bool m_bResizeRequred{false}; -- bool m_bHWStereoEnabled{false}; -+ ID3D11Texture2D* m_pTextureRight; -+ ID3D11RenderTargetView* m_pRenderTargetViewRight; -+ ID3D11ShaderResourceView* m_pShaderResourceViewRight; -+ bool m_bResizeRequred; -+ bool m_bHWStereoEnabled; - // improve get current mode - DXGI_MODE_DESC m_cachedMode; - #ifdef _DEBUG -- ID3D11Debug* m_d3dDebug{nullptr}; -+ ID3D11Debug* m_d3dDebug = NULL; - #endif -- bool m_bDefaultStereoEnabled{false}; -- bool m_bStereoEnabled{false}; -+ bool m_bDefaultStereoEnabled; -+ bool m_bStereoEnabled; - }; - - #endif -diff --git a/xbmc/rendering/gl/RenderSystemGL.cpp b/xbmc/rendering/gl/RenderSystemGL.cpp -index fd6ed8d..87ff900 100644 ---- a/xbmc/rendering/gl/RenderSystemGL.cpp -+++ b/xbmc/rendering/gl/RenderSystemGL.cpp -@@ -186,7 +186,7 @@ bool CRenderSystemGL::ResetRenderSystem(int width, int height, bool fullScreen, - glEnable(GL_SCISSOR_TEST); - - glMatrixProject.Clear(); -- glMatrixProject->LoadIdentity(); -+ glMatrixModview->LoadIdentity(); - glMatrixProject->Ortho(0.0f, width-1, height-1, 0.0f, -1.0f, 1.0f); - glMatrixProject.Load(); - -@@ -290,7 +290,7 @@ bool CRenderSystemGL::IsExtSupported(const char* extension) - return m_RenderExtensions.find(name) != std::string::npos; - } - --void CRenderSystemGL::PresentRender(bool rendered, bool videoLayer) -+void CRenderSystemGL::PresentRender(bool rendered) - { - SetVSync(true); - -diff --git a/xbmc/rendering/gl/RenderSystemGL.h b/xbmc/rendering/gl/RenderSystemGL.h -index 5c6ff78..d6fe28b 100644 ---- a/xbmc/rendering/gl/RenderSystemGL.h -+++ b/xbmc/rendering/gl/RenderSystemGL.h -@@ -39,7 +39,7 @@ public: - - bool BeginRender() override; - bool EndRender() override; -- void PresentRender(bool rendered, bool videoLayer) override; -+ void PresentRender(bool rendered) override; - bool ClearBuffers(color_t color) override; - bool IsExtSupported(const char* extension) override; - -diff --git a/xbmc/rendering/gles/RenderSystemGLES.cpp b/xbmc/rendering/gles/RenderSystemGLES.cpp -index 8cd5ea3..aa3becc 100644 ---- a/xbmc/rendering/gles/RenderSystemGLES.cpp -+++ b/xbmc/rendering/gles/RenderSystemGLES.cpp -@@ -151,7 +151,7 @@ bool CRenderSystemGLES::ResetRenderSystem(int width, int height, bool fullScreen - glEnable(GL_SCISSOR_TEST); - - glMatrixProject.Clear(); -- glMatrixProject->LoadIdentity(); -+ glMatrixModview->LoadIdentity(); - glMatrixProject->Ortho(0.0f, width-1, height-1, 0.0f, -1.0f, 1.0f); - glMatrixProject.Load(); - -@@ -274,7 +274,7 @@ static int64_t abs64(int64_t a) - return a; - } - --void CRenderSystemGLES::PresentRender(bool rendered, bool videoLayer) -+void CRenderSystemGLES::PresentRender(bool rendered) - { - SetVSync(true); - -@@ -283,8 +283,7 @@ void CRenderSystemGLES::PresentRender(bool rendered, bool videoLayer) - - PresentRenderImpl(rendered); - -- // if video is rendered to a separate layer, we should not block this thread -- if (!rendered && !videoLayer) -+ if (!rendered) - Sleep(40); - } - -@@ -328,7 +327,7 @@ void CRenderSystemGLES::CaptureStateBlock() - - glDisable(GL_SCISSOR_TEST); // fixes FBO corruption on Macs - glActiveTexture(GL_TEXTURE0); --//! @todo - NOTE: Only for Screensavers & Visualisations -+//TODO - NOTE: Only for Screensavers & Visualisations - // glColor3f(1.0, 1.0, 1.0); - } - -diff --git a/xbmc/rendering/gles/RenderSystemGLES.h b/xbmc/rendering/gles/RenderSystemGLES.h -index f103cf5..989a43f 100644 ---- a/xbmc/rendering/gles/RenderSystemGLES.h -+++ b/xbmc/rendering/gles/RenderSystemGLES.h -@@ -56,7 +56,7 @@ public: - - bool BeginRender() override; - bool EndRender() override; -- void PresentRender(bool rendered, bool videoLayer) override; -+ void PresentRender(bool rendered) override; - bool ClearBuffers(color_t color) override; - bool IsExtSupported(const char* extension) override; - -diff --git a/xbmc/screensavers/gles/Makefile.in b/xbmc/screensavers/gles/Makefile.in -new file mode 100644 -index 0000000..b83237d ---- /dev/null -+++ b/xbmc/screensavers/gles/Makefile.in -@@ -0,0 +1,6 @@ -+SRCS=triangle2.cpp -+ -+LIB=gleshelpers.a -+ -+include @abs_top_srcdir@/Makefile.include -+-include $(patsubst %.cpp,%.P,$(patsubst %.c,%.P,$(SRCS))) -diff --git a/xbmc/screensavers/gles/ball/Makefile.in b/xbmc/screensavers/gles/ball/Makefile.in -new file mode 100644 -index 0000000..d788075 ---- /dev/null -+++ b/xbmc/screensavers/gles/ball/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libball.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.ball/Ball.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=ball -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/ball/wrapper.cc b/xbmc/screensavers/gles/ball/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/ball/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/noise/Makefile.in b/xbmc/screensavers/gles/noise/Makefile.in -new file mode 100644 -index 0000000..ef3287c ---- /dev/null -+++ b/xbmc/screensavers/gles/noise/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libnoise.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.noise/Noise.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=noise -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/noise/wrapper.cc b/xbmc/screensavers/gles/noise/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/noise/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/plasma/Makefile.in b/xbmc/screensavers/gles/plasma/Makefile.in -new file mode 100644 -index 0000000..a69c159 ---- /dev/null -+++ b/xbmc/screensavers/gles/plasma/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libplasma.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.plasma/Plasma.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=plasma -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/plasma/wrapper.cc b/xbmc/screensavers/gles/plasma/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/plasma/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/plasma2/Makefile.in b/xbmc/screensavers/gles/plasma2/Makefile.in -new file mode 100644 -index 0000000..264e576 ---- /dev/null -+++ b/xbmc/screensavers/gles/plasma2/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libplasma2.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.plasma2/Plasma2.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=plasma2 -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/plasma2/wrapper.cc b/xbmc/screensavers/gles/plasma2/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/plasma2/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/solarwinds/Makefile.in b/xbmc/screensavers/gles/solarwinds/Makefile.in -new file mode 100644 -index 0000000..8d4e845 ---- /dev/null -+++ b/xbmc/screensavers/gles/solarwinds/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libsolarwinds.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.solarwinds/Solarwinds.xbs -+endif -+OBJS = wrapper.o solarwinds.o -+DEFINES += -DSCREENSAVER=solarwinds -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/solarwinds/solarwinds.c b/xbmc/screensavers/gles/solarwinds/solarwinds.c -new file mode 100644 -index 0000000..a1125cf ---- /dev/null -+++ b/xbmc/screensavers/gles/solarwinds/solarwinds.c -@@ -0,0 +1,530 @@ -+/* -+Copyright (c) 2012, Broadcom Europe Ltd -+All rights reserved. -+ -+Redistribution and use in source and binary forms, with or without -+modification, are permitted provided that the following conditions are met: -+ * Redistributions of source code must retain the above copyright -+ notice, this list of conditions and the following disclaimer. -+ * Redistributions in binary form must reproduce the above copyright -+ notice, this list of conditions and the following disclaimer in the -+ documentation and/or other materials provided with the distribution. -+ * Neither the name of the copyright holder nor the -+ names of its contributors may be used to endorse or promote products -+ derived from this software without specific prior written permission. -+ -+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+*/ -+ -+// OpenGL|ES 2 demo using shader to compute particle/render sets -+// Thanks to Peter de Rivas for original Python code -+ -+#include <stdio.h> -+#include <fcntl.h> -+#include <stdlib.h> -+#include <string.h> -+#include <math.h> -+#include <assert.h> -+#include <unistd.h> -+#include <stddef.h> -+ -+#include "solarwinds.h" -+ -+#define PARTICLE_WIDTH 16 -+#define PARTICLE_HEIGHT 16 -+ -+#define min(a,b) ((a)<(b)?(a):(b)) -+#define max(a,b) ((a)<(b)?(b):(a)) -+ -+#define check() assert(glGetError() == 0) -+ -+static void showlog(GLint shader) -+{ -+ // Prints the compile log for a shader -+ char log[1024]; -+ glGetShaderInfoLog(shader,sizeof log,NULL,log); -+ printf("%d:shader:\n%s\n", shader, log); -+} -+ -+static void showprogramlog(GLint shader) -+{ -+ // Prints the information log for a program object -+ char log[1024]; -+ glGetProgramInfoLog(shader,sizeof log,NULL,log); -+ printf("%d:program:\n%s\n", shader, log); -+} -+ -+static void *create_particle_tex(int width, int height) -+{ -+ int i, j; -+ unsigned char *q = malloc(width * height * 4); -+ if (!q) -+ return NULL; -+ unsigned char *p = q; -+ for (j=0; j<height; j++) { -+ for (i=0; i<width; i++) { -+ float x = ((float)i + 0.5f) / (float)width - 0.5f; -+ float y = ((float)j + 0.5f) / (float)height - 0.5f; -+ float d = 1.0f-2.0f*sqrtf(x*x + y*y); -+ unsigned v = 255.0f * max(min(d, 1.0f), 0.0f); -+ *p++ = 255; -+ *p++ = 255; -+ *p++ = 255; -+ *p++ = v; -+ } -+ } -+ return q; -+} -+ -+void solarwinds_init_shaders(CUBE_STATE_T *state) -+{ -+ const GLchar *particle_vshader_source = -+ //"// Attributes" -+ "attribute vec4 aPos;" -+ "attribute vec4 aShade;" -+ "" -+ //"// Uniforms" -+ "uniform mat4 uProjectionMatrix;" -+ "varying vec4 vShade;" -+ "" -+ "void main(void)" -+ "{" -+ " gl_Position = uProjectionMatrix * vec4(aPos.x/60.0, aPos.y/60.0, (16.0-aPos.z)/60.0, 1.0);" -+ " gl_PointSize = 16.0/gl_Position.w;" -+ " vShade = aShade;" -+ "}"; -+ -+ //particle -+ const GLchar *particle_fshader_source = -+ //" Input from Vertex Shader" -+ "varying vec4 vShade;" -+ "" -+ //" Uniforms" -+ "uniform sampler2D uTexture;" -+ "" -+ "void main(void)" -+ "{" -+ " vec4 texture = texture2D(uTexture, gl_PointCoord);" -+ " vec4 color = clamp(vShade, vec4(0.0), vec4(1.0));" -+ " gl_FragColor = texture * color;" -+ "}"; -+ -+ state->mvshader = glCreateShader(GL_VERTEX_SHADER); -+ glShaderSource(state->mvshader, 1, &particle_vshader_source, 0); -+ glCompileShader(state->mvshader); -+ check(); -+ -+ if (state->verbose) -+ showlog(state->mvshader); -+ -+ state->mshader = glCreateShader(GL_FRAGMENT_SHADER); -+ glShaderSource(state->mshader, 1, &particle_fshader_source, 0); -+ glCompileShader(state->mshader); -+ check(); -+ -+ if (state->verbose) -+ showlog(state->mshader); -+ -+ // particle -+ state->program_particle = glCreateProgram(); -+ glAttachShader(state->program_particle, state->mvshader); -+ glAttachShader(state->program_particle, state->mshader); -+ glLinkProgram(state->program_particle); -+ glDetachShader(state->program_particle, state->mvshader); -+ glDetachShader(state->program_particle, state->mshader); -+ glDeleteShader(state->mvshader); -+ glDeleteShader(state->mshader); -+ check(); -+ -+ if (state->verbose) -+ showprogramlog(state->program_particle); -+ -+ state->aPos = glGetAttribLocation(state->program_particle, "aPos"); -+ state->uProjectionMatrix = glGetUniformLocation(state->program_particle, "uProjectionMatrix"); -+ state->aShade = glGetAttribLocation(state->program_particle, "aShade"); -+ state->uTexture = glGetUniformLocation(state->program_particle, "uTexture"); -+ check(); -+ -+ glGenBuffers(1, &state->particleBuffer); -+ -+ check(); -+ -+ // Prepare a texture image -+ glGenTextures(1, &state->tex_particle); -+ check(); -+ glBindTexture(GL_TEXTURE_2D, state->tex_particle); -+ check(); -+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); -+ state->tex_particle_data = create_particle_tex(PARTICLE_WIDTH, PARTICLE_HEIGHT); -+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, PARTICLE_WIDTH, PARTICLE_HEIGHT, 0, GL_RGBA, GL_UNSIGNED_BYTE, state->tex_particle_data); -+ check(); -+ -+ // Upload vertex data to a buffer -+ glBindBuffer(GL_ARRAY_BUFFER, state->particleBuffer); -+ -+ // Create Vertex Buffer Object (VBO) -+ glBufferData( // Fill bound buffer with particles -+ GL_ARRAY_BUFFER, // Buffer target -+ sizeof(state->particles), // Buffer data size -+ state->particles, // Buffer data pointer -+ GL_DYNAMIC_DRAW); // Usage - Data never changes; used for drawing -+ check(); -+} -+ -+void solarwinds_deinit_shaders(CUBE_STATE_T *state) -+{ -+ glDeleteProgram(state->program_particle); -+ check(); -+ -+ glDeleteBuffers(1, &state->particleBuffer); -+ check(); -+ -+ glDeleteTextures(1, &state->tex_particle); -+ check(); -+ -+ free(state->tex_particle_data); -+} -+ -+static void draw_particle_to_texture(CUBE_STATE_T *state) -+{ -+ glClearColor ( 0.0, 0.0, 0.0, 1.0 ); -+ glClear(GL_COLOR_BUFFER_BIT); -+ -+ glBindTexture(GL_TEXTURE_2D, state->tex_particle); -+ glEnable(GL_BLEND); -+ glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -+ -+ glBindBuffer(GL_ARRAY_BUFFER, state->particleBuffer); -+ -+ int remaining = state->numParticles - state->whichParticle; -+ // Create Vertex Buffer Object (VBO) -+ glBufferSubData( // Fill bound buffer with particles -+ GL_ARRAY_BUFFER, // Buffer target -+ 0, -+ remaining * sizeof(state->particles[0]), // Buffer data size -+ state->particles + state->whichParticle // Buffer data pointer -+ ); // Usage - Data never changes; used for drawing -+ check(); -+ // Create Vertex Buffer Object (VBO) -+ glBufferSubData( // Fill bound buffer with particles -+ GL_ARRAY_BUFFER, // Buffer target -+ remaining * sizeof(state->particles[0]), -+ state->whichParticle * sizeof(state->particles[0]), // Buffer data size -+ state->particles // Buffer data pointer -+ ); // Usage - Data never changes; used for drawing -+ check(); -+ -+ glUseProgram ( state->program_particle ); -+ check(); -+ // uniforms -+ const GLfloat projectionMatrix[] = { -+ 1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 0.0f, 1.0f -+ }; -+ glUniformMatrix4fv(state->uProjectionMatrix, 1, 0, projectionMatrix); -+ glUniform1i(state->uTexture, 0); // first currently bound texture "GL_TEXTURE0" -+ check(); -+ -+ // Attributes -+ glEnableVertexAttribArray(state->aPos); -+ glVertexAttribPointer(state->aPos, // Set pointer -+ 4, // One component per particle -+ GL_FLOAT, // Data is floating point type -+ GL_FALSE, // No fixed point scaling -+ sizeof(struct Particle), // No gaps in data -+ (void*)(offsetof(struct Particle, pos))); // Start from "theta" offset within bound buffer -+ -+ glEnableVertexAttribArray(state->aShade); -+ glVertexAttribPointer(state->aShade, // Set pointer -+ 4, // Three components per particle -+ GL_FLOAT, // Data is floating point type -+ GL_FALSE, // No fixed point scaling -+ sizeof(struct Particle), // No gaps in data -+ (void*)(offsetof(struct Particle, shade))); // Start from "shade" offset within bound buffer -+ -+ // Draw particles -+ glDrawArrays(GL_POINTS, 0, state->numParticles); -+ -+ glDisable(GL_BLEND); -+ glBindTexture(GL_TEXTURE_2D, 0); -+ -+ glDisableVertexAttribArray(state->aPos); -+ glDisableVertexAttribArray(state->aShade); -+ -+ glBindBuffer(GL_ARRAY_BUFFER, 0); -+ check(); -+} -+ -+//============================================================================== -+ -+static float randrange(float min, float max) -+{ -+ return min + rand() * ((max-min) / RAND_MAX); -+} -+ -+void solarwinds_init(CUBE_STATE_T *state) -+{ -+ int i; -+ state->numWinds = 1; -+ state->numEmitters = min(30, NUMEMITTERS); -+ state->numParticles = min(2000, NUM_PARTICLES); -+ state->size = 50.0f; -+ state->windSpeed = 20.0f; -+ state->emitterSpeed = 15.0f; -+ state->particleSpeed = 10.0f; -+ state->blur = 40.0f; -+ state->eVel = state->emitterSpeed * 0.01f; -+ -+ for (i = 0; i < NUMCONSTS; ++i) { -+ state->_ct[i] = randrange(0.0f, M_PI * 2.0f); -+ state->_cv[i] = randrange(0.0f, 0.00005f * state->windSpeed * state->windSpeed) + -+ 0.00001f * state->windSpeed * state->windSpeed; -+ } -+ for (i=0; i<NUMEMITTERS; i++) -+ { -+ state->emitter[i].x = randrange(0.0f, 60.0f) - 30.0f; -+ state->emitter[i].y = randrange(0.0f, 60.0f) - 30.0f, -+ state->emitter[i].z = randrange(0.0f, 30.0f) - 15.0f; -+ } -+} -+ -+void solarwinds_update(CUBE_STATE_T *state) -+{ -+ int i; -+ // update constants -+ for (i = 0; i < NUMCONSTS; ++i) { -+ state->_ct[i] += state->_cv[i]; -+ if (state->_ct[i] > M_PI * 2.0f) -+ state->_ct[i] -= M_PI * 2.0f; -+ state->_c[i] = cosf(state->_ct[i]); -+ } -+ -+ // calculate emissions -+ for (i = 0; i < state->numEmitters; ++i) { -+ // emitter moves toward viewer -+ state->emitter[i].z += state->eVel; -+ if (state->emitter[i].z > 15.0f) { // reset emitter -+ state->emitter[i].x = randrange(0.0f, 60.0f) - 30.0f; -+ state->emitter[i].y = randrange(0.0f, 60.0f) - 30.0f, -+ state->emitter[i].z = -15.0f; -+ } -+ Particle *p = state->particles + state->whichParticle; -+ p->pos[0] = state->emitter[i].x; -+ p->pos[1] = state->emitter[i].y; -+ p->pos[2] = state->emitter[i].z; -+ p->pos[3] = 1.0; -+ p->shade[3] = 1.0f; -+ -+ ++state->whichParticle; -+ if (state->whichParticle >= state->numParticles) -+ state->whichParticle = 0; -+ } -+ -+ // calculate particle positions and colors -+ // first modify constants that affect colors -+ state->_c[6] *= 9.0f / state->particleSpeed; -+ state->_c[7] *= 9.0f / state->particleSpeed; -+ state->_c[8] *= 9.0f / state->particleSpeed; -+ // then update each particle -+ float pVel = state->particleSpeed * 0.01f; -+ for (i = 0; i < state->numParticles; ++i) { -+ Particle *p = state->particles + i; -+ // store old positions -+ float x = p->pos[0]; -+ float y = p->pos[1]; -+ float z = p->pos[2]; -+ // make new positions -+ p->pos[0] = x + (state->_c[0] * y + state->_c[1] * z) * pVel; -+ p->pos[1] = y + (state->_c[2] * z + state->_c[3] * x) * pVel; -+ p->pos[2] = z + (state->_c[4] * x + state->_c[5] * y) * pVel; -+ // calculate colors -+ p->shade[0] = abs((p->pos[0] - x) * state->_c[6]); -+ p->shade[1] = abs((p->pos[1] - y) * state->_c[7]); -+ p->shade[2] = abs((p->pos[2] - z) * state->_c[8]); -+ } -+} -+ -+void solarwinds_render(CUBE_STATE_T *state) -+{ -+ draw_particle_to_texture(state); -+} -+ -+#ifdef STANDALONE -+ -+typedef struct -+{ -+ uint32_t screen_width; -+ uint32_t screen_height; -+// OpenGL|ES objects -+ EGLDisplay display; -+ EGLSurface surface; -+ EGLContext context; -+} EGL_STATE_T; -+ -+uint64_t GetTimeStamp() { -+ struct timeval tv; -+ gettimeofday(&tv,NULL); -+ return tv.tv_sec*(uint64_t)1000000+tv.tv_usec; -+} -+ -+/*********************************************************** -+ * Name: init_ogl -+ * -+ * Arguments: -+ * CUBE_STATE_T *state - holds OGLES model info -+ * -+ * Description: Sets the display, OpenGL|ES context and screen stuff -+ * -+ * Returns: void -+ * -+ ***********************************************************/ -+static void init_ogl(EGL_STATE_T *state) -+{ -+ int32_t success = 0; -+ EGLBoolean result; -+ EGLint num_config; -+ -+ static EGL_DISPMANX_WINDOW_T nativewindow; -+ -+ DISPMANX_ELEMENT_HANDLE_T dispman_element; -+ DISPMANX_DISPLAY_HANDLE_T dispman_display; -+ DISPMANX_UPDATE_HANDLE_T dispman_update; -+ VC_RECT_T dst_rect; -+ VC_RECT_T src_rect; -+ -+ static const EGLint attribute_list[] = -+ { -+ EGL_RED_SIZE, 8, -+ EGL_GREEN_SIZE, 8, -+ EGL_BLUE_SIZE, 8, -+ EGL_ALPHA_SIZE, 8, -+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT, -+ EGL_NONE -+ }; -+ -+ static const EGLint context_attributes[] = -+ { -+ EGL_CONTEXT_CLIENT_VERSION, 2, -+ EGL_NONE -+ }; -+ EGLConfig config; -+ -+ // get an EGL display connection -+ state->display = eglGetDisplay(EGL_DEFAULT_DISPLAY); -+ assert(state->display!=EGL_NO_DISPLAY); -+ check(); -+ -+ // initialize the EGL display connection -+ result = eglInitialize(state->display, NULL, NULL); -+ assert(EGL_FALSE != result); -+ check(); -+ -+ // get an appropriate EGL frame buffer configuration -+ result = eglChooseConfig(state->display, attribute_list, &config, 1, &num_config); -+ assert(EGL_FALSE != result); -+ check(); -+ -+ // get an appropriate EGL frame buffer configuration -+ result = eglBindAPI(EGL_OPENGL_ES_API); -+ assert(EGL_FALSE != result); -+ check(); -+ -+ // create an EGL rendering context -+ state->context = eglCreateContext(state->display, config, EGL_NO_CONTEXT, context_attributes); -+ assert(state->context!=EGL_NO_CONTEXT); -+ check(); -+ -+ // create an EGL window surface -+ success = graphics_get_display_size(0 /* LCD */, &state->screen_width, &state->screen_height); -+ assert( success >= 0 ); -+ -+ dst_rect.x = 0; -+ dst_rect.y = 0; -+ dst_rect.width = state->screen_width; -+ dst_rect.height = state->screen_height; -+ -+ src_rect.x = 0; -+ src_rect.y = 0; -+ src_rect.width = state->screen_width << 16; -+ src_rect.height = state->screen_height << 16; -+ -+ dispman_display = vc_dispmanx_display_open( 0 /* LCD */); -+ dispman_update = vc_dispmanx_update_start( 0 ); -+ -+ dispman_element = vc_dispmanx_element_add ( dispman_update, dispman_display, -+ 0/*layer*/, &dst_rect, 0/*src*/, -+ &src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0/*clamp*/, 0/*transform*/); -+ -+ nativewindow.element = dispman_element; -+ nativewindow.width = state->screen_width; -+ nativewindow.height = state->screen_height; -+ vc_dispmanx_update_submit_sync( dispman_update ); -+ -+ check(); -+ -+ state->surface = eglCreateWindowSurface( state->display, config, &nativewindow, NULL ); -+ assert(state->surface != EGL_NO_SURFACE); -+ check(); -+ -+ // connect the context to the surface -+ result = eglMakeCurrent(state->display, state->surface, state->surface, state->context); -+ assert(EGL_FALSE != result); -+ check(); -+} -+ -+int main () -+{ -+ int terminate = 0; -+ CUBE_STATE_T _state, *state=&_state; -+ EGL_STATE_T _eglstate, *eglstate=&_eglstate; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ memset( eglstate, 0, sizeof( *eglstate ) ); -+ state->verbose = 1; -+ bcm_host_init(); -+ // Start OGLES -+ init_ogl(eglstate); -+again: -+ solarwinds_init(state); -+ solarwinds_init_shaders(state); -+ -+ int frames = 0; -+ uint64_t ts = GetTimeStamp(); -+ while (!terminate) -+ { -+ solarwinds_update(state); -+ solarwinds_render(state); -+ //glFlush(); -+ //glFinish(); -+ check(); -+ -+ eglSwapBuffers(eglstate->display, eglstate->surface); -+ check(); -+ -+ frames++; -+ uint64_t ts2 = GetTimeStamp(); -+ if (ts2 - ts > 1e6) -+ { -+ printf("%d fps\n", frames); -+ ts += 1e6; -+ frames = 0; -+ } -+ } -+ solarwinds_deinit_shaders(state); -+ goto again; -+ return 0; -+} -+#endif -+ -diff --git a/xbmc/screensavers/gles/solarwinds/solarwinds.h b/xbmc/screensavers/gles/solarwinds/solarwinds.h -new file mode 100644 -index 0000000..1e9a761 ---- /dev/null -+++ b/xbmc/screensavers/gles/solarwinds/solarwinds.h -@@ -0,0 +1,60 @@ -+#pragma once -+ -+#include "GLES2/gl2.h" -+#include "EGL/egl.h" -+#include "EGL/eglext.h" -+ -+#define NUM_PARTICLES 2000 -+#define NUMCONSTS 9 -+#define NUMEMITTERS 30 -+ -+typedef struct Particle -+{ -+ GLfloat pos[4]; -+ GLfloat shade[4]; -+} Particle; -+ -+typedef struct Emitter -+{ -+ GLfloat x, y, z; -+} Emitter; -+ -+typedef struct -+{ -+ GLuint verbose; -+ GLuint mvshader; -+ GLuint mshader; -+ GLuint program_particle; -+ GLuint tex_particle; -+ GLuint particleBuffer; -+// particle attribs -+ GLuint aPos, aShade, uProjectionMatrix, uTexture; -+ -+ Emitter emitter[NUMEMITTERS]; -+ Particle particles[NUM_PARTICLES]; -+ void *tex_particle_data; -+ -+ float _c[NUMCONSTS]; -+ float _ct[NUMCONSTS]; -+ float _cv[NUMCONSTS]; -+ -+ unsigned int numWinds; -+ unsigned int numEmitters; -+ unsigned int numParticles; -+ unsigned int whichParticle; -+ float size; -+ float windSpeed; -+ float emitterSpeed; -+ float particleSpeed; -+ float blur; -+ float eVel; -+} CUBE_STATE_T; -+ -+ -+void solarwinds_init_shaders(CUBE_STATE_T *state); -+void solarwinds_init(CUBE_STATE_T *state); -+void solarwinds_update(CUBE_STATE_T *state); -+void solarwinds_render(CUBE_STATE_T *state); -+void solarwinds_deinit_shaders(CUBE_STATE_T *state); -+ -+ -diff --git a/xbmc/screensavers/gles/solarwinds/wrapper.cc b/xbmc/screensavers/gles/solarwinds/wrapper.cc -new file mode 100644 -index 0000000..edad7c7 ---- /dev/null -+++ b/xbmc/screensavers/gles/solarwinds/wrapper.cc -@@ -0,0 +1,96 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "solarwinds.h" -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ //state->width = scrprops->width; -+ //state->height = scrprops->height; -+ solarwinds_init(state); -+ solarwinds_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ solarwinds_update(state); -+ solarwinds_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ solarwinds_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/spiral/Makefile.in b/xbmc/screensavers/gles/spiral/Makefile.in -new file mode 100644 -index 0000000..5f57c7d ---- /dev/null -+++ b/xbmc/screensavers/gles/spiral/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libspiral.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.spiral/Spiral.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=spiral -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/spiral/wrapper.cc b/xbmc/screensavers/gles/spiral/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/spiral/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/stellar/Makefile.in b/xbmc/screensavers/gles/stellar/Makefile.in -new file mode 100644 -index 0000000..ef8f5b1 ---- /dev/null -+++ b/xbmc/screensavers/gles/stellar/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libstellar.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.stellar/Stellar.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=stellar -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/stellar/wrapper.cc b/xbmc/screensavers/gles/stellar/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/stellar/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/screensavers/gles/triangle2.c b/xbmc/screensavers/gles/triangle2.c -new file mode 100644 -index 0000000..6fe1155 ---- /dev/null -+++ b/xbmc/screensavers/gles/triangle2.c -@@ -0,0 +1,988 @@ -+/* -+Copyright (c) 2012, Broadcom Europe Ltd -+All rights reserved. -+ -+Redistribution and use in source and binary forms, with or without -+modification, are permitted provided that the following conditions are met: -+ * Redistributions of source code must retain the above copyright -+ notice, this list of conditions and the following disclaimer. -+ * Redistributions in binary form must reproduce the above copyright -+ notice, this list of conditions and the following disclaimer in the -+ documentation and/or other materials provided with the distribution. -+ * Neither the name of the copyright holder nor the -+ names of its contributors may be used to endorse or promote products -+ derived from this software without specific prior written permission. -+ -+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY -+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+*/ -+ -+// OpenGL|ES 2 demo using shader to compute plasma/render sets -+// Thanks to Peter de Rivas for original Python code -+ -+#include <stdio.h> -+#include <fcntl.h> -+#include <stdlib.h> -+#include <string.h> -+#include <math.h> -+#include <assert.h> -+#include <unistd.h> -+#include <sys/time.h> -+ -+#include "triangle2.h" -+ -+#define min(a,b) ((a)<(b)?(a):(b)) -+#define max(a,b) ((a)<(b)?(b):(a)) -+#define TO_STRING(...) #__VA_ARGS__ -+ -+#define check() assert(glGetError() == 0) -+ -+static void showlog(GLint shader) -+{ -+ // Prints the compile log for a shader -+ char log[1024]; -+ glGetShaderInfoLog(shader, sizeof log, NULL, log); -+ printf("%d:shader:\n%s\n", shader, log); -+} -+ -+static void showprogramlog(GLint shader) -+{ -+ // Prints the information log for a program object -+ char log[1024]; -+ glGetProgramInfoLog(shader, sizeof log, NULL, log); -+ printf("%d:program:\n%s\n", shader, log); -+} -+ -+static void *create_particle_tex(int width, int height) -+{ -+ int i, j; -+ unsigned char *q = malloc(width * height * 4); -+ if (!q) -+ return NULL; -+ unsigned char *p = q; -+ for (j=0; j<height; j++) { -+ for (i=0; i<width; i++) { -+ float x = ((float)i + 0.5f) / (float)width - 0.5f; -+ float y = ((float)j + 0.5f) / (float)height - 0.5f; -+ float d = 1.0f-2.0f*sqrtf(x*x + y*y); -+ unsigned v = 255.0f * max(min(d, 1.0f), 0.0f); -+ *p++ = 255; -+ *p++ = 255; -+ *p++ = 255; -+ *p++ = v; -+ } -+ } -+ return q; -+} -+ -+static void *create_checkerboard_tex(int width, int height) -+{ -+ int i, j; -+ unsigned char *q = malloc(width * height * 4); -+ if (!q) -+ return NULL; -+ unsigned char *p = q; -+ for (j=0; j<height; j++) { -+ for (i=0; i<width; i++) { -+ int b = (i+j) & 1; -+ *p++ = b ? 255:0; -+ *p++ = b ? 255:0; -+ *p++ = b ? 255:0; -+ *p++ = b ? 255:0; -+ } -+ } -+ return q; -+} -+ -+static void *create_border_tex(int width, int height) -+{ -+ int i, j; -+ unsigned char *q = malloc(width * height * 4); -+ if (!q) -+ return NULL; -+ unsigned char *p = q; -+ for (j=0; j<height; j++) { -+ for (i=0; i<width; i++) { -+ int b = i == 16 || i == 20 || i == width-1-16 || j == 16 || j == height-1-16; -+ *p++ = b ? 255:0; -+ *p++ = b ? 255:0; -+ *p++ = b ? 255:0; -+ *p++ = b ? 255:0; -+ } -+ } -+ return q; -+} -+ -+static void *create_noise_tex(int width, int height) -+{ -+ int i, j; -+ unsigned char *q = malloc(width * height * 4); -+ if (!q) -+ return NULL; -+ unsigned char *p = q; -+ for (j=0; j<height; j++) { -+ for (i=0; i<width; i++) { -+ *p++ = (rand() >> 16) & 0xff; -+ *p++ = (rand() >> 16) & 0xff; -+ *p++ = (rand() >> 16) & 0xff; -+ *p++ = 255; -+ } -+ } -+ return q; -+} -+ -+static void *create_framebuffer_tex(int width, int height) -+{ -+#ifdef STANDALONE -+ return create_border_tex(width, height); -+#else -+ unsigned char *q = malloc(width * height * 4); -+ if (!q) -+ return NULL; -+ -+ glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, q); -+ check(); -+ return q; -+#endif -+} -+ -+void screensaver_init_shaders(CUBE_STATE_T *state) -+{ -+ static const GLfloat vertex_data[] = { -+ -1.0,1.0,1.0,1.0, -+ 1.0,1.0,1.0,1.0, -+ 1.0,-1.0,1.0,1.0, -+ -1.0,-1.0,1.0,1.0, -+ }; -+ // effect -+ state->effect_vshader = glCreateShader(GL_VERTEX_SHADER); -+ glShaderSource(state->effect_vshader, 1, &state->effect_vshader_source, 0); -+ glCompileShader(state->effect_vshader); -+ check(); -+ -+ if (state->verbose) -+ showlog(state->effect_vshader); -+ -+ state->effect_fshader = glCreateShader(GL_FRAGMENT_SHADER); -+ glShaderSource(state->effect_fshader, 1, &state->effect_fshader_source, 0); -+ glCompileShader(state->effect_fshader); -+ check(); -+ -+ if (state->verbose) -+ showlog(state->effect_fshader); -+ -+ state->effect_program = glCreateProgram(); -+ glAttachShader(state->effect_program, state->effect_vshader); -+ glAttachShader(state->effect_program, state->effect_fshader); -+ glLinkProgram(state->effect_program); -+ glDetachShader(state->effect_program, state->effect_vshader); -+ glDetachShader(state->effect_program, state->effect_fshader); -+ glDeleteShader(state->effect_vshader); -+ glDeleteShader(state->effect_fshader); -+ check(); -+ -+ if (state->verbose) -+ showprogramlog(state->effect_program); -+ -+ state->attr_vertex = glGetAttribLocation(state->effect_program, "vertex"); -+ state->uResolution = glGetUniformLocation(state->effect_program, "iResolution"); -+ state->uMouse = glGetUniformLocation(state->effect_program, "iMouse"); -+ state->uTime = glGetUniformLocation(state->effect_program, "iGlobalTime"); -+ state->uChannel0 = glGetUniformLocation(state->effect_program, "iChannel0"); -+ state->uScale = glGetUniformLocation(state->effect_program, "uScale"); -+ check(); -+ -+ // render -+ state->render_vshader = glCreateShader(GL_VERTEX_SHADER); -+ check(); -+ glShaderSource(state->render_vshader, 1, &state->render_vshader_source, 0); -+ check(); -+ glCompileShader(state->render_vshader); -+ check(); -+ -+ if (state->verbose) -+ showlog(state->render_vshader); -+ -+ state->render_fshader = glCreateShader(GL_FRAGMENT_SHADER); -+ glShaderSource(state->render_fshader, 1, &state->render_fshader_source, 0); -+ glCompileShader(state->render_fshader); -+ check(); -+ -+ if (state->verbose) -+ showlog(state->render_fshader); -+ -+ state->render_program = glCreateProgram(); -+ glAttachShader(state->render_program, state->render_vshader); -+ glAttachShader(state->render_program, state->render_fshader); -+ glLinkProgram(state->render_program); -+ glDetachShader(state->render_program, state->render_vshader); -+ glDetachShader(state->render_program, state->render_fshader); -+ glDeleteShader(state->render_vshader); -+ glDeleteShader(state->render_fshader); -+ check(); -+ -+ if (state->verbose) -+ showprogramlog(state->render_program); -+ -+ state->uTexture = glGetUniformLocation(state->render_program, "uTexture"); -+ check(); -+ -+ if (state->fbwidth && state->fbheight) -+ { -+ // Prepare a texture to render to -+ glGenTextures(1, &state->framebuffer_texture); -+ check(); -+ glActiveTexture(GL_TEXTURE0); -+ glBindTexture(GL_TEXTURE_2D, state->framebuffer_texture); -+ check(); -+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, state->fbwidth, state->fbheight, 0, GL_RGB, GL_UNSIGNED_BYTE, 0); -+ check(); -+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -+ check(); -+ // Prepare a framebuffer for rendering -+ glGenFramebuffers(1, &state->effect_fb); -+ check(); -+ glBindFramebuffer(GL_FRAMEBUFFER, state->effect_fb); -+ check(); -+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, state->framebuffer_texture, 0); -+ check(); -+ glBindFramebuffer(GL_FRAMEBUFFER, 0); -+ check(); -+ } -+ // Prepare a texture image -+ if (state->effect_texture_data) -+ { -+ glGenTextures(1, &state->effect_texture); -+ check(); -+ glActiveTexture(GL_TEXTURE0); -+ glBindTexture(GL_TEXTURE_2D, state->effect_texture); -+ check(); -+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); -+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, state->texwidth, state->texheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, state->effect_texture_data); -+ check(); -+ } -+ // Upload vertex data to a buffer -+ glGenBuffers(1, &state->vertex_buffer); -+ glBindBuffer(GL_ARRAY_BUFFER, state->vertex_buffer); -+ glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW); -+ check(); -+} -+ -+void screensaver_deinit_shaders(CUBE_STATE_T *state) -+{ -+ glDeleteProgram(state->render_program); -+ glDeleteProgram(state->effect_program); -+ check(); -+ -+ glDeleteBuffers(1, &state->vertex_buffer); -+ if (state->framebuffer_texture) -+ { -+ glDeleteTextures(1, &state->framebuffer_texture); -+ check(); -+ } -+ if (state->effect_fb) -+ { -+ glDeleteFramebuffers(1, &state->effect_fb); -+ check(); -+ } -+ if (state->effect_texture) -+ { -+ glDeleteTextures(1, &state->effect_texture); -+ check(); -+ } -+ if (state->effect_texture_data) -+ free(state->effect_texture_data); -+} -+ -+static void draw_effect_to_texture(CUBE_STATE_T *state) -+{ -+ // Draw the effect to a texture -+ if (state->effect_fb) -+ glBindFramebuffer(GL_FRAMEBUFFER, state->effect_fb); -+ else -+ glBindFramebuffer(GL_FRAMEBUFFER, 0); -+ check(); -+ -+ glBindBuffer(GL_ARRAY_BUFFER, state->vertex_buffer); -+ check(); -+ glUseProgram( state->effect_program ); -+ check(); -+ if (state->effect_texture) -+ { -+ glActiveTexture(GL_TEXTURE0); -+ glBindTexture(GL_TEXTURE_2D, state->effect_texture); -+ check(); -+ //glEnable(GL_BLEND); -+ //glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); -+ } -+ glUniform3f(state->uResolution, state->width, state->height, 1.0f); -+ glUniform2f(state->uMouse, state->mousex, state->mousey); -+ glUniform1f(state->uTime, state->time); -+ glUniform1i(state->uChannel0, 0); // first currently bound texture "GL_TEXTURE0" -+ if (state->effect_fb) -+ glUniform2f(state->uScale, (GLfloat)state->width/state->fbwidth, (GLfloat)state->height/state->fbheight); -+ else -+ glUniform2f(state->uScale, 1.0, 1.0); -+ check(); -+ -+ glVertexAttribPointer(state->attr_vertex, 4, GL_FLOAT, 0, 16, 0); -+ glEnableVertexAttribArray(state->attr_vertex); -+ -+ glDrawArrays( GL_TRIANGLE_FAN, 0, 4 ); -+ check(); -+ -+ glDisableVertexAttribArray(state->attr_vertex); -+ glBindTexture(GL_TEXTURE_2D, 0); -+ glBindBuffer(GL_ARRAY_BUFFER, 0); -+ check(); -+} -+ -+static void draw_triangles(CUBE_STATE_T *state) -+{ -+ // already on framebuffer -+ if (!state->framebuffer_texture) -+ return; -+ // Now render to the main frame buffer -+ glBindFramebuffer(GL_FRAMEBUFFER, 0); -+ check(); -+ -+ glBindBuffer(GL_ARRAY_BUFFER, state->vertex_buffer); -+ check(); -+ glUseProgram ( state->render_program ); -+ check(); -+ glActiveTexture(GL_TEXTURE0); -+ glBindTexture(GL_TEXTURE_2D, state->framebuffer_texture); -+ check(); -+ glUniform1i(state->uTexture, 0); // first currently bound texture "GL_TEXTURE0" -+ check(); -+ -+ glVertexAttribPointer(state->attr_vertex, 4, GL_FLOAT, 0, 16, 0); -+ glEnableVertexAttribArray(state->attr_vertex); -+ check(); -+ -+ glDrawArrays( GL_TRIANGLE_FAN, 0, 4 ); -+ check(); -+ -+ glDisableVertexAttribArray(state->attr_vertex); -+ glBindTexture(GL_TEXTURE_2D, 0); -+ glBindBuffer(GL_ARRAY_BUFFER, 0); -+ check(); -+} -+ -+//============================================================================== -+ -+static float randrange(float min, float max) -+{ -+ return min + rand() * ((max-min) / RAND_MAX); -+} -+ -+void screensaver_init(CUBE_STATE_T *state) -+{ -+ int i; -+ for (i = 0; i < NUMCONSTS; ++i) { -+ state->_ct[i] = randrange(0.0f, M_PI * 2.0f); -+ state->_cv[i] = randrange(0.0f, 0.00005f) + -+ 0.00001f; -+ } -+} -+ -+uint64_t GetTimeStamp() { -+ struct timeval tv; -+ gettimeofday(&tv,NULL); -+ return tv.tv_sec*(uint64_t)1000000+tv.tv_usec; -+} -+ -+void screensaver_update(CUBE_STATE_T *state) -+{ -+ int i; -+ // update constants -+ for (i = 0; i < NUMCONSTS; ++i) { -+ state->_ct[i] += state->_cv[i]; -+ if (state->_ct[i] > M_PI * 2.0f) -+ state->_ct[i] -= M_PI * 2.0f; -+ state->_c[i] = cosf(state->_ct[i]); -+ } -+ uint64_t t = GetTimeStamp(); -+ if (state->last_time) -+ state->time += (t-state->last_time) * 1e-6; -+ state->last_time = t; -+ //if (state->time > 12.0f + M_PI) -+ // state->time -= 12.0f * M_PI; -+} -+ -+void screensaver_render(CUBE_STATE_T *state) -+{ -+ draw_effect_to_texture(state); -+ draw_triangles(state); -+} -+ -+void setup_screensaver_default(CUBE_STATE_T *state) -+{ -+ state->effect_vshader_source = TO_STRING( -+ attribute vec4 vertex; -+ varying vec2 vTextureCoord; -+ uniform vec2 uScale; -+ void main(void) -+ { -+ gl_Position = vertex; -+ vTextureCoord = vertex.xy*0.5+0.5; -+ vTextureCoord.x = vTextureCoord.x * uScale.x; -+ vTextureCoord.y = vTextureCoord.y * uScale.y; -+ } -+ ); -+ state->effect_fshader_source = TO_STRING( -+ varying vec2 vTextureCoord; -+ uniform float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ ); -+ state->render_vshader_source = TO_STRING( -+ attribute vec4 vertex; -+ varying vec2 vTextureCoord; -+ void main(void) -+ { -+ gl_Position = vertex; -+ vTextureCoord = vertex.xy*0.5+0.5; -+ } -+ ); -+ state->render_fshader_source = TO_STRING( -+ varying vec2 vTextureCoord; -+ uniform sampler2D uTexture; -+ void main(void) -+ { -+ gl_FragColor = texture2D(uTexture, vTextureCoord); -+ //gl_FragColor = vec4(vTextureCoord.x, vTextureCoord.y, 0.0, 1.0); -+ } -+ ); -+} -+ -+void setup_screensaver_plasma(CUBE_STATE_T *state) -+{ -+ state->fbwidth = 960; state->fbheight = 540; -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ float u_time=iGlobalTime*0.2; -+ vec2 u_k = vec2(32.0, 32.0); -+ precision mediump float; -+ const float PI=3.1415926535897932384626433832795; -+ void main() -+ { -+ float v = 0.0; -+ vec2 c = vTextureCoord * u_k - u_k/2.0; -+ v += sin((c.x+u_time)); -+ v += sin((c.y+u_time)/2.0); -+ v += sin((c.x+c.y+u_time)/2.0); -+ c += u_k/2.0 * vec2(sin(u_time/3.0), cos(u_time/2.0)); -+ v += sin(sqrt(c.x*c.x+c.y*c.y+1.0)+u_time); -+ v = v/2.0; -+ vec3 col = vec3(1.0, sin(PI*v), cos(PI*v)); -+ gl_FragColor = vec4(col*0.5 + 0.5, 1.0); -+ } -+ ); -+} -+ -+ -+void setup_screensaver_plasma2(CUBE_STATE_T *state) -+{ -+ state->fbwidth = 640; state->fbheight = 360; -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ float u_time=iGlobalTime*0.2; -+ vec2 u_k = vec2(32.0, 32.0); -+ precision mediump float; -+ const float PI=3.1415926535897932384626433832795; -+ -+ void mainImage( out vec4 fragColor, in vec2 fragCoord ) -+ { -+ vec2 p = -1.0 + 2.0 * fragCoord.xy / iResolution.xy; -+ -+ // main code, *original shader by: 'Plasma' by Viktor Korsun (2011) -+ float x = p.x; -+ float y = p.y; -+ float mov0 = x+y+cos(sin(iGlobalTime)*2.0)*100.+sin(x/100.)*1000.; -+ float mov1 = y / 0.9 + iGlobalTime; -+ float mov2 = x / 0.2; -+ float c1 = abs(sin(mov1+iGlobalTime)/2.+mov2/2.-mov1-mov2+iGlobalTime); -+ float c2 = abs(sin(c1+sin(mov0/1000.+iGlobalTime)+sin(y/40.+iGlobalTime)+sin((x+y)/100.)*3.)); -+ float c3 = abs(sin(c2+cos(mov1+mov2+c2)+cos(mov2)+sin(x/1000.))); -+ fragColor = vec4(c1,c2,c3,1.0); -+ -+ } -+ -+ void main () { -+ vec4 fragColor; -+ vec2 fragCoord = vTextureCoord * vec2(iResolution.x, iResolution.y); -+ mainImage(fragColor, fragCoord); -+ gl_FragColor = fragColor; -+ gl_FragColor.a = 1.0; -+ } -+ ); -+} -+ -+ -+void setup_screensaver_border(CUBE_STATE_T *state) -+{ -+ state->texwidth = state->texheight = 256; -+ state->fbwidth = state->fbheight = 256; -+ state->effect_texture_data = create_border_tex(state->texwidth, state->texheight); -+ state->effect_fshader_source = TO_STRING( -+ varying vec2 vTextureCoord; -+ uniform float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ void main(void) -+ { -+ vec2 v = vTextureCoord; -+ vec4 texture = texture2D(iChannel0, v); -+ gl_FragColor = texture; -+ } -+ ); -+} -+ -+ -+void setup_screensaver_spiral(CUBE_STATE_T *state) -+{ -+ state->fbwidth = 800; state->fbheight = 450; -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ float u_time=iGlobalTime*0.2; -+ vec2 u_k = vec2(32.0, 32.0); -+ precision mediump float; -+ const float PI=3.1415926535897932384626433832795; -+ const float TAU=6.283185307179586; -+ -+ void mainImage( out vec4 fragColor, in vec2 fragCoord ) -+ { -+ vec2 p = 2.0*(0.5 * iResolution.xy - fragCoord.xy) / iResolution.xx; -+ float angle = atan(p.y, p.x); -+ float turn = (angle + PI) / TAU; -+ float radius = sqrt(p.x*p.x + p.y*p.y); -+ -+ float rotation = 0.04 * TAU * iGlobalTime; -+ float turn_1 = turn + rotation; -+ -+ float n_sub = 2.0; -+ -+ float turn_sub = mod(float(n_sub) * turn_1, float(n_sub)); -+ -+ float k_sine = 0.1 * sin(3.0 * iGlobalTime); -+ float sine = k_sine * sin(50.0 * (pow(radius, 0.1) - 0.4 * iGlobalTime)); -+ float turn_sine = turn_sub + sine; -+ -+ int n_colors = 5; -+ int i_turn = int(mod(float(n_colors) * turn_sine, float(n_colors))); -+ -+ int i_radius = int(1.5/pow(radius*0.5, 0.6) + 5.0 * iGlobalTime); -+ -+ int i_color = int(mod(float(i_turn + i_radius), float(n_colors))); -+ -+ vec3 color; -+ if(i_color == 0) { -+ color = vec3(1.0, 1.0, 1.0); -+ } else if(i_color == 1) { -+ color = vec3(0.0, 0.0, 0.0); -+ } else if(i_color == 2) { -+ color = vec3(1.0, 0.0, 0.0); -+ } else if(i_color == 3) { -+ color = vec3(1.0, 0.5, 0.0); -+ } else if(i_color == 4) { -+ color = vec3(1.0, 1.0, 0.0); -+ } -+ -+ color *= pow(radius, 0.5)*1.0; -+ -+ fragColor = vec4(color, 1.0); -+ } -+ -+ void main () { -+ vec4 fragColor; -+ vec2 fragCoord = vTextureCoord * vec2(iResolution.x, iResolution.y); -+ mainImage(fragColor, fragCoord); -+ gl_FragColor = fragColor; -+ gl_FragColor.a = 1.0; -+ } -+ ); -+} -+ -+void setup_screensaver_ball(CUBE_STATE_T *state) -+{ -+ state->texwidth = state->width; -+ state->texheight = state->height; -+ state->fbwidth = 960; -+ state->fbheight = 540; -+ state->effect_texture_data = create_framebuffer_tex(state->texwidth, state->texheight); -+ -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ float u_time=iGlobalTime*0.2; -+ vec2 u_k = vec2(32.0, 32.0); -+ precision mediump float; -+ const float PI=3.1415926535897932384626433832795; -+ -+ // by maq/floppy -+ const float R=0.2; // to play -+ void mainImage( out vec4 fragColor, in vec2 fragCoord ) -+ { -+ vec3 col; -+ vec2 uv = -0.5+fragCoord.xy / iResolution.xy; -+ uv.y*=0.66; // hack to get ar nice on 16:10 -+ vec2 p = uv; -+ float d=sqrt(dot(p,p)); -+ float fac,fac2; -+ if(d<R) -+ { -+ uv.x=p.x/(R+sqrt(R-d)); -+ uv.y=p.y/(R+sqrt(R-d)); -+ fac = 0.005; -+ fac2 = 5.0; -+ } -+ else -+ { -+ uv.x=p.x/(d*d); -+ uv.y=p.y/(d*d); -+ fac = 0.02; -+ fac2 = 25.0; -+ } -+ -+ uv.x=uv.x-iMouse.x*fac+fac*500.0*sin(0.2*iGlobalTime); -+ uv.y=uv.y-iMouse.y*fac+fac*500.0*sin(0.4*iGlobalTime); -+ col = texture2D(iChannel0, uv/fac2).xyz; -+ col = col*exp(-3.0*(d-R)); // some lighting -+ col = col*(1.1-exp(-8.0*(abs(d-R)))); // and shading -+ -+ -+ fragColor = vec4(col,1.0); -+ } -+ void main () { -+ vec4 fragColor; -+ vec2 fragCoord = vTextureCoord * vec2(iResolution.x, iResolution.y); -+ mainImage(fragColor, fragCoord); -+ gl_FragColor = fragColor; -+ gl_FragColor.a = 1.0; -+ } -+ ); -+} -+ -+ -+void setup_screensaver_stellar(CUBE_STATE_T *state) -+{ -+ state->texwidth = 256; state->texheight = 256; -+ state->effect_texture_data = create_noise_tex(state->texwidth, state->texheight); -+ state->fbwidth = 640; state->fbheight = 360; -+ -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ const float tau = 6.28318530717958647692; -+ vec4 Noise( in ivec2 x ) -+ { -+ return texture2D( iChannel0, (vec2(x)+0.5)/256.0, -100.0 ); -+ } -+ void main() -+ { -+ vec3 ray = vec3(vTextureCoord - vec2(0.5), 1.0); -+ float offset = iGlobalTime*.5; -+ float speed2 = (cos(offset)+1.0)*2.0; -+ float speed = speed2+.1; -+ float ispeed = 1.0/speed; -+ offset += sin(offset)*.96; -+ offset *= 2.0; -+ vec3 col = vec3(0); -+ vec3 stp = ray/max(abs(ray.x),abs(ray.y)); -+ vec3 pos = 2.0*stp+.5; -+ for ( int i=0; i < 10; i++ ) -+ { -+ float z = Noise(ivec2(pos.xy)).x; -+ z = fract(z-offset); -+ float d = 50.0*z-pos.z; -+ float w = max(0.0, 1.0-8.0*length(fract(pos.xy)-.5)); -+ vec3 c = max(vec3(0), vec3(1.0-abs(d+speed2*.5)*ispeed,1.0-abs(d)*ispeed,1.0-abs(d-speed2*.5)*ispeed)); -+ col += 1.5*(1.0-z)*c*w*w; -+ pos += stp; -+ } -+ gl_FragColor = vec4(col,1.0); -+ } -+ ); -+} -+ -+void setup_screensaver_noise(CUBE_STATE_T *state) -+{ -+ state->fbwidth = 960; state->fbheight = 540; -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ float time=iGlobalTime*0.1; -+ float pi = 3.14159265; -+ -+ float rand(vec2 co) -+ { -+ return fract(sin(dot(co.xy, vec2(12.9898,78.233))) * 43758.5453); -+ } -+ -+ void main() -+ { -+ float r = rand(vec2(1.0*iGlobalTime+vTextureCoord.x, 3.0*iGlobalTime+vTextureCoord.y)); -+ float g = rand(vec2(2.0*iGlobalTime+vTextureCoord.x, 2.0*iGlobalTime+vTextureCoord.y)); -+ float b = rand(vec2(3.0*iGlobalTime+vTextureCoord.x, 1.0*iGlobalTime+vTextureCoord.y)); -+ gl_FragColor = vec4(r, g, b, 1.0); -+ } -+ ); -+} -+ -+void setup_screensaver_warp(CUBE_STATE_T *state) -+{ -+ state->texwidth = state->width; -+ state->texheight = state->height; -+ state->fbwidth = 800; -+ state->fbheight = 450; -+ state->effect_texture_data = create_framebuffer_tex(state->texwidth, state->texheight); -+ -+ state->effect_fshader_source = TO_STRING( -+ precision lowp float; -+ varying vec2 vTextureCoord; -+ uniform highp float iGlobalTime; -+ uniform vec3 iResolution; -+ uniform vec2 iMouse; -+ uniform sampler2D iChannel0; -+ -+ float time=iGlobalTime*0.1; -+ const float pi = 3.14159265; -+ const float sin_4000 = 0.6427876097; -+ const float cos_4000 = 0.7660444431; -+ const float sin_6000 = -0.8660254038; -+ const float cos_6000 = -0.5; -+ -+ void main() -+ { -+ float s = sin(time); -+ float c = cos(time); -+ float s2 = 2.0*s*c; -+ float c2 = 1.0-2.0*s*s; -+ float s3 = s2*c + c2*s; -+ float c3 = c2*c - s2*s; -+ float ss = s2*cos_4000 + c2*sin_4000; -+ float cc = c3*cos_6000 - s3*sin_6000; -+ vec2 offset2 = vec2(6.0*sin(time*1.1), 3.0*cos(time*1.1)); -+ vec2 oldPos = vTextureCoord.xy - vec2(0.5, 0.5); -+ vec2 newPos = vec2(oldPos.x * c2 - oldPos.y * s2, -+ oldPos.y * c2 + oldPos.x * s2); -+ newPos = newPos*(1.0+0.2*s3) - offset2; -+ vec2 temp = newPos; -+ float beta = sin(temp.y*2.0 + time*8.0); -+ newPos.x = temp.x + 0.4*beta; -+ newPos.y = temp.y - 0.4*beta; -+ gl_FragColor = texture2D(iChannel0, newPos); -+ } -+ ); -+} -+ -+#ifdef STANDALONE -+ -+typedef struct -+{ -+ uint32_t screen_width; -+ uint32_t screen_height; -+// OpenGL|ES objects -+ EGLDisplay display; -+ EGLSurface surface; -+ EGLContext context; -+} EGL_STATE_T; -+ -+/*********************************************************** -+ * Name: init_ogl -+ * -+ * Arguments: -+ * CUBE_STATE_T *state - holds OGLES model info -+ * -+ * Description: Sets the display, OpenGL|ES context and screen stuff -+ * -+ * Returns: void -+ * -+ ***********************************************************/ -+static void init_ogl(EGL_STATE_T *state) -+{ -+ int32_t success = 0; -+ EGLBoolean result; -+ EGLint num_config; -+ -+ static EGL_DISPMANX_WINDOW_T nativewindow; -+ -+ DISPMANX_ELEMENT_HANDLE_T dispman_element; -+ DISPMANX_DISPLAY_HANDLE_T dispman_display; -+ DISPMANX_UPDATE_HANDLE_T dispman_update; -+ VC_RECT_T dst_rect; -+ VC_RECT_T src_rect; -+ -+ static const EGLint attribute_list[] = -+ { -+ EGL_RED_SIZE, 8, -+ EGL_GREEN_SIZE, 8, -+ EGL_BLUE_SIZE, 8, -+ EGL_ALPHA_SIZE, 8, -+ EGL_SURFACE_TYPE, EGL_WINDOW_BIT, -+ EGL_NONE -+ }; -+ -+ static const EGLint context_attributes[] = -+ { -+ EGL_CONTEXT_CLIENT_VERSION, 2, -+ EGL_NONE -+ }; -+ EGLConfig config; -+ -+ // get an EGL display connection -+ state->display = eglGetDisplay(EGL_DEFAULT_DISPLAY); -+ assert(state->display!=EGL_NO_DISPLAY); -+ check(); -+ -+ // initialize the EGL display connection -+ result = eglInitialize(state->display, NULL, NULL); -+ assert(EGL_FALSE != result); -+ check(); -+ -+ // get an appropriate EGL frame buffer configuration -+ result = eglChooseConfig(state->display, attribute_list, &config, 1, &num_config); -+ assert(EGL_FALSE != result); -+ check(); -+ -+ // get an appropriate EGL frame buffer configuration -+ result = eglBindAPI(EGL_OPENGL_ES_API); -+ assert(EGL_FALSE != result); -+ check(); -+ -+ // create an EGL rendering context -+ state->context = eglCreateContext(state->display, config, EGL_NO_CONTEXT, context_attributes); -+ assert(state->context!=EGL_NO_CONTEXT); -+ check(); -+ -+ // create an EGL window surface -+ success = graphics_get_display_size(0 /* LCD */, &state->screen_width, &state->screen_height); -+ assert( success >= 0 ); -+ -+ dst_rect.x = 0; -+ dst_rect.y = 0; -+ dst_rect.width = state->screen_width; -+ dst_rect.height = state->screen_height; -+ -+ src_rect.x = 0; -+ src_rect.y = 0; -+ src_rect.width = state->screen_width << 16; -+ src_rect.height = state->screen_height << 16; -+ -+ dispman_display = vc_dispmanx_display_open( 0 /* LCD */); -+ dispman_update = vc_dispmanx_update_start( 0 ); -+ -+ dispman_element = vc_dispmanx_element_add ( dispman_update, dispman_display, -+ 0/*layer*/, &dst_rect, 0/*src*/, -+ &src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0/*clamp*/, 0/*transform*/); -+ -+ nativewindow.element = dispman_element; -+ nativewindow.width = state->screen_width; -+ nativewindow.height = state->screen_height; -+ vc_dispmanx_update_submit_sync( dispman_update ); -+ -+ check(); -+ -+ state->surface = eglCreateWindowSurface( state->display, config, &nativewindow, NULL ); -+ assert(state->surface != EGL_NO_SURFACE); -+ check(); -+ -+ // connect the context to the surface -+ result = eglMakeCurrent(state->display, state->surface, state->surface, state->context); -+ assert(EGL_FALSE != result); -+ check(); -+} -+ -+int main () -+{ -+ int terminate = 0; -+ CUBE_STATE_T _state, *state=&_state; -+ EGL_STATE_T _eglstate, *eglstate=&_eglstate; -+ -+ // Clear application state -+ memset( eglstate, 0, sizeof( *eglstate ) ); -+ bcm_host_init(); -+ // Start OGLES -+ init_ogl(eglstate); -+again: -+ memset( state, 0, sizeof( *state ) ); -+ state->verbose = 1; -+ state->width = eglstate->screen_width; -+ state->height = eglstate->screen_height; -+ setup_screensaver_default(state); -+ setup_screensaver_warp(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ int frames = 0; -+ uint64_t ts = GetTimeStamp(); -+ while (!terminate) -+ { -+ screensaver_update(state); -+ screensaver_render(state); -+ eglSwapBuffers(eglstate->display, eglstate->surface); -+ check(); -+ -+ frames++; -+ uint64_t ts2 = GetTimeStamp(); -+ if (ts2 - ts > 1e6) -+ { -+ printf("%d fps (%.3f)\n", frames, state->time); -+ ts += 1e6; -+ frames = 0; -+ //break; -+ } -+ } -+ screensaver_deinit_shaders(state); -+ goto again; -+ return 0; -+} -+#endif -+ -diff --git a/xbmc/screensavers/gles/triangle2.h b/xbmc/screensavers/gles/triangle2.h -new file mode 100644 -index 0000000..6088203 ---- /dev/null -+++ b/xbmc/screensavers/gles/triangle2.h -@@ -0,0 +1,64 @@ -+#pragma once -+ -+#include "GLES2/gl2.h" -+#include "EGL/egl.h" -+#include "EGL/eglext.h" -+ -+#define NUMCONSTS 9 -+ -+typedef struct -+{ -+ GLuint verbose; -+ GLuint effect_vshader; -+ GLuint effect_fshader; -+ GLuint render_vshader; -+ GLuint render_fshader; -+ GLuint effect_program; -+ GLuint render_program; -+ GLuint effect_fb; -+ GLuint framebuffer_texture; -+ GLuint vertex_buffer; -+ GLuint effect_texture; -+ void *effect_texture_data; -+// effect attribs -+ GLuint uTime, uScale, uResolution, uMouse; -+ GLuint uChannel0; -+// render attribs -+ GLuint attr_vertex, uTexture; -+ uint64_t last_time; -+ float _c[NUMCONSTS]; -+ float _ct[NUMCONSTS]; -+ float _cv[NUMCONSTS]; -+ -+// config settings -+ int width, height; -+ int texwidth, texheight; -+ int fbwidth, fbheight; -+ int mousex, mousey; -+ float time; -+ const GLchar *effect_vshader_source; -+ const GLchar *effect_fshader_source; -+ const GLchar *render_vshader_source; -+ const GLchar *render_fshader_source; -+ -+} CUBE_STATE_T; -+ -+ -+void screensaver_init_shaders(CUBE_STATE_T *state); -+void screensaver_init(CUBE_STATE_T *state); -+void screensaver_update(CUBE_STATE_T *state); -+void screensaver_render(CUBE_STATE_T *state); -+void screensaver_deinit_shaders(CUBE_STATE_T *state); -+ -+void setup_screensaver_default(CUBE_STATE_T *state); -+void setup_screensaver_warp(CUBE_STATE_T *state); -+void setup_screensaver_plasma(CUBE_STATE_T *state); -+void setup_screensaver_plasma2(CUBE_STATE_T *state); -+void setup_screensaver_noise(CUBE_STATE_T *state); -+void setup_screensaver_border(CUBE_STATE_T *state); -+void setup_screensaver_stellar(CUBE_STATE_T *state); -+void setup_screensaver_spiral(CUBE_STATE_T *state); -+void setup_screensaver_ball(CUBE_STATE_T *state); -+ -+ -+ -diff --git a/xbmc/screensavers/gles/warp/Makefile.in b/xbmc/screensavers/gles/warp/Makefile.in -new file mode 100644 -index 0000000..4406b4a ---- /dev/null -+++ b/xbmc/screensavers/gles/warp/Makefile.in -@@ -0,0 +1,36 @@ -+ARCH=@ARCH@ -+CXXFLAGS=-fPIC -+ifeq (@USE_ANDROID@,1) -+SLIB = @abs_top_srcdir@/system/libwarp.so -+else -+SLIB = @abs_top_srcdir@/addons/screensaver.gles.warp/Warp.xbs -+endif -+OBJS = wrapper.o -+DEFINES += -DSCREENSAVER=warp -+ -+ifeq (@USE_OPENGLES@,1) -+ DEFINES += -DHAS_GLES=2 -+ INCLUDES+= -I@abs_top_srcdir@/xbmc/screensavers/gles -+ OBJS += @abs_top_srcdir@/xbmc/screensavers/gles/gleshelpers.a -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGLES -+ else -+ LDFLAGS += -lGLESv2 -+ endif -+else -+ DEFINES += -DHAS_GL -+ ifeq ($(findstring osx,$(ARCH)), osx) -+ LDFLAGS += -framework OpenGL -+ else -+ LDFLAGS += -lGL -+ endif -+endif -+ -+$(SLIB): $(OBJS) -+ifeq ($(findstring osx,$(ARCH)), osx) -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -bundle -o $(SLIB) $(OBJS) -+else -+ $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared -o $(SLIB) $(OBJS) -+endif -+ -+include @abs_top_srcdir@/Makefile.include -diff --git a/xbmc/screensavers/gles/warp/wrapper.cc b/xbmc/screensavers/gles/warp/wrapper.cc -new file mode 100644 -index 0000000..fd58b73 ---- /dev/null -+++ b/xbmc/screensavers/gles/warp/wrapper.cc -@@ -0,0 +1,102 @@ -+#include <stdio.h> -+#include <assert.h> -+#include "Application.h" -+#include "../../addons/include/xbmc_scr_dll.h" -+ -+extern "C" { -+ -+#include "triangle2.h" -+ -+#define PASTER(x,y) x ## _ ## y -+#define EVALUATOR(x,y) PASTER(x,y) -+#define NAME(fun) EVALUATOR(fun, SCREENSAVER) -+ -+static CUBE_STATE_T _state, *state=&_state; -+ -+ADDON_STATUS ADDON_Create(void* hdl, void* props) -+{ -+ if (!props) -+ return ADDON_STATUS_UNKNOWN; -+ -+ // Clear application state -+ memset( state, 0, sizeof( *state ) ); -+ // Start OGLES -+ assert( g_application.IsCurrentThread() ); -+ glGetError(); -+ -+ SCR_PROPS* scrprops = (SCR_PROPS*)props; -+ state->width = scrprops->width; -+ state->height = scrprops->height; -+ setup_screensaver_default(state); -+ NAME(setup_screensaver)(state); -+ screensaver_init(state); -+ screensaver_init_shaders(state); -+ -+ return ADDON_STATUS_OK; -+} -+ -+void Start() -+{ -+} -+ -+void Render() -+{ -+ screensaver_update(state); -+ screensaver_render(state); -+} -+ -+void ADDON_Stop() -+{ -+ screensaver_deinit_shaders(state); -+} -+ -+void ADDON_Destroy() -+{ -+} -+ -+ADDON_STATUS ADDON_GetStatus() -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+bool ADDON_HasSettings() -+{ -+puts(__func__); -+ return false; -+} -+ -+unsigned int ADDON_GetSettings(ADDON_StructSetting ***sSet) -+{ -+puts(__func__); -+ return 0; -+} -+ -+ADDON_STATUS ADDON_SetSetting(const char *settingName, const void *settingValue) -+{ -+puts(__func__); -+ return ADDON_STATUS_OK; -+} -+ -+void ADDON_FreeSettings() -+{ -+puts(__func__); -+} -+ -+void ADDON_Announce(const char *flag, const char *sender, const char *message, const void *data) -+{ -+puts(__func__); -+} -+ -+void GetInfo(SCR_INFO *info) -+{ -+puts(__func__); -+} -+ -+void Remove() -+{ -+puts(__func__); -+} -+ -+} -+ -diff --git a/xbmc/settings/AdvancedSettings.cpp b/xbmc/settings/AdvancedSettings.cpp -index 8e39d8c..da9db10 100644 ---- a/xbmc/settings/AdvancedSettings.cpp -+++ b/xbmc/settings/AdvancedSettings.cpp -@@ -26,7 +26,6 @@ - #include <vector> - - #include "addons/AudioDecoder.h" --#include "addons/BinaryAddonCache.h" - #include "addons/IAddon.h" - #include "Application.h" - #include "ServiceBroker.h" -@@ -121,7 +120,8 @@ void CAdvancedSettings::Initialize() - m_limiterHold = 0.025f; - m_limiterRelease = 0.1f; - -- m_seekSteps = { 10, 30, 60, 180, 300, 600, 1800 }; -+ int t[] = { 10, 30, 60, 180, 300, 600, 1800 }; -+ m_seekSteps.assign(t, t + sizeof(t)/sizeof(t[0])); - - m_omxDecodeStartWithValidFrame = true; - -@@ -151,6 +151,7 @@ void CAdvancedSettings::Initialize() - m_videoNonLinStretchRatio = 0.5f; - m_videoEnableHighQualityHwScalers = false; - m_videoAutoScaleMaxFps = 30.0f; -+ m_videoDisableBackgroundDeinterlace = false; - m_videoCaptureUseOcclusionQuery = -1; //-1 is auto detect - m_videoVDPAUtelecine = false; - m_videoVDPAUdeintSkipChromaHD = false; -@@ -384,7 +385,7 @@ void CAdvancedSettings::Initialize() - m_databaseMusic.Reset(); - m_databaseVideo.Reset(); - -- m_pictureExtensions = ".png|.jpg|.jpeg|.bmp|.gif|.ico|.tif|.tiff|.tga|.pcx|.cbz|.zip|.cbr|.rar|.rss|.webp|.jp2|.apng"; -+ m_pictureExtensions = ".png|.jpg|.jpeg|.bmp|.gif|.ico|.tif|.tiff|.tga|.pcx|.cbz|.zip|.cbr|.rar|.dng|.nef|.cr2|.crw|.orf|.arw|.erf|.3fr|.dcr|.x3f|.mef|.raf|.mrw|.pef|.sr2|.rss|.webp|.jp2|.apng"; - m_musicExtensions = ".nsv|.m4a|.flac|.aac|.strm|.pls|.rm|.rma|.mpa|.wav|.wma|.ogg|.mp3|.mp2|.m3u|.gdm|.imf|.m15|.sfx|.uni|.ac3|.dts|.cue|.aif|.aiff|.wpl|.ape|.mac|.mpc|.mp+|.mpp|.shn|.zip|.rar|.wv|.dsp|.xsp|.xwav|.waa|.wvs|.wam|.gcm|.idsp|.mpdsp|.mss|.spt|.rsd|.sap|.cmc|.cmr|.dmc|.mpt|.mpd|.rmt|.tmc|.tm8|.tm2|.oga|.url|.pxml|.tta|.rss|.wtv|.mka|.tak|.opus|.dff|.dsf"; - m_videoExtensions = ".m4v|.3g2|.3gp|.nsv|.tp|.ts|.ty|.strm|.pls|.rm|.rmvb|.mpd|.m3u|.m3u8|.ifo|.mov|.qt|.divx|.xvid|.bivx|.vob|.nrg|.img|.iso|.pva|.wmv|.asf|.asx|.ogm|.m2v|.avi|.bin|.dat|.mpg|.mpeg|.mp4|.mkv|.mk3d|.avc|.vp3|.svq3|.nuv|.viv|.dv|.fli|.flv|.rar|.001|.wpl|.zip|.vdr|.dvr-ms|.xsp|.mts|.m2t|.m2ts|.evo|.ogv|.sdp|.avs|.rec|.url|.pxml|.vc1|.h264|.rcv|.rss|.mpls|.webm|.bdmv|.wtv"; - m_subtitlesExtensions = ".utf|.utf8|.utf-8|.sub|.srt|.smi|.rt|.txt|.ssa|.text|.ssa|.aqt|.jss|.ass|.idx|.ifo|.rar|.zip"; -@@ -556,6 +557,7 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) - XMLUtils::GetFloat(pElement, "nonlinearstretchratio", m_videoNonLinStretchRatio, 0.01f, 1.0f); - XMLUtils::GetBoolean(pElement,"enablehighqualityhwscalers", m_videoEnableHighQualityHwScalers); - XMLUtils::GetFloat(pElement,"autoscalemaxfps",m_videoAutoScaleMaxFps, 0.0f, 1000.0f); -+ XMLUtils::GetBoolean(pElement, "disablebackgrounddeinterlace", m_videoDisableBackgroundDeinterlace); - XMLUtils::GetInt(pElement, "useocclusionquery", m_videoCaptureUseOcclusionQuery, -1, 1); - XMLUtils::GetBoolean(pElement,"vdpauInvTelecine",m_videoVDPAUtelecine); - XMLUtils::GetBoolean(pElement,"vdpauHDdeintSkipChroma",m_videoVDPAUdeintSkipChromaHD); -@@ -905,8 +907,8 @@ void CAdvancedSettings::ParseSettingsFile(const std::string &file) - m_vecTokens.clear(); - CLangInfo::LoadTokens(pRootElement->FirstChild("sorttokens"),m_vecTokens); - -- //! @todo Should cache path be given in terms of our predefined paths?? -- //! Are we even going to have predefined paths?? -+ // TODO: Should cache path be given in terms of our predefined paths?? -+ // Are we even going to have predefined paths?? - std::string tmp; - if (XMLUtils::GetPath(pRootElement, "cachepath", tmp)) - m_cachePath = tmp; -@@ -1342,6 +1344,10 @@ void CAdvancedSettings::SettingOptionsLoggingComponentsFiller(const CSetting *se - list.push_back(std::make_pair(g_localizeStrings.Get(672), LOGFFMPEG)); - list.push_back(std::make_pair(g_localizeStrings.Get(676), LOGAUDIO)); - list.push_back(std::make_pair(g_localizeStrings.Get(680), LOGVIDEO)); -+ list.push_back(std::make_pair(g_localizeStrings.Get(10525), LOGPVR)); -+#ifdef HAS_LIBRTMP -+ list.push_back(std::make_pair(g_localizeStrings.Get(673), LOGRTMP)); -+#endif - #ifdef HAS_DBUS - list.push_back(std::make_pair(g_localizeStrings.Get(674), LOGDBUS)); - #endif -diff --git a/xbmc/settings/AdvancedSettings.h b/xbmc/settings/AdvancedSettings.h -index 76fb7ef..3cac9eb 100644 ---- a/xbmc/settings/AdvancedSettings.h -+++ b/xbmc/settings/AdvancedSettings.h -@@ -185,6 +185,7 @@ class CAdvancedSettings : public ISettingCallback, public ISettingsHandler - std::vector<RefreshOverride> m_videoAdjustRefreshOverrides; - std::vector<RefreshVideoLatency> m_videoRefreshLatency; - float m_videoDefaultLatency; -+ bool m_videoDisableBackgroundDeinterlace; - int m_videoCaptureUseOcclusionQuery; - bool m_DXVACheckCompatibility; - bool m_DXVACheckCompatibilityPresent; -diff --git a/xbmc/settings/AudioDSPSettings.cpp b/xbmc/settings/AudioDSPSettings.cpp -index c2356d7..179bde2 100644 ---- a/xbmc/settings/AudioDSPSettings.cpp -+++ b/xbmc/settings/AudioDSPSettings.cpp -@@ -22,7 +22,7 @@ - ////////////////////////////////////////////////////////////////////// - - #include "AudioDSPSettings.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h" - - ////////////////////////////////////////////////////////////////////// - // Construction/Destruction diff --git a/xbmc/settings/DisplaySettings.cpp b/xbmc/settings/DisplaySettings.cpp -index 363757d..6ce42fa 100644 +index c5ba807..6ce42fa 100644 --- a/xbmc/settings/DisplaySettings.cpp +++ b/xbmc/settings/DisplaySettings.cpp -@@ -501,7 +501,7 @@ void CDisplaySettings::UpdateCalibrations() - { - if (StringUtils::EqualsNoCase(itCal->strMode, m_resolutions[res].strMode)) - { -- //! @todo erase calibrations with default values -+ // TODO: erase calibrations with default values - *itCal = m_resolutions[res]; - found = true; - break; @@ -591,16 +591,10 @@ std::string CDisplaySettings::GetStringFromResolution(RESOLUTION resolution, flo if (resolution >= RES_DESKTOP && resolution < (RESOLUTION)CDisplaySettings::GetInstance().ResolutionInfoSize()) { @@ -92001,34 +16280,8 @@ index 363757d..6ce42fa 100644 StringUtils::Format("%dx%d%s", resolution->width, resolution->height, ModeFlagsToString(resolution->flags, false).c_str()), resolution->ResInfo_Index)); -diff --git a/xbmc/settings/MediaSettings.cpp b/xbmc/settings/MediaSettings.cpp -index 859a3b8..4b17ef6 100644 ---- a/xbmc/settings/MediaSettings.cpp -+++ b/xbmc/settings/MediaSettings.cpp -@@ -42,7 +42,7 @@ - #include "utils/XMLUtils.h" - #include "utils/Variant.h" - #include "video/VideoDatabase.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - - using namespace KODI::MESSAGING; - -diff --git a/xbmc/settings/MediaSourceSettings.cpp b/xbmc/settings/MediaSourceSettings.cpp -index eabe0df..d4f725e 100644 ---- a/xbmc/settings/MediaSourceSettings.cpp -+++ b/xbmc/settings/MediaSourceSettings.cpp -@@ -118,7 +118,7 @@ bool CMediaSourceSettings::Save() - - bool CMediaSourceSettings::Save(const std::string &file) const - { -- //! @todo Should we be specifying utf8 here?? -+ // TODO: Should we be specifying utf8 here?? - CXBMCTinyXML doc; - TiXmlElement xmlRootElement(XML_SOURCES); - TiXmlNode *pRoot = doc.InsertEndChild(xmlRootElement); diff --git a/xbmc/settings/Settings.cpp b/xbmc/settings/Settings.cpp -index 1d9e02b..5ed7391 100644 +index 4e63c15..5ed7391 100644 --- a/xbmc/settings/Settings.cpp +++ b/xbmc/settings/Settings.cpp @@ -182,6 +182,10 @@ const std::string CSettings::SETTING_VIDEOPLAYER_USEMMAL = "videoplayer.usemmal" @@ -92050,22 +16303,6 @@ index 1d9e02b..5ed7391 100644 const std::string CSettings::SETTING_PVRMANAGER_HIDECONNECTIONLOSTWARNING = "pvrmanager.hideconnectionlostwarning"; const std::string CSettings::SETTING_PVRMANAGER_SYNCCHANNELGROUPS = "pvrmanager.syncchannelgroups"; const std::string CSettings::SETTING_PVRMANAGER_BACKENDCHANNELORDER = "pvrmanager.backendchannelorder"; -@@ -242,7 +247,6 @@ const std::string CSettings::SETTING_PVRPLAYBACK_SCANTIME = "pvrplayback.scantim - const std::string CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH = "pvrplayback.confirmchannelswitch"; - const std::string CSettings::SETTING_PVRPLAYBACK_CHANNELENTRYTIMEOUT = "pvrplayback.channelentrytimeout"; - const std::string CSettings::SETTING_PVRPLAYBACK_FPS = "pvrplayback.fps"; --const std::string CSettings::SETTING_PVRRECORD_INSTANTRECORDACTION = "pvrrecord.instantrecordaction"; - const std::string CSettings::SETTING_PVRRECORD_INSTANTRECORDTIME = "pvrrecord.instantrecordtime"; - const std::string CSettings::SETTING_PVRRECORD_DEFAULTPRIORITY = "pvrrecord.defaultpriority"; - const std::string CSettings::SETTING_PVRRECORD_DEFAULTLIFETIME = "pvrrecord.defaultlifetime"; -@@ -295,6 +299,7 @@ const std::string CSettings::SETTING_AUDIOCDS_TRACKPATHFORMAT = "audiocds.trackp - const std::string CSettings::SETTING_AUDIOCDS_ENCODER = "audiocds.encoder"; - const std::string CSettings::SETTING_AUDIOCDS_SETTINGS = "audiocds.settings"; - const std::string CSettings::SETTING_AUDIOCDS_EJECTONRIP = "audiocds.ejectonrip"; -+const std::string CSettings::SETTING_MYMUSIC_STARTWINDOW = "mymusic.startwindow"; - const std::string CSettings::SETTING_MYMUSIC_SONGTHUMBINVIS = "mymusic.songthumbinvis"; - const std::string CSettings::SETTING_MYMUSIC_DEFAULTLIBVIEW = "mymusic.defaultlibview"; - const std::string CSettings::SETTING_PICTURES_GENERATETHUMBS = "pictures.generatethumbs"; @@ -345,6 +350,7 @@ const std::string CSettings::SETTING_VIDEOSCREEN_GUICALIBRATION = "videoscreen.g const std::string CSettings::SETTING_VIDEOSCREEN_TESTPATTERN = "videoscreen.testpattern"; const std::string CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE = "videoscreen.limitedrange"; @@ -92091,7 +16328,7 @@ index 1d9e02b..5ed7391 100644 settingSet.clear(); settingSet.insert(CSettings::SETTING_VIDEOPLAYER_SEEKDELAY); diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h -index f6d1d42..ac97d25 100644 +index e80e328..ac97d25 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -139,6 +139,10 @@ public: @@ -92113,22 +16350,6 @@ index f6d1d42..ac97d25 100644 static const std::string SETTING_PVRMANAGER_HIDECONNECTIONLOSTWARNING; static const std::string SETTING_PVRMANAGER_SYNCCHANNELGROUPS; static const std::string SETTING_PVRMANAGER_BACKENDCHANNELORDER; -@@ -199,7 +204,6 @@ public: - static const std::string SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH; - static const std::string SETTING_PVRPLAYBACK_CHANNELENTRYTIMEOUT; - static const std::string SETTING_PVRPLAYBACK_FPS; -- static const std::string SETTING_PVRRECORD_INSTANTRECORDACTION; - static const std::string SETTING_PVRRECORD_INSTANTRECORDTIME; - static const std::string SETTING_PVRRECORD_DEFAULTPRIORITY; - static const std::string SETTING_PVRRECORD_DEFAULTLIFETIME; -@@ -252,6 +256,7 @@ public: - static const std::string SETTING_AUDIOCDS_ENCODER; - static const std::string SETTING_AUDIOCDS_SETTINGS; - static const std::string SETTING_AUDIOCDS_EJECTONRIP; -+ static const std::string SETTING_MYMUSIC_STARTWINDOW; - static const std::string SETTING_MYMUSIC_SONGTHUMBINVIS; - static const std::string SETTING_MYMUSIC_DEFAULTLIBVIEW; - static const std::string SETTING_PICTURES_GENERATETHUMBS; @@ -302,6 +307,7 @@ public: static const std::string SETTING_VIDEOSCREEN_TESTPATTERN; static const std::string SETTING_VIDEOSCREEN_LIMITEDRANGE; @@ -92145,476 +16366,6 @@ index f6d1d42..ac97d25 100644 static const std::string SETTING_POWERMANAGEMENT_DISPLAYSOFF; static const std::string SETTING_POWERMANAGEMENT_SHUTDOWNTIME; static const std::string SETTING_POWERMANAGEMENT_SHUTDOWNSTATE; -diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp -index 37b6211..cc4fd8e 100644 ---- a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp -+++ b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.cpp -@@ -21,7 +21,7 @@ - #include "GUIDialogAudioDSPManager.h" - - #include "FileItem.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "dialogs/GUIDialogTextViewer.h" - #include "dialogs/GUIDialogOK.h" - #include "dialogs/GUIDialogBusy.h" -@@ -1026,17 +1026,14 @@ CFileItem *CGUIDialogAudioDSPManager::helper_CreateModeListItem(CActiveAEDSPMode - // set list item properties - pItem->SetProperty("ActiveMode", isActive); - pItem->SetProperty("Number", number); -- pItem->SetLabel(modeName); -+ pItem->SetProperty("Name", modeName); - pItem->SetProperty("Description", description); - pItem->SetProperty("Help", ModePointer->ModeHelp()); -- if (ModePointer->IconOwnModePath().empty()) -- pItem->SetIconImage("DefaultAddonAudioDSP.png"); -- else -- pItem->SetIconImage(ModePointer->IconOwnModePath()); -+ pItem->SetProperty("Icon", ModePointer->IconOwnModePath()); - pItem->SetProperty("SettingsDialog", dialogId); - pItem->SetProperty("AddonId", AddonID); - pItem->SetProperty("AddonModeNumber", ModePointer->AddonModeNumber()); -- pItem->SetLabel2(addonName); -+ pItem->SetProperty("AddonName", addonName); - pItem->SetProperty("Changed", false); - - return pItem; -diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.h b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.h -index bf5ed9c..ae0cf78 100644 ---- a/xbmc/settings/dialogs/GUIDialogAudioDSPManager.h -+++ b/xbmc/settings/dialogs/GUIDialogAudioDSPManager.h -@@ -20,7 +20,7 @@ - */ - - #include "addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h" - #include "dialogs/GUIDialogContextMenu.h" - #include "guilib/GUIDialog.h" - #include "view/GUIViewControl.h" -diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp -index e0b77ef..04eb2ff 100644 ---- a/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp -+++ b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.cpp -@@ -22,8 +22,8 @@ - #include "Application.h" - #include "addons/Skin.h" - #include "cores/IPlayer.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPDatabase.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPMode.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPDatabase.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPMode.h" - #include "cores/AudioEngine/Utils/AEUtil.h" - #include "dialogs/GUIDialogKaiToast.h" - #include "dialogs/GUIDialogYesNo.h" -diff --git a/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h -index b90c2c5..c573098 100644 ---- a/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h -+++ b/xbmc/settings/dialogs/GUIDialogAudioDSPSettings.h -@@ -20,9 +20,8 @@ - */ - - #include <utility> --#include <vector> - --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSPProcess.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSPProcess.h" - #include "settings/dialogs/GUIDialogSettingsManualBase.h" - - namespace ActiveAE -diff --git a/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h b/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h -index 47022ae..3798dcd 100644 ---- a/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h -+++ b/xbmc/settings/dialogs/GUIDialogSettingsManualBase.h -@@ -21,8 +21,6 @@ - */ - - #include <map> --#include <string> --#include <vector> - - #include "addons/IAddon.h" - #include "settings/dialogs/GUIDialogSettingsManagerBase.h" -diff --git a/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.h b/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.h -index 34d5af4..671c09b 100644 ---- a/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.h -+++ b/xbmc/settings/windows/GUIWindowSettingsScreenCalibration.h -@@ -20,8 +20,6 @@ - * - */ - --#include <vector> -- - #include "guilib/GUIWindow.h" - - class CGUIWindowSettingsScreenCalibration : public CGUIWindow -diff --git a/xbmc/storage/AutorunMediaJob.cpp b/xbmc/storage/AutorunMediaJob.cpp -index 28fd034..dee6728 100644 ---- a/xbmc/storage/AutorunMediaJob.cpp -+++ b/xbmc/storage/AutorunMediaJob.cpp -@@ -67,9 +67,9 @@ const char *CAutorunMediaJob::GetWindowString(int selection) - switch (selection) - { - case 0: -- return "Videos"; -+ return "VideoFiles"; - case 1: -- return "Music"; -+ return "MusicFiles"; - case 2: - return "Pictures"; - case 3: -diff --git a/xbmc/storage/DetectDVDType.cpp b/xbmc/storage/DetectDVDType.cpp -index 14b0304..99e3b63 100644 ---- a/xbmc/storage/DetectDVDType.cpp -+++ b/xbmc/storage/DetectDVDType.cpp -@@ -132,7 +132,7 @@ VOID CDetectDVDMedia::UpdateDvdrom() - switch (GetTrayState()) - { - case DRIVE_NONE: -- //! @todo reduce / stop polling for drive updates -+ // TODO: reduce / stop polling for drive updates - break; - - case DRIVE_OPEN: -diff --git a/xbmc/storage/IStorageProvider.h b/xbmc/storage/IStorageProvider.h -index c02c7c2..0325b0b 100644 ---- a/xbmc/storage/IStorageProvider.h -+++ b/xbmc/storage/IStorageProvider.h -@@ -18,10 +18,6 @@ - * <http://www.gnu.org/licenses/>. - * - */ -- --#include <string> --#include <vector> -- - #include "system.h" - #include "MediaSource.h" - #ifdef HAS_DVD_DRIVE -diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp -index b0dbc84..931cfac 100644 ---- a/xbmc/storage/MediaManager.cpp -+++ b/xbmc/storage/MediaManager.cpp -@@ -30,7 +30,7 @@ - #include "guilib/GUIWindowManager.h" - #ifdef HAS_DVD_DRIVE - #ifndef TARGET_WINDOWS --//! @todo switch all ports to use auto sources -+// TODO: switch all ports to use auto sources - #include <map> - #include <utility> - #include "DetectDVDType.h" -@@ -314,7 +314,7 @@ void CMediaManager::RemoveAutoSource(const CMediaSource &share) - - ///////////////////////////////////////////////////////////// - // AutoSource status functions: --//! @todo translate cdda://<device>/ -+// - TODO: translate cdda://<device>/ - - std::string CMediaManager::TranslateDevicePath(const std::string& devicePath, bool bReturnAsDevice) - { -@@ -357,7 +357,7 @@ bool CMediaManager::IsDiscInDrive(const std::string& devicePath) - return false; - #else - if(URIUtils::IsDVD(devicePath) || devicePath.empty()) -- return MEDIA_DETECT::CDetectDVDMedia::IsDiscInDrive(); //! @todo switch all ports to use auto sources -+ return MEDIA_DETECT::CDetectDVDMedia::IsDiscInDrive(); // TODO: switch all ports to use auto sources - else - return true; // Assume other paths to be mounted already - #endif -@@ -379,7 +379,7 @@ bool CMediaManager::IsAudio(const std::string& devicePath) - - return false; - #else -- //! @todo switch all ports to use auto sources -+ // TODO: switch all ports to use auto sources - MEDIA_DETECT::CCdInfo* pInfo = MEDIA_DETECT::CDetectDVDMedia::GetCdInfo(); - if (pInfo != NULL && pInfo->IsAudio(1)) - return true; -@@ -679,6 +679,9 @@ std::vector<std::string> CMediaManager::GetDiskUsage() - void CMediaManager::OnStorageAdded(const std::string &label, const std::string &path) - { - #ifdef HAS_DVD_DRIVE -+ if (path == "/run/btrfs-snap" || path == "/tmp/btrfs-snap") -+ return; -+ - if (CSettings::GetInstance().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) != AUTOCD_NONE || CSettings::GetInstance().GetBool(CSettings::SETTING_DVDS_AUTORUN)) - if (CSettings::GetInstance().GetInt(CSettings::SETTING_AUDIOCDS_AUTOACTION) == AUTOCD_RIP) - CJobManager::GetInstance().AddJob(new CAutorunMediaJob(label, path), this, CJob::PRIORITY_LOW); -diff --git a/xbmc/storage/MediaManager.h b/xbmc/storage/MediaManager.h -index 3ea422f..a2c71a5 100644 ---- a/xbmc/storage/MediaManager.h -+++ b/xbmc/storage/MediaManager.h -@@ -19,10 +19,8 @@ - * - */ - --#include <map> --#include <vector> -- - #include "MediaSource.h" // for VECSOURCES -+#include <map> - #include "utils/Job.h" - #include "IStorageProvider.h" - #include "threads/CriticalSection.h" -diff --git a/xbmc/storage/android/AndroidStorageProvider.cpp b/xbmc/storage/android/AndroidStorageProvider.cpp -index 2bb8731..51ddbba 100644 ---- a/xbmc/storage/android/AndroidStorageProvider.cpp -+++ b/xbmc/storage/android/AndroidStorageProvider.cpp -@@ -71,7 +71,7 @@ std::string CAndroidStorageProvider::unescape(const std::string& str) - i += 1; - if (str[i] == 'u') // unicode - { -- //! @todo implement -+ // TODO - } - else if (str[i] >= '0' && str[i] <= '7') // octal - { -diff --git a/xbmc/storage/android/AndroidStorageProvider.h b/xbmc/storage/android/AndroidStorageProvider.h -index 33628d9..d405c20 100644 ---- a/xbmc/storage/android/AndroidStorageProvider.h -+++ b/xbmc/storage/android/AndroidStorageProvider.h -@@ -20,9 +20,6 @@ - */ - - #include <set> --#include <string> --#include <vector> -- - #include "storage/IStorageProvider.h" - - class CAndroidStorageProvider : public IStorageProvider -diff --git a/xbmc/storage/cdioSupport.cpp b/xbmc/storage/cdioSupport.cpp -index 2c278eb..6f31fe7 100644 ---- a/xbmc/storage/cdioSupport.cpp -+++ b/xbmc/storage/cdioSupport.cpp -@@ -502,7 +502,7 @@ bool CCdIoSupport::IsIt(int num) - signature_t *sigp = &sigs[num]; - int len = strlen(sigp->sig_str); - -- //! @todo check that num < largest sig. -+ /* TODO: check that num < largest sig. */ - return 0 == memcmp(&buffer[sigp->buf_num][sigp->offset], sigp->sig_str, len); - } - -diff --git a/xbmc/storage/linux/DeviceKitDisksProvider.cpp b/xbmc/storage/linux/DeviceKitDisksProvider.cpp -index e5123e2..5fc844e 100644 ---- a/xbmc/storage/linux/DeviceKitDisksProvider.cpp -+++ b/xbmc/storage/linux/DeviceKitDisksProvider.cpp -@@ -195,8 +195,8 @@ std::string CDeviceKitDiskDevice::toString() - CDeviceKitDisksProvider::CDeviceKitDisksProvider() - { - dbus_error_init (&m_error); -- //! @todo do not use dbus_connection_pop_message() that requires the use of a -- //! private connection -+ // TODO: do not use dbus_connection_pop_message() that requires the use of a -+ // private connection - m_connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &m_error); - dbus_connection_set_exit_on_disconnect(m_connection, false); - -diff --git a/xbmc/storage/linux/DeviceKitDisksProvider.h b/xbmc/storage/linux/DeviceKitDisksProvider.h -index 4888eda..2902fe5 100644 ---- a/xbmc/storage/linux/DeviceKitDisksProvider.h -+++ b/xbmc/storage/linux/DeviceKitDisksProvider.h -@@ -18,10 +18,6 @@ - * <http://www.gnu.org/licenses/>. - * - */ -- --#include <string> --#include <vector> -- - #include "storage/IStorageProvider.h" - #ifdef HAS_DBUS - #include "DBusUtil.h" -diff --git a/xbmc/storage/linux/LinuxStorageProvider.h b/xbmc/storage/linux/LinuxStorageProvider.h -index b4794ab..6cda860 100644 ---- a/xbmc/storage/linux/LinuxStorageProvider.h -+++ b/xbmc/storage/linux/LinuxStorageProvider.h -@@ -18,9 +18,6 @@ - * <http://www.gnu.org/licenses/>. - * - */ -- --#include <vector> -- - #include "storage/IStorageProvider.h" - #include "DeviceKitDisksProvider.h" - #include "UDevProvider.h" -diff --git a/xbmc/storage/linux/UDevProvider.h b/xbmc/storage/linux/UDevProvider.h -index 5c890cf..35ae37e 100644 ---- a/xbmc/storage/linux/UDevProvider.h -+++ b/xbmc/storage/linux/UDevProvider.h -@@ -19,9 +19,6 @@ - * - */ - --#include <string> --#include <vector> -- - #include "storage/IStorageProvider.h" - - #ifdef HAVE_LIBUDEV -diff --git a/xbmc/storage/linux/UDisksProvider.cpp b/xbmc/storage/linux/UDisksProvider.cpp -index 7bdc520..498d0ef 100644 ---- a/xbmc/storage/linux/UDisksProvider.cpp -+++ b/xbmc/storage/linux/UDisksProvider.cpp -@@ -174,8 +174,8 @@ std::string CUDiskDevice::toString() - CUDisksProvider::CUDisksProvider() - { - dbus_error_init (&m_error); -- //! @todo do not use dbus_connection_pop_message() that requires the use of a -- //! private connection -+ // TODO: do not use dbus_connection_pop_message() that requires the use of a -+ // private connection - m_connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &m_error); - - if (m_connection) -diff --git a/xbmc/storage/linux/UDisksProvider.h b/xbmc/storage/linux/UDisksProvider.h -index cbc8243..572103f 100644 ---- a/xbmc/storage/linux/UDisksProvider.h -+++ b/xbmc/storage/linux/UDisksProvider.h -@@ -18,10 +18,6 @@ - * <http://www.gnu.org/licenses/>. - * - */ -- --#include <string> --#include <vector> -- - #include "storage/IStorageProvider.h" - #ifdef HAS_DBUS - #include "DBusUtil.h" -diff --git a/xbmc/storage/osx/DarwinStorageProvider.h b/xbmc/storage/osx/DarwinStorageProvider.h -index 4d50d26..e337432 100644 ---- a/xbmc/storage/osx/DarwinStorageProvider.h -+++ b/xbmc/storage/osx/DarwinStorageProvider.h -@@ -18,10 +18,6 @@ - * <http://www.gnu.org/licenses/>. - * - */ -- --#include <string> --#include <vector> -- - #include "storage/IStorageProvider.h" - - class CDarwinStorageProvider : public IStorageProvider -diff --git a/xbmc/storage/windows/Win32StorageProvider.h b/xbmc/storage/windows/Win32StorageProvider.h -index cce1a39..2b123e9 100644 ---- a/xbmc/storage/windows/Win32StorageProvider.h -+++ b/xbmc/storage/windows/Win32StorageProvider.h -@@ -18,10 +18,6 @@ - * <http://www.gnu.org/licenses/>. - * - */ -- --#include <string> --#include <vector> -- - #include "storage/IStorageProvider.h" - #include "utils/Job.h" - -diff --git a/xbmc/system.h b/xbmc/system.h -index d426ade..1831e86 100644 ---- a/xbmc/system.h -+++ b/xbmc/system.h -@@ -59,6 +59,10 @@ - #define HAS_FILESYSTEM_NFS - #endif - -+#ifdef HAVE_LIBAFPCLIENT -+ #define HAS_FILESYSTEM_AFP -+#endif -+ - #ifdef HAVE_LIBPLIST - #define HAS_AIRPLAY - #endif -@@ -105,6 +109,7 @@ - #define HAS_WEB_SERVER - #define HAS_WEB_INTERFACE - #define HAVE_LIBSSH -+#define HAS_LIBRTMP - #define HAS_FILESYSTEM_SMB - #define HAS_ZEROCONF - #define HAS_MDNS -diff --git a/xbmc/test/TestBasicEnvironment.cpp b/xbmc/test/TestBasicEnvironment.cpp -index 58ccf4d..0a59603 100644 ---- a/xbmc/test/TestBasicEnvironment.cpp -+++ b/xbmc/test/TestBasicEnvironment.cpp -@@ -20,7 +20,7 @@ - - #include "TestBasicEnvironment.h" - #include "TestUtils.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "filesystem/Directory.h" - #include "filesystem/File.h" - #include "filesystem/SpecialProtocol.h" -@@ -30,9 +30,6 @@ - #include "Util.h" - #include "Application.h" - #include "interfaces/AnnouncementManager.h" --#include "addons/BinaryAddonCache.h" --#include "interfaces/python/XBPython.h" --#include "pvr/PVRManager.h" - - #if defined(TARGET_WINDOWS) - #include "win32/WIN32Util.h" -@@ -70,8 +67,7 @@ void TestBasicEnvironment::SetUp() - std::string frameworksPath = CUtil::GetFrameworksPath(); - CSpecialProtocol::SetXBMCFrameworksPath(frameworksPath); - #endif -- /** -- * @todo Something should be done about all the asserts in GUISettings so -+ /* TODO: Something should be done about all the asserts in GUISettings so - * that the initialization of these components won't be needed. - */ - g_powerManager.Initialize(); -@@ -109,7 +105,7 @@ void TestBasicEnvironment::SetUp() - * CLibcdio). This is done so that the initialization of the VFS does not - * affect the performance results of the test cases. - */ -- /** @todo Make the initialization of the VFS here optional so it can be -+ /* TODO: Make the initialization of the VFS here optional so it can be - * testable in a test case. - */ - f = XBMC_CREATETEMPFILE(""); -diff --git a/xbmc/test/TestURL.cpp b/xbmc/test/TestURL.cpp -index cd2fda4..bf5c8c9 100644 ---- a/xbmc/test/TestURL.cpp -+++ b/xbmc/test/TestURL.cpp -@@ -68,11 +68,11 @@ const TestURLGetWithoutUserDetailsData values[] = { - { std::string("smb://god@[fd00::1]:8080/example"), std::string("smb://USERNAME@[fd00::1]:8080/example"), true }, - { std::string("smb://god:universe@fd00::1/example"), std::string("smb://USERNAME:PASSWORD@fd00::1/example"), true }, - { std::string("http://god:universe@[fd00::1]:8448/example|auth=digest"), std::string("http://USERNAME:PASSWORD@[fd00::1]:8448/example|auth=digest"), true }, -- { std::string("smb://00ff:1:0000:abde::/example"), std::string("smb://00ff:1:0000:abde::/example"), true }, -- { std::string("smb://god:universe@[00ff:1:0000:abde::]:8080/example"), std::string("smb://[00ff:1:0000:abde::]:8080/example"), false }, -- { std::string("smb://god@[00ff:1:0000:abde::]:8080/example"), std::string("smb://USERNAME@[00ff:1:0000:abde::]:8080/example"), true }, -- { std::string("smb://god:universe@00ff:1:0000:abde::/example"), std::string("smb://USERNAME:PASSWORD@00ff:1:0000:abde::/example"), true }, -- { std::string("http://god:universe@[00ff:1:0000:abde::]:8448/example|auth=digest"), std::string("http://USERNAME:PASSWORD@[00ff:1:0000:abde::]:8448/example|auth=digest"), true } -+ { std::string("smb://00ff:1:0000:abde::/example"), std::string("smb://ff:1:0:abde::/example"), true }, -+ { std::string("smb://god:universe@[00ff:1:0000:abde::]:8080/example"), std::string("smb://[ff:1:0:abde::]:8080/example"), false }, -+ { std::string("smb://god@[00ff:1:0000:abde::]:8080/example"), std::string("smb://USERNAME@[ff:1:0:abde::]:8080/example"), true }, -+ { std::string("smb://god:universe@00ff:1:0000:abde::/example"), std::string("smb://USERNAME:PASSWORD@ff:1:0:abde::/example"), true }, -+ { std::string("http://god:universe@[00ff:1:0000:abde::]:8448/example|auth=digest"), std::string("http://USERNAME:PASSWORD@[ff:1:0:abde::]:8448/example|auth=digest"), true } - }; - - INSTANTIATE_TEST_CASE_P(URL, TestURLGetWithoutUserDetails, ValuesIn(values)); -diff --git a/xbmc/threads/Atomics.h b/xbmc/threads/Atomics.h -index d28d62d..a43681c 100644 ---- a/xbmc/threads/Atomics.h -+++ b/xbmc/threads/Atomics.h -@@ -20,7 +20,7 @@ - * - */ - --//! @todo Inline these methods -+// TODO: Inline these methods - long cas(volatile long *pAddr, long expectedVal, long swapVal); - #if !defined(__ppc__) && !defined(__powerpc__) && !defined(__arm__) - long long cas2(volatile long long* pAddr, long long expectedVal, long long swapVal); diff --git a/xbmc/threads/platform/pthreads/ThreadImpl.cpp b/xbmc/threads/platform/pthreads/ThreadImpl.cpp index 99c3dbe..7c315cf 100644 --- a/xbmc/threads/platform/pthreads/ThreadImpl.cpp @@ -92637,114 +16388,11 @@ index 99c3dbe..7c315cf 100644 return bReturn; } -diff --git a/xbmc/utils/AMLUtils.cpp b/xbmc/utils/AMLUtils.cpp -index 4ae45f3..5915e61 100644 ---- a/xbmc/utils/AMLUtils.cpp -+++ b/xbmc/utils/AMLUtils.cpp -@@ -118,21 +118,6 @@ bool aml_permissions() - CLog::Log(LOGERROR, "AML: no rw on /sys/class/tsync/pts_pcrscr"); - permissions_ok = 0; - } -- if (!SysfsUtils::HasRW("/dev/video10")) -- { -- CLog::Log(LOGERROR, "AML: no rw on /dev/video10"); -- permissions_ok = 0; -- } -- if (!SysfsUtils::HasRW("/sys/module/amvideo/parameters/omx_pts")) -- { -- CLog::Log(LOGERROR, "AML: no rw on /sys/module/amvideo/parameters/omx_pts"); -- permissions_ok = 0; -- } -- if (!SysfsUtils::HasRW("/sys/module/amlvideodri/parameters/freerun_mode")) -- { -- CLog::Log(LOGERROR, "AML: no rw on /sys/module/amlvideodri/parameters/freerun_mode"); -- permissions_ok = 0; -- } - if (!SysfsUtils::HasRW("/sys/class/audiodsp/digital_raw")) - { - CLog::Log(LOGERROR, "AML: no rw on /sys/class/audiodsp/digital_raw"); -diff --git a/xbmc/utils/AliasShortcutUtils.cpp b/xbmc/utils/AliasShortcutUtils.cpp -index ce5f93b..ef96f70 100644 ---- a/xbmc/utils/AliasShortcutUtils.cpp -+++ b/xbmc/utils/AliasShortcutUtils.cpp -@@ -34,7 +34,7 @@ bool IsAliasShortcut(const std::string& path, bool isdirectory) - #if defined(TARGET_DARWIN_OSX) - // Note: regular files that have an .alias extension can be - // reported as an alias when clearly, they are not. Trap them out. -- if (!URIUtils::HasExtension(path, ".alias"))//! @todo - check if this is still needed with the new API -+ if (!URIUtils::HasExtension(path, ".alias"))// TODO - check if this is still needed with the new API - { - rtn = CDarwinUtils::IsAliasShortcut(path, isdirectory); - } -diff --git a/xbmc/utils/BitstreamConverter.cpp b/xbmc/utils/BitstreamConverter.cpp -index d0a4c20..7bff587 100644 ---- a/xbmc/utils/BitstreamConverter.cpp -+++ b/xbmc/utils/BitstreamConverter.cpp -@@ -421,12 +421,11 @@ bool CBitstreamConverter::Open(enum AVCodecID codec, uint8_t *in_extradata, int - // valid hvcC data (bitstream) always starts with the value 1 (version) - if(m_to_annexb) - { -- /** @todo from Amlogic -- * It seems the extradata is encoded as hvcC format. -- * Temporarily, we support configurationVersion==0 until 14496-15 3rd -- * is finalized. When finalized, configurationVersion will be 1 and we -- * can recognize hvcC by checking if extradata[0]==1 or not. -- */ -+ // TODO: from Amlogic -+ /* It seems the extradata is encoded as hvcC format. -+ * Temporarily, we support configurationVersion==0 until 14496-15 3rd -+ * is finalized. When finalized, configurationVersion will be 1 and we -+ * can recognize hvcC by checking if extradata[0]==1 or not. */ - - if (in_extradata[0] || in_extradata[1] || in_extradata[2] > 1) - { -@@ -449,7 +448,7 @@ bool CBitstreamConverter::Open(enum AVCodecID codec, uint8_t *in_extradata, int - (in_extradata[0] == 0 && in_extradata[1] == 0 && in_extradata[2] == 1) ) - { - CLog::Log(LOGINFO, "CBitstreamConverter::Open annexb to bitstream init"); -- //! @todo convert annexb to bitstream format -+ // TODO: convert annexb to bitstream format - return false; - } - else -@@ -1405,7 +1404,7 @@ void CBitstreamConverter::parseh264_sps(const uint8_t *sps, const uint32_t sps_s - sps_info.seq_scaling_matrix_present_flag = nal_bs_read (&bs, 1); - if (sps_info.seq_scaling_matrix_present_flag) - { -- //! @todo unfinished -+ /* TODO: unfinished */ - } - } - sps_info.log2_max_frame_num_minus4 = nal_bs_read_ue(&bs); -@@ -1419,7 +1418,7 @@ void CBitstreamConverter::parseh264_sps(const uint8_t *sps, const uint32_t sps_s - sps_info.log2_max_pic_order_cnt_lsb_minus4 = nal_bs_read_ue(&bs); - } - else if (sps_info.pic_order_cnt_type == 1) -- { //! @todo unfinished -+ { // TODO: unfinished - /* - delta_pic_order_always_zero_flag = gst_nal_bs_read (bs, 1); - offset_for_non_ref_pic = gst_nal_bs_read_se (bs); -diff --git a/xbmc/utils/BitstreamConverter.h b/xbmc/utils/BitstreamConverter.h -index 9045ef9..cf5d5ef 100644 ---- a/xbmc/utils/BitstreamConverter.h -+++ b/xbmc/utils/BitstreamConverter.h -@@ -43,8 +43,8 @@ typedef struct { - } bits_reader_t; - - //////////////////////////////////////////////////////////////////////////////////////////// --//! @todo refactor this so as not to need these ffmpeg routines. --//! These are not exposed in ffmpeg's API so we dupe them here. -+// TODO: refactor this so as not to need these ffmpeg routines. -+// These are not exposed in ffmpeg's API so we dupe them here. - // AVC helper functions for muxers, - // * Copyright (c) 2006 Baptiste Coudurier <baptiste.coudurier@smartjog.com> - // This is part of FFmpeg diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp -index 4dff0e9..2a656ae 100644 +index a2a775f..734d262 100644 --- a/xbmc/utils/CPUInfo.cpp +++ b/xbmc/utils/CPUInfo.cpp -@@ -377,7 +377,7 @@ CCPUInfo::CCPUInfo(void) +@@ -375,7 +375,7 @@ CCPUInfo::CCPUInfo(void) StringUtils::Trim(m_cores[nCurrId].m_strModel); } } @@ -92753,7 +16401,7 @@ index 4dff0e9..2a656ae 100644 { char* needle = strchr(buffer, ':'); if (needle) -@@ -408,6 +408,10 @@ CCPUInfo::CCPUInfo(void) +@@ -406,6 +406,10 @@ CCPUInfo::CCPUInfo(void) m_cpuFeatures |= CPU_FEATURE_3DNOW; else if (0 == strcmp(tok, "3dnowext")) m_cpuFeatures |= CPU_FEATURE_3DNOWEXT; @@ -92764,7 +16412,7 @@ index 4dff0e9..2a656ae 100644 tok = strtok_r(NULL, " ", &save); } } -@@ -461,10 +465,6 @@ CCPUInfo::CCPUInfo(void) +@@ -459,10 +463,6 @@ CCPUInfo::CCPUInfo(void) // Set MMX2 when SSE is present as SSE is a superset of MMX2 and Intel doesn't set the MMX2 cap if (m_cpuFeatures & CPU_FEATURE_SSE) m_cpuFeatures |= CPU_FEATURE_MMX2; @@ -92775,7 +16423,7 @@ index 4dff0e9..2a656ae 100644 } CCPUInfo::~CCPUInfo() -@@ -948,27 +948,7 @@ bool CCPUInfo::HasNeon() +@@ -946,27 +946,7 @@ bool CCPUInfo::HasNeon() has_neon = 1; #elif defined(TARGET_LINUX) && defined(__ARM_NEON__) @@ -92816,160 +16464,8 @@ index 1c5e5ba..5f3e2f9 100644 struct CoreInfo { -diff --git a/xbmc/utils/CryptThreading.cpp b/xbmc/utils/CryptThreading.cpp -index 6088929..1d2deca 100644 ---- a/xbmc/utils/CryptThreading.cpp -+++ b/xbmc/utils/CryptThreading.cpp -@@ -29,10 +29,8 @@ - #if (defined HAVE_CONFIG_H) && (!defined TARGET_WINDOWS) - #include "config.h" - #else --#ifndef HAVE_OPENSSL - #define HAVE_OPENSSL - #endif --#endif - - #ifdef HAVE_OPENSSL - #include <openssl/crypto.h> -diff --git a/xbmc/utils/DatabaseUtils.cpp b/xbmc/utils/DatabaseUtils.cpp -index cecc83a..282dac9 100644 ---- a/xbmc/utils/DatabaseUtils.cpp -+++ b/xbmc/utils/DatabaseUtils.cpp -@@ -125,7 +125,7 @@ std::string DatabaseUtils::GetField(Field field, const MediaType &mediaType, Dat - else if (field == FieldTime) result = StringUtils::Format("musicvideo_view.c%02d", VIDEODB_ID_MUSICVIDEO_RUNTIME); - else if (field == FieldDirector) result = StringUtils::Format("musicvideo_view.c%02d", VIDEODB_ID_MUSICVIDEO_DIRECTOR); - else if (field == FieldStudio) result = StringUtils::Format("musicvideo_view.c%02d", VIDEODB_ID_MUSICVIDEO_STUDIOS); -- else if (field == FieldYear) return "musicvideo_view.premiered"; -+ else if (field == FieldYear) result = StringUtils::Format("musicvideo_view.c%02d",VIDEODB_ID_MUSICVIDEO_YEAR); - else if (field == FieldPlot) result = StringUtils::Format("musicvideo_view.c%02d", VIDEODB_ID_MUSICVIDEO_PLOT); - else if (field == FieldAlbum) result = StringUtils::Format("musicvideo_view.c%02d",VIDEODB_ID_MUSICVIDEO_ALBUM); - else if (field == FieldArtist) result = StringUtils::Format("musicvideo_view.c%02d", VIDEODB_ID_MUSICVIDEO_ARTIST); -@@ -159,7 +159,7 @@ std::string DatabaseUtils::GetField(Field field, const MediaType &mediaType, Dat - else if (field == FieldVotes) return "movie_view.votes"; - else if (field == FieldRating) return "movie_view.rating"; - else if (field == FieldWriter) result = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_CREDITS); -- else if (field == FieldYear) return "movie_view.premiered"; -+ else if (field == FieldYear) result = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_YEAR); - else if (field == FieldSortTitle) result = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_SORTTITLE); - else if (field == FieldTime) result = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_RUNTIME); - else if (field == FieldMPAA) result = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_MPAA); -@@ -540,7 +540,7 @@ int DatabaseUtils::GetField(Field field, const MediaType &mediaType, bool asInde - else if (field == FieldTime) index = VIDEODB_ID_MUSICVIDEO_RUNTIME; - else if (field == FieldDirector) index = VIDEODB_ID_MUSICVIDEO_DIRECTOR; - else if (field == FieldStudio) index = VIDEODB_ID_MUSICVIDEO_STUDIOS; -- else if (field == FieldYear) return VIDEODB_DETAILS_MUSICVIDEO_PREMIERED; -+ else if (field == FieldYear) index = VIDEODB_ID_MUSICVIDEO_YEAR; - else if (field == FieldPlot) index = VIDEODB_ID_MUSICVIDEO_PLOT; - else if (field == FieldAlbum) index = VIDEODB_ID_MUSICVIDEO_ALBUM; - else if (field == FieldArtist) index = VIDEODB_ID_MUSICVIDEO_ARTIST; -@@ -574,7 +574,7 @@ int DatabaseUtils::GetField(Field field, const MediaType &mediaType, bool asInde - else if (field == FieldVotes) return VIDEODB_DETAILS_MOVIE_VOTES; - else if (field == FieldRating) return VIDEODB_DETAILS_MOVIE_RATING; - else if (field == FieldWriter) index = VIDEODB_ID_CREDITS; -- else if (field == FieldYear) return VIDEODB_DETAILS_MOVIE_PREMIERED; -+ else if (field == FieldYear) index = VIDEODB_ID_YEAR; - else if (field == FieldTime) index = VIDEODB_ID_RUNTIME; - else if (field == FieldMPAA) index = VIDEODB_ID_MPAA; - else if (field == FieldTop250) index = VIDEODB_ID_TOP250; -diff --git a/xbmc/utils/GroupUtils.cpp b/xbmc/utils/GroupUtils.cpp -index 62a7aeb..7d9055c 100644 ---- a/xbmc/utils/GroupUtils.cpp -+++ b/xbmc/utils/GroupUtils.cpp -@@ -115,8 +115,8 @@ bool GroupUtils::Group(GroupBy groupBy, const std::string &baseDir, const CFileI - } - - // handle year -- if (movieInfo->GetYear() > setInfo->GetYear()) -- setInfo->SetYear(movieInfo->GetYear()); -+ if (movieInfo->m_iYear > setInfo->m_iYear) -+ setInfo->m_iYear = movieInfo->m_iYear; - - // handle lastplayed - if (movieInfo->m_lastPlayed.IsValid() && movieInfo->m_lastPlayed > setInfo->m_lastPlayed) -diff --git a/xbmc/utils/HTMLUtil.cpp b/xbmc/utils/HTMLUtil.cpp -index 6cd4f3c..54cf3fa 100644 ---- a/xbmc/utils/HTMLUtil.cpp -+++ b/xbmc/utils/HTMLUtil.cpp -@@ -195,7 +195,7 @@ static const HTMLMapping mappings[] = - - void CHTMLUtil::ConvertHTMLToW(const std::wstring& strHTML, std::wstring& strStripped) - { -- //! @todo STRING_CLEANUP -+ /* TODO:STRING_CLEANUP */ - if (strHTML.empty()) - { - strStripped.clear(); -diff --git a/xbmc/utils/IRssObserver.h b/xbmc/utils/IRssObserver.h -index ef2a64d..eb930b6 100644 ---- a/xbmc/utils/IRssObserver.h -+++ b/xbmc/utils/IRssObserver.h -@@ -19,8 +19,6 @@ - * - */ - --#include <vector> -- - typedef uint32_t character_t; - typedef std::vector<character_t> vecText; - -diff --git a/xbmc/utils/JSONVariantParser.cpp b/xbmc/utils/JSONVariantParser.cpp -index b457280..d146cdd 100644 ---- a/xbmc/utils/JSONVariantParser.cpp -+++ b/xbmc/utils/JSONVariantParser.cpp -@@ -57,11 +57,6 @@ void CJSONVariantParser::push_buffer(const unsigned char *buffer, unsigned int l - yajl_parse(m_handler, buffer, length); - } - --CVariant CJSONVariantParser::Parse(const std::string& json) --{ -- return Parse(reinterpret_cast<const unsigned char*>(json.c_str()), json.length()); --} -- - CVariant CJSONVariantParser::Parse(const unsigned char *json, unsigned int length) - { - CSimpleParseCallback callback; -diff --git a/xbmc/utils/JSONVariantParser.h b/xbmc/utils/JSONVariantParser.h -index 535636c..7682bd5 100644 ---- a/xbmc/utils/JSONVariantParser.h -+++ b/xbmc/utils/JSONVariantParser.h -@@ -19,9 +19,6 @@ - * - */ - --#include <string> --#include <vector> -- - #include "utils/Variant.h" - - #include <yajl/yajl_parse.h> -@@ -54,8 +51,6 @@ public: - - static CVariant Parse(const unsigned char *json, unsigned int length); - -- static CVariant Parse(const std::string& json); -- - private: - static int ParseNull(void * ctx); - static int ParseBoolean(void * ctx, int boolean); -diff --git a/xbmc/utils/LabelFormatter.cpp b/xbmc/utils/LabelFormatter.cpp -index b7e628a..cc4fe49 100644 ---- a/xbmc/utils/LabelFormatter.cpp -+++ b/xbmc/utils/LabelFormatter.cpp -@@ -209,8 +209,10 @@ std::string CLabelFormatter::GetMaskContent(const CMaskString &mask, const CFile - { - if (movie->m_firstAired.IsValid()) - value = movie->m_firstAired.GetAsLocalizedDate(); -- else if (movie->HasYear()) -- value = StringUtils::Format("%i", movie->GetYear()); -+ else if (movie->m_premiered.IsValid()) -+ value = movie->m_premiered.GetAsLocalizedDate(); -+ else if (movie->m_iYear > 0) -+ value = StringUtils::Format("%i", movie->m_iYear); - } - break; - case 'F': // filename diff --git a/xbmc/utils/Makefile.in b/xbmc/utils/Makefile.in -index 47ad392..686d947 100644 +index afc8dfa..686d947 100644 --- a/xbmc/utils/Makefile.in +++ b/xbmc/utils/Makefile.in @@ -52,6 +52,7 @@ SRCS += RssReader.cpp @@ -92980,75 +16476,6 @@ index 47ad392..686d947 100644 SRCS += Screenshot.cpp SRCS += SeekHandler.cpp SRCS += SortUtils.cpp -@@ -74,9 +75,7 @@ SRCS += Weather.cpp - SRCS += XBMCTinyXML.cpp - SRCS += XMLUtils.cpp - SRCS += Utf8Utils.cpp --ifeq (@HAVE_LIBXSLT@,1) - SRCS += XSLTUtils.cpp --endif - SRCS += ActorProtocol.cpp - SRCS += SysfsUtils.cpp - -diff --git a/xbmc/utils/Mime.cpp b/xbmc/utils/Mime.cpp -index 1acdb1c..8845b53 100644 ---- a/xbmc/utils/Mime.cpp -+++ b/xbmc/utils/Mime.cpp -@@ -638,7 +638,7 @@ CMime::EFileType CMime::GetFileTypeFromContent(const std::string& fileContent) - - const unsigned char* const b = (const unsigned char*)fileContent.c_str(); - -- //! @todo add detection for text types -+ // TODO: add detection for text types - - // check image types - if (b[0] == 'B' && b[1] == 'M') -@@ -658,7 +658,7 @@ CMime::EFileType CMime::GetFileTypeFromContent(const std::string& fileContent) - if (len >= 7 && b[0] == 'R' && b[1] == 'a' && b[2] == 'r' && b[3] == ' ' && b[4] == 0x1A && b[5] == 0x07 && b[6] == 0x00) - return FileTypeRar; - -- //! @todo add detection for other types if required -+ // TODO: add detection for other types if required - - return FileTypeUnknown; - } -diff --git a/xbmc/utils/RecentlyAddedJob.cpp b/xbmc/utils/RecentlyAddedJob.cpp -index 20d9d82..937c969 100644 ---- a/xbmc/utils/RecentlyAddedJob.cpp -+++ b/xbmc/utils/RecentlyAddedJob.cpp -@@ -68,7 +68,7 @@ bool CRecentlyAddedJob::UpdateVideo() - - home->SetProperty("LatestMovie." + value + ".Title" , item->GetLabel()); - home->SetProperty("LatestMovie." + value + ".Rating" , strRating); -- home->SetProperty("LatestMovie." + value + ".Year" , item->GetVideoInfoTag()->GetYear()); -+ home->SetProperty("LatestMovie." + value + ".Year" , item->GetVideoInfoTag()->m_iYear); - home->SetProperty("LatestMovie." + value + ".Plot" , item->GetVideoInfoTag()->m_strPlot); - home->SetProperty("LatestMovie." + value + ".RunningTime" , item->GetVideoInfoTag()->GetDuration() / 60); - home->SetProperty("LatestMovie." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath); -@@ -159,7 +159,7 @@ bool CRecentlyAddedJob::UpdateVideo() - std::string value = StringUtils::Format("%i", i + 1); - - home->SetProperty("LatestMusicVideo." + value + ".Title" , item->GetLabel()); -- home->SetProperty("LatestMusicVideo." + value + ".Year" , item->GetVideoInfoTag()->GetYear()); -+ home->SetProperty("LatestMusicVideo." + value + ".Year" , item->GetVideoInfoTag()->m_iYear); - home->SetProperty("LatestMusicVideo." + value + ".Plot" , item->GetVideoInfoTag()->m_strPlot); - home->SetProperty("LatestMusicVideo." + value + ".RunningTime" , item->GetVideoInfoTag()->GetDuration() / 60); - home->SetProperty("LatestMusicVideo." + value + ".Path" , item->GetVideoInfoTag()->m_strFileNameAndPath); -diff --git a/xbmc/utils/RssManager.cpp b/xbmc/utils/RssManager.cpp -index e0dbe58..0c12123 100644 ---- a/xbmc/utils/RssManager.cpp -+++ b/xbmc/utils/RssManager.cpp -@@ -145,8 +145,8 @@ bool CRssManager::Load() - - if (pFeed->FirstChild() != NULL) - { -- //! @todo UTF-8: Do these URLs need to be converted to UTF-8? -- //! What about the xml encoding? -+ // TODO: UTF-8: Do these URLs need to be converted to UTF-8? -+ // What about the xml encoding? - std::string strUrl = pFeed->FirstChild()->ValueStr(); - set.url.push_back(strUrl); - set.interval.push_back(iInterval); diff --git a/xbmc/utils/RssReader.cpp b/xbmc/utils/RssReader.cpp index 9186f56..114a18c 100644 --- a/xbmc/utils/RssReader.cpp @@ -93062,86 +16489,6 @@ index 9186f56..114a18c 100644 { CLog::Log(LOGWARNING, "RSS: No network connection"); strXML = "<rss><item><title>"+g_localizeStrings.Get(15301)+""; -diff --git a/xbmc/utils/SaveFileStateJob.cpp b/xbmc/utils/SaveFileStateJob.cpp -index 89ad9c8..8363a67 100644 ---- a/xbmc/utils/SaveFileStateJob.cpp -+++ b/xbmc/utils/SaveFileStateJob.cpp -@@ -34,7 +34,7 @@ - #include "guilib/GUIWindowManager.h" - #include "GUIUserMessages.h" - #include "music/MusicDatabase.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "xbmc/music/tags/MusicInfoTag.h" - - bool CSaveFileStateJob::DoWork() -diff --git a/xbmc/utils/ScraperParser.cpp b/xbmc/utils/ScraperParser.cpp -index 23e627f..57476ed 100644 ---- a/xbmc/utils/ScraperParser.cpp -+++ b/xbmc/utils/ScraperParser.cpp -@@ -28,9 +28,7 @@ - #include "utils/StringUtils.h" - #include "log.h" - #include "CharsetConverter.h" --#ifdef HAVE_LIBXSLT - #include "utils/XSLTUtils.h" --#endif - #include "utils/XMLUtils.h" - #include - #include -@@ -340,7 +338,6 @@ void CScraperParser::ParseExpression(const std::string& input, std::string& dest - - void CScraperParser::ParseXSLT(const std::string& input, std::string& dest, TiXmlElement* element, bool bAppend) - { --#ifdef HAVE_LIBXSLT - TiXmlElement* pSheet = element->FirstChildElement(); - if (pSheet) - { -@@ -357,18 +354,13 @@ void CScraperParser::ParseXSLT(const std::string& input, std::string& dest, TiXm - - xsltUtils.XSLTTransform(dest); - } --#endif - } - - TiXmlElement *FirstChildScraperElement(TiXmlElement *element) - { - for (TiXmlElement *child = element->FirstChildElement(); child; child = child->NextSiblingElement()) - { --#ifdef HAVE_LIBXSLT -- if (child->ValueStr() == "XSLT") -- return child; --#endif -- if (child->ValueStr() == "RegExp") -+ if (child->ValueStr() == "RegExp" || child->ValueStr() == "XSLT") - return child; - } - return NULL; -@@ -378,11 +370,7 @@ TiXmlElement *NextSiblingScraperElement(TiXmlElement *element) - { - for (TiXmlElement *next = element->NextSiblingElement(); next; next = next->NextSiblingElement()) - { --#ifdef HAVE_LIBXSLT -- if (next->ValueStr() == "XSLT") -- return next; --#endif -- if (next->ValueStr() == "RegExp") -+ if (next->ValueStr() == "RegExp" || next->ValueStr() == "XSLT") - return next; - } - return NULL; -@@ -444,11 +432,9 @@ void CScraperParser::ParseNext(TiXmlElement* element) - { - if (iDest-1 < MAX_SCRAPER_BUFFERS && iDest-1 > -1) - { --#ifdef HAVE_LIBXSLT - if (pReg->ValueStr() == "XSLT") - ParseXSLT(strInput, m_param[iDest - 1], pReg, bAppend); - else --#endif - ParseExpression(strInput, m_param[iDest - 1],pReg,bAppend); - } - else diff --git a/xbmc/utils/Screen.cpp b/xbmc/utils/Screen.cpp new file mode 100644 index 0000000..b350fa8 @@ -93353,111 +16700,6 @@ index 0000000..9ef0c48 +}; + +extern CScreen g_screen; -diff --git a/xbmc/utils/SortUtils.cpp b/xbmc/utils/SortUtils.cpp -index cff9637..f79c7dd 100644 ---- a/xbmc/utils/SortUtils.cpp -+++ b/xbmc/utils/SortUtils.cpp -@@ -190,7 +190,7 @@ std::string ByProgramCount(SortAttribute attributes, const SortItem &values) - - std::string ByPlaylistOrder(SortAttribute attributes, const SortItem &values) - { -- //! @todo Playlist order is hacked into program count variable (not nice, but ok until 2.0) -+ // TODO: Playlist order is hacked into program count variable (not nice, but ok until 2.0) - return ByProgramCount(attributes, values); - } - -diff --git a/xbmc/utils/SortUtils.h b/xbmc/utils/SortUtils.h -index e49c4fe..e9999ca 100644 ---- a/xbmc/utils/SortUtils.h -+++ b/xbmc/utils/SortUtils.h -@@ -20,9 +20,8 @@ - */ - - #include --#include - #include --#include -+#include - - #include "DatabaseUtils.h" - #include "SortFileItem.h" -diff --git a/xbmc/utils/Splash.cpp b/xbmc/utils/Splash.cpp -index 7e1d885..df50665 100644 ---- a/xbmc/utils/Splash.cpp -+++ b/xbmc/utils/Splash.cpp -@@ -72,6 +72,6 @@ void CSplash::Show() - - //show it on screen - g_Windowing.EndRender(); -- g_graphicsContext.Flip(true, false); -+ g_graphicsContext.Flip(true); - g_graphicsContext.Unlock(); - } -diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp -index 197ae07..40b4d1a 100644 ---- a/xbmc/utils/StringUtils.cpp -+++ b/xbmc/utils/StringUtils.cpp -@@ -38,7 +38,7 @@ - #include "utils/fstrcmp.h" - #include "Util.h" - #include --#include -+ - #include - #include - #include -@@ -1284,29 +1284,3 @@ void StringUtils::Tokenize(const std::string& input, std::vector& t - dataPos = input.find_first_not_of(delimiter, nextDelimPos); - } - } -- --uint64_t StringUtils::ToUint64(std::string str, uint64_t fallback) noexcept --{ -- std::istringstream iss(str); -- uint64_t result(fallback); -- iss >> result; -- return result; --} -- --std::string StringUtils::FormatFileSize(uint64_t bytes) --{ -- const std::array units{"B", "kB", "MB", "GB", "TB", "PB"}; -- if (bytes < 1000) -- return Format("%lluB", bytes); -- -- int i = 0; -- double value = static_cast(bytes); -- while (i < units.size() - 1 && value >= 999.5) -- { -- ++i; -- value /= 1024.0; -- } -- int decimals = value < 9.995 ? 2 : (value < 99.95 ? 1 : 0); -- auto frmt = "%.0" + Format("%d", decimals) + "f%s"; -- return Format(frmt.c_str(), value, units[i].c_str()); --} -diff --git a/xbmc/utils/StringUtils.h b/xbmc/utils/StringUtils.h -index d16e2b6..ad0e088 100644 ---- a/xbmc/utils/StringUtils.h -+++ b/xbmc/utils/StringUtils.h -@@ -244,17 +244,6 @@ public: - static void Tokenize(const std::string& input, std::vector& tokens, const std::string& delimiters); - static std::vector Tokenize(const std::string& input, const char delimiter); - static void Tokenize(const std::string& input, std::vector& tokens, const char delimiter); -- static uint64_t ToUint64(std::string str, uint64_t fallback) noexcept; -- -- /*! -- * Returns bytes in a human readable format using the smallest unit that will fit `bytes` in at -- * most three digits. The number of decimals are adjusted with significance such that 'small' -- * numbers will have more decimals than larger ones. -- * -- * For example: 1024 bytes will be formatted as "1.00kB", 10240 bytes as "10.0kB" and -- * 102400 bytes as "100kB". See TestStringUtils for more examples. -- */ -- static std::string FormatFileSize(uint64_t bytes); - }; - - struct sortstringbyname diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index 06b2068..f569a0c 100644 --- a/xbmc/utils/URIUtils.cpp @@ -93585,7 +16827,7 @@ index f6be769..467eee4 100644 static std::string resolvePath(const std::string &path); }; diff --git a/xbmc/utils/Weather.cpp b/xbmc/utils/Weather.cpp -index 36d2165..13f3fd9 100644 +index 4e7621f..13f3fd9 100644 --- a/xbmc/utils/Weather.cpp +++ b/xbmc/utils/Weather.cpp @@ -78,7 +78,7 @@ CWeatherJob::CWeatherJob(int location) @@ -93597,15 +16839,6 @@ index 36d2165..13f3fd9 100644 return false; AddonPtr addon; -@@ -426,7 +426,7 @@ void CWeather::OnSettingAction(const CSetting *setting) - { - AddonPtr addon; - if (CAddonMgr::GetInstance().GetAddon(CSettings::GetInstance().GetString(CSettings::SETTING_WEATHER_ADDON), addon, ADDON_SCRIPT_WEATHER) && addon != NULL) -- { //! @todo maybe have ShowAndGetInput return a bool if settings changed, then only reset weather if true. -+ { // TODO: maybe have ShowAndGetInput return a bool if settings changed, then only reset weather if true. - CGUIDialogAddonSettings::ShowAndGetInput(addon); - Refresh(); - } diff --git a/xbmc/utils/log.cpp b/xbmc/utils/log.cpp index 3443f12..ba31766 100644 --- a/xbmc/utils/log.cpp @@ -93694,1463 +16927,6 @@ index 3443f12..ba31766 100644 return s_globals.m_platform.WriteStringToLog(strData); } -diff --git a/xbmc/utils/test/TestCPUInfo.cpp b/xbmc/utils/test/TestCPUInfo.cpp -index f5ec5a9..c17b14f 100644 ---- a/xbmc/utils/test/TestCPUInfo.cpp -+++ b/xbmc/utils/test/TestCPUInfo.cpp -@@ -130,7 +130,7 @@ TEST(TestCPUInfo, GetCPUFeatures) - TEST(TestCPUInfo, getUsedPercentage_output) - { - CCPUInfo c; -- Sleep(1); //! @todo Support option from main that sets this parameter -+ Sleep(1); /* TODO: Support option from main that sets this parameter */ - int r = c.getUsedPercentage(); - std::cout << "Percentage: " << testing::PrintToString(r) << std::endl; - } -diff --git a/xbmc/utils/test/TestCharsetConverter.cpp b/xbmc/utils/test/TestCharsetConverter.cpp -index b9fafd0..97f2344 100644 ---- a/xbmc/utils/test/TestCharsetConverter.cpp -+++ b/xbmc/utils/test/TestCharsetConverter.cpp -@@ -89,8 +89,7 @@ protected: - /* Add default settings for locale. - * Settings here are taken from CGUISettings::Initialize() - */ -- /* -- //! @todo implement -+ /* TODO - CSettingsCategory *loc = CSettings::GetInstance().AddCategory(7, "locale", 14090); - CSettings::GetInstance().AddString(loc, CSettings::SETTING_LOCALE_LANGUAGE,248,"english", - SPIN_CONTROL_TEXT); -@@ -133,7 +132,7 @@ TEST_F(TestCharsetConverter, utf8ToW) - //TEST_F(TestCharsetConverter, utf16LEtoW) - //{ - // refstrw1 = L"test_utf16LEtow"; --// //! @todo Should be able to use '=' operator instead of assign() -+// /* TODO: Should be able to use '=' operator instead of assign() */ - // std::wstring refstr16_1; - // refstr16_1.assign(refutf16LE1); - // varstrw1.clear(); -@@ -249,7 +248,7 @@ TEST_F(TestCharsetConverter, isValidUtf8_4) - EXPECT_FALSE(CUtf8Utils::isValidUtf8(refutf16LE3)); - } - --//! @todo Resolve correct input/output for this function -+/* TODO: Resolve correct input/output for this function */ - // TEST_F(TestCharsetConverter, ucs2CharsetToStringCharset) - // { - // void ucs2CharsetToStringCharset(const std::wstring& strSource, -@@ -301,7 +300,7 @@ TEST_F(TestCharsetConverter, utf8logicalToVisualBiDi) - EXPECT_STREQ(refstra2.c_str(), varstra1.c_str()); - } - --//! @todo Resolve correct input/output for this function -+/* TODO: Resolve correct input/output for this function */ - // TEST_F(TestCharsetConverter, utf32ToStringCharset) - // { - // void utf32ToStringCharset(const unsigned long* strSource, std::string& strDest); -diff --git a/xbmc/utils/test/TestDatabaseUtils.cpp b/xbmc/utils/test/TestDatabaseUtils.cpp -index 1f2ce32..1207829 100644 ---- a/xbmc/utils/test/TestDatabaseUtils.cpp -+++ b/xbmc/utils/test/TestDatabaseUtils.cpp -@@ -360,6 +360,11 @@ TEST(TestDatabaseUtils, GetField_MediaTypeMusicVideo) - DatabaseQueryPartSelect); - EXPECT_STREQ(refstr.c_str(), varstr.c_str()); - -+ refstr = StringUtils::Format("musicvideo_view.c%02d",VIDEODB_ID_MUSICVIDEO_YEAR); -+ varstr = DatabaseUtils::GetField(FieldYear, MediaTypeMusicVideo, -+ DatabaseQueryPartSelect); -+ EXPECT_STREQ(refstr.c_str(), varstr.c_str()); -+ - refstr = StringUtils::Format("musicvideo_view.c%02d",VIDEODB_ID_MUSICVIDEO_PLOT); - varstr = DatabaseUtils::GetField(FieldPlot, MediaTypeMusicVideo, - DatabaseQueryPartSelect); -@@ -482,6 +487,11 @@ TEST(TestDatabaseUtils, GetField_MediaTypeMovie) - DatabaseQueryPartSelect); - EXPECT_STREQ(refstr.c_str(), varstr.c_str()); - -+ refstr = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_YEAR); -+ varstr = DatabaseUtils::GetField(FieldYear, MediaTypeMovie, -+ DatabaseQueryPartSelect); -+ EXPECT_STREQ(refstr.c_str(), varstr.c_str()); -+ - refstr = StringUtils::Format("movie_view.c%02d", VIDEODB_ID_SORTTITLE); - varstr = DatabaseUtils::GetField(FieldSortTitle, MediaTypeMovie, - DatabaseQueryPartSelect); -@@ -812,7 +822,7 @@ TEST(TestDatabaseUtils, GetFieldIndex_None) - EXPECT_EQ(refindex, varindex); - } - --//! @todo Should enums in CMusicDatabase be made public instead? -+/* TODO: Should enums in CMusicDatabase be made public instead? */ - TEST(TestDatabaseUtils, GetFieldIndex_MediaTypeAlbum) - { - int refindex, varindex; -@@ -985,6 +995,10 @@ TEST(TestDatabaseUtils, GetFieldIndex_MediaTypeMusicVideo) - varindex = DatabaseUtils::GetFieldIndex(FieldStudio, MediaTypeMusicVideo); - EXPECT_EQ(refindex, varindex); - -+ refindex = VIDEODB_ID_MUSICVIDEO_YEAR + 2; -+ varindex = DatabaseUtils::GetFieldIndex(FieldYear, MediaTypeMusicVideo); -+ EXPECT_EQ(refindex, varindex); -+ - refindex = VIDEODB_ID_MUSICVIDEO_PLOT + 2; - varindex = DatabaseUtils::GetFieldIndex(FieldPlot, MediaTypeMusicVideo); - EXPECT_EQ(refindex, varindex); -@@ -1029,10 +1043,6 @@ TEST(TestDatabaseUtils, GetFieldIndex_MediaTypeMusicVideo) - varindex = DatabaseUtils::GetFieldIndex(FieldUserRating, MediaTypeMusicVideo); - EXPECT_EQ(refindex, varindex); - -- refindex = VIDEODB_DETAILS_MUSICVIDEO_PREMIERED; -- varindex = DatabaseUtils::GetFieldIndex(FieldYear, MediaTypeMusicVideo); -- EXPECT_EQ(refindex, varindex); -- - refindex = -1; - varindex = DatabaseUtils::GetFieldIndex(FieldRandom, MediaTypeMusicVideo); - EXPECT_EQ(refindex, varindex); -@@ -1070,6 +1080,10 @@ TEST(TestDatabaseUtils, GetFieldIndex_MediaTypeMovie) - varindex = DatabaseUtils::GetFieldIndex(FieldWriter, MediaTypeMovie); - EXPECT_EQ(refindex, varindex); - -+ refindex = VIDEODB_ID_YEAR + 2; -+ varindex = DatabaseUtils::GetFieldIndex(FieldYear, MediaTypeMovie); -+ EXPECT_EQ(refindex, varindex); -+ - refindex = VIDEODB_ID_RUNTIME + 2; - varindex = DatabaseUtils::GetFieldIndex(FieldTime, MediaTypeMovie); - EXPECT_EQ(refindex, varindex); -@@ -1134,10 +1148,6 @@ TEST(TestDatabaseUtils, GetFieldIndex_MediaTypeMovie) - varindex = DatabaseUtils::GetFieldIndex(FieldRating, MediaTypeMovie); - EXPECT_EQ(refindex, varindex); - -- refindex = VIDEODB_DETAILS_MOVIE_PREMIERED; -- varindex = DatabaseUtils::GetFieldIndex(FieldYear, MediaTypeMovie); -- EXPECT_EQ(refindex, varindex); -- - refindex = -1; - varindex = DatabaseUtils::GetFieldIndex(FieldRandom, MediaTypeMovie); - EXPECT_EQ(refindex, varindex); -@@ -1347,7 +1357,7 @@ TEST(TestDatabaseUtils, GetFieldValue) - EXPECT_TRUE(v_string.isString()); - } - --//! @todo Need some way to test this function -+/* TODO: Need some way to test this function */ - // TEST(TestDatabaseUtils, GetDatabaseResults) - // { - // static bool GetDatabaseResults(MediaType mediaType, const FieldList &fields, -diff --git a/xbmc/utils/test/TestJobManager.cpp b/xbmc/utils/test/TestJobManager.cpp -index f306322..f6e975e 100644 ---- a/xbmc/utils/test/TestJobManager.cpp -+++ b/xbmc/utils/test/TestJobManager.cpp -@@ -30,8 +30,7 @@ class TestJobManager : public testing::Test - protected: - TestJobManager() - { -- //! @todo implement -- /* -+ /* TODO - CSettingsCategory* net = CSettings::GetInstance().AddCategory(4, "network", 798); - CSettings::GetInstance().AddBool(net, CSettings::SETTING_NETWORK_USEHTTPPROXY, 708, false); - CSettings::GetInstance().AddString(net, CSettings::SETTING_NETWORK_HTTPPROXYSERVER, 706, "", -diff --git a/xbmc/utils/test/TestLabelFormatter.cpp b/xbmc/utils/test/TestLabelFormatter.cpp -index 4dfa004..5c37f8f 100644 ---- a/xbmc/utils/test/TestLabelFormatter.cpp -+++ b/xbmc/utils/test/TestLabelFormatter.cpp -@@ -33,7 +33,6 @@ class TestLabelFormatter : public testing::Test - protected: - TestLabelFormatter() - { -- //! @todo implement - /* TODO - CSettingsCategory* fl = CSettings::GetInstance().AddCategory(7, "filelists", 14081); - CSettings::GetInstance().AddBool(fl, CSettings::SETTING_FILELISTS_SHOWPARENTDIRITEMS, 13306, true); -diff --git a/xbmc/utils/test/TestRegExp.cpp b/xbmc/utils/test/TestRegExp.cpp -index 796cf8d..c161aff 100644 ---- a/xbmc/utils/test/TestRegExp.cpp -+++ b/xbmc/utils/test/TestRegExp.cpp -@@ -18,7 +18,7 @@ - * - */ - --/** @todo gtest/gtest.h needs to come in before utils/RegExp.h. -+/* TODO: gtest/gtest.h needs to come in before utils/RegExp.h. - * Investigate why. - */ - #include "gtest/gtest.h" -diff --git a/xbmc/utils/test/TestStringUtils.cpp b/xbmc/utils/test/TestStringUtils.cpp -index 16e5e76..ccabbbb 100644 ---- a/xbmc/utils/test/TestStringUtils.cpp -+++ b/xbmc/utils/test/TestStringUtils.cpp -@@ -525,26 +525,3 @@ TEST(TestStringUtils, sortstringbyname) - EXPECT_STREQ("B", strarray[1].c_str()); - EXPECT_STREQ("c", strarray[2].c_str()); - } -- --TEST(TestStringUtils, FileSizeFormat) --{ -- EXPECT_STREQ("0B", StringUtils::FormatFileSize(0).c_str()); -- -- EXPECT_STREQ("999B", StringUtils::FormatFileSize(999).c_str()); -- EXPECT_STREQ("0.98kB", StringUtils::FormatFileSize(1000).c_str()); -- -- EXPECT_STREQ("1.00kB", StringUtils::FormatFileSize(1024).c_str()); -- EXPECT_STREQ("9.99kB", StringUtils::FormatFileSize(10229).c_str()); -- -- EXPECT_STREQ("10.1kB", StringUtils::FormatFileSize(10387).c_str()); -- EXPECT_STREQ("99.9kB", StringUtils::FormatFileSize(102297).c_str()); -- -- EXPECT_STREQ("100kB", StringUtils::FormatFileSize(102400).c_str()); -- EXPECT_STREQ("999kB", StringUtils::FormatFileSize(1023431).c_str()); -- -- EXPECT_STREQ("0.98MB", StringUtils::FormatFileSize(1023897).c_str()); -- EXPECT_STREQ("0.98MB", StringUtils::FormatFileSize(1024000).c_str()); -- -- //Last unit should overflow the 3 digit limit -- EXPECT_STREQ("5432PB", StringUtils::FormatFileSize(6115888293969133568).c_str()); --} -diff --git a/xbmc/utils/test/TestURIUtils.cpp b/xbmc/utils/test/TestURIUtils.cpp -index 13f93a7..cb987ac 100644 ---- a/xbmc/utils/test/TestURIUtils.cpp -+++ b/xbmc/utils/test/TestURIUtils.cpp -@@ -333,6 +333,12 @@ TEST_F(TestURIUtils, IsNfs) - EXPECT_TRUE(URIUtils::IsNfs("stack://nfs://path/to/file")); - } - -+TEST_F(TestURIUtils, IsAfp) -+{ -+ EXPECT_TRUE(URIUtils::IsAfp("afp://path/to/file")); -+ EXPECT_TRUE(URIUtils::IsAfp("stack://afp://path/to/file")); -+} -+ - TEST_F(TestURIUtils, IsOnDVD) - { - EXPECT_TRUE(URIUtils::IsOnDVD("dvd://path/to/file")); -diff --git a/xbmc/video/ContextMenus.cpp b/xbmc/video/ContextMenus.cpp -index 540fa80..de20bd4 100644 ---- a/xbmc/video/ContextMenus.cpp -+++ b/xbmc/video/ContextMenus.cpp -@@ -22,7 +22,6 @@ - #include "Application.h" - #include "Autorun.h" - #include "video/dialogs/GUIDialogVideoInfo.h" --#include "video/windows/GUIWindowVideoBase.h" - - - namespace CONTEXTMENU -@@ -115,7 +114,7 @@ std::string CPlay::GetLabel(const CFileItem& item) const - bool CPlay::IsVisible(const CFileItem& item) const - { - if (item.m_bIsFolder) -- return false; //! @todo implement -+ return false; //TODO: implement - return item.IsVideo() || item.IsDVD() || item.IsCDDA(); - } - -diff --git a/xbmc/video/ContextMenus.h b/xbmc/video/ContextMenus.h -index 33cbd62..fbfcf07 100644 ---- a/xbmc/video/ContextMenus.h -+++ b/xbmc/video/ContextMenus.h -@@ -21,6 +21,7 @@ - - #include "ContextMenuItem.h" - #include "guilib/GUIWindowManager.h" -+#include "video/windows/GUIWindowVideoNav.h" - #include "VideoLibraryQueue.h" - - namespace CONTEXTMENU -diff --git a/xbmc/video/Episode.h b/xbmc/video/Episode.h -index 22cd76b..de29450 100644 ---- a/xbmc/video/Episode.h -+++ b/xbmc/video/Episode.h -@@ -18,10 +18,6 @@ - * . - * - */ -- --#include --#include -- - #include "utils/ScraperUrl.h" - #include "XBDateTime.h" - -diff --git a/xbmc/video/GUIViewStateVideo.cpp b/xbmc/video/GUIViewStateVideo.cpp -index 85e8e14..8704c43 100644 ---- a/xbmc/video/GUIViewStateVideo.cpp -+++ b/xbmc/video/GUIViewStateVideo.cpp -@@ -56,6 +56,46 @@ VECSOURCES& CGUIViewStateWindowVideo::GetSources() - return CGUIViewState::GetSources(); - } - -+CGUIViewStateWindowVideoFiles::CGUIViewStateWindowVideoFiles(const CFileItemList& items) : CGUIViewStateWindowVideo(items) -+{ -+ if (items.IsVirtualDirectoryRoot()) -+ { -+ AddSortMethod(SortByLabel, 551, LABEL_MASKS()); // Preformated -+ AddSortMethod(SortByDriveType, 564, LABEL_MASKS()); // Preformated -+ SetSortMethod(SortByLabel); -+ -+ SetViewAsControl(DEFAULT_VIEW_LIST); -+ -+ SetSortOrder(SortOrderAscending); -+ } -+ else -+ { -+ AddSortMethod(SortByLabel, 551, LABEL_MASKS("%L", "%I", "%L", ""), // Label, Size | Label, empty -+ CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_IGNORETHEWHENSORTING) ? SortAttributeIgnoreArticle : SortAttributeNone); -+ AddSortMethod(SortBySize, 553, LABEL_MASKS("%L", "%I", "%L", "%I")); // Label, Size | Label, Size -+ AddSortMethod(SortByDate, 552, LABEL_MASKS("%L", "%J", "%L", "%J")); // Label, Date | Label, Date -+ AddSortMethod(SortByFile, 561, LABEL_MASKS("%L", "%I", "%L", "")); // Label, Size | Label, empty -+ -+ const CViewState *viewState = CViewStateSettings::GetInstance().Get("videofiles"); -+ SetSortMethod(viewState->m_sortDescription); -+ SetViewAsControl(viewState->m_viewMode); -+ SetSortOrder(viewState->m_sortDescription.sortOrder); -+ } -+ LoadViewState(items.GetPath(), WINDOW_VIDEO_FILES); -+} -+ -+void CGUIViewStateWindowVideoFiles::SaveViewState() -+{ -+ SaveViewToDb(m_items.GetPath(), WINDOW_VIDEO_FILES, CViewStateSettings::GetInstance().Get("videofiles")); -+} -+ -+VECSOURCES& CGUIViewStateWindowVideoFiles::GetSources() -+{ -+ VECSOURCES *videoSources = CMediaSourceSettings::GetInstance().GetSources("video"); -+ AddOrReplace(*videoSources, CGUIViewStateWindowVideo::GetSources()); -+ return *videoSources; -+} -+ - CGUIViewStateWindowVideoNav::CGUIViewStateWindowVideoNav(const CFileItemList& items) : CGUIViewStateWindowVideo(items) - { - SortAttribute sortAttributes = SortAttributeNone; -diff --git a/xbmc/video/GUIViewStateVideo.h b/xbmc/video/GUIViewStateVideo.h -index ec63c71..31d7dba 100644 ---- a/xbmc/video/GUIViewStateVideo.h -+++ b/xbmc/video/GUIViewStateVideo.h -@@ -34,6 +34,16 @@ protected: - virtual std::string GetExtensions(); - }; - -+class CGUIViewStateWindowVideoFiles : public CGUIViewStateWindowVideo -+{ -+public: -+ CGUIViewStateWindowVideoFiles(const CFileItemList& items); -+ -+protected: -+ virtual void SaveViewState(); -+ virtual VECSOURCES& GetSources(); -+}; -+ - class CGUIViewStateWindowVideoNav : public CGUIViewStateWindowVideo - { - public: -diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp -index b02a203..201dd7a 100644 ---- a/xbmc/video/VideoDatabase.cpp -+++ b/xbmc/video/VideoDatabase.cpp -@@ -125,7 +125,7 @@ void CVideoDatabase::CreateTables() - for (int i = 0; i < VIDEODB_MAX_COLUMNS; i++) - columns += StringUtils::Format(",c%02d text", i); - -- columns += ", idSet integer, userrating integer, premiered text)"; -+ columns += ", idSet integer, userrating integer)"; - m_pDS->exec(columns); - - CLog::Log(LOGINFO, "create actor table"); -@@ -179,7 +179,7 @@ void CVideoDatabase::CreateTables() - for (int i = 0; i < VIDEODB_MAX_COLUMNS; i++) - columns += StringUtils::Format(",c%02d text", i); - -- columns += ", userrating integer, premiered text)"; -+ columns += ", userrating integer)"; - m_pDS->exec(columns); - - CLog::Log(LOGINFO, "create streaminfo table"); -@@ -269,8 +269,6 @@ void CVideoDatabase::CreateAnalytics() - m_pDS->exec("CREATE INDEX ix_seasons ON seasons (idShow, season)"); - m_pDS->exec("CREATE INDEX ix_art ON art(media_id, media_type(20), type(20))"); - -- m_pDS->exec("CREATE INDEX ix_rating ON rating(media_id, media_type(20))"); -- - CreateLinkIndex("tag"); - CreateLinkIndex("actor"); - CreateForeignLinkIndex("director", "actor"); -@@ -1848,7 +1846,7 @@ void CVideoDatabase::GetMusicVideosByArtist(const std::string& strArtist, CFileI - if (NULL == m_pDS.get()) return ; - - std::string strSQL; -- if (strArtist.empty()) //! @todo SMARTPLAYLISTS what is this here for??? -+ if (strArtist.empty()) // TODO: SMARTPLAYLISTS what is this here for??? - strSQL=PrepareSQL("select distinct * from musicvideo_view join actor_link on actor_link.media_id=musicvideo_view.idMVideo AND actor_link.media_type='musicvideo' join actor on actor.actor_id=actor_link.actor_id"); - else - strSQL=PrepareSQL("select * from musicvideo_view join actor_link on actor_link.media_id=musicvideo_view.idMVideo AND actor_link.media_type='musicvideo' join actor on actor.actor_id=actor_link.actor_id where actor.name='%s'", strArtist.c_str()); -@@ -2107,8 +2105,6 @@ std::string CVideoDatabase::GetValueString(const CVideoInfoTag &details, int min - case VIDEODB_TYPE_DATETIME: - conditions.emplace_back(PrepareSQL("c%02d='%s'", i, ((CDateTime*)(((char*)&details)+offsets[i].offset))->GetAsDBDateTime().c_str())); - break; -- case VIDEODB_TYPE_UNUSED: // Skip the unused field to avoid populating unused data -- continue; - } - } - return StringUtils::Join(conditions, ","); -@@ -2190,7 +2186,7 @@ int CVideoDatabase::SetDetailsForMovie(const std::string& strFilenameAndPath, CV - AddActorLinksToItem(idMovie, MediaTypeMovie, "writer", details.m_writingCredits); - - // add ratings -- details.m_iIdRating = AddRatings(idMovie, MediaTypeMovie, details.m_ratings, details.GetDefaultRating()); -+ details.m_iIdRating = AddRatings(idMovie, MediaTypeMovie, details.m_ratings, details.m_strDefaultRating); - - // add set... - int idSet = -1; -@@ -2208,9 +2204,9 @@ int CVideoDatabase::SetDetailsForMovie(const std::string& strFilenameAndPath, CV - - SetArtForItem(idMovie, MediaTypeMovie, artwork); - -- if (!details.m_strIMDBNumber.empty() && details.HasYear()) -+ if (!details.m_strIMDBNumber.empty() && details.m_iYear) - { // query DB for any movies matching imdbid and year -- std::string strSQL = PrepareSQL("SELECT files.playCount, files.lastPlayed FROM movie INNER JOIN files ON files.idFile=movie.idFile WHERE movie.c%02d='%s' AND movie.premiered LIKE '%i%%' AND movie.idMovie!=%i AND files.playCount > 0", VIDEODB_ID_IDENT, details.m_strIMDBNumber.c_str(), details.GetYear(), idMovie); -+ std::string strSQL = PrepareSQL("SELECT files.playCount, files.lastPlayed FROM movie INNER JOIN files ON files.idFile=movie.idFile WHERE movie.c%02d='%s' AND movie.c%02d=%i AND movie.idMovie!=%i AND files.playCount > 0", VIDEODB_ID_IDENT, details.m_strIMDBNumber.c_str(), VIDEODB_ID_YEAR, details.m_iYear, idMovie); - m_pDS->query(strSQL); - - if (!m_pDS->eof()) -@@ -2240,10 +2236,6 @@ int CVideoDatabase::SetDetailsForMovie(const std::string& strFilenameAndPath, CV - sql += PrepareSQL(", userrating = %i", details.m_iUserRating); - else - sql += ", userrating = NULL"; -- if (details.HasPremiered()) -- sql += PrepareSQL(", premiered = '%s'", details.GetPremiered().GetAsDBDate().c_str()); -- else -- sql += PrepareSQL(", premiered = '%i'", details.GetYear()); - sql += PrepareSQL(" where idMovie=%i", idMovie); - m_pDS->exec(sql); - CommitTransaction(); -@@ -2285,7 +2277,7 @@ int CVideoDatabase::UpdateDetailsForMovie(int idMovie, CVideoInfoTag& details, c - if (updatedDetails.find("art.altered") != updatedDetails.end()) - SetArtForItem(idMovie, MediaTypeMovie, artwork); - if (updatedDetails.find("ratings") != updatedDetails.end()) -- details.m_iIdRating = UpdateRatings(idMovie, MediaTypeMovie, details.m_ratings, details.GetDefaultRating()); -+ details.m_iIdRating = UpdateRatings(idMovie, MediaTypeMovie, details.m_ratings, details.m_strDefaultRating); - if (updatedDetails.find("dateadded") != updatedDetails.end() && details.m_dateAdded.IsValid()) - { - if (details.m_iFileId <= 0) -@@ -2339,10 +2331,6 @@ int CVideoDatabase::UpdateDetailsForMovie(int idMovie, CVideoInfoTag& details, c - sql += PrepareSQL(", userrating = %i", details.m_iUserRating); - else - sql += ", userrating = NULL"; -- if (details.HasPremiered()) -- sql += PrepareSQL(", premiered = '%s'", details.GetPremiered().GetAsDBDate().c_str()); -- else -- sql += PrepareSQL(", premiered = '%i'", details.GetYear()); - sql += PrepareSQL(" where idMovie=%i", idMovie); - m_pDS->exec(sql); - -@@ -2402,7 +2390,7 @@ int CVideoDatabase::GetMatchingTvShow(const CVideoInfoTag &details) - if (!details.m_strIMDBNumber.empty()) - id = GetDbId(PrepareSQL("SELECT idShow from tvshow WHERE c%02d='%s'", VIDEODB_ID_TV_IDENT, details.m_strIMDBNumber.c_str())); - if (id < 0) -- id = GetDbId(PrepareSQL("SELECT idShow FROM tvshow WHERE c%02d='%s' AND c%02d='%s'", VIDEODB_ID_TV_TITLE, details.m_strTitle.c_str(), VIDEODB_ID_TV_PREMIERED, details.GetPremiered().GetAsDBDate().c_str())); -+ id = GetDbId(PrepareSQL("SELECT idShow FROM tvshow WHERE c%02d='%s' AND c%02d='%s'", VIDEODB_ID_TV_TITLE, details.m_strTitle.c_str(), VIDEODB_ID_TV_PREMIERED, details.m_premiered.GetAsDBDate().c_str())); - return id; - } - -@@ -2461,7 +2449,7 @@ bool CVideoDatabase::UpdateDetailsForTvShow(int idTvShow, CVideoInfoTag &details - AddActorLinksToItem(idTvShow, MediaTypeTvShow, "director", details.m_director); - - // add ratings -- details.m_iIdRating = AddRatings(idTvShow, MediaTypeTvShow, details.m_ratings, details.GetDefaultRating()); -+ details.m_iIdRating = AddRatings(idTvShow, MediaTypeTvShow, details.m_ratings, details.m_strDefaultRating); - - // add "all seasons" - the rest are added in SetDetailsForEpisode - AddSeason(idTvShow, -1); -@@ -2590,7 +2578,7 @@ int CVideoDatabase::SetDetailsForEpisode(const std::string& strFilenameAndPath, - AddActorLinksToItem(idEpisode, MediaTypeEpisode, "writer", details.m_writingCredits); - - // add ratings -- details.m_iIdRating = AddRatings(idEpisode, MediaTypeEpisode, details.m_ratings, details.GetDefaultRating()); -+ details.m_iIdRating = AddRatings(idEpisode, MediaTypeEpisode, details.m_ratings, details.m_strDefaultRating); - - if (details.HasStreamDetails()) - { -@@ -2725,10 +2713,6 @@ int CVideoDatabase::SetDetailsForMusicVideo(const std::string& strFilenameAndPat - sql += PrepareSQL(", userrating = %i", details.m_iUserRating); - else - sql += ", userrating = NULL"; -- if (details.HasPremiered()) -- sql += PrepareSQL(", premiered = '%s'", details.GetPremiered().GetAsDBDate().c_str()); -- else -- sql += PrepareSQL(", premiered = '%i'", details.GetYear()); - sql += PrepareSQL(" where idMVideo=%i", idMVideo); - m_pDS->exec(sql); - CommitTransaction(); -@@ -3178,7 +3162,7 @@ void CVideoDatabase::DeleteMovie(int idMovie, bool bKeepId /* = false */) - m_pDS->exec(strSQL); - } - -- //! @todo move this below CommitTransaction() once UPnP doesn't rely on this anymore -+ // TODO: move this below CommitTransaction() once UPnP doesn't rely on this anymore - if (!bKeepId) - AnnounceRemove(MediaTypeMovie, idMovie); - -@@ -3241,7 +3225,7 @@ void CVideoDatabase::DeleteTvShow(int idTvShow, bool bKeepId /* = false */) - } - } - -- //! @todo move this below CommitTransaction() once UPnP doesn't rely on this anymore -+ //TODO: move this below CommitTransaction() once UPnP doesn't rely on this anymore - if (!bKeepId) - AnnounceRemove(MediaTypeTvShow, idTvShow); - -@@ -3307,7 +3291,7 @@ void CVideoDatabase::DeleteEpisode(int idEpisode, bool bKeepId /* = false */) - if (NULL == m_pDB.get()) return ; - if (NULL == m_pDS.get()) return ; - -- //! @todo move this below CommitTransaction() once UPnP doesn't rely on this anymore -+ //TODO: move this below CommitTransaction() once UPnP doesn't rely on this anymore - if (!bKeepId) - AnnounceRemove(MediaTypeEpisode, idEpisode); - -@@ -3363,7 +3347,7 @@ void CVideoDatabase::DeleteMusicVideo(int idMVideo, bool bKeepId /* = false */) - m_pDS->exec(strSQL); - } - -- //! @todo move this below CommitTransaction() once UPnP doesn't rely on this anymore -+ //TODO: move this below CommitTransaction() once UPnP doesn't rely on this anymore - if (!bKeepId) - AnnounceRemove(MediaTypeMusicVideo, idMVideo); - -@@ -3489,8 +3473,6 @@ void CVideoDatabase::GetDetailsFromDB(const dbiplus::sql_record* const record, i - case VIDEODB_TYPE_DATETIME: - ((CDateTime*)(((char*)&details)+offsets[i].offset))->SetFromDBDateTime(record->at(i+idxOffset).get_asString()); - break; -- case VIDEODB_TYPE_UNUSED: // Skip the unused field to avoid populating unused data -- continue; - } - } - } -@@ -3677,14 +3659,9 @@ CVideoInfoTag CVideoDatabase::GetDetailsForMovie(const dbiplus::sql_record* cons - details.m_resumePoint.totalTimeInSeconds = record->at(VIDEODB_DETAILS_MOVIE_TOTAL_TIME).get_asInt(); - details.m_resumePoint.type = CBookmark::RESUME; - details.m_iUserRating = record->at(VIDEODB_DETAILS_MOVIE_USER_RATING).get_asInt(); -- details.AddRating(record->at(VIDEODB_DETAILS_MOVIE_RATING).get_asFloat(), -- record->at(VIDEODB_DETAILS_MOVIE_VOTES).get_asInt(), -- record->at(VIDEODB_DETAILS_MOVIE_RATING_TYPE).get_asString(), true); -- std::string premieredString = record->at(VIDEODB_DETAILS_MOVIE_PREMIERED).get_asString(); -- if (premieredString.size() == 4) -- details.SetYear(record->at(VIDEODB_DETAILS_MOVIE_PREMIERED).get_asInt()); -- else -- details.SetPremieredFromDBDate(premieredString); -+ details.AddRating(record->at(VIDEODB_DETAILS_MOVIE_RATING).get_asFloat(), -+ record->at(VIDEODB_DETAILS_MOVIE_VOTES).get_asInt(), -+ record->at(VIDEODB_DETAILS_MOVIE_RATING_TYPE).get_asString()); - movieTime += XbmcThreads::SystemClockMillis() - time; time = XbmcThreads::SystemClockMillis(); - - if (getDetails) -@@ -3743,7 +3720,6 @@ CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(const dbiplus::sql_record* con - int idTvShow = record->at(0).get_asInt(); - - GetDetailsFromDB(record, VIDEODB_ID_TV_MIN, VIDEODB_ID_TV_MAX, DbTvShowOffsets, details, 1); -- details.m_bHasPremiered = details.m_premiered.IsValid(); - details.m_iDbId = idTvShow; - details.m_type = MediaTypeTvShow; - details.m_strPath = record->at(VIDEODB_DETAILS_TVSHOW_PATH).get_asString(); -@@ -3755,10 +3731,12 @@ CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(const dbiplus::sql_record* con - details.m_iEpisode = record->at(VIDEODB_DETAILS_TVSHOW_NUM_EPISODES).get_asInt(); - details.m_playCount = record->at(VIDEODB_DETAILS_TVSHOW_NUM_WATCHED).get_asInt(); - details.m_strShowTitle = details.m_strTitle; -+ if (details.m_premiered.IsValid()) -+ details.m_iYear = details.m_premiered.GetYear(); - details.m_iUserRating = record->at(VIDEODB_DETAILS_TVSHOW_USER_RATING).get_asInt(); -- details.AddRating(record->at(VIDEODB_DETAILS_TVSHOW_RATING).get_asFloat(), -- record->at(VIDEODB_DETAILS_TVSHOW_VOTES).get_asInt(), -- record->at(VIDEODB_DETAILS_TVSHOW_RATING_TYPE).get_asString(), true); -+ details.AddRating(record->at(VIDEODB_DETAILS_TVSHOW_RATING).get_asFloat(), -+ record->at(VIDEODB_DETAILS_TVSHOW_VOTES).get_asInt(), -+ record->at(VIDEODB_DETAILS_TVSHOW_RATING_TYPE).get_asString()); - details.m_duration = record->at(VIDEODB_DETAILS_TVSHOW_DURATION).get_asInt(); - - movieTime += XbmcThreads::SystemClockMillis() - time; time = XbmcThreads::SystemClockMillis(); -@@ -3784,7 +3762,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(const dbiplus::sql_record* con - - if (item != NULL) - { -- item->m_dateTime = details.GetPremiered(); -+ item->m_dateTime = details.m_premiered; - item->SetProperty("totalseasons", details.m_iSeason); - item->SetProperty("totalepisodes", details.m_iEpisode); - item->SetProperty("numepisodes", details.m_iEpisode); // will be changed later to reflect watchmode setting -@@ -3825,7 +3803,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(const dbiplus::sql_record* co - details.m_strShowTitle = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_NAME).get_asString(); - details.m_genre = StringUtils::Split(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_GENRE).get_asString(), g_advancedSettings.m_videoItemSeparator); - details.m_studio = StringUtils::Split(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO).get_asString(), g_advancedSettings.m_videoItemSeparator); -- details.SetPremieredFromDBDate(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED).get_asString()); -+ details.m_premiered.SetFromDBDate(record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED).get_asString()); - details.m_iIdShow = record->at(VIDEODB_DETAILS_EPISODE_TVSHOW_ID).get_asInt(); - details.m_iIdSeason = record->at(VIDEODB_DETAILS_EPISODE_SEASON_ID).get_asInt(); - -@@ -3833,9 +3811,10 @@ CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(const dbiplus::sql_record* co - details.m_resumePoint.totalTimeInSeconds = record->at(VIDEODB_DETAILS_EPISODE_TOTAL_TIME).get_asInt(); - details.m_resumePoint.type = CBookmark::RESUME; - details.m_iUserRating = record->at(VIDEODB_DETAILS_EPISODE_USER_RATING).get_asInt(); -- details.AddRating(record->at(VIDEODB_DETAILS_EPISODE_RATING).get_asFloat(), -- record->at(VIDEODB_DETAILS_EPISODE_VOTES).get_asInt(), -- record->at(VIDEODB_DETAILS_EPISODE_RATING_TYPE).get_asString(), true); -+ details.AddRating(record->at(VIDEODB_DETAILS_EPISODE_RATING).get_asFloat(), -+ record->at(VIDEODB_DETAILS_EPISODE_VOTES).get_asInt(), -+ record->at(VIDEODB_DETAILS_EPISODE_RATING_TYPE).get_asString()); -+ - movieTime += XbmcThreads::SystemClockMillis() - time; time = XbmcThreads::SystemClockMillis(); - - if (getDetails) -@@ -3890,11 +3869,6 @@ CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo(const dbiplus::sql_record* - details.m_resumePoint.totalTimeInSeconds = record->at(VIDEODB_DETAILS_MUSICVIDEO_TOTAL_TIME).get_asInt(); - details.m_resumePoint.type = CBookmark::RESUME; - details.m_iUserRating = record->at(VIDEODB_DETAILS_MUSICVIDEO_USER_RATING).get_asInt(); -- std::string premieredString = record->at(VIDEODB_DETAILS_MUSICVIDEO_PREMIERED).get_asString(); -- if (premieredString.size() == 4) -- details.SetYear(record->at(VIDEODB_DETAILS_MUSICVIDEO_PREMIERED).get_asInt()); -- else -- details.SetPremieredFromDBDate(premieredString); - - movieTime += XbmcThreads::SystemClockMillis() - time; time = XbmcThreads::SystemClockMillis(); - -@@ -4959,19 +4933,11 @@ void CVideoDatabase::UpdateTables(int iVersion) - } - m_pDS->close(); - } -- -- if (iVersion < 105) -- { -- m_pDS->exec("ALTER TABLE movie ADD premiered TEXT"); -- m_pDS->exec(PrepareSQL("UPDATE movie SET premiered=c%02d", VIDEODB_ID_YEAR)); -- m_pDS->exec("ALTER TABLE musicvideo ADD premiered TEXT"); -- m_pDS->exec(PrepareSQL("UPDATE musicvideo SET premiered=c%02d", VIDEODB_ID_MUSICVIDEO_YEAR)); -- } - } - - int CVideoDatabase::GetSchemaVersion() const - { -- return 106; -+ return 104; - } - - bool CVideoDatabase::LookupByFolders(const std::string &path, bool shows) -@@ -5014,7 +4980,7 @@ bool CVideoDatabase::GetPlayCounts(const std::string &strPath, CFileItemList &it - if (NULL == m_pDB.get()) return false; - if (NULL == m_pDS.get()) return false; - -- //! @todo also test a single query for the above and below -+ // TODO: also test a single query for the above and below - std::string sql = PrepareSQL( - "SELECT" - " files.strFilename, files.playCount," -@@ -5706,12 +5672,12 @@ bool CVideoDatabase::GetPeopleNav(const std::string& strBaseDir, CFileItemList& - - try - { -- //! @todo This routine (and probably others at this same level) use playcount as a reference to filter on at a later -- //! point. This means that we *MUST* filter these levels as you'll get double ups. Ideally we'd allow playcount -- //! to filter through as we normally do for tvshows to save this happening. -- //! Also, we apply this same filtering logic to the locked or unlocked paths to prevent these from showing. -- //! Whether or not this should happen is a tricky one - it complicates all the high level categories (everything -- //! above titles). -+ // TODO: This routine (and probably others at this same level) use playcount as a reference to filter on at a later -+ // point. This means that we *MUST* filter these levels as you'll get double ups. Ideally we'd allow playcount -+ // to filter through as we normally do for tvshows to save this happening. -+ // Also, we apply this same filtering logic to the locked or unlocked paths to prevent these from showing. -+ // Whether or not this should happen is a tricky one - it complicates all the high level categories (everything -+ // above titles). - - // General routine that the other actor/director/writer routines call - -@@ -5955,7 +5921,7 @@ bool CVideoDatabase::GetYearsNav(const std::string& strBaseDir, CFileItemList& i - { - if (idContent == VIDEODB_CONTENT_MOVIES) - { -- strSQL = "select movie_view.premiered, path.strPath, files.playCount from movie_view "; -+ strSQL = PrepareSQL("select movie_view.c%02d, path.strPath, files.playCount from movie_view ", VIDEODB_ID_YEAR); - extFilter.AppendJoin("join files on files.idFile = movie_view.idFile join path on files.idPath = path.idPath"); - } - else if (idContent == VIDEODB_CONTENT_TVSHOWS) -@@ -5965,7 +5931,7 @@ bool CVideoDatabase::GetYearsNav(const std::string& strBaseDir, CFileItemList& i - } - else if (idContent == VIDEODB_CONTENT_MUSICVIDEOS) - { -- strSQL = "select musicvideo_view.premiered, path.strPath, files.playCount from musicvideo_view "; -+ strSQL = PrepareSQL("select musicvideo_view.c%02d, path.strPath, files.playCount from musicvideo_view ", VIDEODB_ID_MUSICVIDEO_YEAR); - extFilter.AppendJoin("join files on files.idFile = musicvideo_view.idFile join path on files.idPath = path.idPath"); - } - else -@@ -5976,9 +5942,9 @@ bool CVideoDatabase::GetYearsNav(const std::string& strBaseDir, CFileItemList& i - std::string group; - if (idContent == VIDEODB_CONTENT_MOVIES) - { -- strSQL = "select movie_view.premiered, count(1), count(files.playCount) from movie_view "; -+ strSQL = PrepareSQL("select movie_view.c%02d, count(1), count(files.playCount) from movie_view ", VIDEODB_ID_YEAR); - extFilter.AppendJoin("join files on files.idFile = movie_view.idFile"); -- extFilter.AppendGroup("movie_view.premiered"); -+ extFilter.AppendGroup(PrepareSQL("movie_view.c%02d", VIDEODB_ID_YEAR)); - } - else if (idContent == VIDEODB_CONTENT_TVSHOWS) - { -@@ -5987,9 +5953,9 @@ bool CVideoDatabase::GetYearsNav(const std::string& strBaseDir, CFileItemList& i - } - else if (idContent == VIDEODB_CONTENT_MUSICVIDEOS) - { -- strSQL = "select musicvideo_view.premiered, count(1), count(files.playCount) from musicvideo_view "; -+ strSQL = PrepareSQL("select musicvideo_view.c%02d, count(1), count(files.playCount) from musicvideo_view ", VIDEODB_ID_MUSICVIDEO_YEAR); - extFilter.AppendJoin("join files on files.idFile = musicvideo_view.idFile"); -- extFilter.AppendGroup("musicvideo_view.premiered"); -+ extFilter.AppendGroup(PrepareSQL("musicvideo_view.c%02d", VIDEODB_ID_MUSICVIDEO_YEAR)); - } - else - return false; -@@ -6010,15 +5976,14 @@ bool CVideoDatabase::GetYearsNav(const std::string& strBaseDir, CFileItemList& i - while (!m_pDS->eof()) - { - int lYear = 0; -- std::string dateString = m_pDS->fv(0).get_asString(); -- if (dateString.size() == 4) -- lYear = m_pDS->fv(0).get_asInt(); -- else -+ if (idContent == VIDEODB_CONTENT_TVSHOWS) - { - CDateTime time; -- time.SetFromDateString(dateString); -+ time.SetFromDateString(m_pDS->fv(0).get_asString()); - lYear = time.GetYear(); - } -+ else if (idContent == VIDEODB_CONTENT_MOVIES || idContent == VIDEODB_CONTENT_MUSICVIDEOS) -+ lYear = m_pDS->fv(0).get_asInt(); - it = mapYears.find(lYear); - if (it == mapYears.end()) - { -@@ -6058,15 +6023,18 @@ bool CVideoDatabase::GetYearsNav(const std::string& strBaseDir, CFileItemList& i - while (!m_pDS->eof()) - { - int lYear = 0; -- std::string strLabel = m_pDS->fv(0).get_asString(); -- if (strLabel.size() == 4) -- lYear = m_pDS->fv(0).get_asInt(); -- else -+ std::string strLabel; -+ if (idContent == VIDEODB_CONTENT_TVSHOWS) - { - CDateTime time; -- time.SetFromDateString(strLabel); -+ time.SetFromDateString(m_pDS->fv(0).get_asString()); - lYear = time.GetYear(); -- strLabel = StringUtils::Format("%i", lYear); -+ strLabel = StringUtils::Format("%i",lYear); -+ } -+ else if (idContent == VIDEODB_CONTENT_MOVIES || idContent == VIDEODB_CONTENT_MUSICVIDEOS) -+ { -+ lYear = m_pDS->fv(0).get_asInt(); -+ strLabel = m_pDS->fv(0).get_asString(); - } - if (lYear == 0) - { -@@ -6224,17 +6192,16 @@ bool CVideoDatabase::GetSeasonsByWhere(const std::string& strBaseDir, const Filt - pItem->GetVideoInfoTag()->m_strPath = path; - pItem->GetVideoInfoTag()->m_strShowTitle = m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_TITLE).get_asString(); - pItem->GetVideoInfoTag()->m_strPlot = m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_PLOT).get_asString(); -- pItem->GetVideoInfoTag()->SetPremieredFromDBDate(m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_PREMIERED).get_asString()); -+ pItem->GetVideoInfoTag()->m_premiered.SetFromDBDate(m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_PREMIERED).get_asString()); - pItem->GetVideoInfoTag()->m_firstAired.SetFromDBDate(m_pDS->fv(VIDEODB_ID_SEASON_PREMIERED).get_asString()); - pItem->GetVideoInfoTag()->m_iUserRating = m_pDS->fv(VIDEODB_ID_SEASON_USER_RATING).get_asInt(); -- // season premiered date based on first episode airdate associated to the season -- // tvshow premiered date is used as a fallback -+ -+ // season premiered date based on first episode airdate associated to the season -+ // tvshow premiered date is used as a fallback - if (pItem->GetVideoInfoTag()->m_firstAired.IsValid()) -- pItem->GetVideoInfoTag()->SetPremiered(pItem->GetVideoInfoTag()->m_firstAired); -- else if (pItem->GetVideoInfoTag()->HasPremiered()) -- pItem->GetVideoInfoTag()->SetPremiered(pItem->GetVideoInfoTag()->GetPremiered()); -- else if (pItem->GetVideoInfoTag()->HasYear()) -- pItem->GetVideoInfoTag()->SetYear(pItem->GetVideoInfoTag()->GetYear()); -+ pItem->GetVideoInfoTag()->m_iYear = pItem->GetVideoInfoTag()->m_firstAired.GetYear(); -+ else if (pItem->GetVideoInfoTag()->m_premiered.IsValid()) -+ pItem->GetVideoInfoTag()->m_iYear = pItem->GetVideoInfoTag()->m_premiered.GetYear(); - pItem->GetVideoInfoTag()->m_genre = StringUtils::Split(m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_GENRE).get_asString(), g_advancedSettings.m_videoItemSeparator); - pItem->GetVideoInfoTag()->m_studio = StringUtils::Split(m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_STUDIO).get_asString(), g_advancedSettings.m_videoItemSeparator); - pItem->GetVideoInfoTag()->m_strMPAARating = m_pDS->fv(VIDEODB_ID_SEASON_TVSHOW_MPAA).get_asString(); -@@ -6740,6 +6707,7 @@ bool CVideoDatabase::GetEpisodesByWhere(const std::string& strBaseDir, const Fil - - pItem->SetOverlayImage(CGUIListItem::ICON_OVERLAY_UNWATCHED, movie.m_playCount > 0); - pItem->m_dateTime = movie.m_firstAired; -+ pItem->GetVideoInfoTag()->m_iYear = pItem->m_dateTime.GetYear(); - items.Add(pItem); - } - } -@@ -8703,8 +8671,8 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFile /* = t - if (singleFile) - { - std::string strFileName(movie.m_strTitle); -- if (movie.HasYear()) -- strFileName += StringUtils::Format("_%i", movie.GetYear()); -+ if (movie.m_iYear > 0) -+ strFileName += StringUtils::Format("_%i", movie.m_iYear); - item.SetPath(GetSafeFile(moviesDir, strFileName) + ".avi"); - } - for (std::map::const_iterator i = artwork.begin(); i != artwork.end(); ++i) -@@ -8792,8 +8760,8 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFile /* = t - if (singleFile) - { - std::string strFileName(StringUtils::Join(movie.m_artist, g_advancedSettings.m_videoItemSeparator) + "." + movie.m_strTitle); -- if (movie.HasYear()) -- strFileName += StringUtils::Format("_%i", movie.GetYear()); -+ if (movie.m_iYear > 0) -+ strFileName += StringUtils::Format("_%i", movie.m_iYear); - item.SetPath(GetSafeFile(moviesDir, strFileName) + ".avi"); - } - for (std::map::const_iterator i = artwork.begin(); i != artwork.end(); ++i) -@@ -9170,8 +9138,8 @@ void CVideoDatabase::ImportFromXML(const std::string &path) - CFileItem item(info); - bool useFolders = info.m_basePath.empty() ? LookupByFolders(item.GetPath()) : false; - std::string filename = info.m_strTitle; -- if (info.HasYear()) -- filename += StringUtils::Format("_%i", info.GetYear()); -+ if (info.m_iYear > 0) -+ filename += StringUtils::Format("_%i", info.m_iYear); - CFileItem artItem(item); - artItem.SetPath(GetSafeFile(moviesDir, filename) + ".avi"); - scanner.GetArtwork(&artItem, CONTENT_MOVIES, useFolders, true, actorsDir); -@@ -9185,8 +9153,8 @@ void CVideoDatabase::ImportFromXML(const std::string &path) - CFileItem item(info); - bool useFolders = info.m_basePath.empty() ? LookupByFolders(item.GetPath()) : false; - std::string filename = StringUtils::Join(info.m_artist, g_advancedSettings.m_videoItemSeparator) + "." + info.m_strTitle; -- if (info.HasYear()) -- filename += StringUtils::Format("_%i", info.GetYear()); -+ if (info.m_iYear > 0) -+ filename += StringUtils::Format("_%i", info.m_iYear); - CFileItem artItem(item); - artItem.SetPath(GetSafeFile(musicvideosDir, filename) + ".avi"); - scanner.GetArtwork(&artItem, CONTENT_MUSICVIDEOS, useFolders, true, actorsDir); -@@ -9523,7 +9491,7 @@ bool CVideoDatabase::GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription - - option = options.find("year"); - if (option != options.end()) -- filter.AppendWhere(PrepareSQL("movie_view.premiered like '%i%%'", (int)option->second.asInteger())); -+ filter.AppendWhere(PrepareSQL("movie_view.c%02d = '%i'", VIDEODB_ID_YEAR, (int)option->second.asInteger())); - - AppendIdLinkFilter("actor", "actor", "movie", "movie", "idMovie", options, filter); - AppendLinkFilter("actor", "actor", "movie", "movie", "idMovie", options, filter); -@@ -9645,7 +9613,7 @@ bool CVideoDatabase::GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription - - option = options.find("year"); - if (option != options.end()) -- filter.AppendWhere(PrepareSQL("musicvideo_view.premiered like '%i%%'", (int)option->second.asInteger())); -+ filter.AppendWhere(PrepareSQL("musicvideo_view.c%02d = '%i'",VIDEODB_ID_MUSICVIDEO_YEAR, (int)option->second.asInteger())); - - option = options.find("artistid"); - if (option != options.end()) -diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h -index 3747886..b85ed4b 100644 ---- a/xbmc/video/VideoDatabase.h -+++ b/xbmc/video/VideoDatabase.h -@@ -22,7 +22,6 @@ - #include - #include - #include --#include - - #include "addons/Scraper.h" - #include "Bookmark.h" -@@ -87,19 +86,18 @@ enum VideoDbDetails - - #define VIDEODB_DETAILS_MOVIE_SET_ID VIDEODB_MAX_COLUMNS + 2 - #define VIDEODB_DETAILS_MOVIE_USER_RATING VIDEODB_MAX_COLUMNS + 3 --#define VIDEODB_DETAILS_MOVIE_PREMIERED VIDEODB_MAX_COLUMNS + 4 --#define VIDEODB_DETAILS_MOVIE_SET_NAME VIDEODB_MAX_COLUMNS + 5 --#define VIDEODB_DETAILS_MOVIE_SET_OVERVIEW VIDEODB_MAX_COLUMNS + 6 --#define VIDEODB_DETAILS_MOVIE_FILE VIDEODB_MAX_COLUMNS + 7 --#define VIDEODB_DETAILS_MOVIE_PATH VIDEODB_MAX_COLUMNS + 8 --#define VIDEODB_DETAILS_MOVIE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 9 --#define VIDEODB_DETAILS_MOVIE_LASTPLAYED VIDEODB_MAX_COLUMNS + 10 --#define VIDEODB_DETAILS_MOVIE_DATEADDED VIDEODB_MAX_COLUMNS + 11 --#define VIDEODB_DETAILS_MOVIE_RESUME_TIME VIDEODB_MAX_COLUMNS + 12 --#define VIDEODB_DETAILS_MOVIE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 13 --#define VIDEODB_DETAILS_MOVIE_RATING VIDEODB_MAX_COLUMNS + 14 --#define VIDEODB_DETAILS_MOVIE_VOTES VIDEODB_MAX_COLUMNS + 15 --#define VIDEODB_DETAILS_MOVIE_RATING_TYPE VIDEODB_MAX_COLUMNS + 16 -+#define VIDEODB_DETAILS_MOVIE_SET_NAME VIDEODB_MAX_COLUMNS + 4 -+#define VIDEODB_DETAILS_MOVIE_SET_OVERVIEW VIDEODB_MAX_COLUMNS + 5 -+#define VIDEODB_DETAILS_MOVIE_FILE VIDEODB_MAX_COLUMNS + 6 -+#define VIDEODB_DETAILS_MOVIE_PATH VIDEODB_MAX_COLUMNS + 7 -+#define VIDEODB_DETAILS_MOVIE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 8 -+#define VIDEODB_DETAILS_MOVIE_LASTPLAYED VIDEODB_MAX_COLUMNS + 9 -+#define VIDEODB_DETAILS_MOVIE_DATEADDED VIDEODB_MAX_COLUMNS + 10 -+#define VIDEODB_DETAILS_MOVIE_RESUME_TIME VIDEODB_MAX_COLUMNS + 11 -+#define VIDEODB_DETAILS_MOVIE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 12 -+#define VIDEODB_DETAILS_MOVIE_RATING VIDEODB_MAX_COLUMNS + 13 -+#define VIDEODB_DETAILS_MOVIE_VOTES VIDEODB_MAX_COLUMNS + 14 -+#define VIDEODB_DETAILS_MOVIE_RATING_TYPE VIDEODB_MAX_COLUMNS + 15 - - #define VIDEODB_DETAILS_EPISODE_TVSHOW_ID VIDEODB_MAX_COLUMNS + 2 - #define VIDEODB_DETAILS_EPISODE_USER_RATING VIDEODB_MAX_COLUMNS + 3 -@@ -134,16 +132,14 @@ enum VideoDbDetails - #define VIDEODB_DETAILS_TVSHOW_RATING_TYPE VIDEODB_MAX_COLUMNS + 12 - - #define VIDEODB_DETAILS_MUSICVIDEO_USER_RATING VIDEODB_MAX_COLUMNS + 2 --#define VIDEODB_DETAILS_MUSICVIDEO_PREMIERED VIDEODB_MAX_COLUMNS + 3 --#define VIDEODB_DETAILS_MUSICVIDEO_FILE VIDEODB_MAX_COLUMNS + 4 --#define VIDEODB_DETAILS_MUSICVIDEO_PATH VIDEODB_MAX_COLUMNS + 5 --#define VIDEODB_DETAILS_MUSICVIDEO_PLAYCOUNT VIDEODB_MAX_COLUMNS + 6 --#define VIDEODB_DETAILS_MUSICVIDEO_LASTPLAYED VIDEODB_MAX_COLUMNS + 7 --#define VIDEODB_DETAILS_MUSICVIDEO_DATEADDED VIDEODB_MAX_COLUMNS + 8 --#define VIDEODB_DETAILS_MUSICVIDEO_RESUME_TIME VIDEODB_MAX_COLUMNS + 9 --#define VIDEODB_DETAILS_MUSICVIDEO_TOTAL_TIME VIDEODB_MAX_COLUMNS + 10 -- --#define VIDEODB_TYPE_UNUSED 0 -+#define VIDEODB_DETAILS_MUSICVIDEO_FILE VIDEODB_MAX_COLUMNS + 3 -+#define VIDEODB_DETAILS_MUSICVIDEO_PATH VIDEODB_MAX_COLUMNS + 4 -+#define VIDEODB_DETAILS_MUSICVIDEO_PLAYCOUNT VIDEODB_MAX_COLUMNS + 5 -+#define VIDEODB_DETAILS_MUSICVIDEO_LASTPLAYED VIDEODB_MAX_COLUMNS + 6 -+#define VIDEODB_DETAILS_MUSICVIDEO_DATEADDED VIDEODB_MAX_COLUMNS + 7 -+#define VIDEODB_DETAILS_MUSICVIDEO_RESUME_TIME VIDEODB_MAX_COLUMNS + 8 -+#define VIDEODB_DETAILS_MUSICVIDEO_TOTAL_TIME VIDEODB_MAX_COLUMNS + 9 -+ - #define VIDEODB_TYPE_STRING 1 - #define VIDEODB_TYPE_INT 2 - #define VIDEODB_TYPE_FLOAT 3 -@@ -172,7 +168,7 @@ typedef enum // this enum MUST match the offset struct further down!! and make s - VIDEODB_ID_VOTES = 4, // unused - VIDEODB_ID_RATING_ID = 5, - VIDEODB_ID_CREDITS = 6, -- VIDEODB_ID_YEAR = 7, // unused -+ VIDEODB_ID_YEAR = 7, - VIDEODB_ID_THUMBURL = 8, - VIDEODB_ID_IDENT = 9, - VIDEODB_ID_SORTTITLE = 10, -@@ -202,10 +198,10 @@ const struct SDbTableOffsets - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlotOutline) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTagLine) }, -- { VIDEODB_TYPE_UNUSED, 0 }, // unused -+ { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strVotes) }, - { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iIdRating) }, - { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_writingCredits) }, -- { VIDEODB_TYPE_UNUSED, 0 }, // unused -+ { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iYear) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strIMDBNumber) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strSortTitle) }, -@@ -251,7 +247,7 @@ const struct SDbTableOffsets DbTvShowOffsets[] = - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTitle) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strStatus) }, -- { VIDEODB_TYPE_UNUSED, 0 }, //unused -+ { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strVotes) }, - { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iIdRating) }, - { VIDEODB_TYPE_DATE, my_offsetof(CVideoInfoTag,m_premiered) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) }, -@@ -266,7 +262,7 @@ const struct SDbTableOffsets DbTvShowOffsets[] = - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strSortTitle)}, - }; - --//! @todo is this comment valid for seasons? There is no offset structure or am I wrong? -+// TODO is this comment valid for seasons? There is no offset structure or am I wrong? - typedef enum // this enum MUST match the offset struct further down!! and make sure to keep min and max at -1 and sizeof(offsets) - { - VIDEODB_ID_SEASON_MIN = -1, -@@ -319,13 +315,13 @@ const struct SDbTableOffsets DbEpisodeOffsets[] = - { - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTitle) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) }, -- { VIDEODB_TYPE_UNUSED, 0 }, // unused -+ { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strVotes) }, - { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iIdRating) }, - { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_writingCredits) }, - { VIDEODB_TYPE_DATE, my_offsetof(CVideoInfoTag,m_firstAired) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) }, -- { VIDEODB_TYPE_UNUSED, 0 }, // unused -+ { VIDEODB_TYPE_COUNT, my_offsetof(CVideoInfoTag,m_playCount) }, // unused - { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_duration) }, - { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_director) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strProductionCode) }, -@@ -350,7 +346,7 @@ typedef enum // this enum MUST match the offset struct further down!! and make s - VIDEODB_ID_MUSICVIDEO_RUNTIME = 4, - VIDEODB_ID_MUSICVIDEO_DIRECTOR = 5, - VIDEODB_ID_MUSICVIDEO_STUDIOS = 6, -- VIDEODB_ID_MUSICVIDEO_YEAR = 7, // unused -+ VIDEODB_ID_MUSICVIDEO_YEAR = 7, - VIDEODB_ID_MUSICVIDEO_PLOT = 8, - VIDEODB_ID_MUSICVIDEO_ALBUM = 9, - VIDEODB_ID_MUSICVIDEO_ARTIST = 10, -@@ -366,11 +362,11 @@ const struct SDbTableOffsets DbMusicVideoOffsets[] = - { VIDEODB_TYPE_STRING, my_offsetof(class CVideoInfoTag,m_strTitle) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) }, -- { VIDEODB_TYPE_UNUSED, 0 }, // unused -+ { VIDEODB_TYPE_COUNT, my_offsetof(CVideoInfoTag,m_playCount) }, // unused - { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_duration) }, - { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_director) }, - { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_studio) }, -- { VIDEODB_TYPE_UNUSED, 0 }, // unused -+ { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iYear) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) }, - { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strAlbum) }, - { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_artist) }, -diff --git a/xbmc/video/VideoInfoDownloader.h b/xbmc/video/VideoInfoDownloader.h -index ee85c53..5698f3b 100644 ---- a/xbmc/video/VideoInfoDownloader.h -+++ b/xbmc/video/VideoInfoDownloader.h -@@ -26,7 +26,6 @@ - #include "Episode.h" - #include "filesystem/CurlFile.h" - #include --#include - - // forward declarations - class CXBMCTinyXML; -diff --git a/xbmc/video/VideoInfoScanner.cpp b/xbmc/video/VideoInfoScanner.cpp -index 797013a..8584e0a 100644 ---- a/xbmc/video/VideoInfoScanner.cpp -+++ b/xbmc/video/VideoInfoScanner.cpp -@@ -139,11 +139,7 @@ namespace VIDEO - * occurs. - */ - std::string directory = *m_pathsToScan.begin(); -- if (m_bStop) -- { -- bCancelled = true; -- } -- else if (!CDirectory::Exists(directory)) -+ if (!CDirectory::Exists(directory)) - { - /* - * Note that this will skip clean (if m_bClean is enabled) if the directory really -@@ -617,7 +613,7 @@ namespace VIDEO - return INFO_ERROR; - return INFO_ADDED; - } -- //! @todo This is not strictly correct as we could fail to download information here or error, or be cancelled -+ // TODO: This is not strictly correct as we could fail to download information here or error, or be cancelled - return INFO_NOT_FOUND; - } - -@@ -666,7 +662,7 @@ namespace VIDEO - return INFO_ERROR; - return INFO_ADDED; - } -- //! @todo This is not strictly correct as we could fail to download information here or error, or be cancelled -+ // TODO: This is not strictly correct as we could fail to download information here or error, or be cancelled - return INFO_NOT_FOUND; - } - -@@ -1594,7 +1590,7 @@ namespace VIDEO - CFileItem item; - item.SetPath(file->strPath); - if (!imdb.GetEpisodeDetails(guide->cScraperUrl, *item.GetVideoInfoTag(), pDlgProgress)) -- return INFO_NOT_FOUND; //! @todo should we just skip to the next episode? -+ return INFO_NOT_FOUND; // TODO: should we just skip to the next episode? - - // Only set season/epnum from filename when it is not already set by a scraper - if (item.GetVideoInfoTag()->m_iSeason == -1) -@@ -1841,8 +1837,8 @@ namespace VIDEO - struct __stat64 buffer; - if (XFILE::CFile::Stat(items[i]->GetPath(), &buffer) == 0) - { -- //! @todo some filesystems may return the mtime/ctime inline, in which case this is -- //! unnecessarily expensive. Consider supporting Stat() in our directory cache? -+ // TODO: some filesystems may return the mtime/ctime inline, in which case this is -+ // unnecessarily expensive. Consider supporting Stat() in our directory cache? - stat_time = buffer.st_mtime ? buffer.st_mtime : buffer.st_ctime; - time += stat_time; - } -diff --git a/xbmc/video/VideoInfoScanner.h b/xbmc/video/VideoInfoScanner.h -index d7ca10b..64facc8 100644 ---- a/xbmc/video/VideoInfoScanner.h -+++ b/xbmc/video/VideoInfoScanner.h -@@ -18,11 +18,6 @@ - * . - * - */ -- --#include --#include --#include -- - #include "InfoScanner.h" - #include "NfoFile.h" - #include "VideoDatabase.h" -@@ -153,7 +148,7 @@ namespace VIDEO - int FindVideo(const std::string &videoName, const ADDON::ScraperPtr &scraper, CScraperUrl &url, CGUIDialogProgress *progress); - - /*! \brief Retrieve detailed information for an item from an online source, optionally supplemented with local data -- @todo sort out some better return codes. -+ TODO: sort out some better return codes. - \param pItem item to retrieve online details for. - \param url URL to use to retrieve online details. - \param scraper Scraper that handles parsing the online data. -@@ -222,7 +217,7 @@ namespace VIDEO - bool CanFastHash(const CFileItemList &items, const std::vector &excludes) const; - - /*! \brief Process a series folder, filling in episode details and adding them to the database. -- @todo Ideally we would return INFO_HAVE_ALREADY if we don't have to update any episodes -+ TODO: Ideally we would return INFO_HAVE_ALREADY if we don't have to update any episodes - and we should return INFO_NOT_FOUND only if no information is found for any of - the episodes. INFO_ADDED then indicates we've added one or more episodes. - \param files the episode files to process. -diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp -index 79f9362..4b7f20e 100644 ---- a/xbmc/video/VideoInfoTag.cpp -+++ b/xbmc/video/VideoInfoTag.cpp -@@ -58,7 +58,6 @@ void CVideoInfoTag::Reset() - m_strMPAARating.clear(); - m_strFileNameAndPath.clear(); - m_premiered.Reset(); -- m_bHasPremiered = false; - m_strStatus.clear(); - m_strProductionCode.clear(); - m_firstAired.Reset(); -@@ -67,6 +66,7 @@ void CVideoInfoTag::Reset() - m_artist.clear(); - m_strTrailer.clear(); - m_iTop250 = 0; -+ m_iYear = 0; - m_iSeason = -1; - m_iEpisode = -1; - m_strUniqueId.clear(); -@@ -149,6 +149,7 @@ bool CVideoInfoTag::Save(TiXmlNode *node, const std::string &tag, bool savePathI - movie->InsertEndChild(epbookmark); - } - -+ XMLUtils::SetInt(movie, "year", m_iYear); - XMLUtils::SetInt(movie, "top250", m_iTop250); - if (tag == "episodedetails" || tag == "tvshow") - { -@@ -218,10 +219,7 @@ bool CVideoInfoTag::Save(TiXmlNode *node, const std::string &tag, bool savePathI - XMLUtils::SetStringArray(movie, "tag", m_tags); - XMLUtils::SetStringArray(movie, "credits", m_writingCredits); - XMLUtils::SetStringArray(movie, "director", m_director); -- if (HasPremiered()) -- XMLUtils::SetDate(movie, "premiered", m_premiered); -- if (HasYear()) -- XMLUtils::SetInt(movie, "year", GetYear()); -+ XMLUtils::SetDate(movie, "premiered", m_premiered); - XMLUtils::SetString(movie, "status", m_strStatus); - XMLUtils::SetString(movie, "code", m_strProductionCode); - XMLUtils::SetDate(movie, "aired", m_firstAired); -@@ -348,7 +346,6 @@ void CVideoInfoTag::Archive(CArchive& ar) - ar << m_strOriginalTitle; - ar << m_strEpisodeGuide; - ar << m_premiered; -- ar << m_bHasPremiered; - ar << m_strStatus; - ar << m_strProductionCode; - ar << m_firstAired; -@@ -358,6 +355,7 @@ void CVideoInfoTag::Archive(CArchive& ar) - ar << m_playCount; - ar << m_lastPlayed; - ar << m_iTop250; -+ ar << m_iYear; - ar << m_iSeason; - ar << m_iEpisode; - ar << m_strUniqueId; -@@ -440,7 +438,6 @@ void CVideoInfoTag::Archive(CArchive& ar) - ar >> m_strOriginalTitle; - ar >> m_strEpisodeGuide; - ar >> m_premiered; -- ar >> m_bHasPremiered; - ar >> m_strStatus; - ar >> m_strProductionCode; - ar >> m_firstAired; -@@ -450,6 +447,7 @@ void CVideoInfoTag::Archive(CArchive& ar) - ar >> m_playCount; - ar >> m_lastPlayed; - ar >> m_iTop250; -+ ar >> m_iYear; - ar >> m_iSeason; - ar >> m_iEpisode; - ar >> m_strUniqueId; -@@ -551,22 +549,22 @@ void CVideoInfoTag::Serialize(CVariant& value) const - value["playcount"] = m_playCount; - value["lastplayed"] = m_lastPlayed.IsValid() ? m_lastPlayed.GetAsDBDateTime() : StringUtils::Empty; - value["top250"] = m_iTop250; -- value["year"] = m_premiered.GetYear(); -+ value["year"] = m_iYear; - value["season"] = m_iSeason; - value["episode"] = m_iEpisode; - value["uniqueid"]["unknown"] = m_strUniqueId; - value["rating"] = GetRating().rating; -- CVariant ratings = CVariant(CVariant::VariantTypeObject); -+ value["ratings"] = CVariant(CVariant::VariantTypeArray); - for (const auto& i : m_ratings) - { - CVariant rating; -+ rating["name"] = i.first; - rating["rating"] = i.second.rating; - rating["votes"] = i.second.votes; -- rating["default"] = i.first == m_strDefaultRating; -- -- ratings[i.first] = rating; -+ if (i.first == m_strDefaultRating) -+ rating["default"] = true; -+ value["ratings"].push_back(rating); - } -- value["ratings"] = ratings; - value["userrating"] = m_iUserRating; - value["dbid"] = m_iDbId; - value["fileid"] = m_iFileId; -@@ -637,7 +635,7 @@ void CVideoInfoTag::ToSortable(SortItem& sortable, Field field) const - case FieldPlaycount: sortable[FieldPlaycount] = m_playCount; break; - case FieldLastPlayed: sortable[FieldLastPlayed] = m_lastPlayed.IsValid() ? m_lastPlayed.GetAsDBDateTime() : StringUtils::Empty; break; - case FieldTop250: sortable[FieldTop250] = m_iTop250; break; -- case FieldYear: sortable[FieldYear] = m_premiered.GetYear(); break; -+ case FieldYear: sortable[FieldYear] = m_iYear; break; - case FieldSeason: sortable[FieldSeason] = m_iSeason; break; - case FieldEpisodeNumber: sortable[FieldEpisodeNumber] = m_iEpisode; break; - case FieldNumberOfEpisodes: sortable[FieldNumberOfEpisodes] = m_iEpisode; break; -@@ -674,38 +672,10 @@ const CRating CVideoInfoTag::GetRating(std::string type) const - if (type.empty()) - type = m_strDefaultRating; - -- const auto& rating = m_ratings.find(type); -- if (rating == m_ratings.end()) -+ if (m_ratings.find(type) == m_ratings.end()) - return CRating(); - -- return rating->second; --} -- --const std::string& CVideoInfoTag::GetDefaultRating() const --{ -- return m_strDefaultRating; --} -- --const bool CVideoInfoTag::HasYear() const --{ -- return m_premiered.IsValid(); --} -- --const int CVideoInfoTag::GetYear() const --{ -- if (m_premiered.IsValid()) -- return GetPremiered().GetYear(); -- return 0; --} -- --const bool CVideoInfoTag::HasPremiered() const --{ -- return m_bHasPremiered; --} -- --const CDateTime& CVideoInfoTag::GetPremiered() const --{ -- return m_premiered; -+ return m_ratings.find(type)->second; - } - - const std::string CVideoInfoTag::GetCast(bool bIncludeRole /*= false*/) const -@@ -793,6 +763,7 @@ void CVideoInfoTag::ParseNative(const TiXmlElement* movie, bool prioritise) - const TiXmlElement* urElement = movie->FirstChildElement("userrating"); - if (urElement && (urElement->QueryIntAttribute("max", &max_value) == TIXML_SUCCESS) && max_value >= 1) - m_iUserRating = m_iUserRating / max_value * 10; // Normalise the user Movie Rating to between 1 and 10 -+ XMLUtils::GetInt(movie, "year", m_iYear); - XMLUtils::GetInt(movie, "top250", m_iTop250); - XMLUtils::GetInt(movie, "season", m_iSeason); - XMLUtils::GetInt(movie, "episode", m_iEpisode); -@@ -841,16 +812,7 @@ void CVideoInfoTag::ParseNative(const TiXmlElement* movie, bool prioritise) - if (XMLUtils::GetString(movie, "filenameandpath", value)) - SetFileNameAndPath(value); - -- if (XMLUtils::GetDate(movie, "premiered", m_premiered)) -- { -- m_bHasPremiered = true; -- } -- else -- { -- int year; -- if (XMLUtils::GetInt(movie, "year", year)) -- SetYear(year); -- } -+ XMLUtils::GetDate(movie, "premiered", m_premiered); - - if (XMLUtils::GetString(movie, "status", value)) - SetStatus(value); -@@ -1200,46 +1162,25 @@ void CVideoInfoTag::SetPictureURL(CScraperUrl &pictureURL) - m_strPictureURL = pictureURL; - } - --void CVideoInfoTag::AddRating(float rating, int votes, const std::string& type /* = "" */, bool def /* = false */) -+void CVideoInfoTag::AddRating(float rating, int votes, const std::string& type /* = "" */) - { - AddRating(CRating(rating, votes), type); - } - --void CVideoInfoTag::AddRating(CRating rating, const std::string& type /* = "" */, bool def /* = false */) -+void CVideoInfoTag::AddRating(CRating rating, const std::string& type /* = "" */) - { - if (type.empty()) - m_ratings[m_strDefaultRating] = rating; - else - m_ratings[type] = rating; -- -- if (def) -- m_strDefaultRating = type; - } - --void CVideoInfoTag::SetRating(float rating, const std::string& type /* = "" */, bool def /* = false */) -+void CVideoInfoTag::SetRating(float rating, const std::string& type /* = "" */) - { - if (type.empty()) - m_ratings[m_strDefaultRating].rating = rating; - else - m_ratings[type].rating = rating; -- -- if (def) -- m_strDefaultRating = type; --} -- --void CVideoInfoTag::RemoveRating(const std::string& type) --{ -- if (m_ratings.find(type) != m_ratings.end()) -- { -- m_ratings.erase(type); -- if (m_strDefaultRating == type && !m_ratings.empty()) -- m_strDefaultRating = m_ratings.begin()->first; -- } --} -- --void CVideoInfoTag::SetRatings(RatingMap ratings) --{ -- m_ratings = std::move(ratings); - } - - void CVideoInfoTag::SetVotes(int votes, const std::string& type /* = "" */) -@@ -1250,27 +1191,6 @@ void CVideoInfoTag::SetVotes(int votes, const std::string& type /* = "" */) - m_ratings[type].votes = votes; - } - --void CVideoInfoTag::SetPremiered(CDateTime premiered) --{ -- m_premiered = premiered; -- m_bHasPremiered = premiered.IsValid(); --} -- --void CVideoInfoTag::SetPremieredFromDBDate(std::string premieredString) --{ -- CDateTime premiered; -- premiered.SetFromDBDate(premieredString); -- SetPremiered(premiered); --} -- --void CVideoInfoTag::SetYear(int year) --{ -- if (m_bHasPremiered) -- m_premiered.SetDate(year, m_premiered.GetMonth(), m_premiered.GetDay()); -- else -- m_premiered = CDateTime(year, 1, 1, 0, 0, 0); --} -- - void CVideoInfoTag::SetArtist(std::vector artist) - { - m_artist = Trim(std::move(artist)); -diff --git a/xbmc/video/VideoInfoTag.h b/xbmc/video/VideoInfoTag.h -index e4ead34..733d78c 100644 ---- a/xbmc/video/VideoInfoTag.h -+++ b/xbmc/video/VideoInfoTag.h -@@ -50,9 +50,10 @@ struct SActorInfo - class CRating - { - public: -- CRating(): rating(0.0f), votes(0) {} -- CRating(float r): rating(r), votes(0) {} -- CRating(float r, int v): rating(r), votes(v) {} -+ CRating() -+ : CRating(0.0f, 0) -+ { } -+ CRating(float r, int v) { rating = r; votes = v; } - float rating; - int votes; - }; -@@ -84,11 +85,6 @@ public: - virtual void Serialize(CVariant& value) const; - virtual void ToSortable(SortItem& sortable, Field field) const; - const CRating GetRating(std::string type = "") const; -- const std::string& GetDefaultRating() const; -- const bool HasYear() const; -- const int GetYear() const; -- const bool HasPremiered() const; -- const CDateTime& GetPremiered() const; - const std::string GetCast(bool bIncludeRole = false) const; - bool HasStreamDetails() const; - bool IsEmpty() const; -@@ -123,15 +119,10 @@ public: - void SetTitle(std::string title); - void SetSortTitle(std::string sortTitle); - void SetPictureURL(CScraperUrl &pictureURL); -- void AddRating(float rating, int votes, const std::string& type = "", bool def = false); -- void AddRating(CRating rating, const std::string& type = "", bool def = false); -- void SetRating(float rating, const std::string& type = "", bool def = false); -- void RemoveRating(const std::string& type); -- void SetRatings(RatingMap ratings); -+ void AddRating(float rating, int votes, const std::string& type = ""); -+ void AddRating(CRating rating, const std::string& type = ""); -+ void SetRating(float rating, const std::string& type = ""); - void SetVotes(int votes, const std::string& type = ""); -- void SetPremiered(CDateTime premiered); -- void SetPremieredFromDBDate(std::string premieredString); -- void SetYear(int year); - void SetArtist(std::vector artist); - void SetSet(std::string set); - void SetSetOverview(std::string setOverview); -@@ -166,6 +157,7 @@ public: - CScraperUrl m_strPictureURL; - std::string m_strTitle; - std::string m_strSortTitle; -+ std::string m_strVotes; - std::vector m_artist; - std::vector< SActorInfo > m_cast; - typedef std::vector< SActorInfo >::const_iterator iCast; -@@ -181,7 +173,6 @@ public: - std::string m_strOriginalTitle; - std::string m_strEpisodeGuide; - CDateTime m_premiered; -- bool m_bHasPremiered; - std::string m_strStatus; - std::string m_strProductionCode; - CDateTime m_firstAired; -@@ -193,6 +184,7 @@ public: - std::map m_namedSeasons; - int m_playCount; - int m_iTop250; -+ int m_iYear; - int m_iSeason; - int m_iEpisode; - std::string m_strUniqueId; -@@ -203,6 +195,7 @@ public: - int m_iTrack; - RatingMap m_ratings; - int m_iIdRating; -+ std::string m_strDefaultRating; - int m_iUserRating; - CBookmark m_EpBookmark; - int m_iBookmarkId; -@@ -227,7 +220,6 @@ private: - */ - void ParseNative(const TiXmlElement* element, bool prioritise); - -- std::string m_strDefaultRating; - std::string Trim(std::string &&value); - std::vector Trim(std::vector &&items); - }; -diff --git a/xbmc/video/VideoLibraryQueue.cpp b/xbmc/video/VideoLibraryQueue.cpp -index bd6e5e3..aacc1ea 100644 ---- a/xbmc/video/VideoLibraryQueue.cpp -+++ b/xbmc/video/VideoLibraryQueue.cpp -@@ -31,6 +31,7 @@ - #include "video/jobs/VideoLibraryMarkWatchedJob.h" - #include "video/jobs/VideoLibraryRefreshingJob.h" - #include "video/jobs/VideoLibraryScanningJob.h" -+#include "video/VideoDatabase.h" - - CVideoLibraryQueue::CVideoLibraryQueue() - : CJobQueue(false, 1, CJob::PRIORITY_LOW), diff --git a/xbmc/video/VideoReferenceClock.cpp b/xbmc/video/VideoReferenceClock.cpp index 4e566e4..4b19657 100644 --- a/xbmc/video/VideoReferenceClock.cpp @@ -95172,193 +16948,6 @@ index 4e566e4..4b19657 100644 if (Speed != m_ClockSpeed) { m_ClockSpeed = Speed; -diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp -index 4714f1f..7628997 100644 ---- a/xbmc/video/VideoThumbLoader.cpp -+++ b/xbmc/video/VideoThumbLoader.cpp -@@ -622,7 +622,7 @@ void CVideoThumbLoader::DetectAndAddMissingItemData(CFileItem &item) - m_videoDatabase->Close(); - - // still empty, try grabbing from filename -- //! @todo in case of too many false positives due to using the full path, extract the filename only using string utils -+ // TODO: in case of too many false positives due to using the full path, extract the filename only using string utils - if (stereoMode.empty()) - stereoMode = CStereoscopicsManager::GetInstance().DetectStereoModeByString( path ); - } -diff --git a/xbmc/video/VideoThumbLoader.h b/xbmc/video/VideoThumbLoader.h -index 4f425ae..569bbd2 100644 ---- a/xbmc/video/VideoThumbLoader.h -+++ b/xbmc/video/VideoThumbLoader.h -@@ -20,7 +20,6 @@ - */ - - #include --#include - #include "ThumbLoader.h" - #include "utils/JobManager.h" - #include "FileItem.h" -diff --git a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp -index eb67552..601067e 100644 ---- a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp -+++ b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.cpp -@@ -85,7 +85,7 @@ void CGUIDialogAudioSubtitleSettings::FrameMove() - const CVideoSettings &videoSettings = CMediaSettings::GetInstance().GetCurrentVideoSettings(); - - // these settings can change on the fly -- //! @todo (needs special handling): m_settingsManager->SetInt(SETTING_AUDIO_STREAM, g_application.m_pPlayer->GetAudioStream()); -+ // TODO (needs special handling): m_settingsManager->SetInt(SETTING_AUDIO_STREAM, g_application.m_pPlayer->GetAudioStream()); - if (!m_dspEnabled) //< The follow settings are on enabled DSP system separated to them and need no update here. - { - m_settingsManager->SetNumber(SETTING_AUDIO_DELAY, videoSettings.m_AudioDelay); -@@ -93,10 +93,10 @@ void CGUIDialogAudioSubtitleSettings::FrameMove() - } - m_settingsManager->SetBool(SETTING_AUDIO_PASSTHROUGH, CSettings::GetInstance().GetBool(CSettings::SETTING_AUDIOOUTPUT_PASSTHROUGH)); - -- //! @todo m_settingsManager->SetBool(SETTING_SUBTITLE_ENABLE, g_application.m_pPlayer->GetSubtitleVisible()); -+ // TODO: m_settingsManager->SetBool(SETTING_SUBTITLE_ENABLE, g_application.m_pPlayer->GetSubtitleVisible()); - // \-> Unless subtitle visibility can change on the fly, while Dialog is up, this code should be removed. - m_settingsManager->SetNumber(SETTING_SUBTITLE_DELAY, videoSettings.m_SubtitleDelay); -- //! @todo (needs special handling): m_settingsManager->SetInt(SETTING_SUBTITLE_STREAM, g_application.m_pPlayer->GetSubtitle()); -+ // TODO (needs special handling): m_settingsManager->SetInt(SETTING_SUBTITLE_STREAM, g_application.m_pPlayer->GetSubtitle()); - } - - CGUIDialogSettingsManualBase::FrameMove(); -@@ -350,7 +350,7 @@ void CGUIDialogAudioSubtitleSettings::InitializeSettings() - AddAudioStreams(groupAudio, SETTING_AUDIO_STREAM); - - // audio output to all speakers setting -- //! @todo remove this setting -+ // TODO: remove this setting - if (SupportsAudioFeature(IPC_AUD_OUTPUT_STEREO) && !m_dspEnabled) - AddToggle(groupAudio, SETTING_AUDIO_OUTPUT_TO_ALL_SPEAKERS, 252, 0, videoSettings.m_OutputToAllSpeakers); - -diff --git a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h -index ecca0bc..b27cba7 100644 ---- a/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h -+++ b/xbmc/video/dialogs/GUIDialogAudioSubtitleSettings.h -@@ -20,9 +20,7 @@ - * - */ - --#include - #include --#include - - #include "settings/dialogs/GUIDialogSettingsManualBase.h" - -diff --git a/xbmc/video/dialogs/GUIDialogSubtitles.cpp b/xbmc/video/dialogs/GUIDialogSubtitles.cpp -index 398558e..6822179 100644 ---- a/xbmc/video/dialogs/GUIDialogSubtitles.cpp -+++ b/xbmc/video/dialogs/GUIDialogSubtitles.cpp -@@ -465,9 +465,9 @@ void CGUIDialogSubtitles::OnDownloadComplete(const CFileItemList *items, const s - if (!subPath.empty()) - strDownloadPath = subPath; - -- /** Get item's folder for sub storage, special case for RAR/ZIP items -- * @todo We need some way to avoid special casing this all over the place -- * for rar/zip (perhaps modify GetDirectory?) -+ /* Get item's folder for sub storage, special case for RAR/ZIP items -+ TODO: We need some way to avoid special casing this all over the place -+ for rar/zip (perhaps modify GetDirectory?) - */ - if (URIUtils::IsInRAR(strCurrentFile) || URIUtils::IsInZIP(strCurrentFile)) - strCurrentFilePath = URIUtils::GetDirectory(CURL(strCurrentFile).GetHostName()); -diff --git a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp -index 53ffdfb..d4247d5 100644 ---- a/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp -+++ b/xbmc/video/dialogs/GUIDialogVideoBookmarks.cpp -@@ -22,6 +22,9 @@ - #include "GUIDialogVideoBookmarks.h" - #include "video/VideoDatabase.h" - #include "Application.h" -+#if defined(HAS_LIBAMCODEC) -+#include "utils/ScreenshotAML.h" -+#endif//HAS_LIBAMCODEC - #include "pictures/Picture.h" - #include "dialogs/GUIDialogContextMenu.h" - #include "view/ViewState.h" -diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp -index fdf4a50..2f3ea96 100644 ---- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp -+++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp -@@ -496,8 +496,8 @@ void CGUIDialogVideoInfo::DoSearch(std::string& strSearch, CFileItemList& items) - for (int i = 0; i < movies.Size(); ++i) - { - std::string label = movies[i]->GetVideoInfoTag()->m_strTitle; -- if (movies[i]->GetVideoInfoTag()->HasYear()) -- label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->GetYear()); -+ if (movies[i]->GetVideoInfoTag()->m_iYear > 0) -+ label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->m_iYear); - movies[i]->SetLabel(label); - } - CGUIWindowVideoBase::AppendAndClearSearchItems(movies, "[" + g_localizeStrings.Get(20338) + "] ", items); -@@ -506,8 +506,8 @@ void CGUIDialogVideoInfo::DoSearch(std::string& strSearch, CFileItemList& items) - for (int i = 0; i < movies.Size(); ++i) - { - std::string label = movies[i]->GetVideoInfoTag()->m_strShowTitle; -- if (movies[i]->GetVideoInfoTag()->HasYear()) -- label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->GetYear()); -+ if (movies[i]->GetVideoInfoTag()->m_iYear > 0) -+ label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->m_iYear); - movies[i]->SetLabel(label); - } - CGUIWindowVideoBase::AppendAndClearSearchItems(movies, "[" + g_localizeStrings.Get(20364) + "] ", items); -@@ -524,8 +524,8 @@ void CGUIDialogVideoInfo::DoSearch(std::string& strSearch, CFileItemList& items) - for (int i = 0; i < movies.Size(); ++i) - { - std::string label = StringUtils::Join(movies[i]->GetVideoInfoTag()->m_artist, g_advancedSettings.m_videoItemSeparator) + " - " + movies[i]->GetVideoInfoTag()->m_strTitle; -- if (movies[i]->GetVideoInfoTag()->HasYear()) -- label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->GetYear()); -+ if (movies[i]->GetVideoInfoTag()->m_iYear > 0) -+ label += StringUtils::Format(" (%i)", movies[i]->GetVideoInfoTag()->m_iYear); - movies[i]->SetLabel(label); - } - CGUIWindowVideoBase::AppendAndClearSearchItems(movies, "[" + g_localizeStrings.Get(20391) + "] ", items); -@@ -676,7 +676,7 @@ void CGUIDialogVideoInfo::OnGetArt() - if (type.empty()) - return; // cancelled - -- //! @todo this can be removed once these are unified. -+ // TODO: this can be removed once these are unified. - if (type == "fanart") - OnGetFanart(); - else -@@ -712,7 +712,7 @@ void CGUIDialogVideoInfo::OnGetArt() - item->SetIconImage("DefaultPicture.png"); - item->SetLabel(g_localizeStrings.Get(13513)); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - // CTextureCache::GetInstance().ClearCachedImage(thumb); - items.Add(item); - } -@@ -808,7 +808,7 @@ void CGUIDialogVideoInfo::OnGetFanart() - item->SetIconImage("DefaultPicture.png"); - item->SetLabel(g_localizeStrings.Get(20441)); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - // CTextureCache::GetInstance().ClearCachedImage(thumb); - items.Add(item); - } -@@ -821,7 +821,7 @@ void CGUIDialogVideoInfo::OnGetFanart() - itemLocal->SetArt("thumb", strLocal); - itemLocal->SetLabel(g_localizeStrings.Get(20438)); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - CTextureCache::GetInstance().ClearCachedImage(strLocal); - items.Add(itemLocal); - } -@@ -1755,7 +1755,7 @@ bool CGUIDialogVideoInfo::ManageVideoItemArtwork(const CFileItemPtr &item, const - item->SetLabel(g_localizeStrings.Get(13513)); - items.Add(item); - -- //! @todo Do we need to clear the cached image? -+ // TODO: Do we need to clear the cached image? - // CTextureCache::GetInstance().ClearCachedImage(thumbs[i]); - } - diff --git a/xbmc/video/dialogs/GUIDialogVideoOSD.cpp b/xbmc/video/dialogs/GUIDialogVideoOSD.cpp index c1e99cf..5e3a31b 100644 --- a/xbmc/video/dialogs/GUIDialogVideoOSD.cpp @@ -95373,18 +16962,9 @@ index c1e99cf..5e3a31b 100644 CGUIDialogVideoOSD::~CGUIDialogVideoOSD(void) diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp -index afbe203..d00165c 100644 +index 3c0a157..d00165c 100644 --- a/xbmc/video/dialogs/GUIDialogVideoSettings.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoSettings.cpp -@@ -170,7 +170,7 @@ void CGUIDialogVideoSettings::OnSettingAction(const CSetting *setting) - return; - g_windowManager.ForceActivateWindow(WINDOW_SCREEN_CALIBRATION); - } -- //! @todo implement -+ // TODO - else if (settingId == SETTING_VIDEO_MAKE_DEFAULT) - Save(); - } @@ -290,6 +290,10 @@ void CGUIDialogVideoSettings::InitializeSettings() entries.push_back(std::make_pair(16333, VS_INTERLACEMETHOD_MMAL_BOB_HALF)); entries.push_back(std::make_pair(16334, VS_INTERLACEMETHOD_IMX_FASTMOTION)); @@ -95396,249 +16976,6 @@ index afbe203..d00165c 100644 /* remove unsupported methods */ for (StaticIntegerSettingOptions::iterator it = entries.begin(); it != entries.end(); ) -diff --git a/xbmc/video/dialogs/GUIDialogVideoSettings.h b/xbmc/video/dialogs/GUIDialogVideoSettings.h -index adad488..bb9c31a 100644 ---- a/xbmc/video/dialogs/GUIDialogVideoSettings.h -+++ b/xbmc/video/dialogs/GUIDialogVideoSettings.h -@@ -20,10 +20,6 @@ - * - */ - --#include --#include --#include -- - #include "settings/dialogs/GUIDialogSettingsManualBase.h" - - class CGUIDialogVideoSettings : public CGUIDialogSettingsManualBase -diff --git a/xbmc/video/videosync/CMakeLists.txt b/xbmc/video/videosync/CMakeLists.txt -index 0dcfab5..147373a 100644 ---- a/xbmc/video/videosync/CMakeLists.txt -+++ b/xbmc/video/videosync/CMakeLists.txt -@@ -20,7 +20,7 @@ if(CORE_SYSTEM_NAME STREQUAL rbpi) - list(APPEND HEADERS VideoSyncPi.h) - endif() - --if(CORE_SYSTEM_NAME STREQUAL osx) -+if(CORE_SYSTEM_NAME STREQUAL darwin) - list(APPEND SOURCES VideoSyncOsx.cpp) - list(APPEND HEADERS VideoSyncOsx.h) - endif() -diff --git a/xbmc/video/windows/GUIWindowFullScreen.cpp b/xbmc/video/windows/GUIWindowFullScreen.cpp -index 0c49cd2..5d98a66 100644 ---- a/xbmc/video/windows/GUIWindowFullScreen.cpp -+++ b/xbmc/video/windows/GUIWindowFullScreen.cpp -@@ -488,8 +488,8 @@ void CGUIWindowFullScreen::Process(unsigned int currentTime, CDirtyRegionList &d - - CGUIWindow::Process(currentTime, dirtyregion); - -- //! @todo This isn't quite optimal - ideally we'd only be dirtying up the actual video render rect -- //! which is probably the job of the renderer as it can more easily track resizing etc. -+ // TODO: This isn't quite optimal - ideally we'd only be dirtying up the actual video render rect -+ // which is probably the job of the renderer as it can more easily track resizing etc. - m_renderRegion.SetRect(0, 0, (float)g_graphicsContext.GetWidth(), (float)g_graphicsContext.GetHeight()); - } - -diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp -index 0aed13a..d8e81cb 100644 ---- a/xbmc/video/windows/GUIWindowVideoBase.cpp -+++ b/xbmc/video/windows/GUIWindowVideoBase.cpp -@@ -34,7 +34,6 @@ - #include "Application.h" - #include "NfoFile.h" - #include "PlayListPlayer.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "GUIPassword.h" - #include "filesystem/StackDirectory.h" - #include "filesystem/VideoDatabaseDirectory.h" -@@ -181,6 +180,10 @@ bool CGUIWindowVideoBase::OnMessage(CGUIMessage& message) - if (GetID() == WINDOW_VIDEO_NAV) - OnDeleteItem(iItem); - -+ // or be at the files window and have file deletion enabled -+ else if (GetID() == WINDOW_VIDEO_FILES && CSettings::GetInstance().GetBool(CSettings::SETTING_FILELISTS_ALLOWFILEDELETION)) -+ OnDeleteItem(iItem); -+ - // or be at the video playlists location - else if (m_vecItems->IsPath("special://videoplaylists/")) - OnDeleteItem(iItem); -@@ -258,7 +261,8 @@ void CGUIWindowVideoBase::OnItemInfo(const CFileItem& fileItem, ADDON::ScraperPt - - bool modified = ShowIMDB(CFileItemPtr(new CFileItem(item)), scraper, fromDB); - if (modified && -- (g_windowManager.GetActiveWindow() == WINDOW_VIDEO_NAV)) // since we can be called from the music library we need this check -+ (g_windowManager.GetActiveWindow() == WINDOW_VIDEO_FILES || -+ g_windowManager.GetActiveWindow() == WINDOW_VIDEO_NAV)) // since we can be called from the music library we need this check - { - int itemNumber = m_viewControl.GetSelectedItem(); - Refresh(); -@@ -1093,8 +1097,8 @@ bool CGUIWindowVideoBase::OnPlayMedia(int iItem, const std::string &player) - CLog::Log(LOGDEBUG, "%s %s", __FUNCTION__, CURL::GetRedacted(item.GetPath()).c_str()); - - -- //! @todo delete entire block in v18 -- //! @deprecated m_strStreamURL is deprecated in v17 -+ // TODO: delete entire block in v18 -+ // m_strStreamURL is deprecated - if (item.IsPVR()) - { - CPVRRecordingsPath path(item.GetPath()); -diff --git a/xbmc/video/windows/GUIWindowVideoNav.cpp b/xbmc/video/windows/GUIWindowVideoNav.cpp -index 1818b43..a4e6c3d 100644 ---- a/xbmc/video/windows/GUIWindowVideoNav.cpp -+++ b/xbmc/video/windows/GUIWindowVideoNav.cpp -@@ -506,8 +506,8 @@ void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items) - - void CGUIWindowVideoNav::LoadVideoInfo(CFileItemList &items, CVideoDatabase &database, bool allowReplaceLabels) - { -- //! @todo this could possibly be threaded as per the music info loading, -- //! we could also cache the info -+ // TODO: this could possibly be threaded as per the music info loading, -+ // we could also cache the info - if (!items.GetContent().empty() && !items.IsPlugin()) - return; // don't load for listings that have content set and weren't created from plugins - -@@ -965,7 +965,7 @@ bool CGUIWindowVideoNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) - item = m_vecItems->Get(itemNumber); - if (CGUIDialogContextMenu::OnContextButton("video", item, button)) - { -- //! @todo should we search DB for entries from plugins? -+ //TODO should we search DB for entries from plugins? - if (button == CONTEXT_BUTTON_REMOVE_SOURCE && !item->IsPlugin() - && !item->IsLiveTV() &&!item->IsRSS() && !URIUtils::IsUPnP(item->GetPath())) - { -diff --git a/xbmc/video/windows/GUIWindowVideoPlaylist.cpp b/xbmc/video/windows/GUIWindowVideoPlaylist.cpp -index 2faaf59..0d6d1e2 100644 ---- a/xbmc/video/windows/GUIWindowVideoPlaylist.cpp -+++ b/xbmc/video/windows/GUIWindowVideoPlaylist.cpp -@@ -24,7 +24,6 @@ - #include "Application.h" - #include "PlayListPlayer.h" - #include "PartyModeManager.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "dialogs/GUIDialogSmartPlaylistEditor.h" - #include "guilib/GUIWindowManager.h" - #include "guilib/GUIKeyboardFactory.h" -diff --git a/xbmc/view/GUIViewState.cpp b/xbmc/view/GUIViewState.cpp -index ceb7881..78f2cb4 100644 ---- a/xbmc/view/GUIViewState.cpp -+++ b/xbmc/view/GUIViewState.cpp -@@ -101,7 +101,7 @@ CGUIViewState* CGUIViewState::GetViewState(int windowId, const CFileItemList& it - return new CGUIViewStateMusicPlaylist(items); - - if (items.GetPath() == "special://musicplaylists/") -- return new CGUIViewStateWindowMusicNav(items); -+ return new CGUIViewStateWindowMusicSongs(items); - - if (url.IsProtocol("androidapp")) - return new CGUIViewStateWindowPrograms(items); -@@ -112,11 +112,17 @@ CGUIViewState* CGUIViewState::GetViewState(int windowId, const CFileItemList& it - if (windowId == WINDOW_MUSIC_NAV) - return new CGUIViewStateWindowMusicNav(items); - -+ if (windowId == WINDOW_MUSIC_FILES) -+ return new CGUIViewStateWindowMusicSongs(items); -+ - if (windowId == WINDOW_MUSIC_PLAYLIST) - return new CGUIViewStateWindowMusicPlaylist(items); - - if (windowId == WINDOW_MUSIC_PLAYLIST_EDITOR) -- return new CGUIViewStateWindowMusicNav(items); -+ return new CGUIViewStateWindowMusicSongs(items); -+ -+ if (windowId == WINDOW_VIDEO_FILES) -+ return new CGUIViewStateWindowVideoFiles(items); - - if (windowId == WINDOW_VIDEO_NAV) - return new CGUIViewStateWindowVideoNav(items); -@@ -556,7 +562,7 @@ CGUIViewStateFromItems::CGUIViewStateFromItems(const CFileItemList &items) : CGU - const GUIViewSortDetails sort = details[i]; - AddSortMethod(sort.m_sortDescription, sort.m_buttonLabel, sort.m_labelMasks); - } -- //! @todo Should default sort/view mode be specified? -+ // TODO: Should default sort/view mode be specified? - m_currentSortMethod = 0; - - SetViewAsControl(DEFAULT_VIEW_LIST); -diff --git a/xbmc/view/GUIViewState.h b/xbmc/view/GUIViewState.h -index 4ae382a..55d2eb2 100644 ---- a/xbmc/view/GUIViewState.h -+++ b/xbmc/view/GUIViewState.h -@@ -20,8 +20,6 @@ - * - */ - --#include -- - #include "utils/LabelFormatter.h" - #include "utils/SortUtils.h" - #include "MediaSource.h" -diff --git a/xbmc/win32/WIN32Util.cpp b/xbmc/win32/WIN32Util.cpp -index 6b80d78..f7c5220 100644 ---- a/xbmc/win32/WIN32Util.cpp -+++ b/xbmc/win32/WIN32Util.cpp -@@ -328,7 +328,7 @@ bool CWIN32Util::XBMCShellExecute(const std::string &strPath, bool bWaitForScrip - - if(bWaitForScriptExit) - { -- //! @todo Pause music and video playback -+ // Todo: Pause music and video playback - WaitForSingleObject(ShExecInfo.hProcess,INFINITE); - } - -@@ -923,8 +923,7 @@ void CWIN32Util::GetDrivesByType(VECSOURCES &localDrives, Drive_Types eDriveType - } - else - { -- // Lets show it, like Windows explorer do... -- //! @todo Sorting should depend on driver letter -+ // Lets show it, like Windows explorer do... TODO: sorting should depend on driver letter - switch(uDriveType) - { - case DRIVE_CDROM: -diff --git a/xbmc/win32/WIN32Util.h b/xbmc/win32/WIN32Util.h -index 8687b90..7079e81 100644 ---- a/xbmc/win32/WIN32Util.h -+++ b/xbmc/win32/WIN32Util.h -@@ -20,8 +20,6 @@ - * - */ - --#include -- - #include "URL.h" - #include "Cfgmgr32.h" - #include "MediaSource.h" -diff --git a/xbmc/win32/Win32DelayedDllLoad.cpp b/xbmc/win32/Win32DelayedDllLoad.cpp -index 60ffc22..dc22705 100644 ---- a/xbmc/win32/Win32DelayedDllLoad.cpp -+++ b/xbmc/win32/Win32DelayedDllLoad.cpp -@@ -18,13 +18,6 @@ - * - */ - --/** --* @todo this is to disable a change coming in update 3 --* We should get rid of this and switch the hooks to const --* once update 3 is rtm and we know our developers have --* updated --*/ --#define DELAYIMP_INSECURE_WRITABLE_HOOKS 1 - #include - #include "Application.h" - #include "utils/StringUtils.h" -@@ -77,11 +70,5 @@ FARPROC WINAPI delayHookFailureFunc (unsigned dliNotify, PDelayLoadInfo pdli) - } - - // assign hook functions --#if !defined(DELAYIMP_INSECURE_WRITABLE_HOOKS) --const --#endif - PfnDliHook __pfnDliNotifyHook2 = delayHookNotifyFunc; --#if !defined(DELAYIMP_INSECURE_WRITABLE_HOOKS) --const --#endif - PfnDliHook __pfnDliFailureHook2 = delayHookFailureFunc; diff --git a/xbmc/windowing/WinEvents.cpp b/xbmc/windowing/WinEvents.cpp index 36c5fab..001256d 100644 --- a/xbmc/windowing/WinEvents.cpp @@ -95747,77 +17084,6 @@ index 50cf0a7..878557f 100644 static CSettingBool* setting = (CSettingBool*)CSettings::GetInstance().GetSetting(CSettings::SETTING_VIDEOSCREEN_LIMITEDRANGE); return setting->GetValue(); #else -diff --git a/xbmc/windowing/X11/WinSystemX11.h b/xbmc/windowing/X11/WinSystemX11.h -index 6a22b33..4119178 100644 ---- a/xbmc/windowing/X11/WinSystemX11.h -+++ b/xbmc/windowing/X11/WinSystemX11.h -@@ -20,9 +20,6 @@ - - #pragma once - --#include --#include -- - #include "windowing/WinSystem.h" - #include "utils/Stopwatch.h" - #include "threads/CriticalSection.h" -diff --git a/xbmc/windowing/X11/WinSystemX11GLContext.cpp b/xbmc/windowing/X11/WinSystemX11GLContext.cpp -index f1f94ae..b975c5d 100644 ---- a/xbmc/windowing/X11/WinSystemX11GLContext.cpp -+++ b/xbmc/windowing/X11/WinSystemX11GLContext.cpp -@@ -111,7 +111,7 @@ bool CWinSystemX11GLContext::SetWindow(int width, int height, bool fullscreen, c - RefreshGLContext(m_currentOutput.compare(output) != 0); - XSync(m_dpy, FALSE); - g_graphicsContext.Clear(0); -- g_graphicsContext.Flip(true, false); -+ g_graphicsContext.Flip(true); - ResetVSync(); - - m_windowDirty = false; -diff --git a/xbmc/windowing/X11/WinSystemX11GLESContext.cpp b/xbmc/windowing/X11/WinSystemX11GLESContext.cpp -index a9995d6..d671aa2 100644 ---- a/xbmc/windowing/X11/WinSystemX11GLESContext.cpp -+++ b/xbmc/windowing/X11/WinSystemX11GLESContext.cpp -@@ -55,7 +55,7 @@ bool CWinSystemX11GLESContext::SetWindow(int width, int height, bool fullscreen, - RefreshGLContext(m_currentOutput.compare(output) != 0); - XSync(m_dpy, FALSE); - g_graphicsContext.Clear(0); -- g_graphicsContext.Flip(true, false); -+ g_graphicsContext.Flip(true); - ResetVSync(); - - m_windowDirty = false; -diff --git a/xbmc/windowing/X11/XRandR.cpp b/xbmc/windowing/X11/XRandR.cpp -index cd8bd12..e0595f3 100644 ---- a/xbmc/windowing/X11/XRandR.cpp -+++ b/xbmc/windowing/X11/XRandR.cpp -@@ -104,7 +104,7 @@ bool CXRandR::Query(bool force, int screennum, bool ignoreoff) - TiXmlElement *pRootElement = xmlDoc.RootElement(); - if (atoi(pRootElement->Attribute("id")) != screennum) - { -- //! @todo ERROR -+ // TODO ERROR - return false; - } - -@@ -407,7 +407,7 @@ void CXRandR::LoadCustomModeLinesToAllOutputs(void) - TiXmlElement *pRootElement = xmlDoc.RootElement(); - if (strcasecmp(pRootElement->Value(), "modelines") != 0) - { -- //! @todo ERROR -+ // TODO ERROR - return; - } - -diff --git a/xbmc/windowing/android/CMakeLists.txt b/xbmc/windowing/android/CMakeLists.txt -index b7782d0..8e58d66 100644 ---- a/xbmc/windowing/android/CMakeLists.txt -+++ b/xbmc/windowing/android/CMakeLists.txt -@@ -3,4 +3,3 @@ set(SOURCES WinEventsAndroid.cpp) - set(HEADERS WinEventsAndroid.h) - - core_add_library(windowing_android) --add_dependencies(windowing_android libcpluff) diff --git a/xbmc/windowing/egl/EGLEdid.cpp b/xbmc/windowing/egl/EGLEdid.cpp new file mode 100644 index 0000000..1e24c1d @@ -95995,62 +17261,6 @@ index 0000000..e4b3287 +}; + +extern CEGLEdid g_EGLEdid; -diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h b/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h -index 188217c..6887537 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h -+++ b/xbmc/windowing/egl/EGLNativeTypeAmlAndroid.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "EGLNativeTypeAndroid.h" - class CEGLNativeTypeAmlAndroid : public CEGLNativeTypeAndroid - { -diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp -index 88cd385..3d6598a 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.cpp -@@ -55,7 +55,8 @@ bool CEGLNativeTypeAmlogic::CheckCompatibility() - std::string modalias = "/sys/class/graphics/" + m_framebuffer_name + "/device/modalias"; - - SysfsUtils::GetString(modalias, name); -- if (name.find("meson") != std::string::npos) -+ StringUtils::Trim(name); -+ if (name == "platform:mesonfb") - return true; - return false; - } -diff --git a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h -index cfb33ca..6867c38 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeAmlogic.h -+++ b/xbmc/windowing/egl/EGLNativeTypeAmlogic.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "EGLNativeType.h" - class CEGLNativeTypeAmlogic : public CEGLNativeType - { -diff --git a/xbmc/windowing/egl/EGLNativeTypeAndroid.h b/xbmc/windowing/egl/EGLNativeTypeAndroid.h -index b88eb57..f26215d 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeAndroid.h -+++ b/xbmc/windowing/egl/EGLNativeTypeAndroid.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "EGLNativeType.h" - class CEGLNativeTypeAndroid : public CEGLNativeType - { diff --git a/xbmc/windowing/egl/EGLNativeTypeIMX.cpp b/xbmc/windowing/egl/EGLNativeTypeIMX.cpp index c7567a9..0bab5ad 100644 --- a/xbmc/windowing/egl/EGLNativeTypeIMX.cpp @@ -96527,18 +17737,10 @@ index c7567a9..0bab5ad 100644 - +#endif diff --git a/xbmc/windowing/egl/EGLNativeTypeIMX.h b/xbmc/windowing/egl/EGLNativeTypeIMX.h -index 53cbc2e..f7fcca8 100644 +index 84ff268..f7fcca8 100644 --- a/xbmc/windowing/egl/EGLNativeTypeIMX.h +++ b/xbmc/windowing/egl/EGLNativeTypeIMX.h -@@ -19,20 +19,11 @@ - * . - * - */ -- --#include --#include -- - #include +@@ -23,12 +23,7 @@ #include #include "EGLNativeType.h" @@ -96552,7 +17754,7 @@ index 53cbc2e..f7fcca8 100644 class CEGLNativeTypeIMX : public CEGLNativeType { -@@ -58,17 +49,22 @@ public: +@@ -54,17 +49,22 @@ public: virtual bool ProbeResolutions(std::vector &resolutions); virtual bool GetPreferredResolution(RESOLUTION_INFO *res) const; @@ -96579,417 +17781,6 @@ index 53cbc2e..f7fcca8 100644 + bool m_ignorenext; +#endif }; -diff --git a/xbmc/windowing/egl/EGLNativeTypeRKAndroid.h b/xbmc/windowing/egl/EGLNativeTypeRKAndroid.h -index 98b89f1..69baaed 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRKAndroid.h -+++ b/xbmc/windowing/egl/EGLNativeTypeRKAndroid.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "EGLNativeTypeAndroid.h" - class CEGLNativeTypeRKAndroid : public CEGLNativeTypeAndroid - { -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -index ee29770..4b83bb7 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp -@@ -32,6 +32,13 @@ - #include "guilib/StereoscopicsManager.h" - #include "rendering/RenderSystem.h" - #include -+#include "peripherals/Peripherals.h" -+#include "peripherals/bus/PeripheralBus.h" -+#include "peripherals/bus/linux/PeripheralBusPLATFORMLibUdev.h" -+ -+#include "EGLEdid.h" -+ -+using namespace PERIPHERALS; - - #ifndef __VIDEOCORE4__ - #define __VIDEOCORE4__ -@@ -69,10 +76,14 @@ static SDTV_ASPECT_T get_sdtv_aspect_from_display_aspect(float display_aspect); - #endif - - CEGLNativeTypeRaspberryPI::CEGLNativeTypeRaspberryPI() -+#if defined(TARGET_RASPBERRY_PI) -+ : m_video(NULL) -+#endif - { - #if defined(TARGET_RASPBERRY_PI) - m_DllBcmHost = NULL; - m_nativeWindow = NULL; -+ m_event.Reset(); - #endif - } - -@@ -108,12 +119,32 @@ void CEGLNativeTypeRaspberryPI::Initialize() - - m_DllBcmHost = new DllBcmHost; - m_DllBcmHost->Load(); -+ vc_tv_register_callback(CallbackTvServiceCallback, this); -+ -+ TV_DISPLAY_STATE_T tv_state; -+ m_DllBcmHost->vc_tv_get_display_state(&tv_state); -+ -+ PeripheralBusPtr m_bus = std::make_shared(&g_peripherals); -+ g_peripherals.CreatePeripheralBus(m_bus); -+ -+ PeripheralScanResult result(m_bus->Type()); -+ PeripheralScanResults results; -+ result.m_strLocation = "/sys/class/graphics/fb0"; -+ result.m_iSequence = m_bus->GetNumberOfPeripheralsWithFeature(FEATURE_CABLESTATE); -+ result.m_type = PERIPHERAL_VIDEO; -+ result.m_strDeviceName = "generic_video"; -+ result.m_iVendorId = 0; -+ result.m_iProductId = 0; -+ results.m_results.push_back(result); -+ -+ m_video = m_bus->RegisterNewDevice(result); - #endif - } - - void CEGLNativeTypeRaspberryPI::Destroy() - { - #if defined(TARGET_RASPBERRY_PI) -+ vc_tv_unregister_callback_full(CallbackTvServiceCallback, this); - if(m_DllBcmHost && m_DllBcmHost->IsLoaded()) - m_DllBcmHost->Unload(); - delete m_DllBcmHost; -@@ -175,10 +206,69 @@ bool CEGLNativeTypeRaspberryPI::DestroyNativeWindow() - #endif - } - -+#if defined(TARGET_RASPBERRY_PI) -+static float get_display_aspect_ratio(SDTV_ASPECT_T aspect); -+#endif -+ - bool CEGLNativeTypeRaspberryPI::GetNativeResolution(RESOLUTION_INFO *res) const - { - #if defined(TARGET_RASPBERRY_PI) -- *res = m_desktopRes; -+ TV_DISPLAY_STATE_T tv_state; -+ -+ // get current display settings state -+ memset(&tv_state, 0, sizeof(TV_DISPLAY_STATE_T)); -+ m_DllBcmHost->vc_tv_get_display_state(&tv_state); -+ -+ if ((tv_state.state & ( VC_HDMI_HDMI | VC_HDMI_DVI )) != 0) // hdtv -+ { -+ res->iScreen = 0; -+ res->bFullScreen = true; -+ res->iWidth = tv_state.display.hdmi.width; -+ res->iHeight = tv_state.display.hdmi.height; -+ res->iScreenWidth = tv_state.display.hdmi.width; -+ res->iScreenHeight= tv_state.display.hdmi.height; -+ res->dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); -+ res->fPixelRatio = g_EGLEdid.GetSAR() ? (float)g_EGLEdid.GetSAR() / ((float)res->iScreenWidth / (float)res->iScreenHeight) : 1.0f; -+ // Also add 3D flags -+ if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_SBS_HALF) -+ { -+ res->dwFlags |= D3DPRESENTFLAG_MODE3DSBS; -+ res->fPixelRatio *= 2.0; -+ } -+ else if (tv_state.display.hdmi.format_3d == HDMI_3D_FORMAT_TB_HALF) -+ { -+ res->dwFlags |= D3DPRESENTFLAG_MODE3DTB; -+ res->fPixelRatio *= 0.5; -+ } -+ HDMI_PROPERTY_PARAM_T property; -+ property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; -+ vc_tv_hdmi_get_property(&property); -+ res->fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; -+ } -+ else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv -+ { -+ res->iScreen = 0; -+ res->bFullScreen = true; -+ res->iWidth = tv_state.display.sdtv.width; -+ res->iHeight = tv_state.display.sdtv.height; -+ res->iScreenWidth = tv_state.display.sdtv.width; -+ res->iScreenHeight= tv_state.display.sdtv.height; -+ res->dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); -+ res->fRefreshRate = (float)tv_state.display.sdtv.frame_rate; -+ res->fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)res->iScreenWidth / (float)res->iScreenHeight); -+ } -+ else if ((tv_state.state & VC_LCD_ATTACHED_DEFAULT) != 0) // lcd -+ { -+ res->iScreen = 0; -+ res->bFullScreen = true; -+ res->iWidth = tv_state.display.sdtv.width; -+ res->iHeight = tv_state.display.sdtv.height; -+ res->iScreenWidth = tv_state.display.sdtv.width; -+ res->iScreenHeight= tv_state.display.sdtv.height; -+ res->dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, 0, 0); -+ res->fRefreshRate = (float)tv_state.display.sdtv.frame_rate; -+ res->fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)res->iScreenWidth / (float)res->iScreenHeight); -+ } - - DLOG("CEGLNativeTypeRaspberryPI::GetNativeResolution %s\n", res->strMode.c_str()); - return true; -@@ -208,15 +298,9 @@ int CEGLNativeTypeRaspberryPI::AddUniqueResolution(RESOLUTION_INFO &res, std::ve - { - SetResolutionString(res); - int i = FindMatchingResolution(res, resolutions, desktop); -- if (i>=0) -- { // don't replace a progressive resolution with an interlaced one of same resolution -- if (!(res.dwFlags & D3DPRESENTFLAG_INTERLACED)) -- resolutions[i] = res; -- } -- else -- { -- resolutions.push_back(res); -- } -+ if (i == -1) -+ resolutions.push_back(res); -+ - return i; - } - #endif -@@ -233,8 +317,6 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) - if(GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) - { - uint32_t mode3d = HDMI_3D_FORMAT_NONE; -- sem_init(&m_tv_synced, 0, 0); -- m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); - - if (stereo_mode == RENDER_STEREO_MODE_SPLIT_HORIZONTAL || stereo_mode == RENDER_STEREO_MODE_SPLIT_VERTICAL) - { -@@ -274,7 +356,7 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) - CStereoscopicsManager::GetInstance().ConvertGuiStereoModeToString(stereo_mode), - mode3d==HDMI_3D_FORMAT_FRAME_PACKING ? " FP" : mode3d==HDMI_3D_FORMAT_SBS_HALF ? " SBS" : mode3d==HDMI_3D_FORMAT_TB_HALF ? " TB" : ""); - -- sem_wait(&m_tv_synced); -+ m_event.WaitMSec(10000); - } - else - { -@@ -283,16 +365,11 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) - CStereoscopicsManager::GetInstance().ConvertGuiStereoModeToString(stereo_mode), - mode3d==HDMI_3D_FORMAT_FRAME_PACKING ? " FP" : mode3d==HDMI_3D_FORMAT_SBS_HALF ? " SBS" : mode3d==HDMI_3D_FORMAT_TB_HALF ? " TB" : ""); - } -- m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); -- sem_destroy(&m_tv_synced); - - m_desktopRes = res; - } - else if(!GETFLAGS_GROUP(res.dwFlags) && GETFLAGS_MODE(res.dwFlags)) - { -- sem_init(&m_tv_synced, 0, 0); -- m_DllBcmHost->vc_tv_register_callback(CallbackTvServiceCallback, this); -- - SDTV_OPTIONS_T options; - options.aspect = get_sdtv_aspect_from_display_aspect((float)res.iScreenWidth / (float)res.iScreenHeight); - -@@ -303,15 +380,13 @@ bool CEGLNativeTypeRaspberryPI::SetNativeResolution(const RESOLUTION_INFO &res) - CLog::Log(LOGDEBUG, "EGL set SDTV mode (%d,%d)=%d\n", - GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); - -- sem_wait(&m_tv_synced); -+ m_event.WaitMSec(10000); - } - else - { - CLog::Log(LOGERROR, "EGL failed to set SDTV mode (%d,%d)=%d\n", - GETFLAGS_GROUP(res.dwFlags), GETFLAGS_MODE(res.dwFlags), success); - } -- m_DllBcmHost->vc_tv_unregister_callback(CallbackTvServiceCallback); -- sem_destroy(&m_tv_synced); - - m_desktopRes = res; - } -@@ -485,74 +560,11 @@ bool CEGLNativeTypeRaspberryPI::ProbeResolutions(std::vector &r - if(!m_DllBcmHost) - return false; - -- /* read initial desktop resolution before probe resolutions. -- * probing will replace the desktop resolution when it finds the same one. -- * we raplace it because probing will generate more detailed -- * resolution flags we don't get with vc_tv_get_state. -- */ -+ g_EGLEdid.CalcSAR(); - -- if(m_initDesktopRes) -- { -- TV_DISPLAY_STATE_T tv_state; -- -- // get current display settings state -- memset(&tv_state, 0, sizeof(TV_DISPLAY_STATE_T)); -- m_DllBcmHost->vc_tv_get_display_state(&tv_state); -- -- if ((tv_state.state & ( VC_HDMI_HDMI | VC_HDMI_DVI )) != 0) // hdtv -- { -- m_desktopRes.iScreen = 0; -- m_desktopRes.bFullScreen = true; -- m_desktopRes.iWidth = tv_state.display.hdmi.width; -- m_desktopRes.iHeight = tv_state.display.hdmi.height; -- m_desktopRes.iScreenWidth = tv_state.display.hdmi.width; -- m_desktopRes.iScreenHeight= tv_state.display.hdmi.height; -- m_desktopRes.dwFlags = MAKEFLAGS(tv_state.display.hdmi.group, tv_state.display.hdmi.mode, tv_state.display.hdmi.scan_mode); -- m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((HDMI_ASPECT_T)tv_state.display.hdmi.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); -- HDMI_PROPERTY_PARAM_T property; -- property.property = HDMI_PROPERTY_PIXEL_CLOCK_TYPE; -- vc_tv_hdmi_get_property(&property); -- m_desktopRes.fRefreshRate = property.param1 == HDMI_PIXEL_CLOCK_TYPE_NTSC ? tv_state.display.hdmi.frame_rate * (1000.0f/1001.0f) : tv_state.display.hdmi.frame_rate; -- } -- else if ((tv_state.state & ( VC_SDTV_NTSC | VC_SDTV_PAL )) != 0) // sdtv -- { -- m_desktopRes.iScreen = 0; -- m_desktopRes.bFullScreen = true; -- m_desktopRes.iWidth = tv_state.display.sdtv.width; -- m_desktopRes.iHeight = tv_state.display.sdtv.height; -- m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; -- m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; -- m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, tv_state.display.sdtv.mode, 1); -- m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; -- m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); -- } -- else if ((tv_state.state & VC_LCD_ATTACHED_DEFAULT) != 0) // lcd -- { -- m_desktopRes.iScreen = 0; -- m_desktopRes.bFullScreen = true; -- m_desktopRes.iWidth = tv_state.display.sdtv.width; -- m_desktopRes.iHeight = tv_state.display.sdtv.height; -- m_desktopRes.iScreenWidth = tv_state.display.sdtv.width; -- m_desktopRes.iScreenHeight= tv_state.display.sdtv.height; -- m_desktopRes.dwFlags = MAKEFLAGS(HDMI_RES_GROUP_INVALID, 0, 0); -- m_desktopRes.fRefreshRate = (float)tv_state.display.sdtv.frame_rate; -- m_desktopRes.fPixelRatio = tv_state.display.hdmi.display_options.aspect == 0 ? 1.0f : get_display_aspect_ratio((SDTV_ASPECT_T)tv_state.display.sdtv.display_options.aspect) / ((float)m_desktopRes.iScreenWidth / (float)m_desktopRes.iScreenHeight); -- } -- -- SetResolutionString(m_desktopRes); -- -- m_initDesktopRes = false; -- -- m_desktopRes.iSubtitles = (int)(0.965 * m_desktopRes.iHeight); -- -- CLog::Log(LOGDEBUG, "EGL initial desktop resolution %s (%.2f)\n", m_desktopRes.strMode.c_str(), m_desktopRes.fPixelRatio); -- } -- -- if(GETFLAGS_GROUP(m_desktopRes.dwFlags) && GETFLAGS_MODE(m_desktopRes.dwFlags)) -- { -- GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); -- GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); -- } -+ GetNativeResolution(&m_desktopRes); -+ GetSupportedModes(HDMI_RES_GROUP_CEA, resolutions); -+ GetSupportedModes(HDMI_RES_GROUP_DMT, resolutions); - { - AddUniqueResolution(m_desktopRes, resolutions, true); - CLog::Log(LOGDEBUG, "EGL probe resolution %s:%x\n", m_desktopRes.strMode.c_str(), m_desktopRes.dwFlags); -@@ -641,7 +653,7 @@ void CEGLNativeTypeRaspberryPI::GetSupportedModes(HDMI_RES_GROUP_T group, std::v - res.iHeight = tv->height; - res.iScreenWidth = tv->width; - res.iScreenHeight = tv->height; -- res.fPixelRatio = get_display_aspect_ratio((HDMI_ASPECT_T)tv->aspect_ratio) / ((float)res.iScreenWidth / (float)res.iScreenHeight); -+ res.fPixelRatio = g_EGLEdid.GetSAR() ? (float)g_EGLEdid.GetSAR() / ((float)res.iScreenWidth / (float)res.iScreenHeight) : 1.0f; - res.iSubtitles = (int)(0.965 * res.iHeight); - - if (!m_desktopRes.dwFlags && prefer_group == group && prefer_mode == tv->code) -@@ -669,15 +681,19 @@ void CEGLNativeTypeRaspberryPI::TvServiceCallback(uint32_t reason, uint32_t para - switch(reason) - { - case VC_HDMI_UNPLUGGED: -+ if (m_video) -+ m_video->OnDeviceChanged(CABLE_DISCONNECTED); - break; -- case VC_HDMI_STANDBY: -+ case VC_HDMI_ATTACHED: -+ if (m_video) -+ m_video->OnDeviceChanged(CABLE_CONNECTED); - break; - case VC_SDTV_NTSC: - case VC_SDTV_PAL: - case VC_HDMI_HDMI: - case VC_HDMI_DVI: - //Signal we are ready now -- sem_post(&m_tv_synced); -+ m_event.Set(); - break; - default: - break; -@@ -690,5 +706,33 @@ void CEGLNativeTypeRaspberryPI::CallbackTvServiceCallback(void *userdata, uint32 - callback->TvServiceCallback(reason, param1, param2); - } - --#endif -+bool CEGLEdid::ReadEdidData() -+{ -+ uint8_t buffer[128]; -+ size_t offset = 0; -+ int i, extensions = 0; -+ -+ int siz = vc_tv_hdmi_ddc_read(offset, sizeof(buffer), buffer); -+ offset += sizeof(buffer); -+ -+ /* First block always exist */ -+ if (siz == sizeof(buffer)) -+ { -+ memcpy(&m_edid, &buffer, sizeof(buffer)); -+ extensions = buffer[0x7e]; /* This tells you how many more blocks to read */ - -+ for (i = 0; i < extensions && i < EDID_MAXSIZE - sizeof(buffer); i++, offset += sizeof(buffer)) -+ { -+ siz = vc_tv_hdmi_ddc_read(offset, sizeof(buffer), buffer); -+ -+ if (siz != sizeof(buffer)) -+ break; -+ -+ memcpy((uint8_t *)(&m_edid + offset), &buffer, sizeof(buffer)); -+ } -+ } -+ -+ return true; -+} -+ -+#endif -diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h -index b524bb4..904645f 100644 ---- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h -+++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.h -@@ -20,14 +20,15 @@ - * - */ - --#include --#include -- - #include "EGLNativeType.h" - #if defined(TARGET_RASPBERRY_PI) - #include - #include - #endif -+#include "peripherals/Peripherals.h" -+#include "threads/Thread.h" -+ -+using namespace PERIPHERALS; - - class DllBcmHost; - class CEGLNativeTypeRaspberryPI : public CEGLNativeType -@@ -55,17 +56,19 @@ public: - virtual bool GetPreferredResolution(RESOLUTION_INFO *res) const; - - virtual bool ShowWindow(bool show); -+ - #if defined(TARGET_RASPBERRY_PI) - private: - DllBcmHost *m_DllBcmHost; - DISPMANX_ELEMENT_HANDLE_T m_dispman_display; - DISPMANX_ELEMENT_HANDLE_T m_dispman_element; - TV_GET_STATE_RESP_T m_tv_state; -- sem_t m_tv_synced; -+ CEvent m_event; - RESOLUTION_INFO m_desktopRes; - int m_width; - int m_height; - int m_initDesktopRes; -+ PERIPHERALS::CPeripheral *m_video; - - void GetSupportedModes(HDMI_RES_GROUP_T group, std::vector &resolutions); - void TvServiceCallback(uint32_t reason, uint32_t param1, uint32_t param2); diff --git a/xbmc/windowing/egl/EGLWrapper.cpp b/xbmc/windowing/egl/EGLWrapper.cpp index 0074027..76d1c4a 100644 --- a/xbmc/windowing/egl/EGLWrapper.cpp @@ -97002,20 +17793,6 @@ index 0074027..76d1c4a 100644 // Try to create each backend in sequence and go with the first one // that we know will work if ( -diff --git a/xbmc/windowing/egl/EGLWrapper.h b/xbmc/windowing/egl/EGLWrapper.h -index 5a74868..f133d86 100644 ---- a/xbmc/windowing/egl/EGLWrapper.h -+++ b/xbmc/windowing/egl/EGLWrapper.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "guilib/Resolution.h" - #include - class CEGLNativeType; diff --git a/xbmc/windowing/egl/Makefile.in b/xbmc/windowing/egl/Makefile.in index 3754233..ffaec1c 100644 --- a/xbmc/windowing/egl/Makefile.in @@ -97029,7 +17806,7 @@ index 3754233..ffaec1c 100644 LIB = windowing_egl.a diff --git a/xbmc/windowing/egl/WinSystemEGL.cpp b/xbmc/windowing/egl/WinSystemEGL.cpp -index 852f337..302001f 100644 +index a249277..302001f 100644 --- a/xbmc/windowing/egl/WinSystemEGL.cpp +++ b/xbmc/windowing/egl/WinSystemEGL.cpp @@ -18,6 +18,7 @@ @@ -97048,46 +17825,17 @@ index 852f337..302001f 100644 #include "guilib/DispResource.h" #include "threads/SingleLock.h" #ifdef HAS_IMXVPU -@@ -56,7 +58,6 @@ CWinSystemEGL::CWinSystemEGL() : CWinSystemBase() - - m_egl = NULL; - m_iVSyncMode = 0; -- m_delayDispReset = false; - } - - CWinSystemEGL::~CWinSystemEGL() -@@ -284,20 +285,9 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE +@@ -283,7 +285,9 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE m_stereo_mode == stereo_mode) { CLog::Log(LOGDEBUG, "CWinSystemEGL::CreateNewWindow: No need to create a new window"); +#if !defined(TARGET_RASPBERRY_PI) return true; -- } -- -- int delay = CSettings::GetInstance().GetInt("videoscreen.delayrefreshchange"); -- if (delay > 0) -- { -- m_delayDispReset = true; -- m_dispResetTimer.Set(delay * 100); -- } -- -- { -- CSingleLock lock(m_resourceSection); -- for (std::vector::iterator i = m_resources.begin(); i != m_resources.end(); ++i) -- (*i)->OnLostDisplay(); +#endif } m_stereo_mode = stereo_mode; -@@ -314,7 +304,6 @@ bool CWinSystemEGL::CreateNewWindow(const std::string& name, bool fullScreen, RE - return false; - } - -- if (!m_delayDispReset) - { - CSingleLock lock(m_resourceSection); - // tell any shared resources -@@ -362,7 +351,7 @@ void CWinSystemEGL::UpdateResolutions() +@@ -347,7 +351,7 @@ void CWinSystemEGL::UpdateResolutions() { CWinSystemBase::UpdateResolutions(); @@ -97096,7 +17844,7 @@ index 852f337..302001f 100644 std::vector resolutions; if (!m_egl->ProbeResolutions(resolutions) || resolutions.empty()) -@@ -381,14 +370,6 @@ void CWinSystemEGL::UpdateResolutions() +@@ -366,14 +370,6 @@ void CWinSystemEGL::UpdateResolutions() } } @@ -97111,7 +17859,7 @@ index 852f337..302001f 100644 RESOLUTION res_index = RES_DESKTOP; for (size_t i = 0; i < resolutions.size(); i++) -@@ -404,41 +385,43 @@ void CWinSystemEGL::UpdateResolutions() +@@ -389,41 +385,43 @@ void CWinSystemEGL::UpdateResolutions() g_graphicsContext.ResetOverscan(resolutions[i]); CDisplaySettings::GetInstance().GetResolutionInfo(res_index) = resolutions[i]; @@ -97124,10 +17872,10 @@ index 852f337..302001f 100644 - resolutions[i].dwFlags & D3DPRESENTFLAG_INTERLACED ? "i" : "", - resolutions[i].fRefreshRate); + CLog::Log(LOGNOTICE, "Found resolution %s\n", resolutions[i].strMode.c_str()); -+ + + res_index = (RESOLUTION)((int)res_index + 1); + } - ++ + /* ProbeResolutions includes already all resolutions. + * Only get desktop resolution so we can replace xbmc's desktop res + */ @@ -97179,49 +17927,6 @@ index 852f337..302001f 100644 } bool CWinSystemEGL::IsExtSupported(const char* extension) -@@ -454,14 +437,6 @@ bool CWinSystemEGL::IsExtSupported(const char* extension) - - void CWinSystemEGL::PresentRenderImpl(bool rendered) - { -- if (m_delayDispReset && m_dispResetTimer.IsTimePast()) -- { -- m_delayDispReset = false; -- CSingleLock lock(m_resourceSection); -- // tell any shared resources -- for (std::vector::iterator i = m_resources.begin(); i != m_resources.end(); ++i) -- (*i)->OnResetDisplay(); -- } - if (!rendered) - return; - m_egl->SwapBuffers(m_display, m_surface); -diff --git a/xbmc/windowing/egl/WinSystemEGL.h b/xbmc/windowing/egl/WinSystemEGL.h -index c24bb35..f2991b2 100644 ---- a/xbmc/windowing/egl/WinSystemEGL.h -+++ b/xbmc/windowing/egl/WinSystemEGL.h -@@ -23,14 +23,10 @@ - * - */ - --#include --#include -- - #include "rendering/gles/RenderSystemGLES.h" - #include "utils/GlobalsHandling.h" - #include - #include "windowing/WinSystem.h" --#include "threads/SystemClock.h" - - class CEGLWrapper; - class IDispResource; -@@ -88,8 +84,6 @@ protected: - std::string m_extensions; - CCriticalSection m_resourceSection; - std::vector m_resources; -- bool m_delayDispReset; -- XbmcThreads::EndTime m_dispResetTimer; - }; - - XBMC_GLOBAL_REF(CWinSystemEGL,g_Windowing); diff --git a/xbmc/windowing/egl/vc_hdmi.h b/xbmc/windowing/egl/vc_hdmi.h new file mode 100644 index 0000000..c8e21ce @@ -97793,158 +18498,11 @@ index 0000000..c8e21ce +#define IS_3D(f) ( f & (D3DPRESENTFLAG_MODE3DSBS | D3DPRESENTFLAG_MODE3DTB) ) + +#endif /*HDMI_RES_GROUP_NAME*/ -diff --git a/xbmc/windowing/osx/CMakeLists.txt b/xbmc/windowing/osx/CMakeLists.txt -index db2c51c..b4006d6 100644 ---- a/xbmc/windowing/osx/CMakeLists.txt -+++ b/xbmc/windowing/osx/CMakeLists.txt -@@ -1,4 +1,4 @@ --if(CORE_SYSTEM_NAME STREQUAL osx) -+if(CORE_SYSTEM_NAME STREQUAL darwin) - set(SOURCES WinEventsOSX.mm - WinSystemOSX.mm - WinSystemOSXGL.mm) -diff --git a/xbmc/windowing/osx/WinSystemIOS.h b/xbmc/windowing/osx/WinSystemIOS.h -index 7ecdf67..eda4b7e 100644 ---- a/xbmc/windowing/osx/WinSystemIOS.h -+++ b/xbmc/windowing/osx/WinSystemIOS.h -@@ -24,9 +24,6 @@ - #define WINDOW_SYSTEM_IOSEGL_H - - #if defined(TARGET_DARWIN_IOS) --#include --#include -- - #include "windowing/WinSystem.h" - #include "rendering/gles/RenderSystemGLES.h" - #include "utils/GlobalsHandling.h" -diff --git a/xbmc/windowing/osx/WinSystemOSX.h b/xbmc/windowing/osx/WinSystemOSX.h -index 1360fc8..dbc9245 100644 ---- a/xbmc/windowing/osx/WinSystemOSX.h -+++ b/xbmc/windowing/osx/WinSystemOSX.h -@@ -22,9 +22,6 @@ - - #if defined(TARGET_DARWIN_OSX) - --#include --#include -- - #include "windowing/WinSystem.h" - #include "threads/CriticalSection.h" - #include "threads/Timer.h" -diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp -index d62abf1..405cb49 100644 ---- a/xbmc/windowing/windows/WinSystemWin32.cpp -+++ b/xbmc/windowing/windows/WinSystemWin32.cpp -@@ -459,7 +459,7 @@ bool CWinSystemWin32::ResizeInternal(bool forceRefresh) - // white frame plus titlebar around the xbmc splash - SetWindowPos(m_hWnd, windowAfter, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW|SWP_DRAWFRAME); - -- //! @todo Probably only need this if switching screens -+ // TODO: Probably only need this if switching screens - ValidateRect(NULL, NULL); - } - return true; -@@ -702,7 +702,7 @@ bool CWinSystemWin32::UpdateResolutionsInternal() - CLog::Log(LOGNOTICE, "Found screen: %s on %s, adapter %d.", monitorStr.c_str(), adapterStr.c_str(), adapter); - - // get information about the display's current position and display mode -- //! @todo for Windows 7/Server 2008 and up, Microsoft recommends QueryDisplayConfig() instead, the API used by the control panel. -+ // TODO: for Windows 7/Server 2008 and up, Microsoft recommends QueryDisplayConfig() instead, the API used by the control panel. - DEVMODEW dm; - ZeroMemory(&dm, sizeof(dm)); - dm.dmSize = sizeof(dm); -diff --git a/xbmc/windowing/windows/WinSystemWin32.h b/xbmc/windowing/windows/WinSystemWin32.h -index 4de378c..59e78f4 100644 ---- a/xbmc/windowing/windows/WinSystemWin32.h -+++ b/xbmc/windowing/windows/WinSystemWin32.h -@@ -26,7 +26,6 @@ - #include "threads/SystemClock.h" - #include "windowing/WinSystem.h" - #include --#include - - struct MONITOR_DETAILS - { -diff --git a/xbmc/windowing/windows/WinSystemWin32DX.cpp b/xbmc/windowing/windows/WinSystemWin32DX.cpp -index 61d2491..0a4d18c 100644 ---- a/xbmc/windowing/windows/WinSystemWin32DX.cpp -+++ b/xbmc/windowing/windows/WinSystemWin32DX.cpp -@@ -40,7 +40,7 @@ CWinSystemWin32DX::~CWinSystemWin32DX() - - } - --void CWinSystemWin32DX::PresentRender(bool rendered, bool videoLayer) -+void CWinSystemWin32DX::PresentRender(bool rendered) - { - if (rendered) - PresentRenderImpl(rendered); -diff --git a/xbmc/windowing/windows/WinSystemWin32DX.h b/xbmc/windowing/windows/WinSystemWin32DX.h -index dc32ad2..ca8716a 100644 ---- a/xbmc/windowing/windows/WinSystemWin32DX.h -+++ b/xbmc/windowing/windows/WinSystemWin32DX.h -@@ -42,7 +42,7 @@ public: - virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); - virtual bool WindowedMode() { return CRenderSystemDX::m_useWindowedDX; } - virtual void NotifyAppFocusChange(bool bGaining); -- virtual void PresentRender(bool rendererd, bool videoLayer); -+ virtual void PresentRender(bool rendererd); - - std::string GetClipboardText(void); - diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp -index 075d531..08e53a7 100644 +index 9ba82cc..08e53a7 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp -@@ -708,10 +708,10 @@ bool CGUIMediaWindow::GetDirectory(const std::string &strDirectory, CFileItemLis - int iWindow = GetID(); - std::vector regexps; - -- //! @todo Do we want to limit the directories we apply the video ones to? -+ // TODO: Do we want to limit the directories we apply the video ones to? - if (iWindow == WINDOW_VIDEO_NAV) - regexps = g_advancedSettings.m_videoExcludeFromListingRegExps; -- if (iWindow == WINDOW_MUSIC_NAV) -+ if (iWindow == WINDOW_MUSIC_FILES || iWindow == WINDOW_MUSIC_NAV) - regexps = g_advancedSettings.m_audioExcludeFromListingRegExps; - if (iWindow == WINDOW_PICTURES) - regexps = g_advancedSettings.m_pictureExcludeFromListingRegExps; -@@ -736,7 +736,7 @@ bool CGUIMediaWindow::GetDirectory(const std::string &strDirectory, CFileItemLis - - bool CGUIMediaWindow::Update(const std::string &strDirectory, bool updateFilterPath /* = true */) - { -- //! @todo OnInitWindow calls Update() before window path has been set properly. -+ // TODO: OnInitWindow calls Update() before window path has been set properly. - if (strDirectory == "?") - return false; - -@@ -789,6 +789,8 @@ bool CGUIMediaWindow::Update(const std::string &strDirectory, bool updateFilterP - { - if (iWindow == WINDOW_PICTURES) - showLabel = 997; -+ else if (iWindow == WINDOW_MUSIC_FILES) -+ showLabel = 998; - else if (iWindow == WINDOW_FILES) - showLabel = 1026; - } -@@ -1073,7 +1075,7 @@ bool CGUIMediaWindow::HaveDiscOrConnection(const std::string& strPath, int iDriv - } - else if (iDriveType==CMediaSource::SOURCE_TYPE_REMOTE) - { -- //! @todo Handle not connected to a remote share -+ // TODO: Handle not connected to a remote share - if ( !g_application.getNetwork().IsConnected() ) - { - CGUIDialogOK::ShowAndGetInput(CVariant{220}, CVariant{221}); -@@ -1623,7 +1625,7 @@ void CGUIMediaWindow::GetContextButtons(int itemNumber, CContextButtons &buttons - if (!item || item->IsParentFolder()) - return; - -- //! @todo FAVOURITES Conditions on masterlock and localisation -+ // TODO: FAVOURITES Conditions on masterlock and localisation - if (!item->IsParentFolder() && !item->IsPath("add") && !item->IsPath("newplaylist://") && - !URIUtils::IsProtocol(item->GetPath(), "newsmartplaylist") && !URIUtils::IsProtocol(item->GetPath(), "newtag") && - !URIUtils::IsProtocol(item->GetPath(), "musicsearch") && -@@ -1674,7 +1676,7 @@ const CFileItemList& CGUIMediaWindow::CurrentDirectory() const +@@ -1676,7 +1676,7 @@ const CFileItemList& CGUIMediaWindow::CurrentDirectory() const bool CGUIMediaWindow::WaitForNetwork() const { @@ -97953,7 +18511,7 @@ index 075d531..08e53a7 100644 return true; CGUIDialogProgress *progress = (CGUIDialogProgress *)g_windowManager.GetWindow(WINDOW_DIALOG_PROGRESS); -@@ -1686,7 +1688,7 @@ bool CGUIMediaWindow::WaitForNetwork() const +@@ -1688,7 +1688,7 @@ bool CGUIMediaWindow::WaitForNetwork() const progress->SetLine(1, CVariant{url.GetWithoutUserDetails()}); progress->ShowProgressBar(false); progress->Open(); @@ -97962,171 +18520,8 @@ index 075d531..08e53a7 100644 { progress->Progress(); if (progress->IsCanceled()) -@@ -1869,11 +1871,11 @@ bool CGUIMediaWindow::GetFilteredItems(const std::string &filter, CFileItemList - filteredItems.Add(item); - continue; - } -- //! @todo Need to update this to get all labels, ideally out of the displayed info (ie from m_layout and m_focusedLayout) -- //! though that isn't practical. Perhaps a better idea would be to just grab the info that we should filter on based on -- //! where we are in the library tree. -- //! Another idea is tying the filter string to the current level of the tree, so that going deeper disables the filter, -- //! but it's re-enabled on the way back out. -+ // TODO: Need to update this to get all labels, ideally out of the displayed info (ie from m_layout and m_focusedLayout) -+ // though that isn't practical. Perhaps a better idea would be to just grab the info that we should filter on based on -+ // where we are in the library tree. -+ // Another idea is tying the filter string to the current level of the tree, so that going deeper disables the filter, -+ // but it's re-enabled on the way back out. - std::string match; - /* if (item->GetFocusedLayout()) - match = item->GetFocusedLayout()->GetAllText(); -diff --git a/xbmc/windows/GUIMediaWindow.h b/xbmc/windows/GUIMediaWindow.h -index b917f31..b1eb511 100644 ---- a/xbmc/windows/GUIMediaWindow.h -+++ b/xbmc/windows/GUIMediaWindow.h -@@ -38,19 +38,19 @@ public: - virtual ~CGUIMediaWindow(void); - - // specializations of CGUIControl -- virtual bool OnAction(const CAction &action) override; -- virtual bool OnBack(int actionID) override; -- virtual bool OnMessage(CGUIMessage& message) override; -+ virtual bool OnAction(const CAction &action); -+ virtual bool OnBack(int actionID); -+ virtual bool OnMessage(CGUIMessage& message); - - // specializations of CGUIWindow -- virtual void OnWindowLoaded() override; -- virtual void OnWindowUnload() override; -- virtual void OnInitWindow() override; -- virtual bool IsMediaWindow() const override { return true; } -- int GetViewContainerID() const override { return m_viewControl.GetCurrentControl(); } -- int GetViewCount() const override { return m_viewControl.GetViewModeCount(); }; -- virtual bool HasListItems() const override { return true; } -- virtual CFileItemPtr GetCurrentListItem(int offset = 0) override; -+ virtual void OnWindowLoaded(); -+ virtual void OnWindowUnload(); -+ virtual void OnInitWindow(); -+ virtual bool IsMediaWindow() const { return true; } -+ int GetViewContainerID() const { return m_viewControl.GetCurrentControl(); } -+ int GetViewCount() const { return m_viewControl.GetViewModeCount(); }; -+ virtual bool HasListItems() const { return true; } -+ virtual CFileItemPtr GetCurrentListItem(int offset = 0); - - // custom methods - virtual bool CanFilterAdvanced() { return m_canFilterAdvanced; } -@@ -64,10 +64,10 @@ public: - - protected: - // specializations of CGUIControlGroup -- virtual CGUIControl *GetFirstFocusableControl(int id) override; -+ virtual CGUIControl *GetFirstFocusableControl(int id); - - // specializations of CGUIWindow -- virtual void LoadAdditionalTags(TiXmlElement *root) override; -+ virtual void LoadAdditionalTags(TiXmlElement *root); - - // custom methods - virtual void SetupShares(); -diff --git a/xbmc/windows/GUIWindowFileManager.cpp b/xbmc/windows/GUIWindowFileManager.cpp -index 57a73b7..602c254 100644 ---- a/xbmc/windows/GUIWindowFileManager.cpp -+++ b/xbmc/windows/GUIWindowFileManager.cpp -@@ -41,9 +41,7 @@ - #include "guilib/GUIKeyboardFactory.h" - #include "dialogs/GUIDialogProgress.h" - #include "filesystem/FavouritesDirectory.h" --#include "PlayListPlayer.h" - #include "playlists/PlayList.h" --#include "cores/playercorefactory/PlayerCoreFactory.h" - #include "storage/MediaManager.h" - #include "settings/MediaSourceSettings.h" - #include "settings/Settings.h" -@@ -589,7 +587,7 @@ void CGUIWindowFileManager::OnClick(int iList, int iItem) - // UpdateButtons(); - } - --//! @todo 2.0: Can this be removed, or should we run without the "special" file directories while -+// TODO 2.0: Can this be removed, or should we run without the "special" file directories while - // in filemanager view. - void CGUIWindowFileManager::OnStart(CFileItem *pItem, const std::string &player) - { -@@ -653,7 +651,7 @@ bool CGUIWindowFileManager::HaveDiscOrConnection( std::string& strPath, int iDri - } - else if ( iDriveType == CMediaSource::SOURCE_TYPE_REMOTE ) - { -- //! @todo Handle not connected to a remote share -+ // TODO: Handle not connected to a remote share - if ( !g_application.getNetwork().IsConnected() ) - { - CGUIDialogOK::ShowAndGetInput(CVariant{220}, CVariant{221}); -@@ -881,8 +879,8 @@ bool CGUIWindowFileManager::GetDirectory(int iList, const std::string &strDirect - - bool CGUIWindowFileManager::CanRename(int iList) - { -- //! @todo Renaming of shares (requires writing to sources.xml) -- //! this might be able to be done via the webserver code stuff... -+ // TODO: Renaming of shares (requires writing to sources.xml) -+ // this might be able to be done via the webserver code stuff... - if (m_Directory[iList]->IsVirtualDirectoryRoot()) return false; - if (m_Directory[iList]->IsReadOnly()) return false; - -@@ -892,8 +890,8 @@ bool CGUIWindowFileManager::CanRename(int iList) - bool CGUIWindowFileManager::CanCopy(int iList) - { - // can't copy if the destination is not writeable, or if the source is a share! -- //! @todo Perhaps if the source is removeable media (DVD/CD etc.) we could -- //! put ripping/backup in here. -+ // TODO: Perhaps if the source is removeable media (DVD/CD etc.) we could -+ // put ripping/backup in here. - if (!CUtil::SupportsReadFileOperations(m_Directory[iList]->GetPath())) return false; - if (m_Directory[iList]->IsVirtualDirectoryRoot()) return false; - if (m_Directory[1 - iList]->IsVirtualDirectoryRoot()) return false; -@@ -960,7 +958,7 @@ void CGUIWindowFileManager::OnPopupMenu(int list, int item, bool bContextDriven - if (m_Directory[list]->IsVirtualDirectoryRoot()) - { - if (item < 0) -- { //! @todo We should add the option here for shares to be added if there aren't any -+ { // TODO: We should add the option here for shares to be added if there aren't any - return ; - } - -diff --git a/xbmc/windows/GUIWindowFileManager.h b/xbmc/windows/GUIWindowFileManager.h -index 1f35d2f..36197ad 100644 ---- a/xbmc/windows/GUIWindowFileManager.h -+++ b/xbmc/windows/GUIWindowFileManager.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "guilib/GUIWindow.h" - #include "filesystem/VirtualDirectory.h" - #include "filesystem/DirectoryHistory.h" -diff --git a/xbmc/windows/GUIWindowLoginScreen.cpp b/xbmc/windows/GUIWindowLoginScreen.cpp -index d6d14ff..ca2edb7 100644 ---- a/xbmc/windows/GUIWindowLoginScreen.cpp -+++ b/xbmc/windows/GUIWindowLoginScreen.cpp -@@ -28,7 +28,7 @@ - #include "GUIPassword.h" - #include "addons/AddonManager.h" - #include "addons/Skin.h" --#include "cores/AudioEngine/Engines/ActiveAE/AudioDSPAddons/ActiveAEDSP.h" -+#include "cores/AudioEngine/DSPAddons/ActiveAEDSP.h" - #include "dialogs/GUIDialogContextMenu.h" - #include "dialogs/GUIDialogOK.h" - #include "guilib/GUIMessage.h" -@@ -42,7 +42,6 @@ - #endif - #include "messaging/ApplicationMessenger.h" - #include "network/Network.h" --#include "PlayListPlayer.h" - #include "profiles/Profile.h" - #include "profiles/ProfilesManager.h" - #include "profiles/dialogs/GUIDialogProfileSettings.h" diff --git a/xbmc/windows/GUIWindowSystemInfo.cpp b/xbmc/windows/GUIWindowSystemInfo.cpp -index 0cd539e..59b6da7 100644 +index 4184db0..fe40f1b 100644 --- a/xbmc/windows/GUIWindowSystemInfo.cpp +++ b/xbmc/windows/GUIWindowSystemInfo.cpp @@ -100,7 +100,9 @@ void CGUIWindowSystemInfo::FrameMove() @@ -98139,20 +18534,6 @@ index 0cd539e..59b6da7 100644 } else if (m_section == CONTROL_BT_STORAGE) -diff --git a/xbmc/windows/GUIWindowSystemInfo.h b/xbmc/windows/GUIWindowSystemInfo.h -index 2fed1f5..751995d 100644 ---- a/xbmc/windows/GUIWindowSystemInfo.h -+++ b/xbmc/windows/GUIWindowSystemInfo.h -@@ -20,9 +20,6 @@ - * - */ - --#include --#include -- - #include "guilib/GUIWindow.h" - - class CGUIWindowSystemInfo : public CGUIWindow -- 2.7.1