Data processing method and device, equipment, medium and product

By encoding and extracting the image adjustment data required for rendering in the image, the problem that the graphics processor cannot pass adjustment parameters in the image rendering is solved, and the universality and applicability of the image is improved.

CN120070280APending Publication Date: 2025-05-30BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510122581.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

When rendering images based on graphics processors, the image adjustment parameters cannot be effectively passed, resulting in the rendered images being less versatile and unable to adapt to the needs of different scenarios.

Method used

By acquiring the first image in the first media data and determining the image area based on its attribute information, the image adjustment data is encoded into these areas. Then, during rendering, these encoded data are obtained and the image is rendered based on these data to improve the universality of the image.

Benefits of technology

It realizes the effective transfer of image adjustment parameters during image rendering, making the rendered images more versatile and widely applicable, and can better adapt to the needs of different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120070280A_ABST
    Figure CN120070280A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, equipment, a medium and a product. The method comprises the steps that first media data are acquired, and the first media data at least comprise a first image; according to the first attribute information of the first media data, determining at least one image area for encoding the first data in the first image, and encoding the first data into the at least one image area; in response to an event of rendering the second media data, the encoded first data in the at least one image region is acquired, and the second media data is rendered based on the first data. According to the technical scheme provided by the embodiment of the invention, the image adjustment data required by rendering is transmitted based on the configured first image, so that the rendered image is more universal, and the use universality of the image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer processing technologies, and in particular, to a data processing method, apparatus, device, medium, and product. Background Art

[0002] Currently, a corresponding target image can be generated based on an initial image uploaded by a user. The generated target image or the initial image is rendered based on a graphics processing unit.

[0003] When rendering an image based on a graphics processing unit, only the rendering of the image can be achieved, and adjustment parameters for adjusting the initial image or the target image cannot be transmitted. As a result, the rendered image cannot be better adapted to various scenarios, that is, there is a problem that the generality of the rendered image is low. Summary of the Invention

[0004] Embodiments of the present disclosure provide a data processing method, apparatus, device, medium, and product to transmit image adjustment data required for rendering based on a configured first image, so that the rendered image has better generality, thereby improving the effect of the wide use of the image.

[0005] In a first aspect, embodiments of the present disclosure provide a data processing method, the method including:

[0006] Obtain first media data, where the first media data includes at least a first image;

[0007] Determine at least one image region in the first image configured with first data according to first attribute information of the first media data, and encode the first data into the at least one image region;

[0008] In response to a trigger operation for rendering the first media data, obtain the first data encoded in the at least one image region, and render the first image or a second image associated with the first image based on the first data.

[0009] In a second aspect, embodiments of the present disclosure further provide a data processing apparatus, the apparatus including:

[0010] A data acquisition module, configured to obtain first media data, where the first media data includes at least a first image;

[0011] A data encoding module, configured to determine at least one image region in the first image configured with first data according to first attribute information of the first media data, and encode the first data into the at least one image region;

[0012] An image rendering module, configured to obtain first data encoded in the at least one image region in response to a trigger operation for rendering the first media data, and render the first image or a second image associated with the first image based on the first data.

[0013] In a third aspect, an embodiment of the present disclosure further provides an electronic device, which includes:

[0014] One or more processors;

[0015] A storage device, configured to store one or more programs,

[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method according to any one of the embodiments of the present disclosure.

[0017] In a fourth aspect, an embodiment of the present disclosure further provides a storage medium including computer-executable instructions, which are used to execute the data processing method according to any one of the embodiments of the present disclosure when executed by a computer processor.

[0018] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the data processing method according to any one of the embodiments of the present disclosure when executed by a processor.

[0019] The technical solution provided by the embodiment of the present disclosure, after obtaining the first media data, can determine at least one image adjustment region in the first image that encodes the first data according to the first attribute information of the first media data, and then encode the first data into the image adjustment region. Next, when rendering the first image based on the shader in the graphics processor, the first data encoded in at least one image region can be obtained. Furthermore, according to the obtained first data, the second image is rendered. At this time, the second image can be the first image, or a second image generated based on the first image, or a second image that needs to be processed and is irrelevant to the first image, achieving the effect of being able to transparently transmit additional rendering information when the image participates in rendering. Based on this, it can be known that the rendering parameters adapted to different scenarios can be transparently transmitted according to the specific application scenario, so that the rendered image is adapted to the corresponding scenario, improving the generality and applicability of image rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In combination with the accompanying drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the embodiments of the present disclosure will become more obvious. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic, and the original elements and elements are not necessarily drawn to scale.

[0021] Figure 1 Flow schematic diagram of a data processing method provided by an embodiment of the present disclosure;

[0022] Figure 2 Schematic diagram of encoding first data into a first image provided by an embodiment of the present disclosure;

[0023] Figure 3 Schematic diagram of applying first data to second media data provided by an embodiment of the present disclosure;

[0024] Figure 4 Schematic diagram of encoding first data into the first image provided by an embodiment of the present disclosure;

[0025] Figure 5 Schematic diagram of the structure of a data processing device provided by an embodiment of the present disclosure;

[0026] Figure 6 Schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0027] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not used to limit the protection scope of the present disclosure.

