Multimedia data encoding method, apparatus, device, and medium

By obtaining the candidate quantization state chain of the transform block in multimedia data encoding and utilizing pre-configured model identifiers and context modeling, the problem of slow rate distortion loss calculation in dependent scalar quantization is solved, and faster rate distortion loss optimization is achieved.

CN115706797BActive Publication Date: 2026-02-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110898283.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-05
Publication Date
2026-02-10
Estimated Expiration
2041-08-05

AI Technical Summary

Technical Problem

Dependency scalar quantization in multimedia data encoding requires significant computational overhead when calculating rate distortion loss, resulting in excessively low speed.

Method used

By acquiring candidate quantization state chains of transform blocks in multimedia data, and utilizing pre-configured model identifiers and context modeling, the computational cost of context modeling is reduced, thus optimizing the computational speed of rate distortion loss.

Benefits of technology

This reduces the computational overhead of rate distortion loss and improves the optimization speed of rate distortion loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115706797B_ABST
    Figure CN115706797B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a multimedia data encoding method, device, equipment and medium, comprising: obtaining M candidate quantization state chains of a transform block in multimedia data; obtaining N syntax elements corresponding to a transform coefficient i in the transform block, obtaining fixed probability models corresponding to K syntax elements based on preconfigured model identifiers corresponding to the K syntax elements, K being less than N; performing context modeling for (N-K) syntax elements according to adjacent coded coefficients corresponding to the transform coefficient i, to obtain target probability models of the (N-K) syntax elements; determining a coefficient rate-distortion loss of the transform coefficient i according to the fixed probability models, the target probability models and a quantized reconstructed value of the transform coefficient i; and determining path rate-distortion losses corresponding to the M candidate quantization state chains respectively according to coefficient rate-distortion losses corresponding to each transform coefficient respectively. By using the present application, context modeling can be reduced, and the optimization speed of rate-distortion loss can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multimedia encoding and decoding technology, and in particular to a multimedia data encoding method, apparatus, device, and medium. Background Technology

[0002] Quantization is a core process in multimedia data (e.g., video, audio, images) encoding technology. Dependent scalar quantization (DQ), as a quantization method in multimedia data encoding, can achieve compression processing of multimedia data to improve encoding efficiency. However, when calculating rate distortion loss, dependent scalar quantization requires a large amount of computational overhead to perform context modeling, resulting in excessively slow rate distortion loss calculation speed. Summary of the Invention

[0003] This application provides a multimedia data encoding method, apparatus, device, and medium that can reduce context modeling and improve the optimization speed of rate distortion loss.

[0004] One embodiment of this application provides a multimedia data encoding method, including:

[0005] Obtain the M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0006] Obtain the N syntax elements corresponding to the transform coefficient i in the transform block. Based on the pre-configured model identifiers corresponding to the K syntax elements among the N syntax elements, obtain the fixed probability models corresponding to the K syntax elements respectively. i is a positive integer less than or equal to the number of coefficients contained in the transform block. N and K are both positive integers, and K is less than N.

[0007] Based on the adjacent coding coefficients corresponding to the transform coefficient i, context modeling is performed for (NK) syntax elements to obtain the target probability models corresponding to (NK) syntax elements respectively.

[0008] Based on the precoding results of the fixed probability model for K syntax elements, the precoding results of the target probability model for (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i, determine the coefficient rate distortion loss corresponding to the transform coefficient i.

[0009] Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, determine the path rate-distortion loss corresponding to each of the M candidate quantization state chains.

[0010] One embodiment of this application provides a multimedia data encoding method, including:

[0011] Obtain the M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0012] Obtain the N syntax elements corresponding to the transform coefficient i in the transform block, and obtain the fixed probability model corresponding to each of the N syntax elements based on the pre-configured model identifiers corresponding to the N syntax elements; i is a positive integer less than or equal to the number of coefficients contained in the transform block, and N is a positive integer;

[0013] Based on the pre-encoding results of N syntax elements using the fixed probability model and the quantization reconstruction values ​​corresponding to transform coefficient i, determine the coefficient rate distortion loss corresponding to transform coefficient i.

[0014] Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, determine the path rate-distortion loss corresponding to each of the M candidate quantization state chains.

[0015] One embodiment of this application provides a multimedia data encoding apparatus, including:

[0016] The first acquisition module is used to acquire M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0017] The second acquisition module is used to acquire the N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to the K syntax elements among the N syntax elements, acquire the fixed probability models corresponding to the K syntax elements respectively; i is a positive integer less than or equal to the number of coefficients contained in the transform block, N and K are both positive integers, and K is less than N;

[0018] The context modeling module is used to perform context modeling for (NK) syntax elements based on the adjacent coding coefficients corresponding to the transform coefficient i, and obtain the target probability models corresponding to (NK) syntax elements respectively.

[0019] The first determining module is used to determine the coefficient rate distortion loss corresponding to the transform coefficient i based on the pre-encoding results of the fixed probability model for K syntax elements, the pre-encoding results of the target probability model for (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i.

[0020] The second determining module is used to determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

[0021] Multimedia data includes video frame images;

[0022] The device also includes:

[0023] The region division module is used to acquire video frame images and divide the video frame images according to the unit allocation information corresponding to the video frame images to obtain at least two pixel regions.

[0024] The transform block selection module is used to determine transform blocks from at least two pixel regions according to the encoding order between at least two pixel regions.

[0025] The first acquisition module includes:

[0026] The coefficient quantization unit is used to obtain the transform coefficient i and transform coefficient (i+1) contained in the transform block of multimedia data, and to obtain the quantized value of transform coefficient i in T quantization states according to the first quantizer and the second quantizer; the first quantizer and the second quantizer each include T / 2 quantization states, where T is a positive integer greater than 1;

[0027] The quantization state determination unit is used to determine the subsequent quantization state corresponding to the quantization state of the transform coefficient i based on the parity of the quantization value in the quantization state of the transform coefficient i, and to determine the subsequent quantization state as the quantization state of the transform coefficient (i+1); the subsequent quantization state belongs to T quantization states.

[0028] The state chain generation unit is used to generate M candidate quantization state chains corresponding to the transform block based on the quantization state of transform coefficient i and the quantization state of transform coefficient (i+1).

[0029] The second acquisition module includes:

[0030] The syntax element acquisition unit is used to acquire N syntax elements corresponding to the transform coefficients i in the transform block, and to acquire K syntax elements carrying pre-configured model identifiers from the N syntax elements.

[0031] The fixed probability model determination unit is used to obtain the first probability model set corresponding to K syntax elements under the T quantization states corresponding to the transformation coefficient i. In the first probability model set, the probability model that matches the pre-configured model identifier is determined as the fixed probability model corresponding to the K syntax elements respectively; T is a positive integer greater than 1.

[0032] The context modeling module includes:

[0033] The adjacent coefficient acquisition unit is used to acquire the adjacent coding coefficients of transform coefficient i in the target quantization state in multimedia data, and to acquire (NK) encoded syntax elements in the adjacent coding coefficients; the target quantization state belongs to T quantization states, where T is a positive integer greater than 1;

[0034] The probability model set acquisition unit is used to acquire the second probability model set corresponding to the (NK) syntax elements of the transformation coefficient i under the target quantization state.

[0035] The probability model allocation unit is used to allocate a target probability model to the (NK) syntax elements of the transform coefficient i from the second probability model set based on the (NK) encoded syntax elements corresponding to adjacent encoded coefficients.

[0036] The probability model allocation unit includes:

[0037] The reconstructed numerical statistics subunit is used to obtain the absolute value of the encoding reconstruction in the adjacent encoding coefficients based on the (NK) encoded syntax elements corresponding to the adjacent encoding coefficients, and to obtain the global reconstruction cumulative value and the local reconstruction cumulative value corresponding to the adjacent encoding coefficients based on the absolute value of the encoding reconstruction.

[0038] The diagonal position determination sub-unit is used to obtain the number of non-zero values ​​in the transform block, obtain the horizontal and vertical coordinates of the transform coefficient i in the transform block, and determine the diagonal position corresponding to the transform coefficient i by the sum of the horizontal and vertical coordinates.

[0039] The target probability model determination subunit is used to assign the target probability model to the (NK) grammatical elements of the transformation coefficient i from the second probability model set based on the global reconstruction cumulative value, the local reconstruction cumulative value, the number of non-zero values, and the diagonal position.

[0040] The first determining module includes:

[0041] The rate loss acquisition unit is used to acquire the rate loss of transform coefficient i in T quantization states based on the precoding results of K syntax elements by the fixed probability model and the precoding results of (NK) syntax elements by the target probability model; T is a positive integer greater than 1.

[0042] The distortion loss acquisition unit is used to acquire the quantized reconstruction value corresponding to the transform coefficient i through the first quantizer and the second quantizer, and determine the distortion loss of the transform coefficient i in T quantization states based on the transform coefficient i and the quantized reconstruction value.

[0043] The rate-distortion loss determination unit is used to determine the coefficient rate-distortion loss of transform coefficient i in T quantization states based on the distortion loss and the bit rate loss.

[0044] The bit rate loss acquisition unit includes:

[0045] The first precoding subunit is used to precode the K syntax elements of the transform coefficient i in T quantization states according to the fixed probability model, and obtain the precoding results corresponding to the K syntax elements respectively.

[0046] The second precoding subunit is used to precode (NK) syntax elements of the transform coefficient i in T quantization states according to the target probability model, and obtain the precoding results corresponding to (NK) syntax elements respectively.

[0047] The rate loss calculation subunit is used to obtain the rate loss of transform coefficient i in T quantization states based on the precoding results corresponding to K syntax elements and (NK) syntax elements.

[0048] Specifically, the second determining module is used for:

[0049] Obtain the coefficient rate distortion loss corresponding to each transform coefficient in the transform block. For each of the M candidate quantized state chains, accumulate the coefficient rate distortion loss associated with each candidate quantized state chain to obtain the path rate distortion loss corresponding to each of the M candidate quantized state chains.

[0050] The device also includes:

[0051] The quantization state chain optimization module is used to determine the candidate quantization state chain corresponding to the minimum path rate distortion loss as the target quantization state chain of the transform block.

[0052] The coefficient quantization value acquisition module is used to traverse the transformation coefficients contained in the transformation block according to the target quantization state chain and obtain the coefficient quantization value corresponding to each transformation coefficient in the transformation block.

[0053] The encoding processing module is used to perform entropy encoding on the coefficient quantization values ​​to obtain the encoded bit stream corresponding to the transform block, and output the encoded bit stream to the decoding end.

[0054] One embodiment of this application provides a multimedia data encoding apparatus, including:

[0055] The third acquisition module is used to acquire M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0056] The fourth acquisition module is used to acquire the N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to the N syntax elements, acquire the fixed probability models corresponding to the N syntax elements respectively; i is a positive integer less than or equal to the number of coefficients contained in the transform block, and N is a positive integer;

