| With the rapid development of computer technology, smart phones and smartphone operating system have been rapidly developed in recent years. Relying on thequickly update of hardware technology, it developed from performing simple staticweb browsing, camera, email and other simple tasks in original smart phone operatingsystem to undertake complex data calculations, data storage, video games and othertasks of the stage now.Among those smart phone OS, Google launched Android operating system as therepresentative of them has been an unprecedented development. With the increase ofentertainment demand on mobile devices, it has new requirements on the ability toprocess images on smart phone OS. RenderScript under Android platform couldprovide programmers an efficient parallel computing frame work for processingimages. This kind of script allows an image to be processed in parallel to improve thespeed of calculations under the limited conditions for responding users quickly.Although RenderScript programmers can make parallel optimization of theoperational efficiency, the learning process will be more difficult, grammarconstraints are more reference documentation fewer, so it makes programmingdiscouraged. The way for writing script file not only increases the difficulty of writing,but is also not conducive to the latter part of maintenance work.We look at these RenderScript inadequates and base on the principle offunctional equivalence, and focus on the transplant work to java. It treats the scriptwith equivalent position, and allows programmers to write the kernel and client codeat the same place. Further, the syntax and the type of the script have been improved tomake the transition from RenderScript to this kind of script not impinge to carry outwriting the actual code.In this paper, it briefly elaborate the research background of script transplant first,and determine the basic techniques for script transplant route and tools to use and the solution by analyzing the mechanism and characteristics, etc. Then make it clear tosolve the problems of key issues such as type, dex parsing, kernel extraction and thetranslation of binary instructions.Following the result of discussion of these issues, It was designed overall andbeen given each module design, and at the end of the article, the result of script hadbeen verified.Final conclusion: after transplantation, the degree of difficulty to writing scripthas been improved that allows programmers to write the kernel like java code underthe condition of same performance, and there are some expansion of improvementsuch as IR optimization and extension of API... |