Decoding method, encoding method, apparatus, device, and storage medium
By identifying and utilizing a reference image queue configuration for deduplication, the problem of inaccurate motion vector prediction in existing technologies is solved, thus improving coding performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
- Filing Date
- 2023-09-26
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies in motion-compensated inter-frame prediction techniques cannot accurately obtain the predicted values of motion vectors, resulting in low coding performance.
By determining the availability of motion vectors in adjacent predicted image blocks corresponding to the current image block, deduplication is performed using a reference image queue configuration to obtain accurate motion vector prediction values and improve coding performance.
It enables accurate acquisition of motion vector prediction values in the case of multiple reference image queues, thereby improving coding performance.
Smart Images

Figure CN119728987B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image encoding and decoding technology, and in particular to a decoding method, encoding method, apparatus, device, and storage medium. Background Technology
[0002] Currently, when encoding video images using motion-compensated inter-frame prediction techniques, to reduce the number of bits used to encode motion vectors, video coding utilizes the spatial correlation between adjacent image blocks. The motion vector of the current block to be encoded is predicted based on the motion vectors of adjacent encoded blocks, and then the prediction difference is encoded. This effectively reduces 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 first using the motion vectors of adjacent encoded blocks. Then, the difference between the predicted value (MVP, Motion Vector Prediction) and the actual estimated value (MVD, Motion Vector Difference) of the motion vector is encoded, thereby effectively reducing the number of bits used to encode the MV.
[0003] In existing prediction techniques, when two reference image queues exist, the motion vector prediction method for a scene may determine the availability of motion vectors based on the reference image queues corresponding to the motion vectors. For example, if an adjacent block meets one of the following conditions, its motion information is deemed 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 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. In this case, 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 in another reference image queue, it will still be deemed unavailable even if that reference frame also appears in the reference image queue corresponding to the current block. Current prediction techniques cannot accurately obtain the predicted value of the motion vector in this situation, resulting in low coding performance.
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a decoding method, encoding method, apparatus, device, and storage medium, aiming to solve the technical problem that the prior art cannot accurately obtain the predicted value of motion vectors, resulting in low encoding performance.
[0006] To achieve the above objectives, the present invention provides a decoding method, which includes the following steps:
[0007] Determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block;
[0008] The current image block is decoded based on the motion vector availability of the adjacent predicted image blocks.
[0009] Optionally, determining the availability of motion vectors for neighboring predicted image patches corresponding to the current image patch includes:
[0010] Determine the main reference image queue and the secondary reference image queue for the current image block. The main reference image queue is the reference image queue to which the motion vector to be predicted for the current image block points, and the secondary reference image queue is the remaining reference image queues other than the main reference image queue.
[0011] The motion vector of the adjacent predicted image block is determined to be unavailable when at least one of the following first preset conditions is met;
[0012] The first preset conditions include:
[0013] The adjacent predicted image block is an unavailable adjacent predicted image block;
[0014] The adjacent predicted image blocks adopt intra-frame prediction mode;
[0015] 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 does not exist in the master reference image queue.
[0016] Optionally, determining the availability of motion vectors for neighboring predicted image patches corresponding to the current image patch further includes:
[0017] Determine whether the reference image queue attribute features corresponding to the current image patch meet the preset attribute features;
[0018] If the reference image queue attribute features satisfy the preset attribute features, 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;
[0019] The second preset condition includes:
[0020] The adjacent predicted image block is an unavailable adjacent predicted image block;
[0021] The adjacent predicted image blocks adopt intra-frame prediction mode.
[0022] Optionally, it is determined whether the reference image queue attribute features corresponding to the current image patch satisfy preset attribute features, including:
[0023] Determine the main reference image queue and the secondary reference image queue for the current image block. The main reference image queue is the reference image queue to which the motion vector to be predicted for the current image block points, and the secondary reference image queue is the remaining reference image queues other than the main reference image queue.
[0024] If each reference frame in the secondary reference image queue exists in the primary reference image queue, or if each reference frame in the secondary reference image queue exists in the primary reference image queue and each reference frame in the primary reference image queue exists in the secondary reference image queue, then the reference image queue attribute features are determined to satisfy the preset attribute features.
[0025] To achieve the above objectives, the present invention also proposes a decoding method, the decoding method further comprising:
[0026] 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;
[0027] Deduplication is performed on the at least two reference image queues;
[0028] The current image block is decoded based on the deduplicated reference image queue.
[0029] Optionally, the deduplication of the at least two reference image queues includes:
[0030] A target reference image queue and a non-target reference image queue are determined, wherein the target reference image queue is either the first reference image queue or the second reference image queue, and the non-target reference image queue is the remaining reference image queues excluding the target reference image queue;
[0031] 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 duplicates of those in the target reference image queue.
[0032] Optionally, before deduplicating the at least two reference image queues, the method further includes:
[0033] Determine whether the reference image queue attribute features corresponding to the current image block meet the preset attribute features;
[0034] The process of deduplicating the at least two reference image queues includes:
[0035] If the attribute features of the reference image queue meet the preset attribute features, then the reference frames in the target reference image queue remain unchanged, and the reference frames in the non-target reference image queue are removed.
[0036] Optionally, after keeping the reference frames in the target reference image queue unchanged and removing the reference frames in the non-target reference image queue, the method further includes:
[0037] Reorder the reference frames in the target reference image queue;
[0038] or,
[0039] Reorder the reference frames in the non-target reference image queue;
[0040] or,
[0041] Reorder the reference frames in the target reference image queue and reorder the reference frames in the non-target reference image queue.
[0042] Optionally, determining whether the reference image queue attribute features corresponding to the current image patch satisfy preset attribute features includes:
[0043] If every reference frame in the non-target reference image queue exists in the target reference image queue, or if 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 the reference image queue attribute features are determined to satisfy the preset attribute features.
[0044] Optionally, decoding the current image block based on the deduplicated reference image queue includes:
[0045] Determine the main reference image queue to which the unidirectional motion information in the deduplicated reference image queue points;
[0046] Obtain 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 based on the target reference frame.
[0048] Optionally, obtaining the indication information and selecting the target reference frame from the main reference image queue according to the indication information includes:
[0049] 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;
[0050] Based on the first indication information, a main reference image queue is determined from the deduplicated reference image queue, and a target reference frame corresponding to the index value is selected from the main reference image queue based on the second indication information.
[0051] Optionally, if every reference frame in the non-target reference image queue exists in the target reference image queue, the step of obtaining the indication information and selecting a target reference frame from the target reference image queue according to the indication information includes:
[0052] The target reference image queue is determined as the main reference image queue;
[0053] Obtain third indication information; wherein, the third indication information is used to indicate the index value of the target reference frame;
[0054] The 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] Obtain the number of reference frames in each of the at least two reference image queues, and select the reference image queue with the largest number of reference frames as the target reference image queue.
[0057] To achieve the above objectives, the present invention also proposes an encoding method, which further includes:
[0058] Determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block;
[0059] The current image block is encoded based on the motion vector availability of the adjacent predicted image blocks.
[0060] To achieve the above objectives, the present invention also proposes an encoding method, which further includes:
[0061] 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;
[0062] Deduplication is performed on the at least two reference image queues;
[0063] The current image block is encoded based on the deduplicated reference image queue.
[0064] Furthermore, to achieve the above objectives, the present invention also proposes a decoding device, the decoding device comprising:
[0065] The detection module is used to determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block;
[0066] The decoding module is used to decode the current image block based on the motion vector availability of the adjacent predicted image blocks.
[0067] Furthermore, to achieve the above objectives, the present invention also proposes a decoding device, the decoding device comprising:
[0068] The acquisition module is used to acquire the reference image queue configuration of the current image block. The reference image queue configuration includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information.
[0069] A deduplication module is used to deduplicatize the at least two reference image queues;
[0070] The decoding module is used to decode the current image block based on the deduplicated reference image queue.
[0071] Furthermore, to achieve the above objectives, the present invention also proposes an encoding device, the encoding device comprising:
[0072] The detection module is used to determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block;
[0073] An encoding module is used to encode the current image block based on the motion vector availability of the adjacent predicted image blocks.
[0074] Furthermore, to achieve the above objectives, the present invention also proposes an encoding device, the encoding device comprising:
[0075] The acquisition module is used to acquire the reference image queue configuration of the current image block. The reference image queue configuration includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information.
[0076] A deduplication module is used to deduplicatize the at least two reference image queues;
[0077] The encoding module is used to encode the current image block according to the deduplicated reference image queue.
[0078] Furthermore, to achieve the above objectives, the present invention also proposes a decoding device, the decoding device comprising: a memory, a processor, and a decoding program stored in the memory and running on the processor, the decoding program being configured to implement the decoding method as described above.
[0079] Furthermore, to achieve the above objectives, the present invention also proposes an encoding device, the encoding device comprising: a memory, a processor, and an encoding program stored in the memory and running on the processor, the encoding program being configured to implement the encoding method as described above.
[0080] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a decoding and encoding program, wherein the decoding or encoding program, when executed by a processor, implements the decoding or encoding method as described above.
[0081] This invention determines the motion vector availability of adjacent predicted image blocks corresponding to the current image block; and decodes the current image block based on the motion vector availability of the adjacent predicted image blocks. By utilizing the motion vector prediction mechanism and usage strategy described above, the predicted values of motion vectors can be accurately obtained, thereby improving coding performance. Attached Figure Description
[0082] Figure 1 This is a schematic diagram of the structure of the decoding device in the hardware operating environment involved in the embodiments of the present invention;
[0083] Figure 2 This is a schematic diagram of the video encoding framework in the decoding method of the present invention;
[0084] Figure 3 This is a flowchart illustrating the first embodiment of the decoding method of the present invention;
[0085] Figure 4 This is a flowchart illustrating the second embodiment of the decoding method of the present invention;
[0086] Figure 5 This is a flowchart illustrating the third embodiment of the decoding method of the present invention;
[0087] Figure 6 This is a flowchart illustrating the first embodiment of the encoding method of the present invention;
[0088] Figure 7 This is a flowchart illustrating the second embodiment of the encoding method of the present invention;
[0089] Figure 8 This is a structural block diagram of the first embodiment of the decoding device of the present invention;
[0090] Figure 9 This is a structural block diagram of the second embodiment of the decoding device of the present invention;
[0091] Figure 10 This is a structural block diagram of the first embodiment of the encoding device of the present invention;
[0092] Figure 11This is a structural block diagram of the second embodiment of the encoding device of the present invention.
[0093] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0094] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0095] Reference Figure 1 , Figure 1 This is a schematic diagram of the decoding device structure of the hardware operating environment involved in the 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. The communication bus 1002 is used to enable communication between these components. The user interface 1003 may include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk drive. The memory 1005 may also optionally be a storage device independent of the aforementioned processor 1001.
[0097] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the decoding device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0098] like Figure 1 As shown, the memory 1005, which serves 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 in the embodiment of the present invention.
[0100] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0101] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, components, features, and elements with the same names in different embodiments of this application may have the same meaning or different meanings, the specific meaning of which must be determined by its interpretation in that specific embodiment or further in conjunction with the context of that specific embodiment.
[0102] It should be understood that although the terms first, second, third, etc., may be used herein to describe various information, such information should not be limited to these terms. These terms are used only to distinguish information of the same type from one another. For example, without departing from the scope of this document, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if," as used herein, may be interpreted as "when," "when," or "in response to determination." Furthermore, as used herein, the singular forms "a," "an," and "the" are intended to also include the plural forms unless the context indicates otherwise. It should be further understood that the terms "comprising," "including," indicate the presence of the stated feature, step, operation, element, component, item, kind, and / or group, but do not exclude the presence, occurrence, or addition of one or more other features, steps, operations, elements, components, items, kinds, and / or groups. The terms "or," "and / or," "including at least one of the following," etc., as used in this application, may be interpreted as inclusive, or mean any one or any combination thereof. For example, "including at least one of the following: A, B, C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C." Similarly, "A, B, or C" or "A, B, and / or C" means "any one of the following: A; B; C; A and B; A and C; B and C; A and B and C." Exceptions to this definition only occur when the combination of elements, functions, steps, or operations is inherently mutually exclusive in some way.
[0103] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.
[0104] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”
[0105] It should be noted that step designations such as S10 and S20 are used in this document for the purpose of more clearly and concisely describing the corresponding content, and do not constitute a substantial limitation on the order. In specific implementation, those skilled in the art may execute S20 first and then S10, etc., but these should all be within the protection scope of this application.
[0106] It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit this application.
[0107] This application proposes a decoding method, which may involve the following concepts:
[0108] Prediction Signal: A prediction signal is a pixel value derived from already decoded pixels. It is obtained by subtracting the original pixel from the predicted pixel to obtain a residual, which is then used for residual transform quantization and coefficient encoding. Specifically, inter-frame prediction signals refer to the pixel values of the current block derived from the reference frame (reconstructed pixel frame). Due to the discrete pixel positions, interpolation is required to obtain the final prediction signal. The closer the prediction signal 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) represents the relative displacement between the current coded block and its best-matching block in the reference image. Each partitioned block has a corresponding motion vector that needs to be transmitted to the decoder. Encoding and transmitting the MV of each block independently, especially when dividing it into small blocks, would consume a considerable number of bits. To reduce the number of bits used to encode motion vectors, video coding utilizes the spatial correlation between adjacent image blocks. The motion vector of the current block to be encoded is predicted based on the motion vectors of adjacent encoded blocks, and then the prediction difference is encoded. This effectively reduces the number of bits required to represent 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 first using the motion vectors of adjacent encoded blocks, and then the difference between the predicted value (MVP, Motion Vector Prediction) and the actual estimated value (MVD, Motion Vector Difference) is encoded, thereby effectively reducing the number of bits required to encode the MV.
[0110] Motion Information: Since motion vectors represent the positional offset of the current block relative to a block in a reference image, in order to accurately obtain information pointing to the image block, in addition to motion vector information, reference image index information is also needed to indicate which reference image was used. In video coding techniques, for the current image, a list of reference images is usually established based on certain principles. The reference image index information indicates which reference image in the list the current block uses. Furthermore, many coding techniques support multiple reference image lists, so an index value is also needed to indicate which reference image list was used; this index value is generally called the reference direction. In video coding, we collectively refer to motion-related coding information such as motion vectors, reference frame indexes, and reference directions as motion information.
[0111] Rate-Distortion Optimized (RDO) principle: Two main metrics for evaluating coding efficiency are bitrate and PSNR. A smaller bitrate results in a higher compression ratio; a higher PSNR leads to better reconstructed image quality. The decision formula for mode selection is essentially a comprehensive evaluation of these two metrics. The cost of a mode is: J(mode) = D + λ*R. Here, D represents Distortion, typically measured using the SSE metric, which is the sum of the mean squares of the differences between the reconstructed block and the source image; λ is the Lagrange multiplier; and R is the actual number of bits required to encode the image block in that mode, including the total number of bits needed for encoding mode information, motion information, residuals, etc. Using the RDO principle to compare and decide on coding modes during mode selection usually ensures optimal coding performance.
[0112] Intra-prediction and inter-prediction: Intra-prediction refers to predictive coding using the reconstructed pixel values of the spatially adjacent blocks (in the same frame as the current block), while inter-prediction refers to predictive coding using the reconstructed pixel values of the temporally adjacent blocks (in different frames from the current block).
[0113] Video coding framework: see Figure 2 As shown, the encoding process of this application embodiment can be implemented using a video encoding framework. Furthermore, the schematic diagram of the video decoding framework is similar to... Figure 1Similarly, this will not be repeated here. Furthermore, the decoding process of this application embodiment can be implemented using a video decoding framework. A complete video encoding method generally includes modules such as prediction, transform, quantization, entropy coding, and filtering. In the inter-frame prediction module, due to the strong temporal correlation of video (i.e., two adjacent frames have many similar image blocks), the image block of the current frame often performs motion search in adjacent reference images to find the block that best matches the current block as a reference block. Since the reference block and the current block have high similarity, their difference is very small, so the bitrate overhead of encoding the difference is usually much smaller than the bitrate overhead of directly encoding the pixel value of the current block. To represent 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, predicted pixels are often obtained from the reference frame through motion information. In particular, when the bidirectional inter-frame prediction mode is enabled, the predicted pixels obtained from the two motion information are weighted to derive the final predicted pixels. The weighting ratio is generally 1:1, 5:3, 3:5, etc.
[0114] This invention provides a decoding method, referring to... Figure 3 , Figure 3 This is a flowchart illustrating a first embodiment of a decoding method according to the present invention.
[0115] In this embodiment, the decoding method includes the following steps:
[0116] Step S10: Determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block.
[0117] The execution subject of this embodiment can be a decoding device, which can be implemented in various forms. For example, the decoding device described in this application may include mobile terminals or smart terminals such as tablet computers, laptop computers, PDAs, cameras, etc., as well as fixed terminal devices such as desktop computers. These devices all have image processing functions, and the following description will use a decoding device as an example.
[0118] It should be noted that when using motion-compensated inter-frame prediction techniques to encode video images, in order to reduce the number of bits used to encode motion vectors, video coding utilizes the spatial correlation between adjacent image blocks. The motion vector of the current macroblock is predicted based on the motion vectors of adjacent encoded blocks, and then the prediction difference is encoded. This effectively reduces the number of bits representing the motion vector. Therefore, in the process of encoding the motion vector of the current image block, the motion vector of the current macroblock is generally predicted first using the motion vectors of adjacent encoded blocks. Then, the difference between the predicted value (MVP, Motion Vector Prediction) and the actual estimated value (MVD) of the motion vector is encoded, thereby effectively reducing the number of bits used to encode the MV.
[0119] In existing prediction techniques, when two reference image queues exist, the motion vector prediction method for a scene may determine the availability of motion vectors based on the reference image queues corresponding to the motion vectors. For example, if an adjacent block meets one of the following conditions, its motion information is deemed 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 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. In this case, 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 in another reference image queue, for example, if the reference image queues corresponding to the current block include List0[0,8,16] and List1[8,16,24], and if the reference image queue corresponding to the current block is List0, and the motion vector of the adjacent block points to the first reference frame 8 of List1, even if reference frame 8 also appears in List0, it will still be determined as unavailable. In this situation, current prediction techniques cannot accurately obtain the predicted value of the motion vector, resulting in low coding performance.
[0120] To address the aforementioned technical issues, this embodiment determines the motion vector availability of adjacent predicted image blocks corresponding to the current image block; and decodes the current image block based on the motion vector availability of the adjacent predicted image blocks. By utilizing the motion vector prediction mechanism and usage strategy described above, the predicted values of motion vectors can be accurately obtained, thereby improving coding performance. Specifically, this can be implemented as follows.
[0121] In this embodiment, for motion vector prediction of B-frames (or B-images), the overall process of this solution includes obtaining the availability of motion information for adjacent blocks based on the reference image queue configuration. Specifically, the method for obtaining the availability of motion information for adjacent blocks based on the reference image queue configuration is as follows: the reference image queue corresponding to the current block requiring motion vector prediction is designated as the main reference image queue, and the remaining reference image queues are designated as secondary reference image queues. If the adjacent block is an inter-frame prediction block and the motion information of the adjacent block points to the secondary reference image queue and the reference frame it points to does not appear in the main reference image queue, then the motion vector of the adjacent block is available, provided 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 this specific implementation, it is necessary to first determine the main reference image queue and the secondary reference image queue of the current image block. When determining the main reference image queue and the secondary reference image queue, it can be determined based on the direction of the motion vector to be predicted for the current block. The reference image queue to which the motion vector to be predicted for the current image block points is the main reference image queue, and the remaining reference image queues are the secondary 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 for the current image block points to List0, then in this embodiment, List0 can be used as the main reference image queue, and the remaining List1 is the secondary reference image queue. Further, taking the encoding end as an example, the motion vector prediction process refers to the encoding end attempting to predict the motion vector pointing to a certain reference image queue. Taking the decoding end as an example, the motion vector prediction process refers to the decoding end first determining from the bitstream that it points to a certain reference image queue, and then performing the corresponding motion vector prediction process.
[0123] After determining the primary reference image queue and the secondary reference image queue, this embodiment can further combine preset conditions to determine the availability of motion vectors of adjacent predicted image blocks corresponding to the current image block. The specific process of determining the availability of motion vectors 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 vectors of adjacent predicted image blocks are unavailable. The first preset condition in this embodiment includes that the adjacent predicted image block is an unusable adjacent predicted image block, the adjacent predicted image block adopts 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 does not exist in the main reference image queue. The adjacent predicted image block is an unusable adjacent predicted image block, which means that the adjacent predicted image block has not been decoded or does not belong to the same parallel unit (Slice, Tile, Patch) as the current block. 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 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 is reference frame 24, but reference frame 24 does not exist in List0.
[0124] The aforementioned availability determination is based on the case where the primary reference image queue and the secondary reference image queue are different. For the special case of primary and secondary reference image queues, this embodiment determines the motion vector availability of adjacent predicted image blocks according to a second preset condition. Specifically, it checks 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 predicted image block is unavailable. In this embodiment, the second preset conditions include the adjacent predicted image block being an unavailable adjacent predicted image block and the adjacent predicted image block using intra-frame prediction mode.
[0125] In an optional embodiment, for the special case of the main reference image queue and the slave reference image queue, this embodiment can make a judgment based on preset attribute features. Specifically, it is first determined whether the attribute features of the reference image queue corresponding to the current image block meet the preset attribute features. If the attribute features of the reference image queue meet the preset attribute features, then the main reference image queue and the slave reference image queue belong to the above-mentioned special case, and the availability of motion vectors of adjacent predicted image blocks can be determined based on the above-mentioned second preset condition.
[0126] In one optional embodiment, determining whether the reference image queue attribute characteristics of the current image block satisfy the preset attribute characteristics can include two cases. The first case is that each reference frame in the secondary reference image queue exists in the primary reference image queue. When this occurs, the secondary reference image queue can be determined to be a subset of the primary reference image queue. For example, List0 is [A,B,C], List1 is [A,B], List0 is the primary reference image queue, and List1 is the secondary reference image queue. The second case is that each reference frame in the secondary reference image queue exists in the primary reference image queue, and simultaneously, each reference frame in the primary reference image queue exists in the secondary reference image queue. When this occurs, the secondary reference image queue and the primary reference image queue are completely identical. For example, List0 is [A,B,C], List1 is [C,B,A], List0 is the primary reference image queue, and List1 is the secondary reference image queue. If either of these two cases is satisfied, then the reference image queue attribute characteristics of the current image block are determined to satisfy the preset attribute characteristics.
[0127] In an optional example, this embodiment can also determine availability based on the current image type and the value of PicSameListFlag. For example, if the current image type is B image and the value of PicSameListFlag is equal to 0, and the prediction unit where the adjacent brightness prediction block X is located does not have a motion vector in the same reference image queue as the current motion vector to be predicted, then the adjacent prediction image block is determined to be unavailable. If each reference frame in the secondary reference image queue exists in the primary reference image queue, and each reference frame in the primary reference image queue exists in the secondary reference image queue, that is, the secondary reference image queue is the same as the primary reference image queue, then the value of PicSameListFlag is equal to 1. Conversely, if the secondary reference image queue is not the same as the primary reference image queue, then the value of PicSameListFlag is equal to 0.
[0128] Step S20: Decode the current image block based on the motion vector availability of the adjacent predicted image blocks.
[0129] In a specific implementation, after determining the motion vector availability of adjacent predicted image blocks, this embodiment can further obtain the motion vector prediction value of the current image block pointing to the main reference image queue based on the motion vector availability 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 master reference image queue based on the motion vector availability of neighboring predicted image blocks is as follows: assuming A, B, and C are neighboring predicted image blocks of the current image block, the logic for 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, and MVA->x, MVB->x, and MVC->x represent the scaled horizontal component values of the motion vectors of adjacent predicted image blocks A, B, and C, respectively. The above logic means that the x-motion component of the motion vector prediction value is the average of the horizontal component values of two motion vectors in the same direction among adjacent predicted image blocks A, B, and C, or the average of the horizontal component values of the two motion vectors with the smallest absolute difference among adjacent predicted image blocks A, B, and C. The above logic pertains to the solution process for the x-motion component of the motion vector prediction value. The solution process for the y-direction motion component of the motion vector prediction value is similar to that for the x-motion component, and will not be elaborated upon in this embodiment.
[0134] After determining the availability of motion vectors for adjacent predicted image blocks, the motion vector prediction value pointing to the master reference image queue, excluding the final current image block, can be calculated through the above process. It should be emphasized that the above process is merely illustrative and not intended to limit this embodiment; in practical applications, other methods can be used to calculate the motion vector prediction value. After obtaining the motion vector prediction value, decoding or encoding of the current image block can be performed based on it.
[0135] This embodiment determines the motion vector availability of adjacent predicted image blocks corresponding to the current image block; and decodes the current image block based on the motion vector availability of the adjacent predicted image blocks. By utilizing the motion vector prediction mechanism and usage strategy described above, the predicted value of the motion vector can be accurately obtained, thus improving the encoding.
[0136] refer to Figure 4 , Figure 4 This is a flowchart illustrating a second embodiment of a decoding method according to the present invention.
[0137] This embodiment provides a decoding method, the decoding method comprising:
[0138] Step S30: Obtain the reference image queue configuration of the current image block. The reference image queue configuration includes at least two reference image queues, including a first reference image queue and a second reference image queue. 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 ways to express a unidirectional reference frame combination. For example, if the reference image queue of the current image block is 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 vector pointing to the reference frame 8 is the same, the above two expressions are redundant.
[0140] To address the aforementioned technical issues, this example removes redundancy by deduplicating reference frames. This process involves pre-setting a primary reference image queue (unlike motion vector prediction, this is done at the decoding end). When the primary reference image queue is List0, the secondary reference image queue can be List1. The primary and secondary reference image queues are different. When a reference frame exists in both the primary and secondary reference image queues, the frame in the primary reference image queue is retained, and the frame in the secondary reference image queue is discarded. Specifically, if all reference frames in the secondary reference image queue exist in the primary reference image queue, there is no need to additionally identify the List pointed to by the unidirectional motion information, as the unidirectional motion information can only point to the primary reference image queue. It is important to emphasize that the deduplication operation in this embodiment targets unidirectional motion information and does not affect bidirectional reference image queues.
[0141] In the specific implementation, this embodiment first needs 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 the first reference image queue and the 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: Deduplicate the at least two reference image queues.
[0143] It should be noted that when deduplicating at least two reference image queues, the target reference image queue and the non-target reference image queue need to be obtained first. Unlike motion vector prediction, in motion vector prediction, the main reference image queue is the reference image queue pointed to by the current image block, while in the redundancy removal process, the target reference image queue 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 in each reference image queue. Specifically, the number of reference frames in each of at least two reference image queues is obtained, and then the reference image queue with the largest number of reference frames in each reference image queue is determined. Finally, the reference image queue with the largest number of reference frames is taken 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 either the first reference image queue or the second reference image queue. The non-target reference image queue is the remaining reference image queues other than the target reference image queue. For example, if the target reference image queue is the first reference image queue, then 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 can 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 duplicates of the target reference image queue. For example, assuming the target reference image queue is List0[0,2,4] and the non-target reference image queue is List1[2,4,6], during deduplication, the reference frames in the target reference image queue are kept unchanged, that is, the reference frames in List0 are kept unchanged. Then, the reference frames in the non-target reference image queue that are duplicates of the target reference image queue are determined, that is, the reference frames in List1 that are duplicates of List0. By comparison, it can be found that the reference frames in List1 that are duplicates of List0 are reference frames 2 and 4. Finally, reference frames 2 and 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 marked whether it points to the deduplicated reference frames 2 and 4.
[0147] In one optional embodiment, the deduplication operation described above is for the case where the target reference image queue and the non-target reference image queue are different. For the special case where the target reference image queue and the non-target reference image queue are different, this embodiment performs the deduplication operation in a different manner. Specifically, the special case 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 identical to the target reference image queue.
[0148] In an optional embodiment, for the special case of target reference image queue and non-target reference image queue, this embodiment can make a judgment based on preset attribute features. Specifically, it is first determined whether the attribute features of the reference image queue corresponding to the current image block meet the preset attribute features. If the attribute features of the reference image queue meet the preset attribute features, then the target reference image queue and non-target reference image queue can be determined to be the special case mentioned above.
[0149] In one optional embodiment, determining whether the reference image queue attribute characteristics of the current image block satisfy the preset attribute characteristics can include two cases. The first case is that every reference frame in the non-target reference image queue exists in the target reference image queue. When this occurs, the non-target reference image queue can be determined to be 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 case is that every reference frame in the non-target reference image queue exists in the target reference image queue, and simultaneously, every reference frame in the target reference image queue exists in the non-target reference image queue. When this occurs, the non-target reference image queue is determined to be completely identical to 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 either of these two cases is satisfied, then the reference image queue attribute characteristics of the current image block are determined to satisfy 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 remain unchanged, and the reference frames in the non-target reference image queue are removed. For example, assuming 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[]. As another example, assuming 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. For example, the reference frames in the target reference image queue can be reordered, or the reference frames in the non-target reference image queue can be reordered, or both the reference frames in the target reference image queue and the reference frames in the non-target reference image queue can be reordered. In this embodiment, the reordering of reference frames in the target reference image queue is used as an example. Specifically, reference frames that exist in both the target reference image queue and the non-target reference image queue can be moved forward. For example, if 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[] can be compared. 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, if 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] can be compared to determine that the reference frames 6 and 8 exist simultaneously in List0 and List1. After reordering List0, we get List0[8,6,2,4]. List1 can also be reordered, for example, List0[12,10].
[0152] In one optional embodiment, Table 3 shows the prediction reference mode InterPredRefMode, which represents the prediction reference mode used by the current prediction unit. The corresponding syntax is shown in Table 1 below.
[0153] Table 1:
[0154] if (the current image is image B) { 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 if the current image is a P-image, the value of `InterPredRefModeIndex` is 0. The debinarization process of this syntax is as follows:
[0156] If the current image type is B and the value of PicSubListFlag is equal to 1, then the value of inter_pred_ref_mode_index is obtained by looking up 0 in the binary symbol string; otherwise, the value of inter_pred_ref_mode_index is obtained by looking up 0 in the binary symbol string.
[0157] Specifically, 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, then 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, then 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, then 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, then the value of PicSubListFlag is equal to 0.
[0158] Furthermore, there are two correspondences between the value of inter_pred_ref_mode_index and the binary symbol string. The first correspondence is shown in Table 2, and the second correspondence 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: Decode the current image block according to the deduplicated reference image queue.
[0164] In the specific implementation, after the deduplication operation is completed, this embodiment can select a target reference frame from the deduplicated reference image queue, and encode and decode the current image block according to the target reference frame.
[0165] This embodiment obtains the reference image queue configuration of the current image block, which includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information. The at least two reference image queues are deduplicated. The current image block is decoded based on the deduplicated reference image queues. By removing redundancy through the above-mentioned deduplication operation on reference frames, the encoding performance can be improved.
[0166] refer to Figure 5 , Figure 5 This is a flowchart illustrating a third embodiment of a decoding method according to the present invention.
[0167] Based on the second embodiment described above, in the decoding method of this embodiment, step S50 specifically includes:
[0168] Step S501: Determine the main reference image queue to which the unidirectional motion information in the deduplicated reference image queue points.
[0169] In the specific implementation, during decoding, the current image block points to the main reference image queue. In this embodiment, the current image block is unidirectional motion information. Therefore, the unidirectional motion information in the deduplicated reference image queue points to the main reference image queue.
[0170] Step S502: Obtain 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 based on the obtained indication information.
[0172] In one optional embodiment, the obtained indication information includes first indication information and second indication information. The first indication information indicates the main reference image queue, and the second indication information indicates the index value of the target reference frame. Based on the first indication information, the main reference image queue can be determined from the deduplicated reference image queue. After determining the main reference image queue, the target reference frame corresponding to the index value can be selected from the main reference image queue based on 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 deduplication, only the target reference image queue remains. In this case, 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. 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 current image block can be decoded based on the target reference frame. This can be achieved using general decoding techniques, which will not be elaborated here.
[0176] This embodiment improves decoding performance by determining the main reference image queue pointed to by the unidirectional motion information in the deduplicated reference image queue, obtaining indication information, selecting a target reference frame from the main reference image queue according to the indication information, and decoding the current image block according to the target reference frame. By decoding the current image block based on the target reference frames obtained after the deduplication operation and different indication information, the decoding performance is improved.
[0177] refer to Figure 6 , Figure 6 This is a flowchart illustrating 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 for adjacent predicted image blocks corresponding to the current image block.
[0180] Step S200: Encode the current image block according to the motion vector availability 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 that at the decoding end. The motion vector prediction process at the decoding end in the first embodiment of the above decoding method can be referred to, and will not be repeated in this embodiment.
[0182] In this embodiment, the motion vector availability of adjacent predicted image blocks corresponding to the current image block is determined; the current image block is encoded according to the motion vector availability of the adjacent predicted image blocks. By utilizing the motion vector prediction mechanism and usage strategy described above, the predicted value of the motion vector can be accurately obtained, thereby improving the encoding performance.
[0183] refer to Figure 7 , Figure 7 This is a flowchart illustrating a first embodiment of an encoding method according to the present invention.
[0184] like Figure 7 As shown, in one encoding method of this embodiment, the encoding method includes:
[0185] Step S300: Obtain the reference image queue configuration of the current image block. The reference image queue configuration includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information.
[0186] Step S400: Deduplicate the at least two reference image queues.
[0187] Step S500: Encode the current image block according to the deduplicated reference image queue.
[0188] It should be noted that the motion vector prediction process at the encoding end in this embodiment is similar to that at the decoding end. The motion vector prediction process at the decoding end in the second and third embodiments of 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, which includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information. The at least two reference image queues are deduplicated. The current image block is encoded according to the deduplicated reference image queues. By removing redundancy through the above-mentioned deduplication operation on reference frames, the encoding performance can be improved.
[0190] Reference Figure 8 , Figure 8 This is a structural block diagram of the first embodiment of the decoding device of the present invention.
[0191] like Figure 8 As shown, the decoding device proposed in this embodiment of the invention includes:
[0192] The detection module 10 is used to determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block.
[0193] The decoding module 20 is used to decode the current image block based on the motion vector availability of the adjacent predicted image blocks.
[0194] This embodiment determines the motion vector availability of adjacent predicted image blocks corresponding to the current image block; and decodes the current image block based on the motion vector availability of the adjacent predicted image blocks. By utilizing the motion vector prediction mechanism and usage strategy described above, the predicted values of motion vectors can be accurately obtained, thereby improving coding performance.
[0195] In an optional embodiment, the detection module 20 is further configured to determine a primary reference image queue and a secondary reference image queue for the current image block, wherein the primary reference image queue is the reference image queue to which the motion vector to be predicted of the current image block points, and the secondary reference image queue is the remaining reference image queues excluding the primary reference image queue; the motion vector of the adjacent predicted image block is determined to be unavailable when at least one of the following first preset conditions is met; the first preset conditions include: 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 secondary reference image queue, and the reference frame in the secondary reference image queue does not exist in the primary reference image queue.
[0196] In an optional embodiment, the detection module 20 is further configured to determine whether the reference image queue attribute features corresponding to the current image block satisfy the preset attribute features; if the reference image queue attribute features satisfy the preset attribute features, then when at least one of the following second preset conditions is satisfied, 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 configured to determine a main reference image queue and a secondary reference image queue for the current image block, wherein the main reference image queue is the reference image queue to which the motion vector to be predicted of the current image block points, and the secondary reference image queue is the remaining reference image queues excluding the main reference image queue; if each reference frame in the secondary reference image queue exists in the main reference image queue, or if each reference frame in the secondary reference image queue exists in the main reference image queue and each reference frame in the main reference image queue exists in the secondary reference image queue, then it is determined that the attribute features of the reference image queue satisfy the preset attribute features.
[0198] Reference Figure 9 , Figure 9This is a structural block diagram of the second embodiment of the decoding device of the present invention.
[0199] like Figure 9 As shown, the decoding device proposed in this embodiment of the invention includes:
[0200] The acquisition module 30 is used to acquire the reference image queue configuration of the current image block. The reference image queue configuration includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information.
[0201] Processing module 40 is used 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 deduplicated reference image queue.
[0203] This embodiment obtains the reference image queue configuration of the current image block, which includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information. The at least two reference image queues are deduplicated. The current image block is decoded based on the deduplicated reference image queues. By removing redundancy through the above-mentioned deduplication operation on reference frames, the encoding performance can be improved.
[0204] In one embodiment, the processing module 40 is further configured to determine a target reference image queue and a non-target reference image queue, wherein the target reference image queue is either the first reference image queue or the second reference image queue, and the non-target reference image queue is the remaining reference image queues excluding the target reference image queue; keeping the reference frames in the target reference image queue unchanged, and removing reference frames in the non-target reference image queue that are duplicates of those in the target reference image queue.
[0205] In one embodiment, the processing module 40 is further configured to determine whether the reference image queue attribute features corresponding to the current image block meet the preset attribute features; the deduplication of the at least two reference image queues includes: if the reference image queue attribute features meet the preset attribute features, then keeping the reference frames in the target reference image queue unchanged, and removing the reference frames in the non-target reference image queue.
[0206] In one embodiment, the processing module 40 is further configured to reorder reference frames in the target reference image queue; or, reorder reference frames in the non-target reference image queue; or, reorder reference frames in the target reference image queue and reorder reference frames in the non-target reference image queue.
[0207] In one embodiment, the processing module 40 is further configured to determine that the reference image queue attribute features satisfy the preset attribute features if each reference frame in the non-target reference image queue exists in the target reference image queue, or if 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 configured to determine the main reference image queue to which the unidirectional motion information points 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 further configured to acquire 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 further configured 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 in each of the at least two reference image queues, and select the reference image queue with the largest number of reference frames as the target reference image queue.
[0212] Reference Figure 10 , Figure 10 This is a structural block diagram of the first embodiment of the encoding device of the present invention.
[0213] like Figure 10 As shown, the encoding device proposed in this embodiment of the invention includes:
[0214] The detection module 100 is used to determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block.
[0215] The encoding module 200 is used to encode the current image block based on the motion vector availability of the adjacent predicted image blocks.
[0216] In this embodiment, the motion vector availability of adjacent predicted image blocks corresponding to the current image block is determined; the current image block is encoded according to the motion vector availability of the adjacent predicted image blocks. By utilizing the motion vector prediction mechanism and usage strategy described above, the predicted value of the motion vector can be accurately obtained, thereby improving the encoding performance.
[0217] Reference Figure 11 , Figure 11 This is a structural block diagram of the second embodiment of the encoding device of the present invention.
[0218] like Figure 11 As shown, the encoding device proposed in this embodiment of the invention includes:
[0219] The acquisition module 300 is used to acquire the reference image queue configuration of the current image block. The reference image queue configuration includes at least two reference image queues, including a first reference image queue and a second reference image queue. 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 deduplicated reference image queue.
[0222] This embodiment obtains the reference image queue configuration of the current image block, which includes at least two reference image queues, including a first reference image queue and a second reference image queue. The motion information of the current image block is unidirectional motion information. The at least two reference image queues are deduplicated. The current image block is encoded according to the deduplicated reference image queues. By removing redundancy through the above-mentioned deduplication operation on reference frames, the encoding performance can be improved.
[0223] Furthermore, embodiments of the present invention also propose a storage medium storing a decoding and encoding program, wherein when the decoding or encoding program is executed by a processor, it implements the steps of the decoding or encoding method described above.
[0224] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought about by the technical solutions of the above embodiments, which will not be repeated here.
[0225] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solutions of the present invention. In specific applications, those skilled in the art can make settings as needed, and the present invention does not impose any restrictions on this.
[0226] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of this invention. In practical applications, those skilled in the art can select some or all of the workflow to achieve the purpose of this embodiment according to actual needs, and no restrictions are imposed here.
[0227] In addition, for technical details not described in detail in this embodiment, please refer to the decoding method provided in any embodiment of the present invention, which will not be repeated here.
[0228] Furthermore, it should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0229] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0230] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this 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. This computer software product is stored in a storage medium (such as read-only memory (ROM) / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0231] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
[0232] It should be understood that although the steps in the flowcharts of this application's embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn 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 includes: Determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block; The current image block is decoded based on the motion vector availability of the adjacent predicted image blocks; The step of determining the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block includes: Determine the main reference image queue and the secondary reference image queue for the current image block. The main reference image queue is the reference image queue to which the motion vector to be predicted for the current image block points, and the secondary reference image queue is the remaining reference image queues other than the main reference image queue. If 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 does not exist in the master reference image queue, it is determined that the motion vector of the adjacent predicted image block is unavailable. If each reference frame in the reference image queue exists in the main reference image queue, then the motion vector of the adjacent predicted image block corresponding to the current image block is determined to be unavailable when at least one of the following second preset conditions is met; the second preset conditions include: the adjacent predicted image block is an unavailable adjacent predicted image block; the adjacent predicted image block adopts an intra-frame prediction mode.
2. The decoding method as described in claim 1, characterized in that, The step of determining the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block further includes: If each reference frame in the secondary reference image queue exists in the primary reference image queue and each reference frame in the primary reference image queue exists in the secondary reference image queue, then if at least one of the second preset conditions is met, the motion vector of the adjacent predicted image block corresponding to the current image block is determined to be unavailable.
3. An encoding method, characterized in that, The encoding method includes: Determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block; The current image block is encoded based on the motion vector availability of the adjacent predicted image blocks; The step of determining the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block includes: Determine the main reference image queue and the secondary reference image queue for the current image block. The main reference image queue is the reference image queue to which the motion vector to be predicted for the current image block points, and the secondary reference image queue is the remaining reference image queues other than the main reference image queue. If 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 does not exist in the master reference image queue, it is determined that the motion vector of the adjacent predicted image block is unavailable. If each reference frame in the reference image queue exists in the main reference image queue, then the motion vector of the adjacent predicted image block corresponding to the current image block is determined to be unavailable when at least one of the following second preset conditions is met; the second preset conditions include: the adjacent predicted image block is an unavailable adjacent predicted image block; the adjacent predicted image block adopts an intra-frame prediction mode.
4. The encoding method as described in claim 3, characterized in that, The step of determining the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block further includes: If each reference frame in the secondary reference image queue exists in the primary reference image queue and each reference frame in the primary reference image queue exists in the secondary reference image queue, then if at least one of the second preset conditions is met, the motion vector of the adjacent predicted image block corresponding to the current image block is determined to be unavailable.
5. A decoding device, characterized in that, The decoding device includes: The detection module is used to determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block; The decoding module is used to decode the current image block based on the motion vector availability of the adjacent predicted image blocks; The detection module is used to determine the main reference image queue and the secondary reference image queue of the current image block. The main reference image queue is the reference image queue to which the motion vector to be predicted of the current image block points, and the secondary reference image queue is the remaining reference image queues other than the main reference image queue. If 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 does not exist in the master reference image queue, it is determined that the motion vector of the adjacent predicted image block is unavailable. If each reference frame in the reference image queue exists in the main reference image queue, then the motion vector of the adjacent predicted image block corresponding to the current image block is determined to be unavailable when at least one of the following second preset conditions is met; the second preset conditions include: the adjacent predicted image block is an unavailable adjacent predicted image block; the adjacent predicted image block adopts an intra-frame prediction mode.
6. An encoding device, characterized in that, The encoding device includes: The detection module is used to determine the availability of motion vectors for adjacent predicted image blocks corresponding to the current image block; The encoding module is used to encode the current image block based on the motion vector availability of the adjacent predicted image blocks; The detection module is used to determine the main reference image queue and the secondary reference image queue of the current image block. The main reference image queue is the reference image queue to which the motion vector to be predicted of the current image block points, and the secondary reference image queue is the remaining reference image queues other than the main reference image queue. If 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 does not exist in the master reference image queue, it is determined that the motion vector of the adjacent predicted image block is unavailable. If each reference frame in the reference image queue exists in the main reference image queue, then the motion vector of the adjacent predicted image block corresponding to the current image block is determined to be unavailable when at least one of the following second preset conditions is met; the second preset conditions include: the adjacent predicted image block is an unavailable adjacent predicted image block; the adjacent predicted image block adopts an intra-frame prediction mode.
7. A decoding device, characterized in that, The decoding device includes: a memory, a processor, and a decoding program stored in the memory and running on the processor, the decoding program being configured to implement the decoding method as described in any one of claims 1-2.
8. An encoding device, characterized in that, The encoding device includes: a memory, a processor, and an encoding program stored in the memory and running on the processor, the encoding program being configured to implement the encoding method as described in any one of claims 3-4.
9. A storage medium, characterized in that, The storage medium stores decoding and encoding programs, which, when executed by a processor, implement the decoding method as described in any one of claims 1-2 or the encoding method as described in any one of claims 3-4.