{"id":159699,"date":"2012-11-29T08:46:03","date_gmt":"2012-11-29T04:46:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=159699"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=159699","title":{"rendered":"<span class=\"post_title\">\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Renderscript \u043d\u0430 android-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438 Intel\u00ae<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/717\/3ce\/47a\/7173ce47ada70c1caee84e3473a6392e.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0434\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Renderscript \u0432\u043d\u0443\u0442\u0440\u0438 Android, \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 Dalvik \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0430ndroid-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c Intel \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 renderscript.<br \/>  <b>Renderscript<\/b> \u2013 \u044d\u0442\u043e API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f 2D\/3D \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u043c\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0435 \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u0445 Android-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445.<br \/>  \u0422\u0430\u043a\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u044f\u0434\u0430 dalvik \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u043e-\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438 \u0434\u0440., \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u044e\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438. <br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>1. \u0422\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f Renderscript \u0432\u043d\u0443\u0442\u0440\u0438 Android<\/h4>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u043a\u0440\u0430\u0442\u043a\u0438\u0439 \u043e\u0431\u0437\u043e\u0440 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Renderscript \u0432\u043d\u0443\u0442\u0440\u0438 Android, \u0435\u0435 \u0434\u043e\u0441\u0442\u043e\u0438\u043d\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438.<\/p>\n<h5>1.1 Renderscript offline-\u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/h5>\n<p>  Renderscript \u043d\u0430\u0447\u0430\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0432 Honeycomb\/Android 3.0 (API 11). \u0410 \u0438\u043c\u0435\u043d\u043d\u043e, \u0432 Android SDK \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 platform-tools \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f llvm-rs-cc (offline compiler) \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 renderscript (*.rs \u0444\u0430\u0439\u043b) \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 (*.bc \u0444\u0430\u0439\u043b) \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 java \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 (*.java \u0444\u0430\u0439\u043b\u044b) \u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440, \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 renderscript \u0438 \u0441\u0430\u043c\u043e\u0433\u043e renderscript. \u0412 \u043e\u0441\u043d\u043e\u0432\u0435 llvm-rs-cc \u043b\u0435\u0436\u0438\u0442 <a href=\"http:\/\/clang.llvm.org\/\">Clang \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440<\/a> \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0434 Android, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 front-end \u0434\u043b\u044f <a href=\"http:\/\/www.llvm.org\/\">LLVM \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430<\/a>.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/2ea\/0c5\/094\/2ea0c5094f96ba3c92e984d7776a3051.png\" alt=\"image\"\/><\/p>\n<h5>1.2 Renderscript run-time \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/h5>\n<p>  \u0412 Android \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f framework, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u043d\u0430 \u0431\u0430\u0437\u0435 LLVM back-end, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 run-time \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430, \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u0443 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438, \u0437\u0430\u043f\u0443\u0441\u043a \u0438 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f renderscript. \u042d\u0442\u043e\u0442 framework \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439: <i>libbcc<\/i> \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 LLVM \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0430\u0433\u043c\u0430\u043c\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0435\u0439 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0430 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043b\u0438\u043d\u043a\u043e\u0432\u043a\u043e\u0439 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438 \u0438\u0437 libRS; <i>libRS<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a (math, time, drawing, ref-counting,\u2026), \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0438 \u0442\u0438\u043f\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445 (Script, Type, Element, Allocation, Mesh, various matrices,\u2026).<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/65b\/542\/1f8\/65b5421f8ae7f58468a24950f8a3cd26.png\" alt=\"image\"\/><br \/>  <b>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<\/b>  <\/p>\n<ul>\n<li><i>\u0410\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e-\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/i> \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e renderscript \u0431\u0430\u0439\u0442-\u043a\u043e\u0434, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0439 \u0432 apk \u0444\u0430\u0439\u043b, \u0432 run-time \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0442\u043e\u0433\u043e \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e-\u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f (CPU) \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d;<\/li>\n<li><i>\u0411\u044b\u0441\u0442\u0440\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f<\/i> \u0434\u043e\u0441\u0442\u0438\u0433\u0430\u0435\u0442\u0441\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, run-time \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043a\u043e\u0434\u0430.<\/li>\n<\/ul>\n<p>  <b>\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<\/b>  <\/p>\n<ul>\n<li><i>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/i> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 renderscript \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439. \u0412\u0441\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e renderscript run-time API, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e <a href=\"http:\/\/developer.android.com\/reference\/renderscript\/index.html\">\u0437\u0434\u0435\u0441\u044c<\/a>;<\/li>\n<li><i>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f renderscript \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u043d\u0430 GPU, DSP.<\/i> \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 run-time \u0431\u0430\u043b\u0430\u043d\u0441\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e\u0442\u043e\u043a\u043e\u0432 \u0432 \u0433\u0435\u0442\u0435\u0440\u043e\u0433\u0435\u043d\u043d\u043e\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0435, \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u044c\u044e.<\/li>\n<\/ul>\n<p>  <\/p>\n<h4>2. Dalvik vs. Renderscript \u0432 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c dalvik-\u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>Dalvik_MonoChromeFilter<\/i> (\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0446\u0432\u0435\u0442\u043d\u043e\u0433\u043e RGB-\u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u0447\u0435\u0440\u043d\u043e-\u0431\u0435\u043b\u043e\u0435 (\u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0435) ):<\/p>\n<pre><code class=\"java\">private void Dalvik_MonoChromeFilter() {     \tfloat MonoMult[] = {0.299f, 0.587f, 0.114f};     \tint mInPixels[] = new int[mBitmapIn.getHeight() * mBitmapIn.getWidth()];     \tint mOutPixels[] = new int[mBitmapOut.getHeight() * mBitmapOut.getWidth()];     \tmBitmapIn.getPixels(mInPixels, 0, mBitmapIn.getWidth(), 0, 0,     \t\t\tmBitmapIn.getWidth(), mBitmapIn.getHeight());     \tfor(int i = 0;i &lt; mInPixels.length;i++) {     \t\tfloat r = (float)(mInPixels[i] & 0xff);     \t\tfloat g = (float)((mInPixels[i] &gt;&gt; 8) & 0xff);     \t\tfloat b = (float)((mInPixels[i] &gt;&gt; 16) & 0xff);      \t\tint mono = (int)(r * MonoMult[0] + g * MonoMult[1] + b * MonoMult[2]);      \t\tmOutPixels[i] = mono + (mono &lt;&lt; 8) + (mono &lt;&lt; 16) + (mInPixels[i] & 0xff000000);     \t}     \tmBitmapOut.setPixels(mOutPixels, 0, mBitmapOut.getWidth(), 0, 0,     \t\t\tmBitmapOut.getWidth(), mBitmapOut.getHeight()); } <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0437\u0430\u0442\u044c? \u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u0446\u0438\u043a\u043b \u0441 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044f\u043c\u0438, \u00ab\u043f\u0435\u0440\u0435\u043c\u0430\u043b\u044b\u0432\u0430\u044e\u0449\u0438\u0439\u00bb \u043a\u0443\u0447\u0443 \u043f\u0438\u043a\u0441\u0435\u043b\u043e\u0432. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0431\u044b\u0441\u0442\u0440\u043e \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<br \/>  \u0414\u043b\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u041c\u0435\u0433\u0430\u0424\u043e\u043d Mint \u043d\u0430 Intel\u00ae Atom\u2122 Z2460 1.6GHz \u0441 Android ICS 4.0.4 \u0438 600&#215;1024 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443 \u0441 \u043b\u0435\u0433\u043e-\u0440\u043e\u0431\u043e\u0442\u043e\u043c, \u043d\u0435\u0441\u0443\u0449\u0438\u043c \u043d\u043e\u0432\u043e\u0433\u043e\u0434\u043d\u0438\u0435 \u043f\u043e\u0434\u0430\u0440\u043a\u0438.<\/p>\n<td><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/73f\/dd7\/ab0\/73fdd7ab0ae4141fbc5dd87510fba819.png\" alt=\"image\"\/><\/td>\n<td><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/76b\/97c\/27a\/76b97c27a3f934f7390ad7774ac68a43.png\" alt=\"image\"\/><\/td>\n<p>  \u0417\u0430\u043c\u0435\u0440\u044b \u0437\u0430\u0442\u0440\u0430\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u0443\u0434\u0435\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0445\u0435\u043c\u0435:<\/p>\n<pre><code class=\"java\">private long startnow; private long endnow;  startnow = android.os.SystemClock.uptimeMillis(); Dalvik_MonoChromeFilter(); endnow = android.os.SystemClock.uptimeMillis(); Log.d(&quot;Timing&quot;, &quot;Ex\u0435cution time: &quot;+(endnow-startnow)+&quot; ms&quot;); <\/code><\/pre>\n<p>  \u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u0433\u043e\u043c \u00abTiming\u00bb \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <abbr title=\"Android Debug Bridge\">ADB<\/abbr>. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0434\u0435\u0441\u044f\u0442\u043e\u043a \u0437\u0430\u043c\u0435\u0440\u043e\u0432, \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0438 \u0443\u0431\u0435\u0434\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0440\u0430\u0437\u0431\u0440\u043e\u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439.<br \/>  <i><u>\u0412\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f dalvik-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e 353 \u043c\u0441\u0435\u043a.<\/u><\/i> <br \/>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0430 \u043c\u043d\u043e\u0433\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 (\u043a \u043f\u0440\u0438\u043c\u0435\u0440\u0443, \u043a\u043b\u0430\u0441\u0441 AsyncTask \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0438\u0445\u0441\u044f \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u043e\u0442\u043e\u043a\u0430\u0445), <b>\u0432 \u043b\u0443\u0447\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435<\/b> \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0436\u0430\u0442\u044c \u0434\u0432\u0443\u0445\u043a\u0440\u0430\u0442\u043d\u043e\u0435 \u0443\u0441\u043a\u043e\u0440\u0435\u043d\u0438\u0435, \u0432 \u0441\u0438\u043b\u0443 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0434\u0432\u0443\u0445 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u044f\u0434\u0435\u0440 \u043d\u0430 Intel Atom Z2460 1.6GHz.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c renderscript-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <i>RS_MonoChromeFilter<\/i> \u0442\u043e\u0433\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0430:<\/p>\n<pre><code class=\"cpp\">\/\/mono.rs \/\/or our small renderscript #pragma version(1) #pragma rs java_package_name(com.example.hellocompute)  \/\/multipliers to convert a RGB colors to black and white const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};  void root(const uchar4 *v_in, uchar4 *v_out) {   \/\/unpack a color to a float4   float4 f4 = rsUnpackColor8888(*v_in);   \/\/take the dot product of the color and the multiplier   float3 mono = dot(f4.rgb, gMonoMult);   \/\/repack the float to a color   *v_out = rsPackColorTo8888(mono); } <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"java\">    private RenderScript mRS;     private Allocation mInAllocation;     private Allocation mOutAllocation;     private ScriptC_mono mScript;     \u2026     private void RS_MonoChromeFilter() {         mRS = RenderScript.create(this);\/*\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Renderscript-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430*\/         mInAllocation = Allocation.createFromBitmap(mRS, mBitmapIn,             Allocation.MipmapControl.MIPMAP_NONE,             Allocation.USAGE_SCRIPT);\/*\u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u0449\u0435\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f dalvik \u0438 renderscript \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043e\u0432 *\/         mOutAllocation = Allocation.createTyped(mRS, mInAllocation.getType());         mScript = new ScriptC_mono(mRS, getResources(), R.raw.mono);\/*\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438         \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 renderscript \u043a renderscript-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 *\/          mScript.forEach_root(mInAllocation, mOutAllocation);\/*\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c renderscript-\u0444\u0443\u043d\u043a\u0446\u0438\u044e root c SMP \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0437\u043c\u043e\u043c \u0432 2 \u043f\u043e\u0442\u043e\u043a\u0430 *\/         mOutAllocation.copyTo(mBitmapOut);     }  <\/code><\/pre>\n<p>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u043c \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0434\u043b\u044f dalvik.<br \/>  <u>\u0412\u0440\u0435\u043c\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f renderscript-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b\u043e 112 \u043c\u0441\u0435\u043a.<\/u> <br \/>  \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0432\u043d\u044b\u0439 3.2x (\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b dalvik \u0438 renderscript: 353\/112 = 3,2).<br \/>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b renderscript-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 renderscript-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430, \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 renderscript \u043a \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0443 \u0438 \u0440\u0430\u0431\u043e\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 root \u0432 mono.rs. <br \/>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435: <\/b> \u041a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u043c \u043c\u0435\u0441\u0442\u043e\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0433\u043e apk \u0444\u0430\u0439\u043b\u0430. \u0412 \u044d\u0442\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 apk \u0444\u0430\u0439\u043b\u0430 \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0440\u0430\u0437\u043c\u0435\u0440 renderscript \u0432 \u0431\u0430\u0439\u0442-\u043a\u043e\u0434\u0435 (*.bc \u0444\u0430\u0439\u043b) \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 dalvik-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u043c\u0435\u0440 dalvik-\u0432\u0435\u0440\u0441\u0438\u0438 \u0431\u044b\u043b \u0440\u0430\u0432\u0435\u043d 404KB, \u0430 \u0440\u0430\u0437\u043c\u0435\u0440 renderscript-\u0432\u0435\u0440\u0441\u0438\u0438 \u0441\u0442\u0430\u043b \u0440\u0430\u0432\u0435\u043d 406KB, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 2KB \u044d\u0442\u043e renderscript \u0431\u0430\u0439\u0442-\u043a\u043e\u0434 (mono.bc). <\/p>\n<h4>3. \u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f renderscript<\/h4>\n<p>  \u0422\u0435\u043a\u0443\u0449\u0443\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c renderscript \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c, \u043e\u0442\u043a\u0430\u0437\u0430\u0432\u0448\u0438\u0441\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u0432\u0435\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438, \u0447\u0442\u043e \u043d\u0435\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u0441\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u043c\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432 renderscript \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u0440\u0430\u0433\u043c\u0443 <i>rs_fp_imprecise<\/i>:<\/p>\n<pre><code class=\"cpp\">\/\/mono.rs \/\/or our small renderscript #pragma version(1) #pragma rs java_package_name(com.example.hellocompute) #pragma rs_fp_imprecise \/\/multipliers to convert a RGB colors to black and white const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};  void root(const uchar4 *v_in, uchar4 *v_out) {   \/\/unpack a color to a float4   float4 f4 = rsUnpackColor8888(*v_in);   \/\/take the dot product of the color and the multiplier   float3 mono = dot(f4.rgb, gMonoMult);   \/\/repack the float to a color   *v_out = rsPackColorTo8888(mono); } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u044d\u0442\u043e\u0433\u043e, <u>\u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 10%\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0443 renderscript-\u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438: 112 \u043c\u0441\u0435\u043a. -&gt; 99 \u043c\u0441\u0435\u043a.<\/u><br \/>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e \u0442\u0430\u043a\u043e\u0435 \u0436\u0435 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0431\u0435\u0437 \u043a\u0430\u043a\u0438\u0445-\u043b\u0438\u0431\u043e \u0430\u0440\u0442\u0435\u0444\u0430\u043a\u0442\u043e\u0432 \u0438 \u0438\u0441\u043a\u0430\u0436\u0435\u043d\u0438\u0439.<br \/>  <b>\u0417\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0435:<\/b> \u0423 renderscript \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f run-time \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 NDK, \u0442.\u043a. \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u043d\u0443\u0442\u0440\u0438 Android \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b (x86, ARM,\u2026).<\/p>\n<h4>4. \u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b dalvik \u0438 renderscript \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439<\/h4>\n<p>  \u0418\u0441\u0441\u043b\u0435\u0434\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u043a\u0430\u043a\u0430\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u0430\u0436\u0434\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f? \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u043e\u0437\u044c\u043c\u0435\u043c 4 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c\u0438 300&#215;512, 600&#215;1024 (\u043d\u0430\u0448\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0435 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441 \u043b\u0435\u0433\u043e-\u0440\u043e\u0431\u043e\u0442\u043e\u043c), 1200&#215;1024, 1200&#215;2048 \u0438 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0437\u0430\u043c\u0435\u0440\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439. \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u043d\u0438\u0436\u0435 \u043d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u0438 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0435.<br \/>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/94e\/d59\/34f\/94ed5934ff85636923a25b7897522d28.png\"\/>  <\/p>\n<table>\n<tr>\n<td><\/td>\n<td><b>300&#215;512<\/b><\/td>\n<td><b>600&#215;1024<\/b><\/td>\n<td><b>1200&#215;1024<\/b><\/td>\n<td><b>1200&#215;2048<\/b><\/td>\n<\/tr>\n<tr>\n<td><b>dalvik<\/b><\/td>\n<td>85<\/td>\n<td>353<\/td>\n<td>744<\/td>\n<td>1411<\/td>\n<\/tr>\n<tr>\n<td><b>renderscript<\/b><\/td>\n<td>75<\/td>\n<td>99<\/td>\n<td>108<\/td>\n<td>227<\/td>\n<\/tr>\n<tr>\n<td><b>\u0432\u044b\u0438\u0433\u0440\u044b\u0448<\/b><\/td>\n<td>1.13<\/td>\n<td>3.56<\/td>\n<td>6.8<\/td>\n<td>6.2<\/td>\n<\/tr>\n<\/table>\n<p>  \u0417\u0430\u043c\u0435\u0442\u0438\u043c \u043b\u0438\u043d\u0435\u0439\u043d\u0443\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043b\u044f dalvik \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 renderscript. \u042d\u0442\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c \u043d\u0430\u043b\u0438\u0447\u0438\u0435\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 renderscript-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430. <br \/>  \u0414\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043c\u0430\u043b\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u043d\u0435\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439, \u0442.\u043a. \u0432\u0440\u0435\u043c\u044f \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 renderscript-\u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u043e\u043a\u043e\u043b\u043e 50-60 \u043c\u0441\u0435\u043a. \u041e\u0434\u043d\u0430\u043a\u043e \u043d\u0430 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043d\u0430 android-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u0445, \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 4-6x.<\/p>\n<h4>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h4>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u044b\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u044b dalvik \u0438 renderscript \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u043d\u043e\u0445\u0440\u043e\u043c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u0417\u0430 \u0441\u0447\u0435\u0442 \u0440\u0430\u0441\u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0438\u0432\u0430\u043d\u0438\u044f, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043d\u043e\u0439 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430 renderscript \u0441\u043e\u043b\u0438\u0434\u043d\u043e \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0438\u0442 dalvik \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441\u0440\u0435\u0434\u043d\u0438\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432. \u042d\u0442\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u044f \u0441\u0442\u0430\u0440\u0430\u043b\u0441\u044f \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 renderscript \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a\u043e\u043c \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e-\u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438.<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/company\/intel\/blog\/159699\/\"> http:\/\/habrahabr.ru\/company\/intel\/blog\/159699\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t<img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/717\/3ce\/47a\/7173ce47ada70c1caee84e3473a6392e.jpg\" alt=\"image\"\/><\/p>\n<p>  \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u0434\u0430\u0442\u044c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 Renderscript \u0432\u043d\u0443\u0442\u0440\u0438 Android, \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 Dalvik \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0430ndroid-\u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 \u0441 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c Intel \u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u0435\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 renderscript.<br \/>  <b>Renderscript<\/b> \u2013 \u044d\u0442\u043e API, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f 2D\/3D \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430 \u0438 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u0441 \u0432\u044b\u0441\u043e\u043a\u043e\u0439 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043b\u0438\u0431\u043e \u0437\u0430\u0434\u0430\u0447\u0443 \u0441 \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u043c\u0438 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u043c\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0434 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043e\u0431\u044a\u0435\u043c\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u0435\u0435 \u043d\u0430 \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0435 \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e \u043d\u0430 \u043c\u043d\u043e\u0433\u043e\u044f\u0434\u0435\u0440\u043d\u044b\u0445 Android-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430\u0445.<br \/>  \u0422\u0430\u043a\u0430\u044f \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u044f\u0434\u0430 dalvik \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u0432, \u0444\u0438\u0437\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c, \u043a\u043b\u0435\u0442\u043e\u0447\u043d\u043e-\u0430\u0432\u0442\u043e\u043c\u0430\u0442\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e \u0438 \u0434\u0440., \u043a\u043e\u0442\u043e\u0440\u044b\u0435, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u043d\u0435 \u043f\u043e\u0442\u0435\u0440\u044f\u044e\u0442 \u0430\u043f\u043f\u0430\u0440\u0430\u0442\u043d\u043e\u0439 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.   <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-159699","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/159699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=159699"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/159699\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}