Image encoding and decoding device and method

By introducing shared and private reference frame cache modules into the image encoding and decoding system, the encoding method is selected based on scene recognition, which solves the problem of high code flow caused by insufficient reference between encoders in multi-screen desktop scenes, and achieves more efficient encoding and decoding. process.

CN118400541BActive Publication Date: 2024-10-18XIAN WANXIANG ELECTRONICS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410814482.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-10-18
Estimated Expiration
2044-06-24

AI Technical Summary

Technical Problem

In a multi-screen desktop scenario, since there is no intra-frame or inter-frame reference between different encoders, redundant information is not eliminated during the encoding process, resulting in a high bit rate.

Method used

Using an image encoding device and method, by using a shared reference frame cache module and a private reference frame cache module at the encoding end and the decoding end respectively, the encoding module and the decoding module are allowed to share or independently use reference frames during the encoding and decoding processes, and identify the scene according to the scene. Choose different encoding methods to reduce or increase the code rate.

Benefits of technology

It effectively reduces the high bitrate problem caused by insufficient reference frame sharing during multi-screen encoding, improves encoding efficiency, and optimizes resource utilization and encoding performance in different scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118400541B_ABST
    Figure CN118400541B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image coding and decoding device and method, which relates to the field of image coding and decoding, and can solve the problem of high code stream caused by the inability to share reference frames between multiple encoders during image coding and decoding. The image coding device includes a first control module, N coding modules and a first shared reference frame cache module, and the N coding modules correspond to N coding areas respectively, wherein the first control module includes a first control submodule, and the first control submodule is used to control each coding module to read the first shared reference frame from the first shared reference frame cache module for encoding during encoding; each coding module is used to encode the image of each coding area, and write the updated reference frame into the first shared reference frame cache module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer graphics, and in particular to an image coding and decoding device and method. Background Art

[0002] In the prior art, based on a multi-screen desktop scenario, the encoding end will separately encode each small desktop image used to compose the entire large screen. Similarly, the decoding end will also decode each small desktop image separately and then splice them. In this process, since the picture itself is a whole, it is artificially divided during the encoding and decoding process. At the encoding end, since different encoders encode different areas, within the same frame, the areas governed by different encoders cannot be referenced within the frame; between different frames, the areas governed by different encoders cannot be referenced between frames. This will result in a lot of redundant information not being eliminated during the encoding process, and ultimately lead to a relatively high overall bit rate for encoding. Summary of the invention

[0003] The embodiments of the present disclosure provide an image coding and decoding device and method, which can solve the problem that different frames and different encoders cannot refer to each other during the above-mentioned image coding and decoding process, resulting in a lot of redundant information not being eliminated during the coding process, and ultimately resulting in a relatively high overall coding bit rate. The technical solution is as follows:

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image encoding device, the image encoding device comprising a first control module, N encoding modules and a first shared reference frame buffer module, the N encoding modules respectively corresponding to N encoding areas, wherein N>1;

[0005] The first control module includes a first control submodule, and the first control submodule is used to control each encoding module to read the first shared reference frame from the first shared reference frame cache module for encoding during encoding;

[0006] Each encoding module is used to encode the image of each encoding area and write the updated reference frame into the first shared reference frame cache module.

[0007] The embodiments provided by the present disclosure can solve the problem of high bitrate caused by the inability to share reference frames between multiple encoders during image encoding and decoding.

[0008] In some optional embodiments, each encoding module includes:

[0009] A collection submodule, used for collecting images of the coding area corresponding to the coding module;

[0010] The first encoding submodule is used to read the first shared reference frame from the first shared reference frame cache module, and encode the image of the encoding area corresponding to the encoding module based on the first shared reference frame.

[0011] In some optional embodiments, the first control module further includes a first scene recognition submodule;

[0012] A first scene recognition submodule, used to recognize whether the current scene is the first scene or the second scene;

[0013] When the first scene recognition submodule recognizes that the current scene is the first scene, the first control submodule is used to control each encoding module to read the first shared reference frame from the first shared reference frame buffer module for encoding during encoding.

[0014] The embodiments provided in the present disclosure can perform scene recognition and select different encoding methods based on the scenes, which can reduce the bit rate in the case of the first scene.

[0015] In some optional embodiments, each encoding module further includes a first private reference frame buffer submodule and a second encoding submodule;

[0016] When the first scene recognition submodule recognizes that the current scene is the second scene, the first control submodule is also used to control the second encoding submodule to read the first private reference frame from the first private reference frame cache submodule, and the second encoding submodule encodes the image of the encoding area corresponding to the encoding module based on the first private reference frame.

