Video encoding and decoding method, device, computer-readable medium and electronic device

The boundary coordinates of the SRCC scanning area are determined by coding block size and range variable difference of the encoded video image frame, which solves the problem of low encoding efficiency in transform skip mode, and achieves more efficient video compression.

CN114979642BActive Publication Date: 2025-07-25TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110199310.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-22
Publication Date
2025-07-25
Estimated Expiration
2041-02-22

AI Technical Summary

Technical Problem

In the video encoding process, the problem of low encoding efficiency, especially in the transformation skip mode, the inconcentrated residual coefficient distribution causes the scanning area to occupy more bits, affecting the video compression performance.

Method used

By encoding the encoded block size of the video image frame and the difference in the range variable based on the scanning area, the boundary coordinates of the SRCC scanning area are determined, and the horizontal coordinates of the right end and vertical coordinates of the SRCC scanning area are avoided directly encoding, and the encoding method is improved to reduce the number of bits.

Benefits of technology

Improves video encoding and decoding efficiency and improves video compression performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979642B_ABST
    Figure CN114979642B_ABST
Patent Text Reader

Abstract

This application belongs to the field of computer technology, and particularly relates to a video encoding and decoding method, apparatus, medium, and electronic device. The video decoding method in the embodiments of this application includes: obtaining the size of an encoded block of a video image frame, where the size of the encoded block includes the width and height of the encoded block; decoding from the bitstream of the encoded block to obtain the difference of range variables related to the coefficient coding SRCC (Scan Region of Coefficient) scan region of the encoded block, where the range variables include a width range variable corresponding to the width and a height range variable corresponding to the height; determining the boundary coordinates of the SRCC scan region according to the size of the encoded block and the values of the range variables, where the boundary coordinates include the right-end abscissa corresponding to the width range variable and the lower-end ordinate corresponding to the height range variable. This method can improve the efficiency of video encoding and decoding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, and particularly relates to a video encoding and decoding method, a video encoding and decoding device, a computer-readable medium, and an electronic device. Background Art

[0002] During video encoding, the encoding end usually needs to perform transformation, quantization, and entropy encoding on the residual data between the original video data and the predicted video data, and then send it to the decoding end. If the energy of the residual coefficients is not concentrated enough, especially in the transform skip mode, the distribution of the residual coefficients is more scattered, which will cause the range of the scanning area to occupy more bits during encoding, thus resulting in the problem of reduced encoding efficiency and affecting the compression performance of the video. Summary of the Invention

[0003] The purpose of this application is to provide a video encoding and decoding method, a video encoding and decoding device, a computer-readable medium, and an electronic device, which at least overcome to a certain extent the technical problem of low video encoding and decoding efficiency in the related art.

[0004] Other features and advantages of this application will become apparent through the following detailed description, or be learned in part through the practice of this application.

[0005] According to one aspect of the embodiments of this application, a video decoding method is provided. The method includes: obtaining the size of an encoded block of a video image frame, where the size of the encoded block includes the width and height of the encoded block; decoding from the bitstream of the encoded block to obtain the value of a range variable related to the coefficient encoding SRCC scanning area based on the scanning area of the encoded block, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height; determining the boundary coordinates of the SRCC scanning area according to the difference between the size of the encoded block and the range variable, where the boundary coordinates include the right-end abscissa corresponding to the width range variable and the lower-end ordinate corresponding to the height range variable.

[0006] According to one aspect of the embodiments of the present application, a video decoding device is provided. The device includes: a size acquisition module configured to acquire the size of an encoded block of a video image frame, where the size of the encoded block includes the width and height of the encoded block; a variable decoding module configured to decode, from the bitstream of the encoded block, the value of a range variable related to the SRCC scan region of the encoded block, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height; and a coordinate determination module configured to determine the boundary coordinates of the SRCC scan region according to the difference between the size of the encoded block and the range variable, where the boundary coordinates include the right-end abscissa corresponding to the width range variable and the lower-end ordinate corresponding to the height range variable.

[0007] In some embodiments of the present application, based on the above technical solution, the coordinate determination module is configured to: determine the boundary coordinates of the SRCC scan region according to the following formula;

[0008] SRx = width - 1 - width_minus1_minus_scan_region_x;

[0009] SRy = height - 1 - height_minus1_minus_scan_region_y;

[0010] where SRx is the right-end abscissa, SRy is the lower-end ordinate, width is the width, height is the height, width_minus1_minus_scan_region_x is the width range variable, and height_minus1_minus_scan_region_y is the height range variable.

[0011] In some embodiments of the present application, based on the above technical solution, the variable decoding module includes: a binary symbol decoding unit configured to sequentially decode the binary symbols corresponding to the indexes in the bitstream of the encoded block in ascending order of the index numbers to obtain the values of the binary symbols; a position variable assignment unit configured to, if the value of the current binary symbol is a preset first value, assign the current index number corresponding to the current binary symbol as the position variable; and a range variable assignment unit configured to assign the range variable related to the SRCC scan region of the encoded block according to the value of the position variable.

[0012] In some embodiments of the present application, based on the above technical solution, the range variable assignment unit includes: a value comparison sub-unit configured to compare the value of the position variable with a preset second value; a first assignment sub-unit configured to assign the second value to the range variable if the value of the position variable is less than or equal to the second value; a value determination sub-unit configured to, if the value of the position variable is greater than the second value, determine a prefix value according to the value of the position variable and determine a suffix value according to the decoding result of other binary symbols after the current binary symbol; and a second assignment sub-unit configured to assign the sum of the prefix value and the suffix value to the range variable.

[0013] In some embodiments of the present application, based on the above technical solution, the value determination sub-unit is further configured to: perform a mapping process on the value of the position variable according to a first mapping vector to obtain a first mapping value corresponding to the value of the position variable; and determine a prefix value according to the first mapping value.

[0014] In some embodiments of the present application, based on the above technical solution, the value determination sub-unit is further configured to: determine the target number of other binary symbols to be decoded according to the value of the position variable; and decode the target number of other binary symbols after the current binary symbol to obtain a suffix value.

[0015] In some embodiments of the present application, based on the above technical solution, the value determination sub-unit is further configured to: perform entropy decoding on the target number of other binary symbols after the current binary symbol in a by-pass decoding manner; and perform inverse binary conversion on the entropy decoding result in the manner of a fixed-length code with a length of len bits using the target number as the length of the fixed-length code to obtain a suffix value.

[0016] In some embodiments of the present application, based on the above technical solution, the binary symbol decoding unit includes: an incremental assignment sub-unit configured to assign an increment to the context index corresponding to the binary symbol; a model determination sub-unit configured to determine a context model corresponding to the binary symbol according to the increment of the context index obtained by the assignment; and a value decoding sub-unit configured to perform arithmetic decoding on the binary symbol based on the context model through a CABAC decoding engine to obtain the value of the binary symbol.

[0017] In some embodiments of the present application, based on the above technical solution, the incremental assignment sub-unit is configured to: assign the index number corresponding to the binary symbol as the increment of the context index.

[0018] In some embodiments of the present application, based on the above technical solutions, the incremental assignment subunit is configured to: assign an initial value to the context index increment according to the channel information of the coding block; determine a displacement amount according to the channel information of the coding block and the size of the coding block; determine an assignment to the context index increment corresponding to the binary symbol according to the initial value, the index number, and the displacement amount.

[0019] In some embodiments of the present application, based on the above technical solutions, the incremental assignment subunit is further configured to: if the coding block is a luminance block, assign a preset third value as the initial value of the context index increment; if the coding block is a chrominance block, determine a fourth value related to the size of the coding block, and assign the initial value of the context index increment after increasing the fourth value on the basis of the third value.

[0020] In some embodiments of the present application, based on the above technical solutions, the incremental assignment subunit is further configured to: perform a mapping process on the size of the coding block according to a second mapping vector to obtain a second mapping value corresponding to the size of the coding block; use the second mapping value as the fourth value related to the size of the coding block.

[0021] In some embodiments of the present application, based on the above technical solutions, the incremental assignment subunit is further configured to: if the coding block is a luminance block, determine the displacement amount according to the formula shift_x = clip3(0, 2, (logV + 1) >> 2), where shift_x is the displacement amount and V is the size of the coding block; if the coding block is a chrominance block, determine the displacement amount according to the formula shift_x = clip3(0, 2, (T >> 3)), where shift_x is the displacement amount and T is the size of the coding block.

[0022] In some embodiments of the present application, based on the above technical solutions, the variable decoding module includes: an index interval determination unit configured to determine a plurality of consecutive index intervals composed of integers, the index interval including a lower limit and an upper limit of the interval; a prefix value decoding unit configured to decode a prefix value in the bitstream of the coding block; a target interval determination unit configured to determine a target index interval where the value of the range variable is located according to the numerical relationship between the prefix value and an index threshold, the index threshold being the upper limit of the first index interval; a compensation value determination unit configured to determine a compensation value according to the lower limit of the target index interval; and a range variable determination unit configured to determine the value of the range variable according to the compensation value.

[0023] In some embodiments of the present application, based on the above technical solutions, the prefix value decoding unit includes: a truncation value determination subunit configured to determine a truncation value according to the number of intervals and the lower limit of the last index interval; a prefix value decoding subunit configured to perform entropy decoding and inverse binarization on the code stream of the coding block in the manner of truncated unary code based on the truncation value to obtain a prefix value.

[0024] In some embodiments of the present application, based on the above technical solutions, the prefix value decoding unit is configured to: decode the code stream of the coding block by CABAC decoding method to obtain a prefix value.

[0025] In some embodiments of the present application, based on the above technical solutions, the range variable determination unit includes: a first variable assignment subunit configured to assign the compensation value as the range variable if the target index interval is the first index interval; a second variable assignment subunit configured to, if the target index interval is other index intervals except the first index interval, decode a suffix value in the code stream of the coding block, and assign the sum of the compensation value and the suffix value as the range variable.

