Layer compositing method and apparatus, electronic device, and storage medium

By introducing a blank layer at the same level as the intermediate layer, compositing it with multiple first layers, and then overlaying it with the intermediate layer, the problem of discontinuous layers in layer compositing is solved, ensuring the correctness of the color values ​​of the composite layer.

CN115700734BActive Publication Date: 2026-04-28XIAN UNISOC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIAN UNISOC TECH CO LTD
Filing Date
2022-10-28
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

When the middle layer needs to be processed in a specific way, other layers cannot be composited, resulting in the inability to composite multiple layers.

Method used

By introducing a blank layer with the same level as the intermediate layer, and compositing it with multiple first layers, a first composite layer is obtained. Then, it is overlaid with the intermediate layer that has undergone specific processing to obtain a second composite layer.

Benefits of technology

This solved the problem of discontinuous layers, ensuring the correctness of the color values ​​in the final composite layer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115700734B_ABST
    Figure CN115700734B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a layer synthesis method and device, electronic equipment and storage medium, the method comprising: obtaining a second layer, a blank layer and a plurality of first layers, the second layer being a layer that has undergone specific processing, the level of the second layer being between the levels of the plurality of first layers, the level of the blank layer being the same as the level of the second layer, and the color value of the pixel points in the blank layer being a preset value; performing synthesis processing on the plurality of first layers and the blank layer to obtain a first synthesis layer; and performing superimposition processing on the first synthesis layer and the second layer to obtain a second synthesis layer. When specific processing is required for an intermediate layer, a plurality of layers can be synthesized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, specifically relating to a layer compositing method, apparatus, electronic device, and storage medium. Background Technology

[0002] The display interface of electronic devices with image display functions, such as mobile phones and televisions, is usually obtained by combining multiple layers.

[0003] When an intermediate layer among multiple layers needs to use the display processing unit (DPU) to perform specific processing such as image enhancement, frame interpolation, and / or HDR, the other layers (the first layer) cannot be composited, thus preventing the compositing of multiple layers. Summary of the Invention

[0004] This application relates to a layer compositing method, apparatus, electronic device, and storage medium, which requires specific processing of intermediate layers and can composite multiple layers.

[0005] In a first aspect, embodiments of this application provide a layer processing method, including:

[0006] Obtain a second layer, a blank layer, and multiple first layers. The second layer is a layer that has undergone specific processing. The layer level of the second layer is located between the layers of the multiple first layers. The layer level of the blank layer is the same as the layer level of the second layer. The color value of the pixels in the blank layer is a preset value.

[0007] The multiple first layers and the blank layer are composited to obtain a first composite layer;

[0008] The first composite layer and the second layer are overlaid to obtain the second composite layer.

[0009] In one possible implementation, the plurality of first layers and the blank layer are composited to obtain a first composite layer, including:

[0010] At least one first layer whose layer level is before the blank layer is composited to obtain a third composite layer;

[0011] The third composite layer and the blank layer are combined to obtain the fourth composite layer;

[0012] The fourth composite layer is composited with at least one first layer whose layer is after the blank layer to obtain the first composite layer.

[0013] In one possible implementation, the third composite layer and the blank layer are composited to obtain a fourth composite layer, including:

[0014] Obtain the first transparency value of the third composite layer and the second transparency value of the blank layer, wherein the second transparency value is the transparency value of the second layer;

[0015] The color values ​​of each pixel in the fourth composite layer are determined based on the first transparency value, the color values ​​of each pixel in the third composite layer, the second transparency value, and the color values ​​of each pixel in the blank layer.

[0016] In one possible implementation, for any first pixel in the third composite layer, determining the color value of each pixel in the fourth composite layer based on the first transparency value, the color values ​​of each pixel in the third composite layer, the second transparency value, and the color values ​​of each pixel in the blank layer includes:

[0017] A second pixel is determined in the blank layer, and the second pixel has the same pixel position as the first pixel on the display screen;

[0018] The color value of the third pixel is determined by summing the product of the color value and the first transparency value of the first pixel and the product of the color value and the second transparency value of the second pixel. The third pixel is a pixel in the fourth composite layer, and the third pixel has the same pixel position as the first pixel on the display screen.

[0019] In one possible implementation, the first composite layer and the second layer are overlaid to obtain a second composite layer, including:

[0020] Obtain the second transparency value of the second layer and the third transparency value of the fifth composite layer, wherein the fifth composite layer is a layer obtained by compositing at least one first layer whose layer is after the second layer;

[0021] The color values ​​of each pixel in the second composite layer are determined based on the color values ​​of each pixel in the first composite layer, the second transparency value, the third transparency value, and the color values ​​of each pixel in the second layer.

[0022] In one possible implementation, for any fourth pixel in the first composite layer, determining the color value of each pixel in the second composite layer based on the color value of each pixel in the first composite layer, the second transparency value, the third transparency value, and the color value of each pixel in the second layer includes:

[0023] Determine the fifth pixel in the second layer, wherein the fifth pixel has the same pixel position as the fourth pixel on the display screen;

[0024] Based on the third transparency value, the fourth transparency value is determined, and the sum of the fourth transparency value and the third transparency value is equal to 1;

[0025] The color value of the sixth pixel is determined by summing the product of the fourth transparency value, the second transparency value, and the color value of the fifth pixel with the color value of the fourth pixel.

[0026] The sixth pixel is a pixel in the second composite layer, and the sixth pixel has the same pixel position as the fourth pixel on the display screen.

[0027] In one possible implementation, the first composite layer and the second layer are overlaid to obtain a second composite layer, including:

[0028] Determine the seventh pixel in the first composite layer;

[0029] If there is no pixel in the second layer that has the same pixel position as the seventh pixel on the display screen, then the color value of the seventh pixel is determined as the color value of the eighth pixel.

[0030] The eighth pixel is a pixel in the second composite layer, and the eighth pixel has the same pixel position as the seventh pixel on the display screen.

[0031] Secondly, embodiments of this application provide a layer compositing apparatus, including an acquisition module, a compositing processing module, and an overlay processing module, wherein...

[0032] The acquisition module is used to acquire a second layer, a blank layer, and multiple first layers. The second layer is a layer that has undergone specific processing. The second layer is located between the multiple first layers. The layer level of the blank layer is the same as that of the second layer. The color value of the pixels in the blank layer is a preset value.

[0033] The compositing module is used to composit the plurality of first layers and the blank layer to obtain a first composite layer;

[0034] The overlay processing module is used to overlay the first composite layer and the second layer to obtain a second composite layer.

[0035] Thirdly, embodiments of this application provide an electronic device, including: a processor and a memory;

[0036] The memory stores instructions that the computer executes;

[0037] The processor executes computer execution instructions stored in memory, causing the processor to perform the method of the first aspect.

[0038] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method of the first aspect.

[0039] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method of the first aspect.

[0040] Sixthly, embodiments of this application provide a chip on which a computer program is stored. When the computer program is executed by the chip, it implements the method as described in the first aspect.

[0041] In one possible implementation, the chip is a chip in a chip module.

[0042] This application provides a layer compositing method, apparatus, electronic device, and storage medium. The method includes: acquiring a second layer, a blank layer, and multiple first layers. The second layer is a layer that has undergone specific processing, and its layer level is located between the layers of the multiple first layers. The blank layer has the same layer level as the second layer, and the color values ​​of the pixels in the blank layer are preset values. The multiple first layers and the blank layer are then composited to obtain a first composite layer. The first composite layer and the second layer are then overlaid to obtain a second composite layer. By adding a blank layer, the problem of discontinuous layers among the multiple first layers can be solved, thereby solving the technical problem of not being able to composite multiple layers. Furthermore, since the color values ​​of the pixels in the blank layer are preset values, the color values ​​of the first composite layer are only the composite values ​​of the color values ​​of the multiple first layers, thus ensuring the correctness of the color values ​​of the final composite layer. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;

[0044] Figure 2 A schematic flowchart illustrating a layer compositing method provided in an embodiment of this application;

[0045] Figure 3 A schematic diagram illustrating the order of multiple layers on the Z-axis, provided for an embodiment of this application;

[0046] Figure 4 A flowchart illustrating another layer compositing method provided in an embodiment of this application;

[0047] Figure 5 A schematic diagram of a layer compositing device provided for the implementation of this application;

[0048] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0049] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0050] It should be noted that although the terms "first," "second," etc., are used to describe various types of information in the embodiments of this application, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. Optionally, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.

[0051] It should be understood that the terms "comprising" or "including" indicate the presence of the previously mentioned features, steps, or operations, but do not preclude the presence, occurrence, or addition of one or more other features, steps, or operations.