[0028] It should be understood that the various steps recited in the method embodiments of the present disclosure can be executed in a different order and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this regard.

[0029] The term "including" and its variants used herein are open-ended, that is, "including but not limited to". The term "based on" is "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order of functions executed by these devices, modules or units or their interdependent relationships.

[0031] It should be noted that the modifications of "one" and "multiple" mentioned in this disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless clearly specified otherwise in the context, it should be understood as "one or more".

[0032] The names of the messages or information exchanged between multiple devices in the embodiments of this disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0033] It can be understood that before using the technical solutions disclosed in the embodiments of this disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0034] For example, when responding to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that executes the technical solutions of this disclosure according to the prompt message.

[0035] As an optional but non-limiting implementation manner, the way of sending a prompt message to the user in response to receiving an active request from the user can be, for example, in the form of a pop-up window, and the prompt message can be presented in text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0036] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not constitute a limitation on the implementation manners of this disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manners of this disclosure.

[0037] It can be understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of corresponding laws, regulations and related provisions.

[0038] Before introducing the technical solution provided by the embodiments of the present invention, an exemplary description of the application scenario can be given first. When rendering an image based on a graphics processor, it may be necessary to pass through more rendering information to render the image. Based on this, the extra information other than the image can be passed through to the rendering layer in the form of json to enable the rendering layer to process it. However, this method is limited by the link or context, resulting in the inability to transmit this information through json or other effective data transmission methods. Based on the above problems, the technical solution provided by the embodiments of the present disclosure can be adopted to pass through other rendering information required for rendering. That is to say, the technical solution provided by the embodiments of the present disclosure can be applied to any scenario where extra rendering information needs to be passed through during image rendering.

[0039] Figure 1 It is a schematic flowchart of a data processing method provided by the embodiments of the present disclosure. The embodiments of the present disclosure are applicable to scenarios where extra rendering information needs to be passed through during image rendering. This method can be executed by a data processing device, which can be implemented in the form of software and / or hardware. Optionally, it can be implemented by an electronic device, which can be a mobile terminal, a PC, or a server, etc.

[0040] As Figure 1 shown, the method of this embodiment can specifically include:

[0041] S110. Obtain first media data, where the first media data includes at least a first image.

[0042] Among them, the first media data may include images, videos, etc. The currently to-be-processed image or video is used as the first media data. The first media data includes at least a first image. In this embodiment, the processing of the first image is taken as an example for illustration. The first image may be an image uploaded by the user or an image pushed by the system background.

[0043] Of course, in order to meet the personalized needs of users, the first image may be an image uploaded by the user. That is to say, the technical solution provided by the embodiments of the present disclosure can be applied to scenarios such as special effect video generation or special effect video production.

[0044] Specifically, if it is applied to the scenario of generating special effect videos, when detecting the triggering of a target prop, an image upload control can be displayed. Based on the triggering operation on the image upload control, the gallery of the terminal device to which the application belongs can be opened. Based on the triggering operation of the user in the gallery, the first image can be determined. Alternatively, when detecting the triggering of the target prop, the background can automatically assign the first image to it. Of course, when detecting the triggering of the target prop, the camera device of the terminal device to which the application belongs can be called to obtain the first image based on the shooting by the camera device. The obtained first image is used as the first media data. It should be noted that it is also possible to determine that it is the first video, and the first frame or a preset number of video frames in the first video is used as the first image. If it is applied to the scenario of producing special effect videos, when detecting the production of a special effect video, the first image can be selected based on the above method or a certain video frame can be extracted from the selected video as the first image.

[0045] S120. According to the first attribute information of the first media data, determine at least one image region in the first image that encodes the first data, and encode the first data into the at least one image region.

[0046] When uploading the first media data, it is usually compressed. Correspondingly, the first attribute information can be the attribute of the first media data being compressed. The compressed data can be the lossy attribute of the first image. The first image includes multiple pixel points, and the pixel value of each pixel point can be determined by the numerical values in the RGB channels. The number of at least one image region can be one or more, and the specific number of regions is related to the encoding region required by the first data. After determining the image region for encoding the first data, the first data can be encoded into the pixel channels of the pixel points in the image region. The first data is the data to be transparently transmitted to the rendering layer, that is, the first data is the additional data required during rendering. The specific data content of the first data can be set according to the specific application scenario, and its specific content is not limited in this embodiment.