[0026] In some embodiments of the present application, based on the above technical solutions, the second variable assignment subunit is further configured to: determine the target number of binary symbols to be decoded in the code stream of the coding block according to the upper limit and the lower limit of the target index interval; perform entropy decoding on the target number of binary symbols in the code stream of the coding block; use the target number as the length of a fixed-length code, and perform inverse binarization on the entropy decoding result in the manner of a len-bit fixed-length code to obtain a suffix value.

[0027] In some embodiments of the present application, based on the above technical solutions, the second variable assignment subunit is further configured to: select a target decoding method from multiple candidate decoding methods; decode a suffix value in the code stream of the coding block according to the target decoding method.

[0028] In some embodiments of the present application, based on the above technical solutions, the variable decoding module includes: a decoding method selection unit configured to select a target decoding method from multiple candidate decoding methods; a target method decoding unit configured to decode the value of the range variable related to the SRCC scanning area in the code stream of the coding block according to the target decoding method.

[0029] In some embodiments of the present application, based on the above technical solutions, the multiple candidate decoding methods include at least one of the following decoding methods: a decoding method based on truncated unary code; a decoding method based on unary code; a decoding method based on len-bit fixed-length code; a decoding method based on k-th order exponential Golomb code.

[0030] In some embodiments of the present application, based on the above technical solutions, the video decoding device is applied to an encoding block that satisfies any one of the following conditions: an encoding block in transform skip mode; an encoding block with an intra-picture prediction transform skip enable flag value of 1; an encoding block with an inter-picture prediction transform skip enable flag value of 1; an encoding block with both an intra-picture prediction transform skip enable flag value and an inter-picture prediction transform skip enable flag value of 1; all encoding blocks.

[0031] According to one aspect of the embodiments of the present application, a video encoding method is provided. The method includes: obtaining the size of an encoding block of a video image frame, where the size of the encoding block includes the width and height of the encoding block; obtaining the boundary coordinates of a coefficient coding SRCC scan region of the encoding block based on a scan region, where the boundary coordinates include the right-end abscissa corresponding to the width and the lower-end ordinate corresponding to the height; determining the value of a range variable related to the SRCC scan region according to the difference between the size of the encoding block and the boundary coordinates, and encoding the range variable, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height.

[0032] According to one aspect of the embodiments of the present application, a video encoding device is provided. The device includes: a size obtaining module configured to obtain the size of an encoding block of a video image frame, where the size of the encoding block includes the width and height of the encoding block; a coordinate obtaining module configured to obtain the boundary coordinates of a coefficient coding SRCC scan region of the encoding block based on a scan region, where the boundary coordinates include the right-end abscissa corresponding to the width and the lower-end ordinate corresponding to the height; a variable encoding module configured to determine the value of a range variable related to the SRCC scan region according to the difference between the size of the encoding block and the boundary coordinates, and encode the range variable, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height.

[0033] According to one aspect of the embodiments 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, it implements the video decoding method in the above technical solutions.

[0034] According to one aspect of the embodiments of the present application, an electronic device is provided. The electronic device includes: a processor; and a memory for storing executable instructions of the processor; wherein, the processor is configured to execute the video decoding method in the above technical solutions by executing the executable instructions.

[0035] 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, and 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 executes the video decoding method in the above technical solution.

[0036] In the technical solution provided by the embodiments of the present application, according to the statistical characteristics of the boundary coordinates of the SRCC scanning region, an encoding and decoding method for the boundary coordinates of the SRCC scanning region is proposed, that is, instead of directly encoding the abscissa of the right end and the ordinate of the lower end of the SRCC scanning region, a range variable related to the boundary coordinates and the size of the encoding block is encoded. During decoding, the value of the range variable is first decoded and deduced from the bitstream, and then the boundary coordinates of the SRCC scanning region can be obtained. The encoding and decoding method provided by the embodiments of the present application can reduce the number of bits required for encoding, help improve the encoding and decoding efficiency of coefficient encoding, and thus further improve the video compression performance.

[0037] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] The drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts.

[0039] 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.

[0040] Figure 2 A schematic diagram showing the placement of a video encoding device and a video decoding device in a streaming system.

[0041] Figure 3 A basic flowchart of a video encoder is shown.

[0042] Figure 4 A scanning region marked by the SRCC technology is shown.

[0043] Figure 5 A schematic diagram showing the scanning order of the marked scanning region is shown.

[0044] Figure 6The flowchart of the steps of the video decoding method in an embodiment of the present application is shown.

[0045] Figure 7 The flowchart of the steps of decoding the range variable of the bitstream distribution position based on binary symbols in an embodiment of the present application is shown.

[0046] Figure 8 The flowchart of the steps of decoding binary symbols in an embodiment of the present application is shown.

[0047] Figure 9 The flowchart of the steps of assigning values to the context index increment corresponding to binary symbols in an embodiment of the present application is shown.

[0048] Figure 10 The flowchart of the steps of decoding the range variable based on the index interval in an embodiment of the present application is shown.

[0049] Figure 11 The flowchart of the steps of the video encoding method in an embodiment of the present application is shown.

[0050] Figure 12 The structural block diagram of the video decoding device provided in an embodiment of the present application is shown.

[0051] Figure 13 The structural block diagram of the video encoding device provided in an embodiment of the present application is shown.

[0052] Figure 14 The computer system structural block diagram of the electronic device suitable for implementing the embodiments of the present application is schematically shown. Detailed implementation manners

[0053] Now, example embodiments will be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various 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 thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art.

[0054] In addition, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will realize that the technical solutions of the present application can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, well-known methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the present application.

[0055] The block diagrams shown in the accompanying drawings are only functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can 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.

[0056] The flowcharts shown in the accompanying drawings are only exemplary illustrations and do not necessarily include all the content and operations / steps, nor do they have to be executed in the described order. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined, so the actual execution order may change according to the actual situation.

[0057] It should be noted that: "a plurality of" mentioned in this article means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0058] Figure 1 The schematic diagram of an exemplary system architecture to which the technical solution of the embodiment of the present application can be applied is shown.

[0059] As Figure 1 shown, the system architecture 100 includes a plurality of terminal devices, and the terminal devices can communicate with each other through, for example, the network 150. For example, the system architecture 100 can include a first terminal device 110 and a second terminal device 120 interconnected through the network 150. In Figure 1 the embodiment, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.

[0060] For example, the first terminal device 110 can encode video data (such as a video picture stream collected by the terminal device 110) to be transmitted to the second terminal device 120 through the network 150. The encoded video data is transmitted in the form of one or more encoded video bitstreams. The second terminal device 120 can receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display the video pictures according to the restored video data.

[0061] 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, such as may occur during a video conference. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (such as a video picture stream captured by the terminal device) for transmission over the network 150 to the other of the third terminal device 130 and the fourth terminal device 140. Each of the third terminal device 130 and the fourth terminal device 140 may also receive the encoded video data transmitted by the other of the third terminal device 130 and the fourth terminal device 140, may decode the encoded video data to recover the video data, and may display the video picture on an accessible display device based on the recovered video data.

[0062] In Figure 1 an embodiment, 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 are not limited thereto. The embodiments disclosed in the present application are applicable to laptop computers, tablet computers, media players, and / or dedicated video conferencing devices. The network 150 represents any number of networks that convey 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-switched and / or packet-switched channels. The network may include a telecommunications network, a local area network, a wide area network, and / or the Internet. For the purposes of the present application, unless otherwise explained hereinafter, the architecture and topology of the network 150 may be immaterial to the operations disclosed in the present application.

[0063] In one embodiment of the present application, Figure 2 shows the placement of the video encoding device and the video decoding device in a streaming environment. The subject matter disclosed in the present application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital TV (television), storing compressed video on digital media including CDs, DVDs, memory sticks, and the like.

[0064] A streaming system may include an acquisition subsystem 213, and the acquisition subsystem 213 may include a video source 201 such as a digital camera. The video source creates an uncompressed video picture stream 202. In an embodiment, the video picture stream 202 includes samples taken by the digital camera. Compared with the encoded video data 204 (or the encoded video bitstream 204), the video picture stream 202 is depicted as a thick line to emphasize the high-data-volume video picture stream. The video picture stream 202 may be processed by an electronic device 220, and the electronic device 220 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 both to implement or carry out aspects of the disclosed subject matter described in more detail below. Compared with the video picture stream 202, the encoded video data 204 (or the encoded video bitstream 204) is depicted as a thin line to emphasize the lower-data-volume encoded video data 204 (or the encoded video bitstream 204), which may be stored on a 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

[0065] may access the streaming server 205 to retrieve copies 207 and 209 of the encoded video data 204. The client subsystem 206 may include, for example, a video decoding device 210 in an 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 (such as 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 (such as video bitstreams) may be encoded according to certain video encoding / compression standards. Examples of such standards include ITU-T H.265. In an embodiment, a video encoding 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.

[0066] In an embodiment of the present application, taking the international video coding standards HEVC (High Efficiency Video Coding) and VVC (Versatile Video Coding), as well as the Chinese national video coding standard AVS as examples, after inputting a video frame image, the video frame image will be divided into a number of non-overlapping processing units according to a block size, and each processing unit will perform similar compression operations. This processing unit is called a CTU (Coding Tree Unit), or an LCU (Largest Coding Unit). The CTU can be further divided more finely to obtain one or more basic coding units CU, and the CU is the most basic element in a coding link. The following introduces some concepts when coding the CU:

[0067] Predictive Coding: Predictive coding includes methods such as intra-frame prediction and inter-frame prediction. After the original video signal is predicted by the selected reconstructed video signal, a residual video signal is obtained. The encoding end needs to decide which predictive coding mode to select for the current CU and inform the decoding end. Among them, intra-frame prediction means that the predicted signal comes from the area that has been encoded and reconstructed within the same image; inter-frame prediction means that the predicted signal comes from other images that have been encoded and are different from the current image (referred to as reference images).

[0068] Transform & Quantization: After the residual video signal undergoes transformation operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform), the signal is converted into the transform domain, which is called the transform coefficient. The transform coefficient further undergoes a lossy quantization operation, losing certain information, so that the quantized signal is conducive to compressed representation. In some video coding standards, there may be more than one transformation method to choose from, so the encoding end also needs to select one of the transformation methods for the current CU and inform the decoding end. The fineness of quantization is usually determined by the quantization parameter (abbreviated as QP). A larger QP value means that coefficients in a larger value range will be quantized to the same output, so it usually brings greater distortion and a lower bit rate; on the contrary, a smaller QP value means that coefficients in a smaller value range will be quantized to the same output, so it usually brings less distortion and a corresponding higher bit rate.