[0052] To facilitate understanding, the following will be combined with... Figure 1 The application scenarios applicable to the embodiments of this application will be described.

[0053] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. Please refer to [link / reference]. Figure 1 The layer compositing device includes a DPU, a 2D accelerator, and a GPU. The layer compositing device can use the DPU, 2D accelerator, and GPU to complete the process from layer generation to display on the screen. Specifically, the GPU can draw the layers, the GPU / 2D accelerator / DPU can composite the layers, and the DPU can send the composited layers to the display screen for display.

[0054] When using a GPU / 2D accelerator to composite multiple layers, these layers are generally hierarchically consecutive. When a certain intermediate layer needs to use the DPU to perform specific processing such as image enhancement, frame interpolation, and / or HDR, the other layers (the first layer) cannot be composited using the GPU, thus making it impossible to composite multiple layers.

[0055] A DPU can include two compositing paths, such as an on-screen display (OSD) path and a video path. When using a DPU to composite multiple layers, these layers are generally hierarchically consecutive. If an intermediate layer needs to use the video path for specific processing such as image enhancement, frame interpolation, and / or HDR, then other layers (the first layer) cannot use the OSD path for compositing, thus preventing the compositing of multiple layers.

[0056] To avoid the aforementioned technical problems, this application provides a layer processing method. A first composite layer is obtained by combining a blank layer with an intermediate layer of the same level as the intermediate layer and multiple first layers. Then, the first composite layer is combined with an intermediate layer (second layer) that has undergone specific processing to obtain a second composite layer.

[0057] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for the same or similar content, the description will not be repeated in different embodiments.

[0058] Figure 2 This is a schematic flowchart illustrating a layer compositing method provided in an embodiment of this application. Please refer to... Figure 2 The method may include:

[0059] S201, Get the second layer, blank layer and multiple first layers.

[0060] The execution subject of this application embodiment can be an electronic device with layer compositing function, or it can be a layer compositing device installed in the electronic device. The layer compositing device can be implemented by software, or by a combination of software and hardware.

[0061] The second layer is a layer that has undergone specific processing, and its level is located between multiple first layers.

[0062] The blank layer has the same layer level as the second layer, and the color values ​​of the pixels in the blank layer are preset values; the preset value can be 0.

[0063] In one possible implementation, the color value can be a red (R) value, a green (G) value, or a blue (B) value.

[0064] Specific processing can refer to image enhancement, frame interpolation, and / or HDR processing.

[0065] The second layer can be a video layer.

[0066] The first layer can be a layer that does not require specific processing. For example, the first layer can be a regular user interface (UI) layer.

[0067] The second layer and multiple first layers can be combined into a single composite layer. The second layer is an intermediate layer, meaning it is neither the top nor the bottom layer. The multiple first layers include both the top and bottom layers.

[0068] Layers can be used to describe the vertical order of layers on the display screen plane.

[0069] The higher the layer level, the more prominent the layer appears in the vertical direction of the display screen plane.

[0070] For example, hierarchy can be described using Z-order. There is a Z-axis in the vertical direction of the screen plane, and the order of all layers is determined by their coordinates on the Z-axis.

[0071] Figure 3 This is a schematic diagram illustrating the order of multiple layers on the Z-axis, as provided in an embodiment of this application. Please refer to... Figure 3 Following the top-to-bottom order of display on the screen, the screen includes Layer 2, Layer 1, and Layer 0. The Z-orders of Layer 0, Layer 1, and Layer 2 are represented as 0, 1, and 2, respectively, meaning that the layer levels of Layer 0, Layer 1, and Layer 2 are 0, 1, and 2, respectively.

[0072] A blank layer can also be called a palette layer.

[0073] In one possible implementation, a specific layer to be composited and multiple first layers can be obtained first, and then a blank layer can be created based on the layer information of the specific layer.

[0074] A blank layer can be created based on the layer information of a specific layer before compositing multiple first layers; alternatively, a blank layer can be created based on the layer information of a specific layer during the compositing process of multiple first layers.

[0075] In one possible implementation, the specific layer to be composited, the blank layer, and multiple first layers can be obtained first, and then the layer information of the blank layer can be modified according to the layer information of the specific layer.

[0076] The layer information of a blank layer can be modified based on the layer information of a specific layer before compositing multiple first layers; alternatively, the layer information of a blank layer can be modified based on the layer information of a specific layer during the compositing process of multiple first layers.