[0047] It can be understood that when uploading the first media data, the compressed data of the first media data can be obtained. The compressed data is used as the first attribute information. According to the compressed data, the reliable region size for storing at least one data in the first data can be determined, and then at least one encoding region can be determined from the first image based on the reliable region size. After obtaining the encoding region, the first data can be encoded into the image region.

[0048] Based on the above, the rendering layer can render the first image. To transmit the first data to the rendering layer, the first data can be encoded into the first image so as to transmit the first data to the rendering layer based on the first image. The first data is the data to be transmitted to the rendering layer, so the first data can be encoded into the first image. To achieve the effect of encoding the first data in the first image, the first image can be processed.

[0049] Correspondingly, before encoding the first data into the first image, the first image can be processed from two perspectives. The first perspective is whether the multiple pixel channels of at least one pixel point in the first image include an alpha pixel channel. The other perspective is that if the multiple pixel channels of at least one pixel point in the first image include an alpha pixel channel, how to process the data in the alpha pixel channel.

[0050] Optionally, in response to the event that the pixel channels of the first image do not include a preset channel, add a preset channel to at least one pixel point in the first image and set the data value of the preset channel to the second data, so that after determining the image area, set the second data of at least one pixel point in the preset channel within the image area to the first data; or, in response to the event that at least one pixel point in the first image includes a preset channel, set the data value of the preset channel to the second data, so that after determining the image area, set the second data of at least one pixel point in the preset channel within the image area to the first data.

[0051] Among them, the first image includes multiple pixel points. The pixel value of each pixel point can be determined by the values in the R channel, G channel, and B channel. The preset channel can be a channel for editing the transparency information of the pixel point. For the first image, each pixel point may or may not have an alpha channel.

[0052] It can be understood that: in the case where the pixel channels of at least one pixel point in the first image do not include an alpha channel, add an alpha channel to at least one pixel point in the first image. The at least one pixel point can include all pixel points in the first image. After adding an alpha channel to the at least one pixel point, the data value of the alpha channel can be set to the first data. The advantage of setting it to the first data is that it is convenient for subsequent direct encoding of the first data. In practical applications, it is possible that at least one pixel point in the first image includes an alpha channel. At this time, in order to facilitate subsequent encoding of the first data in the alpha channel, all existing data in the alpha channel can be adjusted to the second data.

[0053] In this embodiment, after setting the data in the transparency channel of at least one pixel point in the first image to the second data, after determining the image area in the first image, the second data of at least one pixel point in the image area in the preset channel can be encoded into the first data, which improves the efficiency of encoding the first data.

[0054] Based on the above technical solution, before encoding the first data into at least one image area, the first data can be processed to make the first data meet the corresponding scenario requirements.

[0055] Optionally, in response to the event that the first data meets the first condition, the first data is normalized to obtain the first data to be written into the first image.

[0056] Among them, the first condition can be a condition corresponding to a preset scenario. Optionally, the preset scenario is a scenario of image scaling. Then, the first condition can be a scenario of image scaling processing. In the case of an image scaling scenario, the first data can be image size scaling data. Normalization processing can be understood as adjusting the scaling ratio to the interval [0, 1].

[0057] Specifically, when it is detected that the first data corresponds to the data in the scaling scenario, the first data meets the first condition. At this time, the first data can be normalized to obtain the first data to be encoded into the first image. Of course, for other scenarios, as long as there is a need for normalization, the first data can be normalized.

[0058] In this embodiment, according to the first attribute information of the first media data, determining at least one image area in the first image for encoding the first data includes: determining region size data according to the compressed data; where the region size data is used to characterize the region size for storing the first data; determining at least one region quantity according to the data volume of the first data, and determining, according to the region quantity and the region size data, an image area adapted to the region quantity from the first image, where the data of the first data stored in any two image areas is different.

[0059] It should be noted that the different compressed data of the first media data result in different lossy degrees corresponding to the first image. Based on this, the region size data can be determined based on the compressed data. The region size data can be the length and / or width of the region image. Usually, the region image can be a square, then the region size data can be the length of the region image. That is, the region size data is used to characterize the region size of the image area for storing the first data.

[0060] Among them, the first data may include multiple sub-data, and the corresponding quantities of the sub-data can be counted, and the data is used as the data volume. The reason and advantage of determining the data volume are that each image area is used to store one sub-data. In order to store all the sub-data in the first data in full, it is necessary to determine the number of image areas adapted to the data volume, and then store the corresponding sub-data based on different image areas. That is to say, the data content of the first data stored in any two image areas is different.

