Image processing method and device
By dividing the current frame image into regions and searching or encoding the identification information of the target region in the historical region list, the problem of low coding efficiency and large code stream in the video coding scheme in the existing technology is solved, and more efficient coding and storage are achieved. Space utilization.
Patent Information
- Application Number
- CN202010652518.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-08
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-07-08
AI Technical Summary
When existing video coding solutions use a single reference frame, the coding efficiency is low and the code stream is large. When supporting multiple reference frames, multiple complete reference frames need to be saved, resulting in excessive storage space and computational burden.
By dividing the current frame image into regions, the target region is generated, and the identification information of the region is searched or encoded in the historical region list and sent to the decoder to avoid saving multiple complete reference frames and reduce the storage space burden of the codec.
It effectively reduces the code stream, improves coding efficiency, reduces the storage space requirements of the codec, and avoids the computational burden of selecting a reference frame among multiple reference frames.
Smart Images

Figure CN111953976B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to an image processing method and device. Background Art
[0002] The existing technical solutions are mainly similar to video encoding solutions such as H.264 and H.265, which encode and compress video images. This type of video encoding and decoding solution uses the inter-frame prediction method to reduce the bit rate. The so-called inter-frame prediction is that when encoding the current frame, the current frame will be compared with the frame of the reference frame. If a certain area of the current frame is the same as the reference frame, the information of the same area, such as the position, will be directly recorded, and the information of the area of the reference frame will be directly used during decoding.
[0003] However, most of the video coding schemes using the prior art only support one reference frame, and the probability that a reference frame has the same area as all the frame images of the entire video image is low, so when using a reference frame to perform inter-frame prediction on the current frame image, it is difficult to find the same area as the reference frame in the current frame, and the current frame image still needs to be encoded. Therefore, the video coding schemes of the prior art cannot effectively reduce the bit rate when there is only one reference frame. Some coding and decoding technical standards support multiple reference frames, such as H.264, but the need to save multiple complete reference frames will bring a great burden to the storage space of the codec. In addition, when encoding the current frame image, it is necessary to select a reference frame from multiple reference frames. The optimization algorithm will cause a lot of computational burden. Therefore, the video coding schemes of the prior art have low coding efficiency. Summary of the invention
[0004] The embodiments of the present disclosure provide an image processing method and device, which can solve the problem of large bit streams and low coding efficiency in the video coding scheme of the prior art. The technical solution is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, the method comprising:
[0006] Divide the current frame image into regions to generate at least one target region;
[0007] When the target area exists in the historical area list, determining identification information of the target area from the historical area list, the historical area list including at least one historical area and identification information of each of the historical areas;
[0008] Sending the identification information of the target area to a decoding end;
[0009] If it is determined that the target area does not exist in the historical area list, the target area is encoded and sent to the decoding end.
[0010] The image processing method provided by the present embodiment can divide the current frame image into regions and generate at least one target region; when the target region exists in the historical region list, the identification information of the target region is determined from the historical region list, and the historical region list includes at least one historical region and the identification information of each of the historical regions; the identification information of the target region is sent to the decoding end; if it is determined that the target region does not exist in the historical region list, the target region is encoded and sent to the decoding end. When the target region exists in the historical region list, the identification information of the target region is sent to the decoding end, which can effectively reduce the bit rate, and there is no need to save multiple complete reference frames, which greatly reduces the storage space of the codec, and there is no need to select a reference frame from multiple reference frames, thereby avoiding the problem of low coding efficiency of the video coding scheme in the prior art.
[0011] In one embodiment, the historical area list further includes a weight value of each of the historical areas, and determining that the target area exists in the historical area list includes:
[0012] If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list;
[0013] After determining that the target area exists in the historical area list, the method further includes:
[0014] The weight value of the first historical area is increased by a preset weight step.
[0015] By increasing the weight value of the first historical region in the historical region list that has the same pixel data as the target region by a preset weight step, the number of times the target region appears can be accurately counted.
[0016] In one embodiment, after generating at least one target area, the method further includes:
[0017] If the historical area list is empty, adding the at least one target area to the historical area list;
[0018] The weight value of the at least one target area is set to a first preset weight threshold.
[0019] By adding the at least one target area to the historical area list when the historical area list is empty, a reference area can be provided for subsequent frame images.
[0020] In one embodiment, the historical area list further includes a timestamp of the historical area, the at least one historical area is sequentially sorted in the historical area list according to the timestamp of each historical area, and the method further includes:
[0021] If the target area does not exist in the historical area list, determine whether there is a second historical area in the historical area list whose weight value is less than or equal to a second preset weight threshold and whose time difference between the timestamp and the current time is greater than or equal to a preset time threshold;
[0022] If yes, deleting the second historical area from the historical area list;
[0023] adding the target area to the historical area list;
[0024] Setting the weight value of the target area to the first preset weight threshold and generating a timestamp of the target area;
[0025] The historical area list is updated according to the timestamp.
[0026] By deleting the second historical area whose weight value is less than or equal to the second preset weight threshold and the time difference between the timestamp and the current time is greater than or equal to the preset time threshold from the historical area list, the historical areas with lower reference value in the historical area list can be deleted, and then the target area is added to the historical area list, so that the historical areas in the historical area list can be updated to the latest areas.
[0027] In one embodiment, before determining the identification information corresponding to the target area in the historical area, the method further includes:
[0028] Sending the historical area list to the decoding end;
[0029] A confirmation message sent by the decoding end is received, where the confirmation message is used to indicate confirmation of receiving the historical area list.
[0030] By sending the historical area list to the decoding end and receiving a confirmation message sent by the decoding end, the historical area lists of the encoding end and the decoding end can be synchronized.
[0031] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing method, including:
[0032] When a target area exists in the historical area list, receiving identification information of the target area sent by the encoder, the historical area list includes at least one historical area and identification information of each historical area, and the target area is generated after dividing the current frame image obtained by the encoder;
[0033] generating the target area according to the identification information of the target area;
[0034] When the target area does not exist in the historical area list, receiving the encoding data of the target area sent by the encoding end;
[0035] The encoded data of the target area is decoded to generate the target area.
[0036] The image processing method provided by the embodiment of the present disclosure can receive identification information of the target area sent by the encoding end when the target area exists in the historical area list, the historical area list includes at least one historical area and identification information of each historical area, the target area is generated after dividing the current frame image obtained by the encoding end into regions; generate the target area according to the identification information of the target area; when the target area does not exist in the historical area list, receive encoding data of the target area sent by the encoding end; decode the encoding data of the target area to generate the target area, when the target area exists in the historical area list, the target area can be generated only according to the identification information of the target area, which can effectively reduce the code rate and does not need to save multiple complete reference frames, greatly reducing the storage space of the codec.
[0037] In one embodiment, before receiving the identification information of the target area sent by the encoding end, the method further includes:
[0038] Receiving the historical area list sent by the encoding end;
[0039] A confirmation message is sent to the encoding end, where the confirmation message is used to indicate confirmation of receiving the historical area list.
[0040] By receiving the historical area list sent by the encoding end and sending a confirmation message to the encoding end, the historical area lists of the encoding end and the decoding end can be synchronized.
[0041] In one embodiment, generating the target area according to the identification information of the target area includes:
[0042] determining a target historical area in the historical area list according to the identification information of the target area, wherein the identification information of the target historical area is the same as the identification information of the target area;
[0043] The target historical area is used as the target area.
[0044] By determining in the history area list a target history area whose identification information is the same as that of the target area, the target area can be generated according to the target history area.
[0045] According to a third aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, comprising:
[0046] A region division module, used for dividing the current frame image into regions to generate at least one target region;
[0047] an identification information determining module, configured to determine identification information corresponding to the target area from the historical area list when the target area exists in the historical area list, the historical area list including at least one historical area and identification information of each of the historical areas;
[0048] An identification information sending module, used for sending the identification information of the target area to a decoding end;
[0049] The target area encoding module is used to encode the target area and send it to the decoding end if it is determined that the target area does not exist in the historical area list.
[0050] In one embodiment, the historical area list further includes a weight value of each of the historical areas, and the identification information determination module is specifically configured to:
[0051] If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list;
[0052] The device further comprises: a weight value updating module, configured to:
[0053] The weight value of the first historical area is increased by a preset weight step.
[0054] In one embodiment, the device further comprises: a weight value setting module, configured to:
[0055] If the historical area list is empty, adding the at least one target area to the historical area list;
[0056] The weight value of the at least one target area is set to a first preset weight threshold.
[0057] In one embodiment, the historical area list further includes a timestamp of the historical area, and the at least one historical area is sequentially sorted in the historical area list according to the timestamp of each historical area. The device further includes: a historical area list updating module, which is used to:
[0058] If the target area does not exist in the historical area list, determine whether there is a second historical area in the historical area list whose weight value is less than or equal to a second preset weight threshold and whose time difference between the timestamp and the current time is greater than or equal to a preset time threshold;
[0059] If yes, deleting the second historical area from the historical area list;
[0060] adding the target area to the historical area list;
[0061] Setting the weight value of the target area to the first preset weight threshold and generating a timestamp of the target area;
[0062] The historical area list is updated according to the timestamp.
[0063] In one embodiment, the device further comprises: a confirmation message receiving module, configured to:
[0064] Sending the historical area list to the decoding end;
[0065] A confirmation message sent by the decoding end is received, where the confirmation message is used to indicate confirmation of receiving the historical area list.
[0066] According to a fourth aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, including:
[0067] an identification information receiving module, configured to receive identification information of the target area sent by the encoder when there is a target area in the historical area list, wherein the historical area list includes at least one historical area and identification information of each historical area, and the target area is generated after dividing the current frame image obtained by the encoder;
[0068] A target area generating module, used for generating the target area according to the identification information of the target area;
[0069] A coded data receiving module, configured to receive the coded data of the target area sent by the encoding end when the target area does not exist in the historical area list;
[0070] The target area generation module is further used to decode the coded data of the target area to generate the target area.
[0071] In one embodiment, the device further comprises: a confirmation message sending module, configured to:
[0072] Receiving the historical area list sent by the encoding end;
[0073] A confirmation message is sent to the encoding end, where the confirmation message is used to indicate confirmation of receiving the historical area list.
[0074] In one embodiment, the target area generation module is specifically used to:
[0075] determining a target historical area in the historical area list according to the identification information of the target area, wherein the identification information of the target historical area is the same as the identification information of the target area;
[0076] The target historical area is used as the target area.
[0077] According to the fifth aspect of the embodiments of the present disclosure, a coding end device is provided, which includes a processor and a memory, wherein the memory stores at least one computer instruction, and the instruction is loaded and executed by the processor to implement the steps performed in the image processing method described in the first aspect and any embodiment of the first aspect.
[0078] According to the sixth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, in which at least one computer instruction is stored. The instruction is loaded and executed by a processor to implement the steps performed in the image processing method described in the first aspect and any embodiment of the first aspect.
[0079] According to the seventh aspect of the embodiments of the present disclosure, a decoding end device is provided, the decoding end device comprising a processor and a memory, the memory storing at least one computer instruction, the instruction being loaded and executed by the processor to implement the steps performed in the image processing method described in the second aspect and any embodiment of the second aspect.
[0080] According to an eighth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, in which at least one computer instruction is stored. The instruction is loaded and executed by a processor to implement the steps performed in the image processing method described in the second aspect and any embodiment of the second aspect.
[0081] 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
[0082] 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.
[0083] Figure 1 This is a process of an image processing method provided by the embodiment of the present disclosure. Figure 1 ;
[0084] Figure 2 This is a process of an image processing method provided by the embodiment of the present disclosure. Figure 2 ;
[0085] Figure 3A The following is a schematic diagram of the logical layer structure of an image processing device provided by an embodiment of the present disclosure. Figure 1 ;
[0086] Figure 3B The following is a schematic diagram of the logical layer structure of an image processing device provided by an embodiment of the present disclosure. Figure 2 ;
[0087] Figure 3C is a schematic diagram of an Item provided in an embodiment of the present disclosure;
[0088] Figure 4A is a schematic diagram of a frame image divided into three continuous regions provided by an embodiment of the present disclosure;
[0089] Figure 4B This is a method provided by the embodiment of the present disclosure. Figure 4A Schematic diagram of the generated historical area;
[0090] Figure 5 is a schematic diagram of an encoding process provided by an embodiment of the present disclosure;
[0091] Figure 6 is a schematic diagram of a historical area list update process provided by an embodiment of the present disclosure;
[0092] Figure 7 The structure of an image processing device provided by the embodiment of the present disclosure is Figure 1 ;
[0093] Figure 8 The structure of an image processing device provided by the embodiment of the present disclosure is Figure 2 ;
[0094] Fig. 9 is a structural diagram 3 of an image processing device provided by an embodiment of the present disclosure;
[0095] Fig.10 is a structural diagram 4 of an image processing device provided by an embodiment of the present disclosure;
[0096] Fig.11 is a structural diagram of an encoding terminal device provided by an embodiment of the present disclosure;
[0097] Fig.12 It is a structural diagram of a decoding end device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0098] 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.
[0099] Figure 1 This is a process of an image processing method provided by the embodiment of the present disclosure. Figure 1 , this method is applied to the encoding end. Figure 1 As shown, the method includes:
[0100] S101: Divide the current frame image into regions to generate at least one target region.
[0101] In this embodiment, the current frame image may be divided into regions by using a macroblock division method.
[0102] Exemplarily, the current frame image may be divided into macroblocks to generate at least one macroblock, and then a preset number of macroblocks may be used as a target area, that is, each target area is an integer multiple of a macroblock. The macroblock size may be 16*16 pixels, 8*8 pixels, etc., and this embodiment does not impose any specific restrictions here. It should be noted that the specific area division form is not fixed. The more target areas are obtained by dividing the current frame image into regions, the smaller each target area is, but different area division situations all use the same area division method.
[0103] S102: when the target area exists in the historical area list, determine identification information of the target area from the historical area list, where the historical area list includes at least one historical area and identification information of each of the historical areas;
[0104] S103: Send the identification information of the target area to a decoding end.
[0105] Exemplarily, when the historical area list is not empty, the historical area list includes at least one historical area and the identification information, timestamp, and weight value of the historical area. Exemplarily, the at least one historical area is sorted in the historical area list in sequence according to the timestamp of each historical area. Exemplarily, the identification information of the historical area is the serial number of the historical area in the historical area list.
[0106] Preferably, in the historical area list, the historical area at the head of the list is the latest historical area, that is, the historical area with the closest timestamp to the current time. The historical area at the end is the historical area farthest from the current time, that is, the historical area with the farthest timestamp from the current time. At the same time, the historical area list also includes a weight value for each historical area, which represents the number of times the target area appears in the historical frame image. If a historical area appears in multiple frame images continuously, then the weight of the historical area is relatively large.
[0107] In this step, for each target area of the current frame image, if there is a first historical area in the historical area list having the same pixel data as the target area, it is determined that the target area exists in the historical area list, and the identification information of the first historical area is used as the identification information of the target area, and then the identification information of the target area is sent to the decoding end so that the decoding end generates the target area according to the identification information. Exemplarily, the decoding end can determine the target historical area corresponding to the identification information from the pre-stored historical area list, and use the target historical area as the target area.
[0108] Further, after determining that the target area exists in the historical area list, the weight value of the first historical area is increased by a preset weight step and the timestamp of the first historical area is updated according to the current time. In this embodiment, if it is determined that the target area exists in the historical area list, the weight value of the first historical area is increased by 1, and the timestamp of the first historical area is updated to the current time. After the timestamp of the first historical area is updated, the historical area list is updated according to the new timestamp.
[0109] Exemplarily, if the historical area list is empty, that is, the current frame image is the first frame image, then after the current frame image is divided into regions, the at least one target area is added to the historical area list, and the weight value of the at least one target area is set to the first preset weight threshold, and a timestamp of each target area in the at least one target area is generated. Exemplarily, in this embodiment, the weight value of the at least one target area is set to a default value of 1.
[0110] S104: If it is determined that the target area does not exist in the historical area list, the target area is encoded and sent to the decoding end.
[0111] Exemplarily, if the target area does not exist in the historical area list, the target area is encoded and sent to the decoding end, and it is determined whether there is a second historical area in the historical area list whose weight value is less than or equal to the second preset weight threshold and the time difference between the timestamp and the current time is greater than or equal to the preset time threshold; if so, the second historical area is deleted from the historical area list and the target area is added to the historical area list; the weight value of the target area is then set to the first preset weight threshold and the timestamp of the target area is generated; after the timestamp of the target area is generated, the historical area list is updated according to the timestamp of each historical area in the historical area list. Exemplarily, in this embodiment, the weight value of the target area is set to a default value of 1.
[0112] In this embodiment, in order to ensure that the identification information of the historical area list in the encoding end is consistent with the identification information of the target area sent by the decoding end, the historical area list of the decoding end needs to be synchronized with the historical area list of the encoding end.
[0113] When encoding a frame image, theoretically, each time a frame image is obtained and encoded, the historical area list will be updated once, and the encoding and decoding ends must be synchronized once. However, this method is not realistic due to network transmission factors and other factors. Therefore, in the present application, the historical area lists of the encoding end and the decoding end are synchronized at a specific time. Exemplarily, the historical area lists of the encoding end and the decoding end can be synchronized every preset period (for example, 1 hour). If the preset period is reached, the network transmission conditions are judged before synchronization. If the network bandwidth is large, the code stream transmission is stable and the bandwidth is surplus, the historical area lists of the encoding end and the decoding end are synchronized. If the network conditions are poor, only the code stream of the frame image has exhausted the bandwidth, and the synchronization process of the historical area lists of the encoding end and the decoding end is delayed.
[0114] Exemplarily, in this embodiment, the historical area list includes historical area list 0 and historical area list 1. Each time the encoder obtains a frame of image and encodes the frame of image, it updates historical area list 0, but only updates historical area list 0, and does not determine the first historical area that is the same as the target area of the frame of image and the identification information of the first historical area from historical area list 0. At this time, historical area list 0 is a list that is not in an "activated state". After reaching a preset period (such as 1 hour), if the network status is good, the content of historical area list 0 is sent to the decoding end together with the frame code stream of the most recently encoded frame image. After receiving it, the decoding end parses the content of historical area list 0, updates it to its own historical area list 0, and sends a first confirmation message to the encoder end. The first confirmation message is used to indicate confirmation of receiving the historical area list 0.
[0115] It should be noted that after the encoder sends the bitstream containing the content of historical area list 0 to the decoder, the encoder freezes historical area list 0 and no longer updates it, but updates historical area list 1 until the first confirmation message sent by the decoder is received, and then the encoder activates historical area list 0. After activating historical area list 0, steps S101 to S104 are performed on the acquired current frame image. At this time, the decoding end saves the same historical area list 0 as the encoding end. Therefore, after the decoding end receives the identification information of the target area, it can determine the target historical area corresponding to the identification information from historical area list 0 according to the identification information, and the pixel data of the target historical area is the same as that of the target area.
[0116] Exemplarily, after a preset period, the encoder freezes historical area list 1 and no longer updates it, and sends historical area list 1 to the decoder, updates historical area list 0, and does not determine the first historical area that is the same as the target area of the frame image and the identification information of the first historical area from historical area list 1 before receiving the second confirmation message from the decoder. The second confirmation message is used to indicate confirmation of receiving historical area list 0. After receiving the content of historical area list 1, the decoder updates its own historical area list 1, sets historical area list 1 to an activated state, and sends a second confirmation message to the encoder. After receiving the second confirmation message, the encoder activates historical area list 1. After activating historical area list 1, steps S101 to S104 are performed on the acquired current frame image. This cycle is repeated, alternating between using historical area list 0 and historical area list 1.
[0117] The image processing method provided by the present embodiment can divide the current frame image into regions and generate at least one target region; when the target region exists in the historical region list, the identification information of the target region is determined from the historical region list, and the historical region list includes at least one historical region and the identification information of each of the historical regions; the identification information of the target region is sent to the decoding end; if it is determined that the target region does not exist in the historical region list, the target region is encoded and sent to the decoding end. When the target region exists in the historical region list, the identification information of the target region is sent to the decoding end, which can effectively reduce the bit rate, and there is no need to save multiple complete reference frames, which greatly reduces the storage space of the codec, and there is no need to select a reference frame from multiple reference frames, thereby avoiding the problem of low coding efficiency of the video coding scheme in the prior art.
[0118] Combine the following Figure 2 The embodiment describes how the decoding end performs image processing. Figure 2 This is a process of an image processing method provided by the embodiment of the present disclosure. Figure 2 , this method is applied to the decoding end. Figure 2 As shown, the method includes:
[0119] S201. When a target area exists in a historical area list, identification information of the target area sent by the encoding end is received, wherein the historical area list includes at least one historical area and identification information of each historical area, and the target area is generated after dividing the current frame image obtained by the encoding end into regions.
[0120] Exemplarily, in this embodiment, after the encoder obtains the current frame image, it divides the current frame image into regions to generate at least one target region. For each target region, when the target region exists in the historical region list, the encoder receives identification information of the target region sent by the encoder.
[0121] S202: Generate the target area according to the identification information of the target area.
[0122] Exemplarily, a target historical area is determined in the historical area list according to the identification information of the target area, and the identification information of the target historical area is the same as the identification information of the target area; and the target historical area is used as the target area.
[0123] S203: When the target area does not exist in the historical area list, receiving the encoding data of the target area sent by the encoding end;
[0124] S204: Decode the coded data of the target area to generate the target area.
[0125] In this embodiment, after the decoding end device generates each target area of the current frame image, the current frame image is generated according to each target area. Exemplarily, each target area is spliced to generate the current frame image.
[0126] Similarly, in order to ensure that the identification information of the historical area list in the decoding end is consistent with the identification information of the target area sent by the encoding end, it is necessary to synchronize the historical area list of the decoding end with the historical area list of the encoding end. Figure 1 The process in the embodiment is similar, that is, first receiving the historical area list (historical area list 0 or historical area list 1) sent by the encoding end; then sending a confirmation message to the encoding end, the confirmation message is used to indicate confirmation of receiving the historical area list. The synchronization process is not described in detail in this embodiment. After the historical area list is synchronized, steps S201 to S204 are executed.
[0127] The image processing method provided by the embodiment of the present disclosure can receive identification information of the target area sent by the encoding end when the target area exists in the historical area list, the historical area list includes at least one historical area and identification information of each historical area, the target area is generated after dividing the current frame image obtained by the encoding end into regions; generate the target area according to the identification information of the target area; when the target area does not exist in the historical area list, receive encoding data of the target area sent by the encoding end; decode the encoding data of the target area to generate the target area, when the target area exists in the historical area list, the target area can be generated only according to the identification information of the target area, which can effectively reduce the code rate and does not need to save multiple complete reference frames, greatly reducing the storage space of the codec.
[0128] Below is a combination of Figure 3 to Figure 6 , the image processing method provided by the embodiment of the present disclosure is further described in detail. Figure 3A The logical layer structure diagram of the image processing device provided by the embodiment of the present disclosure is Figure 1 . The device is used at the encoding end. Figure 3B The logical layer structure diagram of the image processing device provided by the embodiment of the present disclosure is Figure 1 , the device is used in the decoding end. Figure 3A As shown, the logical layer structure of the image processing device mainly includes:
[0129] S301: Region division module, divides a frame of image into regions of fixed size. Generally, the region size is an integer multiple of the macroblock. The macroblock size is 16*16 pixels. First, a frame of image needs to be logically divided into rectangular regions, and all subsequent work must be performed in units of regions. In the subsequent Figure 4, the region division of the full-frame image is shown with thin lines. It should be noted that the specific division form is not fixed. The more regions are divided, the smaller the size of each region is, but different division situations use the same calculation method.
[0130] S302: Historical area list 0. The historical area list is used to store the content of each area, where each item is called an Item, and each Item represents an area. The structure of Item is as follows: Figure 3C shown.
[0131] The items in the queue are in order. The ones at the head of the list are the most recently queued areas, and the ones at the end are the ones that are the farthest from the current time. At the same time, the weight of each item records the number of times the area corresponding to this item appears when editing different frames. If a certain area appears continuously in multiple frames, then the weight of the item is very large. Therefore, the time of queueing and weight are two factors to measure an item. When a new frame arrives, it is necessary to queue up the various area blocks divided by it. If the current list is full, it is necessary to clear the area item that is the farthest from the current time and has the smallest weight, and then queue up the item of the new frame.
[0132] S303: The region comparison module compares each region of the current frame with each region in the historical region list 0 or the historical region list 1 when encoding a frame. If a region is matched, the weight of the Item of the region in the list is increased by 1. At the same time, the macroblocks in the region of the frame are uniformly recorded as the Item index number (i.e., serial number) in the list, thus completing the reference encoding.
[0133] S304: Historical area list 1 has the same status as historical area list 0. The reason for setting two lists is to synchronize the lists between the encoding end and the decoding end when certain conditions are met (such as when the timer expires or the network conditions are good). The specific synchronization process will be explained in detail later. Here, it is explained that the encoding and decoding ends must store lists with the same content so that the decoding end can correctly decode the bitstream file with historical reference data.
[0134] S305: A code stream generation module, when referencing the data in the list, the encoding of the region is to record the index number of the reference region Item in the list, and this process is completed in the code stream generation module.
[0135] S306: List synchronization module is set up to synchronize the list content at both ends of the codec. The reference area list is essentially generated by the encoding end and needs to be sent to the decoding end under specific conditions. The decoding end saves it and sends a response confirmation to the encoding end. This process is called synchronization. The response confirmation message from the decoding end is received by this module. After receiving it, the list that has just been synchronized is marked as active, and subsequent encoding can refer to the historical area in this list.
[0136] like Figure 3B As shown, the logical layer structure of the image processing device mainly includes:
[0137] S307: The code stream parsing module at the decoding end receives the code stream from the encoding end, and the parsed historical area list code stream is handed over to the S311 list synchronization module, and the parsed code stream data is handed over to the S309 area recovery module.
[0138] S308 and S310: The historical area list maintained by the decoding end has the same structure as that of the encoding end.
[0139] S309: When the code stream contains a historical region reference index, the region recovery module searches for pixels in the activated historical region list according to the index and replaces them to corresponding positions to complete the recovery of the corresponding region content.
[0140] S311: When the list synchronization module receives the list content stream sent by the encoding end, it decodes the list content and updates the historical area list. After the update is completed, it sends a response confirmation message to the encoding end.
[0141] S312: Frame reconstruction module, splicing the regional reference content restored by S309 and forming the final decoded frame image. In the coding system, there are usually other coding forms, such as some macroblocks using JPEG coding, etc. The coding and decoding content of these macroblocks is not within the scope of this solution, and is parallel to the reference solution proposed in this solution, and is generally used at the same time. Then the decoded data of these macroblocks and the decoded content of the reference area proposed in this solution must be spliced to complete the full frame decoding. This step is completed in the S312 module.
[0142] The following is a visual example to intuitively demonstrate the functions of several components involved and the significance of this solution.
[0143] Figure 4A There are three consecutive frame images, a / b / c from top to bottom. The horizontal and vertical thin lines are the region divisions of the frames. The division here is just an example for demonstration. In actual applications, there can be smaller or larger divisions. The areas enclosed by the thick solid lines in the first and second frames are the areas selected into the historical region list. In this example, 4 areas are selected for the first frame image and 2 areas are selected for the second frame image. In fact, the number of areas in the historical region list will be much larger than this number. The historical regions formed are as follows: Figure 4B As shown (the actual data does not contain the red line). When encoding the third frame of the image, the reference Figure 4B In the historical area shown in the figure, the six areas enclosed by the thick dotted line will be matched successfully. Then, when encoding the macroblocks in these six areas, no compression algorithm such as JPEG will be used for compression. Instead, the index numbers in the list where these six areas are located (from 0 to 5 in this example) can be directly recorded. As a result, the code stream generated by the encoding of the macroblocks in these six areas has only six index values, which greatly reduces the code stream. When encoding the third frame of the image, the information of the previous two frames of the image is actually referenced, and the hit rate is much higher than that of a single frame reference.
[0144] Figure 5 It is a flow chart of the encoding process provided by the embodiment of the present disclosure. It includes:
[0145] Step S501: receiving original data to be encoded, such as RGB or YUV data, and passing the data to a region division module for division.
[0146] Step S502: The region division module divides the full frame into regions of MxN pixel size.
[0147] Step S503: Check whether the history area list is empty. If it is empty, go to S509 to fill all the divided areas of the current frame into list 0 and set their weights to the initial value 1. If it is not empty, go to S504 for reference coding.
[0148] Step S504: Compare the region of the current frame with each region in the historical region list. If there is no match, go to S506, delete the region with the lowest weight and the longest history in the list, fill in the current region content, and initialize the weight to 1; if there is a match, directly add 1 to the weight of the item corresponding to the region in the list. And encode the index number of the region in the list into the bitstream to complete the reference encoding of a region.
[0149] Figure 6 It is a schematic diagram of the updating process of the historical area list provided by the embodiment of the present disclosure.
[0150] List update is an important link, and it is the basis for the reference mechanism to work. When encoding, theoretically, the historical area list should be updated once for each frame encoded, and the encoding and decoding ends should be synchronized once. However, this method is not realistic due to network transmission factors and other factors. The synchronization proposed in this scheme is based on a specific timing, which is called comprehensive periodic synchronization. Periodicity refers to synchronization once every hour (or other set time), and comprehensiveness refers to judging the network transmission conditions before synchronization. If the network bandwidth is large, the code stream transmission is stable, and there is surplus bandwidth, synchronization will be performed. If the network conditions are poor, the bandwidth has been exhausted by transmitting only the image code stream, and the synchronization process will be postponed.
[0151] like Figure 6As shown in the figure, the specific synchronization method from the beginning of encoding is to update list 0 every time the encoder encodes a frame, but only update without reference, because there is no list in the "activated state". After the period (such as 1 hour) is up, the network status is good, and the content of list 0 is sent to the decoder together with the frame code stream of the most recent encoding. After receiving it, the decoder decodes the content of list 0, updates it to its own list 0, and sends a response confirmation message to the encoder. It should be noted that since the encoder sent the code stream containing the content of list 0 to the decoder, the encoder freezes the content of list 0 and no longer updates it, but updates list 1 until it receives the response confirmation message of list 0 from the decoder. The encoder activates list 0 and in subsequent encoding, it will refer to the historical area in list 0 for reference encoding. At this time, the decoder saves the same list 0 as the encoder, so it can be decoded correctly. After another hour, the cycle is up, the encoder freezes List 1 and no longer updates it, and sends List 1 to the decoder. Subsequent encoding reflects changes to the list on List 0, and does not refer to any historical area coding in any list before receiving a response confirmation from the decoder. After receiving the content of List 1, the decoder updates its own List 1, sets List 1 to the activated state, and sends a response confirmation to the encoder. After receiving the confirmation, the encoder activates List 1 and refers to List 1 for encoding. This cycle repeats.
[0152] Figure 7 The structure of an image processing device provided by the embodiment of the present disclosure is Figure 1 , the device is used in the encoding end. Figure 7 As shown, the device 70 includes:
[0153] The region division module 701 is used to divide the current frame image into regions to generate at least one target region;
[0154] An identification information determining module 702 is used to determine identification information corresponding to the target area from the historical area list when the target area exists in the historical area list, wherein the historical area list includes at least one historical area and identification information of each of the historical areas;
[0155] The identification information sending module 703 is used to send the identification information of the target area to the decoding end;
[0156] The target area encoding module 704 is used to encode the target area and send it to the decoding end if it is determined that the target area does not exist in the historical area list.
[0157] In one embodiment, the historical area list further includes a weight value of each of the historical areas, and the identification information determination module 702 is specifically configured to:
[0158] If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list;
[0159] like Figure 8 As shown, the device 70 further includes: a weight value updating module 705, which is used to:
[0160] The weight value of the first historical area is increased by a preset weight step.
[0161] In one embodiment, the device 70 further includes: a weight value setting module 706, which is used to:
[0162] If the historical area list is empty, adding the at least one target area to the historical area list;
[0163] The weight value of the at least one target area is set to a first preset weight threshold.
[0164] In one embodiment, the historical area list further includes a timestamp of the historical area, and the at least one historical area is sequentially sorted in the historical area list according to the timestamp of each historical area. The device 70 further includes: a historical area list updating module 707, which is used to:
[0165] If the target area does not exist in the historical area list, determine whether there is a second historical area in the historical area list whose weight value is less than or equal to a second preset weight threshold and whose time difference between the timestamp and the current time is greater than or equal to a preset time threshold;
[0166] If yes, deleting the second historical area from the historical area list;
[0167] adding the target area to the historical area list;
[0168] Setting the weight value of the target area to the first preset weight threshold and generating a timestamp of the target area;
[0169] The historical area list is updated according to the timestamp.
[0170] In one embodiment, the apparatus 70 further includes: a confirmation message receiving module 708, configured to:
[0171] Sending the historical area list to the decoding end;
[0172] A confirmation message sent by the decoding end is received, where the confirmation message is used to indicate confirmation of receiving the historical area list.
[0173] The image processing device provided in the embodiment of the present disclosure, its implementation process and technical effects can be seen in the above Figure 1 The embodiments are not described in detail here.
[0174] Fig. 9 FIG3 is a structural diagram of an image processing device provided by an embodiment of the present disclosure, and the device is applied to a decoding end. Fig. 9 As shown, the device 90 comprises:
[0175] The identification information receiving module 901 is used to receive the identification information of the target area sent by the encoder when there is a target area in the historical area list, wherein the historical area list includes at least one historical area and the identification information of each historical area, and the target area is generated after dividing the current frame image obtained by the encoder;
[0176] A target area generating module 902, configured to generate the target area according to the identification information of the target area;
[0177] A coded data receiving module 903, configured to receive coded data of the target area sent by the encoding end when the target area does not exist in the historical area list;
[0178] The target region generating module 903 is further configured to decode the coded data of the target region to generate the target region.
[0179] In one embodiment, Fig.10 As shown, the device 90 also includes: a confirmation message sending module 904, which is used to:
[0180] Receiving the historical area list sent by the encoding end;
[0181] A confirmation message is sent to the encoding end, where the confirmation message is used to indicate confirmation of receiving the historical area list.
[0182] In one embodiment, the target area generation module 902 is specifically used to:
[0183] determining a target historical area in the historical area list according to the identification information of the target area, wherein the identification information of the target historical area is the same as the identification information of the target area;
[0184] The target historical area is used as the target area.
[0185] The image processing device provided in the embodiment of the present disclosure, its implementation process and technical effects can be seen in the above Figure 2 The embodiments are not described in detail here.
[0186] Fig.11 is a structural diagram of an encoding terminal device provided according to an embodiment of the present disclosure. Fig.11As shown, the encoding terminal device 110 includes a processor 1101 and a memory 1102, wherein the memory 1102 stores at least one computer instruction, which is loaded and executed by the processor 1101 to implement Figure 1 The steps performed in the image processing method.
[0187] Based on the above Figure 1 The image processing method described in the embodiment of the present disclosure also 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, and an optical data storage device. The storage medium stores computer instructions for executing the above Figure 1 The image processing method described in the corresponding embodiment will not be repeated here.
[0188] Fig.12 is a structural diagram of a decoding end device provided according to an embodiment of the present disclosure. Fig.11 As shown, the decoding end device 120 includes a processor 1201 and a memory 1202, wherein the memory 1202 stores at least one computer instruction, which is loaded and executed by the processor 1201 to implement Figure 2 The steps performed in the image processing method.
[0189] Based on the above Figure 2 The image processing method described in the embodiment of the present disclosure also 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, and an optical data storage device. The storage medium stores computer instructions for executing the above Figure 2 The image processing method described in the corresponding embodiment will not be repeated here.
[0190] A person skilled in the art will understand that all or part of the steps to implement 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.
[0191] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure 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 description 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 processing method, characterized in that: include: Divide the current frame image into regions to generate at least one target region; When the target area exists in the historical area list, determining identification information of the target area from the historical area list, the historical area list including at least one historical area and identification information of each of the historical areas; Sending the identification information of the target area to a decoding end; If it is determined that the target area does not exist in the historical area list, encoding the target area and sending it to the decoding end; The historical area list further includes a weight value of each of the historical areas, and determining that the target area exists in the historical area list includes: If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list; After determining that the target area exists in the historical area list, the method further includes: The weight value of the first historical area is increased by a preset weight step.
2. The method according to claim 1, characterized in that After generating at least one target area, the method further includes: If the historical area list is empty, adding the at least one target area to the historical area list; The weight value of the at least one target area is set to a first preset weight threshold.
3. The method according to claim 2, characterized in that The historical area list further includes a timestamp of the historical area, the at least one historical area is sequentially sorted in the historical area list according to the timestamp of each historical area, and the method further includes: If the target area does not exist in the historical area list, determine whether there is a second historical area in the historical area list whose weight value is less than or equal to a second preset weight threshold and whose time difference between the timestamp and the current time is greater than or equal to a preset time threshold; If yes, deleting the second historical area from the historical area list; adding the target area to the historical area list; Setting the weight value of the target area to the first preset weight threshold and generating a timestamp of the target area; The historical area list is updated according to the timestamp.
4. The method according to claim 1, characterized in that: Before determining the identification information corresponding to the target area in the historical area, the method further includes: Sending the historical area list to the decoding end; A confirmation message sent by the decoding end is received, where the confirmation message is used to indicate confirmation of receiving the historical area list.
5. An image processing method, characterized in that: include: When a target area exists in the historical area list, receiving identification information of the target area sent by the encoder, the historical area list includes at least one historical area and identification information of each historical area, and the target area is generated after dividing the current frame image obtained by the encoder; generating the target area according to the identification information of the target area; When the target area does not exist in the historical area list, receiving the encoding data of the target area sent by the encoding end; Decoding the encoded data of the target area to generate the target area; The historical area list further includes a weight value of each of the historical areas, and determining that the target area exists in the historical area list includes: If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list; After determining that the target area exists in the historical area list, the method further includes: The weight value of the first historical area is increased by a preset weight step.
6. The method according to claim 5, characterized in that Before receiving the identification information of the target area sent by the encoding end, the method further includes: Receiving the historical area list sent by the encoding end; A confirmation message is sent to the encoding end, where the confirmation message is used to indicate confirmation of receiving the historical area list.
7. The method according to claim 6, characterized in that Generating the target area according to the identification information of the target area includes: determining a target historical area in the historical area list according to the identification information of the target area, wherein the identification information of the target historical area is the same as the identification information of the target area; The target historical area is used as the target area.
8. An image processing device, characterized in that: include: A region division module, used for dividing the current frame image into regions to generate at least one target region; an identification information determining module, configured to determine identification information corresponding to the target area from the historical area list when the target area exists in the historical area list, the historical area list including at least one historical area and identification information of each of the historical areas; An identification information sending module, used for sending the identification information of the target area to a decoding end; a target area encoding module, configured to encode the target area and send it to a decoding end if it is determined that the target area does not exist in the historical area list; The historical area list also includes a weight value of each of the historical areas, and the identification information determination module is specifically used to: If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list; The device further comprises: a weight value updating module, configured to: The weight value of the first historical area is increased by a preset weight step.
9. An image processing device, characterized in that: include: an identification information receiving module, configured to receive identification information of the target area sent by the encoder when there is a target area in the historical area list, wherein the historical area list includes at least one historical area and identification information of each historical area, and the target area is generated after dividing the current frame image obtained by the encoder; A target area generating module, used for generating the target area according to the identification information of the target area; A coded data receiving module, configured to receive the coded data of the target area sent by the encoding end when the target area does not exist in the historical area list; The target area generation module is further used to decode the coded data of the target area to generate the target area; The historical area list also includes a weight value of each of the historical areas, and the identification information receiving module is specifically used to: If there is a first historical area in the historical area list with the same pixel data as the target area, determining that the target area exists in the historical area list; The weight value of the first historical area is increased by a preset weight step.
Citation Information
Patent Citations
Adaptive bandwidth desktop sharing method based on block encoding
CN101835043A
Video transmission device and method
CN102427533A
Data updating method and system
CN110602500A
Method of determination of stable zones within an image stream, and portable device for implementing the method
EP2975576A1
Method for encoding-decoding image information and disk device
JP2005079815A
