WO2012113328A1 - Method and device for scanning transform coefficient block - Google Patents

Method and device for scanning transform coefficient block Download PDF

Info

Publication number
WO2012113328A1
WO2012113328A1 PCT/CN2012/071432 CN2012071432W WO2012113328A1 WO 2012113328 A1 WO2012113328 A1 WO 2012113328A1 CN 2012071432 W CN2012071432 W CN 2012071432W WO 2012113328 A1 WO2012113328 A1 WO 2012113328A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
texture
scan order
scanning
transform coefficient
Prior art date
Application number
PCT/CN2012/071432
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 WO2012113328A1 publication Critical patent/WO2012113328A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/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/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a scanning method and apparatus for transform coefficient blocks in video encoding and decoding.
  • the scanning of transform coefficient blocks is an integral part of video coding and decoding techniques.
  • the scanning of the transform coefficient block has the following applications:
  • the video encoding end scans the transformed two-dimensional transform coefficient block in the transform domain by the video encoding end, and converts the two-dimensional transform coefficient in the transform coefficient block into one-dimensional A sequence of transform coefficients.
  • the scanning order needs to be selected according to the transformation mode of the current transform coefficient block, so that the scanned one-dimensional transform coefficient sequence tends to be arranged from large to small, thereby improving coding efficiency;
  • at the video decoding end by video
  • the decoding end converts the one-dimensional transform coefficient sequence into a two-dimensional transform coefficient block according to the transform mode and selects the reverse scan order.
  • transforming the prediction residual is performed to obtain transform coefficients, and before performing transform coefficient scanning, reference block information and quantized transform coefficient information may also be obtained;
  • a set of optimal scan modes is selected by the rate distortion optimization criterion from the following three scan modes: Z-scan mode, horizontal scan mode, and vertical scan mode; then the selected scan mode pair transform is used.
  • the coefficients are scanned, and the selection information of the scan mode is encoded into the code stream and transmitted to the decoding end.
  • the mode Since the mode is selected in the three scanning modes at the encoding end of the video, the complexity of the encoding end is high. In addition, the selection information of the scanning mode needs to be encoded into the code stream, which affects the compression coding efficiency.
  • Embodiments of the present invention provide a scanning method and apparatus for transform coefficient blocks, which improve compression coding efficiency. Rate.
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
  • the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients
  • the preset candidate scan order includes a scan order other than a Z-scan sequence
  • the rate distortion is preferably processed for the Z-scan sequence and the selected scan order to obtain a preferred scan order
  • the transform coefficient block of the block to be encoded is scanned according to a preferred scanning order
  • the transform coefficient block of the block to be encoded is reset to a transform coefficient block scanned in a scan order of a predetermined rule; Transmitting a block of transform coefficients of the block to be encoded after the reset;
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
  • Parsing the code stream to obtain indication information if the indication information of the received code stream indicates that the scanning order is not a zigzag scanning order, detecting a texture of the decoded block as a reference of the to-be-decoded block, the texture embodies the waiting Converting a transform coefficient block of the transform block to a variation rule of the transform coefficients in each of the directions; selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than the Z-shaped scan order Scanning order
  • the transform coefficient block of the block to be decoded is reset to be selectable according to the selected scan order according to the selected scan order and the scan order of the predetermined rule. Scanned transform coefficient block.
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
  • the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients
  • the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order; If the selected scanning order is a zigzag scanning order, the transform coefficient blocks of the block to be encoded are scanned in a zigzag scanning order; if the selected scanning order is a scanning order other than the zigzag scanning order, the coding sequence is to be encoded
  • the transform coefficient block of the block is reset to a transform coefficient block conforming to the zigzag scan order; the transform coefficient block of the reset block to be encoded is scanned in a zigzag scan order.
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
  • the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
  • the transform coefficient blocks of the block to be decoded are scanned according to a Z-shaped scanning order
  • the transform coefficient block of the block to be decoded is reset from the transform coefficient block conforming to the Z-shaped scanning order to the transform coefficient block conforming to the selected scanning order;
  • the transformed transform coefficient block of the block to be decoded after being scanned is scanned according to the selected scanning manner.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a first detecting unit configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And a scan order corresponding to the texture is selected from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; and the first processing unit is configured to preset The Z-scan sequence and the selected scan order are subjected to rate distortion optimization processing to obtain a preferred scan order;
  • a first reset unit configured to reset a transform coefficient block of the block to be encoded to a transform coefficient block scanned in a scan order of a predetermined rule, if the preferred scan order is a scan order other than a Z-scan sequence;
  • a first scanning unit configured to scan a transform coefficient block of the block to be coded according to a preferred scan order if the preferred scan order is a Z-scan sequence; if the preferred scan order is a scan order other than the Z-scan order, Scanning the transformed coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule;
  • the first coding unit is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a second parsing unit configured to parse the code stream to obtain indication information
  • a second detecting unit configured to: if the indication information of the received code stream indicates that the scanning order is not a Z-shaped scanning order, detect a texture of the encoded or decoded block that is a reference of the block to be decoded, where the texture reflects the The variation law of the transform coefficient block of the decoding block in the transform coefficients of the respective parties;
  • a second selecting unit configured to select a scan order corresponding to the texture from a preset candidate scan order;
  • the preset candidate scan order includes a scan order other than a Z-scan sequence; and the second scan unit uses Scanning the transform coefficient block of the decoded block in a scan order according to a predetermined rule;
  • a second reset unit configured to: if the selected scan order is different from the scan order of the predetermined rule, the transform coefficient block of the block to be decoded is heavy according to the selected scan order and the scan order of the predetermined rule after the end of the scan Set to a block of transform coefficients that can be scanned in the selected scan order.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a third detecting unit configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And a scan order corresponding to the texture is selected from a preset candidate scan order; the preset candidate scan order includes a zigzag scan order and other scan orders than a zigzag scan order;
  • a third reset unit configured to reset a transform coefficient block of the block to be coded into a transform coefficient block conforming to a Z-shaped scan order if the selected scan order is other scan order than the Z-scan sequence;
  • a third scanning unit configured to: if the selected scanning order is a Z-shaped scanning order, scan the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; or, according to the Z-shaped scanning order, the resetted position The transform coefficient block of the coded block is scanned for scanning.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a fourth detecting unit configured to detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients
  • a fourth selecting unit configured to select a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than a Z-scan order;
  • a fourth reset unit configured to reset the transform coefficient block of the block to be decoded from the transform coefficient block conforming to the Z-scan order to the selection if the selected scan order is other than the Z-scan order a transform coefficient block of the scan order;
  • a fourth scanning unit configured to scan a transform coefficient block of the block to be decoded according to a zigzag scan order if the selected scan order is a z-scan sequence; or, after the reset according to the selected scan mode The transform coefficient block of the block to be encoded is scanned.
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
  • the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients
  • the residual data block of the block to be coded is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule.
  • the transform coefficient blocks of the block to be encoded are scanned in a preferred scan order, and the preferred scan order is a scan order obtained by performing rate distortion optimization processing on a Z-scan sequence and a predetermined rule scan order;
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
  • the indication information of the code stream indicates that the scan order is not a zigzag scan, detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects that the transform coefficient block of the block to be decoded is transformed in all directions a variation rule of the coefficient; if the scan order corresponding to the texture is different from the scan order of the predetermined rule, the block to be decoded is to be decoded according to the scan order corresponding to the texture and the scan order of the predetermined rule after the end of the inverse transform
  • the difference data block is reset, and the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • An embodiment of the present invention provides a method for scanning a transform coefficient block, including: Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
  • the residual data block of the block to be coded is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule.
  • the embodiment of the present invention provides a method for scanning a block of transform coefficients, including:
  • the residual data block of the block to be decoded is reset according to the scan order corresponding to the texture and the scan order of the predetermined rule. And transforming the transform coefficient block corresponding to the residual data block into a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a fifth detecting unit configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And if the scanning order corresponding to the texture is inconsistent with the scanning order of the predetermined rule, the residual data block of the to-be-coded block is reset, so that the transform coefficient block corresponding to the residual data block is scanned according to a predetermined rule.
  • Transform coefficient block
  • a fifth processing unit configured to perform a rate-distortion optimization process on the preset Z-scan sequence and the scan order of the predetermined rule to obtain a preferred scan order
  • a fifth scanning unit configured to scan a transform coefficient block of the block to be coded according to a preferred scan order
  • a fifth coding unit configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a sixth parsing unit configured to parse the code stream to obtain indication information
  • a sixth scanning unit configured to perform a transform coefficient block of the block to be decoded according to the parsed scan order Scan
  • a sixth detecting unit configured to: if the indication information of the code stream indicates that the scanning order is not a zigzag scanning, detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects a transformation of the to-be-decoded block The variation law of the coefficient of transformation of the coefficient block in each direction;
  • a sixth reset unit configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, the scan order corresponding to the texture and the scan order of the predetermined rule are to be decoded
  • the residual data block of the block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • a seventh detecting unit configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient of the block to be encoded in each of the transform coefficients; And if the scanning order corresponding to the texture is inconsistent with the scanning order of the predetermined rule, the residual data block of the to-be-coded block is reset, so that the transform coefficient block corresponding to the residual data block is scanned according to a predetermined rule.
  • Transform coefficient block
  • a seventh scanning unit configured to scan a transform coefficient block of the coded block according to a scan order of a predetermined rule
  • An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
  • An eighth scanning unit configured to scan a transform coefficient block of the block to be decoded according to a scan order of a predetermined rule
  • An eighth detecting unit configured to detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
  • An eighth reset unit configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the inverse transform ends, the scan order corresponding to the texture and the scan order of the predetermined rule are to be decoded
  • the residual data block of the block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • the above technical solution only needs to select between the predetermined scanning order and the Z-shaped scanning order, and is an alternative of two choices. Compared with the selection in the three-choice one, one less one can be used to carry the selected information, so When coding the encoding header information, it saves resources; in addition, it is more efficient when it is selected. DRAWINGS
  • FIG. 1 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 2A is a schematic diagram showing a scanning sequence of a vertical texture according to an embodiment of the present invention.
  • 2B is a schematic diagram of a scanning sequence of a horizontal texture according to an embodiment of the present invention.
  • 2C is a schematic diagram showing a scanning sequence of a diagonal texture according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural view of an apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural view of an apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 10 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 11 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 13 is a schematic flowchart of a method according to an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • Figure 15 is a schematic structural view of an apparatus according to an embodiment of the present invention.
  • 16 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • FIG. 17 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
  • an optimal inter-frame coding type is selected according to a rate-distortion criterion from various inter-coding types, and motion information is obtained at the same time, and motion information is obtained.
  • the encoded reconstructed frame information obtains a predicted value of the block to be coded, and performs a difference between the predicted value and the pixel value of the block to be coded to obtain a residual value, and sequentially transforms, quantizes, scans, and entropy encodes the residual value , the code stream is programmed, and the motion information is programmed into the code stream to complete the encoding process.
  • the scanning in the encoding and decoding process will be specifically described below.
  • the transform mentioned in the embodiment of the present invention may be a Discrete Cosine Transform (DCT); or a multi-transformation technique, such as a KL transform (KLT), which is not limited in this embodiment of the present invention.
  • DCT Discrete Cosine Transform
  • KLT KL transform
  • a scanning method of a transform coefficient block which can be executed at the encoding end, as shown in FIG. 1, and includes:
  • the above 101 belongs to a physical derivation, and the encoded texture as a reference approximates the texture of the current block to be encoded, and the texture to be encoded is similar to the residual texture to be encoded, and the distribution law of the transform coefficients is closely related to the residual texture.
  • the above texture includes a horizontal texture, a vertical texture, and a diagonal texture; wherein the oblique texture can also be regarded as no texture.
  • the detecting the texture of the decoded block includes:
  • a horizontal gradient value in a horizontal direction of the transform coefficient block and a vertical gradient value in a vertical direction are calculated;
  • the horizontal gradient value is a sum of absolute values of difference values of adjacent pixel points in the horizontal direction
  • the vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction;
  • the transform coefficient block as a reference is the coefficient of variation block of the decoded block;
  • the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture;
  • the texture is determined to be a vertical texture
  • the offset of the horizontal direction of the intra prediction mode direction is within M
  • the texture is determined. Is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the above M is the second preset value, and M can also be
  • the resolution width is determined, for example, set to 5, and may be set to other values, such as 3, 4, etc., which are not limited in this embodiment of the present invention.
  • the embodiment of the present invention further provides an implementation manner of modifying the preset value: if the ratio of the horizontal texture to the vertical texture exceeds the third preset value in the block that has been decoded, the value of N is reduced, if the horizontal texture and the vertical If the ratio of the straight texture is less than N, the value of N is increased.
  • the third preset value may be obtained by performing intra-frame coding on a sequence of transform coefficients of different characteristics, and calculating a proportional relationship between the horizontal and vertical prediction directions, and the proportional relationship may be used as the third preset value.
  • the texture of the already encoded block or the decoded block is known, and the information may be used to reduce the amount of operations;
  • the texture of the detected transform coefficient block includes: detecting to be decoded The block sets the texture of the block or decoded block within the time domain or spatial domain distance, and determines the detected texture as the texture of the transform coefficient block.
  • the preset candidate scan order includes a scan order other than the Z-scan order;
  • the scanning order corresponding to the above texture includes as shown in FIG. 2A to FIG. 2C: the vertical texture corresponds to the horizontal scanning order of the progressive scanning, the horizontal texture corresponds to the vertical scanning order of the column-by-column scanning, and the oblique texture corresponds to the Z-shaped sequential scanning Z. Shape scan order.
  • a 4X4 matrix is taken as an example, in which a circle represents a transformation coefficient, a numerical value under a circle represents a coordinate (i.e., a position) at which a transformation coefficient is located, and an arrow direction represents a scanning direction, that is, a scanning order. It should be noted that the matrix on the left side of FIG.
  • the Z-shaped scanning sequence is not limited in the embodiment of the invention.
  • the transform coefficient block of the block to be coded is scanned according to a preferred scan order; if the preferred scan order is a scan order other than the Z-scan order, the transform of the block to be coded is performed. Converting the coefficient block to a transform coefficient block scanned in a scan order of a predetermined rule; scanning the block of transform coefficients of the block to be encoded after the reset according to the scan order of the predetermined rule;
  • the transform coefficient block of the block to be encoded is reset to be scanned in a scanning order of a predetermined rule.
  • Transforming the coefficient block; scanning the transformed coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule includes:
  • the transform coefficients of the block to be coded are transposed, and the transform coefficient blocks of the transposed block to be coded are scanned according to the second scan order; the first scan order and the first scan order
  • the scanning order of the two scanning sequences is symmetrical;
  • the transform coefficient blocks of the block to be encoded are scanned in the second scanning order.
  • first and second are used to distinguish two scanning sequences having a symmetric relationship, and are not otherwise limited.
  • first scanning order if the first scanning order is a horizontal scanning order, the second scanning order is a vertical scanning order, and if the first scanning order is a vertical scanning order, the second scanning order is a horizontal scanning order.
  • the transform coefficient block of the block to be coded is reset to a transform coefficient block scanned in a scan order of a predetermined rule; the transform coefficient of the reset block to be coded according to the scan order of the predetermined rule
  • the scanning of the block includes: resetting the transform coefficient block of the block to be encoded into a transform coefficient block conforming to the Z-scan order; and scanning the transform coefficient block of the reset block to be encoded according to the Z-scan order. If the method is used, the indication information in 105 may not be transmitted, and the subsequent embodiments will be described in detail.
  • the indication that the scan order used for scanning is the Z-scan order is programmed into the code stream.
  • the selection is one of the alternatives, and the selected information can be used less than one in the selection of the three-choice one, so When it is programmed into the encoding header information, it saves resources; in addition, it is more efficient when it is selected.
  • multiplexing the transform coefficient matrix multiplexing the same entropy coding model can improve the coding efficiency.
  • the embodiment further provides an example of an implementation manner of a preset candidate scan sequence, where the preset candidate scan sequence includes:
  • the scan rule determines the order of the scan; or, pre-statistically counts the number of transform coefficients of each position of two or more transform coefficient blocks to be non-zero, from large to small
  • the positions of the transform coefficients corresponding to the respective non-zero numbers are sequentially arranged, and the order of the positions of the above-described transform coefficients obtained by the arrangement is determined as a preset candidate scan order.
  • the quantized residuals can be classified into three categories: horizontal texture The corresponding quantized residual, the quantized residual corresponding to the vertical texture, and the quantized residual corresponding to the oblique texture; the manner of determining the scanning order is: establishing a counter group with the same number of transform coefficients (for example, 16 counters for 4x4 transform) And then counting with a counter, specifically: determining whether each transform coefficient is zero, if non-zero, the corresponding position counter is incremented by one; after the detected number of transform coefficient blocks reaches a set number, each counter has its The value of the count; at this time, the values of the respective counters can be arranged from large to small, and the order of the positions of the above-described transform coefficients obtained by the arrangement can be determined as a preset candidate scan order.
  • Example 1 The following describes the scanning process in the encoding process:
  • A code according to the encoding process until the transform coefficient is encoded
  • inter-frame coding (Inter) is performed, the reference block texture is detected to obtain its texture (horizonous Hor texture, vertical ver texture, oblique texture); if intra-frame coding (Intra) is performed In the case, if the direction of the intra prediction mode (ipmode) is ver +/- 5, the texture is a vertical texture with a direction of Hor +/- 5, the texture is a horizontal texture, and the rest is a diagonal texture.
  • the offset set in this embodiment is 5, and may of course be set to other values, which is not limited in this embodiment of the present invention.
  • a scan order corresponding to the above texture is selected from the preset candidate scan order based on the obtained texture.
  • the detection method in the above B can be:
  • a difference is obtained for every two pixel points of the adjacent detection step in the horizontal direction; an absolute value of the accumulated difference value is obtained as a horizontal gradient value;
  • Step C is the pre-predetermined value An automatic correction process for setting, which is not a step that must be performed.
  • step B detection there may be an alternative to the method of step B detection in the above encoding process: detecting the texture of the already encoded block or the decoded block within the distance of the time domain or the spatial domain to be decoded, and determining the detected texture as the waiting The texture of the transform coefficient block of the decoded block. More specifically, for example, the texture of the decoded block of the periphery of the block to be decoded (upper, left, upper left, upper right, lower left) is detected as the texture of the block of the current transform block to be decoded.
  • F Scan the transform coefficient block to be scanned according to the horizontal scanning order and the related entropy coding model, and then continue the subsequent encoding process.
  • G encodes and scans the transform coefficient block to be scanned according to the Z-scan order and the related entropy coding model, and then continues the subsequent encoding process.
  • step H The above-mentioned scan sequence used for scanning is programmed into the code stream for the indication of the Z-scan order. This step can be performed during the execution of step G or F. It can be understood that after the encoding is completed, the encoded result (code stream) is sent to the decoding end, and other positions of the embodiment of the present invention are not described.
  • the embodiment of the present invention further provides scanning of a transform coefficient block performed at the decoding end.
  • the method as shown in Figure 3, includes:
  • the transform coefficient block of the block to be decoded is scanned according to the Z-shaped scanning sequence; the scanning process ends.
  • the indication information of the received code stream indicates that the scanning order is not a Z-shaped scanning order, detecting a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects the transform coefficient block of the to-be-decoded block in each a change rule of the transform coefficient in the direction; selecting a scan order corresponding to the texture from the preset candidate scan order; in the embodiment, the preset candidate scan order includes a scan order other than the Z scan order;
  • resetting the transform coefficient block of the block to be decoded according to the selected scan order and the scan order of the predetermined rule after the end of the scan may be performed according to the selected scan order.
  • Scanned transform coefficient block It can be understood that, in this embodiment, corresponding to the encoding end, the transform coefficient block of the block to be decoded is once reset by the encoding end according to the predetermined rule.
  • the transform coefficient block of the block to be decoded is scanned according to the scan order of the predetermined rule; if the scan order selected is different from the scan order of the predetermined rule, after the scan ends, according to the selected scan order and the predetermined rule
  • the scan order resets the transform coefficient block of the block to be decoded to a transform coefficient block that can be scanned in the selected scan order, including:
  • the selected scan order is the first scan order
  • the scanning order is symmetrical, and the second scanning order is the scanning order of the above predetermined rules.
  • Example 2 The decoding process is similar to the scanning process of the encoding process:
  • A Decode according to the decoding process until the transform coefficient is parsed
  • step B parsing the code stream, obtaining indication information, that is, the indication information in step H of the encoding process; determining whether the indication information indicates that the scanning order is a zigzag scanning order; if yes, executing E; otherwise executing C;
  • C This step can refer to step B of the first scheme, according to the obtained texture, select the scan order corresponding to the above texture from the preset candidate scan order, and then execute D;
  • the transform coefficient blocks to be scanned are parsed and scanned according to the horizontal scanning order and the related entropy coding model, and then the transform coefficients are transposed to continue the subsequent decoding process; if the texture direction corresponds to the horizontal level In the scanning sequence, the transform coefficient blocks to be scanned are parsed and scanned according to the horizontal scanning order and the related entropy coding model, and the subsequent decoding process is continued;
  • the above example ones and twos only need to choose between the horizontal and vertical scanning order and the zigzag scanning order, which is the alternative of the two, one compared to the horizontal, vertical and zigzag scanning order (zig-zag)
  • the choice between three choices can use one less to carry the selected information, so it saves resources when it is coded into the encoding header information; in addition, it is more efficient at the time of selection.
  • Another embodiment of the present invention further provides a scanning method for a transform coefficient block, which is implemented in an encoding device. Further, the instruction information is not further transmitted on the basis of the above two schemes, and the coding efficiency can be further improved. As shown in Figure 4, it includes:
  • the candidate scan order preset in this embodiment includes a Z-scan order and a scan order other than the Z-scan order;
  • the selected scanning order is a Z-shaped scanning order, scanning the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; if the selected scanning order is a scanning order other than the Z-shaped scanning order, The transform coefficient block of the coded block is reset to a transform coefficient block conforming to the zigzag scan order; the transform coefficient block of the reset block to be coded is scanned in a zigzag scan order.
  • the embodiment of the present invention further provides another method for scanning a transform coefficient block.
  • the solution is executed in a decoding device, and the coding efficiency is further improved without transmitting the indication information.
  • the method includes:
  • Example 1 The following describes the scanning process in the encoding process:
  • This step can refer to step B of the first scheme, and select a scan order corresponding to the texture from the preset candidate scan order according to the obtained texture;
  • 501 Detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients.
  • the candidate scan order preset in this embodiment includes a Z-scan order and a scan order other than the Z-scan order;
  • the selected scanning order is a Z-shaped scanning order, scanning the transform coefficient block of the to-be-decoded block according to a Z-shaped scanning order;
  • the transform coefficient block of the block to be decoded is reset from the transform coefficient block conforming to the Z-shaped scanning order to the transform coefficient block conforming to the selected scanning order. And translating the transformed coefficient block of the block to be decoded after the reset according to the scanning mode selected above.
  • the corresponding decoding process is similar to the scanning process of the encoding process:
  • A Decode according to the decoding process until the transform coefficient is parsed
  • step C In this step, referring to step B of the first scheme, the scan order corresponding to the texture is selected from the preset candidate scan order according to the obtained texture;
  • D If the texture direction corresponds to the vertical scanning order, the position of the transform coefficient is reset to a positional relationship in accordance with the vertical scanning order; if the texture direction corresponds to the horizontal scanning order, the position of the transform coefficient is reset to a position conforming to the horizontal scanning order Relationship; if the texture direction corresponds to the zigzag scanning order, the step operation is not performed;
  • the scan order of the transform coefficients corresponds to a unique frequency domain positional relationship (ie, (0, 0), (0, 1) , ( 1 , 0 ) ... ), so when parsing the scanned point, it can give it a possible value according to the value of the point that has been resolved around the frequency domain (ie, establish an entropy coding model, which can be regarded as A prediction that makes coding more efficient).
  • each scanning order can still be performed in a single scanning scheme.
  • the embodiment of the present invention can determine whether it is zig-zag and cannot distinguish between horizontal and vertical, so if no operation is performed, in the non-zig-zag, the relationship between the scan order and the frequency domain position cannot be determined. There is no way to establish an entropy coding model, and it cannot be decoded. The above solution solves this problem by resetting.
  • Test condition JCTVC high efficiency low delay test condition
  • Test results The third column is the result of the technical solution integrated in the TMuC (New Generation Video Coding Test Software Platform), and the fourth column is the result of the solution of the embodiment of the present invention. It can be seen that the embodiment of the present invention has a high efficiency.
  • a scanning device for transform coefficient blocks includes:
  • a first detecting unit 601 configured to detect a texture of a coded block that is a reference of a block to be coded, where the texture reflects a variation rule of a transform coefficient block of the block to be coded in each of the transform coefficients;
  • the first selecting unit 602 For selecting a scan order corresponding to the texture from the preset candidate scan order;
  • the preset candidate scan order includes a scan order other than the Z-scan order;
  • the first processing unit 603 is configured to preset the Z
  • the shape scan order and the selected scan order are subjected to rate distortion optimization processing to obtain a preferred scan order;
  • the first reset unit 604 is configured to: if the preferred scan order is a scan order other than the Z-scan sequence, reset the transform coefficient block of the block to be coded into a transform coefficient block scanned in a scan order of a predetermined rule;
  • the first scanning unit 605 is configured to scan the transform coefficient block of the block to be coded according to the preferred scan order if the preferred scan order is a Z-scan sequence; if the preferred scan order is a scan order other than the Z-scan order, Scanning the transform coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule;
  • the first coding unit 606 is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
  • a scanning device for transform coefficient blocks includes:
  • a second parsing unit 701 configured to parse the code stream to obtain indication information
  • the second detecting unit 702 is configured to: if the received information of the code stream indicates that the scanning order is not Z Forming a scanning sequence, detecting a texture of the encoded or decoded block as a reference of the block to be decoded, wherein the texture reflects a variation rule of the transform coefficient block of the block to be decoded in each of the transform coefficients;
  • a second selecting unit 703 configured to select a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; and the second scan unit 704 uses Scanning the transform coefficient block of the decoded block in a scan order according to a predetermined rule;
  • a second reset unit 705, configured to: if the selected scan order is different from the scan order of the predetermined rule, reset the transform coefficient block of the block to be decoded according to the selected scan order and the scan order of the predetermined rule after the scan ends A block of transform coefficients that can be scanned in the selected scan order.
  • a scanning device for transform coefficient blocks includes:
  • a third detecting unit 801 configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient of the block to be encoded in each of the transform coefficients; the third selecting unit 802, And a scan order corresponding to the texture is selected from the preset candidate scan sequences; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
  • a third reset unit 803, configured to: if the selected scan order is a scan order other than the Z-scan sequence, reset the transform coefficient block of the block to be coded into a transform coefficient block conforming to the Z-scan order;
  • the unit 804 is configured to: if the selected scanning order is a Z-shaped scanning order, scan the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; or: perform the resetting the to-be-coded block according to a Z-shaped scanning order.
  • the transform coefficient block is scanned.
  • a scanning device for transform coefficient blocks includes:
  • a fourth detecting unit 901 configured to detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects a variation rule of the transform coefficient block of the to-be-decoded block in each of the upward transform coefficients;
  • the fourth selecting unit 902 is configured to select a scan order corresponding to the texture from the preset candidate scan order;
  • the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
  • the fourth reset unit 903 is configured to reset the transform coefficient block of the block to be decoded from the transform coefficient block conforming to the zigzag scan order to another scan mode if the selected scan order is a zigzag scan order. a transform coefficient block that conforms to the scan order of the above selection;
  • a fourth scanning unit 904 configured to: if the selected scanning order is a Z-shaped scanning order, scan the transform coefficient block of the to-be-decoded block according to a Z-shaped scanning order; or, according to the selected scanning manner, the reset The transform coefficient block of the above-mentioned block to be coded is scanned.
  • a scanning method of a transform coefficient block which can be executed on the encoding end, as shown in FIG. 10, and includes:
  • 1001 Detecting a texture of a coded block that is a reference of a block to be coded, where the texture reflects a variation rule of a transform coefficient block of the block to be coded in each of the transform coefficients;
  • the above 1001 belongs to a physical derivation.
  • the referenced encoded texture approximates the texture of the current block to be encoded, and the texture to be encoded is similar to the residual texture to be encoded.
  • the distribution law of the transform coefficients is closely related to the residual texture.
  • the above texture includes a horizontal texture, a vertical texture, and a diagonal texture; wherein the oblique texture can also be regarded as no texture.
  • the detecting the texture of the decoded block includes:
  • a horizontal gradient value in a horizontal direction of the transform coefficient block and a vertical gradient value in a vertical direction are calculated;
  • the horizontal gradient value is a sum of absolute values of difference values of adjacent pixel points in the horizontal direction
  • the vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction;
  • the transform coefficient block as a reference is the coefficient of variation block of the decoded block;
  • the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture;
  • the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is determined within M.
  • the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the above M is the second preset value, and M can also be determined by the resolution width, for example, set to 5, and can also be set to other values such as 3, 4, etc.
  • the embodiment of the invention is not limited.
  • the embodiment of the present invention further provides an implementation manner of modifying the preset value: if the ratio of the horizontal texture to the vertical texture exceeds the third preset value in the block that has been decoded, the value of N is reduced, if the horizontal texture and the vertical If the ratio of the straight texture is less than N, the value of N is increased.
  • the third preset value may be obtained by performing intra-frame coding on a sequence of transform coefficients of different characteristics, and calculating a proportional relationship between the horizontal and vertical prediction directions, and the proportional relationship may be used as the third preset value.
  • the texture of the already encoded block or the decoded block is known, and the information may be used to reduce the amount of operations;
  • the texture of the detected transform coefficient block includes: detecting to be decoded The block sets the texture of the block or decoded block within the time domain or spatial domain distance, and determines the detected texture as the texture of the transform coefficient block.
  • the residual data block of the block to be coded is reset, so that the corresponding transform coefficient block is a transform coefficient block scanned according to a predetermined rule;
  • the scanning order corresponding to the above texture includes as shown in FIG. 2A to FIG. 2C: the vertical texture corresponds to the horizontal scanning order of the progressive scanning, the horizontal texture corresponds to the vertical scanning order of the column-by-column scanning, and the oblique texture corresponds to the Z-shaped sequential scanning Z. Shape scan order.
  • a 4X4 matrix is taken as an example, in which a circle represents a transformation coefficient, a numerical value under a circle represents a coordinate (i.e., a position) at which a transformation coefficient is located, and an arrow direction represents a scanning direction, that is, a scanning order. It should be noted that the matrix on the left side of FIG.
  • the Z-shaped scanning sequence is not limited in the embodiment of the invention.
  • Transforming coefficient blocks; scanning the transform coefficient blocks of the block to be encoded according to a scanning order of a predetermined rule includes:
  • the preferred scanning order is the first scanning order
  • the residual data block of the block to be encoded is transposed, Performing scanning on the transformed coefficient block of the transposed block to be encoded according to the second scanning sequence; the scanning order of the first scanning sequence and the second scanning sequence is symmetric;
  • the transform coefficient blocks of the block to be encoded are scanned in the second scanning order.
  • first and second are used to distinguish two scanning sequences having a symmetric relationship, and are not otherwise limited.
  • first scanning order if the first scanning order is a horizontal scanning order, the second scanning order is a vertical scanning order, and if the first scanning order is a vertical scanning order, the second scanning order is a horizontal scanning order.
  • the selection is one of the alternatives, and the selected information can be used less than one in the selection of the three-choice one, so When it is programmed into the encoding header information, it saves resources; in addition, it is more efficient when it is selected.
  • multiplexing the transform coefficient matrix multiplexing the same entropy coding model can improve the coding efficiency.
  • the embodiment further provides an example of an implementation manner of a preset candidate scan sequence, where the preset candidate scan sequence includes:
  • the scan rule determines the order of the scan; or, pre-statistically counts the number of transform coefficients of each position of two or more transform coefficient blocks to be non-zero, and arranges each non-zero in descending order
  • the position of the transform coefficient corresponding to the number of times determines the order of the positions of the above-described transform coefficients obtained as the preset candidate scan order.
  • the quantized residuals can be classified into three categories: horizontal texture The corresponding quantized residual, the quantized residual corresponding to the vertical texture, and the quantized residual corresponding to the oblique texture; the manner of determining the scanning order is: establishing a counter group with the same number of transform coefficients (for example, 16 counters for 4x4 transform) And then counting with a counter, specifically: determining whether each transform coefficient is zero, if non-zero, the corresponding position counter is incremented by one; after the detected number of transform coefficient blocks reaches a set number, each counter has its The value of the count; at this time, the values of the respective counters can be arranged from large to small, and the order of the positions of the above-described transform coefficients obtained by the arrangement can be determined as a preset candidate scan order.
  • the position of the transform coefficient corresponding to the vertical texture for example, 16 counters for 4x4 transform
  • Example 1 The following describes the scanning process in the encoding process:
  • A code according to the encoding process until the transform coefficient is encoded
  • inter-frame coding (Inter) is performed, the reference block texture is detected to obtain its texture (horizonous Hor texture, vertical ver texture, oblique texture); if intra-frame coding (Intra) is performed In the case, if the direction of the intra prediction mode (ipmode) is ver +/- 5, the texture is a vertical texture with a direction of Hor +/- 5, the texture is a horizontal texture, and the rest is a diagonal texture.
  • the offset set in this embodiment is 5, and may of course be set to other values, which is not limited in this embodiment of the present invention.
  • a scan order corresponding to the above texture is selected from the preset candidate scan order based on the obtained texture.
  • the detection method in the above B can be:
  • a difference is obtained for every two pixel points of the adjacent detection step in the horizontal direction; an absolute value of the accumulated difference value is obtained as a horizontal gradient value;
  • B4 if the horizontal gradient value is greater than N times the vertical gradient value, it is determined that the texture is a vertical texture; If the vertical gradient value is greater than N times the horizontal gradient value, the texture is determined to be a horizontal texture; the other case is a diagonal texture; after B4, the horizontal, vertical, and oblique texture ratio distribution in the coded block may be further determined. It is judged whether the threshold value N needs to be updated, and the determination mode is to determine whether the ratio of the horizontal gradient value to the vertical gradient value exceeds a preset value, and if so, the preset value is increased, otherwise, the preset value is reduced.
  • the preset value is obtained by the following method: by intra-coding the sequence of transform coefficients with different characteristics, and the proportional relationship between the statistical level and the vertical prediction direction, the proportional relationship can be used as the preset value.
  • Step C is the pre-predetermined value An automatic correction process for setting, which is not a step that must be performed.
  • step B detection there may be an alternative to the method of step B detection in the above encoding process: detecting the texture of the already encoded block or the decoded block within the distance of the time domain or the spatial domain to be decoded, and determining the detected texture as the waiting The texture of the transform coefficient block of the decoded block. More specifically, for example, the texture of the decoded block of the periphery of the block to be decoded (upper, left, upper left, upper right, lower left) is detected as the texture of the block of the current transform block to be decoded.
  • step F The above-mentioned scan sequence used for scanning is programmed into the code stream for the indication of the Z-scan order. This step can be performed during the execution of step E. It can be understood that, after the encoding is completed, the encoded result (code stream) is sent to the decoding end, and other positions of the embodiment of the present invention are not described.
  • the embodiment of the present invention further provides a scanning method of a transform coefficient block performed on the decoding end. As shown in FIG. 11, the method includes:
  • the scan sequence corresponding to the texture includes a scan order other than the Z-scan sequence; 1304: If the scan order corresponding to the texture is different from the scan order of the predetermined rule, the residual data block of the block to be decoded is obtained according to the scan order corresponding to the texture and the scan order of the predetermined rule after the end of the inverse transform Reset, such that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule. It can be understood that, in this embodiment, the residual data block of the to-be-decode
  • the transform coefficient block of the block to be decoded is scanned according to a scan order of a predetermined rule; if the scan order corresponding to the texture is different from the scan order of the predetermined rule, according to the texture after the end of the inverse transform
  • the corresponding scan order and the scan order of the predetermined rule reset the residual data block of the block to be decoded, so that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order according to a predetermined rule, and includes:
  • the selected scan order is the first scan order
  • the scanning order of the scanning order is symmetrical, and the second scanning order is the scanning order of the above predetermined rules.
  • Example 2 The decoding process is similar to the scanning process of the encoding process:
  • A Decode according to the decoding process until the transform coefficient is parsed
  • step D Determine whether the indication information indicates that the scanning order is a Z-shaped scanning order. If it is not a Z-shaped scanning, refer to step B of the first scheme, according to the obtained texture direction. If the scanning order corresponding to the texture is different from the scanning order of the predetermined rule, transducing the residual data block of the block to be decoded;
  • the above example ones and twos only need to choose between the horizontal and vertical scanning order and the zigzag scanning order, which is the alternative of the two, one compared to the horizontal, vertical and zigzag scanning order (zig-zag)
  • the choice between three choices can use one less to carry the selected information, so it saves resources when it is coded into the encoding header information; in addition, it is more efficient at the time of selection.
  • Another embodiment of the present invention also provides a scanning method for transform coefficient blocks.
  • the coding efficiency can be further improved without further transmitting the indication information on the basis of the above two solutions; as shown in FIG. 12, the method includes:
  • the residual data block of the block to be coded is reset, so that the corresponding transform coefficient block is a transform coefficient block scanned according to a predetermined rule;
  • Example 1403 Scan the transform coefficient block of the block to be encoded according to a scanning order of a predetermined rule.
  • Example 1 The following describes the scanning process in the encoding process:
  • A code according to the encoding process until the transform coefficient is encoded
  • Step B This step can refer to step B of the first example to obtain the texture direction.
  • the embodiment of the present invention further provides another method for scanning a transform coefficient block.
  • the solution is executed in a decoding device, and the coding efficiency is further improved without transmitting the indication information.
  • the method includes:
  • 1501 scanning a transform coefficient block of the decoded block according to a scan order of a predetermined rule; 1502: detecting a texture of the decoded block as a reference of the block to be decoded, the texture embodying a transform coefficient block of the block to be decoded The law of the change of the coefficient of transformation in all directions;
  • the residual data block of the block to be decoded is determined according to a scan order corresponding to the texture and a scan order of a predetermined rule. Reset, such that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • the corresponding decoding process is similar to the scanning process of the encoding process:
  • A Decode according to the decoding process until the transform coefficient is parsed
  • step C In this step, reference may be made to step B of the first solution to obtain a texture direction. If the scan order corresponding to the texture is different from the scan order of the predetermined rule, the residual data block of the block to be decoded is transposed.
  • the parallelism of the decoding is not affected, the processing delay is reduced, and the decoding efficiency is improved.
  • a scanning device for transform coefficient blocks includes:
  • a fifth detecting unit 1601 configured to detect a texture of the encoded block that is a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients;
  • the fifth reset unit 1602 is configured to: if the scan order corresponding to the texture does not match the scan order of the predetermined rule, reset the residual data block of the block to be coded, so that the corresponding transform coefficient block is according to a predetermined rule. Scanned transform coefficient block;
  • the fifth processing unit 1603 is configured to perform rate-distortion optimization processing on the preset Z-scan sequence and the scan order of the predetermined rule to obtain a preferred scan order;
  • a fifth scanning unit 1604 configured to scan a transform coefficient block of the block to be coded according to a preferred scan order
  • the fifth coding unit 1605 is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
  • a scanning device for transform coefficient blocks includes:
  • a sixth parsing unit 1701 configured to parse the code stream to obtain indication information
  • a sixth scanning unit 1702 configured to scan a transform coefficient block of the block to be decoded according to the parsed scan order
  • a sixth detecting unit 1703 configured to: if the indication information of the code stream indicates that the scanning order is not a zigzag scan, detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects the to-be-decoded block The variation law of the transform coefficient block in each of the transform coefficients;
  • the sixth reset unit 1704 is configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, according to the scan order corresponding to the texture and the predetermined
  • the regular scan order resets the residual data block of the block to be decoded so that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • a scanning device for transform coefficient blocks includes:
  • a seventh detecting unit 1801 configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients;
  • the seventh reset unit 1802 is configured to: if the scan order corresponding to the texture does not match the scan order of the predetermined rule, reset the residual data block of the block to be coded, so that the corresponding transform coefficient block is according to a predetermined rule. Scanned transform coefficient block;
  • a seventh scanning unit 1803, configured to scan a transform coefficient block of the coded block according to a scan order of a predetermined rule
  • a scanning device for transform coefficient blocks includes:
  • the eighth scanning unit 1901 is configured to scan a transform coefficient block of the block to be decoded according to a scan order of a predetermined rule
  • An eighth detecting unit 1902 configured to detect a texture of a decoded block that is a reference of the to-be-decoded block, where the texture reflects a variation rule of a transform coefficient block of the to-be-decoded block in each of the upward transform coefficients;
  • the eighth reset unit 1903 is configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the inverse transform ends, according to the scan order corresponding to the texture and the scan order of the predetermined rule
  • the residual data block of the decoded block is reset such that its corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
  • the method provided by the embodiment of the present invention can be applied to the field of digital signal processing, and is implemented by a video encoder and a decoder.
  • Video encoders, decoders are widely used in a variety of communication devices or electronic devices, such as: media gateways, mobile phones, wireless devices, personal data assistants (PDAs), handheld or portable computers, GPS receivers/navigators, cameras , video players, camcorders, video recorders, surveillance equipment, and more.
  • Such devices include processors, memory, and interfaces for transmitting data.
  • the video codec can be implemented directly by a digital circuit or chip such as a DSP (digital signal processor) or by a software code that drives a processor to execute the flow in the software code.
  • DSP digital signal processor

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

