{"id":15040744,"url":"https://github.com/android/renderscript-intrinsics-replacement-toolkit","last_synced_at":"2025-08-15T00:33:08.565Z","repository":{"id":37704874,"uuid":"358694907","full_name":"android/renderscript-intrinsics-replacement-toolkit","owner":"android","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-10T10:17:23.000Z","size":793,"stargazers_count":357,"open_issues_count":21,"forks_count":96,"subscribers_count":83,"default_branch":"main","last_synced_at":"2024-12-04T07:36:19.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Assembly","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/android.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-04-16T19:04:56.000Z","updated_at":"2024-11-25T01:21:34.000Z","dependencies_parsed_at":"2023-01-28T23:15:19.993Z","dependency_job_id":null,"html_url":"https://github.com/android/renderscript-intrinsics-replacement-toolkit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Frenderscript-intrinsics-replacement-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Frenderscript-intrinsics-replacement-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Frenderscript-intrinsics-replacement-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/android%2Frenderscript-intrinsics-replacement-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/android","download_url":"https://codeload.github.com/android/renderscript-intrinsics-replacement-toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229881197,"owners_count":18138643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-09-24T20:45:00.456Z","updated_at":"2024-12-15T22:14:35.391Z","avatar_url":"https://github.com/android.png","language":"Assembly","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RenderScript Intrinsics Replacement Toolkit - v0.8 BETA\n\nThis Toolkit provides a collection of high-performance image manipulation functions\nlike blur, blend, and resize. It can be used as a stand-alone replacement for most\nof the deprecated RenderScript Intrinsics functions. \n\nThe Toolkit provides ten image manipulation functions:\n* blend,\n* blur,\n* color matrix,\n* convolve,\n* histogram and histogramDot,\n* LUT (lookup table) and LUT 3D,\n* resize, and\n* YUV to RGB.\n\nThe Toolkit provides a C++ and a Java/Kotlin interface. It is packaged as an Android\nlibrary that you can add to your project.\n\nThese functions execute multithreaded on the CPU. They take advantage of Neon/AdvSimd\non Arm processors and SSE on Intel's.\n\nCompared to the RenderScript Intrinsics, this Toolkit is simpler to use and twice as fast\nwhen executing on the CPU. However RenderScript Intrinsics allow more flexibility for\nthe type of allocations supported. This toolkit does not support allocations of floats;\nmost the functions support ByteArrays and Bitmaps.\n\nYou should instantiate the Toolkit once and reuse it throughout your application.\nOn instantiation, the Toolkit creates a thread pool that's used for processing all the functions.\nYou can limit the number of poolThreads used by the Toolkit via the constructor. The poolThreads\nare destroyed once the Toolkit is destroyed, after any pending work is done.\n\nThis library is thread safe. You can call methods from different poolThreads. The functions will\nexecute sequentially.\n\n \n## Future improvement ideas:\n\n* Turn the Java version of the Toolkit into a singleton, to reduce the chance that someone inadventarly\ncreate multiple threadpools.\n\n* Support ByteBuffer. It should be straightforward to use GetDirectBufferAddress in JniEntryPoints.cpp.\nSee https://developer.android.com/training/articles/perf-jni and jni_helper.h.\n\n* The RenderScript Intrinsics support floats for colorMatrix, convolve, and resize. The Toolkit does not.\n\n* Allow in place update of buffers, or writing to an existing byte array.\n\n* For Blur, we could have a version that accepts a mask. This is commonly used for background\nblurring. We should allow the mask to be smaller than the original, since neural networks models\nthat do segmentation are downscaled.\n\n* Allow yuvToRgb to have a Restriction.\n\n* Add support for YUV_420_888, the YUV format favored by Camera2. Allow various strides to be specified.\n\n* When passing a Restriction, it would be nice to say \"Create a smaller output\".\nThe original RenderScript does not allow that. It's not that useful when outputing new buffers as\nour Java library does.\n\n* For Resize, Restriction working on input buffer would be more useful but that's not RenderScript.\n\n* Integrate and test with imageprocessing_jb. Do the same for [github/renderscript-samples/](https://github.com/android/renderscript-samples/tree/main/RenderScriptIntrinsic)\n\n* Allow Bitmaps with rowSize != width * vectorSize. We could do this also for ByteArray.\n\n- In TaskProcessor.cpp, the code below is fine and clean, but probably a bit inefficient. \nWhen this wakes up another thread, it may have to immediately go back to sleep, since we still hold the lock.\nIt could instead set a need_to_notify flag and test that after releasing the lock (both places).\nThat might avoid some context switches.\n```cpp\nif (mTilesInProcess == 0 \u0026\u0026 mTilesNotYetStarted == 0) {\n    mWorkIsFinished.notify_one();\n```\n\n* When compiled as part of Android, librenderscript_toolkit.so is 101,456 bytes. When compiled by Android Studio as part of an .aar, it's 387K. Figure out why and slim it down.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroid%2Frenderscript-intrinsics-replacement-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandroid%2Frenderscript-intrinsics-replacement-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandroid%2Frenderscript-intrinsics-replacement-toolkit/lists"}