[0057] The third determination module is used to determine the coefficient rate distortion loss corresponding to the transform coefficient i based on the pre-encoding results of N syntax elements in the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i.

[0058] The fourth determination module is used to determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

[0059] One aspect of this application provides a computer device, including a memory and a processor. The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method provided in one aspect of this application.

[0060] One aspect of this application provides a computer-readable storage medium storing a computer program adapted to be loaded and executed by a processor, so that a computer device having a processor performs the method provided in one aspect of this application.

[0061] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in the above aspect.

[0062] This application embodiment can obtain M candidate quantization state chains corresponding to a transform block in multimedia data, wherein the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer; that is, in the encoding process of multimedia data, a transform block in multimedia data can correspond to multiple candidate quantization state chains. For transform coefficient i in the transform block of multimedia data, N syntax elements used to describe the transform coefficient i can be obtained. The N syntax elements can include K syntax elements carrying pre-configured model identifiers. The probability models of the K syntax elements can be fixed, and the fixed probability models corresponding to the K syntax elements can be obtained directly based on the pre-configured model identifiers. For the remaining (NK) syntax elements, context modeling can be performed on the (NK) syntax elements using the adjacent coding coefficients of transform coefficient i, resulting in target probability models corresponding to each (NK) syntax element, which reduces context modeling. Furthermore, the coefficient rate-distortion loss corresponding to transform coefficient i can be determined using the fixed probability model, the target probability model, and the quantization reconstruction value corresponding to transform coefficient i. Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to each of the M candidate quantization states can be statistically analyzed. By reducing context modeling, the computational overhead of coefficient rate-distortion loss can be reduced, thereby improving the optimization speed of rate-distortion loss. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0064] Figure 1 This is a schematic diagram of the structure of an encoding system provided in an embodiment of this application;

[0065] Figure 2 This is a flowchart illustrating a multimedia data encoding method provided in an embodiment of this application;

[0066] Figure 3 This is a schematic diagram of the quantization rules for two scalar quantizers provided in an embodiment of this application;

[0067] Figure 4 This is a schematic diagram illustrating the quantization state transition process between two scalar quantizers provided in an embodiment of this application;

[0068] Figure 5 This is a schematic diagram of a chain of M candidate quantized states provided in an embodiment of this application;

[0069] Figure 6 This is a schematic diagram of context modeling provided in an embodiment of this application;

[0070] Figure 7 This is a flowchart illustrating a multimedia data encoding method provided in an embodiment of this application;

[0071] Figure 8 This is a schematic diagram of the structure of a multimedia data encoding device provided in an embodiment of this application;

[0072] Figure 9 This is a schematic diagram of the structure of a multimedia data encoding device provided in an embodiment of this application;

[0073] Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0074] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0075] This application involves the following related technical terms:

[0076] Versatile Video Coding (VVC): VVC is a next-generation video coding standard. It employs a block-based hybrid coding framework, integrating intra-frame and inter-frame prediction, transform, quantization, and entropy coding modules. Intra-frame prediction is a spatial domain compression algorithm that uses reconstructed pixels around the current block to predict its position, removing spatial redundancy between adjacent blocks and achieving more efficient compression. Inter-frame prediction is a temporal domain compression algorithm that utilizes the correlation between video image frames, i.e., temporal correlation, to achieve image compression. To encode a video sequence containing one or more images, an image can be divided into one or more slices, each slice potentially containing one or more segments. Optionally, a segment can be a coding unit (CU), a prediction unit (PU), and a transform unit (TU). The coding unit is the basic unit for performing prediction, transform, quantization, and entropy coding. The prediction unit is the basic unit for intra-frame and inter-frame prediction. The transform block is the basic unit for transforming and quantizing. The separation of these three units makes the various processing stages, such as prediction, transform, and coding, more flexible and makes the division of each stage more consistent with the texture characteristics of the video image, ensuring optimal coding performance. Optionally, the term "block" in this embodiment can refer to a pixel region in an image, such as the color component Y (luminance), or it can refer to any one of, for example, a coding unit, a prediction unit, a transform unit, a coefficient group, a coding block, a prediction block, and a transform block. Furthermore, "block" can also refer to macroblocks and segments specified in VVC or other video coding methods, and more generally, it can refer to data arrays of various sizes.

[0077] Quantization: Multimedia data (e.g., video, audio, and images) often contains a large amount of redundant information. Therefore, before transmitting multimedia data, it needs to be encoded to remove redundant information in spatial and temporal dimensions, thereby improving transmission efficiency. Quantization is the core process in multimedia data encoding, and improving quantization efficiency can bring significant performance gains to multimedia data encoding tasks. In the field of digital signal processing, quantization refers to the process of approximating a continuous value (or a large number of possible discrete values) of a signal to a finite number (or a small number) of discrete values. For example, mapping a single sample in a signal to a fixed value forms a many-to-few mapping, thereby achieving compression. Quantization can be divided into encoding-side quantization and decoding-side quantization. Decoding-side quantization can be called dequantization, and the dequantization process on the decoding side can be understood as the reconstruction process corresponding to encoding-side quantization.

[0078] Dependency-based scalar quantization: VVC's quantization module employs a new technique: dependency-based scalar quantization. Dependency-based scalar quantization refers to the fact that a set of permissible reconstructed values ​​of transform coefficients in multimedia data depends on the values ​​of transform coefficient levels preceding the current transform coefficient level in the reconstruction order. Compared to independent scalar quantization, dependency-based scalar quantization allows the reconstructed vector to be more densely packed in an X-dimensional vector space (where X represents the number of transform coefficients contained in the transform block, and X can be a positive integer), thus reducing the average distortion between the current input vector and nearby reconstructed vectors. To implement dependency-based scalar quantization, multiple scalar quantizers with different reconstruction levels can be defined, as well as the conversion methods between these scalar quantizers. The number of scalar quantizers can be determined according to actual needs; for ease of description, the following description uses two scalar quantizers as an example.

[0079] Entropy coding: The quantized transform coefficients can be entropy-coded to output a bitstream. In one or more embodiments, Context-based Adaptive Binary Arithmetic Coding (CABAC) can be used to encode the syntax elements of the quantized transform coefficients into the bitstream. Of course, other coding algorithms besides CABAC can also be used during entropy coding, such as Shannon coding, Huffman coding, and run-length encoding.

[0080] Please see Figure 1 , Figure 1 This is a schematic diagram of the structure of an encoding system provided in an embodiment of this application. For example... Figure 1As shown, the encoding system may include an encoding device 10a and a decoding device. The encoding device 10a may refer to a user terminal or server used for encoding multimedia data, and the decoding device may refer to a user terminal used for receiving multimedia (such as...). Figure 1 The user terminal 10f shown is an example of a network; when the encoding device 10a and the decoding device (such as the user terminal 10f) are located on different networks, the encoding device 10a and the decoding device can be connected via a communication bus and a switch, such as... Figure 1 As shown, encoding device 10a can connect to external decoding device via communication bus 10b and switch 10c. Alternatively, the network containing the decoding device can also include switch 10d and communication bus 10e, allowing the decoding device to receive multimedia data encoded by encoding device 10a via switch 10d and communication bus 10e. It is understood that the encoding device can transmit the encoded multimedia data to the decoding device via a transmission protocol, enabling the decoding device to decode the received encoded data and display the decoded multimedia data. This transmission protocol can include, but is not limited to: DASH (Dynamic Adaptive Streaming over HTTP), HLS (HTTP Live Streaming), SMTP (Smart Media Transport Protocol), and TCP (Transmission Control Protocol).

[0081] The user terminals involved in this application can be intelligent terminals with multimedia data encoding functions, such as smartphones, tablets, laptops, in-vehicle devices, desktop computers, smart speakers, and smartwatches; the servers involved in this application can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide 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 (CDN), and big data and artificial intelligence platforms. This application does not impose any restrictions on these services.

[0082] Optional, if Figure 1The encoding system shown is applied in a video-on-demand (VOD) scenario. Encoding device 10a is a server providing VOD services to the VOD application, and decoding device can be a user terminal running the VOD application. The multimedia data in this case can be the video-on-demand (VOD) video. When the user terminal initiates a VOD request to the server, the server can obtain the requested VOD video and segment one or more images contained in the VOD video into one or more slices. Then, through operations such as prediction, transformation, quantization, and entropy coding, the server can compress the VOD video into a bitstream and send it to the user terminal. After receiving the VOD video bitstream, the user terminal can decode it to obtain a reconstructed image. The user terminal can then reconstruct and play the VOD video based on the reconstructed image.

[0083] Optional, if Figure 1 The encoding system shown is applied in a video session scenario. The encoding device 10a and the decoding device can be two user terminals participating in the video session. For example, the encoding device 10a can be the first user terminal initiating the video session, and the decoding device can be the second user terminal participating in the video session. The multimedia data in this case can be the session video. The first user terminal can capture the session video and segment one or more images contained in the session video into one or more slices. Then, through operations such as prediction, transformation, quantization, and entropy coding, the session video can be compressed into a bitstream and sent to the second user terminal. After receiving the session video bitstream, the second user terminal can decode the session video bitstream to obtain a reconstructed image. The user terminal can then reconstruct and play the session video based on the reconstructed image, thus realizing a video session between the first and second user terminals.

[0084] Please see Figure 2 , Figure 2 This is a flowchart illustrating a multimedia data encoding method provided in an embodiment of this application. It can be understood that this multimedia data encoding method is executed by an encoding device in an encoding system. This encoding device can be a user terminal, a standalone server, a system consisting of a user terminal and a server, or a computer program (including program code); such as Figure 2 As shown, the multimedia data encoding method may include the following steps:

[0085] Step S101: Obtain M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer.

[0086] In one or more embodiments, the encoding device can directly acquire multimedia data from network resources, or it can acquire multimedia data by capturing real-world sound-visual scenes through a capture device. The multimedia data may include video data, audio data, image data, etc.; the capture device may refer to hardware components within the encoding device, such as microphones, cameras, and sensors when the encoding device is a user terminal; the capture device may also refer to hardware devices with a communication connection to the encoding device, including audio devices, camera devices, and sensing devices. Audio devices may include audio sensors, microphones, etc.; camera devices may include ordinary cameras, stereo cameras, light field cameras, etc.; and sensing devices may include laser devices, radar devices, etc. Optionally, there may be one or more capture devices. When there is only one capture device, it can be used to capture multimedia data content at a fixed angle in real space; when there are multiple capture devices, they can be deployed at specific locations in real space to simultaneously capture multimedia data content at different angles within that space. When multimedia data includes both video and audio data, the video and audio data captured by the capture device are synchronized in both time and space. The multimedia data content acquired by the capture device is the raw multimedia data. For ease of description, the following description uses video data containing one or more video frames as an example to illustrate the multimedia data encoding process.

[0087] Optionally, for any video frame image in multimedia data, in VVC (Video Coding Common Coding), a video frame image can be divided into multiple Coding Tree Units (CTUs). When the video frame image is a three-channel image frame, a CTU can contain coding tree blocks for different color components (e.g., in the YUV color space, it can include one luma coding tree block and two chroma coding tree blocks), and each CTU can have the same size. In VVC, a CTU can be divided into multiple Coding Units (CUs) through a quadtree structure, also called a coding tree, where the CTU can be the root of the quadtree divided into coding units. A Coding Unit can be further divided into one or more Prediction Units (TUs). The internal samples of a Prediction Unit can be predicted using the same prediction method, and the relevant prediction results can be transmitted to the decoding end in units of prediction units. After predicting the prediction units and obtaining residual information, a Coding Unit can also be further divided into several Transform Units (TUs) through a quadtree structure. It should be noted that, in addition to using the quadtree structure mentioned above to divide video frame images, other tree structures can also be used to divide video frame images, such as binary tree structure, ternary tree structure, etc.

[0088] After dividing the video frame image using the above partitioning method, we can obtain the coding tree unit, coding unit, prediction unit, and transform unit associated with the video frame image. A "unit" can include "blocks" of different color components and syntax elements. For example, a coding unit can include coding blocks of different color components, and a transform unit can include transform blocks of different color components, etc. The partitioning method described above can also be called the unit allocation information of the video frame image. After acquiring the video frame image in the multimedia data, the encoding device can partition the video frame image according to the unit allocation information corresponding to the video frame image, obtaining at least two pixel regions. Here, the pixel region can be understood as the "block" mentioned above. According to the encoding order between the at least two pixel regions, the transform block to be quantized can be determined from the at least two pixel regions.

[0089] Optionally, after determining the aforementioned transform block, the encoding device can perform quantization processing on the transform coefficients contained in the transform block using dependency scalar quantization. The multiple scalar quantizers defined to implement dependency scalar quantization may include a first quantizer Q0 and a second quantizer Q1. The encoding device can obtain the transform coefficients i and (i+1) contained in the transform block of the multimedia data. Based on the first quantizer Q0 and the second quantizer Q1, it obtains the quantized values ​​of transform coefficient i in T quantization states, where the first quantizer Q0 and the second quantizer Q1 each include T / 2 quantization states, and T is a positive integer greater than 1, such as 4 in this embodiment. Furthermore, based on the parity of the quantized values ​​in the quantization states of transform coefficient i, it determines the subsequent quantization state (also called the next quantization state) corresponding to the quantization state of transform coefficient i, and defines the subsequent quantization state as the quantization state of transform coefficient (i+1), where the subsequent quantization state belongs to T quantization states. Based on the quantization state of transform coefficient i and the quantization state of transform coefficient (i+1), M candidate quantization state chains corresponding to the transform block are generated. A transform block can include multiple transform coefficients, such as a*a transform coefficients. Transform coefficient i and transform coefficient (i+1) are transform coefficients with adjacent coding order in the transform block. The coding order of transform coefficient i is earlier than the coding order of transform coefficient (i+1), and i is a positive integer less than or equal to the number of transform coefficients. Each transform coefficient in the transform block can correspond to T quantization states. Through the T quantization states corresponding to each transform coefficient in the transform block, and the state transition between the first quantizer Q0 and the second quantizer Q1, M candidate quantization state quantities corresponding to the transform block can be generated. M can be a positive integer, such as M can take values ​​of 8, 9, 10, ...

[0090] The following will be through Figures 3 to 5 The generation process of M candidate quantization state chains is described in detail; the generation process of the M candidate quantization state chains is related to the quantization rules and state transition relationships between the two scalar quantizers defined by dependent scalar quantization.

[0091] Please see Figure 3 , Figure 3 This is a schematic diagram of the quantization rules for two scalar quantizers provided in an embodiment of this application. For example... Figure 3 As shown, the characteristics of the first quantizer Q0 and the second quantizer Q1 can be expressed as follows: the reconstructed value (also called the reconstructed level) of the first quantizer Q0 can be an even integer multiple of the quantization step size, and the reconstructed value of the second quantizer Q1 can be an odd integer multiple of the quantization step size (denoted as "Δ"). Figure 3The black dots or circles shown represent quantization states such as "A", "B", "C", and "D". The values ​​corresponding to these black dots or circles represent quantized transform coefficients (also called quantized values). The values ​​on the horizontal axis (e.g., -9, -8, 0, 8, 9, etc.) represent quantization positions. The product of any quantization position and the quantization step size represents the reconstructed value corresponding to that quantization position. For example, the quantization position of the quantized value "-2" under quantization state A is "-4", and the reconstructed value corresponding to that quantization position "-4" is "-4Δ". Quantization states A and B can be the quantization states of the first quantizer Q0, and quantization states C and D can be the quantization states of the second quantizer Q1. The reconstructed value can be understood as the reconstructed transform coefficients. The number of quantization states T can be 4; for ease of description, T=4 will be used as an example below. The quantizer corresponding to the current transform coefficient can be determined by the parity check of the quantization values ​​preceding the current transform coefficient according to the encoding / reconstruction order.

[0092] Please see Figure 4 , Figure 4 This is a schematic diagram illustrating the quantization state transition process between two scalar quantizers provided in an embodiment of this application. Figure 4 The arrows shown indicate the direction of quantization state transitions. The starting point of the arrow indicates the previous quantization state (referred to as the first quantization state), and the ending point indicates the next quantization state (referred to as the second quantization state). In other words, the quantization state transition can be from the first quantization state to the second quantization state, where the first quantization state occurs earlier than the second quantization state. It should be noted that the first and second quantization states can be the same quantization state, or they can be different quantization states. For example, if the first quantization state is quantization state A, the second quantization state after the transition can still be quantization state A; or, if the first quantization state is quantization state A, the second quantization state after the transition can be quantization state C. Figure 4 The quantization state transition process shown can be implemented according to the quantization state transition table shown in Table 1 below. The second quantization state can be determined based on the parity of the first quantization state and the quantized value (i.e., the quantized transform coefficient, which can be represented as y) in the first quantization state. For example, when "(y&1)==1" is true, it means that the quantized value y in the first quantization state is odd; when "(y&1)==0" is true, it means that the quantized value y in the first quantization state is even. Table 1 can be represented as follows:

[0093] Table 1

[0094]

[0095] Table 1 above defines the state transition conditions between the four quantization states. For example, the state transition condition from quantization state A to quantization state B is: the first quantization state is quantization state A, and the quantized value y in quantization state A satisfies (y & 1) = 0; the state transition condition from quantization state A to quantization state C is: the first quantization state is quantization state A, and the quantized value y in quantization state A satisfies (y & 1) = 1; and so on. During the quantization process of the transform block using the first quantizer Q0 and the second quantizer Q1, the four quantization states (including quantization state A, quantization state B, quantization state C, and quantization state D) can undergo quantization state transitions according to the state transition conditions defined in Table 1.

[0096] It should be noted that the quantization states A, B, C, and D mentioned above are only one representation of the four quantization states provided by the first quantizer Q0 and the second quantizer Q1. The four quantization states provided by the first quantizer Q0 and the second quantizer Q1 can also be represented as quantization state 0, quantization state 1, quantization state 2, and quantization state 3. There can be different correspondences between quantization states A, B, C, and D and quantization states 0, 1, 2, and 3. For example, one correspondence could be: quantization state A corresponds to quantization state 0, quantization state B corresponds to quantization state 1, quantization state C corresponds to quantization state 2, and quantization state D corresponds to quantization state 3; another example could be: quantization state A corresponds to quantization state 2, quantization state B corresponds to quantization state 0, quantization state C corresponds to quantization state 1, and quantization state D corresponds to quantization state 3; and so on.

[0097] Optionally, dependent scalar quantization can also be achieved through two or more scalar quantizers and the quantization state transition between the two or more scalar quantizers; of course, the number of quantization states corresponding to the two or more scalar quantizers can be more than four, and the switching between scalar quantizers can also be handled by predicting other than the state transition conditions shown in Table 1 above.

[0098] Please see Figure 5 , Figure 5 This is a schematic diagram of a chain of M candidate quantized states provided in an embodiment of this application. Figure 5Each column of black dots represents a quantization state selection for a transform coefficient. For example, the black dots in region 20a represent the four quantization state selections corresponding to transform coefficient 1 in the transform block; the black dots in region 20b represent the four quantization state selections corresponding to transform coefficient 2 in the transform block; the black dots in region 20c represent the four quantization state selections corresponding to transform coefficient 3 in the transform block; and the black dots in region 20d represent the four quantization state selections corresponding to transform coefficient 4 in the transform block. The encoding order of transform coefficients 1, 2, 3, and 4 can be represented as: transform coefficient 1 -> transform coefficient 2 -> transform coefficient 3 -> transform coefficient 4, that is, transform coefficient 2 is the next transform coefficient after transform coefficient 1, transform coefficient 3 is the next transform coefficient after transform coefficient 2, and so on. Figure 5 E0 can be associated with quantization state A path in Table 1 above, E1 can be associated with quantization state B path in Table 1 above, E2 can be associated with quantization state C path in Table 1 above, and E3 can be associated with quantization state D path in Table 1 above.