[0069] Entropy Coding or Statistical Coding: The quantized transform domain signal will be statistically compressed and encoded according to the frequencies of each value, and finally a binary (0 or 1) compressed bitstream is output. At the same time, other information generated during encoding, such as the selected coding mode, motion vector data, etc., also needs 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 represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) or Content-Adaptive Binary Arithmetic Coding (CABAC).

[0070] The process of Context-Adaptive Binary Arithmetic Coding (CABAC) mainly includes three steps: binarization, context modeling, and binary arithmetic coding. After binarizing the input syntax element, the binary data can be encoded through the regular coding mode and the bypass coding mode. The Bypass Coding Mode does not need to assign a specific probability model to each binary bit. The input binary bit bin value is directly encoded by a simple bypass encoder to speed up the entire encoding and decoding process. Generally, different syntax elements are not completely independent of each other, and the same syntax element itself also has a certain degree of memory. Therefore, according to the conditional entropy theory, using other already encoded syntax elements for conditional coding can further improve the coding performance compared to independent coding or memoryless coding. This information of the already encoded symbols used as conditions is called context. In the regular coding mode, the binary bits of the syntax element enter the context modeler sequentially. The encoder assigns an appropriate probability model to each input binary bit according to the values of the previously encoded syntax elements or binary bits. This process is called context modeling. The context model corresponding to the syntax element can be located through ctxIdxInc (context index increment) and ctxIdxStart (context index Start). After sending the bin value and the assigned probability model into the binary arithmetic encoder for encoding, the context model needs to be updated according to the bin value, which is the adaptive process in encoding.

[0071] Loop Filtering: The signal that has undergone transformation and quantization will obtain the reconstructed image through operations such as inverse quantization, inverse transformation, and prediction compensation. Compared with the original image, due to the influence of quantization, some information in the reconstructed image is different from the original image, that is, the reconstructed image will generate distortion. Therefore, filtering operations can be performed on the reconstructed image, such as deblocking filter (abbreviated as DB), SAO (Sample Adaptive Offset), or ALF (Adaptive Loop Filter) and other filters, which can effectively reduce the degree of distortion generated by quantization. Since these filtered reconstructed images will be used as references for subsequent encoded images to predict future image signals, the above filtering operations are also called loop filtering, that is, filtering operations within the encoding loop.

[0072] In an embodiment of the present application, Figure 3 shows a basic flowchart of a video encoder, and the intra-frame prediction is taken as an example for illustration in this process. Among them, the original image signal s k [x, y] and the predicted image signal perform a difference operation to obtain the residual signal u k [x, y], and the residual signal u k [x, y] undergoes transformation and quantization processing to obtain quantization coefficients. On the one hand, the quantization coefficients obtain the encoded bitstream through entropy coding, and on the other hand, they obtain the reconstructed residual signal u' k [x, y] through inverse quantization and inverse transformation processing. The predicted image signal and the reconstructed residual signal u' k [x, y] are superimposed to generate the image signal The image signal is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing on the one hand, and on the other hand, the reconstructed image signal s' k [x, y] is output through loop filtering. The reconstructed image signal s' k [x, y] can be used as a 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 the intra-frame prediction result obtain the predicted image signal of the next frame and continue to repeat the above process until the encoding is completed.

[0073] Based on the above encoding process, at the decoding end, for each CU, after obtaining the compressed bitstream (i.e., the bitstream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then, the quantization coefficients are processed through inverse quantization and inverse transformation to obtain the residual signal. On the other hand, according to the known encoding mode information, the prediction signal corresponding to the CU can be obtained. Then, after adding the residual signal and the prediction signal, the reconstructed signal can be obtained. The reconstructed signal is then processed through operations such as loop filtering to generate the final output signal.

[0074] In the above encoding and decoding process, the transformation processing of the residual signal makes the energy of the residual signal concentrate on fewer low-frequency coefficients, that is, most of the coefficient values are small. Then, after passing through the subsequent quantization module, the smaller coefficient values will become zero values, greatly reducing the cost of the encoded residual signal. However, due to the diversity of the residual distribution, a single DCT transformation cannot adapt to all residual characteristics. Therefore, transformation kernels such as DST7 and DCT8 are introduced into the transformation process, and different transformation kernels can be used for the horizontal transformation and vertical transformation of the residual signal. Taking the AMT (Adaptive multiple core transform) technology as an example, the possible transformation combinations for processing a residual signal are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8), and (DST7, DST7). Which transformation combination to specifically select for the residual signal requires making a decision using RDO (Rate–Distortion Optimization) at the encoding end. In addition, in the case where the correlation of the residual distribution within the residual block is weak, the residual signal can be directly quantized without going through the transformation process, that is, transformation skipping. Whether the current residual block belongs to the transformation skipping mode can be identified through two methods: explicit encoding and implicit derivation.

[0075] Since the non-zero coefficients in the quantization coefficient block after the residual signal undergoes transformation and quantization processing are more likely to concentrate in the left and upper regions of the block, while the right and lower regions of the block are often 0, the SRCC technology is introduced. Through the SRCC technology, the size of the upper left region containing non-zero coefficients in each quantization coefficient block (with a size of W×H) can be marked as (SRx + 1)×(SRy + 1), where SRx is the abscissa of the rightmost non-zero coefficient in the quantization coefficient block, SRy is the ordinate of the bottommost non-zero coefficient in the quantization coefficient block, and the starting coordinates of the upper left corner are (0, 0), 1 ≤ SRx + 1 ≤ W, 1 ≤ SRy + 1 ≤ H, and the coefficients outside this region are all 0. The SRCC technology uses (SRx, SRy) to determine the quantization coefficient region that needs to be scanned in a quantization coefficient block, as Figure 4As shown, only the quantization coefficients within the scanning region marked by (SRx, SRy) need to be encoded, and the scanning order for encoding is as Figure 5 shown, which can be a reverse Z-shaped scan from the lower right corner to the upper left corner.

[0076] The coefficients to be encoded within the SRCC region are encoded using a hierarchical method. Specifically, first, the coordinates of the SRCC scanning region are encoded. Then, within the SRCC region, based on the scanning order, the flag (significant flag) indicating whether the coefficient at the current position is 0 is encoded one by one. At the same time, the positions of non-zero coefficients are recorded and the number of non-zero coefficients is counted. If the number of non-zero coefficients is greater than 0, then the absolute value and sign of the non-zero coefficients at the corresponding positions need to be encoded.

[0077] Taking the AVS3 standard as an example, the video codec uses the ScanRegion based Coefficient Coding (SRCC) technology. Before encoding all the coefficients within the SRCC region, the right horizontal coordinate scan_region_x (value SRx) and the lower vertical coordinate scan_region_y (value SRy) of the SRCC scanning region need to be encoded first. In the existing AVS standard, the values SRx of scan_region_x and SRy of scan_region_y are directly encoded.

[0078] Considering that the boundary of the SRCC region mainly depends on the positions of the rightmost and bottommost non-zero coefficients within the current block. For the transformed coding block, the transformed energy is mainly concentrated at the positions of the limited low-frequency coefficients. Therefore, the area of the SRCC region, as well as SRx and SRy, tend to be smaller values. However, for the coding block in the transform skip mode, since there is no transformation process, the residual coefficient energy is not concentrated, and the distribution of non-zero coefficients may be relatively sparser. Therefore, the area of the SRCC region of the coding block in the transform skip mode, as well as SRx and SRy, tend to be larger values relatively. Therefore, if SRx and SRy are directly encoded in the transform skip mode, it may require more bits to encode SRx and SRy in the transform skip mode, resulting in a reduction in coding efficiency.

[0079] According to the statistical characteristics of the SRCC region coordinates in the transform skip mode, this application proposes an encoding and decoding method for the SRCC scan region coordinates. That is, instead of directly encoding the value SRx of the right-end horizontal coordinate scan_region_x and the value SRy of the bottom-end vertical coordinate scan_region_y of the SRCC scan region, it encodes the value of width - 1 - SRx (denoted as width_minus1_minus_scan_region_x) and the value of height - 1 - SRy (denoted as height_minus1_minus_scan_region_y). During decoding, first decode and derive the values of width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y from the bitstream, and then the value of the right-end horizontal coordinate scan_region_x of the SRCC scan region can be obtained as SRx = width - 1 - width_minus1_minus_scan_region_x, and the value of the bottom-end vertical coordinate scan_region_y is SRy = height - 1 - height_minus1_minus_scan_region_y. The improved encoding method can reduce the number of bits required for encoding, which helps to improve the encoding efficiency of coefficient encoding, thereby further improving the video compression performance.

[0080] The encoding method for the SRCC scan region coordinates proposed in this application is not limited to being applied to the SRCC scan region coordinate encoding in the transform skip mode. It can be used for the SRCC scan region coordinate encoding in coefficient encoding in other encoding modes. For example, it can be used in the SRCC scan region coordinate encoding of all blocks. For example, it is used when the intra-picture prediction transform skip enable flag value at the picture level is 1; for example, it is used when the inter-picture prediction transform skip enable flag value at the picture level is 1; for example, it is used when both the intra-picture prediction transform skip enable flag value and the inter-picture prediction transform skip enable flag value at the picture level are 1, and so on.

[0081] In some optional embodiments, width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded in the transform skip mode, and the original encoding method is maintained in other modes, that is, SRx and SRy are directly encoded.

[0082] In some other alternative embodiments, the SRCC scan region coordinate encoding method for all blocks adopts the method of encoding width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y.

[0083] In some other alternative embodiments, another combination method is that in the transform skip mode, the original encoding method is maintained, that is, SRx and SRy are directly encoded, and in other modes, width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded.

