Image encoding method and image decoding method
The hybrid encoding method integrates parallel and serial encoding techniques to optimize video encoding, achieving efficient compression with minimal speed loss and ensuring accurate prediction precision, addressing the limitations of existing technologies like Wavefront Parallel Processing.
Patent Information
- Application Number
- CN202311285394.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2043-09-28
AI Technical Summary
Existing video encoding technologies, such as Wavefront Parallel Processing (WPP), sacrifice compression performance to achieve faster encoding speeds, necessitating a method that minimizes loss in compression efficiency while maintaining high encoding speeds.
A hybrid approach that combines parallel encoding for speed with serial encoding to adjust quantization parameters and coding states, ensuring accurate prediction precision and compatibility between encoding and decoding processes.
This method achieves significant compression efficiency while maintaining high encoding speeds, reducing the performance loss associated with parallel encoding and avoiding encoding-decoding mismatches.
Smart Images

Figure CN119729002A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to an image encoding method. Background Art
[0002] With the development of computer technology, video image production has gradually become easier, and a large number of online video platforms have emerged to provide an indispensable channel for video publishing and dissemination, which has led to an exponential increase in videos on the Internet year by year. However, the transmission of massive videos on the Internet poses a great challenge to network bandwidth and data storage. How to effectively compress videos while ensuring video quality has gradually become a research focus.
[0003] Wavefront Parallel Processing (WPP) is a parallel coding and decoding technology in the High Efficiency Video Coding (HEVC) standard, which can achieve parallel coding and decoding to a certain extent. However, while improving the coding speed, wavefront parallel processing sacrifices a certain compression performance. Therefore, an image coding scheme with less compression performance loss is urgently needed. Summary of the invention
[0004] In view of this, an embodiment of the present specification provides an image encoding method. One or more embodiments of the present specification also relate to an image decoding method, an image encoding device, an image decoding device, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, there is provided an image encoding method, including:
[0006] Obtaining an image to be encoded;
[0007] Performing parallel encoding on a plurality of coding units in the image to be encoded, and determining quantization parameters and encoding states of the plurality of coding units;
[0008] According to the serial coding method, the coding states of the plurality of coding units and the quantization parameters of the target coding unit are reset, and the target coding unit is filtered using the reset quantization parameters to obtain a processing result, wherein the quantization prediction accuracy of the target coding unit reaches a preset accuracy;
[0009] The image encoding result is determined according to the reset encoding state and the processing result.
[0010] According to a second aspect of the embodiments of this specification, there is provided an image decoding method, including:
[0011] Obtaining an image coding result, wherein the image coding result is obtained by the image coding method provided in the first aspect above;
[0012] Analyze the image encoding results and determine the encoding status and quantization parameters;
[0013] The image decoding result is determined based on the encoding status and quantization parameters.
[0014] According to a third aspect of an embodiment of this specification, there is provided an image encoding device, including:
[0015] A first acquisition module is configured to acquire an image to be encoded;
[0016] An encoding module, configured to perform parallel encoding of multiple encoding units in the image to be encoded, and determine quantization parameters and encoding states of the multiple encoding units;
[0017] A reset module is configured to reset the encoding states of the plurality of encoding units and the quantization parameters of the target encoding unit in a serial encoding manner, and perform filtering processing on the target encoding unit using the reset quantization parameters to obtain a processing result, wherein the quantization prediction accuracy of the target encoding unit reaches a preset accuracy;
[0018] The first determination module is configured to determine the image encoding result according to the reset encoding state and the processing result.
[0019] According to a fourth aspect of the embodiments of this specification, there is provided an image decoding apparatus, including:
[0020] A second acquisition module is configured to acquire an image encoding result, wherein the image encoding result is obtained by the image encoding method provided by the first aspect above;
[0021] A parsing module, configured to parse the image encoding result and determine the encoding state and quantization parameters;
[0022] The second determination module is configured to determine the image decoding result according to the encoding state and the quantization parameter.
[0023] According to a fifth aspect of an embodiment of this specification, a computing device is provided, including:
[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. When the computer-executable instructions are executed by the processor, the steps of the method provided in the first aspect or the second aspect are implemented.
[0026] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the method provided in the first aspect or the second aspect are implemented.
[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, the computer is caused to execute the steps of the method provided in the first aspect or the second aspect above.
[0028] An image coding method provided by an embodiment of the present specification obtains an image to be coded; performs parallel coding on multiple coding units in the image to be coded, and determines the quantization parameters and coding states of the multiple coding units; resets the coding states of the multiple coding units and the quantization parameters of the target coding unit in a serial coding manner, and performs filtering processing on the target coding unit using the reset quantization parameters to obtain a processing result, wherein the quantization prediction accuracy of the target coding unit reaches a preset accuracy; and determines the image coding result according to the reset coding state and the processing result. The coding speed is guaranteed by the parallel coding method, and the correlation between the coding units is considered by adjusting the quantization parameters and the coding state by the serial coding method, thereby reducing the compression performance loss caused by the parallel coding method. Moreover, by adjusting the quantization parameters and the coding state by the serial coding method, the problem of mismatch between codecs caused by the parallel decoding method is avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is an architecture diagram of an image coding system provided by an embodiment of this specification;
[0030] Figure 2 is an architecture diagram of another image coding system provided by an embodiment of this specification;
[0031] Figure 3 is a flowchart of an image encoding method provided by an embodiment of this specification;
[0032] Figure 4 is a schematic diagram of a coding unit in an image coding method provided by an embodiment of the present specification;
[0033] Figure 5 is a flowchart of an image decoding method provided by an embodiment of this specification;
[0034] Figure 6 is a structural schematic diagram of an image encoding device provided by an embodiment of this specification;
[0035] Figure 7 is a structural schematic diagram of an image decoding device provided by an embodiment of this specification;
[0036] Figure 8 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0037] Many specific details are described in the following description to facilitate 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 generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0038] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" 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, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0040] In addition, 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, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0041] First, the terms involved in one or more embodiments of this specification are explained.
[0042] Wavefront parallel processing: Wavefront parallel processing is a parallel encoding and decoding technology in the High Efficiency Video Coding standard, which can achieve a certain degree of parallel encoding and decoding at the coding tree unit row level by sacrificing a small amount of compression efficiency.
[0043] High Efficiency Video Coding: High Efficiency Video Coding, also known as H.265, can achieve twice the compression over the Blu-ray video compression method.
[0044] Coding Tree Unit: Coding Tree Unit (CTU) is a basic coding unit in video coding. The division of the coding tree unit is specified by the encoder. Coding Unit (CU) is a unit further divided on the basis of the coding tree unit. In the embodiments of this specification, the coding tree unit and the coding unit are collectively referred to as the coding unit.
[0045] Filtering: The boundaries of transform and prediction blocks will produce blocking effects. Deblocking is to filter these boundaries. The intensity of the filtering is related to the quantization parameters on both sides of the boundary.
[0046] In this specification, an image encoding method is provided. This specification also relates to an image decoding method, an image encoding device, an image decoding device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0047] See also Figure 1 , Figure 1 An architecture diagram of an image coding system provided by an embodiment of the present specification is shown, and the image coding system may include a client 100 and a server 200;
[0048] The client 100 is used to send the image to be encoded to the server 200;
[0049] The server 200 is used to perform parallel encoding on multiple coding units in the image to be encoded, determine quantization parameters and encoding states of the multiple coding units; reset the encoding states of the multiple coding units and the quantization parameters of the target coding unit in a serial encoding manner, and perform filtering processing on the target coding unit using the reset quantization parameters to obtain a processing result, wherein the quantization prediction accuracy of the target coding unit reaches a preset accuracy; determine an image encoding result according to the reset encoding state and the processing result; and send the image encoding result to the client 100;
[0050] The client 100 is also used to receive the image encoding result sent by the server 200.
[0051] By applying the scheme of the embodiments of this specification, the encoding speed is guaranteed through parallel encoding, and the quantization parameter and encoding state are adjusted through serial encoding, the correlation between encoding units is taken into account, and the compression performance loss caused by the parallel encoding is reduced.
[0052] See also Figure 2 , Figure 2The architecture diagram of another image coding system provided by an embodiment of the present specification is shown. The image coding system may include a server 200 and multiple clients 100, wherein the client 100 may be a terminal device and the server 200 may be a cloud device. Multiple clients 100 may establish a communication connection through the server 200. In the image coding scenario, the server 200 is used to provide image coding services between multiple clients 100. Multiple clients 100 may serve as a sender or a receiver, respectively, and realize communication through the server 200.
[0053] The user can interact with the server 200 through the client 100 to receive data sent by other clients 100, or send data to other clients 100, etc. In the image coding scenario, the user can publish a data stream to the server 200 through the client 100, and the server 200 generates an image coding result according to the data stream and pushes the image coding result to other clients that have established communication.
[0054] The client 100 and the server 200 are connected via a network. The network provides a medium for a communication link between the client 100 and the server 200. The network may include various connection types, such as wired or wireless communication links or optical fiber cables, etc. The data transmitted by the client 100 may need to be encoded, transcoded, compressed, etc. before being released to the server 200.
[0055] The client 100 can be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5, Hypertext Markup Language Version 5) application, or a light application (also known as a mini-program, a lightweight application) or a cloud application, etc. The client 100 can be based on the software development kit (SDK, Software Development Kit) of the corresponding service provided by the server 200, such as based on the real-time communication (RTC, Real Time Communication) SDK development and acquisition. The client 100 can be deployed in an electronic device, and needs to rely on the device to run or some APPs in the device to run. For example, the electronic device can have a display screen and support information browsing, such as a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, etc. Various other types of applications can also be configured in the electronic device, such as human-computer dialogue applications, model training applications, text processing applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0056] The server 200 may include servers that provide various services, such as servers that provide communication services to multiple clients, servers for background training that provide support for models used on clients, and servers that process data sent by clients. It should be noted that the server 200 can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server of a distributed system, or a server combined with a blockchain. The server can also be a cloud server for basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), 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, but 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 jointly executed by the client and the server. The architecture of the image decoding system can refer to the above-mentioned image encoding system, and the embodiments of this specification will not be described in detail.
[0058] See also Figure 3 , Figure 3 A flowchart of an image encoding method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0059] Step 302: Obtain an image to be encoded.
[0060] In one or more embodiments of the present specification, an image to be encoded may be obtained, and the image to be encoded may be further encoded in combination with a parallel encoding method and a serial encoding method to obtain an image encoding result.
[0061] Specifically, the image to be encoded is the processing object of image encoding. The image to be encoded can be a single image or a frame image in a video. The image to be encoded can be an image of different scenes, such as an image in a natural scene, an image in a traffic scene, an image in a meeting scene, etc. The image to be encoded can also be an image including different contents. Assuming that the image to be encoded is an image in a natural scene, the image to be encoded can be a portrait image or a landscape image.
[0062] In practical applications, there are many ways to obtain the image to be encoded, which are selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the image to be encoded sent by the user through the client can be received. In another possible implementation of this specification, the image to be encoded can be read from other data acquisition devices or databases.
[0063] In an optional embodiment of the present specification, taking the image to be encoded as a frame of an image in a video to be encoded as an example, the above-mentioned acquisition of the image to be encoded may include the following steps:
[0064] Get 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 may be an image encoding object. When encoding the video to be encoded, each frame of the video to be encoded may be encoded using an image encoding method to obtain a video encoding result. The video to be encoded may be a video of different scenes, or an image of different contents in the same scene, such as an image of a participant in a conference scene, or an image of a conference document in a conference scene.
[0067] It should be noted that the method of obtaining the video to be encoded is the same as the method of obtaining the image to be encoded described above, and will not be described in detail in the embodiments of this specification.
[0068] In practical applications, there are many ways to extract the image to be encoded from the video to be encoded, which are selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, each frame in the video to be encoded can be continuously read by a read function, and the frame image can be displayed using a display function. In another possible implementation of this specification, the image to be encoded can be extracted from the video sequence of the video to be encoded at a certain time interval, for example, a frame of image is extracted from the video to be encoded every second as the image to be encoded.
[0069] By applying the solution of the embodiment of this specification, the video to be encoded is obtained; the image to be encoded is extracted from the video to be encoded, and both a single image and a video can be encoded, making the above-mentioned image encoding method more flexible.
[0070] Step 304: perform parallel encoding on multiple coding units in the image to be encoded, and determine quantization parameters and encoding states of the multiple coding units.
[0071] In a possible implementation of the present specification, after obtaining the image to be encoded, further, multiple coding units in the image to be encoded may be encoded in parallel to determine quantization parameters and encoding states of the multiple coding units.
[0072] Specifically, the quantization parameter (QP) reflects the compression of the image space details, and is used to control the quality and data volume of the image to be encoded. A smaller quantization parameter indicates a higher quantization accuracy and better image quality, but will produce a larger amount of data; while a larger quantization parameter indicates a lower quantization accuracy and worse image quality, but will produce a smaller amount of data. In other words, the quantization parameter is inversely proportional to the bit rate.
[0073] The coding state refers to the current state of the encoder, which can be understood as the coding state of the entropy coding context model (CABAC, Context-Based Adaptive Binary Arithmetic Coding). The coding state includes information such as the context model and the probability of symbol occurrence. The coding state will be continuously updated and adjusted as the encoding process proceeds to adapt to different encoding data. The coding state can be divided into two types: global state and local state. The global state refers to the state information related to the entire encoding sequence. The local state refers to the state information related to the current encoding position. The context model refers to a model that predicts the probability of the current symbol occurrence based on historical encoding data. During the encoding process, the encoder will calculate the probability of the symbol occurrence based on the type of the current symbol and the context model, and adjust the coding state according to the probability value to achieve higher compression efficiency.
[0074] It should be noted that the wavefront parallel processing method can be used to perform parallel encoding on multiple coding units in the image to be encoded to determine the quantization parameters and encoding states of the multiple coding units. Parallel encoding can also determine the encoding modes of the multiple coding units, that is, the syntax elements information (syntax elements) related to the coding units that need to be written into the bitstream.
[0075] In an optional embodiment of the present specification, multiple coding units in the image to be encoded may be determined, and then the multiple coding units may be encoded in parallel. That is, before the multiple coding units in the image to be encoded are encoded in parallel and the quantization parameters and encoding states of the multiple coding units are determined, the following steps may be further included:
[0076] The image to be encoded is divided into segments to determine a plurality of encoding units in the image to be encoded.
[0077] It should be noted that image segmentation refers to dividing an image into multiple sub-regions (coding units) to better understand and process the image.
[0078] In practical applications, when segmenting an image to be encoded, a plurality of coding units in the image to be encoded may be determined by image slicing. Specifically, the image to be encoded may be input into an encoder to determine a plurality of coding units in the image to be encoded. During the encoding process, each coding unit is encoded into a set of entropy encoder and quantizer outputs, which are compressed and stored in the encoded data stream.
[0079] See also Figure 4 , Figure 4 A schematic diagram of a coding unit in an image coding method provided by an embodiment of the present specification is shown. Figure 4 As shown, a slice includes multiple coding lines, and a coding line includes 20 coding units. Figure 4 The numbers (0, 1, 2, 3, ..., 20, 21, 22, ..., 40, 41, ..., 60, ...) in are the numbers of the coding units.
[0080] By applying the solution of the embodiments of this specification, the image to be encoded is segmented and multiple encoding units in the image to be encoded are determined, so that the image to be encoded can be encoded at the encoding unit level, thereby ensuring the accuracy of encoding.
[0081] In an optional embodiment of the present specification, the above-mentioned performing parallel encoding on multiple coding units in the to-be-encoded image and determining quantization parameters and encoding states of the multiple coding units may include the following steps:
[0082] For the current coding line, obtain the completion status information of the specified coding unit, wherein the specified coding unit is the first two coding units of the line before the current coding line;
[0083] When the completion status information indicates that encoding is completed, the current encoding line is encoded, and quantization parameters and encoding states of multiple encoding units are determined.
[0084] Specifically, the current encoding line refers to the Nth line in the image slice, where N≥2. The completion status information is used to indicate whether the encoding is completed.
[0085] It should be noted that when obtaining the completion status information of the specified encoding unit, if the completion status information indicates that encoding is not completed, the current encoding line cannot be encoded, and it is necessary to wait until the completion status information indicates that encoding is completed before encoding the current encoding line.
[0086] In practical applications, when multiple coding units are encoded in parallel, the encoding methods of the first row and the Nth row are different. The first row is encoded in a serial encoding method, which can be understood as not using the wavefront parallel processing technology. When encoding in parallel, the coding unit of the Nth row can be encoded after the first two coding units of the N-1th row are encoded, and it needs to be two or more after the coding unit of the N-1th row.
[0087] For example, Figure 4 Taking the encoding unit 20 in the example, the encoding of the encoding unit 20 can be started only after the encoding of the encoding unit 1 is completed, and the encoding of the encoding unit 41 can be started only after the encoding of the encoding unit 22 is completed.
[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 line before the current coding line; when the completion status information indicates that the encoding is completed, the current coding line is encoded, and the quantization parameters and encoding status of multiple coding units are determined, thereby realizing the encoding of multiple coding units in a parallel encoding manner, thereby improving the image encoding speed.
[0089] In an optional embodiment of the present specification, the encoding of the current coding line and determining the quantization parameters and coding states of multiple coding units may include the following steps:
[0090] For the current coding unit, obtaining a specified coding state of the specified coding unit, and determining the coding state of the current coding unit based on the specified coding state;
[0091] Determining a predicted quantization parameter of a current coding unit according to a quantization parameter of a coding unit that has been encoded;
[0092] The quantization parameter of the current coding unit is determined according to the prediction error and the predicted quantization parameter.
[0093] It should be noted that the current coding unit refers to any coding unit in row N. When determining the coding state of the current coding unit based on the specified coding state, the coding state of row N can be initialized to the coding state after the first two coding units of row N-1 are encoded.
[0094] For example, Figure 4 Taking the encoding unit 40 in the example, the encoding state before the encoding of the encoding unit 40 can be set to the encoding state when the encoding of the encoding unit 21 is finished.
[0095] In practical applications, the quantization parameter (QP) of the current coding unit is determined based on the prediction error (delta QP) and the predicted quantization parameter (reference QP). The predicted quantization parameter is derived based on the quantization parameter of the coding unit that has been encoded. 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 the present specification, for the current coding unit, a 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 predicted quantization parameter of the current coding unit is determined according to the quantization parameter of the coding unit that has completed encoding; the quantization parameter of the current coding unit is determined according to the prediction error and the predicted quantization parameter, thereby ensuring the accuracy of parallel encoding.
[0098] In an optional embodiment of the present specification, the determining of the predicted quantization parameter of the current coding unit according to the quantization parameter of the coding unit that has been encoded may include the following steps:
[0099] Filtering out a second reference coding unit from the coding units that have been encoded, wherein the second reference coding unit is an adjacent coding unit of the current coding unit;
[0100] A predicted quantization parameter of a current coding unit is determined according to a reference quantization parameter of a second reference coding unit.
[0101] Specifically, the adjacent coding unit refers to a coding unit that is adjacent to the current coding unit in position and has been encoded.
[0102] It should be noted that there are multiple ways to select the second reference coding unit, which are selected according to the actual situation, and the embodiments of this specification do not limit this. In one possible implementation of this specification, the coding unit that has been encoded can be determined first, and then the second reference coding unit can be selected from the completed coding unit. In another possible implementation of this specification, the coding unit adjacent to the current coding unit can be determined first, and then the coding unit that has been encoded can be selected from the adjacent coding units as the second reference coding unit.
[0103] In practical applications, the coding units adjacent to the current coding unit include coding units 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 been encoded, the second reference coding unit includes a third coding unit adjacent to the current coding unit and located above the current coding unit, and a fourth coding unit adjacent to the current coding unit and located to the left of the current coding unit.
[0104] Further, after determining the second reference coding unit, the reference quantization parameter 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 predicted quantization parameter, which can be specifically calculated by the following formula (2):
[0105] reference QP=(leftCU QP+aboveCU QP) / 2 (2)
[0106] By applying the scheme of the embodiments of the present specification, a second reference coding unit is screened out from the coding units that have completed encoding, wherein the second reference coding unit is an adjacent coding unit of the current coding unit; based on the reference quantization parameter of the second reference coding unit, the predicted quantization parameter of the current coding unit is determined, thereby achieving accurate determination of the predicted quantization parameter and further ensuring the accuracy of parallel encoding.
[0107] In an optional embodiment of the present specification, the second reference coding unit includes a third coding unit and a fourth coding unit, the third coding unit is adjacent to the current coding unit and is located above the current coding unit, and the fourth coding unit is adjacent to the current coding unit and is located on the left side of the current coding unit; the above-mentioned screening out the second reference coding unit from the coding units that have completed encoding may include the following steps:
[0108] When the fourth coding unit does not exist in the coding units that have been encoded, selecting the third coding unit from the coding units that have been encoded;
[0109] Determining the predicted quantization parameter of the current coding unit according to the reference quantization parameter of the second reference coding unit may include the following steps:
[0110] A predicted quantization parameter of a current coding unit is determined according to the preset quantization parameter and the third quantization parameter of the third coding unit.
[0111] It should be noted that, since the first coding unit in each coding row does not have a coding unit located on its left, when the second reference coding unit is selected from the coding units that have been encoded, there may be a situation where the fourth coding unit does not exist in the coding units that have been encoded. In this case, the preset quantization parameter (slice QP) can be used to replace the fourth coding parameter, and only the third coding unit is selected from the coding units that have been encoded, and the above formula (2) is used to determine the predicted quantization parameter of the current coding unit.
[0112] By applying the scheme of the embodiments of the present specification, when the fourth coding unit does not exist in the coding units that have been encoded, the third coding unit is screened out from the coding units that have been encoded; based on the preset quantization parameter and the third quantization parameter of the third coding unit, the predicted quantization parameter of the current coding unit is determined to avoid errors in the parallel encoding results caused by the absence of the fourth coding unit in the coding units that have been encoded.
[0113] Step 306: According to the serial coding method, the coding states of the plurality of coding units and the quantization parameters of the target coding unit are reset, and the target coding unit is filtered using the reset quantization parameters to obtain a processing result, wherein the quantization prediction accuracy of the target coding unit reaches a preset accuracy.
[0114] In one or more embodiments of the present specification, an image to be encoded is obtained; multiple coding units in the image to be encoded are encoded in parallel, and after the quantization parameters and encoding states of the multiple coding units are determined, the encoding states of the multiple coding units and the quantization parameters of the target coding units can be reset in a serial encoding manner, and the target coding units can be filtered using the reset quantization parameters to obtain a processing result, wherein the quantization prediction accuracy of the target coding units reaches a preset accuracy.
[0115] In practical applications, after encoding each coding line in parallel coding, before filtering the coding line, the quantization parameter of the target coding unit can be reset in serial coding so that the reset quantization parameter can be used for subsequent filtering. In addition, after encoding each coding line in parallel coding, the coding state of the coding line can be reset in serial coding and the syntax element information can be rewritten into the code stream of the coding line, where the serial coding method can be understood as non-wavefront parallel processing. Since image reconstruction will cause discontinuity at the edges between blocks, this phenomenon is called block effect. Therefore, the reset quantization parameter can be used to perform deblocking filter processing on the target coding unit to obtain the processing result.
[0116] It should be noted that there is no order in which the coding states of multiple coding units are reset and the quantization parameters of the target coding units are reset. The coding states of multiple coding units can be reset first, or the quantization parameters of the target coding units can be reset first. However, since the input of the filtering process for the coding units includes the quantization parameters, the quantization parameters can affect the processing results of the filtering process. Therefore, the quantization parameters of the target processing units should be reset before the filtering process.
[0117] Furthermore, the encoder encodes the plurality of coding units and can output the result of whether the quantization prediction accuracy of each coding unit reaches the preset accuracy, that is, the result of whether the prediction accuracy is high or low. Based on the result output by the encoder, the coding unit whose quantization prediction accuracy reaches the preset accuracy, that is, the coding unit with high prediction accuracy, can be selected as the target coding unit.
[0118] In an optional embodiment of the present specification, in order to accurately reset the quantization parameter, a target coding unit among the multiple coding units may be determined first, that is, before resetting the encoding states of the multiple coding units and the quantization parameter of the target coding unit in the serial encoding manner, the following steps may also be included:
[0119] Perform residual data recognition on multiple coding units to obtain recognition results;
[0120] According to the recognition result, a target coding unit is screened out from the plurality of coding units, wherein the target coding unit does not include residual data.
[0121] It should be noted that the recognition result may be that the coding unit includes residual data, or may be that the coding unit does not include residual data. According to the recognition result, the coding unit that does not include residual data may 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 be encoded, and no prediction error needs to be written into the bitstream, that is, the prediction error of the target coding unit is zero, and the quantization parameter of the target coding unit can be determined based on the predicted quantization parameter.
[0123] By applying the scheme of the embodiments of this specification, residual data is identified for multiple coding units to obtain identification results; based on the identification results, a target coding unit is screened out from the multiple coding units, wherein the target coding unit does not include residual data, thereby ensuring the accuracy of the target coding unit and further ensuring the accuracy of the reset.
[0124] In an optional embodiment of the present specification, the above-mentioned resetting the encoding states of multiple encoding units and the quantization parameters of the target encoding unit in the serial encoding manner 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 encoded, wherein the first reference coding unit is an adjacent coding unit of the current target coding unit;
[0126] The encoding states of the plurality of encoding units are reset according to the reference encoding state of the first reference encoding unit, and the quantization parameter of the current target encoding unit is reset according to the reference quantization parameter of the first reference encoding unit.
[0127] It should be noted that the method of selecting the first reference coding unit is the same as the method of selecting the second reference coding unit described above, and will not be described in detail in the embodiments of this specification. In addition, the embodiments of this specification do not limit the order of resetting the coding states of multiple coding units according to the reference coding state of the first reference coding unit, and resetting the quantization parameter of the current target coding unit according to the reference quantization parameter of the first reference coding unit.
[0128] In practical applications, since the final bitstream does not use wavefront parallel processing technology, the encoding states of multiple encoding units can be reset in a serial encoding manner before the bitstream is finally written, so as to ensure the consistency of the encoding and decoding process.
[0129] For example, Figure 4 Taking the coding unit 40 in the example, the coding state of the coding unit 40 determined by parallel coding is the coding state of the coding unit 21. According to the serial coding method, the coding state when the coding unit 39 is encoded can be reset to the coding state of the coding unit 40.
[0130] By applying the scheme of the embodiments of the present specification, for the current target coding unit, a first reference coding unit is screened out from the coding units that have completed encoding, wherein the first reference coding unit is an adjacent coding unit of the current target coding unit; according to the reference encoding state of the first reference coding unit, the encoding states of multiple coding units are 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 the use of parallel decoding.
[0131] In an optional embodiment of the present specification, since the final code stream does not use the wavefront parallel processing technology, the quantization parameter used in filtering should be a quantization parameter derived according to the serial coding method, so as to ensure the consistency of the encoding and decoding process, that is, 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 is located on the left side of the current target coding unit, and the second coding unit is adjacent to the current target coding unit and is located above the current target coding unit; the above-mentioned resetting the quantization parameter of the current target coding unit according to the reference quantization parameter of the first reference coding unit may include the following steps:
[0132] Parsing the quantization parameter of the current target coding unit, and determining the preset quantization parameter 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 by parallel encoding, if the quantization parameters are not reset, the quantization parameters used in subsequent filtering are the quantization parameters obtained by parallel encoding, and during decoding, filtering will still be performed according to the quantization parameters derived by serial encoding. This will cause inconsistency in encoding and decoding and affect the compression performance. If the quantization parameters are reset according to the serial encoding method, the quantization parameters used in subsequent filtering are the correct quantization parameters obtained by non-parallel encoding.
[0135] By applying the solution of the embodiment of this specification, the quantization parameter of the current target coding unit is parsed to determine the preset quantization parameter and the third quantization parameter; the preset quantization parameter is replaced by the first quantization parameter of the first coding unit, and the third quantization parameter is replaced by the second quantization parameter of the second coding unit to determine the reset quantization parameter. The consistency of the encoding and decoding process is ensured, the correlation between the coding units is taken into account, and the compression performance loss caused by the parallel encoding method is reduced.
[0136] In an optional embodiment of the present specification, the first reference coding unit includes a first coding unit, the first coding unit is adjacent to the current target coding unit and is located on the left side of the current target coding unit; the above-mentioned screening out the first reference coding unit from the coding units that have been encoded may include the following steps:
[0137] When there is no first coding unit in the coding units that have been encoded, a replacement coding unit is selected from the coding units that have been encoded, and the replacement coding unit is used as the first coding unit, wherein the replacement coding unit is the last coding unit in a row before the current target coding unit.
[0138] It should be noted that since the first coding unit in each coding row does not have a coding unit located on its left, when the first reference coding unit is screened out from the coding units that have been completely encoded, there may be a situation where the first coding unit does not exist in the coding units that have been completely encoded. In this case, a replacement coding unit can be screened out from the coding units that have been completely encoded and used as the first coding unit.
[0139] For example, Figure 4 Taking the coding unit 40 in the example, the coding unit 40 is a skip mode coding unit, and its coding block flag is zero. During parallel coding, the quantization parameter of the coding unit 40 can be determined based on the preset quantization parameter and the third quantization parameter of the third coding unit of the coding unit 40, and can be specifically calculated by the following formula (3):
[0140] QP WPP =(slice QP+aboveCU QP) / 2 (3)
[0141] Among them, QP WPP is the quantization parameter of the 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 coding method, the replacement coding unit corresponding to the coding unit 40 is the coding unit 39. The quantization parameter of the coding unit 40 can be determined based on the replacement quantization parameter of the replacement coding unit and the second quantization parameter of the second coding unit of the coding unit 40. Specifically, it can be calculated by the following formula (4):
[0143] QP nowpp =(replaceCU QP+aboveCU QP) / 2 (4)
[0144] Among them, QP nowpp is the quantization parameter after the coding unit 40 is reset, replaceCU QP 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] By applying the solution of the embodiment of this specification, when the first coding unit does not exist in the coding units that have been encoded, a replacement coding unit is selected from the coding units that have been encoded, and the replacement coding unit is used as the first coding unit, wherein the replacement coding unit is the last coding unit in the previous row of the current target coding unit. The quantization parameter and the encoding state are adjusted by the serial encoding method, thereby avoiding the problem of mismatch between encoding and decoding caused by the parallel decoding method.
[0146] Step 308: Determine the image encoding result according to the reset encoding state and processing result.
[0147] In one or more embodiments of the present specification, an image to be encoded is obtained; multiple coding units in the image to be encoded are encoded in parallel, and quantization parameters and encoding states of the multiple coding units are determined; in a serial encoding manner, the encoding states of the multiple coding units and the quantization parameters of the target coding units are reset, and the target coding units are filtered using the reset quantization parameters. After obtaining the processing results, the image encoding results can be further determined based on the reset encoding states and the processing results.
[0148] It should be noted that, according to the reset encoding state and processing result, the image to be encoded can be converted into an image file of another format, that is, the image encoding result. Image encoding can remove redundant information in the image to be encoded, reduce the size of the image file, and maintain image quality.
[0149] The scheme of the embodiments of this specification is applied to accelerate the encoder by utilizing the wavefront parallel processing idea to ensure the encoding speed, and to adjust the quantization parameters and encoding status through serial encoding, so as to fully exploit the correlation between encoding units and reduce the compression performance loss caused by the parallel encoding method.
[0150] In practical applications, compared with serial coding, parallel coding can achieve 3.65 times encoder acceleration, that is, the number of frames per second (FPS) transmitted by encoding is 3.65 times that of serial coding; the bit rate of parallel coding is 2.34% higher than that of serial coding at the same peak signal-to-noise ratio (PSNR) quality; the bit rate of parallel coding is 2.59% higher than that of serial coding at the same structural similarity index (SSIM) quality.
[0151] The image coding method proposed in the embodiment of this specification can have a coding speed of 3.65 times that of serial coding, which is equivalent to the coding speed of parallel coding, and only consumes 0.51% more bit rate than serial coding under the same peak signal-to-noise ratio and structural similarity index quality. Therefore, the image coding method proposed in the embodiment of this specification can ensure the coding speed and reduce the compression performance loss caused by the parallel coding method.
[0152] See also Figure 5 , Figure 5 A flowchart of an image decoding method provided by an embodiment of the present specification is shown, which specifically includes the following steps:
[0153] Step 502: Obtain image encoding results.
[0154] The image encoding result is as follows: Figure 3 The image encoding method shown is obtained;
[0155] Step 504: Analyze the image encoding result and determine the encoding state and quantization parameter.
[0156] Step 506: Determine the image decoding result according to the encoding state and the quantization parameter.
[0157] It should be noted that image decoding refers to the process of restoring a compressed and coded image to its original state. The type, frame rate, resolution and other parameters of the image coding can be determined based on the coding state and quantization parameters. These parameters can be used to decode the compressed image coding result to generate an image decoding result.
[0158] Specifically, the compressed image encoding result can be input into the decoder, and the decoder restores the compressed encoded image into a decoded image to obtain an image decoding result. It should be noted that before the compressed image encoding result is input 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 coding state and quantization parameter are obtained by resetting the quantization parameter and coding state obtained by parallel coding in a serial coding manner, the coding and decoding quality can be guaranteed by using a traditional image decoding method to determine the image decoding result.
[0160] The solution of the embodiments of this specification is applied to avoid the problem of mismatch between encoding and decoding caused by the quantization parameters and encoding states determined by the parallel encoding method during encoding and the quantization parameters and encoding states determined by the serial encoding method during decoding. On the basis of ensuring the encoding speed, the compression performance loss caused by the parallel encoding method is reduced without reducing the encoding quality.
[0161] Corresponding to the above method embodiment, this specification also provides an image encoding device embodiment, Figure 6 FIG. 2 shows a schematic diagram of the structure of an image encoding device provided by an embodiment of the present specification. Figure 6 As shown, the device comprises:
[0162] A first acquisition module 602 is configured to acquire an image to be encoded;
[0163] An encoding module 604 is configured to perform parallel encoding on multiple coding units in the image to be encoded, and determine quantization parameters and encoding states of the multiple coding units;
[0164] The resetting module 606 is configured to reset the encoding states of the plurality of encoding units and the quantization parameter of the target encoding unit in a serial encoding manner, and perform filtering processing on the target encoding unit using the reset quantization parameter to obtain a processing result, wherein the quantization prediction accuracy of the target encoding unit reaches a preset accuracy;
[0165] The first determination module 608 is configured to determine the image encoding result according to the reset encoding state and the processing result.
[0166] Optionally, the reset module 606 is further configured to filter out a first reference coding unit from the coding units that have completed encoding for the current target coding unit, wherein the first reference coding unit is an adjacent coding unit of the current target coding unit; reset the encoding states of multiple coding units according to the reference encoding 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 on the left side of the current target coding unit; the reset module 606 is further configured to, when the first coding unit does not exist in the coding unit that has been encoded, filter out a replacement coding unit from the coding unit that has been encoded, and use the replacement coding unit as the first coding unit, wherein the replacement coding unit is the last coding unit in the previous row of 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 the current target coding unit and is located on the left side of the current target coding unit, and the second coding unit is adjacent to the current target coding unit and is located above the current target coding unit; the reset module 606 is further configured to parse the quantization parameter of the current target coding unit, determine the preset quantization parameter and the third quantization parameter; replace the preset quantization parameter with the first quantization parameter of the first coding unit, and replace the third quantization parameter with the second quantization parameter of the second coding unit to determine the reset quantization parameter.
[0169] Optionally, the device further includes: an identification module configured to perform residual data identification on multiple coding units to obtain an identification result; and based on the identification result, screen out a target coding unit from the multiple coding units, wherein the target coding unit does not include residual data.
[0170] Optionally, the encoding module 604 is further configured to obtain completion status information of a specified encoding unit for a current encoding line, wherein the specified encoding unit is the first two encoding units of a line before the current encoding line; when the completion status information indicates that encoding is completed, encode the current encoding line and determine quantization parameters and encoding status of multiple encoding units.
[0171] Optionally, the encoding module 604 is further configured to obtain a specified encoding state of a specified encoding unit for the current encoding unit, and determine the encoding state of the current encoding unit based on the specified encoding state; determine the predicted quantization parameter of the current encoding unit according to the quantization parameter of the encoding unit that has been completed; and determine the quantization parameter of the current encoding unit according to the prediction error and the predicted quantization parameter.
[0172] Optionally, the encoding module 604 is further configured to select a second reference encoding unit from the encoded encoding units, wherein the second reference encoding unit is an adjacent encoding unit of the current encoding unit; and determine the predicted quantization parameter of the current encoding unit according to the reference quantization parameter 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 the current coding unit and located above the current coding unit, and the fourth coding unit is adjacent to the current coding unit and located on the left side of the current coding unit; the coding module 604 is further configured to filter out the third coding unit from the coding units that have been encoded if the fourth coding unit does not exist in the coding units that have been encoded; determine the predicted quantization parameter of the current coding unit based on the preset quantization parameter and the third quantization parameter of the third coding unit.
[0174] Optionally, the device further includes: a segmentation module configured to segment the image to be encoded and determine a plurality of encoding units in the image to be encoded.
[0175] Optionally, the first acquisition module 602 is further configured to acquire a video to be encoded; and extract an image to be encoded from the video to be encoded.
[0176] The scheme of the embodiment of the present specification is applied to ensure the encoding speed through parallel encoding, and to adjust the quantization parameter and the encoding state through serial encoding, taking into account the correlation between the encoding units, and reducing the compression performance loss caused by the parallel encoding. In addition, by adjusting the quantization parameter and the encoding state through serial encoding, the problem of mismatch between encoding and decoding caused by the parallel decoding method is avoided.
[0177] The above is a schematic scheme of an image coding device of this embodiment. It should be noted that the technical scheme of the image coding device and the technical scheme of the above-mentioned image coding method belong to the same concept, and the details not described in detail in the technical scheme of the image coding device can be referred to the description of the technical scheme of the above-mentioned image coding method.
[0178] Corresponding to the above method embodiment, this specification also provides an image decoding device embodiment, Figure 7 FIG. 2 shows a schematic diagram of the structure of an image decoding device provided by an embodiment of the present specification. Figure 7 As shown, the device comprises:
[0179] The second acquisition module 702 is configured to acquire an image encoding result, wherein the image encoding result is obtained by the above-mentioned image encoding method;
[0180] The parsing module 704 is configured to parse the image encoding result and determine the encoding state and quantization parameter;
[0181] The second determination module 706 is configured to determine the image decoding result according to the encoding state and the quantization parameter.
[0182] By applying the scheme of the embodiments of this specification, since the coding state and quantization parameters are obtained by resetting the quantization parameters and coding state obtained by parallel coding in a serial coding manner, the problem of mismatch between encoding and decoding caused by using the quantization parameters and coding state determined by the parallel coding manner during encoding and the quantization parameters and coding state determined by the serial coding manner during decoding is avoided, and the compression performance loss caused by the parallel coding manner is reduced while ensuring the coding speed.
[0183] The above is a schematic scheme of an image decoding device of this embodiment. It should be noted that the technical scheme of the image decoding device and the technical scheme of the above-mentioned image decoding method belong to the same concept, and the details not described in detail in the technical scheme of the image decoding device can be referred to the description of the technical scheme of the above-mentioned image decoding method.
[0184] Figure 8 The structure block diagram of a computing device provided by an embodiment of the present specification is shown. 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 the database 850 is used to store data.
[0185] The computing device 800 also includes an access device 840 that enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0186] In one embodiment of the present specification, the above components of the computing device 800 and Figure 8 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 8 The computing device structure block diagram shown is only for the purpose of illustration, 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 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 800 may also be a mobile or stationary server.
[0188] The processor 820 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned image encoding method or image decoding method.
[0189] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned image encoding method and image decoding method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned image encoding method or image decoding method.
[0190] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned image encoding method or image decoding method.
[0191] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned image encoding method and image decoding method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned image encoding method or image decoding method.
[0192] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image encoding method or image decoding method.
[0193] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above-mentioned image encoding method and image decoding method belong to the same concept, and the details not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the above-mentioned image encoding method or image decoding method.
[0194] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0195] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0196] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0197] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0198] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. An image encoding method, comprising: Obtaining an image to be encoded; Performing parallel encoding on a plurality of encoding units in the to-be-encoded image, and determining quantization parameters and encoding states of the plurality of encoding units; Resetting the encoding states of the plurality of encoding units and the quantization parameter of the target encoding unit in a serial encoding manner, and performing filtering processing on the target encoding unit using the reset quantization parameter to obtain a processing result, wherein the quantization prediction accuracy of the target encoding unit reaches a preset accuracy; The image encoding result is determined according to the reset encoding state and the processing result.
2. The method according to claim 1, wherein resetting the encoding states of the plurality of encoding units and the quantization parameter of the target encoding unit in a serial encoding manner comprises: For a 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; The encoding states of the plurality of encoding units are reset according to a reference encoding state of the first reference encoding unit, and the quantization parameter of the current target encoding unit is reset according to a reference quantization parameter of the first reference encoding unit.
3. The method according to claim 2, wherein the first reference coding unit comprises a first coding unit, and the first coding unit is adjacent to the current target coding unit and is located on the left side of the current target coding unit; The step of selecting a first reference coding unit from the coding units that have been coded includes: In the case that the first coding unit does not exist in the coding units that have been encoded, a replacement coding unit is screened out from the coding units that have been encoded, and the replacement coding unit is used as the first coding unit, wherein the replacement coding unit is the last coding unit of the previous row of the current target coding unit.
4. The method according to claim 2, wherein the first reference coding unit comprises a first coding unit and a second coding unit, the first coding unit is adjacent to the current target coding unit and is located on the left side of the current target coding unit, and the second coding unit is adjacent to the current target coding unit and is located above the current target coding unit; The resetting the quantization parameter of the current target coding unit according to the reference quantization parameter of the first reference coding unit includes: Parsing the quantization parameter of the current target coding unit to determine a preset quantization parameter and a third quantization parameter; 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 a reset quantization parameter.
5. The method according to claim 1, before resetting the encoding states of the plurality of encoding units and the quantization parameters of the target encoding unit in a serial encoding manner, further comprising: Performing residual data recognition on the multiple coding units to obtain recognition results; According to the recognition result, a target coding unit is screened out from the multiple coding units, wherein the target coding unit does not include residual data.
6. The method according to claim 1, wherein the step of encoding the plurality of coding units in the to-be-encoded image in parallel and determining the quantization parameters and encoding states of the plurality of coding units comprises: For a current coding line, obtaining completion status information of a specified coding unit, wherein the specified coding unit is the first two coding units of a line before the current coding line; When the completion status information indicates that encoding is completed, the current encoding line is encoded, and quantization parameters and encoding states of the multiple encoding units are determined.
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 comprises: For a current coding unit, obtaining a specified coding state of the specified coding unit, and determining a coding state of the current coding unit based on the specified coding state; Determining a predicted quantization parameter of the current coding unit according to a quantization parameter of a coding unit that has been encoded; A quantization parameter of the current coding unit is determined according to the prediction error and the predicted quantization parameter.
8. The method according to claim 7, wherein determining the predicted quantization parameter of the current coding unit according to the quantization parameter of the coding unit that has been encoded comprises: Filter out a second reference coding unit from the encoded coding units, wherein the second reference coding unit is an adjacent coding unit of the current coding unit; Determine a predicted quantization parameter of the current coding unit according to the reference quantization parameter of the second reference coding unit.
9. The method according to claim 8, wherein the second reference coding unit comprises a third coding unit and a fourth coding unit, wherein the third coding unit is adjacent to the current coding unit and located above the current coding unit, and the fourth coding unit is adjacent to the current coding unit and located on the left side of the current coding unit; The step of selecting a second reference coding unit from the coding units that have completed coding includes: In a case where the fourth coding unit does not exist in the coding units that have been encoded, selecting the third coding unit from the coding units that have been encoded; The determining, according to the reference quantization parameter of the second reference coding unit, the predicted quantization parameter of the current coding unit comprises: The predicted quantization parameter of the current coding unit is determined according to the preset quantization parameter and the third quantization parameter of the third coding unit.
10. The method according to claim 1, before performing parallel encoding on the multiple coding units in the to-be-encoded image and determining the quantization parameters and encoding states of the multiple coding units, further comprising: The to-be-encoded image is segmented to determine a plurality of encoding units in the to-be-encoded image.
11. The method according to claim 1, wherein obtaining the image to be encoded comprises: Get the video to be encoded; The to-be-encoded image is extracted from the to-be-encoded video.
12. An image decoding method, comprising: Obtaining an image coding result, wherein the image coding result is obtained by the image coding method according to any one of claims 1 to 11; Analyzing the image encoding result to determine the encoding state and quantization parameters; An image decoding result is determined according to the encoding state and the quantization parameter.
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. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 11 or claim 12 are implemented.
14. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 11 or claim 12.
Citation Information
Patent Citations
Video compression method and device, computer equipment and storage medium
CN116112683A
Coding parameter transmission method and device, equipment, storage medium and program product
CN116527909A
Image decoding device, image decoding method, and program
JP2021106345A
Method and apparatus for hierarchical data unit-based video encoding and decoding comprising quantization parameter prediction
US20140341276A1
Data encoding and decoding
US20160142740A1