Image processing method, processor, system on chip, electronic equipment and storage medium

By obtaining and executing pre-customized processing instructions on the processor based on the image processing request type, the problem of low image processing efficiency on processors with small computing power is solved, and the smoothness of user interaction products is improved.

CN118735762APending Publication Date: 2024-10-01DAMO (SHANGHAI) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410799477.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-19
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

When performing image processing on a processor with smaller computing power, the efficiency is low, which may cause freezes or inability to playback in user interactive products.

Method used

By implementing an image processing method on the processor, corresponding target processing instructions are obtained according to the type of image processing request, and pre-customized instructions are read from the storage device and executed to reasonably allocate processing resources and improve image processing efficiency.

Benefits of technology

It improves the efficiency of the processor when processing image processing requests, avoids inefficiency or impossibility problems caused by unreasonable resource allocation, and ensures the smoothness of user interaction products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735762A_ABST
    Figure CN118735762A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method, a processor, a system on chip, electronic equipment and a storage medium. The method is applied to a processor, and comprises the following steps: under the condition that an image processing request is received, based on a request type of the image processing request, obtaining at least one image carried by the image processing request; based on the request type of the image processing request, a target processing instruction corresponding to the request type is read from a storage device, and the target processing instruction is used for representing an instruction created for the request type in advance; and processing the at least one image by using the target processing instruction to obtain a processing result corresponding to the image processing request. According to the invention, the technical problem of low efficiency of image processing on a processor with small computing power in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of processors, and in particular, to an image processing method, a processor, a system on a chip, an electronic device, and a storage medium. Background Art

[0002] In common smart interactive products, users can interact with the interactive information displayed on the screen through touch methods such as clicking and long pressing on the screen to enrich the user's experience of using smart interactive products. However, the computing power of the processors configured in some smart interactive products is limited. When the user interacts with the interactive information on the screen, the processor may not be able to analyze and respond to the user's operations in a timely manner. The corresponding interactive content displayed to the user by the smart interactive product, such as animation display, voice response and other information may be stuck or unable to play, and the processor's ability to perform image processing is poor. Summary of the invention

[0003] The embodiments of the present application provide an image processing method, a processor, a system on chip, an electronic device and a storage medium to at least solve the technical problem of low efficiency of image processing on a processor with less computing power in the related art.

[0004] According to one aspect of an embodiment of the present application, there is provided an image processing method, which is applied to a processor, and includes: upon receiving an image processing request, based on the request type of the image processing request, obtaining at least one image carried by the image processing request; based on the request type of the image processing request, reading a target processing instruction corresponding to the request type from a storage device, wherein the target processing instruction is used to represent an instruction pre-created for the request type; and processing at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request.

[0005] According to one aspect of an embodiment of the present application, there is also provided an image processing method, which is applied to a processor, and includes: upon receiving an image processing request for a video frame in a video, based on the request type of the image processing request, obtaining at least one video frame carried by the image processing request; based on the request type of the image processing request, reading a target processing instruction corresponding to the request type from a storage device, wherein the target processing instruction is used to represent an instruction created in advance for the request type; and processing at least one video frame using the target processing instruction to obtain a processing result corresponding to the image processing request.

[0006] According to one aspect of an embodiment of the present application, there is also provided an image processing device, which is applied to a processor and includes: an image acquisition module, which is used to acquire at least one image carried by the image processing request based on the request type of the image processing request when an image processing request is received; an instruction reading module, which is used to read a target processing instruction corresponding to the request type from a storage device based on the request type of the image processing request, wherein the target processing instruction is used to represent an instruction created in advance for the request type; and an image processing module, which is used to process at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request.

[0007] According to one aspect of an embodiment of the present application, there is also provided an image processing device, which is applied to a processor and includes: a video frame acquisition module, which is used to obtain at least one video frame carried by the image processing request based on the request type of the image processing request when a request for image processing of a video frame in a video is received; a processing instruction reading module, which is used to read a target processing instruction corresponding to the request type from a storage device based on the request type of the image processing request, wherein the target processing instruction is used to represent an instruction created in advance for the request type; and a video frame processing module, which is used to process at least one video frame using the target processing instruction to obtain a processing result corresponding to the image processing request.

[0008] According to one aspect of an embodiment of the present application, a processor is also provided, including: a storage module for storing instructions created in advance for different request types; a processing unit connected to the storage module, and used to, when receiving an image processing request, obtain at least one image carried by the image processing request based on the request type of the image processing request, read out a target processing instruction corresponding to the request type from the storage module based on the request type of the image processing request, and use the target processing instruction to process at least one image to obtain a processing result corresponding to the image processing request, wherein the target processing instruction is used to represent the instruction created in advance for the request type.

[0009] According to one aspect of an embodiment of the present application, a system on chip is also provided, including: a storage device for storing instructions pre-created for different request types; a processor, connected to the storage device, and used to, when receiving an image processing request, obtain at least one image carried by the image processing request based on the request type of the image processing request, read out a target processing instruction corresponding to the request type from the storage device based on the request type of the image processing request, and use the target processing instruction to process at least one image to obtain a processing result corresponding to the image processing request, wherein the target processing instruction is used to represent the instruction pre-created for the request type.

[0010] According to another aspect of the embodiments of the present application, an electronic device is further provided, including: a memory storing an executable program; and a processor for running the program, wherein the method of each embodiment of the present application is executed when the program is running.

[0011] According to another aspect of an embodiment of the present application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in each embodiment of the present application.

[0012] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.

[0013] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present application is implemented.

[0014] According to another aspect of the embodiments of the present application, a computer program is also provided, and when the computer program is executed by a processor, the methods in the various embodiments of the present application are implemented.