[0061] It can be understood that the region size data of the image area can be determined based on the compressed data. The region size data can be the length information of the image area. Further, according to the number of sub-data to be transmitted transparently in the first data, the number of regions is determined. According to the number of regions and the region size data, at least one image area can be determined from the first image. At this time, the number of image areas is the same as the number of sub-data in the first data, and at the same time, the size of the image area is consistent with the region size data.

[0062] In this embodiment, the method for determining at least one region image from the first image may be:

[0063] Randomly determine the image area from the first image according to the region size data. It should be noted that in terms of pixel coincidence, there is no coincidence of pixel points in any two image areas, that is, when the number of at least one image area includes at least two, there is no pixel overlap between any two image areas.

[0064] The advantages of determining the image area in the above manner are: first, there are enough image areas to encode the first data, and second, using a limited number of image areas to encode the first data can improve the reading efficiency of the first data.

[0065] S130. In response to the event of rendering the second media data, obtain the first data encoded in at least one image area, and render the second media data based on the first data.

[0066] Among them, the second media data may be the first media data, or the second media data generated based on the first media data, or any media data that needs to be rendered with the first data in the first image.

[0067] In this embodiment, the second media data may include a second image. The second image may be an image generated based on the first image. Optionally, an existing image generation model may be used to process the first image to obtain a second image associated with the first image. The second image may be an image of any style type, and its specific style type is adapted to the image generation model. The second image may also be another image uploaded by the user. It may also be an image assigned by the system for it. It can be understood that as long as it is an image that needs to be rendered based on the first data, it can be called a second image. The specific source of the second image is not limited in this embodiment.

[0068] When an event for rendering the second media data is detected, at least one image region in the first image may be obtained, and the first data encoded therein may be retrieved. The second media data may be rendered based on the first data. Optionally, the second image may be rendered based on the first data.

[0069] Based on the above technical solution, obtaining the first data encoded in at least one image includes: retrieving the first data encoded in the at least one image region based on a graphics processing unit; or copying the image texture data of the at least the first image and retrieving the first data configured in the at least one image region from the image texture data.

[0070] Among them, the graphics processing unit includes a shader, and the first data encoded in at least one image region in the first image may be retrieved based on the shader. At the same time, in order to further improve its processing efficiency, the image processor texture may be copied to the central processing unit, and the first data may be retrieved by reading the row data of the central processing unit.

[0071] In the technical solution provided by the embodiments of the present disclosure, after the first media data is obtained, at least one image adjustment region encoding the first data in the first image may be determined according to the first attribute information of the first media data, and then the first data may be encoded into the image adjustment region. Next, when rendering the first image based on the shader in the graphics processing unit, at least one image region may be obtained, and the first data encoded therein may be retrieved. Further, the second image may be rendered according to the retrieved first data. At this time, the second image may be the first image, or a second image generated based on the first image, or a second image that needs to be processed and is irrelevant to the first image, achieving the effect of being able to transparently transmit additional rendering information during rendering based on the image. Based on this, it can be known that the rendering parameters adapted to different scenarios can be transparently transmitted according to specific application scenarios, so that the rendered image is adapted to the corresponding scenario, improving the versatility and applicability of image rendering.

[0072] Based on the above technical solutions, in the case where the first data includes only one sub-data, there is an image area including only one encoded sub-data. The sub-data in the image area can be directly obtained, that is, the first data is obtained. In the case where the number of sub-data included in the first data is multiple, the number of image areas is also multiple. In the rendering stage, in order to efficiently determine the specific use of the first data obtained from the image area, that is, the object it acts on. When encoding the first data into the first image, encoding can be performed according to certain rules. Correspondingly, after obtaining the first data, the use corresponding to the sub-data in the first data can be determined according to the rules. In this embodiment, if the sub-data in the first data includes one, then one image area can be randomly selected according to the region size information. In the case where the first data includes multiple sub-data, writing can be performed according to certain rules. The rule can be to write the sub-data in the first data along the four vertices of the first image. Since there is certain compressed data in the first media data, the image area can be determined with the four vertices of the first image as the center and the region size information as the side length or radius. It can be to write each sub-data in the first data clockwise starting from the upper left vertex.

[0073] In the case where the number of sub-data in the first data is greater than four, the image extraction area can be to determine the image area of the second inner layer starting from the edge of the image area corresponding to the upper left vertex, see Figure 2 . It can be written in the order of the labels 1, 2, 3, 4 in Figure 2 for the sub-data in the first data in sequence. Correspondingly, the image areas of the inner layer can be 5, 6, 7, 8, and the sub-data in the first data can be written in this way in sequence.