[0077] The resulting blank layer has the same layer information as the specific layer, the only difference being the color values ​​of each pixel. In other words, the blank layer has the same layer information as the second layer, the only difference being the color values ​​of each pixel.

[0078] Layer information can refer to information such as the size, level, and opacity value of a layer.

[0079] In one possible implementation, after obtaining a specific layer, specific processing is required on that specific layer in order to obtain the second layer.

[0080] In one possible implementation, specific processing of a particular layer and compositing processing of multiple first layers can be performed simultaneously or not simultaneously, and this application does not limit this.

[0081] S202. Perform composite processing on multiple first layers and blank layers to obtain the first composite layer.

[0082] Blank layers and multiple first layers can be sent to the OSD channel of a GPU, 2D accelerator, or DPU for compositing.

[0083] The synthesis process can be alpha blending.

[0084] Compositing can refer to compositing layers sequentially from low to high layer levels.

[0085] For example, if there are three layers with levels 0, 1 and 2, you can first composite the layer with level 0 with the layer with level 1 to get composite layer 1; then composite layer 1 with the layer with level 2 to get composite layer 2.

[0086] Before compositing, it is necessary to determine the pixel position of each layer on the display screen. During compositing, the color values ​​of pixels in multiple layers that are at the same pixel position on the display screen are combined.

[0087] S203. Overlay the first composite layer and the second layer to obtain the second composite layer.

[0088] This can be achieved by overlaying the color values ​​of pixels in the first composite layer and the second layer that are at the same pixel position on the display screen.

[0089] DPU can be used to overlay the first composite layer and the second layer.

[0090] exist Figure 2 In the illustrated embodiment, a second layer and multiple first layers are obtained. The second layer is a layer that has undergone specific processing, and its layer level is located between the layers of the multiple first layers. A blank layer is created, with the same layer level as the second layer, and the color values ​​of the pixels in the blank layer are preset values. The multiple first layers and the blank layer are composited to obtain a first composite layer. The first composite layer and the second layer are then overlaid to obtain a second composite layer. By adding a blank layer, the problem of discontinuous layers among the multiple first layers can be solved, thereby resolving the technical problem of not being able to composite multiple layers. Furthermore, since the color values ​​of the pixels in the blank layer are preset values, the color values ​​of the first composite layer are simply a composite of the color values ​​of the multiple first layers. By then overlaying the color values ​​of the first composite layer with the color values ​​of the second layer, the correctness of the color values ​​of the final composite layer can be guaranteed.

[0091] exist Figure 2 Based on the illustrated embodiment, the following, in conjunction with Figure 4 Explain the process of layer compositing in detail.

[0092] Figure 4 This is a schematic flowchart illustrating another layer compositing method provided in an embodiment of this application. Please refer to... Figure 4 The method may include:

[0093] S401, Get the second layer, blank layer and multiple first layers.

[0094] It should be noted that the execution process of S401 can be found in the execution process of S201, and will not be repeated here.

[0095] S402. Perform a composite process on at least one first layer whose level is before the blank layer to obtain a third composite layer.

[0096] A layer that is above the layer of a blank layer can be represented as a layer that is below the layer of a blank layer.

[0097] If there is only one first layer that is at the level of the blank layer, then you don't need to composite it; you can directly use the first layer that is at the level of the blank layer to proceed to the next step.

[0098] If there are multiple first layers whose layer level precedes that of the blank layer, then these multiple first layers can be alpha-blended sequentially according to their layer level from low to high to obtain the third composite layer.

[0099] Before performing alpha blending, you need to set the transparency value of each layer. The transparency value can be represented as an alpha value.

[0100] Alpha blending is performed on the color values ​​of pixels in each layer that are at the same pixel position on the display screen, based on the transparency value.

[0101] S403. Combine the third composite layer with the blank layer to obtain the fourth composite layer.

[0102] In one possible implementation, the third composite layer and the blank layer can be composited to obtain the fourth composite layer in the following way:

[0103] Obtain the first transparency value of the third composite layer and the second transparency value of the blank layer. The second transparency value is the transparency value of the second layer. Based on the first transparency value, the color value of each pixel in the third composite layer, the second transparency value, and the color value of each pixel in the blank layer, determine the color value of each pixel in the fourth composite layer.