[0099] Each transform coefficient in a transform block can correspond to four quantization states. That is, black dots at the same position in each column can represent the same quantization state. For example, the first black dot in region 20a can represent quantization state A, the second black dot in region 20a can represent quantization state B, the third black dot in region 20a can represent quantization state C, and the fourth black dot in region 20a can represent quantization state D. Each quantization state can have two quantization paths to the next transform coefficient's quantization state. For example, quantization state A can transition to the next transform coefficient's quantization state A, or quantization state A can also transition to the next transform coefficient's quantization state C. Therefore, there can be eight different quantization paths from one transform coefficient to the next, such as eight different quantization paths from transform coefficient 1 to transform coefficient 2. Since a transform block contains multiple transform coefficients, according to the encoding order of the transform coefficients in the transform block, there are multiple quantization paths from the first transform coefficient to the last transform coefficient. These multiple quantization paths from the first transform coefficient to the last transform coefficient can be called the M candidate quantization state chains associated with the transform block.

[0100] Step S102: Obtain the N syntax elements corresponding to the transform coefficients i in the transform block. Based on the pre-configured model identifiers corresponding to the K syntax elements among the N syntax elements, obtain the fixed probability models corresponding to the K syntax elements respectively. i is a positive integer less than or equal to the number of coefficients contained in the transform block. N and K are both positive integers, and K is less than N.

[0101] In one or more embodiments, during the encoding phase, the encoding device can encode the quantized transform coefficients (quantized values) associated with each of the M candidate quantized state chains using a coefficient encoding method coupled with dependent scalar quantization, to calculate the path rate distortion loss corresponding to each candidate quantized state chain, and then select the optimal path rate distortion loss. When calculating the path rate distortion loss corresponding to each candidate quantized state chain, it is necessary to calculate the coefficient rate distortion loss of each transform coefficient associated with that candidate quantized state chain. The calculation process of the coefficient rate distortion loss is related to the encoding process of the transform coefficients.

[0102] For any transform coefficient i in the transform block, the encoding device can perform entropy encoding on the quantized transform coefficient i to output a bit stream. Encoding transform coefficient i requires encoding the syntax elements corresponding to that transform coefficient. For example, the encoding device can scan the transform coefficient i in the transform block and encode the N syntax elements corresponding to transform coefficient i (N can be a positive integer, such as 5). The N syntax elements can include:

[0103] Importance coefficient flags (sig_flag, significance_coeff_flag): Importance of the coefficient (zero / non-zero).

[0104] The absolute level of the coefficient is greater than 1 flag (gt1_flag, coeff_abs_level_greater1_flag): indicates whether the absolute value of the coefficient level is greater than 1.

[0105] The absolute level of the coefficient is greater than 2 flag (gt2_flag, coeff_abs_level_greater2_flag): indicates whether the absolute value of the coefficient level is greater than 2.

[0106] Parity flag (par_flag): Indicates the parity of the coefficient level.

[0107] The remaining absolute level of the coefficient (abs_remainder, coeff_abs_level_remaining): the remaining value of the absolute value of the coefficient level.

[0108] The aforementioned coefficient levels can be understood as quantized transform coefficients. Each syntax element can be encoded into a bitstream using Context-Based Adaptive Binary Arithmetic Coding (CABAC). To encode using CABAC, non-binary syntax element values ​​are mapped to binary sequences called binaries through a binification process. For each bit in the binary sequence, a context model (also called a probability model) can be selected. This context model can be a probability model used to represent one or more bits, and can be selected from available models. The selection of the context model for the transform coefficient is associated with the quantizer used when quantizing the transform coefficient. Optionally, the context model for each bit can be identified by a context model index (also called a context index), and different context indices correspond to different context models. The probability of each bit stored in the context model can be "1" or "0", and can be adaptive or static. Furthermore, in the adaptive coding engine, the context model can be updated based on the actual encoded value of the bit.

[0109] It should be noted that when calculating the coefficient rate distortion loss of transform coefficient i, the loss calculation of the above N syntax elements (sig_flag, gt1_flag, gt2_flag, par_flag, abs_remainder) is included. Among them, the above three syntax elements (gt1_flag, gt2_flag, par_flag) can share a common context model, while the syntax elements (sig_flag) and (abs_remainder) can use a separate context model.

[0110] In one or more embodiments, to improve the computational efficiency of rate-distortion loss and quickly select the optimal candidate quantization state chain, the encoding device can select a context model for fixed K syntax elements and cancel the context model update for K syntax elements. After obtaining N syntax elements corresponding to transform coefficient i, the encoding device can obtain K syntax elements carrying pre-configured model identifiers from the N syntax elements; under the T quantization states corresponding to transform coefficient i, it obtains a first probability model set corresponding to each of the K syntax elements; in the first probability model set, the probability model that matches the pre-configured model identifier is determined as the fixed probability model corresponding to each of the K syntax elements, where T is a positive integer greater than 1.

[0111] The aforementioned pre-configured model identifier can be a context model index or a context model number, and it can be preset. In VVC (Video Coding Framework), different syntax elements can correspond to different numbers of available models (here, available models can refer to the context models corresponding to different syntax elements already existing in VVC). For example, the syntax element (sig_flag) can correspond to 4 available context models. When the transform block is a luma block (a transform block under luma and color components), the syntax elements (gt1_flag, gt2_flag, par_flag) can correspond to 21 available context models. When the transform block is a chroma block (a transform block under chroma and color components), the syntax elements (gt1_flag, gt2_flag, par_flag) can correspond to 11 available context models. The syntax element (abs_remainder) can correspond to 4 available context models. If, among the N syntax elements corresponding to transform coefficient i, K syntax elements carry pre-configured model identifiers, then the context model selection corresponding to the K syntax elements can be fixed, and the context model update of the K syntax elements can be canceled.

[0112] For example, when there are K syntax elements, including syntax elements (gt1_flag, gt2_flag, par_flag) and syntax element (abs_remainder), K=4. The four available context models corresponding to the syntax element (abs_remainder) can be identified as the first probabilistic model set corresponding to the syntax element (abs_remainder). Within this first probabilistic model set, the context model that matches the pre-configured model identifier can be consistently used. This consistently used context model can be called... For the fixed probability model corresponding to the syntax element (abs_remainder), if the pre-configured model identifier is number 1, the first of the four available context models can be fixed as the fixed probability model. If the transform block is a brightness block, the 21 available context models corresponding to the syntax elements (gt1_flag, gt2_flag, par_flag) can be determined as the first probability model set corresponding to the syntax elements (gt1_flag, gt2_flag, par_flag). In the first set of probabilistic models corresponding to (gt1_flag, gt2_flag, par_flag), a context model that matches the pre-configured model identifier can be used. This fixed context model can be called the fixed probabilistic model corresponding to the syntax element (gt1_flag, gt2_flag, par_flag). For example, if the pre-configured model identifier is number 1, the first of the 21 available context models can be fixed as the fixed probabilistic model. If the transform block is a chroma block, then the 11 available context models corresponding to the syntax element (gt1_flag, gt2_flag, par_flag) can be determined as the fixed probabilistic model. The first probabilistic model set corresponding to gt1_flag, gt2_flag, par_flag. In the first probabilistic model set corresponding to the syntax element (gt1_flag, gt2_flag, par_flag), the context model that matches the pre-configured model identifier can be used in a fixed way. The context model used in this way can be called the fixed probabilistic model corresponding to the syntax element (gt1_flag, gt2_flag, par_flag). For example, when the pre-configured model identifier is number 1, the first context model among the 11 available context models can be fixed as the fixed probabilistic model.Assuming the number of transform coefficients in a transform block is X, the above method can reduce the number of context model updates from 12*X (one transform coefficient can correspond to 4 quantization states, and the N syntax elements corresponding to one transform coefficient correspond to 3 types of context models, so one transform coefficient needs to update the context model 3*4 times) to 4*X (the context models corresponding to the syntax elements gt1_flag, gt2_flag, par_flag, and abs_remainder are fixed, that is, there is no need to update the context models of the above 4 syntax elements, only the context model of the syntax element sig_flag needs to be updated), which can greatly reduce the computational overhead, reduce complexity, and thus accelerate the encoding speed of multimedia data. Optionally, the aforementioned K syntax elements may include any one or more of the syntax elements (sig_flag, gt1_flag, gt2_flag, par_flag, abs_remainder), such as K syntax elements including the syntax element (sig_flag), or K syntax elements including the syntax elements (gt1_flag, gt2_flag, par_flag), or K syntax elements including the syntax element (abs_remainder), or K syntax elements including the syntax elements (sig_flag, gt1_flag, gt2_flag, par_flag), etc.

[0113] Step S103: Based on the adjacent coding coefficients corresponding to the transform coefficient i, perform context modeling for (NK) syntax elements to obtain the target probability models corresponding to (NK) syntax elements respectively.

[0114] In one or more embodiments, for the remaining (NK) syntax elements out of N syntax elements, the encoding device can obtain the adjacent coding coefficients corresponding to the transform coefficient i, perform context modeling for the (NK) syntax elements, and obtain the target probability models corresponding to the (NK) syntax elements respectively. That is, based on the adjacent coding coefficients, the target probability model used to encode the (NK) syntax elements is selected. In other words, for the uncoded transform coefficient i, the information of the already encoded coefficients (e.g., the information of the already encoded syntax elements, which can also be called adjacent coding coefficients) can be used as conditions for encoding. This process can be called context modeling. For example, the context modeling of the (NK) syntax elements corresponding to the transform coefficient i needs to utilize the information of the adjacent coding coefficients (adjacent regions). When the quantization state of the current transform coefficient i is different, the quantization state of its adjacent coding coefficients is also different, that is, the information of the adjacent regions is different.