Disclosed are a method and a device for scanning a transform coefficient block. The implementation of the method comprises: detecting a texture of an encoded block as a reference of a block to be encoded; selecting a scan order corresponding to the texture from preset candidate scan orders; performing rate distortion optimization processing on a zig-zag scan order and the selected scan order to obtain an optimal scan order; if the optimal scan order is the zig-zag scan order, scanning, according to the optimal scan order, a transform coefficient block of the block to be encoded; if the optimal scan order is a scan order other than the zig-zag scan order, resetting the transform coefficient block of the block to be encoded as a transform coefficient block scanned according to a scan order of a predetermined rule; scanning, according to the scan order of the predetermined rule, the reset transform coefficient block of the block to be encoded; and encoding indication information of whether the scan order used for scan is the zig-zag scan order into a code stream. The solution can save resources and achieve higher efficiency.

Description

本申请要求于 2011年 2月 23 日提交的申请号为 201110043594。 0, 发 明名称为 "一种变换系数块的扫描方法和装置"的中国专利申请和 2011年 3月 29 日提交的申请号为 201110076616.3 , 发明名称为"一种变换系数块的扫描 方法和装置"的中国专利申请的优先权, 其全部内容通过引用结合在本申请 中。  This application requires the application number submitted on February 23, 2011 as 201110043594. 0, the Chinese patent application entitled "Scanning Method and Apparatus for Transforming Blocks" and the application number of 201110076616.3 filed on March 29, 2011, entitled "Scanning Method and Apparatus for Transforming Blocks" Priority of the Chinese Patent Application, the entire contents of which is incorporated herein by reference.
技术领域 Technical field
本发明涉及通信技术领域, 特别涉及一种视频编解码中变换系数块的扫 描方法和装置。  The present invention relates to the field of communications technologies, and in particular, to a scanning method and apparatus for transform coefficient blocks in video encoding and decoding.
背景技术 Background technique
变换系数块的扫描是视频编解码技术的一个组成部分。 变换系数块的扫 描有如下的应用: 视频编码端, 由视频编码端对经过变换后在变换域的二维 的变换系数块进行扫描, 使变换系数块中的二维的变换系数转变成一维的变 换系数序列。 在这一过程中, 需要根据当前变换系数块的变换方式选择扫描 顺序, 使扫描所得的一维变换系数序列更趋向于由大到小的排列, 从而提高 编码效率; 在视频解码端, 由视频解码端根据变换方式, 选择反扫描顺序将 一维变换系数序列转换成二维的变换系数块。  The scanning of transform coefficient blocks is an integral part of video coding and decoding techniques. The scanning of the transform coefficient block has the following applications: The video encoding end scans the transformed two-dimensional transform coefficient block in the transform domain by the video encoding end, and converts the two-dimensional transform coefficient in the transform coefficient block into one-dimensional A sequence of transform coefficients. In this process, the scanning order needs to be selected according to the transformation mode of the current transform coefficient block, so that the scanned one-dimensional transform coefficient sequence tends to be arranged from large to small, thereby improving coding efficiency; at the video decoding end, by video The decoding end converts the one-dimensional transform coefficient sequence into a two-dimensional transform coefficient block according to the transform mode and selects the reverse scan order.
目前在视频编码端, 在执行视频编码过程中, 首先对预测残差进行变换 操作得到变换系数, 在进行变换系数扫描之前, 还可以得到参考块信息, 以 及量化后的变换系数信息; 当高频变换系数非零时, 从以下三种扫描模式: Z 形扫描模式, 水平扫描模式以及竖直扫描模式中, 通过率失真优化准则选择 一组最优的扫描模式; 然后使用选择的扫描模式对变换系数进行扫描, 将扫 描模式的选择信息编入码流, 传递给解码端。  At the video encoding end, in the process of performing video encoding, first, transforming the prediction residual is performed to obtain transform coefficients, and before performing transform coefficient scanning, reference block information and quantized transform coefficient information may also be obtained; When the transform coefficient is non-zero, a set of optimal scan modes is selected by the rate distortion optimization criterion from the following three scan modes: Z-scan mode, horizontal scan mode, and vertical scan mode; then the selected scan mode pair transform is used. The coefficients are scanned, and the selection information of the scan mode is encoded into the code stream and transmitted to the decoding end.
由于在视频的编码端, 需要在三种扫描模式中进行模式的选择, 使编码 端复杂度高; 另外, 需要将扫描模式的选择信息编入码流, 影响了压缩编码 效率。  Since the mode is selected in the three scanning modes at the encoding end of the video, the complexity of the encoding end is high. In addition, the selection information of the scanning mode needs to be encoded into the code stream, which affects the compression coding efficiency.
发明内容 Summary of the invention
本发明实施例提供一种变换系数块的扫描方法和装置, 提高压缩编码效 率。 Embodiments of the present invention provide a scanning method and apparatus for transform coefficient blocks, which improve compression coding efficiency. Rate.
本发明实施例提供一种变换系数块的扫描方法, 包括:  An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序;  Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence;
对 Z形扫描顺序和选择的扫描顺序进行率失真优选处理得到优选扫描顺 序;  The rate distortion is preferably processed for the Z-scan sequence and the selected scan order to obtain a preferred scan order;
若优选的扫描顺序为 Z形扫描顺序则按照优选扫描顺序对所述待编码块 的变换系数块进行扫描;  If the preferred scanning order is a Z-shaped scanning order, the transform coefficient block of the block to be encoded is scanned according to a preferred scanning order;
若所述优选扫描顺序为 Z形扫描顺序以外的其它扫描顺序, 则将待编码块 的变换系数块重置为按预定规则的扫描顺序扫描的变换系数块; 按照所述预 定规则的扫描顺序对重置后的所述待编码块的变换系数块进行扫描;  If the preferred scan order is a scan order other than the Z-scan sequence, the transform coefficient block of the block to be encoded is reset to a transform coefficient block scanned in a scan order of a predetermined rule; Transmitting a block of transform coefficients of the block to be encoded after the reset;
将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入码流。 本发明实施例提供一种变换系数块的扫描方法, 包括:  The indication information for whether the scanning order used for scanning is the Z-shaped scanning order is encoded into the code stream. An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
解析码流得到指示信息,若接收到的码流的指示信息指示扫描顺序不是 Z 形扫描顺序, 则检测作为所述待解码块的参考的已解码块的纹理, 所述纹理 体现了所述待解码块的变换系数块在各方向上变换系数的变化规律; 从预置 的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的候选扫描顺 序包含 Z形扫描顺序以外的其它扫描顺序;  Parsing the code stream to obtain indication information, if the indication information of the received code stream indicates that the scanning order is not a zigzag scanning order, detecting a texture of the decoded block as a reference of the to-be-decoded block, the texture embodies the waiting Converting a transform coefficient block of the transform block to a variation rule of the transform coefficients in each of the directions; selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than the Z-shaped scan order Scanning order
按照预定规则的扫描顺序对待解码块的变换系数块进行扫描;  Scanning the transform coefficient block of the decoded block according to the scanning order of the predetermined rule;
若选择的扫描顺序与所述预定规则的扫描顺序不同, 则在扫描结束后根 据所述选择的扫描顺序以及预定规则的扫描顺序将待解码块的变换系数块重 置为可按照选择的扫描顺序扫描的变换系数块。  If the selected scan order is different from the scan order of the predetermined rule, the transform coefficient block of the block to be decoded is reset to be selectable according to the selected scan order according to the selected scan order and the scan order of the predetermined rule. Scanned transform coefficient block.
本发明实施例提供一种变换系数块的扫描方法, 包括:  An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的其它扫描顺序; 若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描顺序对所述待编码块 的变换系数块进行扫描; 若选择的扫描顺序为 Z形扫描顺序以外的其它扫描顺 序, 则将待编码块的变换系数块重置为符合 Z形扫描顺序的变换系数块; 按照 Z形扫描顺序对重置后的所述待编码块的变换系数块进行扫描。 Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order; If the selected scanning order is a zigzag scanning order, the transform coefficient blocks of the block to be encoded are scanned in a zigzag scanning order; if the selected scanning order is a scanning order other than the zigzag scanning order, the coding sequence is to be encoded The transform coefficient block of the block is reset to a transform coefficient block conforming to the zigzag scan order; the transform coefficient block of the reset block to be encoded is scanned in a zigzag scan order.
本发明实施例提供一种变换系数块的扫描方法, 包括:  An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述 待解码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的其它扫描顺序;  Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描顺序对所述待解码块 的变换系数块进行扫描;  If the selected scanning order is a Z-shaped scanning order, the transform coefficient blocks of the block to be decoded are scanned according to a Z-shaped scanning order;
若选择的扫描顺序为 Z形扫描顺序以外的其它扫描方式, 则将待解码块的 变换系数块从符合 Z形扫描顺序的变换系数块重置为符合所述选择的扫描顺 序的变换系数块; 按照所述选择的扫描方式对重置后的所述待解码块的变换 系数块进行扫描。  If the selected scanning order is a scanning mode other than the Z-shaped scanning order, the transform coefficient block of the block to be decoded is reset from the transform coefficient block conforming to the Z-shaped scanning order to the transform coefficient block conforming to the selected scanning order; The transformed transform coefficient block of the block to be decoded after being scanned is scanned according to the selected scanning manner.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第一检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第一选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序; 第一处理单元, 用于对预置的 Z形扫描顺序和选择的扫描顺序进行率失真 优选处理得到优选扫描顺序;  a first detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And a scan order corresponding to the texture is selected from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; and the first processing unit is configured to preset The Z-scan sequence and the selected scan order are subjected to rate distortion optimization processing to obtain a preferred scan order;
第一重置单元, 用于若所述优选扫描顺序为 Z形扫描顺序以外的其它扫描 顺序, 则将待编码块的变换系数块重置为按预定规则的扫描顺序扫描的变换 系数块;  a first reset unit, configured to reset a transform coefficient block of the block to be encoded to a transform coefficient block scanned in a scan order of a predetermined rule, if the preferred scan order is a scan order other than a Z-scan sequence;
第一扫描单元, 用于若优选的扫描顺序为 Z形扫描顺序则按照优选扫描顺 序对待编码块的变换系数块进行扫描; 若所述优选扫描顺序为 Z形扫描顺序以 外的其它扫描顺序, 则按照所述预定规则的扫描顺序对重置后的所述待编码 块的变换系数块进行扫描; 第一编码单元, 用于将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指 示信息编入码流。 a first scanning unit, configured to scan a transform coefficient block of the block to be coded according to a preferred scan order if the preferred scan order is a Z-scan sequence; if the preferred scan order is a scan order other than the Z-scan order, Scanning the transformed coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule; The first coding unit is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第二解析单元, 用于解析码流得到指示信息;  a second parsing unit, configured to parse the code stream to obtain indication information;
第二检测单元,用于若接收到的码流的指示信息指示扫描顺序不是 Z形扫 描顺序, 则检测作为待解码块的参考的已编码或解码块的纹理, 所述纹理体 现了所述待解码块的变换系数块在各方向上变换系数的变化规律;  a second detecting unit, configured to: if the indication information of the received code stream indicates that the scanning order is not a Z-shaped scanning order, detect a texture of the encoded or decoded block that is a reference of the block to be decoded, where the texture reflects the The variation law of the transform coefficient block of the decoding block in the transform coefficients of the respective parties;
第二选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序; 第二扫描单元, 用于按照预定规则的扫描顺序对待解码块的变换系数块 进行扫描;  a second selecting unit, configured to select a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; and the second scan unit uses Scanning the transform coefficient block of the decoded block in a scan order according to a predetermined rule;
第二重置单元, 用于若选择的扫描顺序与所述预定规则的扫描顺序不同, 则在扫描结束后根据所述选择的扫描顺序以及预定规则的扫描顺序将待解码 块的变换系数块重置为可按照选择的扫描顺序扫描的变换系数块。  a second reset unit, configured to: if the selected scan order is different from the scan order of the predetermined rule, the transform coefficient block of the block to be decoded is heavy according to the selected scan order and the scan order of the predetermined rule after the end of the scan Set to a block of transform coefficients that can be scanned in the selected scan order.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第三检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第三选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的 其它扫描顺序;  a third detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And a scan order corresponding to the texture is selected from a preset candidate scan order; the preset candidate scan order includes a zigzag scan order and other scan orders than a zigzag scan order;
第三重置单元, 用于若选择的扫描顺序为 Z形扫描顺序以外的其它扫描顺 序, 则将待编码块的变换系数块重置为符合 Z形扫描顺序的变换系数块;  a third reset unit, configured to reset a transform coefficient block of the block to be coded into a transform coefficient block conforming to a Z-shaped scan order if the selected scan order is other scan order than the Z-scan sequence;
第三扫描单元, 用于若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描 顺序对所述待编码块的变换系数块进行扫描; 或者, 按照 Z形扫描顺序对重置 后的所述待编码块的变换系数块进行扫描。  a third scanning unit, configured to: if the selected scanning order is a Z-shaped scanning order, scan the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; or, according to the Z-shaped scanning order, the resetted position The transform coefficient block of the coded block is scanned for scanning.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第四检测单元, 用于检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数块在各方向上变换系数的变化规 律; 第四选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的 其它扫描顺序; a fourth detecting unit, configured to detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients; a fourth selecting unit, configured to select a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than a Z-scan order;
第四重置单元, 用于若选择的扫描顺序为 Z形扫描顺序以外的其它扫描方 式, 则将待解码块的变换系数块从符合 Z形扫描顺序的变换系数块重置为符合 所述选择的扫描顺序的变换系数块;  a fourth reset unit, configured to reset the transform coefficient block of the block to be decoded from the transform coefficient block conforming to the Z-scan order to the selection if the selected scan order is other than the Z-scan order a transform coefficient block of the scan order;
第四扫描单元, 用于若选择的扫描顺序为 z形扫描顺序, 则按照 Z形扫描 顺序对所述待解码块的变换系数块进行扫描; 或者, 按照所述选择的扫描方 式对重置后的所述待编码块的变换系数块进行扫描。  a fourth scanning unit, configured to scan a transform coefficient block of the block to be decoded according to a zigzag scan order if the selected scan order is a z-scan sequence; or, after the reset according to the selected scan mode The transform coefficient block of the block to be encoded is scanned.
本发明实施例提供一种变换系数块的扫描方法, 包括:  An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
若所述纹理所对应的扫描顺序与预定规则的扫描顺序不一致, 则对待编 码块的残差数据块重置, 使所述残差数据块对应的变换系数块为按预定规则 扫描的变换系数块;  If the scan order corresponding to the texture does not match the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule. ;
按照优选扫描顺序对所述待编码块的变换系数块进行扫描, 所述优选扫 描顺序为对 Z形扫描顺序和预定规则的扫描顺序进行率失真优选处理得到的 扫描顺序;  The transform coefficient blocks of the block to be encoded are scanned in a preferred scan order, and the preferred scan order is a scan order obtained by performing rate distortion optimization processing on a Z-scan sequence and a predetermined rule scan order;
将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入码流。 本发明实施例提供一种变换系数块的扫描方法, 包括:  The indication information for whether the scanning order used for scanning is the Z-shaped scanning order is encoded into the code stream. An embodiment of the present invention provides a method for scanning a transform coefficient block, including:
解析码流得到指示信息, 码流的指示信息指示扫描顺序;  Parsing the code stream to obtain indication information, and the indication information of the code stream indicates a scanning order;
按照解析的扫描顺序对待解码块的变换系数块进行扫描;  Scanning the transform coefficient block of the decoded block according to the parsed scan order;
若码流的指示信息指示扫描顺序不是 Z形扫描, 则检测作为所述待解码块 的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数块在各 方向上变换系数的变化规律; 若所述纹理所对应的扫描顺序与所述预定规则 的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定 规则的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对应的变 换系数块为可按照预定规则的扫描顺序扫描的变换系数块。  If the indication information of the code stream indicates that the scan order is not a zigzag scan, detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects that the transform coefficient block of the block to be decoded is transformed in all directions a variation rule of the coefficient; if the scan order corresponding to the texture is different from the scan order of the predetermined rule, the block to be decoded is to be decoded according to the scan order corresponding to the texture and the scan order of the predetermined rule after the end of the inverse transform The difference data block is reset, and the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
本发明实施例提供一种变换系数块的扫描方法, 包括: 检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律; An embodiment of the present invention provides a method for scanning a transform coefficient block, including: Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
若所述纹理所对应的扫描顺序与预定规则的扫描顺序不一致, 则对待编 码块的残差数据块重置, 使所述残差数据块对应的变换系数块为按预定规则 扫描的变换系数块;  If the scan order corresponding to the texture does not match the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule. ;
按照预定规则的扫描顺序对所述待编码块的变换系数块进行扫描; 本发明实施例提供一种变换系数块的扫描方法, 包括:  Scanning a block of transform coefficients of the block to be coded according to a scan order of a predetermined rule. The embodiment of the present invention provides a method for scanning a block of transform coefficients, including:
按照预定规则的扫描顺序对待解码块的变换系数块进行扫描;  Scanning the transform coefficient block of the decoded block according to the scanning order of the predetermined rule;
检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述 待解码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
若所述纹理所对应的扫描顺序与所述预定规则的扫描顺序不同, 则在反 变换结束后根据所述纹理对应的扫描顺序以及预定规则的扫描顺序将待解码 块的残差数据块重置, 使所述残差数据块对应的变换系数块为可按照预定规 则的扫描顺序扫描的变换系数块。  If the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, the residual data block of the block to be decoded is reset according to the scan order corresponding to the texture and the scan order of the predetermined rule. And transforming the transform coefficient block corresponding to the residual data block into a transform coefficient block that can be scanned in a scan order of a predetermined rule.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第五检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第五重置单元, 用于若所述纹理所对应的扫描顺序与预定规则的扫描顺 序不一致, 则对待编码块的残差数据块重置, 使所述残差数据块对应的变换 系数块为按预定规则扫描的变换系数块;  a fifth detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And if the scanning order corresponding to the texture is inconsistent with the scanning order of the predetermined rule, the residual data block of the to-be-coded block is reset, so that the transform coefficient block corresponding to the residual data block is scanned according to a predetermined rule. Transform coefficient block;
第五处理单元, 用于对预置的 Z形扫描顺序和预定规则的扫描顺序进行率 失真优选处理得到优选扫描顺序;  a fifth processing unit, configured to perform a rate-distortion optimization process on the preset Z-scan sequence and the scan order of the predetermined rule to obtain a preferred scan order;
第五扫描单元, 用于按照优选扫描顺序对待编码块的变换系数块进行扫 描;  a fifth scanning unit, configured to scan a transform coefficient block of the block to be coded according to a preferred scan order;
第五编码单元, 用于将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指 示信息编入码流。  And a fifth coding unit, configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第六解析单元, 用于解析码流得到指示信息;  a sixth parsing unit, configured to parse the code stream to obtain indication information;
第六扫描单元, 用于按照解析的扫描顺序对待解码块的变换系数块进行 扫描; a sixth scanning unit, configured to perform a transform coefficient block of the block to be decoded according to the parsed scan order Scan
第六检测单元, 用于若码流的指示信息指示扫描顺序不是 Z形扫描, 则检 测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码 块的变换系数块在各方向上变换系数的变化规律;  a sixth detecting unit, configured to: if the indication information of the code stream indicates that the scanning order is not a zigzag scanning, detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects a transformation of the to-be-decoded block The variation law of the coefficient of transformation of the coefficient block in each direction;
第六重置单元, 用于若所述纹理所对应的扫描顺序与所述预定规则的扫 描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定规则 的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对应的变换系 数块为可按照预定规则的扫描顺序扫描的变换系数块。  a sixth reset unit, configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, the scan order corresponding to the texture and the scan order of the predetermined rule are to be decoded The residual data block of the block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第七检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第七重置单元, 用于若所述纹理所对应的扫描顺序与预定规则的扫描顺 序不一致, 则对待编码块的残差数据块重置, 使所述残差数据块对应的变换 系数块为按预定规则扫描的变换系数块;  a seventh detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient of the block to be encoded in each of the transform coefficients; And if the scanning order corresponding to the texture is inconsistent with the scanning order of the predetermined rule, the residual data block of the to-be-coded block is reset, so that the transform coefficient block corresponding to the residual data block is scanned according to a predetermined rule. Transform coefficient block;
第七扫描单元, 用于按照预定规则的扫描顺序对待编码块的变换系数块 进行扫描;  a seventh scanning unit, configured to scan a transform coefficient block of the coded block according to a scan order of a predetermined rule;
本发明实施例提供一种变换系数块的扫描装置, 包括:  An embodiment of the present invention provides a scanning device for transforming coefficient blocks, including:
第八扫描单元, 用于按照预定规则的扫描顺序对待解码块的变换系数块 进行扫描;  An eighth scanning unit, configured to scan a transform coefficient block of the block to be decoded according to a scan order of a predetermined rule;
第八检测单元, 用于检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数块在各方向上变换系数的变化规 律;  An eighth detecting unit, configured to detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
第八重置单元, 用于若所述纹理所对应的扫描顺序与所述预定规则的扫 描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定规则 的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对应的变换系 数块为可按照预定规则的扫描顺序扫描的变换系数块。  An eighth reset unit, configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the inverse transform ends, the scan order corresponding to the texture and the scan order of the predetermined rule are to be decoded The residual data block of the block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
上述技术方案只需要在预定的扫描顺序与 Z形扫描顺序间做选择,是二选 一的选择, 相比于在三选一的选择可以少使用一位来携带选择的信息, 因此 在将其编入编码头信息时, 会节省资源; 另外, 在选择的时候效率也更高。 附图说明 The above technical solution only needs to select between the predetermined scanning order and the Z-shaped scanning order, and is an alternative of two choices. Compared with the selection in the three-choice one, one less one can be used to carry the selected information, so When coding the encoding header information, it saves resources; in addition, it is more efficient when it is selected. DRAWINGS
为了更清楚地说明本发明实施例的技术方案, 下面将对实施例描述中所 需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发 明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的 前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the present invention, Those skilled in the art can also obtain other drawings based on these drawings without paying creative labor.
图 1为本发明实施例方法流程示意图;  1 is a schematic flowchart of a method according to an embodiment of the present invention;
图 2A为本发明实施例竖直纹理的扫描顺序示意图;  2A is a schematic diagram showing a scanning sequence of a vertical texture according to an embodiment of the present invention;
图 2B为本发明实施例水平纹理的扫描顺序示意图;  2B is a schematic diagram of a scanning sequence of a horizontal texture according to an embodiment of the present invention;
图 2C为本发明实施例斜纹理的扫描顺序示意图;  2C is a schematic diagram showing a scanning sequence of a diagonal texture according to an embodiment of the present invention;
图 3为本发明实施例方法流程示意图;  3 is a schematic flowchart of a method according to an embodiment of the present invention;
图 4为本发明实施例方法流程示意图;  4 is a schematic flowchart of a method according to an embodiment of the present invention;
图 5为本发明实施例方法流程示意图;  FIG. 5 is a schematic flowchart of a method according to an embodiment of the present invention;
图 6为本发明实施例装置结构示意图;  6 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
图 7为本发明实施例装置结构示意图;  7 is a schematic structural view of an apparatus according to an embodiment of the present invention;
图 8为本发明实施例装置结构示意图;  8 is a schematic structural view of an apparatus according to an embodiment of the present invention;
图 9为本发明实施例装置结构示意图;  9 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
图 10为本发明实施例方法流程示意图;  10 is a schematic flowchart of a method according to an embodiment of the present invention;
图 11为本发明实施例方法流程示意图;  11 is a schematic flowchart of a method according to an embodiment of the present invention;
图 12为本发明实施例方法流程示意图;  12 is a schematic flowchart of a method according to an embodiment of the present invention;
图 13为本发明实施例方法流程示意图;  13 is a schematic flowchart of a method according to an embodiment of the present invention;
图 14为本发明实施例装置结构示意图;  14 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
图 15为本发明实施例装置结构示意图;  Figure 15 is a schematic structural view of an apparatus according to an embodiment of the present invention;
图 16为本发明实施例装置结构示意图;  16 is a schematic structural diagram of an apparatus according to an embodiment of the present invention;
图 17为本发明实施例装置结构示意图。  FIG. 17 is a schematic structural diagram of an apparatus according to an embodiment of the present invention.
具体实施方式 detailed description
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 本发明实施例的编码端在帧间编码过程中, 对于每一待编码块, 从各种 帧间编码类型中根据率失真准则选择最优的帧间编码类型, 同时得到运动信 息, 由运动信息及已编码的重构帧信息, 得到待编码块的预测值, 对预测值 和待编码块的像素值做差, 得到残差值, 对残差值依次进行变换、 量化、 扫 描、 熵编码操作, 编入码流, 同时将运动信息编入码流, 完成编码过程。 以 下对编码和解码过程中的扫描进行具体说明。 本发明实施例提到的变换可以 是离散余弦变换(Discrete Cosine Transform, DCT ); 也可以是多变换技术, 例如 KL变换 ( Karhunen Loeve Transform, KLT )对此本发明实施例不予限定。 The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention. In the inter-coding process of the embodiment of the present invention, for each block to be encoded, an optimal inter-frame coding type is selected according to a rate-distortion criterion from various inter-coding types, and motion information is obtained at the same time, and motion information is obtained. And the encoded reconstructed frame information, obtains a predicted value of the block to be coded, and performs a difference between the predicted value and the pixel value of the block to be coded to obtain a residual value, and sequentially transforms, quantizes, scans, and entropy encodes the residual value , the code stream is programmed, and the motion information is programmed into the code stream to complete the encoding process. The scanning in the encoding and decoding process will be specifically described below. The transform mentioned in the embodiment of the present invention may be a Discrete Cosine Transform (DCT); or a multi-transformation technique, such as a KL transform (KLT), which is not limited in this embodiment of the present invention.
一种变换系数块的扫描方法, 本实施例方案可以在编码端执行, 如图 1所 示, 包括:  A scanning method of a transform coefficient block, which can be executed at the encoding end, as shown in FIG. 1, and includes:
101 : 检测作为待编码块的参考的已编码块的纹理, 上述纹理体现了上述 待编码块的变换系数块在各方向上变换系数的变化规律;  101: Detecting a texture of a coded block that is a reference of a block to be coded, where the texture reflects a variation rule of a transform coefficient block of the block to be coded in each of the transform coefficients;
上述 101属于一种物理推导, 作为参考的已编码的纹理近似于当前的待编 码块的纹理, 而待编码的纹理又近似于待编码的残差纹理, 变换系数的分布 规律与残差纹理密切相关。 更具体地, 上述纹理包括水平纹理、 竖直纹理和 斜纹理; 其中斜纹理也可以看作是无纹理。  The above 101 belongs to a physical derivation, and the encoded texture as a reference approximates the texture of the current block to be encoded, and the texture to be encoded is similar to the residual texture to be encoded, and the distribution law of the transform coefficients is closely related to the residual texture. Related. More specifically, the above texture includes a horizontal texture, a vertical texture, and a diagonal texture; wherein the oblique texture can also be regarded as no texture.
更具体地, 上述检测已解码块的纹理包括:  More specifically, the detecting the texture of the decoded block includes:
在执行帧间解码时, 计算变换系数块的水平方向上的水平梯度值和竖直 方向上的竖直梯度值; 水平梯度值为水平方向上各相邻像素点的差值的绝对 值的和, 竖直梯度值为竖直方向上各相邻像素点的差值的绝对值的和; 上述 作为参考的变换系数块即为上述已解码块的变化系数块;  When inter-frame decoding is performed, a horizontal gradient value in a horizontal direction of the transform coefficient block and a vertical gradient value in a vertical direction are calculated; the horizontal gradient value is a sum of absolute values of difference values of adjacent pixel points in the horizontal direction The vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction; the transform coefficient block as a reference is the coefficient of variation block of the decoded block;
若水平梯度值大于 N倍的竖直梯度值则确定纹理为竖直纹理,竖直梯度值 大于 N倍的水平梯度值则确定纹理为水平纹理, 否则确定纹理为斜纹理; 上述 N为第一预置值, N可以由分辨率宽度来确定, 例如分辨率宽度大于 1000时 N=2, 分辨率宽度小于 1000时 N=1.5; 以上 N的取值可以根据经验来确定, 具 体的取值本发明实施例对此不予限定。  If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; The preset value, N, can be determined by the resolution width. For example, when the resolution width is greater than 1000, N=2, and when the resolution width is less than 1000, N=1.5; the value of N above can be determined according to experience, and the specific value is The embodiment of the invention is not limited thereto.
在执行帧内解码时,若帧内预测模式方向的竖直方向的偏移量在 M以内则 确定纹理为竖直纹理,帧内预测模式方向的水平方向的偏移量在 M以内则确定 纹理为水平纹理, 否则确定纹理为斜纹理; 上述 M为第二预置值, M也可以由 分辨率宽度来确定, 例如设置成 5, 还可以设置成其他值例如 3、 4等, 对此本 发明实施例不予限定。 When intra-frame decoding is performed, if the offset of the vertical direction of the intra prediction mode direction is within M, the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is within M, the texture is determined. Is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the above M is the second preset value, and M can also be The resolution width is determined, for example, set to 5, and may be set to other values, such as 3, 4, etc., which are not limited in this embodiment of the present invention.
进一步地, 本发明实施例还提供了修正预置值的实现方式: 若已经解码 的块中, 水平纹理与竖直纹理的比值超过第三预置值则缩小 N的值, 若水平纹 理与竖直纹理的比值小于 N,则增大 N的值。第三预置值可以由以下方式得到, 通过对不同特点的变换系数的序列进行帧内编码, 统计水平、 竖直预测方向 的比例关系, 该比例关系即可以作为第三预置值。  Further, the embodiment of the present invention further provides an implementation manner of modifying the preset value: if the ratio of the horizontal texture to the vertical texture exceeds the third preset value in the block that has been decoded, the value of N is reduced, if the horizontal texture and the vertical If the ratio of the straight texture is less than N, the value of N is increased. The third preset value may be obtained by performing intra-frame coding on a sequence of transform coefficients of different characteristics, and calculating a proportional relationship between the horizontal and vertical prediction directions, and the proportional relationship may be used as the third preset value.
可选地, 若存在已编码块或解码块, 那么已经编码块或解码块的纹理则 是已知的, 此时可以利用这些信息减少运算量; 上述检测变换系数块的纹理 包括: 检测待解码块设定时域或空域距离内已经编码块或解码块的纹理, 将 检测到的纹理确定为变换系数块的纹理。  Optionally, if there is an encoded block or a decoded block, the texture of the already encoded block or the decoded block is known, and the information may be used to reduce the amount of operations; the texture of the detected transform coefficient block includes: detecting to be decoded The block sets the texture of the block or decoded block within the time domain or spatial domain distance, and determines the detected texture as the texture of the transform coefficient block.
102: 从预置的候选扫描顺序中选择与上述纹理对应的扫描顺序; 在本实 施例中预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序;  102: Select a scan order corresponding to the texture from the preset candidate scan order; in the embodiment, the preset candidate scan order includes a scan order other than the Z-scan order;
上述纹理对应的扫描顺序包括如图 2A〜图 2C所示的: 竖直纹理对应逐行 扫描的水平扫描顺序、 水平纹理对应逐列扫描的竖直扫描顺序、 斜纹理对应 Z 形顺序扫描的 Z形扫描顺序。 图 2A〜图 2C中以 4X4矩阵为例, 其中圓形代表变 换系数, 圓形下的数值表示变换系数其所在的坐标(即位置), 箭头方向表示 扫描方向, 即扫描顺序。 需要说明的是图 2C左边和矩阵和右边的矩阵分别代 表一种 Z形扫描顺序, Z形扫描顺序是可以自定义的, 所以可能的种类较多, 图 2C的举例也不是穷举; 因此本发明实施例对 Z形扫描顺序不予限定。  The scanning order corresponding to the above texture includes as shown in FIG. 2A to FIG. 2C: the vertical texture corresponds to the horizontal scanning order of the progressive scanning, the horizontal texture corresponds to the vertical scanning order of the column-by-column scanning, and the oblique texture corresponds to the Z-shaped sequential scanning Z. Shape scan order. In Fig. 2A to Fig. 2C, a 4X4 matrix is taken as an example, in which a circle represents a transformation coefficient, a numerical value under a circle represents a coordinate (i.e., a position) at which a transformation coefficient is located, and an arrow direction represents a scanning direction, that is, a scanning order. It should be noted that the matrix on the left side of FIG. 2C and the matrix on the right side respectively represent a Z-shaped scanning order, and the Z-shaped scanning order is self-definable, so there are many possible types, and the example of FIG. 2C is not exhaustive; The Z-shaped scanning sequence is not limited in the embodiment of the invention.
103: 对预置的 Z形扫描顺序和选择的扫描顺序进行率失真优选处理得到 优选扫描顺序;  103: performing rate distortion optimization processing on the preset Z-scan sequence and the selected scan order to obtain a preferred scan order;
104: 若优选的扫描顺序为 Z形扫描顺序则按照优选扫描顺序对待编码块 的变换系数块进行扫描; 若上述优选扫描顺序为 Z形扫描顺序以外的其它扫描 顺序, 则将待编码块的变换系数块重置为按预定规则的扫描顺序扫描的变换 系数块; 按照上述预定规则的扫描顺序对重置后的上述待编码块的变换系数 块进行扫描;  104: If the preferred scan order is a Z-scan sequence, the transform coefficient block of the block to be coded is scanned according to a preferred scan order; if the preferred scan order is a scan order other than the Z-scan order, the transform of the block to be coded is performed. Converting the coefficient block to a transform coefficient block scanned in a scan order of a predetermined rule; scanning the block of transform coefficients of the block to be encoded after the reset according to the scan order of the predetermined rule;
更具体地, 上述 104中, 若上述优选扫描顺序为 Z形扫描顺序以外的其它 扫描顺序, 则将待编码块的变换系数块重置为按预定规则的扫描顺序扫描的 变换系数块; 按照上述预定规则的扫描顺序对重置后的上述待编码块的变换 系数块进行扫描包括: More specifically, in the above 104, if the preferred scanning order is a scanning order other than the Z-shaped scanning order, the transform coefficient block of the block to be encoded is reset to be scanned in a scanning order of a predetermined rule. Transforming the coefficient block; scanning the transformed coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule includes:
若优选的扫描顺序为第一扫描顺序, 则将待编码块的变换系数转置, 按 照第二扫描顺序对转置后的上述待编码块的变换系数块进行扫描; 上述第一 扫描顺序与第二扫描顺序的扫描顺序是对称的;  If the preferred scan order is the first scan order, the transform coefficients of the block to be coded are transposed, and the transform coefficient blocks of the transposed block to be coded are scanned according to the second scan order; the first scan order and the first scan order The scanning order of the two scanning sequences is symmetrical;
若优选的扫描顺序为第二扫描顺序, 则按照第二扫描顺序对上述待编码 块的变换系数块进行扫描。  If the preferred scanning order is the second scanning order, the transform coefficient blocks of the block to be encoded are scanned in the second scanning order.
需要说明的是, 以上 "第一" 和 "第二" 用于区分两个具有对称关系的 扫描顺序, 不作其它限定, 例如: 水平扫描顺序和竖直扫描顺序之间就是两 个具有对称关系的扫描顺序, 若第一扫描顺序为水平扫描顺序则第二扫描顺 序为竖直扫描顺序, 若第一扫描顺序为竖直扫描顺序则第二扫描顺序为水平 扫描顺序。  It should be noted that the above "first" and "second" are used to distinguish two scanning sequences having a symmetric relationship, and are not otherwise limited. For example: between the horizontal scanning order and the vertical scanning order, there are two symmetric relationships. Scanning order, if the first scanning order is a horizontal scanning order, the second scanning order is a vertical scanning order, and if the first scanning order is a vertical scanning order, the second scanning order is a horizontal scanning order.
更具体地, 上述 104中, 将待编码块的变换系数块重置为按预定规则的扫 描顺序扫描的变换系数块; 按照上述预定规则的扫描顺序对重置后的上述待 编码块的变换系数块进行扫描包括: 则将待编码块的变换系数块重置为符合 Z 形扫描顺序的变换系数块; 按照 Z形扫描顺序对重置后的上述待编码块的变换 系数块进行扫描。 若采用本方法可以不用传递 105中的指示信息, 后续实施例 将详细说明。  More specifically, in the above 104, the transform coefficient block of the block to be coded is reset to a transform coefficient block scanned in a scan order of a predetermined rule; the transform coefficient of the reset block to be coded according to the scan order of the predetermined rule The scanning of the block includes: resetting the transform coefficient block of the block to be encoded into a transform coefficient block conforming to the Z-scan order; and scanning the transform coefficient block of the reset block to be encoded according to the Z-scan order. If the method is used, the indication information in 105 may not be transmitted, and the subsequent embodiments will be described in detail.
105: 将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入码 流。  105: The indication that the scan order used for scanning is the Z-scan order is programmed into the code stream.
以上实施方式, 只需要在预定的扫描顺序与 Z形扫描顺序间做选择, 是二 选一的选择, 相比于在三选一的选择可以少使用一位来携带选择的信息, 因 此在将其编入编码头信息时, 会节省资源; 另外, 在选择的时候效率也更高。 另外通过对变换系数矩阵转置的方式, 复用相同的熵编码模型可以提高编码 效率。  In the above embodiment, only the selection between the predetermined scanning order and the Z-shaped scanning order is required, and the selection is one of the alternatives, and the selected information can be used less than one in the selection of the three-choice one, so When it is programmed into the encoding header information, it saves resources; in addition, it is more efficient when it is selected. In addition, by multiplexing the transform coefficient matrix, multiplexing the same entropy coding model can improve the coding efficiency.
更具体地, 本实施例还提供了预置候选扫描顺序的实现方式的举例, 上 述预置候选扫描顺序包括:  More specifically, the embodiment further provides an example of an implementation manner of a preset candidate scan sequence, where the preset candidate scan sequence includes:
预先定义的扫描规则, 扫描规则确定了扫描的顺序; 或者, 预先统计两 个或两个以上的变换系数块各位置的变换系数为非零的次数, 按从大到小的 顺序排列各个非零次数对应的变换系数的位置, 将排列得到的上述变换系数 的位置的顺序确定为预置的候选扫描顺序。 a predefined scan rule, the scan rule determines the order of the scan; or, pre-statistically counts the number of transform coefficients of each position of two or more transform coefficient blocks to be non-zero, from large to small The positions of the transform coefficients corresponding to the respective non-zero numbers are sequentially arranged, and the order of the positions of the above-described transform coefficients obtained by the arrangement is determined as a preset candidate scan order.
在以上的预置候选扫描方式的举例的后一种实现方式本发明实施例给出 了一个举例说明: 在编码器中, 依据残差块的纹理, 量化残差可以分为三类: 水平纹理对应的量化残差、 竖直纹理对应的量化残差、 斜纹理对应的量化残 差; 确定扫描顺序的方式为: 建立与变换系数个数相同的计数器组(例如 4x4 变换则为 16个计数器), 然后用计数器进行计数, 具体为: 判断各个变换系数 上是否为零, 如果非零, 则对应位置的计数器加一; 检测的变换系数块的数 量达到设定的数量以后, 各个计数器均有其计数的数值; 此时可以从大到小 排列各个计数器的值, 将排列得到的上述变换系数的位置的顺序确定为预置 的候选扫描顺序。 使用该方法, 按照得到的顺序进行扫描时, 数值大的计数 器其所对应的变换系数位置会在扫描顺序中排在前面。  The latter implementation example of the above preset candidate scanning mode provides an example in the embodiment of the present invention: In the encoder, according to the texture of the residual block, the quantized residuals can be classified into three categories: horizontal texture The corresponding quantized residual, the quantized residual corresponding to the vertical texture, and the quantized residual corresponding to the oblique texture; the manner of determining the scanning order is: establishing a counter group with the same number of transform coefficients (for example, 16 counters for 4x4 transform) And then counting with a counter, specifically: determining whether each transform coefficient is zero, if non-zero, the corresponding position counter is incremented by one; after the detected number of transform coefficient blocks reaches a set number, each counter has its The value of the count; at this time, the values of the respective counters can be arranged from large to small, and the order of the positions of the above-described transform coefficients obtained by the arrangement can be determined as a preset candidate scan order. With this method, when scanning in the order obtained, the position of the corresponding transform coefficient of the counter with a large value will be ranked in the scanning order.
举例方案一、 以下对编码过程中的扫描环节进行具体说明:  Example 1: The following describes the scanning process in the encoding process:
A: 按照编码流程编码, 直到进行变换系数编码之前;  A: code according to the encoding process until the transform coefficient is encoded;
B: 若执行的是帧间编码(Inter ), 则对参考块纹理进行检测, 得到其纹 理(水平 Hor纹理、 竖直 ver纹理、 斜纹理); 若在执行的是帧内编码( Intra ) 的情况, 如果帧内预测模式( intra prediction mode, ipmode )的方向为 ver+/-5 , 其纹理为竖直纹理, 方向为 Hor+/-5 , 其纹理为水平纹理, 其余情况为斜纹理。 本实施例中设置的偏移量是 5 , 当然还可以设置成其他值, 对此本发明实施例 不予限定。 根据得到的纹理从预置的候选扫描顺序中选择与上述纹理对应的 扫描顺序。  B: If inter-frame coding (Inter) is performed, the reference block texture is detected to obtain its texture (horizonous Hor texture, vertical ver texture, oblique texture); if intra-frame coding (Intra) is performed In the case, if the direction of the intra prediction mode (ipmode) is ver +/- 5, the texture is a vertical texture with a direction of Hor +/- 5, the texture is a horizontal texture, and the rest is a diagonal texture. The offset set in this embodiment is 5, and may of course be set to other values, which is not limited in this embodiment of the present invention. A scan order corresponding to the above texture is selected from the preset candidate scan order based on the obtained texture.
上述 B中的检测方法可以是:  The detection method in the above B can be:
B 1: 确定检测步长。 该步骤为不同变换单元( Transform Unit , TU )设置 不同的检测步长, 例如 TU = 4时, 步长为 1 , TU = 8时, 步长为 1 , TU = 16 时, 步长为 2, TU = 32时, 步长为 4, 也可以所有大小的 TU对应步长均为 1 ;  B 1: Determine the detection step size. This step sets different detection steps for different Transform Units (TUs). For example, when TU = 4, the step size is 1, when TU = 8, the step size is 1, and when TU = 16, the step size is 2. When TU = 32, the step size is 4, and the TUs of all sizes can be 1 step;
B2: 对参考块(即作为参考的变换系数块) 中, 水平方向相邻检测步长 的每两个像素点求差值; 累加差值的绝对值得到水平梯度值; B2: for a reference block (ie, a transform coefficient block as a reference), a difference is obtained for every two pixel points of the adjacent detection step in the horizontal direction; an absolute value of the accumulated difference value is obtained as a horizontal gradient value;
B3 : 对参考块中, 竖直方向相邻检测步长的每两个像素点求差值; 累加 差值的绝对值得到竖直梯度值; B3: for each pixel point of the adjacent detection step in the vertical direction in the reference block, the difference is obtained; The absolute value of the difference gives a vertical gradient value;
B4: 如果水平梯度值大于 N倍的竖直梯度值, 则确定其纹理为竖直纹理; 如果竖直梯度值大于 N倍的水平梯度值, 则确定其纹理为水平纹理; 其它情况 为斜纹理; B4之后, 还可以进一步地根据已编码块中的水平、 竖直、 斜纹理 比例分布, 判断阈值 N是否需要更新, 判断方式是判断水平梯度值与竖直梯度 值的比例是否超过预置值, 若是, 则增大预置值, 否, 则缩小预置值。 (其中 预置值由以下方式得到, 通过对不同特点的变换系数的序列进行帧内编码, 统计水平、 竖直预测方向的比例关系, 该比例关系即可以作为预置值。 步骤 C 是对预置值的一个自动修正的过程, 该过程并不是必须执行的步骤。  B4: If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture; if the vertical gradient value is greater than N times the horizontal gradient value, the texture is determined to be a horizontal texture; After B4, it is further determined whether the threshold N needs to be updated according to the horizontal, vertical, and oblique texture ratio distribution in the coded block, and the determination manner is to determine whether the ratio of the horizontal gradient value to the vertical gradient value exceeds a preset value. If yes, increase the preset value, otherwise, decrease the preset value. (The preset value is obtained by the following method: by intra-coding the sequence of transform coefficients with different characteristics, and the proportional relationship between the statistical level and the vertical prediction direction, the proportional relationship can be used as the preset value. Step C is the pre-predetermined value An automatic correction process for setting, which is not a step that must be performed.
另外, 对于以上编码过程中的步骤 B检测的方法可以有替代的方案: 检测 待解码块设定时域或空域的距离内已经编码块或解码块的纹理, 将检测到的 纹理确定为作为待解码块的变换系数块的纹理。 更具体地, 例如将检测待解 码块周边(上、 左、 左上、 右上、 左下) 的已解码块的纹理作为当前待解码 块变换系数块的纹理。  In addition, there may be an alternative to the method of step B detection in the above encoding process: detecting the texture of the already encoded block or the decoded block within the distance of the time domain or the spatial domain to be decoded, and determining the detected texture as the waiting The texture of the transform coefficient block of the decoded block. More specifically, for example, the texture of the decoded block of the periphery of the block to be decoded (upper, left, upper left, upper right, lower left) is detected as the texture of the block of the current transform block to be decoded.
C: 对预置的 Z形扫描顺序和选择的扫描顺序进行率失真优选处理得到优 选扫描顺序;  C: performing rate distortion optimization processing on the preset Z-scan sequence and the selected scan order to obtain a preferred scan order;
D: 判断优选的扫描顺序是否为 Z形扫描顺序, 如果是, 则执行 G, 如果 否, 则执行 E;  D: determining whether the preferred scanning order is a Z-shaped scanning order, if yes, executing G, and if not, executing E;
E: 如果扫描顺序为竖直, 则将变换系数转置; 如果扫描顺序为水平, 继 续;  E: If the scan order is vertical, the transform coefficients are transposed; if the scan order is horizontal, continue;
F: 按照水平扫描顺序及相关熵编码模型对待扫描的变换系数块进行扫 描, 然后继续后续的编码过程。  F: Scan the transform coefficient block to be scanned according to the horizontal scanning order and the related entropy coding model, and then continue the subsequent encoding process.
G:按照 Z形扫描顺序及相关熵编码模型对待扫描的变换系数块进行编码、 扫描, 然后继续后续的编码过程。  G: encodes and scans the transform coefficient block to be scanned according to the Z-scan order and the related entropy coding model, and then continues the subsequent encoding process.
H: 将上述进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入 码流。 本步骤可以在步骤 G或 F执行过程中进行。 可以理解的是, 编码完成后 会将编码的结果(码流)发送给解码端, 对此本发明实施例其他位置不—— 说明。  H: The above-mentioned scan sequence used for scanning is programmed into the code stream for the indication of the Z-scan order. This step can be performed during the execution of step G or F. It can be understood that after the encoding is completed, the encoded result (code stream) is sent to the decoding end, and other positions of the embodiment of the present invention are not described.
对应的, 本发明实施例还提供了在解码端执行的一种变换系数块的扫描 方法, 如图 3所示, 包括: Correspondingly, the embodiment of the present invention further provides scanning of a transform coefficient block performed at the decoding end. The method, as shown in Figure 3, includes:
301 : 解析码流得到指示信息;  301: parsing the code stream to obtain indication information;
302: 若接收到的码流的指示信息指示扫描顺序是 Z形扫描顺序, 按照 Z 形扫描顺序对待解码块的变换系数块进行扫描; 扫描的流程结束。  302: If the indication information of the received code stream indicates that the scanning order is a Z-shaped scanning order, the transform coefficient block of the block to be decoded is scanned according to the Z-shaped scanning sequence; the scanning process ends.
303 : 若接收到的码流的指示信息指示扫描顺序不是 Z形扫描顺序, 则检 测作为上述待解码块的参考的已解码块的纹理, 上述纹理体现了上述待解码 块的变换系数块在各方向上变换系数的变化规律; 从预置的候选扫描顺序中 选择与上述纹理对应的扫描顺序; 本实施例中上述预置的候选扫描顺序包含 Z 形扫描顺序以外的其它扫描顺序;  303: If the indication information of the received code stream indicates that the scanning order is not a Z-shaped scanning order, detecting a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects the transform coefficient block of the to-be-decoded block in each a change rule of the transform coefficient in the direction; selecting a scan order corresponding to the texture from the preset candidate scan order; in the embodiment, the preset candidate scan order includes a scan order other than the Z scan order;
304: 按照预定规则的扫描顺序对待解码块的变换系数块进行扫描; 若选 择的扫描顺序与上述预定规则的扫描顺序相同, 扫描的流程结束。  304: Scan the transform coefficient block of the decoded block according to a predetermined scanning order; if the selected scanning order is the same as the scanning order of the predetermined rule, the scanning process ends.
305: 若选择的扫描顺序与上述预定规则的扫描顺序不同, 则在扫描结束 后根据上述选择的扫描顺序以及预定规则的扫描顺序将待解码块的变换系数 块重置为可按照选择的扫描顺序扫描的变换系数块。 可以理解的是, 本实施 例与编码端对应的, 那么上述待解码块的变换系数块曾经经过编码端按照上 述预定规则重置过。  305: If the selected scan order is different from the scan order of the predetermined rule, resetting the transform coefficient block of the block to be decoded according to the selected scan order and the scan order of the predetermined rule after the end of the scan may be performed according to the selected scan order. Scanned transform coefficient block. It can be understood that, in this embodiment, corresponding to the encoding end, the transform coefficient block of the block to be decoded is once reset by the encoding end according to the predetermined rule.
更具体地, 上述按照预定规则的扫描顺序对待解码块的变换系数块进行 扫描; 若选择的扫描顺序与上述预定规则的扫描顺序不同, 则在扫描结束后 根据上述选择的扫描顺序以及预定规则的扫描顺序将待解码块的变换系数块 重置为可按照选择的扫描顺序扫描的变换系数块包括:  More specifically, the transform coefficient block of the block to be decoded is scanned according to the scan order of the predetermined rule; if the scan order selected is different from the scan order of the predetermined rule, after the scan ends, according to the selected scan order and the predetermined rule The scan order resets the transform coefficient block of the block to be decoded to a transform coefficient block that can be scanned in the selected scan order, including:
若选择的扫描顺序为第一扫描顺序, 按照第二扫描顺序上述待解码块的 变换系数块进行扫描; 扫描完成后将待解码块的变换系数转置; 上述第一扫 描顺序与第二扫描顺序的扫描顺序是对称的, 第二扫描顺序为上述预定规则 的扫描顺序。  If the selected scan order is the first scan order, scan the transform coefficient block of the block to be decoded according to the second scan order; after the scan is completed, transform coefficients of the block to be decoded are transposed; the first scan order and the second scan order The scanning order is symmetrical, and the second scanning order is the scanning order of the above predetermined rules.
举例方案二、 解码过程与编码过程扫描的方法类似:  Example 2: The decoding process is similar to the scanning process of the encoding process:
A: 按照解码流程解码, 直到进行变换系数解析之前;  A: Decode according to the decoding process until the transform coefficient is parsed;
B: 解析码流, 得到指示信息, 该指示信息即编码过程的步骤 H中的指示 信息; 判断指示信息是否指示扫描顺序为 Z形扫描顺序; 若是, 执行 E; 否则 执行 C; C: 本步骤可以参考举例方案一的步骤 B, 根据得到的纹理从预置的候选 扫描顺序中选择与上述纹理对应的扫描顺序, 然后执行 D; B: parsing the code stream, obtaining indication information, that is, the indication information in step H of the encoding process; determining whether the indication information indicates that the scanning order is a zigzag scanning order; if yes, executing E; otherwise executing C; C: This step can refer to step B of the first scheme, according to the obtained texture, select the scan order corresponding to the above texture from the preset candidate scan order, and then execute D;
D: 如果纹理方向对应竖直扫描顺序, 则按照水平扫描顺序及相关熵编码 模型对待扫描的变换系数块进行解析、 扫描, 然后对变换系数转置, 继续后 续的解码过程; 如果纹理方向对应水平扫描顺序, 则按照水平扫描顺序及相 关熵编码模型对待扫描的变换系数块进行解析、 扫描, 继续后续的解码过程; D: If the texture direction corresponds to the vertical scanning order, the transform coefficient blocks to be scanned are parsed and scanned according to the horizontal scanning order and the related entropy coding model, and then the transform coefficients are transposed to continue the subsequent decoding process; if the texture direction corresponds to the horizontal level In the scanning sequence, the transform coefficient blocks to be scanned are parsed and scanned according to the horizontal scanning order and the related entropy coding model, and the subsequent decoding process is continued;
E:按照 Z形扫描顺序及相关熵编码模型对待扫描的变换系数块进行解析、 扫描, 然后继续后续的解码过程。 E: parsing and scanning the transform coefficient block to be scanned according to the Z-scan sequence and the related entropy coding model, and then continuing the subsequent decoding process.
以上举例方案一和二, 只需要在水平和竖直的扫描顺序与 Z形扫描顺序间 做选择, 是二选一的选择, 相比于在水平、 竖直以及 Z形扫描顺序 (zig-zag ) 之间的三选一的选择可以少使用一位来携带选择的信息, 因此在将其编入编 码头信息时, 会节省资源; 另外, 在选择的时候效率也更高。  The above example ones and twos only need to choose between the horizontal and vertical scanning order and the zigzag scanning order, which is the alternative of the two, one compared to the horizontal, vertical and zigzag scanning order (zig-zag) The choice between three choices can use one less to carry the selected information, so it saves resources when it is coded into the encoding header information; in addition, it is more efficient at the time of selection.
本发明实施例还给出了另一种变换系数块的扫描方法, 该方案在编码设 备中执行, 在以上两个方案的基础之上更进一步地不用传递指示信息, 可以 进一步地提高编码效率; 如图 4所示, 包括:  Another embodiment of the present invention further provides a scanning method for a transform coefficient block, which is implemented in an encoding device. Further, the instruction information is not further transmitted on the basis of the above two schemes, and the coding efficiency can be further improved. As shown in Figure 4, it includes:
401 : 检测作为待编码块的参考的已编码块的纹理, 上述纹理体现了上述 待编码块的变换系数块在各方向上变换系数的变化规律;  401: Detecting a texture of a coded block that is a reference of a block to be coded, where the texture embodies a variation rule of a transform coefficient block of the block to be coded in each of the upward transform coefficients;
402: 从预置的候选扫描顺序中选择与上述纹理对应的扫描顺序; 本实施 例中预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的其它扫描 顺序;  402: Select a scan order corresponding to the texture from the preset candidate scan order; the candidate scan order preset in this embodiment includes a Z-scan order and a scan order other than the Z-scan order;
403: 若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描顺序对上述待编 码块的变换系数块进行扫描; 若选择的扫描顺序为 Z形扫描顺序以外的其它扫 描顺序, 则将待编码块的变换系数块重置为符合 Z形扫描顺序的变换系数块; 按照 Z形扫描顺序对重置后的上述待编码块的变换系数块进行扫描。  403: If the selected scanning order is a Z-shaped scanning order, scanning the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; if the selected scanning order is a scanning order other than the Z-shaped scanning order, The transform coefficient block of the coded block is reset to a transform coefficient block conforming to the zigzag scan order; the transform coefficient block of the reset block to be coded is scanned in a zigzag scan order.
对应的, 本发明实施例还提供了另一种变换系数块的扫描方法, 本方案 在解码设备中执行, 不用传递指示信息, 可以进一步地提高编码效率; 如图 5 所示, 包括:  Correspondingly, the embodiment of the present invention further provides another method for scanning a transform coefficient block. The solution is executed in a decoding device, and the coding efficiency is further improved without transmitting the indication information. As shown in FIG. 5, the method includes:
举例方案一、 以下对编码过程中的扫描环节进行具体说明:  Example 1: The following describes the scanning process in the encoding process:
以下对编码过程中的扫描环节进行具体说明: A: 按照编码流程编码, 直到进行变换系数编码之前; The following describes the scanning process in the encoding process: A: code according to the encoding process until the transform coefficient is encoded;
B: 本步骤可以参考举例方案一的步骤 B, 根据得到的纹理从预置的候选 扫描顺序中选择与上述纹理对应的扫描顺序;  B: This step can refer to step B of the first scheme, and select a scan order corresponding to the texture from the preset candidate scan order according to the obtained texture;
C: 按照选定的扫描顺序将变换系数的位置重置为符合 Z形扫描顺序的位 置关系;  C: reset the position of the transform coefficient to the positional relationship in accordance with the Z-scan order according to the selected scan order;
D:按照 Z形扫描顺序及相关熵编码模型对待扫描的变换系数块进行编码、 扫描, 然后继续后续的编码过程。  D: Encoding and scanning the transform coefficient block to be scanned according to the Z-scan sequence and the related entropy coding model, and then continuing the subsequent encoding process.
501 : 检测作为上述待解码块的参考的已解码块的纹理, 上述纹理体现了 上述待解码块的变换系数块在各方向上变换系数的变化规律;  501: Detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients.
502: 从预置的候选扫描顺序中选择与上述纹理对应的扫描顺序; 本实施 例中预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的其它扫描 顺序;  502: Select a scan order corresponding to the texture from the preset candidate scan order; the candidate scan order preset in this embodiment includes a Z-scan order and a scan order other than the Z-scan order;
503: 若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描顺序对上述待解 码块的变换系数块进行扫描;  503: If the selected scanning order is a Z-shaped scanning order, scanning the transform coefficient block of the to-be-decoded block according to a Z-shaped scanning order;
504: 若选择的扫描顺序为 Z形扫描顺序以外的其它扫描方式, 则将待解 码块的变换系数块从符合 Z形扫描顺序的变换系数块重置为符合上述选择的 扫描顺序的变换系数块; 按照上述选择的扫描方式对重置后的上述待解码块 的变换系数块进行扫描。  504: If the selected scanning order is other scanning modes than the Z-shaped scanning order, the transform coefficient block of the block to be decoded is reset from the transform coefficient block conforming to the Z-shaped scanning order to the transform coefficient block conforming to the selected scanning order. And translating the transformed coefficient block of the block to be decoded after the reset according to the scanning mode selected above.
对应的解码过程与编码过程扫描的方法类似:  The corresponding decoding process is similar to the scanning process of the encoding process:
A: 按照解码流程解码, 直到进行变换系数解析之前;  A: Decode according to the decoding process until the transform coefficient is parsed;
B:按照 Z形扫描顺序及相关熵编码模型对待扫描的变换系数块进行解析、 扫描;  B: parsing and scanning the transform coefficient block to be scanned according to the Z-shaped scanning order and the related entropy coding model;
C: 本步骤可以参考举例方案一的步骤 B, 根据得到的纹理从预置的候选 扫描顺序中选择与上述纹理对应的扫描顺序;  C: In this step, referring to step B of the first scheme, the scan order corresponding to the texture is selected from the preset candidate scan order according to the obtained texture;
D: 如果纹理方向对应竖直扫描顺序, 将变换系数的位置重置为符合竖直 扫描顺序的位置关系; 如果纹理方向对应水平扫描顺序, 将变换系数的位置 重置为符合水平扫描顺序的位置关系; 如果纹理方向对应 Z形扫描顺序, 则不 进行该步骤操作;  D: If the texture direction corresponds to the vertical scanning order, the position of the transform coefficient is reset to a positional relationship in accordance with the vertical scanning order; if the texture direction corresponds to the horizontal scanning order, the position of the transform coefficient is reset to a position conforming to the horizontal scanning order Relationship; if the texture direction corresponds to the zigzag scanning order, the step operation is not performed;
E: 继续后续的解码过程; 对于单扫描方案而言变换系数的扫描顺序(即第一个扫描, 第二个扫描, 第三个扫描…)对应着唯一的频域位置关系(即(0, 0 ), ( 0, 1 ), ( 1 , 0 ) ... ), 所以在解析后扫描的点时可以根据其频域周边已经解析的点的数值来为其赋 予一个可能的值(即建立熵编码模型, 可以看作是一种预测, 从而使编码效 率更高)。对于多扫描方案来说, 由于在解析变换系数前已经确定了扫描顺序, 即已经确定了扫描顺序与频域位置的关系, 所以对于每一种扫描顺序依然可 以按照单扫描方案的方式进行。 本发明实施例在解析变换系数之前, 可以判 定是否是 zig-zag而无法区分水平和竖直,所以如果不做任何操作,在非 zig-zag 时, 无法确定扫描顺序与频域位置的关系, 也就没有办法进行熵编码模型的 建立, 也就无法解码。 上述方案通过重置的方式解决了这一问题。 E: continue the subsequent decoding process; For a single scan scheme, the scan order of the transform coefficients (ie, the first scan, the second scan, the third scan...) corresponds to a unique frequency domain positional relationship (ie, (0, 0), (0, 1) , ( 1 , 0 ) ... ), so when parsing the scanned point, it can give it a possible value according to the value of the point that has been resolved around the frequency domain (ie, establish an entropy coding model, which can be regarded as A prediction that makes coding more efficient). For the multi-scanning scheme, since the scanning order has been determined before the transform coefficients are resolved, that is, the relationship between the scanning order and the frequency domain position has been determined, each scanning order can still be performed in a single scanning scheme. Before analyzing the transform coefficients, the embodiment of the present invention can determine whether it is zig-zag and cannot distinguish between horizontal and vertical, so if no operation is performed, in the non-zig-zag, the relationship between the scan order and the frequency domain position cannot be determined. There is no way to establish an entropy coding model, and it cannot be decoded. The above solution solves this problem by resetting.
以下是对本发明实施例提供的方案进行的仿真实验的结果。  The following are the results of simulation experiments conducted on the scheme provided by the embodiment of the present invention.
则试条件: JCTVC high efficiency low delay test condition;  Test condition: JCTVC high efficiency low delay test condition;
测试结果: 其中第三列是集成于 TMuC (新一代视频编码测试软件平台) 技术方案的结果, 第四列是本发明实施例方案的结果, 可以看出本发明实施 例方案效率较高。  Test results: The third column is the result of the technical solution integrated in the TMuC (New Generation Video Coding Test Software Platform), and the fourth column is the result of the solution of the embodiment of the present invention. It can be seen that the embodiment of the present invention has a high efficiency.
Class Name Sequence Name HHI BD Rate (in HW BD Rate (in (类名) (序列名) %) %)  Class Name Sequence Name HHI BD Rate (in HW BD Rate (in (class name) (sequence name) %) %)
Kimono -0.0 -0.7  Kimono -0.0 -0.7
ParkScene -0.1 -0.7  ParkScene -0.1 -0.7
Class B Cactus -0.3 -0.9  Class B Cactus -0.3 -0.9
BasketballDrive -0.3 -2.5  BasketballDrive -0.3 -2.5
BQTerrace -0.2 -2.1  BQTerrace -0.2 -2.1
BasketballDrill -0.2 -0.7  BasketballDrill -0.2 -0.7
BQMall -0.3 -2.1  BQMall -0.3 -2.1
Class C  Class C
Partyscene -0.2 -1.0  Partyscene -0.2 -1.0
RaceHorses -0.2 -0.6  RaceHorses -0.2 -0.6
Class D BasketballPass -0.4 -1.8  Class D BasketballPass -0.4 -1.8
BQSquare -0.3 -0.8 BlowingBubbles -0.1 -1.0 BQSquare -0.3 -0.8 BlowingBubbles -0.1 -1.0
RaceHorses -0.2 -0.8  RaceHorses -0.2 -0.8
Vidyol -0.2 -1.2  Vidyol -0.2 -1.2
Class E Vidyo3 -0.2 -0.8  Class E Vidyo3 -0.2 -0.8
Vidyo4 -0.2 -1.2  Vidyo4 -0.2 -1.2
Class B -0.2 -1.4  Class B -0.2 -1.4
Class C -0.2 -1.1  Class C -0.2 -1.1
Average Class D -0.3 -1.1  Average Class D -0.3 -1.1
Class E -0.2 -1.1  Class E -0.2 -1.1
All -0.2 -1.2  All -0.2 -1.2
一种变换系数块的扫描装置, 如图 6上述, 包括:  A scanning device for transform coefficient blocks, as described above in FIG. 6, includes:
第一检测单元 601 , 用于检测作为待编码块的参考的已编码块的纹理, 上 述纹理体现了上述待编码块的变换系数块在各方向上变换系数的变化规律; 第一选择单元 602, 用于从预置的候选扫描顺序中选择与上述纹理对应的 扫描顺序; 上述预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序; 第一处理单元 603 , 用于对预置的 Z形扫描顺序和选择的扫描顺序进行率 失真优选处理得到优选扫描顺序;  a first detecting unit 601, configured to detect a texture of a coded block that is a reference of a block to be coded, where the texture reflects a variation rule of a transform coefficient block of the block to be coded in each of the transform coefficients; the first selecting unit 602, For selecting a scan order corresponding to the texture from the preset candidate scan order; the preset candidate scan order includes a scan order other than the Z-scan order; and the first processing unit 603 is configured to preset the Z The shape scan order and the selected scan order are subjected to rate distortion optimization processing to obtain a preferred scan order;
第一重置单元 604, 用于若上述优选扫描顺序为 Z形扫描顺序以外的其它 扫描顺序, 则将待编码块的变换系数块重置为按预定规则的扫描顺序扫描的 变换系数块;  The first reset unit 604 is configured to: if the preferred scan order is a scan order other than the Z-scan sequence, reset the transform coefficient block of the block to be coded into a transform coefficient block scanned in a scan order of a predetermined rule;
第一扫描单元 605 , 用于若优选的扫描顺序为 Z形扫描顺序则按照优选扫 描顺序对待编码块的变换系数块进行扫描; 若上述优选扫描顺序为 Z形扫描顺 序以外的其它扫描顺序, 则按照上述预定规则的扫描顺序对重置后的上述待 编码块的变换系数块进行扫描;  The first scanning unit 605 is configured to scan the transform coefficient block of the block to be coded according to the preferred scan order if the preferred scan order is a Z-scan sequence; if the preferred scan order is a scan order other than the Z-scan order, Scanning the transform coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule;
第一编码单元 606, 用于将进行扫描使用的扫描顺序是否为 Z形扫描顺序 的指示信息编入码流。  The first coding unit 606 is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
一种变换系数块的扫描装置, 如图 7所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 7, includes:
第二解析单元 701 , 用于解析码流得到指示信息;  a second parsing unit 701, configured to parse the code stream to obtain indication information;
第二检测单元 702, 用于若接收到的码流的指示信息指示扫描顺序不是 Z 形扫描顺序, 则检测作为待解码块的参考的已编码或解码块的纹理, 上述纹 理体现了上述待解码块的变换系数块在各方向上变换系数的变化规律; The second detecting unit 702 is configured to: if the received information of the code stream indicates that the scanning order is not Z Forming a scanning sequence, detecting a texture of the encoded or decoded block as a reference of the block to be decoded, wherein the texture reflects a variation rule of the transform coefficient block of the block to be decoded in each of the transform coefficients;
第二选择单元 703 , 用于从预置的候选扫描顺序中选择与上述纹理对应的 扫描顺序; 上述预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序; 第二扫描单元 704, 用于按照预定规则的扫描顺序对待解码块的变换系数 块进行扫描;  a second selecting unit 703, configured to select a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; and the second scan unit 704 uses Scanning the transform coefficient block of the decoded block in a scan order according to a predetermined rule;
第二重置单元 705 , 用于若选择的扫描顺序与上述预定规则的扫描顺序不 同, 则在扫描结束后根据上述选择的扫描顺序以及预定规则的扫描顺序将待 解码块的变换系数块重置为可按照选择的扫描顺序扫描的变换系数块。  a second reset unit 705, configured to: if the selected scan order is different from the scan order of the predetermined rule, reset the transform coefficient block of the block to be decoded according to the selected scan order and the scan order of the predetermined rule after the scan ends A block of transform coefficients that can be scanned in the selected scan order.
一种变换系数块的扫描装置, 如图 8所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 8, includes:
第三检测单元 801 , 用于检测作为待编码块的参考的已编码块的纹理, 上 述纹理体现了上述待编码块的变换系数块在各方向上变换系数的变化规律; 第三选择单元 802, 用于从预置的候选扫描顺序中选择与上述纹理对应的 扫描顺序; 上述预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外 的其它扫描顺序;  a third detecting unit 801, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient of the block to be encoded in each of the transform coefficients; the third selecting unit 802, And a scan order corresponding to the texture is selected from the preset candidate scan sequences; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
第三重置单元 803 , 用于若选择的扫描顺序为 Z形扫描顺序以外的其它扫 描顺序, 则将待编码块的变换系数块重置为符合 Z形扫描顺序的变换系数块; 第三扫描单元 804, 用于若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫 描顺序对上述待编码块的变换系数块进行扫描; 或者, 按照 Z形扫描顺序对重 置后的上述待编码块的变换系数块进行扫描。  a third reset unit 803, configured to: if the selected scan order is a scan order other than the Z-scan sequence, reset the transform coefficient block of the block to be coded into a transform coefficient block conforming to the Z-scan order; The unit 804 is configured to: if the selected scanning order is a Z-shaped scanning order, scan the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; or: perform the resetting the to-be-coded block according to a Z-shaped scanning order. The transform coefficient block is scanned.
一种变换系数块的扫描装置, 如图 9所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 9, includes:
第四检测单元 901 , 用于检测作为上述待解码块的参考的已解码块的纹 理, 上述纹理体现了上述待解码块的变换系数块在各方向上变换系数的变化 规律;  a fourth detecting unit 901, configured to detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects a variation rule of the transform coefficient block of the to-be-decoded block in each of the upward transform coefficients;
第四选择单元 902, 用于从预置的候选扫描顺序中选择与上述纹理对应的 扫描顺序; 上述预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外 的其它扫描顺序;  The fourth selecting unit 902 is configured to select a scan order corresponding to the texture from the preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
第四重置单元 903 , 用于若选择的扫描顺序为 Z形扫描顺序以外的其它扫 描方式, 则将待解码块的变换系数块从符合 Z形扫描顺序的变换系数块重置为 符合上述选择的扫描顺序的变换系数块; The fourth reset unit 903 is configured to reset the transform coefficient block of the block to be decoded from the transform coefficient block conforming to the zigzag scan order to another scan mode if the selected scan order is a zigzag scan order. a transform coefficient block that conforms to the scan order of the above selection;
第四扫描单元 904, 用于若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫 描顺序对上述待解码块的变换系数块进行扫描; 或者, 按照上述选择的扫描 方式对重置后的上述待编码块的变换系数块进行扫描。  a fourth scanning unit 904, configured to: if the selected scanning order is a Z-shaped scanning order, scan the transform coefficient block of the to-be-decoded block according to a Z-shaped scanning order; or, according to the selected scanning manner, the reset The transform coefficient block of the above-mentioned block to be coded is scanned.
上述装置的方案只需要在水平和竖直的扫描顺序与 Z形扫描顺序间做选 择, 是二选一的选择, 相比于在水平、 竖直以及 Z形扫描顺序(zig-zag )之间 的三选一的选择可以少使用一位来携带选择的信息, 因此在将其编入编码头 信息时, 会节省资源; 另外, 在选择的时候效率也更高。 一种变换系数块的扫描方法, 本实施例方案可以在编码端执行, 如图 10 所示, 包括:  The solution of the above device only needs to choose between the horizontal and vertical scanning order and the zigzag scanning order, which is an alternative to the selection of horizontal, vertical and zigzag scanning sequences (zig-zag). The choice of three choices can use one less to carry the selected information, so it saves resources when it is coded into the encoding header information; in addition, it is more efficient when it is selected. A scanning method of a transform coefficient block, which can be executed on the encoding end, as shown in FIG. 10, and includes:
1001 : 检测作为待编码块的参考的已编码块的纹理, 上述纹理体现了上 述待编码块的变换系数块在各方向上变换系数的变化规律;  1001: Detecting a texture of a coded block that is a reference of a block to be coded, where the texture reflects a variation rule of a transform coefficient block of the block to be coded in each of the transform coefficients;
上述 1001属于一种物理推导, 作为参考的已编码的纹理近似于当前的待 编码块的纹理, 而待编码的纹理又近似于待编码的残差纹理, 变换系数的分 布规律与残差纹理密切相关。 更具体地, 上述纹理包括水平纹理、 竖直纹理 和斜纹理; 其中斜纹理也可以看作是无纹理。  The above 1001 belongs to a physical derivation. The referenced encoded texture approximates the texture of the current block to be encoded, and the texture to be encoded is similar to the residual texture to be encoded. The distribution law of the transform coefficients is closely related to the residual texture. Related. More specifically, the above texture includes a horizontal texture, a vertical texture, and a diagonal texture; wherein the oblique texture can also be regarded as no texture.
更具体地, 上述检测已解码块的纹理包括:  More specifically, the detecting the texture of the decoded block includes:
在执行帧间解码时, 计算变换系数块的水平方向上的水平梯度值和竖直 方向上的竖直梯度值; 水平梯度值为水平方向上各相邻像素点的差值的绝对 值的和, 竖直梯度值为竖直方向上各相邻像素点的差值的绝对值的和; 上述 作为参考的变换系数块即为上述已解码块的变化系数块;  When inter-frame decoding is performed, a horizontal gradient value in a horizontal direction of the transform coefficient block and a vertical gradient value in a vertical direction are calculated; the horizontal gradient value is a sum of absolute values of difference values of adjacent pixel points in the horizontal direction The vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction; the transform coefficient block as a reference is the coefficient of variation block of the decoded block;
若水平梯度值大于 N倍的竖直梯度值则确定纹理为竖直纹理,竖直梯度值 大于 N倍的水平梯度值则确定纹理为水平纹理, 否则确定纹理为斜纹理; 上述 N为第一预置值, N可以由分辨率宽度来确定, 例如分辨率宽度大于 1000时 N=2, 分辨率宽度小于 1000时 N=1.5; 以上 N的取值可以根据经验来确定, 具 体的取值本发明实施例对此不予限定。  If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; The preset value, N, can be determined by the resolution width. For example, when the resolution width is greater than 1000, N=2, and when the resolution width is less than 1000, N=1.5; the value of N above can be determined according to experience, and the specific value is The embodiment of the invention is not limited thereto.
在执行帧内解码时,若帧内预测模式方向的竖直方向的偏移量在 M以内则 确定纹理为竖直纹理,帧内预测模式方向的水平方向的偏移量在 M以内则确定 纹理为水平纹理, 否则确定纹理为斜纹理; 上述 M为第二预置值, M也可以由 分辨率宽度来确定, 例如设置成 5, 还可以设置成其他值例如 3、 4等, 对此本 发明实施例不予限定。 When intra-frame decoding is performed, if the offset of the vertical direction of the intra prediction mode direction is within M, the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is determined within M. The texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the above M is the second preset value, and M can also be determined by the resolution width, for example, set to 5, and can also be set to other values such as 3, 4, etc. The embodiment of the invention is not limited.
进一步地, 本发明实施例还提供了修正预置值的实现方式: 若已经解码 的块中, 水平纹理与竖直纹理的比值超过第三预置值则缩小 N的值, 若水平纹 理与竖直纹理的比值小于 N,则增大 N的值。第三预置值可以由以下方式得到, 通过对不同特点的变换系数的序列进行帧内编码, 统计水平、 竖直预测方向 的比例关系, 该比例关系即可以作为第三预置值。  Further, the embodiment of the present invention further provides an implementation manner of modifying the preset value: if the ratio of the horizontal texture to the vertical texture exceeds the third preset value in the block that has been decoded, the value of N is reduced, if the horizontal texture and the vertical If the ratio of the straight texture is less than N, the value of N is increased. The third preset value may be obtained by performing intra-frame coding on a sequence of transform coefficients of different characteristics, and calculating a proportional relationship between the horizontal and vertical prediction directions, and the proportional relationship may be used as the third preset value.
可选地, 若存在已编码块或解码块, 那么已经编码块或解码块的纹理则 是已知的, 此时可以利用这些信息减少运算量; 上述检测变换系数块的纹理 包括: 检测待解码块设定时域或空域距离内已经编码块或解码块的纹理, 将 检测到的纹理确定为变换系数块的纹理。  Optionally, if there is an encoded block or a decoded block, the texture of the already encoded block or the decoded block is known, and the information may be used to reduce the amount of operations; the texture of the detected transform coefficient block includes: detecting to be decoded The block sets the texture of the block or decoded block within the time domain or spatial domain distance, and determines the detected texture as the texture of the transform coefficient block.
1002: 若所述纹理所对应的扫描顺序与预定规则的扫描顺序不一致, 则 对待编码块的残差数据块重置, 使其所对应的变换系数块为按预定规则扫描 的变换系数块;  1002: If the scan order corresponding to the texture is inconsistent with the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the corresponding transform coefficient block is a transform coefficient block scanned according to a predetermined rule;
上述纹理对应的扫描顺序包括如图 2A〜图 2C所示的: 竖直纹理对应逐行 扫描的水平扫描顺序、 水平纹理对应逐列扫描的竖直扫描顺序、 斜纹理对应 Z 形顺序扫描的 Z形扫描顺序。 图 2A〜图 2C中以 4X4矩阵为例, 其中圓形代表变 换系数, 圓形下的数值表示变换系数其所在的坐标(即位置), 箭头方向表示 扫描方向, 即扫描顺序。 需要说明的是图 2C左边和矩阵和右边的矩阵分别代 表一种 Z形扫描顺序, Z形扫描顺序是可以自定义的, 所以可能的种类较多, 图 2C的举例也不是穷举; 因此本发明实施例对 Z形扫描顺序不予限定。  The scanning order corresponding to the above texture includes as shown in FIG. 2A to FIG. 2C: the vertical texture corresponds to the horizontal scanning order of the progressive scanning, the horizontal texture corresponds to the vertical scanning order of the column-by-column scanning, and the oblique texture corresponds to the Z-shaped sequential scanning Z. Shape scan order. In Fig. 2A to Fig. 2C, a 4X4 matrix is taken as an example, in which a circle represents a transformation coefficient, a numerical value under a circle represents a coordinate (i.e., a position) at which a transformation coefficient is located, and an arrow direction represents a scanning direction, that is, a scanning order. It should be noted that the matrix on the left side of FIG. 2C and the matrix on the right side respectively represent a Z-shaped scanning order, and the Z-shaped scanning order is self-definable, so there are many possible types, and the example of FIG. 2C is not exhaustive; The Z-shaped scanning sequence is not limited in the embodiment of the invention.
1003: 对预置的 Z形扫描顺序和预定规则的扫描顺序进行率失真优选处理 得到优选扫描顺序;  1003: performing rate distortion optimization processing on a preset Z-scan sequence and a predetermined rule scan order to obtain a preferred scan order;
更具体地, 上述 1003中, 若所述纹理所对应的扫描顺序与预定规则的扫 描顺序不一致, 则对待编码块的残差数据块重置, 使其所对应的变换系数块 为按预定规则扫描的变换系数块; 按照预定规则的扫描顺序对所述待编码块 的变换系数块进行扫描包括:  More specifically, in the above 1003, if the scan order corresponding to the texture does not match the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the corresponding transform coefficient block is scanned according to a predetermined rule. Transforming coefficient blocks; scanning the transform coefficient blocks of the block to be encoded according to a scanning order of a predetermined rule includes:
若优选的扫描顺序为第一扫描顺序, 则将待编码块的残差数据块转置, 按照第二扫描顺序对转置后的上述待编码块的变换系数块进行扫描; 上述第 一扫描顺序与第二扫描顺序的扫描顺序是对称的; If the preferred scanning order is the first scanning order, the residual data block of the block to be encoded is transposed, Performing scanning on the transformed coefficient block of the transposed block to be encoded according to the second scanning sequence; the scanning order of the first scanning sequence and the second scanning sequence is symmetric;
若优选的扫描顺序为第二扫描顺序, 则按照第二扫描顺序对上述待编码 块的变换系数块进行扫描。  If the preferred scanning order is the second scanning order, the transform coefficient blocks of the block to be encoded are scanned in the second scanning order.
需要说明的是, 以上 "第一" 和 "第二" 用于区分两个具有对称关系的 扫描顺序, 不作其它限定, 例如: 水平扫描顺序和竖直扫描顺序之间就是两 个具有对称关系的扫描顺序, 若第一扫描顺序为水平扫描顺序则第二扫描顺 序为竖直扫描顺序, 若第一扫描顺序为竖直扫描顺序则第二扫描顺序为水平 扫描顺序。  It should be noted that the above "first" and "second" are used to distinguish two scanning sequences having a symmetric relationship, and are not otherwise limited. For example: between the horizontal scanning order and the vertical scanning order, there are two symmetric relationships. Scanning order, if the first scanning order is a horizontal scanning order, the second scanning order is a vertical scanning order, and if the first scanning order is a vertical scanning order, the second scanning order is a horizontal scanning order.
更具体地, 上述 1003中, 将待编码块的残差数据块, 使其对应的变换系 数块为按预定规则的扫描顺序扫描的变换系数块; 按照上述预定规则的扫描 顺序对上述待编码块的变换系数块进行扫描包括: 则将待编码块的残差数据 块, 使其对应的变换系数块为按预定规则的扫描顺序扫描的变换系数块; 按 照预定规则的扫描顺序对上述待编码块的变换系数块进行扫描。 若采用本方 法可以不用传递 1005中的指示信息, 后续实施例将详细说明。  More specifically, in the above 1003, the residual data block of the block to be coded is such that the corresponding transform coefficient block is a transform coefficient block scanned in a scan order of a predetermined rule; the block to be coded according to the scan order of the predetermined rule Transmitting the transform coefficient block includes: then, the residual data block of the block to be coded is such that the corresponding transform coefficient block is a transform coefficient block scanned in a scan order of a predetermined rule; the block to be coded according to a scan order of a predetermined rule The transform coefficient block is scanned. If the method is used, the indication information in 1005 may not be transmitted, and the subsequent embodiments will be described in detail.
1004: 按照优选扫描顺序对所述待编码块的变换系数块进行扫描; 1004: Scan a transform coefficient block of the to-be-coded block according to a preferred scan order;
1005: 将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入码 流。 1005: The indication that the scan order used for scanning is the Z-scan order is programmed into the code stream.
以上实施方式, 只需要在预定的扫描顺序与 Z形扫描顺序间做选择, 是二 选一的选择, 相比于在三选一的选择可以少使用一位来携带选择的信息, 因 此在将其编入编码头信息时, 会节省资源; 另外, 在选择的时候效率也更高。 另外通过对变换系数矩阵转置的方式, 复用相同的熵编码模型可以提高编码 效率。  In the above embodiment, only the selection between the predetermined scanning order and the Z-shaped scanning order is required, and the selection is one of the alternatives, and the selected information can be used less than one in the selection of the three-choice one, so When it is programmed into the encoding header information, it saves resources; in addition, it is more efficient when it is selected. In addition, by multiplexing the transform coefficient matrix, multiplexing the same entropy coding model can improve the coding efficiency.
更具体地, 本实施例还提供了预置候选扫描顺序的实现方式的举例, 上 述预置候选扫描顺序包括:  More specifically, the embodiment further provides an example of an implementation manner of a preset candidate scan sequence, where the preset candidate scan sequence includes:
预先定义的扫描规则, 扫描规则确定了扫描的顺序; 或者, 预先统计两 个或两个以上的变换系数块各位置的变换系数为非零的次数, 按从大到小的 顺序排列各个非零次数对应的变换系数的位置, 将排列得到的上述变换系数 的位置的顺序确定为预置的候选扫描顺序。 在以上的预置候选扫描方式的举例的后一种实现方式本发明实施例给出 了一个举例说明: 在编码器中, 依据残差块的纹理, 量化残差可以分为三类: 水平纹理对应的量化残差、 竖直纹理对应的量化残差、 斜纹理对应的量化残 差; 确定扫描顺序的方式为: 建立与变换系数个数相同的计数器组(例如 4x4 变换则为 16个计数器), 然后用计数器进行计数, 具体为: 判断各个变换系数 上是否为零, 如果非零, 则对应位置的计数器加一; 检测的变换系数块的数 量达到设定的数量以后, 各个计数器均有其计数的数值; 此时可以从大到小 排列各个计数器的值, 将排列得到的上述变换系数的位置的顺序确定为预置 的候选扫描顺序。 使用该方法, 按照得到的顺序进行扫描时, 数值大的计数 器其所对应的变换系数位置会在扫描顺序中排在前面。 a predefined scan rule, the scan rule determines the order of the scan; or, pre-statistically counts the number of transform coefficients of each position of two or more transform coefficient blocks to be non-zero, and arranges each non-zero in descending order The position of the transform coefficient corresponding to the number of times determines the order of the positions of the above-described transform coefficients obtained as the preset candidate scan order. The latter implementation example of the above preset candidate scanning mode provides an example in the embodiment of the present invention: In the encoder, according to the texture of the residual block, the quantized residuals can be classified into three categories: horizontal texture The corresponding quantized residual, the quantized residual corresponding to the vertical texture, and the quantized residual corresponding to the oblique texture; the manner of determining the scanning order is: establishing a counter group with the same number of transform coefficients (for example, 16 counters for 4x4 transform) And then counting with a counter, specifically: determining whether each transform coefficient is zero, if non-zero, the corresponding position counter is incremented by one; after the detected number of transform coefficient blocks reaches a set number, each counter has its The value of the count; at this time, the values of the respective counters can be arranged from large to small, and the order of the positions of the above-described transform coefficients obtained by the arrangement can be determined as a preset candidate scan order. With this method, when scanning in the order obtained, the position of the transform coefficient corresponding to the counter with a large value will be ranked first in the scan order.
举例方案一、 以下对编码过程中的扫描环节进行具体说明:  Example 1: The following describes the scanning process in the encoding process:
A: 按照编码流程编码, 直到进行变换系数编码之前;  A: code according to the encoding process until the transform coefficient is encoded;
B: 若执行的是帧间编码(Inter ), 则对参考块纹理进行检测, 得到其纹 理(水平 Hor纹理、 竖直 ver纹理、 斜纹理); 若在执行的是帧内编码( Intra ) 的情况, 如果帧内预测模式( intra prediction mode, ipmode )的方向为 ver+/-5 , 其纹理为竖直纹理, 方向为 Hor+/-5 , 其纹理为水平纹理, 其余情况为斜纹理。 本实施例中设置的偏移量是 5 , 当然还可以设置成其他值, 对此本发明实施例 不予限定。 根据得到的纹理从预置的候选扫描顺序中选择与上述纹理对应的 扫描顺序。  B: If inter-frame coding (Inter) is performed, the reference block texture is detected to obtain its texture (horizonous Hor texture, vertical ver texture, oblique texture); if intra-frame coding (Intra) is performed In the case, if the direction of the intra prediction mode (ipmode) is ver +/- 5, the texture is a vertical texture with a direction of Hor +/- 5, the texture is a horizontal texture, and the rest is a diagonal texture. The offset set in this embodiment is 5, and may of course be set to other values, which is not limited in this embodiment of the present invention. A scan order corresponding to the above texture is selected from the preset candidate scan order based on the obtained texture.
上述 B中的检测方法可以是:  The detection method in the above B can be:
B 1: 确定检测步长。 该步骤为不同变换单元( Transform Unit , TU )设置 不同的检测步长, 例如 TU = 4时, 步长为 1 , TU = 8时, 步长为 1 , TU = 16 时, 步长为 2, TU = 32时, 步长为 4, 也可以所有大小的 TU对应步长均为 1 ;  B 1: Determine the detection step size. This step sets different detection steps for different Transform Units (TUs). For example, when TU = 4, the step size is 1, when TU = 8, the step size is 1, and when TU = 16, the step size is 2. When TU = 32, the step size is 4, and the TUs of all sizes can be 1 step;
B2: 对参考块(即作为参考的变换系数块) 中, 水平方向相邻检测步长 的每两个像素点求差值; 累加差值的绝对值得到水平梯度值; B2: for a reference block (ie, a transform coefficient block as a reference), a difference is obtained for every two pixel points of the adjacent detection step in the horizontal direction; an absolute value of the accumulated difference value is obtained as a horizontal gradient value;
B3 : 对参考块中, 竖直方向相邻检测步长的每两个像素点求差值; 累加 差值的绝对值得到竖直梯度值;  B3: for each two pixel points of the adjacent detection step in the vertical direction, the difference is obtained; and the absolute value of the accumulated difference value is obtained as a vertical gradient value;
B4: 如果水平梯度值大于 N倍的竖直梯度值, 则确定其纹理为竖直纹理; 如果竖直梯度值大于 N倍的水平梯度值, 则确定其纹理为水平纹理; 其它情况 为斜纹理; B4之后, 还可以进一步地根据已编码块中的水平、 竖直、 斜纹理 比例分布, 判断阈值 N是否需要更新, 判断方式是判断水平梯度值与竖直梯度 值的比例是否超过预置值, 若是, 则增大预置值, 否, 则缩小预置值。 (其中 预置值由以下方式得到, 通过对不同特点的变换系数的序列进行帧内编码, 统计水平、 竖直预测方向的比例关系, 该比例关系即可以作为预置值。 步骤 C 是对预置值的一个自动修正的过程, 该过程并不是必须执行的步骤。 B4: if the horizontal gradient value is greater than N times the vertical gradient value, it is determined that the texture is a vertical texture; If the vertical gradient value is greater than N times the horizontal gradient value, the texture is determined to be a horizontal texture; the other case is a diagonal texture; after B4, the horizontal, vertical, and oblique texture ratio distribution in the coded block may be further determined. It is judged whether the threshold value N needs to be updated, and the determination mode is to determine whether the ratio of the horizontal gradient value to the vertical gradient value exceeds a preset value, and if so, the preset value is increased, otherwise, the preset value is reduced. (The preset value is obtained by the following method: by intra-coding the sequence of transform coefficients with different characteristics, and the proportional relationship between the statistical level and the vertical prediction direction, the proportional relationship can be used as the preset value. Step C is the pre-predetermined value An automatic correction process for setting, which is not a step that must be performed.
另外, 对于以上编码过程中的步骤 B检测的方法可以有替代的方案: 检测 待解码块设定时域或空域的距离内已经编码块或解码块的纹理, 将检测到的 纹理确定为作为待解码块的变换系数块的纹理。 更具体地, 例如将检测待解 码块周边(上、 左、 左上、 右上、 左下) 的已解码块的纹理作为当前待解码 块变换系数块的纹理。  In addition, there may be an alternative to the method of step B detection in the above encoding process: detecting the texture of the already encoded block or the decoded block within the distance of the time domain or the spatial domain to be decoded, and determining the detected texture as the waiting The texture of the transform coefficient block of the decoded block. More specifically, for example, the texture of the decoded block of the periphery of the block to be decoded (upper, left, upper left, upper right, lower left) is detected as the texture of the block of the current transform block to be decoded.
C: 如果所述纹理对应的扫描顺序为竖直, 则将变换系数转置; 如果所述 纹理对应的扫描顺序为水平, 继续;  C: if the scan order corresponding to the texture is vertical, transpose the transform coefficient; if the scan order corresponding to the texture is horizontal, continue;
D: 对预置的 Z形扫描顺序和预定规则的扫描顺序进行率失真优选处理得 到优选扫描顺序;  D: performing rate distortion on the preset zigzag scanning order and the scanning order of the predetermined rule is preferably processed to obtain a preferred scanning order;
E: 按照优选的扫描顺序及相关熵编码模型对待扫描的变换系数块进行编 码、 扫描, 然后继续后续的编码过程;  E: encoding, scanning, and then continuing the subsequent encoding process according to the preferred scanning order and the associated entropy coding model;
F: 将上述进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入 码流。 本步骤可以在步骤 E执行过程中进行。 可以理解的是, 编码完成后会将 编码的结果(码流)发送给解码端, 对此本发明实施例其他位置不——说明。  F: The above-mentioned scan sequence used for scanning is programmed into the code stream for the indication of the Z-scan order. This step can be performed during the execution of step E. It can be understood that, after the encoding is completed, the encoded result (code stream) is sent to the decoding end, and other positions of the embodiment of the present invention are not described.
对应的, 本发明实施例还提供了在解码端执行的一种变换系数块的扫描 方法, 如图 11所示, 包括:  Correspondingly, the embodiment of the present invention further provides a scanning method of a transform coefficient block performed on the decoding end. As shown in FIG. 11, the method includes:
1301 : 解析码流得到指示信息;  1301: parsing the code stream to obtain indication information;
1302: 按照解析的扫描顺序对待解码块的变换系数块进行扫描、 反变换; 1303: 若码流的指示信息指示扫描顺序不是 Z形扫描, 则检测作为所述待 解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数 块在各方向上变换系数的变化规律; 本实施例中上述纹理对应的扫描顺序包 含 Z形扫描顺序以外的其它扫描顺序; 1304: 若所述纹理所对应的扫描顺序与所述预定规则的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定规则的扫描顺序将 待解码块的残差数据块重置, 使其所对应的变换系数块为可按照预定规则的 扫描顺序扫描的变换系数块。 可以理解的是, 本实施例与编码端对应的, 那 么上述待解码块的残差数据块曾经经过编码端按照上述预定规则重置过。 1302: Scan and inverse transform the transform coefficient block of the decoded block according to the parsed scan order; 1303: if the indication information of the code stream indicates that the scan order is not a zigzag scan, detecting the decoded block that is a reference of the block to be decoded a texture, the texture embodies a variation rule of the transform coefficient block of the block to be decoded in each of the transform coefficients; in this embodiment, the scan sequence corresponding to the texture includes a scan order other than the Z-scan sequence; 1304: If the scan order corresponding to the texture is different from the scan order of the predetermined rule, the residual data block of the block to be decoded is obtained according to the scan order corresponding to the texture and the scan order of the predetermined rule after the end of the inverse transform Reset, such that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule. It can be understood that, in this embodiment, the residual data block of the to-be-decoded block is reset by the encoding end according to the foregoing predetermined rule.
更具体地, 上述按照预定规则的扫描顺序对待解码块的变换系数块进行 扫描; 若所述纹理所对应的扫描顺序与所述预定规则的扫描顺序不同, 则在 反变换结束后根据所述纹理对应的扫描顺序以及预定规则的扫描顺序将待解 码块的残差数据块重置, 使其所对应的变换系数块为可按照预定规则的扫描 顺序扫描的变换系数块包括:  More specifically, the transform coefficient block of the block to be decoded is scanned according to a scan order of a predetermined rule; if the scan order corresponding to the texture is different from the scan order of the predetermined rule, according to the texture after the end of the inverse transform The corresponding scan order and the scan order of the predetermined rule reset the residual data block of the block to be decoded, so that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order according to a predetermined rule, and includes:
若选择的扫描顺序为第一扫描顺序, 按照第二扫描顺序上述待解码块的 变换系数块进行扫描; 扫描完成后将待解码块的残差数据块转置; 上述第一 扫描顺序与第二扫描顺序的扫描顺序是对称的, 第二扫描顺序为上述预定规 则的扫描顺序。  If the selected scan order is the first scan order, scan the transform coefficient block of the block to be decoded according to the second scan order; after the scan is completed, the residual data block of the block to be decoded is transposed; the first scan order and the second scan sequence The scanning order of the scanning order is symmetrical, and the second scanning order is the scanning order of the above predetermined rules.
举例方案二、 解码过程与编码过程扫描的方法类似:  Example 2: The decoding process is similar to the scanning process of the encoding process:
A: 按照解码流程解码, 直到进行变换系数解析之前;  A: Decode according to the decoding process until the transform coefficient is parsed;
B: 解析码流, 得到指示信息, 该指示信息即编码过程的步骤 H中的指示 信息;  B: parsing the code stream, and obtaining indication information, that is, the indication information in step H of the encoding process;
C:按照解析的扫描顺序及相关熵编码模型对待扫描的变换系数块进行解 析、 扫描, 反变换;  C: performing analysis, scanning, and inverse transformation on the transform coefficient block to be scanned according to the analyzed scanning order and the related entropy coding model;
D: 判断指示信息是否指示扫描顺序为 Z形扫描顺序, 如果不是 Z形扫描, 可以参考举例方案一的步骤 B, 根据得到的纹理方向。 若所述纹理所对应的扫 描顺序与所述预定规则的扫描顺序不同, 则将待解码块的残差数据块转置; D: Determine whether the indication information indicates that the scanning order is a Z-shaped scanning order. If it is not a Z-shaped scanning, refer to step B of the first scheme, according to the obtained texture direction. If the scanning order corresponding to the texture is different from the scanning order of the predetermined rule, transducing the residual data block of the block to be decoded;
E: 继续后续的解码过程。 E: Continue the subsequent decoding process.
以上举例方案一和二, 只需要在水平和竖直的扫描顺序与 Z形扫描顺序间 做选择, 是二选一的选择, 相比于在水平、 竖直以及 Z形扫描顺序 (zig-zag ) 之间的三选一的选择可以少使用一位来携带选择的信息, 因此在将其编入编 码头信息时, 会节省资源; 另外, 在选择的时候效率也更高。  The above example ones and twos only need to choose between the horizontal and vertical scanning order and the zigzag scanning order, which is the alternative of the two, one compared to the horizontal, vertical and zigzag scanning order (zig-zag) The choice between three choices can use one less to carry the selected information, so it saves resources when it is coded into the encoding header information; in addition, it is more efficient at the time of selection.
本发明实施例还给出了另一种变换系数块的扫描方法, 该方案在编码设 备中执行, 在以上两个方案的基础之上更进一步地不用传递指示信息, 可以 进一步地提高编码效率; 如图 12所示, 包括: Another embodiment of the present invention also provides a scanning method for transform coefficient blocks. In the standby implementation, the coding efficiency can be further improved without further transmitting the indication information on the basis of the above two solutions; as shown in FIG. 12, the method includes:
1401 : 检测作为待编码块的参考的已编码块的纹理, 上述纹理体现了上 述待编码块的变换系数块在各方向上变换系数的变化规律;  1401: Detecting a texture of a coded block that is a reference of a block to be coded, where the texture reflects a variation rule of a transform coefficient block of the block to be coded in each of the transform coefficients;
1402: 若所述纹理所对应的扫描顺序与预定规则的扫描顺序不一致, 则 对待编码块的残差数据块重置, 使其所对应的变换系数块为按预定规则扫描 的变换系数块;  1402: If the scan order corresponding to the texture is inconsistent with the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the corresponding transform coefficient block is a transform coefficient block scanned according to a predetermined rule;
1403: 按照预定规则的扫描顺序对所述待编码块的变换系数块进行扫描。 举例方案一、 以下对编码过程中的扫描环节进行具体说明:  1403: Scan the transform coefficient block of the block to be encoded according to a scanning order of a predetermined rule. Example 1: The following describes the scanning process in the encoding process:
以下对编码过程中的扫描环节进行具体说明:  The following describes the scanning process in the encoding process:
A: 按照编码流程编码, 直到进行变换系数编码之前;  A: code according to the encoding process until the transform coefficient is encoded;
B: 本步骤可以参考举例方案一的步骤 B, 得到纹理方向;  B: This step can refer to step B of the first example to obtain the texture direction.
C: 按照选定的扫描顺序将变换系数的位置重置为符合 Z形扫描顺序的位 置关系;  C: reset the position of the transform coefficient to the positional relationship in accordance with the Z-scan order according to the selected scan order;
D:按照 Z形扫描顺序及相关熵编码模型对待扫描的变换系数块进行编码、 扫描, 然后继续后续的编码过程。  D: Encoding and scanning the transform coefficient block to be scanned according to the Z-scan sequence and the related entropy coding model, and then continuing the subsequent encoding process.
对应的, 本发明实施例还提供了另一种变换系数块的扫描方法, 本方案 在解码设备中执行, 不用传递指示信息, 可以进一步地提高编码效率; 如图 13所示, 包括:  Correspondingly, the embodiment of the present invention further provides another method for scanning a transform coefficient block. The solution is executed in a decoding device, and the coding efficiency is further improved without transmitting the indication information. As shown in FIG. 13, the method includes:
1501 : 按照预定规则的扫描顺序对待解码块的变换系数块进行扫描; 1502: 检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现 了所述待解码块的变换系数块在各方向上变换系数的变化规律;  1501: scanning a transform coefficient block of the decoded block according to a scan order of a predetermined rule; 1502: detecting a texture of the decoded block as a reference of the block to be decoded, the texture embodying a transform coefficient block of the block to be decoded The law of the change of the coefficient of transformation in all directions;
1503 : 若所述纹理所对应的扫描顺序与所述预定规则的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定规则的扫描顺序将 待解码块的残差数据块重置, 使其所对应的变换系数块为可按照预定规则的 扫描顺序扫描的变换系数块。  1503: if a scan order corresponding to the texture is different from a scan order of the predetermined rule, after the inverse transform ends, the residual data block of the block to be decoded is determined according to a scan order corresponding to the texture and a scan order of a predetermined rule. Reset, such that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
对应的解码过程与编码过程扫描的方法类似:  The corresponding decoding process is similar to the scanning process of the encoding process:
A: 按照解码流程解码, 直到进行变换系数解析之前;  A: Decode according to the decoding process until the transform coefficient is parsed;
B:按照 Z形扫描顺序及相关熵编码模型对待扫描的变换系数块进行解析、 扫描, 反变换; B: parsing the transform coefficient block to be scanned according to the zigzag scanning order and the related entropy coding model, Scan, inverse transform
C: 本步骤可以参考举例方案一的步骤 B, 得到纹理方向; 若所述纹理所 对应的扫描顺序与所述预定规则的扫描顺序不同, 则将待解码块的残差数据 块转置  C: In this step, reference may be made to step B of the first solution to obtain a texture direction. If the scan order corresponding to the texture is different from the scan order of the predetermined rule, the residual data block of the block to be decoded is transposed.
D: 继续后续的解码过程;  D: continue the subsequent decoding process;
将纹理检测和转置操作放在反变换操作之后进行, 不会对解码的并行性 造成影响, 减小了处理时延, 提高了解码效率。  After the texture detection and transposition operations are performed after the inverse transform operation, the parallelism of the decoding is not affected, the processing delay is reduced, and the decoding efficiency is improved.
一种变换系数块的扫描装置, 如图 14所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 14, includes:
第五检测单元 1601 , 用于检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规 律;  a fifth detecting unit 1601, configured to detect a texture of the encoded block that is a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients;
第五重置单元 1602, 用于若所述纹理所对应的扫描顺序与预定规则的扫 描顺序不一致, 则对待编码块的残差数据块重置, 使其所对应的变换系数块 为按预定规则扫描的变换系数块;  The fifth reset unit 1602 is configured to: if the scan order corresponding to the texture does not match the scan order of the predetermined rule, reset the residual data block of the block to be coded, so that the corresponding transform coefficient block is according to a predetermined rule. Scanned transform coefficient block;
第五处理单元 1603 ,用于对预置的 Z形扫描顺序和预定规则的扫描顺序进 行率失真优选处理得到优选扫描顺序;  The fifth processing unit 1603 is configured to perform rate-distortion optimization processing on the preset Z-scan sequence and the scan order of the predetermined rule to obtain a preferred scan order;
第五扫描单元 1604, 用于按照优选扫描顺序对待编码块的变换系数块进 行扫描;  a fifth scanning unit 1604, configured to scan a transform coefficient block of the block to be coded according to a preferred scan order;
第五编码单元 1605 ,用于将进行扫描使用的扫描顺序是否为 Z形扫描顺序 的指示信息编入码流。  The fifth coding unit 1605 is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
一种变换系数块的扫描装置, 如图 15所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 15, includes:
第六解析单元 1701 , 用于解析码流得到指示信息;  a sixth parsing unit 1701, configured to parse the code stream to obtain indication information;
第六扫描单元 1702, 用于按照解析的扫描顺序对待解码块的变换系数块 进行扫描;  a sixth scanning unit 1702, configured to scan a transform coefficient block of the block to be decoded according to the parsed scan order;
第六检测单元 1703 , 用于若码流的指示信息指示扫描顺序不是 Z形扫描, 则检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待 解码块的变换系数块在各方向上变换系数的变化规律;  a sixth detecting unit 1703, configured to: if the indication information of the code stream indicates that the scanning order is not a zigzag scan, detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects the to-be-decoded block The variation law of the transform coefficient block in each of the transform coefficients;
第六重置单元 1704, 用于若所述纹理所对应的扫描顺序与所述预定规则 的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定 规则的扫描顺序将待解码块的残差数据块重置, 使其所对应的变换系数块为 可按照预定规则的扫描顺序扫描的变换系数块。 The sixth reset unit 1704 is configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, according to the scan order corresponding to the texture and the predetermined The regular scan order resets the residual data block of the block to be decoded so that the corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
一种变换系数块的扫描装置, 如图 16所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 16, includes:
第七检测单元 1801 , 用于检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规 律;  a seventh detecting unit 1801, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients;
第七重置单元 1802, 用于若所述纹理所对应的扫描顺序与预定规则的扫 描顺序不一致, 则对待编码块的残差数据块重置, 使其所对应的变换系数块 为按预定规则扫描的变换系数块;  The seventh reset unit 1802 is configured to: if the scan order corresponding to the texture does not match the scan order of the predetermined rule, reset the residual data block of the block to be coded, so that the corresponding transform coefficient block is according to a predetermined rule. Scanned transform coefficient block;
第七扫描单元 1803 , 用于按照预定规则的扫描顺序对待编码块的变换系 数块进行扫描;  a seventh scanning unit 1803, configured to scan a transform coefficient block of the coded block according to a scan order of a predetermined rule;
一种变换系数块的扫描装置, 如图 17所示, 包括:  A scanning device for transform coefficient blocks, as shown in FIG. 17, includes:
第八扫描单元 1901 , 用于按照预定规则的扫描顺序对待解码块的变换系 数块进行扫描;  The eighth scanning unit 1901 is configured to scan a transform coefficient block of the block to be decoded according to a scan order of a predetermined rule;
第八检测单元 1902, 用于检测作为所述待解码块的参考的已解码块的纹 理, 所述纹理体现了所述待解码块的变换系数块在各方向上变换系数的变化 规律;  An eighth detecting unit 1902, configured to detect a texture of a decoded block that is a reference of the to-be-decoded block, where the texture reflects a variation rule of a transform coefficient block of the to-be-decoded block in each of the upward transform coefficients;
第八重置单元 1903 , 用于若所述纹理所对应的扫描顺序与所述预定规则 的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定 规则的扫描顺序将待解码块的残差数据块重置, 使其所对应的变换系数块为 可按照预定规则的扫描顺序扫描的变换系数块。 本发明实施例提供的方法可以应用在数字信号处理领域中, 通过视频编 码器, 解码器实现。 视频编码器, 解码器广泛应用于各种通讯设备或电子设 备中, 例如: 媒体网关, 移动电话, 无线装置, 个人数据助理(PDA ), 手持 式或便携式计算机, GPS接收机 /导航器, 照相机, 视频播放器, 摄像机, 录 像机, 监控设备等等。 这类设备中包括处理器, 存储器, 以及传输数据的接 口 。 视频编解码器可以直接由数字电路或芯片例如 DSP ( digital signal processor )实现,或者由软件代码驱动一处理器执行软件代码中的流程而实现。 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件完成, 上述的程序可以存储于一种计算机 可读存储介质中, 上述提到的存储介质可以是只读存储器, 磁盘或光盘等。 The eighth reset unit 1903 is configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the inverse transform ends, according to the scan order corresponding to the texture and the scan order of the predetermined rule The residual data block of the decoded block is reset such that its corresponding transform coefficient block is a transform coefficient block that can be scanned in a scan order of a predetermined rule. The method provided by the embodiment of the present invention can be applied to the field of digital signal processing, and is implemented by a video encoder and a decoder. Video encoders, decoders are widely used in a variety of communication devices or electronic devices, such as: media gateways, mobile phones, wireless devices, personal data assistants (PDAs), handheld or portable computers, GPS receivers/navigators, cameras , video players, camcorders, video recorders, surveillance equipment, and more. Such devices include processors, memory, and interfaces for transmitting data. The video codec can be implemented directly by a digital circuit or chip such as a DSP (digital signal processor) or by a software code that drives a processor to execute the flow in the software code. A person skilled in the art can understand that all or part of the steps of implementing the above embodiments can be completed by a program to instruct related hardware, and the above program can be stored in a computer readable storage medium, the above mentioned storage medium. It can be a read-only memory, a disk or a disc, and the like.
以上对本发明实施例所提供的一种变换系数块的扫描方法、 装置和*** 阐述, 以上实施例的说明只是用于帮助理解本发明的方法及其核心思想; 同 时, 对于本领域的一般技术人员, 依据本发明的思想, 在具体实施方式及应 用范围上均会有改变之处, 综上, 本说明书内容不应理解为对本发明的限制。  The foregoing description of the scanning method, apparatus and system for a transform coefficient block provided by the embodiment of the present invention is merely for facilitating understanding of the method and core idea of the present invention. Meanwhile, for those skilled in the art. The present invention is not limited by the scope of the present invention.

Claims

权利 要求 书 Claim
1、 一种变换系数块的扫描方法, 其特征在于, 包括:  A scanning method for a transform coefficient block, comprising:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序;  Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence;
对 Z形扫描顺序和选择的扫描顺序进行率失真优选处理得到优选扫描顺 序;  The rate distortion is preferably processed for the Z-scan sequence and the selected scan order to obtain a preferred scan order;
若优选的扫描顺序为 Z形扫描顺序则按照优选扫描顺序对所述待编码块 的变换系数块进行扫描;  If the preferred scanning order is a Z-shaped scanning order, the transform coefficient block of the block to be encoded is scanned according to a preferred scanning order;
若所述优选扫描顺序为 Z形扫描顺序以外的其它扫描顺序, 则将待编码块 的变换系数块重置为按预定规则的扫描顺序扫描的变换系数块; 按照所述预 定规则的扫描顺序对重置后的所述待编码块的变换系数块进行扫描;  If the preferred scan order is a scan order other than the Z-scan sequence, the transform coefficient block of the block to be encoded is reset to a transform coefficient block scanned in a scan order of a predetermined rule; Transmitting a block of transform coefficients of the block to be encoded after the reset;
将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入码流。 The indication information for whether the scanning order used for scanning is the Z-shaped scanning order is encoded into the code stream.
2、 根据权利要求 1所述方法, 其特征在于, 所述若所述优选扫描顺序为 Z 形扫描顺序以外的其它扫描顺序, 则将待编码块的变换系数块重置为按预定 规则的扫描顺序扫描的变换系数块; 按照所述预定规则的扫描顺序对重置后 的所述待编码块的变换系数块进行扫描包括: 2. The method according to claim 1, wherein if the preferred scanning order is a scanning order other than a zigzag scanning order, the transform coefficient block of the block to be encoded is reset to a scan according to a predetermined rule. And sequentially scanning the transform coefficient block; scanning the transformed transform coefficient block of the to-be-coded block according to the scan order of the predetermined rule includes:
若优选的扫描顺序为第一扫描顺序, 则将待编码块的变换系数转置, 按 照第二扫描顺序对转置后的所述待编码块的变换系数块进行扫描; 所述第一 扫描顺序与第二扫描顺序的扫描顺序是对称的;  If the preferred scan order is the first scan order, the transform coefficients of the block to be coded are transposed, and the transform coefficient blocks of the transposed block to be coded are scanned according to the second scan order; The scanning order with the second scanning order is symmetrical;
若优选的扫描顺序为第二扫描顺序, 则按照第二扫描顺序对所述待编码 块的变换系数块进行扫描。 — If the preferred scanning order is the second scanning order, the transform coefficient blocks of the block to be encoded are scanned in the second scanning order. -
3、根据权利要求 1或 2所述方法, 其特征在于,检测已编码块的纹理包括: 在执行帧间编码时, 计算已编码块的水平方向上的水平梯度值和竖直方 向上的竖直梯度值; 水平梯度值为水平方向上各相邻像素点的差值的绝对值 的和, 竖直梯度值为竖直方向上各相邻像素点的差值的绝对值的和; The method according to claim 1 or 2, wherein detecting the texture of the encoded block comprises: calculating horizontal gradient values in the horizontal direction of the encoded block and vertical in the vertical direction when inter-coding is performed a straight gradient value; a horizontal gradient value is a sum of absolute values of differences of adjacent pixels in the horizontal direction, and a vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction;
若水平梯度值大于 N倍的竖直梯度值则确定纹理为竖直纹理,竖直梯度值 大于 N倍的水平梯度值则确定纹理为水平纹理, 否则确定纹理为斜纹理; 所述 N为第一预置值; If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; N is the first preset value;
在执行帧内编码时,若帧内预测模式方向的竖直方向的偏移量在 M以内则 确定纹理为竖直纹理,帧内预测模式方向的水平方向的偏移量在 M以内则确定 纹理为水平纹理, 否则确定纹理为斜纹理; 所述 M为第二预置值。  When performing intra coding, if the offset of the vertical direction of the intra prediction mode direction is within M, the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is within M, the texture is determined. Is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the M is a second preset value.
4、 一种变换系数块的扫描方法, 其特征在于, 包括:  4. A scanning method for a transform coefficient block, comprising:
解析码流得到指示信息,若接收到的码流的指示信息指示扫描顺序不是 Z 形扫描顺序, 则检测作为所述待解码块的参考的已解码块的纹理, 所述纹理 体现了所述待解码块的变换系数块在各方向上变换系数的变化规律;  Parsing the code stream to obtain indication information, if the indication information of the received code stream indicates that the scanning order is not a zigzag scanning order, detecting a texture of the decoded block as a reference of the to-be-decoded block, the texture embodies the waiting The variation law of the transform coefficient block of the decoding block in the transform coefficients of the respective parties;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序;  Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence;
按照预定规则的扫描顺序对待解码块的变换系数块进行扫描;  Scanning the transform coefficient block of the decoded block according to the scanning order of the predetermined rule;
若选择的扫描顺序与所述预定规则的扫描顺序不同, 则在扫描结束后根 据所述选择的扫描顺序以及预定规则的扫描顺序将待解码块的变换系数块重 置为可按照选择的扫描顺序扫描的变换系数块。  If the selected scan order is different from the scan order of the predetermined rule, the transform coefficient block of the block to be decoded is reset to be selectable according to the selected scan order according to the selected scan order and the scan order of the predetermined rule. Scanned transform coefficient block.
5、 根据权利要求 4所述方法, 其特征在于, 所述按照预定规则的扫描顺 序对待解码块的变换系数块进行扫描; 若选择的扫描顺序与所述预定规则的 扫描顺序不同, 则在扫描结束后根据所述选择的扫描顺序以及预定规则的扫 描顺序将待解码块的变换系数块重置为可按照选择的扫描顺序扫描的变换系 数块包括:  The method according to claim 4, wherein the transform coefficient block of the block to be decoded is scanned according to a scan order of a predetermined rule; if the selected scan order is different from the scan order of the predetermined rule, then scanning After the end, the transform coefficient block of the block to be decoded is reset to the transform coefficient block that can be scanned according to the selected scan order according to the selected scan order and the scan order of the predetermined rule, including:
若选择的扫描顺序为第一扫描顺序, 按照第二扫描顺序对所述待解码块 的变换系数块进行扫描; 扫描完成后将待解码块的变换系数转置; 所述第一 扫描顺序与第二扫描顺序的扫描顺序是对称的, 第二扫描顺序为所述预定规 则的扫描顺序。  If the selected scan order is the first scan order, the transform coefficient block of the block to be decoded is scanned according to the second scan order; after the scan is completed, the transform coefficients of the block to be decoded are transposed; the first scan order and the first scan order The scanning order of the two scanning sequences is symmetrical, and the second scanning order is the scanning order of the predetermined rules.
6、 根据权利要求 4或 5所述方法, 其特征在于, 检测已解码的纹理包括: 在执行帧间解码时, 计算已解码块的水平方向上的水平梯度值和竖直方 向上的竖直梯度值; 水平梯度值为水平方向上各相邻像素点的差值的绝对值 的和, 竖直梯度值为竖直方向上各相邻像素点的差值的绝对值的和;  6. The method according to claim 4 or 5, wherein detecting the decoded texture comprises: calculating a horizontal gradient value in a horizontal direction and a vertical direction in a vertical direction of the decoded block when inter-frame decoding is performed a gradient value; a horizontal gradient value is a sum of absolute values of difference values of adjacent pixel points in a horizontal direction, and a vertical gradient value is a sum of absolute values of difference values of adjacent pixel points in a vertical direction;
若水平梯度值大于 N倍的竖直梯度值则确定纹理为竖直纹理,竖直梯度值 大于 N倍的水平梯度值则确定纹理为水平纹理, 否则确定纹理为斜纹理; 所述 N为第一预置值; If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; N is the first preset value;
在执行帧内解码时,若帧内预测模式方向的竖直方向的偏移量在 M以内则 确定纹理为竖直纹理,帧内预测模式方向的水平方向的偏移量在 M以内则确定 纹理为水平纹理, 否则确定纹理为斜纹理; 所述 M为第二预置值。  When intra-frame decoding is performed, if the offset of the vertical direction of the intra prediction mode direction is within M, the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is within M, the texture is determined. Is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the M is a second preset value.
7、 一种变换系数块的扫描方法, 其特征在于, 包括:  7. A scanning method for a transform coefficient block, comprising:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的其它扫描顺序;  Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描顺序对所述待编码块 的变换系数块进行扫描; 若选择的扫描顺序为 Z形扫描顺序以外的其它扫描顺 序, 则将待编码块的变换系数块重置为符合 Z形扫描顺序的变换系数块; 按照 Z形扫描顺序对重置后的所述待编码块的变换系数块进行扫描。  If the selected scanning order is a zigzag scanning order, the transform coefficient blocks of the block to be encoded are scanned in a zigzag scanning order; if the selected scanning order is a scanning order other than the zigzag scanning order, the coding sequence is to be encoded The transform coefficient block of the block is reset to a transform coefficient block conforming to the zigzag scan order; the transform coefficient block of the reset block to be encoded is scanned in a zigzag scan order.
8、 一种变换系数块的扫描方法, 其特征在于, 包括:  8. A scanning method for a transform coefficient block, comprising:
检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述 待解码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
从预置的候选扫描顺序中选择与所述纹理对应的扫描顺序; 所述预置的 候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的其它扫描顺序;  Selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a Z-scan order and a scan order other than the Z-scan order;
若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描顺序对所述待解码块 的变换系数块进行扫描;  If the selected scanning order is a Z-shaped scanning order, the transform coefficient blocks of the block to be decoded are scanned according to a Z-shaped scanning order;
若选择的扫描顺序为 Z形扫描顺序以外的其它扫描方式, 则将待解码块的 变换系数块从符合 Z形扫描顺序的变换系数块重置为符合所述选择的扫描顺 序的变换系数块; 按照所述选择的扫描方式对重置后的所述待解码块的变换 系数块进行扫描。  If the selected scanning order is a scanning mode other than the Z-shaped scanning order, the transform coefficient block of the block to be decoded is reset from the transform coefficient block conforming to the Z-shaped scanning order to the transform coefficient block conforming to the selected scanning order; The transformed transform coefficient block of the block to be decoded after being scanned is scanned according to the selected scanning manner.
9、 一种变换系数块的扫描装置, 其特征在于, 包括:  9. A scanning device for transforming coefficient blocks, comprising:
第一检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第一选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序; 第一处理单元, 用于对预置的 Z形扫描顺序和选择的扫描顺序进行率失真 优选处理得到优选扫描顺序; a first detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And a method for selecting a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; a first processing unit, configured to perform rate distortion optimization processing on the preset Z-scan sequence and the selected scan order to obtain a preferred scan order;
第一重置单元, 用于若所述优选扫描顺序为 Z形扫描顺序以外的其它扫描 顺序, 则将待编码块的变换系数块重置为按预定规则的扫描顺序扫描的变换 系数块;  a first reset unit, configured to reset a transform coefficient block of the block to be encoded to a transform coefficient block scanned in a scan order of a predetermined rule, if the preferred scan order is a scan order other than a Z-scan sequence;
第一扫描单元, 用于若优选的扫描顺序为 Z形扫描顺序则按照优选扫描顺 序对待编码块的变换系数块进行扫描; 若所述优选扫描顺序为 Z形扫描顺序以 外的其它扫描顺序, 则按照所述预定规则的扫描顺序对重置后的所述待编码 块的变换系数块进行扫描;  a first scanning unit, configured to scan a transform coefficient block of the block to be coded according to a preferred scan order if the preferred scan order is a Z-scan sequence; if the preferred scan order is a scan order other than the Z-scan order, Scanning the transformed coefficient block of the block to be encoded after the reset according to the scanning order of the predetermined rule;
第一编码单元, 用于将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指 示信息编入码流。  The first coding unit is configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
10、 一种变换系数块的扫描装置, 其特征在于, 包括:  10. A scanning device for transform coefficient blocks, comprising:
第二解析单元, 用于解析码流得到指示信息;  a second parsing unit, configured to parse the code stream to obtain indication information;
第二检测单元,用于若接收到的码流的指示信息指示扫描顺序不是 Z形扫 描顺序, 则检测作为待解码块的参考的已编码或解码块的纹理, 所述纹理体 现了所述待解码块的变换系数块在各方向上变换系数的变化规律;  a second detecting unit, configured to: if the indication information of the received code stream indicates that the scanning order is not a Z-shaped scanning order, detect a texture of the encoded or decoded block that is a reference of the block to be decoded, where the texture reflects the The variation law of the transform coefficient block of the decoding block in the transform coefficients of the respective parties;
第二选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包含 Z形扫描顺序以外的其它扫描顺序; 第二扫描单元, 用于按照预定规则的扫描顺序对待解码块的变换系数块 进行扫描;  a second selecting unit, configured to select a scan order corresponding to the texture from a preset candidate scan order; the preset candidate scan order includes a scan order other than a Z-scan sequence; and the second scan unit uses Scanning the transform coefficient block of the decoded block in a scan order according to a predetermined rule;
第二重置单元, 用于若选择的扫描顺序与所述预定规则的扫描顺序不同, 则在扫描结束后根据所述选择的扫描顺序以及预定规则的扫描顺序将待解码 块的变换系数块重置为可按照选择的扫描顺序扫描的变换系数块。  a second reset unit, configured to: if the selected scan order is different from the scan order of the predetermined rule, the transform coefficient block of the block to be decoded is heavy according to the selected scan order and the scan order of the predetermined rule after the end of the scan Set to a block of transform coefficients that can be scanned in the selected scan order.
11、 一种变换系数块的扫描装置, 其特征在于, 包括:  11. A scanning device for transforming coefficient blocks, comprising:
第三检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第三选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的 其它扫描顺序; 第三重置单元, 用于若选择的扫描顺序为 Z形扫描顺序以外的其它扫描顺 序, 则将待编码块的变换系数块重置为符合 Z形扫描顺序的变换系数块; 第三扫描单元, 用于若选择的扫描顺序为 Z形扫描顺序, 则按照 Z形扫描 顺序对所述待编码块的变换系数块进行扫描; 或者, 按照 Z形扫描顺序对重置 后的所述待编码块的变换系数块进行扫描。 a third detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture embodies a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And a scan order corresponding to the texture is selected from a preset candidate scan order; the preset candidate scan order includes a zigzag scan order and other scan orders than a zigzag scan order; a third reset unit, configured to: if the selected scan order is a scan order other than the Z-scan sequence, reset the transform coefficient block of the block to be coded into a transform coefficient block conforming to the Z-scan order; And if the scanning order selected is a Z-shaped scanning order, scanning the transform coefficient block of the to-be-coded block according to a Z-shaped scanning order; or, the resetting the to-be-coded block according to a Z-shaped scanning order The transform coefficient block is scanned.
12、 一种变换系数块的扫描装置, 其特征在于, 包括:  12. A scanning device for transforming coefficient blocks, comprising:
第四检测单元, 用于检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数块在各方向上变换系数的变化规 律;  a fourth detecting unit, configured to detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
第四选择单元, 用于从预置的候选扫描顺序中选择与所述纹理对应的扫 描顺序; 所述预置的候选扫描顺序包括 Z形扫描顺序以及 Z形扫描顺序以外的 其它扫描顺序;  a fourth selecting unit, configured to select a scanning order corresponding to the texture from a preset candidate scanning order; the preset candidate scanning order includes a Z-shaped scanning order and other scanning orders other than a Z-shaped scanning order;
第四重置单元, 用于若选择的扫描顺序为 Z形扫描顺序以外的其它扫描方 式, 则将待解码块的变换系数块从符合 Z形扫描顺序的变换系数块重置为符合 所述选择的扫描顺序的变换系数块;  a fourth reset unit, configured to reset the transform coefficient block of the block to be decoded from the transform coefficient block conforming to the Z-scan order to the selection if the selected scan order is other than the Z-scan order a transform coefficient block of the scan order;
第四扫描单元, 用于若选择的扫描顺序为 z形扫描顺序, 则按照 Z形扫描 顺序对所述待解码块的变换系数块进行扫描; 或者, 按照所述选择的扫描方 式对重置后的所述待编码块的变换系数块进行扫描。  a fourth scanning unit, configured to scan a transform coefficient block of the block to be decoded according to a zigzag scan order if the selected scan order is a z-scan sequence; or, after the reset according to the selected scan mode The transform coefficient block of the block to be encoded is scanned.
13、 一种变换系数块的扫描方法, 其特征在于, 包括:  13. A scanning method for a transform coefficient block, comprising:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
若所述纹理所对应的扫描顺序与预定规则的扫描顺序不一致, 则对待编 码块的残差数据块重置, 使所述残差数据块对应的变换系数块为按预定规则 扫描的变换系数块;  If the scan order corresponding to the texture does not match the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule. ;
按照优选扫描顺序对所述待编码块的变换系数块进行扫描, 所述优选扫 描顺序为对 Z形扫描顺序和预定规则的扫描顺序进行率失真优选处理得到的 扫描顺序;  The transform coefficient blocks of the block to be encoded are scanned in a preferred scan order, and the preferred scan order is a scan order obtained by performing rate distortion optimization processing on a Z-scan sequence and a predetermined rule scan order;
将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指示信息编入码流。 The indication information for whether the scanning order used for scanning is the Z-shaped scanning order is encoded into the code stream.
14、 根据权利要求 13所述方法, 其特征在于, 所述若所述纹理所对应的 扫描顺序与预定规则的扫描顺序不一致, 则对待编码块的残差数据块重置, 使所述残差数据块对应的变换系数块为按预定规则扫描的变换系数块; 按照 优选扫描顺序对所述待编码块的变换系数块进行扫描包括: 14. The method according to claim 13, wherein: if the texture corresponds to If the scanning order is inconsistent with the scanning order of the predetermined rule, the residual data block of the coded block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule; The scanning of the transform coefficient block of the coding block is performed by:
若所述纹理所对应的扫描顺序为第一扫描顺序, 则将待编码块的残差数 据块转置, 变换后得到所述待编码块的变换系数块, 按照第二扫描顺序对转 置后的所述待编码块的变换系数块进行扫描; 所述第一扫描顺序与第二扫描 顺序的扫描顺序是对称的。  If the scan order corresponding to the texture is the first scan order, the residual data block of the block to be coded is transposed, and the transform coefficient block of the block to be coded is obtained, and the transposed block is transposed according to the second scan order. The transform coefficient block of the block to be encoded is scanned; the scan order of the first scan order and the second scan order is symmetric.
15、 根据权利要求 13或 14所述方法, 其特征在于, 检测已编码块的纹理 包括:  15. The method according to claim 13 or 14, wherein detecting the texture of the encoded block comprises:
在执行帧间编码时, 计算已编码块的水平方向上的水平梯度值和竖直方 向上的竖直梯度值; 水平梯度值为水平方向上各相邻像素点的差值的绝对值 的和, 竖直梯度值为竖直方向上各相邻像素点的差值的绝对值的和;  When inter-coding is performed, a horizontal gradient value in a horizontal direction of the encoded block and a vertical gradient value in a vertical direction are calculated; the horizontal gradient value is a sum of absolute values of differences of adjacent pixels in the horizontal direction The vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction;
若水平梯度值大于 N倍的竖直梯度值则确定纹理为竖直纹理,竖直梯度值 大于 N倍的水平梯度值则确定纹理为水平纹理, 否则确定纹理为斜纹理; 所述 N为第一预置值;或者,若水平梯度值大于竖直梯度值则确定纹理为竖直纹理, 竖直梯度值大于水平梯度值则确定纹理为水平纹理;  If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; a preset value; or, if the horizontal gradient value is greater than the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than the horizontal gradient value to determine that the texture is a horizontal texture;
在执行帧内编码时,若帧内预测模式方向的竖直方向的偏移量在 M以内则 确定纹理为竖直纹理,帧内预测模式方向的水平方向的偏移量在 M以内则确定 纹理为水平纹理, 否则确定纹理为斜纹理; 所述 M为第二预置值。  When performing intra coding, if the offset of the vertical direction of the intra prediction mode direction is within M, the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is within M, the texture is determined. Is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the M is a second preset value.
16、 一种变换系数块的扫描方法, 其特征在于, 包括:  16. A scanning method for a transform coefficient block, comprising:
解析码流得到指示信息, 码流的指示信息指示扫描顺序;  Parsing the code stream to obtain indication information, and the indication information of the code stream indicates a scanning order;
按照解析的扫描顺序对待解码块的变换系数块进行扫描;  Scanning the transform coefficient block of the decoded block according to the parsed scan order;
若码流的指示信息指示扫描顺序不是 Z形扫描, 则检测作为所述待解码块 的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数块在各 方向上变换系数的变化规律; 若所述纹理所对应的扫描顺序与所述预定规则 的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定 规则的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对应的变 换系数块为可按照预定规则的扫描顺序扫描的变换系数块。  If the indication information of the code stream indicates that the scan order is not a zigzag scan, detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects that the transform coefficient block of the block to be decoded is transformed in all directions a variation rule of the coefficient; if the scan order corresponding to the texture is different from the scan order of the predetermined rule, the block to be decoded is to be decoded according to the scan order corresponding to the texture and the scan order of the predetermined rule after the end of the inverse transform The difference data block is reset, and the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
17、 根据权利要求 16所述方法, 其特征在于, 所述按照解析的扫描顺序 对待解码块的变换系数块进行扫描; 若所述纹理所对应的扫描顺序与所述预 定规则的扫描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以 及预定规则的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对 应的变换系数块为可按照预定规则的扫描顺序扫描的变换系数块包括: 17. The method according to claim 16, wherein said scanning order according to parsing Scanning the transform coefficient block of the decoded block; if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, according to the scan order corresponding to the texture and the scan order of the predetermined rule The residual data block of the block to be decoded is reset, and the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order according to a predetermined rule, including:
若选择的扫描顺序为第一扫描顺序, 按照第二扫描顺序对所述待解码块 的变换系数块进行扫描; 反变换完成后将待解码块的残差数据转置; 所述第 一扫描顺序与第二扫描顺序的扫描顺序是对称的, 第二扫描顺序为所述预定 规则的扫描顺序。  If the selected scan order is the first scan order, the transform coefficient block of the block to be decoded is scanned according to the second scan order; after the inverse transform is completed, the residual data of the block to be decoded is transposed; the first scan sequence The scanning order with the second scanning order is symmetrical, and the second scanning order is the scanning order of the predetermined rules.
18、 根据权利要求 16或 17所述方法, 其特征在于, 检测已解码的纹理包 括:  18. The method of claim 16 or 17, wherein detecting the decoded texture comprises:
在执行帧间解码时, 计算已解码块的水平方向上的水平梯度值和竖直方 向上的竖直梯度值; 水平梯度值为水平方向上各相邻像素点的差值的绝对值 的和, 竖直梯度值为竖直方向上各相邻像素点的差值的绝对值的和;  When performing inter-frame decoding, calculating a horizontal gradient value in a horizontal direction of the decoded block and a vertical gradient value in a vertical direction; the horizontal gradient value is a sum of absolute values of difference values of adjacent pixel points in the horizontal direction The vertical gradient value is a sum of absolute values of differences of adjacent pixels in the vertical direction;
若水平梯度值大于 N倍的竖直梯度值则确定纹理为竖直纹理,竖直梯度值 大于 N倍的水平梯度值则确定纹理为水平纹理, 否则确定纹理为斜纹理; 所述 N为第一预置值;或者,若水平梯度值大于竖直梯度值则确定纹理为竖直纹理, 竖直梯度值大于水平梯度值则确定纹理为水平纹理;  If the horizontal gradient value is greater than N times the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than N times the horizontal gradient value to determine that the texture is a horizontal texture, otherwise the texture is determined to be a diagonal texture; a preset value; or, if the horizontal gradient value is greater than the vertical gradient value, the texture is determined to be a vertical texture, and the vertical gradient value is greater than the horizontal gradient value to determine that the texture is a horizontal texture;
在执行帧内解码时,若帧内预测模式方向的竖直方向的偏移量在 M以内则 确定纹理为竖直纹理,帧内预测模式方向的水平方向的偏移量在 M以内则确定 纹理为水平纹理, 否则确定纹理为斜纹理; 所述 M为第二预置值。  When intra-frame decoding is performed, if the offset of the vertical direction of the intra prediction mode direction is within M, the texture is determined to be a vertical texture, and the offset of the horizontal direction of the intra prediction mode direction is within M, the texture is determined. Is a horizontal texture, otherwise the texture is determined to be a diagonal texture; the M is a second preset value.
19、 一种变换系数块的扫描方法, 其特征在于, 包括:  19. A scanning method for a transform coefficient block, comprising:
检测作为待编码块的参考的已编码块的纹理, 所述纹理体现了所述待编 码块的变换系数块在各方向上变换系数的变化规律;  Detecting a texture of the coded block as a reference of the block to be coded, the texture embodies a variation rule of the transform coefficient block of the block to be coded in each of the transform coefficients;
若所述纹理所对应的扫描顺序与预定规则的扫描顺序不一致, 则对待编 码块的残差数据块重置, 使所述残差数据块对应的变换系数块为按预定规则 扫描的变换系数块;  If the scan order corresponding to the texture does not match the scan order of the predetermined rule, the residual data block of the block to be coded is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block scanned according to a predetermined rule. ;
按照预定规则的扫描顺序对所述待编码块的变换系数块进行扫描。  The transform coefficient blocks of the block to be encoded are scanned in accordance with a scanning order of a predetermined rule.
20、 一种变换系数块的扫描方法, 其特征在于, 包括:  20. A scanning method for a transform coefficient block, comprising:
按照预定规则的扫描顺序对待解码块的变换系数块进行扫描; 检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述 待解码块的变换系数块在各方向上变换系数的变化规律; Scanning the transform coefficient block of the decoded block according to the scanning order of the predetermined rule; Detecting a texture of the decoded block as a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
若所述纹理所对应的扫描顺序与所述预定规则的扫描顺序不同, 则在反 变换结束后根据所述纹理对应的扫描顺序以及预定规则的扫描顺序将待解码 块的残差数据块重置, 使所述残差数据块对应的变换系数块为可按照预定规 则的扫描顺序扫描的变换系数块。  If the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, the residual data block of the block to be decoded is reset according to the scan order corresponding to the texture and the scan order of the predetermined rule. And transforming the transform coefficient block corresponding to the residual data block into a transform coefficient block that can be scanned in a scan order of a predetermined rule.
21、 一种变换系数块的扫描装置, 其特征在于, 包括:  21. A scanning device for transforming coefficient blocks, comprising:
第五检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第五重置单元, 用于若所述纹理所对应的扫描顺序与预定规则的扫描顺 序不一致, 则对待编码块的残差数据块重置, 使所述残差数据块对应的变换 系数块为按预定规则扫描的变换系数块;  a fifth detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient block of the block to be encoded in each of the transform coefficients; And if the scanning order corresponding to the texture is inconsistent with the scanning order of the predetermined rule, the residual data block of the to-be-coded block is reset, so that the transform coefficient block corresponding to the residual data block is scanned according to a predetermined rule. Transform coefficient block;
第五处理单元, 用于对预置的 Z形扫描顺序和预定规则的扫描顺序进行率 失真优选处理得到优选扫描顺序;  a fifth processing unit, configured to perform a rate-distortion optimization process on the preset Z-scan sequence and the scan order of the predetermined rule to obtain a preferred scan order;
第五扫描单元, 用于按照优选扫描顺序对待编码块的变换系数块进行扫 描;  a fifth scanning unit, configured to scan a transform coefficient block of the block to be coded according to a preferred scan order;
第五编码单元, 用于将进行扫描使用的扫描顺序是否为 Z形扫描顺序的指 示信息编入码流。  And a fifth coding unit, configured to encode the indication information of whether the scanning order used for scanning is a Z-shaped scanning order into the code stream.
22、 一种变换系数块的扫描装置, 其特征在于, 包括:  22. A scanning device for transforming coefficient blocks, comprising:
第六解析单元, 用于解析码流得到指示信息;  a sixth parsing unit, configured to parse the code stream to obtain indication information;
第六扫描单元, 用于按照解析的扫描顺序对待解码块的变换系数块进行 扫描;  a sixth scanning unit, configured to scan a transform coefficient block of the block to be decoded according to the parsed scan order;
第六检测单元, 用于若码流的指示信息指示扫描顺序不是 Z形扫描, 则检 测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码 块的变换系数块在各方向上变换系数的变化规律;  a sixth detecting unit, configured to: if the indication information of the code stream indicates that the scanning order is not a zigzag scanning, detect a texture of the decoded block that is a reference of the to-be-decoded block, where the texture reflects a transformation of the to-be-decoded block The variation law of the coefficient of transformation of the coefficient block in each direction;
第六重置单元, 用于若所述纹理所对应的扫描顺序与所述预定规则的扫 描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定规则 的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对应的变换系 数块为可按照预定规则的扫描顺序扫描的变换系数块。 a sixth reset unit, configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the end of the inverse transform, the scan order corresponding to the texture and the scan order of the predetermined rule are to be decoded The residual data block of the block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
23、 一种变换系数块的扫描装置, 其特征在于, 包括: 23. A scanning device for transforming coefficient blocks, comprising:
第七检测单元, 用于检测作为待编码块的参考的已编码块的纹理, 所述 纹理体现了所述待编码块的变换系数块在各方向上变换系数的变化规律; 第七重置单元, 用于若所述纹理所对应的扫描顺序与预定规则的扫描顺 序不一致, 则对待编码块的残差数据块重置, 使所述残差数据块对应的变换 系数块为按预定规则扫描的变换系数块;  a seventh detecting unit, configured to detect a texture of the encoded block as a reference of the block to be encoded, where the texture reflects a variation rule of the transform coefficient of the block to be encoded in each of the transform coefficients; And if the scanning order corresponding to the texture is inconsistent with the scanning order of the predetermined rule, the residual data block of the to-be-coded block is reset, so that the transform coefficient block corresponding to the residual data block is scanned according to a predetermined rule. Transform coefficient block;
第七扫描单元, 用于按照预定规则的扫描顺序对待编码块的变换系数块 进行扫描。  And a seventh scanning unit, configured to scan the transform coefficient block of the coded block according to a scan order of a predetermined rule.
24、 一种变换系数块的扫描装置, 其特征在于, 包括:  24. A scanning device for transforming coefficient blocks, comprising:
第八扫描单元, 用于按照预定规则的扫描顺序对待解码块的变换系数块 进行扫描;  An eighth scanning unit, configured to scan a transform coefficient block of the block to be decoded according to a scan order of a predetermined rule;
第八检测单元, 用于检测作为所述待解码块的参考的已解码块的纹理, 所述纹理体现了所述待解码块的变换系数块在各方向上变换系数的变化规 律;  An eighth detecting unit, configured to detect a texture of a decoded block that is a reference of the block to be decoded, where the texture reflects a variation rule of a transform coefficient block of the block to be decoded in each of the transform coefficients;
第八重置单元, 用于若所述纹理所对应的扫描顺序与所述预定规则的扫 描顺序不同, 则在反变换结束后根据所述纹理对应的扫描顺序以及预定规则 的扫描顺序将待解码块的残差数据块重置, 使所述残差数据块对应的变换系 数块为可按照预定规则的扫描顺序扫描的变换系数块。  An eighth reset unit, configured to: if the scan order corresponding to the texture is different from the scan order of the predetermined rule, after the inverse transform ends, the scan order corresponding to the texture and the scan order of the predetermined rule are to be decoded The residual data block of the block is reset, so that the transform coefficient block corresponding to the residual data block is a transform coefficient block that can be scanned in a scan order of a predetermined rule.
PCT/CN2012/071432 2011-02-23 2012-02-22 Method and device for scanning transform coefficient block WO2012113328A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201110043594.0 2011-02-23
CN201110043594 2011-02-23
CN201110076616.3A CN102651816B (en) 2011-02-23 2011-03-29 Method and device for scanning transformation coefficient block
CN201110076616.3 2011-03-29

Publications (1)

Publication Number Publication Date
WO2012113328A1 true WO2012113328A1 (en) 2012-08-30

Family

ID=46693700

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/071432 WO2012113328A1 (en) 2011-02-23 2012-02-22 Method and device for scanning transform coefficient block

Country Status (2)

Country Link
CN (1) CN102651816B (en)
WO (1) WO2012113328A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110741636A (en) * 2017-12-15 2020-01-31 谷歌有限责任公司 Transform block level scan order selection for video coding

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG11201600128WA (en) 2013-07-24 2016-02-26 Microsoft Technology Licensing Llc Scanning orders for non-transform coding
CN103561274B (en) * 2013-11-19 2017-02-15 福建师范大学 Video time domain tamper detection method for removing moving object shot by static camera lens
CN104853196B (en) * 2014-02-18 2018-10-19 华为技术有限公司 Decoding method and device
WO2017131233A1 (en) * 2016-01-28 2017-08-03 日本放送協会 Encoding device, decoding device, and program
CA3014271C (en) 2016-02-12 2020-10-20 Huawei Technologies Co., Ltd. Method and apparatus for scan order selection
RU2707719C1 (en) * 2016-02-12 2019-11-28 Хуавей Текнолоджиз Ко., Лтд. Scanning order selection method and device
CN113453008B (en) * 2020-03-26 2022-08-02 腾讯科技(深圳)有限公司 Video decoding method, video encoding method, related apparatus and medium
CN114786010A (en) * 2022-03-07 2022-07-22 杭州未名信科科技有限公司 Rate distortion optimization quantization method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08256266A (en) * 1995-03-17 1996-10-01 Mitsubishi Electric Corp Image coding system
CN1585483A (en) * 2004-06-16 2005-02-23 浙江大学 Method and apparatus for scanning converting coefficient in visual or image compression
JP2007129612A (en) * 2005-11-07 2007-05-24 Nippon Telegr & Teleph Corp <Ntt> Scanning method, inverse scanning method, scanner and inverse scanner of orthogonal conversion coefficient, its program, and computer-readable recording medium recording the program
WO2009134575A2 (en) * 2008-05-02 2009-11-05 Microsoft Corporation Multi-level representation of reordered transform coefficients

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101325707B (en) * 2007-06-12 2012-04-18 浙江大学 System for encoding and decoding texture self-adaption video

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08256266A (en) * 1995-03-17 1996-10-01 Mitsubishi Electric Corp Image coding system
CN1585483A (en) * 2004-06-16 2005-02-23 浙江大学 Method and apparatus for scanning converting coefficient in visual or image compression
JP2007129612A (en) * 2005-11-07 2007-05-24 Nippon Telegr & Teleph Corp <Ntt> Scanning method, inverse scanning method, scanner and inverse scanner of orthogonal conversion coefficient, its program, and computer-readable recording medium recording the program
WO2009134575A2 (en) * 2008-05-02 2009-11-05 Microsoft Corporation Multi-level representation of reordered transform coefficients

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110741636A (en) * 2017-12-15 2020-01-31 谷歌有限责任公司 Transform block level scan order selection for video coding
CN110741636B (en) * 2017-12-15 2023-03-21 谷歌有限责任公司 Transform block level scan order selection for video coding

Also Published As

Publication number Publication date
CN102651816A (en) 2012-08-29
CN102651816B (en) 2014-09-17

Similar Documents

Publication Publication Date Title
WO2012113328A1 (en) Method and device for scanning transform coefficient block
JP6256564B2 (en) Logical intra-mode naming in HEVC video coding
RU2514777C1 (en) Method and device for image encoding and decoding using large transformation unit
JP6073405B2 (en) Video decoding method and apparatus
US10003792B2 (en) Video encoder for images
RU2504103C1 (en) Method and apparatus for encoding and decoding image using rotational transform
JP5266342B2 (en) Video intra prediction method and apparatus
RU2406255C2 (en) Forecasting conversion ratios for image compression
CN103348651A (en) Method and apparatus of transform unit partition with reduced complexity
CN105611292B (en) Video decoding apparatus and video encoding/decoding method
KR20110014839A (en) Method and apparatus for encoding video, and method and apparatus for decoding video
KR20110010324A (en) Method and apparatus for image encoding, and method and apparatus for image decoding
KR20110017302A (en) Method and apparatus for encoding/decoding image by using motion vector accuracy control
KR20120079194A (en) Video encoding/decoding method and apparatus using unit-level parallel intra prediction
WO2012094909A1 (en) Scanning method, device and system for transformation coefficient block
WO2011124163A1 (en) Method and device for encoding or decoding video data, method and device for transform processing
WO2022166370A1 (en) Video encoding and decoding method and apparatus, computer program product, computer-readable storage medium, and electronic device
CN108322743B (en) method for quickly selecting intra-frame of indistinguishable quadratic transformation mode based on mode dependence characteristics
KR101366088B1 (en) Method and apparatus for encoding and decoding based on intra prediction
JP5739714B2 (en) Encoding device, decoding device, and program
KR101489222B1 (en) Method and apparatus for image encoding, and method and apparatus for image decoding
JP5298082B2 (en) Encoding apparatus and decoding apparatus for adaptively determining scan order of orthogonal transform coefficients
WO2021211576A1 (en) Methods and systems for combined lossless and lossy coding
JP2007243859A (en) Image encoding apparatus and image encoding program

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12749748

Country of ref document: EP

Kind code of ref document: A1