[0017] In some optional embodiments, the first control submodule is further used to control the second encoding submodule to write the updated reference frame into the first private reference frame cache submodule after encoding the image of the encoding area corresponding to the encoding module based on the first private reference frame.

[0018] The embodiments provided in the present disclosure can perform scene recognition and select different encoding methods based on the scenes, which can improve the encoding efficiency in the case of the second scene.

[0019] In some optional embodiments, the first scene recognition submodule is specifically used for:

[0020] Determine whether the number of repeated macroblocks in the continuous R frame image exceeds a first preset threshold, and if the number of repeated macroblocks in the continuous R frame image exceeds the first preset threshold, identify the current scene as the first scene, wherein R is greater than 2;

[0021] Alternatively, determining whether the number of macroblocks whose contrast ratios of consecutive P frame images are higher than a preset contrast ratio exceeds a second preset threshold value, and if the number of macroblocks whose contrast ratios of consecutive P frame images are higher than a preset contrast ratio exceeds the second preset threshold value, identifying that the current scene is the first scene, wherein P is greater than 2;

[0022] Alternatively, it is determined whether the frame rate of the continuous Q frame images is constant. If the frame rate of the continuous Q frame images is not constant, it is identified that the current scene is the first scene, wherein Q is greater than 2.

[0023] In some optional embodiments, the first scene recognition submodule is specifically used for:

[0024] Determine whether the number of repeated macroblocks in the continuous R frame image frames exceeds a first preset threshold, and if the number of repeated macroblocks in the continuous R frame image frames does not exceed the first preset threshold, identify the current scene as the second scene, wherein R is greater than 2;

[0025] Alternatively, determining whether the number of macroblocks whose contrasts of consecutive P frame images are all higher than a preset contrast exceeds a second preset threshold, and identifying that the current scene is the second scene when the number of macroblocks whose contrasts of consecutive P frame images are all higher than the preset contrast does not exceed the second preset threshold, wherein P is greater than 2;

[0026] Alternatively, it is determined whether the frame rate of the continuous Q frame images is constant. If the frame rate of the continuous Q frame images is constant, it is identified that the current scene is the second scene, wherein Q is greater than 2.

[0027] The embodiments provided in the present disclosure can identify a first scene and a second scene based on multiple situations, wherein the first scene is a computer screen scene and the second scene is a natural video scene.

[0028] According to a second aspect of an embodiment of the present disclosure, an image decoding device is provided, the image decoding device comprising a second control module, M decoding modules, and a second shared reference frame buffer module; the M decoding modules correspond to M decoding areas respectively, where M>1;

[0029] The second control module includes a second control submodule, and the second control submodule is used to control each decoding module to read the second shared reference frame from the second shared reference frame cache module for decoding during decoding;

[0030] Each decoding module is used to decode the image of each decoding area and write the updated reference frame into the second shared reference frame cache module.

[0031] In some optional embodiments, each decoding module includes a first decoding submodule, and each first decoding submodule is used to decode the image of each decoding area based on the second shared reference frame and write the updated reference frame into the second shared reference frame cache module.

[0032] In some optional embodiments, the second control module further includes a second scene recognition submodule;

[0033] A second scene recognition submodule, used to recognize whether the current scene is the first scene or the second scene;

[0034] When the second scene recognition submodule recognizes that the current scene is the first scene, the second control submodule is used to control each decoding module to read the second shared reference frame from the second shared reference frame buffer module for decoding during decoding.

[0035] In some optional embodiments, each decoding module further includes a second private reference frame buffer submodule and a second decoding submodule;

[0036] When the second scene recognition submodule recognizes that the current scene is the second scene, the second control submodule is also used to control the second decoding submodule to read the second private reference frame from the second private reference frame cache submodule, and the second decoding submodule decodes the image of the decoding area corresponding to the decoding module based on the second private reference frame.

[0037] In some optional embodiments, the second control submodule is further used to control the second decoding submodule to write the updated reference frame into the second private reference frame cache submodule after decoding the image of the decoding area corresponding to the decoding module based on the second private reference frame.

[0038] According to a third aspect of an embodiment of the present disclosure, there is provided an image encoding method, which is applied to the image encoding device described in the first aspect above, and the image encoding method includes:

[0039] Acquire an image of a coding area corresponding to a coding module;

[0040] A first shared reference frame is read from a first shared reference frame cache module, and an image of a coding area corresponding to the coding module is encoded based on the first shared reference frame.

[0041] In some optional embodiments, before reading the first shared reference frame from the first shared reference frame cache module and encoding the image of the encoding area corresponding to the encoding module based on the first shared reference frame, the method further includes:

[0042] Identify whether the current scene is the first scene or the second scene. When the current scene is identified as the first scene, execute the steps of reading the first shared reference frame from the first shared reference frame cache module, and encoding the image of the encoding area corresponding to the encoding module based on the first shared reference frame.

[0043] In some optional embodiments, the method further comprises:

[0044] When the current scene is identified as the second scene, a first private reference frame is read from the first private reference frame cache submodule, and an image in a coding area corresponding to the coding module is encoded based on the first private reference frame.

[0045] In some optional embodiments, after encoding the image of the encoding area corresponding to the encoding module based on the first private reference frame, the method further includes:

[0046] The updated reference frame is written into the first private reference frame buffer submodule.

[0047] According to a fourth aspect of an embodiment of the present disclosure, there is provided an image decoding method, which is applied to the image decoding device described in the second aspect above. The image decoding method includes:

[0048] Reading a second shared reference frame from a second shared reference frame cache module;

[0049] The image of each decoding area is decoded respectively based on the second shared reference frame, and the updated reference frame is written into the second shared reference frame cache module.

[0050] In some optional embodiments, before reading the second shared reference frame from the second shared reference frame cache module, the method further includes:

[0051] It is identified that the current scene is the first scene or the second scene. When the current scene is identified as the first scene, a step of reading the second shared reference frame from the second shared reference frame cache module is performed.

[0052] In some optional embodiments, the method further comprises:

[0053] When the current scene is identified as the second scene, a second private reference frame is read from the second private reference frame buffer submodule, and an image in a decoding area corresponding to the decoding module is decoded based on the second private reference frame.

[0054] In some optional embodiments, after decoding the image of the coding area corresponding to the decoding module based on the second private reference frame, the method further includes:

[0055] The updated reference frame is written into the second private reference frame buffer submodule.

[0056] The image encoding and decoding method provided by the present disclosure is applied to multi-screen encoding, and can adaptively detect screen image scenes, and combine the reference frames of each screen in the first scene and put them into a shared reference frame cache module for reference by each encoder instance to reduce the code rate. In the second scene, the reference frames are respectively put into the private reference frame cache modules corresponding to each encoding module to improve the encoding efficiency.

[0057] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0059] Figure 1 is an architecture diagram of an image encoding and decoding system provided by an embodiment of the present disclosure;

[0060] Figure 2 is a structural diagram of an image encoding device provided by an embodiment of the present disclosure;

[0061] Figure 3 is a structural diagram of an encoding module of an image encoding device provided by an embodiment of the present disclosure;

[0062] Figure 4 is a structural diagram of a first control module of an image encoding device provided by an embodiment of the present disclosure;

[0063] Figure 5 is a structural diagram of an encoding module of an image encoding device provided by an embodiment of the present disclosure;

[0064] Figure 6 is a structural schematic diagram of an image decoding device provided by an embodiment of the present disclosure;

[0065] Figure 7 is a structural schematic diagram of a second control module of an image decoding device provided by an embodiment of the present disclosure;

[0066] Figure 8 is a structural schematic diagram of a decoding module of an image decoding device provided by an embodiment of the present disclosure;

[0067] Fig. 9 is a flowchart of an image encoding method provided by an embodiment of the present disclosure;

[0068] Fig.10 is a flowchart of an image encoding method provided by an embodiment of the present disclosure;

[0069] Fig.11 is a flowchart of an image decoding method provided by an embodiment of the present disclosure;

[0070] Fig.12 is a flowchart of an image decoding method provided by an embodiment of the present disclosure;

[0071] Fig.13 It is a schematic diagram of a multi-region encoding provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0072] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0073] like Figure 1 As described, the image coding and decoding method provided by the embodiment of the present disclosure can be applied to an image coding and decoding system, and the image coding and decoding system includes an encoding end (coding device or image coding device) 10 and a decoding end (decoding device or image decoding device) 20. The encoding end 10 includes multiple encoding modules and multiple encoding areas, wherein the multiple encoding modules correspond to the multiple encoding areas one by one, and the encoding module is used to obtain the image to be encoded from the encoding area corresponding to it and encode it. In addition, each encoding module corresponds to a private reference frame cache module that is only accessible to itself, and at the same time, the encoding end 10 also includes a shared reference frame cache module, and all encoding modules can access the shared reference frame cache module. The decoding end 20 includes multiple decoding modules, each decoding module corresponds to an encoding module of the encoding end, and is used to decode the encoded image sent after the corresponding encoding module is encoded. At the same time, similar to the encoding end, each decoding module also corresponds to a private reference frame cache module that is only accessible to itself, and at the same time, the decoding end also includes a shared reference frame cache module, and each decoding module can access the shared reference frame cache module. Based on the above coding and decoding system, each coding module can choose to encode based on a private reference frame or a shared reference frame according to the characteristics of the image to be encoded. At the encoding end 10, the collected images are composed of multiple macroblocks.

