Image encoding method and image decoding method
After determining the quantization parameters and state of the coding unit through parallel coding, the serial coding method is used to reset and perform filtering, which solves the problem of compression performance loss in wavefront parallel processing and achieves efficient image coding.
Patent Information
- Application Number
- CN202311285394.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2026-01-27
- Estimated Expiration
- 2043-09-28
AI Technical Summary
While existing wavefront parallel processing technology improves coding speed, it sacrifices compression performance. There is an urgent need for an image coding scheme with less loss of compression performance.
After determining the quantization parameters and encoding state of multiple encoding units using parallel encoding, the encoding state and quantization parameters are reset by serial encoding and filtered to ensure that the quantization prediction accuracy reaches the preset accuracy.
While maintaining encoding speed, it reduces the compression performance loss caused by parallel encoding and avoids encoding/decoding mismatch issues.
Smart Images

Figure CN119729002B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to an image encoding method. Background Technology
[0002] With the development of computer technology, video image production has become increasingly easier, and the proliferation of online video platforms has provided essential channels for video publishing and dissemination, leading to an exponential increase in the number of videos on the internet year after year. However, the transmission of massive amounts of video over the network poses significant challenges to network bandwidth and data storage. Therefore, how to effectively compress video while ensuring video quality has gradually become a key research focus.
[0003] Wavefront Parallel Processing (WPP) is a parallel encoding and decoding technique in the High Efficiency Video Coding (HEVC) standard, which can achieve a certain degree of parallel encoding and decoding. However, while improving encoding speed, wavefront parallel processing sacrifices some compression performance. Therefore, there is an urgent need for an image coding scheme with minimal loss of compression performance. Summary of the Invention
[0004] In view of the above, embodiments of this specification provide an image encoding method. One or more embodiments of this specification also relate to an image decoding method, an image encoding apparatus, an image decoding apparatus, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, an image encoding method is provided, comprising:
[0006] Obtain the image to be encoded;
[0007] Multiple coding units in the image to be encoded are encoded in parallel, and the quantization parameters and coding states of multiple coding units are determined.
[0008] According to the serial encoding method, the encoding state of multiple encoding units and the quantization parameters of the target encoding unit are reset, and the target encoding unit is filtered using the reset quantization parameters to obtain the processing result. The quantization prediction accuracy of the target encoding unit reaches the preset accuracy.
[0009] The image encoding result is determined based on the reset encoding state and processing result.
[0010] According to a second aspect of the embodiments of this specification, an image decoding method is provided, comprising:
[0011] Obtain the image encoding result, wherein the image encoding result is obtained by the image encoding method provided in the first aspect above;
[0012] Analyze the image encoding results to determine the encoding state and quantization parameters;
[0013] The image decoding result is determined based on the encoding state and quantization parameters.
[0014] According to a third aspect of the embodiments of this specification, an image encoding apparatus is provided, comprising:
[0015] The first acquisition module is configured to acquire the image to be encoded.
[0016] The encoding module is configured to encode multiple coding units in the image to be encoded in parallel, and to determine the quantization parameters and encoding state of the multiple coding units;
[0017] The reset module is configured to reset the encoding state of multiple encoding units and the quantization parameters of the target encoding unit according to the serial encoding method, and to use the reset quantization parameters to filter the target encoding unit to obtain the processing result, wherein the quantization prediction accuracy of the target encoding unit reaches the preset accuracy.
[0018] The first determining module is configured to determine the image encoding result based on the reset encoding state and the processing result.
[0019] According to a fourth aspect of the embodiments of this specification, an image decoding apparatus is provided, comprising:
[0020] The second acquisition module is configured to acquire the image encoding result, wherein the image encoding result is obtained by the image encoding method provided in the first aspect above;
[0021] The parsing module is configured to parse the image encoding results and determine the encoding state and quantization parameters;
[0022] The second determining module is configured to determine the image decoding result based on the encoding state and quantization parameters.
[0023] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising:
[0024] Memory and processor;
[0025] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method provided in the first or second aspect above.
[0026] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the methods provided in the first or second aspect described above.
[0027] According to a seventh aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the method provided in the first or second aspect described above.
[0028] This specification provides an image encoding method according to one embodiment, which involves acquiring an image to be encoded; performing parallel encoding on multiple encoding units in the image to be encoded, determining the quantization parameters and encoding states of the multiple encoding units; resetting the encoding states of the multiple encoding units and the quantization parameters of the target encoding unit according to a serial encoding method, and using the reset quantization parameters to filter the target encoding unit to obtain a processing result, wherein the quantization prediction accuracy of the target encoding unit reaches a preset accuracy; and determining the image encoding result based on the reset encoding state and the processing result. The parallel encoding method ensures encoding speed, and the serial encoding method adjusts the quantization parameters and encoding states, taking into account the correlation between encoding units and reducing the compression performance loss caused by the parallel encoding method. Furthermore, the serial encoding method avoids the encoding-decoding mismatch problem caused by the parallel decoding method. Attached Figure Description
[0029] Figure 1 This is an architecture diagram of an image coding system provided in one embodiment of this specification;
[0030] Figure 2 This is an architecture diagram of another image coding system provided in one embodiment of this specification;
[0031] Figure 3 This is a flowchart illustrating an image encoding method provided in one embodiment of this specification;
[0032] Figure 4 This is a schematic diagram of an encoding unit in an image encoding method provided in one embodiment of this specification;
[0033] Figure 5 This is a flowchart of an image decoding method provided in one embodiment of this specification;
[0034] Figure 6 This is a schematic diagram of the structure of an image encoding device provided in one embodiment of this specification;
[0035] Figure 7 This is a schematic diagram of the structure of an image decoding device provided in one embodiment of this specification;
[0036] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0037] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0038] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0039] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0040] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0041] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0042] Wavefront parallel processing: Wavefront parallel processing is a parallel encoding and decoding technique in high-efficiency video coding standards. It can achieve a certain degree of parallel encoding and decoding at the row level of coding tree units by sacrificing a small amount of compression efficiency.
[0043] High-efficiency video coding: Also known as H.265, high-efficiency video coding can achieve twice the compression of Blu-ray video compression methods.
[0044] Coding Tree Unit (CTU): A Coding Tree Unit (CTU) is a basic coding unit in video coding. The division of CTUs is specified by the encoder. A Coding Unit (CU) is a unit that further divides the CTU based on the CTU. In the embodiments of this specification, both CTUs and CUs are collectively referred to as coding units.
[0045] Filtering: The boundaries of transform and prediction blocks can produce blocking effects. Filtering (deblocking) is used to filter these boundaries. The strength of the filter is related to the quantization parameters on both sides of the boundary.
[0046] This specification provides an image encoding method, and also relates to an image decoding method, an image encoding apparatus, an image decoding apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.
[0047] See Figure 1 , Figure 1 This specification illustrates an architecture diagram of an image encoding system according to one embodiment of the present specification. The image encoding system may include a client 100 and a server 200.
[0048] Client 100 is used to send the image to be encoded to server 200;
[0049] Server 200 is used to perform parallel encoding of multiple coding units in the image to be encoded, determine the quantization parameters and encoding state of multiple coding units; reset the encoding state of multiple coding units and the quantization parameters of the target coding unit according to the serial encoding method, and use the reset quantization parameters to filter the target coding unit to obtain the processing result, wherein the quantization prediction accuracy of the target coding unit reaches the preset accuracy; determine the image encoding result based on the reset encoding state and processing result; and send the image encoding result to client 100.
[0050] Client 100 is also used to receive image encoding results sent by server 200.
[0051] The scheme implemented in this specification ensures encoding speed through parallel encoding, and adjusts quantization parameters and encoding state through serial encoding, taking into account the correlation between encoding units and reducing the compression performance loss caused by parallel encoding.
[0052] See Figure 2 , Figure 2This specification illustrates an architecture diagram of another image encoding system provided in one embodiment. The image encoding system may include a server 200 and multiple clients 100, wherein the clients 100 may be edge devices, and the server 200 may be cloud devices. Multiple clients 100 can establish communication connections through the server 200. In the image encoding scenario, the server 200 is used to provide image encoding services between the multiple clients 100, and the multiple clients 100 can act as either senders or receivers, communicating through the server 200.
[0053] Users can interact with server 200 through client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the image encoding scenario, users can publish data streams to server 200 through client 100, server 200 can generate image encoding results based on the data stream, and push the image encoding results to other clients that have established communication.
[0054] In this system, client 100 and server 200 establish a connection via a network. The network provides the medium for communication between client 100 and server 200. The network can include various connection types, such as wired or wireless communication links or fiber optic cables. Data transmitted by client 100 may need to undergo encoding, transcoding, compression, or other processing before being published to server 200.
[0055] Client 100 can be a browser, an app (application), a web application such as an H5 (HyperText Markup Language 5) application, a lightweight application (also known as a mini-program), or a cloud application. Client 100 can be developed based on the software development kit (SDK) of the corresponding service provided by server 200, such as a real-time communication (RTC) SDK. Client 100 can be deployed on electronic devices and depends on the device or certain apps on the device to run. Electronic devices may have displays and support information browsing, such as personal mobile terminals like mobile phones, tablets, and personal computers. Various other types of applications can also be configured on electronic devices, such as human-computer interaction applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, and social media platform software.
[0056] Server 200 may include servers providing various services, such as servers providing communication services to multiple clients, servers supporting backend training of models used on clients, and servers processing data sent by clients. It should be noted that server 200 can be implemented as a distributed server cluster composed of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0057] It is worth noting that the image encoding method provided in the embodiments of this specification is generally executed by the server. However, in other embodiments of this specification, the client may also have similar functions to the server, thereby executing the image encoding method provided in the embodiments of this specification. In other embodiments, the image encoding method provided in the embodiments of this specification may also be executed jointly by the client and the server. The architecture of the image decoding system can be found in the image encoding system described above, and will not be repeated in the embodiments of this specification.
[0058] See Figure 3 , Figure 3 A flowchart of an image encoding method provided in one embodiment of this specification is shown, which specifically includes the following steps:
[0059] Step 302: Obtain the image to be encoded.
[0060] In one or more embodiments of this specification, an image to be encoded can be obtained, and then the image to be encoded can be further encoded by combining parallel encoding and serial encoding methods to obtain an image encoding result.
[0061] Specifically, the image to be encoded is the object of image encoding processing. The image to be encoded can be a single image or a frame from a video. The image to be encoded can be an image from different scenes, such as images from natural scenes, traffic scenes, meeting scenes, etc. The image to be encoded can also be an image containing different content; assuming the image to be encoded is an image from a natural scene, it can be a portrait image or a landscape image.
[0062] In practical applications, there are various ways to acquire the image to be encoded, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on this method. In one possible implementation, the image to be encoded can be received from a user via a client. In another possible implementation, the image to be encoded can be read from other data acquisition devices or a database.
[0063] In one optional embodiment of this specification, taking a frame from the video to be encoded as the image to be encoded, the above-mentioned acquisition of the image to be encoded may include the following steps:
[0064] Obtain the video to be encoded;
[0065] Extract the image to be encoded from the video to be encoded.
[0066] Specifically, the video to be encoded can be an image encoding object. When encoding the video, image encoding methods can be used to encode each frame of the video to obtain the video encoding result. The video to be encoded can be videos of different scenes, or images of different content in the same scene. For example, the video to be encoded can be images of participants in a meeting scene, or images of meeting documents in a meeting scene.
[0067] It should be noted that the method of acquiring the video to be encoded is the same as the method of acquiring the image to be encoded described above, and will not be repeated in the embodiments of this specification.
[0068] In practical applications, there are various ways to extract the image to be encoded from the video to be encoded, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on this method. In one possible implementation, each frame of the video to be encoded can be continuously read using the `read` function, and the frame image can be displayed using the `imshow` function. In another possible implementation, the image to be encoded can be extracted from the video sequence at certain time intervals; for example, one frame can be extracted from the video to be encoded every second.
[0069] By applying the scheme of the embodiments in this specification, a video to be encoded can be obtained; an image to be encoded can be extracted from the video to be encoded. This allows for encoding of both single images and videos, making the above image encoding method more flexible.
[0070] Step 304: Perform parallel encoding on multiple coding units in the image to be encoded, and determine the quantization parameters and encoding state of multiple coding units.
[0071] In one possible implementation of this specification, after obtaining the image to be encoded, multiple coding units in the image to be encoded can be encoded in parallel to determine the quantization parameters and coding states of the multiple coding units.
[0072] Specifically, the quantization parameter (QP) reflects the compression of spatial details in an image. It controls the quality and data volume of the image being encoded. A smaller quantization parameter indicates higher quantization precision and better image quality, but results in a larger data volume; conversely, a larger quantization parameter indicates lower quantization precision and poorer image quality, but results in a smaller data volume. In other words, the quantization parameter and bit rate are inversely proportional.
[0073] The encoding state refers to the current state of the encoder, which can be understood as the encoding state of the Context-Based Adaptive Binary Arithmetic Coding (CABAC) model. The encoding state includes information such as the context model and symbol occurrence probabilities. The encoding state is continuously updated and adjusted as the encoding process progresses to adapt to different encoded data. The encoding state can be divided into two types: global state and local state. The global state refers to the state information related to the entire encoded sequence. The local state refers to the state information related to the current encoding position. The context model is a model that predicts the probability of the current symbol occurrence based on historical encoding data. During the encoding process, the encoder calculates the probability of the symbol occurrence based on the type of the current symbol and the context model, and adjusts the encoding state according to the probability value to achieve higher compression efficiency.
[0074] It should be noted that wavefront parallel processing can be used to encode multiple coding units in the image to be encoded in parallel, determining the quantization parameters and coding states of multiple coding units. Parallel encoding can also determine the coding mode of multiple coding units, that is, the syntax element information (syntaxelements) associated with the coding units that need to be written into the bitstream.
[0075] In one optional embodiment of this specification, multiple coding units in the image to be encoded can be determined, and then the multiple coding units can be encoded in parallel. That is, before determining the quantization parameters and encoding states of the multiple coding units in the image to be encoded in parallel, the following steps may be included:
[0076] The image to be encoded is segmented to identify multiple coding units within the image.
[0077] It should be noted that image segmentation refers to dividing an image into multiple sub-regions (coding units) in order to better understand and process the image.
[0078] In practical applications, when segmenting an image to be encoded, image slicing can be used to determine multiple coding units within the image. Specifically, the image to be encoded can be input into an encoder to determine multiple coding units. During the encoding process, each coding unit is encoded as the output of a set of entropy encoders and quantizers, and these outputs are compressed and stored in the encoded data stream.
[0079] See Figure 4 , Figure 4 The diagram illustrates a coding unit in an image coding method according to an embodiment of this specification, as shown below. Figure 4 As shown, a slice contains multiple coding lines, and a coding line contains 20 coding units. Figure 4 The numbers (0, 1, 2, 3, ..., 20, 21, 22, ..., 40, 41, ..., 60, ...) are the codes for the coding units.
[0080] By applying the scheme of the embodiments in this specification, the image to be encoded is segmented, and multiple coding units in the image to be encoded are determined, so that the image to be encoded can be encoded at the coding unit level, thus ensuring the accuracy of the encoding.
[0081] In one optional embodiment of this specification, the parallel encoding of multiple coding units in the image to be encoded, and the determination of the quantization parameters and encoding states of the multiple coding units, may include the following steps:
[0082] For the current encoding line, obtain the completion status information of the specified encoding unit, where the specified encoding unit is the first two encoding units of the line preceding the current encoding line;
[0083] If the completion status information indicates that encoding is complete, the current encoding line is encoded to determine the quantization parameters and encoding status of multiple encoding units.
[0084] Specifically, the current encoded line refers to the Nth row in the image slice, where N ≥ 2. The completion status information is used to indicate whether the encoding is complete.
[0085] It should be noted that when obtaining the completion status information of a specified encoding unit, if the completion status information indicates that the encoding is not complete, the current encoding line cannot be encoded and must be waited until the completion status information indicates that the encoding is complete before the current encoding line can be encoded.
[0086] In practical applications, when multiple coding units are encoded in parallel, the encoding methods for the first row and the Nth row are different. The first row is encoded using a serial encoding method, which can be understood as not using wavefront parallel processing technology. During parallel encoding, the coding units in the Nth row can begin encoding after the first two coding units in the (N-1)th row have been encoded, and must be two or more coding units following the (N-1)th row.
[0087] For example, with Figure 4 Taking encoding unit 20 as an example, the encoding of encoding unit 20 can only be started after encoding unit 1 has finished encoding, and the encoding of encoding unit 41 can only be started after encoding unit 22 has finished encoding.
[0088] By applying the scheme of the embodiments of this specification, for the current coding line, the completion status information of the specified coding unit is obtained, wherein the specified coding unit is the first two coding units of the previous line of the current coding line; when the completion status information is that the coding is completed, the current coding line is coded, the quantization parameters and coding status of multiple coding units are determined, and the parallel coding method is used to encode multiple coding units, thereby improving the image coding speed.
[0089] In one optional embodiment of this specification, the above-described encoding of the current encoding line and determination of the quantization parameters and encoding state of multiple encoding units may include the following steps:
[0090] For the current coding unit, obtain the specified coding state of the specified coding unit, and determine the coding state of the current coding unit based on the specified coding state;
[0091] Based on the quantization parameters of the already encoded coding units, determine the prediction quantization parameters of the current coding unit;
[0092] The quantization parameters of the current coding unit are determined based on the prediction error and the prediction quantization parameters.
[0093] It should be noted that the current coding unit refers to any coding unit in the Nth row. When determining the coding state of the current coding unit based on a specified coding state, the coding state of the Nth row can be initialized to the coding state after the first two coding units of the (N-1)th row have been encoded.
[0094] For example, with Figure 4 Taking encoding unit 40 as an example, the encoding state before encoding by encoding unit 40 can be set to the encoding state at the end of encoding by encoding unit 21.
[0095] In practical applications, the quantization parameter (QP) of the current coding unit is determined based on the prediction error (delta QP) and the prediction quantization parameter (reference QP). The prediction quantization parameter is derived from the quantization parameters of the coding units that have already been encoded, and the prediction error is the value written into the bitstream. That is, the quantization parameter of the current coding unit can be determined by the following formula (1):
[0096] QP=reference QP+delta QP (1)
[0097] By applying the scheme of the embodiments of this specification, for the current coding unit, the specified coding state of the specified coding unit is obtained, and the coding state of the current coding unit is determined based on the specified coding state; the prediction quantization parameters of the current coding unit are determined according to the quantization parameters of the coding units that have completed coding; and the quantization parameters of the current coding unit are determined according to the prediction error and the prediction quantization parameters, thus ensuring the accuracy of parallel coding.
[0098] In one optional embodiment of this specification, determining the prediction quantization parameter of the current coding unit based on the quantization parameters of the already encoded coding units may include the following steps:
[0099] Select a second reference coding unit from the coding units that have been encoded, wherein the second reference coding unit is the adjacent coding unit of the current coding unit;
[0100] The predictive quantization parameters of the current coding unit are determined based on the reference quantization parameters of the second reference coding unit.
[0101] Specifically, an adjacent coding unit refers to a coding unit that is adjacent to the current coding unit in position and has already been encoded.
[0102] It should be noted that there are multiple ways to select the second reference coding unit, and the specific method should be selected according to the actual situation. This specification does not impose any limitations on this method in the embodiments. In one possible implementation, the coding units that have already been encoded can be determined first, and then the second reference coding unit can be selected from these completed coding units. In another possible implementation, the coding units adjacent to the current coding unit can be determined first, and then the completed coding units can be selected from these adjacent coding units as the second reference coding unit.
[0103] In practical applications, the coding units adjacent to the current coding unit include those above, below, to the left, and to the right of the current coding unit. Since the coding units to the right and below the current coding unit have not yet been encoded, the second reference coding unit includes a third coding unit adjacent to and above the current coding unit, and a fourth coding unit adjacent to and to the left of the current coding unit.
[0104] Furthermore, after determining the second reference coding unit, the reference quantization parameters of the second reference coding unit can be obtained, that is, the third coding parameter (aboveCU QP) of the third coding unit and the fourth coding parameter (leftCU QP) of the fourth coding unit are obtained, the third coding parameter and the fourth coding parameter are merged, and the merged result is divided by two to obtain the prediction quantization parameters, which can be calculated using the following formula (2):
[0105] reference QP=(leftCU QP+aboveCU QP) / 2 (2)
[0106] By applying the scheme of the embodiments of this specification, a second reference coding unit is selected from the coding units that have been encoded, wherein the second reference coding unit is the adjacent coding unit of the current coding unit; the prediction quantization parameter of the current coding unit is determined according to the reference quantization parameter of the second reference coding unit, thereby achieving accurate determination of the prediction quantization parameter and further ensuring the accuracy of parallel coding.
[0107] In one optional embodiment of this specification, the second reference coding unit includes a third coding unit and a fourth coding unit. The third coding unit is adjacent to and above the current coding unit, and the fourth coding unit is adjacent to and to the left of the current coding unit. The process of selecting the second reference coding unit from the already encoded coding units may include the following steps:
[0108] If there is no fourth coding unit among the coding units that have been encoded, select the third coding unit from the coding units that have been encoded.
[0109] Determining the prediction quantization parameters of the current coding unit based on the reference quantization parameters of the second reference coding unit may include the following steps:
[0110] The predicted quantization parameters of the current coding unit are determined based on the preset quantization parameters and the third quantization parameters of the third coding unit.
[0111] It should be noted that since the first coding unit in each coding line does not have a coding unit to its left, when selecting the second reference coding unit from the coding units that have been coded, there may be a situation where there is no fourth coding unit among the coding units that have been coded. In this case, the preset quantization parameter (slice QP) can be used to replace the fourth coding parameter, and only the third coding unit can be selected from the coding units that have been coded. The prediction quantization parameter of the current coding unit can be determined using the above formula (2).
[0112] The solution implemented in this specification involves selecting a third coding unit from the already encoded coding units when there is no fourth coding unit among the already encoded coding units. Based on the preset quantization parameters and the third quantization parameters of the third coding unit, the predicted quantization parameters of the current coding unit are determined to avoid errors in the parallel coding results due to the absence of a fourth coding unit among the already encoded coding units.
[0113] Step 306: According to the serial encoding method, reset the encoding state of multiple encoding units and the quantization parameters of the target encoding unit, and use the reset quantization parameters to filter the target encoding unit to obtain the processing result, wherein the quantization prediction accuracy of the target encoding unit reaches the preset accuracy.
[0114] In one or more embodiments of this specification, an image to be encoded is obtained; multiple coding units in the image to be encoded are encoded in parallel, and after determining the quantization parameters and coding states of the multiple coding units, the coding states of the multiple coding units and the quantization parameters of the target coding unit can be reset in a serial encoding manner, and the target coding unit is filtered using the reset quantization parameters to obtain the processing result, wherein the quantization prediction accuracy of the target coding unit reaches a preset accuracy.
[0115] In practical applications, after encoding each line of code using parallel encoding, the quantization parameters of the target coding unit can be reset using serial encoding before filtering. This reset quantization parameter is then used for subsequent filtering. Furthermore, after encoding each line of code using parallel encoding, the encoding state of that line can be reset using serial encoding, and the syntax element information can be rewritten into the bitstream of that line. Serial encoding can be understood as non-wavefront parallel processing. Because image reconstruction can cause discontinuities at the edges between blocks—a phenomenon called block artifacts—the reset quantization parameters can be used to perform deblocking filtering on the target coding unit to obtain the processing result.
[0116] It should be noted that there is no specific order in which the encoding states of multiple coding units and the quantization parameters of the target coding unit are reset. The encoding states of the multiple coding units can be reset first, or the quantization parameters of the target coding unit can be reset first. However, since the input to the coding unit during filtering includes the quantization parameters, and these parameters can affect the filtering result, the quantization parameters of the target coding unit must be reset before the filtering process.
[0117] Furthermore, the encoder encodes multiple coding units and outputs the result of whether the quantization prediction accuracy of each coding unit reaches a preset accuracy, that is, whether the prediction accuracy is high or low. Based on the encoder output, the coding unit that achieves the preset accuracy in quantization prediction, that is, the coding unit with high prediction accuracy, can be selected as the target coding unit.
[0118] In one optional embodiment of this specification, in order to accurately reset the quantization parameters, the target coding unit among multiple coding units can be determined first. That is, before resetting the coding state of multiple coding units and the quantization parameters of the target coding unit according to the serial coding method, the following steps may be included:
[0119] Residual data identification is performed on multiple coding units to obtain identification results;
[0120] Based on the identification results, the target coding unit is selected from multiple coding units, where the target coding unit does not include residual data.
[0121] It should be noted that the recognition result can be that the coding unit includes residual data or that the coding unit does not include residual data. Based on the recognition result, the coding unit that does not include residual data can be used as the target coding unit.
[0122] In practical applications, the coding block flag (CBF) of the target coding unit is zero. The target coding unit has no subsequent transform tree to encode, nor any prediction error to write into the bitstream; that is, the prediction error of the target coding unit is zero, and the quantization parameters of the target coding unit can be determined based on the prediction quantization parameters.
[0123] By applying the scheme of the embodiments of this specification, residual data identification is performed on multiple coding units to obtain identification results; based on the identification results, a target coding unit is selected from the multiple coding units, wherein the target coding unit does not include residual data, thus ensuring the accuracy of the target coding unit and further ensuring the accuracy of the reset.
[0124] In one optional embodiment of this specification, resetting the encoding state of multiple encoding units and the quantization parameters of the target encoding unit according to the serial encoding method may include the following steps:
[0125] For the current target coding unit, a first reference coding unit is selected from the coding units that have been coded. The first reference coding unit is the adjacent coding unit of the current target coding unit.
[0126] Based on the reference coding state of the first reference coding unit, the coding states of multiple coding units are reset, and based on the reference quantization parameters of the first reference coding unit, the quantization parameters of the current target coding unit are reset.
[0127] It should be noted that the method for selecting the first reference coding unit is the same as the method for selecting the second reference coding unit described above, and will not be repeated in the embodiments of this specification. Furthermore, the embodiments of this specification do not impose any restrictions on the order in which the coding states of multiple coding units are reset according to the reference coding state of the first reference coding unit, and the quantization parameters of the current target coding unit are reset according to the reference quantization parameters of the first reference coding unit.
[0128] In practical applications, since the final bitstream does not use wavefront parallel processing technology, the encoding state of multiple encoding units can be reset in a serial encoding manner before the final bitstream is written, so as to ensure consistency in the encoding and decoding process.
[0129] For example, with Figure 4 Taking coding unit 40 as an example, the coding state of coding unit 40 determined by parallel coding is the coding state of coding unit 21. According to the serial coding method, the coding state when coding unit 39 is completed can be reset to the coding state of coding unit 40.
[0130] Applying the scheme of the embodiments of this specification, for the current target coding unit, a first reference coding unit is selected from the coding units that have been encoded, wherein the first reference coding unit is an adjacent coding unit of the current target coding unit; according to the reference coding state of the first reference coding unit, the coding state of multiple coding units is reset, and according to the reference quantization parameter of the first reference coding unit, the quantization parameter of the current target coding unit is reset, thereby avoiding the problem of encoding and decoding mismatch caused by using parallel decoding.
[0131] In one optional embodiment of this specification, since the final bitstream does not employ wavefront parallel processing technology, the quantization parameters used during filtering should be derived according to the serial encoding method. This ensures consistency in the encoding and decoding process. Specifically, the first reference coding unit includes a first coding unit and a second coding unit. The first coding unit is adjacent to and to the left of the current target coding unit, and the second coding unit is adjacent to and above the current target coding unit. The aforementioned resetting of the quantization parameters of the current target coding unit based on the reference quantization parameters of the first reference coding unit may include the following steps:
[0132] Analyze the quantization parameters of the current target coding unit to determine the preset quantization parameters and the third quantization parameter;
[0133] The preset quantization parameter is replaced by the first quantization parameter of the first encoding unit, and the third quantization parameter is replaced by the second quantization parameter of the second encoding unit to determine the reset quantization parameter.
[0134] It should be noted that since the quantization parameters of multiple coding units are obtained through parallel encoding, if the quantization parameters are not reset, the quantization parameters used in subsequent filtering will be those obtained through parallel encoding, while the decoding will still use the quantization parameters derived through serial encoding for filtering. This will cause inconsistency between encoding and decoding, affecting compression performance. If the quantization parameters are reset according to the serial encoding method, the quantization parameters used in subsequent filtering will be the correct quantization parameters obtained through non-parallel encoding.
[0135] The scheme described in this specification involves parsing the quantization parameters of the current target coding unit to determine the preset quantization parameters and the third quantization parameters. The preset quantization parameters are then replaced with the first quantization parameters of the first coding unit, and the third quantization parameters are replaced with the second quantization parameters of the second coding unit to determine the reset quantization parameters. This ensures consistency in the encoding and decoding process, considers the correlation between coding units, and reduces the compression performance loss caused by parallel encoding.
[0136] In one optional embodiment of this specification, the first reference coding unit includes a first coding unit, which is adjacent to the current target coding unit and located to the left of the current target coding unit; the above-mentioned selection of the first reference coding unit from the coding units that have been encoded may include the following steps:
[0137] If the first coding unit is not found in the coding units that have been encoded, a replacement coding unit is selected from the coding units that have been encoded and used as the first coding unit. The replacement coding unit is the last coding unit in the row preceding the current target coding unit.
[0138] It should be noted that since the first coding unit in each coding line does not have a coding unit to its left, when selecting the first reference coding unit from the coding units that have been coded, there may be cases where the first coding unit is not present in the coding units that have been coded. In this case, a replacement coding unit can be selected from the coding units that have been coded and used as the first coding unit.
[0139] For example, with Figure 4 Taking coding unit 40 as an example, coding unit 40 is a skip mode coding unit with its coding block flag set to zero. During parallel coding, the quantization parameters of coding unit 40 can be determined based on the preset quantization parameters and the third quantization parameters of the third coding unit of coding unit 40. Specifically, it can be calculated using the following formula (3):
[0140] QP WPP =(slice QP+aboveCU QP) / 2 (3)
[0141] Among them, QP WPP is the quantization parameter of coding unit 40, slice QP is the preset quantization parameter, and aboveCU QP is the third quantization parameter of the third coding unit (coding unit 20).
[0142] According to the serial encoding method, the replacement encoding unit corresponding to encoding unit 40 is encoding unit 39. The quantization parameters of encoding unit 40 can be determined based on the replacement quantization parameters of the replacement encoding unit and the second quantization parameters of the second encoding unit of encoding unit 40. Specifically, it can be calculated using the following formula (4):
[0143] QP nowpp =(replaceCU QP+aboveCU QP) / 2 (4)
[0144] Among them, QP nowpp The quantization parameters after resetting the coding unit 40 are replaceCU QP, which is the replacement quantization parameter of the replacement coding unit (coding unit 39), and aboveCU QP is the second quantization parameter of the second coding unit (coding unit 20).
[0145] Applying the scheme of the embodiments in this specification, when the first coding unit is not present in the already encoded coding units, a replacement coding unit is selected from the already encoded coding units, and the replacement coding unit is used as the first coding unit. The replacement coding unit is the last coding unit in the row preceding the current target coding unit. By adjusting the quantization parameters and encoding state through serial encoding, the encoding / decoding mismatch problem caused by parallel decoding is avoided.
[0146] Step 308: Determine the image encoding result based on the reset encoding state and processing result.
[0147] In one or more embodiments of this specification, an image to be encoded is acquired; multiple coding units in the image to be encoded are encoded in parallel to determine the quantization parameters and coding states of the multiple coding units; the coding states of the multiple coding units and the quantization parameters of the target coding unit are reset according to the serial encoding method, and the target coding unit is filtered using the reset quantization parameters. After obtaining the processing result, the image encoding result can be further determined based on the reset coding state and the processing result.
[0148] It should be noted that, based on the reset encoding state and processing results, the image to be encoded can be converted into another image file format, i.e., the image encoding result. Image encoding can remove redundant information from the image to be encoded, reducing the size of the image file while maintaining image quality.
[0149] The scheme implemented in this specification accelerates the encoder by utilizing the wavefront parallel processing concept, ensuring encoding speed. Furthermore, by adjusting quantization parameters and encoding state through serial encoding, the correlation between encoding units is fully exploited, reducing the compression performance loss caused by parallel encoding.
[0150] In practical applications, compared with serial coding, parallel coding can achieve a 3.65 times encoder speedup, that is, the number of frames per second (FPS) transmitted is 3.65 times that of serial coding; at the same peak signal-to-noise ratio (PSNR) quality, the code rate of parallel coding is 2.34% higher than that of serial coding; and at the same structural similarity index (SSIM) quality, the code rate of parallel coding is 2.59% higher than that of serial coding.
[0151] The image coding method proposed in the embodiments of this specification can achieve a coding speed of 3.65 times that of serial coding, which is comparable to the coding speed of parallel coding. Under the same peak signal-to-noise ratio and structural similarity index quality, it only consumes 0.51% more bit rate than serial coding. Therefore, the image coding method proposed in the embodiments of this specification can guarantee coding speed and reduce the compression performance loss caused by parallel coding.
[0152] See Figure 5 , Figure 5 This specification shows a flowchart of an image decoding method according to an embodiment, which specifically includes the following steps:
[0153] Step 502: Obtain the image encoding result.
[0154] The image encoding results are as follows: Figure 3 The image encoding method shown is used to obtain;
[0155] Step 504: Analyze the image encoding results to determine the encoding state and quantization parameters.
[0156] Step 506: Determine the image decoding result based on the encoding state and quantization parameters.
[0157] It should be noted that image decoding refers to the process of restoring a compressed image to its original form. Based on the encoding state and quantization parameters, parameters such as the image encoding type, frame rate, and resolution can be determined. These parameters can then be used to decode the compressed image encoding result, generating the decoded image.
[0158] Specifically, the compressed image encoding result can be input into the decoder, which then restores the compressed image to a decoded image, yielding the image decoding result. It's important to note that before inputting the compressed image encoding result into the decoder, the decoder can be configured based on parameters such as the image encoding type, frame rate, and resolution to ensure that the restored decoded image has the same frame rate and resolution as the original image before encoding.
[0159] It is worth noting that since the encoding state and quantization parameters are obtained by resetting the quantization parameters and encoding state obtained by parallel encoding in a serial encoding manner, the encoding and decoding quality can also be guaranteed by using traditional image decoding methods to determine the image decoding result.
[0160] The scheme implemented in this specification avoids the problem of encoding-decoding mismatch caused by using parallel encoding to determine quantization parameters and encoding states during encoding, and using serial encoding to determine quantization parameters and encoding states during decoding. It reduces the compression performance loss caused by parallel encoding while ensuring encoding speed, and does not reduce encoding quality.
[0161] Corresponding to the above method embodiments, this specification also provides embodiments of image encoding devices. Figure 6 A schematic diagram of an image encoding apparatus according to one embodiment of this specification is shown. Figure 6 As shown, the device includes:
[0162] The first acquisition module 602 is configured to acquire the image to be encoded;
[0163] The encoding module 604 is configured to encode multiple coding units in the image to be encoded in parallel, and to determine the quantization parameters and encoding state of the multiple coding units;
[0164] The reset module 606 is configured to reset the encoding state of multiple encoding units and the quantization parameters of the target encoding unit according to the serial encoding method, and to use the reset quantization parameters to filter the target encoding unit to obtain the processing result, wherein the quantization prediction accuracy of the target encoding unit reaches the preset accuracy.
[0165] The first determining module 608 is configured to determine the image encoding result based on the reset encoding state and the processing result.
[0166] Optionally, the reset module 606 is further configured to, for the current target coding unit, select a first reference coding unit from the coding units that have been encoded, wherein the first reference coding unit is an adjacent coding unit of the current target coding unit; reset the coding state of multiple coding units according to the reference coding state of the first reference coding unit, and reset the quantization parameter of the current target coding unit according to the reference quantization parameter of the first reference coding unit.
[0167] Optionally, the first reference coding unit includes a first coding unit, which is adjacent to the current target coding unit and located to the left of the current target coding unit; the reset module 606 is further configured to, when there is no first coding unit among the coding units that have been coded, select a replacement coding unit from the coding units that have been coded and use the replacement coding unit as the first coding unit, wherein the replacement coding unit is the last coding unit in the row preceding the current target coding unit.
[0168] Optionally, the first reference coding unit includes a first coding unit and a second coding unit. The first coding unit is adjacent to and located to the left of the current target coding unit, and the second coding unit is adjacent to and located above the current target coding unit. The reset module 606 is further configured to parse the quantization parameters of the current target coding unit, determine the preset quantization parameters and the third quantization parameters, replace the preset quantization parameters with the first quantization parameters of the first coding unit, and replace the third quantization parameters with the second quantization parameters of the second coding unit to determine the reset quantization parameters.
[0169] Optionally, the device further includes: an identification module configured to identify residual data of multiple coding units to obtain identification results; and to select a target coding unit from the multiple coding units based on the identification results, wherein the target coding unit does not include residual data.
[0170] Optionally, the encoding module 604 is further configured to obtain the completion status information of a specified encoding unit for the current encoding line, wherein the specified encoding unit is the first two encoding units of the previous line of the current encoding line; if the completion status information is that the encoding is complete, the current encoding line is encoded to determine the quantization parameters and encoding status of multiple encoding units.
[0171] Optionally, the encoding module 604 is further configured to, for the current encoding unit, obtain a specified encoding state of a specified encoding unit, and determine the encoding state of the current encoding unit based on the specified encoding state; determine the predicted quantization parameters of the current encoding unit based on the quantization parameters of the encoding units that have been encoded; and determine the quantization parameters of the current encoding unit based on the prediction error and the predicted quantization parameters.
[0172] Optionally, the encoding module 604 is further configured to select a second reference encoding unit from the encoded units that have been encoded, wherein the second reference encoding unit is an adjacent encoding unit of the current encoding unit; and to determine the predictive quantization parameters of the current encoding unit based on the reference quantization parameters of the second reference encoding unit.
[0173] Optionally, the second reference coding unit includes a third coding unit and a fourth coding unit. The third coding unit is adjacent to and above the current coding unit, and the fourth coding unit is adjacent to and to the left of the current coding unit. The coding module 604 is further configured to select the third coding unit from the coding units that have been encoded if the fourth coding unit is not present in the encoded units that have been encoded. The predicted quantization parameters of the current coding unit are determined according to the preset quantization parameters and the third quantization parameters of the third coding unit.
[0174] Optionally, the apparatus further includes a segmentation module configured to segment the image to be encoded and determine multiple coding units in the image to be encoded.
[0175] Optionally, the first acquisition module 602 is further configured to acquire the video to be encoded and extract the image to be encoded from the video to be encoded.
[0176] The scheme implemented in this specification ensures encoding speed through parallel encoding, and adjusts quantization parameters and encoding states through serial encoding, taking into account the correlation between encoding units and reducing the compression performance loss caused by parallel encoding. Furthermore, adjusting quantization parameters and encoding states through serial encoding avoids the encoding-decoding mismatch problem that occurs when using parallel decoding.
[0177] The above is an illustrative scheme of an image encoding device according to this embodiment. It should be noted that the technical solution of this image encoding device and the technical solution of the image encoding method described above belong to the same concept. For details not described in detail in the technical solution of the image encoding device, please refer to the description of the technical solution of the image encoding method described above.
[0178] Corresponding to the above method embodiments, this specification also provides embodiments of image decoding apparatus. Figure 7 A schematic diagram of an image decoding apparatus according to one embodiment of this specification is shown. Figure 7 As shown, the device includes:
[0179] The second acquisition module 702 is configured to acquire the image encoding result, wherein the image encoding result is obtained as described above using the image encoding method.
[0180] The parsing module 704 is configured to parse the image encoding results and determine the encoding state and quantization parameters;
[0181] The second determining module 706 is configured to determine the image decoding result based on the encoding state and quantization parameters.
[0182] The scheme implemented in this specification is obtained by resetting the quantization parameters and encoding state obtained by parallel encoding in a serial encoding manner, since the encoding state and quantization parameters are obtained by resetting the quantization parameters and encoding state obtained by parallel encoding in a serial encoding manner. Therefore, the problem of encoding and decoding mismatch caused by using quantization parameters and encoding state determined by parallel encoding in encoding and serial encoding in decoding is avoided. The compression performance loss caused by parallel encoding is reduced while ensuring the encoding speed.
[0183] The above is an illustrative scheme of an image decoding device according to this embodiment. It should be noted that the technical solution of this image decoding device and the technical solution of the image decoding method described above belong to the same concept. For details not described in detail in the technical solution of the image decoding device, please refer to the description of the technical solution of the image decoding method described above.
[0184] Figure 8 This specification illustrates a structural block diagram of a computing device according to one embodiment. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0185] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Networks (WLAN) interface, a Wi-MAX (World Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0186] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0187] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 800 can also be a mobile or stationary server.
[0188] The processor 820 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described image encoding method or image decoding method.
[0189] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solutions of the image encoding method and the image decoding method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the image encoding method or the image decoding method described above.
[0190] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described image encoding method or image decoding method.
[0191] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solutions of the image encoding method and the image decoding method described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the image encoding method or the image decoding method described above.
[0192] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described image encoding method or image decoding method.
[0193] The above is an illustrative scheme of a computer program according to this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the technical solutions of the image encoding method and the image decoding method described above. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solutions of the image encoding method or the image decoding method described above.
[0194] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0195] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0196] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0197] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0198] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. An image encoding method, comprising: Obtain the image to be encoded; Multiple coding units in the image to be encoded are encoded in parallel to determine the quantization parameters and coding states of the multiple coding units; According to the serial encoding method, the encoding state of the multiple encoding units and the quantization parameters of the target encoding unit are reset, and the target encoding unit is filtered using the reset quantization parameters to obtain the processing result. The quantization prediction accuracy of the target encoding unit reaches the preset accuracy. The encoding state is the encoding state of the entropy encoding context model. The quantization parameters are the compression situation reflecting the spatial details of the image and are used to control the quality and data volume of the image to be encoded. The image encoding result is determined based on the reset encoding state and the processing result.
2. The method according to claim 1, wherein resetting the encoding state of the plurality of encoding units and the quantization parameters of the target encoding unit according to the serial encoding method includes: For the current target coding unit, a first reference coding unit is selected from the coding units that have been encoded, wherein the first reference coding unit is the adjacent coding unit of the current target coding unit; Based on the reference coding state of the first reference coding unit, the coding states of the plurality of coding units are reset, and based on the reference quantization parameters of the first reference coding unit, the quantization parameters of the current target coding unit are reset.
3. The method according to claim 2, wherein the first reference coding unit includes a first coding unit, the first coding unit being adjacent to the current target coding unit and located to the left of the current target coding unit; The step of selecting the first reference coding unit from the already encoded coding units includes: If the first encoding unit is not present in the encoded units that have been encoded, a replacement encoding unit is selected from the encoded units that have been encoded, and the replacement encoding unit is used as the first encoding unit, wherein the replacement encoding unit is the last encoding unit in the row preceding the current target encoding unit.
4. The method according to claim 2, wherein the first reference coding unit includes a first coding unit and a second coding unit, the first coding unit is adjacent to the current target coding unit and located to the left of the current target coding unit, and the second coding unit is adjacent to the current target coding unit and located above the current target coding unit; The step of resetting the quantization parameters of the current target coding unit according to the reference quantization parameters of the first reference coding unit includes: Analyze the quantization parameters of the current target coding unit to determine the preset quantization parameters and the third quantization parameters; The preset quantization parameter is replaced by the first quantization parameter of the first encoding unit, and the third quantization parameter is replaced by the second quantization parameter of the second encoding unit to determine the reset quantization parameter.
5. The method according to claim 1, further comprising, before resetting the encoding state of the plurality of encoding units and the quantization parameters of the target encoding unit according to the serial encoding method: Residual data identification is performed on the multiple coding units to obtain identification results; Based on the identification results, a target coding unit is selected from the plurality of coding units, wherein the target coding unit does not include residual data.
6. The method according to claim 1, wherein the parallel encoding of multiple coding units in the image to be encoded, and the determination of the quantization parameters and encoding states of the multiple coding units, comprises: For the current encoding line, obtain the completion status information of a specified encoding unit, wherein the specified encoding unit is the first two encoding units of the line preceding the current encoding line; If the completion status information indicates that encoding is complete, the current encoding line is encoded to determine the quantization parameters and encoding status of the plurality of encoding units.
7. The method according to claim 6, wherein encoding the current coding line and determining the quantization parameters and coding states of the plurality of coding units includes: For the current coding unit, obtain the specified coding state of the specified coding unit, and determine the coding state of the current coding unit based on the specified coding state; Based on the quantization parameters of the coded units that have already been encoded, determine the prediction quantization parameters of the current coded unit; The quantization parameters of the current coding unit are determined based on the prediction error and the prediction quantization parameters.
8. The method according to claim 7, wherein determining the prediction quantization parameter of the current coding unit based on the quantization parameters of the coded units that have been encoded includes: A second reference coding unit is selected from the coding units that have been encoded, wherein the second reference coding unit is the adjacent coding unit of the current coding unit; The prediction quantization parameters of the current coding unit are determined based on the reference quantization parameters of the second reference coding unit.
9. The method according to claim 8, wherein the second reference coding unit includes a third coding unit and a fourth coding unit, the third coding unit being adjacent to and above the current coding unit, and the fourth coding unit being adjacent to and to the left of the current coding unit; The step of selecting a second reference coding unit from the already encoded coding units includes: If the fourth coding unit is not present in the coding units that have already been encoded, the third coding unit is selected from the coding units that have already been encoded. Determining the prediction quantization parameters of the current coding unit based on the reference quantization parameters of the second reference coding unit includes: The prediction quantization parameters of the current coding unit are determined based on the preset quantization parameters and the third quantization parameters of the third coding unit.
10. The method according to claim 1, further comprising, before performing parallel encoding on multiple coding units in the image to be encoded and determining the quantization parameters and encoding states of the multiple coding units: The image to be encoded is segmented to determine multiple coding units within the image.
11. The method according to claim 1, wherein acquiring the image to be encoded comprises: Obtain the video to be encoded; Extract the image to be encoded from the video to be encoded.
12. An image decoding method, comprising: Obtain the image encoding result, wherein the image encoding result is obtained by the image encoding method according to any one of claims 1-11; Analyze the image encoding results to determine the encoding state and quantization parameters; The image decoding result is determined based on the encoding state and the quantization parameters.
13. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 11 or claim 12.
14. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of any one of claims 1 to 11 or the method of claim 12.
Citation Information
Patent Citations
Video compression method and device, computer equipment and storage medium
CN116112683A
Image encoding method, image decoding method, and related apparatuses
WO2022088631A1