[0074] It should be noted that the region size data of each image area is the same.

[0075] As another embodiment in this embodiment, on the basis of the foregoing embodiment, taking the scenario where the size data of the second image in the second media data needs to be expanded by transparent transmission according to the application scenario as an example, correspondingly, the first data can include four sub-data. Based on the above conditions, how to determine the image area is further elaborated. The specific implementation manner can refer to the detailed description of this technical solution. Among them, the same or corresponding technical terms as those in the above embodiment will not be elaborated in this embodiment.

[0076] The application scenario corresponding to this embodiment is as follows: The first media data includes a first image, and the second media data includes a second image, where the second image is generated based on the first image. That is to say, there is a certain correlation between the picture contents of the first image and the second image. However, the second image is an image obtained by stylizing the first image. Now, it is necessary to enlarge the size of the second image in the second media data and fill the corresponding pixel points in the enlarged area.

[0077] Exemplarily, referring to Figure 3 , after stylizing the first image in the first media data, the second image in the second media data can be obtained, that is, the second image is the stylized result image. When enlarging the upper, lower, left, and right four edges of the second stylized result image by different ratios, different expansion ratios in different directions can be passed in. That is, the first data to be passed through to the rendering layer includes a first expansion ratio t for expansion in the first direction, a second expansion ratio b for expansion in the opposite direction of the first direction, a third expansion ratio r for expansion in the second direction, and a fourth expansion ratio l for expansion in the opposite direction of the second direction. If the width data of the second image is W 0 , and the height data is H 0 , the width data of the second image expected to be obtained after processing the second image based on the passed-through rendering data is W e , and the height data is H 0 .

[0078] After determining the first data to be passed through to the rendering layer, normalization processing can be performed first. It should be noted that for the first data t, r, b, l ∈ [0, 1] to be passed through (passed through) to the rendering layer, it is already normalized data and does not need to be processed. For the data that needs to be normalized, normalization processing can be performed, that is, according to the maximum and minimum values in the first data, the first difference is determined. According to the difference between the sub-data in the first data and the minimum value, the second difference is determined. According to the ratio of the second difference to the first difference, the normalized data of the sub-data is determined.

[0079] After normalizing the data, the first image can be processed. Currently, in the scenario of stylized image processing, that is, when the second media data is a stylized image, the demand for the transparency channel of the pixel points in the second image is very small. Therefore, the first data can be encoded based on the transparency channel of the pixel points. Since the shader corresponding to the rendering layer can read the pixel values in the first image, the first data can be encoded based on the pixel channels of the pixel points, and then the first data is passed through to the rendering layer.

[0080] In this embodiment, the transparency channel of the first image can be set to a second value first. If the first image does not have a transparency channel, a transparency channel is added to all pixel points in the first image, and the data of the transparency channel is set to the second data.

[0081] Based on the above, the data to be encoded into the first image are four floating-point values, which are used to represent the top expansion ratio, the right expansion ratio, the bottom expansion ratio, and the left expansion ratio. These four floating-point values can be written into the transparency channels of the four corner points (the four vertices) of the first image. The order of writing into the transparency channels of the four vertices can be: write the top expansion ratio t into the transparency channel of the upper left vertex, write the right expansion ratio r into the transparency channel of the upper right vertex, write the bottom expansion ratio b into the transparency channel of the lower right vertex, and write the left expansion ratio l into the transparency channel of the lower left vertex, that is, write t, r, b, l clockwise.

[0082] In the case where the first media data is not compressed, the first data can be written according to the above method. After the first media data is uploaded to the client or the server, there is usually a certain degree of compression. Based on this, the region size data for writing the first data can be determined based on the compression degree. Optionally, if the compressed data corresponding to the first media data is S, and the length of the region size corresponding to this compressed data is k. A rectangular region with k / 2 as the side length centered on the four vertices of the first image can be used as the image region. The transparency channels of the pixel points within the image region can be written with the corresponding sub-data. Exemplarily, refer to Figure 4 writing the corresponding expansion ratio into the transparency channels of the pixel points in the image region marked as a in

[0083] The advantage of adopting the above method is that if the expansion ratio is only written in the four vertices, the information of the transparency channels covered will be damaged due to the lossy compression of the first image, resulting in the inability to restore the first data written in the four vertices during the rendering stage. If the sub-data in the first data is written in a rectangular region with k / 2 as the side length centered on the four vertices, even if there is lossy compression, the data fidelity of the middle part of the rectangle can still be protected to the greatest extent.

[0084] From the perspective of test verification, for the first image with a resolution of 1080p, if k = 10, that is, within a 5×5 pixel range, the first data in the transparency channel can accurately transmit the expansion map information t, r, b, l with high precision.