[0074] In some embodiments, the encoding end and the decoding end include but are not limited to one of a server, a mobile smart terminal, a vehicle-mounted smart terminal, a smart TV, a wearable device, etc. The embodiment of the present invention describes the image encoding and decoding method in detail, but is not limited to the specifics.

[0075] In some embodiments, Figure 2 As shown, the image encoding device 10 includes a first control module 101, N encoding modules 102 and a first shared reference frame buffer module 103, wherein the N encoding modules correspond to N encoding regions respectively, wherein N>1;

[0076] The first control module 101 includes a first control submodule 1011, and the first control submodule 1011 is used to control each encoding module 102 to read the first shared reference frame from the first shared reference frame cache module 103 for encoding during encoding;

[0077] Each encoding module 102 is used to encode the image of each encoding area, and write the updated reference frame into the first shared reference frame cache module 103; that is, the first shared reference frame cache module 103 is used to store the reference frames updated by all encoding modules 102 in the current image encoding device 10 after encoding, and the reference frames stored in the first shared reference frame cache module 103 are called shared reference frames. Therefore, each encoding module 102 in the encoding device 10 provided by the present disclosure can encode based on the reference frames updated by all encoding modules 102 after encoding. This encoding method can improve encoding efficiency and reduce encoding bit stream.

[0078] In some optional embodiments, such as Figure 3 As shown, each encoding module 102 includes:

[0079] The acquisition submodule 1021 is used to acquire an image of the coding area corresponding to the coding module;

[0080] The first encoding submodule 1022 is configured to read the first shared reference frame from the first shared reference frame buffer module 103, and encode the image in the encoding area corresponding to the encoding module based on the first shared reference frame.

[0081] In some optional embodiments, such as Figure 4 As shown, the first control module 101 also includes a first scene recognition submodule 1012;

[0082] A first scene recognition submodule 1012, used to recognize whether the current scene is the first scene or the second scene;

[0083] When the first scene recognition submodule 1012 recognizes that the current scene is the first scene, the first control submodule 1011 is used to control each encoding module to read the first shared reference frame from the first shared reference frame buffer module 103 for encoding during encoding.

[0084] In some embodiments, the first scene is a computer graphics scene and the second scene is a natural video scene.

[0085] In some optional embodiments, such as Figure 5 As shown, each encoding module 102 further includes a first private reference frame buffer submodule 1023 and a second encoding submodule 1024;

[0086] When the first scene recognition submodule 1012 recognizes that the current scene is the second scene, the first control submodule 1011 is also used to control the second encoding submodule 1024 to read the first private reference frame from the first private reference frame cache submodule 1023, and the second encoding submodule 1024 encodes the image of the encoding area corresponding to the encoding module based on the first private reference frame.

[0087] Optionally, the first control submodule 1011 is further configured to control the second encoding submodule 1024 to write the updated reference frame into the first private reference frame cache submodule 1023 after encoding the image of the encoding area corresponding to the encoding module based on the first private reference frame.

[0088] In the specific implementation process, each encoding module 102 may start an encoding instance in the computer, and N encoding modules start N encoding instances. The encoding module may specifically use intra-frame or inter-frame prediction encoding, and the specific encoding core technology may use H264, H265, etc. The embodiment of the present invention does not limit the specific encoding algorithm, and all current encoders use intra-frame and inter-frame prediction as core technologies.

[0089] The first private reference frame cache submodule in the encoding module is not accessible to other encoder instances. This part is compatible with the current encoder and does not require additional modification. That is, the encoding module can use the first private reference frame cache submodule in natural video scenes, and can use the reference frames in the first shared reference frame cache module in computer screen scenes, thereby achieving automatic scene-based recognition and selecting different encoding methods based on the scene, which can reduce the bit rate.

[0090] In some optional embodiments, the first scene recognition submodule 1012 is specifically used to: determine whether the number of repeated macroblocks in the continuous R frame image frame exceeds the first preset threshold, and if the number of repeated macroblocks in the continuous R frame image frame exceeds the first preset threshold, recognize that the current scene is the first scene, where R is greater than 2;

[0091] In this case, determine whether there is intra-frame repeated content in the continuously appearing pictures. If there are intra-frame repeated macroblocks in consecutive R frames (R is an empirical value, which can be 5, 10, etc.), and the number of such macroblocks exceeds a certain proportion (for example, 20%) of the total number of macroblocks in the full frame, the current picture scene is considered to be a computer screen scene. The so-called intra-frame repeated content refers to the fact that the content of a certain macroblock is exactly the same as the content of macroblocks in other areas of the frame. In computer screen scenes, this phenomenon is very common. For example, browser backgrounds, repeated text in editors, etc., often have such identical macroblocks. The high proportion of such repeated macroblocks is a significant feature of computer screen scenes.