[0115] Optionally, during the encoding of transform coefficient i, the encoding device can obtain the adjacent encoded coefficients of transform coefficient i in the target quantization state, and obtain (NK) encoded syntax elements from the adjacent encoded coefficients, where the target quantization state belongs to T quantization states, and T is a positive integer greater than 1. For example, the encoding device can obtain adjacent encoded coefficients in different quantization states. In the target quantization state, the device obtains the second probability model set corresponding to the (NK) syntax elements of transform coefficient i respectively. Based on the (NK) encoded syntax elements corresponding to the adjacent encoded coefficients, the device assigns a target probability model to the (NK) syntax elements of transform coefficient i from the second probability model set. The second probability model set can refer to the context models available in VVC for the remaining (NK) syntax elements mentioned above. For example, when the above K syntax elements include syntax elements (gt1_flag, gt2_flag, par_flag) and syntax element (abs_remainder), the remaining (NK) syntax elements include syntax element (sig_flag). In this case, the second probability model set can include the four available context models corresponding to syntax element (sig_flag). It should be noted that the transformation coefficient i performs one context modeling for (NK) syntax elements in the target quantization state, which can be understood as one context model update for the transformation coefficient i. When the transformation coefficient i corresponds to 4 quantization states, (NK) syntax elements need to undergo 4 context model updates.

[0116] The process of performing context modeling on (NK) grammatical elements based on adjacent coding coefficients may include: the encoding device can obtain the absolute value of coding reconstruction in the (NK) coded grammatical elements corresponding to the adjacent coding coefficients; based on the absolute value of coding reconstruction, obtain the cumulative global reconstruction value and the cumulative local reconstruction value corresponding to the adjacent coding coefficients; obtain the number of non-zero values ​​in the transform block; obtain the horizontal and vertical coordinates of transform coefficient i in the transform block; and determine the diagonal position corresponding to transform coefficient i by the sum of the horizontal and vertical coordinates; and assign target probability models to the (NK) grammatical elements of transform coefficient i from the second probability model set based on the cumulative global reconstruction value, the cumulative local reconstruction value, the number of non-zero values, and the diagonal position. Here, the absolute value of the reconstructed code can refer to the absolute value of the reconstructed code values ​​in adjacent coding coefficients (adjacent regions); the global cumulative reconstructed code value can be denoted as sumAbs, representing the sum of the absolute values ​​of the reconstructed code values ​​in adjacent coding coefficients; the local cumulative reconstructed code value can be denoted as sumAbs1, representing the sum of the absolute values ​​of some reconstructed code values ​​in adjacent coding coefficients; the number of non-zero values ​​can be denoted as numSig, representing the number of non-zero values ​​in the current transform block; and the diagonal position can be denoted as dis, representing the sum of the horizontal and vertical coordinates of transform coefficient i within the current transform block. Based on the values ​​of the number of non-zero values ​​numSig, the local cumulative reconstructed code value sumAbs1, and the diagonal position dis, the probability model for the coding syntax elements sig_flag, par_flag, gt1_flag, and gt2_flag is selected. Based on the values ​​of the global cumulative reconstructed code value sumAbs and the number of non-zero values ​​numSig, the probability model for the coding syntax element abs_remainder is selected. For example, when the above (NK) syntax elements include the syntax element sig_flag, the target probability model for encoding the syntax element sig_flag can be selected from the second probability model set corresponding to the syntax element sig_flag based on the local reconstruction cumulative value sumAbs1 in the adjacent coding coefficients, the number of non-zero values ​​numSig in the current transform block, and the diagonal position dis.

[0117] Please see Figure 6 , Figure 6 This is a schematic diagram of context modeling provided in an embodiment of this application. For example... Figure 6 The image block shown can be 16*16 in size. This image block can be a coded block in a video frame image, and it can include 16 transform blocks of size 4*4, such as... Figure 6The black area shown can represent the transform coefficient i in the current transform block, and the gray area can represent the adjacent coded coefficients used when encoding transform coefficient i. The number of adjacent coded coefficients corresponding to transform coefficient i can be 5; of course, the number of adjacent coded coefficients used when encoding transform coefficient i can also be other values, such as 6, 7, ... When the encoding device encodes the syntax element sig_flag of transform coefficient i, any combination of the encoded syntax elements sig_flag of the 5 adjacent coded coefficients and their mapped values ​​can be used as context to model the context of the syntax element sig_flag. Optionally, the information of all or part of the encoded syntax elements of the 5 adjacent coded coefficients can be used as the context for encoding transform coefficient i.

[0118] It should be noted that for the K syntax elements of the transform coefficient i, the fixed probability model in the first probability model set is used directly, and there is no need to use adjacent coding coefficients for context modeling.