[0084] In some other alternative embodiments, width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded when the image-level intra prediction transform skip enable flag value is 1, and the original encoding method is maintained under other conditions, that is, SRx and SRy are directly encoded.

[0085] In some other alternative embodiments, width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded when the image-level inter prediction transform skip enable flag value is 1, and the original encoding method is maintained under other conditions, that is, SRx and SRy are directly encoded.

[0086] In some other alternative embodiments, width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded when both the image-level intra prediction transform skip enable flag value and the image-level inter prediction transform skip enable flag value are 1, and the original encoding method is maintained under other conditions, that is, SRx and SRy are directly encoded.

[0087] In the embodiments of the present application, it is possible to determine whether a coding block adopts a transform skip mode through explicit coding or implicit derivation. Among them, explicit coding decodes a flag (flag) used to indicate whether the coding block adopts a transform skip mode before decoding the absolute value of the coefficient, so as to clearly determine whether the current coding block needs to skip the transform process based on the decoding result of the flag. Implicit derivation (i.e., Implicit Selection of Transform Skip) is to perform statistics on the coefficient decoding result in the absence of a corresponding flag, and then determine whether to skip the transform process according to the statistical result. For example, all coefficients can be decoded first, the number of all non-zero coefficients and the number of even coefficients among all coefficients (including zero coefficients) can be calculated, and then according to the parity of the number of non-zero coefficients or the parity of the number of even coefficients among all coefficients, it is implicitly deduced whether the current coding block adopts a transform skip (for example, when the number of non-zero coefficients is odd, it is determined that the current coding block adopts a transform skip; when the number of non-zero coefficients is even, it is determined that the current coding block does not adopt a transform skip. For example, when the number of even coefficients among all coefficients is even, it is determined that the current coding block adopts a transform skip; when the number of even coefficients among all coefficients is odd, it is determined that the current coding block does not adopt a transform skip).

[0088] The picture-level intra-prediction transform skip enable flag and the picture-level inter-prediction transform skip enable flag are flags used to control whether implicit selection of transform skip can be used in intra / inter prediction. In the embodiments of the present application, the syntax elements related to the transform skip mode are explained as follows.

[0089] Implicit selection of transform skip enable flag ist_skip_enable_flag:

[0090] A binary variable. A value of '1' indicates that implicit selection of transform skip can be used; a value of '0' indicates that implicit selection of transform skip should not be used. The value of the variable IstSkipEnableFlag can be obtained by decoding the syntax element ist_skip_enable_flag. If the syntax element ist_skip_enable_flag does not exist in the bitstream, IstSkipEnableFlag can be assigned a value of 0.

[0091] Inter-prediction transform skip enable flag inter_transform_skip_enable_flag:

[0092] Binary variable. A value of '1' indicates that inter-frame transform skip can be used; a value of '0' indicates that inter-frame transform skip should not be used. The value of the variable InterTransformSkipEnableFlag can be obtained by decoding the syntax element inter_transform_skip_enable_flag. If the syntax element inter_transform_skip_enable_flag does not exist in the bitstream, InterTransformSkipEnableFlag can be assigned a value of 0.

[0093] Picture-level intra-prediction transform skip enable flag picture_ist_skip_enable_flag:

[0094] Binary variable. A value of '1' indicates that the transform skip method can be used for the luminance intra-prediction residual block and the luminance coded block copy intra-prediction residual block of the current picture; a value of '0' indicates that the transform skip method should not be used for the luminance intra-prediction residual block and the luminance coded block copy intra-prediction residual block of the current picture. The value of the variable PictureIstSkipEnableFlag can be obtained by decoding the syntax element picure_ist_skip_enable_flag. If the syntax element picture_ist_skip_enable_flag does not exist in the bitstream, PictureIstSkipEnableFlag can be assigned a value of 0.

[0095] Picture-level inter-prediction transform skip enable flag picture_inter_trasform_skip_flag:

[0096] Binary variable. A value of '1' indicates that the transform skip method can be used for the luminance inter-prediction residual block of the current picture; a value of '0' indicates that the transform skip method should not be used for the luminance inter-prediction residual block of the current picture. The value of PictureInterSkipEnableFlag can be obtained by decoding the syntax element picture_inter_trasform_skip_flag. If the syntax element picture_inter_trasform_skip_flag does not exist in the bitstream, PictureInterSkipEnableFlag can be assigned a value of 0.

[0097] The implementation details of the technical solution of the embodiments of the present application are described in detail below in combination with specific application scenarios.

[0098] Figure 6The flowchart of the steps of a video decoding method in an embodiment of the present application is shown. This video decoding method can be executed by a device with computing and processing capabilities, such as a terminal device or a server. As Figure 6 shown, the video decoding method mainly includes the following steps S610 to S630.

[0099] Step S610: Obtain the size of the coded block of the video image frame. The size of the coded block includes the width and height of the coded block.

[0100] In an embodiment of the present application, the video image frame sequence includes a series of images. Each image can be further divided into slices, and each slice can be divided into a series of LCU (or CTU). An LCU contains several CUs. When the video image frame is encoded, it is encoded in units of blocks. In some new video coding standards, such as in the H.264 standard, there are macroblocks (MBs), and a macroblock can be further divided into multiple prediction blocks 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 adopted to functionally divide multiple block units and use a brand-new tree-based structure for description. For example, a CU can be divided into smaller CUs according to a quadtree, and the smaller CUs can continue to be divided, thus forming a quadtree structure. The coded block in the embodiment of the present application can be a CU or a block smaller than a CU, such as a smaller block obtained by dividing a CU.

[0101] Step S620: Decode from the bitstream of the coded block to obtain the values of the range variables related to the coefficient coding SRCC scan region based on the scan region of the coded block. The range variables include a width range variable corresponding to the width and a height range variable corresponding to the height.

[0102] In one embodiment of the present application, the syntax elements related to scan_region_x are decoded and de-binarized from the bitstream, and the derived value is assigned to the width range variable width_minus1_minus_scan_region_x. The meaning represented by the width range variable is the result obtained by subtracting the value SRx of the right abscissa scan_region_x of the SRCC scan region from the width width of the current coding block minus 1. Then, the syntax elements related to scan_region_x can be decoded and de-binarized from the bitstream, and the derived value is denoted as the height range variable height_minus1_minus_scan_region_y. The meaning represented by the height range variable is the result obtained by subtracting the value SRy of the lower ordinate scan_region_y of the SRCC scan region from the height height of the current coding block minus 1.

[0103] Step S630: Determine the boundary coordinates of the SRCC scan region according to the difference between the size of the coding block and the range variable. The boundary coordinates include the right abscissa corresponding to the width range variable and the lower ordinate corresponding to the height range variable.

[0104] From the definition of the width range variable, it can be determined that between the width range variable, the value of the right abscissa of the SRCC scan region, and the width of the coding block, the following formula is satisfied:

[0105] width_minus1_minus_scan_region_x+(SRx+1)=width

[0106] From this, the value of the right abscissa scan_region_x of the SRCC scan region can be obtained as:

[0107] SRx=width-1-width_minus1_minus_scan_region_x.

[0108] From the definition of the height range variable, it can be determined that between the height range variable, the value of the lower ordinate of the SRCC scan region, and the height of the coding block, the following formula is satisfied:

[0109] height_minus1_minus_scan_region_y+(SRy+1)=height

[0110] From this, the value of the lower ordinate scan_region_x of the SRCC scan region can be obtained as:

[0111] SRy = height - 1 - height_minus1_minus_scan_region_y。

[0112] In an embodiment of the present application, the range variable may be decoded according to the position distribution characteristics of the binary symbols in the bitstream. Figure 7 The flowchart showing the steps of decoding the range variable based on the position distribution of the binary symbols in the bitstream in an embodiment of the present application is as follows. Figure 7 As shown, based on the above embodiment, the steps of decoding the value of the range variable related to the SRCC scan region of the coding block from the bitstream of the coding block in step S620 may include the following steps S710 to S730.

[0113] Step S710: In the bitstream of the coding block, decode the values of the binary symbols corresponding to the index numbers in ascending order of the index numbers to obtain the values of the binary symbols.

[0114] In an embodiment of the present application, the binary symbols in the bitstream of the coding block are denoted as bin, and the corresponding index number is binIdx. For binIdx = 0 to (group_idx[min(T, 32) - 1] - 1), entropy decode the value of the bin at the binIdx-th bit in the bitstream in the CABAC manner one by one. When width_minus1_minus_scan_region_x needs to be decoded, let T = width. When height_minus1_minus_scan_region_y needs to be decoded, let T = height. Among them, group_idx

[64] = {0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}.

[0115] Step S720: If the value of the current binary symbol is a preset first value, assign the current index number corresponding to the current binary symbol as the position variable.

[0116] In an embodiment of the present application, the first value is taken as 0. If the value of the current binary symbol obtained by current decoding is 0, that is, bin = 0, the position variable pos can be assigned the current index number corresponding to the current binary symbol, that is, let pos = binIdx. If the value of the current binary symbol is not the first value (for example, the value is 1, that is, bin = 1), then let binIdx = binIdx + 1, and continue to read other subsequent binary symbols.

[0117] Step S730: Assign values to the range variables related to the SRCC scan region of the coding block according to the value of the position variable.

[0118] In an embodiment of the present application, the method of assigning values to the range variables related to the SRCC scan region of the coding block according to the value of the position variable may include: comparing the value of the position variable with a preset second value; if the value of the position variable is less than or equal to the second value, assign the second value to the range variable; if the value of the position variable is greater than the second value, determine a prefix value according to the value of the position variable, and determine a suffix value according to the decoding results of other binary symbols after the current binary symbol; assign the sum of the prefix value and the suffix value to the range variable.

[0119] For example, the second value is taken as 3. If the value of the position variable pos <= 3, then assign width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to pos. If the value of the position variable pos > 3, it is necessary to further determine the prefix value and the suffix value, so as to assign values to the current decoded range variable width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y according to the sum of the prefix value and the suffix value.

[0120] In an embodiment of the present application, the method of determining the prefix value according to the value of the position variable may include: performing a mapping process on the value of the position variable according to the first mapping vector to obtain a first mapping value corresponding to the value of the position variable; determining the prefix value according to the first mapping value.

