Video decoding method, device and electronic equipment
By rotating and rearranging the inverse quantization coefficient matrix, the problem of difficult to reduce the SRCC area size after transformation skipping in the prior art is solved, and the effect of improving video encoding efficiency is achieved.
Patent Information
- Application Number
- CN202011286559.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-17
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2040-11-17
AI Technical Summary
In the case of transformation skipping, existing video encoding technology is difficult to effectively reduce the size of the SRCC area, resulting in a decrease in video encoding efficiency.
By rotating the inverse quantization coefficient matrix and rearranging the partial coefficients, the non-zero coefficients are concentrated more on the left, upper and upper left areas of the coefficient matrix, thereby reducing the area of the SRCC area.
The video encoding efficiency is improved, and the efficiency of coefficient encoding is optimized by concentrating non-zero coefficients in specific areas.
Smart Images

Figure CN114513663B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer and communication technology, and in particular to a video decoding method, device and electronic device. Background Art
[0002] During the video encoding process, the encoder usually needs to transform, quantize and entropy encode the residual data between the original video data and the predicted video data before sending it to the decoder. In addition, some residuals have weak correlation, so the transformation process may be skipped. Since the coefficient coding module is more efficient in encoding the coefficient matrix with non-zero coefficients concentrated in the upper left corner, the coefficients after transformation or skipping transformation do not all meet the requirements of the coefficient coding module.
[0003] Taking the transform skipped residual as an example, the current transform skip method in the AVS (Audio Video Coding Standard) 3 standard directly skips the residual transform process. However, due to the characteristics of intra-frame prediction, the residual energy in the lower right corner of the residual block is higher. Direct coefficient coding makes it difficult to reduce the size of the SRCC (Scan Region Coefficient Coding) area, which reduces the efficiency of SRCC and thus affects the video coding efficiency. Summary of the invention
[0004] The embodiments of the present application provide a video decoding method, apparatus and electronic device, which can effectively improve the video encoding efficiency at least to a certain extent.
[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0006] According to one aspect of an embodiment of the present application, a video decoding method is provided, including: performing entropy decoding processing on a coding block of a video image frame to obtain a quantization coefficient block of residual data corresponding to the coding block; performing inverse quantization processing on the quantization coefficient block to obtain an inverse quantization coefficient matrix; performing rotation processing on the inverse quantization coefficient matrix and rearrangement processing on some coefficients to obtain a processed coefficient matrix; generating the residual data according to the processed coefficient matrix.
[0007] According to one aspect of an embodiment of the present application, a video decoding device is provided, including: a decoding unit, configured to perform entropy decoding processing on a coding block of a video image frame to obtain a quantization coefficient block of residual data corresponding to the coding block; a first processing unit, configured to perform inverse quantization processing on the quantization coefficient block to obtain an inverse quantization coefficient matrix; a second processing unit, configured to perform rotation processing and rearrangement processing of some coefficients on the inverse quantization coefficient matrix to obtain a processed coefficient matrix; a third processing unit, configured to generate the residual data according to the processed coefficient matrix.
[0008] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit performs rotation processing on the inverse quantization coefficient matrix, including at least one of the following: rotating the inverse quantization coefficient matrix in all or part of its area; flipping the inverse quantization coefficient matrix in all or part of its area.
[0009] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit performs rotation processing on the entire area or a part of the area of the inverse quantization coefficient matrix, including: rotating the entire area or a part of the area of the inverse quantization coefficient matrix by n×90° in a specified direction, where n is a non-negative integer.
[0010] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit performs flipping processing on the entire area or a part of the inverse quantization coefficient matrix, including at least one of the following: flipping processing on the entire area or a part of the inverse quantization coefficient matrix along the main diagonal, flipping processing on the entire area or a part of the inverse quantization coefficient matrix along the secondary diagonal, flipping processing on the entire area or a part of the inverse quantization coefficient matrix left to right, and flipping processing on the entire area or a part of the inverse quantization coefficient matrix up and down.
[0011] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit performs flipping processing on the entire area or a part of the area of the inverse quantization coefficient matrix, including: determining the flipping method of the inverse quantization coefficient matrix according to the intra-frame prediction mode adopted by the coding block; and flipping the entire area or a part of the area of the inverse quantization coefficient matrix based on the determined flipping method.
[0012] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit is configured as follows: if the direction of the intra-frame prediction mode of the coding block is toward the lower left, then it is determined that the inverse quantization coefficient matrix is flipped up and down; if the direction of the intra-frame prediction mode of the coding block is toward the upper right, then it is determined that the inverse quantization coefficient matrix is flipped left and right.
[0013] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit is configured to: determine a flipping method of the inverse quantization coefficient matrix according to a relationship between a width and a height of the inverse quantization coefficient matrix.
[0014] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit is configured to: perform rotation processing on the inverse quantization coefficient matrix and rearrange at least two coefficients.
[0015] In some embodiments of the present application, based on the above scheme, the second processing unit is further configured to: determine whether the corresponding coding block needs to perform the rotation processing and the rearrangement processing on the dequantization coefficient matrix obtained by entropy decoding and dequantization processing according to at least one of the following methods:
[0016] The value of the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence;
[0017] The value of the index identifier contained in the image header of the coding block corresponding to the video image frame;
[0018] The encoding mode used by the encoding block;
[0019] The size of the coding block;
[0020] The value of the index identifier contained in the coding block or the implicit indication of the coefficient statistics in the quantized coefficient block.
[0021] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit is also configured as follows: if the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence and the index identifier contained in the image header of the coding block corresponding to a video image frame in the video image frame sequence are both specified values, the coding mode adopted by the target coding block in the coding block corresponding to the video image frame is an intra-frame coding mode, and the size of the target coding block is smaller than the set size, then when the statistical result of the quantization coefficient block corresponding to the target coding block is a first value, it is determined that the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the target coding block needs to be rotated and rearranged.
[0022] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit is configured as follows: if the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence and the index identifier contained in the image header of the coding block corresponding to a video image frame in the video image frame sequence are both specified values, the coding mode adopted by the target coding block in the coding block corresponding to the video image frame is an intra-frame coding mode, and the size of the target coding block is smaller than the set size, then when the statistical result of the quantization coefficient block corresponding to the target coding block is a second value, it is determined that it is necessary to perform entropy decoding and inverse quantization processing on the target coding block by means of DCT (Discrete Cosine Transform) to obtain an inverse transformation processing of the inverse quantization coefficient matrix.
[0023] In some embodiments of the present application, based on the aforementioned scheme, if it is necessary to determine whether the corresponding coding block needs to perform the rotation processing and the rearrangement processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing at least based on the implicit indication of the coefficient statistics in the quantization coefficient block, then the second processing unit is further configured to: count the number of non-zero coefficients, even coefficients, non-zero even coefficients or odd coefficients in a specified area in the quantization coefficient block, and use the parity of the number as the coefficient statistics in the quantization coefficient block, and the specified area includes the entire area in the quantization coefficient block or the SRCC area in the quantization coefficient block.
[0024] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit is further configured to: count the quantization coefficients in the quantization coefficient block to obtain an implicit derived index value; determine whether the coding block needs to skip the inverse transformation processing and whether the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing needs to be rotated and rearranged according to the implicit derived index value and the value of the explicit index identifier contained in the coding block.
[0025] In some embodiments of the present application, based on the above-mentioned scheme, the second processing unit is further configured as: if the value of the explicit index identifier contained in the coding block is a first value and the implicit derived index value is a first value, then it is determined that the coding block needs to skip the inverse transform processing, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the coding block needs to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is a first value and the implicit derived index value is a second value, then it is determined that the coding block needs to skip the inverse transform processing, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the coding block does not need to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is a second value, then it is determined that the coding block needs to perform inverse transform processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing through DCT transform.
[0026] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the video decoding method as described in the above embodiment is implemented.
[0027] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the video decoding method as described in the above embodiments.
[0028] According to one aspect of the embodiments of the present application, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are 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, so that the computer device performs the video decoding method provided in the above various optional embodiments.
[0029] In the technical solutions provided in some embodiments of the present application, by rotating the inverse quantization coefficient matrix and rearranging some of the coefficients, and then generating residual data based on the processed coefficient matrix, the non-zero coefficients in the coefficient matrix can be concentrated more in the left, above and upper left areas of the coefficient matrix by rotating the inverse quantization coefficient matrix and rearranging some of the coefficients, thereby reducing the area of the SRCC area during encoding, thereby effectively improving the video coding efficiency.
[0030] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0032] Figure 1 A schematic diagram showing an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied;
[0033] Figure 2 A schematic diagram showing the placement of a video encoding device and a video decoding device in a streaming transmission system;
[0034] Figure 3 shows a basic flow chart of a video encoder;
[0035] Figure 4 shows the scan area marked by the SRCC technique;
[0036] Figure 5 A schematic diagram showing a sequence of scanning the marked scanning area;
[0037] Figure 6 A flowchart of a video decoding method according to an embodiment of the present application is shown;
[0038] 7A to 7C A schematic diagram showing a rotation process of a dequantization coefficient matrix according to an embodiment of the present application is shown;
[0039] FIG. 8A to FIG. 8D A schematic diagram showing a flipping process of a dequantization coefficient matrix according to an embodiment of the present application is shown;
[0040] Fig. 9 A schematic diagram of prediction direction in intra-frame prediction mode is shown;
[0041] Fig.10 A schematic diagram showing a flipping process and a rearrangement process of a dequantization coefficient matrix according to an embodiment of the present application is shown;
[0042] Fig.11 A schematic diagram showing a flipping process and a rearrangement process of a dequantization coefficient matrix according to an embodiment of the present application is shown;
[0043] Fig.12 A block diagram of a video decoding device according to an embodiment of the present application is shown;
[0044] Fig.13A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0045] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0046] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0047] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0048] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0049] It should be noted that the "multiple" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.
[0050] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied is shown.
[0051] like Figure 1As shown, the system architecture 100 includes a plurality of terminal devices, which can communicate with each other through, for example, a network 150. For example, the system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected through the network 150. Figure 1 In the embodiment of the present invention, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0052] For example, the first terminal device 110 may encode video data (e.g., a video picture stream captured by the terminal device 110) for transmission to the second terminal device 120 via the network 150. The encoded video data is transmitted in the form of one or more encoded video code streams. The second terminal device 120 may receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display the video picture based on the restored video data.
[0053] In one embodiment of the present application, the system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, which may occur during a video conference, for example. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video picture stream collected by the terminal device) to transmit to the other terminal device of the third terminal device 130 and the fourth terminal device 140 through the network 150. Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded video data transmitted by the other terminal device of the third terminal device 130 and the fourth terminal device 140, and may decode the encoded video data to restore the video data, and may display the video picture on an accessible display device according to the restored video data.
[0054] exist Figure 1 In the embodiment of the present invention, the first terminal device 110, the second terminal device 120, the third terminal device 130 and the fourth terminal device 140 may be servers, personal computers and smart phones, but the principles disclosed in the present application may not be limited thereto. The embodiments disclosed in the present application are applicable to laptop computers, tablet computers, media players and / or dedicated video conferencing equipment. The network 150 represents any number of networks that transmit encoded video data between the first terminal device 110, the second terminal device 120, the third terminal device 130 and the fourth terminal device 140, including, for example, wired and / or wireless communication networks. The communication network 150 may exchange data in circuit switching and / or packet switching channels. The network may include a telecommunications network, a local area network, a wide area network and / or the Internet. For the purpose of the present application, unless explained below, the architecture and topology of the network 150 may be irrelevant to the operation disclosed in the present application.
[0055] In one embodiment of the present application, Figure 2 The placement of the video encoding device and the video decoding device in the streaming environment is shown. The subject matter disclosed in the present application can be equally applicable to other video-supported applications, including, for example, video conferencing, digital TV (television), storing compressed video on digital media including CD, DVD, memory stick, etc.
[0056] The streaming system may include an acquisition subsystem 213, which may include a video source 201 such as a digital camera, which creates an uncompressed video picture stream 202. In an embodiment, the video picture stream 202 includes samples taken by a digital camera. The video picture stream 202 is depicted as a thick line to emphasize the high data volume of the video picture stream compared to the encoded video data 204 (or the encoded video code stream 204), and the video picture stream 202 can be processed by an electronic device 220, which includes a video encoding device 203 coupled to the video source 201. The video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the disclosed subject matter as described in more detail below. Compared to the video picture stream 202, the encoded video data 204 (or the encoded video code stream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or the encoded video code stream 204), which can be stored on the streaming server 205 for future use. One or more streaming client subsystems, such as Figure 2 The client subsystem 206 and the client subsystem 208 in the streaming server 205 can access the streaming server 205 to retrieve the copy 207 and the copy 209 of the encoded video data 204. The client subsystem 206 may include, for example, a video decoding device 210 in the electronic device 230. The video decoding device 210 decodes the incoming copy 207 of the encoded video data and generates an output video picture stream 211 that can be presented on a display 212 (e.g., a display screen) or another presentation device. In some streaming systems, the encoded video data 204, the video data 207, and the video data 209 (e.g., a video bitstream) may be encoded according to certain video encoding / compression standards. Examples of these standards include ITU-T H.265. In an embodiment, the video coding standard under development is informally referred to as Versatile Video Coding (VVC), and the present application may be used in the context of the VVC standard.
[0057] It should be noted that the electronic device 220 and the electronic device 230 may include other components not shown in the figure. For example, the electronic device 220 may include a video decoding device, and the electronic device 230 may also include a video encoding device.
[0058] In one embodiment of the present application, taking the international video coding standards HEVC (High Efficiency Video Coding), VVC (Versatile Video Coding), and China's national video coding standard AVS as examples, after a video frame image is input, the video frame image will be divided into several non-overlapping processing units according to a block size, and each processing unit will perform similar compression operations. This processing unit is called CTU (Coding Tree Unit), or LCU (Largest Coding Unit). CTU can continue to be divided more finely to obtain one or more basic coding units CU, which is the most basic element in a coding link. The following introduces some concepts when encoding CU:
[0059] Predictive Coding: Predictive coding includes intra-frame prediction and inter-frame prediction. The original video signal is predicted by the selected reconstructed video signal to obtain the residual video signal. The encoder needs to decide which predictive coding mode to choose for the current CU and inform the decoder. Intra-frame prediction means that the predicted signal comes from the encoded and reconstructed area in the same image; inter-frame prediction means that the predicted signal comes from other images that have been encoded and different from the current image (called reference images).
[0060] Transform & Quantization: After the residual video signal is transformed by DFT (Discrete Fourier Transform), DCT and other transformation operations, the signal is converted into the transform domain, which is called the transform coefficient. The transform coefficient is further subjected to lossy quantization operation, which loses a certain amount of information, making the quantized signal conducive to compression expression. In some video coding standards, there may be more than one transform method to choose from, so the encoder also needs to select one of the transform methods for the current CU and inform the decoder. The degree of quantization is usually determined by the quantization parameter (QP). A larger QP value means that coefficients with a larger value range will be quantized to the same output, which usually results in greater distortion and lower bit rate; on the contrary, a smaller QP value means that coefficients with a smaller value range will be quantized to the same output, which usually results in less distortion and a higher bit rate.
[0061] Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequency of occurrence of each value, and finally output as a binary (0 or 1) compressed bit stream. At the same time, the encoding generates other information, such as the selected coding mode, motion vector data, etc., which also need to be entropy encoded to reduce the bit rate. Statistical coding is a lossless coding method that can effectively reduce the bit rate required to express the same signal. Common statistical coding methods include variable length coding (VLC) or context-based binary arithmetic coding (CABAC).
[0062] Loop Filtering: The changed and quantized signal will be reconstructed through inverse quantization, inverse transformation and prediction compensation operations to obtain a reconstructed image. Compared with the original image, due to the influence of quantization, some information of the reconstructed image is different from the original image, that is, the reconstructed image will produce distortion. Therefore, the reconstructed image can be filtered, such as deblocking filter (DB), SAO (Sample Adaptive Offset) or ALF (Adaptive Loop Filter) and other filters, which can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed images will be used as a reference for subsequent encoded images to predict future image signals, the above filtering operation is also called loop filtering, that is, filtering operation within the encoding loop.
[0063] In one embodiment of the present application, Figure 3 A basic flow chart of a video encoder is shown, in which intra-frame prediction is used as an example for explanation. k [x,y] and predicted image signal Perform difference operation to obtain the residual signal u k [x,y], residual signal u k [x,y] is transformed and quantized to obtain the quantized coefficients. The quantized coefficients are entropy coded to obtain the encoded bit stream, and the reconstructed residual signal u' is obtained through inverse quantization and inverse transformation. k [x,y], predicted image signal and reconstructed residual signal u' k [x,y] superposition generates image signal Image signal On the one hand, it is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing, and on the other hand, the reconstructed image signal s' is output through loop filtering k [x,y], reconstructed image signal s' k [x,y] can be used as the reference image for the next frame for motion estimation and motion compensation prediction. Then based on the result of motion compensation prediction s' r [x+m x ,y+m y ] and intra prediction results Get the predicted image signal of the next frame And continue to repeat the above process until the encoding is completed.
[0064] In addition, since the non-zero coefficients in the quantized coefficient block of the residual signal after transformation and quantization are more likely to be concentrated in the left and upper areas of the block, while the right and lower areas of the block are often 0, the SRCC technology is introduced. The SRCC technology can mark the size of the upper left area SRx×SRy of the non-zero coefficients contained in each quantized coefficient block (size W×H), where SRx is the horizontal coordinate of the rightmost non-zero coefficient in the quantized coefficient block, SRy is the vertical coordinate of the bottom non-zero coefficient in the quantized coefficient block, and 1≤SRx≤W, 1≤SRy≤H, and the coefficients outside this area are all 0. The SRCC technology uses (SRx, SRy) to determine the quantized coefficient area that needs to be scanned in a quantized coefficient block, such as Figure 4 As shown, only the quantized coefficients in the scan area marked by (SRx, SRy) need to be encoded, and the encoding scanning order is as follows Figure 5 As shown, it can be a reverse Z-shaped scan from the lower right corner to the upper left corner.
[0065] Based on the above encoding process, at the decoding end, for each CU, after obtaining the compressed code stream (i.e., bit stream), entropy decoding is performed to obtain various mode information and quantization coefficients. The quantization coefficients are then dequantized and inversely transformed to obtain a residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to the CU can be obtained, and then the residual signal and the prediction signal are added to obtain the reconstructed signal. The reconstructed signal is then subjected to loop filtering and other operations to generate the final output signal.
[0066] In the above encoding and decoding process, the transformation processing of the residual signal makes the energy of the residual signal concentrated in fewer low-frequency coefficients, that is, most of the coefficient values are small. Then after the subsequent quantization module, the smaller coefficient values will become zero values, which greatly reduces the cost of encoding the residual signal. However, due to the diversity of residual distribution, a single DCT transform cannot adapt to all residual characteristics. Therefore, transform cores such as DST7 and DCT8 are introduced into the transformation processing process, and different transform cores can be used for the horizontal and vertical transformations of the residual signal. Taking AMT (Adaptive multiple core transform) technology as an example, the transform combinations that may be selected for transform processing of a residual signal are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8) and (DST7, DST7).
[0067] For the specific selection of transformation combination for the residual signal, it is necessary to use RDO (Rate-Distortion Optimization) at the encoding end to make a decision. In addition, some residuals have weak correlation, and the transformation process may be skipped. Taking the residual skipped by transformation as an example, the current transformation skip method in the AVS3 standard directly skips the transformation process of the residual. However, due to the characteristics of intra-frame prediction, the residual energy in the lower right corner of the residual block is higher. Direct coefficient coding makes it difficult to reduce the size of the SRCC area, which reduces the efficiency of SRCC and thus affects the coding efficiency of the video.
[0068] In response to the above problems, an embodiment of the present application proposes to flip and replace the coefficients of the inverse quantization coefficient matrix so as to concentrate the non-zero coefficients in the coefficient matrix more in the left, above and upper left areas of the coefficient matrix, thereby reducing the area of the SRCC area during encoding, thereby effectively improving the video coding efficiency.
[0069] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0070] Figure 6 A flowchart of a video decoding method according to an embodiment of the present application is shown. The video decoding method can be executed by a device with a computing and processing function, such as a terminal device or a server. Figure 6 As shown, the video decoding method at least includes steps S610 to S640, which are described in detail as follows:
[0071] In step S610, entropy decoding is performed on the coding block of the video image frame to obtain a quantization coefficient block of residual data corresponding to the coding block.
[0072] In one embodiment of the present application, a video image frame sequence includes a series of images, each of which can be further divided into slices, which can be further divided into a series of LCUs (or CTUs), and the LCU contains several CUs. When encoding, the video image frame is encoded in blocks. In some new video coding standards, such as the H.264 standard, there are macroblocks (MB), which can be further divided into multiple prediction blocks (prediction) that can be used for predictive coding. In the HEVC standard, basic concepts such as coding units CU, prediction units (PU) and transform units (TU) are used to functionally divide various block units and describe them using a new tree-based structure. For example, CU can be divided into smaller CUs according to a quadtree, and the smaller CU can be further divided to form a quadtree structure. The coding block in the embodiment of the present application can be a CU, or a smaller block than a CU, such as a smaller block obtained by dividing a CU.
[0073] In step S620, the quantization coefficient block is subjected to inverse quantization processing to obtain an inverse quantization coefficient matrix. The inverse quantization processing is the inverse process of the quantization processing process of the video image frame during encoding, so as to obtain the inverse quantization coefficient, for example, based on or using the same quantization step size as that during the quantization processing, the inverse quantization scheme corresponding to the quantization processing scheme is applied to perform the inverse quantization processing.
[0074] In step S630, the inverse quantization coefficient matrix is rotated and some coefficients are rearranged to obtain a processed coefficient matrix.
[0075] In one embodiment of the present application, whether the corresponding coding block needs to perform rotation processing and rearrangement processing of some coefficients on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing can be determined according to at least one of the following methods:
[0076] The value of the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence;
[0077] The value of the index identifier contained in the image header of the coding block corresponding to the video image frame;
[0078] The encoding mode used by the encoding block;
[0079] The size of the coding block;
[0080] The value of the index identifier contained in the coding block or the implicit indication of the coefficient statistics in the quantized coefficient block.
[0081] Specifically, when determining whether the corresponding coding block needs to perform rotation processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing and rearrangement processing of some coefficients, the following methods can be used:
[0082] 1. Indicated by the index identifier in the sequence header of the coding block corresponding to the video image frame sequence. For example, if the index identifier in the sequence header is 1 (the value is only an example), it means that all coding blocks corresponding to the video image frame sequence need to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients.
[0083] 2. Indicated by the index mark in the image header of the coding block corresponding to the video image frame. For example, if the index mark in the image header is 1 (the value is only an example), it means that all coding blocks corresponding to the video image frame need to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients.
[0084] 3. Indicated by the coding mode used by the coding block. For example, if a coding block uses intra-frame coding, it means that the coding block needs to rotate the dequantized coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients.
[0085] 4. Indicated by the size of the coding block. For example, if the size of a coding block is smaller than the set value, it means that the coding block needs to rotate the dequantized coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients.
[0086] 5. Indicated by the index identifier contained in the coding block. For example, if the index identifier contained in a coding block is 1 (the value is only an example), it means that the coding block needs to rotate the dequantized coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients.
[0087] 6. Implicit indication is made through the statistical results of coefficients in the quantization coefficient block. For example, the number of non-zero coefficients, even coefficients, non-zero even coefficients or odd coefficients in the quantization coefficient block can be counted, and then the parity of the number is used to implicitly indicate whether the coding block needs to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients. If the number is an odd number, it means that the coding block needs to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients; conversely, if the number is an even number, it means that the coding block does not need to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients. Of course, it is also possible to indicate that the coding block does not need to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients when the number is an odd number; and when the number is an even number, it means that the coding block needs to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization and rearrange some coefficients.
[0088] In one embodiment of the present application, when taking statistics on coefficients in a quantization coefficient block, statistics may be taken on all regions in the quantization coefficient block, or statistics may be taken on part of the regions in the quantization coefficient block, or statistics may be taken on the SRCC regions in the quantization coefficient block (such as all SRCC regions or part of the SRCC regions). For example, statistics may be taken on a position or multiple positions specified in the quantization coefficient block, statistics may be taken on at least one row specified in the quantization coefficient block, statistics may be taken on at least one column specified in the quantization coefficient block, statistics may be taken on at least one row specified in the quantization coefficient block and at least one column specified in the quantization coefficient block, statistics may be taken on a position on at least one oblique line in the quantization coefficient block, etc. Optionally, a part of the SRCC region may be a position or multiple positions specified in the SRCC region, at least one row specified in the SRCC region, at least one column specified in the SRCC region, at least one row specified in the SRCC region and at least one column specified in the SRCC region, a position on at least one oblique line in the SRCC region, etc.
[0089] 7. Instruction is given by two or more of the above methods 1 to 5.
[0090] For example, it can be indicated by the index identifier in the sequence header of the coding block corresponding to the video image frame sequence, the index identifier in the image header of the coding block corresponding to the video image frame, the coding mode adopted by the coding block, the size of the coding block and the index identifier contained in the coding block. Specifically, if the index identifier in the sequence header is 1 (the value is only an example), the index identifier in the image header is 1 (the value is only an example), the coding block adopts intra-frame coding, and the size of the coding block is less than the set size, then if the index identifier contained in the coding block is 1 (the value is only an example), it means that the coding block needs to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients.
[0091] Optionally, in the above example, if the index identifier in the sequence header is 1 (the value is only an example), the index identifier in the image header is 1 (the value is only an example), the coding block adopts intra-frame coding, and the size of the coding block is smaller than the set size, then if the index identifier contained in the coding block is 0 (the value is only an example), it means that the coding block does not need to rotate the dequantized coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients, and the dequantized coefficient matrix obtained by entropy decoding and dequantization processing of the coding block can be inversely transformed by DCT transformation.
[0092] 8. Instruction is given by two or more of the above methods 1 to 4 and 6.
[0093] For example, it can be indicated by the index identifier in the sequence header of the coding block corresponding to the video image frame sequence, the index identifier in the image header of the coding block corresponding to the video image frame, the coding mode adopted by the coding block, the size of the coding block, and the coefficient statistics in the quantization coefficient block. Specifically, if the index identifier in the sequence header is 1 (the value is only an example), the index identifier in the image header is 1 (the value is only an example), the coding block adopts intra-frame coding, and the size of the coding block is less than the set size, then if the statistical result of the quantization coefficient block corresponding to the coding block is a first value (the first value can be an odd value, for example, only an example), it means that the coding block needs to rotate the dequantization coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients.
[0094] Optionally, in the above example, if the index identifier in the sequence header is 1 (the value is only an example), the index identifier in the image header is 1 (the value is only an example), the coding block adopts intra-frame coding, and the size of the coding block is smaller than the set size, then if the statistical result of the quantization coefficient block corresponding to the coding block is a second value (the second value may be an even value, for example, only an example), it means that the coding block does not need to rotate the dequantized coefficient matrix obtained by entropy decoding and dequantization processing and rearrange some coefficients, and the dequantized coefficient matrix obtained by entropy decoding and dequantization processing of the coding block can be inversely transformed by DCT transformation.
[0095] 9. Indicate through explicit index identification + implicit derived index value.
[0096] For example, the quantization coefficients in the quantization coefficient block can be counted to obtain an implicit derived index value. If the value of the explicit index identifier contained in the coding block is a first value (the first value of the explicit index identifier can be, for example, 0 or 1), and the implicit derived index value is a first value (the first value of the implicit derived index value can also be, for example, 0 or 1), it is determined that the coding block needs to skip the inverse transform process, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization of the coding block needs to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is a first value, and the implicit derived index value is a second value, it is determined that the coding block needs to skip the inverse transform process, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization of the coding block does not need to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is a second value, it is determined that the coding block needs to perform an inverse transform process on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization through DCT transform.
[0097] Optionally, in the above example, if the value of the explicit index identifier contained in the coding block is 0 (the value is only an example), and the implicit derived index value is 1, it is determined that the coding block needs to skip the inverse transform process, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization of the coding block needs to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is 0, and the implicit derived index value is 0, it is determined that the coding block needs to skip the inverse transform process, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization of the coding block does not need to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is 1, it is determined that the coding block needs to perform inverse transform processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization through DCT transform. The details are shown in Table 1 below:
[0098]
[0099] Table 1
[0100] Among them, the case where the explicit index identifier is "1" and the implicit derived index value is "-" in Table 1 indicates that: when the explicit index identifier takes the value of 1, no matter what value the implicit derived index takes, the transform mode is DCT2, and no rotation or rearrangement processing is required. In this case, the encoder does not need to adjust the quantization coefficient block for implicit indication, and the decoder does not need to perform the implicit indexing process. "TS" in Table 1 indicates the transform skip mode, that is, the transform process is skipped during encoding, and the inverse transform process needs to be skipped during decoding.
[0101] In one embodiment of the present application, the process of counting the quantized coefficients in the quantized coefficient block and obtaining the implicit derived index value may be to count the quantized coefficients in the specified area in the quantized coefficient block, obtain the statistical results of the quantized coefficients, and then determine the implicit derived index value according to the parity of the statistical results. The technical solution of this embodiment is to determine the implicit derived index value based on the parity of the statistical results. For example, if the statistical result is an odd number, the implicit derived index value can be 1; if the statistical result is an even number, the implicit derived index value can be 0. Of course, if the statistical result is an odd number, the implicit derived index value can also be 0, and if the statistical result is an even number, the implicit derived index value can be 1.
[0102] In one embodiment of the present application, the process of counting the quantized coefficients in the quantized coefficient block and obtaining the implicit derived index value may be to count the quantized coefficients in the specified area in the quantized coefficient block to obtain the statistical result of the quantized coefficient, then calculate the remainder of the statistical result with respect to the set value, and then determine the implicit derived index value according to the remainder. The technical solution of this embodiment is to determine the implicit derived index value based on the remainder of the statistical result with respect to the set value. This solution makes the possible values of the implicit derived index value more than two, for example, the set value can be 3, in which case, the remainder of the statistical result with respect to 3 can be 0, 1, 2, and each remainder will correspond to an implicit derived index value, for example, the remainder can be directly used as the implicit derived index value.
[0103] In one embodiment of the present application, the rotation processing of the inverse quantization coefficient matrix may be a rotation processing of the inverse quantization coefficient matrix in whole or in part; or it may be a flipping processing of the inverse quantization coefficient matrix in whole or in part; or it may be a rotation processing of the inverse quantization coefficient matrix in whole or in part, and a flipping processing of the inverse quantization coefficient matrix in whole or in part.
[0104] In one embodiment of the present application, the whole or part of the inverse quantization coefficient matrix is rotated, including: rotating the whole or part of the inverse quantization coefficient matrix by n×90° in a specified direction, where n is a non-negative integer (for example, n can be 0, 1, 2, 3, 4, etc.). The specified direction can be clockwise, counterclockwise, etc.
[0105] For example, Fig. 7A As shown, the entire area of the inverse quantization coefficient matrix can be rotated 90° clockwise; or as Figure 7B As shown, the entire area of the inverse quantization coefficient matrix is rotated 180° clockwise; or as Figure 7C As shown, the entire area of the inverse quantization coefficient matrix is rotated 270° clockwise.
[0106] In one embodiment of the present application, the inverse quantization coefficient matrix is flipped in its entirety or in part, including at least one of the following: flipping the entirety or in part of the inverse quantization coefficient matrix along the main diagonal, flipping the entirety or in part of the inverse quantization coefficient matrix along the secondary diagonal, flipping the entirety or in part of the inverse quantization coefficient matrix left to right, and flipping the entirety or in part of the inverse quantization coefficient matrix up and down.
[0107] For example, Fig. 8A As shown, the entire area of the inverse quantization coefficient matrix can be flipped along the secondary diagonal; Figure 8B As shown, the entire area of the inverse quantization coefficient matrix can be flipped along the main diagonal; Figure 8C As shown, the entire area of the inverse quantization coefficient matrix can be flipped left and right along the vertical center axis; Fig.8D As shown, the entire area of the dequantization coefficient matrix can be flipped up and down along the horizontal center axis.
[0108] In one embodiment of the present application, when flipping the inverse quantization coefficient matrix, the flipping method of the inverse quantization coefficient matrix can be determined according to the relationship between the width and height of the inverse quantization coefficient matrix, and then the inverse quantization coefficient matrix can be flipped based on the determined flipping method.
[0109] For example, if the width and height of the inverse quantization coefficient matrix are equal, it is determined that the inverse quantization coefficient matrix is flipped along the main diagonal or the secondary diagonal of the inverse quantization coefficient matrix, as follows: Fig. 8A and 8BOf course, if the width and height of the inverse quantization coefficient matrix are equal, it is also possible to use an up-down flipping method, or a left-right flipping method, or at least two of left-right flipping, up-down flipping, flipping along the secondary diagonal of the inverse quantization coefficient matrix, and flipping along the main diagonal of the inverse quantization coefficient matrix.
[0110] If the width of the inverse quantization coefficient matrix is greater than the height, the inverse quantization coefficient matrix is determined to be flipped left and right, as shown in the following example: Figure 8C If the width of the inverse quantization coefficient matrix is smaller than the height, it is determined that the inverse quantization coefficient matrix is flipped upside down, as shown in the embodiment. Fig.8D The embodiment shown.
[0111] In one embodiment of the present application, when flipping the entire area or a part of the area of the inverse quantization coefficient matrix, the flipping method of the inverse quantization coefficient matrix can be determined according to the intra-frame prediction mode adopted by the coding block, and then the entire area or a part of the area of the inverse quantization coefficient matrix can be flipped based on the determined flipping method.
[0112] Specifically, if the direction of the intra-frame prediction mode of the coding block is toward the lower left, it is determined that the inverse quantization coefficient matrix is flipped upside down; if the direction of the intra-frame prediction mode of the coding block is toward the upper right, it is determined that the inverse quantization coefficient matrix is flipped left to right.
[0113] In one embodiment of the present application, Fig. 9 As shown, the intra-frame prediction mode facing the lower left direction may be mode 3 to mode 11, mode 34 to mode 43; the intra-frame prediction mode facing the upper right direction may be mode 25 to mode 32, mode 58 to mode 65.
[0114] In one embodiment of the present application, if the intra prediction mode of the coding block is other intra prediction modes except for the lower left and upper right directions, the flipping mode of the inverse quantization coefficient matrix is determined according to the relationship between the width and height of the inverse quantization coefficient matrix. Fig. 9 As shown, other intra-frame prediction modes in this embodiment can be mode 0 to mode 2, mode 12 to mode 24, mode 44 to mode 57. Among them, mode 0 represents the DC prediction mode, mode 1 represents the Plane prediction mode, and mode 2 represents the Bilinear prediction mode. In this embodiment, according to the relationship between the width and height of the inverse quantization coefficient matrix, the solution for determining the flipping method of the inverse quantization coefficient matrix can refer to the technical solution of the aforementioned embodiment, and will not be repeated.
[0115] In one embodiment of the present application, when the inverse quantization coefficient matrix is rotated and some coefficients are rearranged, there is no strict order between the rotation and rearrangement. The rotation can be performed first and then the rearrangement; the rearrangement can be performed first and then the rotation; the rotation and rearrangement can be performed simultaneously. The rearrangement can be performed by rearranging at least two coefficients in the inverse quantization coefficient matrix, such as swapping the positions of two coefficients, randomly shuffling and rearranging multiple coefficients, etc.
[0116] For example, in one embodiment of the present application, Fig.10 As shown, after rotating the entire region of the inverse quantization coefficient matrix by 180°, the coefficients of the shaded part can be exchanged respectively according to the rearrangement method indicated by the arrows therein to obtain the processed coefficient matrix. This embodiment is an embodiment of rotating the entire region of the inverse quantization coefficient matrix and rearranging some coefficients.
[0117] For example, in one embodiment of the present application, Fig.11 As shown, the partial area of the inverse quantization coefficient matrix ( Fig.11 The area except the shaded area in the dequantization coefficient matrix is rotated 180°, and the coefficients of the shaded area are respectively exchanged according to the rearrangement method indicated by the arrows therein to obtain a processed coefficient matrix. This embodiment is an embodiment of rotating a part of the area of the dequantization coefficient matrix and rearranging some coefficients.
[0118] In step S640, residual data is generated according to the processed coefficient matrix.
[0119] In one embodiment of the present application, the processed coefficient matrix can be used as the reconstructed residual data, or the processed coefficient matrix can be subjected to other processing to obtain the residual data. Specifically, after the encoder performs a transformation or a transformation skipping process on the residual data, the coefficient matrix is rotated and some coefficients are rearranged, and then quantization and entropy coding are performed. After obtaining the coding block, the decoder performs entropy decoding and inverse quantization, and then rotates the coefficient matrix and rearranges some coefficients (this process is the inverse process of the encoder), and then transforms or transforms and skips to obtain the reconstructed residual data.
[0120] The technical solution of the above-mentioned embodiment of the present application enables the non-zero coefficients in the coefficient matrix to be concentrated more in the left, above and upper left areas of the coefficient matrix by rotating the inverse quantization coefficient matrix and rearranging some coefficients, thereby reducing the area of the SRCC area during encoding, thereby effectively improving the video coding efficiency.
[0121] The following describes an apparatus embodiment of the present application, which can be used to execute the video decoding method in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the video decoding method of the present application.
[0122] Fig.12 A block diagram of a video decoding device according to an embodiment of the present application is shown. The video decoding device can be set in a device with a computing and processing function, such as a terminal device or a server.
[0123] Reference Fig.12 As shown, a video decoding device 1200 according to an embodiment of the present application includes: a decoding unit 1202 , a first processing unit 1204 , a second processing unit 1206 and a third processing unit 1208 .
[0124] Among them, the decoding unit 1202 is configured to perform entropy decoding processing on the coding block of the video image frame to obtain a quantization coefficient block of the residual data corresponding to the coding block; the first processing unit 1204 is configured to perform inverse quantization processing on the quantization coefficient block to obtain an inverse quantization coefficient matrix; the second processing unit 1206 is configured to rotate the inverse quantization coefficient matrix and rearrange some coefficients to obtain a processed coefficient matrix; the third processing unit 1208 is configured to generate the residual data according to the processed coefficient matrix.
[0125] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 performs rotation processing on the inverse quantization coefficient matrix, including at least one of the following: rotating the inverse quantization coefficient matrix in all or part of its area; flipping the inverse quantization coefficient matrix in all or part of its area.
[0126] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 performs rotation processing on the entire area or a portion of the area of the inverse quantization coefficient matrix, including: rotating the entire area or a portion of the area of the inverse quantization coefficient matrix by n×90° in a specified direction, where n is a non-negative integer.
[0127] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 performs flipping processing on the entire area or a part of the inverse quantization coefficient matrix, including at least one of the following: flipping processing on the entire area or a part of the inverse quantization coefficient matrix along the main diagonal, flipping processing on the entire area or a part of the inverse quantization coefficient matrix along the secondary diagonal, flipping processing on the entire area or a part of the inverse quantization coefficient matrix left to right, and flipping processing on the entire area or a part of the inverse quantization coefficient matrix up and down.
[0128] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 performs flipping processing on the entire area or a part of the area of the inverse quantization coefficient matrix, including: determining the flipping method of the inverse quantization coefficient matrix according to the intra-frame prediction mode adopted by the coding block; and flipping the entire area or a part of the area of the inverse quantization coefficient matrix based on the determined flipping method.
[0129] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 is configured as: if the direction of the intra-frame prediction mode of the coding block is toward the lower left, then determine to flip the inverse quantization coefficient matrix up and down; if the direction of the intra-frame prediction mode of the coding block is toward the upper right, then determine to flip the inverse quantization coefficient matrix left and right; if the intra-frame prediction mode of the coding block is other intra-frame prediction modes except toward the lower left and toward the upper right, then determine the flipping method of the inverse quantization coefficient matrix according to the relationship between the width and height of the inverse quantization coefficient matrix.
[0130] In some embodiments of the present application, based on the above-mentioned solution, the second processing unit 1206 is configured to: perform rotation processing on the dequantization coefficient matrix and rearrange at least two coefficients.
[0131] In some embodiments of the present application, based on the above scheme, the second processing unit 1206 is further configured to: determine whether the corresponding coding block needs to perform the rotation processing and the rearrangement processing on the dequantization coefficient matrix obtained by entropy decoding and dequantization processing according to at least one of the following methods:
[0132] The value of the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence;
[0133] The value of the index identifier contained in the image header of the coding block corresponding to the video image frame;
[0134] The encoding mode used by the encoding block;
[0135] The size of the coding block;
[0136] The value of the index identifier contained in the coding block or the implicit indication of the coefficient statistics in the quantized coefficient block.
[0137] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 is configured as follows: if the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence and the index identifier contained in the image header of the coding block corresponding to a video image frame in the video image frame sequence are both specified values, the coding mode adopted by the target coding block in the coding block corresponding to the video image frame is an intra-frame coding mode, and the size of the target coding block is smaller than the set size, then when the statistical result of the quantization coefficient block corresponding to the target coding block is a first value, it is determined that the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the target coding block needs to be rotated and rearranged.
[0138] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 is configured as follows: if the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence and the index identifier contained in the image header of the coding block corresponding to a video image frame in the video image frame sequence are both specified values, the coding mode adopted by the target coding block in the coding block corresponding to the video image frame is the intra-frame coding mode, and the size of the target coding block is smaller than the set size, then when the statistical result of the quantization coefficient block corresponding to the target coding block is a second value, it is determined that it is necessary to perform entropy decoding and inverse quantization processing on the target coding block by means of DCT (Discrete Cosine Transform) to obtain the inverse quantization coefficient matrix for inverse transformation processing.
[0139] In some embodiments of the present application, based on the aforementioned scheme, if it is necessary to determine whether the corresponding coding block needs to perform the rotation processing and the rearrangement processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing at least based on the implicit indication of the coefficient statistics in the quantization coefficient block, then the second processing unit 1206 is further configured to: count the number of non-zero coefficients, even coefficients, non-zero even coefficients or odd coefficients in a specified area in the quantization coefficient block, and use the parity of the number as the coefficient statistics in the quantization coefficient block, and the specified area includes the entire area in the quantization coefficient block or the SRCC area in the quantization coefficient block.
[0140] In some embodiments of the present application, based on the aforementioned scheme, the second processing unit 1206 is further configured to: count the quantization coefficients in the quantization coefficient block to obtain an implicit derived index value; determine whether the coding block needs to skip the inverse transformation processing, and whether the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing needs to be rotated and rearranged according to the implicit derived index value and the value of the explicit index identifier contained in the coding block.
[0141] In some embodiments of the present application, based on the above-mentioned scheme, the second processing unit 1206 is further configured as: if the value of the explicit index identifier contained in the coding block is a first value and the implicit derived index value is a first value, then it is determined that the coding block needs to skip the inverse transform processing, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the coding block needs to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is a first value and the implicit derived index value is a second value, then it is determined that the coding block needs to skip the inverse transform processing, and the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the coding block does not need to be rotated and rearranged; if the value of the explicit index identifier contained in the coding block is a second value, then it is determined that the coding block needs to perform inverse transform processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing through DCT transform.
[0142] Fig.13 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0143] It should be noted that Fig.13 The computer system 1300 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0144] like Fig.13 As shown, the computer system 1300 includes a central processing unit (CPU) 1301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1302 or the program loaded from the storage part 1308 to the random access memory (RAM) 1303, such as executing the method described in the above embodiment. In RAM 1303, various programs and data required for system operation are also stored. CPU 1301, ROM 1302 and RAM 1303 are connected to each other through bus 1304. Input / output (I / O) interface 1305 is also connected to bus 1304.
[0145] The following components are connected to the I / O interface 1305: an input section 1306 including a keyboard, a mouse, etc.; an output section 1307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1308 including a hard disk, etc.; and a communication section 1309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1309 performs communication processing via a network such as the Internet. A drive 1310 is also connected to the I / O interface 1305 as needed. A removable medium 1311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1310 as needed so that a computer program read therefrom is installed into the storage section 1308 as needed.
[0146] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1309, and / or installed from a removable medium 1311. When the computer program is executed by a central processing unit (CPU) 1301, various functions defined in the system of the present application are executed.
[0147] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0148] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0149] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0150] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0151] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0152] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0153] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0154] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A video decoding method, characterized in that: include: Performing entropy decoding processing on the coding block of the video image frame to obtain a quantization coefficient block of residual data corresponding to the coding block; Performing inverse quantization processing on the quantized coefficient block to obtain an inverse quantized coefficient matrix; Performing a rotation process on the dequantized coefficient matrix and a rearrangement process on some coefficients to obtain a processed coefficient matrix; generating the residual data according to the processed coefficient matrix; Wherein, the video decoding method further includes: Counting the quantized coefficients in the quantized coefficient block to obtain an implicit derived index value; According to the implicit derived index value and the value of the explicit index identifier contained in the coding block, it is determined whether the coding block needs to skip the inverse transformation processing, and whether the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing needs to be rotated and rearranged.
2. The video decoding method according to claim 1, characterized in that: The dequantization coefficient matrix is rotated, including at least one of the following: Performing rotation processing on the entire region or a part of the region of the dequantization coefficient matrix; The inverse quantization coefficient matrix is subjected to a flipping process in all regions or in part of the regions.
3. The video decoding method according to claim 2, characterized in that: The dequantization coefficient matrix is subjected to rotation processing of the entire region or a part of the region, including: The entire region or a part of the region of the dequantization coefficient matrix is rotated n×90° according to a specified direction, where n is a non-negative integer.
4. The video decoding method according to claim 2, characterized in that: The inverting process is performed on the entire region or a part of the region of the inverse quantization coefficient matrix, including at least one of the following: The whole or part of the inverse quantization coefficient matrix is flipped along the main diagonal, the whole or part of the inverse quantization coefficient matrix is flipped along the secondary diagonal, the whole or part of the inverse quantization coefficient matrix is flipped left to right, and the whole or part of the inverse quantization coefficient matrix is flipped up and down.
5. The video decoding method according to claim 2, characterized in that: Performing a flipping process on the entire region or a partial region of the dequantization coefficient matrix includes: Determining a flipping method of the inverse quantization coefficient matrix according to the intra-frame prediction mode adopted by the coding block; The entire region or a part of the region of the inverse quantization coefficient matrix is flipped based on the determined flipping method.
6. The video decoding method according to claim 5, characterized in that: Determining a flipping method of the inverse quantization coefficient matrix according to the intra-frame prediction mode adopted by the coding block includes: If the direction of the intra-frame prediction mode of the coding block is toward the lower left, it is determined that the inverse quantization coefficient matrix is flipped upside down; if the direction of the intra-frame prediction mode of the coding block is toward the upper right, it is determined that the inverse quantization coefficient matrix is flipped left to right; or The flipping method of the dequantization coefficient matrix is determined according to the relationship between the width and the height of the dequantization coefficient matrix.
7. The video decoding method according to claim 1, characterized in that: The inverse quantization coefficient matrix is rotated and some coefficients are rearranged, including: the inverse quantization coefficient matrix is rotated and at least two coefficients are rearranged.
8. The video decoding method according to claim 1, characterized in that: Also includes: The value of the explicit index identifier is determined according to at least one of the following methods: The value of the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence; The value of the index identifier contained in the image header of the coding block corresponding to the video image frame; The encoding mode used by the encoding block; The size of the encoding block.
9. The video decoding method according to claim 8, characterized in that: The value of the explicit index identifier is determined according to the following method: the value of the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence, the value of the index identifier contained in the image header of the coding block corresponding to the video image frame, the coding mode adopted by the coding block, and the size of the coding block; Determining whether the coding block needs to skip inverse transformation processing, and whether the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing needs to be rotated and rearranged according to the implicit derived index value and the value of the explicit index identifier contained in the coding block, including: If the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence and the index identifier contained in the image header of the coding block corresponding to a video image frame in the video image frame sequence are both specified values, the coding mode adopted by the target coding block in the coding block corresponding to the video image frame is the intra-frame coding mode, and the size of the target coding block is smaller than the set size, then when the statistical result of the quantization coefficient block corresponding to the target coding block is a first value, it is determined that the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the target coding block needs to be rotated and rearranged.
10. The video decoding method according to claim 9, characterized in that: The video decoding method further comprises: If the index identifier contained in the sequence header of the coding block corresponding to the video image frame sequence and the index identifier contained in the image header of the coding block corresponding to a video image frame in the video image frame sequence are both specified values, the coding mode adopted by the target coding block in the coding block corresponding to the video image frame is the intra-frame coding mode, and the size of the target coding block is smaller than the set size, then when the statistical result of the quantization coefficient block corresponding to the target coding block is a second value, it is determined that it is necessary to perform inverse transformation processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing of the target coding block by means of discrete cosine transform DCT.
11. The video decoding method according to claim 1, characterized in that: Counting the quantized coefficients in the quantized coefficient block to obtain an implicit derived index value includes: Count the number of non-zero coefficients, even coefficients, non-zero even coefficients or odd coefficients in a specified area in the quantization coefficient block, and use the parity of the number as the coefficient statistics result in the quantization coefficient block to determine the implicit derived index value; wherein the specified area includes the entire area in the quantization coefficient block or the scan area coefficient coding SRCC area in the quantization coefficient block.
12. The video decoding method according to claim 1, characterized in that: Determining whether the coding block needs to skip inverse transformation processing, and whether the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing needs to be rotated and rearranged according to the implicit derived index value and the value of the explicit index identifier contained in the coding block, including: If the value of the explicit index identifier included in the coding block is the first value and the implicit derived index value is the first value, it is determined that the coding block needs to skip the inverse transformation process, and the inverse quantization coefficient matrix obtained by performing entropy decoding and inverse quantization on the coding block needs to be subjected to the rotation process and the rearrangement process; If the value of the explicit index identifier included in the coding block is the first value and the implicit derived index value is the second value, it is determined that the coding block needs to skip the inverse transform process, and there is no need to perform the rotation process and the rearrangement process on the inverse quantization coefficient matrix obtained by performing entropy decoding and inverse quantization process on the coding block; If the value of the explicit index identifier included in the coding block is the second value, it is determined that the coding block needs to perform inverse transformation processing on the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing through DCT transformation.
13. A video decoding device, characterized in that: include: A decoding unit configured to perform entropy decoding processing on a coding block of a video image frame to obtain a quantization coefficient block of residual data corresponding to the coding block; A first processing unit, configured to perform inverse quantization processing on the quantization coefficient block to obtain an inverse quantization coefficient matrix; A second processing unit is configured to perform a rotation process on the dequantized coefficient matrix and a rearrangement process on some coefficients to obtain a processed coefficient matrix; a third processing unit, configured to generate the residual data according to the processed coefficient matrix; Among them, the second processing unit is also configured to: count the quantization coefficients in the quantization coefficient block to obtain implicit derived index values; determine whether the coding block needs to skip inverse transformation processing and whether the inverse quantization coefficient matrix obtained by entropy decoding and inverse quantization processing needs to be rotated and rearranged according to the implicit derived index values and the values of the explicit index identifiers contained in the coding block.
14. An electronic device, characterized in that: include: one or more processors; A storage device, used to store one or more computer programs, when the one or more computer programs are executed by the one or more processors, enables the one or more processors to implement the video decoding method according to any one of claims 1 to 12.
15. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the video decoding method according to any one of claims 1 to 12 is implemented.
16. A computer program product, characterized in that The computer program product comprises a computer program, which is stored in a computer-readable storage medium. A processor of an electronic device reads and executes the computer program from the computer-readable storage medium, so that the electronic device executes the video decoding method according to any one of claims 1 to 12.
17. A method for processing a video code stream, characterized in that: The video code stream is decoded based on the video decoding method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Repositioning of prediction residual blocks in video coding
CN105165012A