[0015] In an embodiment of the present application, when an image processing request is received, based on the request type of the image processing request, at least one image carried by the image processing request is obtained; based on the request type of the image processing request, a target processing instruction corresponding to the request type is read from a storage device; at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request. Different processing instructions are customized for different request types of image processing requests in advance on the basis that the processor can run smoothly, and then when the image processing request is received, the target processing instruction matching the request type of the image processing request is determined from the customized processing instructions, and finally the processor is used to execute the target processing instruction to implement the corresponding image processing request to obtain the corresponding processing result. This can ensure that the processor can reasonably allocate existing processing resources according to the pre-customized target processing instruction when implementing the image processing request, avoiding the situation where the image processing request is implemented inefficiently or even cannot be implemented due to unreasonable allocation of processing resources, thereby improving the efficiency of the processor in implementing the image processing request, and further solving the technical problem of low efficiency of image processing on a processor with less computing power in the related art.

[0016] It is easy to notice that the above general description and the following detailed description are only for the purpose of exemplifying and explaining the present application, and do not constitute a limitation of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 It is a hardware structure block diagram of a RISC-V system for implementing an image processing method according to Embodiment 1 of the present application;

[0019] Figure 2 is a schematic diagram of a RISC-V architecture system on chip according to Embodiment 1 of the present application;

[0020] Figure 3 is a flowchart of an image processing method according to Embodiment 1 of the present application;

[0021] Figure 4 is a flowchart of an image processing method according to Embodiment 2 of the present application;

[0022] Figure 5 is a schematic diagram of an image processing device according to Embodiment 3 of the present application;

[0023] Figure 6 is a schematic diagram of an image processing device according to Embodiment 4 of the present application;

[0024] Figure 7 is a schematic diagram of a processor according to Embodiment 5 of the present application;

[0025] Figure 8 is a schematic diagram of a system on a chip according to Embodiment 6 of the present application;

[0026] Fig. 9 It is a structural block diagram of an electronic device shown in Example 7 of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0030] Transparency: It can refer to the opacity or coverage of pixels in an image or element, usually represented by the Alpha channel. The value of the Alpha channel can be selected between 0-1, or between 0-225. The larger the Alpha value, the higher the corresponding opacity.

[0031] Image blending: refers to the way different colors or pixels are blended in an image. Common image blending modes include: overlay, soften, color dodge, color darken, color blend, etc.

[0032] Image fill: refers to filling different colors in the image.

[0033] RVV: Vector instruction set of Risc-v architecture.

[0034] Instruction customization: When designing a processor, specific instructions are specified to allow the processor to complete a specific computing process.

[0035] Example 1

[0036] According to an embodiment of the present application, an image processing method applied to a processor is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0037] The method embodiment provided in Embodiment 1 of the present application can be executed in a RISC-V system, a RISC-V chip or a similar device. Figure 1 1 is a hardware structure block diagram of a RISC-V system for implementing an image processing method according to Embodiment 1 of the present application. Figure 1As shown, the RISC-V system 100 can be divided from the bottom layer to the upper layer into a reduced instruction set architecture 101 (including a basic instruction set 101-1 and an extended instruction set 101-2), a hardware layer 102 (including a processor 102-1, a peripheral hardware circuit 102-2, etc.), an interface layer 103, an operating system layer 104 (supporting multiple operating systems 104-1, 104-2, ..., 104-n, such as Linux, FreeSBD, RT-Tread, etc.), a middleware and library layer 105 (including a system library 105-1, an API 105-2 and a middleware service 105-3) and an application layer 106 (including multiple user programs and services 106-1, 106-2, ..., 106-n). The RISC-V system 100 also includes a tool chain 107 from the underlying hardware to the application layer, which may include a compiler and assembler 107-1, a linker 107-2, a debugger 107-3, a simulator and emulator 107-4, an integrated development environment 107-5, a hardware description language tool 107-6, a performance analysis tool 107-7 and a version control system 107-8, etc.

[0038] The instruction set architecture 101 defines the basic operations and instruction sets supported by the processor 102-1, including a basic instruction set and an extended instruction set, wherein the basic instruction set represents a basic integer instruction set, such as RV32I and RV64I, and the extended instruction set can be floating point, atomic operations, compressed instructions, etc.

[0039] The interface layer 103 includes the specific design of the processor, such as pipeline design, cache structure, execution unit, branch prediction, etc. This layer is the process of mapping abstract instructions to physical hardware.

[0040] The operating system layer 104 is located at the hardware level and provides a hardware abstraction layer and management mechanism, so that applications can interact with the hardware through system calls. The operating system is responsible for managing processor resources, memory, device drivers, task scheduling, etc.

[0041] The middleware and library layer 105 provides a rich set of services and interfaces to help applications run more efficiently. For example, the standard library provides functions such as file operations and mathematical calculations, while the middleware can provide complex services such as network communications and graphical user interfaces.

[0042] The application layer 106 uses the functions and services provided by the lower layer to implement specific application logic. These applications can be command line tools, graphical interface applications, server-side services, etc.

[0043] The tool chain 107 is a key component that connects the underlying hardware to the upper-level software. Various tools in the tool chain 107 function at different levels to support the entire process from hardware design to software development, ensuring the consistency and effectiveness of the entire system design.

[0044] It should be noted that the layered design of the RISC-V architecture allows decoupling between different layers, so that each layer can be developed and optimized independently.

[0045] In an optional embodiment, Figure 2 1 is a schematic diagram of a RISC-V architecture system on chip according to Embodiment 1 of the present application. Figure 2 As shown, the system on chip SOC (System On Chip, SOC) includes at least one RISC-V core 202 (only one is shown in the figure), and the RISC-V core 202 is connected to peripheral devices through a bus 204, including but not limited to ROM 206, RAM 208, timer 210, UART (Universal Asynchronous Receiver / Transmitter) 212, GPIO (General Purpose Input / Output) 214, SPI (Serial Peripheral Interface Bus) 216, etc.

[0046] Under the above operating environment, this application provides Figure 3 The image processing method shown. Figure 3 is a flowchart of an image processing method according to Embodiment 1 of the present application, such as Figure 3 As shown, the method comprises the following steps:

[0047] Step S302: upon receiving an image processing request, obtaining at least one image carried in the image processing request based on the request type of the image processing request.