[0092] In some optional embodiments, the first scene recognition submodule 1012 is specifically used to: determine whether the number of macroblocks whose contrast of consecutive P frame images is higher than the preset contrast exceeds a second preset threshold, and if the number of macroblocks whose contrast of consecutive P frame images is higher than the preset contrast exceeds the second preset threshold, recognize that the current scene is the first scene, where P is greater than 2;

[0093] In this case, if there are a large number of high-contrast, sharp-edged lines in consecutive P frames, it can be judged as a computer screen scene. Due to its own characteristics, natural videos generally have few sudden and regular elements such as icon edges and text lines on computer screens, which is also a feature for judging computer screen images. P is an empirical value and can be set by the user.

[0094] In some optional embodiments, the first scene recognition submodule 1012 is specifically used to: determine whether the frame rate of consecutive Q frame images is constant, and if the frame rate of consecutive Q frame images is not constant, recognize that the current scene is the first scene, where Q is greater than 2.

[0095] In any of the above three situations, the identification is the first scenario. If none of the above three situations are met, the identification is the second scenario.

[0096] Since the source of natural video is captured by a camera, once it is displayed, the frame rate of the image sent by the acquisition module is generally relatively constant, such as 30fps. However, the characteristics of computer screen images are: if the elements on the screen are not refreshed, the picture will not change. A typical example is a static desktop without anyone operating it. At this time, the operating system does not render the picture, and the acquisition module will not send data to the encoder. In other words, the frame rate may be very low at this time. When the user starts to operate the computer, such as dragging a window, the acquisition module continuously collects images and sends them to the encoder due to changes in the picture. Therefore, in the computer screen image scene, the frame rate is often unstable and may be 0 at a low time. This is also a condition for determining the screen scene. Q is also an empirical value and can be set by the user.

[0097] If it is determined that the current scene is a computer screen scene, the first control module 101 notifies the encoding module 102 to reconstruct the reference frame after encoding each frame, that is, the "reference frame" used when encoding the subsequent frames is placed in the first shared reference frame cache module 103, and when encoding subsequent frames, the encoding instance of each screen will obtain the reference frame reference from the first shared reference frame cache module 103 according to the instruction of the first control module 101. If the first scene recognition submodule 1012 recognizes that the current scene is a natural video scene, it notifies each encoding instance to encode independently and put their own reference frames into their own internal cache area, that is, the first private reference frame cache submodule 1023.

[0098] like Figure 6 As shown, the embodiment of the present disclosure further provides an image decoding device 20, which includes a second control module 201, M decoding modules 202 and a second shared reference frame buffer module 203; the M decoding modules 202 correspond to M decoding areas respectively, where M>1;

[0099] The second control module 201 includes a second control submodule 2011, and the second control submodule 2011 is used to control each decoding module 202 to read the second shared reference frame from the second shared reference frame cache module 203 for decoding during decoding;

[0100] Each decoding module 202 is used to decode the image of each decoding area and write the updated reference frame into the second shared reference frame buffer module 203.

[0101] In some optional embodiments, such as Figure 8 As shown, each decoding module 202 includes a first decoding submodule 2021 , which is used to decode the image of each decoding area based on the second shared reference frame and write the updated reference frame into the second shared reference frame cache module 203 .

[0102] In some optional embodiments, such as Figure 7 As shown, the second control module 201 also includes a second scene recognition submodule 2012;

[0103] The second scene recognition submodule 2012 is used to recognize whether the current scene is the first scene or the second scene;

[0104] When the second scene recognition submodule 2012 recognizes that the current scene is the first scene, the second control submodule 2011 is used to control each decoding module 202 to read the second shared reference frame from the second shared reference frame buffer module 203 for decoding during decoding.

[0105] Specifically, the second scene recognition submodule 2012 receives the notification message from the first scene recognition submodule 1012 to identify whether the current scene is the first scene or the second scene.

[0106] In some optional embodiments, such as Figure 8 As shown, each decoding module 202 further includes a second private reference frame buffer submodule 2022 and a second decoding submodule 2023;

[0107] When the second scene recognition submodule 2012 recognizes that the current scene is the second scene, the second control submodule 2011 is also used to control the second decoding submodule 2023 to read the second private reference frame from the second private reference frame cache submodule 2022, and the second decoding submodule 2023 decodes the image of the decoding area corresponding to the decoding module based on the second private reference frame.