[0121] For example, the first mapping vector is denoted as min_in_group

[14] = {0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96}. When the value of the position variable is greater than the second value, let the prefix value be pre = min_in_group[pos].

[0122] In an embodiment of the present application, the method for determining a suffix value according to the decoding results of other binary symbols after the current binary symbol may include: determining the target number of other binary symbols to be decoded according to the value of a position variable; decoding the target number of other binary symbols after the current binary symbol to obtain a suffix value. Optionally, the embodiment of the present application may perform entropy decoding on the target number of other binary symbols after the current binary symbol in the manner of bypass decoding; then, using the target number as the length of a fixed-length code, perform inverse binarization on the entropy decoding result in the manner of a fixed-length code of len bits to obtain a suffix value.

[0123] For example, when the value of the position variable is greater than a second value and the corresponding prefix value pre is determined, the embodiment of the present application may continue to decode len = (pos - 2) >> 1 bins in the bypass manner in the code stream and perform inverse binarization in the manner of a fixed-length code of len bits (see Table 1 below) to obtain a suffix value suf; then the currently decoded width range variable width_minus1_minus_scan_region_x or height range variable height_minus1_minus_scan_region_y may be assigned the value of pre + suf.

[0124] Table 1 Relationship between synElVal and binary symbol string (fixed-length code of length len)

[0125]

[0126] Figure 8 Shows the step flowchart for decoding binary symbols in an embodiment of the present application. As Figure 8 shown, based on the above embodiment, the method for decoding the binary symbols corresponding to the index numbers in ascending order of the index numbers to obtain the values of the binary symbols in step S710 may include the following steps S810 to S830.

[0127] Step S810: Assign a value to the context index increment corresponding to the binary symbol.

[0128] Step S820: Determine the context model corresponding to the binary symbol according to the context index increment obtained by the assignment.

[0129] Step S830: Based on the context model, perform arithmetic decoding on the binary symbol through a CABAC decoding engine to obtain the value of the binary symbol.

[0130] In an embodiment of the present application, the context index increment may be assigned a value with the index number corresponding to the binary symbol, that is, ctxIdxInc = binIdx.

[0131] In one embodiment of the present application, the context index increment may also be assigned according to the relevant position information of the binary symbol. Figure 9 FIG. shows a flowchart of steps for assigning a context index increment corresponding to a binary symbol in one embodiment of the present application. As Figure 9 shown, based on the above embodiment, the method for assigning a context index increment corresponding to a binary symbol in step S810 may include the following steps S910 to S930.

[0132] Step S910: Assign an initial value to the context index increment according to the channel information of the coding block.

[0133] In one embodiment of the present application, if the coding block is a luminance block, assign a preset third value as the initial value of the context index increment; if the coding block is a chrominance block, determine a fourth value related to the size of the coding block, and increase the fourth value on the basis of the third value and then assign it as the initial value of the context index increment.

[0134] In one embodiment of the present application, the method for determining the fourth value related to the size of the coding block may include: performing a mapping process on the size of the coding block according to the second mapping vector to obtain a second mapping value corresponding to the size of the coding block; using the second mapping value as the fourth value related to the size of the coding block.

[0135] For example, the third value may be taken as 0. If the current coding block is a luminance block, let ctxIdxInc = 0. If the current coding block is a chrominance block, let ctxIdxInc = ctxIdxInc + 25 + prefix_ctx[logV]. Among them, the second mapping vector is denoted as prefix_ctx[8] = {0, 0, 0, 3, 6, 10, 15, 21}. When width_minus1_minus_scan_region_x needs to be decoded, let V = width, then logV = log(width). When height_minus1_minus_scan_region_y needs to be decoded, let V = height, then logV = log(height).

[0136] Step S920: Determine the displacement amount according to the channel information of the coding block and the size of the coding block.

[0137] In one embodiment of the present application, if the coding block is a luminance block, the displacement amount is determined according to the formula shift_x = clip3(0, 2, (logV + 1) >> 2), where shift_x is the displacement amount and V is the size of the coding block. When decoding width_minus1_minus_scan_region_x, let V = width, then logV = log(width). When decoding height_minus1_minus_scan_region_y, let V = height, then logV = log(height). If the coding block is a chrominance block, the displacement amount is determined according to the formula shift_x = clip3(0, 2, (T >> 3)), where shift_x is the displacement amount and T is the size of the coding block. When decoding width_minus1_minus_scan_region_x, let T = width. When decoding height_minus1_minus_scan_region_y, let T = height..

[0138] Step S930: Determine the assignment of the context index increment corresponding to the binary symbol according to the initial value, the index number, and the displacement amount.

[0139] In one embodiment of the present application, if binIdx is equal to 0, then let ctxIdxInc maintain the current value, that is, let ctxIdxInc = ctxIdxInc. If binIdx is greater than 0, and the previous bin is 1, and binIdx is less than group_idx[min(T, 32) - 1], then let ctxIdxInc = ctxIdxInc + (binIdx >> shift_x).

[0140] Figure 10 The flowchart of the steps for decoding the range variable based on the index interval in one embodiment of the present application is shown. As Figure 10 shown, based on the above embodiments, the steps of decoding the value of the range variable related to the SRCC scan region of the coding block from the bitstream in step S620 may include the following steps S1010 to step S1050.

[0141] Step S1010: Determine a plurality of consecutive index intervals composed of integers, where the index interval includes a lower limit and an upper limit.

[0142] In the embodiments of the present application, a series of intervals with integer values are first determined, denoted as R0, R1, R2, …, Rn, where the index of Rx is x, and the interval Rx can be expressed as [Rx_start, Rx_end). Table 2 shows the index interval division method in an embodiment of the present application.

[0143] Table 2 Interval Division