[0085] It should also be noted that the larger the value of k, the more robust the protection effect can be obtained. Currently, k = 20 can be used to determine the image region in the online environment.

[0086] In the rendering stage, after obtaining the top expansion ratio t, right expansion ratio r, bottom expansion ratio b, and left expansion ratio l in the first image, the size data of the second image can be determined according to these ratios.

[0087] Exemplarily, W e = W o *(1.0 + l + r), H e = H o *(1.0 + t + b), where W e represents the target width data after expanding the width of the second image, and H e is the target height data after expanding the height of the second image. After determining the target width data and target height data, the image content of the second image can be expanded based on the existing model according to the image content of the second image.

[0088] In the technical solution provided by the embodiments of the present disclosure, after obtaining the first media data, at least one image adjustment area for encoding the first data in the first image can be determined according to the first attribute information of the first media data, and then the first data is encoded into the image adjustment area. Next, when rendering the first image based on the shader in the graphics processor, the first data encoded in at least one image area can be obtained. Furthermore, the second image is rendered according to the obtained first data. At this time, the second image can be the first image, or a second image generated based on the first image, or a second image that needs to be processed and is irrelevant to the first image, achieving the effect of being able to transparently transmit additional rendering information during rendering based on the image. Based on this, it can be known that the rendering parameters adapted to different scenarios can be transparently transmitted according to the specific application scenario, so that the rendered image is adapted to the corresponding scenario, improving the versatility and wide applicability of image rendering.

[0089] Figure 5 The following is a schematic structural diagram of a data processing device provided by an embodiment of the present disclosure, as Figure 5 shown. The device includes: a media data acquisition module 210, an image area determination module 220, and a data rendering module 230.

[0090] The media data acquisition module 210 is configured to acquire first media data, where the first media data at least includes a first image; the image area determination module 220 is configured to determine at least one image area for encoding the first data in the first image according to the first attribute information of the first media data, and encode the first data into the at least one image area; the data rendering module 230 is configured to, in response to an event of rendering second media data, acquire the first data encoded in the at least one image area, and render the second media data based on the first data.

[0091] Based on the above technical solution, the device further includes: a data normalization module, configured to, in response to an event that the first data satisfies a first condition, perform normalization processing on the first data to obtain first data to be encoded into the first image.

[0092] Based on the above technical solutions, the device further includes:

[0093] A first processing module, configured to, in response to an event that a preset channel is not included in the pixel channels of the first image, add a preset channel to at least one pixel point in the first image, and set the data value of the preset channel to second data, so that after determining the image region, encode the second data of at least one pixel point in the preset channel within the image region into the first data; or,

[0094] A second processing module, configured to, in response to an event that a preset channel is included in the pixel channels of at least one pixel point in the first image, set the data value of the preset channel to second data, so that after determining the image region, encode the second data of at least one pixel point in the preset channel within the image region into the first data.

[0095] Based on the above technical solutions, the first attribute information includes the compressed data of the first media data, and the image region determination module includes:

[0096] A region size data determination sub-module, configured to determine region size data according to the compressed data; wherein, the region size data is used to characterize the region size for encoding the first data;

[0097] An image region determination sub-module, configured to determine at least one region quantity according to the quantity of sub-data in the first data, and determine the at least one image region according to the region quantity and the region size data;

[0098] Wherein, the data content of the first data encoded by any two image regions is different.

[0099] Based on the above technical solutions, the first attribute information includes a height magnification ratio along a first direction and / or a width magnification ratio along a second direction. Correspondingly, the at least one image region includes a first image region for encoding the height magnification ratio, and / or a second image region for encoding the width magnification ratio

[0100] Based on the above technical solutions, the second media data includes a second image, which is an image generated based on the first image. The data rendering module is further configured to: render the second media data based on the width magnification ratio and / or height magnification ratio in the first data.

[0101] Based on the above technical solutions, the data rendering module is further configured to:

[0102] Read the first data encoded in the at least one image region by a graphics processor; or,

[0103] Copy the image texture data of the at least first image, and obtain the first data configured in the at least one image region from the image texture data.

[0104] In the technical solution provided by the embodiment of the present disclosure, after obtaining the first media data, at least one image adjustment region for encoding the first data in the first image can be determined according to the first attribute information of the first media data, and then the first data is encoded into the image adjustment region. Next, when rendering the first image based on the shader in the graphics processor, the first data encoded in at least one image region can be obtained. Furthermore, the second image is rendered according to the obtained first data. At this time, the second image can be the first image, or a second image generated based on the first image, or a second image that needs to be processed and is irrelevant to the first image, achieving the effect of being able to transparently transmit additional rendering information when participating in rendering based on the image. Based on this, it can be known that the rendering parameters adapted to different scenarios can be transparently transmitted according to the specific application scenario, so that the rendered image is adapted to the corresponding scenario, improving the versatility and wide applicability of image rendering.