[0108] Optionally, the second control submodule 2011 is further used to control the second decoding submodule 2023 to write the updated reference frame into the second private reference frame cache submodule 2022 after decoding the image of the decoding area corresponding to the decoding module based on the second private reference frame.

[0109] Based on the image encoding device 10 and the image decoding device 20, in a computer multi-screen display scenario, there are often some identical or similar areas between different screens, and the solution provided by the present invention can reduce the code stream. If the current scene is a natural video scene, and it suddenly becomes a computer screen scene, after the first scene recognition submodule 1012 analyzes this change, on the one hand, it will notify the encoder instance of each screen to switch the position of the reference frame buffer, and on the other hand, it will send a message to the decoding end to notify this information. After receiving the message, the control module 201 in the image decoding device 20 immediately notifies the decoding instance (decoding module 202) of each screen to make corresponding changes, put the reference frame into the second shared reference frame cache module 203, and when decoding each subsequent frame, the reference frame in the second shared reference frame cache module 203 will be used for reference. On the contrary, if it is a natural video scene, under the notification of the first scene recognition submodule 1012, the second private reference frame cache submodule 2022 and the second decoding submodule 2023 will be enabled.

[0110] like Fig. 9 As shown, the embodiment of the present disclosure further provides an image encoding method, which is applied to the image encoding device 10 described above, and the image encoding method includes:

[0111] Step 301: Acquire an image of a coding area corresponding to a coding module;

[0112] Step 303: read a first shared reference frame from a first shared reference frame cache module, and encode an image in a coding area corresponding to the coding module based on the first shared reference frame.

[0113] like Fig.10 As shown, in some optional embodiments, before step 303, the method further includes:

[0114] Step 302: Identify whether the current scene is the first scene or the second scene;

[0115] When the current scene is identified as the first scene, step 303 is executed, and when the current scene is identified as the second scene, step 304 is executed.

[0116] Step 304: read a first private reference frame from the first private reference frame buffer submodule, and encode the image in the encoding area corresponding to the encoding module based on the first private reference frame.

[0117] Optionally, after step 304, the method further includes:

[0118] The updated reference frame is written into the first private reference frame buffer submodule.

[0119] like Fig.11 As shown, the embodiment of the present disclosure further provides an image decoding method, which is applied to the image decoding device 20 described in the above embodiment. The image decoding method includes:

[0120] Step 401: Read a second shared reference frame from a second shared reference frame cache module;

[0121] Step 402: Decode the image of each decoding area based on the second shared reference frame, and write the updated reference frame into the second shared reference frame cache module.

[0122] In some optional embodiments, such as Fig.12 As shown, before reading the second shared reference frame from the second shared reference frame cache module, the method further includes:

[0123] Step 400: Identify whether the current scene is the first scene or the second scene;

[0124] When the current scene is identified as the first scene, step 401 is executed;

[0125] When the current scene is identified as the second scene, step 403 is executed.

[0126] Step 403: read a second private reference frame from the second private reference frame buffer submodule, and decode the image in the decoding area corresponding to the decoding module based on the second private reference frame.

[0127] Optionally, after step 403, the method further includes:

[0128] The updated reference frame is written into the second private reference frame buffer submodule.

[0129] The image encoding and decoding method provided by the present disclosure can identify whether the current scene is a computer desktop scene or a natural video scene based on the characteristics of each frame. If it is a natural video scene, each screen is kept with an independent encoder for encoding without affecting each other. If it is a computer desktop scene, the encoding instance corresponding to each internal screen is notified to enter the shared reference frame mode, and the reference frame of each encoder instance is no longer placed in the private part of its own encoder, but in a shared area, which can also be accessed by other encoder instances. This method can improve the utilization of memory resources in computer screen scenarios, eliminate redundant information within and between frames to a greater extent, and reduce the bit rate.

[0130] like Fig.13 As shown, the beneficial effect is explained by taking the entire large screen as an example of dividing it into four display screens. In this example, the encoding end also collects and encodes through 4 encoding modules. In this scenario, if a notepad window is dragged from the lower right corner of the screen to the upper left corner, assuming that in the first frame, the notepad is in the screen of the sub-screen (screen 4) in the lower right corner, and in the second frame, it has reached screen 1. If these four screens are encoded using four independent and unrelated encoders, it is obvious that when encoding the area of ​​the notepad in the second frame, it is impossible to refer to its screen in the first frame. This part of the redundant information is not eliminated, and the reference information is not used. Obviously, the code rate will be very high. The solution provided in this article can effectively solve this problem.