[0048] The above-mentioned image processing request may refer to a request that needs to be implemented on the processor of the local device, and can be used to process the image output by the local device, such as image enhancement, image mixing, image segmentation, etc. Different image processing requests may target different processing objects. For example, when enhancing an image, the processing object may only include the original image, and when mixing an image, the processing object may include the original image and the target image for mixing, etc.

[0049] In an optional scheme of the present embodiment, it is considered that different image processing requests usually include multiple different request types, for example, the above-mentioned image enhancement type, image mixing type, image segmentation type and other request types, and the processing resources invested by the processor for image processing requests of different request types may be different. In addition, it is considered that the image processing request may include sub-requests of multiple different request types. In the process of the processor implementing the image processing request, different sub-requests may correspond to different processing stages. For example, assuming that the received image processing request includes a first sub-request for image segmentation, a second sub-request for enhancing the segmented image, and a third sub-request for mixing the enhanced image, when the processor implements the image processing request, the processor may first implement the first sub-request, then implement the second sub-request, and finally implement the third sub-request. The corresponding process of the processor implementing the image processing request is divided into three stages. In addition, considering that the objects processed by the processor at different stages may be different, the corresponding processing resources invested are also May be different. Therefore, in order to reduce the processing resources invested by the processor in implementing the image processing request, the processor can allocate reasonable processing resources to different image processing requests in the processor according to the request type of the image processing request, so as to improve the efficiency and success rate of the processor in implementing the image processing request. Based on this, when using the processor for image processing, the processor can first determine the request type of the image processing request when receiving the image processing request, and then obtain at least one image carried by the image processing request according to the request type, so as to allocate reasonable processing resources to the image processing request in a targeted manner. For example, if the request type is to segment the image, then the corresponding at least one image obtained can at least include the original image that currently needs to be segmented. At this time, the processor can focus on segmenting the image; if the request type is to mix the image, then the corresponding at least one image obtained can include the original image that currently needs to be mixed, and the target image used to mix the original image, such as superimposed on the original image. At this time, the processor can focus on mixing the image.

[0050] Step S304: based on the request type of the image processing request, read the target processing instruction corresponding to the request type from the storage device.

[0051] The target processing instruction is used to represent an instruction created in advance for a request type.

[0052] The target processing instruction may refer to a processing instruction executed on a processor, customized for different request types, and may be an instruction in an RVV instruction set, an instruction for implementing an image processing request. For example, if the received image processing request is an image segmentation request, the corresponding target processing instruction may be an instruction for segmenting an image; if the received image processing request is an image blending request, the corresponding target processing instruction may be an instruction for blending an image. The storage device may refer to a device for storing target processing instructions.

[0053] In an optional solution of this embodiment, considering that the computing power of different processors may be different, a processor with lower computing power may have less processing resources to allocate, resulting in slow processing efficiency or even processing failure when implementing the instructions contained in the image processing request. Therefore, the processor can pre-construct multiple processing instructions that can be successfully executed under the existing processing resources of the processor according to the processing power of the processor, such as the processing resources currently available to the processor, and different request types, and store the constructed multiple processing instructions in the above-mentioned storage device. After the processor determines the request type of the currently received image processing request, it can obtain the processing instruction matching the request type from the above-mentioned storage device as the above-mentioned target processing instruction, so that when the processor executes the target processing instruction, it can implement the operation of executing the image processing request of the request type corresponding to the target processing instruction.

[0054] In an optional scheme of the present embodiment, considering that in the same type of image processing request, the processing parameters used may be different, for example, the segmentation method, segmentation position and other parameters used in image segmentation may be different, or the mixing method, mixing object and other parameters used in image mixing may also be different. Therefore, when constructing processing instructions corresponding to different request types, the corresponding constructed processing instructions can be a processing framework. The key parameters in the processing instructions, such as the segmentation method, segmentation position and other parameters, can be preset values. When the processor obtains the target processing instruction corresponding to the request type, it can first obtain the corresponding processing instruction and the specific processing parameters included in the image processing request, and then use the specific processing parameters to adjust the processing instruction to obtain the corresponding target processing instruction, thereby avoiding the situation where the processing parameters contained in the obtained target processing instruction do not match the processing parameters contained in the image processing request, resulting in the execution of the target processing instruction failing to realize the image processing request.

[0055] Step S306: Process at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request.

[0056] In an optional scheme of this embodiment, after obtaining the target processing instruction corresponding to the request type from the storage device, the processor can control the processor to execute the target processing instruction to implement the operation of processing the at least one image obtained above according to the corresponding image processing request, thereby obtaining the processing result corresponding to the image processing request.

[0057] In the above embodiments of the present application, the processor adopts a reduced instruction set architecture.

[0058] In an optional solution of this embodiment, the architecture used by the processor may refer to a reduced instruction set architecture.

[0059] Through the technical solution of the present application, corresponding target processing instructions are first generated according to the image processing actions corresponding to different types of image processing requests, and complex image processing processes, such as synthesizing multiple pixel points contained in different images to achieve image synthesis, image registration and other operations, are simplified and encapsulated into a single image processing instruction. When the processor executes the corresponding image processing action, it can directly run the corresponding single image processing execution to quickly process the multiple pixel points contained in the image in parallel, thereby shortening the calculation time for identifying and analyzing the image processing instructions, reducing the memory occupancy of the processor, and effectively improving the efficiency of the processor in executing image processing actions.

[0060] In an embodiment of the present application, when an image processing request is received, based on the request type of the image processing request, at least one image carried by the image processing request is obtained; based on the request type of the image processing request, a target processing instruction corresponding to the request type is read from a storage device; at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request. Different processing instructions are customized for different request types of image processing requests in advance on the basis that the processor can run smoothly, and then when the image processing request is received, the target processing instruction matching the request type of the image processing request is determined from the customized processing instructions, and finally the processor is used to execute the target processing instruction to implement the corresponding image processing request to obtain the corresponding processing result. This can ensure that the processor can reasonably allocate existing processing resources according to the pre-customized target processing instruction when implementing the image processing request, avoiding the situation where the image processing request is implemented inefficiently or even cannot be implemented due to unreasonable allocation of processing resources, thereby improving the efficiency of the processor in implementing the image processing request, and further solving the technical problem of low efficiency of image processing on a processor with less computing power in the related art.