[0105] The data processing device provided by the embodiment of the present disclosure can execute the data processing method provided by any embodiment of the present disclosure, and has corresponding functional modules and beneficial effects for executing the method.

[0106] It should be noted that the various units and modules included in the above device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of the functional units are only for the convenience of mutual distinction and do not limit the protection scope of the embodiment of the present disclosure.

[0107] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As Figure 6As shown, the electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 302 or a program loaded from a storage device 308 into a random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0108] Generally, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 the electronic device 300 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.

[0109] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes program codes for performing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication device 309, or installed from the storage device 308, or installed from the ROM 302. When the computer program is executed by the processing device 301, the above functions defined in the method of the embodiment of the present disclosure are executed.

[0110] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0111] The electronic device provided by the embodiment of the present disclosure and the data processing method provided by the above embodiment belong to the same inventive concept. Technical details not described in detail in the embodiment of the present disclosure may be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0112] The embodiment of the present disclosure provides a computer storage medium, on which a computer program is stored, and when the program is executed by a processor, the data processing method provided by the above embodiment is implemented.

[0113] It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and this computer-readable signal medium can send, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. The program code contained on a computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0114] In some embodiments, the client and the server can communicate using any currently known or future-developed network protocol such as HTTP (HyperText Transfer Protocol), and can be interconnected with digital data communication in any form or medium (for example, a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet (for example, the Internet), and end-to-end networks (for example, ad hoc end-to-end networks), as well as any currently known or future-developed network.

[0115] The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or it may exist separately and not be assembled into the electronic device.

[0116] The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to:

[0117] Obtain first media data, where the first media data includes at least a first image;

[0118] Determine at least one image region in the first image that encodes first data according to first attribute information of the first media data, and encode the first data into the at least one image region;

[0119] In response to an event of rendering second media data, obtain the first data encoded in the at least one image region, and render the second media data based on the first data.

[0120] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or combinations thereof. The above-mentioned programming languages include, but are not limited to, object-oriented programming languages - such as Java, Smalltalk, C++; and also include conventional procedural programming languages - such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network - including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (for example, by using an Internet service provider to connect through the Internet).

[0121] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.

[0122] The units involved in the embodiments of the present disclosure can be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation to the unit itself in some cases. For example, the first acquisition unit can also be described as "the unit for acquiring at least two Internet protocol addresses".

[0123] The functions described above in this article can be performed at least in part by one or more hardware logic components. For example, without limitation, the exemplary types of hardware logic components that can be used include: Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC), Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), and so on.

[0124] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include electrical connections based on one or more wires, portable computer disks, hard disks, Random Access Memory (RAM), Read Only Memory (ROM), Erasable Programmable Read Only Memory (EPROM or Flash Memory), optical fibers, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0125] According to one or more embodiments of the present disclosure, [Example 1] provides a video detection method, including:

[0126] Obtain first media data, where the first media data includes at least a first image;

[0127] Based on the first attribute information of the first media data, determine at least one image region in the first image that encodes the first data, and encode the first data into the at least one image region;

[0128] In response to an event of rendering second media data, obtain the first data encoded in the at least one image region, and render the second media data based on the first data.

[0129] According to one or more embodiments of the present disclosure, [Example 2] provides the method of Example 1, further including:

[0130] Optionally, before encoding the first data into the at least one image region, the method further includes:

[0131] In response to an event that the first data meets a first condition, performing normalization processing on the first data to obtain the first data to be encoded into the first image.

[0132] According to one or more embodiments of the present disclosure, [Example Three] provides the method of Example One, further including:

[0133] Optionally, in response to an event that a preset channel is not included in the pixel channels of the first image, adding a preset channel to at least one pixel point in the first image, and setting the data value of the preset channel to second data, so that after determining the image region, encoding the second data of at least one pixel point in the preset channel within the image region as the first data; or,

[0134] In response to an event that a preset channel is included in the pixel channels of at least one pixel point in the first image, setting the data value of the preset channel to second data, so that after determining the image region, encoding the second data of at least one pixel point in the preset channel within the image region as the first data.

[0135] According to one or more embodiments of the present disclosure, [Example Four] provides the method of Example One, further including:

[0136] Optionally, the first attribute information includes the compressed data of the first media data, and determining at least one image region in the first image for encoding the first data according to the first attribute information of the first media data includes:

[0137] Determining region size data according to the compressed data; wherein, the region size data is used to characterize the region size for encoding the first data;