[0131] Because the source of natural video images is obtained by camera shooting, the distance between different areas corresponding to different screens is generally far, unlike computer screen images, where one area often jumps suddenly from one area to another area far away. Secondly, some areas may change drastically (such as the protagonist fighting area in the movie), and some areas may change slowly (such as the background picture). If the areas with drastic and slow changes are located in the areas corresponding to different screens, then for the areas with slow changes, a long-term reference frame mechanism can be used, and it is enough to save 1 reference frame for a long time, while for the screen with drastic changes, each frame recently edited may be updated to a reference frame. If these screens use a shared reference frame area, the memory of this buffer area will soon be filled up by the screen with drastic changes, and more reference frames may not be able to provide much effective reference information in the case of such drastic changes (because the changes are too drastic), which may eventually reduce the overall work efficiency of the system, and the code stream will not decrease but increase. In the embodiment provided by the present disclosure, in the computer desktop scene, multiple encoding modules can use shared reference frames for encoding and decoding to reduce the code stream. In the natural video scene, private reference frames are used for encoding to improve the encoding efficiency.

[0132] Based on the above Fig. 9 and Fig.10In accordance with the image encoding method described in the embodiment, the embodiment of the present disclosure further provides a computer-readable storage medium. For example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, or an optical data storage device. The storage medium stores computer instructions for executing the above Fig. 9 and Fig.10 The image encoding method described in the corresponding embodiment will not be repeated here.

[0133] Based on the above Fig.11 and Fig.12 In accordance with the image decoding method described in the embodiment, the embodiment of the present disclosure further provides a computer-readable storage medium. For example, the non-temporary computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, or an optical data storage device. The storage medium stores computer instructions for executing the above Fig.11 and Fig.12 The image decoding method described in the corresponding embodiment will not be repeated here.

[0134] A person skilled in the art will understand that all or part of the steps of implementing the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0135] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing what is disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

Claims

1. An image encoding device, characterized in that: It includes a first control module, N encoding modules and a first shared reference frame buffer module, wherein the N encoding modules correspond to N encoding areas respectively, wherein N>1; The first control module includes a first control submodule, and the first control submodule is used to control each encoding module to read the first shared reference frame from the first shared reference frame cache module for encoding during encoding; Each encoding module is used to encode the image of each encoding area, and write the updated reference frame into the first shared reference frame cache module; The first control module also includes a first scene recognition submodule; The first scene recognition submodule is used to recognize whether the current scene is the first scene or the second scene; When the first scene recognition submodule recognizes that the current scene is the first scene, the first control submodule is used to control each encoding module to read the first shared reference frame from the first shared reference frame cache module for encoding during encoding; Each encoding module further includes a first private reference frame buffer submodule and a second encoding submodule; When the first scene recognition submodule recognizes that the current scene is the second scene, the first control submodule is further used to control the second encoding submodule to read the first private reference frame from the first private reference frame buffer submodule, and the second encoding submodule encodes the image of the encoding area corresponding to the encoding module based on the first private reference frame; The first control submodule is further used to control the second encoding submodule to write the updated reference frame into the first private reference frame cache submodule after encoding the image of the encoding area corresponding to the encoding module based on the first private reference frame; The first scene recognition submodule is specifically used for: Determine whether the number of repeated macroblocks in the continuous R frame image exceeds a first preset threshold, and if the number of repeated macroblocks in the continuous R frame image exceeds the first preset threshold, identify the current scene as the first scene, wherein R is greater than 2; Alternatively, determining whether the number of macroblocks whose contrast ratios of consecutive P frame images are all higher than a preset contrast ratio exceeds a second preset threshold value, and identifying that the current scene is the first scene when the number of macroblocks whose contrast ratios of consecutive P frame images are all higher than the preset contrast ratio exceeds the second preset threshold value, wherein P is greater than 2; Alternatively, determining whether the frame rate of the continuous Q frame images is constant, and if the frame rate of the continuous Q frame images is not constant, identifying that the current scene is the first scene, wherein Q is greater than 2; The first scene recognition submodule is specifically used for: Determine whether the number of repeated macroblocks in the continuous R frame image frames exceeds a first preset threshold, and if the number of repeated macroblocks in the continuous R frame image frames does not exceed the first preset threshold, identify the current scene as the second scene, wherein R is greater than 2; Alternatively, determining whether the number of macroblocks whose contrasts of consecutive P frame images are all higher than a preset contrast exceeds a second preset threshold, and identifying that the current scene is the second scene when the number of macroblocks whose contrasts of consecutive P frame images are all higher than the preset contrast does not exceed the second preset threshold, wherein P is greater than 2; Alternatively, it is determined whether the frame rate of the continuous Q frame images is constant. If the frame rate of the continuous Q frame images is constant, it is identified that the current scene is the second scene, wherein Q is greater than 2.

