Decoding method and device, coding method and device, equipment and storage medium
By determining the motion vector availability of adjacent predicted image blocks and deduplication of reference image queues, the problem of inaccurate motion vector prediction values in the prior art is solved, and the encoding performance is improved.
Patent Information
- Application Number
- CN202311257068.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-26
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-09-26
AI Technical Summary
The prior art cannot accurately obtain the predicted value of the motion vector, resulting in low encoding performance.
By determining the motion vector availability of adjacent predicted image blocks corresponding to the current image block and decoding according to the availability, the deduplication reference image queue is used to obtain the accurate motion vector prediction value.
Improve the prediction accuracy of motion vectors, thereby improving coding performance.
Smart Images

Figure CN119728987A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image coding and decoding technology, and in particular to a decoding method, an encoding method, a device, an equipment and a storage medium. Background Art
[0002] At present, when using motion-compensated inter-frame prediction technology to encode video images, in order to reduce the number of bits used to encode motion vectors, the spatial correlation between adjacent image blocks is used in video encoding to predict the motion vector of the current block to be encoded based on the motion vector of the adjacent encoded block, and then encode the prediction difference. This can effectively reduce the number of bits representing the motion vector. Based on this, in the process of encoding the motion vector of the current image block, the motion vector of the current macroblock is generally predicted using the motion vector of the adjacent encoded block first, and then the difference (MVD, Motion Vector Difference) between the predicted value of the motion vector (MVP, Motion Vector Prediction) and the true estimate of the motion vector is encoded, thereby effectively reducing the number of encoding bits of the MV.
[0003] Under the existing prediction technology, when there are two reference image queues, in the motion vector prediction method of the scene, the availability of the motion vector may be determined based on the reference image queue corresponding to the motion vector. For example: if the adjacent block meets one of the following conditions, the motion information of the adjacent block is unavailable. 1. The adjacent block is "unavailable" (not decoded or does not belong to the same parallel unit (Slice, Tile, Patch, etc.) as the current block); 2. The adjacent bright block uses the intra-frame prediction mode; 3. The adjacent block does not have the same motion vector as the reference image queue corresponding to the current block. At this time, if the reference image queue corresponding to the current block is one of the reference image queues, and the motion vector of the adjacent block points to a reference frame of the other reference image queue, even if the reference frame also appears in the reference image queue corresponding to the current block, it will be judged as unavailable. In this case, the current prediction technology cannot accurately obtain the predicted value of the motion vector, resulting in low encoding performance.
[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present invention is to provide a decoding method, an encoding method, an apparatus, a device and a storage medium, aiming to solve the technical problem that the prior art cannot accurately obtain the prediction value of the motion vector, thereby causing low encoding performance.
[0006] To achieve the above object, the present invention provides a decoding method, which comprises the following steps:
[0007] Determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block;
[0008] The current image block is decoded according to the availability of the motion vectors of the neighboring predicted image blocks.
[0009] Optionally, determining the availability of a motion vector of an adjacent predicted image block corresponding to the current image block includes:
[0010] Determine a main reference image queue and a secondary reference image queue of the current image block, wherein the main reference image queue is a reference image queue pointed to by a motion vector to be predicted of the current image block, and the secondary reference image queue is a remaining reference image queue except the main reference image queue;
[0011] When at least one of the following first preset conditions is met, determining that the motion vector of the adjacent prediction image block is unavailable;
[0012] The first preset condition includes:
[0013] The adjacent prediction image block is an unavailable adjacent prediction image block;
[0014] The adjacent prediction image blocks adopt an intra-frame prediction mode;
[0015] The motion vector of the adjacent prediction image block points to the slave reference image queue, and the reference frame in the slave reference image queue pointed to does not exist in the master reference image queue.
[0016] Optionally, the determining the availability of the motion vector of the adjacent predicted image block corresponding to the current image block further includes:
[0017] Determine whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics;
[0018] If the reference image queue attribute characteristic satisfies the preset attribute characteristic, then when at least one of the following second preset conditions is met, it is determined that the motion vector of the adjacent prediction image block corresponding to the current image block is unavailable;
[0019] The second preset condition includes:
[0020] The adjacent prediction image block is an unavailable adjacent prediction image block;
[0021] The adjacent prediction image blocks adopt an intra-frame prediction mode.
[0022] Optionally, determining whether the attribute characteristics of the reference image queue corresponding to the current image block meet preset attribute characteristics includes:
[0023] Determine a main reference image queue and a secondary reference image queue of the current image block, wherein the main reference image queue is a reference image queue pointed to by a motion vector to be predicted of the current image block, and the secondary reference image queue is a remaining reference image queue except the main reference image queue;
[0024] If each reference frame in the slave reference image queue exists in the master reference image queue, or, each reference frame in the slave reference image queue exists in the master reference image queue and each reference frame in the master reference image queue exists in the slave reference image queue, it is determined that the attribute characteristics of the reference image queue meet the preset attribute characteristics.
[0025] To achieve the above object, the present invention further provides a decoding method, which further includes:
[0026] Acquire a reference image queue configuration of the current image block, the reference image queue configuration comprising at least two reference image queues, the at least two reference image queues comprising a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information;
[0027] Deduplication of the at least two reference image queues;
[0028] The current image block is decoded according to the deduplicated reference image queue.
[0029] Optionally, deduplicating the at least two reference image queues includes:
[0030] Determine a target reference image queue and a non-target reference image queue, wherein the target reference image queue is the first reference image queue or the second reference image queue, and the non-target reference image queue is a remaining reference image queue except the target reference image queue;
[0031] The reference frames in the target reference image queue are kept unchanged, and the reference frames in the non-target reference image queue that are repeated with those in the target reference image queue are removed.
[0032] Optionally, before deduplicating the at least two reference image queues, the method further includes:
[0033] Determining whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics;
[0034] The deduplication of the at least two reference image queues comprises:
[0035] If the attribute characteristics of the reference image queue meet the preset attribute characteristics, the reference frames in the target reference image queue are kept unchanged, and the reference frames in the non-target reference image queue are removed.
[0036] Optionally, after the reference frames in the target reference image queue are kept unchanged and the reference frames in the non-target reference image queue are removed, the method further includes:
[0037] reordering the reference frames in the target reference image queue;
[0038] or,
[0039] Reordering the reference frames in the non-target reference image queue;
[0040] or,
[0041] The reference frames in the target reference picture queue are reordered and the reference frames in the non-target reference picture queue are reordered.
[0042] Optionally, the determining whether the attribute feature of the reference image queue corresponding to the current image block meets a preset attribute feature includes:
[0043] If every reference frame in the non-target reference image queue exists in the target reference image queue, or, every reference frame in the non-target reference image queue exists in the target reference image queue and every reference frame in the target reference image queue exists in the non-target reference image queue, then it is determined that the attribute characteristics of the reference image queue meet the preset attribute characteristics.
[0044] Optionally, decoding the current image block according to the reference image queue after deduplication includes:
[0045] Determine a primary reference image queue to which the unidirectional motion information in the reference image queue after deduplication points;
[0046] Acquire indication information, and select a target reference frame from the main reference image queue according to the indication information;
[0047] The current image block is decoded according to the target reference frame.
[0048] Optionally, the acquiring indication information and selecting a target reference frame from the primary reference image queue according to the indication information includes:
[0049] Acquire first indication information and second indication information; wherein the first indication information is used to indicate a main reference image queue, and the second indication information is used to indicate an index value of a target reference frame;
[0050] A main reference image queue is determined from the deduplicated reference image queue according to the first indication information, and a target reference frame corresponding to the index value is selected from the main reference image queue according to the second indication information.
[0051] Optionally, if each reference frame in the non-target reference image queue exists in the target reference image queue, the acquiring indication information and selecting the target reference frame from the main reference image queue according to the indication information includes:
[0052] Determine the target reference image queue as a main reference image queue;
[0053] Acquire third indication information; wherein the third indication information is used to indicate an index value of a target reference frame;
[0054] A target reference frame corresponding to the index value is selected from the main reference image queue according to the third indication information.
[0055] Optionally, the decoding method further includes:
[0056] The number of reference frames of each reference image queue of the at least two reference image queues is obtained, and the reference image queue with the largest number of reference frames is used as the target reference image queue.
[0057] To achieve the above object, the present invention further proposes an encoding method, which further includes:
[0058] Determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block;
[0059] The current image block is encoded according to the availability of the motion vectors of the neighboring prediction image blocks.
[0060] To achieve the above object, the present invention further proposes an encoding method, which further includes:
[0061] Acquire a reference image queue configuration of the current image block, the reference image queue configuration comprising at least two reference image queues, the at least two reference image queues comprising a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information;
[0062] Deduplication of the at least two reference image queues;
[0063] The current image block is encoded according to the reference image queue after deduplication.
[0064] In addition, to achieve the above object, the present invention further provides a decoding device, the decoding device comprising:
[0065] A detection module, used to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block;
[0066] A decoding module is used to decode the current image block according to the availability of the motion vector of the adjacent predicted image block.
[0067] In addition, to achieve the above object, the present invention further provides a decoding device, the decoding device comprising:
[0068] an acquisition module, configured to acquire a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information;
[0069] A deduplication module, configured to perform deduplication on the at least two reference image queues;
[0070] A decoding module is used to decode the current image block according to the reference image queue after deduplication.
[0071] In addition, to achieve the above object, the present invention further provides an encoding device, the encoding device comprising:
[0072] A detection module, used to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block;
[0073] The encoding module is used to encode the current image block according to the availability of the motion vector of the adjacent prediction image block.
[0074] In addition, to achieve the above object, the present invention further provides an encoding device, the encoding device comprising:
[0075] an acquisition module, configured to acquire a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information;
[0076] A deduplication module, configured to perform deduplication on the at least two reference image queues;
[0077] The encoding module is used to encode the current image block according to the reference image queue after deduplication.
[0078] In addition, to achieve the above objectives, the present invention also proposes a decoding device, which includes: a memory, a processor, and a decoding program stored in the memory and running on the processor, and the decoding program is configured to implement the decoding method described above.
[0079] In addition, to achieve the above objectives, the present invention also proposes a coding device, which includes: a memory, a processor, and a coding program stored in the memory and running on the processor, and the coding program is configured to implement the coding method described above.
[0080] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a decoding and encoding program is stored, and when the decoding or encoding program is executed by a processor, the decoding or encoding method as described above is implemented.
[0081] The present invention determines the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; decodes the current image block according to the availability of motion vectors of the adjacent predicted image blocks, and utilizes the motion vector prediction mechanism and usage strategy in the above manner to accurately obtain the predicted value of the motion vector and improve the encoding performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 It is a structural diagram of a decoding device in a hardware operating environment involved in an embodiment of the present invention;
[0083] Figure 2 A schematic diagram of a video encoding framework in a decoding method of the present invention;
[0084] Figure 3 It is a flowchart of a first embodiment of a decoding method of the present invention;
[0085] Figure 4 It is a flowchart of a second embodiment of a decoding method of the present invention;
[0086] Figure 5 A schematic diagram of a flow chart of a third embodiment of a decoding method of the present invention;
[0087] Figure 6 It is a schematic diagram of the flow chart of the first embodiment of the encoding method of the present invention;
[0088] Figure 7 It is a schematic diagram of the flow chart of the second embodiment of the encoding method of the present invention;
[0089] Figure 8 is a structural block diagram of a first embodiment of a decoding device of the present invention;
[0090] Fig. 9 is a structural block diagram of a second embodiment of a decoding device of the present invention;
[0091] Fig.10 is a structural block diagram of a first embodiment of an encoding device of the present invention;
[0092] Fig.11It is a structural block diagram of the second embodiment of the encoding device of the present invention.
[0093] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0094] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0095] Reference Figure 1 , Figure 1 The figure is a schematic diagram of the structure of a decoding device in a hardware operating environment involved in an embodiment of the present invention.
[0096] like Figure 1 As shown, the decoding device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0097] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the decoding device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0098] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module and a decoding program.
[0099] exist Figure 1In the decoding device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the decoding device of the present invention can be set in the decoding device, and the decoding device calls the decoding program stored in the memory 1005 through the processor 1001, and executes the decoding method provided by the embodiment of the present invention.
[0100] 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 implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0101] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.
[0102] It should be understood that, although the terms first, second, third, etc. may be used to describe various information in this article, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this article, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination". Furthermore, as used in this article, the singular forms "one", "one" and "the" are intended to also include plural forms, unless there is an opposite indication in the context. It should be further understood that the terms "comprising" and "including" indicate that there are the described features, steps, operations, elements, components, projects, kinds, and / or groups, but do not exclude the existence, occurrence or addition of one or more other features, steps, operations, elements, components, projects, kinds, and / or groups. The terms "or", "and / or", "including at least one of the following" etc. used in this application can be interpreted as inclusive, or mean any one or any combination. For example, “comprising at least one of the following: A, B, C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”, and for another example, “A, B or C” or “A, B and / or C” means “any of the following: A; B; C; A and B; A and C; B and C; A and B and C”. An exception to this definition will only occur when a combination of elements, functions, steps or operations are inherently mutually exclusive in some manner.
[0103] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0104] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0105] It should be noted that in this article, step codes such as S10 and S20 are used for the purpose of expressing the corresponding content more clearly and concisely, and do not constitute a substantial limitation on the sequence. When implementing the step, those skilled in the art may execute S20 first and then S10, etc., but these should all be within the scope of protection of this application.
[0106] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0107] In an embodiment of the present application, a decoding method is proposed, which may involve the following concepts:
[0108] Prediction Signal: Prediction signal refers to the pixel value derived from the decoded pixel. The residual is obtained by the difference between the original pixel and the predicted pixel, and then the residual transform quantization and coefficient encoding are performed. In particular, the prediction pixel between frames refers to the pixel value derived from the reference frame (reconstructed pixel frame) of the current block. Since the pixel position is discrete, interpolation operation is required to obtain the final prediction pixel. The closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two, and the higher the coding compression performance.
[0109] Motion Vector (MV): In inter-frame coding, a motion vector (MV) is used to represent the relative displacement between the current coding block and the best matching block in its reference image. Each divided block has a corresponding motion vector that needs to be transmitted to the decoding end. If the MV of each block is encoded and transmitted independently, especially when divided into small-sized blocks, it will consume a considerable number of bits. In order to reduce the number of bits used to encode the motion vector, the spatial correlation between adjacent image blocks is used in video coding to predict the motion vector of the current block to be encoded based on the motion vector of the adjacent encoded block, and then encode the predicted difference. This can effectively reduce the number of bits representing the motion vector. Based on this, in the process of encoding the motion vector of the current image block, the motion vector of the adjacent encoded block is generally first used to predict the motion vector of the current macroblock, and then the difference (MVD) between the predicted value of the motion vector (MVP, Motion Vector Prediction) and the true estimate of the motion vector is encoded, thereby effectively reducing the number of encoding bits of the MV.
[0110] Motion Information: Since the motion vector represents the position offset between the current block and a block in a reference image, in order to accurately obtain the information pointing to the image block, in addition to the motion vector information, the reference image index information is also required to indicate which reference image is used. In video coding technology, for the current image, a reference image list is usually established based on certain principles, and the reference image index information indicates which reference image in the reference image list is used by the current block. In addition, many coding technologies also support multiple reference image lists, so an index value is also required to indicate which reference image list is used. Generally, we call this index value the reference direction. In video coding, we refer to motion-related coding information such as motion vectors, reference frame indexes, and reference directions as motion information.
[0111] Rate-Distortion Optimized: There are two major indicators for evaluating coding efficiency: bit rate and PSNR. The smaller the bit stream, the greater the compression rate; the larger the PSNR, the better the quality of the reconstructed image. When selecting a mode, the discriminant formula is essentially a comprehensive evaluation of the two. The cost corresponding to the mode: J(mode) = D + λ*R. Among them, D represents Distortion, which is usually measured by the SSE indicator. SSE refers to the mean square sum of the differences between the reconstructed block and the source image; λ is the Lagrange multiplier; R is the actual number of bits required for encoding the image block under this mode, including the sum of bits required for coding mode information, motion information, residuals, etc. When selecting a mode, if the RDO principle is used to make comparative decisions on the coding mode, the best coding performance can usually be guaranteed.
[0112] Intra Prediction and Inter Prediction: Intra prediction refers to predictive coding using the reconstructed pixel values of the spatial neighboring blocks of the current block (in the same frame image as the current block), while inter prediction refers to predictive coding using the reconstructed pixel values of the temporal neighboring blocks of the current block (in different images from the current block).
[0113] Video Coding Framework: See Figure 2 As shown, the video encoding framework can be used to implement the encoding end processing flow of the embodiment of the present application. In addition, the schematic diagram of the video decoding framework is similar to Figure 1Similarly, no further description is given here, and the decoding end processing flow of the embodiment of the present application can be implemented using a video decoding framework. A complete video encoding method generally includes modules such as prediction, transformation, quantization, entropy coding, and filtering. In the inter-frame prediction module, since there is a strong temporal correlation in the video, that is, there are many similar image blocks in two adjacent frames in the temporal domain, the image block of the current frame often performs motion search in the adjacent reference image to find the block that best matches the current block as the reference block. Since the reference block has a high similarity with the current block and the difference between the two is very small, the code rate overhead of the encoding difference is usually much smaller than the code rate overhead caused by directly encoding the pixel value of the current block. In order to indicate the position of the block that best matches the current block, a lot of motion information needs to be encoded and transmitted to the decoding end so that the decoding end can know the position of the best matching block. In inter-frame prediction, the predicted pixels are often obtained from the reference frame through motion information. In particular, when the bidirectional inter-frame prediction mode is turned on, the predicted pixels obtained by the two motion information are weighted to derive the final predicted pixels, and the weighting ratio is generally 1:1, 5:3, 3:5, etc.
[0114] The embodiment of the present invention provides a decoding method, referring to Figure 3 , Figure 3 The figure is a flowchart of a first embodiment of a decoding method of the present invention.
[0115] In this embodiment, the decoding method includes the following steps:
[0116] Step S10: Determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block.
[0117] The execution subject of this embodiment may be a decoding device, and the decoding device may be implemented in various forms. For example, the decoding device described in this application may include a mobile terminal or intelligent terminal such as a tablet computer, a laptop computer, a PDA, a camera, etc., and a fixed terminal device such as a desktop computer. These devices all have image processing functions, and the subsequent description will be described by taking the decoding device as an example.
[0118] It should be noted that, when using motion-compensated inter-frame prediction technology to encode video images, in order to reduce the number of bits used to encode motion vectors, the spatial correlation between adjacent image blocks is used in video encoding to predict the motion vector of the current block to be encoded based on the motion vector of the adjacent encoded block, and then encode the prediction difference. This can effectively reduce the number of bits representing the motion vector. Based on this, in the process of encoding the motion vector of the current image block, the motion vector of the adjacent encoded block is generally first used to predict the motion vector of the current macroblock, and then the difference (MVD, Motion Vector Difference) between the predicted value of the motion vector (MVP, Motion Vector Prediction) and the true estimate of the motion vector is encoded, thereby effectively reducing the number of encoding bits of the MV.
[0119] Under the existing prediction technology, when there are two reference image queues, in the motion vector prediction method of the scene, the availability of the motion vector may be determined according to the reference image queue corresponding to the motion vector. For example, if the adjacent block meets one of the following conditions, the motion information of the adjacent block is unavailable. 1. The adjacent block is "unavailable" (not decoded or does not belong to the same parallel unit (Slice, Tile, Patch, etc.) as the current block; 2. The adjacent bright block adopts the intra-frame prediction mode; 3. The adjacent block does not have the same motion vector as the reference image queue corresponding to the current block. At this time, if the reference image queue corresponding to the current block is one of the reference image queues, and the motion vector of the adjacent block points to a reference frame of the other reference image queue, for example, the reference image queue corresponding to the current block includes List0[0,8,16] and List1[8,16,24], if the reference image queue corresponding to the current block is List0, the motion vector of the adjacent block points to the first frame reference frame 8 of List1, even if the reference frame 8 also appears in List0, it will be determined as unavailable. In this case, the current prediction technology cannot accurately obtain the predicted value of the motion vector, resulting in the problem of low encoding performance.
[0120] In order to solve the above technical problems, in this embodiment, the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block is determined; the current image block is decoded according to the availability of motion vectors of the adjacent predicted image blocks, and the motion vector prediction mechanism and usage strategy in the above manner are utilized to accurately obtain the predicted value of the motion vector and improve the encoding performance. Specifically, this can be implemented as follows.
[0121] In this embodiment, for the motion vector prediction of B frames (or B images), the overall process of this solution includes obtaining the availability of motion information of adjacent blocks according to the reference image queue configuration. The method for obtaining the availability of motion information of adjacent blocks according to the reference image queue configuration is specifically as follows: the reference image queue corresponding to the current block that needs to perform motion vector prediction is used as the main reference image queue, and the remaining reference image queues are used as slave reference image queues. If the adjacent block is an inter-frame prediction block and the motion information of the adjacent block points to the slave reference image queue and the reference frame pointed to does not appear in the main reference image queue. In particular, if all reference frames in the slave reference image queue exist in the main reference image queue, the motion vector of the adjacent block is available as long as the adjacent block is an inter-frame prediction block. Subsequently, the motion vector prediction value of the current block pointing to the reference image queue is derived based on the availability of the motion information of the adjacent blocks. For example, the available motion information is scaled and weighted.
[0122] In the specific implementation, in this embodiment, it is necessary to first determine the main reference image queue and the slave reference image queue of the current image block. When determining the main reference image queue and the slave reference image queue, it can be determined based on the direction of the motion vector to be predicted of the current block, and the reference image queue pointed to by the motion vector to be predicted of the current image block can be the main reference image queue, and the remaining reference image queues are slave reference image queues. For example, the reference image queues corresponding to the current image are List0 and List1. Assuming that the motion vector to be predicted of the current image block points to List0, in this embodiment, List0 can be used as the main reference image queue, and the remaining List1 is the slave reference image queue. Furthermore, taking the encoding end as an example, the process of motion vector to be predicted refers to the encoding end trying to point to a certain reference image queue for motion vector prediction. Taking the decoding end as an example, the process of motion vector to be predicted refers to the decoding end first determining from the code stream that it points to a certain reference image queue, and then performing the corresponding motion vector prediction process.
[0123] After determining the main reference image queue and the secondary reference image queue, in this embodiment, the availability of the motion vector of the adjacent predicted image block corresponding to the current image block can be further judged in combination with the preset conditions. The specific process of judging the availability of the motion vector is to detect whether at least one of the following first preset conditions is met. If at least one of the following first preset conditions is met, it can be determined that the motion vector of the adjacent predicted image block is unavailable. The first preset condition in this embodiment includes that the adjacent predicted image block is an unavailable adjacent predicted image block, the adjacent predicted image block adopts the intra-frame prediction mode, and the motion vector of the adjacent predicted image block points to the slave reference image queue, and the reference frame in the slave reference image queue pointed to does not exist in the main reference image queue, wherein the adjacent predicted image block is an unavailable adjacent predicted image block, which means that the adjacent predicted image block is not decoded or does not belong to the same parallel unit (Slice, Tile, Patch) as the current block, etc., the motion vector of the adjacent predicted image block points to the slave reference image queue, and the reference frame in the slave reference image queue pointed to does not exist in the main reference image queue, for example, the motion vector of the adjacent predicted image block points to the slave reference image queue List1, and the reference frame in List1 pointed to is reference frame 24, and reference frame 24 does not exist in List0.
[0124] The above-mentioned availability judgment is based on the situation that the main reference image queue and the slave reference image queue are different. For the special situation of the main reference image queue and the slave reference image queue, in this embodiment, the availability of the motion vector of the adjacent prediction image block is judged according to the second preset condition. The specific process is to detect whether at least one of the following second preset conditions is met. If at least one of the following second preset conditions is met, it can be determined that the motion vector of the adjacent prediction image block is unavailable. The second preset condition in this embodiment includes that the adjacent prediction image block is an unavailable adjacent prediction image block and the adjacent prediction image block adopts an intra-frame prediction mode.
[0125] In an optional embodiment, for the special cases of the main reference image queue and the slave reference image queue, the present embodiment can make a judgment based on preset attribute characteristics. Specifically, it is first judged whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics. If the attribute characteristics of the reference image queue meet the preset attribute characteristics, the main reference image queue and the slave reference image queue belong to the above-mentioned special cases, and the availability of motion vectors of adjacent predicted image blocks can be judged based on the above-mentioned second preset condition.
[0126] In an optional embodiment, judging whether the attribute characteristics of the reference image queue of the current image block meet the preset attribute characteristics may include two situations. The first situation is that each reference frame in the slave reference image queue exists in the master reference image queue. When this situation occurs, it can be determined that the slave reference image queue is a subset of the master reference image queue, for example, List0 is [A, B, C], List1 is [A, B], List0 is the master reference image queue, and List1 is the slave reference image queue. The second situation is that each reference frame in the slave reference image queue exists in the master reference image queue, and each reference frame in the master reference image queue exists in the slave reference image queue. When this situation occurs, it can be determined that the slave reference image queue is exactly the same as the master reference image queue, for example, List0 is [A, B, C], List1 is [C, B, A], List0 is the master reference image queue, and List1 is the slave reference image queue. If any of the above two situations is met, it is determined that the attribute characteristics of the reference image queue of the current image block meet the preset attribute characteristics.
[0127] In an optional example, in this embodiment, the availability can also be judged based on the current image type and the value of PicSameListFlag. For example, if the current image type is a B image and the value of PicSameListFlag is equal to 0, and the prediction unit where the adjacent luminance prediction block X is located does not have the same motion vector as the reference image queue corresponding to the current motion vector to be predicted, then the adjacent prediction image block is determined to be unavailable, wherein, if each reference frame in the slave reference image queue exists in the master reference image queue, and each reference frame in the master reference image queue exists in the slave reference image queue, that is, the slave reference image queue is the same as the master reference image queue, then the value of PicSameListFlag is equal to 1, otherwise if the slave reference image queue is different from the master reference image queue, then the value of PicSameListFlag is equal to 0.
[0128] Step S20: Decoding the current image block according to the availability of the motion vectors of the adjacent predicted image blocks.
[0129] In a specific implementation, after determining the availability of motion vectors of adjacent predicted image blocks, this embodiment can further obtain a motion vector prediction value of the current image block pointing to the primary reference image queue based on the availability of motion vectors of adjacent predicted image blocks.
[0130] In an optional embodiment, the process of obtaining the motion vector prediction value of the current image block pointing to the primary reference image queue based on the motion vector availability of the adjacent predicted image blocks is, for example, assuming that A, B and C are adjacent predicted image blocks of the current image block, and the logic of calculating the x and y motion vector components of the motion vector prediction value is as follows:
[0131]
[0132]
[0133] It should be noted that MVEPred->x represents the x motion component of the motion vector prediction value, MVA->x, MVB->x and MVC->x represent the horizontal component values of the scaled motion vectors of the adjacent prediction image blocks A, B and C respectively, and the above logic means that the x motion component of the motion vector prediction value is the average value of the horizontal component values of the two motion vectors with the same direction in the adjacent prediction image blocks A, B and C, or the average value of the horizontal component values of the two motion vectors with the smallest absolute difference value in the adjacent prediction image blocks A, B and C. The above logic is aimed at the solution process of the x motion component of the motion vector prediction value, and the solution process of the motion component in the y direction of the motion vector prediction value is similar to the solution process of the x motion component, which will not be repeated in this embodiment.
[0134] After determining the availability of motion vectors of adjacent predicted image blocks, the motion vector prediction value pointing to the main reference image queue except for the final current image block can be calculated through the above process, and it should be emphasized that the above process is only an example and is not a limitation of this embodiment. In practical applications, other methods can also be used to calculate the motion vector prediction value. After obtaining the motion vector prediction value, the current image block can be decoded or encoded based on the motion vector prediction value.
[0135] This embodiment determines the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; decodes the current image block according to the availability of motion vectors of the adjacent predicted image blocks, and utilizes the motion vector prediction mechanism and usage strategy in the above manner to accurately obtain the predicted value of the motion vector and improve encoding.
[0136] refer to Figure 4 , Figure 4 FIG. 4 is a flow chart of a second embodiment of a decoding method according to the present invention.
[0137] This embodiment provides a decoding method, and the decoding method includes:
[0138] Step S30: Obtain a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information.
[0139] It should be noted that the current prediction technology still has a problem. When there are two reference image lists, there may be two expressions of a one-way reference frame combination. For example, if the reference image queues of the current image block are configured as List0[0,8,16] and List1[8,16,24], the reference frame combination (8) has two expressions: 1. Point to the reference frame list List0 and take the second reference frame 8 in List0; 2. Point to the reference frame list List1 and take the first reference frame 8 in List1. In this case, if the motion vectors pointing to reference frame 8 are the same, the above two expressions are redundant.
[0140] In order to solve the above-mentioned technical problems, in this example, redundancy can be removed by deduplicating the reference frames. The process of removing redundancy by deduplicating the reference frames is to preset a main reference image queue (different from motion vector prediction, a main reference queue is preset on the decoding end at this time). When the main reference image queue is List0, the slave reference image queue can be List1, and the main reference image queue is different from the slave reference image queue. When a reference frame exists in both the main reference image queue and the slave reference image queue, the frame in the main reference image queue is retained, and the reference frame in the slave reference image queue is removed. In particular, if all reference frames in the slave reference image queue exist in the main reference image queue, there is no need to additionally identify the List pointed to by the unidirectional motion information, because the unidirectional motion information can only point to the main reference image queue at this time. And it should be emphasized that the deduplication operation in this embodiment is for unidirectional motion information and does not affect the bidirectional reference image queue.
[0141] In the specific implementation, in this embodiment, it is first necessary to obtain the reference image queue configuration of the current image block. The obtained reference image queue configuration includes at least two reference image queues, such as a first reference image queue and a second reference image queue. Since the removal operation is aimed at unidirectional motion information, the current image block in this embodiment is unidirectional motion information.
[0142] Step S40: Deduplication of the at least two reference image queues.
[0143] It should be noted that when deduplicating at least two reference image queues, it is necessary to first obtain the target reference image queue and the non-target reference image queue. Unlike motion vector prediction, the main reference image queue in the motion vector prediction process is the reference image queue pointed to by the current image block, while the target reference image queue in the redundancy removal process is preset by the decoding end.
[0144] In an optional embodiment, the target reference image queue can also be determined based on the number of reference frames of each reference image queue. Specifically, the number of reference frames of each reference image queue in at least two reference image queues is obtained, and then the number of reference frames of each reference image queue is used to determine the reference image queue with the largest number of reference frames. Finally, the reference image queue with the largest number of reference frames is used as the target reference image queue.
[0145] In this embodiment, at least two reference image queues include a first reference image queue and a second reference image queue. The target reference image queue can be the first reference image queue or the second reference image queue, and the non-target reference image queue is the remaining reference image queue except the target reference image queue. For example, when the target reference image queue is the first reference image queue, the non-target reference image queue is the second reference image queue.
[0146] In an optional embodiment, after determining the target reference image queue and the non-target reference image queue, the deduplication process may be to keep the reference frames in the target reference image queue unchanged, and remove the reference frames in the non-target reference image queue that are repeated with the target reference image queue. For example, assuming that the target reference image queue is List0[0,2,4] and the non-target reference image queue is List1[2,4,6], when deduplication is performed, the reference frames in the target reference image queue are kept unchanged, that is, the reference frames in List0 are kept unchanged, and then the reference frames in the non-target reference image queue that are repeated with the target reference image queue, that is, the reference frames that are repeated with List1 and List0 are determined. By comparison, it can be known that the reference frames in List1 that are repeated with List0 are reference frames 2 and reference frames 4. Finally, reference frames 2 and reference frames 4 are removed from List1. After deduplication, List0[0,2,4] and List1[6] can be obtained. If the unidirectional motion information points to List1 at this time, it will no longer be indicated whether it points to the reference frames 2 and 4 that are removed by deduplication.
[0147] In an optional embodiment, the above deduplication operation is for the case where the target reference image queue and the non-target reference image queue are different. For the special case of the target reference image queue and the non-target reference image queue, the deduplication operation is performed in other ways in this embodiment. Specifically, the special case of the target reference image queue and the non-target reference image queue in this embodiment refers to the non-target reference image queue being a subset of the target reference image queue or the non-target reference image queue being exactly the same as the target reference image queue.
[0148] In an optional embodiment, for the special cases of the target reference image queue and the non-target reference image queue, the present embodiment can make a judgment based on preset attribute characteristics. Specifically, it is first determined whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics. If the attribute characteristics of the reference image queue meet the preset attribute characteristics, it can be determined that the target reference image queue and the non-target reference image queue are the above-mentioned special cases.
[0149] In an optional embodiment, judging whether the attribute characteristics of the reference image queue of the current image block meet the preset attribute characteristics may include two situations. The first situation is that each reference frame in the non-target reference image queue exists in the target reference image queue. When this situation occurs, it can be determined that the non-target reference image queue is a subset of the target reference image queue, for example, List0 is [A, B, C], List1 is [A, B], List0 is the target reference image queue, and List1 is the non-target reference image queue. The second situation is that each reference frame in the non-target reference image queue exists in the target reference image queue, and each reference frame in the target reference image queue exists in the non-target reference image queue. When this situation occurs, it can be determined that the non-target reference image queue is exactly the same as the target reference image queue, for example, List0 is [A, B, C], List1 is [A, B, C], List0 is the target reference image queue, and List1 is the non-target reference image queue. If any of the above two situations is met, it is determined that the attribute characteristics of the reference image queue of the current image block meet the preset attribute characteristics.
[0150] Furthermore, if the attribute characteristics of the reference image queue meet the preset attribute characteristics, in this embodiment, the reference frames in the target reference image queue are kept unchanged, and the reference frames in the non-target reference image queue are removed. For example, assuming that the target reference image queue is List0[1,2,3] and the non-target reference image queue is List1[1,3], after deduplication: List0[1,2,3], List1[]. For another example, assuming that the target reference image queue is List0[0,8,16] and the non-target reference image queue is List1[0,8,16], after deduplication: List0[0,8,16], List1[].
[0151] In an optional embodiment, after the deduplication operation is completed, the reference image queue can also be sorted in this embodiment, for example, the reference frames in the target reference image queue are reordered, or the reference frames in the non-target reference image queue are reordered, or both the reference frames in the target reference image queue and the reference frames in the non-target reference image queue are reordered. In this embodiment, the reordering of the reference frames in the target reference image queue is used for illustration. Specifically, the reference frames that exist in both the target reference image queue and the non-target reference image queue can be put in front. For example, the target reference image queue is List0[1,2,3], and the non-target reference image queue is List1[1,3]. After deduplication, List0[1,2,3] and List1[] are obtained. By comparison, it can be determined that the reference frames that exist in both List0 and List1 are 1 and 3. After reordering List0, List0[1,3,2] is obtained. For example, the target reference image queue is List0[2,4,6,8], and the non-target reference image queue is List1[6,8,10,12]. After deduplication, List0[2,4,6,8] and List1[10,12] are obtained. By comparison, it can be determined that the reference frames that exist in both List0 and List1 are 6 and 8. After reordering List0, List0[8,6,2,4] is obtained. List1 can also be reordered, for example, List0[12,10].
[0152] Table 3 In an optional embodiment, the prediction reference mode InterPredRefMode represents the prediction reference mode used by the current prediction unit, and the corresponding syntax is shown in Table 1 below.
[0153] Table 1:
[0154] if (the current image is a B image) { inter_pred_ref_mode_index ae(v) }
[0155] The prediction reference mode index inter_pred_ref_mode_index is used to determine the prediction reference mode used by the current prediction unit. InterPredRefModeIndex is equal to the value of inter_pred_ref_mode_index. If inter_pred_ref_mode_index does not exist in the bitstream, or the current picture is a P picture, the value of InterPredRefModeIndex is 0. The debinarization process of this syntax is:
[0156] If the current picture type is a B picture and the value of PicSubListFlag is equal to 1, the value of inter_pred_ref_mode_index is obtained by checking the binary symbol string 0; otherwise, the value of inter_pred_ref_mode_index is obtained by checking the binary symbol string 0.
[0157] Wherein, for the case where the non-target reference image queue is a subset of the target reference image queue, if the non-target reference image queue is a subset of the target reference image queue, the value of PicSubListFlag is equal to 1, otherwise if the non-target reference image queue is not a subset of the target reference image queue, the value of PicSubListFlag is equal to 0. For the case where the non-target reference image queue is the same as the target reference image queue, if the non-target reference image queue is the same as the target reference image queue, the value of PicSubListFlag is equal to 1, otherwise if the non-target reference image queue is not the same as the target reference image queue, the value of PicSubListFlag is equal to 0.
[0158] Furthermore, there are two corresponding relationships between the value of inter_pred_ref_mode_index and the binary symbol string. The first corresponding relationship is shown in Table 2, and the second corresponding relationship is shown in Table 3.
[0159] Table 2:
[0160] The value of inter_pred_ref_mode_index Binary symbol string 0 0 2 1 binIndex 0
[0161] Table 3:
[0162]
[0163] Step S50: decoding the current image block according to the reference image queue after deduplication.
[0164] In a specific implementation, after the deduplication operation is completed, in this embodiment, a target reference frame can be selected from the deduplication reference image queue, and encoding and decoding of the current image block can be implemented according to the target reference frame.
[0165] This embodiment obtains the reference image queue configuration of the current image block, the reference image queue configuration includes at least two reference image queues, the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; deduplicates the at least two reference image queues; decodes the current image block according to the deduplicated reference image queues, and removes redundancy by the above-mentioned reference frame deduplication operation method, thereby improving the encoding performance.
[0166] refer to Figure 5 , Figure 5 FIG. 4 is a flow chart of a third embodiment of a decoding method according to the present invention.
[0167] Based on the above second embodiment, in the decoding method of this embodiment, step S50 specifically includes:
[0168] Step S501: Determine the main reference picture queue pointed to by the unidirectional motion information in the deduplicated reference picture queue.
[0169] In a specific implementation, during decoding, the current image block points to the main reference image queue. The current image block in this embodiment is unidirectional motion information, so the unidirectional motion information in the deduplicated reference image queue points to the main reference image queue.
[0170] Step S502: Acquire indication information, and select a target reference frame from the main reference image queue according to the indication information.
[0171] In a specific implementation, after determining the main reference image queue, this embodiment needs to further obtain indication information, and select a target reference frame from the main reference image queue according to the obtained indication information.
[0172] In an optional embodiment, the indication information obtained in this embodiment includes first indication information and second indication information, wherein the first indication information is used to indicate the main reference image queue, and the second indication information is used to indicate the index value of the target reference frame. According to the first indication information, the main reference image queue can be first determined from the reference image queue after deduplication, and after the main reference image queue is determined, the target reference frame corresponding to the index value can be selected from the main reference image queue according to the second indication information.
[0173] In an optional embodiment, if every reference frame in the non-target reference image queue exists in the target reference image queue, after the deduplication operation, only the target reference image queue remains. At this time, the target reference image queue can be directly determined as the main reference image queue. In this case, the indication information obtained in this embodiment is the third indication information, and the third indication information is used to indicate the index value of the target reference frame. Since the main reference image queue is determined, the target reference frame corresponding to the index value is selected from the main reference image queue according to the third indication information.
[0174] Step S503: Decode the current image block according to the target reference frame.
[0175] It is easy to understand that after obtaining the target reference frame, the decoding of the current image block can be achieved based on the target reference frame, which can be achieved based on general decoding technology and will not be described in detail here.
[0176] This embodiment determines the main reference image queue pointed to by the unidirectional motion information in the deduplicated reference image queue, obtains indication information, selects a target reference frame from the main reference image queue according to the indication information, decodes the current image block according to the target reference frame, and decodes the current image block based on the target reference frame obtained after the deduplication operation based on different indication information, thereby improving decoding performance.
[0177] refer to Figure 6 , Figure 6 FIG. 4 is a flow chart of a second embodiment of an encoding method according to the present invention.
[0178] like Figure 6 As shown, in one encoding method of this embodiment, the encoding method includes:
[0179] Step S100: Determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block.
[0180] Step S200: Encode the current image block according to the availability of motion vectors of the adjacent predicted image blocks.
[0181] It should be noted that the motion vector prediction process at the encoding end in this embodiment is similar to the motion vector prediction process at the decoding end. The motion vector prediction process at the decoding end in the first embodiment corresponding to the above decoding method can be referred to and will not be repeated in this embodiment.
[0182] In this embodiment, the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block is determined; the current image block is encoded according to the availability of motion vectors of the adjacent predicted image blocks, and the motion vector prediction mechanism and usage strategy in the above manner are utilized to accurately obtain the predicted value of the motion vector, thereby improving the encoding performance.
[0183] refer to Figure 7 , Figure 7 It is a flowchart diagram of a first embodiment of an encoding method of the present invention.
[0184] like Figure 7 As shown, in one encoding method of this embodiment, the encoding method includes:
[0185] Step S300: Obtain a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information.
[0186] Step S400: Deduplication of the at least two reference image queues.
[0187] Step S500: Encode the current image block according to the reference image queue after deduplication.
[0188] It should be noted that the motion vector prediction process at the encoding end in this embodiment is similar to the motion vector prediction process at the decoding end. The motion vector prediction process at the decoding end in the second and third embodiments corresponding to the above decoding method can be referred to and will not be repeated in this embodiment.
[0189] This embodiment obtains the reference image queue configuration of the current image block, the reference image queue configuration includes at least two reference image queues, the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; deduplicates the at least two reference image queues; encodes the current image block according to the deduplicated reference image queues, and removes redundancy by the above-mentioned reference frame deduplication operation method, which can improve the encoding performance.
[0190] Reference Figure 8 , Figure 8 FIG. 4 is a structural block diagram of a first embodiment of a decoding device according to the present invention.
[0191] like Figure 8 As shown, the decoding device proposed in the embodiment of the present invention includes:
[0192] The detection module 10 is used to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block.
[0193] The decoding module 20 is configured to decode the current image block according to the availability of the motion vectors of the adjacent predicted image blocks.
[0194] This embodiment determines the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; decodes the current image block according to the availability of motion vectors of the adjacent predicted image blocks, and utilizes the motion vector prediction mechanism and usage strategy in the above manner to accurately obtain the predicted value of the motion vector and improve the encoding performance.
[0195] In an optional embodiment, the detection module 20 is further used to determine a main reference image queue and a slave reference image queue of the current image block, the main reference image queue being the reference image queue pointed to by the motion vector to be predicted of the current image block, and the slave reference image queue being the remaining reference image queue except the main reference image queue; when at least one of the following first preset conditions is met, it is determined that the motion vector of the adjacent predicted image block is unavailable; the first preset condition includes: the adjacent predicted image block is an unavailable adjacent predicted image block; the adjacent predicted image block adopts an intra-frame prediction mode; the motion vector of the adjacent predicted image block points to the slave reference image queue, and the reference frame in the slave reference image queue pointed to does not exist in the main reference image queue.
[0196] In an optional embodiment, the detection module 20 is further used to determine whether the reference image queue attribute characteristics corresponding to the current image block meet the preset attribute characteristics; if the reference image queue attribute characteristics meet the preset attribute characteristics, then when at least one of the following second preset conditions is met, it is determined that the motion vector of the adjacent predicted image block corresponding to the current image block is unavailable; the second preset condition includes: the adjacent predicted image block is an unavailable adjacent predicted image block; the adjacent predicted image block adopts an intra-frame prediction mode.
[0197] In an optional embodiment, the detection module 20 is further used to determine a main reference image queue and a slave reference image queue of the current image block, wherein the main reference image queue is a reference image queue pointed to by a motion vector to be predicted of the current image block, and the slave reference image queue is a remaining reference image queue except the main reference image queue; if each reference frame in the slave reference image queue exists in the main reference image queue, or each reference frame in the slave reference image queue exists in the main reference image queue and each reference frame in the main reference image queue exists in the slave reference image queue, then it is determined that the attribute characteristics of the reference image queue meet the preset attribute characteristics.
[0198] Reference Fig. 9 , Fig. 9It is a structural block diagram of the second embodiment of the decoding device of the present invention.
[0199] like Fig. 9 As shown, the decoding device proposed in the embodiment of the present invention includes:
[0200] An acquisition module 30 is used to acquire a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information;
[0201] A processing module 40, configured to deduplicate the at least two reference image queues;
[0202] The decoding module 50 is used to decode the current image block according to the reference image queue after deduplication.
[0203] This embodiment obtains the reference image queue configuration of the current image block, the reference image queue configuration includes at least two reference image queues, the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; deduplicates the at least two reference image queues; decodes the current image block according to the deduplicated reference image queues, and removes redundancy by the above-mentioned reference frame deduplication operation method, thereby improving the encoding performance.
[0204] In one embodiment, the processing module 40 is also used to determine a target reference image queue and a non-target reference image queue, the target reference image queue is the first reference image queue or the second reference image queue, and the non-target reference image queue is the remaining reference image queue except the target reference image queue; keep the reference frames in the target reference image queue unchanged, and remove the reference frames in the non-target reference image queue that are repeated with those in the target reference image queue.
[0205] In one embodiment, the processing module 40 is also used to determine whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics; the deduplication of the at least two reference image queues includes: if the attribute characteristics of the reference image queue meet the preset attribute characteristics, then the reference frame in the target reference image queue is kept unchanged, and the reference frame in the non-target reference image queue is eliminated.
[0206] In one embodiment, the processing module 40 is also used to reorder the reference frames in the target reference image queue; or, to reorder the reference frames in the non-target reference image queue; or, to reorder the reference frames in the target reference image queue and to reorder the reference frames in the non-target reference image queue.
[0207] In one embodiment, the processing module 40 is also used to determine that the attribute characteristics of the reference image queue meet the preset attribute characteristics if each reference frame in the non-target reference image queue exists in the target reference image queue, or each reference frame in the non-target reference image queue exists in the target reference image queue and each reference frame in the target reference image queue exists in the non-target reference image queue.
[0208] In one embodiment, the decoding module 50 is further used to determine the main reference image queue pointed to by the unidirectional motion information in the deduplicated reference image queue; obtain indication information, select a target reference frame from the main reference image queue according to the indication information; and decode the current image block according to the target reference frame.
[0209] In one embodiment, the decoding module 50 is also used to obtain first indication information and second indication information; wherein the first indication information is used to indicate the main reference image queue, and the second indication information is used to indicate the index value of the target reference frame; the main reference image queue is determined from the deduplicated reference image queue according to the first indication information, and the target reference frame corresponding to the index value is selected from the main reference image queue according to the second indication information.
[0210] In one embodiment, the decoding module 50 is also used to determine the target reference image queue as the main reference image queue; obtain third indication information; wherein the third indication information is used to indicate the index value of the target reference frame; and select the target reference frame corresponding to the index value from the main reference image queue according to the third indication information.
[0211] In one embodiment, the processing module 40 is further configured to obtain the number of reference frames of each of the at least two reference image queues, and use the reference image queue with the largest number of reference frames as the target reference image queue.
[0212] Reference Fig.10 , Fig.10 FIG. 4 is a structural block diagram of a first embodiment of an encoding device according to the present invention.
[0213] like Fig.10 As shown, the encoding device proposed in the embodiment of the present invention includes:
[0214] The detection module 100 is used to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block.
[0215] The encoding module 200 is used to encode the current image block according to the availability of the motion vector of the adjacent predicted image block.
[0216] In this embodiment, the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block is determined; the current image block is encoded according to the availability of motion vectors of the adjacent predicted image blocks, and the motion vector prediction mechanism and usage strategy in the above manner are utilized to accurately obtain the predicted value of the motion vector, thereby improving the encoding performance.
[0217] Reference Fig.11 , Fig.11 It is a structural block diagram of the second embodiment of the encoding device of the present invention.
[0218] like Fig.11 As shown, the encoding device proposed in the embodiment of the present invention includes:
[0219] The acquisition module 300 is used to obtain the reference image queue configuration of the current image block, the reference image queue configuration includes at least two reference image queues, the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information.
[0220] The processing module 400 is used to deduplicate the at least two reference image queues.
[0221] The encoding module 500 is used to encode the current image block according to the reference image queue after deduplication.
[0222] This embodiment obtains the reference image queue configuration of the current image block, the reference image queue configuration includes at least two reference image queues, the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; deduplicates the at least two reference image queues; encodes the current image block according to the deduplicated reference image queues, and removes redundancy by the above-mentioned reference frame deduplication operation method, which can improve the encoding performance.
[0223] In addition, an embodiment of the present invention further provides a storage medium, on which a decoding and encoding program is stored. When the decoding or encoding program is executed by a processor, the steps of the decoding or encoding method described above are implemented.
[0224] Since the storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be described one by one here.
[0225] It should be understood that the above is only an example and does not constitute any limitation on the technical solution of the present invention. In specific applications, technicians in this field can make settings as needed, and the present invention does not limit this.
[0226] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.
[0227] In addition, for technical details not fully described in this embodiment, reference can be made to the decoding method provided in any embodiment of the present invention, and will not be repeated here.
[0228] In addition, it should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0229] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0230] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM) / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0231] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
[0232] It should be understood that, although the various steps in the flowchart in the embodiment of the present application are displayed in sequence according to the indication of the arrows, these steps are not necessarily performed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and it can be performed in other orders. Moreover, at least a portion of the steps in the figure may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and their execution order is not necessarily performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
Claims
1. A decoding method, characterized in that: The decoding method comprises: Determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; The current image block is decoded according to the availability of the motion vectors of the neighboring predicted image blocks.
2. The decoding method according to claim 1, characterized in that: The determining the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block comprises: Determine a main reference image queue and a secondary reference image queue of the current image block, wherein the main reference image queue is a reference image queue pointed to by a motion vector to be predicted of the current image block, and the secondary reference image queue is a remaining reference image queue except the main reference image queue; When at least one of the following first preset conditions is met, determining that the motion vector of the adjacent prediction image block is unavailable; The first preset condition includes: The adjacent prediction image block is an unavailable adjacent prediction image block; The adjacent prediction image blocks adopt an intra-frame prediction mode; The motion vector of the adjacent prediction image block points to the slave reference image queue, and the reference frame in the slave reference image queue pointed to does not exist in the master reference image queue.
3. The decoding method according to claim 1, characterized in that: The determining the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block also includes: Determine whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics; If the attribute feature of the reference image queue satisfies the preset attribute feature, then when at least one of the following second preset conditions is met, it is determined that the motion vector of the adjacent prediction image block corresponding to the current image block is unavailable; The second preset condition includes: The adjacent prediction image block is an unavailable adjacent prediction image block; The adjacent prediction image blocks adopt an intra-frame prediction mode.
4. The decoding method according to claim 3, characterized in that: The determining whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics includes: Determine a main reference image queue and a secondary reference image queue of the current image block, wherein the main reference image queue is a reference image queue pointed to by a motion vector to be predicted of the current image block, and the secondary reference image queue is a remaining reference image queue except the main reference image queue; If each reference frame in the slave reference image queue exists in the master reference image queue, or, each reference frame in the slave reference image queue exists in the master reference image queue and each reference frame in the master reference image queue exists in the slave reference image queue, it is determined that the attribute characteristics of the reference image queue meet the preset attribute characteristics.
5. A decoding method, characterized in that: The decoding method comprises: Acquire a reference image queue configuration of the current image block, the reference image queue configuration comprising at least two reference image queues, the at least two reference image queues comprising a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; Deduplication of the at least two reference image queues; The current image block is decoded according to the deduplicated reference image queue.
6. The decoding method according to claim 5, characterized in that: The deduplication of the at least two reference image queues comprises: Determine a target reference image queue and a non-target reference image queue, wherein the target reference image queue is the first reference image queue or the second reference image queue, and the non-target reference image queue is a remaining reference image queue except the target reference image queue; The reference frames in the target reference image queue are kept unchanged, and the reference frames in the non-target reference image queue that are repeated with those in the target reference image queue are removed.
7. The decoding method according to claim 6, characterized in that: Before deduplication of the at least two reference image queues, the method further includes: Determining whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics; The deduplication of the at least two reference image queues comprises: If the attribute characteristics of the reference image queue meet the preset attribute characteristics, the reference frames in the target reference image queue are kept unchanged, and the reference frames in the non-target reference image queue are removed.
8. The decoding method according to claim 7, characterized in that: After the reference frames in the target reference image queue are kept unchanged and the reference frames in the non-target reference image queue are removed, the method further includes: reordering the reference frames in the target reference image queue; or, Reordering the reference frames in the non-target reference image queue; or, The reference frames in the target reference picture queue are reordered and the reference frames in the non-target reference picture queue are reordered.
9. The decoding method according to claim 7, characterized in that: The determining whether the attribute characteristics of the reference image queue corresponding to the current image block meet the preset attribute characteristics includes: If every reference frame in the non-target reference image queue exists in the target reference image queue, or, every reference frame in the non-target reference image queue exists in the target reference image queue and every reference frame in the target reference image queue exists in the non-target reference image queue, then it is determined that the attribute characteristics of the reference image queue meet the preset attribute characteristics.
10. The decoding method according to claim 9, characterized in that: The decoding of the current image block according to the reference image queue after deduplication includes: Determine a primary reference image queue to which the unidirectional motion information in the reference image queue after deduplication points; Acquire indication information, and select a target reference frame from the main reference image queue according to the indication information; The current image block is decoded according to the target reference frame.
11. The decoding method according to claim 10, characterized in that: The acquiring indication information and selecting a target reference frame from the main reference image queue according to the indication information includes: Acquire first indication information and second indication information; wherein the first indication information is used to indicate a main reference image queue, and the second indication information is used to indicate an index value of a target reference frame; A main reference image queue is determined from the deduplicated reference image queue according to the first indication information, and a target reference frame corresponding to the index value is selected from the main reference image queue according to the second indication information.
12. The decoding method according to claim 10, characterized in that: If each reference frame in the non-target reference image queue exists in the target reference image queue, the acquiring indication information and selecting the target reference frame from the main reference image queue according to the indication information include: Determine the target reference image queue as a main reference image queue; Acquire third indication information; wherein the third indication information is used to indicate an index value of a target reference frame; A target reference frame corresponding to the index value is selected from the main reference image queue according to the third indication information.
13. The decoding method according to claim 6, characterized in that: The decoding method further comprises: The number of reference frames of each reference image queue of the at least two reference image queues is obtained, and the reference image queue with the largest number of reference frames is used as the target reference image queue.
14. A coding method, characterized in that: The encoding method comprises: Determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; The current image block is encoded according to the availability of the motion vectors of the neighboring prediction image blocks.
15. A coding method, characterized in that: The encoding method comprises: Acquire a reference image queue configuration of the current image block, the reference image queue configuration comprising at least two reference image queues, the at least two reference image queues comprising a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; Deduplication of the at least two reference image queues; The current image block is encoded according to the reference image queue after deduplication.
16. A decoding device, characterized in that: The decoding device comprises: A detection module, used to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; A decoding module is used to decode the current image block according to the availability of the motion vector of the adjacent predicted image block.
17. A decoding device, characterized in that: The decoding device comprises: an acquisition module, configured to acquire a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; A deduplication module, configured to perform deduplication on the at least two reference image queues; A decoding module is used to decode the current image block according to the reference image queue after deduplication.
18. An encoding device, characterized in that: The encoding device comprises: A detection module, used to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block; The encoding module is used to encode the current image block according to the availability of the motion vector of the adjacent prediction image block.
19. An encoding device, characterized in that: The encoding device comprises: an acquisition module, configured to acquire a reference image queue configuration of the current image block, wherein the reference image queue configuration includes at least two reference image queues, wherein the at least two reference image queues include a first reference image queue and a second reference image queue, and the motion information of the current image block is unidirectional motion information; A deduplication module, configured to perform deduplication on the at least two reference image queues; The encoding module is used to encode the current image block according to the reference image queue after deduplication.
20. A decoding device, characterized in that: The decoding device comprises: a memory, a processor, and a decoding program stored in the memory and running on the processor, wherein the decoding program is configured to implement the decoding method according to any one of claims 1 to 13.
21. A coding device, characterized in that: The encoding device comprises: a memory, a processor, and an encoding program stored in the memory and running on the processor, wherein the encoding program is configured to implement the encoding method according to claim 14 or 15.
22. A storage medium, characterized in that: The storage medium stores a decoding and encoding program, and when the decoding or encoding program is executed by the processor, the decoding or encoding method according to any one of claims 1 to 13 or 14-15 is implemented.
Citation Information
Patent Citations
Decoding and coding method and equipment thereof
CN110933426A
Coding and decoding method, device and equipment
CN111726632A
Candidate motion vector list acquisition method and device and codec
CN111953997A
Video coding device and video decoding device
JP2020145484A
Device and method for encoding motion vector, and device and method for decoding motion vector
WO2021206280A1