[0104] In one possible implementation, for any first pixel in the third composite layer, the color values ​​of each pixel in the fourth composite layer are determined based on the first transparency value, the color values ​​of each pixel in the third composite layer, the second transparency value, and the color values ​​of each pixel in the blank layer, including:

[0105] In the blank layer, determine the second pixel point, which has the same pixel position as the first pixel point on the display screen; based on the sum of the product of the color value and the first transparency value of the first pixel point and the product of the color value and the second transparency value of the second pixel point, determine the color value of the third pixel point, which is a pixel point in the fourth composite layer, and has the same pixel position as the first pixel point on the display screen.

[0106] In one possible implementation, the color value of each pixel in the fourth composite layer can be determined by the following formula: (1-α1)*p0+α1*P 空 .

[0107] Where α1 is the second transparency value of the blank layer, (1-α1) is the first transparency value of the third composite layer, p0 is the color value of a certain first pixel in the third composite layer, and P 空It is the color value of the second pixel in the blank layer that corresponds to the position of the first pixel in the third composite layer.

[0108] This step only calculates the color values ​​of pixels in the third composite layer, excluding the color values ​​of pixels in the blank layer. This can be achieved by adjusting the P... 空 Setting it to 0 achieves the desired effect, meaning the color value of each pixel in the fourth composite layer is (1-α1)*p0.

[0109] S404. Perform a composite process on the fourth composite layer and at least one first layer whose layer level is after the blank layer to obtain the first composite layer.

[0110] A layer that is below a blank layer can also be represented as a layer that is above a blank layer.

[0111] If there is only one first layer after the blank layer, the color value of each pixel in the first composite layer can be determined by the following formula: (1-α2)*(1-α1)*p0+α2*p2.

[0112] Where α1 is the second transparency value of the blank layer, (1-α1) is the first transparency value of the third composite layer, α2 is the transparency value of layer 2, p0 is the color value of a certain first pixel in the third composite layer, and p2 is the color value of the pixel in layer 2 that corresponds to the pixel position in the fourth composite layer; where layer 2 is the first layer after the layer of the blank layer.

[0113] If there are multiple first layers whose layer level is after the blank layer, the fourth composite layer and the multiple first layers can be alpha-blended sequentially according to the layer level from low to high to obtain the first composite layer.

[0114] S405. Overlay the first composite layer and the second layer to obtain the second composite layer.

[0115] In one possible implementation, the second composite layer can be obtained in the following way:

[0116] Obtain the second transparency value of the second layer and the third transparency value of the fifth composite layer; determine the color value of each pixel in the second composite layer based on the color value of each pixel in the first composite layer, the second transparency value, the third transparency value, and the color value of each pixel in the second layer.

[0117] The fifth composite layer is a layer obtained by compositing at least one first layer that is at a level after the second layer.

[0118] If there is only one first layer that is at the level of the second layer, then this first layer can be called the top layer, and the transparency value of the top layer can be directly used as the third transparency value.

[0119] If there are multiple first layers that are at the level of the second layer, then the multiple first layers that are at the level of the second layer can be composited to obtain the fifth composite layer, and then the third transparency value of the fifth composite layer can be determined.

[0120] In one possible implementation, for any fourth pixel in the first composite layer, the color values ​​of each pixel in the second composite layer are determined based on the color values, second transparency values, third transparency values, and color values ​​of each pixel in the second layer, including:

[0121] Determine the fifth pixel in the second layer, whose pixel position on the display screen is the same as that of the fourth pixel; determine the fourth transparency value based on the third transparency value, the sum of the fourth transparency value and the third transparency value equals 1; determine the color value of the sixth pixel based on the product of the fourth transparency value, the second transparency value, and the color value of the fifth pixel, and the sum of the color value of the fourth pixel; wherein, the sixth pixel is a pixel in the second composite layer, and the sixth pixel has the same pixel position on the display screen as the fourth pixel.

[0122] In one possible implementation, the color value of each pixel in the second composite layer can be determined by the following formula: blend_out0 + (1-α3)*α1*p1; where α1 is the second transparency value of the second layer, α3 is the third transparency value of the fifth composite layer, (1-α3) is the fourth transparency value, p1 is the color value of the fifth pixel in the second layer, and blend_out0 is the color value of the fourth pixel in the first composite layer, wherein the fifth pixel and the fourth pixel have the same pixel position on the display screen.