2. The image encoding device according to claim 1, characterized in that Each encoding module comprises: A collection submodule, used for collecting images of the coding area corresponding to the coding module; The first encoding submodule is configured to read a first shared reference frame from the first shared reference frame cache module, and encode an image in an encoding area corresponding to the encoding module based on the first shared reference frame.

3. An image decoding device, characterized in that: It includes a second control module, M decoding modules and a second shared reference frame buffer module; the M decoding modules correspond to M decoding areas respectively, wherein M>1; The second control module includes a second control submodule, and the second control submodule is used to control each decoding module to read the second shared reference frame from the second shared reference frame cache module for decoding during decoding; Each decoding module is used to decode the image of each decoding area, and write the updated reference frame into the second shared reference frame buffer module; The second control module also includes a second scene recognition submodule; The second scene recognition submodule is used to recognize whether the current scene is the first scene or the second scene; When the second scene recognition submodule recognizes that the current scene is the first scene, the second control submodule is used to control each decoding module to read the second shared reference frame from the second shared reference frame cache module for decoding during decoding; Each of the decoding modules comprises a second private reference frame buffer submodule and a second decoding submodule; When the second scene recognition submodule recognizes that the current scene is the second scene, the second control submodule is further used to control the second decoding submodule to read the second private reference frame from the second private reference frame buffer submodule, and the second decoding submodule decodes the image of the decoding area corresponding to the decoding module based on the second private reference frame; The second control submodule is further used to control the second decoding submodule to write the updated reference frame into the second private reference frame cache submodule after decoding the image of the decoding area corresponding to the decoding module based on the second private reference frame; The second scene recognition submodule is specifically used for: Determine whether the number of repeated macroblocks in X consecutive image frames exceeds a third preset threshold, and if the number of repeated macroblocks in X consecutive image frames exceeds the third preset threshold, identify the current scene as the first scene, wherein X is greater than 2; Alternatively, determining whether the number of macroblocks whose contrasts of Y consecutive frames of images are all higher than a preset contrast exceeds a fourth preset threshold, and if the number of macroblocks whose contrasts of Y consecutive frames of images are all higher than the preset contrast exceeds the fourth preset threshold, identifying that the current scene is the first scene, wherein Y is greater than 2; Alternatively, determining whether the frame rate of the continuous Z frame images is constant, and if the frame rate of the continuous Z frame images is not constant, identifying that the current scene is the first scene, wherein Z is greater than 2; The second scene recognition submodule is specifically used for: Determine whether the number of repeated macroblocks in X consecutive image frames exceeds a third preset threshold, and if the number of repeated macroblocks in X consecutive image frames does not exceed the third preset threshold, identify the current scene as the second scene, wherein X is greater than 2; Alternatively, determining whether the number of macroblocks whose contrasts of Y consecutive frames of images are all higher than a preset contrast exceeds a fourth preset threshold, and identifying that the current scene is the second scene when the number of macroblocks whose contrasts of Y consecutive frames of images are all higher than the preset contrast does not exceed the fourth preset threshold, wherein Y is greater than 2; Alternatively, it is determined whether the frame rate of the continuous Z frame images is constant. If the frame rate of the continuous Z frame images is constant, it is identified that the current scene is the second scene, wherein Z is greater than 2.

4. An image encoding method, characterized in that: Applied to the image encoding device according to any one of claims 1 to 2, the method comprising: Acquire an image of a coding area corresponding to a coding module; Identify whether the current scene is the first scene or the second scene; In the case of identifying that the current scene is the first scene, reading a first shared reference frame from a first shared reference frame cache module, and encoding an image of a coding area corresponding to the coding module based on the first shared reference frame; When the current scene is identified as the second scene, a first private reference frame is read from a first private reference frame cache submodule, an image of a coding area corresponding to the coding module is encoded based on the first private reference frame, and an updated reference frame is written into the first private reference frame cache submodule.

5. An image decoding method, characterized in that: Applied to the image decoding device according to claim 3, the method comprises: Identify whether the current scene is the first scene or the second scene; In the case of identifying that the current scene is the first scene, reading a second shared reference frame from a second shared reference frame cache module; decoding an image of each decoding area based on the second shared reference frame, and writing an updated reference frame into the second shared reference frame cache module; When the current scene is identified as the second scene, a second private reference frame is read from a second private reference frame cache submodule, an image of a decoding area corresponding to the decoding module is decoded based on the second private reference frame, and an updated reference frame is written into the second private reference frame cache submodule.

Citation Information

Patent Citations

  • Full search motion estimation method based on programmable parallel processor

    CN103873874A

  • Image transmission method, device and system

    CN108600769A