[0061] In the above embodiment of the present application, based on the request type of the image processing request, at least one image carried by the image processing request is obtained, including: when the request type of the image processing request is image mixing, multiple images carried by the image processing request are obtained to obtain at least one image, wherein the image processing request is used to request image mixing of multiple images; when the request type of the image processing request is image filling, the image to be filled and the filling color carried by the image processing request are obtained to obtain at least one image, wherein the image processing request is used to request to fill the image to be filled with the filling color; when the request type of the image processing request is image-text mixing, the image to be mixed, the mixed color and the mixed text carried by the image processing request are obtained to obtain at least one image, wherein the image processing request is used to request to mix the image to be mixed and the mixed text with the mixed color.

[0062] In an optional scheme of the present embodiment, the request types of the image processing requests received by the processor may include but are not limited to: image mixing, image filling, image-text mixing, etc., wherein image mixing may refer to mixing multiple images, such as image overlay, image stitching, etc., image filling may refer to the operation of filling the image to be filled with a selected texture or color, and image-text mixing may refer to the operation of mixing the image to be mixed and the text to be mixed with a selected mixing color.

[0063] When the request type is image mixing, the processor can analyze the image processing request, determine the mixed image that currently needs to be mixed, and then determine the mixed image from the multiple images carried by the image processing request to obtain at least one of the above-mentioned images; when the request type is image filling, the processor can analyze the image processing request, determine the image to be filled that currently needs to be filled, and the filling color used to fill the image to be filled, and then obtain the image to be filled and the filling color from the multiple images carried by the image processing request to obtain at least one of the above-mentioned images; when the request type is image and text mixing, the processor can analyze the image processing request, determine the image to be mixed and the text to be mixed that currently need to be mixed, and the color to be mixed used to mix the two objects, and then obtain the image to be mixed, the text to be mixed and the color to be mixed from the multiple images carried by the image processing request to obtain at least one of the above-mentioned images.

[0064] In the above-mentioned embodiment of the present application, based on the request type of the image processing request, the target processing instruction corresponding to the request type is read from the storage device, including: when the request type of the image processing request is image mixing, a single image mixing instruction is read from the storage device to obtain the target processing instruction; when the request type of the image processing request is image filling, a single image filling instruction is read from the storage device to obtain the target processing instruction; when the request type of the image processing request is image and text mixing, a single image and text mixing instruction is read from the storage device to obtain the target processing instruction.

[0065] In an optional scheme of this embodiment, corresponding to the above-mentioned multiple request instructions, the pre-constructed processing instructions for implementing the image processing requests may include but are not limited to: image mixing instructions for image mixing, image filling instructions for image filling, image-text mixing instructions for image-text mixing, etc.

[0066] When the request type is image mixing, the processor can read a single image mixing instruction from the storage device as the above-mentioned target processing instruction; when the request type is image filling, the processor can read a single image filling instruction from the storage device as the above-mentioned target processing instruction; when the request type is image and text mixing, the processor can read a single image and text mixing instruction from the storage device as the above-mentioned target processing instruction. Considering that the processing parameters contained in the pre-built processing instruction may be different from the parameters contained in the image processing request, as shown above, the processor can also determine the specific processing parameters from the image processing request, and use the determined processing parameters to update the processing parameters contained in the processing instruction to obtain the above-mentioned target processing instruction.

[0067] In the above embodiment of the present application, when the target processing instruction is a single image mixing instruction, at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request, including: determining a first transparency corresponding to the single image mixing instruction; obtaining the product of the first transparency and a first image among multiple images to obtain a first mixed product; obtaining the product of the first inverse transparency and a second image among multiple images to obtain a second mixed product, wherein the first inverse transparency is used to characterize the difference between a preset value and the first transparency; obtaining the sum of the first mixed product and the second mixed product to obtain a processing result.

[0068] The first image and the second image may refer to images that currently need to be mixed, and the processor may mix the first image and the second image together to implement an image mixing operation. The first transparency may refer to the transparency that the first image needs to maintain when mixing the first image and the second image. The first inverse transparency may refer to the transparency used to adjust the current transparency of the second image. The sum of the first transparency and the first inverse transparency is a preset value, and the preset value may be a value in the transparency range of the image. For example, assuming that the transparency range is set to [0, 1], 0 represents that the image is completely transparent, and 1 represents that the image is completely opaque, then the preset value may be between 0-1.

[0069] In an optional scheme of the present embodiment, when the target processing instruction is a single image mixing instruction, when processing at least one acquired image, the processor may first determine the first transparency corresponding to the single mixing instruction, and determine the above-mentioned first reverse transparency according to the difference between the preset value and the first transparency, and then use the first transparency to adjust the first image, and obtain the above-mentioned first mixed product according to the product of the first transparency and the first image. At the same time, the second image is adjusted according to the first reverse transparency, and the second mixed image is obtained according to the product of the first reverse transparency and the second image. Finally, the first mixed product and the second mixed product are added, for example, the adjusted first image is superimposed on the adjusted second image, so as to obtain an image after the first image and the second image are mixed, that is, the above-mentioned processing result is obtained, so that the transparency of the obtained processing result is maintained at the preset value, so as to realize the operation of mixing the first image and the second image in the image processing request.

[0070] In the above embodiments of the present application, the first transparency is the transparency carried by the image processing request, or the value of the transparency channel of the first image.

[0071] In an optional scheme of the present embodiment, the above-mentioned first transparency can be the transparency of the first image itself, that is, the value of the first image on the transparency channel, or it can be the transparency carried by the image processing request, for example, it can be the transparency manually entered by the user, or it can be the transparency automatically generated by the device that generates the image processing request according to the historical generation record, which is not limited here.

[0072] Based on this, if the first transparency is the transparency carried by the image processing request, the corresponding formula for determining the processing result may be:

[0073] p_dest=p_srcA*alpha+p_srcB*(1-alpha).

[0074] Among them, p_dest represents the processing result, p_srcA represents the first image, alpha represents the transparency carried by the image processing request, and p_srcB represents the second image.

[0075] If the first transparency is the transparency of the first image itself, the corresponding formula for determining the processing result may be:

[0076] p_dest=p_srcA*p_srcA.alpha+p_srcB*(1-p_srcA.alpha).

[0077] Among them, p_srcA.alpha represents the transparency of the first image itself.

[0078] In the above embodiment of the present application, when the target processing instruction is a single image fill instruction, at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request, including: obtaining the value of the transparency channel of the filling color to obtain a second transparency; obtaining the product of the second transparency and the filling color to obtain a first filling product; obtaining the product of the second inverse transparency and the image to be filled to obtain a second filling product, wherein the second inverse transparency is used to characterize the difference between the preset value and the second transparency; obtaining the sum of the first filling product and the second filling product to obtain a processing result.

[0079] The second transparency may refer to the transparency that the fill color needs to maintain when mixing the image to be mixed and the image to be filled. The second inverse transparency may refer to the transparency used to adjust the current transparency of the image to be filled, and the second transparency and the second transparency may also be the same. Similarly, the second transparency may be the transparency carried by the image processing request, or the value of the transparency channel of the fill color.

[0080] In an optional scheme of the present embodiment, when the target processing instruction is a single image filling instruction, when processing at least one acquired image, the processor can obtain the value of the transparency channel of the filling color as the above-mentioned second transparency, and obtain the above-mentioned second inverse transparency according to the product of the preset value and the second transparency, and then use the second transparency to adjust the filling color, and obtain the above-mentioned first filling product according to the product of the second transparency and the second image, and use the second inverse transparency to adjust the image to be filled, and obtain the above-mentioned second filling product according to the product of the second inverse transparency and the image to be filled. Finally, by adding the first filling product and the second filling product, the image after filling the image to be filled with the filling color can be obtained, that is, the above-mentioned processing result is obtained.

[0081] The corresponding formula for image filling can be:

[0082] p_dest=color1*color.alpha+p_srcC*(1-color.alpha).

[0083] Among them, color1 represents the fill color, color.alpha represents the value of the transparency channel of the fill color, and p_srcC represents the image to be filled.

[0084] In the above embodiment of the present application, when the target processing instruction is a single graphic and text mixing instruction, at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request, including: determining the mask data corresponding to the mixed text, wherein the mask data is used to characterize the font of the mixed text; obtaining the product of the mixed color and the mask data to obtain a third mixed product; obtaining the product of the inverse mask data and the image to be processed to obtain a fourth mixed product; obtaining the sum of the third mixed product and the fourth mixed product to obtain a processing result.

[0085] In an optional scheme of the present embodiment, when the target processing instruction is a single graphic and text mixing instruction, when processing at least one acquired image, the processor can first determine the mask data corresponding to the font contained in the mixed text, and multiply the mask data with the mixed color to obtain the above-mentioned third mixed product, and then negate the mask data to obtain the above-mentioned reverse mask data, and multiply the reverse mask data with the image to be processed to obtain the above-mentioned fourth mixed product, and finally add the third mixed product and the fourth mixed product to obtain the image after the mixed color, mixed text and the image to be processed are mixed, that is, the above-mentioned processing result.

[0086] The corresponding formula for mixing images and text can be:

[0087] p_dest=color2*mask+p_srcD*(1-mask).

[0088] Among them, color2 represents the mixed color, mask represents the mask data of the mixed text, which can be a text font, and p_srcD represents the image to be processed.

[0089] In the above embodiment of the present application, after obtaining at least one image carried by the image processing request, the method also includes: storing the at least one image in at least one register; after processing the at least one image using the target processing instruction to obtain the processing result corresponding to the image processing request, the method also includes: storing the processing result in at least one register.

[0090] In an optional scheme of this embodiment, in order to facilitate viewing the association between different original images and processing results in an image processing request, the processor can also store the image value in at least one register after acquiring at least one image, and after obtaining the processing result corresponding to the image processing request, store the processing result in at least one register.

[0091] For example, assuming that there are currently registers v0, v1, and a0, p_srcA, p_srcC, p_srcD, and p_dest can be stored in v0, p_srcB and mask can be stored in v1, and alpha, color1, color.alpha, and color2 can be stored in a0.

[0092] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0093] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0094] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0095] Example 2

[0096] According to an embodiment of the present application, an image processing method is also provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0097] Figure 4 is a flow chart of an image processing method according to Embodiment 2 of the present application, such as Figure 4 As shown, the method may include the following steps:

[0098] Step S402: upon receiving a request for performing image processing on a video frame in a video, obtaining at least one video frame carried in the image processing request based on the request type of the image processing request.

[0099] The above-mentioned image processing request may refer to a request that needs to be implemented on a processor of a local device for a video frame in a video, such as a request to enhance a picture played by a video, to capture a partial area in a video, and the like.

[0100] In an optional scheme of the present embodiment, in order to reduce the processing resources invested by the processor in implementing an image processing request, the processor can, when using the processor for image processing, first determine the request type of the image processing request when receiving an image processing request for a video frame in a video, and then, based on the request type, obtain at least one image carried by the image processing request, so as to allocate reasonable processing resources for the image processing request in a targeted manner.

[0101] Step S404: based on the request type of the image processing request, read the target processing instruction corresponding to the request type from the storage device.

[0102] The target processing instruction is used to represent an instruction created in advance for a request type.

[0103] In an optional solution of this embodiment, the processor can pre-construct multiple processing instructions that can be successfully executed under the existing processing resources of the processor according to the processing capability of the processor, such as the processing resources currently available to the processor, and different request types, and store the constructed multiple processing instructions in the above-mentioned storage device. After the processor determines the request type of the currently received image processing request, it can obtain the processing instruction matching the request type from the above-mentioned storage device as the above-mentioned target processing instruction.