[0123] Based on the color value of the fourth pixel in the first composite layer, the color value of the fifth pixel corresponding to the fourth pixel in the second layer, the transparency value of the second layer itself, and the transparency value of the layers after the second layer are added to calculate the color value of the pixels in the final composite layer, so as to ensure the correctness of the color values ​​of the pixels in the final composite layer.

[0124] In one possible implementation, the second composite layer can be obtained by overlaying the first composite layer and the second layer in the following ways:

[0125] Determine the seventh pixel in the first composite layer; if there is no pixel in the second layer with the same pixel position as the seventh pixel on the display screen, then determine the color value of the seventh pixel as the color value of the eighth pixel; wherein, the eighth pixel is a pixel in the second composite layer, and the eighth pixel and the seventh pixel have the same pixel position on the display screen.

[0126] exist Figure 4 In the illustrated embodiment, a second layer, a blank layer, and multiple first layers are obtained. The second layer is a layer that has undergone specific processing, and its layer level is located between the layers of the multiple first layers. At least one first layer whose layer level is before the blank layer is composited to obtain a third composite layer. The third composite layer and the blank layer are composited to obtain a fourth composite layer. The fourth composite layer and at least one first layer whose layer level is after the blank layer are composited to obtain a first composite layer. The first composite layer and the second layer are overlaid to obtain a second composite layer. By adding a blank layer, the problem of discontinuous layers among the multiple first layers can be solved, thereby solving the technical problem of not being able to composite multiple layers. At the same time, since the color values ​​of the pixels in the blank layer are preset values, the color values ​​of the first composite layer are only composite values ​​of the color values ​​of multiple first layers. By overlaying the color values ​​of the first composite layer and the color values ​​of the second layer, the correctness of the color values ​​of the final composite layer can be guaranteed.

[0127] To make it easier to understand, the following example of combining three layers into a second composite layer will be used to explain the layer compositing process in detail.

[0128] The three layers are arranged in ascending order of hierarchy as Layer 0, Layer 1, and Layer 2. The color value of the pixels in Layer 0 is represented by P0, the color value of the pixels in Layer 1 is represented by P1, the transparency value of Layer 1 is represented by α1, the color value of the pixels in Layer 2 is represented by P2, and the transparency value of Layer 2 is represented by α2. Layer 1 is a layer that has undergone specific processing.

[0129] S1. Create a blank layer.

[0130] The transparency value of the blank layer is equal to that of layer 1. The color value of the pixels in the blank layer is set to 0. The layer level of the blank layer is the same as that of layer 1.

[0131] S2. Perform alpha blending on the blank layer and layer 0 to obtain composite layer 1.

[0132] The color value of the pixel in the composite layer 1 = (1-α1)*p0 + α1*0 = (1-α1)*p0.

[0133] S3. Perform alpha blending on composite layer 1 and layer 2 to obtain composite layer 2.

[0134] The color value of the pixel in the composite layer 2 is (1-α2)*(1-α1)*p0+α2*p2.

[0135] S4. First, perform PQ processing on layer 1, and then overlay it with composite layer 2 to obtain composite layer 3.

[0136] The color value of the pixel in the composite layer 3 is (1-α2)*(1-α1)*p0+α2*p2+(1-α2)*α1*p1.

[0137] It should be noted that the pixels in the different layers mentioned above all refer to pixels that are in the same position on the display screen.

[0138] Figure 5 A schematic diagram of a layer compositing device provided for the implementation of this application. Please refer to... Figure 5 The device 10 includes an acquisition module 11, a synthesis processing module 12, and a superposition processing module 13, wherein...

[0139] The acquisition module 11 is used to acquire the second layer, the blank layer and multiple first layers. The second layer is a layer that has undergone specific processing. The second layer is located between multiple first layers. The layer level of the blank layer is the same as that of the second layer. The color value of the pixels in the blank layer is a preset value.

[0140] The compositing module 12 is used to composite multiple first layers and blank layers to obtain a first composite layer;

[0141] The overlay processing module 13 is used to overlay the first composite layer and the second layer to obtain the second composite layer.

[0142] In one possible implementation, the synthesis processing module 12 is specifically used for:

[0143] At least one first layer whose layer level is before the blank layer is composited to obtain a third composite layer;

[0144] The third composite layer and the blank layer are combined to obtain the fourth composite layer;

[0145] The fourth composite layer is composited with at least one first layer whose layer is after the blank layer to obtain the first composite layer.

[0146] In one possible implementation, the synthesis processing module 12 is specifically used for:

[0147] Obtain the first transparency value of the third composite layer and the second transparency value of the blank layer, wherein the second transparency value is the transparency value of the second layer;

[0148] The color values ​​of each pixel in the fourth composite layer are determined based on the first transparency value, the color values ​​of each pixel in the third composite layer, the second transparency value, and the color values ​​of each pixel in the blank layer.

[0149] In one possible implementation, for any first pixel in the third composite layer, the composite processing module 13 is specifically used for:

[0150] A second pixel is determined in the blank layer, and the second pixel has the same pixel position as the first pixel on the display screen;

[0151] The color value of the third pixel is determined by summing the product of the color value and the first transparency value of the first pixel and the product of the color value and the second transparency value of the second pixel. The third pixel is a pixel in the fourth composite layer, and the third pixel has the same pixel position as the first pixel on the display screen.

[0152] In one possible implementation, the overlay processing module 13 is specifically used for:

[0153] Obtain the second transparency value of the second layer and the third transparency value of the fifth composite layer, wherein the fifth composite layer is a layer obtained by compositing at least one first layer whose layer is after the second layer;

[0154] The color values ​​of each pixel in the second composite layer are determined based on the color values ​​of each pixel in the first composite layer, the second transparency value, the third transparency value, and the color values ​​of each pixel in the second layer.

[0155] In one possible implementation, for any fourth pixel in the first composite layer, the overlay processing module 13 is specifically used for:

[0156] Determine the fifth pixel in the second layer, wherein the fifth pixel has the same pixel position as the fourth pixel on the display screen;

[0157] Based on the third transparency value, the fourth transparency value is determined, and the sum of the fourth transparency value and the third transparency value is equal to 1;

[0158] The color value of the sixth pixel is determined by summing the product of the fourth transparency value, the second transparency value, and the color value of the fifth pixel with the color value of the fourth pixel.

[0159] The sixth pixel is a pixel in the second composite layer, and the sixth pixel has the same pixel position as the fourth pixel on the display screen.

[0160] In one possible implementation, the overlay processing module 13 is specifically used for:

[0161] Determine the seventh pixel in the first composite layer;

[0162] If there is no pixel in the second layer that has the same pixel position as the seventh pixel on the display screen, then the color value of the seventh pixel is determined as the color value of the eighth pixel.

[0163] The eighth pixel is a pixel in the second composite layer, and the eighth pixel has the same pixel position as the seventh pixel on the display screen.

[0164] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to... Figure 6 Electronic device 20 may include a transceiver 21, a memory 22, and a processor 23. Transceiver 21 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, transmitter port, or transmitter interface, and the receiver may also be referred to as a receiver, receiver port, or receiver interface, etc. Exemplarily, transceiver 22, memory 22, and processor 23 are interconnected via bus 24.

[0165] Memory 22 is used to store program instructions;

[0166] The processor 23 is used to execute the program instructions stored in the memory, so that the electronic device 20 performs any of the layer compositing methods shown above.

[0167] Transceiver 21 is used to perform the sending and receiving functions of electronic device 20 in the layer compositing method.

[0168] Electronic devices 20 can be chips, modules, integrated development environments (IDEs), etc.

[0169] This application provides a computer-readable storage medium storing computer-executable instructions, which are used to implement the above-described layer compositing method when executed by a processor.

[0170] This application also provides a computer program product that can be executed by a processor. When the computer program product is executed, the above-described layer compositing method can be implemented.

[0171] This application provides a chip on which a computer program is stored. When the computer program is executed by the chip, it implements the above-described layer compositing method.

[0172] In one possible implementation, the chip is a chip in a chip module.

[0173] The layer compositing apparatus, electronic device, computer-readable storage medium, and computer program product of this application can execute the technical solutions shown in the above-described layer compositing method embodiments. Their implementation principles and beneficial effects are similar and will not be described again here.

[0174] All or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.

[0175] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0176] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.

[0177] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0178] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.

Claims

1. A layer compositing method, characterized in that, include: Obtain a second layer, a blank layer, and multiple first layers. The second layer is a layer that has undergone specific processing. The layer level of the second layer is located between the layers of the multiple first layers. The layer level of the blank layer is the same as the layer level of the second layer. The second transparency value of the blank layer is the transparency value of the second layer. The color value of the pixels in the blank layer is a preset value. The specific processing refers to image quality enhancement, frame interpolation, and / or HDR processing. The multiple first layers and the blank layer are composited to obtain a first composite layer; The first composite layer and the second layer are overlaid to obtain the second composite layer; The multiple first layers and the blank layer are composited to obtain a first composite layer, including: At least one first layer whose layer level is before the blank layer is composited to obtain a third composite layer; The third composite layer and the blank layer are combined to obtain the fourth composite layer; The fourth composite layer is composited with at least one first layer whose layer is after the blank layer to obtain the first composite layer.

