WO2022174638A1 - 视频编解码方法、装置、计算机可读介质及电子设备 - Google Patents

视频编解码方法、装置、计算机可读介质及电子设备 Download PDF

Info

Publication number
WO2022174638A1
WO2022174638A1 PCT/CN2021/131617 CN2021131617W WO2022174638A1 WO 2022174638 A1 WO2022174638 A1 WO 2022174638A1 CN 2021131617 W CN2021131617 W CN 2021131617W WO 2022174638 A1 WO2022174638 A1 WO 2022174638A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
coding block
decoding
range variable
height
Prior art date
Application number
PCT/CN2021/131617
Other languages
English (en)
French (fr)
Inventor
胡晔
王力强
Original Assignee
腾讯科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Publication of WO2022174638A1 publication Critical patent/WO2022174638A1/zh
Priority to US17/978,092 priority Critical patent/US20230061939A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/167Position within a video image, e.g. region of interest [ROI]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/172Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a picture, frame or field
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/184Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being bits, e.g. of the compressed video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/1887Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a variable length codeword
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present application belongs to the field of computer technology, and in particular relates to a video encoding and decoding method, a video encoding and decoding apparatus, a computer-readable medium, and an electronic device.
  • the encoder In the video encoding process, the encoder usually needs to transform, quantize, and entropy the residual data between the original video data and the predicted video data before sending it to the decoder. 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 sparse, which will cause the range of the scanning area to occupy more bits during encoding, thus leading to the problem of reduced encoding efficiency. Affects video compression performance.
  • the purpose of this application is to provide a video encoding and decoding method, a video encoding and decoding apparatus, a computer-readable medium, and an electronic device, at least to a certain extent, to overcome the technical problem of low video encoding and decoding efficiency in the related art.
  • a video decoding method executed by an electronic device, the method includes: acquiring a 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 obtain the value of a range variable related to the scan area-based coefficient coding SRCC scan area of the code block by decoding from the code stream of the code block, the range variable including a width range variable corresponding to the width and A height range variable corresponding to the height; the boundary coordinates of the SRCC scanning area are determined according to the difference between the size of the coding block and the range variable, and the boundary coordinates include the right end horizontal corresponding to the width range variable. coordinates and the lower ordinate corresponding to the height range variable.
  • a video decoding apparatus comprising: a size obtaining module configured to obtain a size of a coding block of a video image frame, where the size of the coding block includes the width of the coding block and height; the variable decoding module is configured to decode from the code stream of the coding block to obtain the value of the range variable related to the SRCC scanning area of the coding block, the range variable includes a width corresponding to the width a range variable and a height range variable corresponding to the height; a coordinate determination module configured to determine boundary coordinates of the SRCC scan area according to the difference between the size of the encoding block and the range variable, the boundary coordinates including The right end abscissa corresponding to the width range variable and the lower end ordinate corresponding to the height range variable.
  • a video encoding method executed by an electronic device, the method includes: acquiring a 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 the scanning area-based coefficient coding SRCC scanning area of the coding block, the boundary coordinates including the right abscissa corresponding to the width and the lower ordinate corresponding to the height; according to the coding block
  • the difference between the size of the SRCC and the boundary coordinates determines the value of a range variable related to the SRCC scanning area, and encodes the range variable, the range variable includes a width range variable corresponding to the width and a corresponding range variable. Height range variable at the height.
  • a video encoding apparatus comprising: a size obtaining module configured to obtain a size of a coding block of a video image frame, where the size of the coding block includes a width of the coding block and height; a coordinate acquisition module configured to acquire boundary coordinates of the scanning area-based coefficient-encoded SRCC scan area of the coding block, the boundary coordinates including a right-hand abscissa corresponding to the width and a coordinate corresponding to the height a lower ordinate; a variable encoding module configured to determine the value of a range variable related to the SRCC scanning area according to the difference between the size of the coding block and the boundary coordinates, and to encode the range variable,
  • the range variables include a width range variable corresponding to the width and a height range variable corresponding to the height.
  • a computer-readable medium on which a computer program is stored, and when the computer program is executed by a processor, implements the video decoding method in the above technical solution.
  • an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the The executable instructions are described to perform the video decoding method as in the above technical solution.
  • a computer program product or computer program where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
  • the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the video decoding method as in the above technical solutions.
  • FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.
  • FIG. 2 shows a schematic diagram of the arrangement of the video encoding device and the video decoding device in the streaming transmission system.
  • Figure 3 shows a basic flow diagram of a video encoder.
  • Figure 4 shows the scan area marked by the SRCC technique.
  • FIG. 5 shows a schematic diagram of the sequence of scanning the marked scanning area.
  • FIG. 6 shows a flowchart of steps of a video decoding method in an embodiment of the present application.
  • FIG. 7 shows a flowchart of steps for decoding range variables based on binary symbols based on the code stream distribution position in an embodiment of the present application.
  • FIG. 8 shows a flowchart of steps for decoding a binary symbol in an embodiment of the present application.
  • FIG. 9 shows a flowchart of steps for incrementally assigning a context index corresponding to a binary symbol in an embodiment of the present application.
  • FIG. 10 shows a flow chart of steps for decoding a range variable based on an index interval in an embodiment of the present application.
  • FIG. 11 shows a flowchart of steps of a video encoding method in an embodiment of the present application.
  • FIG. 12 shows a structural block diagram of a video decoding apparatus provided by an embodiment of the present application.
  • FIG. 13 shows a structural block diagram of a video encoding apparatus provided by an embodiment of the present application.
  • FIG. 14 schematically shows a structural block diagram of a computer system suitable for implementing the electronic device of the embodiment of the present application.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments can be embodied 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 thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
  • FIG. 1 shows a schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of the present application can be applied.
  • the system architecture 100 includes a plurality of end devices that can communicate with each other through, for example, a network 150 .
  • the system architecture 100 may include a first end device 110 and a second end device 120 interconnected by a network 150 .
  • the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
  • the first terminal device 110 may encode video data (eg, a video picture stream captured by the terminal device 110 ) for transmission to the second terminal device 120 through the network 150, and the encoded video data may be encoded in one or more
  • the second terminal device 120 may receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display video pictures according to the restored video data.
  • the system architecture 100 may include a third end device 130 and a fourth end device 140 that perform bidirectional transmission of encoded video data, such as may occur during a video conference.
  • each of the third end device 130 and the fourth end device 140 may encode video data (eg, a stream of video pictures captured by the end device) for transmission to the third end device over the network 150 130 and the other terminal device of the fourth terminal device 140 .
  • Each of the third terminal device 130 and the fourth terminal device 140 may also receive encoded video data transmitted by the other one of the third terminal device 130 and the fourth terminal device 140, and may The video data is decoded to recover the video data, and a video picture can be displayed on an accessible display device based on the recovered video data.
  • 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 this application may not be limited thereto .
  • Embodiments disclosed herein are applicable to laptop computers, tablet computers, media players, and/or dedicated videoconferencing equipment.
  • Network 150 represents any number of networks, including, for example, wired and/or wireless communication networks, that communicate encoded video data between first end device 110, second end device 120, third end device 130, and fourth end device 140.
  • 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.
  • the architecture and topology of network 150 may be immaterial to the operations disclosed herein.
  • FIG. 2 illustrates the placement of a video encoding device and a video decoding device in a streaming environment.
  • the subject matter disclosed herein is equally applicable to other video-enabled applications including, for example, videoconferencing, digital television (TV), storing compressed video on digital media including CDs, DVDs, memory sticks, and the like.
  • the streaming system may include a capture subsystem 213 , which may include a video source 201 such as a digital camera, and the video source creates an uncompressed video picture stream 202 .
  • the video picture stream 202 includes samples captured by a digital camera.
  • the video picture stream 202 is depicted as a thick line to emphasize the high data volume of the video picture stream, which can be processed by the electronic device 220, and the electronic Device 220 includes video encoding device 203 coupled to video source 201 .
  • Video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or implement various aspects of the disclosed subject matter as described in greater detail below.
  • the encoded video data 204 (or encoded video code stream 204) is depicted as a thin line to emphasize the lower amount of encoded video data 204 (or encoded video code stream 204) 204), which can be stored on the streaming server 205 for future use.
  • One or more streaming client subsystems such as client subsystem 206 and client subsystem 208 in FIG. 2 , may access streaming server 205 to retrieve copies 207 and 209 of encoded video data 204 .
  • Client subsystem 206 may include, for example, video decoding device 210 in electronic device 230 .
  • the video decoding device 210 decodes the incoming copy 207 of the encoded video data and produces an output video picture stream 211 that can be presented on a display 212 (eg, a display screen) or another presentation device.
  • encoded video data 204, video data 207, and video data 209 may be encoded according to certain video encoding/compression standards. Examples of these standards include ITU-T H.265.
  • video coding standard under development is informally referred to as Versatile Video Coding (VVC), and this application may be used in the context of the VVC standard.
  • electronic device 220 and the electronic device 230 may include other components not shown in the figures.
  • electronic device 220 may include a video decoding device
  • electronic device 230 may also include a video encoding device.
  • HEVC High Efficiency Video Coding
  • VVC Versatile Video Coding
  • AVS China National Video Coding Standard AVS
  • HEVC High Efficiency Video Coding
  • VVC Versatile Video Coding
  • AVS China National Video Coding Standard AVS
  • HEVC High Efficiency Video Coding
  • VVC Versatile Video Coding
  • AVS China National Video Coding Standard AVS
  • HEVC High Efficiency Video Coding
  • VVC Versatile Video Coding
  • AVS China National Video Coding Standard AVS
  • Predictive Coding includes 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 encoder needs to decide which predictive coding mode to select for the current CU and inform the decoder. Among them, intra-frame prediction means that the predicted signal comes from an area that has been coded and reconstructed in the same image; inter-frame prediction means that the predicted signal comes from another image (called a reference image) that has been coded and different from the current image. .
  • Transform & Quantization After the residual video signal undergoes discrete Fourier transform (Discrete Fourier Transform, DFT), discrete cosine transform (Discrete Cosine Transform, DCT) and other transformation operations, the signal is converted into the transform domain, called is the transformation coefficient.
  • the transform coefficient is further subjected to a lossy quantization operation, which loses a certain amount of information, so that the quantized signal is beneficial to the compressed expression.
  • a lossy quantization operation which loses a certain amount of information, so that the quantized signal is beneficial to the compressed expression.
  • the fineness of quantization is usually determined by the Quantization Parameter (QP for short).
  • the coefficients representing a larger value range will be quantized into the same output, which usually brings greater distortion and distortion. A lower code rate; on the contrary, if the QP value is smaller, the coefficients representing a smaller value range will be quantized into the same output, so it usually brings less distortion and corresponds to a higher code rate.
  • Entropy Coding or Statistical Coding The quantized transform domain signal will undergo statistical compression coding according to the frequency of occurrence of each value, and finally output a binarized (0 or 1) compressed code stream. At the same time, other information generated by encoding, such as the selected encoding 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 code rate required to express the same signal. Common statistical coding methods include variable length coding (Variable Length Coding, VLC for short) or context-based adaptive binary arithmetic coding ( Content Adaptive Binary Arithmetic Coding, referred to as CABAC).
  • the context-based adaptive binary arithmetic coding (CABAC) process mainly includes three steps: binarization, context modeling and binary arithmetic coding.
  • the binary data can be encoded by the normal encoding mode and the bypass encoding mode (bypass).
  • Bypass Coding Mode it does not need to assign a specific probability model to each binary bit, and the input binary bit bin value is directly encoded with a simple bypass encoder to speed up the entire encoding and decoding process. speed.
  • different syntax elements are not completely independent, and the same syntax element itself also has a certain memory.
  • This encoded symbol information used as a condition is called a context.
  • the binaries of syntax elements enter the context modeler sequentially.
  • the encoder assigns an appropriate probability model to each input binary bit based on the value of the previously encoded syntax element or binary bit, a process known as context modeling.
  • the context model corresponding to the syntax element can be located by the context index increment (context index increment, ctxIdxInc) and the context start index (context index Start, ctxIdxStart).
  • the context model needs to be updated according to the bin value, that is, the adaptive process in encoding.
  • Loop Filtering The changed and quantized signal will obtain a reconstructed image through the operations of inverse quantization, inverse transformation and prediction compensation. Compared with the original image, the reconstructed image is different from the original image due to the influence of quantization, that is, the reconstructed image will produce distortion (Distortion). Therefore, filtering operations can be performed on the reconstructed image, such as deblocking filter (DB), adaptive pixel compensation (Sample Adaptive Offset, SAO) or adaptive loop filter (Adaptive Loop Filter, ALF) and other filters , which can effectively reduce the degree of distortion caused by quantization. Since these filtered reconstructed images will be used as references for subsequent encoded images to predict future image signals, the above filtering operation is also called in-loop filtering, ie, a filtering operation in an encoding loop.
  • DB deblocking filter
  • SAO Sample Adaptive Offset
  • ALF adaptive Loop Filter
  • FIG. 3 shows a basic flowchart of a video encoder, and intra-frame prediction is used as an example for description in the flowchart.
  • the quantized coefficients are encoded by entropy coding to obtain the encoded bits
  • the reconstructed residual signal u' k [x, y] is obtained through inverse quantization and inverse transformation processing, and the predicted image signal It is superimposed with the reconstructed residual signal u' k [x, y] to generate an image signal image signal
  • it is input to the intra - frame mode decision module and the intra-frame prediction module for intra-frame prediction processing; ] can be used as a reference image for the next frame for motion estimation and motion compensation prediction.
  • the decoding end Based on the above encoding process, for each CU, the decoding end performs entropy decoding to obtain various mode information and quantization coefficients after obtaining the compressed code stream (ie, the bit stream). Then, the quantized coefficients undergo inverse quantization and inverse transformation to obtain residual signals.
  • the predicted signal corresponding to the CU can be obtained, and then the reconstructed signal can be obtained by adding the residual signal and the predicted signal. The reconstructed signal is then subjected to loop filtering and other operations to generate the final output signal.
  • the transform processing of the residual signal makes the energy of the residual signal concentrate on less low-frequency coefficients, that is, most coefficients have smaller values. Then after the subsequent quantization module, the smaller coefficient value will become zero value, which greatly reduces the cost of coding the residual signal.
  • transformation kernels such as DST7 and DCT8 are introduced into the transformation process, and the horizontal transformation and vertical transformation of the residual signal are carried out. Direct transforms can use different transform kernels.
  • the possible combinations of transforms that can be selected for transform processing of a residual signal are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7) ), (DST7, DCT8) and (DST7, DST7).
  • rate-distortion optimization RDO
  • the residual signal can be directly quantized without going through the transformation process, that is, the transformation is skipped. Identifying whether the current residual block belongs to the transform skip mode can be done in two ways: explicit coding and implicit derivation.
  • the scanning region-based Coefficient coding Scan Region based Coefficient Coding, SRCC
  • SRx is the abscissa of the rightmost non-zero coefficient in the quantized coefficient block
  • SRy is the ordinate of the lowermost non-zero coefficient in the quantized coefficient block
  • the starting point coordinate of the upper left corner is (0,0)
  • 1 ⁇ SRx+1 ⁇ W, 1 ⁇ SRy+1 ⁇ H is all 0.
  • the SRCC technology uses (SRx, SRy) to determine the quantized coefficient area that needs to be scanned in a quantized coefficient block. As shown in Figure 4, only the quantized coefficients in the scanning area marked by (SRx, SRy) need to be coded.
  • the scanning order of the coding is as follows As shown in Figure 5, it can be a reverse zigzag scan from the lower right corner to the upper left corner.
  • the coefficients to be coded in the SRCC area are coded using a hierarchical method. Specifically, first, the SRCC scan area coordinates are encoded. Then, within the SRCC region, based on the scanning order, a flag (significant flag) that identifies whether the coefficient at the current position is 0 is encoded one by one. At the same time, record the position of non-zero coefficients and count the number of non-zero coefficients. If the number of non-zero coefficients is greater than 0, it is necessary to encode the absolute value and sign of the non-zero coefficient at the corresponding position.
  • the video codec uses Scan Region based Coefficient Coding (SRCC). Before coding all the coefficients in the SRCC region, the right abscissa scan_region_x (value of SRx) and the lower ordinate scan_region_y (value of SRy) of the SRCC scanning region should be coded first.
  • SRCC Scan Region based Coefficient Coding
  • the boundary of the SRCC region mainly depends on the position of the rightmost and bottommost non-zero coefficients in the current block.
  • the transformed energy is mainly concentrated in the limited low-frequency coefficient positions, so the area of the SRCC region, as well as SRx and SRy tend to be smaller.
  • the area of the SRCC region of the coding block of the transform skip mode, and SRx and SRy tend to be relatively larger values. Therefore, if SRx and SRy are also directly encoded in the transform skip mode, more bits may be required to encode the SRx and SRy in the transform skip mode, resulting in a decrease in encoding efficiency.
  • the present application proposes a method for encoding and decoding the coordinates of the SRCC scanning region, that is, the value SRx of the abscissa scan_region_x at the right end of the SRCC scanning region and the value SRy of the lower ordinate scan_region_y are not directly Instead, encode 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).
  • the coding method for the coordinates of the SRCC scan area proposed in this application is not limited to be applied to the coding of the coordinates of the SRCC scan area in the transform skip mode. It can be used in the SRCC scan area coordinate encoding in coefficient encoding in other coding modes, for example, in the SRCC scan area coordinate encoding of all blocks, for example, at the picture level intra-prediction transform skip allow flag value 1 Used when the image-level inter-prediction transform skip allow flag value is 1; for example, when the picture-level intra-prediction transform skip allow flag value and the picture-level inter-prediction transform skip allow flag value It is used when both are 1, and so on.
  • width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded in transform skip mode, and the original encoding mode is maintained in other modes, namely, SRx and SRy are directly encoded.
  • the SRCC scan region coordinate encoding method of all blocks adopts the method of encoding width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y.
  • another combination method is to maintain the original encoding method in the transform skip mode, that is, directly encode SRx and SRy, and encode width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y in other modes.
  • the width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded when the picture-level intra prediction transform skip allow flag value is 1, and the original encoding mode is maintained under other conditions, that is, SRx and SRy are directly encoded.
  • the width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded when the picture-level inter-frame prediction transform skip allow flag value is 1, and the original encoding mode is maintained under other conditions, that is, SRx and SRy are directly encoded.
  • the width_minus1_minus_scan_region_x and height_minus1_minus_scan_region_y are encoded when the picture-level intra-prediction transform skip allow flag value and the picture-level inter-prediction transform skip allow flag value are both 1, and the original encoding mode is maintained under other conditions , that is, directly encode SRx and SRy.
  • This embodiment of the present application can determine whether the coding block adopts the transform skip mode by means of explicit coding or implicit derivation.
  • the explicit coding is to decode the flag flag indicating whether the coding block adopts the transform skip mode before decoding the absolute value of the coefficient, so as to clarify 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, Implicit Selection of Transform Skip
  • Implicit Selection of Transform Skip is to perform statistics on the decoding results of coefficients without corresponding flags, and then judge whether to skip the transformation process according to the statistical results.
  • all coefficients can be decoded first, the number of all non-zero coefficients, and the number of even coefficients in all coefficients (including zero coefficients) can be calculated first, and then according to the parity of the number of non-zero coefficients, or the number of even coefficients in all coefficients
  • the parity of to implicitly deduce whether the current coding block adopts transform skipping (for example, when the number of non-zero coefficients is odd, it is determined that the current coding block adopts transform skipping; when the number of non-zero coefficients is even, the Determine that the current coding block does not use transform skipping.
  • the picture-level intra-prediction transform skip enable flag and the picture-level inter-prediction transform skip enable flag are flags for controlling whether implicit transform skipping can be used in intra/inter frames.
  • syntax elements related to transform skip mode are explained as follows.
  • 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 may be assigned the value 0.
  • Inter-transform skip enable flag inter_transform_skip_enable_flag
  • 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, the InterTransformSkipEnableFlag may be assigned the value 0.
  • a value of '1' means that the luma intra prediction residual block and the luma coding block of the current image can be copied using the transform skip method; a value of '0' means the luma intra prediction residual block of the current image Intra prediction residual blocks and luma coded blocks should not use the transform skip method.
  • the value of the variable PictureIstSkipEnableFlag can be obtained by decoding the syntax element picture_ist_skip_enable_flag. If the syntax element picture_ist_skip_enable_flag does not exist in the bitstream, PictureIstSkipEnableFlag may be assigned the value 0.
  • a value of '1' indicates that the transform skip method can be used for the luma inter prediction residual block of the current image; a value of '0' indicates that the transform skip method should not be used for the luma inter prediction residual block of the current image.
  • 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 may be assigned the value 0.
  • FIG. 6 shows a flowchart of steps of a video decoding method in an embodiment of the present application.
  • the video decoding method may be executed by a device with a computing processing function, such as a terminal device or a server, or may be executed by a device as shown in FIG. 14 . performed by the electronic equipment shown.
  • the video decoding method may mainly include the following steps S610 to S630.
  • Step S610 Obtain 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.
  • the video image frame sequence includes a series of images, each image can be further divided into slices (Slices), and the slices can be further divided into a series of LCUs (or CTUs), LCUs include several CU.
  • Video image frames are encoded in blocks during encoding.
  • macroblocks MB
  • PB Encoded prediction block
  • basic concepts such as coding unit CU, prediction unit (PU) and transform unit (TU) are used to functionally divide a variety of block units, and adopt a new tree-based structure for describe.
  • a CU can be divided into smaller CUs according to a quadtree, and the smaller CUs can be further divided to form a quadtree structure.
  • the coding block in this embodiment of the present application may be a CU, or a block smaller than the CU, such as a smaller block obtained by dividing the CU.
  • Step S620 Decoding the code stream of the coding block to obtain the value of the range variable related to the scanning area-based coefficient coding SRCC scan area of the coding block, where the range variable includes a width range variable corresponding to the width and a height range corresponding to the height variable.
  • the syntax elements related to scan_region_x are decoded and de-binarized from the code stream, and the derived value is assigned to the width range variable width_minus1_minus_scan_region_x, and the meaning represented by the width range variable is the current coding block The result obtained by subtracting 1 from the width width and subtracting the value SRx of the abscissa scan_region_x at the right end of the SRCC scan region.
  • the syntax elements related to scan_region_y can be decoded and de-binarized from the code stream, and the derived value is recorded as the height range variable height_minus1_minus_scan_region_y, and the meaning represented by the height range variable is the height of the current coding block minus 1
  • the result is obtained by subtracting the value SRy of the lower ordinate scan_region_y of the SRCC scan region.
  • Step S630 Determine the boundary coordinates of the SRCC scanning area according to the difference between the size of the coding block and the range variable, where the boundary coordinates include the right abscissa corresponding to the width range variable and the lower ordinate corresponding to the height range variable.
  • the width range variable From the definition of the width range variable, the width range variable, the value of the abscissa at the right end of the SRCC scanning area and the width of the coding block can be determined, and the following formulas are satisfied:
  • width_minus1_minus_scan_region_x+(SRx+1) width
  • SRx width-1-width_minus1_minus_scan_region_x.
  • the height range variable From the definition of the height range variable, it can be determined that the height range variable, the value of the lower ordinate of the SRCC scanning area and the height of the coding block satisfy the following formula:
  • SRy height-1-height_minus1_minus_scan_region_y.
  • the range variable can be decoded according to the location distribution characteristics of binary symbols in the code stream.
  • FIG. 7 shows a flowchart of steps for decoding range variables based on binary symbols based on the code stream distribution position in an embodiment of the present application.
  • the decoding of the code stream of the coding block in step S620 to obtain the value of the range variable related to the SRCC scanning area of the coding block may include the following steps S710 to S710 S730.
  • Step S710 In the code stream of the coding block, sequentially decode the binary symbols corresponding to the index numbers in the order of increasing index numbers to obtain the values of the binary symbols.
  • the binary symbol in the code stream of the coding block is denoted as bin, and the corresponding index number is binIdx.
  • binIdx 0 ⁇ (group_idx[min(T,32)-1]-1
  • the bin values of the binIdx th bit are entropy decoded in the code stream one by one in the CABAC manner.
  • 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,10,10,10,10,10,10,10,10, 10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11 ⁇ .
  • Step S720 If the value of the current binary symbol is a preset first value, assign the position variable with the current index number corresponding to the current binary symbol.
  • Step S730 Assign a value to a range variable related to the SRCC scanning area of the coding block according to the value of the position variable.
  • the method for assigning a value to a range variable related to the SRCC scanning area 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, the range variable is assigned the second value; if the value of the position variable is greater than the second value, the prefix value is determined according to the value of the position variable, and according to the current binary value The decoding result of other binary symbols following the symbol determines the suffix value; the range variable is assigned the sum of the prefix value and the suffix value.
  • the method for determining the prefix value according to the value of the position variable may include: performing mapping processing on the value of the position variable according to the first mapping vector to obtain a first value corresponding to the value of the position variable. mapping value; the prefix value is determined according to the first mapping value.
  • the method for determining the suffix value according to the decoding result of other binary symbols following the current binary symbol may include: determining the target number of other binary symbols to be decoded according to the value of the position variable; The target number of other binary symbols after the current binary symbol is decoded to obtain the suffix value.
  • entropy decoding can be performed on a target number of other binary symbols after the current binary symbol in the manner of bypass decoding; The suffix value is obtained by de-binarizing the entropy decoding result.
  • the suffix value suf is obtained by inverse binarization according to the len-bit fixed-length code (see Table 1 below); then the currently decoded width range variable width_minus1_minus_scan_region_x or height range variable height_minus1_minus_scan_region_y can be assigned as pre+suf.
  • FIG. 8 shows a flowchart of steps for decoding a binary symbol in an embodiment of the present application.
  • the method for decoding the binary symbols corresponding to the index numbers in order to obtain the value of the binary symbols in the order of increasing index numbers may include the following steps S810 to step S830.
  • Step S810 Increment the context index corresponding to the binary symbol.
  • Step S820 Determine the context model corresponding to the binary symbol according to the context index increment obtained by the assignment.
  • Step S830 Based on the context model, the binary symbol is arithmetically decoded by the CABAC decoding engine to obtain the value of the binary symbol.
  • the context index increment may also be assigned according to the relevant position information of the binary symbol.
  • FIG. 9 shows a flowchart of steps for incrementally assigning a context index corresponding to a binary symbol in an embodiment of the present application. As shown in FIG. 9 , based on the above embodiment, the method for incrementally assigning a context index corresponding to a binary symbol in step S810 may include the following steps S910 to S930.
  • Step S910 Assign an initial value of the context index increment according to the channel information of the coding block.
  • a preset third value is used as the initial value of the context index increment; if the coding block is a chroma block, it is determined to be related to the size of the coding block
  • the fourth value of , and the initial value of the context index increment is assigned after increasing the fourth value on the basis of the third value.
  • the method for determining the fourth numerical 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 numerical value corresponding to the size of the coding block. Mapping value; take the second mapping value as the fourth numerical value related to the size of the coding block.
  • Step S920 Determine the displacement amount according to the channel information of the coding block and the size of the coding block.
  • shift_x clip3(0,2,(T>>3)
  • T the size of the coding block.
  • Step S930 Determine, according to the initial value, the index number and the displacement amount, to assign a value to the context index increment corresponding to the binary symbol.
  • FIG. 10 shows a flow chart of steps for decoding a range variable based on an index interval in an embodiment of the present application.
  • the decoding of the code stream of the coding block to obtain the value of the range variable related to the SRCC scanning area of the coding block in step S620 may include the following steps S1010 to S1010 S1050.
  • Step S1010 Determine a plurality of consecutive index intervals composed of integers, and the index intervals include a lower interval limit and an interval upper limit.
  • This embodiment of the present application first determines a series of intervals with integer values, 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 an index interval division manner in an embodiment of the present application.
  • Step S1020 Decode the code stream of the coded block to obtain the prefix value.
  • the truncation value can be determined according to the number of intervals and the interval lower limit of the last index interval; Entropy decoding and inverse binarization are performed to obtain the prefix value.
  • the prefix value can also be obtained by decoding the code stream of the coded block in a CABAC decoding manner, wherein each binary bit has a corresponding context model.
  • 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 interval of the first index interval.
  • Step S1040 Determine the compensation value according to the interval lower limit of the target index interval.
  • Step S1050 Determine the value of the range variable according to the compensation value.
  • the compensation value is used to assign a value to the range variable;
  • the suffix value is obtained by decoding the code stream of , and the range variable is assigned the value of the sum of the compensation value and the suffix value.
  • the method for obtaining the suffix value by decoding in the code stream of the coding block may include: determining the binary symbol to be decoded in the code stream of the coding block according to the interval upper limit and the interval lower limit of the target index interval Target number: Entropy decoding is performed on the binary symbols of the target number in the code stream of the encoding block; the target number is used as the length len of the fixed-length code, and the entropy decoding result is de-binarized according to the len-bit fixed-length code. suffix value.
  • len Ceil(log2( Rx_end -Rx - 1_end)).
  • Inverse binarization according to the 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.
  • the method for obtaining the suffix value by decoding the code stream of the coding block may include: selecting a target decoding method from multiple candidate decoding methods; decoding the code stream of the coding block according to the target decoding method to obtain the suffix value suffix value.
  • offset entropy decode 2 bits from the code stream, de-binarize it according to the 2-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.
  • entropy decoding and de-binarization of the suffix value suf can also be performed in one of the following ways including but not limited to, and its value can be derived:
  • entropy decoding and de-binarization of the suffix value suf can also be performed in one of the following ways including but not limited to, and its value can be derived:
  • entropy decoding and de-binarization of the suffix value suf can also be performed in one of the following ways including but not limited to, and its value can be derived:
  • the method for obtaining the value of the range variable related to the SRCC scan area by decoding the code stream of the coding block may include: selecting a target decoding method from multiple candidate decoding methods; according to the target decoding method The value of the range variable related to the SRCC scanning area is obtained by decoding in the code stream of the coded block.
  • multiple candidate decoding methods 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 len The decoding method of the bit-fixed-length code (see Table 1 above); the decoding method based on the k-order exponential Golomb code (see Table 5 above).
  • FIG. 11 shows a flowchart of steps of a video encoding method in an embodiment of the present application.
  • the video encoding method may be executed by a device with computing processing functions, such as a terminal device or a server, or by the electronic device shown in FIG. 14 .
  • the video coding method may mainly include the following steps S1110 to S1130.
  • Step S1110 Obtain 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;
  • Step S1120 Obtain the boundary coordinates of the scanning area-based coefficient coding SRCC scanning area of the coding block, where the boundary coordinates include the right abscissa corresponding to the width and the lower ordinate corresponding to the height;
  • Step S1130 Determine the value of the range variable related to the SRCC scanning area 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 corresponding to the height. scope variable.
  • the present application proposes an encoding and decoding method for the boundary coordinates of the SRCC scanning area, that is, the right abscissa and the lower ordinate of the SRCC scanning area are not directly encoded. , but encodes a range variable related to the boundary coordinates and the size of the encoded block.
  • decoding first decode and deduce the value of the range variable from the code stream, and then the boundary coordinates of the SRCC scanning area can be obtained.
  • the encoding and decoding methods 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 further improve video compression performance.
  • FIG. 12 shows a structural block diagram of a video decoding apparatus provided by an embodiment of the present application. As shown in FIG.
  • the video decoding apparatus 1200 may mainly include: a size obtaining module 1210, 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; variable decoding Module 1220, configured to decode the code stream of the coding block to obtain a value of a range variable related to the SRCC scanning area of the coding block, where the range variable includes a width range variable corresponding to the width and a corresponding range variable.
  • a size obtaining module 1210 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
  • variable decoding Module 1220 configured to decode the code stream of the coding block to obtain a value of a range variable related to the SRCC scanning area of the coding block, where the range variable includes a width range variable corresponding to the width and a corresponding range variable.
  • the coordinate determination module 1230 is configured to determine the boundary coordinates of the SRCC scanning area according to the difference between the size of the encoding block and the range variable, the boundary coordinates including the boundary coordinates corresponding to the The right end abscissa of the width range variable and the lower end ordinate corresponding to the height range variable.
  • the coordinate determination module is configured to: determine the boundary coordinates of the SRCC scanning area according to the following formula
  • SRx width-1-width_minus1_minus_scan_region_x;
  • SRy height-1-height_minus1_minus_scan_region_y;
  • 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
  • height_minus1_minus_scan_region_y is the height range variable.
  • the variable decoding module 1220 includes: a binary symbol decoding unit configured to, in the code stream of the coding block, sequentially perform the decoding in the order of increasing index numbers. The binary symbol corresponding to the index number is decoded to obtain the value of the binary symbol; the position variable assignment unit is configured to, if the value of the current binary symbol is a preset first value, then use the current value of the binary symbol. The current index number corresponding to the binary symbol is assigned to the position variable; the scope variable assignment unit is configured to assign a value to the scope variable related to the SRCC scanning area of the coding block according to the value of the position variable.
  • the range variable assignment unit includes: a value comparison subunit configured to compare the value of the position variable with a preset second value; a first assignment subunit, configured to assign a value to the range variable with the second value if the value of the position variable is less than or equal to the second value; the value determination subunit is configured to The value of the position variable is greater than the second value, then the prefix value is determined according to the value of the position variable, and the suffix value is determined according to the decoding results of other binary symbols after the current binary symbol; the second assignment a subunit configured to assign a value to the scope variable with the sum of the prefix value and the suffix value.
  • the numerical value determination subunit is further configured to: perform mapping processing on the value of the position variable according to the first mapping vector, to obtain a value corresponding to the position variable.
  • the first mapping value corresponding to the value is obtained; the prefix value is determined according to the first mapping value.
  • the numerical value determination subunit is further configured to: determine the target number of other binary symbols to be decoded according to the value of the position variable; The target number of other binary symbols after the binary symbol are decoded to obtain the suffix value.
  • the numerical value determination subunit is further configured to: perform entropy on a target number of other binary symbols following the current binary symbol in a bypass decoding manner Decoding; taking the target number as the length len of the fixed-length code, and performing inverse binarization on the entropy decoding result in the manner of len-bit fixed-length code to obtain a suffix value.
  • the binary symbol decoding unit includes: an incremental assignment subunit, configured to incrementally assign a context index corresponding to the binary symbol; a model determination subunit The unit is configured to determine the context model corresponding to the binary symbol according to the context index increment obtained by assignment; the value decoding subunit is configured to, based on the context model, perform a CABAC decoding engine on the binary symbol. The symbol is arithmetically decoded to obtain the value of the binary symbol.
  • the increment assignment subunit is configured to: increment the assignment by using the index number corresponding to the binary symbol as the context index.
  • the increment assignment subunit is configured to: assign an initial value of the context index increment according to the channel information of the coding block;
  • the channel information of the block and the size of the coded block determine the displacement amount; according to the initial value, the index number and the displacement amount, the context index increment corresponding to the binary symbol is determined and assigned.
  • the increment assignment subunit is further configured to: if the coding block is a luminance block, increment the context index with a preset third value If the coding block is a chrominance block, then determine a fourth numerical value related to the size of the coding block, and increase the fourth numerical value on the basis of the third numerical value to be The initial value assignment of the context index increment.
  • the increment assignment subunit is further configured to: perform mapping processing on the size of the coding block according to the second mapping vector, to obtain the size of the coding block. a second mapping value corresponding to the size; taking the second mapping value as a fourth numerical value related to the size of the coding block.
  • the variable decoding module 1120 includes: an index interval determination unit, configured to determine a plurality of consecutive index intervals composed of integers, where the index interval includes an interval lower limit and an upper limit of the interval; a prefix value decoding unit, configured to decode the code stream of the coding block to obtain a prefix value; a target interval determination unit, configured to determine the range variable according to the numerical relationship between the prefix value and the index threshold The target index interval where the value of , the index threshold is the upper limit of the first index interval; the compensation value determination unit is configured to determine the compensation value according to the interval lower limit of the target index interval; the range variable determination unit is is configured to determine the value of the range variable according to the compensation value.
  • 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 interval lower limit of the last index interval; the prefix value The decoding subunit is configured to perform entropy decoding and inverse binarization in the code stream of the coding block in a manner of truncating the unary code to obtain a prefix value based on the truncation value.
  • the prefix value decoding unit is configured to: obtain the prefix value by decoding the code stream of the coding block in a CABAC decoding manner.
  • the range variable determination unit includes: a first variable assignment subunit configured to, if the target index interval is the first index interval, use the The compensation value is assigned to the range variable; the second variable assignment subunit is configured to, if the target index interval is an index interval other than the first index interval, in the code stream of the encoding block The suffix value is obtained by decoding, and the range variable is assigned a value based on the sum of the compensation value and the suffix value.
  • the second variable assignment subunit is further configured to: determine in the code stream of the coding block according to the upper limit and lower limit of the target index interval The target number of binary symbols to be decoded; entropy decoding is performed on the binary symbols of the target number in the code stream of the coding block; the target number is used as the length len of the fixed-length code, according to the len position of the fixed-length code.
  • the suffix value is obtained by inverse binarization of the entropy decoding result.
  • the second variable assignment subunit is further configured to: select a target decoding method from a plurality of candidate decoding methods; The suffix value is obtained by decoding the code stream of the block.
  • 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 The value of the range variable related to the SRCC scanning area is obtained by decoding in the code stream of the coding block according to the target decoding method.
  • the plurality of 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; Decoding method of fixed-length code; decoding method based on k-order exponential Golomb code.
  • the video decoding apparatus 1200 is applied to a coding block that satisfies any one of the following conditions: a coding block in transform skip mode; a picture-level intra prediction transform skip Coding blocks with a flag value of 1 are allowed; picture-level inter-frame predictive transform skips coding blocks with a flag value of 1; picture-level intra-frame predictive transform skip allows flag values and picture-level inter-frame predictive transform skip allow flag values are both. Coding blocks of 1; all coding blocks.
  • FIG. 13 shows a structural block diagram of a video encoding apparatus in an embodiment of the present application.
  • the video encoding apparatus 1300 may mainly include: a size obtaining module 1310, configured to obtain 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; coordinate obtaining Module 1320, configured to obtain boundary coordinates of the coefficient-encoded SRCC scanning area of the coding block based on the scanning area, where the boundary coordinates include a right abscissa corresponding to the width and a lower ordinate corresponding to the height;
  • the variable encoding module 1330 is configured to determine the value of the range variable related to the SRCC scanning area according to the difference between the size of the encoding block and the boundary coordinates, and encode the range variable, the range
  • the variables include a width range variable corresponding to the width and a height range variable corresponding to the height.
  • an encoding and decoding method for the boundary coordinates of the SRCC scanning area is proposed, that is, the right abscissa and the lower vertical coordinate of the SRCC scanning area are not directly coordinates are encoded, but rather range variables related to boundary coordinates and the dimensions of the encoded block.
  • decoding first decode and deduce the value of the range variable from the code stream, and then the boundary coordinates of the SRCC scanning area can be obtained.
  • the encoding and decoding methods 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 further improve video compression performance.
  • FIG. 14 schematically shows a structural block diagram of a computer system for implementing an electronic device according to an embodiment of the present application.
  • the computer system 1400 includes a central processing unit 1401 (Central Processing Unit, CPU), which can be loaded into a random device according to a program stored in a read-only memory 1402 (Read-Only Memory, ROM) or from a storage part 1408 Various appropriate actions and processes are performed by accessing the program in the memory 1403 (Random Access Memory, RAM). In the random access memory 1403, various programs and data necessary 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, ie, I/O interface) is also connected to the bus 1404 .
  • 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., and 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, and the like. The communication section 1409 performs communication processing via a network such as the Internet.
  • a driver 1410 is also connected to the input/output interface 1405 as needed.
  • a removable medium 1411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1410 as needed so that a computer program read therefrom is installed into the storage section 1408 as needed.
  • embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication portion 1409, and/or installed from the removable medium 1411.
  • the central processing unit 1401 various functions defined in the system of the present application are executed.
  • the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two.
  • the computer readable storage medium can 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.
  • Computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Erasable Programmable Read Only Memory (EPROM), flash memory, optical fiber, portable Compact Disc Read-Only Memory (CD-ROM), optical storage device, magnetic storage device, or any suitable of the above The combination.
  • a computer-readable storage medium can 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.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein.
  • Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium can also be any computer-readable medium, other than a computer-readable storage medium, that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
  • Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination of the foregoing.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • the exemplary embodiments described herein can be implemented by software, or can be implemented by software combined with necessary hardware. Therefore, the technical solutions according to the embodiments of the present application may be embodied in the form of software products, and the software products may be stored in a non-volatile storage medium (which may be CD-ROM, U disk, mobile hard disk, etc.) or on the network , which includes several instructions to cause a computing device (which may be 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.
  • a computing device which may be a personal computer, a server, a touch terminal, or a network device, etc.

Abstract

本申请属于计算机技术领域,具体涉及一种视频编解码方法、装置、介质以及电子设备。本申请实施例中的视频解码方法由电子设备执行,包括:获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;从所述编码块的码流中解码得到与所述编码块的基于扫描区域的系数编码SRCC扫描区域相关的范围变量的差值,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量;根据所述编码块的尺寸和所述范围变量的差值确定所述SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度范围变量的右端横坐标以及对应于所述高度范围变量的下端纵坐标。

Description

视频编解码方法、装置、计算机可读介质及电子设备
本申请要求于2021年2月22日提交中国专利局、申请号为202110199310.0、发明名称为“视频编解码方法、装置、计算机可读介质及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于计算机技术领域,具体涉及一种视频编解码方法、视频编解码装置、计算机可读介质以及电子设备。
发明背景
在视频编码过程中,编码端通常需要对原始视频数据与预测视频数据之间的残差数据进行变换、量化及熵编码处理之后发送给解码端。如果残差系数能量不够集中,尤其是在变换跳过模式下,残差系数的分布更为稀疏,将导致扫描区域的范围在编码时占用较多的必特,因而导致编码效率降低的问题,影响了视频的压缩性能。
发明内容
本申请的目的在于提供一种视频编解码方法、视频编解码装置、计算机可读介质以及电子设备,至少在一定程度上克服相关技术中存在的视频编解码效率低的技术问题。
本申请的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本申请的实践而习得。
根据本申请实施例的一个方面,提供一种视频解码方法,由电子设备执行,该方法包括:获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;从所述编码块的码流中解码得到与所述编码块的基于扫描区域的系数编码SRCC扫描区域相关的范围变量的取值,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量;根据所述编码块的尺寸和所述范围变量的差值确定所述SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度范围变量的右端横坐标以及对应于所述高度范围变量的下端纵坐标。
根据本申请实施例的一个方面,提供一种视频解码装置,该装置包括:尺寸获取模块,被配置为获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;变量解码模块,被配置为从所述编码块的码流中解码得到与所述编码块的SRCC扫描区域相关的范围变量的取值,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量;坐标确定模块,被配置为根据所述编码块的尺寸和所述范围变量的差值确定所述SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度范围变量的右端横坐标以及对应于所述高度范围变量的下端纵坐标。
根据本申请实施例的一个方面,提供一种视频编码方法,由电子设备执行,该方法包括:获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;获取所述编码块的基于扫描区域的系数编码SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度的右端横坐标以及对应于所述高度的下端纵坐标;根据所述编码块的尺寸和所述边界坐标的差值确定与所述SRCC扫描区域相关的范围变量的取值,并对所述范围变量进行编码,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量。
根据本申请实施例的一个方面,提供一种视频编码装置,该装置包括:尺寸获取模块,被配置为获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度; 坐标获取模块,被配置为获取所述编码块的基于扫描区域的系数编码SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度的右端横坐标以及对应于所述高度的下端纵坐标;变量编码模块,被配置为根据所述编码块的尺寸和所述边界坐标的差值确定与所述SRCC扫描区域相关的范围变量的取值,并对所述范围变量进行编码,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量。
根据本申请实施例的一个方面,提供一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如以上技术方案中的视频解码方法。
根据本申请实施例的一个方面,提供一种电子设备,该电子设备包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器被配置为经由执行所述可执行指令来执行如以上技术方案中的视频解码方法。
根据本申请实施例的一个方面,提供一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行如以上技术方案中的视频解码方法。
附图简要说明
图1示出了可以应用本申请实施例的技术方案的示例性系统架构的示意图。
图2示出视频编码装置和视频解码装置在流式传输系统中的放置方式示意图。
图3示出了一个视频编码器的基本流程图。
图4示出了通过SRCC技术标记出的扫描区域。
图5示出了对标记出的扫描区域进行扫描的顺序示意图。
图6示出了本申请一个实施例中的视频解码方法的步骤流程图。
图7示出了本申请一个实施例中基于二元符号的码流分布位置解码范围变量的步骤流程图。
图8示出了本申请一个实施例中对二元符号进行解码的步骤流程图。
图9示出了本申请一个实施例中为二元符号对应的上下文索引增量赋值的步骤流程图。
图10示出了本申请的一个实施例中基于索引区间解码范围变量的步骤流程图。
图11示出了本申请一个实施例中的视频编码方法的步骤流程图。
图12示出了本申请实施例提供的视频解码装置的结构框图。
图13示出了本申请实施例提供的视频编码装置的结构框图。
图14示意性示出了适于用来实现本申请实施例的电子设备的计算机系统结构框图。
实施方式
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本申请将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多具体细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本申请的各方面。
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即,可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。
需要说明的是:在本文中提及的“多个”是指两个或两个以上。“和/或”描述关联对象的关 联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
图1示出了可以应用本申请实施例的技术方案的示例性系统架构的示意图。
如图1所示,系统架构100包括多个终端装置,所述终端装置可通过例如网络150彼此通信。举例来说,系统架构100可以包括通过网络150互连的第一终端装置110和第二终端装置120。在图1的实施例中,第一终端装置110和第二终端装置120执行单向数据传输。
举例来说,第一终端装置110可对视频数据(例如由终端装置110采集的视频图片流)进行编码以通过网络150传输到第二终端装置120,已编码的视频数据以一个或多个已编码视频码流形式传输,第二终端装置120可从网络150接收已编码视频数据,对已编码视频数据进行解码以恢复视频数据,并根据恢复的视频数据显示视频图片。
在本申请的一个实施例中,系统架构100可以包括执行已编码视频数据的双向传输的第三终端装置130和第四终端装置140,所述双向传输比如可以发生在视频会议期间。对于双向数据传输,第三终端装置130和第四终端装置140中的每个终端装置可对视频数据(例如由终端装置采集的视频图片流)进行编码,以通过网络150传输到第三终端装置130和第四终端装置140中的另一终端装置。第三终端装置130和第四终端装置140中的每个终端装置还可接收由第三终端装置130和第四终端装置140中的另一终端装置传输的已编码视频数据,且可对已编码视频数据进行解码以恢复视频数据,并可根据恢复的视频数据在可访问的显示装置上显示视频图片。
在图1的实施例中,第一终端装置110、第二终端装置120、第三终端装置130和第四终端装置140可为服务器、个人计算机和智能电话,但本申请公开的原理可不限于此。本申请公开的实施例适用于膝上型计算机、平板电脑、媒体播放器和/或专用视频会议设备。网络150表示在第一终端装置110、第二终端装置120、第三终端装置130和第四终端装置140之间传送已编码视频数据的任何数目的网络,包括例如有线和/或无线通信网络。通信网络150可在电路交换和/或分组交换信道中交换数据。该网络可包括电信网络、局域网、广域网和/或互联网。出于本申请的目的,除非在下文中有所解释,否则网络150的架构和拓扑对于本申请公开的操作来说可能是无关紧要的。
在本申请的一个实施例中,图2示出视频编码装置和视频解码装置在流式传输环境中的放置方式。本申请所公开主题可同等地适用于其它支持视频的应用,包括例如视频会议、数字电视机(television,TV)、在包括CD、DVD、存储棒等的数字介质上存储压缩视频等等。
流式传输系统可包括采集子系统213,采集子系统213可包括数码相机等视频源201,视频源创建未压缩的视频图片流202。在实施例中,视频图片流202包括由数码相机拍摄的样本。相较于已编码的视频数据204(或已编码的视频码流204),视频图片流202被描绘为粗线以强调高数据量的视频图片流,视频图片流202可由电子装置220处理,电子装置220包括耦接到视频源201的视频编码装置203。视频编码装置203可包括硬件、软件或软硬件组合以实现或实施如下文更详细地描述的所公开主题的各方面。相较于视频图片流202,已编码的视频数据204(或已编码的视频码流204)被描绘为细线以强调较低数据量的已编码的视频数据204(或已编码的视频码流204),其可存储在流式传输服务器205上以供将来使用。一个或多个流式传输客户端子系统,例如图2中的客户端子系统206和客户端子系统208,可访问流式传输服务器205以检索已编码的视频数据204的副本207和副本209。客户端子系统206可包括例如电子装置230中的视频解码装置210。视频解码装置210对已编码的视频数据的传入副本207进行解码,且产生可在显示器212(例如显示屏)或另一呈现装置上呈现的输出视频图片流211。在一些流式传输系统中,可根据某些视频编码/压缩标准对已编码的视频数据204、视频数据207和视频数据209(例如视频码流)进行编码。这些标准的实施例包括ITU-T H.265。在实施例中,正在开发的视频编码标准非正式地称为多功能视频编码(Versatile Video Coding,VVC),本申请可用于VVC标准的上下文中。
应注意,电子装置220和电子装置230可包括图中未示出的其它组件。举例来说,电子装置220可包括视频解码装置,且电子装置230还可包括视频编码装置。
在本申请的一个实施例中,以国际视频编码标准高效率视频编码(High Efficiency Video Coding,HEVC)、多功能视频编码(Versatile Video Coding,VVC),以及中国国家视频编 码标准AVS为例,当输入一个视频帧图像之后,会根据一个块大小,将视频帧图像划分成若干个不重叠的处理单元,每个处理单元将进行类似的压缩操作。这个处理单元被称作编码树单元(Coding Tree Unit,CTU),或者称之为最大编码单元(Largest Coding Unit,LCU)。CTU再往下可以继续进行更加精细的划分,得到一个或多个基本的编码单元CU,CU是一个编码环节中最基本的元素。以下介绍对CU进行编码时的一些概念:
预测编码(Predictive Coding):预测编码包括了帧内预测和帧间预测等方式,原始视频信号经过选定的已重建视频信号的预测后,得到残差视频信号。编码端需要为当前CU决定选择哪一种预测编码模式,并告知解码端。其中,帧内预测是指预测的信号来自于同一图像内已经编码重建过的区域;帧间预测是指预测的信号来自已经编码过的、不同于当前图像的其它图像(称之为参考图像)。
变换及量化(Transform&Quantization):残差视频信号经过离散傅里叶变换(Discrete Fourier Transform,DFT)、离散余弦变换(Discrete Cosine Transform,DCT)等变换操作后,将信号转换到变换域中,称之为变换系数。变换系数进一步进行有损的量化操作,丢失掉一定的信息,使得量化后的信号有利于压缩表达。在一些视频编码标准中,可能有多于一种变换方式可以选择,因此编码端也需要为当前CU选择其中的一种变换方式,并告知解码端。量化的精细程度通常由量化参数(Quantization Parameter,简称QP)来决定,QP取值较大,表示更大取值范围的系数将被量化为同一个输出,因此通常会带来更大的失真及较低的码率;相反,QP取值较小,表示较小取值范围的系数将被量化为同一个输出,因此通常会带来较小的失真,同时对应较高的码率。
熵编码(Entropy Coding)或统计编码:量化后的变换域信号将根据各个值出现的频率进行统计压缩编码,最后输出二值化(0或者1)的压缩码流。同时,编码产生其他信息,例如选择的编码模式、运动矢量数据等,也需要进行熵编码以降低码率。统计编码是一种无损的编码方式,可以有效的降低表达同样信号所需要的码率,常见的统计编码方式有变长编码(Variable Length Coding,简称VLC)或者基于上下文的自适应二进制算术编码(Content Adaptive Binary Arithmetic Coding,简称CABAC)。
基于上下文的自适应二进制算术编码(CABAC)过程主要包含3个步骤:二进制化、上下文建模和二进制算术编码。在对输入的语法元素进行二值化后,可以通过常规编码模式和旁路编码模式(bypass)对二元数据进行编码。旁路编码模式(Bypass Coding Mode),它无须为每个二元位分配特定的概率模型,输入的二元位bin值直接用一个简单的旁路编码器进行编码,以加快整个编码以及解码的速度。一般情况下,不同的语法元素之间并不是完全独立的,且相同语法元素自身也具有一定的记忆性。因此,根据条件熵理论,利用其他已编码的语法元素进行条件编码,相对于独立编码或者无记忆编码能够进一步提高编码性能。这些用来作为条件的已编码符号信息称为上下文。在常规编码模式中,语法元素的二元位顺序地进入上下文模型器。编码器根据先前编码过的语法元素或二元位的值,为每一个输入的二元位分配合适的概率模型,该过程即为上下文建模。通过上下文索引增量(context index increment,ctxIdxInc)和上下文起始索引(context index Start,ctxIdxStart)即可定位到语法元素所对应的上下文模型。将bin值和分配的概率模型一起送入二元算术编码器进行编码后,需要根据bin值更新上下文模型,也就是编码中的自适应过程。
环路滤波(Loop Filtering):经过变化及量化的信号会通过反量化、反变换及预测补偿的操作获得重建图像。重建图像与原始图像相比由于存在量化的影响,部分信息与原始图像有所不同,即重建图像会产生失真(Distortion)。因此,可以对重建图像进行滤波操作,例如去块效应滤波(Deblocking filter,简称DB)、自适应像素补偿(Sample Adaptive Offset,SAO)或者自适应环路滤波(Adaptive Loop Filter,ALF)等滤波器,可以有效降低量化所产生的失真程度。由于这些经过滤波后的重建图像将作为后续编码图像的参考来对将来的图像信号进行预测,因此上述的滤波操作也被称为环路滤波,即在编码环路内的滤波操作。
在本申请的一个实施例中,图3示出了一个视频编码器的基本流程图,在该流程中以帧内预测为例进行说明。其中,原始图像信号s k[x,y]与预测图像信号
Figure PCTCN2021131617-appb-000001
做差值运算,得 到残差信号u k[x,y],残差信号u k[x,y]经过变换及量化处理之后得到量化系数,量化系数一方面通过熵编码得到编码后的比特流,另一方面通过反量化及反变换处理得到重构残差信号u' k[x,y],预测图像信号
Figure PCTCN2021131617-appb-000002
与重构残差信号u' k[x,y]叠加生成图像信号
Figure PCTCN2021131617-appb-000003
图像信号
Figure PCTCN2021131617-appb-000004
一方面输入至帧内模式决策模块和帧内预测模块进行帧内预测处理,另一方面通过环路滤波输出重建图像信号s' k[x,y],重建图像信号s' k[x,y]可以作为下一帧的参考图像进行运动估计及运动补偿预测。然后基于运动补偿预测的结果s' r[x+m x,y+m y]和帧内预测结果
Figure PCTCN2021131617-appb-000005
得到下一帧的预测图像信号
Figure PCTCN2021131617-appb-000006
并继续重复上述过程,直至编码完成。
基于上述的编码过程,在解码端针对每一个CU,在获取到压缩码流(即比特流)之后,进行熵解码获得各种模式信息及量化系数。然后量化系数经过反量化及反变换处理得到残差信号。另一方面,根据已知的编码模式信息,可获得该CU对应的预测信号,然后将残差信号与预测信号相加之后即可得到重建信号,重建信号再经过环路滤波等操作,产生最终的输出信号。
在上述的编解码过程中,对残差信号的变换处理使得残差信号的能量集中在较少的低频系数,也就是多数系数值较小。然后经过后续的量化模块后,较小系数值将变为零值,极大降低了编码残差信号的代价。但是,由于残差分布的多样性,单一的DCT变换无法适应所有的残差特性,因此,DST7和DCT8这样的变换核被引入到变换处理过程中,并且对残差信号进行的水平变换和竖直变换可以采用不同的变换核。以自适应多核变换(Adaptive multiple core transform,AMT)技术为例,对于一个残差信号进行变换处理可能选择的变换组合如下所示:(DCT2,DCT2)、(DCT8,DCT8)、(DCT8,DST7)、(DST7,DCT8)和(DST7,DST7)。对于残差信号具体选择哪种变换组合,需要在编码端使用率失真优化(Rate–Distortion Optimization,RDO)进行决策。另外,在残差块内残差分布相关性较弱的情况下,可以不经过变换过程而直接对残差信号进行量化,即变换跳过。标识当前残差块是否属于变换跳过模式可以通过显式编码和隐式导出两种方式。
由于残差信号在经过变换和量化处理后的量化系数块中非零系数较大概率会集中在块的左边和上方区域,而块的右边和下方区域往往为0,因此引入了基于扫描区域的系数编码(Scan Region based Coefficient Coding,SRCC)技术,通过SRCC技术可以标记出每个量化系数块(尺寸为W×H)中包含的非零系数的左上区域的大小为(SRx+1)×(SRy+1),其中SRx是量化系数块中最右面的非零系数的横坐标,SRy是量化系数块中最下面的非零系数的纵坐标,且左上角起点坐标为(0,0),1≤SRx+1≤W,1≤SRy+1≤H,而该区域外的系数均为0。SRCC技术利用(SRx,SRy)来确定一个量化系数块中需要扫描的量化系数区域,如图4所示,只有(SRx,SRy)标记的扫描区域内的量化系数需要编码,编码的扫描顺序如图5所示,可以是从右下角到左上角的反向Z字型扫描。
SRCC区域内的待编码的系数采用的是分层的方法进行编码。具体来讲,首先,对SRCC扫描区域坐标进行编码。然后,在SRCC区域内,基于扫描顺序,逐一编码标识当前位置上的系数是否为0的flag(significant flag)。与此同时,记录非零系数位置和统计非零系数个数。如果非零系数个数大于0,则需要对相应位置的非0系数绝对值和符号进行编码。
以AVS3标准作为示例,视频编解码器使用了基于扫描区域的系数编码技术(Scan Region based Coefficient Coding,SRCC)。在对SRCC区域内的所有系数进行编码前,要先对SRCC扫描区域右端横坐标scan_region_x(值为SRx)和下端纵坐标scan_region_y(值为SRy)进行编码。在现有的AVS标准中,是直接对scan_region_x的值SRx和scan_region_y的值SRy进行编码。
考虑到SRCC区域的边界主要取决于当前块内最右边和最下边非零系数的位置。对于经过变换的编码块,其变换后的能量主要集中在有限的低频系数位置,因此,SRCC区域的面积,以及SRx和SRy倾向于较小值。然而,对于变换跳过模式的编码块,由于不存在变换过程,残差系数能量没有被集中,非零系数的分布可能相对更为稀疏。因此,变换跳过模式的 编码块的SRCC区域的面积,以及SRx和SRy相对来讲倾向于更大值。因此,如果在变换跳过模式下,也直接对SRx和SRy进行编码,可能会使得在编码变换跳过模式下的SRx和SRy时需要更多比特,从而导致编码效率的降低。
本申请根据变换跳过模式下SRCC区域坐标的统计特性,提出了一种SRCC扫描区域坐标的编解码方法,即不直接对SRCC扫描区域右端横坐标scan_region_x的值SRx和下端纵坐标scan_region_y的值SRy进行编码,而是编码width-1-SRx的值(记为width_minus1_minus_scan_region_x)和height-1-SRy的值(记为height_minus1_minus_scan_region_y),解码时,先从码流里解码并推导出width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y的值,随后即可求得SRCC扫描区域右端横坐标scan_region_x的值SRx=width-1-width_minus1_minus_scan_region_x,下端纵坐标scan_region_y的值SRy=height-1-height_minus1_minus_scan_region_y。改进后的编码方式能够减少编码所需比特数,有助于提升系数编码的编码效率,从而进一步提升视频压缩性能。
本申请提出的SRCC扫描区域坐标的编码方法,不局限于应用在变换跳过模式下的SRCC扫描区域坐标编码上。它可以使用在其它编码模式下的系数编码中的SRCC扫描区域坐标编码上,例如,运用在所有块的SRCC扫描区域坐标编码中,例如,在图像级帧内预测变换跳过允许标志值为1的时候使用;例如,在图像级帧间预测变换跳过允许标志值为1的时候使用;例如,在图像级帧内预测变换跳过允许标志值和图像级帧间预测变换跳过允许标志值均为1的时候使用,等等。
在一些实施方式中,在变换跳过模式下编码width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y,在其它模式下保持原先的编码方式,即直接编码SRx和SRy。
在其他一些实施方式中,所有块的SRCC扫描区域坐标编码方式都采用编码width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y的方法。
在其他一些实施方式中,另一种结合方式为,在变换跳过模式下保持原先的编码方式,即直接编码SRx和SRy,在其它模式下编码width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y。
在其他一些实施方式中,在图像级帧内预测变换跳过允许标志值为1的时候编码width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y,在其它条件下保持原先的编码方式,即直接编码SRx和SRy。
在其他一些实施方式中,在图像级帧间预测变换跳过允许标志值为1的时候编码width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y,在其它条件下保持原先的编码方式,即直接编码SRx和SRy。
在其他一些实施方式中,在图像级帧内预测变换跳过允许标志值和图像级帧间预测变换跳过允许标志值均为1的时候编码width_minus1_minus_scan_region_x和height_minus1_minus_scan_region_y,在其它条件下保持原先的编码方式,即直接编码SRx和SRy。
本申请实施例可以通过显式编码或者隐含导出的方式确定编码块是否采用变换跳过模式。其中,显式编码是在解码系数绝对值之前对用于表示编码块是否采用变换跳过模式的标志flag进行解码,以基于标志的解码结果明确当前的编码块是否需要跳过变换过程。隐含导出(即隐择变换跳过,Implicit Selection of Transform Skip)是在没有相应标志的情况下,对系数解码结果进行统计,再根据统计结果判断是否跳过变换过程。例如,可以先解码出所有系数,计算所有非零系数的数量,以及所有系数(包括零系数)中偶数系数的数量,然后根据非零系数的数量的奇偶性,或者所有系数中偶数系数的数量的奇偶性,去隐式地推导当前编码块是否采用变换跳过(例如,非零系数的数量为奇数时,确定当前编码块采用了变换跳过;而在非零系数的数量为偶数时,确定当前编码块未采用变换跳过。例如,所有系数中偶数系数的数量为偶数时,确定当前编码块采用了变换跳过;而在所有系数中偶数系数的数量为奇数时,确定当前编码块未采用变换跳过)。
图像级帧内预测变换跳过允许标志和图像级帧间预测变换跳过允许标志是用于控制是否 能够在帧内/帧间使用隐择变换跳过的标志。在本申请的实施例中,涉及与变换跳过模式相关的语法元素解释如下。
隐择变换跳过允许标志ist_skip_enable_flag:
二值变量。值为‘1’表示可使用隐择变换跳过;值为‘0’表示不应使用隐择变换跳过。变量IstSkipEnableFlag的值可以通过对语法元素ist_skip_enable_flag解码得到。如果位流中不存在语法元素ist_skip_enable_flag,可以将IstSkipEnableFlag赋值为0。
帧间变换跳过允许标志inter_transform_skip_enable_flag:
二值变量。值为‘1’表示可使用帧间变换跳过;值为‘0’表示不应使用帧间变换跳过。变量InterTransformSkipEnableFlag的值可以通过对语法元素inter_transform_skip_enable_flag解码得到。如果位流中不存在语法元素inter_transform_skip_enable_flag,可以将InterTransformSkipEnableFlag赋值为0。
图像级帧内预测变换跳过允许标志picture_ist_skip_enable_flag:
二值变量。值为‘1’表示当前图像的亮度帧内预测残差块和亮度编码块复制帧内预测残差块可使用变换跳过方法;值为‘0’表示当前图像的亮度帧内预测残差块和亮度编码块复制帧内预测残差块不应使用变换跳过方法。变量PictureIstSkipEnableFlag的值可以通过对语法元素picure_ist_skip_enable_flag解码得到。如果位流中不存在语法元素picture_ist_skip_enable_flag,可以将PictureIstSkipEnableFlag赋值为0。
图像级帧间预测变换跳过允许标志picture_inter_trasform_skip_flag:
二值变量。值为‘1’表示当前图像的亮度帧间预测残差块可使用变换跳过方法;值为‘0’表示当前图像的亮度帧间预测残差块不应使用变换跳过方法。PictureInterSkipEnableFlag的值可以通过对语法元素picture_inter_trasform_skip_flag解码得到。如果位流中不存在语法元素picture_inter_trasform_skip_flag,可以将PictureInterSkipEnableFlag赋值为0。
下面结合具体应用场景对本申请实施例的技术方案的实现细节进行详细阐述。
图6示出了本申请一个实施例中的视频解码方法的步骤流程图,该视频解码方法可以由具有计算处理功能的设备来执行,比如可以由终端设备或服务器来执行,或者可由图14所示的电子设备执行。如图6所示,该视频解码方法主要可以包括如下的步骤S610至步骤S630。
步骤S610:获取视频图像帧的编码块的尺寸,编码块的尺寸包括编码块的宽度和高度。
在本申请的一个实施例中,视频图像帧序列包括了一系列图像,每张图像可以被进一步划分为切片(Slice),切片又可以划分为一系列的LCU(或CTU),LCU包含有若干CU。视频图像帧在编码时以块为单位进行编码处理,在一些新的视频编码标准中,比如在H.264标准中有宏块(macroblock,MB),宏块可进一步划分成多个可用于预测编码的预测块(prediction block,PB)。在HEVC标准中,采用编码单元CU、预测单元(prediction unit,PU)和变换单元(transform unit,TU)等基本概念,从功能上划分了多种块单元,并采用全新的基于树的结构进行描述。比如CU可以按照四叉树划分为更小的CU,而更小的CU还可以继续划分,从而形成一种四叉树结构。本申请实施例中的编码块可以是CU,或者是比CU更小的块,如对CU进行划分得到的更小的块。
步骤S620:从编码块的码流中解码得到与编码块的基于扫描区域的系数编码SRCC扫描区域相关的范围变量的取值,范围变量包括对应于宽度的宽度范围变量以及对应于高度的高度范围变量。
在本申请的一个实施例中,从码流中对与scan_region_x相关的语法元素进行解码和反二值化,所推导得到的值赋给宽度范围变量width_minus1_minus_scan_region_x,宽度范围变量表示的含义是当前编码块的宽度width减去1再减去SRCC扫描区域的右端横坐标scan_region_x的值SRx所得到的结果。然后,可以从码流中对与scan_region_y相关的语法元素进行解码和反二值化,所推导得到的值记为高度范围变量height_minus1_minus_scan_region_y,高度范围变量表示的含义是当前编码块的高度height减去1再减去SRCC扫描区域的下端纵坐标scan_region_y的值SRy所得到的结果。
步骤S630:根据编码块的尺寸和范围变量的差值确定SRCC扫描区域的边界坐标,边界坐标包括对应于宽度范围变量的右端横坐标以及对应于高度范围变量的下端纵坐标。
由宽度范围变量的定义,可以确定宽度范围变量、SRCC扫描区域的右端横坐标的取值 以及编码块的宽度之间,满足如下公式:
width_minus1_minus_scan_region_x+(SRx+1)=width
由此可得到SRCC扫描区域右端横坐标scan_region_x的取值为:
SRx=width-1-width_minus1_minus_scan_region_x。
由高度范围变量的定义,可以确定高度范围变量、SRCC扫描区域的下端纵坐标的取值以及编码块的高度之间,满足如下公式:
height_minus1_minus_scan_region_y+(SRy+1)=height
由此可得到SRCC扫描区域下端纵坐标scan_region_x的取值为:
SRy=height-1-height_minus1_minus_scan_region_y。
在本申请的一个实施例中,可以根据二元符号在码流中的位置分布特点对范围变量进行解码。图7示出了本申请一个实施例中基于二元符号的码流分布位置解码范围变量的步骤流程图。如图7所示,在以上实施例的基础上,步骤S620中的从编码块的码流中解码得到与编码块的SRCC扫描区域相关的范围变量的取值,可以包括如下的步骤S710至步骤S730。
步骤S710:在编码块的码流中,按照索引号递增的顺序依次对索引号对应的二元符号进行解码得到二元符号的取值。
在本申请的一个实施例中,将编码块的码流中的二元符号记作bin,其对应的索引号为binIdx。对于binIdx=0~(group_idx[min(T,32)-1]-1),逐一在码流中按CABAC方式熵解码第binIdx位的bin值。当需要解码的是width_minus1_minus_scan_region_x时,令T=width。当需要解码的是height_minus1_minus_scan_region_y时,令T=height。其中,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,10,10,10,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11}。
步骤S720:若当前二元符号的取值为预设的第一数值,则以当前二元符号对应的当前索引号为位置变量赋值。
在本申请的一个实施例中,取第一数值为0,如果当前解码得到的当前二元符号的取值为0,即bin=0,则可以将位置变量pos赋值为当前二元符号对应的当前索引号,即令pos=binIdx。而如果当前二元符号的取值不是第一数值(例如取值为1,即bin=1),则令binIdx=binIdx+1,继续读取后续的其他二元符号。
步骤S730:根据位置变量的取值对与编码块的SRCC扫描区域相关的范围变量进行赋值。
在本申请的一个实施例中,根据位置变量的取值对与编码块的SRCC扫描区域相关的范围变量进行赋值的方法可以包括:将位置变量的取值与预设的第二数值进行比较;若位置变量的取值小于或等于第二数值,则以第二数值为范围变量赋值;若位置变量的取值大于第二数值,则根据位置变量的取值确定前缀值,并根据当前二元符号之后的其他二元符号的解码结果确定后缀值;以前缀值和后缀值的和为范围变量赋值。
举例而言,第二数值取值为3,如果位置变量的取值pos<=3,则将width_minus1_minus_scan_region_x或者height_minus1_minus_scan_region_y赋值为pos。而如果位置变量的取值pos>3,则需要进一步确定前缀值和后缀值,从而根据前缀值和后缀值的和对当前解码的范围变量width_minus1_minus_scan_region_x或者height_minus1_minus_scan_region_y进行赋值。
在本申请的一个实施例中,根据位置变量的取值确定前缀值的方法可以包括:根据第一映射向量对位置变量的取值进行映射处理,得到与位置变量的取值相对应的第一映射值;根据第一映射值确定前缀值。
举例而言,第一映射向量记作min_in_group[14]={0,1,2,3,4,6,8,12,16,24,32,48,64,96},在位置变量的取值大于第二数值时,令前缀值为pre=min_in_group[pos]。
在本申请的一个实施例中,根据当前二元符号之后的其他二元符号的解码结果确定后缀值的方法可以包括:根据位置变量的取值确定待解码的其他二元符号的目标数量;对当前二元符号之后的目标数量个其他二元符号进行解码得到后缀值。本申请实施例可以按照旁路解码bypass的方式对当前二元符号之后的目标数量个其他二元符号进行熵解码;然后以目标数量作为定长码的长度len,按照len位定长码的方式对熵解码结果进行反二值化得到后缀值。
举例而言,在位置变量的取值大于第二数值时并确定相应的前缀值pre之后,本申请实施例可以继续在码流里按bypass方式解码len=(pos-2)>>1个bin并按照len位定长码(见下方 表1)的方式进行反二值化得到后缀值suf;那么当前解码的宽度范围变量width_minus1_minus_scan_region_x或者高度范围变量height_minus1_minus_scan_region_y可以赋值为pre+suf。
表1 synElVal与二元符号串的关系
(长度为len的定长码)
Figure PCTCN2021131617-appb-000007
图8示出了本申请一个实施例中对二元符号进行解码的步骤流程图。如图8所示,在以上实施例的基础上,步骤S710中,按照索引号递增的顺序,依次对索引号对应的二元符号进行解码得到二元符号的取值的方法可以包括如下的步骤S810至步骤S830。
步骤S810:为二元符号对应的上下文索引增量赋值。
步骤S820:根据赋值得到的上下文索引增量确定与二元符号相对应的上下文模型。
步骤S830:基于上下文模型,通过CABAC解码引擎对二元符号进行算数解码得到二元符号的取值。
在本申请的一个实施例中,可以以二元符号对应的索引号为上下文索引增量赋值,即ctxIdxInc=binIdx。
在本申请的一个实施例中,也可以根据二元符号的相关位置信息对上下文索引增量进行赋值。图9示出了本申请一个实施例中为二元符号对应的上下文索引增量赋值的步骤流程图。如图9所示,在以上实施例的基础上,步骤S810中的为二元符号对应的上下文索引增量赋值的方法可以包括如下的步骤S910至步骤S930。
步骤S910:根据编码块的通道信息为上下文索引增量的初始值赋值。
在本申请的一个实施例中,若编码块为亮度块,则以预设的第三数值为上下文索引增量的初始值赋值;若编码块为色度块,则确定与编码块的尺寸相关的第四数值,并在第三数值的基础上增大第四数值后为上下文索引增量的初始值赋值。
在本申请的一个实施例中,确定与编码块的尺寸相关的第四数值的方法可以包括:根据第二映射向量对编码块的尺寸进行映射处理,得到与编码块的尺寸相对应的第二映射值;以第二映射值作为与编码块的尺寸相关的第四数值。
举例而言,第三数值可以取值为0,如果当前编码块是亮度块,则令ctxIdxInc=0。如果当前编码块是色度块,则令ctxIdxInc=ctxIdxInc+25+prefix_ctx[logV]。其中,第二映射向量记作prefix_ctx[8]={0,0,0,3,6,10,15,21}。当需要解码的是width_minus1_minus_scan_region_x时,令V=width,则logV=log(width)。当需要解码的是height_minus1_minus_scan_region_y时,令V=height,则logV=log(height)。
步骤S920:根据编码块的通道信息以及编码块的尺寸确定位移量。
在本申请的一个实施例中,若编码块为亮度块,按照公式shift_x=clip3(0,2,(logV+1)>>2)确定位移量,其中shift_x为位移量,V为编码块的尺寸,当需要解码的是width_minus1_minus_scan_region_x时,令V=width,则logV=log(width)。当需要解码的是height_minus1_minus_scan_region_y时,令V=height,则logV=log(height)。若编码块为色度块,按照公式shift_x=clip3(0,2,(T>>3))确定位移量,其中shift_x为位移量,T为编码块的尺寸,当需要解码的是width_minus1_minus_scan_region_x时,令T=width。当需要解码的是height_minus1_minus_scan_region_y时,令T=height。。
步骤S930:根据初始值、索引号以及位移量确定对二元符号对应的上下文索引增量进行赋值。
在本申请的一个实施例中,如果binIdx等于0,则令ctxIdxInc保持当前值,即令ctxIdxInc=ctxIdxInc。如果binIdx大于0,且前一个bin为1,且binIdx小于group_idx[min(T,32)-1],则令ctxIdxInc=ctxIdxInc+(binIdx>>shift_x)。
图10示出了本申请的一个实施例中基于索引区间解码范围变量的步骤流程图。如图10所示,在以上实施例的基础上,步骤S620中的从编码块的码流中解码得到与编码块的SRCC扫描区域相关的范围变量的取值,可以包括如下的步骤S1010至步骤S1050。
步骤S1010:确定多个连续的由整数组成的索引区间,索引区间包括区间下限和区间上限。
本申请实施例首先确定一系列数值为整数的区间,记为R0,R1,R2,…,Rn,其中Rx的索引为x,区间Rx可以表示为[Rx_start,Rx_end)。表2示出了本申请一个实施例中的索引区间划分方式。
表2区间划分
区间Rx 区间范围[Rx_start,Rx_end)
R 0 [0,R 0_end)
R 1 [R 0_end,R 1_end)
R 2 [R 1_end,R 2_end)
R 3 [R 2_end,R 3_end)
R x [R x-1_end,R x_end)
R n-1 [R n-2_end,R n-1_end)
R n [R n-1_end,R n_end)
举例而言,相关索引区间的取值可以表示为:R 0=[0,5),R 1=[5,9),R 2=[9,17),R 3=[17,MAX_TU_SIZE),MAX_TU_SIZE为编解码器所规定的变换单元TU的最大尺寸。
步骤S1020:在编码块的码流中解码得到前缀值。
在本申请的一个实施例中,可以根据区间个数和最后一个索引区间的区间下限确定截断 值;然后基于截断值,按照截断一元码的方式(见下方表3)在编码块的码流中进行熵解码和反二值化得到前缀值。其中截断值可以取值为maxVal=R 0_end+n-1。
在本申请的一个实施例中,也可以通过CABAC解码方式对编码块的码流进行解码得到前缀值,其中每个二进制位具有对应的上下文模型。
步骤S1030:根据前缀值与索引阈值的数值关系确定范围变量的取值所在的目标索引区间,索引阈值为第一个索引区间的区间上限。
举例而言,以第一个索引区间的区间上限R 0_end作为索引阈值,如果pre等于R 0_end+x-1(x=1~n-1),可以确定范围变量的取值属于区间R x=[R x-1_end,R x_end)。
步骤S1040:根据目标索引区间的区间下限确定补偿值。
步骤S1050:根据补偿值确定范围变量的取值。
在本申请的一个实施例中,若目标索引区间为第一个索引区间,则以补偿值为范围变量赋值;若目标索引区间是除第一个索引区间以外的其他索引区间,则在编码块的码流中解码得到后缀值,并以补偿值与后缀值的和为范围变量赋值。
举例而言,如果pre小于等于R 0_end-1,可以令补偿值offset=pre。如果pre等于R 0_end+x-1(x=1~n-1),则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值属于区间R x=[R x-1_end,R x_end)。在此基础上,可以令offset等于R x-1_end。
在本申请的一个实施例中,在编码块的码流中解码得到后缀值的方法可以包括:根据目标索引区间的区间上限和区间下限在编码块的码流中确定待解码的二元符号的目标数量;在编码块的码流中对目标数量的二元符号进行熵解码;以目标数量作为定长码的长度len,按照len位定长码的方式对熵解码结果进行反二值化得到后缀值。
举例而言,本申请实施例可以将待解码的二元符号的目标数量记作len=Ceil(log2(R x_end-R x-1_end))。按照len位定长码的方式反二值化(见上方表1)并推导得到后缀值suf,则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值为offset+suf。
在本申请的一个实施例中,在编码块的码流中解码得到后缀值的方法可以包括:从多个候选解码方法中选取目标解码方法;按照目标解码方法在编码块的码流中解码得到后缀值。
在本申请的一个实施例中,可供选择的多个候选解码方法可以包括:基于截断一元码(截断值maxVal=R x_end-offset-1)的解码方法(见下方表3);基于一元码的解码方法(见下方表4);基于len位定长码的解码方法(见上方表1);基于k阶指数哥伦布码的解码方法(见下方表5)。
表3 synElVal与二元符号串的关系
(截断一元码的2种形式:表3-1或表3-2)
表3-1
Figure PCTCN2021131617-appb-000008
Figure PCTCN2021131617-appb-000009
表3-2
Figure PCTCN2021131617-appb-000010
表4 synElVal与二元符号串的关系
(包括2种一元码形式:表4-1或表4-2)
表4-1
Figure PCTCN2021131617-appb-000011
Figure PCTCN2021131617-appb-000012
表5-2
Figure PCTCN2021131617-appb-000013
表5 k阶指数哥伦布码表
Figure PCTCN2021131617-appb-000014
Figure PCTCN2021131617-appb-000015
下面以索引区间R 0=[0,5),R 1=[5,9),R 2=[9,17),R 3=[17,MAX_TU_SIZE),即n=3,x=0~3,R 0_end=5为例进行说明如下,其中,MAX_TU_SIZE为编解码器所规定的TU的最大尺寸。
(1)首先确定一系列数值为整数的区间,R 0=[0,5),R 1=[5,9),R 2=[9,17),R 3=[17,MAX_TU_SIZE);
(2)从码流中按照截断一元码的方式(见表3,截断值maxVal=5+3-1=7)解码和反二值化得到前缀值pre。如果pre小于等于4,令offset=pre,则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值即为offset。
(3)pre采用CABAC的方式进行熵解码,每个二进制位具有对应的上下文模型;
(4)如果pre等于5(x=1),则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值属于区间R 1=[5,9)。令offset等于5,从码流中熵解码2位比特,按照2位定长码的方式反二值化(见表1)并推导得到后缀值suf,那么待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值即为offset+suf。
(5)对于以上步骤(4),也可以按照包括但不限于以下方式之一对后缀值suf进行熵解码和反二值化并推导出其值:
(5-1)按照k阶指数哥伦布码(见表5)的方式对后缀值suf反二值化;
(5-2)按照截断一元码(见表3,截断值maxVal=R x_end-offset-1=9-5-1=3)的方式对后缀值suf反二值化;
(5-3)按照一元码(见表4)的方式对后缀值suf反二值化。
(6)如果pre等于6(x=2),则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值属于区间R 2=[9,17),令offset等于9,从码流中熵解码3位比特,按照3位定长码的方式反二值化(见表1)并推导得到后缀值suf,那么待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值即为offset+suf。
(7)对于以上步骤(6),也可按照包括但不限于以下方式之一对后缀值suf进行熵解码和反二值化并推导出其值:
(7-1)按照k阶指数哥伦布码(见表5)的方式对后缀值suf反二值化;
(7-2)按照截断一元码(见表3,截断值maxVal=R x_end-offset-1=17-9-1=7)的方式对后缀值suf反二值化;
(7-3)按照一元码(见表4)的方式对后缀值suf反二值化。
(8)如果pre等于7,则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值属于区间R 3=[17,MAX_TU_SIZE);,令offset等于17,继续从码流中进行熵解码,按照k阶指数哥伦布码的方式反二值化(见表5)并推导得到后缀值suf。则待解码的width_minus1_minus_scan_region_x或height_minus1_minus_scan_region_y的值为offset+suf。
(9)对于以上(8),也可按照包括但不限于以下方式之一对后缀值suf进行熵解码和反二值化并推导出其值:
(9-1)按照len=Ceil(log2(R n_end-R n-1_end))位定长码的方式反二值化(见表1)并推导得到后缀值suf;
(9-2)按照截断一元码(见表3)的方式对后缀值suf反二值化;
(9-3)按照一元码(见表4)的方式对后缀值suf反二值化。
在本申请的一个实施例中,从编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值的方法可以包括:从多个候选解码方法中选取目标解码方法;按照目标解码方法在编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值。在本申请的一个实施例中,可供选择的多个候选解码方法可以包括:基于截断一元码的解码方法(见上方表3);基于一元码的解码方法(见上方表4);基于len位定长码的解码方法(见上方表1);基于k阶指数哥伦布码的解码方法(见上方表5)。
以上实施例从解码侧的角度介绍了关于SRCC扫描区域边界坐标的解码方案,而在编码侧可以使用与以上各个实施例相对应的编码方案。图11示出了本申请一个实施例中的视频编码方法的步骤流程图。该视频编码方法可以由具有计算处理功能的设备来执行,比如可以由终端设备或服务器来执行,或由图14所示的电子设备执行。如图11所示,该视频编码方法主要可以包括如下的步骤S1110至步骤S1130。
步骤S1110:获取视频图像帧的编码块的尺寸,编码块的尺寸包括编码块的宽度和高度;
步骤S1120:获取编码块的基于扫描区域的系数编码SRCC扫描区域的边界坐标,边界坐标包括对应于宽度的右端横坐标以及对应于高度的下端纵坐标;
步骤S1130:根据编码块的尺寸和边界坐标的差值确定与SRCC扫描区域相关的范围变量的取值,并对范围变量进行编码,范围变量包括对应于宽度的宽度范围变量以及对应于高度的高度范围变量。
本申请实施例中的视频编码方法的相关内容细节与以上实施例中的视频解码方法相对应,此处不再赘述。
基于以上各实施例,本申请根据SRCC扫描区域的边界坐标的统计特性,提出了一种针对SRCC扫描区域边界坐标的编解码方法,即不直接对SRCC扫描区域右端横坐标和下端纵坐标进行编码,而是编码与边界坐标以及编码块的尺寸相关的范围变量。在解码时,先从码流里解码并推导出范围变量的值,随后即可求得SRCC扫描区域的边界坐标。本申请实施例提供的编解码方法能够减少编码所需比特数,有助于提升系数编码的编解码效率,从而进一步提升视频压缩性能。
应当注意,尽管在附图中以特定顺序描述了本申请中方法的各个步骤,但是,这并非要求或者暗示必须按照该特定顺序来执行这些步骤,或是必须执行全部所示的步骤才能实现期望的结果。附加的或备选的,可以省略某些步骤,将多个步骤合并为一个步骤执行,以及/或者将一个步骤分解为多个步骤执行等。
以下介绍本申请的装置实施例,可以用于执行本申请上述实施例中的视频编解码方法。图12示出了本申请实施例提供的视频解码装置的结构框图。如图12所示,视频解码装置1200主要可以包括:尺寸获取模块1210,被配置为获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;变量解码模块1220,被配置为从所述编码块的码流中解码得到与所述编码块的SRCC扫描区域相关的范围变量的取值,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量;坐标确定模块1230,被配置为根据所述编码块的尺寸和所述范围变量的差值确定所述SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度范围变量的右端横坐标以及对应于所述高度范围变量的下端纵坐标。
在本申请的一些实施例中,基于以上实施例,所述坐标确定模块被配置为:按照如下公式确定所述SRCC扫描区域的边界坐标;
SRx=width-1-width_minus1_minus_scan_region_x;
SRy=height-1-height_minus1_minus_scan_region_y;
其中,SRx为所述右端横坐标,SRy为所述下端纵坐标,width为所述宽度,height为所 述高度,width_minus1_minus_scan_region_x为所述宽度范围变量,height_minus1_minus_scan_region_y为所述高度范围变量。
在本申请的一些实施例中,基于以上各实施例,所述变量解码模块1220包括:二元符号解码单元,被配置为在所述编码块的码流中,按照索引号递增的顺序依次对所述索引号对应的二元符号进行解码得到所述二元符号的取值;位置变量赋值单元,被配置为若当前二元符号的取值为预设的第一数值,则以所述当前二元符号对应的当前索引号为位置变量赋值;范围变量赋值单元,被配置为根据所述位置变量的取值对与所述编码块的SRCC扫描区域相关的范围变量进行赋值。
在本申请的一些实施例中,基于以上各实施例,所述范围变量赋值单元包括:取值比较子单元,被配置为将所述位置变量的取值与预设的第二数值进行比较;第一赋值子单元,被配置为若所述位置变量的取值小于或等于所述第二数值,则以所述第二数值为所述范围变量赋值;数值确定子单元,被配置为若所述位置变量的取值大于所述第二数值,则根据所述位置变量的取值确定前缀值,并根据所述当前二元符号之后的其他二元符号的解码结果确定后缀值;第二赋值子单元,被配置为以所述前缀值和所述后缀值的和为所述范围变量赋值。
在本申请的一些实施例中,基于以上各实施例,所述数值确定子单元还被配置为:根据第一映射向量对所述位置变量的取值进行映射处理,得到与所述位置变量的取值相对应的第一映射值;根据所述第一映射值确定前缀值。
在本申请的一些实施例中,基于以上各实施例,所述数值确定子单元还被配置为:根据所述位置变量的取值确定待解码的其他二元符号的目标数量;对所述当前二元符号之后的目标数量个其他二元符号进行解码得到后缀值。
在本申请的一些实施例中,基于以上各实施例,所述数值确定子单元还被配置为:按照旁路解码的方式对所述当前二元符号之后的目标数量个其他二元符号进行熵解码;以所述目标数量作为定长码的长度len,按照len位定长码的方式对熵解码结果进行反二值化得到后缀值。
在本申请的一些实施例中,基于以上各实施例,所述二元符号解码单元包括:增量赋值子单元,被配置为为所述二元符号对应的上下文索引增量赋值;模型确定子单元,被配置为根据赋值得到的上下文索引增量确定与所述二元符号相对应的上下文模型;取值解码子单元,被配置为基于所述上下文模型,通过CABAC解码引擎对所述二元符号进行算数解码得到所述二元符号的取值。
在本申请的一些实施例中,基于以上各实施例,所述增量赋值子单元被配置为:以所述二元符号对应的索引号为上下文索引增量赋值。
在本申请的一些实施例中,基于以上各实施例,所述增量赋值子单元被配置为:根据所述编码块的通道信息为所述上下文索引增量的初始值赋值;根据所述编码块的通道信息以及所述编码块的尺寸确定位移量;根据所述初始值、所述索引号以及所述位移量确定对所述二元符号对应的上下文索引增量进行赋值。
在本申请的一些实施例中,基于以上各实施例,所述增量赋值子单元还被配置为:若所述编码块为亮度块,则以预设的第三数值为所述上下文索引增量的初始值赋值;若所述编码块为色度块,则确定与所述编码块的尺寸相关的第四数值,并在所述第三数值的基础上增大所述第四数值后为所述上下文索引增量的初始值赋值。
在本申请的一些实施例中,基于以上各实施例,所述增量赋值子单元还被配置为:根据第二映射向量对所述编码块的尺寸进行映射处理,得到与所述编码块的尺寸相对应的第二映射值;以所述第二映射值作为与所述编码块的尺寸相关的第四数值。
在本申请的一些实施例中,基于以上各实施例,所述增量赋值子单元还被配置为:若所述编码块为亮度块,按照公式shift_x=clip3(0,2,(logV+1)>>2)确定位移量,其中shift_x为位移量,V为所述编码块的尺寸;若所述编码块为色度块,按照公式shift_x=clip3(0,2,(T>>3))确定位移量,其中shift_x为位移量,T为所述编码块的尺寸。
在本申请的一些实施例中,基于以上各实施例,所述变量解码模块1120包括:索引区间确定单元,被配置为确定多个连续的由整数组成的索引区间,所述索引区间包括区间下限和区间上限;前缀值解码单元,被配置为在所述编码块的码流中解码得到前缀值;目标区间确 定单元,被配置为根据所述前缀值与索引阈值的数值关系确定所述范围变量的取值所在的目标索引区间,所述索引阈值为第一个索引区间的区间上限;补偿值确定单元,被配置为根据所述目标索引区间的区间下限确定补偿值;范围变量确定单元,被配置为根据所述补偿值确定所述范围变量的取值。
在本申请的一些实施例中,基于以上各实施例,所述前缀值解码单元包括:截断值确定子单元,被配置为根据区间个数和最后一个索引区间的区间下限确定截断值;前缀值解码子单元,被配置为基于所述截断值,按照截断一元码的方式在所述编码块的码流中进行熵解码和反二值化得到前缀值。
在本申请的一些实施例中,基于以上各实施例,所述前缀值解码单元被配置为:通过CABAC解码方式对所述编码块的码流进行解码得到前缀值。
在本申请的一些实施例中,基于以上各实施例,所述范围变量确定单元包括:第一变量赋值子单元,被配置为若所述目标索引区间为第一个索引区间,则以所述补偿值为所述范围变量赋值;第二变量赋值子单元,被配置为若所述目标索引区间是除所述第一个索引区间以外的其他索引区间,则在所述编码块的码流中解码得到后缀值,并以所述补偿值与所述后缀值的和为所述范围变量赋值。
在本申请的一些实施例中,基于以上各实施例,所述第二变量赋值子单元还被配置为:根据所述目标索引区间的区间上限和区间下限在所述编码块的码流中确定待解码的二元符号的目标数量;在所述编码块的码流中对目标数量的二元符号进行熵解码;以所述目标数量作为定长码的长度len,按照len位定长码的方式对熵解码结果进行反二值化得到后缀值。
在本申请的一些实施例中,基于以上各实施例,所述第二变量赋值子单元还被配置为:从多个候选解码方法中选取目标解码方法;按照所述目标解码方法在所述编码块的码流中解码得到后缀值。
在本申请的一些实施例中,基于以上各实施例,所述变量解码模块1220包括:解码方法选取单元,被配置为从多个候选解码方法中选取目标解码方法;目标方法解码单元,被配置为按照所述目标解码方法在所述编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值。
在本申请的一些实施例中,基于以上各实施例,所述多个候选解码方法包括如下解码方法中的至少一种:基于截断一元码的解码方法;基于一元码的解码方法;基于len位定长码的解码方法;基于k阶指数哥伦布码的解码方法。
在本申请的一些实施例中,基于以上各实施例,所述视频解码装置1200应用于满足以下条件中的任意一个的编码块:变换跳过模式的编码块;图像级帧内预测变换跳过允许标志值为1的编码块;图像级帧间预测变换跳过允许标志值为1的编码块;图像级帧内预测变换跳过允许标志值和图像级帧间预测变换跳过允许标志值均为1的编码块;所有编码块。
图13示出了本申请一个实施例中的视频编码装置的结构框图。如图13所示,视频编码装置1300主要可以包括:尺寸获取模块1310,被配置为获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;坐标获取模块1320,被配置为获取所述编码块的基于扫描区域的系数编码SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度的右端横坐标以及对应于所述高度的下端纵坐标;变量编码模块1330,被配置为根据所述编码块的尺寸和所述边界坐标的差值确定与所述SRCC扫描区域相关的范围变量的取值,并对所述范围变量进行编码,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量。
本申请各实施例中提供的视频解码装置的具体细节已经在对应的方法实施例中进行了详细的描述,此处不再赘述。
在本申请实施例提供的技术方案中,根据SRCC扫描区域的边界坐标的统计特性,提出了一种针对SRCC扫描区域边界坐标的编解码方法,即不直接对SRCC扫描区域右端横坐标和下端纵坐标进行编码,而是编码与边界坐标以及编码块的尺寸相关的范围变量。在解码时,先从码流里解码并推导出范围变量的值,随后即可求得SRCC扫描区域的边界坐标。本申请实施例提供的编解码方法能够减少编码所需比特数,有助于提升系数编码的编解码效率,从而进一步提升视频压缩性能。
图14示意性地示出了用于实现本申请实施例的电子设备的计算机系统结构框图。
需要说明的是,图14示出的电子设备的计算机系统1400仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图14所示,计算机系统1400包括中央处理器1401(Central Processing Unit,CPU),其可以根据存储在只读存储器1402(Read-Only Memory,ROM)中的程序或者从存储部分1408加载到随机访问存储器1403(Random Access Memory,RAM)中的程序而执行各种适当的动作和处理。在随机访问存储器1403中,还存储有系统操作所需的各种程序和数据。中央处理器1401、只读存储器1402以及随机访问存储器1403通过总线1404彼此相连。输入/输出接口1405(Input/Output接口,即I/O接口)也连接至总线1404。
以下部件连接至输入/输出接口1405:包括键盘、鼠标等的输入部分1406;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分1407;包括硬盘等的存储部分1408;以及包括诸如局域网卡、调制解调器等的网络接口卡的通信部分1409。通信部分1409经由诸如因特网的网络执行通信处理。驱动器1410也根据需要连接至输入/输出接口1405。可拆卸介质1411,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1410上,以便于从其上读出的计算机程序根据需要被安装入存储部分1408。
特别地,根据本申请的实施例,各个方法流程图中所描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1409从网络上被下载和安装,和/或从可拆卸介质1411被安装。在该计算机程序被中央处理器1401执行时,执行本申请的系统中限定的各种功能。
需要说明的是,本申请实施例所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是,但不限于,电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可 以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台计算设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本申请实施方式的方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。

Claims (27)

  1. 一种视频解码方法,由电子设备执行,其特征在于,包括:
    获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;
    从所述编码块的码流中解码得到与所述编码块的基于扫描区域的系数编码SRCC扫描区域相关的范围变量的取值,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量;
    根据所述编码块的尺寸和所述范围变量之间的差值,确定所述SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度范围变量的右端横坐标以及对应于所述高度范围变量的下端纵坐标。
  2. 根据权利要求1所述的视频解码方法,其特征在于,根据所述编码块的尺寸和所述范围变量的差值确定所述SRCC扫描区域的边界坐标,包括:
    按照如下公式确定所述SRCC扫描区域的边界坐标;
    SRx=width-1-width_minus1_minus_scan_region_x;
    SRy=height-1-height_minus1_minus_scan_region_y;
    其中,SRx为所述右端横坐标,SRy为所述下端纵坐标,width为所述宽度,height为所述高度,width_minus1_minus_scan_region_x为所述宽度范围变量,height_minus1_minus_scan_region_y为所述高度范围变量。
  3. 根据权利要求1所述的视频解码方法,其特征在于,从所述编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值,包括:
    在所述编码块的码流中,按照索引号递增的顺序依次对所述索引号对应的二元符号进行解码得到所述二元符号的取值;
    若当前二元符号的取值为预设的第一数值,则以所述当前二元符号对应的当前索引号为位置变量赋值;
    根据所述位置变量的取值对与所述编码块的SRCC扫描区域相关的范围变量进行赋值。
  4. 根据权利要求3所述的视频解码方法,其特征在于,根据所述位置变量的取值对与所述编码块的SRCC扫描区域相关的范围变量进行赋值,包括:
    将所述位置变量的取值与预设的第二数值进行比较;
    若所述位置变量的取值小于或等于所述第二数值,则以所述第二数值为所述范围变量赋值;
    若所述位置变量的取值大于所述第二数值,则根据所述位置变量的取值确定前缀值,并根据所述当前二元符号之后的其他二元符号的解码结果确定后缀值;
    以所述前缀值和所述后缀值的和为所述范围变量赋值。
  5. 根据权利要求4所述的视频解码方法,其特征在于,根据所述位置变量的取值确定前缀值,包括:
    根据第一映射向量对所述位置变量的取值进行映射处理,得到与所述位置变量的取值相对应的第一映射值;
    根据所述第一映射值确定前缀值。
  6. 根据权利要求4所述的视频解码方法,其特征在于,根据所述当前二元符号之后的其他二元符号的解码结果确定后缀值,包括:
    根据所述位置变量的取值确定待解码的其他二元符号的目标数量;
    对所述当前二元符号之后的目标数量个其他二元符号进行解码得到后缀值。
  7. 根据权利要求6所述的视频解码方法,其特征在于,对所述当前二元符号之后的目标数量个其他二元符号进行解码得到后缀值,包括:
    按照旁路解码的方式对所述当前二元符号之后的目标数量个其他二元符号进行熵解码;
    以所述目标数量作为定长码的长度len,按照len位定长码的方式对熵解码结果进行反二值化得到后缀值。
  8. 根据权利要求3所述的视频解码方法,其特征在于,按照索引号递增的顺序依次对所述索引号对应的二元符号进行解码得到所述二元符号的取值,包括:
    为所述二元符号对应的上下文索引增量赋值;
    根据赋值得到的上下文索引增量确定与所述二元符号相对应的上下文模型;
    基于所述上下文模型,通过基于上下文的自适应二进制算术编码CABAC解码引擎,对所述二元符号进行算数解码得到所述二元符号的取值。
  9. 根据权利要求8所述的视频解码方法,其特征在于,为所述二元符号对应的上下文索引增量赋值,包括:
    以所述二元符号对应的索引号为上下文索引增量赋值。
  10. 根据权利要求8所述的视频解码方法,其特征在于,为所述二元符号对应的上下文索引增量赋值,包括:
    根据所述编码块的通道信息为所述上下文索引增量的初始值赋值;
    根据所述编码块的通道信息以及所述编码块的尺寸确定位移量;
    根据所述初始值、所述索引号以及所述位移量确定对所述二元符号对应的上下文索引增量进行赋值。
  11. 根据权利要求10所述的视频解码方法,其特征在于,所述根据所述编码块的通道信息为所述上下文索引增量的初始值赋值,包括:
    若所述编码块为亮度块,则以预设的第三数值为所述上下文索引增量的初始值赋值;
    若所述编码块为色度块,则确定与所述编码块的尺寸相关的第四数值,并在所述第三数值的基础上增大所述第四数值后为所述上下文索引增量的初始值赋值。
  12. 根据权利要求11所述的视频解码方法,其特征在于,确定与所述编码块的尺寸相关的第四数值,包括:
    根据第二映射向量对所述编码块的尺寸进行映射处理,得到与所述编码块的尺寸相对应的第二映射值;
    以所述第二映射值作为与所述编码块的尺寸相关的第四数值。
  13. 根据权利要求10所述的视频解码方法,其特征在于,所述根据所述编码块的通道信息以及所述编码块的尺寸确定位移量,包括:
    若所述编码块为亮度块,按照公式shift_x=clip3(0,2,(logV+1)>>2)确定位移量,其中shift_x为位移量,V为所述编码块的尺寸;
    若所述编码块为色度块,按照公式shift_x=clip3(0,2,(T>>3))确定位移量,其中shift_x为位移量,T为所述编码块的尺寸。
  14. 根据权利要求1所述的视频解码方法,其特征在于,从所述编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值,包括:
    确定多个连续的由整数组成的索引区间,所述索引区间包括区间下限和区间上限;
    在所述编码块的码流中解码得到前缀值;
    根据所述前缀值与索引阈值的数值关系确定所述范围变量的取值所在的目标索引区间,所述索引阈值为第一个索引区间的区间上限;
    根据所述目标索引区间的区间下限确定补偿值;
    根据所述补偿值确定所述范围变量的取值。
  15. 根据权利要求14所述的视频解码方法,其特征在于,所述在所述编码块的码流中解码得到前缀值,包括:
    根据区间个数和最后一个索引区间的区间下限确定截断值;
    基于所述截断值,按照截断一元码的方式在所述编码块的码流中进行熵解码和反二值化得到前缀值。
  16. 根据权利要求14所述的视频解码方法,其特征在于,所述在所述编码块的码流中解码得到前缀值,包括:
    通过CABAC解码方式对所述编码块的码流进行解码得到前缀值。
  17. 根据权利要求14所述的视频解码方法,其特征在于,根据所述补偿值确定所述范围变量的取值,包括:
    若所述目标索引区间为第一个索引区间,则以所述补偿值为所述范围变量赋值;
    若所述目标索引区间是除所述第一个索引区间以外的其他索引区间,则在所述编码块的码 流中解码得到后缀值,并以所述补偿值与所述后缀值的和为所述范围变量赋值。
  18. 根据权利要求17所述的视频解码方法,其特征在于,在所述编码块的码流中解码得到后缀值,包括:
    根据所述目标索引区间的区间上限和区间下限在所述编码块的码流中确定待解码的二元符号的目标数量;
    在所述编码块的码流中对目标数量的二元符号进行熵解码;
    以所述目标数量作为定长码的长度len,按照len位定长码的方式对熵解码结果进行反二值化得到后缀值。
  19. 根据权利要求17所述的视频解码方法,其特征在于,在所述编码块的码流中解码得到后缀值,包括:
    从多个候选解码方法中选取目标解码方法;
    按照所述目标解码方法在所述编码块的码流中解码得到后缀值。
  20. 根据权利要求1所述的视频解码方法,其特征在于,从所述编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值,包括:
    从多个候选解码方法中选取目标解码方法;
    按照所述目标解码方法在所述编码块的码流中解码得到与SRCC扫描区域相关的范围变量的取值。
  21. 根据权利要求19或20所述的视频解码方法,其特征在于,所述多个候选解码方法包括如下解码方法中的至少一种:
    基于截断一元码的解码方法;
    基于一元码的解码方法;
    基于len位定长码的解码方法;
    基于k阶指数哥伦布码的解码方法。
  22. 根据权利要求1至20中任意一项所述的视频解码方法,其特征在于,所述方法应用于满足以下条件中的任意一个的编码块:
    变换跳过模式的编码块;
    图像级帧内预测变换跳过允许标志值为1的编码块;
    图像级帧间预测变换跳过允许标志值为1的编码块;
    图像级帧内预测变换跳过允许标志值和图像级帧间预测变换跳过允许标志值均为1的编码块;
    所有编码块。
  23. 一种视频编码方法,由电子设备执行,其特征在于,包括:
    获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;
    获取所述编码块的基于扫描区域的系数编码SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度的右端横坐标以及对应于所述高度的下端纵坐标;
    根据所述编码块的尺寸和所述边界坐标之间的差值,确定与所述SRCC扫描区域相关的范围变量的取值,并对所述范围变量进行编码,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量。
  24. 一种视频解码装置,其特征在于,包括:
    尺寸获取模块,被配置为获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编码块的宽度和高度;
    变量解码模块,被配置为从所述编码块的码流中解码得到与所述编码块的基于扫描区域的系数编码SRCC扫描区域相关的范围变量的取值,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量;
    坐标确定模块,被配置为根据所述编码块的尺寸和所述范围变量之间的差值,确定所述SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度范围变量的右端横坐标以及对应于所述高度范围变量的下端纵坐标。
  25. 一种视频编码装置,其特征在于,包括:
    尺寸获取模块,被配置为获取视频图像帧的编码块的尺寸,所述编码块的尺寸包括所述编 码块的宽度和高度;
    坐标获取模块,被配置为获取所述编码块的基于扫描区域的系数编码SRCC扫描区域的边界坐标,所述边界坐标包括对应于所述宽度的右端横坐标以及对应于所述高度的下端纵坐标;
    变量编码模块,被配置为根据所述编码块的尺寸和所述边界坐标之间的差值,确定与所述SRCC扫描区域相关的范围变量的取值,并对所述范围变量进行编码,所述范围变量包括对应于所述宽度的宽度范围变量以及对应于所述高度的高度范围变量。
  26. 一种计算机可读介质,其上存储有计算机程序,该计算机程序被处理器执行时实现权利要求1至23中任意一项所述的方法。
  27. 一种电子设备,其特征在于,包括:
    处理器;以及
    存储器,用于存储所述处理器的可执行指令;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至23中任意一项所述的方法。
PCT/CN2021/131617 2021-02-22 2021-11-19 视频编解码方法、装置、计算机可读介质及电子设备 WO2022174638A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/978,092 US20230061939A1 (en) 2021-02-22 2022-10-31 Coding efficiency of boundary coordinates of srcc scan region

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110199310.0 2021-02-22
CN202110199310.0A CN114979642A (zh) 2021-02-22 2021-02-22 视频编解码方法、装置、计算机可读介质及电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/978,092 Continuation US20230061939A1 (en) 2021-02-22 2022-10-31 Coding efficiency of boundary coordinates of srcc scan region

Publications (1)

Publication Number Publication Date
WO2022174638A1 true WO2022174638A1 (zh) 2022-08-25

Family

ID=82930281

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/131617 WO2022174638A1 (zh) 2021-02-22 2021-11-19 视频编解码方法、装置、计算机可读介质及电子设备

Country Status (3)

Country Link
US (1) US20230061939A1 (zh)
CN (1) CN114979642A (zh)
WO (1) WO2022174638A1 (zh)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108293139A (zh) * 2015-09-08 2018-07-17 三星电子株式会社 用于熵编码和熵解码的设备和方法
WO2019045538A1 (ko) * 2017-09-04 2019-03-07 삼성전자 주식회사 부호화 방법 및 그 장치, 복호화 방법 및 그 장치
CN111727606A (zh) * 2018-01-02 2020-09-29 三星电子株式会社 视频解码方法及其装置和视频编码方法及其装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108293139A (zh) * 2015-09-08 2018-07-17 三星电子株式会社 用于熵编码和熵解码的设备和方法
WO2019045538A1 (ko) * 2017-09-04 2019-03-07 삼성전자 주식회사 부호화 방법 및 그 장치, 복호화 방법 및 그 장치
CN111727606A (zh) * 2018-01-02 2020-09-29 三星电子株式会社 视频解码方法及其装置和视频编码方法及其装置

Also Published As

Publication number Publication date
CN114979642A (zh) 2022-08-30
US20230061939A1 (en) 2023-03-02

Similar Documents

Publication Publication Date Title
WO2022078163A1 (zh) 视频解码方法、视频编码方法及相关装置
WO2022078304A1 (zh) 视频解码方法、装置、计算机可读介质、程序及电子设备
WO2022063033A1 (zh) 视频解码方法、视频编码方法、装置、计算机可读介质及电子设备
WO2022062880A1 (zh) 视频解码方法、装置、计算机可读介质及电子设备
WO2022116836A1 (zh) 视频解码方法、视频编码方法、装置及设备
WO2022174660A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
CN113207002B (zh) 视频编解码方法、装置、计算机可读介质及电子设备
US20230053118A1 (en) Video decoding method, video coding method, and related apparatus
WO2022174638A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2022174637A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2022037478A1 (zh) 视频解码方法、视频编码方法、装置、介质及电子设备
US20230077935A1 (en) Video Encoding Method and Apparatus, Video Decoding Method and Apparatus, Computer-Readable Medium, and Electronic Device
WO2022116854A1 (zh) 视频解码方法、装置、可读介质、电子设备及程序产品
CN114079772B (zh) 视频解码方法、装置、计算机可读介质及电子设备
WO2022174701A1 (zh) 视频编解码方法、装置、计算机可读介质及电子设备
WO2022037464A1 (zh) 视频解码方法、视频编码方法、装置、设备及存储介质
WO2023130899A1 (zh) 环路滤波方法、视频编解码方法、装置、介质及电子设备
CN115209146A (zh) 视频编解码方法、装置、计算机可读介质及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21926352

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 18/01/2024)