[0119] Step S104: Based on the precoding results of the fixed probability model for K syntax elements, the precoding results of the target probability model for (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i, determine the coefficient rate distortion loss corresponding to the transform coefficient i.

[0120] In one or more embodiments, the encoding device can obtain the bitrate loss of transform coefficient i in T quantization states based on the precoding results of K syntax elements using a fixed probability model and the precoding results of (NK) syntax elements using a target probability model. In other words, the encoding device can precode K syntax elements of transform coefficient i in T quantization states using a fixed probability model to obtain precoding results corresponding to each of the K syntax elements; precode (NK) syntax elements of transform coefficient i in T quantization states using a target probability model to obtain precoding results corresponding to each of the (NK) syntax elements; and obtain the bitrate loss of transform coefficient i in T quantization states based on the precoding results corresponding to the K syntax elements and the (NK) syntax elements.

[0121] In the General Video Coding (VVC) algorithm, the context model can be used to store parameters related to the probability of a bit being 1 or 0. Specifically, the fixed probability model can be a probability model for K syntax elements, and the target probability model can be a probability model for (NK) syntax elements. The precoding results corresponding to the N syntax elements can be the encoded bits output by the CABAC algorithm. Here, precoding refers to encoding to select the optimal quantization state chain; the encoded bits are not transmitted to the decoder at this stage. Each syntax element of the transform coefficient i can be used as input to the CABAC algorithm, and the output of the CABAC algorithm is the encoded bits. For a syntax element input to the CABAC algorithm, once the probability model of that syntax element is determined (including the fixed probability model corresponding to the K syntax elements and the target probability model corresponding to (NK) syntax elements), the interval starting point (low) and interval width (range) in the CABAC encoder can be adjusted based on the value of the input syntax element and its probability model. The probability model can also be updated. The CABAC algorithm process can include: receiving the starting point (Low_input) and the range width (range_input); receiving the syntax element and its probability model, calculating the range length occupied by the value 0 (R0 = range_input p(0)) and the range length occupied by the value 1 (R1 = range_input - R0), where p(0) can be represented as the probability corresponding to 0 in the probability model; updating the starting point (Low_input) and the range width (range_input) according to the value of the received syntax element. If the syntax element is 1, the updated starting point (Low_input) remains Low_input, and the updated range width (range_output) is reduced to R1; if the received syntax element is 0, the starting point (Low_input) is updated to Low_input + R1, and the range width (range_input) is reduced to R0. The rate loss of the transform coefficient i in T quantization states can be calculated using the precoding results output by the CABAC algorithm.

[0122] The encoding device can obtain the quantized reconstructed value corresponding to the transform coefficient i through the first quantizer and the second quantizer, and then, based on the transform coefficient i and the quantized reconstructed value (e.g., ... Figure 3 The product of the horizontal axis value and the quantization step size is used to determine the distortion loss of transform coefficient i in T quantization states; based on the distortion loss and the bit rate loss, the coefficient rate distortion loss of transform coefficient i in T quantization states is determined. The coefficient rate distortion loss can be expressed as... RDC can be represented as Rate Distortion Cost, where W is the transform coefficient before quantization, and y is the transform coefficient after quantization (quantized value). For quantization and reconstructing numerical values, λ is a parameter that can be set manually; R(y) represents the rate loss required for encoding the quantized transform coefficients. Distortion loss can be calculated using the squared error:

[0123] Step S105: Determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

[0124] In one or more embodiments, for each transform coefficient in the transform block, the coefficient rate distortion loss can be calculated. By summing the coefficient rate distortion loss of each transform coefficient in each candidate quantization state chain, the path rate distortion loss corresponding to each candidate quantization state chain can be obtained. In other words, the encoding device can obtain the coefficient rate distortion loss corresponding to each transform coefficient in the transform block, and accumulate the coefficient rate distortion loss associated with each of the M candidate quantization state chains to obtain the path rate distortion loss corresponding to each of the M candidate quantization state chains.

[0125] Furthermore, the encoding device can determine the candidate quantization state chain corresponding to the minimum path rate distortion loss as the target quantization state chain of the transform block; it traverses the transform coefficients contained in the transform block according to the target quantization state chain and saves the coefficient quantization value (quantized transform coefficient) corresponding to each transform coefficient in the transform block; by performing entropy encoding processing on the coefficient quantization value, the encoded bitstream corresponding to the transform block is obtained, and the encoded bitstream is output to the decoding end so that the decoding end can decode the encoded bitstream and display the decoded multimedia data; the entropy encoding here is still implemented using the above CABAC algorithm, and the target quantization state chain can be the optimal quantization state chain selected from M candidate quantization state chains.

[0126] In this embodiment, M candidate quantization state chains corresponding to a transform block in multimedia data can be obtained, where the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer; that is, in the encoding process of multimedia data, a transform block in multimedia data can correspond to multiple candidate quantization state chains. For a transform coefficient i in a transform block of multimedia data, N syntax elements used to describe the transform coefficient i can be obtained. These N syntax elements may include K syntax elements carrying pre-configured model identifiers. The probability models of the K syntax elements can be fixed, and the fixed probability models corresponding to the K syntax elements can be obtained directly based on the pre-configured model identifiers; for the remaining (N Given K syntax elements, context modeling can be performed on (NK) syntax elements using the adjacent coding coefficients of transform coefficient i, resulting in target probability models corresponding to each (NK) syntax element, which reduces context modeling. Furthermore, the coefficient rate-distortion loss corresponding to transform coefficient i can be determined using the fixed probability model, the target probability model, and the quantization reconstruction value corresponding to transform coefficient i. Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to M candidate quantization states can be statistically analyzed. By reducing context modeling, the computational overhead of coefficient rate-distortion loss can be reduced, thereby improving the optimization speed of rate-distortion loss and thus increasing the encoding speed of multimedia data.

[0127] Please see Figure 7 , Figure 7 This is a flowchart illustrating a multimedia data encoding method provided in an embodiment of this application. It can be understood that this multimedia data encoding method is executed by an encoding device, which can be a user terminal, a standalone server, a system consisting of a user terminal and a server, or a computer program (including program code); such as Figure 7 As shown, the multimedia data encoding method may include the following steps:

[0128] Step S201: Obtain M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer.

[0129] Step S202: Obtain the N syntax elements corresponding to the transform coefficients i in the transform block. Based on the pre-configured model identifiers corresponding to the N syntax elements, obtain the fixed probability models corresponding to the N syntax elements respectively. i is a positive integer less than or equal to the number of coefficients contained in the transform block, and N is a positive integer.

[0130] Step S203: Based on the pre-encoding results of the N syntax elements by the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i, determine the coefficient rate distortion loss corresponding to the transform coefficient i.

[0131] Step S204: Determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

[0132] In one or more embodiments, to further improve the computation speed of path rate-distortion loss, the context model update of the N syntax elements (sig_flag, gt1_flag, gt2_flag, par_flag, abs_remainder) of transform coefficient i can be cancelled. In other words, in one or more embodiments of this application, it is not necessary to perform context modeling based on the adjacent coding coefficients of transform coefficient i in the transform block. All N syntax elements use a fixed probability model that matches the pre-configured model identifier. Apart from this, the remaining implementation process can be referred to the above. Figure 2 The descriptions of steps S101-S105 in the corresponding embodiments will not be repeated here.

[0133] In this embodiment, M candidate quantization state chains corresponding to a transform block in multimedia data can be obtained. These M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, where M is a positive integer. That is, during the encoding process of multimedia data, a transform block in the multimedia data can correspond to multiple candidate quantization state chains. For a transform coefficient i in a transform block of multimedia data, N syntax elements can be obtained to represent that transform coefficient i. Each of these N syntax elements can carry a pre-configured model identifier. The probability model (context model) of the N syntax elements can be fixed, and the fixed probability model corresponding to each of the N syntax elements can be directly obtained based on the pre-configured model identifier, without the need for context modeling. Furthermore, the rate-distortion loss corresponding to the transform coefficient i can be determined through the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i. Based on the rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to each of the M candidate quantization state chains can be statistically analyzed. By reducing the computational overhead of the rate-distortion loss, the optimization speed of the rate-distortion loss can be improved, thereby increasing the encoding speed of multimedia data.

[0134] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of a multimedia data encoding device provided in an embodiment of this application. The multimedia data encoding can be a computer program (including program code) running on a computer device. For example, the multimedia data encoding device can be an application software in the computer device used to perform encoding processing. Figure 8As shown, the multimedia encoding device 1 may include: a first acquisition module 10, a second acquisition module 11, a context modeling module 12, a first determination module 13, and a second determination module 14;

[0135] The first acquisition module 10 is used to acquire M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0136] The second acquisition module 11 is used to acquire the N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to the K syntax elements among the N syntax elements, acquire the fixed probability models corresponding to the K syntax elements respectively; i is a positive integer less than or equal to the number of coefficients contained in the transform block, N and K are both positive integers, and K is less than N;

[0137] The context modeling module 12 is used to perform context modeling for (NK) syntax elements based on the adjacent coding coefficients corresponding to the transform coefficient i, so as to obtain the target probability models corresponding to (NK) syntax elements respectively.

[0138] The first determining module 13 is used to determine the coefficient rate distortion loss corresponding to the transform coefficient i based on the pre-encoding results of the fixed probability model for K syntax elements, the pre-encoding results of the target probability model for (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i.

[0139] The second determining module 14 is used to determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

[0140] In one or more embodiments, the second determining module 14 may be specifically used for:

[0141] Obtain the coefficient rate distortion loss corresponding to each transform coefficient in the transform block. For each of the M candidate quantized state chains, accumulate the coefficient rate distortion loss associated with each candidate quantized state chain to obtain the path rate distortion loss corresponding to each of the M candidate quantized state chains.

[0142] The specific functional implementation methods of the first acquisition module 10, the second acquisition module 11, the context modeling module 12, the first determination module 13, and the second determination module 14 can be found in the above description. Figure 3 Steps S101-S105 in the corresponding embodiments will not be described again here.

[0143] In one or more embodiments, multimedia data includes video frame images;

[0144] The multimedia encoding device 1 may further include: a region division module 15 and a transform block selection module 16;

[0145] The region division module 15 is used to acquire video frame images and divide the video frame images according to the unit allocation information corresponding to the video frame images to obtain at least two pixel regions.

[0146] Transform block selection module 16 is used to determine transform blocks from at least two pixel regions according to the encoding order between at least two pixel regions.

[0147] The specific functional implementation methods of the region division module 15 and the transformation block selection module 16 can be found in the above description. Figure 3 Step S101 in the corresponding embodiment will not be described again here.

[0148] In one or more embodiments, the first acquisition module 10 may include: a coefficient quantization unit 101, a quantization state determination unit 102, and a state chain generation unit 103;

[0149] The coefficient quantization unit 101 is used to obtain the transform coefficient i and transform coefficient (i+1) contained in the transform block of multimedia data, and to obtain the quantized value of transform coefficient i in T quantization states according to the first quantizer and the second quantizer; the first quantizer and the second quantizer each include T / 2 quantization states, where T is a positive integer greater than 1;

[0150] The quantization state determination unit 102 is used to determine the subsequent quantization state corresponding to the quantization state of the transform coefficient i based on the parity of the quantization value in the quantization state of the transform coefficient i, and to determine the subsequent quantization state as the quantization state of the transform coefficient (i+1); the subsequent quantization state belongs to T quantization states.

[0151] The state chain generation unit 103 is used to generate M candidate quantization state chains corresponding to the transform block based on the quantization state of transform coefficient i and the quantization state of transform coefficient (i+1).

[0152] The specific functional implementation methods of the coefficient quantization unit 101, the quantization state determination unit 102, and the state chain generation unit 103 can be found in the above description. Figure 3 Step S101 in the corresponding embodiment will not be described again here.

[0153] In one or more embodiments, the second acquisition module 11 may include: a syntax element acquisition unit 111 and a fixed probability model determination unit 112;

[0154] Syntax element acquisition unit 111 is used to acquire N syntax elements corresponding to the transform coefficients i in the transform block, and to acquire K syntax elements carrying pre-configured model identifiers from the N syntax elements;

[0155] The fixed probability model determination unit 112 is used to obtain the first probability model set corresponding to K syntax elements under the T quantization states corresponding to the transformation coefficient i. In the first probability model set, the probability model that matches the pre-configured model identifier is determined as the fixed probability model corresponding to the K syntax elements respectively; T is a positive integer greater than 1.

[0156] The specific functional implementation methods of the syntax element acquisition unit 111 and the fixed probability model determination unit 112 can be found in the above description. Figure 3 Step S102 in the corresponding embodiment will not be described again here.

[0157] In one or more embodiments, the context modeling module 12 may include: an adjacent coefficient acquisition unit 121, a probability model set acquisition unit 122, and a probability model allocation unit 123;

[0158] The adjacent coefficient acquisition unit 121 is used to acquire the adjacent coding coefficients of the transform coefficient i in the target quantization state in the multimedia data, and to acquire (NK) encoded syntax elements in the adjacent coding coefficients; the target quantization state belongs to T quantization states, where T is a positive integer greater than 1;

[0159] The probability model set acquisition unit 122 is used to acquire the second probability model set corresponding to the (NK) syntax elements of the transformation coefficient i under the target quantization state.

[0160] The probability model allocation unit 123 is used to allocate a target probability model to the (NK) syntax elements of the transform coefficient i from the second probability model set according to the (NK) encoded syntax elements corresponding to adjacent coding coefficients.

[0161] The specific functional implementation methods of the adjacent coefficient acquisition unit 121, the probability model set acquisition unit 122, and the probability model allocation unit 123 can be found in the above description. Figure 3 Step S103 in the corresponding embodiment will not be described again here.

[0162] In one or more embodiments, the probability model allocation unit 123 may include: a reconstructed numerical statistics subunit 1231, a diagonal position determination subunit 1232, and a target probability model determination subunit 1233;

[0163] The reconstructed numerical statistics subunit 1231 is used to obtain the absolute value of the encoding reconstruction in the adjacent encoding coefficients based on the (NK) encoded syntax elements corresponding to the adjacent encoding coefficients, and to obtain the global reconstruction cumulative value and the local reconstruction cumulative value corresponding to the adjacent encoding coefficients based on the absolute value of the encoding reconstruction.

[0164] The diagonal position determination subunit 1232 is used to obtain the number of non-zero values ​​in the transform block, obtain the horizontal and vertical coordinates of the transform coefficient i in the transform block, and determine the diagonal position corresponding to the transform coefficient i by the sum of the horizontal and vertical coordinates.

[0165] The target probability model determination subunit 1233 is used to assign the target probability model to the (NK) grammatical elements of the transformation coefficient i from the second probability model set based on the global reconstruction cumulative value, the local reconstruction cumulative value, the number of non-zero values ​​and the diagonal position.

[0166] The specific functional implementation methods of the reconstructed numerical statistics subunit 1231, the diagonal position determination subunit 1232, and the target probability model determination subunit 1233 can be found in the above-mentioned... Figure 3 Step S103 in the corresponding embodiment will not be described again here.

[0167] In one or more embodiments, the first determining module 13 may include: a bit rate loss acquisition unit 131, a distortion loss acquisition unit 132, and a rate-distortion loss determining unit 133;

[0168] The rate loss acquisition unit 131 is used to acquire the rate loss of transform coefficient i in T quantization states based on the precoding results of K syntax elements by the fixed probability model and the precoding results of (NK) syntax elements by the target probability model; T is a positive integer greater than 1.

[0169] The distortion loss acquisition unit 132 is used to acquire the quantization reconstruction value corresponding to the transform coefficient i through the first quantizer and the second quantizer, and determine the distortion loss of the transform coefficient i in T quantization states based on the transform coefficient i and the quantization reconstruction value.

[0170] Rate distortion loss determination unit 133 is used to determine the coefficient rate distortion loss of transform coefficient i in T quantization states based on distortion loss and bit rate loss.

[0171] The specific functional implementation methods of the bit rate loss acquisition unit 131, the distortion loss acquisition unit 132, and the rate-distortion loss determination unit 133 can be found in the above description. Figure 3 Step S104 in the corresponding embodiment will not be described again here.

[0172] In one or more embodiments, the bit rate loss acquisition unit 131 may include: a first precoding subunit 1311, a second precoding subunit 1312, and a bit rate loss calculation subunit 1313;

[0173] The first precoding subunit 1311 is used to precode the K syntax elements of the transform coefficient i in T quantization states according to a fixed probability model, and obtain the precoding results corresponding to the K syntax elements respectively.

[0174] The second precoding subunit 1312 is used to precode (NK) syntax elements of the transform coefficient i in T quantization states according to the target probability model, and obtain the precoding results corresponding to (NK) syntax elements respectively.

[0175] The rate loss calculation subunit 1313 is used to obtain the rate loss of transform coefficient i in T quantization states based on the precoding results corresponding to K syntax elements and (NK) syntax elements.

[0176] The specific functional implementations of the first precoding subunit 1311, the second precoding subunit 1312, and the rate loss calculation subunit 1313 can be found in the above description. Figure 3 Step S104 in the corresponding embodiment will not be described again here.

[0177] In one or more embodiments, the multimedia data encoding device 1 may include: a quantization state chain optimization module 17, a coefficient quantization value acquisition module 18, and an encoding processing module 19;

[0178] The quantization state chain optimization module 17 is used to determine the candidate quantization state chain corresponding to the minimum path rate distortion loss as the target quantization state chain of the transform block.

[0179] The coefficient quantization value acquisition module 18 is used to traverse the transformation coefficients contained in the transformation block according to the target quantization state chain and obtain the coefficient quantization value corresponding to each transformation coefficient in the transformation block.

[0180] The encoding processing module 19 is used to perform entropy encoding processing on the coefficient quantization values ​​to obtain the encoded bit stream corresponding to the transform block, and output the encoded bit stream to the decoding end.

[0181] The specific functional implementation methods of the quantization state chain optimization module 17, the coefficient quantization value acquisition module 18, and the encoding processing module 19 can be found in the above description. Figure 3 Step S105 in the corresponding embodiment will not be described again here.

[0182] In this embodiment, M candidate quantization state chains corresponding to a transform block in multimedia data can be obtained, where the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer; that is, in the encoding process of multimedia data, a transform block in multimedia data can correspond to multiple candidate quantization state chains. For a transform coefficient i in a transform block of multimedia data, N syntax elements used to describe the transform coefficient i can be obtained. These N syntax elements may include K syntax elements carrying pre-configured model identifiers. The probability models of the K syntax elements can be fixed, and the fixed probability models corresponding to the K syntax elements can be obtained directly based on the pre-configured model identifiers; for the remaining (N Given K syntax elements, context modeling can be performed on (NK) syntax elements using the adjacent coding coefficients of transform coefficient i, resulting in target probability models corresponding to each (NK) syntax element, which reduces context modeling. Furthermore, the coefficient rate-distortion loss corresponding to transform coefficient i can be determined using the fixed probability model, the target probability model, and the quantization reconstruction value corresponding to transform coefficient i. Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to M candidate quantization states can be statistically analyzed. By reducing context modeling, the computational overhead of coefficient rate-distortion loss can be reduced, thereby improving the optimization speed of rate-distortion loss and thus increasing the encoding speed of multimedia data.

[0183] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a multimedia data encoding device provided in an embodiment of this application. The multimedia data encoding can be a computer program (including program code) running on a computer device. For example, the multimedia data encoding device can be an application software in the computer device used to perform encoding processing. Figure 9 As shown, the multimedia encoding device 2 may include: a third acquisition module 21, a fourth acquisition module 22, a third determination module 23, and a fourth determination module 24;

[0184] The third acquisition module 21 is used to acquire M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0185] The fourth acquisition module 22 is used to acquire the N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to the N syntax elements, acquire the fixed probability models corresponding to the N syntax elements respectively; i is a positive integer less than or equal to the number of coefficients contained in the transform block, and N is a positive integer;

[0186] The third determining module 23 is used to determine the coefficient rate distortion loss corresponding to the transform coefficient i based on the pre-encoding results of the N syntax elements in the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i.

[0187] The fourth determination module 24 is used to determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

[0188] The specific functional implementation methods of the third acquisition module 21, the fourth acquisition module 22, the third determination module 23, and the fourth determination module 24 can be found in the above description. Figure 7 Steps S201-S204 in the corresponding embodiments will not be described again here.

[0189] In this embodiment, M candidate quantization state chains corresponding to a transform block in multimedia data can be obtained. These M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, where M is a positive integer. That is, during the encoding process of multimedia data, a transform block in the multimedia data can correspond to multiple candidate quantization state chains. For a transform coefficient i in a transform block of multimedia data, N syntax elements can be obtained to represent that transform coefficient i. Each of these N syntax elements can carry a pre-configured model identifier. The probability model (context model) of the N syntax elements can be fixed, and the fixed probability model corresponding to each of the N syntax elements can be directly obtained based on the pre-configured model identifier, without the need for context modeling. Furthermore, the rate-distortion loss corresponding to the transform coefficient i can be determined through the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i. Based on the rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to each of the M candidate quantization state chains can be statistically analyzed. By reducing the computational overhead of the rate-distortion loss, the optimization speed of the rate-distortion loss can be improved, thereby increasing the encoding speed of multimedia data.

[0190] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 10As shown, the computer device 1000 can be a user terminal or a server; this is not a limitation. For ease of understanding, this application takes the computer device as a user terminal as an example. The computer device 1000 may include: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a Wi-Fi interface). The memory 1004 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. The memory 1005 may optionally be at least one storage device located remotely from the aforementioned processor 1001. Figure 10 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.

[0191] The network interface 1004 in the computer device 1000 can also provide network communication functions, and the optional user interface 1003 can also include a display screen and a keyboard. Figure 10 In the computer device 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application program stored in the memory 1005 to achieve:

[0192] Obtain the M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0193] Obtain the N syntax elements corresponding to the transform coefficient i in the transform block. Based on the pre-configured model identifiers corresponding to the K syntax elements among the N syntax elements, obtain the fixed probability models corresponding to the K syntax elements respectively. i is a positive integer less than or equal to the number of coefficients contained in the transform block. N and K are both positive integers, and K is less than N.

[0194] Based on the adjacent coding coefficients corresponding to the transform coefficient i, context modeling is performed for (NK) syntax elements to obtain the target probability models corresponding to (NK) syntax elements respectively.

[0195] Based on the precoding results of the fixed probability model for K syntax elements, the precoding results of the target probability model for (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i, determine the coefficient rate distortion loss corresponding to the transform coefficient i.

[0196] Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, determine the path rate-distortion loss corresponding to each of the M candidate quantization state chains.

[0197] Alternatively, processor 1001 can also achieve:

[0198] Obtain the M candidate quantization state chains corresponding to the transform block in the multimedia data; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer;

[0199] Obtain the N syntax elements corresponding to the transform coefficient i in the transform block, and obtain the fixed probability model corresponding to each of the N syntax elements based on the pre-configured model identifiers corresponding to the N syntax elements; i is a positive integer less than or equal to the number of coefficients contained in the transform block, and N is a positive integer;

[0200] Based on the pre-encoding results of N syntax elements using the fixed probability model and the quantization reconstruction values ​​corresponding to transform coefficient i, determine the coefficient rate distortion loss corresponding to transform coefficient i.

[0201] Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, determine the path rate-distortion loss corresponding to each of the M candidate quantization state chains.

[0202] It should be understood that the computer device 1000 described in the embodiments of this application can execute the foregoing text. Figure 2 and Figure 7 The description of the multimedia data encoding method in any of the corresponding embodiments can also be performed as described above. Figure 8 The description of the multimedia data encoding device 1 in the corresponding embodiment, or the execution of the preceding text Figure 9 The description of the multimedia data encoding device 2 in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated.

[0203] Furthermore, it should be noted that this application embodiment also provides a computer-readable storage medium, which stores a computer program executed by the aforementioned multimedia data encoding device 1. The computer program includes program instructions, and when the processor executes the program instructions, it can execute the aforementioned... Figure 2 and Figure 7The description of the multimedia data encoding method in any corresponding embodiment is already provided and will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer-readable storage medium embodiments related to this application, please refer to the description of the method embodiments of this application. As an example, program instructions can be deployed and executed on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network. These multiple computing devices distributed across multiple locations and interconnected via a communication network can constitute a blockchain system.

[0204] Furthermore, it should be noted that this application also provides a computer program product or computer program, which may include computer instructions, which may be stored in a computer-readable storage medium. The processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor may execute the computer instructions, causing the computer device to perform the aforementioned actions. Figure 2 and Figure 7 The description of the multimedia data encoding method in any corresponding embodiment is already provided, and therefore will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated. For technical details not disclosed in the computer program products or computer program embodiments related to this application, please refer to the description of the method embodiments of this application.

[0205] 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 this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0206] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.

[0207] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.

[0208] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0209] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A multimedia data encoding method, characterized in that, include: Obtain the M candidate quantization state chains corresponding to the transform blocks in the multimedia data; The M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, where M is a positive integer; Obtain the N syntax elements corresponding to the transform coefficient i in the transform block, and obtain the fixed probability model corresponding to each of the K syntax elements based on the pre-configured model identifiers of the K syntax elements; i is a positive integer less than or equal to the number of coefficients contained in the transform block, N and K are both positive integers, and K is less than N; Based on the adjacent coding coefficients corresponding to the transform coefficient i, context modeling is performed for (NK) syntax elements to obtain the target probability models corresponding to the (NK) syntax elements respectively. Based on the precoding results of the fixed probability model for the K syntax elements, the precoding results of the target probability model for the (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i, the coefficient rate distortion loss corresponding to the transform coefficient i is determined. Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to each of the M candidate quantization state chains is determined.

2. The method according to claim 1, characterized in that, The multimedia data includes video frame images; The method further includes: The video frame image is acquired, and the video frame image is divided according to the unit allocation information corresponding to the video frame image to obtain at least two pixel regions; The transform block is determined from the at least two pixel regions according to the encoding order between the at least two pixel regions.

3. The method according to claim 1, characterized in that, The step of obtaining the M candidate quantization state chains corresponding to the transform blocks in the multimedia data includes: Obtain the transform coefficient i and transform coefficient (i+1) contained in the transform block of the multimedia data, and obtain the quantized value of the transform coefficient i in T quantization states according to the first quantizer and the second quantizer; the first quantizer and the second quantizer each include T / 2 quantization states, where T is a positive integer greater than 1; Based on the parity of the quantization value in the quantization state of the transform coefficient i, determine the subsequent quantization state corresponding to the quantization state of the transform coefficient i, and determine the subsequent quantization state as the quantization state of the transform coefficient (i+1); the subsequent quantization state belongs to the T quantization states. Based on the quantization state of the transform coefficient i and the quantization state of the transform coefficient (i+1), M candidate quantization state chains corresponding to the transform block are generated.

4. The method according to claim 1, characterized in that, The step of obtaining the N syntax elements corresponding to the transform coefficients i in the transform block, and obtaining the fixed probability models corresponding to the K syntax elements based on the pre-configured model identifiers corresponding to the K syntax elements, includes: Obtain N syntax elements corresponding to the transform coefficients i in the transform block, and extract K syntax elements carrying the pre-configured model identifier from the N syntax elements; In the T quantization states corresponding to the transformation coefficient i, the first probability model set corresponding to the K syntax elements is obtained respectively. In the first probability model set, the probability model that matches the pre-configured model identifier is determined as the fixed probability model corresponding to the K syntax elements respectively; T is a positive integer greater than 1.

5. The method according to claim 1, characterized in that, The step of performing context modeling for (NK) grammatical elements based on the adjacent coding coefficients corresponding to the transform coefficient i to obtain a target probability model for encoding the (NK) grammatical elements includes: In the multimedia data, obtain the adjacent coding coefficients of the transform coefficient i in the target quantization state, and obtain (NK) encoded syntax elements from the adjacent coding coefficients; the target quantization state belongs to T quantization states, where T is a positive integer greater than 1; In the target quantization state, obtain the second probability model set corresponding to the (NK) syntax elements of the transformation coefficient i; Based on the (NK) encoded syntax elements corresponding to the adjacent coding coefficients, a target probability model is assigned to the (NK) syntax elements of the transform coefficient i from the second probability model set.

6. The method according to claim 5, characterized in that, The step of assigning a target probability model to the (NK) grammatical elements of the transform coefficient i from the second probability model set based on the (NK) coded grammatical elements corresponding to the adjacent coded coefficients includes: Based on the (NK) encoded syntax elements corresponding to the adjacent coding coefficients, obtain the absolute value of coding reconstruction in the adjacent coding coefficients, and based on the absolute value of coding reconstruction, obtain the global reconstruction cumulative value and the local reconstruction cumulative value corresponding to the adjacent coding coefficients. Obtain the number of non-zero values ​​in the transformation block, obtain the horizontal and vertical coordinates of the transformation coefficient i in the transformation block, and determine the sum of the horizontal and vertical coordinates as the diagonal position corresponding to the transformation coefficient i; Based on the global reconstruction cumulative value, the local reconstruction cumulative value, the number of non-zero values, and the diagonal position, a target probability model is assigned to the (NK) grammatical elements of the transformation coefficient i from the second probability model set.

7. The method according to claim 1, characterized in that, The step of determining the coefficient rate distortion loss corresponding to the transform coefficient i based on the precoding results of the K syntax elements by the fixed probability model, the precoding results of the (NK) syntax elements by the target probability model, and the quantization reconstruction value corresponding to the transform coefficient i includes: Based on the precoding results of the K syntax elements by the fixed probability model and the precoding results of the (NK) syntax elements by the target probability model, the rate loss of the transform coefficient i in T quantization states is obtained; T is a positive integer greater than 1. The first quantizer and the second quantizer are used to obtain the quantization reconstruction value corresponding to the transformation coefficient i. Based on the transformation coefficient i and the quantization reconstruction value, the distortion loss of the transformation coefficient i in the T quantization states is determined. Based on the distortion loss and the bit rate loss, determine the coefficient rate distortion loss of the transform coefficient i in the T quantization states.

8. The method according to claim 7, characterized in that, The step of obtaining the rate loss of the transform coefficient i in T quantization states based on the precoding results of the K syntax elements by the fixed probability model and the precoding results of the (NK) syntax elements by the target probability model includes: According to the fixed probability model, the transform coefficient i is pre-encoded for K syntax elements in the T quantization states to obtain the pre-encoding results corresponding to the K syntax elements respectively; According to the target probability model, the transform coefficient i is pre-encoded in (NK) syntax elements under the T quantization states to obtain the pre-encoding results corresponding to the (NK) syntax elements respectively; Based on the precoding results corresponding to the K syntax elements and the precoding results corresponding to the (NK) syntax elements, the rate loss of the transform coefficient i in the T quantization states is obtained.

9. The method according to claim 1, characterized in that, The step of determining the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block includes: Obtain the coefficient rate distortion loss corresponding to each transform coefficient in the transform block, and accumulate the coefficient rate distortion loss associated with each of the M candidate quantization state chains to obtain the path rate distortion loss corresponding to each of the M candidate quantization state chains.

10. The method according to claim 1, characterized in that, Also includes: The candidate quantization state chain corresponding to the minimum path rate distortion loss is determined as the target quantization state chain of the transform block. According to the target quantization state chain, traverse the transformation coefficients contained in the transformation block to obtain the coefficient quantization value corresponding to each transformation coefficient in the transformation block; The quantized coefficient values ​​are entropy encoded to obtain the encoded bitstream corresponding to the transform block, and the encoded bitstream is output to the decoding end.

11. A multimedia data encoding method, characterized in that, include: The transform coefficients i and (i+1) contained in the transform block of the multimedia data are obtained. Based on the first quantizer and the second quantizer, the quantization value of the transform coefficient i in T quantization states is obtained. The first quantizer and the second quantizer each include T / 2 quantization states, where T is a positive integer greater than 1 and i is a positive integer less than or equal to the number of coefficients contained in the transform block. Based on the parity of the quantization value in the quantization state of the transform coefficient i, determine the subsequent quantization state corresponding to the quantization state of the transform coefficient i, and determine the subsequent quantization state as the quantization state of the transform coefficient (i+1). The subsequent quantization state belongs to the T quantization states; Based on the quantization state of the transform coefficient i and the quantization state of the transform coefficient (i+1), M candidate quantization state chains corresponding to the transform block are generated; the M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, and M is a positive integer; Obtain the N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to the N syntax elements, obtain the fixed probability models corresponding to the N syntax elements respectively; N is a positive integer; Based on the precoding results of the N syntax elements by the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i, the coefficient rate distortion loss corresponding to the transform coefficient i is determined. Based on the coefficient rate-distortion loss corresponding to each transform coefficient in the transform block, the path rate-distortion loss corresponding to each of the M candidate quantization state chains is determined.

12. A multimedia data encoding device, characterized in that, include: The first acquisition module is used to acquire M candidate quantization state chains corresponding to the transform blocks in multimedia data; The M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, where M is a positive integer; The second acquisition module is used to acquire N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to K syntax elements among the N syntax elements, acquire the fixed probability models corresponding to the K syntax elements respectively; i is a positive integer less than or equal to the number of coefficients contained in the transform block, N and K are both positive integers, and K is less than N; The context modeling module is used to perform context modeling for (NK) syntax elements based on the adjacent coding coefficients corresponding to the transform coefficient i, so as to obtain the target probability models corresponding to the (NK) syntax elements respectively. The first determining module is used to determine the coefficient rate distortion loss corresponding to the transform coefficient i based on the precoding results of the fixed probability model for the K syntax elements, the precoding results of the target probability model for the (NK) syntax elements, and the quantization reconstruction value corresponding to the transform coefficient i. The second determining module is used to determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

13. A multimedia data encoding device, characterized in that, include: The third acquisition module is used to acquire the transform coefficient i and transform coefficient (i+1) contained in the transform block of multimedia data, and to acquire the quantized value of the transform coefficient i in T quantization states according to the first quantizer and the second quantizer; the first quantizer and the second quantizer each include T / 2 quantization states, where T is a positive integer greater than 1 and i is a positive integer less than or equal to the number of coefficients contained in the transform block. The third acquisition module is further configured to determine the subsequent quantization state corresponding to the quantization state of the transformation coefficient i based on the parity of the quantization value in the quantization state of the transformation coefficient i, and to determine the subsequent quantization state as the quantization state of the transformation coefficient (i+1); the subsequent quantization state belongs to the T quantization states. The third acquisition module is further configured to generate M candidate quantization state chains corresponding to the transform block based on the quantization state of the transform coefficient i and the quantization state of the transform coefficient (i+1). The M candidate quantization state chains are determined by the quantization state corresponding to each transform coefficient in the transform block, where M is a positive integer; The fourth acquisition module is used to acquire N syntax elements corresponding to the transform coefficients i in the transform block, and based on the pre-configured model identifiers corresponding to the N syntax elements, acquire the fixed probability models corresponding to the N syntax elements respectively; N is a positive integer; The third determining module is used to determine the coefficient rate distortion loss corresponding to the transform coefficient i based on the precoding results of the N syntax elements by the fixed probability model and the quantization reconstruction value corresponding to the transform coefficient i. The fourth determining module is used to determine the path rate distortion loss corresponding to each of the M candidate quantization state chains based on the coefficient rate distortion loss corresponding to each transform coefficient in the transform block.

14. A computer device, characterized in that, Including memory and processor; The memory is connected to the processor, the memory is used to store computer programs, and the processor is used to invoke the computer programs so that the computer device performs the method according to any one of claims 1-11.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded and executed by a processor to cause a computer device having the processor to perform the method of any one of claims 1-11.

16. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by a processor, perform the method described in any one of claims 1-11.

Citation Information

Patent Citations

  • Method and apparatus for quantizing signal in digital system

    CN1297623A