2. The method according to claim 1, characterized in that, The third composite layer and the blank layer are combined to obtain a fourth composite layer, including: Obtain the first transparency value of the third composite layer and the second transparency value of the blank layer; The color values ​​of each pixel in the fourth composite layer are determined based on the first transparency value, the color values ​​of each pixel in the third composite layer, the second transparency value, and the color values ​​of each pixel in the blank layer.

3. The method according to claim 2, characterized in that, For any first pixel in the third composite layer, the color values ​​of each pixel in the fourth composite layer are determined based on the first transparency value, the color values ​​of each pixel in the third composite layer, the second transparency value, and the color values ​​of each pixel in the blank layer, including: A second pixel is determined in the blank layer, and the second pixel has the same pixel position as the first pixel on the display screen; The color value of the third pixel is determined by summing the product of the color value and the first transparency value of the first pixel and the product of the color value and the second transparency value of the second pixel. The third pixel is a pixel in the fourth composite layer, and the third pixel has the same pixel position as the first pixel on the display screen.

4. The method according to any one of claims 1 to 3, characterized in that, The first composite layer and the second layer are overlaid to obtain a second composite layer, which includes: Obtain the second transparency value of the second layer and the third transparency value of the fifth composite layer, wherein the fifth composite layer is a layer obtained by compositing at least one first layer whose layer is after the second layer; The color values ​​of each pixel in the second composite layer are determined based on the color values ​​of each pixel in the first composite layer, the second transparency value, the third transparency value, and the color values ​​of each pixel in the second layer.

5. The method according to claim 4, characterized in that, For any fourth pixel in the first composite layer, the color value of each pixel in the second composite layer is determined based on the color value of each pixel in the first composite layer, the second transparency value, the third transparency value, and the color value of each pixel in the second layer, including: Determine the fifth pixel in the second layer, wherein the fifth pixel has the same pixel position as the fourth pixel on the display screen; A fourth transparency value is determined based on the third transparency value, and the sum of the fourth transparency value and the third transparency value is equal to 1; The color value of the sixth pixel is determined by summing the product of the fourth transparency value, the second transparency value, and the color value of the fifth pixel with the color value of the fourth pixel. The sixth pixel is a pixel in the second composite layer, and the sixth pixel has the same pixel position as the fourth pixel on the display screen.

6. The method according to any one of claims 1 to 3, characterized in that, The first composite layer and the second layer are overlaid to obtain a second composite layer, which includes: Determine the seventh pixel in the first composite layer; If there is no pixel in the second layer that has the same pixel position as the seventh pixel on the display screen, then the color value of the seventh pixel is determined as the color value of the eighth pixel. The eighth pixel is a pixel in the second composite layer, and the eighth pixel has the same pixel position as the seventh pixel on the display screen.

7. A layer compositing device, characterized in that, It includes an acquisition module, a synthesis processing module, and an overlay processing module, among which, The acquisition module is used to acquire a second layer, a blank layer, and multiple first layers. The second layer is a layer that has undergone specific processing. The second layer is located between the multiple first layers. The layer level of the blank layer is the same as that of the second layer. The second transparency value of the blank layer is the transparency value of the second layer. The color value of the pixels in the blank layer is a preset value. The specific processing refers to image quality enhancement, frame interpolation, and / or HDR processing. The compositing module is used to composit the plurality of first layers and the blank layer to obtain a first composite layer; The overlay processing module is used to overlay the first composite layer and the second layer to obtain a second composite layer; The synthesis processing module is specifically used for: At least one first layer whose layer level is before the blank layer is composited to obtain a third composite layer; The third composite layer and the blank layer are combined to obtain the fourth composite layer; The fourth composite layer is composited with at least one first layer whose layer is after the blank layer to obtain the first composite layer.

8. An electronic device, characterized in that, include: Processor and memory; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, are used to implement the method described in any one of claims 1 to 6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Frame insertion method and device and electronic equipment

    CN114339313A