[0104] Step S406: Process at least one video frame using the target processing instruction to obtain a processing result corresponding to the image processing request.

[0105] In an optional scheme of this embodiment, after obtaining the target processing instruction corresponding to the request type from the storage device, the processor can control the processor to execute the target processing instruction to implement the operation of processing the at least one video frame obtained above according to the corresponding image processing request, thereby obtaining the processing result corresponding to the image processing request.

[0106] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0107] Example 3

[0108] According to an embodiment of the present application, a video processing device for implementing the above-mentioned image processing method is also provided, and the device can be deployed in an electronic device. Figure 5 is a schematic diagram of an image processing device according to Embodiment 3 of the present application. Figure 5 As shown, the device 500 includes: an image acquisition module 502 , an instruction reading module 504 and an image processing module 506 .

[0109] Among them, the image acquisition module 502 is used to obtain at least one image carried by the image processing request based on the request type of the image processing request when an image processing request is received; the instruction reading module 504 is used to read the target processing instruction corresponding to the request type from the storage device based on the request type of the image processing request, wherein the target processing instruction is used to represent the instruction created in advance for the request type; the image processing module 506 is used to process at least one image using the target processing instruction to obtain the processing result corresponding to the image processing request.

[0110] In the above embodiment of the present application, the image acquisition module 502 includes: a first acquisition unit, which is used to acquire multiple images carried by the image processing request when the request type of the image processing request is image mixing, and obtain at least one image, wherein the image processing request is used to request image mixing of multiple images; a second acquisition unit, which is used to acquire the image to be filled and the filling color carried by the image processing request when the request type of the image processing request is image filling, and obtain at least one image, wherein the image processing request is used to request to fill the image to be filled with the filling color; a third acquisition unit, which is used to acquire the image to be mixed, the mixed color and the mixed text carried by the image processing request when the request type of the image processing request is image and text mixing, and obtain at least one image, wherein the image processing request is used to request to mix the image to be mixed and the mixed text with the mixed color.

[0111] In the above embodiment of the present application, the instruction reading module 504 includes: a first reading unit, which is used to read a single image mixing instruction from a storage device to obtain a target processing instruction when the request type of the image processing request is image mixing; a second reading unit, which is used to read a single image filling instruction from a storage device to obtain a target processing instruction when the request type of the image processing request is image filling; a third reading unit, which is used to read a single image-text mixing instruction from a storage device to obtain a target processing instruction when the request type of the image processing request is image-text mixing.

[0112] In the above embodiment of the present application, the image processing module 506 is also used to: determine the first transparency corresponding to the single image mixing instruction; obtain the product of the first transparency and the first image among the multiple images to obtain a first mixed product; obtain the product of the first inverse transparency and the second image among the multiple images to obtain a second mixed product, wherein the first inverse transparency is used to characterize the difference between the preset value and the first transparency; obtain the sum of the first mixed product and the second mixed product to obtain a processing result.

[0113] In the above embodiments of the present application, the first transparency is the transparency carried by the image processing request, or the value of the transparency channel of the first image.

[0114] In the above embodiment of the present application, the image processing module 506 is also used to: obtain the value of the transparency channel of the filling color to obtain a second transparency; obtain the product of the second transparency and the filling color to obtain a first filling product; obtain the product of the second inverse transparency and the image to be filled to obtain a second filling product, wherein the second inverse transparency is used to characterize the difference between the preset value and the second transparency; obtain the sum of the first filling product and the second filling product to obtain a processing result.

[0115] In the above embodiment of the present application, the image processing module 506 is also used to: determine the mask data corresponding to the mixed text, wherein the mask data is used to characterize the font of the mixed text; obtain the product of the mixed color and the mask data to obtain a third mixed product; obtain the product of the inverse mask data and the image to be processed to obtain a fourth mixed product; obtain the sum of the third mixed product and the fourth mixed product to obtain a processing result.

[0116] In the above embodiment of the present application, the above device also includes: a first storage module, used to store at least one image in at least one register; and a second storage module, used to store the processing result in at least one register.

[0117] In the above embodiments of the present application, the processor adopts a reduced instruction set architecture.

[0118] It should be noted that the above-mentioned image acquisition module 502, instruction reading module 504 and image processing module 506 correspond to steps S302 to S306 in Example 1, and the three modules and corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may be run in the server 10 provided in Example 1.

[0119] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0120] Example 4

[0121] According to an embodiment of the present application, a video processing device for implementing the above-mentioned image processing method is also provided, and the device can be deployed in an electronic device. Figure 6 is a schematic diagram of an image processing device according to Embodiment 4 of the present application. Figure 6 As shown, the device 600 includes: a video frame acquisition module 602 , a processing instruction reading module 604 and a video frame processing module 606 .

[0122] Among them, the video frame acquisition module 602 is used to obtain at least one video frame carried by the image processing request based on the request type of the image processing request when receiving an image processing request for a video frame in a video; the processing instruction reading module 604 is used to read the target processing instruction corresponding to the request type from the storage device based on the request type of the image processing request, wherein the target processing instruction is used to represent the instruction created in advance for the request type; the video frame processing module 606 is used to process at least one video frame using the target processing instruction to obtain the processing result corresponding to the image processing request.

[0123] It should be noted that the video frame acquisition module 602, the processing instruction reading module 604 and the video frame processing module 606 correspond to steps S402 to S406 in Example 2, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules or units may be hardware components or software components stored in a memory and processed by one or more processors, and the above-mentioned modules may also be part of the device and may be run in the server 10 provided in Example 1.

[0124] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0125] Example 5

[0126] According to one aspect of the embodiments of the present application, a processor is also provided. Figure 7 is a schematic diagram of a processor according to Embodiment 5 of the present application, such as Figure 7 As shown, the processor includes: a storage module 702 and a processing unit 704.

[0127] Among them, the storage module 702 is used to store instructions created in advance for different request types; the processing unit 704 is connected to the storage module 702, and is used to, when receiving an image processing request, obtain at least one image carried by the image processing request based on the request type of the image processing request, read out the target processing instruction corresponding to the request type from the storage module based on the request type of the image processing request, and use the target processing instruction to process at least one image to obtain the processing result corresponding to the image processing request, wherein the target processing instruction is used to represent the instruction created in advance for the request type.

