CN112449184B - Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device - Google Patents

Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device Download PDF

Info

Publication number
CN112449184B
CN112449184B CN201910802828.1A CN201910802828A CN112449184B CN 112449184 B CN112449184 B CN 112449184B CN 201910802828 A CN201910802828 A CN 201910802828A CN 112449184 B CN112449184 B CN 112449184B
Authority
CN
China
Prior art keywords
coefficient
zero
frequency band
coefficients
encoding
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910802828.1A
Other languages
Chinese (zh)
Other versions
CN112449184A (en
Inventor
崔静
马思伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Peking University
Tencent Technology Shenzhen Co Ltd
Original Assignee
Peking University
Tencent Technology Shenzhen Co Ltd
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 Peking University, Tencent Technology Shenzhen Co Ltd filed Critical Peking University
Priority to CN201910802828.1A priority Critical patent/CN112449184B/en
Publication of CN112449184A publication Critical patent/CN112449184A/en
Application granted granted Critical
Publication of CN112449184B publication Critical patent/CN112449184B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/13Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock

Landscapes

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

Abstract

The embodiment of the application provides a transformation coefficient optimization method, a coding and decoding method, a device, a medium and electronic equipment. The transform coefficient optimization method comprises the following steps: dividing coefficients contained in a video frame coding block into at least two frequency band segments according to a scanning sequence; detecting whether the at least two frequency band segments contain non-zero coefficients or not; if the first band segment of the at least two band segments according to the scanning order does not contain a non-zero coefficient, adjusting a zero coefficient at a specified position in the first band segment to be a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame encoding block, wherein the target syntax element is used for indicating whether the first band segment contains a non-zero coefficient. The technical scheme of the embodiment of the application can improve the coding efficiency and the decoding efficiency of the video frame coding block.

Description

Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device
Technical Field
The present application relates to the field of computer and communication technologies, and in particular, to a transform coefficient optimization method, an encoding and decoding method, an apparatus, a medium, and an electronic device.
Background
In the video coding standard, coefficient coding is that the whole coding block is coded one by one in a certain scanning mode, each non-zero coefficient in the coding block needs to be bound with a previous continuous zero coefficient for coding, and even if the previous zero coefficient is 0, the coding needs to be carried out to find the corresponding coefficient position at a decoding end. It can be seen that this coding scheme brings more extra coded bits, resulting in lower coding efficiency and decoding efficiency.
Disclosure of Invention
Embodiments of the present application provide a transform coefficient optimization method, a coding and decoding method, an apparatus, a medium, and an electronic device, so that coding efficiency and decoding efficiency of a video frame coding block can be improved at least to a certain extent.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of an embodiment of the present application, there is provided a transform coefficient optimization method, including: dividing coefficients contained in a video frame coding block into at least two frequency band segments according to a scanning sequence; detecting whether the at least two frequency band segments contain non-zero coefficients or not; if the first band segment of the at least two band segments according to the scanning order does not contain a non-zero coefficient, adjusting a zero coefficient at a specified position in the first band segment to be a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame encoding block, wherein the target syntax element is used for indicating whether the first band segment contains a non-zero coefficient.
According to an aspect of an embodiment of the present application, there is provided a video decoding method including: acquiring coded data corresponding to a video frame to be decoded, wherein the coded data comprise coding results of at least two frequency band segments, the at least two frequency band segments are obtained by dividing coefficients contained in a video frame coding block according to a scanning sequence, and a first frequency band segment in the at least two frequency band segments according to the scanning sequence comprises a nonzero coefficient; determining the condition of non-zero coefficients contained in other frequency band segments except the first frequency band segment in the at least two frequency band segments; and decoding each frequency band section by adopting a corresponding decoding strategy according to the condition of the nonzero coefficient contained in each frequency band section in the at least two frequency band sections.
According to an aspect of an embodiment of the present application, there is provided a video encoding method, including: obtaining at least two frequency band sections obtained by dividing coefficients contained in a video frame coding block according to a scanning sequence, wherein a first frequency band section of the at least two frequency band sections according to the scanning sequence contains a nonzero coefficient; determining the condition of non-zero coefficients contained in other frequency band segments except the first frequency band segment in the at least two frequency band segments; and coding syntax elements for indicating the condition of the non-zero coefficients contained in the other frequency band segments, and coding each frequency band segment by adopting a corresponding coding strategy according to the condition of the non-zero coefficients contained in each of the at least two frequency band segments.
According to an aspect of the embodiments of the present application, there is provided a transform coefficient optimization apparatus including: a dividing unit for dividing coefficients contained in a video frame coding block into at least two band segments according to a scanning order; a detecting unit, configured to detect whether the at least two frequency band segments include a non-zero coefficient; a processing unit, configured to, when a first band segment of the at least two band segments according to the scanning order does not include a non-zero coefficient, adjust a zero coefficient at a specified position in the first band segment to a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame coding block, where the target syntax element is used to indicate whether the first band segment includes a non-zero coefficient.
In some embodiments of the present application, based on the foregoing solution, the processing unit is configured to: and adjusting the zero coefficient at the last position or the first position in the first frequency band section into a non-zero coefficient.
In some embodiments of the present application, based on the foregoing solution, the processing unit is configured to: calculating rate distortion cost for adjusting the zero coefficient of the last position or the first position to be each candidate non-zero coefficient, and obtaining the rate distortion cost corresponding to each candidate non-zero coefficient; and selecting the candidate non-zero coefficient corresponding to the minimum rate distortion cost as the value of the non-zero coefficient at the last position or the first position according to the rate distortion cost corresponding to each candidate non-zero coefficient.
In some embodiments of the present application, based on the foregoing scheme, the respective candidate non-zero coefficients include: -1 and 1.
In some embodiments of the present application, based on the foregoing solution, the processing unit is configured to: calculating rate distortion cost difference values between zero coefficients of all positions in the first frequency band section and all candidate non-zero coefficients to obtain rate distortion cost difference values corresponding to all the positions; and selecting the position corresponding to the minimum rate-distortion cost difference value as the designated position according to the rate-distortion cost difference value corresponding to each position, and adjusting the coefficient value of the designated position to be the candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
In some embodiments of the present application, based on the foregoing solution, the processing unit is configured to: selecting a target part for determining the designated position in the first frequency band segment according to the condition of a nonzero coefficient contained in a coding block before the video frame coding block; calculating rate distortion cost difference values between zero coefficients and candidate non-zero coefficients of all positions in the target part to obtain rate distortion cost difference values corresponding to all the positions; and selecting the position corresponding to the minimum rate-distortion cost difference value as the designated position according to the rate-distortion cost difference value corresponding to each position, and adjusting the coefficient value of the designated position to be the candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
In some embodiments of the present application, based on the foregoing solution, the processing unit is configured to: if the latter half part of the former coding block contains non-zero coefficients, taking the latter half part of the first frequency band segment as the target part; and if the second half of the previous coding block does not contain a nonzero coefficient, taking the first half of the first frequency band segment as the target part.
In some embodiments of the present application, based on the foregoing scheme, the dividing unit is configured to: dividing the coefficients contained in the video frame coding block into two frequency band sections according to a scanning sequence, wherein the number of the coefficients contained in the first frequency band section of the two frequency band sections according to the scanning sequence is smaller than the number of the coefficients contained in the second frequency band section.
According to an aspect of an embodiment of the present application, there is provided a video decoding apparatus including: an obtaining unit, configured to obtain encoded data corresponding to a video frame to be decoded, where the encoded data includes an encoding result of at least two band segments, where the at least two band segments are obtained by dividing coefficients included in a video frame encoding block according to a scanning order, and a first band segment of the at least two band segments according to the scanning order includes a non-zero coefficient; a determining unit, configured to determine a non-zero coefficient included in a frequency band segment other than the first frequency band segment in the at least two frequency band segments; and the decoding unit is used for decoding each frequency band section by adopting a corresponding decoding strategy according to the condition of the nonzero coefficient contained in each frequency band section in the at least two frequency band sections.
According to an aspect of an embodiment of the present application, there is provided a video encoding apparatus including: the video coding device comprises an acquisition unit, a coding unit and a decoding unit, wherein the acquisition unit is used for acquiring at least two frequency band sections obtained by dividing coefficients contained in a video frame coding block according to a scanning sequence, and a first frequency band section of the at least two frequency band sections according to the scanning sequence contains a nonzero coefficient; a determining unit, configured to determine a non-zero coefficient included in a frequency band segment other than the first frequency band segment in the at least two frequency band segments; and the coding unit is configured to perform coding processing on syntax elements used for indicating the condition of the non-zero coefficients contained in the other band segments, and perform coding processing on each band segment by adopting a corresponding coding strategy according to the condition of the non-zero coefficients contained in each band segment of the at least two band segments.
According to an aspect of embodiments of the present application, there is provided a computer-readable medium on which a computer program is stored, which when executed by a processor implements a transform coefficient optimization method, a video decoding method, or a video encoding method as described in the above embodiments.
According to an aspect of an embodiment of the present application, there is provided an electronic device including: one or more processors; a storage device for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a transform coefficient optimization method, a video decoding method, or a video encoding method as described in the above embodiments.
In the technical solutions provided in some embodiments of the present application, coefficients included in a video frame coding block are divided into at least two frequency band segments according to a scanning order, so that a corresponding coding strategy can be adopted for coding characteristics of coefficients included in different frequency band segments in the scanning order, which is further beneficial to improving coding efficiency. In addition, the video frame coding block is divided into at least two frequency band sections, so that the frequency band sections can be independently coded, and the coding efficiency of the video frame coding block is conveniently improved in a parallel coding mode. When the first frequency band segment contains the nonzero coefficient, the zero coefficient at the appointed position in the first frequency band segment is adjusted to be the nonzero coefficient, so that the first frequency band segment can be ensured to contain the nonzero coefficient all the time, and further, when a video frame coding block is coded, the coding process of a target syntax element for indicating whether the first frequency band segment contains the nonzero coefficient can be omitted, unnecessary information coding is saved, and the coding efficiency is improved.
In the technical solutions provided in some embodiments of the present application, by obtaining encoded data including an encoding result of at least two frequency band segments, and then decoding each frequency band segment by using a corresponding decoding strategy according to a condition of a non-zero coefficient included in each frequency band segment, it is possible to perform decoding processing by using a corresponding decoding strategy with respect to a characteristic of a coefficient included in different frequency band segments in a scanning order, which is beneficial to improving decoding efficiency. In addition, because the video frame coding block is divided into at least two frequency band sections, the frequency band sections can be independently decoded respectively, and the decoding efficiency is further improved conveniently in a parallel decoding mode.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. It is obvious that the drawings in the following description are only some embodiments of the application, and that for a person skilled in the art, other drawings can be derived from them without inventive effort. In the drawings:
FIG. 1 shows a schematic diagram of an exemplary system architecture to which aspects of embodiments of the present application may be applied;
FIG. 2 is a schematic diagram illustrating placement of video encoding and decoding devices in a streaming environment;
FIG. 3 shows a flow diagram of a transform coefficient optimization method according to an embodiment of the present application;
FIG. 4 shows a schematic diagram of the partitioning of coefficients comprised by a coding block of a video frame according to an embodiment of the present application;
FIG. 5 shows a flow diagram for adjusting a zero coefficient at a specified location in a first band segment to a non-zero coefficient according to an embodiment of the present application;
FIG. 6 shows a flow diagram for adjusting a zero coefficient at a specified location in a first band segment to a non-zero coefficient according to an embodiment of the present application;
FIG. 7 shows a flow diagram of a video encoding method according to an embodiment of the present application;
FIG. 8 shows a flow diagram of a video decoding method according to an embodiment of the present application;
FIG. 9 shows a diagram of adjusting the last zero coefficient in band0 to be a non-zero coefficient according to an embodiment of the present application;
FIG. 10 shows a schematic diagram of adjusting a zero coefficient to a non-zero coefficient at a location of band0 where delta _ cost is minimum according to an embodiment of the present application;
FIG. 11 shows a block diagram of a transform coefficient optimization apparatus according to an embodiment of the present application;
FIG. 12 shows a block diagram of a video decoding apparatus according to an embodiment of the present application;
FIG. 13 shows a block diagram of a video encoding apparatus according to an embodiment of the present application;
FIG. 14 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure 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 specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The technical terms in the present application will first be briefly described below:
syntax elements: information representing the codestream that needs to be encoded and transmitted in video coding.
Entropy coding: a data compression method is a key technology for realizing information compression in a video coding process, and entropy coding is carried out on the basis of an entropy principle without losing any information in the coding process.
Run-level coding: run length coding, a type of coefficient coding. Wherein Run represents the number of continuous zero coefficients before a non-zero coefficient; level represents the magnitude of the non-zero coefficient.
Context (buffer): in the process of entropy coding, each syntax element reads and writes information in the corresponding buffer for calculation and updating.
Last _ flag: is a coefficient-coded syntax element used to indicate whether the current non-zero coefficient is the last non-zero coefficient in the current coding block. The 0 coefficients after the last non-zero coefficient can be skipped without transmitting the code stream, and the decoding end can decode the rest 0 coefficients through the position of the last non-zero coefficient.
And (3) quantification: refers to the process of mapping a continuous value (or a large number of possible discrete values) of a signal to a finite number of discrete amplitudes, which is a many-to-one mapping. In the video encoding process, after the residual signal is subjected to Discrete Cosine Transform (DCT for short), the Transform coefficient generally has a large range, so that the quantization of the Transform coefficient can effectively reduce the signal value space, and further obtain a better compression rate.
Rate Distortion Optimization (Rate Distortion Optimization, RDO for short): the method is used for improving the quality of the video compressed video. The quality and the compression ratio are important indexes for measuring the video coding technology, usually, the distortion degree reflects the video quality, and the code rate reflects the compression ratio, which are mutually restricted and contradictory, for example, the code rate is increased when the distortion degree is reduced; reducing the code rate tends to increase the distortion. The purpose of video coding is to reduce the code rate as much as possible under the condition of ensuring certain video quality, or to reduce the distortion degree as much as possible under the condition of certain code rate. In order to balance the relationship between the two, video coding introduces a rate-distortion optimization technique to assist in deciding a suitable prediction method and prediction mode.
Rate Distortion Optimization Quant (Rate Distortion Optimization Quant, RDOQ for short): the quantization technology based on rate distortion optimization can adjust the size of the transformation coefficient according to the rate distortion cost, so that the rate distortion cost of the whole coding block is minimum. Rate-distortion optimized quantization is mainly an analysis process that performs further optimal selection on quantized coefficients. The process of quantization of many-to-one mapping can be understood simply as the process of finding neighboring scatterers, and thus a choice of finding either positive or negative will be encountered. The process of scalar quantization is mechanical, uniformly specifying a seek direction, and RDOQ is an optimization for this mechanical selection process. On the basis of scalar quantization, the RDOQ determines the optimal coefficient in the local range according to the RDO.
Fig. 1 shows a schematic diagram of an exemplary system architecture to which the technical solution of the embodiments of the present application can be applied.
As shown in fig. 1, the system architecture 100 includes a plurality of end devices that may communicate with each other over, for example, a network 150. For example, the system architecture 100 may 100 include a first end device 110 and a second end device 120 interconnected by a network 150. In the embodiment of fig. 1, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission. For example, the first end device 110 may encode video data (e.g., a video picture stream captured by the end device 110) for transmission over the network 150 to the second end device 120. The encoded video data is transmitted in the form of one or more encoded video streams. The second terminal device 120 may receive the encoded video data from the network 150, decode the encoded video data to restore the video data, and display a video picture according to the restored video data.
In one embodiment of the present application, system architecture 100 may include a third end device 130 and a fourth end device 140 that perform bi-directional transmission of encoded video data, which may occur, for example, during a video conference. For bi-directional data transmission, each of third end device 130 and fourth end device 140 may encode video data (e.g., a stream of video pictures captured by the end device) for transmission over network 150 to the other of third end device 130 and fourth end device 140. Each of third terminal device 130 and fourth terminal device 140 may also receive encoded video data transmitted by the other of third terminal device 130 and fourth terminal device 140, and may decode the encoded video data to recover the video data, and may display video pictures on an accessible display device according to the recovered video data.
In the embodiment of fig. 1, the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be a server, a personal computer, and a smart phone, but the principles disclosed herein may not be limited thereto. Embodiments disclosed herein are applicable to laptop computers, tablet computers, media players, and/or dedicated video conferencing equipment. Network 150 represents any number of networks that communicate encoded video data between first end device 110, second end device 120, third end device 130, and fourth end device 140, including, for example, wired and/or wireless communication networks. The communication network 150 may exchange data in circuit-switched and/or packet-switched channels. The network may include a telecommunications network, a local area network, a wide area network, and/or the internet. For purposes of this application, the architecture and topology of the network 150 may be immaterial to the operation of the present disclosure, unless explained below.
In one embodiment of the present application, fig. 2 illustrates the placement of video encoding devices and video decoding devices in a streaming environment. The subject matter disclosed herein is equally applicable to other video-enabled applications including, for example, video conferencing, digital TV, storing compressed video on digital media including CDs, DVDs, memory sticks, and the like.
The streaming system may include an acquisition subsystem 213, and the acquisition subsystem 213 may include a video source 201, such as a digital camera, that creates an uncompressed video picture stream 202. In an embodiment, the video picture stream 202 includes samples taken by a digital camera. The video picture stream 202 is depicted as a thick line to emphasize a high data amount video picture stream compared to the encoded video data 204 (or the encoded video codestream 204), the video picture stream 202 can be processed by an electronic device 220, the electronic device 220 comprising a video encoding device 203 coupled to a video source 201. The video encoding device 203 may comprise hardware, software, or a combination of hardware and software to implement or embody aspects of the disclosed subject matter as described in greater detail below. The encoded video data 204 (or encoded video codestream 204) is depicted as a thin line compared to the video picture stream 202 to emphasize the lower data amount of the encoded video data 204 (or encoded video codestream 204), which 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. Video decoding device 210 decodes incoming copies 207 of the encoded video data and generates an output video picture stream 211 that may be presented on a display 212 (e.g., a display screen) or another presentation device. In some streaming systems, encoded video data 204, video data 207, and video data 209 (e.g., video streams) may be encoded according to certain video encoding/compression standards. Examples of such standards include ITU-T H.265. In an embodiment, the Video Coding standard under development is informally referred to as next generation Video Coding (VVC), and the present application may be used in the context of the VVC standard.
It should be noted that electronic devices 220 and 230 may include other components not shown in the figures. For example, electronic device 220 may include a video decoding device not shown, and electronic device 230 may also include a video encoding device not shown.
The implementation details of the technical solution of the embodiment of the present application are set forth in detail below:
fig. 3 shows a flowchart of a transform coefficient optimization method according to an embodiment of the present application, which may be performed by the video encoding apparatus described in the foregoing embodiments. Referring to fig. 3, the transform coefficient optimization method at least includes steps S310 to S330, which are described in detail as follows:
in step S310, coefficients contained in a video frame coding block are divided into at least two band segments in scan order.
In one embodiment of the present application, coefficients contained in a coding block may be divided into at least two band segments in conjunction with the length and height of the coding block of a video frame. For example, as shown in fig. 4, coefficients contained in a coded block of a video frame may be divided into two band segments, denoted as band0 and band1, in scan order. In order to ensure that the second band also contains some non-zero coefficients as much as possible, the coding of last _ flag in the first band may be omitted, and therefore, in the embodiment of the present application, the proportion of the first band may be made smaller, that is, the number of coefficients contained in the first band is smaller than the number of coefficients contained in the second band. For example, the first band may contain the previous width height/4 coefficients and the second band may contain the last 3 width height/4 coefficients.
In step S320, it is detected whether the at least two frequency bands contain non-zero coefficients.
In one embodiment of the present application, whether each band segment contains non-zero coefficients may be determined by scanning the coefficient cases contained in each band segment.
In step S330, if a first band segment of the at least two band segments according to the scanning order does not include a non-zero coefficient, a zero coefficient at a specified position in the first band segment is adjusted to be a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame coding block, where the target syntax element is used to indicate whether the first band segment includes a non-zero coefficient.
The technical scheme of the embodiment shown in fig. 3 can ensure that the first band segment always contains a nonzero coefficient, and therefore, when a video frame coding block is coded, the coding process of a target syntax element for indicating whether the first band segment contains the nonzero coefficient can be omitted, unnecessary information coding is saved, and coding efficiency is improved.
In one embodiment of the present application, the zero coefficient at the last position in the first band segment may be adjusted to a non-zero coefficient. In this case, the rate distortion cost of adjusting the zero coefficient at the last position in the first frequency band segment to each candidate non-zero coefficient may be calculated to obtain the rate distortion cost corresponding to each candidate non-zero coefficient, and then the candidate non-zero coefficient corresponding to the smallest rate distortion cost is selected as the value of the non-zero coefficient at the last position in the first frequency band segment. Alternatively, to reduce the amount of coding after the zero coefficient at the last position in the first band segment is adjusted to a non-zero coefficient, the candidate non-zero coefficients may be-1 and1, i.e., the value of the zero coefficient at the last position in the first band segment adjusted to a non-zero coefficient is selected from-1 and 1.
In one embodiment of the present application, the zero coefficient in the first band segment at the position where the non-zero coefficient is most likely to occur may be adjusted to a non-zero coefficient. For example, a zero coefficient at a first position in a first band segment may be adjusted to a non-zero coefficient. In this case, the rate distortion cost of adjusting the zero coefficient at the first position in the first frequency band segment to each candidate non-zero coefficient may be calculated to obtain the rate distortion cost corresponding to each candidate non-zero coefficient, and then the candidate non-zero coefficient corresponding to the smallest rate distortion cost is selected as the value of the non-zero coefficient at the first position in the first frequency band segment. Alternatively, to reduce the amount of coding after the zero coefficient at the first position in the first band segment is adjusted to a non-zero coefficient, the candidate non-zero coefficients may be-1 and1, i.e., the value of the zero coefficient at the first position in the first band segment adjusted to a non-zero coefficient is selected from-1 and 1.
In an embodiment of the present application, the method shown in fig. 5 may further be used to adjust the zero coefficient at a specified position in the first frequency band segment to be a non-zero coefficient, and specifically includes the following steps:
step S510, calculating a rate-distortion cost difference between a zero coefficient at each position in the first frequency band segment and each candidate non-zero coefficient, to obtain a rate-distortion cost difference corresponding to each position.
In one embodiment of the present application, there may be a plurality of candidate non-zero coefficients at each position in the first frequency band segment, and then a rate-distortion cost difference between the zero coefficient at each position and each candidate non-zero coefficient may be calculated.
Step S520, according to the rate-distortion cost difference values corresponding to the respective positions, selecting a position corresponding to a minimum rate-distortion cost difference value as the designated position, and adjusting the coefficient value of the designated position to be a candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
The technical solution of the embodiment shown in fig. 5 enables to reduce the data amount of the first frequency band segment during encoding as much as possible on the premise of ensuring that the first frequency band segment contains non-zero coefficients, thereby improving the encoding efficiency.
In an embodiment of the present application, the method shown in fig. 6 may further be used to adjust the zero coefficient at the specified position in the first frequency band segment to be a non-zero coefficient, which specifically includes the following steps:
step S610 selects a target portion for determining a designated position in the first band segment according to the condition of a non-zero coefficient included in a coding block preceding the coding block of the video frame.
In one embodiment of the present application, if the second half of a previous coding block of a video frame coding block (hereinafter referred to as a current coding block for convenience of distinction) contains a non-zero coefficient, the part of the current coding block where the non-zero coefficient is most likely to occur is the second half, and therefore the second half of the first band segment of the current coding block can be used as a target part. If the second half of the previous coding block of the current coding block does not contain the non-zero coefficient, the part of the current coding block where the non-zero coefficient is most likely to occur is the first half, so the first half of the first band segment of the current coding block can be used as the target part.
Step S620, calculating a rate-distortion cost difference between the zero coefficient of each position in the target portion and each candidate non-zero coefficient, to obtain a rate-distortion cost difference corresponding to each position.
In one embodiment of the present application, there may be a plurality of candidate non-zero coefficients at each position in the target portion, and then a rate-distortion cost difference between the zero coefficient at each position and each candidate non-zero coefficient may be calculated.
Step S630, according to the rate-distortion cost difference values corresponding to the respective positions, selecting a position corresponding to a minimum rate-distortion cost difference value as the designated position, and adjusting the coefficient value of the designated position to be a candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
The technical solution of the embodiment shown in fig. 6 enables to reduce the data amount of the first frequency band segment during encoding as much as possible on the premise of ensuring that the first frequency band segment contains non-zero coefficients, and can reduce the calculation amount during determining the designated position, thereby improving the encoding efficiency.
Fig. 7 shows a flowchart of a video encoding method according to an embodiment of the present application, which can be performed by the video encoding apparatus described in the foregoing embodiments. Referring to fig. 7, the video encoding method at least includes steps S710 to S730, which are described in detail as follows:
in step S710, at least two band segments obtained by dividing coefficients included in a video frame coding block according to a scanning order are obtained, where a first band segment of the at least two band segments according to the scanning order includes a non-zero coefficient.
In one embodiment of the present application, coefficients contained in a coding block may be divided into at least two band segments in conjunction with the length and height of the coding block of a video frame. After dividing the coefficients included in the video frame coding block into at least two band segments, if the first band segment does not include a non-zero coefficient, the zero coefficient at the specified position in the first band segment may be adjusted to be a non-zero coefficient by the technical solution of the foregoing embodiment.
In step S720, the condition of the non-zero coefficients contained in the other frequency bands except the first frequency band is determined.
In one embodiment of the present application, the condition of non-zero coefficients contained in other band segments may be determined by scanning the condition of coefficients contained in other band segments.
In step S730, a syntax element indicating a condition of a non-zero coefficient included in the other band segments is encoded, and each band segment is encoded by using a corresponding encoding policy according to a condition of a non-zero coefficient included in each of the at least two band segments.
In the technical solution of the embodiment shown in fig. 7, since the first frequency band segment includes the non-zero coefficient, the encoding process of the syntax element for indicating the condition of the non-zero coefficient included in the first frequency band segment can be omitted during encoding, and the encoding efficiency can be improved by saving encoding information. Meanwhile, since each band segment can be encoded using a corresponding encoding strategy based on the condition of the non-zero coefficients contained in each band segment, the encoding efficiency can be improved by omitting some unnecessary information encoding. For example, if a video frame coding block is divided into two band segments, band0 and band1, if both band0 and band1 contain non-zero coefficients, the coding of last _ flag of all non-zero coefficients in band0 can be omitted, and the coding efficiency can be effectively improved.
Fig. 8 shows a flowchart of a video decoding method according to an embodiment of the present application, which can be performed by the video decoding apparatus described in the foregoing embodiments. Referring to fig. 8, the video decoding method at least includes steps S810 to S830, which are described in detail as follows:
in step S810, encoded data corresponding to a video frame to be decoded is obtained, where the encoded data includes an encoding result of at least two band segments, the at least two band segments are obtained by dividing coefficients included in a video frame encoding block according to a scanning order, and a first band segment of the at least two band segments according to the scanning order includes a non-zero coefficient.
In one embodiment of the present application, the division may be done in conjunction with the length and height of the video frame coding blocks to obtain at least two band segments, as described above.
In step S820, the condition of the non-zero coefficients contained in the other frequency bands except the first frequency band is determined.
In an embodiment of the present application, if the encoded data includes an encoding result of a syntax element indicating a case of a non-zero coefficient included in a band other than the first band, decoding processing may be performed according to a context of the syntax element to obtain a case of a non-zero coefficient included in another band. Since the first band segment contains the nonzero coefficient, the encoding process of the syntax element for indicating the nonzero coefficient condition contained in the first band segment can be omitted during encoding, the decoding process is not needed during decoding, and the decoding efficiency can be improved.
In step S830, according to the condition of the non-zero coefficient included in each of the at least two frequency band segments, a corresponding decoding strategy is adopted to perform decoding processing on each frequency band segment.
In an embodiment of the present application, when encoded data includes an encoding result of a first band segment (hereinafter referred to as band0) and an encoding result of a second band segment (hereinafter referred to as band1) in a scanning order, if both band0 and band1 include non-zero coefficients, decoding is performed on the non-zero coefficients included in band0 and consecutive zero coefficients before the non-zero coefficients, in which case, the video frame encoding block may omit coding of last _ flag of all non-zero coefficients in band0 during encoding. For band1, since band1 contains non-zero coefficients, decoding processing can be performed on non-zero coefficients contained in band1, consecutive zero coefficients before the non-zero coefficients, and last _ flag of all non-zero coefficients in band 1.
In an embodiment of the present application, in a case where encoded data includes an encoding result of band0 and an encoding result of band1 in a scanning order, if band0 includes a non-zero coefficient and band1 does not include a non-zero coefficient, decoding processing is performed on a non-zero coefficient included in band0, a consecutive zero coefficient before the non-zero coefficient, and last _ flag of all non-zero coefficients in band 0. For band1, since no non-zero coefficients are contained in band1, a video frame coding block can omit the encoding process for band1 when encoding, and can decode all the coefficients contained in band1 to 0 when decoding.
The following describes details of implementation of the technical solution of the embodiment of the present application by taking an example of dividing coefficients included in a coding block of a video frame into two frequency bands (i.e. band0 and band 1):
in one embodiment of the present application, since the coefficients located at the front tend to be non-zero coefficients in the scanning order, the division of the bands can be divided according to the size of the coding block, and the first band is made to contain non-zero coefficients as much as possible. When coding, the coefficients in each band can be coded separately, and some unnecessary information coding, such as coding of last _ flag, run, etc., can be omitted according to the coefficient situation contained in different bands, thereby improving the coding efficiency.
In one embodiment of the present application, whether or not non-zero coefficients are included in band0 and band1 may be represented by syntax element band0_ sig _ flag and syntax element band1_ sig _ flag, respectively, which has a value of 1 if non-zero coefficients are included and a value of 0 otherwise.
Since the band0_ sig _ flag and the band1_ sig _ flag also need to be encoded, if the conditions can be slightly adjusted according to the conditions of the nonzero coefficients contained in the band0 and the band1 (namely, the band0_ sig _ flag is 0, and the band1_ sig _ flag is 1), so that the band0_ sig _ flag always keeps 1, only the band1_ sig _ flag needs to be encoded, thereby saving unnecessary information encoding and improving the encoding efficiency.
Since the rate distortion decision is performed on the coefficients in the two bands in the RDOQ process, if all the coefficients in the band0 are quantized to 0, and there are non-zero coefficients in the band1, that is, in the case that the band0_ sig _ flag is 0 and the band1_ sig _ flag is 1, the zero coefficient in the band0 may be adjusted to avoid this, and the adjustment strategy in this embodiment of the present application is described below:
in one embodiment of the present application, as shown in fig. 9, the last zero coefficient in the band0 may be adjusted to be a non-zero coefficient, so that the band0_ sig _ flag is 1. In order to determine whether the value of the nonzero coefficient is 1 or-1, a rate distortion cost function can be adopted to make a decision in the embodiment of the application. Specifically, it may be assumed that RDcost (1) is the rate-distortion cost when the zero coefficient is adjusted to 1 at the last position in band0, RDcost (-1) is the rate-distortion cost when the zero coefficient is adjusted to-1 at the last position in band0, and by comparing RDcost (1) and RDcost (-1), the one with the smallest cost is selected, for example, if RDcost (1) < RDcost (-1), the zero coefficient at the last position in band0 is adjusted to 1; if RDcost (1) > RDcost (-1), the zero coefficient at the last position in band0 is adjusted to-1. Since this occurs in very small proportions, the overhead after adjustment is not very large.
In another embodiment of the present application, rate distortion cost of all coefficients in band0 for deciding the optimal coefficient in RDOQ process may be recorded, and rate distortion cost difference between candidate 0 and non-zero candidate for each coefficient may be recorded, and the coefficient with the smallest difference may be adjusted to its corresponding non-zero coefficient. Specifically, in the RDOQ process of the band0, the coefficients of each position usually have 2-3 candidate values, and if 0 is the optimal coefficient, the corresponding position in the band0 should be 0. If one of the coefficients 0 needs to be adjusted to be nonzero, it may be recorded that the rate-distortion cost of each candidate value at position i in the band0 is zero, the rate-distortion cost is RDcost (i,0), and the rate-distortion cost of each candidate value at position i in the band0 is RDcost (i, c), and the difference between the two values is delta _ cost (i) ═ abs (RDcost (i,0) -RDcost (i, c)), and then the delta _ cost at each position in the band0 is compared, and the position i with the smallest delta _ cost is selected, and the coefficient 0 at the position i is adjusted to be nonzero c. For example, as shown in fig. 10, a coefficient 0 at a position where delta _ cost is minimum in band0 may be adjusted to a non-zero coefficient 1.
In one embodiment of the present application, in determining whether or not non-zero coefficients are contained in band1, the determination may be made by traversing the various coefficients contained in band 1. If the band1 contains a nonzero coefficient, the band1_ sig _ flag is 1; if the band1 does not contain a non-zero coefficient, the band1_ sig _ flag is 0.
In one embodiment of the present application, the strategy for encoding band0 and band1 based on band0_ sig _ flag and band1_ sig _ flag may be as shown in table 1:
Figure BDA0002182811960000161
TABLE 1
As shown in table 1, for the band0, since the embodiment of the present application ensures that all the bands 0 include non-zero coefficients, the encoding of the band0_ sig _ flag can be omitted. If the band0_ sig _ flag is 1 and the band1_ sig _ flag is 0, then run, level and last _ flag values of non-zero coefficients in the band0 need to be coded according to context; if the band0_ sig _ flag is 1 and the band1_ sig _ flag is 1, then run and level values of non-zero coefficients in the band0 need to be coded according to context and the coding of last _ flag of non-zero coefficients can be omitted.
For the band1, the band1_ sig _ flag needs to be encoded according to the context of the band1 when encoding. If the band0_ sig _ flag is 1 and the band1_ sig _ flag is 0, then the encoding of the band1 may be omitted; if the band0_ sig _ flag is 1 and the band1_ sig _ flag is 1, then run, level and last _ flag values of the non-zero coefficients in the band1 need to be coded according to context.
When decoding band0 and band1, decoding needs to be performed depending on the encoding strategy. Specifically, for the band0, since it is guaranteed that all the bands 0 include non-zero coefficients in the embodiment of the present application, it is not necessary to decode the band0_ sig _ flag during decoding, but it is necessary to decode the band1_ sig _ flag according to the video frame code stream and the context of the band 1. If the band0_ sig _ flag is 1 and the band1_ sig _ flag is 0, then the run value, level value and last _ flag of the non-zero coefficients in the band0 need to be decoded according to the video frame code stream and the context; if the band0_ sig _ flag is 1 and the band1_ sig _ flag is 1, then run and level values of non-zero coefficients in the band0 need to be decoded according to the video frame stream and the context.
For band1, if band0_ sig _ flag is 1 and band1_ sig _ flag is 0 at decoding time, the coefficients contained in band1 may be decoded as 0; if the band0_ sig _ flag is 1 and the band1_ sig _ flag is 1, then run, level and last _ flag of non-zero coefficients in the band1 need to be decoded according to the video frame stream and the context.
Syntax elements band0_ sig _ flag and band1_ sig _ flag are introduced in the embodiment of the present application, it can be ensured that the value of band0_ sig _ flag is 1, and certain correlations exist among the band1_ sig _ flag, the band0_ sig _ flag and the coding block size. An example is given in the embodiment of the present application, and there are 4 contexts in the definition of band1_ sig _ flag, and each includes two in luma (luminance) and chroma (chrominance), which are specifically defined as follows:
offset1=(band0_sig_flag==1&&(log2(width)+log2(height)<=6))?0:1;
ctx_band1=offset1+(ch_type==luma)?0:2。
wherein, offset1 is an integer variable, and ch _ type represents the channel type of the scan; ctx _ band1 denotes the context index number of band1_ sig _ flag.
In one embodiment of the present application, the context design of band1_ sig _ flag may be designed by using already encoded \ decoded neighboring block information (such as the case of non-zero coefficients contained in neighboring blocks) in addition to the size of the current coding block.
It should be noted that, in the above embodiments of the present application, the coefficient included in the coding block is divided into 2 bands as an example, and in other embodiments of the present application, the coefficient included in the coding block may be divided into more bands, for example, into 3 bands or 4 bands.
According to the technical scheme of the embodiment of the application, after the coefficients contained in the coding block are divided into a plurality of bands, if a first band contains a nonzero coefficient, the zero coefficient at a specified position in the first band is adjusted to be the nonzero coefficient, so that the first band can be ensured to contain the nonzero coefficient all the time, and further, when the coding block of a video frame is coded, the coding process of a target syntax element for indicating whether the first band contains the nonzero coefficient can be omitted (namely, a flag for identifying whether the first band contains the nonzero coefficient can be realized in an implicit form, namely, the flag is hidden), unnecessary information coding is saved, and the coding efficiency is improved.
Embodiments of the apparatus of the present application are described below, which may be used to perform the methods of the above-described embodiments of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method described above in the present application.
Fig. 11 shows a block diagram of a transform coefficient optimization apparatus according to an embodiment of the present application.
Referring to fig. 11, a transform coefficient optimization apparatus 1100 according to an embodiment of the present application includes: a dividing unit 1102, a detecting unit 1104 and a processing unit 1106.
The dividing unit 1102 is configured to divide coefficients included in a video frame coding block into at least two band segments according to a scanning order; the detecting unit 1104 is configured to detect whether a non-zero coefficient is included in the at least two frequency band segments; the processing unit 1106 is configured to, when a first band segment of the at least two band segments in the scanning order does not include a non-zero coefficient, adjust a zero coefficient at a specified position in the first band segment to be a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame coding block, where the target syntax element is used to indicate whether the first band segment includes a non-zero coefficient.
In some embodiments of the present application, based on the foregoing solution, the processing unit 1106 is configured to: the zero coefficient at the last position or the first position in the first band segment is adjusted to be a non-zero coefficient.
In some embodiments of the present application, based on the foregoing solution, the processing unit 1106 is configured to: calculating rate distortion cost for adjusting the zero coefficient of the last position or the first position to be each candidate non-zero coefficient, and obtaining the rate distortion cost corresponding to each candidate non-zero coefficient; and selecting the candidate non-zero coefficient corresponding to the minimum rate distortion cost as the value of the non-zero coefficient at the last position or the first position according to the rate distortion cost corresponding to each candidate non-zero coefficient.
In some embodiments of the present application, based on the foregoing scheme, the respective candidate non-zero coefficients include: -1 and 1.
In some embodiments of the present application, based on the foregoing solution, the processing unit 1106 is configured to: calculating rate distortion cost difference values between zero coefficients of all positions in the first frequency band section and all candidate non-zero coefficients to obtain rate distortion cost difference values corresponding to all the positions; and selecting the position corresponding to the minimum rate-distortion cost difference value as the designated position according to the rate-distortion cost difference value corresponding to each position, and adjusting the coefficient value of the designated position to be the candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
In some embodiments of the present application, based on the foregoing solution, the processing unit 1106 is configured to: selecting a target part for determining the designated position in the first frequency band segment according to the condition of a nonzero coefficient contained in a coding block before the video frame coding block; calculating rate distortion cost difference values between zero coefficients and candidate non-zero coefficients of all positions in the target part to obtain rate distortion cost difference values corresponding to all the positions; and selecting the position corresponding to the minimum rate-distortion cost difference value as the designated position according to the rate-distortion cost difference value corresponding to each position, and adjusting the coefficient value of the designated position to be the candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
In some embodiments of the present application, based on the foregoing solution, the processing unit 1106 is configured to: if the latter half part of the former coding block contains non-zero coefficients, taking the latter half part of the first frequency band segment as the target part; and if the second half of the previous coding block does not contain a nonzero coefficient, taking the first half of the first frequency band segment as the target part.
In some embodiments of the present application, based on the foregoing scheme, the dividing unit 1102 is configured to: dividing the coefficients contained in the video frame coding block into two frequency band sections according to a scanning sequence, wherein the number of the coefficients contained in the first frequency band section of the two frequency band sections according to the scanning sequence is smaller than the number of the coefficients contained in the second frequency band section.
Fig. 12 shows a block diagram of a video decoding apparatus according to an embodiment of the present application.
Referring to fig. 12, a video decoding apparatus 1200 according to an embodiment of the present application includes: acquisition unit 1202, determination unit 1204, and decoding unit 1206.
The obtaining unit 1202 is configured to obtain encoded data corresponding to a video frame to be decoded, where the encoded data includes an encoding result of at least two band segments, the at least two band segments are obtained by dividing coefficients included in a video frame encoding block according to a scanning order, and a first band segment of the at least two band segments according to the scanning order includes a non-zero coefficient; a determining unit 1204 is configured to determine a non-zero coefficient included in a frequency band segment other than the first frequency band segment; the decoding unit 1206 is configured to perform decoding processing on each frequency band segment by using a corresponding decoding policy according to a condition of a non-zero coefficient included in each frequency band segment of the at least two frequency band segments.
Fig. 13 shows a block diagram of a video encoding apparatus according to an embodiment of the present application.
Referring to fig. 13, a video encoding apparatus 1300 according to an embodiment of the present application includes: an acquisition unit 1302, a determination unit 1304, and an encoding unit 1306.
The obtaining unit 1302 is configured to obtain at least two frequency band segments obtained by dividing coefficients included in a video frame coding block according to a scanning order, where a first frequency band segment of the at least two frequency band segments according to the scanning order includes a non-zero coefficient; a determining unit 1304 is configured to determine a non-zero coefficient included in a frequency band segment other than the first frequency band segment; the encoding unit 1306 is configured to perform encoding processing on a syntax element indicating a non-zero coefficient condition included in the other band segments, and perform encoding processing on each of the at least two band segments by using a corresponding encoding strategy according to a non-zero coefficient condition included in each of the band segments.
FIG. 14 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application.
It should be noted that the computer system 1400 of the electronic device shown in fig. 14 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 14, a computer system 1400 includes a Central Processing Unit (CPU)1401, which can perform various appropriate actions and processes, such as executing the methods described in the above embodiments, according to a program stored in a Read-Only Memory (ROM) 1402 or a program loaded from a storage portion 1408 into a Random Access Memory (RAM) 1403. In the RAM 1403, various programs and data necessary for system operation are also stored. The CPU 1401, ROM 1402, and RAM 1403 are connected to each other via a bus 1404. An Input/Output (I/O) interface 1405 is also connected to the bus 1404.
The following components are connected to the I/O interface 1405: an input portion 1406 including a keyboard, a mouse, and the like; an output portion 1407 including a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, a speaker, and the like; a storage portion 1408 including a hard disk and the like; and a communication section 1409 including a Network interface card such as a LAN (Local Area Network) card, a modem, and the like. The communication section 1409 performs communication processing via a network such as the internet. The driver 1410 is also connected to the I/O interface 1405 as necessary. A removable medium 1411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 1410 as necessary, so that a computer program read out therefrom is installed into the storage section 1408 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising a computer program for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication portion 1409 and/or installed from the removable medium 1411. When the computer program is executed by a Central Processing Unit (CPU)1401, various functions defined in the system of the present application are executed.
It should be noted that the computer readable medium shown in the embodiments of the present application may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable Compact Disc Read-Only Memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with a computer program embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the 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. Each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block 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 will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software, or may be implemented by hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the application. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (15)

1. A method for transform coefficient optimization, comprising:
dividing coefficients contained in a video frame coding block into at least two frequency band segments according to a scanning sequence;
detecting whether the at least two frequency band segments contain non-zero coefficients or not;
if the first band segment of the at least two band segments according to the scanning order does not contain a non-zero coefficient, adjusting a zero coefficient at a specified position in the first band segment to be a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame encoding block, wherein the target syntax element is used for indicating whether the first band segment contains a non-zero coefficient.
2. The method of claim 1, wherein adjusting zero coefficients at specified locations in the first band segment to non-zero coefficients comprises: and adjusting the zero coefficient at the last position or the first position in the first frequency band section into a non-zero coefficient.
3. The method of claim 2, wherein adjusting zero coefficients at a last position or a first position in the first band segment to non-zero coefficients comprises:
calculating rate distortion cost for adjusting the zero coefficient of the last position or the first position to be each candidate non-zero coefficient, and obtaining the rate distortion cost corresponding to each candidate non-zero coefficient;
and selecting the candidate non-zero coefficient corresponding to the minimum rate distortion cost as the value of the non-zero coefficient at the last position or the first position according to the rate distortion cost corresponding to each candidate non-zero coefficient.
4. The transform coefficient optimization method of claim 3, wherein the respective candidate non-zero coefficients comprise: -1 and 1.
5. The method of claim 1, wherein adjusting zero coefficients at specified locations in the first band segment to non-zero coefficients comprises:
calculating rate distortion cost difference values between zero coefficients of all positions in the first frequency band section and all candidate non-zero coefficients to obtain rate distortion cost difference values corresponding to all the positions;
and selecting the position corresponding to the minimum rate-distortion cost difference value as the designated position according to the rate-distortion cost difference value corresponding to each position, and adjusting the coefficient value of the designated position to be the candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
6. The method of claim 1, wherein adjusting zero coefficients at specified locations in the first band segment to non-zero coefficients comprises:
selecting a target part for determining the designated position in the first frequency band segment according to the condition of a nonzero coefficient contained in a coding block before the video frame coding block;
calculating rate distortion cost difference values between zero coefficients and candidate non-zero coefficients of all positions in the target part to obtain rate distortion cost difference values corresponding to all the positions;
and selecting the position corresponding to the minimum rate-distortion cost difference value as the designated position according to the rate-distortion cost difference value corresponding to each position, and adjusting the coefficient value of the designated position to be the candidate non-zero coefficient corresponding to the minimum rate-distortion cost difference value.
7. The transform coefficient optimization method of claim 6, wherein selecting the target portion for locating the specified position in the first band segment based on non-zero coefficients contained in a previous one of the video frame coding blocks comprises:
if the latter half part of the former coding block contains non-zero coefficients, taking the latter half part of the first frequency band segment as the target part;
and if the second half of the previous coding block does not contain a nonzero coefficient, taking the first half of the first frequency band segment as the target part.
8. The transform coefficient optimization method of any of claims 1 to 7, wherein dividing coefficients contained in a coded block of video frames into at least two band segments in scan order, comprises:
dividing the coefficients contained in the video frame coding block into two frequency band sections according to a scanning sequence, wherein the number of the coefficients contained in the first frequency band section of the two frequency band sections according to the scanning sequence is smaller than the number of the coefficients contained in the second frequency band section.
9. A video encoding method, comprising:
acquiring at least two frequency band segments obtained by dividing coefficients contained in a video frame coding block according to a scanning sequence;
if the first band segment of the at least two band segments according to the scanning order does not contain a nonzero coefficient, adjusting a zero coefficient at a specified position in the first band segment to be a nonzero coefficient, and omitting the coding of a target syntax element when coding the video frame coding block, wherein the target syntax element is used for indicating whether the first band segment contains a nonzero coefficient.
10. The video encoding method of claim 9, wherein the method further comprises:
if a first frequency band segment of the at least two frequency band segments according to the scanning sequence contains a nonzero coefficient, determining the condition of nonzero coefficients contained in other frequency band segments except the first frequency band segment;
and coding syntax elements for indicating the condition of the non-zero coefficients contained in the other frequency band segments, and coding each frequency band segment by adopting a corresponding coding strategy according to the condition of the non-zero coefficients contained in each of the at least two frequency band segments.
11. A transform coefficient optimization apparatus, comprising:
a dividing unit for dividing coefficients contained in a video frame coding block into at least two band segments according to a scanning order;
a detecting unit, configured to detect whether the at least two frequency band segments include a non-zero coefficient;
a processing unit, configured to, when a first band segment of the at least two band segments according to the scanning order does not include a non-zero coefficient, adjust a zero coefficient at a specified position in the first band segment to a non-zero coefficient, so as to omit encoding of a target syntax element when encoding the video frame coding block, where the target syntax element is used to indicate whether the first band segment includes a non-zero coefficient.
12. A video encoding apparatus, comprising:
the device comprises an acquisition unit, a decoding unit and a processing unit, wherein the acquisition unit is used for acquiring at least two frequency band sections obtained by dividing coefficients contained in a video frame coding block according to a scanning sequence;
and if the first band segment in the scanning order of the at least two band segments does not contain a nonzero coefficient, adjusting a zero coefficient at a specified position in the first band segment to be a nonzero coefficient, and omitting the encoding of a target syntax element when encoding the video frame encoding block, wherein the target syntax element is used for indicating whether the first band segment contains a nonzero coefficient.
13. The video encoding device of claim 12, wherein the video encoding device further comprises:
a determining unit, configured to determine, when a non-zero coefficient is included in a first frequency band segment of the at least two frequency band segments according to the scanning order, a condition of non-zero coefficients included in other frequency band segments of the at least two frequency band segments except the first frequency band segment;
the encoding unit is further configured to perform encoding processing on a syntax element indicating a condition of a non-zero coefficient included in the other band segments, and perform encoding processing on each band segment by using a corresponding encoding strategy according to a condition of a non-zero coefficient included in each of the at least two band segments.
14. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out a method for transform coefficient optimization according to any one of claims 1 to 8, or a method for video coding according to claim 9 or 10.
15. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the transform coefficient optimization method of any one of claims 1 to 8, or the video encoding method of claim 9 or 10.
CN201910802828.1A 2019-08-28 2019-08-28 Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device Active CN112449184B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910802828.1A CN112449184B (en) 2019-08-28 2019-08-28 Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910802828.1A CN112449184B (en) 2019-08-28 2019-08-28 Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device

Publications (2)

Publication Number Publication Date
CN112449184A CN112449184A (en) 2021-03-05
CN112449184B true CN112449184B (en) 2022-01-25

Family

ID=74740672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910802828.1A Active CN112449184B (en) 2019-08-28 2019-08-28 Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device

Country Status (1)

Country Link
CN (1) CN112449184B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1825963A (en) * 2006-02-13 2006-08-30 清华大学 Adaptive variable length decoding method based on text
CN101267553A (en) * 2007-03-12 2008-09-17 华为技术有限公司 A method and device for coding and decoding
CN102752592A (en) * 2012-06-20 2012-10-24 深圳广晟信源技术有限公司 Entropy coding method of video transformation coefficient
CN103329529A (en) * 2011-01-24 2013-09-25 高通股份有限公司 Signaling quantization parameter changes for coded units in high efficiency video coding (HEVC)
CN103636225A (en) * 2011-06-30 2014-03-12 高通股份有限公司 Signaling syntax elements for transform coefficients for sub-sets of leaf-level coding unit
CN104137542A (en) * 2012-03-02 2014-11-05 高通股份有限公司 Scan-based sliding window in context derivation for transform coefficient coding
CN107580224A (en) * 2017-08-08 2018-01-12 西安理工大学 A kind of adaptive scanning method towards HEVC entropy codes
CN108322749A (en) * 2018-03-15 2018-07-24 北京数码视讯科技股份有限公司 The coefficient optimization method of RDOQ, the accelerating method and device of RDOQ

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10523968B2 (en) * 2017-09-18 2019-12-31 Google Llc Coding of last significant coefficient flags

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1825963A (en) * 2006-02-13 2006-08-30 清华大学 Adaptive variable length decoding method based on text
CN101267553A (en) * 2007-03-12 2008-09-17 华为技术有限公司 A method and device for coding and decoding
CN103329529A (en) * 2011-01-24 2013-09-25 高通股份有限公司 Signaling quantization parameter changes for coded units in high efficiency video coding (HEVC)
CN103636225A (en) * 2011-06-30 2014-03-12 高通股份有限公司 Signaling syntax elements for transform coefficients for sub-sets of leaf-level coding unit
CN104137542A (en) * 2012-03-02 2014-11-05 高通股份有限公司 Scan-based sliding window in context derivation for transform coefficient coding
CN102752592A (en) * 2012-06-20 2012-10-24 深圳广晟信源技术有限公司 Entropy coding method of video transformation coefficient
CN107580224A (en) * 2017-08-08 2018-01-12 西安理工大学 A kind of adaptive scanning method towards HEVC entropy codes
CN108322749A (en) * 2018-03-15 2018-07-24 北京数码视讯科技股份有限公司 The coefficient optimization method of RDOQ, the accelerating method and device of RDOQ

Also Published As

Publication number Publication date
CN112449184A (en) 2021-03-05

Similar Documents

Publication Publication Date Title
CN110024398B (en) Local hash-based motion estimation for screen teleprocessing scenes
US10390039B2 (en) Motion estimation for screen remoting scenarios
US9756360B2 (en) Coefficient scanning in video coding
RU2609088C2 (en) Image encoding and decoding method, encoding and decoding device and corresponding software
US20110047155A1 (en) Multimedia encoding method and device based on multimedia content characteristics, and a multimedia decoding method and device based on multimedia
US20190246107A1 (en) Encoding and decoding methods and corresponding devices
WO2020220884A1 (en) Intra-frame prediction method and apparatus for video sequence
US20230024834A1 (en) Video decoding method, video encoding method, and related apparatuses
CN113301333A (en) Method and device for video decoding
WO2022062880A1 (en) Video decoding method and apparatus, computer readable medium, and electronic device
US20230421763A1 (en) Video coding method and apparatus, medium, and electronic device
WO2022174660A1 (en) Video coding and decoding method, video coding and decoding apparatus, computer-readable medium, and electronic device
WO2021238546A1 (en) Video encoding method, video playing back method, related devices and medium
CN115398899A (en) Video filtering method and device
CN112449184B (en) Transform coefficient optimization method, encoding and decoding method, device, medium, and electronic device
WO2021263251A1 (en) State transition for dependent quantization in video coding
WO2021004420A1 (en) Encoding and decoding methods, transmission method, and encoding and decoding devices and systems
CN116805968A (en) Video encoding and decoding method and device, computer readable medium and electronic equipment
CN112449188B (en) Video decoding method, video encoding device, video encoding medium, and electronic apparatus
CN111757122A (en) Video decoding method and apparatus, computer device, and storage medium
CN112449185B (en) Video decoding method, video encoding device, video encoding medium, and electronic apparatus
CN112449187B (en) Video decoding method, video encoding device, video encoding medium, and electronic apparatus
JP7483029B2 (en) VIDEO DECODING METHOD, VIDEO ENCODING METHOD, DEVICE, MEDIUM, AND ELECTRONIC APPARATUS
WO2022174701A1 (en) Video coding method and apparatus, video decoding method and apparatus, and computer-readable medium and electronic device
WO2022247452A1 (en) Method and apparatus for processing track data in multimedia resource, and medium and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant