WO2022063033A1 - Video decoding method and apparatus, video coding method and apparatus, computer-readable medium, and electronic device - Google Patents

Video decoding method and apparatus, video coding method and apparatus, computer-readable medium, and electronic device Download PDF

Info

Publication number
WO2022063033A1
WO2022063033A1 PCT/CN2021/118810 CN2021118810W WO2022063033A1 WO 2022063033 A1 WO2022063033 A1 WO 2022063033A1 CN 2021118810 W CN2021118810 W CN 2021118810W WO 2022063033 A1 WO2022063033 A1 WO 2022063033A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
block
quantization
coding
video
Prior art date
Application number
PCT/CN2021/118810
Other languages
French (fr)
Chinese (zh)
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 WO2022063033A1 publication Critical patent/WO2022063033A1/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/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
    • 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/12Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
    • 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/124Quantisation

Definitions

  • the present application relates to the field of computer and communication technologies, and in particular, to a video decoding method, a video encoding method, an 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. Due to the diversity of residual data, a single Discrete Cosine Transform (DCT) transform kernel cannot adapt to all residual characteristics. Therefore, multiple DCT transform kernels or discrete sine transform (Discrete Sine Transform) may need to be selected for a residual block. Sine Transform, DST) transformation kernel is used as a transformation matrix combination. In this case, although the adaptability of the transformation matrix combination to the residual block is improved, the transformation kernel needs to be encoded for each coding unit (Coding Unit, CU). index, thus resulting in low coding and decoding efficiency.
  • CU Coding Unit
  • the embodiment of the present application provides a video decoding method, including:
  • Entropy decoding is performed on the coding block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coding block;
  • Inverse transform processing is performed on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
  • the embodiment of the present application provides a video encoding method, including:
  • Entropy coding is performed on the quantized coefficients to obtain coding blocks.
  • Embodiments of the present application provide a video decoding apparatus, including:
  • a decoding unit configured to perform entropy decoding processing on an encoding block of a video image frame to obtain a quantized coefficient block of residual data corresponding to the encoding block;
  • a statistical unit configured to perform statistical processing on the quantization coefficients in multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of each of the multiple regions, and to determine that the statistical results of the respective regions are relative to the set value the remainder;
  • a selection unit configured to select the transformation matrix combination corresponding to the coding block according to the remainder of the respective regions
  • the processing unit is configured to perform inverse transformation processing on the inverse quantization result of the quantized coefficient block based on the selected transformation matrix combination.
  • An embodiment of the present application provides a video encoding device, including:
  • a residual unit configured to determine residual data between the original image signal of the video frame image and the predicted image signal
  • a transformation unit configured to perform transformation processing on the residual data based on the transformation matrix combination to obtain a transformation result
  • a quantization unit configured to perform quantization processing on the transformation result to obtain a quantization coefficient; wherein the quantization coefficient is used to indicate the transformation matrix combination;
  • an encoding unit configured to perform entropy encoding processing on the quantized coefficients to obtain an encoding block.
  • Embodiments of the present application provide a computer-readable medium storing a computer program, and when the computer program is executed by a processor, the video decoding method or the video encoding method described in the foregoing embodiments is implemented.
  • An embodiment of the present application provides an electronic device, including: one or more processors; and a storage device for storing one or more computer programs, when the one or more computer programs are processed by the one or more computer programs When the processor is executed, the one or more processors are caused to implement the video decoding method or the video encoding method as described in the above embodiments.
  • Embodiments of the present application provide 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 medium.
  • the processor of the electronic device reads the computer instructions from the computer-readable medium, and the processor executes the computer instructions, so that the electronic device executes the video decoding method or the video encoding method provided in the above embodiments.
  • 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 a placement manner of a video encoding device and a video decoding device in a streaming transmission system
  • Fig. 3 shows the basic flow chart of video encoder
  • Fig. 4 shows the scanning area marked by scanning area coefficient coding technique
  • Fig. 5 shows the sequence schematic diagram of scanning the marked scanning area
  • FIG. 6A shows a flowchart of a video encoding method provided by an embodiment of the present application
  • 6B shows a flowchart of a video decoding method provided by an embodiment of the present application
  • FIG. 7 shows a schematic diagram of a division manner of a designated area provided by an embodiment of the present application.
  • FIG. 8 shows a schematic diagram of a division manner of a designated area provided by an embodiment of the present application.
  • FIG. 9 shows a schematic diagram of a division manner of a designated area provided by an embodiment of the present application.
  • FIG. 10 shows a block diagram of a video decoding apparatus provided by an embodiment of the present application.
  • FIG. 11 shows a schematic structural diagram of a computer system suitable for implementing the electronic device according to 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 electronic devices that can communicate with each other through, for example, a network 150 .
  • system architecture 100 may include first electronic device 110 and second electronic device 120 interconnected by network 150 .
  • the first electronic device 110 and the second electronic device 120 perform one-way data transmission.
  • the first electronic device 110 may encode video data (eg, a video image stream captured by the first electronic device 110 ) and transmit it to the second electronic device 120 through the network 150 , and the encoded video data may be encoded in one or It is transmitted in the form of multiple encoded video streams.
  • the second electronic device 120 may receive encoded video data from the network 150, decode the encoded video data to restore the video data, and display a video image according to the restored video data.
  • the system architecture 100 may include a third electronic device 130 and a fourth electronic device 140 that perform bidirectional transmission of encoded video data, such as may occur during a video conference.
  • each of the third electronic device 130 and the fourth electronic device 140 may encode video data (eg, a stream of video images captured by the electronic device) and transmit to the third electronic device through the network 150 130 and the other electronic device of the fourth electronic device 140 .
  • Each of the third electronic device 130 and the fourth electronic device 140 may also receive encoded video data transmitted by the other electronic device of the third electronic device 130 and the fourth electronic device 140, and may The video data is decoded to recover the video data, and a video image can be displayed on an accessible display device based on the recovered video data.
  • the involved electronic devices may be servers or terminal devices, where the server may be An independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, Domain name service, security service, Content Delivery Network (CDN), and cloud server for basic cloud computing services such as big data and artificial intelligence platforms; terminal devices can be personal computers, smart phones, laptop computers, tablet computers , media players, dedicated video conferencing equipment, etc., but not limited to this.
  • the server may be An independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, Domain name service, security service, Content Delivery Network (CDN), and cloud server for basic cloud computing services such as big data and artificial intelligence platforms
  • terminal devices can be personal computers, smart phones, laptop computers, tablet computers , media players, dedicated video conferencing equipment, etc., but not limited to this.
  • Network 150 represents any number of networks, such as wired and/or wireless communication networks, that communicate encoded video data between first electronic device 110 , second electronic device 120 , third electronic device 130 , and fourth electronic device 140 .
  • Network 150 may exchange data in circuit-switched and/or packet-switched channels.
  • the network 150 may include at least one of a telecommunications network, a local area network, a wide area network, and the Internet.
  • the architecture and topology of the network 150 may be irrelevant to the operations disclosed by the embodiments of the present application.
  • Figure 2 illustrates the placement of a video encoding device and a video decoding device in a streaming environment.
  • the subject matter disclosed in the embodiments of the present application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (TeleVision, TV), storage of compressed video on digital media including CDs, DVDs, memory sticks, etc. .
  • 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 201 creates an uncompressed video image stream 202 .
  • the video image stream 202 includes samples captured by a digital camera.
  • the video image stream 202 is depicted as a thick line in FIG. 2 to emphasize the high data volume of the video image stream 202, which can be Processing is performed by electronic device 220 , which includes video encoding means 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 the encoded video code stream 204) is depicted as a thin line in FIG. 2 to emphasize the lower data volume of the encoded video data 204, wherein, The encoded video data 204 may 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 204 and produces an output video image stream 211 that can be presented on a display 212 (eg, a display screen) or other presentation device.
  • the encoded video data 204, video data 207, and video data 209 may be encoded according to certain video encoding/compression standards, including but not limited to ITU-T H.265.
  • the video coding standard under development is informally referred to as Versatile Video Coding (VVC), and the embodiments of the present application may be used in the context of the VVC standard.
  • VVC Versatile Video Coding
  • electronic device 220 and 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 include a video encoding device.
  • high efficiency video coding High Efficiency Video Coding, HEVC
  • Versatile Video Coding Very Video Coding, VVC
  • other international video coding standards as well as China's national video coding standard Source coding standard ( Audio Video coding Standard, AVS) as an example
  • AVS Audio Video coding Standard
  • 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 transformation operations such as Discrete Fourier Transform (DFT) and DCT, the signal is converted into the transform domain, which is called transform coefficients. 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. In some video coding standards, there may be more than one transformation mode to choose from, so the encoder also needs to select one of the transformation modes for the current CU and inform the decoder. The fineness of quantization is usually determined by the Quantization Parameter (QP). The larger the value of QP, the more coefficients representing a larger value range will be quantized into the same output, which usually leads to greater distortion and higher quantization. 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.
  • QP Quantization Parameter
  • 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 bit rate required to express the same signal. Common statistical coding methods include Variable Length Coding (VLC) or context-based binary arithmetic coding (Content Coding). Adaptive Binary Arithmetic Coding, CABAC).
  • 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, It 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, in which intra-frame prediction is used as an example.
  • the original image signal s k [x, y] of the video frame image is combined with the predicted image signal Do the difference operation to obtain the residual signal u k [x, y], and the residual signal u k [x, y] is transformed and quantized to obtain quantized coefficients.
  • 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 video frame image for motion estimation and motion compensation prediction.
  • the intra prediction result Get the predicted image signal of the next frame of video frame image And continue to repeat the above process until the encoding is complete.
  • Coefficient coding SRCC technology through SRCC technology, the size of the upper left region containing non-zero coefficients in each quantized coefficient block (size W ⁇ H) can be marked SRx ⁇ SRy, where SRx is the rightmost non-zero coefficient in the quantized coefficient block The abscissa of SRy is the ordinate of the lowest non-zero coefficient in the quantized coefficient block, and 1 ⁇ SRx ⁇ W, 1 ⁇ SRy ⁇ H, and the coefficients outside this area are all 0.
  • the SRCC technology uses (SRx, SRy) to determine the quantized coefficient area that needs to be scanned in a quantized coefficient block. 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 compressed code stream ie bit stream
  • entropy decoding is performed to obtain various mode information and quantization coefficients. 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.
  • transform kernels such as DST7 and DCT8 can be introduced into the transformation process, and the horizontal transform and Vertical transforms can use different transform kernels.
  • the possible combinations of transforms that can be selected for transforming a residual signal are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7) ), (DST7, DCT8) and (DST7, DST7).
  • rate-distortion optimization (Rate-Distortion Optimization, RDO) can be used at the encoding end to make a decision.
  • RDO rate-distortion optimization
  • multiple transformation kernels are used to improve the adaptability of the transformation matrix combination to the residual block, but Since the index of the transform kernel needs to be encoded for each coding unit, the encoding and decoding efficiency is low.
  • the embodiments of the present application propose to use the quantization coefficients in the quantization coefficient block to implicitly indicate the transformation matrix combination corresponding to the coding block, thereby reducing the bits occupied by the transformation matrix index and effectively improving the video coding and decoding efficiency.
  • FIG. 6A shows a flowchart of a video encoding method according to an embodiment of the present application.
  • the video encoding method may be executed by an electronic device with a computing processing function, such as a terminal device or a server.
  • a computing processing function such as a terminal device or a server.
  • the video encoding method at least includes steps S510 to S540, and the details are as follows:
  • step S510 residual data between the original image signal and the predicted image signal of the video frame image is determined.
  • step S520 transform processing is performed on the residual data based on the transform matrix combination to obtain a transform result.
  • step S530 the transform result is quantized to obtain quantized coefficients; wherein, the quantized coefficients are used to indicate the combination of transform matrices.
  • step S540 entropy coding is performed on the quantized coefficients to obtain coding blocks.
  • FIG. 6B shows a flowchart of a video decoding method according to an embodiment of the present application.
  • the video decoding method may be executed by an electronic device with a computing processing function, such as a terminal device or a server.
  • the video decoding method includes at least steps S610 to S640, which are described in detail as follows:
  • step S610 entropy decoding processing is performed on the coded block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coded block.
  • the video image frame sequence includes a series of images, each image can be further divided into slices, and the slices can be divided into a series of LCUs (or CTUs), and the LCUs include several CUs .
  • the video image frame is coded in block units.
  • a macroblock MB
  • the macroblock can be further divided into multiple blocks that can be used for Prediction block (prediction) for predictive coding.
  • prediction 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 statistical processing is performed on the quantization coefficients in the multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of each of the multiple regions, and determine the remainder of the statistical results of each region to the set value.
  • the multiple regions refer to at least two regions, and the multiple regions may be all the regions in the quantized coefficient block, or may be part of the regions in the quantized coefficient block.
  • the value of the index identifier corresponding to the coding block it can be determined whether the coding block in the corresponding coded data needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
  • entropy decoding processing can be performed on the coding block to obtain the residual data corresponding to the coding block. Quantized coefficient block.
  • the specified index identifier may include at least one of the following: the sequence header of the first encoded data corresponding to the video image frame sequence, the image header of the second encoded data corresponding to the video image frame, and the first encoded data corresponding to a slice of the video image frame.
  • the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence may be used to indicate whether the encoded block in the first encoded data needs a quantization coefficient block obtained by entropy decoding
  • the quantization coefficients in select the corresponding transformation matrix combination. For example, when the value of the specified index identifier in the sequence header of the first encoded data is 1, it indicates that the target encoding block in the first encoded data needs to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding combination.
  • the technical solution of this embodiment enables the indication of all target coding blocks corresponding to the entire video image frame sequence through an index identifier in the sequence header of the first encoded data corresponding to the video image frame sequence, thereby effectively reducing the index Identifies the occupied bits to improve the efficiency of video encoding and decoding.
  • the target coding block in the first coded data may be all coding blocks in the first coded data (that is, coding blocks using any coding mode), or may be coding using the intra-frame coding mode in the first coded data
  • the block may also be an encoding block in the first encoded data that adopts the inter-frame encoding mode.
  • the value of the index identifier included in the image header of the second encoded data corresponding to the video image frame may be used to indicate whether the encoded block in the second encoded data needs a quantization coefficient block obtained by entropy decoding
  • the quantization coefficients in select the corresponding transformation matrix combination. For example, when the value of the specified index flag in the image header of the second coded data is 1, it means that the target coding block in the second coded data needs to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding combination.
  • the technical solution of this embodiment enables the indication of all target coding blocks corresponding to the entire video image frame through an index identifier in the image header of the second encoded data corresponding to the video image frame, which can also reduce the occupation of the index identifier. bits to improve the efficiency of video encoding and decoding.
  • the target coding block in the second coded data may be all coding blocks in the second coded data, may be coding blocks in the second coded data using the intra-frame coding mode, or may be the coding blocks in the second coded data. Coding block in inter coding mode.
  • the value of the index identifier included in the slice header information of the third encoded data corresponding to one slice of the video image frame may be used to indicate whether the encoding block in the third encoded data needs to be based on entropy
  • the quantized coefficients in the decoded quantized coefficient block select the corresponding transformation matrix combination. For example, when the value of the specified index identifier in the slice header information of the third encoded data is 1, it means that the target encoding block in the third encoded data needs to select the corresponding quantization coefficient according to the quantization coefficient block in the quantization coefficient block obtained by entropy decoding. Transformation matrix combination.
  • the technical solution of this embodiment makes it possible to realize the indication of all target coding blocks corresponding to the entire slice through an index identifier in the slice header of the third encoded data corresponding to one slice of the video image frame, which can also reduce the The index identifies the occupied bits, which improves the video coding and decoding efficiency.
  • the target coding blocks in the third coded data may be all coding blocks in the third coded data, may be coding blocks in the third coded data using the intra-frame coding mode, or may be the coding blocks in the third coded data. Coding block in inter coding mode.
  • the value of the index identifier included in the LCU header information of the fourth encoded data corresponding to one LCU of the video image frame may be used to indicate whether the encoded block in the fourth encoded data needs to be obtained according to entropy decoding.
  • the quantization coefficients in the quantization coefficient block select the corresponding transformation matrix combination. For example, when the value of the specified index identifier in the LCU header information of the fourth encoded data is 1, it means that the target encoding block in the fourth encoded data needs to select the corresponding transform according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding matrix combination.
  • the technical solution of this embodiment enables an index identification in the LCU header information of the fourth encoded data corresponding to one LCU of the video image frame to realize the indication of all target encoding blocks corresponding to the entire LCU, and the index identification can also be reduced.
  • the occupied bits can improve the efficiency of video coding and decoding.
  • the target coding blocks in the fourth coded data may be all coding blocks in the fourth coded data, may be coding blocks in the fourth coded data using the intra-frame coding mode, or may be the coding blocks in the fourth coded data. Coding block in inter coding mode.
  • the size of the coding block is small (for example, smaller than the first preset threshold), it can be determined that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding;
  • the size of the block is larger (for example, larger than the second preset threshold), it can be determined that the encoding block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding, wherein the first preset threshold and The second preset threshold constitutes a preset threshold range, and the second preset threshold is greater than or equal to the first preset threshold.
  • the technical solution of this embodiment can implicitly indicate whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding according to the size of the coding block, without additional bits, so it can also improve the video coding and decoding. effectiveness.
  • the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence is the first value (for example, it may be 0)
  • determine the target encoding block in the first encoded data It is not necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the index identifier included in the sequence header is the second value (for example, it can be 1), it can be further based on the video image. The decision is made based on the value of the index identifier included in the image header of the second encoded data corresponding to the video image frame in the frame sequence.
  • the target coding blocks in the first coded data may be all coding blocks in the first coded data, may be coding blocks in the first coded data using the intra-frame coding mode, or may be the coding blocks in the first coded data. Coding block in inter coding mode.
  • the value of the index identifier included in the foregoing sequence header is the second value (for example, it may be 1)
  • the value of the index identifier included in the foregoing image header is the first value (for example, it may be When it is 0)
  • it can be determined that the target coding block in the second coded data does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
  • the value of the index identifier included in the foregoing sequence header and the value of the index identifier included in the foregoing image header are both the second value (for example, it may be 1), then the target code in the second encoded data can be determined.
  • the block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding. In this case, the decision can no longer be made by the slice header information, the LCU header information and the size of the coding block.
  • the target coding block in the second coded data may be all coding blocks in the second coded data, may be coding blocks in the second coded data using the intra-frame coding mode, or may be the coding blocks in the second coded data. Coding block in inter coding mode.
  • the value of the index identifier included in the foregoing sequence header and the value of the index identifier included in the foregoing image header are both the second value (for example, it may be 1), then it is also possible to The decision is further made according to the value of the index identifier included in the slice header information of the third encoded data corresponding to the slice of the video image frame.
  • the value of the index identifier included in the foregoing sequence header is the second value
  • the value of the index identifier included in the foregoing image header is the second value
  • the slice header of the third encoded data corresponding to one slice is
  • the value of the index identifier included in the information is the first value (for example, it can be 0)
  • it can be determined that the target coding block in the third coded data does not need to select the corresponding transform according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding matrix combination.
  • the target encoding block in the third encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. size decision.
  • the target coding blocks in the third coded data may be all coding blocks in the third coded data, may be coding blocks in the third coded data using the intra-frame coding mode, or may be the coding blocks in the third coded data. Coding block in inter coding mode.
  • the decision may be further based on the value of the index identifier included in the LCU header information of the fourth encoded data corresponding to the LCU in the slice.
  • the value of the index identifier included in the preceding sequence header, the value of the index identifier included in the preceding image header, and the value of the index identifier included in the preceding slice header information are all second values, but one LCU corresponds to
  • the value of the index identifier contained in the LCU header information of the fourth encoded data is the first value (for example, it may be 0), then it can be determined that the target encoding block in the fourth encoded data does not need to be decoded according to entropy.
  • the obtained quantization coefficient block The quantization coefficients in select the corresponding transformation matrix combination.
  • the value of the index identifier included in the aforementioned sequence header, the value of the index identifier included in the aforementioned image header, the value of the index identifier included in the aforementioned slice header information, and the value of the index identifier included in the aforementioned LCU header information is the second value (for example, it can be 1), then it can be determined that the target coding block in the fourth coded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. In this case In this case, the decision can no longer be made by the size of the coding block.
  • the target coding blocks in the fourth coded data may be all coding blocks in the fourth coded data, may be coding blocks in the fourth coded data using the intra-frame coding mode, or may be the coding blocks in the fourth coded data. Coding block in inter coding mode.
  • the value of the index identifier included in the foregoing sequence header when the value of the index identifier included in the foregoing sequence header, the value of the index identifier included in the foregoing image header, the value of the index identifier included in the foregoing slice header information, and the foregoing value of the index identifier
  • the value of the index identifier included in the LCU header information is all the second value (for example, it may be 1), the decision may be further made according to the size of the coding block.
  • the value of the index identifier contained in the preceding sequence header, the value of the index identifier contained in the preceding image header, the value of the index identifier contained in the preceding slice header information, and the value of the index identifier contained in the preceding LCU header information is the second value, but the size of a coding block is small (for example, smaller than a certain preset threshold), it can be determined that the coding block needs to select the corresponding quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the size of the coding block is larger (such as larger than a certain preset threshold), it can be determined that the coding block does not need to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding combination.
  • an indication bit may also be used to respectively indicate whether the quantization coefficient selection in the quantization coefficient block obtained by entropy decoding is required for the coding block using the intra-frame coding mode and the coding block using the inter-frame coding mode in the coded data respectively.
  • the corresponding transformation matrix combination An example will be described later.
  • the value of the first indicator bit and the value of the second indicator bit included in the sequence header of the first encoded data corresponding to the video image frame sequence it is possible to determine, respectively, that the first encoded data adopts the intra-frame value. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding for the coding block in the coding mode and the coding block in the inter coding mode. For example, when the value of the first indicator bit included in the sequence header of the first encoded data is 0, it indicates that the encoding block in the first encoded data that adopts the intra-frame encoding mode does not need to be decoded according to the entropy decoding in the quantization coefficient block.
  • the quantization coefficient selects the corresponding transformation matrix combination; when the value of the first indicator bit contained in the sequence header of the first encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the first encoded data needs to be obtained according to entropy decoding
  • the corresponding transformation matrix combination is selected for the quantization coefficients in the quantization coefficient block of The block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit contained in the sequence header of the first encoded data is 1, it indicates that the first encoded data contains
  • the coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
  • the value of the first indicator bit and the value of the second indicator bit included in the image header of the second encoded data corresponding to the video image frame it may be determined that intra-frame encoding is used in the second encoded data, respectively. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding for the coding block of the mode and the coding block using the inter coding mode. For example, when the value of the first indicator bit included in the image header of the second encoded data is 0, it indicates that the encoding block in the second encoded data that adopts the intra-frame encoding mode does not need to decode the quantization coefficient block obtained by entropy decoding.
  • the quantization coefficient selects the corresponding transformation matrix combination; when the value of the first indicator bit contained in the image header of the second encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the second encoded data needs to be obtained according to entropy decoding
  • the corresponding transformation matrix combination is selected for the quantization coefficients in the quantization coefficient block of The block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit included in the image header of the second encoded data is 1, it indicates that the second encoded data contains
  • the coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
  • the third encoded data is determined respectively according to the value of the first indicator bit and the value of the second indicator bit included in the slice header information of the third encoded data corresponding to one slice of the video image frame Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding for the coding block in the intra-frame coding mode and the coding block in the inter-frame coding mode. For example, when the value of the first indicator bit included in the slice header information of the third encoded data is 0, it means that the encoding block in the third encoded data that adopts the intra-frame encoding mode does not need the quantization coefficient block obtained by entropy decoding.
  • the quantization coefficient in selects the corresponding transformation matrix combination; when the value of the first indicator bit contained in the slice header information of the third encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the third encoded data needs to be Select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit included in the slice header information of the third encoded data is 0, it indicates that the third encoded data adopts The coding block of the inter-frame coding mode does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit included in the slice header information of the third coded data is 1 , indicating that the encoding block in the inter-frame encoding mode in the third encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the fourth encoded data adopts the value of the first indicator bit and the value of the second indicator bit. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding for the coding block in the intra-frame coding mode and the coding block in the inter-frame coding mode.
  • the value of the first indicator bit included in the LCU header information of the fourth encoded data is 0, it indicates that the encoding block in the fourth encoded data that adopts the intra-frame encoding mode does not need to be decoded according to the entropy decoding in the quantization coefficient block.
  • the value of the first indicator bit contained in the LCU header information of the fourth encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the fourth encoded data needs to be based on the entropy
  • the corresponding transformation matrix combination is selected for the quantization coefficients in the quantization coefficient block obtained by decoding; when the value of the second indicator bit included in the LCU header information of the fourth encoded data is 0, it indicates that the fourth encoded data adopts inter-frame encoding.
  • the encoding block of the mode does not need to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit contained in the LCU header information of the fourth encoded data is 1, it indicates that the first Among the four coded data, the coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the coding block using the intra-frame coding mode and the coding block using the inter-frame coding mode in the coded data by indicating the bit pair respectively indicate whether the corresponding transform needs to be selected according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the indicator bits in the sequence header and the indicator bits in the image header are used to jointly decide, or the indicator bits in the sequence header and the indicator bits in the image header are used.
  • the indicator bits in the slice header information and the indicator bits in the slice header information are jointly decided, or the indicator bits in the sequence header, the indicator bits in the image header, the indicator bits in the slice header information, and the LCU header information.
  • the index identifier in the aforementioned sequence header it is only indicated by the index identifier in the aforementioned sequence header, and the decision is no longer made by the image header, slice header information, LCU header information and the size of the coding block.
  • the value of the index identifier in the sequence header is 1 (the value is only an example), it means that the target coding block in the first coded data corresponding to the video image frame sequence needs to be in the quantization coefficient block obtained by entropy decoding.
  • the quantization coefficients of select the corresponding transformation matrix combination.
  • the coding block using the intra-frame coding mode and the coding block using the inter-frame coding mode in the first coded data corresponding to the video image frame sequence may also be respectively indicated by the indication bit in the sequence header. That is, the sequence header contains two indicator bits, and one indicator bit is used to indicate whether the encoding block using the intra-frame encoding mode in the first encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. , and another indication bit is used to indicate whether the coding block in the first coded data using the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the index identifier in the aforementioned image header it is only indicated by the index identifier in the aforementioned image header, and the decision is no longer made by the sequence header, slice header information, LCU header information and the size of the coding block.
  • the value of the index identifier in the image header is 1 (the value is only an example), it means that the target coding block in the second coded data corresponding to the video image frame needs to be decoded according to the entropy decoding in the quantization coefficient block.
  • the quantization coefficient selects the corresponding transformation matrix combination.
  • the indication bits in the image header may be used to separately indicate the coding blocks that use the intra-frame coding mode and the coding blocks that use the inter-frame coding mode in the second coded data corresponding to the video image frame. That is, the image header contains two indicator bits, and one indicator bit is used to indicate whether the encoding block using the intra-frame encoding mode in the second encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. , and another indicator bit is used to indicate whether the encoding block in the inter-frame encoding mode in the second encoded data needs to select a corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the index identifier in the foregoing slice header information it is only indicated by the index identifier in the foregoing slice header information, and the decision is no longer made by the sequence header, the picture header, the LCU header information and the size of the coding block.
  • the value of the index identifier in the slice header information is 1 (the value is only an example), it means that the target encoding block in the third encoded data corresponding to the slice needs to be in the quantization coefficient block obtained by entropy decoding.
  • the quantization coefficients of select the corresponding transformation matrix combination.
  • the slice header information includes two indicator bits, and one indicator bit is used to indicate whether the encoding block in the intra-frame encoding mode in the third encoded data needs to select the corresponding transform according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. Matrix combination, and another indicator bit is used to indicate whether the coding block in the inter-frame coding mode in the third coded data needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
  • the index identifier in the aforementioned LCU header information it is only indicated by the index identifier in the aforementioned LCU header information, and the decision is no longer made by the sequence header, the image header, the slice header information and the size of the coding block.
  • the value of the index identifier in the LCU header information is 1 (the value is only an example), it means that the target coding block in the fourth coded data corresponding to the LCU needs to be quantized according to the quantization coefficient block obtained by entropy decoding.
  • the coefficient selects the corresponding transformation matrix combination.
  • the indication bits in the LCU header information may be used to separately indicate the coding blocks that use the intra-frame coding mode and the coding blocks that use the inter-frame coding mode in the fourth coded data corresponding to the LCU. That is, the LCU header information includes two indicator bits, and one indicator bit is used to indicate whether the encoding block in the fourth encoded data that adopts the intra-frame encoding mode needs to select the corresponding transformation matrix according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. The other indicator bit is used to indicate whether the encoding block in the inter-frame encoding mode in the fourth encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the size of the coding block is small (for example, smaller than the first preset threshold), it can be determined that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; on the contrary, if If the size of the coding block is larger (eg, larger than the second preset threshold), it can be determined that the coding block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
  • the decision is no longer made by the slice header information, the LCU header information and the size of the coding block.
  • the value of the index mark in the sequence header and the value of the index mark in the image header are both 1 (the value is only an example)
  • the index identifier in the sequence header, the index identifier in the image header, and the index identifier in the slice header information are all 1 (the value is only an example), it means that the slice
  • the target coding block in the corresponding third coded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the sequence header and the index in the image header The value of the identifier is 1, and the value of the index identifier in the slice header information is 0 (the value is only an example), which means that the target encoding block in the third encoded data corresponding to the slice does not need to be based on entropy.
  • the index identification in the aforementioned sequence header the index identification in the image header, the index identification in the slice header information and the index identification in the LCU header information, and is no longer determined by the size of the coding block. make decisions.
  • the value of the index mark in the sequence header, the value of the index mark in the image header, the value of the index mark in the slice header information and the value of the index mark in the LCU header information are all is 1 (the value is only an example)
  • the target coding block in the fourth coded data corresponding to the LCU needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the index in the sequence header
  • the value of the logo, the value of the index logo in the image header, and the value of the index logo in the slice header information are all 1, while the value of the index logo in the LCU header information is 0 (the value is only 0).
  • the decision is made based on the index identifier in the sequence header, the index identifier in the image header, the index identifier in the slice header information, the index identifier in the LCU header information, and the size of the coding block.
  • the value of the index mark in the sequence header, the value of the index mark in the image header, the value of the index mark in the slice header information, and the value of the index mark in the LCU header information are all is 1 (the value is only an example), and the size of the coding block is smaller than the preset threshold (such as the first preset threshold), it means that the coding block needs to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding Combination; if the value of the index mark in the sequence header, the value of the index mark in the image header, the value of the index mark in the slice header information and the value of the index mark in the LCU header information are all is 1, but the size of the encoding block is greater than the preset
  • the index identifier in the image header and the index identifier in the slice header information are both 1 (the value is only an example), it means that the target encoding in the third encoded data corresponding to the slice is The block needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the image header is 1, and the value of the index mark in the slice header information is 0 (The numerical value is only an example), it means that the target coding block in the third coded data corresponding to the slice does not need to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
  • the index identifier in the image header, the index identifier in the slice header information, and the index identifier in the LCU header information are all 1 (the value is only an example), it means that The target coding block in the fourth coded data corresponding to the LCU needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the image header and the slice header information The value of the index identifier of the LCU is 1, and the value of the index identifier in the LCU header information is 0 (the value is only an example), which means that the target encoding block in the fourth encoded data corresponding to the LCU does not need to be decoded according to entropy
  • the decision is made based on the index identifier in the image header, the index identifier in the slice header information, the index identifier in the LCU header information, and the size of the coding block, and no longer makes the decision by the sequence header.
  • the value of the index mark in the image header, the value of the index mark in the slice header information, and the value of the index mark in the LCU header information are all 1 (the value is only an example), and the encoding
  • the size of the block is smaller than the preset threshold (such as the first preset threshold), which means that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding;
  • the value, the value of the index mark in the slice header information and the value of the index mark in the LCU header information are all 1, but the size of the coding block is greater than the preset threshold (such as the second preset threshold), then It is indicated that the coding block does not need to select the corresponding transformation matrix combination according to the
  • the target region when statistical processing is performed on the quantized coefficients in multiple regions in the quantized coefficient block, the following may be used for any one of the multiple regions (for convenience of description, it is referred to as the target region) as follows
  • the sum of absolute values, the obtained sum value is used as the statistical result; or the sum of the numerical values of the quantization coefficients whose values are even or non-zero even in the target area can be calculated, and the obtained sum value is used as the statistical result; or the target area can be calculated
  • the sum of the absolute values of the quantization coefficients whose values are even or non-zero even in the region will be used as the statistical result.
  • the numerical values of the quantization coefficients in the target area may be linearly mapped, and then the linearity of the quantization coefficients in the target area is calculated. The sum of the numerical values or the sum of the absolute values after the mapping, and the obtained sum value will be used as the statistical result.
  • the above-mentioned linear mapping may be to convert the numerical value of the quantization coefficient whose value is an odd number in the target area into a first value, and convert the value of the quantization coefficient whose value is an even number in the target area into a second value, wherein , one of the first value and the second value is odd and the other is even.
  • the value of the quantization coefficient whose value is odd in the target area is converted to 1, and the value of the quantization coefficient whose value is even is converted to 0; or the value of the quantization coefficient whose value is odd in the target area is converted to 0, Convert the value of the quantization coefficient with an even number to 1; or convert the value of the quantization coefficient with an odd value in the target area to 3, and convert the value of the quantization coefficient with an even value to 2; or in the target area
  • the numerical value of the quantization coefficient whose value is an odd number is converted into 2, and the value of the quantization coefficient whose value is an even number is converted into 3.
  • the above-mentioned linear mapping may be to convert the value of the non-zero quantization coefficient in the target area into a third value, and convert the value of the quantization coefficient with a value of zero into a fourth value, wherein the third value One of the numerical value and the fourth numerical value is an odd number and the other is an even number.
  • the value of the non-zero quantization coefficient in the target area is converted to 1, and the value of the quantization coefficient with the value zero is converted to 0; or the value of the non-zero quantization coefficient in the target area is converted to 0, and the value
  • the value of the zero quantization coefficient is converted to 1; or the value of the non-zero quantization coefficient in the target area is converted to 3, and the value of the quantization coefficient of zero value is converted to 2; or the non-zero value of the target area is converted.
  • the value of the quantization coefficient is converted to 2, and the value of the quantization coefficient with a value of zero is converted to 3.
  • the above-mentioned linear mapping may be to reduce the value of the quantization coefficient in the target area according to the fifth value.
  • the values of the quantization coefficients in the target area are all reduced by 1, or both are reduced by 2.
  • the above-mentioned linear mapping may be performed to increase the value of the quantization coefficient in the target region according to the fifth value.
  • the values of the quantization coefficients in the target area are all increased by 1, or both are increased by 2.
  • the above-mentioned linear mapping may be to multiply the value of the quantization coefficients in the target region by a sixth non-zero value.
  • the values of the quantization coefficients in the target area are multiplied by 1, or multiplied by 2.
  • the sixth value may be a non-zero even number, such as 2, 4, 6, and so on.
  • the above-mentioned linear mapping may be the value of the quantization coefficients in the target region divided by a sixth non-zero value.
  • the values of the quantization coefficients in the target area are divided by 1, or divided by 2.
  • the sixth value may be a non-zero even number, such as 2, 4, 6, and so on.
  • the above-mentioned linear mapping may be to convert the numerical values of the quantization coefficients in the target region into opposite numbers.
  • the same statistical method can be used for different regions; or different statistical methods can also be used for different regions; The same statistics are used for regions, and additional statistics are used for other regions.
  • the remainder of the statistical results of each region to the set value can be calculated respectively.
  • the fixed value can be any non-zero number, such as 2, 3, 4, etc.
  • the set values corresponding to the statistical results of different regions may be the same or different. For example, there are two areas. The statistical result of area 1 can take the remainder of 2, and the statistical result of area 2 can take the remainder of 2 or other values such as 3 or 4.
  • the embodiments of the present application can perform statistical processing on the quantization coefficients in each of the aforementioned multiple regions in the following manner.
  • the quantization coefficients are used for statistics as an example to illustrate:
  • one of the above-mentioned multiple regions may be all regions in the quantized coefficient block.
  • one of the plurality of regions may be a location or locations specified in the block of quantized coefficients.
  • one of the above-mentioned plurality of regions may be at least one row designated in the block of quantized coefficients.
  • the quantized coefficient block is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient
  • 1 row of the gray area can be used as a region; or
  • two lines of the gray area are regarded as one area.
  • the at least one row may be an upper row in the block of quantized coefficients.
  • one of the aforementioned plurality of regions may be at least one column designated in the block of quantized coefficients.
  • the quantized coefficient block is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient
  • one column of the gray area can be used as an area; or you can
  • the two columns in the gray area are regarded as one area.
  • the at least one column may be the left column in the block of quantized coefficients.
  • one of the above-mentioned plurality of regions may be at least one designated row and at least one designated column in the block of quantized coefficients.
  • the quantized coefficient block is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient, then as shown in (a) of FIG.
  • the lower row and the right column that is, The gray area in it
  • the lower 2 rows and the right 2 columns that is, the gray area
  • the upper 1 row and the left 1 column that is, the gray area in it
  • the upper 2 rows and the left 2 columns that is, the gray area
  • one of the above-mentioned multiple regions may be a position on at least one oblique line in the block of quantized coefficients.
  • the quantized coefficient block is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient
  • the position on a diagonal line can be used as an area; or as shown in (c) and (d) in 9, the position on the two diagonal lines is regarded as an area.
  • one of the aforementioned plurality of regions may be an SRCC region in a block of quantized coefficients.
  • the SRCC area is the scanning area marked by the SRCC technology.
  • one of the above-mentioned multiple areas may be a location or locations designated in the SRCC area.
  • the position or positions specified in the SRCC area may include: the first N positions in the scanning order or the middle N positions in the scanning order, and of course, the last N positions in the scanning order position, etc., N is a non-zero natural number.
  • the top N positions in the scanning order refer to the top N positions after sorting all the positions in the SRCC region according to the scanning order, and the rest are the same.
  • one of the above-mentioned plurality of regions may be at least one row designated in the SRCC region.
  • the SRCC area is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient
  • 1 row of the gray area can be used as a region;
  • two lines in the gray area are regarded as one area.
  • the at least one row may be an upper row in the block of quantized coefficients.
  • one of the aforementioned plurality of regions may be at least one column designated in the SRCC region.
  • the SRCC area is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient
  • one column of the gray area can be used as a region; or it can be as follows
  • the two columns in the gray area are regarded as one area.
  • the at least one column may be the left column in the block of quantized coefficients.
  • one of the above-mentioned multiple areas may be at least one designated row and at least one designated column in the SRCC area.
  • the SRCC area is a 4 ⁇ 4 coefficient block, and each block represents a quantized coefficient
  • the lower row and the right column that is, where the gray area
  • the 2 rows below and the 2 columns on the right that is, the gray area
  • the upper 1 row and the left 1 column that is, the gray area in it
  • the upper 2 rows and the left 2 columns that is, the gray area
  • one of the above-mentioned regions may be a position on at least one diagonal line in the SRCC region.
  • each block represents a quantized coefficient, then as shown in (a) and (b) in 9, the position on a diagonal line can be used as a area; or as shown in (c) and (d) in 9, take the position on the two diagonal lines as an area.
  • the area division manners in the foregoing embodiments may also be combined, so that the combined area is regarded as one area, and then multiple areas are selected therefrom.
  • step S630 the combination of transformation matrices corresponding to the coding blocks is selected according to the remainder of each region.
  • remainder combinations corresponding to multiple regions may be generated according to the remainders of each region, and then the corresponding transformation matrix combination may be selected according to the correspondence between the remainder combination and the transformation matrix combination. For example, if there are 2 areas, and when calculating the remainder, set the setting value to 2, then the remainder of these two areas may be 0 or 1, and the possible combination of remainders can be (0, 0), (0 ,1), (1,0) or (1,1), in this case four different combinations of transformation matrices can be indicated; if there are 3 regions, and when calculating the remainder, set the set value to 2, then the remainder of these three areas may be 0 or 1, and the possible combination of remainders can be (0,0,0), (0,0,1), (0,1,0), (0 ,1,1), (1,0,0), (1,0,1), (1,1,0) or (1,1,1), in which case eight different transformations can be indicated Matrix combination, where the remainder combination corresponds to the transformation matrix combination one-to-one. It can be seen that the remainder combination corresponds
  • the transformation matrix combinations corresponding to different remainder combinations may be different.
  • the transformation matrix combinations corresponding to different remainder combinations may also be the same, but for all possible remainder combinations, they cannot all correspond to the same transformation matrix combination.
  • the transform kernels employed in the transform matrix combination may be any combination of known discrete transform kernels (8 DCT transform kernels and 8 DST transform kernels).
  • the transformation kernel may include: DCT2, DCT5, DCT8, DST1, DST7, and so on.
  • the transform matrix combination includes at least one of a discrete cosine transform (DCT) transform kernel and a discrete sine transform (DST) transform kernel, and each transform matrix combination corresponds to a remainder combination.
  • DCT discrete cosine transform
  • DST discrete sine transform
  • the transformation matrix combination includes at least one combination of DCT2, DCT5, DCT8, DST1, and DST7.
  • the remainder combination is ( 0,0), the corresponding transformation matrix combination can be (DCT2, DCT2); when the remainder combination is (0,1), the corresponding transformation matrix combination can be (DCT8, DCT8); the remainder combination is (1,0) , the corresponding transformation matrix combination may be (DCT8, DST7); when the remainder combination is (1, 1), the corresponding transformation matrix combination may be (DST7, DST7).
  • the coded block may also be indicated by a remainder combination to skip the transform process.
  • the combination of the remainders may be used to indicate that the corresponding transformation matrix combination is a null value (or TS), where the null value (or TS) indicates that the coding block skips the transformation process.
  • the corresponding transformation matrix combination can be (DCT2, DCT2); when the remainder combination is (0,1), The corresponding transformation matrix combination can be (DCT8, DCT8); when the remainder combination is (1,0), the corresponding transformation matrix combination can be (DCT8, DST7); when the remainder combination is (1,1), the corresponding transformation matrix
  • the combination can be a null value (or TS) to indicate that the encoding block skips the transform process, in which case the quantized coefficient block can be directly inverse-quantized, and then the result of the inverse-quantization process is used as the reconstructed residual. difference data without performing inverse transform processing on the result of inverse quantization processing.
  • the remainder combination indicating that the coding block skips the transformation process may be set according to actual needs, and (1, 1) in this embodiment is only an example.
  • the combination of transformation matrices can also be selected through the association indication scheme between various regions, for example, traversing multiple regions in a set order, and performing the following processing on the traversed regions: Perform statistical processing on the quantization coefficients in the area of When the transformation matrix is combined, continue traversing the next region. For example, statistical processing may be performed on the quantization coefficients in the first region of the foregoing multiple regions in a set order to obtain a statistical result of the first region, and then the remainder of the first region may be calculated. If the corresponding transformation matrix combination cannot be selected according to the remainder of the first area, continue to perform statistical processing on the quantization coefficients in the second area of the foregoing multiple areas to obtain the statistical result of the second area, and calculate the remainder of the second area. , judging whether the corresponding transformation matrix combination can be selected according to the remainder of the second region, until the transformation matrix combination corresponding to the coding block is selected.
  • a combination of transformation matrices (DCT2, DCT2) is selected. At this time, it is not necessary to perform statistical processing on the quantization coefficients in area 2; If the remainder is 1, it means that a transformation matrix combination cannot be determined according to the remainder of the statistical result of area 1. In this case, statistical processing of the quantization coefficients in area 2 is required, and then the remainder of the statistical result of area 2 is taken.
  • the remainder obtained from the statistical result of area 1 can be determined to use a certain transformation matrix combination, you do not need to Statistical processing is performed on the quantized coefficients in area 2 and the quantized coefficients in area 3; if a transformation matrix combination cannot be determined based on the remainder obtained from the statistical results of area 1, statistical processing can be performed on the quantized coefficients in area 2, Then, take the remainder of the statistical result of area 2, and then determine a transformation matrix combination according to the remainder obtained from the statistical result of area 2. If the remainder obtained from the statistical result of area 2 cannot determine a transformation matrix combination, you can perform statistical processing on the quantization coefficients in area 3, and then take the remainder of the statistical result of area 3, and then calculate according to the statistical result of area 3. The resulting remainder determines a transformation matrix combination.
  • the transformation matrix combination (DCT2, DCT2) is selected, and statistical processing of the quantization coefficients in region 2 and region 3 is not required at this time; If the remainder of the statistical result is 1, it means that a transformation matrix combination cannot be determined according to the remainder of the statistical result of area 1. In this case, it is necessary to perform statistical processing on the quantization coefficients in area 2, and then take the remainder of the statistical result of area 2.
  • if the remainder of the statistical result of area 1 is 0, it means that the transformation matrix combination needs to be determined according to the quantization coefficients in area 2; The quantization coefficients within are used to determine the transform matrix combination. If the remainder of the statistic result of Region 2 is 0, select the transform combination (DCT8, DCT8); if the remainder of the statistic result of Region 2 is 1, then select the transform combination (DCT2, DCT2).
  • the remainder of the statistical results of each region may also be calculated first, and then the transformation matrix combination may be selected according to the association indication scheme between the regions.
  • step S640 inverse transform processing is performed on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
  • inverse transform processing is performed on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
  • the technical solutions of the above embodiments of the present application enable the quantization coefficient in the quantization coefficient block to implicitly indicate the combination of transformation matrices corresponding to the coding block, without the need for the coding end to encode the index of the transformation matrix for each coding unit, thereby reducing the transformation matrix index
  • the occupied bits can then effectively improve the video coding and decoding efficiency.
  • FIG. 10 shows a block diagram of a video decoding apparatus according to an embodiment of the present application.
  • the video decoding apparatus may be set in an electronic device with a computing processing function, for example, may be set in a terminal device or a server.
  • the video decoding apparatus 1000 includes: a decoding unit 1002 , a statistics unit 1004 , a selection unit 1006 , and a processing unit 1008 .
  • the decoding unit 1002 is configured to perform entropy decoding processing on the coding block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coding block; Perform statistical processing respectively to obtain the statistical results of each area in the multiple areas, and determine the remainder of the statistical results of each area for the set value; the selection unit 1006 is configured to select the corresponding transformation matrix combination of the coding block according to the remainder of each area; the processing unit 1008 is configured to perform an inverse transform process on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
  • the video decoding apparatus 1000 further includes a determination unit configured to: according to the value of the index identifier corresponding to the coding block, the value of the indicator bit corresponding to the coding block, and the value of the coding block At least one of the relationships between the size and the preset threshold range determines whether the encoding block needs to select a corresponding transformation matrix combination according to the quantization coefficient.
  • the determining unit is further configured to perform at least one of the following processing: according to the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence, determine the first Whether the coding block in the coded data needs to select the corresponding transformation matrix combination according to the quantization coefficient; according to the value of the index identifier contained in the image header of the second coded data corresponding to the video image frame, determine the coding block in the second coded data.
  • the determination unit is further configured to perform at least one of the following processing: according to the value of the first indication bit included in the sequence header of the first encoded data corresponding to the video image frame sequence and the The value of the second indicator bit determines whether the encoding block using the intra-frame encoding mode and the encoding block using the inter-frame encoding mode in the first encoded data need to select the corresponding transformation matrix combination according to the quantization coefficient; The value of the first indicator bit and the value of the second indicator bit included in the image header of the second encoded data respectively determine the encoding block in the second encoded data that adopts the intra-frame encoding mode and the encoding block that adopts the inter-frame encoding mode.
  • the determining unit is further configured to: when the size of the encoding block is smaller than the first preset threshold, determine that the encoding block needs to select a corresponding transformation matrix combination according to the quantization coefficient; When the size is greater than the second preset threshold, it is determined that the coding block does not need to select the corresponding transformation matrix combination according to the quantization coefficient; wherein the second preset threshold is greater than or equal to the first preset threshold.
  • the statistics unit 1004 is further configured to: perform any one of the following processing for the target area in the multiple areas: determine the sum of the numerical values of the quantization coefficients in the target area, and obtain The sum value of the target area is used as the statistical result of the target area; the sum of the absolute values of the quantization coefficients in the target area is determined, and the obtained sum value is used as the statistical result of the target area; the numerical value of the odd-numbered quantization coefficients in the target area is determined, Use the obtained sum as the statistical result of the target area; determine the sum of the absolute values of the quantization coefficients with odd values in the target area, and use the obtained sum as the statistical result of the target area; determine whether the value in the target area is even or non-zero The sum of the values of the even quantization coefficients is used as the statistical result of the target area; the sum of the absolute values of the quantization coefficients with even or non-zero even numbers in the target area is determined, and the obtained sum is
  • the statistics unit 1004 is further configured to: perform linear mapping on the numerical values of the quantized coefficients in the target area, and calculate the sum of the numerical values or the sum of the absolute values of the quantized coefficients after the linear mapping As the statistical result of the target area; wherein, the target area represents any one of the multiple areas.
  • the statistics unit 1004 is further configured to perform any one of the following processing: converting the value of the quantization coefficient whose value is odd in the target area into a first value, and converting the value in the target area as The value of the even-numbered quantization coefficient is converted into a second value, wherein one of the first value and the second value is an odd number, and the other is an even number; the value of the non-zero quantization coefficient in the target area is converted into a third value, and the The value of the quantization coefficient with zero value in the target area is converted into a fourth value, wherein one of the third value and the fourth value is an odd number, and the other is an even number; according to the fifth value, the value of the quantization coefficient in the target area is changed. Perform a reduction process or an increase process; multiply or divide the value of the quantization coefficient in the target area by a sixth non-zero value; convert the value of the quantization coefficient in the target area to an opposite number.
  • each of the multiple regions includes any one of the following: all regions in the quantized coefficient block; one position or multiple positions in the quantized coefficient block; quantized coefficient block at least one row in the quantized coefficient block; at least one column in the quantized coefficient block; at least one row and at least one column in the quantized coefficient block; the position on at least one oblique line in the quantized coefficient block; the SRCC area in the quantized coefficient block; one position or more positions; at least one row in the SRCC area; at least one column in the SRCC area; at least one row and at least one column in the SRCC area; a position on at least one diagonal line in the SRCC area.
  • one or more positions in the SRCC area include: the first N positions in the scanning order or the N positions in the middle according to the scanning order, where N is a non-zero natural number .
  • the selection unit 1006 is further configured to: generate a remainder combination corresponding to a plurality of regions according to the remainder of each region; select a code according to the correspondence between the remainder combination and the transformation matrix combination The combination of transform matrices corresponding to the block.
  • the transformation matrix combination includes at least one of a discrete cosine transform DCT transformation kernel and a discrete sine transform DST transformation kernel, and each transformation matrix combination corresponds to a remainder combination.
  • the remainder combination whose value is a specified value is used to indicate that the encoding block skips the transformation process.
  • the transformation matrix combination includes a combination of at least one of DCT2, DCT5, DCT8, DST1, and DST7.
  • the statistics unit 1004 is further configured to perform traversal processing on multiple regions in a set order, and perform the following processing on the traversed regions: quantization coefficients in the traversed regions Perform statistical processing to obtain the statistical result of the traversed area; determine the remainder of the statistical result of the traversed area for the set value; when the transformation matrix combination corresponding to the coding block cannot be selected according to the remainder of the traversed area, continue to traverse next area.
  • the video encoding apparatus provided in the embodiments of the present application may also be set in an electronic device having a computing processing function, for example, may be set in a terminal device or a server.
  • the video encoding apparatus according to the embodiment of the present application includes: a residual unit configured to determine residual data between an original image signal of a video frame image and a predicted image signal; a transform unit configured to transform the residual data based on a combination of transform matrices
  • the quantization unit is configured to perform quantization processing on the transformation result to obtain quantized coefficients; wherein, the quantized coefficients are used to indicate the combination of transformation matrices; the coding unit is configured to perform entropy coding processing on the quantized coefficients to obtain coding blocks.
  • FIG. 11 shows a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.
  • the computer system 1100 includes a central processing unit (Central Processing Unit, CPU) 1101, which can be loaded into a random device according to a program stored in a read-only memory (Read-Only Memory, ROM) 1102 or from a storage part 1108 Various appropriate actions and processes are performed by accessing the programs in the memory (Random Access Memory, RAM) 1103, for example, performing the video decoding method or the video encoding method in the above-mentioned embodiments. In the RAM 1103, various programs and data required for system operation are also stored.
  • the CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other through a bus 1104.
  • An Input/Output (I/O) interface 1105 is also connected to the bus 1104 .
  • I/O Input/Output
  • the following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc. ; a storage part 1108 including a hard disk and the like; and a communication part 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like.
  • the communication section 1109 performs communication processing via a network such as the Internet.
  • Drivers 1110 are also connected to I/O interface 1105 as needed.
  • a removable medium 1111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 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 being used to execute the video decoding method or the video decoding method shown in the flowchart.
  • the computer program may be downloaded and installed from the network via the communication portion 1109, and/or installed from the removable medium 1111.
  • CPU central processing unit
  • the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, may be a computer-readable storage medium, or may be any combination of the above two.
  • Computer readable storage media include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus or devices, or a combination of any 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 of the above suitable combination.
  • the computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device.
  • the computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, carrying a computer-readable computer program therein.
  • 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 .
  • a computer program 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 diagram may represent a module, program segment, or part of code, and the above-mentioned module, program segment, or part of code contains one or more executables for realizing the specified logical function instruction.
  • 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 units involved in the embodiments of the present application may be implemented in software or hardware, and the described units may also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
  • Embodiments of the present application further provide a computer-readable medium, which may be included in the electronic device described in the foregoing embodiments, or may exist independently without being assembled into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs (that is, computer programs), and when the above-mentioned one or more programs are executed by an electronic device, the electronic device is made to realize the video decoding method or the video encoding method in the above-mentioned embodiment. .
  • Embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions (ie, executable instructions), and the computer instructions are stored in a computer-readable medium.
  • the processor of the electronic device reads the computer instructions from the computer-readable medium, and the processor executes the computer instructions, so that the electronic device executes the video decoding method or the video encoding method provided in the above embodiments.
  • the exemplary embodiments described herein may be implemented by software, or may 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 an electronic 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 non-volatile storage medium which may be CD-ROM, U disk, mobile hard disk, etc.
  • an electronic device which may be a personal computer, a server, a touch terminal, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

A video decoding method and apparatus, a video coding method and apparatus, a computer-readable medium, and an electronic device. The video decoding method comprises: performing entropy decoding processing on a coded block of a video image frame to obtain a quantization coefficient block of residual data corresponding to the coded block; respectively performing statistical processing on quantization coefficients in a plurality of areas in the quantization coefficient block to obtain a statistical result of each area in the plurality of areas, and determining the remainder of the statistical result of each area relative to a set value; according to the remainder of each area, selecting a transform matrix combination corresponding to the coded block; and on the basis of the selected transform matrix combination, performing inverse transform processing on an inverse quantization result of the quantization coefficient block.

Description

视频解码方法、视频编码方法、装置、计算机可读介质及电子设备Video decoding method, video encoding method, apparatus, computer-readable medium, and electronic device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于申请号为202011054872.8、申请日为2020年09月27日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。This application is based on the Chinese patent application with the application number of 202011054872.8 and the filing date of September 27, 2020, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is incorporated herein by reference.
技术领域technical field
本申请涉及计算机及通信技术领域,具体而言,涉及一种视频解码方法、视频编码方法、装置、计算机可读介质及电子设备。The present application relates to the field of computer and communication technologies, and in particular, to a video decoding method, a video encoding method, an apparatus, a computer-readable medium, and an electronic device.
背景技术Background technique
在视频编码过程中,编码端通常需要对原始视频数据与预测视频数据之间的残差数据进行变换、量化及熵编码处理之后发送给解码端。由于残差数据的多样性,单一的离散余弦变换(Discrete Cosine Transform,DCT)变换核无法适应所有的残差特性,因此对于一个残差块可能需要选择多个DCT变换核或离散正弦变换(Discrete Sine Transform,DST)变换核作为变换矩阵组合,在这种情况下,虽然提升了变换矩阵组合对残差块的适应性,但是由于需要针对每个编码单元(Coding Unit,CU)来编码变换核的索引,因此导致编解码效率较低。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. Due to the diversity of residual data, a single Discrete Cosine Transform (DCT) transform kernel cannot adapt to all residual characteristics. Therefore, multiple DCT transform kernels or discrete sine transform (Discrete Sine Transform) may need to be selected for a residual block. Sine Transform, DST) transformation kernel is used as a transformation matrix combination. In this case, although the adaptability of the transformation matrix combination to the residual block is improved, the transformation kernel needs to be encoded for each coding unit (Coding Unit, CU). index, thus resulting in low coding and decoding efficiency.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种视频解码方法,包括:The embodiment of the present application provides a video decoding method, including:
对视频图像帧的编码块进行熵解码处理,得到所述编码块对应的残差数据的量化系数块;Entropy decoding is performed on the coding block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coding block;
对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,确定所述各个区域的统计结果针对设定值的余数;Perform statistical processing on the quantization coefficients in the multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of the respective regions in the multiple regions, and determine the remainder of the statistical results of the respective regions to the set value;
根据所述各个区域的余数选择所述编码块对应的变换矩阵组合;Select the transformation matrix combination corresponding to the coding block according to the remainder of the respective regions;
基于选择的变换矩阵组合对所述量化系数块的反量化结果进行反变换处理。Inverse transform processing is performed on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
本申请实施例提供了一种视频编码方法,包括:The embodiment of the present application provides a video encoding method, including:
确定视频帧图像的原始图像信号与预测图像信号之间的残差数据;Determine residual data between the original image signal of the video frame image and the predicted image signal;
基于变换矩阵组合对所述残差数据进行变换处理,得到变换结果;Transform the residual data based on the combination of transformation matrices to obtain a transformation result;
对所述变换结果进行量化处理,得到量化系数;其中,所述量化系数用于指示所述变换矩阵组合;Perform quantization processing on the transformation result to obtain quantization coefficients; wherein, the quantization coefficients are used to indicate the transformation matrix combination;
对所述量化系数进行熵编码处理,得到编码块。Entropy coding is performed on the quantized coefficients to obtain coding blocks.
本申请实施例提供了一种视频解码装置,包括:Embodiments of the present application provide a video decoding apparatus, including:
解码单元,配置为对视频图像帧的编码块进行熵解码处理,得到所述编码块对应的残差数据的量化系数块;a decoding unit, configured to perform entropy decoding processing on an encoding block of a video image frame to obtain a quantized coefficient block of residual data corresponding to the encoding block;
统计单元,配置为对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,确定所述各个区域的统计结果针对设定值的余数;A statistical unit, configured to perform statistical processing on the quantization coefficients in multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of each of the multiple regions, and to determine that the statistical results of the respective regions are relative to the set value the remainder;
选择单元,配置为根据所述各个区域的余数选择所述编码块对应的变换矩阵组合;a selection unit, configured to select the transformation matrix combination corresponding to the coding block according to the remainder of the respective regions;
处理单元,配置为基于选择的变换矩阵组合对所述量化系数块的反量化结果进行反变换处理。The processing unit is configured to perform inverse transformation processing on the inverse quantization result of the quantized coefficient block based on the selected transformation matrix combination.
本申请实施例提供了一种视频编码装置,包括:An embodiment of the present application provides a video encoding device, including:
残差单元,配置为确定视频帧图像的原始图像信号与预测图像信号之间的残差数据;a residual unit, configured to determine residual data between the original image signal of the video frame image and the predicted image signal;
变换单元,配置为基于变换矩阵组合对所述残差数据进行变换处理,得到变换结果;a transformation unit, configured to perform transformation processing on the residual data based on the transformation matrix combination to obtain a transformation result;
量化单元,配置为对所述变换结果进行量化处理,得到量化系数;其中,所述量化系数用于指示所述变换矩阵组合;a quantization unit, configured to perform quantization processing on the transformation result to obtain a quantization coefficient; wherein the quantization coefficient is used to indicate the transformation matrix combination;
编码单元,配置为对所述量化系数进行熵编码处理,得到编码块。an encoding unit, configured to perform entropy encoding processing on the quantized coefficients to obtain an encoding block.
本申请实施例提供了一种计算机可读介质,存储有计算机程序,所述计算机程序被处理器执行时实现如上述实施例中所述的视频解码方法或视频编码方法。Embodiments of the present application provide a computer-readable medium storing a computer program, and when the computer program is executed by a processor, the video decoding method or the video encoding method described in the foregoing embodiments is implemented.
本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储装置,用于存储一个或多个计算机程序,当所述一个或多个计算机程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如上述实施例中所述的视频解码方法或视频编码方法。An embodiment of the present application provides an electronic device, including: one or more processors; and a storage device for storing one or more computer programs, when the one or more computer programs are processed by the one or more computer programs When the processor is executed, the one or more processors are caused to implement the video decoding method or the video encoding method as described in the above embodiments.
本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读介质中。电子设备的处理器从计算机可读介质读取该计算机指令,处理器执行该计算机指令,使得该电子设备执行上述实施例中提供的视频解码方法或视频编码方法。Embodiments of the present application provide 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 medium. The processor of the electronic device reads the computer instructions from the computer-readable medium, and the processor executes the computer instructions, so that the electronic device executes the video decoding method or the video encoding method provided in the above embodiments.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the present application.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在附图中:The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description serve to explain the principles of the application. Obviously, the drawings in the following description are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort. In the attached image:
图1示出了可以应用本申请实施例的技术方案的示例性***架构的示意图;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;
图2示出视频编码装置和视频解码装置在流式传输***中的放置方式示意图;FIG. 2 shows a schematic diagram of a placement manner of a video encoding device and a video decoding device in a streaming transmission system;
图3示出了视频编码器的基本流程图;Fig. 3 shows the basic flow chart of video encoder;
图4示出了通过扫描区域系数编码技术标记出的扫描区域;Fig. 4 shows the scanning area marked by scanning area coefficient coding technique;
图5示出了对标记出的扫描区域进行扫描的顺序示意图;Fig. 5 shows the sequence schematic diagram of scanning the marked scanning area;
图6A示出了本申请实施例提供的视频编码方法的流程图;6A shows a flowchart of a video encoding method provided by an embodiment of the present application;
图6B示出了本申请实施例提供的视频解码方法的流程图;6B shows a flowchart of a video decoding method provided by an embodiment of the present application;
图7示出了本申请实施例提供的指定区域的划分方式示意图;FIG. 7 shows a schematic diagram of a division manner of a designated area provided by an embodiment of the present application;
图8示出了本申请实施例提供的指定区域的划分方式示意图;FIG. 8 shows a schematic diagram of a division manner of a designated area provided by an embodiment of the present application;
图9示出了本申请实施例提供的指定区域的划分方式示意图;FIG. 9 shows a schematic diagram of a division manner of a designated area provided by an embodiment of the present application;
图10示出了本申请实施例提供的视频解码装置的框图;FIG. 10 shows a block diagram of a video decoding apparatus provided by an embodiment of the present application;
图11示出了适于实现本申请实施例的电子设备的计算机***的结构示意图。FIG. 11 shows a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.
具体实施方式detailed description
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本申请将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, 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.
此外,所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施例中。在下面的描述中,提供许多示例细节从而给出对本申请的实施例的充分理解。然而,本领域技术人员将意识到,可以实践本申请的技术方案而没有特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本申请的各方面。Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous example details are provided in order to give a thorough understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical solutions of the present application may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the present application.
附图中所示的方框图仅仅是功能实体,不一定必须与物理上独立的实体相对应。即可以采用软件形式来实现这些功能实体,也可以在硬件模块或集成电路中实现这些功能实体,还可以通过网络、处理器装置以及微控制器装置中的至少之一来实现这些功能实体。The block diagrams shown in the figures are merely functional entities and do not necessarily necessarily correspond to physically separate entities. That is, these functional entities can be implemented in software, or in hardware modules or integrated circuits, and can also be implemented through at least one of a network, a processor device, and a microcontroller device.
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解,而有的操作/步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the figures are only exemplary illustrations and do not necessarily include all contents and operations/steps, nor do they have to be performed in the order described. For example, some operations/steps can be decomposed, and some operations/steps can be combined or partially combined, so the actual execution order may be changed according to the actual situation.
需要说明的是:在本文中提及的“多个”是指两个或两个以上。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。It should be noted that the "plurality" mentioned in this document refers to two or more. "And/or" describes the association relationship between associated objects, indicating that there can be three kinds of relationships, for example, A and/or B can indicate that A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the associated objects are an "or" relationship.
图1示出了可以应用本申请实施例的技术方案的示例性***架构的示意图。如图1所示,***架构100包括多个电子设备,电子设备可通过例如网络150彼此通信。举例来说,***架构100可以包括通过网络150互连的第一电子设备110和第二电子设备120。在图1的实施例中,第一电子设备110和第二电子设备120执行单向数据传输。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. As shown in FIG. 1 , the system architecture 100 includes a plurality of electronic devices that can communicate with each other through, for example, a network 150 . For example, system architecture 100 may include first electronic device 110 and second electronic device 120 interconnected by network 150 . In the embodiment of FIG. 1 , the first electronic device 110 and the second electronic device 120 perform one-way data transmission.
举例来说,第一电子设备110可对视频数据(例如由第一电子设备110采集的视频图像流)进行编码,并通过网络150传输到第二电子设备120,已编码的视频数据以一个或多个已编码视频码流的形式传输。第二电子设备120可从网络150接收已编码视频数据,对已编码视频数据进行解码以恢复视频数据,并根据恢复的视频数据显示视频图像。For example, the first electronic device 110 may encode video data (eg, a video image stream captured by the first electronic device 110 ) and transmit it to the second electronic device 120 through the network 150 , and the encoded video data may be encoded in one or It is transmitted in the form of multiple encoded video streams. The second electronic device 120 may receive encoded video data from the network 150, decode the encoded video data to restore the video data, and display a video image according to the restored video data.
在一些实施例中,***架构100可以包括执行针对已编码视频数据的双向传输的第三电子设备130和第四电子设备140,双向传输比如可以发生在视频会议期间。对于双向数据传输,第三电子设备130和第四电子设备140中的每个电子设备可对视频数据(例如由电子设备采集的视频图像流)进行编码,并通过网络150传输到第三电子设备130和第四电子设备140中的另一电子设备。第三电子设备130和第四电子设备140中的每个电子设备还可接收由第三电子设备130和第四电子设备140中的另一电子设备传输的已编码视频数据,且可对已编码视频数据进行解码以恢复视频数据,并可根据恢复的视频数据在可访问的显示装置上显示视频图像。In some embodiments, the system architecture 100 may include a third electronic device 130 and a fourth electronic device 140 that perform bidirectional transmission of encoded video data, such as may occur during a video conference. For bidirectional data transmission, each of the third electronic device 130 and the fourth electronic device 140 may encode video data (eg, a stream of video images captured by the electronic device) and transmit to the third electronic device through the network 150 130 and the other electronic device of the fourth electronic device 140 . Each of the third electronic device 130 and the fourth electronic device 140 may also receive encoded video data transmitted by the other electronic device of the third electronic device 130 and the fourth electronic device 140, and may The video data is decoded to recover the video data, and a video image can be displayed on an accessible display device based on the recovered video data.
在图1的实施例中,涉及的电子设备(如第一电子设备110、第二电子设备120、第三电子设备130和第四电子设备140)可为服务器或终端设备,其中,服务器可以是独立的物理服务器,也可以是多个物理服务器构成的服务器集群或者分布式***,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器;终端设备可以是个人计算机、智能电话、膝上型计算机、平板电脑、媒体播放器、专用视频会议设备等,但并不限于此。网络150表示在第一电子设备110、第二电子设备120、第三电子设备130和第四电子设备140之间传送已编码视频数据的任何数目的网络,例如有线和/或无线通信网络。网络150可在电路交换和/或分组交换信道中交换数据。网络150可包括电信网络、局域网、广域网和互联网中的至少之一。出于本申请实施例的目的,除非在下文中有所解释,否 则网络150的架构和拓扑对于本申请实施例公开的操作来说可能是无关紧要的。In the embodiment of FIG. 1 , the involved electronic devices (such as the first electronic device 110 , the second electronic device 120 , the third electronic device 130 and the fourth electronic device 140 ) may be servers or terminal devices, where the server may be An independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, Domain name service, security service, Content Delivery Network (CDN), and cloud server for basic cloud computing services such as big data and artificial intelligence platforms; terminal devices can be personal computers, smart phones, laptop computers, tablet computers , media players, dedicated video conferencing equipment, etc., but not limited to this. Network 150 represents any number of networks, such as wired and/or wireless communication networks, that communicate encoded video data between first electronic device 110 , second electronic device 120 , third electronic device 130 , and fourth electronic device 140 . Network 150 may exchange data in circuit-switched and/or packet-switched channels. The network 150 may include at least one of a telecommunications network, a local area network, a wide area network, and the Internet. For the purposes of the embodiments of the present application, unless explained below, the architecture and topology of the network 150 may be irrelevant to the operations disclosed by the embodiments of the present application.
在一些实施例中,图2示出视频编码装置和视频解码装置在流式传输环境中的放置方式。本申请实施例所公开主题可同等地适用于其它支持视频的应用,包括例如视频会议、数字电视机(TeleVision,TV)、在包括CD、DVD、存储棒等的数字介质上存储压缩视频等等。In some embodiments, Figure 2 illustrates the placement of a video encoding device and a video decoding device in a streaming environment. The subject matter disclosed in the embodiments of the present application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (TeleVision, TV), storage of compressed video on digital media including CDs, DVDs, memory sticks, etc. .
流式传输***可包括采集子***213,采集子***213可包括数码相机等视频源201,视频源201创建未压缩的视频图像流202。在一些实施例中,视频图像流202包括由数码相机拍摄的样本。相较于已编码的视频数据204(或已编码的视频码流204),视频图像流202在图2中被描绘为粗线,以强调视频图像流202的高数据量,视频图像流202可由电子设备220处理,电子设备220包括耦接到视频源201的视频编码装置203。视频编码装置203可包括硬件、软件或软硬件组合,以实现或实施如下文更详细地描述的所公开主题的各方面。相较于视频图像流202,已编码的视频数据204(或已编码的视频码流204)在图2中被描绘为细线,以强调已编码的视频数据204的较低数据量,其中,已编码的视频数据204可存储在流式传输服务器205上以供将来使用。一个或多个流式传输客户端子***,例如图2中的客户端子***206和客户端子***208,可访问流式传输服务器205以检索已编码的视频数据204的副本207和副本209。客户端子***206可包括例如电子设备230中的视频解码装置210。视频解码装置210对已编码的视频数据204的传入副本207进行解码,且产生可在显示器212(例如显示屏)或其他呈现装置上呈现的输出视频图像流211。在一些流式传输***中,可根据某些视频编码/压缩标准对已编码的视频数据204、视频数据207和视频数据209(例如视频码流)进行编码,视频编码/压缩标准包括但不限于ITU-T H.265。在一些实施例中,正在开发的视频编码标准非正式地称为下一代视频编码(Versatile Video Coding,VVC),本申请实施例可用于VVC标准的上下文中。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 201 creates an uncompressed video image stream 202 . In some embodiments, the video image stream 202 includes samples captured by a digital camera. Compared to the encoded video data 204 (or the encoded video code stream 204), the video image stream 202 is depicted as a thick line in FIG. 2 to emphasize the high data volume of the video image stream 202, which can be Processing is performed by electronic device 220 , which includes video encoding means 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. Compared to the video image stream 202, the encoded video data 204 (or the encoded video code stream 204) is depicted as a thin line in FIG. 2 to emphasize the lower data volume of the encoded video data 204, wherein, The encoded video data 204 may 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 204 and produces an output video image stream 211 that can be presented on a display 212 (eg, a display screen) or other presentation device. In some streaming systems, the encoded video data 204, video data 207, and video data 209 (eg, video bitstreams) may be encoded according to certain video encoding/compression standards, including but not limited to ITU-T H.265. In some embodiments, the video coding standard under development is informally referred to as Versatile Video Coding (VVC), and the embodiments of the present application may be used in the context of the VVC standard.
应注意,电子设备220和电子设备230可包括图中未示出的其它组件。举例来说,电子设备220可包括视频解码装置,电子设备230可包括视频编码装置。It should be noted that electronic device 220 and electronic device 230 may include other components not shown in the figures. For example, electronic device 220 may include a video decoding device, and electronic device 230 may include a video encoding device.
在一些实施例中,以高效率视频编码(High Efficiency Video Coding,HEVC)、多功能视频编码(Versatile Video Coding,VVC)等国际视频编码标准,以及作为中国国家视频编码标准的信源编码标准(Audio Video coding Standard,AVS)为例,当输入一个视频图像帧之后,会根据一个块大小,将视频图像帧划分成若干个不重叠的处理单元,每个处理单元将进行类似的压缩操作。这个处理单元被称作编码树单元(Coding Tree Unit,CTU),或者称之为最大编码单元(Largest Coding Unit,LCU)。CTU再往下可以继续进行更加精细的划分,得到一个或多个基本的编码单元CU,CU是一个编码环节中最基本的元素。以下介绍对CU进行编码时的一些概念:In some embodiments, high efficiency video coding (High Efficiency Video Coding, HEVC), Versatile Video Coding (Versatile Video Coding, VVC) and other international video coding standards, as well as China's national video coding standard Source coding standard ( Audio Video coding Standard, AVS) as an example, when a video image frame is input, the video image frame will be divided into several non-overlapping processing units according to a block size, and each processing unit will perform similar compression operations. This processing unit is called a Coding Tree Unit (CTU), or the Largest Coding Unit (LCU). The CTU can continue to be further divided into finer divisions to obtain one or more basic coding units CU, and CU is the most basic element in a coding link. The following introduces some concepts when encoding CUs:
预测编码(Predictive Coding):预测编码包括了帧内预测和帧间预测等方式,原始视频信号经过选定的已重建视频信号的预测后,得到残差视频信号。编码端需要为当前CU决定选择哪一种预测编码模式,并告知解码端。其中,帧内预测是指预测的信号来自于同一图像内已经编码重建过的区域;帧间预测是指预测的信号来自已经编码过的、不同于当前图像的其它图像(称之为参考图像)。Predictive Coding: 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):残差视频信号经过离散傅里叶变换(Discrete Fourier Transform,DFT)、DCT等变换操作后,将信号转换到变换域中,称之为变换系数。变换系数进一步进行有损的量化操作,丢失掉一定的信息,使得量化后的信号有利于压缩表达。在一些视频编码标准中,可能有多于一种变换方式可以选择,因此编码端也需要为当前CU选择其中的一种变换方式,并告知解码端。量化的精细程度通常由量化参数(Quantization Parameter,QP)来决定,QP取值较大,表示更大取值 范围的系数将被量化为同一个输出,因此通常会带来更大的失真及较低的码率;相反,QP取值较小,表示较小取值范围的系数将被量化为同一个输出,因此通常会带来较小的失真,同时对应较高的码率。Transform & Quantization: After the residual video signal undergoes transformation operations such as Discrete Fourier Transform (DFT) and DCT, the signal is converted into the transform domain, which is called transform coefficients. 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. In some video coding standards, there may be more than one transformation mode to choose from, so the encoder also needs to select one of the transformation modes for the current CU and inform the decoder. The fineness of quantization is usually determined by the Quantization Parameter (QP). The larger the value of QP, the more coefficients representing a larger value range will be quantized into the same output, which usually leads to greater distortion and higher quantization. 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)或统计编码:量化后的变换域信号将根据各个值出现的频率进行统计压缩编码,最后输出二值化(0或者1)的压缩码流。同时,编码产生其他信息,例如选择的编码模式、运动矢量数据等,也需要进行熵编码以降低码率。统计编码是一种无损的编码方式,可以有效的降低表达同样信号所需要的码率,常见的统计编码方式有变长编码(Variable Length Coding,VLC)或者基于上下文的二值化算术编码(Content Adaptive Binary Arithmetic Coding,CABAC)。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 bit rate required to express the same signal. Common statistical coding methods include Variable Length Coding (VLC) or context-based binary arithmetic coding (Content Coding). Adaptive Binary Arithmetic Coding, CABAC).
环路滤波(Loop Filtering):经过变化及量化的信号会通过反量化、反变换及预测补偿的操作获得重建图像。重建图像与原始图像相比由于存在量化的影响,部分信息与原始图像有所不同,即重建图像会产生失真(Distortion)。因此,可以对重建图像进行滤波操作,例如去块效应滤波(Deblocking filter,DB)、自适应像素补偿(Sample Adaptive Offset,SAO)或者自适应环路滤波(Adaptive Loop Filter,ALF)等滤波器,可以有效降低量化所产生的失真程度。由于这些经过滤波后的重建图像将作为后续编码图像的参考来对将来的图像信号进行预测,因此上述的滤波操作也被称为环路滤波,即在编码环路内的滤波操作。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, It 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.
在一些实施例中,图3示出了视频编码器的基本流程图,在该流程中以帧内预测为例进行说明。其中,对于视频帧图像,将该视频帧图像的原始图像信号s k[x,y]与预测图像信号
Figure PCTCN2021118810-appb-000001
做差值运算,得到残差信号u k[x,y],残差信号u k[x,y]经过变换及量化处理之后得到量化系数,量化系数一方面通过熵编码得到编码后的比特流,另一方面通过反量化及反变换处理得到重构残差信号u' k[x,y],预测图像信号
Figure PCTCN2021118810-appb-000002
与重构残差信号u' k[x,y]叠加生成图像信号
Figure PCTCN2021118810-appb-000003
图像信号
Figure PCTCN2021118810-appb-000004
一方面输入至帧内模式决策模块和帧内预测模块进行帧内预测处理,另一方面通过环路滤波输出重建图像信号s' k[x,y],重建图像信号s' k[x,y]可以作为下一帧视频帧图像的参考图像进行运动估计及运动补偿预测。然后基于运动补偿预测的结果s' r[x+m x,y+m y]和帧内预测结果
Figure PCTCN2021118810-appb-000005
得到下一帧视频帧图像的预测图像信号
Figure PCTCN2021118810-appb-000006
并继续重复上述过程,直至编码完成。
In some embodiments, FIG. 3 shows a basic flowchart of a video encoder, in which intra-frame prediction is used as an example. Among them, for the video frame image, the original image signal s k [x, y] of the video frame image is combined with the predicted image signal
Figure PCTCN2021118810-appb-000001
Do the difference operation to obtain the residual signal u k [x, y], and the residual signal u k [x, y] is transformed and quantized to obtain quantized coefficients. On the one hand, the quantized coefficients are encoded by entropy coding to obtain the encoded bits On the other hand, the reconstructed residual signal u' k [x, y] is obtained through inverse quantization and inverse transformation processing, and the predicted image signal
Figure PCTCN2021118810-appb-000002
It is superimposed with the reconstructed residual signal u' k [x, y] to generate an image signal
Figure PCTCN2021118810-appb-000003
image signal
Figure PCTCN2021118810-appb-000004
On the one hand, it is input to the intra - frame mode decision module and the intra-frame prediction module for intra-frame prediction processing; ] can be used as a reference image for the next video frame image for motion estimation and motion compensation prediction. Then based on the motion compensation prediction result s' r [x+m x ,y+m y ] and the intra prediction result
Figure PCTCN2021118810-appb-000005
Get the predicted image signal of the next frame of video frame image
Figure PCTCN2021118810-appb-000006
And continue to repeat the above process until the encoding is complete.
此外,由于残差信号在经过变换和量化处理后的量化系数块中非零系数较大概率会集中在块的左边和上方区域,而块的右边和下方区域往往为0,因此引入了扫描区域系数编码SRCC技术,通过SRCC技术可以标记出每个量化系数块(尺寸为W×H)中包含非零系数的左上区域的大小SRx×SRy,其中SRx是量化系数块中最右面的非零系数的横坐标,SRy是量化系数块中最下面的非零系数的纵坐标,且1≤SRx≤W,1≤SRy≤H,而该区域外的系数均为0。SRCC技术利用(SRx,SRy)来确定一个量化系数块中需要扫描的量化系数区域,如图4所示,只有(SRx,SRy)标记的扫描区域内的量化系数需要编码,编码的扫描顺序如图5所示,可以是从右下角到左上角的反向Z字型扫描。In addition, since the residual signal in the transformed and quantized quantized coefficient block has a high probability that the non-zero coefficients will be concentrated in the left and upper areas of the block, while the right and lower areas of the block are often 0, so the scanning area is introduced. Coefficient coding SRCC technology, through SRCC technology, the size of the upper left region containing non-zero coefficients in each quantized coefficient block (size W×H) can be marked SRx×SRy, where SRx is the rightmost non-zero coefficient in the quantized coefficient block The abscissa of SRy is the ordinate of the lowest non-zero coefficient in the quantized coefficient block, and 1≤SRx≤W, 1≤SRy≤H, and the coefficients outside this area are all 0. The SRCC technology uses (SRx, SRy) to determine the quantized coefficient area that needs to be scanned in a quantized coefficient block. 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.
基于上述的编码过程,在解码端针对每一个CU,在获取到压缩码流(即比特流)之后,进行熵解码得到各种模式信息及量化系数。然后量化系数经过反量化及反变换处理得到残差信号。另一方面,根据已知的编码模式信息,可获得该CU对应的预测信号,然后将残差信号与预测信号相加之后即可得到重建信号,重建信号再经过环路滤波等操作,产生最终的输出信号。Based on the above encoding process, for each CU at the decoding end, after obtaining the compressed code stream (ie bit stream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then, the quantized coefficients undergo inverse quantization and inverse transformation to obtain residual signals. On the other hand, according to the known coding mode information, 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.
在上述的编解码过程中,对残差信号的变换处理使得残差信号的能量集中在较少的低频系数,也就是多数系数值较小。然后经过后续的量化模块后,较小系数值将变为零值,极大降低了编码残差信号的代价。但是,由于残差分布的多样性,单一的DCT变换无法适应所有的残差特性,因此,可以将DST7和DCT8这样的变换核引入到变换处理过程中,并且对残差信号进行的水平变换和竖直变换可以采用不同的变换核。以自适应多核变换(Adaptive Multiple core Transform,AMT)技术为例,对于一个残差信号进行变换处理可能选择的变换组合如下所示:(DCT2,DCT2)、(DCT8,DCT8)、(DCT8,DST7)、(DST7,DCT8)和(DST7,DST7)。In the above encoding and decoding process, 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. However, due to the diversity of residual distribution, a single DCT transform cannot adapt to all residual characteristics. Therefore, transform kernels such as DST7 and DCT8 can be introduced into the transformation process, and the horizontal transform and Vertical transforms can use different transform kernels. Taking the Adaptive Multiple Core Transform (AMT) technology as an example, the possible combinations of transforms that can be selected for transforming a residual signal are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7) ), (DST7, DCT8) and (DST7, DST7).
对于残差信号具体选择哪种变换组合,可以在编码端使用率失真优化(Rate–Distortion Optimization,RDO)进行决策,虽然采用多个变换核提升了变换矩阵组合对残差块的适应性,但是由于需要针对每个编码单元来编码变换核的索引,因此导致编解码效率较低。As for which transformation combination to choose for the residual signal, rate-distortion optimization (Rate-Distortion Optimization, RDO) can be used at the encoding end to make a decision. Although multiple transformation kernels are used to improve the adaptability of the transformation matrix combination to the residual block, but Since the index of the transform kernel needs to be encoded for each coding unit, the encoding and decoding efficiency is low.
针对上述问题,本申请实施例提出了通过量化系数块中的量化系数来隐含指示编码块对应的变换矩阵组合,进而可以降低变换矩阵索引所占用的比特位,有效提高了视频编解码效率。In response to the above problems, the embodiments of the present application propose to use the quantization coefficients in the quantization coefficient block to implicitly indicate the transformation matrix combination corresponding to the coding block, thereby reducing the bits occupied by the transformation matrix index and effectively improving the video coding and decoding efficiency.
以下对本申请实施例的技术方案的实现细节进行详细阐述。The implementation details of the technical solutions of the embodiments of the present application are described in detail below.
图6A示出了本申请实施例的视频编码方法的流程图,该视频编码方法可以由具有计算处理功能的电子设备来执行,比如可以由终端设备或服务器来执行。参照图6A所示,该视频编码方法至少包括步骤S510至步骤S540,详细介绍如下:FIG. 6A shows a flowchart of a video encoding method according to an embodiment of the present application. The video encoding method may be executed by an electronic device with a computing processing function, such as a terminal device or a server. Referring to FIG. 6A , the video encoding method at least includes steps S510 to S540, and the details are as follows:
在步骤S510中,确定视频帧图像的原始图像信号与预测图像信号之间的残差数据。In step S510, residual data between the original image signal and the predicted image signal of the video frame image is determined.
在步骤S520中,基于变换矩阵组合对残差数据进行变换处理,得到变换结果。In step S520, transform processing is performed on the residual data based on the transform matrix combination to obtain a transform result.
在步骤S530中,对变换结果进行量化处理,得到量化系数;其中,量化系数用于指示变换矩阵组合。In step S530, the transform result is quantized to obtain quantized coefficients; wherein, the quantized coefficients are used to indicate the combination of transform matrices.
在步骤S540中,对量化系数进行熵编码处理,得到编码块。In step S540, entropy coding is performed on the quantized coefficients to obtain coding blocks.
图6B示出了本申请实施例的视频解码方法的流程图,该视频解码方法可以由具有计算处理功能的电子设备来执行,比如可以由终端设备或服务器来执行。参照图6B所示,该视频解码方法至少包括步骤S610至步骤S640,详细介绍如下:FIG. 6B shows a flowchart of a video decoding method according to an embodiment of the present application. The video decoding method may be executed by an electronic device with a computing processing function, such as a terminal device or a server. Referring to FIG. 6B , the video decoding method includes at least steps S610 to S640, which are described in detail as follows:
在步骤S610中,对视频图像帧的编码块进行熵解码处理,得到编码块对应的残差数据的量化系数块。In step S610, entropy decoding processing is performed on the coded block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coded block.
在一些实施例中,视频图像帧序列包括了一系列图像,每张图像可以被进一步划分为条带(Slice),条带又可以划分为一系列的LCU(或CTU),LCU包含有若干CU。视频图像帧在编码时是以块为单位进行编码处理,在一些新的视频编码标准中,比如在H.264标准中有宏块(MacroBlock,MB),宏块可进一步划分成多个可用于预测编码的预测块(prediction)。在HEVC标准中,采用编码单元CU、预测单元(prediction unit,PU)和变换单元(transform unit,TU)等基本概念,从功能上划分了多种块单元,并采用全新的基于树的结构进行描述。比如CU可以按照四叉树划分为更小的CU,而更小的CU还可以继续划分,从而形成一种四叉树结构。本申请实施例中的编码块可以是CU,或者是比CU更小的块,如对CU进行划分得到的更小的块。In some embodiments, the video image frame sequence includes a series of images, each image can be further divided into slices, and the slices can be divided into a series of LCUs (or CTUs), and the LCUs include several CUs . The video image frame is coded in block units. In some new video coding standards, such as the H.264 standard, there is a macroblock (MB). The macroblock can be further divided into multiple blocks that can be used for Prediction block (prediction) for predictive coding. In the HEVC standard, 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. For example, 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.
在步骤S620中,对量化系数块中的多个区域内的量化系数分别进行统计处理,得到多个区域中各个区域的统计结果,确定各个区域的统计结果针对设定值的余数。In step S620, statistical processing is performed on the quantization coefficients in the multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of each of the multiple regions, and determine the remainder of the statistical results of each region to the set value.
这里,多个区域是指至少两个区域,该多个区域可以是量化系数块中的全部区域,也可以是量化系数块中的部分区域。Here, the multiple regions refer to at least two regions, and the multiple regions may be all the regions in the quantized coefficient block, or may be part of the regions in the quantized coefficient block.
在一些实施例中,可以根据编码块对应的索引标识的取值,确定对应的编码数据中的该编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵 组合。当索引标识的取值表示编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合时,可以对该编码块进行熵解码处理,得到该编码块对应的残差数据的量化系数块。其中,指定的索引标识可以包括以下至少之一:视频图像帧序列对应的第一编码数据的序列头、视频图像帧对应的第二编码数据的图像头、视频图像帧的一个条带对应的第三编码数据的条带头、视频图像帧的一个最大编码单元LCU对应的第四编码数据的LCU头。详细说明如下:In some embodiments, according to the value of the index identifier corresponding to the coding block, it can be determined whether the coding block in the corresponding coded data needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding. When the value of the index flag indicates that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding, entropy decoding processing can be performed on the coding block to obtain the residual data corresponding to the coding block. Quantized coefficient block. The specified index identifier may include at least one of the following: the sequence header of the first encoded data corresponding to the video image frame sequence, the image header of the second encoded data corresponding to the video image frame, and the first encoded data corresponding to a slice of the video image frame. Three slice headers of coded data and an LCU header of fourth coded data corresponding to one largest coding unit LCU of a video image frame. Details are as follows:
在一些实施例中,可以通过视频图像帧序列对应的第一编码数据的序列头部包含的索引标识的取值,来指示第一编码数据中的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如当第一编码数据的序列头部中的指定索引标识的取值为1时,表示第一编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。该实施例的技术方案使得通过视频图像帧序列对应的第一编码数据的序列头部中的一个索引标识,实现了对整个视频图像帧序列对应的所有目标编码块的指示,进而可以有效降低索引标识所占用的比特位,提高视频编解码效率。需要说明的是:第一编码数据中的目标编码块可以是第一编码数据中的所有编码块(即采用任意编码模式的编码块),可以是第一编码数据中采用帧内编码模式的编码块,也可以是第一编码数据中采用帧间编码模式的编码块。In some embodiments, the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence may be used to indicate whether the encoded block in the first encoded data needs a quantization coefficient block obtained by entropy decoding The quantization coefficients in select the corresponding transformation matrix combination. For example, when the value of the specified index identifier in the sequence header of the first encoded data is 1, it indicates that the target encoding block in the first encoded data needs to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding combination. The technical solution of this embodiment enables the indication of all target coding blocks corresponding to the entire video image frame sequence through an index identifier in the sequence header of the first encoded data corresponding to the video image frame sequence, thereby effectively reducing the index Identifies the occupied bits to improve the efficiency of video encoding and decoding. It should be noted that: the target coding block in the first coded data may be all coding blocks in the first coded data (that is, coding blocks using any coding mode), or may be coding using the intra-frame coding mode in the first coded data The block may also be an encoding block in the first encoded data that adopts the inter-frame encoding mode.
在一些实施例中,可以通过视频图像帧对应的第二编码数据的图像头部中包含的索引标识的取值,来指示第二编码数据中的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如当第二编码数据的图像头部中的指定索引标识的取值为1时,表示第二编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。该实施例的技术方案使得通过视频图像帧对应的第二编码数据的图像头部中的一个索引标识,实现了对整个视频图像帧对应的所有目标编码块的指示,同样可以降低索引标识所占用的比特位,提高视频编解码效率。需要说明的是:第二编码数据中的目标编码块可以是第二编码数据中的所有编码块,可以是第二编码数据中采用帧内编码模式的编码块,也可以是第二编码数据中采用帧间编码模式的编码块。In some embodiments, the value of the index identifier included in the image header of the second encoded data corresponding to the video image frame may be used to indicate whether the encoded block in the second encoded data needs a quantization coefficient block obtained by entropy decoding The quantization coefficients in select the corresponding transformation matrix combination. For example, when the value of the specified index flag in the image header of the second coded data is 1, it means that the target coding block in the second coded data needs to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding combination. The technical solution of this embodiment enables the indication of all target coding blocks corresponding to the entire video image frame through an index identifier in the image header of the second encoded data corresponding to the video image frame, which can also reduce the occupation of the index identifier. bits to improve the efficiency of video encoding and decoding. It should be noted that: the target coding block in the second coded data may be all coding blocks in the second coded data, may be coding blocks in the second coded data using the intra-frame coding mode, or may be the coding blocks in the second coded data. Coding block in inter coding mode.
在一些实施例中,可以通过视频图像帧的一个条带对应的第三编码数据的条带头部信息中包含的索引标识的取值,来指示第三编码数据中的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如当第三编码数据的条带头部信息中的指定索引标识的取值为1时,表示第三编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。该实施例的技术方案使得通过视频图像帧的一个条带对应的第三编码数据的条带头部中的一个索引标识,实现了对整个条带对应的所有目标编码块的指示,同样可以降低索引标识所占用的比特位,提高视频编解码效率。需要说明的是:第三编码数据中的目标编码块可以是第三编码数据中的所有编码块,可以是第三编码数据中采用帧内编码模式的编码块,也可以是第三编码数据中采用帧间编码模式的编码块。In some embodiments, the value of the index identifier included in the slice header information of the third encoded data corresponding to one slice of the video image frame may be used to indicate whether the encoding block in the third encoded data needs to be based on entropy The quantized coefficients in the decoded quantized coefficient block select the corresponding transformation matrix combination. For example, when the value of the specified index identifier in the slice header information of the third encoded data is 1, it means that the target encoding block in the third encoded data needs to select the corresponding quantization coefficient according to the quantization coefficient block in the quantization coefficient block obtained by entropy decoding. Transformation matrix combination. The technical solution of this embodiment makes it possible to realize the indication of all target coding blocks corresponding to the entire slice through an index identifier in the slice header of the third encoded data corresponding to one slice of the video image frame, which can also reduce the The index identifies the occupied bits, which improves the video coding and decoding efficiency. It should be noted that: the target coding blocks in the third coded data may be all coding blocks in the third coded data, may be coding blocks in the third coded data using the intra-frame coding mode, or may be the coding blocks in the third coded data. Coding block in inter coding mode.
在一些实施例中,可以通过视频图像帧的一个LCU对应的第四编码数据的LCU头部信息中包含的索引标识的取值,来指示第四编码数据中的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如当第四编码数据的LCU头部信息中的指定索引标识的取值为1时,表示第四编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。该实施例的技术方案使得通过视频图像帧的一个LCU对应的第四编码数据的LCU头部信息中的一个索引标识,实现了对整个LCU对应的所有目标编码块的指示,同样可以降低索引标识所占用的比特位,提高视频编解码效率。需要说明的是:第四编码数据中的目标编码块可以是 第四编码数据中的所有编码块,可以是第四编码数据中采用帧内编码模式的编码块,也可以是第四编码数据中采用帧间编码模式的编码块。In some embodiments, the value of the index identifier included in the LCU header information of the fourth encoded data corresponding to one LCU of the video image frame may be used to indicate whether the encoded block in the fourth encoded data needs to be obtained according to entropy decoding. The quantization coefficients in the quantization coefficient block select the corresponding transformation matrix combination. For example, when the value of the specified index identifier in the LCU header information of the fourth encoded data is 1, it means that the target encoding block in the fourth encoded data needs to select the corresponding transform according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding matrix combination. The technical solution of this embodiment enables an index identification in the LCU header information of the fourth encoded data corresponding to one LCU of the video image frame to realize the indication of all target encoding blocks corresponding to the entire LCU, and the index identification can also be reduced. The occupied bits can improve the efficiency of video coding and decoding. It should be noted that: the target coding blocks in the fourth coded data may be all coding blocks in the fourth coded data, may be coding blocks in the fourth coded data using the intra-frame coding mode, or may be the coding blocks in the fourth coded data. Coding block in inter coding mode.
在一些实施例中,也可以根据编码块的尺寸大小和预设阈值范围之间的关系,确定编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如,若编码块的尺寸较小(如小于第一预设阈值),则可以确定该编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;相反地,若编码块的尺寸较大(如大于第二预设阈值),则可以确定该编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,其中,第一预设阈值及第二预设阈值构成了预设阈值范围,且第二预设阈值大于或等于第一预设阈值。该实施例的技术方案可以根据编码块的尺寸来隐含指示是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,无需额外的比特位,因此也可以提高视频编解码效率。In some embodiments, it may also be determined according to the relationship between the size of the coding block and the preset threshold range whether the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding. For example, if the size of the coding block is small (for example, smaller than the first preset threshold), it can be determined that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; The size of the block is larger (for example, larger than the second preset threshold), it can be determined that the encoding block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding, wherein the first preset threshold and The second preset threshold constitutes a preset threshold range, and the second preset threshold is greater than or equal to the first preset threshold. The technical solution of this embodiment can implicitly indicate whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding according to the size of the coding block, without additional bits, so it can also improve the video coding and decoding. effectiveness.
在一些实施例中,当视频图像帧序列对应的第一编码数据的序列头部包含的索引标识的取值为第一值(比如可以为0)时,确定第一编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当该序列头部包含的索引标识的取值为第二值(比如可以为1)时,可以进一步根据视频图像帧序列中的视频图像帧所对应的第二编码数据的图像头部包含的索引标识的取值来进行决策。需要说明的是:第一编码数据中的目标编码块可以是第一编码数据中的所有编码块,可以是第一编码数据中采用帧内编码模式的编码块,也可以是第一编码数据中采用帧间编码模式的编码块。In some embodiments, when the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence is the first value (for example, it may be 0), determine the target encoding block in the first encoded data It is not necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the index identifier included in the sequence header is the second value (for example, it can be 1), it can be further based on the video image. The decision is made based on the value of the index identifier included in the image header of the second encoded data corresponding to the video image frame in the frame sequence. It should be noted that the target coding blocks in the first coded data may be all coding blocks in the first coded data, may be coding blocks in the first coded data using the intra-frame coding mode, or may be the coding blocks in the first coded data. Coding block in inter coding mode.
在一些实施例中,当前述的序列头部包含的索引标识的取值为第二值(比如可以为1)、且前述的图像头部包含的索引标识的取值为第一值(比如可以为0)时,可以确定第二编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。当前述的序列头部包含的索引标识的取值和前述的图像头部包含的索引标识的取值均为第二值(比如可以为1)时,那么可以确定第二编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,这种情况下,可以不再通过条带头部信息、LCU头部信息和编码块的尺寸大小进行决策。需要说明的是:第二编码数据中的目标编码块可以是第二编码数据中的所有编码块,可以是第二编码数据中采用帧内编码模式的编码块,也可以是第二编码数据中采用帧间编码模式的编码块。In some embodiments, when the value of the index identifier included in the foregoing sequence header is the second value (for example, it may be 1), and the value of the index identifier included in the foregoing image header is the first value (for example, it may be When it is 0), it can be determined that the target coding block in the second coded data does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding. When the value of the index identifier included in the foregoing sequence header and the value of the index identifier included in the foregoing image header are both the second value (for example, it may be 1), then the target code in the second encoded data can be determined. The block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding. In this case, the decision can no longer be made by the slice header information, the LCU header information and the size of the coding block. It should be noted that: the target coding block in the second coded data may be all coding blocks in the second coded data, may be coding blocks in the second coded data using the intra-frame coding mode, or may be the coding blocks in the second coded data. Coding block in inter coding mode.
当然,在一些实施例中,当前述的序列头部包含的索引标识的取值和前述的图像头部包含的索引标识的取值均为第二值(比如可以为1)时,那么也可以进一步根据视频图像帧的条带所对应的第三编码数据的条带头部信息包含的索引标识的取值来进行决策。比如,当前述序列头部包含的索引标识的取值为第二值、前述图像头部包含的索引标识的取值为第二值、且一个条带对应的第三编码数据的条带头部信息包含的索引标识的取值为第一值(比如可以为0)时,那么可以确定第三编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。当前述的序列头部包含的索引标识的取值、前述的图像头部包含的索引标识的取值和前述条带头部信息包含的索引标识的取值均为第二值(比如可以为1)时,那么可以确定第三编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,这种情况下,可以不再通过LCU头和编码块的尺寸大小进行决策。需要说明的是:第三编码数据中的目标编码块可以是第三编码数据中的所有编码块,可以是第三编码数据中采用帧内编码模式的编码块,也可以是第三编码数据中采用帧间编码模式的编码块。Of course, in some embodiments, when the value of the index identifier included in the foregoing sequence header and the value of the index identifier included in the foregoing image header are both the second value (for example, it may be 1), then it is also possible to The decision is further made according to the value of the index identifier included in the slice header information of the third encoded data corresponding to the slice of the video image frame. For example, when the value of the index identifier included in the foregoing sequence header is the second value, the value of the index identifier included in the foregoing image header is the second value, and the slice header of the third encoded data corresponding to one slice is When the value of the index identifier included in the information is the first value (for example, it can be 0), it can be determined that the target coding block in the third coded data does not need to select the corresponding transform according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding matrix combination. When the value of the index identifier included in the aforementioned sequence header, the value of the index identifier included in the aforementioned image header, and the value of the index identifier included in the aforementioned slice header information are all second values (for example, it may be 1 ), then it can be determined that the target encoding block in the third encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. size decision. It should be noted that: the target coding blocks in the third coded data may be all coding blocks in the third coded data, may be coding blocks in the third coded data using the intra-frame coding mode, or may be the coding blocks in the third coded data. Coding block in inter coding mode.
当然,在一些实施例中,当前述的序列头部包含的索引标识的取值、前述的图像头 部包含的索引标识的取值和前述条带头部信息包含的索引标识的取值均为第二值(比如可以为1)时,那么也可以进一步根据条带中的LCU所对应的第四编码数据的LCU头部信息包含的索引标识的取值来进行决策。比如,若前述序列头部包含的索引标识的取值、前述图像头部包含的索引标识的取值和前述条带头部信息包含的索引标识的取值均为第二值,但一个LCU对应的第四编码数据的LCU头部信息包含的索引标识的取值为第一值(比如可以为0),那么可以确定第四编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。如果前述的序列头部包含的索引标识的取值、前述的图像头部包含的索引标识的取值、前述条带头部信息包含的索引标识的取值和前述LCU头部信息包含的索引标识的取值均为第二值(比如可以为1),那么可以确定第四编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,这种情况下,可以不再通过编码块的尺寸大小进行决策。需要说明的是:第四编码数据中的目标编码块可以是第四编码数据中的所有编码块,可以是第四编码数据中采用帧内编码模式的编码块,也可以是第四编码数据中采用帧间编码模式的编码块。Of course, in some embodiments, when the value of the index identifier included in the aforementioned sequence header, the value of the index identifier included in the aforementioned image header, and the value of the index identifier included in the aforementioned slice header information are all When the second value (for example, may be 1), the decision may be further based on the value of the index identifier included in the LCU header information of the fourth encoded data corresponding to the LCU in the slice. For example, if the value of the index identifier included in the preceding sequence header, the value of the index identifier included in the preceding image header, and the value of the index identifier included in the preceding slice header information are all second values, but one LCU corresponds to The value of the index identifier contained in the LCU header information of the fourth encoded data is the first value (for example, it may be 0), then it can be determined that the target encoding block in the fourth encoded data does not need to be decoded according to entropy. The obtained quantization coefficient block The quantization coefficients in select the corresponding transformation matrix combination. If the value of the index identifier included in the aforementioned sequence header, the value of the index identifier included in the aforementioned image header, the value of the index identifier included in the aforementioned slice header information, and the value of the index identifier included in the aforementioned LCU header information is the second value (for example, it can be 1), then it can be determined that the target coding block in the fourth coded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. In this case In this case, the decision can no longer be made by the size of the coding block. It should be noted that: the target coding blocks in the fourth coded data may be all coding blocks in the fourth coded data, may be coding blocks in the fourth coded data using the intra-frame coding mode, or may be the coding blocks in the fourth coded data. Coding block in inter coding mode.
当然,在一些实施例中,当前述的序列头部包含的索引标识的取值、前述的图像头部包含的索引标识的取值、前述条带头部信息包含的索引标识的取值和前述LCU头部信息包含的索引标识的取值均为第二值(比如可以为1)时,那么也可以进一步根据编码块的尺寸大小来进行决策。比如,若前述的序列头部包含的索引标识的取值、前述的图像头部包含的索引标识的取值、前述条带头部信息包含的索引标识的取值和前述LCU头部信息包含的索引标识的取值均为第二值,但一个编码块的尺寸较小(如小于某个预设阈值),则可以确定该编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;相反地,若编码块的尺寸较大(如大于某个预设阈值),则可以确定该编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。Of course, in some embodiments, when the value of the index identifier included in the foregoing sequence header, the value of the index identifier included in the foregoing image header, the value of the index identifier included in the foregoing slice header information, and the foregoing value of the index identifier When the value of the index identifier included in the LCU header information is all the second value (for example, it may be 1), the decision may be further made according to the size of the coding block. For example, if the value of the index identifier contained in the preceding sequence header, the value of the index identifier contained in the preceding image header, the value of the index identifier contained in the preceding slice header information, and the value of the index identifier contained in the preceding LCU header information The value of the index identifier is the second value, but the size of a coding block is small (for example, smaller than a certain preset threshold), it can be determined that the coding block needs to select the corresponding quantization coefficient in the quantization coefficient block obtained by entropy decoding. On the contrary, if the size of the coding block is larger (such as larger than a certain preset threshold), it can be determined that the coding block does not need to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding combination.
在一些实施例中,也可以通过指示位来对编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块分别指示是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。将在后文进行示例说明。In some embodiments, an indication bit may also be used to respectively indicate whether the quantization coefficient selection in the quantization coefficient block obtained by entropy decoding is required for the coding block using the intra-frame coding mode and the coding block using the inter-frame coding mode in the coded data respectively. The corresponding transformation matrix combination. An example will be described later.
在一些实施例中,可以根据视频图像帧序列对应的第一编码数据的序列头部包含的第一指示位的取值和第二指示位的取值,分别确定第一编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如,当第一编码数据的序列头部包含的第一指示位的取值为0时,表示第一编码数据中采用帧内编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第一编码数据的序列头部包含的第一指示位的取值为1时,表示第一编码数据中采用帧内编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第一编码数据的序列头部包含的第二指示位的取值为0时,表示第一编码数据中采用帧间编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第一编码数据的序列头部包含的第二指示位的取值为1时,表示第一编码数据中采用帧间编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In some embodiments, according to the value of the first indicator bit and the value of the second indicator bit included in the sequence header of the first encoded data corresponding to the video image frame sequence, it is possible to determine, respectively, that the first encoded data adopts the intra-frame value. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding for the coding block in the coding mode and the coding block in the inter coding mode. For example, when the value of the first indicator bit included in the sequence header of the first encoded data is 0, it indicates that the encoding block in the first encoded data that adopts the intra-frame encoding mode does not need to be decoded according to the entropy decoding in the quantization coefficient block. The quantization coefficient selects the corresponding transformation matrix combination; when the value of the first indicator bit contained in the sequence header of the first encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the first encoded data needs to be obtained according to entropy decoding The corresponding transformation matrix combination is selected for the quantization coefficients in the quantization coefficient block of The block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit contained in the sequence header of the first encoded data is 1, it indicates that the first encoded data contains The coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
在一些实施例中,可以根据视频图像帧对应的第二编码数据的图像头部包含的第一指示位的取值和第二指示位的取值,分别确定第二编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如,当第二编码数据的图像头部包含的第一指示位的取值 为0时,表示第二编码数据中采用帧内编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第二编码数据的图像头部包含的第一指示位的取值为1时,表示第二编码数据中采用帧内编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第二编码数据的图像头部包含的第二指示位的取值为0时,表示第二编码数据中采用帧间编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第二编码数据的图像头部包含的第二指示位的取值为1时,表示第二编码数据中采用帧间编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In some embodiments, according to the value of the first indicator bit and the value of the second indicator bit included in the image header of the second encoded data corresponding to the video image frame, it may be determined that intra-frame encoding is used in the second encoded data, respectively. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding for the coding block of the mode and the coding block using the inter coding mode. For example, when the value of the first indicator bit included in the image header of the second encoded data is 0, it indicates that the encoding block in the second encoded data that adopts the intra-frame encoding mode does not need to decode the quantization coefficient block obtained by entropy decoding. The quantization coefficient selects the corresponding transformation matrix combination; when the value of the first indicator bit contained in the image header of the second encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the second encoded data needs to be obtained according to entropy decoding The corresponding transformation matrix combination is selected for the quantization coefficients in the quantization coefficient block of The block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit included in the image header of the second encoded data is 1, it indicates that the second encoded data contains The coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
在一些实施例中,根据视频图像帧的一个条带对应的第三编码数据的条带头部信息包含的第一指示位的取值和第二指示位的取值,分别确定第三编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如,当第三编码数据的条带头部信息包含的第一指示位的取值为0时,表示第三编码数据中采用帧内编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第三编码数据的条带头部信息包含的第一指示位的取值为1时,表示第三编码数据中采用帧内编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第三编码数据的条带头部信息包含的第二指示位的取值为0时,表示第三编码数据中采用帧间编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第三编码数据的条带头部信息包含的第二指示位的取值为1时,表示第三编码数据中采用帧间编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In some embodiments, the third encoded data is determined respectively according to the value of the first indicator bit and the value of the second indicator bit included in the slice header information of the third encoded data corresponding to one slice of the video image frame Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding for the coding block in the intra-frame coding mode and the coding block in the inter-frame coding mode. For example, when the value of the first indicator bit included in the slice header information of the third encoded data is 0, it means that the encoding block in the third encoded data that adopts the intra-frame encoding mode does not need the quantization coefficient block obtained by entropy decoding. The quantization coefficient in selects the corresponding transformation matrix combination; when the value of the first indicator bit contained in the slice header information of the third encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the third encoded data needs to be Select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit included in the slice header information of the third encoded data is 0, it indicates that the third encoded data adopts The coding block of the inter-frame coding mode does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit included in the slice header information of the third coded data is 1 , indicating that the encoding block in the inter-frame encoding mode in the third encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
在一些实施例中,根据视频图像帧的一个LCU对应的第四编码数据的LCU头部信息包含的第一指示位的取值和第二指示位的取值,分别确定第四编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。比如,当第四编码数据的LCU头部信息包含的第一指示位的取值为0时,表示第四编码数据中采用帧内编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第四编码数据的LCU头部信息包含的第一指示位的取值为1时,表示第四编码数据中采用帧内编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第四编码数据的LCU头部信息包含的第二指示位的取值为0时,表示第四编码数据中采用帧间编码模式的编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;当第四编码数据的LCU头部信息包含的第二指示位的取值为1时,表示第四编码数据中采用帧间编码模式的编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In some embodiments, according to the value of the first indicator bit and the value of the second indicator bit included in the LCU header information of the fourth encoded data corresponding to one LCU of the video image frame, it is respectively determined that the fourth encoded data adopts the value of the first indicator bit and the value of the second indicator bit. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding for the coding block in the intra-frame coding mode and the coding block in the inter-frame coding mode. For example, when the value of the first indicator bit included in the LCU header information of the fourth encoded data is 0, it indicates that the encoding block in the fourth encoded data that adopts the intra-frame encoding mode does not need to be decoded according to the entropy decoding in the quantization coefficient block. When the value of the first indicator bit contained in the LCU header information of the fourth encoded data is 1, it indicates that the encoding block using the intra-frame encoding mode in the fourth encoded data needs to be based on the entropy The corresponding transformation matrix combination is selected for the quantization coefficients in the quantization coefficient block obtained by decoding; when the value of the second indicator bit included in the LCU header information of the fourth encoded data is 0, it indicates that the fourth encoded data adopts inter-frame encoding. The encoding block of the mode does not need to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; when the value of the second indicator bit contained in the LCU header information of the fourth encoded data is 1, it indicates that the first Among the four coded data, the coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
需要说明的是:在通过指示位对编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块分别指示是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合时,也可以采用类似于前述实施例中的方案,由序列头部中的指示位和图像头部中的指示位来共同决策,或者由序列头部中的指示位、图像头部中的指示位和条带头部信息中的指示位来共同决策,或者由序列头部中的指示位、图像头部中的指示位、条带头部信息中的指示位和LCU头部信息中的指示位来共同决策,或者由序列头部中的指示位、图像头部中的指示位、条带头部信息中的指示位、LCU头部信息中的指示位,以及编码块的尺寸大小来共同决策。It should be noted that: the coding block using the intra-frame coding mode and the coding block using the inter-frame coding mode in the coded data by indicating the bit pair respectively indicate whether the corresponding transform needs to be selected according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. When matrices are combined, a scheme similar to that in the previous embodiment can also be adopted, and the indicator bits in the sequence header and the indicator bits in the image header are used to jointly decide, or the indicator bits in the sequence header and the indicator bits in the image header are used. The indicator bits in the slice header information and the indicator bits in the slice header information are jointly decided, or the indicator bits in the sequence header, the indicator bits in the image header, the indicator bits in the slice header information, and the LCU header information. The indicator bits in the sequence header, the indicator bits in the picture header, the indicator bits in the slice header information, the indicator bits in the LCU header information, and the size of the coding block to make decisions together.
综上,在确定是否需要根据量化系数块中的量化系数选择编码块对应的变换矩阵组合时,有以下方式:To sum up, when determining whether it is necessary to select the transformation matrix combination corresponding to the coding block according to the quantization coefficients in the quantization coefficient block, there are the following methods:
1、仅通过前述序列头部中的索引标识来指示,不再通过图像头部、条带头部信息、LCU头部信息和编码块的尺寸大小来进行决策。此时,若序列头部中的索引标识的取值为1(数值仅为示例),就说明视频图像帧序列对应的第一编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。1. It is only indicated by the index identifier in the aforementioned sequence header, and the decision is no longer made by the image header, slice header information, LCU header information and the size of the coding block. At this time, if the value of the index identifier in the sequence header is 1 (the value is only an example), it means that the target coding block in the first coded data corresponding to the video image frame sequence needs to be in the quantization coefficient block obtained by entropy decoding. The quantization coefficients of , select the corresponding transformation matrix combination.
另外,也可以仅通过序列头部中的指示位来对视频图像帧序列对应的第一编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块分别进行指示。即序列头部包含有两个指示位,一个指示位用于指示第一编码数据中采用帧内编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,另一个指示位用于指示第一编码数据中采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In addition, the coding block using the intra-frame coding mode and the coding block using the inter-frame coding mode in the first coded data corresponding to the video image frame sequence may also be respectively indicated by the indication bit in the sequence header. That is, the sequence header contains two indicator bits, and one indicator bit is used to indicate whether the encoding block using the intra-frame encoding mode in the first encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. , and another indication bit is used to indicate whether the coding block in the first coded data using the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
2、仅通过前述图像头部中的索引标识来指示,不再通过序列头部、条带头部信息、LCU头部信息和编码块的尺寸大小来进行决策。此时,若图像头部中的索引标识的取值为1(数值仅为示例),就说明视频图像帧对应的第二编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。2. It is only indicated by the index identifier in the aforementioned image header, and the decision is no longer made by the sequence header, slice header information, LCU header information and the size of the coding block. At this time, if the value of the index identifier in the image header is 1 (the value is only an example), it means that the target coding block in the second coded data corresponding to the video image frame needs to be decoded according to the entropy decoding in the quantization coefficient block. The quantization coefficient selects the corresponding transformation matrix combination.
另外,也可以仅通过图像头部中的指示位来对视频图像帧对应的第二编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块分别进行指示。即图像头部包含有两个指示位,一个指示位用于指示第二编码数据中采用帧内编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,另一个指示位用于指示第二编码数据中采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In addition, only the indication bits in the image header may be used to separately indicate the coding blocks that use the intra-frame coding mode and the coding blocks that use the inter-frame coding mode in the second coded data corresponding to the video image frame. That is, the image header contains two indicator bits, and one indicator bit is used to indicate whether the encoding block using the intra-frame encoding mode in the second encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. , and another indicator bit is used to indicate whether the encoding block in the inter-frame encoding mode in the second encoded data needs to select a corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
3、仅通过前述条带头部信息中的索引标识来指示,不再通过序列头部、图像头部、LCU头部信息和编码块的尺寸大小来进行决策。此时,若条带头部信息中的索引标识的取值为1(数值仅为示例),就说明条带对应的第三编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。3. It is only indicated by the index identifier in the foregoing slice header information, and the decision is no longer made by the sequence header, the picture header, the LCU header information and the size of the coding block. At this time, if the value of the index identifier in the slice header information is 1 (the value is only an example), it means that the target encoding block in the third encoded data corresponding to the slice needs to be in the quantization coefficient block obtained by entropy decoding. The quantization coefficients of , select the corresponding transformation matrix combination.
另外,也可以仅通过条带头部信息中的指示位来对条带对应的第三编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块分别进行指示。即条带头部信息包含有两个指示位,一个指示位用于指示第三编码数据中采用帧内编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,另一个指示位用于指示第三编码数据中采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In addition, only the indication bits in the slice header information may be used to separately indicate the coding blocks that use the intra-frame coding mode and the coding blocks that use the inter-frame coding mode in the third coded data corresponding to the slice. That is, the slice header information includes two indicator bits, and one indicator bit is used to indicate whether the encoding block in the intra-frame encoding mode in the third encoded data needs to select the corresponding transform according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. Matrix combination, and another indicator bit is used to indicate whether the coding block in the inter-frame coding mode in the third coded data needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
4、仅通过前述LCU头部信息中的索引标识来指示,不再通过序列头部、图像头部、条带头部信息和编码块的尺寸大小来进行决策。此时,若LCU头部信息中的索引标识的取值为1(数值仅为示例),就说明LCU对应的第四编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。4. It is only indicated by the index identifier in the aforementioned LCU header information, and the decision is no longer made by the sequence header, the image header, the slice header information and the size of the coding block. At this time, if the value of the index identifier in the LCU header information is 1 (the value is only an example), it means that the target coding block in the fourth coded data corresponding to the LCU needs to be quantized according to the quantization coefficient block obtained by entropy decoding. The coefficient selects the corresponding transformation matrix combination.
另外,也可以仅通过LCU头部信息中的指示位来对LCU对应的第四编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块分别进行指示。即LCU头部信息包含有两个指示位,一个指示位用于指示第四编码数据中采用帧内编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合,另一个指示位用于指示第四编码数据中采用帧间编码模式的编码块是否需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。In addition, only the indication bits in the LCU header information may be used to separately indicate the coding blocks that use the intra-frame coding mode and the coding blocks that use the inter-frame coding mode in the fourth coded data corresponding to the LCU. That is, the LCU header information includes two indicator bits, and one indicator bit is used to indicate whether the encoding block in the fourth encoded data that adopts the intra-frame encoding mode needs to select the corresponding transformation matrix according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding. The other indicator bit is used to indicate whether the encoding block in the inter-frame encoding mode in the fourth encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
5、仅通过编码块的尺寸大小来隐含指示,不再通过序列头部、图像头部、条带头部信息和LCU头部信息来进行决策。此时,若编码块的尺寸较小(如小于第一预设阈值),则可以确定该编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;相反地,若编码块的尺寸较大(如大于第二预设阈值),则可以确定该 编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。5. It is only indicated implicitly by the size of the coding block, and the decision is no longer made by the sequence header, image header, slice header information and LCU header information. At this time, if the size of the coding block is small (for example, smaller than the first preset threshold), it can be determined that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; on the contrary, if If the size of the coding block is larger (eg, larger than the second preset threshold), it can be determined that the coding block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
6、通过前述序列头部中的索引标识和图像头部中的索引标识来指示,不再通过条带头部信息、LCU头部信息和编码块的尺寸大小来进行决策。此时,若序列头部中的索引标识的取值和图像头部中的索引标识的取值均为1(数值仅为示例),则说明视频图像帧对应的第二编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若序列头部中的索引标识的取值为1,而图像头部中的索引标识的取值为0(数值仅为示例),则说明该视频图像帧对应的第二编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。6. It is indicated by the index identifier in the aforementioned sequence header and the index identifier in the image header, and the decision is no longer made by the slice header information, the LCU header information and the size of the coding block. At this time, if the value of the index mark in the sequence header and the value of the index mark in the image header are both 1 (the value is only an example), it means that the target encoding in the second encoded data corresponding to the video image frame is The block needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the sequence header is 1, and the value of the index mark in the image header is 0 (num It is only an example), it means that the target coding block in the second coded data corresponding to the video image frame does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
7、通过前述序列头部中的索引标识、图像头部中的索引标识和条带头部信息中的索引标识来指示,不再通过LCU头部信息和编码块的尺寸大小来进行决策。此时,若序列头部中的索引标识的取值、图像头部中的索引标识的取值和条带头部信息的索引标识的取值均为1(数值仅为示例),则说明条带对应的第三编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若序列头部中的索引标识的取值和图像头部中的索引标识的取值均为1,而条带头部信息中的索引标识的取值为0(数值仅为示例),则说明该条带对应的第三编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。7. It is indicated by the index identifier in the sequence header, the index identifier in the image header, and the index identifier in the slice header information, and the decision is no longer made based on the LCU header information and the size of the coding block. At this time, if the value of the index mark in the sequence header, the value of the index mark in the image header, and the value of the index mark in the slice header information are all 1 (the value is only an example), it means that the slice The target coding block in the corresponding third coded data needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the sequence header and the index in the image header The value of the identifier is 1, and the value of the index identifier in the slice header information is 0 (the value is only an example), which means that the target encoding block in the third encoded data corresponding to the slice does not need to be based on entropy. The quantized coefficients in the decoded quantized coefficient block select the corresponding transformation matrix combination.
8、通过前述序列头部中的索引标识、图像头部中的索引标识、条带头部信息中的索引标识和LCU头部信息中的索引标识来指示,不再通过编码块的尺寸大小来进行决策。此时,若序列头部中的索引标识的取值、图像头部中的索引标识的取值、条带头部信息的索引标识的取值和LCU头部信息中的索引标识的取值均为1(数值仅为示例),则说明LCU对应的第四编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若序列头部中的索引标识的取值、图像头部中的索引标识的取值和条带头部信息中的索引标识的取值均为1,而LCU头部信息中的索引标识的取值为0(数值仅为示例),则说明该LCU对应的第四编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。8. It is indicated by the index identification in the aforementioned sequence header, the index identification in the image header, the index identification in the slice header information and the index identification in the LCU header information, and is no longer determined by the size of the coding block. make decisions. At this time, if the value of the index mark in the sequence header, the value of the index mark in the image header, the value of the index mark in the slice header information and the value of the index mark in the LCU header information are all is 1 (the value is only an example), it means that the target coding block in the fourth coded data corresponding to the LCU needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the index in the sequence header The value of the logo, the value of the index logo in the image header, and the value of the index logo in the slice header information are all 1, while the value of the index logo in the LCU header information is 0 (the value is only 0). Example), it means that the target coding block in the fourth coded data corresponding to the LCU does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
9、通过前述序列头部中的索引标识、图像头部中的索引标识、条带头部信息中的索引标识、LCU头部信息中的索引标识和编码块的尺寸大小来进行决策。此时,若序列头部中的索引标识的取值、图像头部中的索引标识的取值、条带头部信息的索引标识的取值、LCU头部信息中的索引标识的取值均为1(数值仅为示例),且编码块的尺寸小于预设阈值(如第一预设阈值),则说明该编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若序列头部中的索引标识的取值、图像头部中的索引标识的取值、条带头部信息中的索引标识的取值和LCU头部信息中的索引标识的取值均为1,但是编码块的尺寸大于预设阈值(如第二预设阈值),则说明该编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。9. The decision is made based on the index identifier in the sequence header, the index identifier in the image header, the index identifier in the slice header information, the index identifier in the LCU header information, and the size of the coding block. At this time, if the value of the index mark in the sequence header, the value of the index mark in the image header, the value of the index mark in the slice header information, and the value of the index mark in the LCU header information are all is 1 (the value is only an example), and the size of the coding block is smaller than the preset threshold (such as the first preset threshold), it means that the coding block needs to select the corresponding transformation matrix according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding Combination; if the value of the index mark in the sequence header, the value of the index mark in the image header, the value of the index mark in the slice header information and the value of the index mark in the LCU header information are all is 1, but the size of the encoding block is greater than the preset threshold (eg, the second preset threshold), it means that the encoding block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
当然,还可以有如下方式:Of course, there are also the following ways:
10、通过前述图像头部中的索引标识和条带头部信息中的索引标识来指示,不再通过序列头部、LCU头部信息和编码块的尺寸大小来进行决策。此时,若图像头部中的索引标识的取值和条带头部信息的索引标识的取值均为1(数值仅为示例),则说明条带对应的第三编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若图像头部中的索引标识的取值为1,而条带头部信息中的索引标识的取值为0(数值仅为示例),则说明该条带对应的第三编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。10. It is indicated by the index identifier in the image header and the index identifier in the slice header information, and the decision is no longer made by the sequence header, the LCU header information and the size of the coding block. At this time, if the value of the index identifier in the image header and the value of the index identifier of the slice header information are both 1 (the value is only an example), it means that the target encoding in the third encoded data corresponding to the slice is The block needs to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the image header is 1, and the value of the index mark in the slice header information is 0 (The numerical value is only an example), it means that the target coding block in the third coded data corresponding to the slice does not need to select the corresponding transformation matrix combination according to the quantization coefficient in the quantization coefficient block obtained by entropy decoding.
11、通过前述图像头部中的索引标识、条带头部信息中的索引标识和LCU头部信息中的索引标识来指示,不再通过序列头部、编码块的尺寸大小来进行决策。此时,若 图像头部中的索引标识的取值、条带头部信息的索引标识的取值和LCU头部信息中的索引标识的取值均为1(数值仅为示例),则说明LCU对应的第四编码数据中的目标编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若图像头部中的索引标识的取值和条带头部信息中的索引标识的取值为1,而LCU头部信息中的索引标识的取值为0(数值仅为示例),则说明该LCU对应的第四编码数据中的目标编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。11. It is indicated by the index identifier in the image header, the index identifier in the slice header information, and the index identifier in the LCU header information, and the decision is no longer made by the sequence header and the size of the coding block. At this time, if the value of the index mark in the image header, the value of the index mark in the slice header information, and the value of the index mark in the LCU header information are all 1 (the value is only an example), it means that The target coding block in the fourth coded data corresponding to the LCU needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; if the value of the index mark in the image header and the slice header information The value of the index identifier of the LCU is 1, and the value of the index identifier in the LCU header information is 0 (the value is only an example), which means that the target encoding block in the fourth encoded data corresponding to the LCU does not need to be decoded according to entropy. The quantized coefficients in the obtained quantized coefficient block select the corresponding transformation matrix combination.
12、通过前述图像头部中的索引标识、条带头部信息中的索引标识、LCU头部信息中的索引标识和编码块的尺寸大小来进行决策,不再通过序列头部来进行决策。此时,若图像头部中的索引标识的取值、条带头部信息的索引标识的取值、LCU头部信息中的索引标识的取值均为1(数值仅为示例),且编码块的尺寸小于预设阈值(如第一预设阈值),则说明该编码块需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合;若图像头部中的索引标识的取值、条带头部信息中的索引标识的取值和LCU头部信息中的索引标识的取值均为1,但是编码块的尺寸大于预设阈值(如第二预设阈值),则说明该编码块不需要根据熵解码得到的量化系数块中的量化系数选择对应的变换矩阵组合。12. The decision is made based on the index identifier in the image header, the index identifier in the slice header information, the index identifier in the LCU header information, and the size of the coding block, and no longer makes the decision by the sequence header. At this time, if the value of the index mark in the image header, the value of the index mark in the slice header information, and the value of the index mark in the LCU header information are all 1 (the value is only an example), and the encoding The size of the block is smaller than the preset threshold (such as the first preset threshold), which means that the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding; The value, the value of the index mark in the slice header information and the value of the index mark in the LCU header information are all 1, but the size of the coding block is greater than the preset threshold (such as the second preset threshold), then It is indicated that the coding block does not need to select the corresponding transformation matrix combination according to the quantization coefficients in the quantization coefficient block obtained by entropy decoding.
此外,在本申请的实施例中,还有其它更多种指示方式,不再详述。In addition, in the embodiments of the present application, there are other more indication manners, which will not be described in detail.
在一些实施例中,对量化系数块中的多个区域内的量化系数分别进行统计处理时,可以针对该多个区域中的任意一个区域(为便于描述,将其称为目标区域)采用如下的方式计算该目标区域对应的统计结果:可以计算该目标区域内的量化系数的数值之和,将得到的和值作为统计结果;或者可以计算该目标区域内的量化系数的绝对值之和,将得到的和值作为统计结果;或者可以计算该目标区域内数值为奇数的量化系数的数值之和,将得到的和值作为统计结果;或者可以计算该目标区域内数值为奇数的量化系数的绝对值之和,将得到的和值作为统计结果;或者可以计算该目标区域内数值为偶数或非零偶数的量化系数的数值之和,将得到的和值作为统计结果;或者可以计算该目标区域内数值为偶数或非零偶数的量化系数的绝对值之和,将得到的和值作为统计结果。In some embodiments, when statistical processing is performed on the quantized coefficients in multiple regions in the quantized coefficient block, the following may be used for any one of the multiple regions (for convenience of description, it is referred to as the target region) as follows Calculate the statistical result corresponding to the target area in a way: you can calculate the numerical sum of the quantization coefficients in the target area, and use the obtained sum as the statistical result; or you can calculate the sum of the absolute values of the quantization coefficients in the target area, The obtained sum is used as the statistical result; or the numerical sum of the quantization coefficients with odd values in the target area can be calculated, and the obtained sum is used as the statistical result; or the sum of the quantization coefficients with odd values in the target area can be calculated. The sum of absolute values, the obtained sum value is used as the statistical result; or the sum of the numerical values of the quantization coefficients whose values are even or non-zero even in the target area can be calculated, and the obtained sum value is used as the statistical result; or the target area can be calculated The sum of the absolute values of the quantization coefficients whose values are even or non-zero even in the region will be used as the statistical result.
在一些实施例中,对前述多个区域中的目标区域内的量化系数进行统计处理时,可以将该目标区域内的量化系数的数值进行线性映射,然后计算该目标区域内的量化系数在线性映射之后的数值之和或绝对值之和,将得到的和值作为统计结果。In some embodiments, when statistical processing is performed on the quantization coefficients in the target area in the aforementioned multiple areas, the numerical values of the quantization coefficients in the target area may be linearly mapped, and then the linearity of the quantization coefficients in the target area is calculated. The sum of the numerical values or the sum of the absolute values after the mapping, and the obtained sum value will be used as the statistical result.
在一些实施例中,上述的线性映射可以是将该目标区域内数值为奇数的量化系数的数值转换为第一数值,将目标区域内数值为偶数的量化系数的数值转换为第二数值,其中,该第一数值和该第二数值中的一个为奇数,另一个为偶数。比如,将该目标区域内数值为奇数的量化系数的数值转换为1,将数值为偶数的量化系数的数值转换为0;或者将该目标区域内数值为奇数的量化系数的数值转换为0,将数值为偶数的量化系数的数值转换为1;或者将该目标区域内数值为奇数的量化系数的数值转换为3,将数值为偶数的量化系数的数值转换为2;或者将该目标区域内数值为奇数的量化系数的数值转换为2,将数值为偶数的量化系数的数值转换为3。In some embodiments, the above-mentioned linear mapping may be to convert the numerical value of the quantization coefficient whose value is an odd number in the target area into a first value, and convert the value of the quantization coefficient whose value is an even number in the target area into a second value, wherein , one of the first value and the second value is odd and the other is even. For example, the value of the quantization coefficient whose value is odd in the target area is converted to 1, and the value of the quantization coefficient whose value is even is converted to 0; or the value of the quantization coefficient whose value is odd in the target area is converted to 0, Convert the value of the quantization coefficient with an even number to 1; or convert the value of the quantization coefficient with an odd value in the target area to 3, and convert the value of the quantization coefficient with an even value to 2; or in the target area The numerical value of the quantization coefficient whose value is an odd number is converted into 2, and the value of the quantization coefficient whose value is an even number is converted into 3.
在一些实施例中,上述的线性映射可以是将该目标区域内的非零量化系数的数值转换为第三数值,将数值为零的量化系数的数值转换为第四数值,其中,该第三数值和该第四数值中的一个为奇数,另一个为偶数。比如,将该目标区域内的非零量化系数的数值转换为1,将数值为零的量化系数的数值转换为0;或者将该目标区域内的非零量化系数的数值转换为0,将数值为零的量化系数的数值转换为1;或者将该目标区域内的非零量化系数的数值转换为3,将数值为零的量化系数的数值转换为2;或者将该目标区域内的非零量化系数的数值转换为2,将数值为零的量化系数的数值转换为3。In some embodiments, the above-mentioned linear mapping may be to convert the value of the non-zero quantization coefficient in the target area into a third value, and convert the value of the quantization coefficient with a value of zero into a fourth value, wherein the third value One of the numerical value and the fourth numerical value is an odd number and the other is an even number. For example, the value of the non-zero quantization coefficient in the target area is converted to 1, and the value of the quantization coefficient with the value zero is converted to 0; or the value of the non-zero quantization coefficient in the target area is converted to 0, and the value The value of the zero quantization coefficient is converted to 1; or the value of the non-zero quantization coefficient in the target area is converted to 3, and the value of the quantization coefficient of zero value is converted to 2; or the non-zero value of the target area is converted. The value of the quantization coefficient is converted to 2, and the value of the quantization coefficient with a value of zero is converted to 3.
在一些实施例中,上述的线性映射可以是根据第五数值对该目标区域内的量化系数 的数值进行减少处理。比如将该目标区域内的量化系数的数值都减少1,或者都减少2。In some embodiments, the above-mentioned linear mapping may be to reduce the value of the quantization coefficient in the target area according to the fifth value. For example, the values of the quantization coefficients in the target area are all reduced by 1, or both are reduced by 2.
在一些实施例中,上述的线性映射可以是根据第五数值对该目标区域内的量化系数的数值进行增加处理。比如将该目标区域内的量化系数的数值都增加1,或者都增加2。In some embodiments, the above-mentioned linear mapping may be performed to increase the value of the quantization coefficient in the target region according to the fifth value. For example, the values of the quantization coefficients in the target area are all increased by 1, or both are increased by 2.
在一些实施例中,上述的线性映射可以是将该目标区域内的量化系数的数值乘以非零的第六数值。比如将该目标区域内的量化系数的数值都乘以1,或者乘以2。在一些实施例中,该第六数值可以为非零偶数,比如2、4、6等。In some embodiments, the above-mentioned linear mapping may be to multiply the value of the quantization coefficients in the target region by a sixth non-zero value. For example, the values of the quantization coefficients in the target area are multiplied by 1, or multiplied by 2. In some embodiments, the sixth value may be a non-zero even number, such as 2, 4, 6, and so on.
在一些实施例中,上述的线性映射可以是将该目标区域内的量化系数的数值除以非零的第六数值。比如将该目标区域内的量化系数的数值都除以1,或者除以2。在一些实施例中,该第六数值可以为非零偶数,比如2、4、6等。In some embodiments, the above-mentioned linear mapping may be the value of the quantization coefficients in the target region divided by a sixth non-zero value. For example, the values of the quantization coefficients in the target area are divided by 1, or divided by 2. In some embodiments, the sixth value may be a non-zero even number, such as 2, 4, 6, and so on.
在一些实施例中,上述的线性映射可以是将该目标区域内的量化系数的数值转换为相反数。In some embodiments, the above-mentioned linear mapping may be to convert the numerical values of the quantization coefficients in the target region into opposite numbers.
需要说明的是,在对前述多个区域内的量化系数分别进行统计处理时,可以针对不同的区域采用相同的统计方式;或者也可以针对不同的区域分别采用不同的统计方式;还可以针对部分区域采用相同的统计方式,而针对其它区域采用另外的统计方式。It should be noted that when performing statistical processing on the quantization coefficients in the aforementioned multiple regions, the same statistical method can be used for different regions; or different statistical methods can also be used for different regions; The same statistics are used for regions, and additional statistics are used for other regions.
在一些实施例中,在对量化系数块中的多个区域内的量化系数分别进行统计处理,得到各个区域的统计结果之后,可以分别计算各个区域的统计结果针对设定值的余数,该设定值可以是任意非零的数,比如可以是2、3、4等。需要说明的是:不同区域的统计结果所对应的设定值可以是相同的,也可以是不相同的。比如共有两个区域,区域1的统计结果可以对2取余数,区域2的统计结果既可以对2取余数,也可以对3或4等其它值取余数。In some embodiments, after statistical processing is performed on the quantization coefficients in multiple regions in the quantization coefficient block, and the statistical results of each region are obtained, the remainder of the statistical results of each region to the set value can be calculated respectively. The fixed value can be any non-zero number, such as 2, 3, 4, etc. It should be noted that the set values corresponding to the statistical results of different regions may be the same or different. For example, there are two areas. The statistical result of area 1 can take the remainder of 2, and the statistical result of area 2 can take the remainder of 2 or other values such as 3 or 4.
综上,本申请的实施例在对前述多个区域中的各个区域内的量化系数进行统计处理时可以有如下方式,为便于描述,以对任意一个区域(将其称之为目标区域)内的量化系数进行统计为例进行说明:To sum up, the embodiments of the present application can perform statistical processing on the quantization coefficients in each of the aforementioned multiple regions in the following manner. The quantization coefficients are used for statistics as an example to illustrate:
1、对目标区域内的量化系数的数值直接求和;1. Directly sum the values of the quantization coefficients in the target area;
2、对目标区域内的量化系数求数值的绝对值之和;2. Calculate the sum of the absolute values of the quantization coefficients in the target area;
3、对目标区域内数值为奇数的量化系数的数值直接求和;3. Directly sum the values of the quantization coefficients whose values are odd in the target area;
4、对目标区域内数值为奇数的量化系数求数值的绝对值之和;4. Calculate the sum of the absolute values of the quantization coefficients whose values are odd in the target area;
5、对目标区域内数值为偶数或非零偶数的量化系数的数值直接求和;5. Directly sum the values of the quantization coefficients whose values are even or non-zero even in the target area;
6、对目标区域内数值为偶数或非零偶数的量化系数求数值的绝对值之和;6. Calculate the sum of the absolute values of the quantization coefficients whose values are even or non-zero even in the target area;
7、先根据目标区域内的量化系数的奇偶性对奇数和偶数进行数值转换,然后对目标区域内转换后的所有数值求和;7. First convert odd numbers and even numbers according to the parity of the quantization coefficients in the target area, and then sum up all the converted values in the target area;
8、先根据目标区域内的量化系数的奇偶性对奇数和偶数进行数值转换,然后对目标区域内转换后的所有数值的绝对值求和;8. First perform numerical conversion on odd and even numbers according to the parity of the quantization coefficients in the target area, and then sum the absolute values of all converted values in the target area;
9、先根据目标区域内的非零量化系数和数值为零的量化系数进行数值转换,然后对目标区域内转换后的所有数值求和;9. First perform numerical conversion according to the non-zero quantization coefficient in the target area and the quantization coefficient with zero value, and then sum up all the converted values in the target area;
10、先根据目标区域内的非零量化系数和数值为零的量化系数进行数值转换,然后对目标区域内转换后的所有数值的绝对值求和;10. First perform numerical conversion according to the non-zero quantization coefficient in the target area and the quantization coefficient with zero value, and then sum the absolute values of all converted values in the target area;
11、先对目标区域内的所有量化系数进行增加、减少、乘以非零倍数、除以非零倍数或者求相反数等数值转换操作,然后对目标区域内转换后的所有数值求和;11. First perform numerical conversion operations on all quantization coefficients in the target area, such as increasing, decreasing, multiplying by non-zero multiples, dividing by non-zero multiples, or inverse numbers, and then summing all converted values in the target area;
12、先对目标区域内的所有量化系数进行增加、减少、乘以非零倍数、除以非零倍数或者求相反数等数值转换操作,然后对目标区域内转换后的所有数值的绝对值求和。12. First perform numerical conversion operations on all quantization coefficients in the target area, such as increasing, decreasing, multiplying by non-zero multiples, dividing by non-zero multiples, or inverse numbers, and then calculating the absolute value of all converted values in the target area. and.
当然,还可以有其它方式,比如先通过前述7至12中的转换方式对目标区域内的量化系数进行数值转换,然后只对转换后的奇数或者偶数进行求和等。Of course, there may also be other methods, such as first performing numerical conversion on the quantized coefficients in the target area through the conversion methods in 7 to 12, and then only summing the converted odd or even numbers.
在一些实施例中,上述多个区域中的一个区域(指每个区域,以下同理)可以是量 化系数块中的全部区域。In some embodiments, one of the above-mentioned multiple regions (referring to each region, the same applies hereinafter) may be all regions in the quantized coefficient block.
在一些实施例中,上述多个区域中的一个区域可以是量化系数块中指定的一个位置或多个位置。In some embodiments, one of the plurality of regions may be a location or locations specified in the block of quantized coefficients.
在一些实施例中,上述多个区域中的一个区域可以是量化系数块中指定的至少一行。如图7所示,假设量化系数块是4×4的系数块,每个方块表示一个量化系数,那么可以如图7中(a)所示,将灰色区域的1行作为一个区域;或者可以如图7中(b)所示,将灰色区域的2行作为一个区域。在一些实施例中,这至少一行可以是量化系数块中靠上边的行。In some embodiments, one of the above-mentioned plurality of regions may be at least one row designated in the block of quantized coefficients. As shown in FIG. 7 , assuming that the quantized coefficient block is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (a) of FIG. 7 , 1 row of the gray area can be used as a region; or As shown in FIG. 7( b ), two lines of the gray area are regarded as one area. In some embodiments, the at least one row may be an upper row in the block of quantized coefficients.
在一些实施例中,上述多个区域中的一个区域可以是量化系数块中指定的至少一列。如图7所示,假设量化系数块是4×4的系数块,每个方块表示一个量化系数,那么可以如图7中(c)所示,将灰色区域的1列作为一个区域;或者可以如图7中(d)所示,将灰色区域的2列作为一个区域。在一些实施例中,这至少一列可以是量化系数块中靠左边的列。In some embodiments, one of the aforementioned plurality of regions may be at least one column designated in the block of quantized coefficients. As shown in FIG. 7 , assuming that the quantized coefficient block is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (c) in FIG. 7 , one column of the gray area can be used as an area; or you can As shown in (d) of FIG. 7 , the two columns in the gray area are regarded as one area. In some embodiments, the at least one column may be the left column in the block of quantized coefficients.
在一些实施例中,上述多个区域中的一个区域可以是量化系数块中指定的至少一行和指定的至少一列。如图8所示,假设量化系数块是4×4的系数块,每个方块表示一个量化系数,那么可以如图8中(a)所示,将下方的1行和右边的1列(即其中的灰色区域)作为一个区域;或者可以如图8中(b)所示,将下方的2行和右边的2列(即其中的灰色区域)作为一个区域;或者可以如图8中(c)所示,将上方的1行和左边的1列(即其中的灰色区域)作为一个区域;或者可以如图8中(d)所示,将上方的2行和左边的2列(即其中的灰色区域)作为一个区域。In some embodiments, one of the above-mentioned plurality of regions may be at least one designated row and at least one designated column in the block of quantized coefficients. As shown in FIG. 8 , assuming that the quantized coefficient block is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (a) of FIG. 8 , the lower row and the right column (that is, The gray area in it) is used as an area; or as shown in Figure 8 (b), the lower 2 rows and the right 2 columns (that is, the gray area) can be used as an area; or as shown in Figure 8 (c) ), the upper 1 row and the left 1 column (that is, the gray area in it) are used as an area; or as shown in (d) in Figure 8, the upper 2 rows and the left 2 columns (that is, the gray area) as a region.
在一些实施例中,上述多个区域中的一个区域可以是量化系数块中处于至少一条斜线上的位置。如图9所示,假设量化系数块是4×4的系数块,每个方块表示一个量化系数,那么可以如9中的(a)和(b)所示,将一条斜线上的位置作为一个区域;或者如9中的(c)和(d)所示,将两条斜线上的位置作为一个区域。In some embodiments, one of the above-mentioned multiple regions may be a position on at least one oblique line in the block of quantized coefficients. As shown in FIG. 9 , assuming that the quantized coefficient block is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (a) and (b) in 9, the position on a diagonal line can be used as an area; or as shown in (c) and (d) in 9, the position on the two diagonal lines is regarded as an area.
在一些实施例中,上述多个区域中的一个区域可以是量化系数块中的SRCC区域。其中,SRCC区域即为通过SRCC技术标记出的扫描区域。In some embodiments, one of the aforementioned plurality of regions may be an SRCC region in a block of quantized coefficients. The SRCC area is the scanning area marked by the SRCC technology.
在一些实施例中,上述多个区域中的一个区域可以是SRCC区域中指定的一个位置或多个位置。在一些实施例中,SRCC区域中指定的一个位置或多个位置可以包括:按照扫描顺序的前N个位置或者按照扫描顺序处于中间的N个位置,当然也可以是按照扫描顺序处于最后的N个位置等,N为非0的自然数。其中,按照扫描顺序的前N个位置是指按照扫描顺序对SRCC区域中的所有位置进行排序后,位于前N个的位置,其余同理。In some embodiments, one of the above-mentioned multiple areas may be a location or locations designated in the SRCC area. In some embodiments, the position or positions specified in the SRCC area may include: the first N positions in the scanning order or the middle N positions in the scanning order, and of course, the last N positions in the scanning order position, etc., N is a non-zero natural number. The top N positions in the scanning order refer to the top N positions after sorting all the positions in the SRCC region according to the scanning order, and the rest are the same.
在一些实施例中,上述多个区域中的一个区域可以是SRCC区域中指定的至少一行。如图7所示,假设SRCC区域是4×4的系数块,每个方块表示一个量化系数,那么可以如图7中(a)所示,将灰色区域的1行作为一个区域;或者可以如图7中(b)所示,将灰色区域的2行作为一个区域。在一些实施例中,这至少一行可以是量化系数块中靠上边的行。In some embodiments, one of the above-mentioned plurality of regions may be at least one row designated in the SRCC region. As shown in Figure 7, assuming that the SRCC area is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (a) in Figure 7, 1 row of the gray area can be used as a region; As shown in (b) of FIG. 7 , two lines in the gray area are regarded as one area. In some embodiments, the at least one row may be an upper row in the block of quantized coefficients.
在一些实施例中,上述多个区域中的一个区域可以是SRCC区域中指定的至少一列。如图7所示,假设SRCC区域是4×4的系数块,每个方块表示一个量化系数,那么可以如图7中(c)所示,将灰色区域的1列作为一个区域;或者可以如图7中(d)所示,将灰色区域的2列作为一个区域。在一些实施例中,这至少一列可以是量化系数块中靠左边的列。In some embodiments, one of the aforementioned plurality of regions may be at least one column designated in the SRCC region. As shown in Figure 7, assuming that the SRCC area is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (c) in Figure 7, one column of the gray area can be used as a region; or it can be as follows As shown in (d) of FIG. 7 , the two columns in the gray area are regarded as one area. In some embodiments, the at least one column may be the left column in the block of quantized coefficients.
在一些实施例中,上述多个区域中的一个区域可以是SRCC区域中指定的至少一行和指定的至少一列。如图8所示,假设SRCC区域是4×4的系数块,每个方块表示一个 量化系数,那么可以如图8中(a)所示,将下方的1行和右边的1列(即其中的灰色区域)作为一个区域;或者可以如图8中(b)所示,将下方的2行和右边的2列(即其中的灰色区域)作为一个区域;或者可以如图8中(c)所示,将上方的1行和左边的1列(即其中的灰色区域)作为一个区域;或者可以如图8中(d)所示,将上方的2行和左边的2列(即其中的灰色区域)作为一个区域。In some embodiments, one of the above-mentioned multiple areas may be at least one designated row and at least one designated column in the SRCC area. As shown in Figure 8, assuming that the SRCC area is a 4×4 coefficient block, and each block represents a quantized coefficient, then as shown in (a) of Figure 8, the lower row and the right column (that is, where the gray area) as an area; or as shown in (b) in Figure 8, the 2 rows below and the 2 columns on the right (that is, the gray area) can be used as an area; or as shown in (c) in Figure 8 As shown in Figure 8, the upper 1 row and the left 1 column (that is, the gray area in it) are used as an area; or as shown in (d) in Figure 8, the upper 2 rows and the left 2 columns (that is, the gray area) as a region.
在一些实施例中,上述多个区域中的一个区域可以是SRCC区域中处于至少一条斜线上的位置。如图9所示,假设SRCC区域是4×4的系数块,每个方块表示一个量化系数,那么可以如9中的(a)和(b)所示,将一条斜线上的位置作为一个区域;或者如9中的(c)和(d)所示,将两条斜线上的位置作为一个区域。In some embodiments, one of the above-mentioned regions may be a position on at least one diagonal line in the SRCC region. As shown in Figure 9, assuming that the SRCC area is a 4×4 coefficient block, each block represents a quantized coefficient, then as shown in (a) and (b) in 9, the position on a diagonal line can be used as a area; or as shown in (c) and (d) in 9, take the position on the two diagonal lines as an area.
在本申请的其它实施例中,也可以将上述实施例中的区域划分方式进行组合,以将组合后的区域作为一个区域,然后从中选择多个区域。In other embodiments of the present application, the area division manners in the foregoing embodiments may also be combined, so that the combined area is regarded as one area, and then multiple areas are selected therefrom.
继续参照图6B所示,在步骤S630中,根据各个区域的余数选择编码块对应的变换矩阵组合。Continuing to refer to FIG. 6B , in step S630 , the combination of transformation matrices corresponding to the coding blocks is selected according to the remainder of each region.
在一些实施例中,可以根据各个区域的余数,生成多个区域对应的余数组合,然后根据余数组合与变换矩阵组合之间的对应关系,选择对应的变换矩阵组合。比如有2个区域,且在计算余数时,将设定值设置为2,那么这两个区域的余数都可能是0或者1,进而可能得到的余数组合可以为(0,0)、(0,1)、(1,0)或(1,1),在这种情况下可以指示四种不同的变换矩阵组合;再如有3个区域,且在计算余数时,将设定值设置为2,那么这三个区域的余数都可能是0或者1,进而可能得到的余数组合可以为(0,0,0)、(0,0,1)、(0,1,0)、(0,1,1)、(1,0,0)、(1,0,1)、(1,1,0)或(1,1,1),在这种情况下可以指示八种不同的变换矩阵组合,其中,余数组合与变换矩阵组合一一对应。可见,本申请实施例的技术方案能够实现多种变换矩阵组合的索引指示,并且可以有效降低变换矩阵索引所占用的比特位,实现变换矩阵组合的准确确定(选择)。In some embodiments, remainder combinations corresponding to multiple regions may be generated according to the remainders of each region, and then the corresponding transformation matrix combination may be selected according to the correspondence between the remainder combination and the transformation matrix combination. For example, if there are 2 areas, and when calculating the remainder, set the setting value to 2, then the remainder of these two areas may be 0 or 1, and the possible combination of remainders can be (0, 0), (0 ,1), (1,0) or (1,1), in this case four different combinations of transformation matrices can be indicated; if there are 3 regions, and when calculating the remainder, set the set value to 2, then the remainder of these three areas may be 0 or 1, and the possible combination of remainders can be (0,0,0), (0,0,1), (0,1,0), (0 ,1,1), (1,0,0), (1,0,1), (1,1,0) or (1,1,1), in which case eight different transformations can be indicated Matrix combination, where the remainder combination corresponds to the transformation matrix combination one-to-one. It can be seen that the technical solutions of the embodiments of the present application can realize the index indication of various transformation matrix combinations, and can effectively reduce the bits occupied by the transformation matrix indexes, and realize the accurate determination (selection) of the transformation matrix combinations.
需要说明的是,在本申请的实施例中,不同余数组合对应的变换矩阵组合可以是不同的。当然,不同余数组合对应的变换矩阵组合也可以是相同的,但是对于可能出现的所有余数组合,不能都对应相同的变换矩阵组合。It should be noted that, in the embodiments of the present application, the transformation matrix combinations corresponding to different remainder combinations may be different. Of course, the transformation matrix combinations corresponding to different remainder combinations may also be the same, but for all possible remainder combinations, they cannot all correspond to the same transformation matrix combination.
在一些实施例中,变换矩阵组合所采用的变换核可以是已知的离散变换核(8种DCT变换核和8种DST变换核)的任意组合。比如变换核可以包括:DCT2、DCT5、DCT8、DST1、DST7等。In some embodiments, the transform kernels employed in the transform matrix combination may be any combination of known discrete transform kernels (8 DCT transform kernels and 8 DST transform kernels). For example, the transformation kernel may include: DCT2, DCT5, DCT8, DST1, DST7, and so on.
在一些实施例中,变换矩阵组合包括离散余弦变换DCT变换核和离散正弦变换DST变换核中的至少之一,且每个变换矩阵组合对应一个余数组合。例如,变换矩阵组合包括DCT2、DCT5、DCT8、DST1、DST7中至少一种的组合,同时,有2个区域,前述的设定值为2,那么可以设定如下的对应关系:余数组合为(0,0)时,对应的变换矩阵组合可以是(DCT2,DCT2);余数组合为(0,1)时,对应的变换矩阵组合可以是(DCT8,DCT8);余数组合为(1,0)时,对应的变换矩阵组合可以是(DCT8,DST7);余数组合为(1,1)时,对应的变换矩阵组合可以是(DST7,DST7)。In some embodiments, the transform matrix combination includes at least one of a discrete cosine transform (DCT) transform kernel and a discrete sine transform (DST) transform kernel, and each transform matrix combination corresponds to a remainder combination. For example, the transformation matrix combination includes at least one combination of DCT2, DCT5, DCT8, DST1, and DST7. At the same time, there are 2 regions, and the aforementioned setting value is 2, then the following correspondence can be set: The remainder combination is ( 0,0), the corresponding transformation matrix combination can be (DCT2, DCT2); when the remainder combination is (0,1), the corresponding transformation matrix combination can be (DCT8, DCT8); the remainder combination is (1,0) , the corresponding transformation matrix combination may be (DCT8, DST7); when the remainder combination is (1, 1), the corresponding transformation matrix combination may be (DST7, DST7).
在一些实施例中,也可以通过余数组合来指示编码块跳过了变换处理过程。例如可以通过余数组合来指示对应的变换矩阵组合为空值(或者为TS),该空值(或TS)表示编码块跳过了变换处理过程。比如,有2个区域,前述的设定值为2,那么在余数组合为(0,0)时,对应的变换矩阵组合可以是(DCT2,DCT2);余数组合为(0,1)时,对应的变换矩阵组合可以是(DCT8,DCT8);余数组合为(1,0)时,对应的变换矩阵组合可以是(DCT8,DST7);余数组合为(1,1)时,对应的变换矩阵组合可以是空值(或者为TS),以指示编码块跳过了变换处理过程,在这种情况下,可以直接对量化系数块进行反量化处理,然后将反量化处理的结果作为重建的残差数据,而不需要对反量 化处理的结果进行反变换处理。需要说明的是,指示编码块跳过了变换处理过程的余数组合可以根据实际需要进行设定,该实施例中的(1,1)仅为示例。In some embodiments, the coded block may also be indicated by a remainder combination to skip the transform process. For example, the combination of the remainders may be used to indicate that the corresponding transformation matrix combination is a null value (or TS), where the null value (or TS) indicates that the coding block skips the transformation process. For example, if there are 2 regions and the aforementioned setting value is 2, then when the remainder combination is (0,0), the corresponding transformation matrix combination can be (DCT2, DCT2); when the remainder combination is (0,1), The corresponding transformation matrix combination can be (DCT8, DCT8); when the remainder combination is (1,0), the corresponding transformation matrix combination can be (DCT8, DST7); when the remainder combination is (1,1), the corresponding transformation matrix The combination can be a null value (or TS) to indicate that the encoding block skips the transform process, in which case the quantized coefficient block can be directly inverse-quantized, and then the result of the inverse-quantization process is used as the reconstructed residual. difference data without performing inverse transform processing on the result of inverse quantization processing. It should be noted that, the remainder combination indicating that the coding block skips the transformation process may be set according to actual needs, and (1, 1) in this embodiment is only an example.
在一些实施例中,还可以通过各个区域之间的关联指示方案来选择变换矩阵组合,例如:按照设定顺序对多个区域进行遍历处理,并针对遍历到的区域执行以下处理:对遍历到的区域内的量化系数进行统计处理,得到遍历到的区域的统计结果;确定遍历到的区域的统计结果针对设定值的余数;当根据遍历到的区域对应的余数不能选择出编码块对应的变换矩阵组合时,继续遍历下一个区域。例如,可以按照设定顺序对前述多个区域中的第一区域内的量化系数进行统计处理得到第一区域的统计结果,然后计算第一区域的余数。如果根据第一区域的余数不能选择出对应的变换矩阵组合,则继续对前述多个区域中的第二区域内的量化系数进行统计处理得到第二区域的统计结果,并计算第二区域的余数,根据第二区域的余数判断是否能够选择出对应的变换矩阵组合,直至选择出编码块对应的变换矩阵组合。In some embodiments, the combination of transformation matrices can also be selected through the association indication scheme between various regions, for example, traversing multiple regions in a set order, and performing the following processing on the traversed regions: Perform statistical processing on the quantization coefficients in the area of When the transformation matrix is combined, continue traversing the next region. For example, statistical processing may be performed on the quantization coefficients in the first region of the foregoing multiple regions in a set order to obtain a statistical result of the first region, and then the remainder of the first region may be calculated. If the corresponding transformation matrix combination cannot be selected according to the remainder of the first area, continue to perform statistical processing on the quantization coefficients in the second area of the foregoing multiple areas to obtain the statistical result of the second area, and calculate the remainder of the second area. , judging whether the corresponding transformation matrix combination can be selected according to the remainder of the second region, until the transformation matrix combination corresponding to the coding block is selected.
比如,有2个区域,分别记为区域1和区域2,区域1的统计结果对2取余,区域2的统计结果对4取余。那么可以先统计区域1内的量化系数得到区域1的统计结果,然后对区域1的统计结果取余,如果根据区域1的统计结果求得的余数能够确定使用某个变换矩阵组合,则不需要对区域2内的量化系数进行统计处理;如果根据区域1的统计结果求得的余数不能确定出一个变换矩阵组合,则需要对区域2内的量化系数进行统计处理,然后对区域2的统计结果取余,进而根据区域2的统计结果求得的余数确定出一个变换矩阵组合。在一些实施例中,若区域1的统计结果的余数为0,则选择变换矩阵组合(DCT2,DCT2),此时不需要对区域2内的量化系数进行统计处理;如果区域1的统计结果的余数为1,则表示根据区域1的统计结果的余数不能确定出一个变换矩阵组合,此时需要对区域2内的量化系数进行统计处理,然后对区域2的统计结果取余。如果区域2的统计结果的余数为0,则选择变换组合(DCT8,DCT8);如果区域2的统计结果的余数为1,则选择变换矩阵组合(DCT8,DST7);如果区域2的统计结果的余数为2,则选择变换矩阵组合(DST7,DCT8);如果区域2的统计结果的余数为3,则选择变换矩阵组合(DST7,DST7)。For example, there are 2 areas, which are respectively recorded as area 1 and area 2, the statistical result of area 1 takes the remainder of 2, and the statistical result of area 2 takes the remainder of 4. Then, you can first count the quantization coefficients in area 1 to obtain the statistical result of area 1, and then take the remainder of the statistical result of area 1. If the remainder obtained from the statistical result of area 1 can be determined to use a certain transformation matrix combination, you do not need to Perform statistical processing on the quantization coefficients in area 2; if the remainder obtained from the statistical results in area 1 cannot determine a transformation matrix combination, you need to perform statistical processing on the quantization coefficients in area 2, and then perform statistical processing on the statistical results in area 2. Take the remainder, and then determine a transformation matrix combination based on the remainder obtained from the statistical results of area 2. In some embodiments, if the remainder of the statistical result of area 1 is 0, a combination of transformation matrices (DCT2, DCT2) is selected. At this time, it is not necessary to perform statistical processing on the quantization coefficients in area 2; If the remainder is 1, it means that a transformation matrix combination cannot be determined according to the remainder of the statistical result of area 1. In this case, statistical processing of the quantization coefficients in area 2 is required, and then the remainder of the statistical result of area 2 is taken. If the remainder of the statistical result of area 2 is 0, select the transformation combination (DCT8, DCT8); if the remainder of the statistical result of area 2 is 1, select the transformation matrix combination (DCT8, DST7); If the remainder is 2, the transformation matrix combination (DST7, DCT8) is selected; if the remainder of the statistical result of region 2 is 3, the transformation matrix combination (DST7, DST7) is selected.
再如,有3个区域,分别记为区域1、区域2和区域3,区域1的统计结果对2取余,区域2的统计结果对2取余,区域3的统计结果对4取余。那么可以先统计区域1内的量化系数得到区域1的统计结果,然后对区域1的统计结果取余,如果根据区域1的统计结果求得的余数能够确定使用某个变换矩阵组合,则不需要对区域2内的量化系数和区域3内的量化系数进行统计处理;如果根据区域1的统计结果求得的余数不能确定出一个变换矩阵组合,则可以对区域2内的量化系数进行统计处理,然后对区域2的统计结果取余,进而根据区域2的统计结果求得的余数确定出一个变换矩阵组合。如果根据区域2的统计结果求得的余数不能确定出一个变换矩阵组合,则可以对区域3内的量化系数进行统计处理,然后对区域3的统计结果取余,进而根据区域3的统计结果求得的余数确定出一个变换矩阵组合。在一些实施例中,若区域1的统计结果的余数为0,则选择变换矩阵组合(DCT2,DCT2),此时不需要对区域2和区域3内的量化系数进行统计处理;如果区域1的统计结果的余数为1,则表示根据区域1的统计结果的余数不能确定出一个变换矩阵组合,此时需要对区域2内的量化系数进行统计处理,然后对区域2的统计结果取余。如果区域2的统计结果的余数为0,则选择变换组合(DCT8,DCT8);如果区域2的统计结果的余数为1,则表示根据区域2的统计结果的余数不能确定出一个变换矩阵组合,此时需要对区域3内的量化系数进行统计处理,然后对区域3的统计结果取余。如果区域3的统计结果的余数为0,则选择变换组合(DCT8,DST7);如果区域3的统计结果的余数为1,则选择变换组合(DST7,DCT8);如果区域3的统 计结果的余数为2,则选择变换矩阵组合(DST7,DST7);如果区域3的统计结果的余数为3,则可以表示编码块跳过了变换处理过程。For another example, there are 3 areas, which are respectively recorded as area 1, area 2 and area 3. The statistical result of area 1 is the remainder of 2, the statistical result of area 2 is the remainder of 2, and the statistical result of area 3 is the remainder of 4. Then, you can first count the quantization coefficients in area 1 to obtain the statistical result of area 1, and then take the remainder of the statistical result of area 1. If the remainder obtained from the statistical result of area 1 can be determined to use a certain transformation matrix combination, you do not need to Statistical processing is performed on the quantized coefficients in area 2 and the quantized coefficients in area 3; if a transformation matrix combination cannot be determined based on the remainder obtained from the statistical results of area 1, statistical processing can be performed on the quantized coefficients in area 2, Then, take the remainder of the statistical result of area 2, and then determine a transformation matrix combination according to the remainder obtained from the statistical result of area 2. If the remainder obtained from the statistical result of area 2 cannot determine a transformation matrix combination, you can perform statistical processing on the quantization coefficients in area 3, and then take the remainder of the statistical result of area 3, and then calculate according to the statistical result of area 3. The resulting remainder determines a transformation matrix combination. In some embodiments, if the remainder of the statistical result of region 1 is 0, the transformation matrix combination (DCT2, DCT2) is selected, and statistical processing of the quantization coefficients in region 2 and region 3 is not required at this time; If the remainder of the statistical result is 1, it means that a transformation matrix combination cannot be determined according to the remainder of the statistical result of area 1. In this case, it is necessary to perform statistical processing on the quantization coefficients in area 2, and then take the remainder of the statistical result of area 2. If the remainder of the statistical result of area 2 is 0, select the transformation combination (DCT8, DCT8); if the remainder of the statistical result of area 2 is 1, it means that a transformation matrix combination cannot be determined according to the remainder of the statistical result of area 2, In this case, it is necessary to perform statistical processing on the quantization coefficients in the area 3, and then take the remainder of the statistical result of the area 3. If the remainder of the statistical result of area 3 is 0, select the transformation combination (DCT8, DST7); if the remainder of the statistical result of area 3 is 1, select the transformation combination (DST7, DCT8); if the remainder of the statistical result of area 3 If it is 2, the transformation matrix combination (DST7, DST7) is selected; if the remainder of the statistical result of region 3 is 3, it can indicate that the encoding block skips the transformation process.
又如,有3个区域,分别记为区域1、区域2和区域3,区域1的统计结果对2取余,区域2的统计结果对2取余,区域3的统计结果对4取余。那么可以先统计区域1内的量化系数得到区域1的统计结果,然后对区域1的统计结果取余,其中,区域1的统计结果的余数为某一个值时,可以表示需要根据区域2内的量化系数来确定变换矩阵组合;区域1的统计结果的余数为另一个值时,可以表示需要根据区域3内的量化系数来确定变换矩阵组合。在这种情况下,需要根据区域1的统计结果的余数来确定是对区域2内的量化系数进行统计处理还是对区域3内的量化系数进行统计处理,如果需要对区域2内的量化系数进行统计处理,则在统计处理之后对区域2的统计结果取余,进而根据区域2的统计结果求得的余数确定出一个变换矩阵组合;如果需要对区域3内的量化系数进行统计处理,则在统计处理之后对区域3的统计结果取余,进而根据区域3的统计结果求得的余数确定出一个变换矩阵组合。在一些实施例中,如果区域1的统计结果的余数为0,则表示需要根据区域2内的量化系数来确定变换矩阵组合;如果区域1的统计结果的余数为1,则表示需要根据区域3内的量化系数来确定变换矩阵组合。如果区域2的统计结果的余数为0,则选择变换组合(DCT8,DCT8);如果区域2的统计结果的余数为1,则选择变换组合(DCT2,DCT2)。如果区域3的统计结果的余数为0,则选择变换组合(DCT8,DST7);如果区域3的统计结果的余数为1,则选择变换组合(DST7,DCT8);如果区域3的统计结果的余数为2,则选择变换矩阵组合(DST7,DST7);如果区域3的统计结果的余数为3,则可以表示编码块跳过了变换处理过程。For another example, there are 3 areas, which are respectively recorded as area 1, area 2 and area 3, the statistical result of area 1 is the remainder of 2, the statistical result of area 2 is the remainder of 2, and the statistical result of area 3 is the remainder of 4. Then you can first count the quantization coefficients in area 1 to obtain the statistical result of area 1, and then take the remainder of the statistical result of area 1. When the remainder of the statistical result of area 1 is a certain value, it can indicate that it needs to be calculated according to the statistical result in area 2. The quantization coefficients are used to determine the transformation matrix combination; when the remainder of the statistical result of region 1 is another value, it can indicate that the transformation matrix combination needs to be determined according to the quantization coefficients in region 3. In this case, it is necessary to determine whether to perform statistical processing on the quantized coefficients in area 2 or the quantized coefficients in area 3 according to the remainder of the statistical results of area 1. If it is necessary to perform statistical processing on the quantized coefficients in area 2 Statistical processing, after the statistical processing, take the remainder of the statistical result of area 2, and then determine a transformation matrix combination according to the remainder obtained from the statistical result of area 2; After the statistical processing, the remainder of the statistical result of the area 3 is taken, and then a transformation matrix combination is determined according to the remainder obtained from the statistical result of the area 3. In some embodiments, if the remainder of the statistical result of area 1 is 0, it means that the transformation matrix combination needs to be determined according to the quantization coefficients in area 2; The quantization coefficients within are used to determine the transform matrix combination. If the remainder of the statistic result of Region 2 is 0, select the transform combination (DCT8, DCT8); if the remainder of the statistic result of Region 2 is 1, then select the transform combination (DCT2, DCT2). If the remainder of the statistical result of area 3 is 0, select the transformation combination (DCT8, DST7); if the remainder of the statistical result of area 3 is 1, select the transformation combination (DST7, DCT8); if the remainder of the statistical result of area 3 If it is 2, the transformation matrix combination (DST7, DST7) is selected; if the remainder of the statistical result of region 3 is 3, it can indicate that the encoding block skips the transformation process.
当然,在本申请的其它实施例中,也可以先计算出各个区域的统计结果的余数,然后按照各个区域之间的关联指示方案来选择变换矩阵组合。Of course, in other embodiments of the present application, the remainder of the statistical results of each region may also be calculated first, and then the transformation matrix combination may be selected according to the association indication scheme between the regions.
继续参照图6B所示,在步骤S640中,基于选择的变换矩阵组合对量化系数块的反量化结果进行反变换处理。该过程可以参照前述实施例中的相关描述,不再赘述。Continuing to refer to FIG. 6B , in step S640 , inverse transform processing is performed on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination. For this process, reference may be made to the relevant descriptions in the foregoing embodiments, and details are not repeated here.
本申请上述实施例的技术方案使得能够通过量化系数块中的量化系数来隐含指示编码块对应的变换矩阵组合,无需编码端针对每个编码单元都编码变换矩阵的索引,降低了变换矩阵索引所占用的比特位,进而可以有效提高视频编解码效率。The technical solutions of the above embodiments of the present application enable the quantization coefficient in the quantization coefficient block to implicitly indicate the combination of transformation matrices corresponding to the coding block, without the need for the coding end to encode the index of the transformation matrix for each coding unit, thereby reducing the transformation matrix index The occupied bits can then effectively improve the video coding and decoding efficiency.
以下介绍本申请的装置实施例,可以用于执行本申请上述实施例中的视频解码方法。对于本申请装置实施例中未披露的细节,请参照本申请上述的视频解码方法的实施例。The apparatus embodiments of the present application are described below, which can be used to execute the video decoding methods in the above-mentioned embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the above-mentioned embodiments of the video decoding method of the present application.
图10示出了本申请实施例的视频解码装置的框图,该视频解码装置可以设置在具有计算处理功能的电子设备内,比如可以设置在终端设备或服务器内。FIG. 10 shows a block diagram of a video decoding apparatus according to an embodiment of the present application. The video decoding apparatus may be set in an electronic device with a computing processing function, for example, may be set in a terminal device or a server.
参照图10所示,本申请实施例的视频解码装置1000包括:解码单元1002、统计单元1004、选择单元1006和处理单元1008。Referring to FIG. 10 , the video decoding apparatus 1000 according to the embodiment of the present application includes: a decoding unit 1002 , a statistics unit 1004 , a selection unit 1006 , and a processing unit 1008 .
其中,解码单元1002配置为对视频图像帧的编码块进行熵解码处理,得到编码块对应的残差数据的量化系数块;统计单元1004配置为对量化系数块中的多个区域内的量化系数分别进行统计处理,得到多个区域中各个区域的统计结果,确定各个区域的统计结果针对设定值的余数;选择单元1006配置为根据各个区域的余数选择编码块对应的变换矩阵组合;处理单元1008配置为基于选择的变换矩阵组合对量化系数块的反量化结果进行反变换处理。The decoding unit 1002 is configured to perform entropy decoding processing on the coding block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coding block; Perform statistical processing respectively to obtain the statistical results of each area in the multiple areas, and determine the remainder of the statistical results of each area for the set value; the selection unit 1006 is configured to select the corresponding transformation matrix combination of the coding block according to the remainder of each area; the processing unit 1008 is configured to perform an inverse transform process on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
在本申请的一些实施例中,基于前述方案,视频解码装置1000还包括确定单元,配置为:根据编码块对应的索引标识的取值、编码块对应的指示位的取值、以及编码块的尺寸与预设阈值范围之间的关系中的至少之一,确定编码块是否需要根据量化系数选择对应的变换矩阵组合。In some embodiments of the present application, based on the foregoing solution, the video decoding apparatus 1000 further includes a determination unit configured to: according to the value of the index identifier corresponding to the coding block, the value of the indicator bit corresponding to the coding block, and the value of the coding block At least one of the relationships between the size and the preset threshold range determines whether the encoding block needs to select a corresponding transformation matrix combination according to the quantization coefficient.
在本申请的一些实施例中,基于前述方案,确定单元还配置为执行以下至少一种处理:根据视频图像帧序列对应的第一编码数据的序列头部包含的索引标识的取值,确定第一编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合;根据视频图像帧对应的第二编码数据的图像头部包含的索引标识的取值,确定第二编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合;根据视频图像帧的条带对应的第三编码数据的条带头部信息包含的索引标识的取值,确定第三编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合;根据视频图像帧的最大编码单元LCU对应的第四编码数据的LCU头部信息包含的索引标识的取值,确定第四编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合。In some embodiments of the present application, based on the foregoing solution, the determining unit is further configured to perform at least one of the following processing: according to the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence, determine the first Whether the coding block in the coded data needs to select the corresponding transformation matrix combination according to the quantization coefficient; according to the value of the index identifier contained in the image header of the second coded data corresponding to the video image frame, determine the coding block in the second coded data. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficient; according to the value of the index identifier contained in the slice header information of the third encoded data corresponding to the slice of the video image frame, determine whether the encoding block in the third encoded data needs to be Select the corresponding transformation matrix combination according to the quantization coefficient; according to the value of the index identifier included in the LCU header information of the fourth encoded data corresponding to the largest coding unit LCU of the video image frame, determine whether the encoding block in the fourth encoded data needs to be The quantization coefficient selects the corresponding transformation matrix combination.
在本申请的一些实施例中,基于前述方案,确定单元还配置为执行以下至少一种处理:根据视频图像帧序列对应的第一编码数据的序列头部包含的第一指示位的取值和第二指示位的取值,分别确定第一编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合;根据视频图像帧对应的第二编码数据的图像头部包含的第一指示位的取值和第二指示位的取值,分别确定第二编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合;根据视频图像帧的条带对应的第三编码数据的条带头部信息包含的第一指示位的取值和第二指示位的取值,分别确定第三编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合;根据视频图像帧的LCU对应的第四编码数据的LCU头部信息包含的第一指示位的取值和第二指示位的取值,分别确定第四编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合。In some embodiments of the present application, based on the foregoing solution, the determination unit is further configured to perform at least one of the following processing: according to the value of the first indication bit included in the sequence header of the first encoded data corresponding to the video image frame sequence and the The value of the second indicator bit determines whether the encoding block using the intra-frame encoding mode and the encoding block using the inter-frame encoding mode in the first encoded data need to select the corresponding transformation matrix combination according to the quantization coefficient; The value of the first indicator bit and the value of the second indicator bit included in the image header of the second encoded data respectively determine the encoding block in the second encoded data that adopts the intra-frame encoding mode and the encoding block that adopts the inter-frame encoding mode. Whether it is necessary to select the corresponding transformation matrix combination according to the quantization coefficient; according to the value of the first indicator bit and the value of the second indicator bit included in the slice header information of the third encoded data corresponding to the slice of the video image frame, respectively Determine whether the encoding block using the intra-frame encoding mode and the encoding block using the inter-frame encoding mode in the third encoded data need to select the corresponding transformation matrix combination according to the quantization coefficient; according to the LCU header of the fourth encoded data corresponding to the LCU of the video image frame The value of the first indicator bit and the value of the second indicator bit contained in the partial information respectively determine whether the encoding block using the intra-frame encoding mode and the encoding block using the inter-frame encoding mode in the fourth encoded data need to be selected according to the quantization coefficient. The corresponding transformation matrix combination.
在本申请的一些实施例中,基于前述方案,确定单元还配置为:当编码块的尺寸小于第一预设阈值时,确定编码块需要根据量化系数选择对应的变换矩阵组合;当编码块的尺寸大于第二预设阈值时,确定编码块不需要根据量化系数选择对应的变换矩阵组合;其中,第二预设阈值大于或等于第一预设阈值。In some embodiments of the present application, based on the foregoing solution, the determining unit is further configured to: when the size of the encoding block is smaller than the first preset threshold, determine that the encoding block needs to select a corresponding transformation matrix combination according to the quantization coefficient; When the size is greater than the second preset threshold, it is determined that the coding block does not need to select the corresponding transformation matrix combination according to the quantization coefficient; wherein the second preset threshold is greater than or equal to the first preset threshold.
在本申请的一些实施例中,基于前述方案,统计单元1004还配置为:针对多个区域中的目标区域,执行以下任意一种处理:确定目标区域内的量化系数的数值之和,将得到的和值作为目标区域的统计结果;确定目标区域内的量化系数的绝对值之和,将得到的和值作为目标区域的统计结果;确定目标区域内数值为奇数的量化系数的数值之和,将得到的和值作为目标区域的统计结果;确定目标区域内数值为奇数的量化系数的绝对值之和,将得到的和值作为目标区域的统计结果;确定目标区域内数值为偶数或非零偶数的量化系数的数值之和,将得到的和值作为目标区域的统计结果;确定目标区域内数值为偶数或非零偶数的量化系数的绝对值之和,将得到的和值作为目标区域的统计结果;其中,目标区域表示多个区域中的任意一个区域。In some embodiments of the present application, based on the foregoing solution, the statistics unit 1004 is further configured to: perform any one of the following processing for the target area in the multiple areas: determine the sum of the numerical values of the quantization coefficients in the target area, and obtain The sum value of the target area is used as the statistical result of the target area; the sum of the absolute values of the quantization coefficients in the target area is determined, and the obtained sum value is used as the statistical result of the target area; the numerical value of the odd-numbered quantization coefficients in the target area is determined, Use the obtained sum as the statistical result of the target area; determine the sum of the absolute values of the quantization coefficients with odd values in the target area, and use the obtained sum as the statistical result of the target area; determine whether the value in the target area is even or non-zero The sum of the values of the even quantization coefficients is used as the statistical result of the target area; the sum of the absolute values of the quantization coefficients with even or non-zero even numbers in the target area is determined, and the obtained sum is used as the target area. Statistical results; wherein, the target area represents any one of the multiple areas.
在本申请的一些实施例中,基于前述方案,统计单元1004还配置为:将目标区域内的量化系数的数值进行线性映射,并将量化系数在线性映射之后的数值之和或绝对值之和作为目标区域的统计结果;其中,目标区域表示多个区域中的任意一个区域。In some embodiments of the present application, based on the foregoing solution, the statistics unit 1004 is further configured to: perform linear mapping on the numerical values of the quantized coefficients in the target area, and calculate the sum of the numerical values or the sum of the absolute values of the quantized coefficients after the linear mapping As the statistical result of the target area; wherein, the target area represents any one of the multiple areas.
在本申请的一些实施例中,基于前述方案,统计单元1004还配置为执行以下任意一种处理:将目标区域内数值为奇数的量化系数的数值转换为第一数值,将目标区域内数值为偶数的量化系数的数值转换为第二数值,其中,第一数值和第二数值中的一个为奇数,另一个为偶数;将目标区域内的非零量化系数的数值转换为第三数值,将目标区域内数值为零的量化系数的数值转换为第四数值,其中,第三数值和第四数值中的一个为奇数,另一个为偶数;根据第五数值对目标区域内的量化系数的数值进行减少处理或增加处理;将目标区域内的量化系数的数值乘以或除以非零的第六数值;将目标区域内 的量化系数的数值转换为相反数。In some embodiments of the present application, based on the foregoing solution, the statistics unit 1004 is further configured to perform any one of the following processing: converting the value of the quantization coefficient whose value is odd in the target area into a first value, and converting the value in the target area as The value of the even-numbered quantization coefficient is converted into a second value, wherein one of the first value and the second value is an odd number, and the other is an even number; the value of the non-zero quantization coefficient in the target area is converted into a third value, and the The value of the quantization coefficient with zero value in the target area is converted into a fourth value, wherein one of the third value and the fourth value is an odd number, and the other is an even number; according to the fifth value, the value of the quantization coefficient in the target area is changed. Perform a reduction process or an increase process; multiply or divide the value of the quantization coefficient in the target area by a sixth non-zero value; convert the value of the quantization coefficient in the target area to an opposite number.
在本申请的一些实施例中,基于前述方案,多个区域中的每个区域包括以下任意一种:量化系数块中的全部区域;量化系数块中的一个位置或多个位置;量化系数块中的至少一行;量化系数块中的至少一列;量化系数块中的至少一行和的至少一列;量化系数块中处于至少一条斜线上的位置;量化系数块中的SRCC区域;SRCC区域中的一个位置或多个位置;SRCC区域中的至少一行;SRCC区域中的至少一列;SRCC区域中的至少一行和的至少一列;SRCC区域中处于至少一条斜线上的位置。In some embodiments of the present application, based on the foregoing scheme, each of the multiple regions includes any one of the following: all regions in the quantized coefficient block; one position or multiple positions in the quantized coefficient block; quantized coefficient block at least one row in the quantized coefficient block; at least one column in the quantized coefficient block; at least one row and at least one column in the quantized coefficient block; the position on at least one oblique line in the quantized coefficient block; the SRCC area in the quantized coefficient block; one position or more positions; at least one row in the SRCC area; at least one column in the SRCC area; at least one row and at least one column in the SRCC area; a position on at least one diagonal line in the SRCC area.
在本申请的一些实施例中,基于前述方案,SRCC区域中的一个位置或多个位置包括:按照扫描顺序的前N个位置或按照扫描顺序处于中间的N个位置,N为非0的自然数。In some embodiments of the present application, based on the foregoing solution, one or more positions in the SRCC area include: the first N positions in the scanning order or the N positions in the middle according to the scanning order, where N is a non-zero natural number .
在本申请的一些实施例中,基于前述方案,选择单元1006还配置为:根据各个区域的余数,生成多个区域对应的余数组合;根据余数组合与变换矩阵组合之间的对应关系,选择编码块对应的变换矩阵组合。In some embodiments of the present application, based on the aforementioned solution, the selection unit 1006 is further configured to: generate a remainder combination corresponding to a plurality of regions according to the remainder of each region; select a code according to the correspondence between the remainder combination and the transformation matrix combination The combination of transform matrices corresponding to the block.
在本申请的一些实施例中,基于前述方案,变换矩阵组合包括离散余弦变换DCT变换核和离散正弦变换DST变换核中的至少之一,且每个变换矩阵组合对应一个余数组合。In some embodiments of the present application, based on the foregoing solution, the transformation matrix combination includes at least one of a discrete cosine transform DCT transformation kernel and a discrete sine transform DST transformation kernel, and each transformation matrix combination corresponds to a remainder combination.
在本申请的一些实施例中,基于前述方案,数值为指定值的余数组合用于表示编码块跳过了变换处理过程。In some embodiments of the present application, based on the aforementioned scheme, the remainder combination whose value is a specified value is used to indicate that the encoding block skips the transformation process.
在本申请的一些实施例中,基于前述方案,变换矩阵组合包括DCT2、DCT5、DCT8、DST1、DST7中至少一种的组合。In some embodiments of the present application, based on the foregoing solution, the transformation matrix combination includes a combination of at least one of DCT2, DCT5, DCT8, DST1, and DST7.
在本申请的一些实施例中,基于前述方案,统计单元1004还配置为按照设定顺序对多个区域进行遍历处理,并针对遍历到的区域执行以下处理:对遍历到的区域内的量化系数进行统计处理,得到遍历到的区域的统计结果;确定遍历到的区域的统计结果针对设定值的余数;当根据遍历到的区域的余数不能选择出编码块对应的变换矩阵组合时,继续遍历下一个区域。In some embodiments of the present application, based on the foregoing solution, the statistics unit 1004 is further configured to perform traversal processing on multiple regions in a set order, and perform the following processing on the traversed regions: quantization coefficients in the traversed regions Perform statistical processing to obtain the statistical result of the traversed area; determine the remainder of the statistical result of the traversed area for the set value; when the transformation matrix combination corresponding to the coding block cannot be selected according to the remainder of the traversed area, continue to traverse next area.
在一些实施例中,本申请实施例提供的视频编码装置也可以设置在具有计算处理功能的电子设备内,比如可以设置在终端设备或服务器内。本申请实施例的视频编码装置包括:残差单元,配置为确定视频帧图像的原始图像信号与预测图像信号之间的残差数据;变换单元,配置为基于变换矩阵组合对残差数据进行变换处理,得到变换结果;量化单元,配置为对变换结果进行量化处理,得到量化系数;其中,量化系数用于指示变换矩阵组合;编码单元,配置为对量化系数进行熵编码处理,得到编码块。In some embodiments, the video encoding apparatus provided in the embodiments of the present application may also be set in an electronic device having a computing processing function, for example, may be set in a terminal device or a server. The video encoding apparatus according to the embodiment of the present application includes: a residual unit configured to determine residual data between an original image signal of a video frame image and a predicted image signal; a transform unit configured to transform the residual data based on a combination of transform matrices The quantization unit is configured to perform quantization processing on the transformation result to obtain quantized coefficients; wherein, the quantized coefficients are used to indicate the combination of transformation matrices; the coding unit is configured to perform entropy coding processing on the quantized coefficients to obtain coding blocks.
图11示出了适于用来实现本申请实施例的电子设备的计算机***的结构示意图。FIG. 11 shows a schematic structural diagram of a computer system suitable for implementing the electronic device according to the embodiment of the present application.
需要说明的是,图11示出的电子设备的计算机***1100仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。It should be noted that the computer system 1100 of the electronic device shown in FIG. 11 is only an example, and should not impose any limitations on the functions and scope of use of the embodiments of the present application.
如图11所示,计算机***1100包括中央处理单元(Central Processing Unit,CPU)1101,其可以根据存储在只读存储器(Read-Only Memory,ROM)1102中的程序或者从存储部分1108加载到随机访问存储器(Random Access Memory,RAM)1103中的程序而执行各种适当的动作和处理,例如执行上述实施例中的视频解码方法或视频编码方法。在RAM 1103中,还存储有***操作所需的各种程序和数据。CPU 1101、ROM 1102以及RAM 1103通过总线1104彼此相连。输入/输出(Input/Output,I/O)接口1105也连接至总线1104。As shown in FIG. 11 , the computer system 1100 includes a central processing unit (Central Processing Unit, CPU) 1101, which can be loaded into a random device according to a program stored in a read-only memory (Read-Only Memory, ROM) 1102 or from a storage part 1108 Various appropriate actions and processes are performed by accessing the programs in the memory (Random Access Memory, RAM) 1103, for example, performing the video decoding method or the video encoding method in the above-mentioned embodiments. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other through a bus 1104. An Input/Output (I/O) interface 1105 is also connected to the bus 1104 .
以下部件连接至I/O接口1105:包括键盘、鼠标等的输入部分1106;包括诸如阴极射线管(Cathode Ray Tube,CRT)、液晶显示器(Liquid Crystal Display,LCD)等以及扬声器等的输出部分1107;包括硬盘等的存储部分1108;以及包括诸如LAN(Local Area  Network,局域网)卡、调制解调器等的网络接口卡的通信部分1109。通信部分1109经由诸如因特网的网络执行通信处理。驱动器1110也根据需要连接至I/O接口1105。可拆卸介质1111,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1110上,以便于从其上读出的计算机程序根据需要被安装入存储部分1108。The following components are connected to the I/O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc. ; a storage part 1108 including a hard disk and the like; and a communication part 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 1109 performs communication processing via a network such as the Internet. Drivers 1110 are also connected to I/O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.
根据本申请的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本申请的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序用于执行流程图所示的视频解码方法或视频解码方法。在这样的实施例中,该计算机程序可以通过通信部分1109从网络上被下载和安装,和/或从可拆卸介质1111被安装。在该计算机程序被中央处理单元(CPU)1101执行时,执行本申请实施例的***中限定的各种功能。According to embodiments of the present application, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program being used to execute the video decoding method or the video decoding method shown in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication portion 1109, and/or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, various functions defined in the system of the embodiment of the present application are executed.
需要说明的是,本申请实施例所示的计算机可读介质可以是计算机可读信号介质,可以是计算机可读存储介质,也可以是上述两者的任意组合。计算机可读存储介质包括但不限于电、磁、光、电磁、红外线、或半导体的***、装置或器件,或者任意以上的组合。在一些实施例中,计算机可读存储介质可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、闪存、光纤、便携式紧凑磁盘只读存储器(Compact Disc Read-Only Memory,CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请实施例中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行***、装置或者器件使用或者与其结合使用。而在本申请实施例中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的计算机程序。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行***、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的计算机程序可以用任何适当的介质传输,包括但不限于:无线、有线等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium, may be a computer-readable storage medium, or may be any combination of the above two. Computer readable storage media include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus or devices, or a combination of any of the above. In some embodiments, 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 of the above suitable combination. In the embodiments of the present application, the computer-readable storage medium may be any tangible medium containing or storing a program, and the program may be used by or in combination with an instruction execution system, apparatus, or device. In the embodiments of the present application, however, the computer-readable signal medium may include a data signal propagated in a baseband or as a part of a carrier wave, carrying a computer-readable computer program 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 . A computer program 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.
附图中的流程图和框图,图示了按照本申请各种实施例的***、方法和计算机程序产品的可能实现的体系架构、功能和操作。其中,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的***来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. Wherein, each block in the flowchart or block diagram may represent a module, program segment, or part of code, and the above-mentioned module, program segment, or part of code contains one or more executables for realizing the specified logical function instruction. It should also be noted that, in some alternative implementations, 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. It is also noted that each block of the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented in special purpose hardware-based systems that perform the specified functions or operations, or can be implemented using A combination of dedicated hardware and computer instructions is implemented.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现,所描述的单元也可以设置在处理器中。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present application may be implemented in software or hardware, and the described units may also be provided in a processor. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
本申请实施例还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。上述计算机可读介质承载有一个或者多个程序(即计算机程序),当上述一个或者多个程序被一个该电子设备执行时,使得该电子设备实现上述实施例中的视频解码方法或视频编码方法。Embodiments of the present application further provide a computer-readable medium, which may be included in the electronic device described in the foregoing embodiments, or may exist independently without being assembled into the electronic device. The above-mentioned computer-readable medium carries one or more programs (that is, computer programs), and when the above-mentioned one or more programs are executed by an electronic device, the electronic device is made to realize the video decoding method or the video encoding method in the above-mentioned embodiment. .
本申请实施例还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计 算机程序包括计算机指令(即可执行指令),该计算机指令存储在计算机可读介质中。电子设备的处理器从计算机可读介质读取该计算机指令,处理器执行该计算机指令,使得该电子设备执行上述实施例中提供的视频解码方法或视频编码方法。Embodiments of the present application also provide a computer program product or computer program, where the computer program product or computer program includes computer instructions (ie, executable instructions), and the computer instructions are stored in a computer-readable medium. The processor of the electronic device reads the computer instructions from the computer-readable medium, and the processor executes the computer instructions, so that the electronic device executes the video decoding method or the video encoding method provided in the above embodiments.
应当注意,尽管在上文详细描述中提及了用于动作执行的设备的若干模块或者单元,但是这种划分并非强制性的。实际上,根据本申请的实施方式,上文描述的两个或更多模块或者单元的特征和功能可以在一个模块或者单元中具体化。反之,上文描述的一个模块或者单元的特征和功能可以进一步划分为由多个模块或者单元来具体化。It should be noted that although several modules or units of the apparatus for action performance are mentioned in the above detailed description, this division is not mandatory. Indeed, according to embodiments of the present application, the features and functions of two or more modules or units described above may be embodied in one module or unit. Conversely, the features and functions of one module or unit described above may be further divided into multiple modules or units to be embodied.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,根据本申请实施方式的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中或网络上,包括若干指令以使得一台电子设备(可以是个人计算机、服务器、触控终端、或者网络设备等)执行根据本申请实施方式的方法。From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein may be implemented by software, or may 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 an electronic 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.
本领域技术人员在考虑说明书及实践这里公开的实施方式后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。Other embodiments of the present application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses or adaptations of this application that follow the general principles of this application and include common knowledge or conventional techniques in the technical field not disclosed in this application .
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。It is to be understood that the present application is not limited to the precise structures described above and illustrated in the accompanying drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (21)

  1. 一种视频解码方法,包括:A video decoding method, comprising:
    对视频图像帧的编码块进行熵解码处理,得到所述编码块对应的残差数据的量化系数块;Entropy decoding is performed on the coding block of the video image frame to obtain a quantized coefficient block of residual data corresponding to the coding block;
    对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,确定所述各个区域的统计结果针对设定值的余数;Perform statistical processing on the quantization coefficients in the multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of the respective regions in the multiple regions, and determine the remainder of the statistical results of the respective regions to the set value;
    根据所述各个区域的余数选择所述编码块对应的变换矩阵组合;Select the transformation matrix combination corresponding to the coding block according to the remainder of the respective regions;
    基于选择的变换矩阵组合对所述量化系数块的反量化结果进行反变换处理。Inverse transform processing is performed on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
  2. 根据权利要求1所述的视频解码方法,其中,所述方法还包括:The video decoding method according to claim 1, wherein the method further comprises:
    根据所述编码块对应的索引标识的取值、所述编码块对应的指示位的取值、以及所述编码块的尺寸与预设阈值范围之间的关系中的至少之一,确定所述编码块是否需要根据量化系数选择对应的变换矩阵组合;According to at least one of the value of the index identifier corresponding to the coding block, the value of the indicator bit corresponding to the coding block, and the relationship between the size of the coding block and a preset threshold range, determine the Whether the coding block needs to select the corresponding transformation matrix combination according to the quantization coefficient;
    其中,所述编码块为以下任一:采用帧内编码模式的编码块、采用帧间编码模式的编码块、采用任意编码模式的编码块。Wherein, the coding block is any one of the following: a coding block using an intra-frame coding mode, a coding block using an inter-frame coding mode, and a coding block using an arbitrary coding mode.
  3. 根据权利要求2所述的视频解码方法,其中,所述根据所述编码块对应的索引标识的取值、所述编码块对应的指示位的取值、以及所述编码块的尺寸与预设阈值范围之间的关系中的至少之一,确定所述编码块是否需要根据量化系数选择对应的变换矩阵组合,包括:The video decoding method according to claim 2, wherein the value of the index identifier corresponding to the coding block, the value of the indicator bit corresponding to the coding block, and the size of the coding block are different from a preset value. At least one of the relationships between the threshold ranges to determine whether the coding block needs to select a corresponding combination of transformation matrices according to the quantization coefficients, including:
    执行以下至少一种处理:Perform at least one of the following processes:
    根据视频图像帧序列对应的第一编码数据的序列头部包含的索引标识的取值,确定所述第一编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合;According to the value of the index identifier included in the sequence header of the first encoded data corresponding to the video image frame sequence, determine whether the encoding block in the first encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient;
    根据所述视频图像帧对应的第二编码数据的图像头部包含的索引标识的取值,确定所述第二编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合;According to the value of the index identifier included in the image header of the second encoded data corresponding to the video image frame, determine whether the encoding block in the second encoded data needs to select the corresponding transformation matrix combination according to the quantization coefficient;
    根据所述视频图像帧的条带对应的第三编码数据的条带头部信息包含的索引标识的取值,确定所述第三编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合;According to the value of the index identifier included in the slice header information of the third encoded data corresponding to the slice of the video image frame, it is determined whether the encoding block in the third encoded data needs to select the corresponding transformation matrix according to the quantization coefficient. combination;
    根据所述视频图像帧的最大编码单元LCU对应的第四编码数据的LCU头部信息包含的索引标识的取值,确定所述第四编码数据中的编码块是否需要根据量化系数选择对应的变换矩阵组合。According to the value of the index identifier included in the LCU header information of the fourth encoded data corresponding to the largest coding unit LCU of the video image frame, it is determined whether the encoding block in the fourth encoded data needs to select the corresponding transform according to the quantization coefficient matrix combination.
  4. 根据权利要求2所述的视频解码方法,其中,所述根据所述编码块对应的索引标识的取值、所述编码块对应的指示位的取值、以及所述编码块的尺寸与预设阈值范围之间的关系中的至少之一,确定所述编码块是否需要根据量化系数选择对应的变换矩阵组合,包括:The video decoding method according to claim 2, wherein the value of the index identifier corresponding to the coding block, the value of the indicator bit corresponding to the coding block, and the size of the coding block are different from a preset value. At least one of the relationships between the threshold ranges to determine whether the coding block needs to select a corresponding combination of transformation matrices according to the quantization coefficients, including:
    执行以下至少一种处理:Perform at least one of the following processes:
    根据视频图像帧序列对应的第一编码数据的序列头部包含的第一指示位的取值和第二指示位的取值,分别确定所述第一编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合;According to the value of the first indicator bit and the value of the second indicator bit included in the sequence header of the first encoded data corresponding to the video image frame sequence, the encoding blocks in the first encoded data that use the intra-frame encoding mode are determined respectively. and whether the coding block in the inter-frame coding mode needs to select the corresponding transformation matrix combination according to the quantization coefficient;
    根据所述视频图像帧对应的第二编码数据的图像头部包含的第一指示位的取值和第二指示位的取值,分别确定所述第二编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合;According to the value of the first indicator bit and the value of the second indicator bit included in the image header of the second encoded data corresponding to the video image frame, the encoding using the intra-frame encoding mode in the second encoded data is determined respectively. Whether the block and the coding block using the inter-coding mode need to select the corresponding transformation matrix combination according to the quantization coefficient;
    根据所述视频图像帧的条带对应的第三编码数据的条带头部信息包含的第一指示位的取值和第二指示位的取值,分别确定所述第三编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合;According to the value of the first indicator bit and the value of the second indicator bit included in the slice header information of the third encoded data corresponding to the slice of the video image frame, the frame used in the third encoded data is determined respectively. Whether the coding block in the intra-coding mode and the coding block in the inter-coding mode need to select the corresponding transformation matrix combination according to the quantization coefficient;
    根据所述视频图像帧的LCU对应的第四编码数据的LCU头部信息包含的第一指示位的取值和第二指示位的取值,分别确定所述第四编码数据中采用帧内编码模式的编码块和采用帧间编码模式的编码块是否需要根据量化系数选择对应的变换矩阵组合。According to the value of the first indicator bit and the value of the second indicator bit included in the LCU header information of the fourth encoded data corresponding to the LCU of the video image frame, it is respectively determined that intra-frame encoding is used in the fourth encoded data Whether the coding block in the mode and the coding block in the inter-frame coding mode need to select the corresponding transformation matrix combination according to the quantization coefficient.
  5. 根据权利要求2所述的视频解码方法,其中,所述根据所述编码块对应的索引标识的取值、所述编码块对应的指示位的取值、以及所述编码块的尺寸与预设阈值范围之间的关系中的至少之一,确定所述编码块是否需要根据量化系数选择对应的变换矩阵组合,包括:The video decoding method according to claim 2, wherein the value of the index identifier corresponding to the coding block, the value of the indicator bit corresponding to the coding block, and the size of the coding block are different from a preset value. At least one of the relationships between the threshold ranges to determine whether the coding block needs to select a corresponding combination of transformation matrices according to the quantization coefficients, including:
    当所述编码块的尺寸小于第一预设阈值时,确定所述编码块需要根据量化系数选择对应的变换矩阵组合;When the size of the coding block is smaller than the first preset threshold, it is determined that the coding block needs to select a corresponding transformation matrix combination according to the quantization coefficient;
    当所述编码块的尺寸大于第二预设阈值时,确定所述编码块不需要根据量化系数选择对应的变换矩阵组合;When the size of the coding block is greater than the second preset threshold, it is determined that the coding block does not need to select a corresponding transformation matrix combination according to the quantization coefficient;
    其中,所述第二预设阈值大于或等于所述第一预设阈值。Wherein, the second preset threshold is greater than or equal to the first preset threshold.
  6. 根据权利要求1所述的视频解码方法,其中,所述对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,包括:The video decoding method according to claim 1, wherein the performing statistical processing on the quantization coefficients in multiple regions in the quantization coefficient block to obtain statistical results of each region in the multiple regions, comprising:
    针对所述多个区域中的目标区域,执行以下任意一种处理:For the target area in the plurality of areas, any one of the following processing is performed:
    确定所述目标区域内的量化系数的数值之和,将得到的和值作为所述目标区域的统计结果;Determine the numerical sum of the quantization coefficients in the target area, and use the obtained sum as the statistical result of the target area;
    确定所述目标区域内的量化系数的绝对值之和,将得到的和值作为所述目标区域的统计结果;Determine the sum of the absolute values of the quantization coefficients in the target area, and use the obtained sum as the statistical result of the target area;
    确定所述目标区域内数值为奇数的量化系数的数值之和,将得到的和值作为所述目标区域的统计结果;Determine the numerical sum of the odd-numbered quantization coefficients in the target area, and use the obtained sum as the statistical result of the target area;
    确定所述目标区域内数值为奇数的量化系数的绝对值之和,将得到的和值作为所述目标区域的统计结果;Determine the sum of the absolute values of the odd-numbered quantization coefficients in the target area, and use the obtained sum as the statistical result of the target area;
    确定所述目标区域内数值为偶数或非零偶数的量化系数的数值之和,将得到的和值作为所述目标区域的统计结果;Determine the numerical sum of the quantization coefficients whose values are even or non-zero even in the target area, and use the obtained sum as the statistical result of the target area;
    确定所述目标区域内数值为偶数或非零偶数的量化系数的绝对值之和,将得到的和值作为所述目标区域的统计结果;Determine the sum of the absolute values of the quantization coefficients whose values are even or non-zero even in the target area, and use the obtained sum as the statistical result of the target area;
    其中,所述目标区域表示所述多个区域中的任意一个区域。Wherein, the target area represents any one of the multiple areas.
  7. 根据权利要求1所述的视频解码方法,其中,所述对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,包括:The video decoding method according to claim 1, wherein the performing statistical processing on the quantization coefficients in multiple regions in the quantization coefficient block to obtain statistical results of each region in the multiple regions, comprising:
    将目标区域内的量化系数的数值进行线性映射,并将所述量化系数在线性映射之后的数值之和或绝对值之和作为所述目标区域的统计结果;The numerical value of the quantization coefficient in the target area is linearly mapped, and the numerical sum or the sum of the absolute value of the quantization coefficient after the linear mapping is used as the statistical result of the target area;
    其中,所述目标区域表示所述多个区域中的任意一个区域。Wherein, the target area represents any one of the multiple areas.
  8. 根据权利要求7所述的视频解码方法,其中,所述将目标区域内的量化系数的数值进行线性映射,包括:The video decoding method according to claim 7, wherein the linearly mapping the numerical values of the quantization coefficients in the target area comprises:
    执行以下任意一种处理:Perform any of the following processing:
    将所述目标区域内数值为奇数的量化系数的数值转换为第一数值,将所述目标区域内数值为偶数的量化系数的数值转换为第二数值,其中,所述第一数值和所述第二数值中的一个为奇数,另一个为偶数;Convert the numerical value of the quantization coefficient whose value is an odd number in the target area into a first numerical value, and convert the numerical value of the quantization coefficient whose value is an even number in the target area into a second numerical value, wherein the first numerical value and the One of the second values is odd and the other is even;
    将所述目标区域内的非零量化系数的数值转换为第三数值,将所述目标区域内数值为零的量化系数的数值转换为第四数值,其中,所述第三数值和所述第四数值中的一个为奇数,另一个为偶数;Convert the numerical value of the non-zero quantization coefficient in the target area into a third numerical value, and convert the numerical value of the quantization coefficient with zero value in the target area into a fourth numerical value, wherein the third numerical value and the third numerical value are One of the four values is odd and the other is even;
    根据第五数值对所述目标区域内的量化系数的数值进行减少处理或增加处理;Perform a reduction process or an increase process on the value of the quantization coefficient in the target area according to the fifth value;
    将所述目标区域内的量化系数的数值乘以或除以非零的第六数值;multiplying or dividing the value of the quantization coefficients within the target region by a sixth non-zero value;
    将所述目标区域内的量化系数的数值转换为相反数。The numerical values of the quantization coefficients in the target area are converted to opposite numbers.
  9. 根据权利要求1至8中任一项所述的视频解码方法,其中,所述多个区域中的每个区域包括以下任意一种:The video decoding method according to any one of claims 1 to 8, wherein each of the plurality of regions comprises any one of the following:
    所述量化系数块中的全部区域;all regions in the block of quantized coefficients;
    所述量化系数块中的一个位置或多个位置;a position or positions in the block of quantized coefficients;
    所述量化系数块中的至少一行;at least one row in the block of quantized coefficients;
    所述量化系数块中的至少一列;at least one column in the block of quantized coefficients;
    所述量化系数块中的至少一行和至少一列;at least one row and at least one column in the block of quantized coefficients;
    所述量化系数块中处于至少一条斜线上的位置;a position on at least one oblique line in the quantized coefficient block;
    所述量化系数块中的扫描区域系数编码SRCC区域;the scanning region coefficients in the quantized coefficient block encode the SRCC region;
    所述SRCC区域中的一个位置或多个位置;a location or locations in the SRCC area;
    所述SRCC区域中的至少一行;at least one row in the SRCC area;
    所述SRCC区域中的至少一列;at least one column in the SRCC area;
    所述SRCC区域中的至少一行和至少一列;at least one row and at least one column in the SRCC area;
    所述SRCC区域中处于至少一条斜线上的位置。The SRCC area is located on at least one diagonal line.
  10. 根据权利要求9所述的视频解码方法,其中,所述SRCC区域中的一个位置或多个位置包括:按照扫描顺序的前N个位置或按照扫描顺序处于中间的N个位置,N为非0的自然数。The video decoding method according to claim 9, wherein the one or more positions in the SRCC region include: the first N positions in the scanning order or the N positions in the middle according to the scanning order, and N is non-0 of natural numbers.
  11. 根据权利要求1至8中任一项所述的视频解码方法,其中,所述根据所述各个区域的余数选择所述编码块对应的变换矩阵组合,包括:The video decoding method according to any one of claims 1 to 8, wherein the selecting the transformation matrix combination corresponding to the coding block according to the remainder of the respective regions comprises:
    根据所述各个区域的余数,生成所述多个区域对应的余数组合;generating a remainder combination corresponding to the multiple regions according to the remainders of the respective regions;
    根据所述余数组合与变换矩阵组合之间的对应关系,选择所述编码块对应的变换矩阵组合。According to the correspondence between the remainder combination and the transformation matrix combination, the transformation matrix combination corresponding to the coding block is selected.
  12. 根据权利要求11所述的视频解码方法,其中,所述变换矩阵组合包括离散余弦变换DCT变换核和离散正弦变换DST变换核中的至少之一,且每个所述变换矩阵组合对应一个余数组合。The video decoding method according to claim 11, wherein the transformation matrix combination comprises at least one of a discrete cosine transform (DCT) transformation kernel and a discrete sine transform (DST) transformation kernel, and each of the transformation matrix combinations corresponds to a remainder combination .
  13. 根据权利要求11所述的视频解码方法,其中,数值为指定值的余数组合用于表示所述编码块跳过了变换处理过程。12. The video decoding method of claim 11, wherein a combination of remainders whose value is a specified value is used to indicate that the encoding block skips a transform process.
  14. 根据权利要求1至8任一项所述的视频解码方法,其中,所述变换矩阵组合包括DCT2、DCT5、DCT8、DST1、DST7中至少一种的组合。The video decoding method according to any one of claims 1 to 8, wherein the transformation matrix combination comprises a combination of at least one of DCT2, DCT5, DCT8, DST1, and DST7.
  15. 根据权利要求1至8中任一项所述的视频解码方法,其中,所述对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,包括:The video decoding method according to any one of claims 1 to 8, wherein the quantization coefficients in the plurality of regions in the quantization coefficient block are respectively subjected to statistical processing to obtain each region in the plurality of regions statistics, including:
    按照设定顺序对所述多个区域进行遍历处理,并针对遍历到的区域执行以下处理:Perform traversal processing on the multiple areas in a set order, and perform the following processing on the traversed areas:
    对所述遍历到的区域内的量化系数进行统计处理,得到所述遍历到的区域的统计结果;Statistical processing is performed on the quantization coefficients in the traversed area to obtain a statistical result of the traversed area;
    确定所述遍历到的区域的统计结果针对设定值的余数;Determine the remainder of the statistical result of the traversed area for the set value;
    当根据所述遍历到的区域的余数不能选择出所述编码块对应的变换矩阵组合时,继续遍历下一个区域。When the transformation matrix combination corresponding to the coding block cannot be selected according to the remainder of the traversed area, continue to traverse the next area.
  16. 一种视频编码方法,包括:A video encoding method, comprising:
    确定视频帧图像的原始图像信号与预测图像信号之间的残差数据;Determine residual data between the original image signal of the video frame image and the predicted image signal;
    基于变换矩阵组合对所述残差数据进行变换处理,得到变换结果;Transform the residual data based on the combination of transformation matrices to obtain a transformation result;
    对所述变换结果进行量化处理,得到量化系数;其中,所述量化系数用于指示所述变换矩阵组合;Perform quantization processing on the transformation result to obtain quantization coefficients; wherein, the quantization coefficients are used to indicate the transformation matrix combination;
    对所述量化系数进行熵编码处理,得到编码块。Entropy encoding is performed on the quantized coefficients to obtain an encoded block.
  17. 一种视频解码装置,包括:A video decoding device, comprising:
    解码单元,配置为对视频图像帧的编码块进行熵解码处理,得到所述编码块对应的残差数据的量化系数块;a decoding unit, configured to perform entropy decoding processing on an encoding block of a video image frame to obtain a quantized coefficient block of residual data corresponding to the encoding block;
    统计单元,配置为对所述量化系数块中的多个区域内的量化系数分别进行统计处理,得到所述多个区域中各个区域的统计结果,确定所述各个区域的统计结果针对设定值的余数;A statistical unit, configured to perform statistical processing on the quantization coefficients in the multiple regions in the quantization coefficient block, respectively, to obtain the statistical results of each of the multiple regions, and to determine that the statistical results of the respective regions are relative to the set value the remainder;
    选择单元,配置为根据所述各个区域的余数选择所述编码块对应的变换矩阵组合;a selection unit, configured to select the transformation matrix combination corresponding to the coding block according to the remainder of the respective regions;
    处理单元,配置为基于选择的变换矩阵组合对所述量化系数块的反量化结果进行反变换处理。The processing unit is configured to perform inverse transform processing on the inverse quantization result of the quantized coefficient block based on the selected transform matrix combination.
  18. 一种视频编码装置,包括:A video encoding device, comprising:
    残差单元,配置为确定视频帧图像的原始图像信号与预测图像信号之间的残差数据;a residual unit, configured to determine residual data between the original image signal of the video frame image and the predicted image signal;
    变换单元,配置为基于变换矩阵组合对所述残差数据进行变换处理,得到变换结果;a transformation unit, configured to perform transformation processing on the residual data based on the transformation matrix combination to obtain a transformation result;
    量化单元,配置为对所述变换结果进行量化处理,得到量化系数;其中,所述量化系数用于指示所述变换矩阵组合;a quantization unit, configured to perform quantization processing on the transformation result to obtain a quantization coefficient; wherein the quantization coefficient is used to indicate the transformation matrix combination;
    编码单元,配置为对所述量化系数进行熵编码处理,得到编码块。an encoding unit, configured to perform entropy encoding processing on the quantized coefficients to obtain an encoding block.
  19. 一种计算机可读介质,存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至15中任一项所述的视频解码方法,或者如权利要求16所述的视频编码方法。A computer-readable medium storing a computer program that, when executed by a processor, implements the video decoding method as claimed in any one of claims 1 to 15, or the video encoding method as claimed in claim 16 .
  20. 一种电子设备,包括:An electronic device comprising:
    一个或多个处理器;one or more processors;
    存储装置,用于存储一个或多个计算机程序,当所述一个或多个计算机程序被所述一个或多个处理器执行时,使得所述一个或多个处理器实现如权利要求1至15中任一项所述的视频解码方法,或者如权利要求16所述的视频编码方法。A storage device for storing one or more computer programs which, when executed by the one or more processors, cause the one or more processors to implement the methods of claims 1 to 15 The video decoding method according to any one of the above, or the video encoding method according to claim 16 .
  21. 一种计算机程序产品,包括计算机指令,所述计算机指令被处理器执行时实现如权利要求1至15中任一项所述的视频解码方法,或者如权利要求16所述的视频编码方法。A computer program product comprising computer instructions which, when executed by a processor, implement the video decoding method as claimed in any one of claims 1 to 15, or the video encoding method as claimed in claim 16.
PCT/CN2021/118810 2020-09-27 2021-09-16 Video decoding method and apparatus, video coding method and apparatus, computer-readable medium, and electronic device WO2022063033A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011054872.8A CN112543337B (en) 2020-09-27 2020-09-27 Video decoding method, device, computer readable medium and electronic equipment
CN202011054872.8 2020-09-27

Publications (1)

Publication Number Publication Date
WO2022063033A1 true WO2022063033A1 (en) 2022-03-31

Family

ID=75013489

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/118810 WO2022063033A1 (en) 2020-09-27 2021-09-16 Video decoding method and apparatus, video coding method and apparatus, computer-readable medium, and electronic device

Country Status (2)

Country Link
CN (1) CN112543337B (en)
WO (1) WO2022063033A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114079772B (en) * 2020-08-21 2023-04-07 腾讯科技(深圳)有限公司 Video decoding method and device, computer readable medium and electronic equipment
CN113824957B (en) * 2020-09-27 2022-10-28 腾讯科技(深圳)有限公司 Video encoding and decoding method and device and electronic equipment
CN112543337B (en) * 2020-09-27 2023-05-02 腾讯科技(深圳)有限公司 Video decoding method, device, computer readable medium and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771868A (en) * 2008-12-31 2010-07-07 华为技术有限公司 Method and device for processing images in quantification
CN109788286A (en) * 2019-02-01 2019-05-21 北京大学深圳研究生院 A kind of coding, decoded transform method, system, equipment and computer-readable medium
WO2020050651A1 (en) * 2018-09-05 2020-03-12 엘지전자 주식회사 Multiple transform selection-based image coding method and device therefor
CN111225206A (en) * 2018-11-23 2020-06-02 华为技术有限公司 Video decoding method and video decoder
CN111385584A (en) * 2018-12-28 2020-07-07 杭州海康威视数字技术股份有限公司 Method, device and system for encoding and decoding
CN112543337A (en) * 2020-09-27 2021-03-23 腾讯科技(深圳)有限公司 Video decoding method and device, computer readable medium and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5740239B2 (en) * 2011-08-03 2015-06-24 日本放送協会 Mode information transmission / replacement device, image encoding device, image decoding device, and programs thereof
FR3038196A1 (en) * 2015-06-29 2016-12-30 B<>Com METHOD FOR ENCODING A DIGITAL IMAGE, DECODING METHOD, DEVICES AND COMPUTER PROGRAMS
WO2020244662A1 (en) * 2019-06-06 2020-12-10 Beijing Bytedance Network Technology Co., Ltd. Simplified transform coding tools
CN112449192B (en) * 2019-08-27 2022-09-16 杭州海康威视数字技术股份有限公司 Decoding method, encoding method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771868A (en) * 2008-12-31 2010-07-07 华为技术有限公司 Method and device for processing images in quantification
WO2020050651A1 (en) * 2018-09-05 2020-03-12 엘지전자 주식회사 Multiple transform selection-based image coding method and device therefor
CN111225206A (en) * 2018-11-23 2020-06-02 华为技术有限公司 Video decoding method and video decoder
CN111385584A (en) * 2018-12-28 2020-07-07 杭州海康威视数字技术股份有限公司 Method, device and system for encoding and decoding
CN109788286A (en) * 2019-02-01 2019-05-21 北京大学深圳研究生院 A kind of coding, decoded transform method, system, equipment and computer-readable medium
CN112543337A (en) * 2020-09-27 2021-03-23 腾讯科技(深圳)有限公司 Video decoding method and device, computer readable medium and electronic equipment

Also Published As

Publication number Publication date
CN112543337A (en) 2021-03-23
CN112543337B (en) 2023-05-02

Similar Documents

Publication Publication Date Title
WO2022078163A1 (en) Video decoding method, video encoding method, and related device
WO2022063033A1 (en) Video decoding method and apparatus, video coding method and apparatus, computer-readable medium, and electronic device
WO2022062880A1 (en) Video decoding method and apparatus, computer readable medium, and electronic device
WO2022078304A1 (en) Video decoding method and apparatus, computer readable medium, program, and electronic device
WO2022174660A1 (en) Video coding and decoding method, video coding and decoding apparatus, computer-readable medium, and electronic device
CN113207002A (en) Video encoding and decoding method and device, computer readable medium and electronic equipment
US20230053118A1 (en) Video decoding method, video coding method, and related apparatus
WO2022037478A1 (en) Video decoding method, video encoding method, apparatus, medium, and electronic device
WO2022037477A1 (en) Video decoding method and apparatus, computer readable medium, and electronic device
WO2022174637A1 (en) Video encoding and decoding method, video encoding and decoding apparatus, computer-readable medium and electronic device
WO2022063040A1 (en) Video coding/decoding method, apparatus, and device
WO2022174701A1 (en) Video coding method and apparatus, video decoding method and apparatus, and computer-readable medium and electronic device
WO2023130899A1 (en) Loop filtering method, video encoding/decoding method and apparatus, medium, and electronic device
WO2022116854A1 (en) Video decoding method and apparatus, readable medium, electronic device, and program product
WO2022174638A1 (en) Video coding method and apparatus, video decoding method and apparatus, computer readable medium, and electronic device
US20230077935A1 (en) Video Encoding Method and Apparatus, Video Decoding Method and Apparatus, Computer-Readable Medium, and Electronic Device
CN115209146A (en) Video encoding and decoding method and device, computer readable medium and electronic equipment

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: 21871403

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 11/08/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21871403

Country of ref document: EP

Kind code of ref document: A1