[0144] Interval Rx Interval range [Rx_start, Rx_end) <![CDATA[R0]]> <![CDATA[[0,R0_end)]]> <![CDATA[R1]]> <![CDATA[[R0_end,R1_end)]]> <![CDATA[R2]]> <![CDATA[[R1_end,R2_end)]]> <![CDATA[R3]]> <![CDATA[[R2_end,R3_end)]]> … … <![CDATA[R x > <![CDATA[[R x-1 _end,R x _end)]]> … … <![CDATA[R n-1 > <![CDATA[[R n-2 _end,R n-1 _end)]]> <![CDATA[R n > <![CDATA[[R n-1 _end,R n _end)]]>

[0145] For example, the values of relevant index intervals can be expressed as: R0 = [0, 5), R1 = [5, 9), R2 = [9, 17), R3 = [17, MAX_TU_SIZE), where MAX_TU_SIZE is the maximum size of the transformation unit TU specified by the codec.

[0146] Step S1020: Decode the prefix value from the bitstream of the coding block.

[0147] In an embodiment of the present application, the truncation value can be determined according to the number of intervals and the lower limit of the last index interval; then, based on the truncation value, entropy decoding and inverse binarization are performed on the bitstream of the coding block in the manner of truncated unary code (see Table 3 below) to obtain the prefix value. The truncation value can take the value of maxVal = R0_end + n - 1.

[0148] In an embodiment of the present application, the prefix value can also be obtained by decoding the bitstream of the coding block through the CABAC decoding method, where each binary bit has a corresponding context model.

[0149] Step S1030: Determine the target index interval where the value of the range variable is located according to the numerical relationship between the prefix value and the index threshold, and the index threshold is the upper limit of the first index interval.

[0150] For example, taking the upper limit R0_end of the first index interval as the index threshold, if pre is equal to R0_end + x - 1 (x = 1 to n - 1), it can be determined that the value of the range variable belongs to the interval R x =[R x-1 _end, R x _end).

[0151] Step S1040: Determine the compensation value according to the lower limit of the target index interval.

[0152] Step S1050: Determine the value of the range variable according to the compensation value.

[0153] In an embodiment of the present application, if the target index range is the first index range, the compensation value is assigned to the range variable; if the target index range is other index ranges except the first index range, the suffix value is decoded from the code stream of the coding block, and the sum of the compensation value and the suffix value is assigned to the range variable.

[0154] For example, if pre is less than or equal to R0_end - 1, the compensation value offset can be set to pre. If pre is equal to R0_end + x - 1 (x = 1 to n - 1), then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded belongs to the interval R x =[R x-1 _end, R x _end). On this basis, offset can be set equal to R x-1 _end.

[0155] In an embodiment of the present application, the method for decoding the suffix value from the code stream of the coding block may include: determining the target number of binary symbols to be decoded in the code stream of the coding block according to the upper limit and the lower limit of the target index range; performing entropy decoding on the target number of binary symbols in the code stream of the coding block; using the target number as the length of the fixed-length code, and performing inverse binarization on the entropy decoding result in the manner of a len-bit fixed-length code to obtain the suffix value.

[0156] For example, in an embodiment of the present application, the target number of binary symbols to be decoded may be denoted as len = Ceil(log2(R x _end - R x-1 _end)). After inverse binarization (see Table 1 above) in the manner of a len-bit fixed-length code and deriving the suffix value suf, the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded is offset + suf.

[0157] In an embodiment of the present application, the method for decoding the suffix value from the code stream of the coding block may include: selecting a target decoding method from multiple candidate decoding methods; decoding the suffix value from the code stream of the coding block according to the target decoding method.

[0158] In an embodiment of the present application, multiple candidate decoding methods available for selection may include: based on the truncated unary code (truncation value maxVal = R xDecoding method for _end-offset-1) (see Table 3 below); decoding method based on unary code (see Table 4 below); decoding method based on len-bit fixed-length code (see Table 1 above); decoding method based on kth-order exponential Golomb code (see Table 5 below).

[0159] Table 3 Relationship between synElVal and binary symbol strings (two forms of truncated unary code: Table 3-1 or Table 3-2)

[0160] Table 3-1

[0161]

[0162] Table 3-2

[0163]

[0164] Table 4 Relationship between synElVal and binary symbol strings (including two forms of unary code: Table 4-1 or Table 4-2)

[0165] Table 4-1

[0166]

[0167] Table 5-2

[0168]

[0169] Table 5 kth-order exponential Golomb code table

[0170]

[0171]

[0172] The following takes the index intervals R0 = [0, 5), R1 = [5, 9), R2 = [9, 17), R3 = [17, MAX_TU_SIZE) as an example for illustration, where n = 3, x = 0 to 3, and R0_end = 5. Here, MAX_TU_SIZE is the maximum size of the TU specified by the codec.

[0173] (1) First, determine a series of intervals with integer values, R0 = [0, 5), R1 = [5, 9), R2 = [9, 17), R3 = [17, MAX_TU_SIZE);

[0174] (2) Decode and inverse binarize from the bitstream in the way of truncated unary code (see Table 3, the truncation value maxVal = 5 + 3 - 1 = 7) to obtain the prefix value pre. If pre is less than or equal to 4, let offset = pre, then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded is offset.

[0175] (3) Optionally, pre is entropy decoded in the way of CABAC, and each binary bit has a corresponding context model;

[0176] (4) If pre equals 5 (x = 1), then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded belongs to the interval R1 = [5, 9). Let offset equal 5, entropy decode 2 bits from the bitstream, inverse binarize in the way of 2-bit fixed-length code (see Table 1) and deduce the suffix value suf, then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded is offset + suf.

[0177] (5) Optionally, for the above step (4), the suffix value suf can also be entropy decoded, inverse binarized and its value deduced in one of the following ways including but not limited to:

[0178] (5-1) Inverse binarize the suffix value suf in the way of k-th order exponential Golomb code (see Table 5);

[0179] (5-2) Inverse binarize the suffix value suf in the way of truncated unary code (see Table 3, the truncation value maxVal = R x _end - offset - 1 = 9 - 5 - 1 = 3);

[0180] (5-3) Inverse binarize the suffix value suf in the way of unary code (see Table 4).

[0181] (6) If pre is equal to 6 (x = 2), then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded belongs to the interval R2 = [9, 17). Let offset be equal to 9, entropy decode 3 bits from the bitstream, de-binarize in the manner of a 3-bit fixed-length code (see Table 1) and derive the suffix value suf. Then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded is offset + suf.

[0182] (7) Optionally, for the above step (6), the suffix value suf can also be entropy decoded, de-binarized and its value derived in one of the following manners including but not limited to:

[0183] (7-1) De-binarize the suffix value suf in the manner of a k-th order exponential Golomb code (see Table 5);

[0184] (7-2) De-binarize the suffix value suf in the manner of a truncated unary code (see Table 3, truncation value maxVal = R x _end - offset - 1 = 17 - 9 - 1 = 7);

[0185] (7-3) De-binarize the suffix value suf in the manner of a unary code (see Table 4).

[0186] (8) If pre is equal to 7, then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded belongs to the interval R3 = [17, MAX_TU_SIZE); Let offset be equal to 17, continue entropy decoding from the bitstream, de-binarize in the manner of a k-th order exponential Golomb code (see Table 5) and derive the suffix value suf. Then the value of width_minus1_minus_scan_region_x or height_minus1_minus_scan_region_y to be decoded is offset + suf.

[0187] (9) Optionally, for the above (8), the suffix value suf can also be entropy decoded, de-binarized and its value derived in one of the following manners including but not limited to:

[0188] (9-1) According to len = Ceil(log2(R n _end - R n-1Perform inverse binarization in the form of a fixed-length code with the number of bits of _end)) (see Table 1) and derive the suffix value suf;

[0189] (9-2) Perform inverse binarization on the suffix value suf in the form of a truncated unary code (see Table 3 above);

[0190] (9-3) Perform inverse binarization on the suffix value suf in the form of a unary code (see Table 4 above).

[0191] In an embodiment of the present application, the method for decoding the value of the range variable related to the SRCC scanning region from the code stream of the coding block may include: selecting a target decoding method from multiple candidate decoding methods; decoding the value of the range variable related to the SRCC scanning region from the code stream of the coding block according to the target decoding method. In an embodiment of the present application, the multiple candidate decoding methods available for selection may include: a decoding method based on a truncated unary code (see Table 3 above); a decoding method based on a unary code (see Table 4 above); a decoding method based on a fixed-length code with len bits (see Table 1 above); a decoding method based on a k-th order exponential Golomb code (see Table 5 above).

[0192] The above embodiments introduce the decoding scheme for the boundary coordinates of the SRCC scanning region from the perspective of the decoding side, and corresponding encoding schemes can be used on the encoding side for each of the above embodiments. Figure 11 The flowchart of the steps of a video encoding method in an embodiment of the present application is shown. This video encoding method can be executed by a device with computing and processing capabilities, such as a terminal device or a server. As Figure 11 shown, this video encoding method mainly may include the following steps S1110 to step S1130.

[0193] Step S1110: Obtain the size of the coding block of the video image frame, and the size of the coding block includes the width and height of the coding block;

[0194] Step S1120: Obtain the boundary coordinates of the coefficient coding SRCC scanning region of the coding block based on the scanning region, and the boundary coordinates include the right-end abscissa corresponding to the width and the lower-end ordinate corresponding to the height;

[0195] Step S1130: Determine the value of the range variable related to the SRCC scanning region according to the difference between the size of the coding block and the boundary coordinates, and encode the range variable, where the range variable includes the width range variable corresponding to the width and the height range variable corresponding to the height.

[0196] The relevant content details of the video encoding method in the embodiments of the present application correspond to the video decoding method in the above embodiments, and will not be elaborated here.

[0197] Based on the above embodiments, the present application proposes an encoding and decoding method for the boundary coordinates of the SRCC scan region according to the statistical characteristics of the boundary coordinates of the SRCC scan region, that is, instead of directly encoding the right-end abscissa and the lower-end ordinate of the SRCC scan region, a range variable related to the boundary coordinates and the size of the encoding block is encoded. During decoding, the value of the range variable is first decoded and derived from the bitstream, and then the boundary coordinates of the SRCC scan region can be obtained. The encoding and decoding method provided by the embodiments of the present application can reduce the number of bits required for encoding, contribute to improving the encoding and decoding efficiency of coefficient encoding, and thus further improve the video compression performance.

[0198] It should be noted that although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that these steps must be executed in this specific order, or that all the steps shown must be executed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.

[0199] The following introduces the device embodiments of the present application, which can be used to execute the video encoding and decoding method in the above embodiments of the present application. Figure 12 The structural block diagram of the video decoding device provided by the embodiments of the present application is shown. As Figure 12 shown, the video decoding device 1200 mainly may include: a size acquisition module 1210, configured to acquire the size of the encoding block of the video image frame, where the size of the encoding block includes the width and height of the encoding block; a variable decoding module 1220, configured to decode from the bitstream of the encoding block to obtain the value of the range variable related to the SRCC scan region of the encoding block, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height; a coordinate determination module 1230, configured to determine the boundary coordinates of the SRCC scan region according to the difference between the size of the encoding block and the range variable, where the boundary coordinates include the right-end abscissa corresponding to the width range variable and the lower-end ordinate corresponding to the height range variable.

[0200] In some embodiments of the present application, based on the above embodiments, the coordinate determination module is configured to: determine the boundary coordinates of the SRCC scan region according to the following formula;

[0201] SRx = width - 1 - width_minus1_minus_scan_region_x;

[0202] SRy = height - 1 - height_minus1_minus_scan_region_y;

[0203] Wherein, SRx is the abscissa of the right end, SRy is the ordinate of the lower end, width is the width, height is the height, width_minus1_minus_scan_region_x is the width range variable, and height_minus1_minus_scan_region_y is the height range variable.

[0204] In some embodiments of the present application, based on the above embodiments, the variable decoding module 1220 includes: a binary symbol decoding unit configured to sequentially decode the binary symbols corresponding to the index numbers in the bitstream of the coding block in ascending order of the index numbers to obtain the values of the binary symbols; a position variable assignment unit configured to assign a position variable with the current index number corresponding to the current binary symbol if the value of the current binary symbol is a preset first value; and a range variable assignment unit configured to assign a range variable related to the SRCC scan region of the coding block according to the value of the position variable.

[0205] In some embodiments of the present application, based on the above embodiments, the range variable assignment unit includes: a value comparison sub-unit configured to compare the value of the position variable with a preset second value; a first assignment sub-unit configured to assign the second value to the range variable if the value of the position variable is less than or equal to the second value; a value determination sub-unit configured to determine a prefix value according to the value of the position variable and determine a suffix value according to the decoding results of other binary symbols after the current binary symbol if the value of the position variable is greater than the second value; and a second assignment sub-unit configured to assign the sum of the prefix value and the suffix value to the range variable.

[0206] In some embodiments of the present application, based on the above embodiments, the value determination sub-unit is further configured to: perform a mapping process on the value of the position variable according to a first mapping vector to obtain a first mapped value corresponding to the value of the position variable; and determine a prefix value according to the first mapped value.

[0207] In some embodiments of the present application, based on the above embodiments, the value determination sub-unit is further configured to: determine the target number of other binary symbols to be decoded according to the value of the position variable; and decode the target number of other binary symbols after the current binary symbol to obtain a suffix value.

[0208] In some embodiments of the present application, based on the above embodiments, the numerical value determination subunit is further configured to: perform entropy decoding on a target number of other binary symbols after the current binary symbol in a bypass decoding manner; use the target number as the length of a fixed-length code, and perform inverse binarization on the entropy decoding result in the manner of a len-bit fixed-length code to obtain a suffix value.

[0209] In some embodiments of the present application, based on the above embodiments, the binary symbol decoding unit includes: an incremental assignment subunit configured to incrementally assign a value to the context index corresponding to the binary symbol; a model determination subunit configured to determine a context model corresponding to the binary symbol according to the increment of the context index obtained by the assignment; and a value decoding subunit configured to perform arithmetic decoding on the binary symbol based on the context model through a CABAC decoding engine to obtain the value of the binary symbol.

[0210] In some embodiments of the present application, based on the above embodiments, the incremental assignment subunit is configured to: incrementally assign a value to the context index with the index number corresponding to the binary symbol.

[0211] In some embodiments of the present application, based on the above embodiments, the incremental assignment subunit is configured to: assign an initial value to the increment of the context index according to the channel information of the coding block; determine a displacement according to the channel information of the coding block and the size of the coding block; and determine the assignment of the increment of the context index corresponding to the binary symbol according to the initial value, the index number, and the displacement.

[0212] In some embodiments of the present application, based on the above embodiments, the incremental assignment subunit is further configured to: if the coding block is a luminance block, assign an initial value of a preset third numerical value to the increment of the context index; if the coding block is a chrominance block, determine a fourth numerical value related to the size of the coding block, and assign an initial value of the increment of the context index after increasing the third numerical value by the fourth numerical value.

[0213] In some embodiments of the present application, based on the above embodiments, the incremental assignment subunit is further configured to: perform mapping processing on the size of the coding block according to a second mapping vector to obtain a second mapping value corresponding to the size of the coding block; and use the second mapping value as the fourth numerical value related to the size of the coding block.

[0214] In some embodiments of the present application, based on the above embodiments, the incremental assignment subunit is further configured to: if the coding block is a luminance block, determine the displacement amount according to the formula shift_x = clip3(0, 2, (logV + 1) >> 2), where shift_x is the displacement amount and V is the size of the coding block; if the coding block is a chrominance block, determine the displacement amount according to the formula shift_x = clip3(0, 2, (T >> 3)), where shift_x is the displacement amount and T is the size of the coding block.

[0215] In some embodiments of the present application, based on the above embodiments, the variable decoding module 1120 includes: an index range determination unit configured to determine a plurality of consecutive index ranges composed of integers, the index range including a lower limit and an upper limit of the range; a prefix value decoding unit configured to decode a prefix value in the code stream of the coding block; a target range determination unit configured to determine the target index range where the value of the range variable is located according to the numerical relationship between the prefix value and an index threshold, the index threshold being the upper limit of the first index range; a compensation value determination unit configured to determine a compensation value according to the lower limit of the target index range; and a range variable determination unit configured to determine the value of the range variable according to the compensation value.

[0216] In some embodiments of the present application, based on the above embodiments, the prefix value decoding unit includes: a truncation value determination subunit configured to determine a truncation value according to the number of ranges and the lower limit of the last index range; and a prefix value decoding subunit configured to perform entropy decoding and inverse binarization in the code stream of the coding block in the manner of truncated unary code based on the truncation value to obtain a prefix value.

[0217] In some embodiments of the present application, based on the above embodiments, the prefix value decoding unit is configured to: decode the code stream of the coding block through CABAC decoding to obtain a prefix value.

[0218] In some embodiments of the present application, based on the above embodiments, the range variable determination unit includes: a first variable assignment subunit configured to assign the compensation value as the range variable if the target index range is the first index range; and a second variable assignment subunit configured to, if the target index range is other index ranges except the first index range, decode a suffix value in the code stream of the coding block and assign the sum of the compensation value and the suffix value as the range variable.

[0219] In some embodiments of the present application, based on the above embodiments, the second variable assignment subunit is further configured to: determine the target number of binary symbols to be decoded in the bitstream of the coding block according to the upper limit and the lower limit of the target index range; perform entropy decoding on the target number of binary symbols in the bitstream of the coding block; use the target number as the length of the fixed-length code, and perform inverse binarization on the entropy decoding result in the manner of a len-bit fixed-length code to obtain a suffix value.

[0220] In some embodiments of the present application, based on the above embodiments, the second variable assignment subunit is further configured to: select a target decoding method from multiple candidate decoding methods; decode to obtain a suffix value in the bitstream of the coding block according to the target decoding method.

[0221] In some embodiments of the present application, based on the above embodiments, the variable decoding module 1220 includes: a decoding method selection unit configured to select a target decoding method from multiple candidate decoding methods; a target method decoding unit configured to decode to obtain the value of the range variable related to the SRCC scanning area in the bitstream of the coding block according to the target decoding method.

[0222] In some embodiments of the present application, based on the above embodiments, the multiple candidate decoding methods include at least one of the following decoding methods: a decoding method based on a truncated unary code; a decoding method based on a unary code; a decoding method based on a len-bit fixed-length code; a decoding method based on a k-th order exponential Golomb code.

[0223] In some embodiments of the present application, based on the above embodiments, the video decoding device 1200 is applied to a coding block that satisfies any one of the following conditions: a coding block in a transform skip mode; a coding block with an image-level intra prediction transform skip enable flag value of 1; a coding block with an image-level inter prediction transform skip enable flag value of 1; a coding block with both an image-level intra prediction transform skip enable flag value and an image-level inter prediction transform skip enable flag value of 1; all coding blocks.

[0224] Figure 13 The structural block diagram of a video encoding device in an embodiment of the present application is shown. As Figure 13As shown, the video encoding device 1300 mainly may include: a size acquisition module 1310 configured to acquire the size of an encoding block of a video image frame, where the size of the encoding block includes the width and height of the encoding block; a coordinate acquisition module 1320 configured to acquire the boundary coordinates of a coefficient encoding SRCC scan region of the encoding block based on a scan region, where the boundary coordinates include the right - hand abscissa corresponding to the width and the lower - end ordinate corresponding to the height; and a variable encoding module 1330 configured to determine the value of a range variable related to the SRCC scan region according to the difference between the size of the encoding block and the boundary coordinates, and encode the range variable, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height.

[0225] The specific details of the video decoding device provided in each embodiment of this application have been described in detail in the corresponding method embodiment, and will not be elaborated here.

[0226] Figure 14 Schematically shows a computer system block diagram of an electronic device for implementing the embodiments of this application.

[0227] It should be noted that Figure 14 The computer system 1400 of the electronic device shown is only an example, and should not impose any limitation on the functions and usage scope of the embodiments of this application.

[0228] As Figure 14 shown, the computer system 1400 includes a central processing unit 1401 (Central Processing Unit, CPU), which can perform various appropriate actions and processes according to a program stored in a read - only memory 1402 (Read - Only Memory, ROM) or a program loaded from a storage section 1408 into a random access memory 1403 (Random Access Memory, RAM). In the random access memory 1403, various programs and data required for system operation are also stored. The central processing unit 1401, the read - only memory 1402, and the random access memory 1403 are connected to each other through a bus 1404. An input / output interface 1405 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1404.

[0229] The following components are connected to the input / output interface 1405: an input section 1406 including a keyboard, a mouse, etc.; an output section 1407 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc. as well as a speaker, etc.; a storage section 1408 including a hard disk, etc.; and a communication section 1409 including a network interface card such as a local area network card, a modem, etc. The communication section 1409 performs communication processing via a network such as the Internet. A drive 1410 is also connected to the input / output interface 1405 as required. A removable medium 1411, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1410 as required so that a computer program read from it can be installed into the storage section 1408 as required.

[0230] Specifically, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as computer software programs. 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 contains program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 1409, and / or installed from the removable medium 1411. When the computer program is executed by the central processing unit 1401, various functions defined in the system of the present application are executed.

[0231] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having 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 disc 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 that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. 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, which carries computer-readable program code. Such a propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on a 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.

[0232] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or by a combination of dedicated hardware and computer instructions.

[0233] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0234] From the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (such as a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0235] After considering the specification and practicing the invention disclosed herein, those skilled in the art will readily conceive of other embodiments of the present application. 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 well-known knowledge or conventional technical means in the technical field not disclosed in the present application.

[0236] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A video decoding method, characterized in that, Including: Obtaining the size of an encoded block of a video image frame, where the size of the encoded block includes the width and height of the encoded block; Decoding from the bitstream of the encoded block to obtain the value of a range variable related to the coefficient coding SRCC (Scan Region of Coefficients) scan region of the encoded block, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height; Determining the boundary coordinates of the SRCC scan region according to the difference between the size of the encoded block and the range variable, where the boundary coordinates include the right-end horizontal coordinate corresponding to the width range variable and the lower-end vertical coordinate corresponding to the height range variable; Wherein, decoding from the bitstream of the encoded block to obtain the value of a range variable related to the SRCC scan region includes: In the bitstream of the encoded block, decoding the binary symbols corresponding to the indexes in ascending order of the index number to obtain the values of the binary symbols; if the value of the current binary symbol is a preset first value, assigning the current index number corresponding to the current binary symbol as the position variable; assigning values to the range variables related to the SRCC scan region of the encoded block according to the value of the position variable; Or, determining a plurality of consecutive index intervals composed of integers, where the index interval includes a lower limit and an upper limit; decoding a prefix value in the bitstream of the encoded block; determining the target index interval where the value of the range variable is located according to the numerical relationship between the prefix value and the index threshold, where the index threshold is the upper limit of the first index interval; determining a compensation value according to the lower limit of the target index interval; determining the value of the range variable according to the compensation value.

2. The video decoding method according to claim 1, wherein Determining the boundary coordinates of the SRCC scan region according to the difference between the size of the encoded block and the range variable includes: Determining the boundary coordinates of the SRCC scan region according to the following formula; SRx = width - 1 - width_minus1_minus_scan_region_x; SRy = height - 1 - height_minus1_minus_scan_region_y; Wherein, SRx is the right-end horizontal coordinate, SRy is the lower-end vertical coordinate, width is the width, height is the height, width_minus1_minus_scan_region_x is the width range variable, and height_minus1_minus_scan_region_y is the height range variable.

3. The video decoding method according to claim 1, wherein Assigning values to the range variables related to the SRCC scan region of the encoded block according to the value of the position variable includes: Comparing the value of the position variable with a preset second value; If the value of the position variable is less than or equal to the second value, assigning the second value as the value of the range variable; If the value of the position variable is greater than the second value, determine a prefix value according to the value of the position variable, and determine a suffix value according to the decoding results of other binary symbols after the current binary symbol; Assign the sum of the prefix value and the suffix value to the range variable.

4. The video decoding method according to claim 3, wherein Determining a prefix value according to the value of the position variable includes: Performing a mapping process on the value of the position variable according to a first mapping vector to obtain a first mapping value corresponding to the value of the position variable; Determine a prefix value according to the first mapping value.

5. The video decoding method according to claim 3, wherein Determining a suffix value according to the decoding results of other binary symbols after the current binary symbol includes: Determine the target number of other binary symbols to be decoded according to the value of the position variable; Decode the target number of other binary symbols after the current binary symbol to obtain a suffix value.

6. The video decoding method according to claim 5, wherein Decoding the target number of other binary symbols after the current binary symbol to obtain a suffix value includes: Performing entropy decoding on the target number of other binary symbols after the current binary symbol in a bypass decoding manner; Using the target number as the length of a fixed-length code, and performing inverse binarization on the entropy decoding result in the manner of a len-bit fixed-length code to obtain a suffix value.

7. The video decoding method according to claim 1, wherein Decoding the binary symbols corresponding to the indexes in ascending order of the index numbers to obtain the values of the binary symbols, including: Assign a context index increment corresponding to the binary symbol; Determine a context model corresponding to the binary symbol according to the assigned context index increment; Based on the context model, perform arithmetic decoding on the binary symbol through a CABAC decoding engine to obtain the value of the binary symbol.

8. The video decoding method according to claim 7, wherein Assigning a context index increment corresponding to the binary symbol includes: Assign the index number corresponding to the binary symbol as the context index increment.

9. The video decoding method according to claim 7, wherein Assigning a context index increment corresponding to the binary symbol includes: Assign an initial value to the context index increment according to the channel information of the coding block; Determine a displacement amount according to the channel information of the coding block and the size of the coding block; Determine the assignment of the context index increment corresponding to the binary symbol according to the initial value, the index number, and the displacement amount.

10. The video decoding method according to claim 9, wherein The assigning an initial value to the context index increment according to the channel information of the coding block includes: If the coding block is a luminance block, assign a preset third value as the initial value of the context index increment; If the coding block is a chrominance block, determine a fourth value related to the size of the coding block, and assign the initial value of the context index increment after increasing the fourth value on the basis of the third value.

11. The video decoding method according to claim 10, wherein Determining a fourth value related to the size of the coding block includes: Performing a mapping process on the size of the coding block according to a second mapping vector to obtain a second mapping value corresponding to the size of the coding block; Use the second mapping value as the fourth value related to the size of the coding block.

12. The video decoding method according to claim 9, wherein The determining a displacement amount according to the channel information of the coding block and the size of the coding block includes: If the coding block is a luminance block, determine the displacement amount according to the formula shift_x = clip3(0, 2, (logV + 1) >> 2), where shift_x is the displacement amount and V is the size of the coding block; If the coding block is a chrominance block, determine the displacement amount according to the formula shift_x = clip3(0, 2, (T >> 3)), where shift_x is the displacement amount and T is the size of the coding block.

13. The video decoding method according to claim 1, wherein Decoding to obtain a prefix value in the bitstream of the coding block includes: Determine a truncation value according to the number of intervals and the lower limit of the last index interval; Based on the truncation value, perform entropy decoding and inverse binary transformation in the bitstream of the coding block in the manner of truncated unary code to obtain a prefix value.

14. The video decoding method according to claim 1, wherein Decoding to obtain a prefix value in the bitstream of the coding block includes: Decode the bitstream of the coding block through CABAC decoding to obtain a prefix value.

15. The video decoding method according to claim 1, characterized in that, Determine the value of the range variable according to the compensation value, including: If the target index interval is the first index interval, assign the compensation value to the range variable; If the target index interval is other index intervals except the first index interval, decode to obtain a suffix value in the bitstream of the coding block, and assign the sum of the compensation value and the suffix value to the range variable.

16. The video decoding method according to claim 15, wherein Decoding to obtain a suffix value in the bitstream of the coding block includes: Determine the target number of binary symbols to be decoded in the bitstream of the coding block according to the upper limit and lower limit of the target index interval; Perform entropy decoding on the target number of binary symbols in the bitstream of the coding block; Use the target number as the length of the fixed-length code, and perform inverse binary transformation on the entropy decoding result in the manner of len-bit fixed-length code to obtain a suffix value.

17. The video decoding method according to claim 15, wherein Decoding to obtain a suffix value in the bitstream of the coding block includes: Select a target decoding method from multiple candidate decoding methods; Decode to obtain a suffix value in the bitstream of the coding block according to the target decoding method.

18. The video decoding method according to claim 1, wherein Decoding to obtain the value of the range variable related to the SRCC scanning area from the bitstream of the coding block includes: Select a target decoding method from multiple candidate decoding methods; Decode to obtain the value of the range variable related to the SRCC scanning area in the bitstream of the coding block according to the target decoding method.

19. The video decoding method according to claim 17 or 18, characterized in that, The multiple candidate decoding methods include at least one of the following decoding methods: Decoding method based on truncated unary code; Decoding method based on unary code; Decoding method based on len-bit fixed-length code; Decoding method based on k-order exponential Golomb code.

20. The video decoding method according to any one of claims 1 to 18, characterized in that, The method is applied to a coding block that satisfies any one of the following conditions: Coding block in transform skip mode; Coding block with the value of the picture-level intra prediction transform skip enable flag being 1; Coding block with the value of the picture-level inter prediction transform skip enable flag being 1; Coding block with both the value of the picture-level intra prediction transform skip enable flag and the value of the picture-level inter prediction transform skip enable flag being 1; All coding blocks.

21. A video encoding method, characterized in that, Including: Obtain the size of the coding block of the video image frame, and the size of the coding block includes the width and height of the coding block; Obtain the boundary coordinates of the coefficient coding SRCC scanning region based on the scanning region of the coding block, where the boundary coordinates include the right-end abscissa corresponding to the width and the lower-end ordinate corresponding to the height; Determine the value of the range variable related to the SRCC scanning region according to the difference between the size of the coding block and the boundary coordinates, and encode the range variable, where the range variable includes the width range variable corresponding to the width and the height range variable corresponding to the height; Among them, when decoding the bitstream of the coding block, decoding the value of the range variable related to the SRCC scanning region from the bitstream of the coding block includes: In the bitstream of the coding block, decode the value of the binary symbol corresponding to the index number in ascending order of the index number; if the value of the current binary symbol is a preset first value, assign the current index number corresponding to the current binary symbol as the position variable; assign the range variable related to the SRCC scanning region of the coding block according to the value of the position variable; Alternatively, determine multiple consecutive index intervals composed of integers, where the index interval includes the interval lower limit and the interval upper limit; decode the prefix value in the bitstream of the coding block; determine the target index interval where the value of the range variable is located according to the numerical relationship between the prefix value and the index threshold, where the index threshold is the interval upper limit of the first index interval; determine the compensation value according to the interval lower limit of the target index interval; determine the value of the range variable according to the compensation value.

22. A video decoding device, characterized in that, Include: A size acquisition module configured to acquire the size of the coding block of the video image frame, where the size of the coding block includes the width and height of the coding block; A variable decoding module configured to decode the value of the range variable related to the coefficient coding SRCC scanning region based on the scanning region of the coding block from the bitstream of the coding block, where the range variable includes the width range variable corresponding to the width and the height range variable corresponding to the height; A coordinate determination module configured to determine the boundary coordinates of the SRCC scanning region according to the difference between the size of the coding block and the range variable, where the boundary coordinates include the right-end abscissa corresponding to the width range variable and the lower-end ordinate corresponding to the height range variable; Among them, decoding the value of the range variable related to the SRCC scanning region from the bitstream of the coding block includes: In the bitstream of the coding block, decode the value of the binary symbol corresponding to the index number in ascending order of the index number; if the value of the current binary symbol is a preset first value, assign the current index number corresponding to the current binary symbol as the position variable; assign the range variable related to the SRCC scanning region of the coding block according to the value of the position variable; Alternatively, determine multiple consecutive index intervals composed of integers, where the index interval includes a lower bound and an upper bound; decode a prefix value from the bitstream of the coding block; determine the target index interval where the value of the range variable lies according to the numerical relationship between the prefix value and the index threshold, where the index threshold is the upper bound of the first index interval; determine a compensation value according to the lower bound of the target index interval; and determine the value of the range variable according to the compensation value.

23. A video encoding device, characterized in that, Comprising: a size acquisition module configured to acquire the size of a coding block of a video image frame, where the size of the coding block includes the width and height of the coding block; a coordinate acquisition module configured to acquire the boundary coordinates of the coefficient coding SRCC scan region of the coding block based on a scan region, where the boundary coordinates include the right-end abscissa corresponding to the width and the lower-end ordinate corresponding to the height; a variable coding module configured to determine the value of a range variable related to the SRCC scan region according to the difference between the size of the coding block and the boundary coordinates, and encode the range variable, where the range variable includes a width range variable corresponding to the width and a height range variable corresponding to the height; wherein, when decoding the bitstream of the coding block, decoding the value of the range variable related to the SRCC scan region from the bitstream of the coding block includes: in the bitstream of the coding block, decoding the values of the binary symbols corresponding to the indexes in ascending order of the index numbers to obtain the values of the binary symbols; if the value of the current binary symbol is a preset first value, assign the current index number corresponding to the current binary symbol as the position variable; and assign the range variable related to the SRCC scan region of the coding block according to the value of the position variable; Alternatively, determine multiple consecutive index intervals composed of integers, where the index interval includes a lower bound and an upper bound; decode a prefix value from the bitstream of the coding block; determine the target index interval where the value of the range variable lies according to the numerical relationship between the prefix value and the index threshold, where the index threshold is the upper bound of the first index interval; determine a compensation value according to the lower bound of the target index interval; and determine the value of the range variable according to the compensation value.

24. A computer-readable medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the method according to any one of claims 1 to 21.

25. An electronic device, characterized in that, Comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the method according to any one of claims 1 to 21 by executing the executable instructions.

26. A computer program product comprising computer instructions, characterized in that, The computer instructions, when executed by the processor, implement the method according to any one of claims 1 to 21.

Citation Information

Patent Citations

  • Device and method for entropy encoding and decoding

    CN108293139A

  • Encoding method and apparatus therefor, and decoding method and apparatus therefor

    WO2019045538A1