[0128] Example 6

[0129] According to one aspect of the embodiments of the present application, a system on chip is also provided. Figure 8 is a schematic diagram of a system on chip according to Embodiment 6 of the present application, such as Figure 8 As shown, the system on chip includes: a storage device 802 and a processor 804 .

[0130] Among them, the storage device 802 is used to store instructions created in advance for different request types; the processor 804 is connected to the storage device 802, and is used to, when receiving an image processing request, obtain at least one image carried by the image processing request based on the request type of the image processing request, read out the target processing instruction corresponding to the request type from the storage device based on the request type of the image processing request, and use the target processing instruction to process at least one image to obtain the processing result corresponding to the image processing request, wherein the target processing instruction is used to represent the instruction created in advance for the request type.

[0131] Example 7

[0132] The embodiment of the present application may provide an electronic device, which may be any electronic device in a group of electronic devices. Optionally, in this embodiment, the electronic device may also be replaced by a terminal device such as a mobile terminal.

[0133] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.

[0134] In this embodiment, the electronic device can execute the program code in the method.

[0135] Optionally, Fig. 9 is a structural block diagram of an electronic device according to Embodiment 7 of the present application. Fig. 9 As shown, the electronic device A may include: one or more (only one is shown in the figure) processors 902, a memory 904, a storage controller, and a peripheral interface, wherein the peripheral interface is connected to a radio frequency module, an audio module, and a display.

[0136] Among them, the memory can be used to store software programs and modules, such as program instructions / modules corresponding to the methods and devices in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, that is, implementing the methods in the above embodiments. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal A via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0137] The processor can call the information and application stored in the memory through the transmission device to perform the following steps: when receiving an image processing request, based on the request type of the image processing request, obtain at least one image carried by the image processing request; based on the request type of the image processing request, read out the target processing instruction corresponding to the request type from the storage device, wherein the target processing instruction is used to represent the instruction created in advance for the request type; and use the target processing instruction to process at least one image to obtain a processing result corresponding to the image processing request.

[0138] Optionally, the processor may also execute the program code of the following steps: when the request type of the image processing request is image mixing, obtaining multiple images carried by the image processing request to obtain at least one image, wherein the image processing request is used to request image mixing of the multiple images; when the request type of the image processing request is image filling, obtaining the image to be filled and the filling color carried by the image processing request to obtain at least one image, wherein the image processing request is used to request to fill the image to be filled with the filling color; when the request type of the image processing request is image-text mixing, obtaining the image to be mixed, the mixed color and the mixed text carried by the image processing request to obtain at least one image, wherein the image processing request is used to request to mix the image to be mixed and the mixed text with the mixed color.

[0139] Optionally, the processor may also execute the program code of the following steps: when the request type of the image processing request is image mixing, a single image mixing instruction is read from the storage device to obtain a target processing instruction; when the request type of the image processing request is image filling, a single image filling instruction is read from the storage device to obtain a target processing instruction; when the request type of the image processing request is image and text mixing, a single image and text mixing instruction is read from the storage device to obtain a target processing instruction.

[0140] Optionally, the processor may also execute the program code of the following steps: determining a first transparency corresponding to a single image mixing instruction; obtaining the product of the first transparency and a first image among multiple images to obtain a first mixed product; obtaining the product of the first inverse transparency and a second image among multiple images to obtain a second mixed product, wherein the first inverse transparency is used to characterize the difference between a preset value and the first transparency; obtaining the sum of the first mixed product and the second mixed product to obtain a processing result.

[0141] Optionally, the first transparency is the transparency carried in the image processing request, or the value of a transparency channel of the first image.

[0142] Optionally, the processor may also execute the following program code steps: obtaining the value of the transparency channel of the filling color to obtain a second transparency; obtaining the product of the second transparency and the filling color to obtain a first filling product; obtaining the product of the second inverse transparency and the image to be filled to obtain a second filling product, wherein the second inverse transparency is used to characterize the difference between the preset value and the second transparency; obtaining the sum of the first filling product and the second filling product to obtain a processing result.

[0143] Optionally, the processor may also execute the program code of the following steps: determining the mask data corresponding to the mixed text, wherein the mask data is used to characterize the font of the mixed text; obtaining the product of the mixed color and the mask data to obtain a third mixed product; obtaining the product of the inverse mask data and the image to be processed to obtain a fourth mixed product; obtaining the sum of the third mixed product and the fourth mixed product to obtain a processing result.

[0144] Optionally, the processor may also execute the program code of the following steps: after acquiring at least one image carried by an image processing request, storing the at least one image in at least one register; after processing the at least one image using a target processing instruction and obtaining a processing result corresponding to the image processing request, storing the processing result in at least one register.

[0145] Optionally, the processor adopts a reduced instruction set architecture.

[0146] In an embodiment of the present application, when an image processing request is received, based on the request type of the image processing request, at least one image carried by the image processing request is obtained; based on the request type of the image processing request, a target processing instruction corresponding to the request type is read from a storage device; at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request. Different processing instructions are customized for different request types of image processing requests on the basis that the processor can run smoothly in advance, and then when the image processing request is received, the target processing instruction matching the request type of the currently received image processing request is determined from the customized processing instructions that are pre-constructed for different request types and can be successfully executed by the processor, and then the processor is finally used to execute the target processing instruction to implement the corresponding image processing request and obtain the corresponding processing result. This can ensure that the processor can reasonably allocate existing processing resources according to the pre-customized target processing instruction when implementing the image processing request, avoid the situation where the image processing request is implemented inefficiently or even cannot be implemented due to unreasonable allocation of processing resources, thereby improving the efficiency of the processor in implementing the image processing request, and further solving the technical problem of low efficiency of image processing on a processor with less computing power in the related art.