[0138] Determining at least one region quantity according to the quantity of sub-data in the first data, and determining the at least one image region according to the region quantity and the region size data;

[0139] Wherein, the data content of the first data encoded by any two image regions is different.

[0140] According to one or more embodiments of the present disclosure, [Example Five] provides the method of Example One, further including:

[0141] Optionally, the first attribute information includes a height magnification ratio in a first direction and / or a width magnification ratio in a second direction. Correspondingly, the at least one image region includes a first image region for encoding the height magnification ratio and / or a second image region for encoding the width magnification ratio.

[0142] According to one or more embodiments of the present disclosure, [Example Six] provides the method of Example One, further including:

[0143] Optionally, the second media data includes a second image, which is an image generated based on the first image. Rendering the second media data based on the first data includes:

[0144] Rendering the second media data based on the width magnification ratio and / or height magnification ratio in the first data.

[0145] According to one or more embodiments of the present disclosure, [Example Seven] provides the method of Example One, further including:

[0146] Optionally, obtaining the first data encoded in the at least one image region includes:

[0147] Reading the first data encoded in the at least one image region based on a graphics processing unit; or,

[0148] Copying the image texture data of the at least first image and obtaining the first data configured in the at least one image region from the image texture data.

[0149] According to one or more embodiments of the present disclosure, [Example Eight] provides a data processing device, including:

[0150] A media data acquisition module, configured to acquire first media data, where the first media data at least includes a first image;

[0151] An image region determination module, configured to determine at least one image region in the first image that encodes first data according to the first attribute information of the first media data, and encode the first data into the at least one image region;

[0152] A data rendering module, configured to, in response to an event of rendering second media data, acquire the first data encoded in the at least one image region, and render the second media data based on the first data.

[0153] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0154] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0155] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.

Claims

1. A data processing method, characterized in that: include: Acquire first media data, wherein the first media data at least includes a first image; Determine, according to the first attribute information of the first media data, at least one image region in the first image for encoding first data, and encode the first data into the at least one image region; In response to an event of rendering the second media data, first data encoded in the at least one image region is obtained, and the second media data is rendered based on the first data.

2. The method according to claim 1, characterized in that Before encoding the first data into the at least one image region, the method further comprises: In response to an event that the first data satisfies a first condition, the first data is normalized to obtain first data to be encoded into the first image.

3. The method according to claim 1, characterized in that The method further comprises: In response to an event that the pixel channels of the first image do not include a preset channel, adding a preset channel to at least one pixel point in the first image, and setting the data value of the preset channel to second data, so that after determining the image area, the second data of at least one pixel point in the image area in the preset channel is encoded as the first data; or In response to an event that a pixel channel of at least one pixel point in the first image includes a preset channel, the data value of the preset channel is set to second data, so that after determining the image area, the second data of at least one pixel point in the image area in the preset channel is encoded as the first data.

4. The method according to claim 1, characterized in that: The first attribute information includes compressed data of the first media data, and determining at least one image region in the first image encoding the first data according to the first attribute information of the first media data includes: Determine region size data according to the compressed data; wherein the region size data is used to represent the region size for encoding the first data; Determine at least one region number according to the number of sub-data in the first data, and determine the at least one image region according to the region number and the region size data; The data contents of the first data encoded in any two image regions are different.

5. The method according to claim 1 or 4, characterized in that: The first attribute information includes a height magnification ratio along a first direction and / or a width magnification ratio along a second direction. Accordingly, the at least one image area includes a first image area for encoding the height magnification ratio and / or a second image area for encoding the width magnification ratio.

6. The method according to claim 4, characterized in that The second media data includes a second image, the second image is an image generated based on the first image, and the rendering of the second media data based on the first data includes: The second media data is rendered based on the width magnification ratio and / or the height magnification ratio in the first data.

7. The method according to claim 1, characterized in that The obtaining of the first data encoded in the at least one image region comprises: Reading the first data encoded in the at least one image area based on a graphics processor; or, The image texture data of the at least first image is copied, and the first data configured in the at least one image region is acquired from the image texture data.

8. A data processing device, characterized in that: include: A media data acquisition module, configured to acquire first media data, wherein the first media data at least includes a first image; an image region determining module, configured to determine at least one image region in the first image for encoding first data according to first attribute information of the first media data, and encode the first data into the at least one image region; The data rendering module is used to obtain the first data encoded in the at least one image area in response to an event of rendering the second media data, and render the second media data based on the first data.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the data processing method according to any one of claims 1 to 7.

10. A storage medium containing computer executable instructions, characterized in that: When the computer executable instructions are executed by a computer processor, they are used to perform the data processing method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the data processing method according to any one of claims 1 to 7.