Video coding method, apparatus and device
By implicitly indicating the position of sub-block transformations in the quantization coefficient matrix, the problem of increased bit count in the bitstream in existing technologies is solved, thereby improving video coding efficiency.
Patent Information
- Application Number
- CN202310189883.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-27
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2040-09-27
AI Technical Summary
In existing video coding technologies, encoding the flag bits of sub-block transformation positions increases the number of bits in the bitstream, affecting video coding efficiency.
By implicitly indicating the flags of sub-block transformation positions through the quantization coefficient matrix, explicit encoding of sub-block transformation positions is avoided, reducing the number of bits in the bitstream and improving video coding efficiency.
This reduces the number of bits used in the video stream, improving the processing efficiency of the video encoder and decoder.
Smart Images

Figure CN116193119B_ABST
Abstract
Description
[0001] This application is a divisional application of the application for patent with application number 202011032954.2 and titled "Video decoding method, device and equipment", which was filed on September 27, 2020. TECHNICAL FIELD
[0002] Embodiments of the present application relate to the field of audio and video technology, in particular to a video encoding method, a decoding method, a device and equipment. BACKGROUND
[0003] A video signal refers to a sequence of images including multiple frames. Since the data bandwidth of a video signal is very high after digitization, a computer device is difficult to directly store, transmit and process the video signal, and thus a video compression technology is needed to reduce the data bandwidth of the video signal.
[0004] A video compression technology is realized through video encoding. In some mainstream video encoding technologies, a hybrid encoding framework is adopted to perform a series of operations and processing on an input original video signal (video sequence). At an encoding end, an encoder divides the input original video signal (video sequence) into a plurality of non-overlapping coding units; then performs prediction encoding on the coding units to obtain residual data; performs transform and quantization on the residual data to obtain a quantized coefficient matrix; and then performs entropy coding or statistical coding on the quantized coefficient matrix and other information (such as a selected encoding mode, a motion vector of the coding unit, etc.) to obtain a compressed video bitstream. At a decoding end, a decoder performs inverse operations of the operations performed at the encoding end on the obtained video bitstream, that is, the decoder first decodes the video bitstream to obtain a quantized coefficient matrix and various encoding mode information, etc.; then on one hand, inverse quantization and inverse transform are performed on the quantized coefficient matrix to obtain residual data corresponding to the coding unit, and on the other hand, a prediction signal corresponding to the coding unit is obtained according to the various encoding mode information, etc.; then the reconstructed signal is obtained according to the residual data and the prediction signal, and finally loop filtering and other processing are performed on the reconstructed signal to obtain a final video output signal.
[0005] Among them, for the transform and quantization of the residual signal corresponding to the coding unit, the related technology divides the coding unit into sub-blocks, and performs transform and quantization of the residual data on part of the sub-blocks, and forcibly clears the other sub-blocks. For the sub-blocks that need to perform transform and quantization on the residual data, the related technology indicates the positions (referred to as "sub-block transform positions" in the present application) of these sub-blocks through a flag. In the video encoding process, the encoder explicitly encodes the flag to write into the video bitstream, and the subsequent decoder decodes the video bitstream to obtain the flag, and then derives the sub-block transform positions according to the flag.
[0006] However, encoding the flag bit of the sub-block transform position can increase the bit number of the code stream, and is not conducive to improving the video coding efficiency. SUMMARY
[0007] Embodiments of the present application provide a video coding method, a decoding method, an apparatus and a device, which can be used to reduce the bit number of the code stream and improve the video coding efficiency. The technical solutions are as follows.
[0008] In one aspect, the present application provides a video decoding method, which includes:
[0009] decoding a target coding unit to obtain a quantization coefficient matrix corresponding to the target coding unit;
[0010] determining first reference information according to the quantization coefficient in the quantization coefficient matrix;
[0011] obtaining a value of a transform flag bit corresponding to the first reference information, the transform flag bit being a flag bit of a sub-block transform position, the sub-block transform position being a position of a sub-block in the coding unit that needs to be transformed and quantized;
[0012] determining the sub-block transform position of the target coding unit according to the obtained value of the transform flag bit.
[0013] In another aspect, the present application provides a video coding method, which includes:
[0014] obtaining a quantization coefficient matrix corresponding to a target coding unit;
[0015] determining a value of a transform flag bit that needs to be indicated according to the quantization coefficient matrix, the transform flag bit being a flag bit of a sub-block transform position of the target coding unit, the sub-block transform position being a position of a sub-block in the target coding unit that needs to be transformed and quantized;
[0016] adjusting the quantization coefficient in the quantization coefficient matrix according to the value of the transform flag bit to obtain an adjusted quantization coefficient matrix;
[0017] encoding the adjusted quantization coefficient matrix.
[0018] In an example, the adjusting the quantization coefficient in the quantization coefficient matrix according to the value of the transform flag bit to obtain an adjusted quantization coefficient matrix comprises: determining reference information corresponding to the value of the transform flag bit as first reference information; obtaining at least one quantization coefficient in the quantization coefficient matrix; performing statistical summation processing on the at least one quantization coefficient to obtain a statistical summation result; and adjusting the at least one quantization coefficient according to the statistical summation result, the first reference information, and a first calculation factor to obtain an adjusted at least one quantization coefficient, wherein the first reference information is obtained by performing remainder processing on the statistical summation result of the adjusted at least one quantization coefficient by using the first calculation factor.
[0019] In an example, the obtaining at least one quantization coefficient in the quantization coefficient matrix comprises at least one of the following: obtaining all quantization coefficients in the quantization coefficient matrix; obtaining quantization coefficients at at least one specified position in the quantization coefficient matrix; obtaining quantization coefficients in at least one row of the quantization coefficient matrix; obtaining quantization coefficients in at least one column of the quantization coefficient matrix; obtaining quantization coefficients in at least one row and at least one column of the quantization coefficient matrix; obtaining quantization coefficients in at least one diagonal of the quantization coefficient matrix; obtaining quantization coefficients with a scanning order in a front n bit of the quantization coefficient matrix, wherein n is a positive integer; obtaining quantization coefficients with a scanning order in a middle m bit of the quantization coefficient matrix, wherein m is a positive integer; obtaining all quantization coefficients in a scanning region coefficient coding (SRCC) region of the quantization coefficient matrix; obtaining quantization coefficients at at least one specified position in the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one row of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one column of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one row and at least one column of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one diagonal of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients with a scanning order in a front s bit of the SRCC region of the quantization coefficient matrix, wherein s is a positive integer; and obtaining quantization coefficients with a scanning order in a middle t bit of the SRCC region of the quantization coefficient matrix, wherein t is a positive integer.
[0020] In one example, the statistical sum processing on the at least one quantization coefficient to obtain a statistical sum result includes: statistical sum processing on original values of the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on absolute values of the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on original values of quantization coefficients with odd original values in the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on absolute values of quantization coefficients with odd original values in the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on original values of quantization coefficients with even original values in the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on absolute values of quantization coefficients with even original values in the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on original values of quantization coefficients with non-zero even original values in the at least one quantization coefficient to obtain the statistical sum result; or statistical sum processing on absolute values of quantization coefficients with non-zero even original values in the at least one quantization coefficient to obtain the statistical sum result; or mapping processing on each quantization coefficient in the at least one quantization coefficient to obtain at least one mapped quantization coefficient; and statistical sum processing on the at least one mapped quantization coefficient to obtain the statistical sum result.
[0021] In an example, the mapping processing on each of the at least one quantization coefficient to obtain at least one mapped quantization coefficient includes: mapping a quantization coefficient with an original value of an odd number in the at least one quantization coefficient to a first value to obtain at least one first quantization coefficient; mapping a quantization coefficient with an original value of an even number in the at least one quantization coefficient to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or mapping a quantization coefficient with an original value of zero in the at least one quantization coefficient to a first value to obtain at least one first quantization coefficient; mapping a quantization coefficient with an original value of a non-zero in the at least one quantization coefficient to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or mapping a quantization coefficient with an original value of a non-zero even number in the at least one quantization coefficient to a first value to obtain at least one first quantization coefficient; mapping a quantization coefficient with an original value of an odd number or zero in the at least one quantization coefficient to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or performing a calculation mapping processing on the at least one quantization coefficient to obtain the at least one mapped quantization coefficient; wherein the calculation mapping processing includes at least one of: an inversion mapping, a value addition mapping, a value subtraction mapping, a value multiplication mapping, and a value division mapping.
[0022] In an example, the transform flag includes at least one of: a first flag indicating a division direction of a sub-block transform position of the target coding unit, the division direction including a horizontal division and a vertical division; and a second flag indicating the sub-block transform position of the target coding unit based on the division direction indicated by the first flag.
[0023] In an example, the method further includes: indicating, according to a target index in the encoded data, whether a coding unit in the encoded data needs to determine a value of a transform flag according to a quantization coefficient matrix; wherein the coding unit in the encoded data includes any one of: all coding units in the encoded data, coding units in the encoded data using an intra prediction mode, and coding units in the encoded data using an inter prediction mode.
[0024] In an example, the indication of whether the coding unit in the coded data needs to determine the value of the transform flag according to the quantization coefficient matrix according to the target index in the coded data comprises at least one of the following: indication of whether the coding unit in a first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix according to a first index coded in a sequence header included in the coded data, the target index comprising the first index; indication of whether the coding unit in a first picture needs to determine the value of the transform flag according to the quantization coefficient matrix according to a second index coded in a picture header included in the coded data, the target index comprising the second index; indication of whether the coding unit in a first slice needs to determine the value of the transform flag according to the quantization coefficient matrix according to a third index coded in a slice header included in the coded data, the target index comprising the third index; indication of whether the coding unit in a first largest coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix according to a fourth index coded in maximum coding unit header information included in the coded data, the target index comprising the fourth index; in a case where the coding unit in the first picture needs to determine the value of the transform flag according to the quantization coefficient matrix, indication of whether the coding unit in the first picture needs to determine the value of the transform flag according to the quantization coefficient matrix according to the first index coded in the sequence header included in the coded data and the second index coded in the picture included in the coded data, the target index comprising the first index and the second index.
[0025] In an example, the obtaining the quantization coefficient matrix corresponding to the target coding unit comprises: performing prediction coding on the target coding unit to obtain residual data corresponding to the target coding unit; determining a sub-block transform position of the target coding unit; and performing transform and quantization on the residual data according to the sub-block transform position to obtain the quantization coefficient matrix.
[0026] In an example, the method further comprises: determining whether rotation of the quantization coefficient matrix is needed according to the value of the flag of the sub-block transform position; and in a case where it is determined that rotation of the quantization coefficient matrix is needed, rotating a direction of the quantization coefficient matrix from a second direction to a first direction to obtain a rotated quantization coefficient matrix, the rotated quantization coefficient matrix being used for coding.
[0027] In another aspect, an embodiment of the present application provides a video decoding device, the device comprising:
[0028] a decoding module configured to decode a target coding unit to obtain a quantization coefficient matrix corresponding to the target coding unit;
[0029] an information determining module configured to determine first reference information according to quantization coefficients in the quantization coefficient matrix;
[0030] a value obtaining module, configured to obtain a value of a transform flag corresponding to the first reference information, the transform flag being a flag of a sub-block transform position, the sub-block transform position being a position of a sub-block in the coding unit that needs to be transformed and quantized;
[0031] a position determining module, configured to determine the sub-block transform position of the target coding unit according to the obtained value of the transform flag.
[0032] In yet another aspect, an embodiment of the present application provides a video encoding apparatus, the apparatus comprising:
[0033] a matrix obtaining module, configured to obtain a quantization coefficient matrix corresponding to a target coding unit;
[0034] a value determining module, configured to determine a value of a transform flag that needs to be indicated according to the quantization coefficient matrix, the transform flag being a flag of a sub-block transform position of the target coding unit, the sub-block transform position being a position of a sub-block in the target coding unit that needs to be transformed and quantized;
[0035] a coefficient adjusting module, configured to adjust quantization coefficients in the quantization coefficient matrix according to the value of the transform flag, to obtain an adjusted quantization coefficient matrix;
[0036] an encoding module, configured to encode the adjusted quantization coefficient matrix.
[0037] In yet another aspect, an embodiment of the present application provides a computer device, the computer device comprising a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the above video decoding method or implement the above video encoding method.
[0038] In yet another aspect, an embodiment of the present application provides a computer readable storage medium, the computer readable storage medium storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by a processor to implement the above video decoding method or implement the above video encoding method.
[0039] In still another aspect, the embodiments of the present application provide a computer program product or computer program, which comprises 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 the processor executes the computer instructions to cause the computer device to perform the video decoding method as described above, or implement the video encoding method as described above.
[0040] The technical solutions provided by the embodiments of the present application can bring the following beneficial effects:
[0041] By using the quantization coefficients in the quantization coefficient matrix corresponding to the coding unit to implicitly indicate the flag bits of the sub-block transform position in the target coding unit, the sub-block transform position in the target coding unit is determined, so that the explicit coding of the sub-block transform position is avoided, the number of bits occupied by the video code stream is reduced, and the video coding efficiency is improved. In addition, in the technical solutions provided by the embodiments of the present application, since each flag bit of the sub-block transform position does not need to be explicitly coded and decoded, the processing overhead of the video encoder and the video decoder can be reduced, which is helpful to improve the coding efficiency of the video encoder and the decoding efficiency of the video decoder. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0043] Figure 1 is a schematic diagram of a video encoding process provided by an embodiment of the present application;
[0044] Figure 2 is a schematic diagram of an SRCC scanning region provided by an embodiment of the present application;
[0045] Figure 3 is a schematic diagram of an SRCC scanning order provided by an embodiment of the present application;
[0046] Figure 4 is a schematic diagram of sub-block division provided by an embodiment of the present application;
[0047] Figure 5 is a schematic diagram of sub-block transform provided by an embodiment of the present application;
[0048] Figure 6 is a block diagram of a communication system provided by an embodiment of the present application;
[0049] Figure 7is a block diagram of a streaming system provided by an embodiment of the present application;
[0050] Figure 8 is a flowchart of a video decoding method provided by an embodiment of the present application;
[0051] Figure 9 is a schematic diagram of a rotated quantization coefficient matrix provided by an embodiment of the present application;
[0052] Figure 10 is a schematic diagram of obtaining quantization coefficients provided by an embodiment of the present application;
[0053] Figure 11 is a flowchart of a video encoding method provided by an embodiment of the present application;
[0054] Figure 12 is a schematic diagram of a video coding process provided by an embodiment of the present application;
[0055] Figure 13 is a block diagram of a video decoding apparatus provided by an embodiment of the present application;
[0056] Figure 14 is a block diagram of a video decoding apparatus provided by another embodiment of the present application;
[0057] Figure 15 is a block diagram of a video encoding apparatus provided by an embodiment of the present application;
[0058] Figure 16 is a block diagram of a video encoding apparatus provided by another embodiment of the present application;
[0059] Figure 17 is a structural block diagram of a computer device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0061] First, the video encoding technology will be introduced. Figure 1 The video encoding technology will be introduced. Figure 1 is a schematic diagram of a video coding process provided by an embodiment of the present application.
[0062] A video signal refers to a sequence of images including one or more frames. A frame is a representation of spatial information of a video signal. Taking YUV mode as an example, a frame includes a luminance sample matrix (Y) and two chrominance sample matrices (Cb and Cr). From the perspective of the acquisition method of a video signal, it can be divided into two ways, i.e., a camera shooting and a computer generation. Due to the difference in statistical characteristics, the corresponding compression encoding method may also be different.
[0063] In some mainstream video encoding technologies, such as H.265 / HEVC (High Efficient Video Coding), H.266 / VVC (Versatile Video Coding) standard, and AVS (Audio Video coding Standard) (such as AVS3), a hybrid coding framework is adopted, and a series of operations and processing are performed on the input original video signal as follows:
[0064] 1. Block partition structure: the input image is divided into a plurality of non-overlapping processing units, each processing unit will undergo similar compression operations. This processing unit is referred to as a CTU (Coding Tree Unit) or LCU (Large Coding Unit). The CTU can be further divided into one or more basic coding units, referred to as a CU (Coding Unit). Each CU is the most basic element in the coding link, and when prediction is performed, the CU needs to be further divided into different PUs (Predict Unit). The following describes various encoding methods that can be adopted for each CU.
[0065] 2. Predictive coding: including intra prediction and inter prediction, etc. After the original video signal is predicted by the selected reconstructed video signal, a residual video signal is obtained. The encoding end needs to determine the most suitable one from a plurality of possible predictive coding modes for the current CU, and inform the decoding end. Among them, intra prediction refers to the predicted signal coming from the already encoded and reconstructed region within the same image. Inter prediction refers to the predicted signal coming from other images (referred to as reference images) that have been encoded, which are different from the current image.
[0066] 3. Transform Coding and Quantization: The residual video signal undergoes transform operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform) to convert the signal into the transform domain, where the coefficients are called transform coefficients. In the transform domain, the signal undergoes further lossy quantization, losing some information to make the quantized signal more suitable for compression. Some video coding standards may offer more than one transform option; therefore, the encoder needs to select one transform for the current CU and inform the decoder. The fineness of quantization is usually determined by the quantization parameter. A larger QP (Quantization Parameter) value means that coefficients with a wider range of values will be quantized into the same output, which usually results in greater distortion and a lower bitrate. Conversely, a smaller QP value means that coefficients with a smaller range of values will be quantized into the same output, which usually results in less distortion and a higher bitrate.
[0067] 4. Entropy Coding or Statistical Coding: The quantized transform domain signal is statistically compressed and encoded based on the frequency of each value, ultimately outputting a binary (0 or 1) compressed bitstream (or "video bitstream," hereinafter referred to as "video bitstream" for convenience). Simultaneously, other information generated during encoding, such as the selected mode and motion vectors, also requires entropy coding to reduce the bitrate. Statistical coding is a lossless coding method that effectively reduces the bitrate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) or Content Adaptive Binary Arithmetic Coding (CABAC).
[0068] 5、Loop Filtering: The already encoded picture, after the operation of inverse quantization, inverse transform and prediction compensation (the inverse operation of 2-4 above), the reconstructed decoded picture can be obtained. The reconstructed picture is different from the original picture due to the influence of quantization, and part of the information is different from the original picture, resulting in distortion. Filtering operation is performed on the reconstructed picture, such as deblocking, SAO (Sample Adaptive Offset, sample adaptive offset) or ALF (Adaptive Lattice Filter, adaptive lattice filter) filter, which can effectively reduce the distortion degree caused by quantization. Since these filtered reconstructed pictures will be used as references for subsequent encoding pictures to predict future signals, the above filtering operation is also called loop filtering and filtering operation within the encoding loop.
[0069] At the decoding end, the decoder performs the inverse operation of the operation performed at the encoding end on the obtained video code stream. As described above, at the decoding end, for each CU, the decoder first decodes the video code stream to obtain the quantized coefficient matrix and various encoding mode information. Then, on the one hand, the quantized coefficient matrix is inverse quantized and inverse transformed to obtain the residual data corresponding to the encoding unit, and on the other hand, the prediction signal corresponding to the encoding unit is obtained according to the various encoding mode information. Then, according to the residual data and the prediction information (residual data plus prediction signal), the reconstructed signal can be obtained, and finally, the loop filtering and other processing are performed on the reconstructed signal to obtain the final video output signal.
[0070] It should be noted that in the embodiments of the present application, the quantized coefficient matrix contains the quantized transform coefficient (or "quantized coefficient"), which can also be referred to as "transform quantized coefficient matrix" and the like. With the evolution of video compression technology and different naming habits, the quantized coefficient matrix may appear other names. It should be understood that the name "quantized coefficient matrix" does not constitute a limitation on the present application, and subsequent names with the same meaning as "quantized coefficient matrix" should also be within the protection scope of the present application.
[0071] As described above, since there may be a large prediction error in the prediction encoding process, the residual needs to be transmitted to compensate for the prediction signal, thereby improving the quality of the reconstructed signal. As shown in FIG. 1, in the hybrid encoding framework, the residual data is the difference between the original video signal (original picture) and the prediction signal (predicted picture): Figure 1
[0072]
[0073] Wherein, u k [x, y] represents the residual data, S k [x, y] represents the original video signal. This is the predicted signal.
[0074] In one example, the correlation of residual data can be leveraged to transform and concentrate the energy in the residual data, focusing the energy on fewer low-frequency coefficients and resulting in smaller values for most coefficients. Subsequent quantization processing then reduces these smaller coefficient values to zero. By transforming and quantizing the residual data, the cost of encoding residual data is significantly reduced, improving video coding efficiency.
[0075] Because after transformation and quantization, the non-zero coefficients in the quantization coefficient matrix are likely concentrated in the left and upper regions of the matrix, while the right and lower regions are often zero, the Scan Region Coefficient Coding (SRCC) technique is introduced. SRCC marks the size SRx×SRy of the upper-left region of non-zero coefficients in each quantization coefficient matrix (size W×H), where SRx is the x-coordinate of the rightmost non-zero coefficient in the quantization coefficient block, and SRy is the y-coordinate of the bottommost non-zero coefficient in the quantization coefficient block, with 1≤SRx≤W and 1≤SRy≤H. Coefficients outside this region are all zero. SRCC uses (SRx, SRy) to determine the quantization coefficient region to be scanned in a quantization coefficient matrix. Figure 2 As shown, only the quantization coefficients within the scan region marked (SRx, SRy) need to be encoded, and the encoding scan order is as follows. Figure 3 As shown, it can be a reverse Z-shaped scan from the bottom right corner to the top left corner.
[0076] Taking the traditional DCT (Discrete Cosine Transform) as an example, the transformation is as follows:
[0077]
[0078] The two-dimensional discrete transform is realized by two separate one-dimensional discrete transforms (horizontal transform, vertical transform). Optionally, due to the diversity of residual distribution, a single DCT cannot adapt to all residual characteristics. Therefore, transform kernels such as DST (Discrete Sine Transform) 7 and DCT 8 are introduced into the transform module, and the horizontal transform and the vertical transform can adopt different transform kernels. Taking the AMT (Adaptive multiple core transform) technology as an example, the transform combination that can be selected for a residual block includes any one of the following: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8), (DST7, DST7). For a residual block, which transform combination is specifically selected needs to be decided by RDO (Rate-Distortion Optimization) at the encoding end.
[0079] In one example, for the transform and quantization of the residual signal corresponding to the coding unit, the coding unit needs to be sub-block divided, and the partial sub-blocks obtained by the division need to be transformed and quantized for residual data, while the other sub-blocks are forcibly zeroed. In the embodiments of the present application, the sub-block transform position can be indicated by a flag. In one example, the text of SBT (Sub-Block Transform) is as follows.
[0080] Table 1: Text of SBT
[0081]
[0082] The analysis diagram shown in Figure 4 is derived from the SBT text shown in Table 1 above. Figure 4 quad, dir and pos in correspond to sbt_quad_flag, sbt_dir_flag and sbt_pos_flag in the text shown in Table 1 above, respectively. Among them, quad can be regarded as a size control syntax of the sub-block, and dir and pos can both be regarded as syntaxes for controlling the position of the sub-block. That is, quad determines the size (area) of the sub-block, while dir and pos can determine the position of the sub-block.
[0083] As shown in Figure 4 , there are 8 division results of SBT, that is, 8 possible sub-block transform positions. As shown in Figure 4As shown, the shaded part 410 is the sub-block transform position, i.e., the position of the sub-block that needs to be transformed and quantized; and the blank part 420 is forced to be zero. Regarding the selection of the transform combination of the sub-block, when the width or height of the non-zero residual sub-block is 64, the horizontal and vertical transforms of the non-zero residual sub-block are both DCT2; otherwise, the selection of the horizontal and vertical transforms is as shown in the table below. Figure 5 In addition, the shaded part 510 in the table below is the non-zero residual sub-block, and the blank part 520 is the zero residual sub-block. Figure 5 In addition, the shaded part 510 in the table below is the non-zero residual sub-block, and the blank part 520 is the zero residual sub-block.
[0084] As can be known from the above description, the sub-block transform position can be indicated by the three flag bits of sbt_quad_flag, sbt_dir_flag and sbt_pos_flag. In an example, the encoder explicitly encodes the flag bits of the sub-block transform position to write into the video bitstream, and the subsequent decoder decodes the video bitstream to obtain the flag bits, and then derives the sub-block transform position according to the flag bits. However, the encoding of the flag bits of the sub-block transform position will increase the number of bits of the bitstream, which is not conducive to the improvement of the video coding efficiency.
[0085] Based on this, the embodiments of the present application provide a video coding method, which can be used to implicitly indicate the flag bits of the sub-block transform position according to the quantization coefficient matrix, thereby avoiding the explicit encoding of the flag bits of the sub-block transform position, reducing the number of bits of the bitstream, and improving the video coding efficiency. In the following, the technical solutions of the present application are introduced and described in combination with several embodiments.
[0086] Please refer to Figure 6 , which shows a simplified block diagram of a communication system provided by an embodiment of the present application. The communication system 200 includes multiple devices, which can communicate with each other through, for example, a network 250. For example, the communication system 200 includes a first device 210 and a second device 220 interconnected through the network 250. In Figure 6 In an embodiment of the present application, the first device 210 and the second device 220 perform unidirectional data transmission. For example, the first device 210 can encode video data, such as a stream of video pictures captured by the first device 210, for transmission to the second device 220 through the network 250. The encoded video data is transmitted in the form of one or more coded video bitstreams. The second device 220 can receive the encoded video data from the network 250, decode the encoded video data to recover the video data, and display video pictures based on the recovered video data. Unidirectional data transmission is common in applications such as media serving.
[0087] In another embodiment, the communication system 200 includes a third device 230 and a fourth device 240 that perform bidirectional transmission of encoded video data, which may occur, for example, during a video conference. For bidirectional data transmission, each of the third device 230 and the fourth device 240 may encode video data (e.g., a stream of video images captured by the device) for transmission over network 250 to the other device. Each of the third device 230 and the fourth device 240 may also receive encoded video data transmitted by the other device, decode the encoded video data to recover the video data, and display the video images on an accessible display device based on the recovered video data.
[0088] exist Figure 6 In the embodiments described, the first device 210, the second device 220, the third device 230, and the fourth device 240 may be computer devices such as servers, personal computers, and smartphones, but the principles disclosed in this application are not limited to these. The embodiments of this application are applicable to PCs (Personal Computers), mobile phones, tablets, media players, and / or dedicated video conferencing equipment. Network 250 refers to any number of networks that transmit encoded video data between the first device 210, the second device 220, the third device 230, and the fourth device 240, including, for example, wired and / or wireless communication networks. Communication network 250 may exchange data in circuit-switched and / or packet-switched channels. This network may include telecommunications networks, local area networks, wide area networks, and / or the Internet. For the purposes of this application, unless explained below, the architecture and topology of network 250 may be irrelevant to the operation of the disclosures in this application.
[0089] As an example, Figure 7 The diagram illustrates the placement of a video encoder and a video decoder in a streaming environment. The subject matter disclosed in this application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital TV, storing compressed video on digital media including CDs (Compact Discs), DVDs (Digital Versatile Discs), memory sticks, etc.
[0090] The streaming system may include an acquisition subsystem 313, which may include a video source 301 such as a digital camera, which creates an uncompressed video image stream 302. In an embodiment, the video image stream 302 includes samples captured by a digital camera. Compared to encoded video data 304 (or encoded video bitstream), the video image stream 302 is depicted as a thick line to emphasize the high data volume of the video image stream. The video image stream 302 may be processed by an electronic device 320, which includes a video encoder 303 coupled to the video source 301. The video encoder 303 may include hardware, software, or a combination of hardware and software to implement or carry out aspects of the disclosed subject matter as described in more detail below. The video encoder 303 may be a computer device, meaning an electronic device with data computing, processing, and storage capabilities, such as a PC, mobile phone, tablet computer, media player, dedicated video conferencing equipment, server, etc. The video encoder 303 based on the method provided in this application may be implemented by one or more processors or one or more integrated circuits.
[0091] Compared to the video image stream 302, the encoded video data 304 (or encoded video stream 304) is depicted as a thin line to emphasize the lower data volume of the encoded video data 304 (or encoded video stream 304), which can be stored on the streaming server 305 for future use. One or more streaming client subsystems, such as... Figure 7 Client subsystems 306 and 308 can access streaming server 305 to retrieve copies 307 and 309 of encoded video data 304. Client subsystem 306 may include, for example, a video decoder 310 in electronic device 330. Video decoder 310 decodes the incoming copy 307 of the encoded video data and produces an output video picture stream 311 that can be displayed on display 312 (e.g., a screen) or another presentation device (not depicted). In some streaming systems, the encoded video data 304, copies 307, and copies 309 (e.g., video streams) may be encoded according to certain video encoding / compression standards.
[0092] It should be noted that electronic devices 320 and 330 may include other components (not shown). For example, electronic device 320 may include a video decoder (not shown), and electronic device 330 may also include a video encoder (not shown). The video decoder is used to decode received encoded video data; the video encoder is used to encode the video data.
[0093] The technical solution of this application will be described and illustrated below through several embodiments.
[0094] Please refer to Figure 8FIG. 8 shows a flowchart of a method of video decoding according to an embodiment of the present application. The method can be applied in a video decoder, such as the second device 220 in the communication system shown in FIG. 2. The method can include the following steps (steps 810-840): Figure 6
[0095] Step 810, decode the target coding unit to obtain a quantized coefficient matrix corresponding to the target coding unit.
[0096] As described above, after the video decoder obtains the video bitstream, the video decoder performs the inverse operation of the operation performed by the video encoder. Therefore, the video decoder needs to first decode each coding unit in the video bitstream. Optionally, the video decoder decodes the video bitstream by using entropy decoding. In the embodiment of the present application, the video decoder decodes the target coding unit to obtain a quantized coefficient matrix corresponding to the target coding unit, wherein the quantized coefficient matrix includes at least one quantized transform coefficient (hereinafter referred to as “quantized coefficient”).
[0097] The target coding unit refers to a coding unit to be processed in the video decoding process. Optionally, the target coding unit is the current coding unit to be processed, or is a coding unit to be processed after the current coding unit to be processed. The shape of the target coding unit is not limited in the embodiment of the present application. Optionally, the target coding unit is a square, i.e., the width and the height of the target coding unit are equal. Alternatively, the target coding unit is a rectangle, i.e., the width and the height of the target coding unit are not equal. The size of the target coding unit is not limited in the embodiment of the present application. Optionally, the size of the target coding unit is 64x64 or 128x128 or 128x64. In actual applications, the size of the target coding unit can be determined in combination with the maximum allowed size of the coding unit in the video coding process. For example, if the maximum allowed size of the coding unit in the video coding process is 128x128, the size of the target coding unit is less than or equal to 128x128.
[0098] Step 820, determine the first reference information according to the quantized coefficients in the quantized coefficient matrix.
[0099] The video decoder, after obtaining the quantization coefficient matrix, determines first reference information according to the quantization coefficients in the quantization coefficient matrix, the first reference information being used to determine the value of the flag bit of the sub-block transform position of the target coding unit (hereinafter referred to as "transform flag bit"). Optionally, the first reference information is a numerical value, for example, the first reference information is a quantization coefficient in the quantization coefficient matrix, or the first reference information is a statistical summation result of a plurality of quantization coefficients in the quantization coefficient matrix, or the first reference information is a remainder obtained by dividing the statistical summation result of a plurality of quantization coefficients in the quantization coefficient matrix by a calculation factor. For a detailed description of the determination process of the first reference information, please refer to the method embodiment below, which will not be described here.
[0100] It should be noted that the "quantization coefficient in the quantization coefficient matrix" described herein is only used to indicate that the determination of the first reference information is based on the quantization coefficient of the quantization coefficient matrix of the target coding unit, and is not used to limit the specific number of quantization coefficients. It should be understood that the "quantization coefficient in the quantization coefficient matrix" described herein can be one quantization coefficient in the quantization coefficient matrix, can be a plurality of quantization coefficients in the quantization coefficient matrix, or can be all quantization coefficients in the quantization coefficient matrix, and the embodiments of the present application do not limit this.
[0101] At step 830, the value of the transform flag bit corresponding to the first reference information is obtained, the transform flag bit being the flag bit of the sub-block transform position, and the sub-block transform position being the position of the sub-block in the coding unit that needs to be transformed and quantized.
[0102] As can be seen from the above description, for the process of transforming and quantizing the residual signal corresponding to the coding unit, the coding unit needs to be divided into sub-blocks, and the residual data of part of the sub-blocks obtained by the division needs to be transformed and quantized, while the other sub-blocks are forcibly cleared. The position of the sub-block in the coding unit that needs to be transformed and quantized can be referred to as the sub-block transform position. The transform flag bit is the flag bit of the sub-block transform position, that is, the value of the transform flag bit can be used to determine the sub-block transform position.
[0103] It should be understood that the "sub-block transform position" and the "transform flag bit" in the embodiments of the present application are only exemplary names, and as the video standard evolves and different naming habits are adopted, the "sub-block transform position" and the "transform flag bit" can be referred to as other names, for example, the "sub-block transform position" can be referred to as "transform sub-block position", etc. These names having the same meaning as the "sub-block transform position" and the names having the same meaning as the "transform flag bit" shall all fall within the protection scope of the present application.
[0104] In the embodiments of the present application, the reference information used to determine the value of the transform flag bit has a corresponding relationship (or a mapping relationship, etc.) with the value of the transform flag bit, that is, the value of the transform flag bit can be obtained by referring to the reference information. Based on this, after determining the first reference information according to the quantization coefficients in the quantization coefficient matrix, the video decoder can further obtain the value of the transform flag bit corresponding to the first reference information. The present application does not limit the corresponding manner between the reference information and the value of the transform flag bit. Alternatively, the reference information and the value of the transform flag bit are in one-to-one correspondence; or the reference information and the value of the transform flag bit are in a many-to-one correspondence; or the reference information itself does not have a corresponding relationship with the value of the transform flag bit, but the nature of the reference information has a corresponding relationship with the value of the transform flag bit, for example, the parity of the reference information has a corresponding relationship with the value of the transform flag bit. The present application does not limit the determination manner of the corresponding relationship between the reference information and the value of the transform flag bit. Alternatively, it can be predefined by the video standard; or determined by the video encoder and the video decoder; or determined by the video encoder and written into the video code stream to notify the video decoder; or pre-stored in the video decoder.
[0105] In one example, the transform flag bit includes at least one of the following: a first flag bit for indicating a division direction of the sub-block transform position of the target coding unit, and the division direction includes horizontal division and vertical division; and a second flag bit for indicating the sub-block transform position of the target coding unit based on the division direction indicated by the first flag bit. The first flag bit can be sbt_dir_flag in the above embodiments, and the second flag bit can be sbt_pos_flag in the above embodiments. Based on this, in the embodiments of the present application, the value of one flag bit (such as sbt_dir_flag or sbt_pos_flag) can be determined according to the first reference information, or the values of multiple flag bits (such as sbt_dir_flag and sbt_pos_flag) can be determined according to the first reference information. For other descriptions of obtaining the value of the transform flag bit corresponding to the first reference information, please refer to the following method embodiments, which will not be described here.
[0106] In step 840, the sub-block transform position of the target coding unit is determined according to the obtained value of the transform flag bit.
[0107] The video decoder can derive the sub-block transform position of the target coding unit according to the obtained value of the transform flag bit, and perform subsequent processing according to the sub-block transform position.
[0108] In one example, since the video encoder can rotate the quantization coefficient matrix and then encode the rotated quantization coefficient matrix, in order to ensure that the encoding process of the video encoder corresponds to the decoding process of the video decoder, the video decoder should also rotate the quantization coefficient matrix after decoding the quantization coefficient matrix. Optionally, as shown in Figure 9 the direction of the quantization coefficient matrix in the video coding process includes a horizontal direction and a vertical direction, in the case where the direction of the quantization coefficient matrix needs to be unified to the horizontal direction, the quantization coefficient matrix in the vertical direction needs to be rotated to the horizontal direction, and the quantization coefficient matrix in the horizontal direction does not need to be rotated; in the case where the direction of the quantization coefficient matrix needs to be unified to the vertical direction, the quantization coefficient matrix in the horizontal direction needs to be rotated to the vertical direction, and the quantization coefficient matrix in the vertical direction does not need to be rotated.
[0109] Optionally, the video decoder determines whether to rotate the quantization coefficient matrix according to the value of the transform flag, based on which, after obtaining the value of the transform flag corresponding to the first reference information, the method further includes: determining whether the quantization coefficient matrix needs to be rotated according to the obtained value of the transform flag; in the case where it is determined that the quantization coefficient matrix needs to be rotated, rotating the direction of the quantization coefficient matrix from the first direction to the second direction to obtain the rotated quantization coefficient matrix; and performing inverse quantization and inverse transformation on the rotated quantization coefficient matrix to obtain the residual data. In the determination of whether to rotate the quantization coefficient matrix, the video decoder can refer to a first flag in the transform flag, which is used to indicate the division direction of the sub-block transform position of the target coding unit, such as the above-mentioned “sbt_dir_flag”.
[0110] For example, as shown in Figure 9 , assuming that the “sbt_dir_flag” of the sub-block transform position in the horizontal direction is 1, and the “sbt_dir_flag” of the sub-block transform position in the vertical direction is 0, and the direction of the quantization coefficient matrix needs to be rotated to the horizontal direction in the coding process, then the quantization coefficient matrix corresponding to the sub-block transform position with the “sbt_dir_flag” of 0 needs to be rotated to the horizontal direction, and the quantization coefficient matrix corresponding to the sub-block transform position with the “sbt_dir_flag” of 1 does not need to be rotated.
[0111] In summary, the technical scheme provided by the embodiments of the present application indicates the flag bit of the sub-block transform position in the target coding unit by the quantization coefficient in the quantization coefficient matrix corresponding to the coding unit, and then determines the sub-block transform position in the target coding unit, thereby avoiding explicit coding of the sub-block transform position, reducing the number of bits occupied by the video code stream, and improving the video coding efficiency. Moreover, in the technical scheme provided by the embodiments of the present application, since each flag bit of the sub-block transform position does not need to be explicitly coded and decoded, the processing overhead of the video encoder and the video decoder can be reduced, which is helpful to improve the coding efficiency of the video encoder and the decoding efficiency of the video decoder.
[0112] Next, the way of implicitly indicating the value of the transform flag bit by the quantization coefficient matrix provided by the embodiments of the present application is described.
[0113] In one example, the step 820 described above includes the following steps:
[0114] The step 822 includes the following steps:
[0115] If the corresponding relationship between the quantization coefficient and the value of the transform flag bit is directly established, too many quantization coefficients may need to correspond to the same value of the transform flag bit due to the too large value range of the quantization coefficient and the values of the transform flag bit being only 0 and 1, thereby causing the corresponding relationship between the quantization coefficient and the value of the transform flag bit to be too complex. In the embodiments of the present application, the sum of the quantization coefficients is calculated and then the remainder is taken, and the corresponding relationship between the remainder and the value of the transform flag bit is established. Since the value range of the remainder is smaller than the value range of the quantization coefficient, the complexity of the corresponding relationship can be reduced to a certain extent. Therefore, at least one quantization coefficient in the quantization coefficient matrix needs to be obtained, that is, the statistical region in the quantization coefficient matrix needs to be determined.
[0116] The embodiments of the present application do not limit the way of obtaining the at least one quantization coefficient, and the following examples show several possible ways of obtaining the at least one quantization coefficient. Optionally, the step 822 described above includes at least one of the following implementation manners:
[0117] (1) All quantization coefficients in the quantization coefficient matrix are obtained.
[0118] That is, the entire quantization coefficient matrix is taken as the basis for implicitly indicating the value of the transform flag bit.
[0119] (2) The quantization coefficient at at least one specified position in the quantization coefficient matrix is obtained.
[0120] The specified position can be predefined by a video standard, specified by a video encoder and informed to a video decoder, or determined by the video encoder and the video decoder in the same way, which is not limited in the embodiments of the present application.
[0121] (3) Obtain the quantization coefficients in at least one row of the quantization coefficient matrix.
[0122] For example, as shown in FIG. 3, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 3(a), the quantization coefficients in one row indicated by the shaded part are obtained; or as shown in FIG. 3(b), the quantization coefficients in two rows indicated by the shaded part are obtained. Figure 10 Figure 10 For example, as shown in FIG. 3, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 3(a), the quantization coefficients in one row indicated by the shaded part are obtained; or as shown in FIG. 3(b), the quantization coefficients in two rows indicated by the shaded part are obtained. Figure 10
[0123] The relative position of the obtained quantization coefficient region (i.e., at least one row) in the quantization coefficient matrix is not limited in the embodiments of the present application. Optionally, the obtained quantization coefficient region is located at the edge (such as the upper edge, the lower edge, the upper edge and the lower edge) of the quantization coefficient matrix, or is located in the middle of the quantization coefficient matrix.
[0124] (4) Obtain the quantization coefficients in at least one column of the quantization coefficient matrix.
[0125] For example, as shown in FIG. 4, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 4(a), the quantization coefficients in one column indicated by the shaded part are obtained; or as shown in FIG. 4(b), the quantization coefficients in two columns indicated by the shaded part are obtained. Figure 10 Figure 10 For example, as shown in FIG. 4, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 4(a), the quantization coefficients in one column indicated by the shaded part are obtained; or as shown in FIG. 4(b), the quantization coefficients in two columns indicated by the shaded part are obtained. Figure 10 For example, as shown in FIG. 4, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 4(a), the quantization coefficients in one column indicated by the shaded part are obtained; or as shown in FIG. 4(b), the quantization coefficients in two columns indicated by the shaded part are obtained.
[0126] The relative position of the obtained quantization coefficient region (i.e., at least one column) in the quantization coefficient matrix is not limited in the embodiments of the present application. Optionally, the obtained quantization coefficient region is located at the edge (such as the left edge, the right edge, the left edge and the right edge) of the quantization coefficient matrix, or is located in the middle of the quantization coefficient matrix.
[0127] (5) Obtain the quantization coefficients in at least one diagonal of the quantization coefficient matrix.
[0128] For example, as shown in FIG. 5, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 5(a), the quantization coefficients in one diagonal indicated by the shaded part are obtained; or as shown in FIG. 5(b), the quantization coefficients in two diagonals indicated by the shaded part are obtained. Figure 10 Figure 10 (c) as shown in FIG. 2(c), obtaining the quantization coefficients on one diagonal line shown by the shaded part in the quantization coefficient matrix; or Figure 10 (c) as shown in FIG. 2(c), obtaining the quantization coefficients on two diagonal lines shown by the shaded part in the quantization coefficient matrix. Optionally, the diagonal lines on which the obtained quantization coefficients are located correspond to the order of the reverse zigzag scanning performed on the quantization coefficient matrix in the above embodiment.
[0129] (6) obtaining the quantization coefficients in the quantization coefficient matrix whose scanning order is located in the first n positions, n being a positive integer.
[0130] That is, obtaining the first n quantization coefficients in the quantization coefficient matrix.
[0131] (7) obtaining the quantization coefficients in the quantization coefficient matrix whose scanning order is located in the middle m positions, m being a positive integer.
[0132] That is, obtaining the m quantization coefficients in the middle of the scanning process of the quantization coefficient matrix.
[0133] Optionally, in the embodiments of the present application, the quantization coefficients in the quantization coefficient matrix whose scanning order is located in the last w positions, w being a positive integer, can also be obtained. That is, obtaining the last w quantization coefficients in the quantization coefficient matrix.
[0134] As can be seen from the above description, in the video coding process, the quantization coefficient matrix can be subjected to SRCC scanning, and then only the quantization coefficients in the marked scanning region need to be encoded. Therefore, in the case that the quantization coefficient matrix is subjected to SRCC scanning, the value of the transform flag bit can also be implicitly indicated according to the quantization coefficients in the SRCC region (scanning region). Based on this, the obtaining of at least one quantization coefficient also includes the following obtaining methods:
[0135] (8) obtaining all the quantization coefficients in the SRCC region of the quantization coefficient matrix.
[0136] That is, taking the entire SRCC region as a whole to implicitly indicate the value of the transform flag bit.
[0137] (9) obtaining the quantization coefficients in at least one specified position in the SRCC region of the quantization coefficient matrix.
[0138] Optionally, the quantization coefficients in the at least one specified position in the SRCC region can be the first scanned quantization coefficients, the last scanned quantization coefficients, or the at least one quantization coefficient in the middle of the scanning process. As described above, the at least one specified position in the SRCC region can be predefined by the video standard, specified by the video encoder and informed to the video decoder, or determined by the video encoder and the video decoder in the same way, which is not limited in the embodiments of the present application.
[0139] (10) obtaining the quantization coefficients in at least one row of the SRCC region of the quantization coefficient matrix.
[0140] For example, as shown in FIG. 10, the quantization coefficients in the SRCC region of the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient in the SRCC region. Assuming that the SRCC region is a 4x4 coefficient matrix, as shown in FIG. 11(a), the quantization coefficients in one row of the SRCC region shown by the shaded part are obtained; or as shown in FIG. 11(b), the quantization coefficients in two rows of the SRCC region shown by the shaded part are obtained. Figure 10 Figure 10 Figure 10
[0141] The embodiments of the present application do not limit the relative position of the obtained quantization coefficient region in the SRCC region of the quantization coefficient matrix, and optionally, the obtained quantization coefficient region (i.e., at least one row) is located at the edge (such as the upper edge, the lower edge, the upper edge and the lower edge) of the SRCC region, or in the middle of the SRCC region.
[0142] (11) obtaining the quantization coefficients in at least one column of the SRCC region of the quantization coefficient matrix.
[0143] For example, as shown in FIG. 12, the quantization coefficients in the SRCC region of the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient in the SRCC region. Assuming that the SRCC region is a 4x4 coefficient matrix, as shown in FIG. 13(a), the quantization coefficients in one column of the SRCC region shown by the shaded part are obtained; or as shown in FIG. 13(b), the quantization coefficients in two columns of the SRCC region shown by the shaded part are obtained. Figure 10 Figure 10 Figure 10
[0144] The embodiments of the present application do not limit the relative position of the obtained quantization coefficient region in the SRCC region of the quantization coefficient matrix, and optionally, the obtained quantization coefficient region (i.e., at least one column) is located at the edge (such as the left edge, the right edge, the left edge and the right edge) of the SRCC region, or in the middle of the SRCC region.
[0145] (12) Obtain the quantization coefficients on at least one diagonal line in the SRCC region of the quantization coefficient matrix.
[0146] For example, as shown in FIG. 12, the quantization coefficients in the SRCC region of the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient in the SRCC region. Assuming that the SRCC region is a 4x4 coefficient matrix, as shown in FIG. 12(a), the quantization coefficients on one diagonal line in the SRCC region are obtained. Figure 10 Figure 10 (c), the quantization coefficients on two diagonal lines in the SRCC region shown by the shaded parts are obtained. Alternatively, the diagonal lines on which the obtained quantization coefficients are located correspond to the order of the reverse zigzag scanning performed on the quantization coefficient matrix in the above embodiment. Figure 10
[0147] (13) Obtain the quantization coefficients in the SRCC region of the quantization coefficient matrix whose scanning order is located in the first s positions, s being a positive integer.
[0148] That is, the first s quantization coefficients in the SRCC region of the quantization coefficient matrix are obtained.
[0149] (14) Obtain the quantization coefficients in the SRCC region of the quantization coefficient matrix whose scanning order is located in the middle t positions, t being a positive integer.
[0150] That is, the m quantization coefficients whose scanning order is located in the middle in the scanning process of the SRCC region of the quantization coefficient matrix are obtained.
[0151] Alternatively, the quantization coefficients in the SRCC region of the quantization coefficient matrix whose scanning order is located in the last x positions, x being a positive integer, can also be obtained in the embodiments of the present application. That is, the last x quantization coefficients in the quantization coefficient matrix are obtained.
[0152] It should be noted that the above is only for the convenience of description, and various ways of obtaining at least one quantization coefficient are introduced and described respectively. In actual application, at least one quantization coefficient can be obtained in combination with the above-mentioned various obtaining methods, and these combinations should all belong to the protection scope of the present application. For example:
[0153] (15) Obtain the quantization coefficients on at least one row and at least one column in the quantization coefficient matrix.
[0154] For example, as shown in FIG. 13, the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, as shown in FIG. 13(a), the quantization coefficients on at least one row and at least one column in the quantization coefficient matrix are obtained. Figure 10 Figure 10 (d) as shown, obtaining the quantization coefficients in one row and one column of the shaded part in the quantization coefficient matrix; or, as shown in Figure 10 (d) as shown, obtaining the quantization coefficients in two rows and two columns of the shaded part in the quantization coefficient matrix. The embodiments of the present application do not limit the relative position of the obtained quantization coefficient region in the quantization coefficient matrix, and the obtained quantization coefficient region (i.e., at least one row and at least one column) can be located at the edge (such as the upper edge and the left edge, the lower edge and the right edge, the upper edge and the right edge, the lower edge and the left edge, etc.) of the quantization coefficient matrix; or, in the middle of the quantization coefficient matrix; or, at any specified position in the quantization coefficient matrix.
[0155] (16) Obtaining the quantization coefficients in at least one row and at least one column of the SRCC region of the quantization coefficient matrix.
[0156] As shown in Figure 10 , the quantization coefficients in the SRCC region of the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the SRCC region of the quantization coefficient matrix is a 4x4 coefficient matrix, then, as shown in Figure 10 (d) as shown, obtaining the quantization coefficients in one row and one column of the shaded part in the quantization coefficient matrix; or, as shown in Figure 10 (d) as shown, obtaining the quantization coefficients in two rows and two columns of the shaded part in the quantization coefficient matrix. The embodiments of the present application do not limit the relative position of the obtained quantization coefficient region in the quantization coefficient matrix, and the obtained quantization coefficient region (i.e., at least one row and at least one column) can be located at the edge (such as the upper edge and the left edge, the lower edge and the right edge, the upper edge and the right edge, the lower edge and the left edge, etc.) of the quantization coefficient matrix; or, in the middle of the quantization coefficient matrix; or, at any specified position in the quantization coefficient matrix.
[0157] (17) Obtaining the quantization coefficients in at least one diagonal line and at least one specified position in the quantization coefficient matrix.
[0158] As shown in Figure 10 , the quantization coefficients in the quantization coefficient matrix are represented by blocks, and each block represents one quantization coefficient. Assuming that the quantization coefficient matrix is a 4x4 coefficient matrix, then, as shown in Figure 10 (c) as shown, obtaining the quantization coefficients in one diagonal line and one specified position of the shaded part in the quantization coefficient matrix; or, as shown in Figure 11 (c) as shown, obtaining the quantization coefficients in two diagonal lines and one specified position of the shaded part in the quantization coefficient matrix.
[0159] (18) Obtain at least one slash and at least one quantization coefficient at a specified position in the SRCC region of the quantization coefficient matrix.
[0160] like Figure 6 As shown, the quantization coefficients in the SRCC region of the quantization coefficient matrix are represented by squares, with each square representing one quantization coefficient. Assuming the SRCC region of the quantization coefficient matrix is a 4×4 coefficient matrix, it can be represented as follows: Figure 12 As shown in (c), obtain a slanted line and a quantization coefficient at a specified position in the shaded area of the SRCC region of the quantization coefficient matrix; or, as shown in Figure 7 As shown in (c), the SRCC region of the quantization coefficient matrix is obtained by showing the two slanted lines and a quantization coefficient at a specified position in the shaded area.
[0161] Another point to note is that, in the embodiments of this application, the video decoder and the video encoder should adopt the same method of implicitly indicating the value of the transform flag, and select the quantization coefficients in the same region of the quantization coefficient matrix to implicitly indicate the value of the transform flag, so as to ensure the consistency of the video encoding and video decoding processes.
[0162] Step 824: Perform statistical summation on at least one quantization coefficient to obtain the statistical summation result.
[0163] After obtaining at least one quantization coefficient, a statistical summation process can be performed on the at least one quantization coefficient to obtain the statistical summation result.
[0164] This application does not limit the statistical summation method for at least one quantization coefficient. Several possible statistical summation methods are illustrated below. Optionally, step 824 above includes any of the following implementation methods:
[0165] (1) Perform statistical summation on the original value of at least one quantization coefficient to obtain the statistical summation result.
[0166] That is, statistical summation is performed directly on at least one quantization coefficient to obtain the statistical summation result.
[0167] (2) Perform statistical summation on the absolute value of at least one quantization coefficient to obtain the statistical summation result.
[0168] That is, the absolute value of at least one quantization coefficient is taken first, and then the absolute values of at least one quantization coefficient are statistically summed to obtain the statistical summation result.
[0169] (3) Perform statistical summation on the original values of at least one quantization coefficient whose original value is odd, and obtain the statistical summation result.
[0170] (4) performing statistical summation processing on the original values of the quantization coefficients with even original values in the at least one quantization coefficient, to obtain a statistical summation result.
[0171] (5) performing statistical summation processing on the absolute values of the quantization coefficients with odd original values in the at least one quantization coefficient, to obtain a statistical summation result.
[0172] (6) performing statistical summation processing on the absolute values of the quantization coefficients with even original values in the at least one quantization coefficient, to obtain a statistical summation result.
[0173] (7) performing statistical summation processing on the original values of the quantization coefficients with non-zero even original values in the at least one quantization coefficient, to obtain a statistical summation result.
[0174] (8) performing statistical summation processing on the absolute values of the quantization coefficients with non-zero even original values in the at least one quantization coefficient, to obtain a statistical summation result.
[0175] (9) performing mapping processing on each of the quantization coefficients in the at least one quantization coefficient, to obtain at least one mapped quantization coefficient; and performing statistical summation processing on the at least one mapped quantization coefficient, to obtain a statistical summation result.
[0176] That is, the at least one quantization coefficient is respectively mapped, and then statistical summation processing is performed on the at least one mapped quantization coefficient, to obtain a statistical summation result.
[0177] The present embodiment does not limit the mapping processing mode, and the following exemplary mapping processing modes provided by the present embodiment are described. Optionally, the mapping processing on each of the quantization coefficients in the at least one quantization coefficient, to obtain at least one mapped quantization coefficient, includes any one of the following implementation modes:
[0178] (1) mapping the quantization coefficients with odd original values in the at least one quantization coefficient to a first value, to obtain at least one first quantization coefficient; and mapping the quantization coefficients with even original values in the at least one quantization coefficient to a second value, to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient.
[0179] The first value and the second value can be different values. Optionally, the parity of the first value and the parity of the second value are the same, or the parity of the first value and the parity of the second value are different. The present embodiment does not limit the specific values of the first value and the second value, and optionally, the first value and the second value include the following possible value modes.
[0180] For example, the first value is 0 and the second value is 1, and the mapping is that the original value of the odd quantization coefficient in the at least one quantization coefficient is mapped to 0, and the original value of the even quantization coefficient in the at least one quantization coefficient is mapped to 1, that is, the original value of the even quantization coefficient in the at least one quantization coefficient is mapped and summed, and the original value of the odd quantization coefficient in the at least one quantization coefficient is ignored.
[0181] For example, the first value is 1 and the second value is 0, and the mapping is that the original value of the odd quantization coefficient in the at least one quantization coefficient is mapped to 1, and the original value of the even quantization coefficient in the at least one quantization coefficient is mapped to 0, that is, the original value of the odd quantization coefficient in the at least one quantization coefficient is mapped and summed, and the original value of the even quantization coefficient in the at least one quantization coefficient is ignored.
[0182] For example, the first value is 3 and the second value is 2, and the mapping is that the original value of the odd quantization coefficient in the at least one quantization coefficient is mapped to 3, and the original value of the even quantization coefficient in the at least one quantization coefficient is mapped to 2.
[0183] For example, the first value is 2 and the second value is 3, and the mapping is that the original value of the odd quantization coefficient in the at least one quantization coefficient is mapped to 2, and the original value of the even quantization coefficient in the at least one quantization coefficient is mapped to 3.
[0184] (2) mapping the original value of the zero quantization coefficient in the at least one quantization coefficient to the first value to obtain at least one first quantization coefficient, and mapping the original value of the non-zero quantization coefficient in the at least one quantization coefficient to the second value to obtain at least one second quantization coefficient, wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient.
[0185] The first value and the second value can be different values. Alternatively, the parity of the first value and the parity of the second value are the same, or the parity of the first value and the parity of the second value are different. The specific values of the first value and the second value are not limited in the embodiments of the present application. Alternatively, the first value and the second value include the following possible value modes.
[0186] For example, the first value is 0 and the second value is 1, and the mapping is that the original value of the zero quantization coefficient in the at least one quantization coefficient is mapped to 0, and the original value of the non-zero quantization coefficient in the at least one quantization coefficient is mapped to 1, that is, the original value of the non-zero quantization coefficient in the at least one quantization coefficient is mapped and summed, and the original value of the zero quantization coefficient in the at least one quantization coefficient is ignored.
[0187] For example, the first value is 1 and the second value is 0, and the mapping is that the original value of 0 of the at least one quantization coefficient is mapped to 1, and the original value of non-0 of the at least one quantization coefficient is mapped to 0, that is, the original value of 0 of the at least one quantization coefficient is mapped and summed, and the original value of non-0 of the at least one quantization coefficient is ignored.
[0188] For example, the first value is 3 and the second value is 2, and the mapping is that the original value of 0 of the at least one quantization coefficient is mapped to 3, and the original value of non-0 of the at least one quantization coefficient is mapped to 2.
[0189] For example, the first value is 2 and the second value is 3, and the mapping is that the original value of 0 of the at least one quantization coefficient is mapped to 2, and the original value of non-0 of the at least one quantization coefficient is mapped to 3.
[0190] (3) The original value of non-0 even of the at least one quantization coefficient is mapped to the first value to obtain at least one first quantization coefficient, and the original value of odd or 0 of the at least one quantization coefficient is mapped to the second value to obtain at least one second quantization coefficient, wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient.
[0191] The first value and the second value can be different values. Alternatively, the parity of the first value and the parity of the second value are the same, or the parity of the first value and the parity of the second value are different. The specific values of the first value and the second value are not limited in the embodiments of the present application. Alternatively, the first value and the second value include the following possible value modes.
[0192] For example, the first value is 0 and the second value is 1, and the mapping is that the original value of non-0 even of the at least one quantization coefficient is mapped to 0, and the original value of odd or 0 of the at least one quantization coefficient is mapped to 1, that is, the original value of odd or 0 of the at least one quantization coefficient is mapped and summed, and the original value of non-0 even of the at least one quantization coefficient is ignored.
[0193] For example, the first value is 1 and the second value is 0, and the mapping is that the original value of non-0 even of the at least one quantization coefficient is mapped to 1, and the original value of odd or 0 of the at least one quantization coefficient is mapped to 0, that is, the original value of non-0 even of the at least one quantization coefficient is mapped and summed, and the original value of odd or 0 of the at least one quantization coefficient is ignored.
[0194] For example, the first value is 3 and the second value is 2, and the mapping is that the quantized coefficients with the original values of even non-zero are mapped to 3 respectively, and the quantized coefficients with the original values of odd or zero are mapped to 2 respectively.
[0195] For example, the first value is 2 and the second value is 3, and the mapping is that the quantized coefficients with the original values of even non-zero are mapped to 2 respectively, and the quantized coefficients with the original values of odd or zero are mapped to 3 respectively.
[0196] (4) performing a calculation mapping processing on the at least one quantized coefficient to obtain at least one mapped quantized coefficient; wherein the calculation mapping processing comprises at least one of the following: a negation mapping, an addition mapping, a subtraction mapping, a multiplication mapping, and a division mapping.
[0197] In addition to mapping the quantized coefficients with different properties respectively according to different properties of the at least one quantized coefficient, a unified mapping processing can also be performed on the at least one quantized coefficient. In the embodiments of the present application, a calculation mapping processing can be performed on the at least one quantized coefficient, and a statistical summation processing is performed on the at least one calculation mapping processed quantized coefficient to obtain a statistical summation result.
[0198] Optionally, the calculation mapping processing comprises at least one of the following: a negation mapping (i.e., mapping each of the at least one quantized coefficient to an opposite number), an addition mapping (i.e., adding a certain value, such as 1 or 2, to each of the at least one quantized coefficient), a subtraction mapping (i.e., subtracting a certain value, such as 1 or 2, from each of the at least one quantized coefficient), a multiplication mapping (i.e., multiplying each of the at least one quantized coefficient by a certain value, such as 2 or 4), and a division mapping (i.e., dividing each of the at least one quantized coefficient by a certain value, such as 2 or 4).
[0199] It should be noted that, in the embodiments of the present application, the mapping processing of the at least one quantized coefficient adopts linear mapping for the consideration of calculation amount, and in actual application, if the constraint of calculation amount is not considered, a non-linear mapping, such as an exponential mapping, can also be adopted for the at least one quantized coefficient.
[0200] It should be noted that the mapping processing provided by the embodiments of the present application can be implemented alone or in combination, for example, an addition mapping is first performed on each of the at least one quantized coefficient to obtain at least one mapped quantized coefficient, and then odd numbers in the at least one mapped quantized coefficient are mapped to a first value to obtain at least one first quantized coefficient, and even numbers are mapped to a second value to obtain at least one second quantized coefficient. It should be understood that all of these should be within the protection scope of the present application.
[0201] At step 826, the statistical summation result is processed by taking remainder according to the first calculation factor, and the first reference information is obtained.
[0202] The first calculation factor is a non-zero integer. For the video decoder, the first calculation factor is a calculation factor for taking remainder of the statistical summation result, i.e., the first calculation factor is a divisor. Optionally, the first calculation factor is a predefined calculation factor, or a specified calculation factor, or a calculation factor determined by the video encoder and the video decoder in the same manner. According to the statistical summation result and the first calculation factor, the first reference information is obtained. Optionally, the first reference information is a remainder obtained by dividing the statistical summation result by the first calculation factor.
[0203] Since the first reference information is a result of taking remainder of the statistical summation result by the first calculation factor, the possible value of the first reference information is equal to the first calculation factor. For example, the first calculation factor is N, and N is a positive integer. Then, the value of the first reference information can be any one of 0 to N-1.
[0204] Based on this, the step 830 includes determining the value of the transform flag corresponding to the first reference information according to the correspondence between the value of the reference information and the value of the transform flag.
[0205] In the embodiments of the present application, the correspondence between the value of the reference information and the value of the transform flag can be established. Optionally, the transform flag includes the first flag and / or the second flag, i.e., the transform flag can have three cases: the first flag (e.g., sbt_dir_flag), the second flag (e.g., sbt_pos_flag), and the first flag and the second flag. Below, the correspondence between the value of the reference information and the value of the transform flag is introduced and described with respect to the three cases of the transform flag.
[0206] With respect to the case that the transform flag includes the first flag or the second flag, i.e., the number of the transform flag is 1, optionally, the reference information includes the first partial remainder and the second partial remainder, and the value of the transform flag includes 0 and 1. The correspondence between the value of the reference information and the value of the transform flag includes: the first partial remainder corresponds to the value of the transform flag being 0; and the second partial remainder corresponds to the value of the transform flag being 1. Optionally, the first calculation factor is 2, the first partial remainder is 0, and the second partial remainder is 1.
[0207] In the case that the transform flag includes the first flag (such as sbt_dir_flag), since the value of the first flag can include 0 and 1, the reference information needs to include at least two possible values, i.e., the remainder obtained by taking the remainder of the first reference information by the first calculation factor needs to include at least two possibilities, based on which the first calculation factor needs to be greater than or equal to 2. In the case that the first calculation factor is equal to 2, the remainder obtained by taking the remainder just includes two possibilities, respectively corresponding to 0 and 1, for example, the remainder of 0 corresponds to the first flag being 0, and the remainder of 1 corresponds to the first flag being 1; or, the remainder of 0 corresponds to the first flag being 1, and the remainder of 1 corresponds to the first flag being 0. In the case that the first calculation factor is greater than 2, the remainder obtained by taking the remainder is greater than two possibilities, so there need to be a plurality of possible remainders corresponding to the same value of the first flag, for example, the first calculation factor is 5, so the remainder obtained by taking the remainder can be 0, 1, 2, 3, 4, and it can be set that the remainder of 0, 1, 2 corresponds to the first flag being 1, and the remainder of 3, 4 corresponds to the first flag being 0; or, it can be set that the remainder of 0, 1 corresponds to the first flag being 1, and the remainder of 2, 3, 4 corresponds to the first flag being 0.
[0208] In the case that the transform flag includes the second flag (such as sbt_pos_flag), since the value of the second flag can include 0 and 1, the reference information needs to include at least two possible values, i.e., the remainder obtained by taking the remainder of the first reference information by the first calculation factor needs to include at least two possibilities, based on which the first calculation factor needs to be greater than or equal to 2. In the case that the first calculation factor is equal to 2, the remainder obtained by taking the remainder just includes two possibilities, respectively corresponding to 0 and 1, for example, the remainder of 0 corresponds to the second flag being 0, and the remainder of 1 corresponds to the second flag being 1; or, the remainder of 0 corresponds to the second flag being 1, and the remainder of 1 corresponds to the second flag being 0. In the case that the first calculation factor is greater than 2, the remainder obtained by taking the remainder is greater than two possibilities, so there need to be a plurality of possible remainders corresponding to the same value of the second flag, for example, the first calculation factor is 5, so the remainder obtained by taking the remainder can be 0, 1, 2, 3, 4, and it can be set that the remainder of 0, 1, 2 corresponds to the second flag being 1, and the remainder of 3, 4 corresponds to the second flag being 0; or, it can be set that the remainder of 0, 1 corresponds to the second flag being 1, and the remainder of 2, 3, 4 corresponds to the second flag being 0.
[0209] In the case that the transform flag bits include a first flag bit and a second flag bit, i.e., the number of transform flag bits is 2, optionally, the reference information includes a first partial remainder, a second partial remainder, a third partial remainder and a fourth partial remainder, the value of the first flag bit includes 0 and 1, and the value of the second flag bit includes 0 and 1; the correspondence between the reference information and the value of the transform flag bits includes: the first partial remainder corresponds to the value of the first flag bit being 0 and the value of the second flag bit being 0; the second partial remainder corresponds to the value of the first flag bit being 0 and the value of the second flag bit being 1; the third partial remainder corresponds to the value of the first flag bit being 1 and the value of the second flag bit being 0; and the fourth partial remainder corresponds to the value of the first flag bit being 1 and the value of the second flag bit being 1. Optionally, the first calculation factor is 4, the first partial remainder is 0, the second partial remainder is 1, the third partial remainder is 2, and the fourth partial remainder is 3.
[0210] In the case that the transform flag bits include a first flag bit (such as sbt_dir_flag) and a second flag bit (such as sbt_pos_flag), since the value of the first flag bit can include 0 and 1, and the value of the second flag bit can include 0 and 1, the combined value of the first flag bit and the second flag bit can include four possibilities: (0, 0), (0, 1), (1, 0), (1, 1). In order to indicate the values of the two flag bits at the same time, the reference information needs to include at least four possible values, i.e., the remainder obtained by taking the first reference information with the first calculation factor needs to include at least four possibilities, based on which the first calculation factor needs to be greater than or equal to 4. In the case that the first calculation factor is equal to 4, the remainder obtained by taking the remainder includes exactly four possibilities, respectively corresponding to (0, 0), (0, 1), (1, 0), (1, 1), for example, the remainder 0 corresponds to (0, 0), the remainder 1 corresponds to (0, 1), the remainder 2 corresponds to (1, 0), and the remainder 3 corresponds to (1, 1). In the case that the first calculation factor is greater than 4, the remainder obtained by taking the remainder includes more than four possibilities, so that a plurality of possible remainders correspond to the same combined value, for example, the first calculation factor is 5, and the remainder obtained by taking the remainder can be 0, 1, 2, 3, 4, and the remainder 0 and 1 can be set to correspond to (0, 0), the remainder 1 corresponds to (0, 1), the remainder 2 corresponds to (1, 0), and the remainder 3 corresponds to (1, 1).
[0211] For the case that the transform flag bit includes both the first flag bit and the second flag bit, the above description is that the remainder obtained by taking the remainder of the statistical summation result indicates both the value of the first flag bit and the value of the second flag bit. It needs to be explained that the value of the first flag bit and the value of the second flag bit can also be indicated respectively or jointly. For example, the above-mentioned obtaining method of at least one quantization coefficient and the statistical summation processing and the taking remainder method are used respectively to obtain two remainders, one of which corresponds to the value of the first flag bit and the other of which corresponds to the value of the second flag bit. It should be understood that these should all belong to the protection scope of the present application.
[0212] Exemplarily, the above-mentioned obtaining method of at least one quantization coefficient is used to obtain the quantization coefficients in the first region of the quantization coefficient matrix; then the above-mentioned statistical summation processing is performed on the quantization coefficients in the first region to obtain a first statistical summation result; then the first statistical summation result is subjected to a remainder processing according to a second calculation factor to obtain a first remainder. The above-mentioned obtaining method of at least one quantization coefficient is used to obtain the quantization coefficients in the second region of the quantization coefficient matrix; then the above-mentioned statistical summation processing is performed on the quantization coefficients in the second region to obtain a second statistical summation result; then the second statistical summation result is subjected to a remainder processing according to a third calculation factor to obtain a second remainder. The second calculation factor and the third calculation factor can be the same calculation factor, for example, both the second calculation factor and the third calculation factor are 2; or they can be different calculation factors, for example, the second calculation factor is 4 and the third calculation factor is 3.
[0213] The first remainder and the second remainder can respectively indicate the value of one flag bit, for example, the first remainder indicates the value of the first flag bit and the second remainder indicates the value of the second flag bit; or they can jointly indicate the values of the two flag bits. Taking the case that the second calculation factor and the third calculation factor are both 2, the first remainder indicates the value of the first flag bit, and the second remainder indicates the value of the second flag bit as an example, then the first remainder can be 0 or 1, the first remainder being 1 indicates that the value of the first flag bit is 1, and the first remainder being 0 indicates that the value of the first flag bit is 0; the second remainder can be 0 or 1, the second remainder being 1 indicates that the value of the second flag bit is 1, and the second remainder being 0 indicates that the value of the second flag bit is 0; the values of the first remainder and the second remainder can respectively be 0 or 1, so the combinations of the first remainder and the second remainder can be (0, 0), (0, 1), (1, 0) and (1, 1), so that the combination (0, 0) indicates that the value of the first flag bit is 0 and the value of the second flag bit is 0, the combination (0, 1) indicates that the value of the first flag bit is 0 and the value of the second flag bit is 1, the combination (1, 0) indicates that the value of the first flag bit is 1 and the value of the second flag bit is 0, and the combination (1, 1) indicates that the value of the first flag bit is 1 and the value of the second flag bit is 1.
[0214] It should be noted that part of the steps in the manner of implicitly indicating the value of the transform flag bit according to the remainder obtained by taking the remainder of the statistical sum of the quantization coefficients can be used in combination with other implicit indication manners. For example, the parity of the remainder obtained by taking the remainder of the statistical sum is used to implicitly indicate the value of the transform flag bit; or the parity of the statistical sum is used to implicitly indicate the value of the transform flag bit. It should be understood that these should all be within the protection scope of the present application. Next, a simple description is given for the case of implicitly indicating the value of the transform flag bit according to the parity of the statistical sum.
[0215] In an example, the above determining the first reference information according to the quantization coefficients in the quantization coefficient matrix comprises: obtaining at least one quantization coefficient in the quantization coefficient matrix; and performing statistical sum processing on the at least one quantization coefficient to obtain the first reference information. Optionally, the above determining the value of the transform flag bit corresponding to the first reference information comprises: determining the parity of the first reference information; and determining the value of the transform flag bit corresponding to the first reference information according to the correspondence between the parity and the value of the transform flag bit. For the obtaining process of the at least one quantization coefficient, the calculation process of the statistical sum result, and the like, please refer to the above method embodiments, which will not be described here in detail.
[0216] In summary, the technical scheme provided by the embodiments of the present application determines the value of the flag bit of the sub-block transform position of the to-be-processed coding unit according to the correspondence between the remainder and the value of the flag bit of the sub-block transform position, by performing summing on at least one quantization coefficient in the quantization coefficient matrix and obtaining the remainder by taking the remainder of the summing result. Since the value range of the remainder is smaller than the value range of the quantization coefficient, the establishment of the correspondence between the remainder and the value of the flag bit of the sub-block transform position can avoid excessive number of the correspondence, reduce the complexity of the correspondence, and improve the acquisition speed of the value of the flag bit of the sub-block transform position.
[0217] In the embodiments of the present application, the video encoder can indicate whether the value of the flag bit of the sub-block transform position is implicitly indicated according to the quantization coefficients in the quantization coefficient matrix through the index in the encoded data in the encoding process. Therefore, the video decoder can determine whether the value of the transform flag bit is determined according to the quantization coefficients according to the index in the encoded data in the decoding process, and if so, the video decoder can perform decoding by using the video decoding method provided by the embodiments of the present application.
[0218] Based on this, in an example, the above method further comprises: determining whether the coding unit in the encoded data needs to determine the value of the transform flag bit according to the quantization coefficient matrix according to the target index in the encoded data.
[0219] The target index in the coded data can be an index bit newly added in the coded data, used to indicate whether the coding units in the coded data need to determine the value of the transform flag bit according to the quantization coefficient matrix. It should be understood that the "coding units in the coded data" in the embodiments of the present application are only used to indicate that the coding units belong to this coded data, and are not used to limit the number of coding units, i.e., are not used to limit all coding units in the coded data. Alternatively, the coding units in the coded data include any one of the following: all coding units in the coded data, coding units in the coded data using the intra prediction mode, and coding units in the coded data using the inter prediction mode.
[0220] Alternatively, the coded data includes at least one sequence, each sequence includes at least one image, each image includes at least one slice (Slice, also known as "slice"), and each slice includes at least one largest coding unit (LCU). Based on this, the above determination of whether the coding units in the coded data need to determine the value of the transform flag bit according to the quantization coefficient matrix based on the target index in the coded data includes at least one of the following:
[0221] (1) A first index is decoded from a sequence header included in the coded data, and the target index includes the first index; and whether the coding units in the first sequence need to determine the value of the transform flag bit according to the quantization coefficient matrix is determined according to the first index.
[0222] For example, in the case where the value of the first index is 1, it is determined that the coding units in the first sequence need to determine the value of the transform flag bit according to the quantization coefficient matrix; and in the case where the value of the first index is 0, it is determined that the coding units in the first sequence do not need to determine the value of the transform flag bit according to the quantization coefficient matrix. Alternatively, the coding units in the first sequence include any one of the following: all coding units in the first sequence, coding units in the first sequence using the intra prediction mode, and coding units in the first sequence using the inter prediction mode.
[0223] (2) A second index is decoded from a picture header included in the coded data, and the target index includes the second index; and whether the coding units in the first image need to determine the value of the transform flag bit according to the quantization coefficient matrix is determined according to the second index.
[0224] For example, in the case where the value of the second index is 1, it is determined that the coding units in the first image need to determine the value of the transform flag bit according to the quantization coefficient matrix; and in the case where the value of the second index is 0, it is determined that the coding units in the first image do not need to determine the value of the transform flag bit according to the quantization coefficient matrix. Alternatively, the coding units in the first image include any one of the following: all coding units in the first image, coding units in the first image using the intra prediction mode, and coding units in the first image using the inter prediction mode.
[0225] (3) decoding a third index from a slice header included in the coded data, the target index including the third index; and determining, according to the third index, whether a coding unit in the first slice needs to determine the value of the transform flag bit according to the quantization coefficient matrix.
[0226] For example, in a case where the value of the third index is 1, it is determined that the coding unit in the first slice needs to determine the value of the transform flag bit according to the quantization coefficient matrix; and in a case where the value of the third index is 0, it is determined that the coding unit in the first slice does not need to determine the value of the transform flag bit according to the quantization coefficient matrix. Optionally, the coding unit in the first slice includes any one of the following: all coding units in the first slice, coding units in the first slice using an intra prediction mode, and coding units in the first slice using an inter prediction mode.
[0227] (4) decoding a fourth index from maximum coding unit header information included in the coded data, the target index including the fourth index; and determining, according to the fourth index, whether a coding unit in the first maximum coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix.
[0228] For example, in a case where the value of the fourth index is 1, it is determined that the coding unit in the first maximum coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix; and in a case where the value of the fourth index is 0, it is determined that the coding unit in the first maximum coding unit does not need to determine the value of the transform flag bit according to the quantization coefficient matrix. Optionally, the coding unit in the first maximum coding unit includes any one of the following: all coding units in the first maximum coding unit, coding units in the first maximum coding unit using an intra prediction mode, and coding units in the first maximum coding unit using an inter prediction mode.
[0229] In the embodiments of the present application, at least two of the first index, the second index, the third index, and the fourth index can be used to determine whether the coding unit in the encoded data needs to determine the value of the transform flag according to the quantization coefficient matrix. Alternatively, the first index and the second index are used to determine whether the value of the transform flag needs to be determined according to the quantization coefficient. The determination of whether the coding unit in the encoded data needs to determine the value of the transform flag according to the quantization coefficient matrix according to the target index in the encoded data includes: decoding the first index from the sequence header included in the encoded data, the target index including the first index; determining whether the coding unit in the first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix according to the first index; in the case where the first index indicates that the coding unit in the first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix, decoding the second index from the picture header included in the encoded data, the target index including the second index; determining whether the coding unit in the first picture needs to determine the value of the transform flag according to the quantization coefficient matrix according to the second index.
[0230] It is assumed that the value of the index is 1, indicating that the coding unit in the encoded data corresponding to the index needs to determine the value of the transform flag according to the quantization coefficient matrix, and the value of the index is 0, indicating that the coding unit in the encoded data corresponding to the index does not need to determine the value of the transform flag according to the quantization coefficient matrix. The following exemplary shows the way of combining to indicate whether the coding unit in the encoded data needs to determine the value of the transform flag according to the quantization coefficient matrix provided by the embodiments of the present application.
[0231] In the case where the first index is 0, it is determined that the coding unit in the first sequence does not need to determine the value of the transform flag according to the quantization coefficient matrix, and at this time, it is no longer necessary to continue to determine the values of the second index, the third index, and the fourth index. Alternatively, the video encoder can only encode the first index, without the need to encode the second index, the third index, and the fourth index.
[0232] In the case where the first index is 1, the value of the second index is further determined, and in the case where the second index is 0, it is determined that the coding unit in the first picture does not need to determine the value of the transform flag according to the quantization coefficient matrix, and at this time, it is no longer necessary to continue to determine the values of the third index and the fourth index. Alternatively, the video encoder can encode the first index and the second index, without the need to encode the third index and the fourth index.
[0233] In the case that the first index is 1 and the second index is 1, a value of a third index is further determined, in the case that the third index is 0, it is determined that the coding unit in the first strip does not need to determine the value of the transform flag bit according to the quantization coefficient matrix, at this time, it is no longer necessary to continue to determine the value of the fourth index. Optionally, the video encoder can encode the first index, the second index and the third index, without encoding the fourth index.
[0234] In the case that the first index is 1, the second index is 1, and the third index is 1, a value of a fourth index is further determined, in the case that the fourth index is 0, it is determined that the coding unit in the first largest coding unit does not need to determine the value of the transform flag bit according to the quantization coefficient matrix, in the case that the fourth index is 1, it is determined that the coding unit in the first largest coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix. Optionally, the video encoder needs to encode the first index, the second index, the third index and the fourth index.
[0235] In another example, the above method further comprises: determining whether the coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix according to the size relationship between the block size of the coding unit and the target block size.
[0236] The target block size can be a pre-defined block size, a block size determined by the video encoder and informed to the video decoder, or a block size determined by the video encoder and the video decoder in the same manner, and the determination manner and size of the target block size are not limited in the embodiments of the present application. In the video coding process, according to the size relationship between the block size of the coding unit and the target block size, it can be determined whether the coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix. For example, when the block size of the coding unit is smaller than the target block size, it is determined that the coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix; when the block size of the coding unit is greater than or equal to the target block size, it is determined that the coding unit does not need to determine the value of the transform flag bit according to the quantization coefficient matrix.
[0237] In yet another example, the above method further comprises: determining whether the coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix according to the number of non-zero quantization coefficients with original values in the quantization coefficient matrix corresponding to the coding unit.
[0238] Optionally, after obtaining the quantization coefficient matrix, the number of quantization coefficients with original non-zero values in the quantization coefficient matrix can be determined, and then the number of quantization coefficients with original non-zero values is compared with a target number to determine whether the coding unit needs to implicitly indicate the value of the transform flag according to the quantization coefficient matrix. For example, in the case where the number of quantization coefficients with original non-zero values is greater than the target number, it is determined that the value of the transform flag needs to be implicitly indicated according to the quantization coefficient matrix; in the case where the number of quantization coefficients with original non-zero values is less than or equal to the target number, it is determined that the value of the transform flag does not need to be implicitly indicated according to the quantization coefficient matrix. The target number can be a predefined number, a number determined by the video encoder and notified to the video decoder, or a number determined by the video encoder and the video decoder in the same manner, and the determination manner and size of the target number are not limited in the embodiments of the present application.
[0239] In still another example, the above method further comprises: determining whether the coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix according to the position of the vertex coordinates in the SRCC region of the quantization coefficient matrix corresponding to the coding unit.
[0240] Optionally, after obtaining the quantization coefficient matrix, the position of the vertex coordinates in the SRCC region of the quantization coefficient matrix can be determined, and whether the value of the transform flag needs to be determined according to the quantization coefficient matrix is determined according to the position of the vertex coordinates. For example, assuming that the vertex coordinates are represented by coordinates (x, y) in a two-dimensional coordinate system, in the case where x is greater than a first reference value and y is greater than a second reference value, it is determined that the value of the transform flag needs to be implicitly indicated according to the quantization coefficient matrix; in the case where x is less than or equal to the first reference value or y is less than or equal to the second reference value, it is determined that the value of the transform flag does not need to be implicitly indicated according to the quantization coefficient matrix. For another example, assuming that the vertex coordinates are represented by coordinates (x, y) in a two-dimensional coordinate system, in the case where x is greater than a first reference value or y is greater than a second reference value, it is determined that the value of the transform flag needs to be implicitly indicated according to the quantization coefficient matrix; in the case where x is less than or equal to the first reference value and y is less than or equal to the second reference value, it is determined that the value of the transform flag does not need to be implicitly indicated according to the quantization coefficient matrix. The target position can be a predefined position, a position determined by the video encoder and notified to the video decoder, or a position determined by the video encoder and the video decoder in the same manner, and the determination manner and size of the target position are not limited in the embodiments of the present application.
[0241] In summary, the technical scheme provided by the embodiments of the present application determines whether the value of the flag bit for the sub-block transform position needs to be determined according to the quantization coefficient matrix in any one of the following manners: the index in the coded data, the size of the coding unit, the number of quantization coefficients with original values that are not zero in the quantization coefficient matrix, and the position of the vertex coordinates in the SRCC region, thereby avoiding the waste of computing resources and improving the decoding efficiency.
[0242] Reference is made to Figure 12 which shows a flowchart of a video encoding method provided by an embodiment of the present application. The method can be applied in a video encoder, such as the first device 210 in the communication system shown in Figure 12 . The method can include the following steps (steps 1110-1140):
[0243] In step 1110, the quantization coefficient matrix corresponding to the target coding unit is obtained.
[0244] As can be known from the above description, after the video encoder performs the prediction encoding on the target coding unit, the residual data corresponding to the target coding unit can be obtained, and then the residual processing is performed on the residual data to obtain the quantization coefficient matrix of the target coding unit. Optionally, in the embodiments of the present application, the residual processing on the residual data includes the transformation and quantization. The transformation is performed on the residual data to obtain the transform coefficients, and then the quantization is performed on the transform coefficients to obtain the quantized transform coefficients, i.e., the quantization coefficients, wherein at least one quantization coefficient can constitute the quantization coefficient matrix.
[0245] In the embodiments of the present application, for the transformation and quantization of the residual signal corresponding to the target coding unit, the target coding unit needs to be divided into sub-blocks, and the transformation and quantization of the residual data are performed on the partial sub-blocks obtained by the division, while the other sub-blocks are forcibly cleared, i.e., neither transformation nor quantization is performed on the other sub-blocks. Based on this, in one example, the step 1110 includes: performing the prediction encoding on the target coding unit to obtain the residual data corresponding to the target coding unit; determining the sub-block transform position of the target coding unit; and performing the transformation and quantization on the residual data according to the sub-block transform position to obtain the quantization coefficient matrix.
[0246] In step 1120, the value of the transform flag bit that needs to be indicated by the quantization coefficient matrix is determined, wherein the transform flag bit refers to the flag bit for the sub-block transform position of the target coding unit, and the sub-block transform position refers to the position of the sub-blocks in the target coding unit that need to be transformed and quantized.
[0247] The flag bits of the sub-block transform position (transform flag bits) can include multiple flag bits. In one example, the transform flag bits include at least one of the following: a first flag bit for indicating a division direction of the sub-block transform position of the target coding unit, the division direction including horizontal division and vertical division; and a second flag bit for indicating the sub-block transform position of the target coding unit based on the division direction indicated by the first flag bit. The video encoder can determine the flag bits that need to be implicitly indicated, and the values of the flag bits that need to be implicitly indicated. Optionally, the video encoder can determine the values of the flag bits that need to be implicitly indicated when determining the sub-block transform position.
[0248] At step 1130, the quantization coefficient in the quantization coefficient matrix is adjusted according to the value of the transform flag bit to obtain an adjusted quantization coefficient matrix.
[0249] To ensure that the video decoder can accurately determine the values of the implicitly indicated flag bits through the quantization coefficients in the quantization coefficient matrix, in the embodiments of the present application, the video encoder adjusts the quantization coefficients in the quantization coefficient matrix according to the values of the implicitly indicated flag bits in the encoding process to obtain an adjusted quantization coefficient matrix.
[0250] In one example, the above step 1130 includes: determining the reference information corresponding to the value of the transform flag bit as first reference information; obtaining at least one quantization coefficient in the quantization coefficient matrix; performing statistical summation processing on the at least one quantization coefficient to obtain a statistical summation result; and adjusting the at least one quantization coefficient according to the statistical summation result, the first reference information and a first calculation factor to obtain an adjusted at least one quantization coefficient; wherein the first reference information is obtained by performing a remainder processing on the statistical summation result of the adjusted at least one quantization coefficient through the first calculation factor, and the first calculation factor is a non-zero integer.
[0251] Optionally, the above obtaining at least one quantization coefficient in the quantization coefficient matrix includes at least one of the following implementation manners:
[0252] (1) All quantization coefficients in the quantization coefficient matrix are obtained.
[0253] (2) The quantization coefficient at at least one specified position in the quantization coefficient matrix is obtained.
[0254] (3) The quantization coefficients in at least one row of the quantization coefficient matrix are obtained.
[0255] (4) The quantization coefficients in at least one column of the quantization coefficient matrix are obtained.
[0256] (5) The quantization coefficients in at least one diagonal of the quantization coefficient matrix are obtained.
[0257] (6) Obtain the quantization coefficients in the first n positions in the scan order in the quantization coefficient matrix, n being a positive integer.
[0258] (7) Obtain the quantization coefficients in the middle m positions in the scan order in the quantization coefficient matrix, m being a positive integer.
[0259] (8) Obtain all the quantization coefficients in the SRCC region of the quantization coefficient matrix.
[0260] (9) Obtain the quantization coefficients in at least one specified position in the SRCC region of the quantization coefficient matrix.
[0261] (10) Obtain the quantization coefficients in at least one row in the SRCC region of the quantization coefficient matrix.
[0262] (11) Obtain the quantization coefficients in at least one column in the SRCC region of the quantization coefficient matrix.
[0263] (12) Obtain the quantization coefficients in at least one diagonal in the SRCC region of the quantization coefficient matrix.
[0264] (13) Obtain the quantization coefficients in the first s positions in the scan order in the SRCC region of the quantization coefficient matrix, s being a positive integer.
[0265] (14) Obtain the quantization coefficients in the middle t positions in the scan order in the SRCC region of the quantization coefficient matrix, t being a positive integer.
[0266] (15) Obtain the quantization coefficients in at least one row and at least one column in the quantization coefficient matrix.
[0267] (16) Obtain the quantization coefficients in at least one row and at least one column in the SRCC region of the quantization coefficient matrix.
[0268] (17) Obtain the quantization coefficients in at least one diagonal and at least one specified position in the quantization coefficient matrix.
[0269] (18) Obtain the quantization coefficients in at least one diagonal and at least one specified position in the SRCC region of the quantization coefficient matrix.
[0270] Optionally, the statistical summation processing is performed on the at least one quantization coefficient to obtain a statistical summation result, including any one of the following embodiments:
[0271] (1) The statistical summation processing is performed on the original values of the at least one quantization coefficient to obtain the statistical summation result.
[0272] (2) The statistical summation processing is performed on the absolute values of the at least one quantization coefficient to obtain the statistical summation result.
[0273] (3) statistically summing the original values of the quantization coefficients with odd original values in the at least one quantization coefficient to obtain a statistical summation result.
[0274] (4) statistically summing the absolute values of the quantization coefficients with odd original values in the at least one quantization coefficient to obtain a statistical summation result.
[0275] (5) statistically summing the original values of the quantization coefficients with even original values in the at least one quantization coefficient to obtain a statistical summation result.
[0276] (6) statistically summing the absolute values of the quantization coefficients with even original values in the at least one quantization coefficient to obtain a statistical summation result.
[0277] (7) statistically summing the original values of the quantization coefficients with non-zero even original values in the at least one quantization coefficient to obtain a statistical summation result.
[0278] (8) statistically summing the absolute values of the quantization coefficients with non-zero even original values in the at least one quantization coefficient to obtain a statistical summation result.
[0279] (9) mapping each quantization coefficient in the at least one quantization coefficient to obtain at least one mapped quantization coefficient; and statistically summing the at least one mapped quantization coefficient to obtain a statistical summation result.
[0280] Optionally, the mapping each quantization coefficient in the at least one quantization coefficient to obtain at least one mapped quantization coefficient comprises any one of the following implementation manners:
[0281] (1) mapping the quantization coefficients with odd original values in the at least one quantization coefficient to a first value to obtain at least one first quantization coefficient; and mapping the quantization coefficients with even original values in the at least one quantization coefficient to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient comprises the at least one first quantization coefficient and / or the at least one second quantization coefficient.
[0282] (2) mapping the quantization coefficients with zero original values in the at least one quantization coefficient to a first value to obtain at least one first quantization coefficient; and mapping the quantization coefficients with non-zero original values in the at least one quantization coefficient to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient comprises the at least one first quantization coefficient and / or the at least one second quantization coefficient.
[0283] (3) mapping the quantized coefficients with original values of even non-zero integers to a first value to obtain at least one first quantized coefficient, and mapping the quantized coefficients with original values of odd integers or zero to a second value to obtain at least one second quantized coefficient; wherein the at least one mapped quantized coefficient comprises the at least one first quantized coefficient and / or the at least one second quantized coefficient.
[0284] (4) performing a calculation mapping process on the at least one quantized coefficient to obtain at least one mapped quantized coefficient; wherein the calculation mapping process comprises at least one of the following: negation mapping, addition mapping, subtraction mapping, multiplication mapping, and division mapping.
[0285] For the introduction and description of the above-mentioned obtaining of the quantized coefficients, the adjustment of the quantized coefficient matrix, the corresponding relationship between the reference information and the value of the transform flag, and the like, please refer to the introduction and description of the method example on the video decoding side. It should be understood that, from the process of determining the value of the transform flag according to the quantized coefficients on the video decoding side, the process of adjusting the quantized coefficients according to the value of the transform flag can be known.
[0286] It should be noted that, in the embodiments of the present application, when the video decoding side determines the value of the transform flag, the region of the at least one quantized coefficient in the quantized coefficient matrix obtained should be consistent with the region of the quantized coefficient adjusted in the encoding process of the video encoder, so as to ensure the consistency of the video decoding process and the video encoding process.
[0287] Step 1140, encoding the adjusted quantized coefficient matrix.
[0288] After the video encoder adjusts the quantized coefficients, the video encoder can encode the adjusted quantized coefficient matrix. Optionally, the video encoder can also encode other information (such as mode information, motion vector, etc.), and then by encoding the adjusted quantized coefficient matrix and other information, the encoding data corresponding to the target coding unit can be obtained.
[0289] In the embodiments of the present application, the video encoder can indicate in the index in the encoding data whether the value of the flag indicating the sub-block transform position is implicitly indicated according to the quantized coefficients in the quantized coefficient matrix in the encoding process. That is, in one example, the above-mentioned method further comprises: indicating, according to the target index in the encoding data, whether the coding unit in the encoding data needs to determine the value of the transform flag according to the quantized coefficient matrix; wherein the coding unit in the encoding data comprises any one of the following: all coding units in the encoding data, coding units in the encoding data using the intra prediction mode, and coding units in the encoding data using the inter prediction mode.
[0290] Optionally, the above method further comprises: determining, according to the value of the flag bit of the sub-block transform position, whether rotation is needed for the quantization coefficient matrix; and in a case where it is determined that rotation is needed for the quantization coefficient matrix, rotating the direction of the quantization coefficient matrix from the second direction to the first direction to obtain a rotated quantization coefficient matrix, the rotated quantization coefficient matrix being used for encoding. For the above description of the rotation process of the quantization coefficient matrix, please refer to the above method embodiments, and no more description is given here.
[0291] (1) According to the first index encoded in the sequence header included in the encoding data, indicating whether the encoding unit in the first sequence needs to determine the value of the transform flag bit according to the quantization coefficient matrix, the target index includes the first index.
[0292] (2) According to the second index encoded in the image header included in the encoding data, indicating whether the encoding unit in the first image needs to determine the value of the transform flag bit according to the quantization coefficient matrix, the target index includes the second index.
[0293] (3) According to the third index encoded in the slice included in the encoding data, indicating whether the encoding unit in the first slice needs to determine the value of the transform flag bit according to the quantization coefficient matrix, the target index includes the third index.
[0294] (4) According to the fourth index encoded in the maximum coding unit header information included in the encoding data, indicating whether the encoding unit in the first maximum coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix, the target index includes the fourth index.
[0295] (5) In a case where the encoding unit in the first image needs to determine the value of the transform flag bit according to the quantization coefficient matrix, according to the first index encoded in the sequence header included in the encoding data and the second index encoded in the image included in the encoding data, indicating whether the encoding unit in the first image needs to determine the value of the transform flag bit according to the quantization coefficient matrix, the target index includes the first index and the second index.
[0296] For the above description of the index indicating whether the value of the flag bit of the sub-block transform position needs to be determined according to the quantization coefficient matrix, please refer to the above embodiments, and no more description is given here.
[0297] In one example, the above method further comprises: determining, according to the value of the flag bit of the sub-block transform position, whether rotation is needed for the quantization coefficient matrix; and in a case where it is determined that rotation is needed for the quantization coefficient matrix, rotating the direction of the quantization coefficient matrix from the second direction to the first direction to obtain a rotated quantization coefficient matrix, the rotated quantization coefficient matrix being used for encoding. For the above description of the rotation process of the quantization coefficient matrix, please refer to the above method embodiments, and no more description is given here.
[0298] In summary, the technical scheme provided by the embodiments of the present application adjusts the quantization coefficients in the quantization coefficient matrix according to the value of the flag of the sub-block transform position of the coding unit in the video encoding process, so that the video decoder determines the value of the flag of the sub-block transform position according to the quantization coefficients in the adjusted quantization coefficient matrix, thereby achieving the purpose of implicitly indicating the flag of the sub-block transform position of the target coding unit according to the quantization coefficients in the quantization coefficient matrix corresponding to the coding unit, avoiding explicit encoding of the sub-block transform position, reducing the number of bits occupied by the video code stream, and improving the video encoding efficiency. Moreover, in the technical scheme provided by the embodiments of the present application, since each flag of the sub-block transform position does not need to be explicitly encoded and decoded, the processing overhead of the video encoder and the video decoder can be reduced, which is helpful to improve the encoding efficiency of the video encoder and the decoding efficiency of the video decoder.
[0299] Reference is made to Figure 13 which shows a schematic diagram of a video encoding process and a video decoding process provided by an embodiment of the present application. The method can be applied in a video encoder and a video decoder, such as the first device 210 and the second device 220 in the communication system shown in Figure 14 .
[0300] For the video encoding end:
[0301] As shown in Figure 14 , in the encoding process, the video encoder can determine the position of the sub-block in the target coding unit that needs to be transformed and quantized (sub-block transform position), and indicate the sub-block transform position through the value of the transform flag. Then, the video encoder adjusts the quantization coefficients in the specified region of the quantization coefficient matrix 1210 according to the value of the transform flag, to obtain the adjusted quantization coefficient matrix 1220. Then, the adjusted quantization coefficient matrix and other information (such as mode information, motion vector, etc.) are encoded to obtain the encoding data corresponding to the target coding unit.
[0302] For the video decoding end:
[0303] As shown in Figure 14 , after obtaining the encoding data, the video decoder decodes the encoding data to obtain the quantization coefficient matrix corresponding to the target coding unit. Then, the value of the flag of the sub-block transform position is obtained according to the quantization coefficients in the specified region of the quantization coefficient matrix, to determine the sub-block transform position in the target coding unit.
[0304] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the apparatus embodiments of the present application, please refer to the method embodiments of the present application.
[0305] Reference is made to Figure 14This diagram illustrates a block diagram of a video decoding apparatus according to an embodiment of this application. The apparatus has the functionality to implement the video decoding method example described above; this functionality can be implemented in hardware or by hardware executing corresponding software. The apparatus 1300 can be a video decoder or can be integrated within a video decoder. The apparatus 1300 may include: a decoding module 1310, an information determination module 1320, a value acquisition module 1330, and a position determination module 1340.
[0306] The decoding module 1310 is used to decode the target coding unit to obtain the quantization coefficient matrix corresponding to the target coding unit.
[0307] The information determination module 1320 is used to determine the first reference information based on the quantization coefficients in the quantization coefficient matrix.
[0308] The value acquisition module 1330 is used to acquire the value of the transformation flag bit corresponding to the first reference information. The transformation flag bit refers to the flag bit of the sub-block transformation position. The sub-block transformation position refers to the position of the sub-block in the encoding unit that needs to transform and quantize the residual data.
[0309] The position determination module 1340 is used to determine the sub-block transformation position of the target coding unit based on the value of the obtained transformation flag bit.
[0310] In one example, such as Figure 14 As shown, the aforementioned information determination module 1320 includes: a coefficient acquisition submodule 1322, used to acquire at least one quantization coefficient in the quantization coefficient matrix; a summation processing submodule 1324, used to perform statistical summation processing on the at least one quantization coefficient to obtain a statistical summation result; and an information determination submodule 1326, used to perform a remainder processing on the statistical summation result according to a first calculation factor to obtain the first reference information, wherein the first calculation factor is a non-zero integer.
[0311] In one example, the coefficient obtaining submodule 1322 is configured to implement at least one of the following manners: obtaining all the quantized coefficients in the quantized coefficient matrix; obtaining the quantized coefficients in at least one specified position in the quantized coefficient matrix; obtaining the quantized coefficients in at least one row in the quantized coefficient matrix; obtaining the quantized coefficients in at least one column in the quantized coefficient matrix; obtaining the quantized coefficients in at least one row and at least one column in the quantized coefficient matrix; obtaining the quantized coefficients in at least one diagonal line in the quantized coefficient matrix; obtaining the quantized coefficients with the scanning order in the first n positions in the quantized coefficient matrix, wherein n is a positive integer; obtaining the quantized coefficients with the scanning order in the middle m positions in the quantized coefficient matrix, wherein m is a positive integer; obtaining all the quantized coefficients in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one specified position in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one row in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one column in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one row and at least one column in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one diagonal line in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients with the scanning order in the first s positions in the SRCC region of the quantized coefficient matrix, wherein s is a positive integer; and obtaining the quantized coefficients with the scanning order in the middle t positions in the SRCC region of the quantized coefficient matrix, wherein t is a positive integer.
[0312] In one example, the summation processing submodule 1324 is configured to implement at least one of: statistical summation processing on the original values of the at least one quantized coefficient to obtain the statistical summation result; or statistical summation processing on absolute values of the at least one quantized coefficient to obtain the statistical summation result; or statistical summation processing on the original values of the at least one quantized coefficient whose original value is an odd number to obtain the statistical summation result; or statistical summation processing on absolute values of the at least one quantized coefficient whose original value is an odd number to obtain the statistical summation result; or statistical summation processing on the original values of the at least one quantized coefficient whose original value is an even number to obtain the statistical summation result; or statistical summation processing on absolute values of the at least one quantized coefficient whose original value is an even number to obtain the statistical summation result; or statistical summation processing on the original values of the at least one quantized coefficient whose original value is a non-zero even number to obtain the statistical summation result; or statistical summation processing on absolute values of the at least one quantized coefficient whose original value is a non-zero even number to obtain the statistical summation result; or mapping processing on each of the at least one quantized coefficient to obtain at least one mapped quantized coefficient; and statistical summation processing on the at least one mapped quantized coefficient to obtain the statistical summation result.
[0313] In an example, the mapping processing on each of the at least one quantized coefficient to obtain at least one mapped quantized coefficient includes: mapping a quantized coefficient with an original value of an odd number in the at least one quantized coefficient to a first numerical value to obtain at least one first quantized coefficient; mapping a quantized coefficient with an original value of an even number in the at least one quantized coefficient to a second numerical value to obtain at least one second quantized coefficient; wherein the at least one mapped quantized coefficient includes the at least one first quantized coefficient and / or the at least one second quantized coefficient; or mapping a quantized coefficient with an original value of zero in the at least one quantized coefficient to a first numerical value to obtain at least one first quantized coefficient; mapping a quantized coefficient with an original value of a non-zero number in the at least one quantized coefficient to a second numerical value to obtain at least one second quantized coefficient; wherein the at least one mapped quantized coefficient includes the at least one first quantized coefficient and / or the at least one second quantized coefficient; or mapping a quantized coefficient with an original value of a non-zero even number in the at least one quantized coefficient to a first numerical value to obtain at least one first quantized coefficient; mapping a quantized coefficient with an original value of an odd number or zero in the at least one quantized coefficient to a second numerical value to obtain at least one second quantized coefficient; wherein the at least one mapped quantized coefficient includes the at least one first quantized coefficient and / or the at least one second quantized coefficient; or performing calculation mapping processing on the at least one quantized coefficient to obtain the at least one mapped quantized coefficient; wherein the calculation mapping processing includes at least one of: negative mapping, addition mapping, subtraction mapping, multiplication mapping, and division mapping.
[0314] In an example, the value obtaining module 1330 is configured to: determine the value of the transform flag corresponding to the first reference information according to a corresponding relationship between the reference information and the value of the transform flag.
[0315] In an example, the reference information includes a first partial remainder and a second partial remainder, and the value of the transform flag includes 0 and 1; the corresponding relationship between the reference information and the value of the transform flag includes: the first partial remainder corresponds to the value of the transform flag being 0; and the second partial remainder corresponds to the value of the transform flag being 1.
[0316] In an example, the first calculation factor is 2, the first partial remainder is 0, and the second partial remainder is 1.
[0317] In an example, the transform flag includes at least one of: a first flag, used to indicate a division direction of a sub-block transform position of the target coding unit, the division direction including horizontal division and vertical division; and a second flag, used to indicate the sub-block transform position of the target coding unit based on the division direction indicated by the first flag.
[0318] In one example, such as Figure 15 As shown, the above-mentioned device 1300 further includes: an implicit indication determination module 1350, used to determine whether the coding unit in the coding data needs to determine the value of the transform flag bit according to the quantization coefficient matrix based on the target index in the coding data; wherein, the coding unit in the coding data includes any one of the following: all coding units in the coding data, coding units in the coding data using intra-frame prediction mode, and coding units in the coding data using inter-frame prediction mode.
[0319] In one example, such as Figure 16 As shown, the aforementioned implicit indication determination module 1350 is configured to perform at least one of the following: decoding a first index from the sequence header contained in the encoded data, wherein the target index includes the first index; determining, based on the first index, whether the coding units in the first sequence need to determine the value of the transform flag bit according to the quantization coefficient matrix; decoding a second index from the image header contained in the encoded data, wherein the target index includes the second index; determining, based on the second index, whether the coding units in the first image need to determine the value of the transform flag bit according to the quantization coefficient matrix; decoding a third index from the strip header contained in the encoded data, wherein the target index includes the third index; determining, based on the third index, whether the coding units in the first strip need to determine the value of the transform flag bit according to the quantization coefficient matrix; and determining, based on the maximum encoding index contained in the encoded data... In the code unit header information, a fourth index is decoded to obtain a target index that includes the fourth index. Based on the fourth index, it is determined whether the coding unit in the first maximum coding unit needs to determine the value of the transform flag bit according to the quantization coefficient matrix. From the sequence header contained in the encoded data, a first index is decoded to obtain a target index that includes the first index. Based on the first index, it is determined whether the coding unit in the first sequence needs to determine the value of the transform flag bit according to the quantization coefficient matrix. If the first index indicates that the coding unit in the first sequence needs to determine the value of the transform flag bit according to the quantization coefficient matrix, a second index is decoded from the image header contained in the encoded data to obtain a target index that includes the second index. Based on the second index, it is determined whether the coding unit in the first image needs to determine the value of the transform flag bit according to the quantization coefficient matrix.
[0320] In one example, such as Figure 16As shown in the above, the apparatus 1300 further includes an implicit indication determination module 1350 configured to determine whether the coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix according to a size relationship between a block size of the coding unit and a target block size, or according to a number of quantization coefficients with original non-zero values in the quantization coefficient matrix corresponding to the coding unit, or according to a position of a vertex coordinate in a scanning region coefficient coding (SRCC) region of the quantization coefficient matrix corresponding to the coding unit.
[0321] In one example, as Figure 16 As shown in the above, the apparatus 1300 further includes a rotation determination module 1360 configured to determine whether rotation of the quantization coefficient matrix is needed according to the obtained value of the transform flag, a matrix rotation module 1370 configured to rotate a direction of the quantization coefficient matrix from a first direction to a second direction to obtain a rotated quantization coefficient matrix in a case where it is determined that rotation of the quantization coefficient matrix is needed, and a coefficient processing module 1380 configured to perform dequantization and inverse transform processing on the rotated quantization coefficient matrix to obtain the residual data.
[0322] In summary, the technical scheme provided by the embodiments of the present application determines the sub-block transform position in the target coding unit by using the quantization coefficients in the quantization coefficient matrix corresponding to the coding unit to implicitly indicate the flag of the sub-block transform position in the target coding unit, thereby avoiding explicit coding of the sub-block transform position and reducing the number of bits occupied by the video code stream, and improving the video coding efficiency. Moreover, in the technical scheme provided by the embodiments of the present application, since each flag of the sub-block transform position does not need to be explicitly coded and decoded, the processing overhead of the video encoder and the video decoder can be reduced, which is helpful to improve the coding efficiency of the video encoder and the decoding efficiency of the video decoder.
[0323] Please refer to Figure 16 which shows a block diagram of a video coding apparatus provided by an embodiment of the present application. The apparatus has the functions of implementing the above-mentioned examples of the video coding method, which can be implemented by hardware or corresponding software executed by hardware. The apparatus can be a video encoder or can be arranged in a video encoder. The apparatus 1500 can include a matrix obtaining module 1510, a value determining module 1520, a coefficient adjusting module 1530, and a coding module 1540.
[0324] The matrix obtaining module 1510 is configured to obtain a quantization coefficient matrix corresponding to a target coding unit.
[0325] The value determination module 1520 is configured to determine a value of a transform flag bit that needs to be indicated according to the quantized coefficient matrix, the transform flag bit being a flag bit of a sub-block transform position of the target coding unit, and the sub-block transform position being a position of a sub-block in the target coding unit that needs to be transformed and quantized.
[0326] The coefficient adjustment module 1530 is configured to adjust quantized coefficients in the quantized coefficient matrix according to the value of the transform flag bit, to obtain an adjusted quantized coefficient matrix.
[0327] The encoding module 1540 is configured to encode the adjusted quantized coefficient matrix.
[0328] In one example, as shown in FIG. 13, the coefficient adjustment module 1530 includes an information determination sub-module 1532, a coefficient acquisition sub-module 1534, a summation processing sub-module 1536, and a coefficient adjustment sub-module 1538. Figure 16 The information determination sub-module 1532 is configured to determine reference information corresponding to the value of the transform flag bit as first reference information. The coefficient acquisition sub-module 1534 is configured to acquire at least one quantized coefficient in the quantized coefficient matrix. The summation processing sub-module 1536 is configured to perform statistical summation processing on the at least one quantized coefficient, to obtain a statistical summation result. The coefficient adjustment sub-module 1538 is configured to adjust the at least one quantized coefficient according to the statistical summation result, the first reference information, and a first calculation factor, to obtain adjusted at least one quantized coefficient.
[0329] In one example, as shown in FIG. 14, the coefficient adjustment module 1530 includes an information determination sub-module 1532, a coefficient acquisition sub-module 1534, a summation processing sub-module 1536, and a coefficient adjustment sub-module 1538. Figure 16As shown, the coefficient obtaining sub-module 1534 is configured to implement at least one of the following manners: obtaining all the quantized coefficients in the quantized coefficient matrix; obtaining the quantized coefficients at at least one specified position in the quantized coefficient matrix; obtaining the quantized coefficients in at least one row of the quantized coefficient matrix; obtaining the quantized coefficients in at least one column of the quantized coefficient matrix; obtaining the quantized coefficients in at least one row and at least one column of the quantized coefficient matrix; obtaining the quantized coefficients in at least one diagonal line of the quantized coefficient matrix; obtaining the quantized coefficients with a scanning order in the first n positions of the quantized coefficient matrix, wherein n is a positive integer; obtaining the quantized coefficients with a scanning order in the middle m positions of the quantized coefficient matrix, wherein m is a positive integer; obtaining all the quantized coefficients in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients at at least one specified position in the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one row of the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one column of the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one row and at least one column of the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients in at least one diagonal line of the SRCC region of the quantized coefficient matrix; obtaining the quantized coefficients with a scanning order in the first s positions of the SRCC region of the quantized coefficient matrix, wherein s is a positive integer; and obtaining the quantized coefficients with a scanning order in the middle t positions of the SRCC region of the quantized coefficient matrix, wherein t is a positive integer.
[0330] In one example, as Figure 17The sum processing submodule 1536 is configured to: perform statistical sum processing on the original values of the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on absolute values of the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on original values of quantization coefficients with odd original values in the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on absolute values of quantization coefficients with odd original values in the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on original values of quantization coefficients with even original values in the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on absolute values of quantization coefficients with even original values in the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on original values of quantization coefficients with non-zero even original values in the at least one quantization coefficient to obtain the statistical sum result; or perform statistical sum processing on absolute values of quantization coefficients with non-zero even original values in the at least one quantization coefficient to obtain the statistical sum result; or perform mapping processing on each quantization coefficient in the at least one quantization coefficient to obtain at least one mapped quantization coefficient; and perform statistical sum processing on the at least one mapped quantization coefficient to obtain the statistical sum result.
[0331] In one example, the mapping process for each quantization coefficient in the at least one quantization coefficient to obtain at least one mapped quantization coefficient includes: mapping quantization coefficients with odd original values to a first value to obtain at least one first quantization coefficient; mapping quantization coefficients with even original values to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or, mapping quantization coefficients with zero original values to a first value to obtain at least one first quantization coefficient; mapping quantization coefficients with non-zero original values to a second value to obtain at least one second quantization coefficient. The at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or, the at least one quantization coefficient with a non-zero even value is mapped to a first value to obtain at least one first quantization coefficient; the at least one quantization coefficient with an odd or zero value is mapped to a second value to obtain at least one second quantization coefficient; the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or, the at least one quantization coefficient is subjected to a calculation mapping process to obtain the at least one mapped quantization coefficient; the calculation mapping process includes at least one of the following: inversion mapping, addition mapping, subtraction mapping, multiplication mapping, and division mapping.
[0332] In one example, the transformation flag includes at least one of the following: a first flag, used to indicate the division direction of the sub-block transformation position of the target coding unit, the division direction including horizontal division and vertical division; and a second flag, used to indicate the sub-block transformation position of the target coding unit based on the division direction indicated by the first flag.
[0333] In one example, such as Figure 6 As shown, the above-mentioned device 1500 further includes: an implicit indication module 1550, used to: indicate whether the coding unit in the coding data needs to determine the value of the transform flag bit according to the quantization coefficient matrix based on the target index in the coding data; wherein, the coding unit in the coding data includes any one of the following: all coding units in the coding data, coding units in the coding data that adopt intra-frame prediction mode, and coding units in the coding data that adopt inter-frame prediction mode.
[0334] In one example, such as Figure 6As shown in the above, the implicit indication module 1550 is configured to implement at least one of the following modes: according to a first index encoded in a sequence header included in the coding data, indicating whether a coding unit in a first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix, the target index including the first index; according to a second index encoded in a picture header included in the coding data, indicating whether a coding unit in a first picture needs to determine the value of the transform flag according to the quantization coefficient matrix, the target index including the second index; according to a third index encoded in a slice header included in the coding data, indicating whether a coding unit in a first slice needs to determine the value of the transform flag according to the quantization coefficient matrix, the target index including the third index; according to a fourth index encoded in maximum coding unit header information included in the coding data, indicating whether a coding unit in a first maximum coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix, the target index including the fourth index; in a case where a coding unit in a first picture needs to determine the value of the transform flag according to the quantization coefficient matrix, according to a first index encoded in a sequence header included in the coding data and a second index encoded in a picture included in the coding data, indicating whether a coding unit in the first picture needs to determine the value of the transform flag according to the quantization coefficient matrix, the target index including the first index and the second index.
[0335] In one example, the matrix obtaining module 1510 is configured to: perform prediction coding on the target coding unit to obtain residual data corresponding to the target coding unit; determine a sub-block transform position of the target coding unit; and perform transform and quantization on the residual data according to the sub-block transform position to obtain the quantization coefficient matrix.
[0336] In one example, as Figure 17 shown in the above, the device 1500 includes: a rotation determining module 1560 configured to determine whether rotation is needed for the quantization coefficient matrix according to the value of the flag bit of the sub-block transform position; and a matrix rotation module 1570 configured to, in a case where it is determined that rotation is needed for the quantization coefficient matrix, rotate the direction of the quantization coefficient matrix from a second direction to a first direction to obtain a rotated quantization coefficient matrix, the rotated quantization coefficient matrix being used for coding.
[0337] In summary, the technical scheme provided by the embodiments of the present application, by adjusting the quantization coefficient in the quantization coefficient matrix according to the value of the flag bit of the sub-block transform position of the coding unit in the video encoding process, so that the video decoder determines the value of the flag bit of the sub-block transform position according to the quantization coefficient in the adjusted quantization coefficient matrix, thereby achieving the purpose of implicitly indicating the flag bit of the sub-block transform position in the target coding unit according to the quantization coefficient in the quantization coefficient matrix corresponding to the coding unit, avoiding explicit encoding of the sub-block transform position, reducing the number of bits occupied by the video code stream, and improving the video encoding efficiency. Moreover, in the technical scheme provided by the embodiments of the present application, since each flag bit of the sub-block transform position does not need to be explicitly encoded and decoded, the processing overhead of the video encoder and the video decoder can be reduced, which is helpful to improve the encoding efficiency of the video encoder and the decoding efficiency of the video decoder.
[0338] It should be noted that the device provided by the above embodiments, in realizing its functions, is only exemplified by the above division of each functional module, and in actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the device and method embodiments provided by the above embodiments belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be described here.
[0339] Please refer to , which shows the structure block diagram of the computer device provided by an embodiment of the present application. The computer device can be the video decoder introduced above, such as the second device 220 in the communication system as shown in the first device 210 in the communication system as shown in . In the case of the computer device being a video decoder, the computer device is used to implement the above video decoding method; in the case of the computer device being a video encoder, the computer device is used to implement the above video encoding method. The computer device 170 can include a processor 171, a memory 172, a communication interface 173, an encoder / decoder 174 and a bus 175.
[0340] The processor 171 includes one or more processing cores, and the processor 171 performs various functional applications and information processing by running software programs and modules.
[0341] The memory 172 can be used to store computer programs, and the processor 171 is used to execute the computer programs to implement the above video decoding method or the above video encoding method.
[0342] The communication interface 173 can be used for communication with other devices, such as transmitting and receiving audio and video data.
[0343] The encoder / decoder 174 can be configured to implement encoding and decoding functions, such as encoding and decoding audio and video data.
[0344] The memory 172 is connected to the processor 171 via the bus 175.
[0345] In addition, the memory 172 can be implemented by any type of volatile or nonvolatile storage devices or a combination thereof, including, but not limited to, a magnetic disk or a compact disk, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory), an SRAM (Static Random-Access Memory), a ROM (Read-Only Memory), a magnetic memory, a flash memory, a PROM (Programmable read-only memory).
[0346] Those skilled in the art can understand that, The structure shown in the figure does not constitute a limitation on the computer device 170, and can include more or fewer components than those shown, or combine certain components, or adopt a different arrangement of components.
[0347] In an exemplary embodiment, a computer readable storage medium is also provided, and the storage medium stores at least one instruction, at least one program, a code set or an instruction set. When the at least one instruction, the at least one program, the code set or the instruction set is executed by the processor of the computer device, the above-mentioned video decoding method or the above-mentioned video encoding method is implemented.
[0348] Optionally, the computer readable storage medium can include a read-only memory (ROM), a random access memory (RAM), a solid state disk (SSD) or an optical disk, etc. Among them, the random access memory can include a resistance random access memory (ReRAM) and a dynamic random access memory (DRAM).
[0349] In an example embodiment, a computer program product or computer program including computer instructions stored in a computer readable storage medium is also provided. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the above-mentioned video decoding method, or implement the above-mentioned video encoding method.
[0350] It should be understood that "multiple" mentioned herein refers to two or more. The "and / or" describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can represent the three cases of A existing alone, A and B existing together, and B existing alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. In addition, the step numbers described herein only exemplarily show a possible execution order between steps. In some other embodiments, the above steps can also be executed in a non-numbered order, such as two steps with different numbers being executed at the same time, or two steps with different numbers being executed in an order opposite to that shown in the figure. The embodiments of the present application are not limited in this regard.
[0351] The above only describes example embodiments of the present application and is not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method of video decoding, the method comprising: The method comprises: decoding a target coding unit to obtain a quantization coefficient matrix corresponding to the target coding unit; determining first reference information according to quantization coefficients in the quantization coefficient matrix; determining a value of a second flag corresponding to the first reference information according to a corresponding relationship between the reference information and the value of the second flag, the second flag being used to indicate a sub-block transform position of the target coding unit on the basis of a partition direction indicated by a first flag, the sub-block transform position being a position of a sub-block in the coding unit that needs to be transformed and quantized; wherein the first flag is used to indicate a partition direction of the sub-block transform position of the target coding unit, the partition direction being horizontal partition or vertical partition, and the first flag is explicitly coded into a video bitstream; the reference information comprises a first part of a remainder and a second part of a remainder, the value of the second flag comprises 0 and 1; the corresponding relationship between the reference information and the value of the second flag comprises that the first part of the remainder corresponds to the value of the second flag being 0, and the second part of the remainder corresponds to the value of the second flag being 1; determining the sub-block transform position of the target coding unit according to the value of the first flag and the value of the second flag.
2. The method of claim 1, wherein, The method comprises: obtaining at least one quantization coefficient in the quantization coefficient matrix; performing statistical summation processing on the at least one quantization coefficient to obtain a statistical summation result; performing remainder processing on the statistical summation result according to a first calculation factor to obtain the first reference information, the first calculation factor being a non-zero integer.
3. The method of claim 2, wherein, The method comprises at least one of the following: obtaining all quantization coefficients in the quantization coefficient matrix; obtaining quantization coefficients at at least one specified position in the quantization coefficient matrix; obtaining quantization coefficients in at least one row of the quantization coefficient matrix; obtaining quantization coefficients in at least one column of the quantization coefficient matrix; obtaining quantization coefficients in at least one row and at least one column of the quantization coefficient matrix; obtaining quantization coefficients in at least one diagonal line of the quantization coefficient matrix; obtaining quantization coefficients located in the first n bits in a scanning order, n being a positive integer; obtaining quantization coefficients located in the middle m bits in the scanning order, m being a positive integer; obtaining all quantization coefficients in a scanning region coefficient coding (SRCC) region of the quantization coefficient matrix; obtaining quantization coefficients at at least one specified position in the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one row of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one column of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one row and at least one column of the SRCC region of the quantization coefficient matrix; obtaining quantization coefficients in at least one diagonal line of the SRCC region of the quantization coefficient matrix; Obtain the quantization coefficients located in the first s positions of the SRCC region of the quantization coefficient matrix in the scanning order, where s is a positive integer; Obtain the quantization coefficients located in the middle t position of the SRCC region of the quantization coefficient matrix, where t is a positive integer.
4. The method of claim 2, wherein, The step of performing statistical summation on the at least one quantization coefficient to obtain a statistical summation result includes: The at least one quantization coefficient is subjected to statistical summation to obtain the statistical summation result; or, The absolute values of the at least one quantization coefficient are statistically summed to obtain the statistical summation result; or, The at least one quantization coefficient that is odd is subjected to statistical summation to obtain the statistical summation result; or, The absolute values of the at least one quantization coefficients that are odd numbers are statistically summed to obtain the statistical summation result; or, The statistical summation result is obtained by performing a statistical summation process on the at least one quantization coefficient that is even. or, The absolute values of the even-numbered quantization coefficients among the at least one quantization coefficients are statistically summed to obtain the statistical summation result; or, The at least one quantization coefficient that is a non-zero even number is statistically summed to obtain the statistical summation result; or, The absolute values of the at least one quantization coefficient that are non-zero even numbers are statistically summed to obtain the statistical summation result; or, Each of the at least one quantization coefficients is mapped to obtain at least one mapped quantization coefficient; the at least one mapped quantization coefficient is then statistically summed to obtain the statistical summation result.
5. The method of claim 4, wherein, The step of mapping each of the at least one quantization coefficient to obtain at least one mapped quantization coefficient includes: The at least one quantization coefficient is mapped to an odd value to obtain at least one first quantization coefficient; the at least one quantization coefficient is mapped to a second value to obtain at least one second quantization coefficient; wherein the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient. or, Mapping the at least one quantization coefficient that is non-zero and even to a first value, to obtain at least one first quantization coefficient; mapping the at least one quantization coefficient that is odd or zero to a second value, to obtain at least one second quantization coefficient; wherein, the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or, Map the zero quantization coefficients among the at least one quantization coefficients to a first value to obtain at least one first quantization coefficient; map the non-zero quantization coefficients among the at least one quantization coefficients to a second value to obtain at least one second quantization coefficient; wherein, the at least one mapped quantization coefficient includes the at least one first quantization coefficient and / or the at least one second quantization coefficient; or, The at least one quantization coefficient is subjected to a calculation mapping process to obtain at least one mapped quantization coefficient; wherein the calculation mapping process comprises at least one of the following: negative mapping, value addition mapping, value subtraction mapping, value multiplication mapping, and value division mapping.
6. The method of claim 2, wherein, The first calculation factor is 2, the first partial remainder is 0, and the second partial remainder is 1.
7. The method of claim 1, wherein, The method further comprises: According to a target index in the encoded data, determining whether a coding unit in the encoded data needs to determine the value of the transform flag according to the quantization coefficient matrix; The coding unit in the encoded data includes any one of the following: all coding units in the encoded data, coding units in the encoded data using an intra prediction mode, and coding units in the encoded data using an inter prediction mode.
8. The method of claim 7, wherein, The determination of whether the coding unit in the encoded data needs to determine the value of the transform flag according to the quantization coefficient matrix according to the target index in the encoded data includes at least one of the following: A first index is decoded from a sequence header included in the encoded data, the target index includes the first index, and whether a coding unit in a first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix is determined according to the first index; A second index is decoded from a picture header included in the encoded data, the target index includes the second index, and whether a coding unit in a first picture needs to determine the value of the transform flag according to the quantization coefficient matrix is determined according to the second index; A third index is decoded from a slice header included in the encoded data, the target index includes the third index, and whether a coding unit in a first slice needs to determine the value of the transform flag according to the quantization coefficient matrix is determined according to the third index; A fourth index is decoded from maximum coding unit header information included in the encoded data, the target index includes the fourth index, and whether a coding unit in a first maximum coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix is determined according to the fourth index; A first index is decoded from a sequence header included in the encoded data, the target index includes the first index, and whether a coding unit in a first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix is determined according to the first index; in a case where the first index indicates that the coding unit in the first sequence needs to determine the value of the transform flag according to the quantization coefficient matrix, a second index is decoded from a picture header included in the encoded data, the target index includes the second index, and whether a coding unit in a first picture needs to determine the value of the transform flag according to the quantization coefficient matrix is determined according to the second index.
9. The method of claim 1, wherein, The method further comprises: According to a size relationship between a block size of a coding unit and a target block size, determining whether the coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix; Or, According to a number of non-zero quantization coefficients in a quantization coefficient matrix corresponding to the coding unit, determining whether the coding unit needs to determine the value of the transform flag according to the quantization coefficient matrix; Or, According to a position of a vertex coordinate in a scan region coefficient (SRCC) region corresponding to a quantization coefficient matrix of a coding unit, it is determined whether the coding unit needs to determine a value of a transform flag according to the quantization coefficient matrix.
10. A method of video encoding, the method comprising: The method comprises: obtaining a quantization coefficient matrix corresponding to a target coding unit; determining a value of a second flag indicating according to the quantization coefficient matrix, the second flag being used to indicate a sub-block transform position of the target coding unit on the basis of a division direction indicated by a first flag, the sub-block transform position being a position of a sub-block in the coding unit which needs to be transformed and quantized; wherein the first flag is used to indicate a division direction of the sub-block transform position of the target coding unit as horizontal division or vertical division, and the first flag is explicitly coded into a video bitstream; the value of the second flag is determined according to a corresponding relationship between reference information and a value of the second flag, the reference information comprising a first part remainder and a second part remainder, and the value of the second flag comprising 0 and 1; the corresponding relationship between the reference information and the value of the second flag comprises that the first part remainder corresponds to a value of 0 of the second flag and the second part remainder corresponds to a value of 1 of the second flag; adjusting quantization coefficients in the quantization coefficient matrix according to the value of the second flag to obtain an adjusted quantization coefficient matrix; encoding the adjusted quantization coefficient matrix.
11. A video decoding apparatus, comprising: The device comprises: a decoding module configured to decode a target coding unit to obtain a quantization coefficient matrix corresponding to the target coding unit; an information determining module configured to determine first reference information according to quantization coefficients in the quantization coefficient matrix; a value obtaining module configured to determine a value of a second flag corresponding to the first reference information according to a corresponding relationship between reference information and a value of the second flag, the second flag being used to indicate a sub-block transform position of the target coding unit on the basis of a division direction indicated by a first flag, the sub-block transform position being a position of a sub-block in the coding unit which needs to be transformed and quantized; wherein the first flag is used to indicate a division direction of the sub-block transform position of the target coding unit as horizontal division or vertical division, and the first flag is explicitly coded into a video bitstream; the reference information comprises a first part remainder and a second part remainder, and the value of the second flag comprises 0 and 1; the corresponding relationship between the reference information and the value of the second flag comprises that the first part remainder corresponds to a value of 0 of the second flag and the second part remainder corresponds to a value of 1 of the second flag; a position determining module configured to determine the sub-block transform position of the target coding unit according to the obtained value of the first flag and the value of the second flag.
12. A video encoding apparatus, comprising: The device comprises: a matrix obtaining module configured to obtain a quantization coefficient matrix corresponding to a target coding unit; The value determination module is configured to determine a value of a second flag bit indicating a value of the quantized coefficient matrix, the second flag bit being used to indicate a sub-block transform position of the target coding unit based on a partition direction indicated by a first flag bit, the sub-block transform position being a position of a sub-block in the coding unit that needs to be transformed and quantized; wherein the first flag bit is used to indicate a partition direction of the sub-block transform position of the target coding unit, and the first flag bit is explicitly coded into a video bitstream; the value of the second flag bit is determined according to a corresponding relationship between reference information and a value of the second flag bit, the reference information including a first part of a remainder and a second part of the remainder, and the value of the second flag bit including 0 and 1; the corresponding relationship between the reference information and the value of the second flag bit includes that the first part of the remainder corresponds to the value of the second flag bit being 0, and the second part of the remainder corresponds to the value of the second flag bit being 1. The coefficient adjustment module is configured to adjust quantized coefficients in the quantized coefficient matrix according to the value of the second flag bit to obtain an adjusted quantized coefficient matrix. The encoding module is configured to encode the adjusted quantized coefficient matrix.
13. A computer device, comprising: The computer device includes a processor and a memory, and the memory stores at least one program, the at least one program is loaded and executed by the processor to implement the video decoding method according to any one of claims 1 to 9, or the video encoding method according to claim 10.
14. A computer-readable storage medium, characterized in that, The computer readable storage medium stores at least one program, and the at least one program is loaded and executed by the processor to implement the video decoding method according to any one of claims 1 to 9, or the video encoding method according to claim 10.
15. A computer program product, characterised in that, The computer program product includes computer instructions stored in a computer readable storage medium, and a processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to implement the video decoding method according to any one of claims 1 to 9, or the video encoding method according to claim 10.
Citation Information
Patent Citations
Sub-block transform in transform SKIP mode
WO2020182213A1