[0147] Those skilled in the art will understand that Fig. 9 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Fig. 9 It does not limit the structure of the above electronic device. For example, the electronic device A may also include Fig. 9More or fewer components (such as network interfaces, display devices, etc.) shown in the figure, or having Fig. 9 Different configurations are shown.

[0148] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0149] Example 8

[0150] The embodiment of the present application further provides a computer program product. Optionally, in this embodiment, the computer program product may include a computer program, and the computer program implements the method provided in the embodiment when executed by a processor.

[0151] Example 9

[0152] The embodiments of the present application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which may be used to store a computer program, and when the computer program is executed by a processor, the method provided in the embodiments is implemented.

[0153] Example 10

[0154] The embodiment of the present application further provides a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, the method provided in the above embodiment is implemented.

[0155] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0156] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0157] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0158] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0160] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0161] The above are only preferred implementations of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An image processing method, characterized in that: Applicable to processors, including: When receiving an image processing request, acquiring at least one image carried in the image processing request based on a request type of the image processing request; Based on the request type of the image processing request, reading a target processing instruction corresponding to the request type from a storage device, wherein the target processing instruction is used to represent an instruction created in advance for the request type; The at least one image is processed using the target processing instruction to obtain a processing result corresponding to the image processing request.

2. The method according to claim 1, characterized in that The acquiring, based on the request type of the image processing request, at least one image carried by the image processing request comprises: When the request type of the image processing request is image mixing, acquiring multiple images carried by the image processing request to obtain the at least one image, wherein the image processing request is used to request image mixing of the multiple images; In a case where the request type of the image processing request is image filling, acquiring the image to be filled and the filling color carried by the image processing request to obtain the at least one image, wherein the image processing request is used to request to fill the image to be filled with the filling color; In the case where the request type of the image processing request is image and text mixing, the image to be mixed, the mixed color and the mixed text carried by the image processing request are obtained to obtain the at least one image, wherein the image processing request is used to request that the image to be mixed and the mixed text be mixed using the mixed color.

3. The method according to claim 1, characterized in that The step of reading a target processing instruction corresponding to the request type from a storage device based on the request type of the image processing request includes: In a case where the request type of the image processing request is image mixing, reading a single image mixing instruction from the storage device to obtain the target processing instruction; In the case where the request type of the image processing request is image filling, reading a single image filling instruction from the storage device to obtain the target processing instruction; In the case that the request type of the image processing request is image-text mixing, a single image-text mixing instruction is read from the storage device to obtain the target processing instruction.

4. The method according to claim 1, characterized in that: In the case where the target processing instruction is a single image mixing instruction, the processing of the at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request includes: Determine a first transparency corresponding to the single image blending instruction; Obtaining a product of the first transparency and a first image among the multiple images to obtain a first mixed product; Obtaining a product of a first reverse transparency and a second image among the multiple images to obtain a second mixed product, wherein the first reverse transparency is used to represent a difference between a preset value and the first transparency; Obtain the sum of the first mixed product and the second mixed product to obtain the processing result.

5. The method according to claim 4, characterized in that The first transparency is the transparency carried in the image processing request, or the value of the transparency channel of the first image.

6. The method according to claim 1, characterized in that In the case where the target processing instruction is a single image filling instruction, the processing of the at least one image by using the target processing instruction to obtain a processing result corresponding to the image processing request includes: Get the value of the transparency channel of the fill color to obtain the second transparency; Obtaining the product of the second transparency and the filling color to obtain a first filling product; Obtaining a product of a second inverse transparency and the image to be filled, to obtain a second filling product, wherein the second inverse transparency is used to represent a difference between a preset value and the second transparency; The sum of the first filling product and the second filling product is obtained to obtain the processing result.

7. The method according to claim 1, characterized in that In the case where the target processing instruction is a single mixed image and text instruction, the processing of the at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request includes: Determine mask data corresponding to the mixed text, wherein the mask data is used to represent the font of the mixed text; Obtaining the product of the mixed color and the mask data to obtain a third mixed product; Obtaining the product of the inverse mask data and the image to be processed to obtain a fourth mixed product; The sum of the third mixed product and the fourth mixed product is obtained to obtain the processing result.

8. The method according to any one of claims 1 to 7, characterized in that After acquiring at least one image carried in the image processing request, the method further includes: storing the at least one image in at least one register; After processing the at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request, the method further includes: The processing result is stored in the at least one register.

9. The method according to any one of claims 1 to 7, characterized in that: The processor adopts a reduced instruction set architecture.

10. An image processing method, characterized in that: Applicable to processors, including: When receiving a request for performing image processing on a video frame in a video, obtaining at least one video frame carried in the image processing request based on a request type of the image processing request; Based on the request type of the image processing request, reading a target processing instruction corresponding to the request type from a storage device, wherein the target processing instruction is used to represent an instruction created in advance for the request type; The at least one video frame is processed using the target processing instruction to obtain a processing result corresponding to the image processing request.

11. A processor, characterized in that: include: A storage module, used to store instructions created in advance for different request types; A processing unit is connected to the storage module and is used for, when receiving an image processing request, obtaining at least one image carried by the image processing request based on the request type of the image processing request, reading a target processing instruction corresponding to the request type from the storage module based on the request type of the image processing request, and processing the at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request, wherein the target processing instruction is used to represent an instruction created in advance for the request type.

12. A system on chip, characterized in that: include: A storage device, used to store instructions created in advance for different request types; A processor is connected to the storage device and is used for, when receiving an image processing request, obtaining at least one image carried by the image processing request based on the request type of the image processing request, reading a target processing instruction corresponding to the request type from the storage device based on the request type of the image processing request, and processing the at least one image using the target processing instruction to obtain a processing result corresponding to the image processing request, wherein the target processing instruction is used to represent an instruction created in advance for the request type.

13. An electronic device, characterized in that: include: A memory storing an executable program; A processor, configured to run the program, wherein the program executes the method according to any one of claims 1 to 10 when running.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is executed, the device where the storage medium is located is controlled to execute the method according to any one of claims 1 to 10.

15. A computer program product, characterized in that It comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 10.